[freeside-commits] freeside/FS/FS cust_pay.pm,1.77,1.78

Ivan,,, ivan at wavetail.420.am
Thu Jun 17 12:45:47 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv29220

Modified Files:
	cust_pay.pm 
Log Message:
fix fallout from N/A payinfo, RT#8809

Index: cust_pay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay.pm,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -w -d -r1.77 -r1.78
--- cust_pay.pm	11 Jun 2010 21:17:47 -0000	1.77
+++ cust_pay.pm	17 Jun 2010 19:45:45 -0000	1.78
@@ -693,6 +693,10 @@
 
   warn "$me upgrading $class\n" if $DEBUG;
 
+  ##
+  # otaker/ivan upgrade
+  ##
+
   #not the most efficient, but hey, it only has to run once
 
   my $where = "WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) ".
@@ -748,6 +752,33 @@
 
   }
 
+  ###
+  # payinfo N/A upgrade
+  ###
+
+  my @na_cust_pay = qsearch( {
+    'table'     => 'cust_pay',
+    'hashref'   => { 'payinfo' => 'N/A' },
+    'extra_sql' => "AND payby IN ( 'CARD', 'CHEK' )",
+  } );
+
+  foreach my $na ( @na_cust_pay ) {
+    my $cust_pay_pending =
+      qsearchs('cust_pay_pending', { 'paynum' => $na->paynum } );
+    $na->$_($cust_pay_pending->$_) for qw( payinfo paymask );
+    my $error = $na->replace;
+    if ( $error ) {
+      warn " *** WARNING: Error updating payinfo for payment paynum ".
+           $na->paynun. ": $error\n";
+      next;
+    }
+
+  }
+
+  ###
+  # otaker->usernum upgrade
+  ###
+
   $class->_upgrade_otaker(%opts);
 
 }



More information about the freeside-commits mailing list