View | Details | Raw Unified | Return to bug 15967
Collapse All | Expand All

(-)a/misc/cronjobs/overdue_notices.pl (-7 / +6 lines)
Lines 670-679 END_SQL Link Here
670
670
671
                my $print_sent = 0; # A print notice is not yet sent for this patron
671
                my $print_sent = 0; # A print notice is not yet sent for this patron
672
                for my $mtt ( @message_transport_types ) {
672
                for my $mtt ( @message_transport_types ) {
673
673
                    my $effective_mtt = $mtt;
674
                    if ( ($mtt eq 'email' and not scalar @emails_to_use) or ($mtt eq 'sms' and not $data->{smsalertnumber}) ) {
674
                    if ( ($mtt eq 'email' and not scalar @emails_to_use) or ($mtt eq 'sms' and not $data->{smsalertnumber}) ) {
675
                        # email or sms is requested but not exist, do a print.
675
                        # email or sms is requested but not exist, do a print.
676
                        $mtt = 'print';
676
                        $effective_mtt = 'print';
677
                    }
677
                    }
678
                    my $letter = parse_overdues_letter(
678
                    my $letter = parse_overdues_letter(
679
                        {   letter_code     => $overdue_rules->{"letter$i"},
679
                        {   letter_code     => $overdue_rules->{"letter$i"},
Lines 685-691 END_SQL Link Here
685
                                                'items.content' => $titles,
685
                                                'items.content' => $titles,
686
                                                'count'         => $itemcount,
686
                                                'count'         => $itemcount,
687
                                               },
687
                                               },
688
                            message_transport_type => $mtt,
688
                            message_transport_type => $effective_mtt,
689
                        }
689
                        }
690
                    );
690
                    );
691
                    unless ($letter) {
691
                    unless ($letter) {
Lines 745-763 END_SQL Link Here
745
                                }
745
                                }
746
                              );
746
                              );
747
                        }
747
                        }
748
                        unless ( $mtt eq 'print' and $print_sent == 1 ) {
748
                        unless ( $effective_mtt eq 'print' and $print_sent == 1 ) {
749
                            # Just sent a print if not already done.
749
                            # Just sent a print if not already done.
750
                            C4::Letters::EnqueueLetter(
750
                            C4::Letters::EnqueueLetter(
751
                                {   letter                 => $letter,
751
                                {   letter                 => $letter,
752
                                    borrowernumber         => $borrowernumber,
752
                                    borrowernumber         => $borrowernumber,
753
                                    message_transport_type => $mtt,
753
                                    message_transport_type => $effective_mtt,
754
                                    from_address           => $admin_email_address,
754
                                    from_address           => $admin_email_address,
755
                                    to_address             => join(',', @emails_to_use),
755
                                    to_address             => join(',', @emails_to_use),
756
                                }
756
                                }
757
                            );
757
                            );
758
                            # A print notice should be sent only once per overdue level.
758
                            # A print notice should be sent only once per overdue level.
759
                            # Without this check, a print could be sent twice or more if the library checks sms and email and print and the patron has no email or sms number.
759
                            # Without this check, a print could be sent twice or more if the library checks sms and email and print and the patron has no email or sms number.
760
                            $print_sent = 1 if $mtt eq 'print';
760
                            $print_sent = 1 if $effective_mtt eq 'print';
761
                        }
761
                        }
762
                    }
762
                    }
763
                }
763
                }
764
- 

Return to bug 15967