Bug 14048: [QA Followup]

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>
Signed-off-by: Margaret Thrasher <p.thrasher@dover.nh.gov>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2016-06-09 16:48:07 +00:00 committed by Jesse Weaver
parent b1b61c6073
commit 523cdcee04
1 changed files with 25 additions and 16 deletions

View File

@ -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;
}