From 78bb0f4c18c920b1111f242f7c99864efd1b81f8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 18 Mar 2019 15:06:03 -0300 Subject: [PATCH] Bug 23463: remove trivial UpdateHoldingbranch sub We do not need this subroutine, moving it where it is used. --- C4/Circulation.pm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index ab7fdca87d..b837cf2650 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1975,8 +1975,7 @@ sub AddReturn { # this is always done regardless of whether the item was on loan or not my $item_holding_branch = $item->holdingbranch; if ($item->holdingbranch ne $branch) { - UpdateHoldingbranch($branch, $item->itemnumber); - $item->holdingbranch($branch); # update item data holdingbranch too # FIXME I guess this is for the _debar_user_on_return call later + $item->holdingbranch($branch)->store; } my $leave_item_lost = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; @@ -3491,20 +3490,7 @@ sub updateWrongTransfer { ModItemTransfer($itemNumber, $FromLibrary, $waitingAtLibrary); #third step changing holdingbranch of item - UpdateHoldingbranch($FromLibrary,$itemNumber); -} - -=head2 UpdateHoldingbranch - - $items = UpdateHoldingbranch($branch,$itmenumber); - -Simple methode for updating hodlingbranch in items BDD line - -=cut - -sub UpdateHoldingbranch { - my ( $branch,$itemnumber ) = @_; - ModItem({ holdingbranch => $branch }, undef, $itemnumber); + my $item = Koha::Items->find($itemNumber)->holdingbranch($FromLibrary)->store; } =head2 CalcDateDue -- 2.25.0