X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay.pm;h=ab8113381a4ce94326b5967901f56b89d3e9d639;hb=e3dffa23a03cd9f88946ceb78bc75ada29bc013a;hp=de14610d655ced2afe7612b24076173c2821d03e;hpb=188c20600560139fc40811c6538a18109c050f95;p=freeside.git diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index de14610d6..ab8113381 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -687,19 +687,19 @@ sub _upgrade_data { #class method my $count = 0; my $lastprog = 0; - while (1) { - my $cust_pay = qsearchs( { + my @cust_pay = qsearch( { 'table' => 'cust_pay', 'hashref' => {}, 'extra_sql' => $where, - 'order_by' => 'ORDER BY paynum LIMIT 1', - } ); + 'order_by' => 'ORDER BY paynum', + } ); - return unless $cust_pay; + foreach my $cust_pay (@cust_pay) { my $h_cust_pay = $cust_pay->h_search('insert'); if ( $h_cust_pay ) { + next if $cust_pay->otaker eq $h_cust_pay->history_user; $cust_pay->otaker($h_cust_pay->history_user); } else { $cust_pay->otaker('legacy'); @@ -708,13 +708,11 @@ sub _upgrade_data { #class method 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