From 4a4653ec2c85dece16cfbfde4fbcedaec69a5e1a Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 26 Sep 2024 12:59:17 +0000 Subject: [PATCH] Bug 33292: Add a checkbox to refund a lost fee on return claim --- Koha/UI/Form/Builder/Item.pm | 12 ++++++++---- .../intranet-tmpl/prog/en/includes/modal-claims.inc | 12 ++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm index 2ace11b4037..228ba982e66 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -182,10 +182,14 @@ sub generate_subfield_form { if ( $subfield->{authorised_value} eq "LOST" ) { my $ClaimReturnedLostValue = C4::Context->preference('ClaimReturnedLostValue'); - my $item_is_return_claim = - $ClaimReturnedLostValue - && exists $item->{itemlost} - && $ClaimReturnedLostValue eq $item->{itemlost}; + my $claim = Koha::Checkouts::ReturnClaims->find( + { + itemnumber => $item->{itemnumber}, + resolution => undef, + } + ); + my $item_is_return_claim = $ClaimReturnedLostValue + && $claim; $subfield_data{IS_RETURN_CLAIM} = $item_is_return_claim; $subfield_data{IS_LOST_AV} = 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc index 577c32d6720..8cfd36e6dff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc @@ -26,6 +26,12 @@ Charge lost fee +
+ +
[% END %] @@ -63,7 +69,8 @@ $(document).on("click", '#claims-returned-modal-btn-submit', function(e){ let itemnumber = $('#claims-returned-itemnumber').val(); let notes = $('#claims-returned-notes').val(); - let fee = $('#claims-returned-charge-lost-fee').prop('checked') ? true : false; + let charge_lost_fee = $('#claims-returned-charge-lost-fee').prop('checked') ? true : false; + let refund_lost_fee = $('#claims-returned-refund-lost-fee').prop('checked') ? true : false; $('#claims-returned-modal').modal('hide'); @@ -74,7 +81,8 @@ params = { item_id: itemnumber, notes: notes, - charge_lost_fee: fee, + charge_lost_fee, + refund_lost_fee, created_by: logged_in_user_borrowernumber, }; -- 2.39.3 (Apple Git-146)