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

(-)a/misc/cronjobs/overdue_notices.pl (-8 / +7 lines)
Lines 443-450 elsif ( defined $text_filename ) { Link Here
443
}
443
}
444
444
445
foreach my $branchcode (@branches) {
445
foreach my $branchcode (@branches) {
446
    my $calendar;
446
    if ( C4::Context->preference('OverdueNoticeCalendar') ) {
447
    if ( C4::Context->preference('OverdueNoticeCalendar') ) {
447
        my $calendar = Koha::Calendar->new( branchcode => $branchcode );
448
        $calendar = Koha::Calendar->new( branchcode => $branchcode );
448
        if ( $calendar->is_holiday($date_to_run) ) {
449
        if ( $calendar->is_holiday($date_to_run) ) {
449
            next;
450
            next;
450
        }
451
        }
Lines 466-472 SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, branchname Link Here
466
    AND biblio.biblionumber   = biblioitems.biblionumber
467
    AND biblio.biblionumber   = biblioitems.biblionumber
467
    AND issues.borrowernumber = ?
468
    AND issues.borrowernumber = ?
468
    AND issues.branchcode = ?
469
    AND issues.branchcode = ?
469
    AND TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0
470
    AND items.itemlost = 0
471
/   AND TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0
470
END_SQL
472
END_SQL
471
473
472
    my $query = "SELECT * FROM overduerules WHERE delay1 IS NOT NULL AND branchcode = ? ";
474
    my $query = "SELECT * FROM overduerules WHERE delay1 IS NOT NULL AND branchcode = ? ";
Lines 514-522 END_SQL Link Here
514
516
515
            my $borrower_sql = <<"END_SQL";
517
            my $borrower_sql = <<"END_SQL";
516
SELECT issues.borrowernumber, firstname, surname, address, address2, city, zipcode, country, email, emailpro, B_email, smsalertnumber, phone, cardnumber, date_due
518
SELECT issues.borrowernumber, firstname, surname, address, address2, city, zipcode, country, email, emailpro, B_email, smsalertnumber, phone, cardnumber, date_due
517
FROM   issues,borrowers,categories
519
FROM   issues,borrowers,categories,items
518
WHERE  issues.borrowernumber=borrowers.borrowernumber
520
WHERE  issues.borrowernumber=borrowers.borrowernumber
519
AND    borrowers.categorycode=categories.categorycode
521
AND    borrowers.categorycode=categories.categorycode
522
AND    issues.itemnumber = items.itemnumber
523
AND    items.itemlost = 0
520
AND    TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0
524
AND    TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0
521
END_SQL
525
END_SQL
522
            my @borrower_parameters;
526
            my @borrower_parameters;
Lines 542-549 END_SQL Link Here
542
                my $days_between;
546
                my $days_between;
543
                if ( C4::Context->preference('OverdueNoticeCalendar') )
547
                if ( C4::Context->preference('OverdueNoticeCalendar') )
544
                {
548
                {
545
                    my $calendar =
546
                      Koha::Calendar->new( branchcode => $branchcode );
547
                    $days_between =
549
                    $days_between =
548
                      $calendar->days_between( dt_from_string($data->{date_due}),
550
                      $calendar->days_between( dt_from_string($data->{date_due}),
549
                        $date_to_run );
551
                        $date_to_run );
Lines 626-633 END_SQL Link Here
626
                my $exceededPrintNoticesMaxLines = 0;
628
                my $exceededPrintNoticesMaxLines = 0;
627
                while ( my $item_info = $sth2->fetchrow_hashref() ) {
629
                while ( my $item_info = $sth2->fetchrow_hashref() ) {
628
                    if ( C4::Context->preference('OverdueNoticeCalendar') ) {
630
                    if ( C4::Context->preference('OverdueNoticeCalendar') ) {
629
                        my $calendar =
630
                          Koha::Calendar->new( branchcode => $branchcode );
631
                        $days_between =
631
                        $days_between =
632
                          $calendar->days_between(
632
                          $calendar->days_between(
633
                            dt_from_string( $item_info->{date_due} ), $date_to_run );
633
                            dt_from_string( $item_info->{date_due} ), $date_to_run );
634
- 

Return to bug 17952