[freeside-commits] branch FREESIDE_4_BRANCH updated. fdd0c874e13cb424ed924f4a2bf87a706a598ee4

Ivan ivan at 420.am
Fri Jun 3 17:21:22 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  fdd0c874e13cb424ed924f4a2bf87a706a598ee4 (commit)
      from  0b01125393fc9e50eb77a17498046b6fca192a61 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fdd0c874e13cb424ed924f4a2bf87a706a598ee4
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 3 17:21:20 2016 -0700

    fix "Customer has automatic payment information" condition when migrated from v3

diff --git a/FS/FS/part_event/Condition/has_cust_payby_auto.pm b/FS/FS/part_event/Condition/has_cust_payby_auto.pm
index 9f91429..42f6d35 100644
--- a/FS/FS/part_event/Condition/has_cust_payby_auto.pm
+++ b/FS/FS/part_event/Condition/has_cust_payby_auto.pm
@@ -30,11 +30,24 @@ sub condition {
 
   my $cust_main = $self->cust_main($object);
 
+  #handle multiple (HASH) type options migrated from a v3 payby.pm condition
+  # (and maybe we should be a select-multiple or checkbox-multiple too?)
+  my @payby = ();
+  my $payby = $self->option('payby');
+  if ( ref($payby) ) {
+    @payby = keys %$payby;
+  } elsif ( $payby ) {
+    @payby = ( $payby );
+  }
+
   scalar( qsearch({ 
     'table'     => 'cust_payby',
     'hashref'   => { 'custnum' => $cust_main->custnum,
-                     'payby'   => $self->option('payby')
+                     #'payby'   => $self->option('payby')
                    },
+    'extra_sql' => 'AND payby IN ( '.
+                     join(',', map dbh->quote($_), @payby).
+                   ' ) ',
     'order_by'  => 'LIMIT 1',
   }) );
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_event/Condition/has_cust_payby_auto.pm |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list