From 72fea80a33bc9ea57335e6d8c00500439a38b1c4 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 15 Nov 2016 12:32:53 -0300 Subject: [PATCH] Bug 17599: (QA followup) Perltidy really long lines Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- C4/Circulation.pm | 59 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index b6225381fb..9e085eff0e 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -397,7 +397,13 @@ sub TooMany { # given branch, patron category, and item type, determine # applicable issuing rule - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $cat_borrower, itemtype => $type, branchcode => $branch }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $cat_borrower, + itemtype => $type, + branchcode => $branch + } + ); + # if a rule is found and has a loan limit set, count # how many loans the patron already has that meet that @@ -1333,7 +1339,13 @@ sub AddIssue { # If automatic renewal wasn't selected while issuing, set the value according to the issuing rule. unless ($auto_renew) { - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branch }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $borrower->{categorycode}, + itemtype => $item->{itype}, + branchcode => $branch + } + ); + $auto_renew = $issuing_rule->auto_renew if $issuing_rule; } @@ -1533,7 +1545,13 @@ Get the Hard Due Date and it's comparison for an itemtype, a borrower type and a sub GetHardDueDate { my ( $borrowertype, $itemtype, $branchcode ) = @_; - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrowertype, itemtype => $itemtype, branchcode => $branchcode }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $borrowertype, + itemtype => $itemtype, + branchcode => $branchcode + } + ); + if ( defined( $issuing_rule ) ) { if ( $issuing_rule->hardduedate ) { @@ -2185,7 +2203,12 @@ sub _debar_user_on_return { my $branchcode = _GetCircControlBranch( $item, $borrower ); my $circcontrol = C4::Context->preference('CircControl'); - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $borrower->{categorycode}, + itemtype => $item->{itype}, + branchcode => $branchcode + } + ); my $finedays = $issuing_rule ? $issuing_rule->finedays : undef; my $unit = $issuing_rule ? $issuing_rule->lengthunit : undef; my $chargeable_units = C4::Overdues::get_chargeable_units($unit, $dt_due, $dt_today, $branchcode); @@ -2780,7 +2803,12 @@ sub CanBookBeRenewed { return ( 1, undef ) if $override_limit; my $branchcode = _GetCircControlBranch( $item, $borrower ); - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $borrower->{categorycode}, + itemtype => $item->{itype}, + branchcode => $branchcode + } + ); return ( 0, "too_many" ) if not $issuing_rule or $issuing_rule->renewalsallowed <= $itemissue->{renewals}; @@ -3022,7 +3050,12 @@ sub GetRenewCount { # $item and $borrower should be calculated my $branchcode = _GetCircControlBranch($item, $borrower); - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $borrower->{categorycode}, + itemtype => $item->{itype}, + branchcode => $branchcode + } + ); $renewsallowed = $issuing_rule ? $issuing_rule->renewalsallowed : undef; # FIXME Just replace undef with 0 to get what we expected. But what about the side-effects? TODO LATER $renewsleft = $renewsallowed - $renewcount; @@ -3062,7 +3095,12 @@ sub GetSoonestRenewDate { or return; my $branchcode = _GetCircControlBranch( $item, $borrower ); - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $borrower->{categorycode}, + itemtype => $item->{itype}, + branchcode => $branchcode + } + ); my $now = dt_from_string; return $now unless $issuing_rule; @@ -3117,7 +3155,12 @@ sub GetLatestAutoRenewDate { or return; my $branchcode = _GetCircControlBranch( $item, $borrower ); - my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); + my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( + { categorycode => $borrower->{categorycode}, + itemtype => $item->{itype}, + branchcode => $branchcode + } + ); return unless $issuing_rule; return if not $issuing_rule->no_auto_renewal_after -- 2.39.5