|
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 1450-1461
sub AddIssue {
Link Here
|
| 1450 |
UpdateTotalIssues( $item->{'biblionumber'}, 1 ); |
1452 |
UpdateTotalIssues( $item->{'biblionumber'}, 1 ); |
| 1451 |
} |
1453 |
} |
| 1452 |
|
1454 |
|
| 1453 |
## If item was lost, it has now been found, reverse any list item charges if necessary. |
1455 |
## If item was lost, it has now been found, reverse any list item charges if necessary. |
| 1454 |
if ( $item->{'itemlost'} ) { |
1456 |
if ( $item->{'itemlost'} ) { |
| 1455 |
if ( C4::Context->preference('RefundLostItemFeeOnReturn') ) { |
1457 |
if ( Koha::RefundLostItemFeeRules->should_refund( |
| 1456 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); |
1458 |
current_branch => C4::Context->userenv->{ branch }, |
| 1457 |
} |
1459 |
patron_branch => $borrower->{ branchcode }, |
|
|
1460 |
item_home_branch => $item->{ homebranch }, |
| 1461 |
item_holding_branch => $item->{ holdingbranch } |
| 1462 |
) ) { |
| 1463 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); |
| 1458 |
} |
1464 |
} |
|
|
1465 |
} |
| 1459 |
|
1466 |
|
| 1460 |
ModItem( |
1467 |
ModItem( |
| 1461 |
{ |
1468 |
{ |
|
Lines 2131-2139
sub AddReturn {
Link Here
|
| 2131 |
if ( $item->{'itemlost'} ) { |
2138 |
if ( $item->{'itemlost'} ) { |
| 2132 |
$messages->{'WasLost'} = 1; |
2139 |
$messages->{'WasLost'} = 1; |
| 2133 |
|
2140 |
|
| 2134 |
if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { |
2141 |
if ( $item->{'itemlost'} ) { |
| 2135 |
_FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode); # can tolerate undef $borrowernumber |
2142 |
if ( Koha::RefundLostItemFeeRules->should_refund( |
| 2136 |
$messages->{'LostItemFeeRefunded'} = 1; |
2143 |
current_branch => C4::Context->userenv->{ branch }, |
|
|
2144 |
patron_branch => $borrower->{ branchcode }, |
| 2145 |
item_home_branch => $item->{ homebranch }, |
| 2146 |
item_holding_branch => $item->{ holdingbranch } |
| 2147 |
) ) { |
| 2148 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode ); |
| 2149 |
$messages->{'LostItemFeeRefunded'} = 1; |
| 2150 |
} |
| 2137 |
} |
2151 |
} |
| 2138 |
} |
2152 |
} |
| 2139 |
|
2153 |
|
| 2140 |
- |
|
|