From: Jason Stephenson Date: Sat, 21 Dec 2013 15:47:04 +0000 (-0500) Subject: LP 1198465: Fix _check_payment_interval in O::A::Circ::CircCommon. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=75a6fd2638cacb7d9829a08b8b28f4ae54ee0a72;p=working%2FEvergreen.git LP 1198465: Fix _check_payment_interval in O::A::Circ::CircCommon. I was passing in the hashref from org_unit_setting and treating it as if I had the value hash member. This change modified _check_payment_interval to detect if we have the hashref. If so, we set the the inverval to $hashref->{value}. Signed-off-by: Jason Stephenson Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm index 22c259c1f4..e4508bd842 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm @@ -694,6 +694,11 @@ sub _check_payment_interval { my ($entry, $interval) = @_; my $result = ($interval ? 0 : 1); + # A check to see if we were given the settings hash or the value: + if (ref($interval) eq 'HASH') { + $interval = $interval->{value}; + } + if ($interval && $entry && $entry->{payments} && @{$entry->{payments}}) { my $interval_secs = interval_to_seconds($interval); my @pay_dates = map {$_->payment_ts()} sort {$b->payment_ts() cmp $a->payment_ts()} grep {$_->payment_type() ne 'void_payment'} @{$entry->{payments}};