[freeside-commits] branch master updated. d22baa4e71bfa9e153c1fe1152ff4c748f1d935c

Ivan ivan at 420.am
Fri Jun 3 17:23:06 PDT 2016


The branch, master has been updated
       via  d22baa4e71bfa9e153c1fe1152ff4c748f1d935c (commit)
       via  a60ce94f914fb7380546d19713fece0ed208bdc6 (commit)
       via  a074e417df3aef3bbcb9e397ef30794ba9f0d5c0 (commit)
      from  1efab29ccbb2aa15bcb94f1cb46069f32dcabf9f (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 d22baa4e71bfa9e153c1fe1152ff4c748f1d935c
Merge: a60ce94 1efab29
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 3 17:23:02 2016 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit a60ce94f914fb7380546d19713fece0ed208bdc6
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 3 17:22:57 2016 -0700

    spacing nit

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index bf5baa9..0d89ff4 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1991,7 +1991,9 @@ sub cust_payby {
     'hashref'  => { 'custnum' => $self->custnum },
     'order_by' => "ORDER BY payby IN ('CARD','CHEK') DESC, weight ASC",
   };
-  $search->{'extra_sql'} = ' AND payby IN ( ' . join(',', map { dbh->quote($_) } @payby) . ' ) '
+  $search->{'extra_sql'} = ' AND payby IN ( '.
+                               join(',', map dbh->quote($_), @payby).
+                             ' ) '
     if @payby;
 
   qsearch($search);

commit a074e417df3aef3bbcb9e397ef30794ba9f0d5c0
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 3 17:22:33 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/cust_main.pm                                |    4 +++-
 FS/FS/part_event/Condition/has_cust_payby_auto.pm |   15 ++++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list