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

(-)a/C4/Circulation.pm (-3 / +13 lines)
Lines 3080-3092 sub CanBookBeRenewed { Link Here
3080
        }
3080
        }
3081
    }
3081
    }
3082
3082
3083
    return ( 0, $auto_renew, { soonest_renew_date => $soonest } ) if $auto_renew =~ 'too_soon';#$auto_renew ne "no" && $auto_renew ne "ok";
3083
    if($auto_renew =~ 'too_soon'){
3084
3085
        # If its cron, tell it it's too soon for a an auto renewal
3086
        return ( 0, $auto_renew, { soonest_renew_date => $soonest } ) if $cron;
3087
3088
        # Check if it's too soon for a manual renewal
3089
        my $soonestManual = GetSoonestRenewDate( $patron, $issue );
3090
        if($soonestManual > dt_from_string()){
3091
            return (0, "too_soon", { soonest_renew_date => $soonestManual } ) unless $override_limit;
3092
        }
3093
    }
3094
3084
    $soonest = GetSoonestRenewDate($patron, $issue);
3095
    $soonest = GetSoonestRenewDate($patron, $issue);
3085
    if ( $soonest > dt_from_string() ){
3096
    if ( $soonest > dt_from_string() ){
3086
        return (0, "too_soon", { soonest_renew_date => $soonest } ) unless $override_limit;
3097
        return (0, "too_soon", { soonest_renew_date => $soonest } ) unless $override_limit;
3087
    }
3098
    }
3088
3099
3089
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
3100
    return ( 1, "auto_renew" ) if $auto_renew eq "ok" || $auto_renew eq "auto_too_soon" && !$override_limit;    # 0 if auto-renewal should not succeed
3090
3101
3091
    return ( 1, undef );
3102
    return ( 1, undef );
3092
}
3103
}
3093
- 

Return to bug 25393