From a493ae69c2710290ef48d0af3151667fba8e3d01 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 Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer --- 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 2ace11b403..228ba982e6 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 577c32d672..8cfd36e6df 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.5