[freeside-commits] freeside/FS/FS cust_pay.pm,1.50.2.12,1.50.2.13
Ivan,,,
ivan at wavetail.420.am
Thu Mar 13 02:15:02 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv13145
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cust_pay.pm
Log Message:
infinite loop protection
Index: cust_pay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay.pm,v
retrieving revision 1.50.2.12
retrieving revision 1.50.2.13
diff -u -d -r1.50.2.12 -r1.50.2.13
--- cust_pay.pm 13 Mar 2008 08:57:43 -0000 1.50.2.12
+++ cust_pay.pm 13 Mar 2008 09:15:00 -0000 1.50.2.13
@@ -687,6 +687,7 @@
my $count = 0;
my $lastprog = 0;
+ my %seen = ();
while (1) {
my $cust_pay = qsearchs( {
@@ -698,6 +699,8 @@
return unless $cust_pay;
+ next if $seen{$cust_pay->paynum}++;
+
my $h_cust_pay = $cust_pay->h_search('insert');
if ( $h_cust_pay ) {
$cust_pay->otaker($h_cust_pay->history_user);
@@ -708,13 +711,11 @@
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;
+ if ( $error ) {
+ warn " *** WARNING: Error updaating order taker for payment paynum".
+ $cust_pay->paynun. ": $error\n";
+ next;
+ }
$FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it
More information about the freeside-commits
mailing list