From dce1145148d5132908dfcf8461053d9be3b3d362 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 --- C4/Circulation.pm | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 7fa77da..08081fc 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1439,13 +1439,18 @@ sub AddIssue { ## 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 ( + 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'} ); } } @@ -2118,12 +2123,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.1.4