Fix _check_payment_interval in O::A::Circ::CircCommon.
authorJason Stephenson <jason@sigio.com>
Sat, 21 Dec 2013 15:47:04 +0000 (10:47 -0500)
committerKathy Lussier <klussier@masslnc.org>
Thu, 13 Feb 2014 05:39:13 +0000 (00:39 -0500)
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 <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm

index 22c259c..e4508bd 100644 (file)
@@ -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}};