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

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

Return to bug 14784