This commit was generated by cvs2svn to compensate for changes in r6252,
[freeside.git] / FS / FS / cust_pay.pm
index 67f34c3..90a14ea 100644 (file)
@@ -698,9 +698,16 @@ sub _upgrade_data {  #class method
     return unless $cust_pay;
 
     my $h_cust_pay = $cust_pay->h_search('insert');
-    $cust_pay->otaker($h_cust_pay->history_user);
+    if ( $h_cust_pay ) {
+      $cust_pay->otaker($h_cust_pay->history_user);
+    } else {
+      $cust_pay->otaker('legacy');
+    }
+
+    delete $FS::payby::hash{'COMP'}->{cust_pay}; #quelle kludge
     my $error = $cust_pay->replace;
     die $error if $error;
+    $FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it
 
     $count++;
     if ( $DEBUG > 1 && $lastprog + 30 < time ) {