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

(-)a/C4/Circulation.pm (-5 / +17 lines)
Lines 2301-2310 sub AddReturn { Link Here
2301
        if ( $issue and $issue->is_overdue($return_date) ) {
2301
        if ( $issue and $issue->is_overdue($return_date) ) {
2302
        # fix fine days
2302
        # fix fine days
2303
            my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item->unblessed, dt_from_string($issue->date_due), $return_date );
2303
            my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item->unblessed, dt_from_string($issue->date_due), $return_date );
2304
            if ($reminder){
2304
            if ($debardate and $debardate ne "9999-12-31") {
2305
                $messages->{'PrevDebarred'} = $debardate;
2305
                if ($reminder){
2306
            } else {
2306
                    $messages->{'PrevDebarred'} = $debardate;
2307
                $messages->{'Debarred'} = $debardate if $debardate;
2307
                } else {
2308
                    $messages->{'Debarred'} = $debardate;
2309
                }
2310
            } elsif ($patron->debarred) {
2311
                if ( $patron->debarred eq "9999-12-31") {
2312
                    $messages->{'ForeverDebarred'} = $patron->debarred;
2313
                } else {
2314
                    my $borrower_debar_dt = dt_from_string( $patron->debarred );
2315
                    $borrower_debar_dt->truncate(to => 'day');
2316
                    my $today_dt = $return_date->clone()->truncate(to => 'day');
2317
                    if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) {
2318
                        $messages->{'PrevDebarred'} = $patron->debarred;
2319
                    }
2320
                }
2308
            }
2321
            }
2309
        # there's no overdue on the item but borrower had been previously debarred
2322
        # there's no overdue on the item but borrower had been previously debarred
2310
        } elsif ( $issue->date_due and $patron->debarred ) {
2323
        } elsif ( $issue->date_due and $patron->debarred ) {
2311
- 

Return to bug 14784