[freeside-commits] branch FREESIDE_4_BRANCH updated. 20fd8098a709fe5c63e8aa418f0a5344d7df9c42

Ivan ivan at 420.am
Fri Oct 27 16:34:27 PDT 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  20fd8098a709fe5c63e8aa418f0a5344d7df9c42 (commit)
      from  f2e3c0d68533554b6288d2d7b33e299ea301762d (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 20fd8098a709fe5c63e8aa418f0a5344d7df9c42
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Oct 27 16:34:13 2017 -0700

    don't abort upgrade if a customer doesn't have an echeck cust_main.paytype.  if it's not there, it's not there.

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 2b21cf1..d71ade0 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -5773,15 +5773,17 @@ sub _upgrade_data { #class method
       # at the time we do this, also migrate paytype into cust_pay_batch
       # so that batches that are open before the migration can still be 
       # processed
-      my @cust_pay_batch = qsearch('cust_pay_batch', {
-          'custnum' => $cust_main->custnum,
-          'payby'   => 'CHEK',
-          'paytype' => '',
-      });
-      foreach my $cust_pay_batch (@cust_pay_batch) {
-        $cust_pay_batch->set('paytype', $cust_main->get('paytype'));
-        my $error = $cust_pay_batch->replace;
-        die "$error (setting cust_pay_batch.paytype)" if $error;
+      if ( $cust_main->get('paytype') ) {
+        my @cust_pay_batch = qsearch('cust_pay_batch', {
+            'custnum' => $cust_main->custnum,
+            'payby'   => 'CHEK',
+            'paytype' => '',
+        });
+        foreach my $cust_pay_batch (@cust_pay_batch) {
+          $cust_pay_batch->set('paytype', $cust_main->get('paytype'));
+          my $error = $cust_pay_batch->replace;
+          die "$error (setting cust_pay_batch.paytype)" if $error;
+        }
       }
 
       $cust_main->complimentary('Y') if $cust_main->payby eq 'COMP';

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

Summary of changes:
 FS/FS/cust_main.pm |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list