From 523cdcee044c87dd886e3364f65fac5b2a2c294a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 9 Jun 2016 16:48:07 +0000 Subject: [PATCH] Bug 14048: [QA Followup] Signed-off-by: Nick Clemens Signed-off-by: Jason Robb Signed-off-by: Jennifer Schmidt Signed-off-by: Margaret Thrasher Signed-off-by: Jonathan Druart Signed-off-by: Jesse Weaver --- C4/Circulation.pm | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 7ceac6bfa7..1e8985ebd1 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1452,17 +1452,22 @@ sub AddIssue { UpdateTotalIssues( $item->{'biblionumber'}, 1 ); } - ## If item was lost, it has now been found, reverse any list item charges if necessary. - if ( $item->{'itemlost'} ) { - if ( Koha::RefundLostItemFeeRules->should_refund( - current_branch => C4::Context->userenv->{ branch }, - patron_branch => $borrower->{ branchcode }, - item_home_branch => $item->{ homebranch }, - item_holding_branch => $item->{ holdingbranch } - ) ) { - _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); + ## If item was lost, it has now been found, reverse any list item charges if necessary. + if ( $item->{'itemlost'} ) { + if ( + Koha::RefundLostItemFeeRules->should_refund( + { + current_branch => C4::Context->userenv->{branch}, + item_home_branch => $item->{homebranch}, + item_holding_branch => $item->{holdingbranch} + } + ) + ) + { + _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, + $item->{'barcode'} ); + } } - } ModItem( { @@ -2139,12 +2144,16 @@ sub AddReturn { $messages->{'WasLost'} = 1; if ( $item->{'itemlost'} ) { - if ( Koha::RefundLostItemFeeRules->should_refund( - current_branch => C4::Context->userenv->{ branch }, - patron_branch => $borrower->{ branchcode }, - item_home_branch => $item->{ homebranch }, - item_holding_branch => $item->{ holdingbranch } - ) ) { + if ( + Koha::RefundLostItemFeeRules->should_refund( + { + current_branch => C4::Context->userenv->{branch}, + item_home_branch => $item->{homebranch}, + item_holding_branch => $item->{holdingbranch} + } + ) + ) + { _FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode ); $messages->{'LostItemFeeRefunded'} = 1; } -- 2.39.5