[freeside-commits] branch master updated. b664241d5e97c8bd2c2d44a961d08aa8c1f0feb5

Ivan ivan at 420.am
Thu Feb 4 10:24:55 PST 2016


The branch, master has been updated
       via  b664241d5e97c8bd2c2d44a961d08aa8c1f0feb5 (commit)
      from  51bb83f4d08859d1b5a2a2b49c74fa52ad8d15f4 (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 b664241d5e97c8bd2c2d44a961d08aa8c1f0feb5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Feb 4 10:24:49 2016 -0800

    in a new 5.x install, don't try to upgrade from 3.x-style payby, those fields are gone

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index a15a369..206f1b0 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -5144,71 +5144,6 @@ sub _upgrade_data { #class method
 
   }
 
-  unless ( FS::upgrade_journal->is_done('cust_main__cust_payby') ) {
-
-    #we don't want to decrypt them, just stuff them as-is into cust_payby
-    local(@encrypted_fields) = ();
-
-    local($FS::cust_payby::ignore_expired_card) = 1;
-    local($FS::cust_payby::ignore_banned_card) = 1;
-
-    my @payfields = qw( payby payinfo paycvv paymask
-                        paydate paystart_month paystart_year payissue
-                        payname paystate paytype payip
-                      );
-
-    my $search = new FS::Cursor {
-      'table'     => 'cust_main',
-      'extra_sql' => " WHERE ( payby IS NOT NULL AND payby != '' ) ",
-    };
-
-    while (my $cust_main = $search->fetch) {
-
-      unless ( $cust_main->payby =~ /^(BILL|COMP)$/ ) {
-
-        my $cust_payby = new FS::cust_payby {
-          'custnum' => $cust_main->custnum,
-          'weight'  => 1,
-          map { $_ => $cust_main->$_(); } @payfields
-        };
-
-        my $error = $cust_payby->insert;
-        die $error if $error;
-
-      }
-
-      # 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;
-      }
-
-      $cust_main->complimentary('Y') if $cust_main->payby eq 'COMP';
-
-      $cust_main->invoice_attn( $cust_main->payname )
-        if $cust_main->payby eq 'BILL' && $cust_main->payname;
-      $cust_main->po_number( $cust_main->payinfo )
-        if $cust_main->payby eq 'BILL' && $cust_main->payinfo;
-
-      $cust_main->setfield($_, '') foreach @payfields;
-      my $error = $cust_main->replace;
-      die "Error upgradging payment information for custnum ".
-          $cust_main->custnum. ": $error"
-        if $error;
-
-    };
-
-    FS::upgrade_journal->set_done('cust_main__cust_payby');
-  }
-
   $class->_upgrade_otaker(%opts);
 
 }

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

Summary of changes:
 FS/FS/cust_main.pm |   65 ----------------------------------------------------
 1 file changed, 65 deletions(-)




More information about the freeside-commits mailing list