From cc9fecd04c90e3f572db9d484cea4c1c0a2cb612 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 28 May 2024 13:22:44 +0000 Subject: [PATCH] Bug 27919: Return claims shouldn't change lost status if already set This patch prevents a return claim from changing the lost status if it has already been set. Test plan: 1) In system preferences, set the ClaimReturnedLostValue syspref to any value 2) Checkout an item to a patron 3) Set that item as lost, using a different status to the one you set in step 1 4) Create a return claim on the item 5) Check the item's lost status, it should now have been set to the value you set in step 1 6) Apply patch 7) reset_all 8) Repeat steps 1-5, this time the status should remain at the value you set in step 3 and not be overwritten by the return claim 9) Repeat steps 1,2,4 and 5 - this time the lost status should be set to the value you set in step 1 as we didn't have a pre-existing lost status Signed-off-by: Andrew Fuerste Henry Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- Koha/Checkout.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm index a63ec71ab8..bbb2d59d86 100644 --- a/Koha/Checkout.pm +++ b/Koha/Checkout.pm @@ -258,7 +258,7 @@ sub claim_returned { )->store(); my $ClaimReturnedLostValue = C4::Context->preference('ClaimReturnedLostValue'); - $self->item->itemlost($ClaimReturnedLostValue)->store; + $self->item->itemlost($ClaimReturnedLostValue)->store unless $self->item->itemlost; my $ClaimReturnedChargeFee = C4::Context->preference('ClaimReturnedChargeFee'); $charge_lost_fee = -- 2.39.5