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