From 445947245dd1a1e3c2a8bf208ca3fa796f4aef32 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 12 Jan 2024 22:47:07 +0000 Subject: [PATCH] Bug 16122: Increment items.localuse in AddReturn --- C4/Circulation.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 29abc95ac7..c59c92bff7 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -834,6 +834,12 @@ sub CanBookBeIssued { interface => C4::Context->interface, } ); + + #increment items.localuse + my $localuse_count = $item_object->localuse; + $localuse_count++; + $item_object->localuse( $localuse_count )->store; + my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); @@ -2153,6 +2159,7 @@ sub AddReturn { my $itemnumber = $item->itemnumber; my $itemtype = $item->effective_itemtype; + my $localuse_count = $item->localuse; my $issue = $item->checkout; if ( $issue ) { @@ -2168,6 +2175,8 @@ sub AddReturn { # No issue, no borrowernumber. ONLY if $doreturn, *might* you have a $borrower later. # Record this as a local use, instead of a return, if the RecordLocalUseOnReturn is on if (C4::Context->preference("RecordLocalUseOnReturn")) { + $localuse_count++; + $item->localuse( $localuse_count )->store; $messages->{'LocalUse'} = 1; $stat_type = 'localuse'; } -- 2.30.2