From df520d2d6288bfbc9acac59c90a28ebe343a5390 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. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- C4/Circulation.pm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 49a81e74c6..cca192c6b0 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1993,8 +1993,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; @@ -3562,20 +3561,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.39.5