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

(-)a/C4/Circulation.pm (-2 / +12 lines)
Lines 2222-2227 sub MarkIssueReturned { Link Here
2222
    # FIXME Improve the return value and handle it from callers
2222
    # FIXME Improve the return value and handle it from callers
2223
    $schema->txn_do(sub {
2223
    $schema->txn_do(sub {
2224
2224
2225
        my $patron = Koha::Patrons->find( $borrowernumber );
2226
2225
        # Update the returndate value
2227
        # Update the returndate value
2226
        if ( $returndate ) {
2228
        if ( $returndate ) {
2227
            $issue->returndate( $returndate )->store->discard_changes; # update and refetch
2229
            $issue->returndate( $returndate )->store->discard_changes; # update and refetch
Lines 2245-2253 sub MarkIssueReturned { Link Here
2245
2247
2246
        if ( C4::Context->preference('StoreLastBorrower') ) {
2248
        if ( C4::Context->preference('StoreLastBorrower') ) {
2247
            my $item = Koha::Items->find( $itemnumber );
2249
            my $item = Koha::Items->find( $itemnumber );
2248
            my $patron = Koha::Patrons->find( $borrowernumber );
2249
            $item->last_returned_by( $patron );
2250
            $item->last_returned_by( $patron );
2250
        }
2251
        }
2252
2253
        # Remove any OVERDUES related debarment if the borrower has no overdues
2254
        if ( C4::Context->preference('AutoRemoveOverduesRestrictions')
2255
          && $patron->debarred
2256
          && !$patron->has_overdues
2257
          && @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) }
2258
        ) {
2259
            DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' });
2260
        }
2261
2251
    });
2262
    });
2252
2263
2253
    return $issue_id;
2264
    return $issue_id;
2254
- 

Return to bug 24413