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

(-)a/misc/cronjobs/longoverdue.pl (-4 / +6 lines)
Lines 464-478 foreach my $startrange (sort keys %$lost) { Link Here
464
        $sth_items->execute($startrange, $endrange, $lostvalue);
464
        $sth_items->execute($startrange, $endrange, $lostvalue);
465
        $count=0;
465
        $count=0;
466
        ITEM: while (my $row=$sth_items->fetchrow_hashref) {
466
        ITEM: while (my $row=$sth_items->fetchrow_hashref) {
467
            my $patron;
467
            if( $filter_borrower_categories ) {
468
            if( $filter_borrower_categories ) {
468
                my $category = uc Koha::Patrons->find( $row->{borrowernumber} )->categorycode();
469
                $patron ||= Koha::Patrons->find( $row->{borrowernumber} );
470
                my $category = uc $patron->categorycode();
469
                next ITEM unless ( $category_to_process{ $category } );
471
                next ITEM unless ( $category_to_process{ $category } );
470
            }
472
            }
471
            if ($filter_branches) {
473
            if ($filter_branches) {
472
                my $lib;
474
                my $lib;
473
                for ($circ_control_pref) {
475
                for ($circ_control_pref) {
474
                    if ( $_ eq 'PatronLibrary' ) {
476
                    if ( $_ eq 'PatronLibrary' ) {
475
                        $lib = Koha::Patrons->find( $row->{borrowernumber} )->branchcode();
477
                        $patron ||= Koha::Patrons->find( $row->{borrowernumber} );
478
                        $lib = $patron->branchcode();
476
                    } elsif ( $_ eq 'PickupLibrary' ) {
479
                    } elsif ( $_ eq 'PickupLibrary' ) {
477
                        $lib = C4::Context->userenv->{'branch'};
480
                        $lib = C4::Context->userenv->{'branch'};
478
                    } else {    # ( $_ eq 'ItemHomeLibrary' )
481
                    } else {    # ( $_ eq 'ItemHomeLibrary' )
Lines 492-498 foreach my $startrange (sort keys %$lost) { Link Here
492
                if ( $charge && $charge eq $lostvalue ) {
495
                if ( $charge && $charge eq $lostvalue ) {
493
                    LostItem( $row->{'itemnumber'}, 'cronjob', $mark_returned );
496
                    LostItem( $row->{'itemnumber'}, 'cronjob', $mark_returned );
494
                } elsif ( $mark_returned ) {
497
                } elsif ( $mark_returned ) {
495
                    my $patron = Koha::Patrons->find( $row->{borrowernumber} );
498
                    $patron ||= Koha::Patrons->find( $row->{borrowernumber} );
496
                    MarkIssueReturned($row->{borrowernumber},$row->{itemnumber},undef,$patron->privacy)
499
                    MarkIssueReturned($row->{borrowernumber},$row->{itemnumber},undef,$patron->privacy)
497
                }
500
                }
498
            }
501
            }
499
- 

Return to bug 9596