Lines 75-80
my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 });
Link Here
|
75 |
my %report; |
75 |
my %report; |
76 |
while ( my $auto_renew = $auto_renews->next ) { |
76 |
while ( my $auto_renew = $auto_renews->next ) { |
77 |
|
77 |
|
|
|
78 |
#If norenewalbefore is undef, $NoRenewalBeforeThisDate will equal $now. |
79 |
my $NoRenewalBeforeThisDate = C4::Circulation::GetSoonestRenewDate($auto_renew->borrowernumber, $auto_renew->itemnumber); |
80 |
my $now = Koha::DateUtils::dt_from_string; |
81 |
if ( $NoRenewalBeforeThisDate && $now ){ |
82 |
if ( $NoRenewalBeforeThisDate > $now ){ |
83 |
next; |
84 |
} |
85 |
else { |
86 |
#Fallback: if norenewalbefore is undef, don't renew before due date |
87 |
if ( Koha::DateUtils::dt_from_string( $auto_renew->date_due, 'sql' ) > $now ){ |
88 |
next; |
89 |
} |
90 |
} |
91 |
} |
92 |
|
78 |
# CanBookBeRenewed returns 'auto_renew' when the renewal should be done by this script |
93 |
# CanBookBeRenewed returns 'auto_renew' when the renewal should be done by this script |
79 |
my ( $ok, $error ) = CanBookBeRenewed( $auto_renew->borrowernumber, $auto_renew->itemnumber ); |
94 |
my ( $ok, $error ) = CanBookBeRenewed( $auto_renew->borrowernumber, $auto_renew->itemnumber ); |
80 |
if ( $error eq 'auto_renew' ) { |
95 |
if ( $error eq 'auto_renew' ) { |
81 |
- |
|
|