Bug 42298: Automatic renewals should only respect the "No automatic renewals before" rule

To test:
1. prove t/db_dependent/Circulation.t
2. Observe success

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Lari Taskula 2026-04-07 16:35:22 +03:00 committed by Lucas Gass
parent 5fa5012ebe
commit 7412a3e38d
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 5 additions and 9 deletions

View File

@ -3494,17 +3494,13 @@ sub CanBookBeRenewed {
# If its cron, tell it it's too soon for a an auto renewal
return ( 0, $auto_renew, { soonest_renew_date => $soonest } ) if $cron;
# Check if it's too soon for a manual renewal
my $soonestManual = GetSoonestRenewDate( $patron, $issue );
if ( $soonestManual > dt_from_string() ) {
return ( 0, "too_soon", { soonest_renew_date => $soonestManual } ) unless $override_limit;
}
}
$soonest = GetSoonestRenewDate( $patron, $issue );
if ( $soonest > dt_from_string() ) {
return ( 0, "too_soon", { soonest_renew_date => $soonest } ) unless $override_limit;
unless ($cron) {
$soonest = GetSoonestRenewDate( $patron, $issue );
if ( $soonest > dt_from_string() ) {
return ( 0, "too_soon", { soonest_renew_date => $soonest } ) unless $override_limit;
}
}
my $auto_renew_code =