[freeside-commits] freeside/FS/FS cust_pay.pm,1.50.2.11,1.50.2.12

Ivan,,, ivan at wavetail.420.am
Thu Mar 13 01:57:46 PDT 2008


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

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_pay.pm 
Log Message:
allow cust_pay.otaker upgrade to proceed even if there are some old crufty records around attached to now-deleted customers

Index: cust_pay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay.pm,v
retrieving revision 1.50.2.11
retrieving revision 1.50.2.12
diff -u -d -r1.50.2.11 -r1.50.2.12
--- cust_pay.pm	4 Mar 2008 21:06:43 -0000	1.50.2.11
+++ cust_pay.pm	13 Mar 2008 08:57:43 -0000	1.50.2.12
@@ -673,7 +673,9 @@
 
   #not the most efficient, but hey, it only has to run once
 
-  my $where = "WHERE otaker IS NULL OR otaker = '' OR otaker = 'ivan' ";
+  my $where = "WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) ".
+              "  AND 0 < ( SELECT COUNT(*) FROM cust_main                 ".
+              "              WHERE cust_main.custnum = cust_pay.custnum ) ";
 
   my $count_sql = "SELECT COUNT(*) FROM cust_pay $where";
 
@@ -705,7 +707,15 @@
 
     delete $FS::payby::hash{'COMP'}->{cust_pay}; #quelle kludge
     my $error = $cust_pay->replace;
+
+    #infinite...
+    #if ( $error ) {
+    #  warn " *** WARNING: Error updaating order taker for payment paynum".
+    #       $cust_pay->paynun. ": $error\n";
+    #  next;
+    #}
     die $error if $error;
+
     $FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it
 
     $count++;



More information about the freeside-commits mailing list