From 7dbad8e210ab18e2323e8557e50680832a54cdce Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 19 Sep 2019 14:48:45 +0100 Subject: [PATCH] Bug 23382: (follow-up) Clarify variable names This patch updates the variable name '$branch' to '$branchcode' in a number of places to make it clearer what the variable contains. Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit af9333292799695b5322a5cf1598e12f08f0a66c) Signed-off-by: Lucas Gass --- C4/Circulation.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 88794b49fd..7d6be93dd3 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1179,7 +1179,7 @@ sub CanBookBeReturned { sub checkHighHolds { my ( $item, $borrower ) = @_; - my $branch = _GetCircControlBranch( $item, $borrower ); + my $branchcode = _GetCircControlBranch( $item, $borrower ); my $item_object = Koha::Items->find( $item->{itemnumber} ); my $return_data = { @@ -1237,10 +1237,10 @@ sub checkHighHolds { my $issuedate = DateTime->now( time_zone => C4::Context->tz() ); - my $calendar = Koha::Calendar->new( branchcode => $branch ); + my $calendar = Koha::Calendar->new( branchcode => $branchcode ); my $itype = $item_object->effective_itemtype; - my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branch, $borrower ); + my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration'); @@ -1330,7 +1330,7 @@ sub AddIssue { or return; # if we don't get an Item, abort. my $item_unblessed = $item_object->unblessed; - my $branch = _GetCircControlBranch( $item_unblessed, $borrower ); + my $branchcode = _GetCircControlBranch( $item_unblessed, $borrower ); # get actual issuing if there is one my $actualissue = $item_object->checkout; @@ -1341,7 +1341,7 @@ sub AddIssue { $datedue = AddRenewal( $borrower->{'borrowernumber'}, $item_object->itemnumber, - $branch, + $branchcode, $datedue, $issuedate, # here interpreted as the renewal date ); @@ -1349,13 +1349,13 @@ sub AddIssue { else { unless ($datedue) { my $itype = $item_object->effective_itemtype; - $datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); + $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); } $datedue->truncate( to => 'minute' ); my $patron = Koha::Patrons->find( $borrower ); - my $library = Koha::Libraries->find( $branch ); + my $library = Koha::Libraries->find( $branchcode ); my $fees = Koha::Charges::Fees->new( { patron => $patron, @@ -1396,7 +1396,7 @@ sub AddIssue { my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $item_object->effective_itemtype, - branchcode => $branch + branchcode => $branchcode } ); @@ -1406,7 +1406,7 @@ sub AddIssue { # Record in the database the fact that the book was issued. unless ($datedue) { my $itype = $item_object->effective_itemtype; - $datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); + $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); } $datedue->truncate( to => 'minute' ); @@ -1507,7 +1507,7 @@ sub AddIssue { # Send a checkout slip. my $circulation_alert = 'C4::ItemCirculationAlertPreference'; my %conditions = ( - branchcode => $branch, + branchcode => $branchcode, categorycode => $borrower->{categorycode}, item_type => $item_object->effective_itemtype, notification => 'CHECKOUT', @@ -1518,7 +1518,7 @@ sub AddIssue { type => 'CHECKOUT', item => $item_object->unblessed, borrower => $borrower, - branch => $branch, + branch => $branchcode, } ); } -- 2.39.5