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

(-)a/C4/Circulation.pm (-5 / +18 lines)
Lines 53-58 use Koha::Patron::Debarments; Link Here
53
use Koha::Database;
53
use Koha::Database;
54
use Koha::Libraries;
54
use Koha::Libraries;
55
use Koha::Holds;
55
use Koha::Holds;
56
use Koha::RefundLostItemFeeRule;
57
use Koha::RefundLostItemFeeRules;
56
use Carp;
58
use Carp;
57
use List::MoreUtils qw( uniq );
59
use List::MoreUtils qw( uniq );
58
use Scalar::Util qw( looks_like_number );
60
use Scalar::Util qw( looks_like_number );
Lines 1437-1443 sub AddIssue { Link Here
1437
1439
1438
        ## If item was lost, it has now been found, reverse any list item charges if necessary.
1440
        ## If item was lost, it has now been found, reverse any list item charges if necessary.
1439
        if ( $item->{'itemlost'} ) {
1441
        if ( $item->{'itemlost'} ) {
1440
            if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) {
1442
            if ( Koha::RefundLostItemFeeRules->should_refund(
1443
                    current_branch => C4::Context->userenv->{ branch },
1444
                    patron_branch  => $borrower->{ branchcode },
1445
                    item_home_branch => $item->{ homebranch },
1446
                    item_holding_branch => $item->{ holdingbranch }
1447
                 ) ) {
1441
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
1448
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
1442
            }
1449
            }
1443
        }
1450
        }
Lines 2110-2118 sub AddReturn { Link Here
2110
    if ( $item->{'itemlost'} ) {
2117
    if ( $item->{'itemlost'} ) {
2111
        $messages->{'WasLost'} = 1;
2118
        $messages->{'WasLost'} = 1;
2112
2119
2113
        if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) {
2120
        if ( $item->{'itemlost'} ) {
2114
            _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode);    # can tolerate undef $borrowernumber
2121
            if ( Koha::RefundLostItemFeeRules->should_refund(
2115
            $messages->{'LostItemFeeRefunded'} = 1;
2122
                    current_branch => C4::Context->userenv->{ branch },
2123
                    patron_branch  => $borrower->{ branchcode },
2124
                    item_home_branch => $item->{ homebranch },
2125
                    item_holding_branch => $item->{ holdingbranch }
2126
                 ) ) {
2127
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode );
2128
                $messages->{'LostItemFeeRefunded'} = 1;
2129
            }
2116
        }
2130
        }
2117
    }
2131
    }
2118
2132
2119
- 

Return to bug 14048