projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
99037cf
)
allow cust_pay.otaker upgrade to proceed even if there are some old crufty records...
author
ivan
<ivan>
Thu, 13 Mar 2008 08:57:41 +0000
(08:57 +0000)
committer
ivan
<ivan>
Thu, 13 Mar 2008 08:57:41 +0000
(08:57 +0000)
FS/FS/cust_pay.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pay.pm
b/FS/FS/cust_pay.pm
index
acb2844
..
de14610
100644
(file)
--- a/
FS/FS/cust_pay.pm
+++ b/
FS/FS/cust_pay.pm
@@
-673,7
+673,9
@@
sub _upgrade_data { #class method
#not the most efficient, but hey, it only has to run once
#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";
my $count_sql = "SELECT COUNT(*) FROM cust_pay $where";
@@
-705,7
+707,15
@@
sub _upgrade_data { #class method
delete $FS::payby::hash{'COMP'}->{cust_pay}; #quelle kludge
my $error = $cust_pay->replace;
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;
die $error if $error;
+
$FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it
$count++;
$FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it
$count++;