proceed with upgrade even when N/A cards can't be recovered
authorivan <ivan>
Sun, 25 Jul 2010 07:08:59 +0000 (07:08 +0000)
committerivan <ivan>
Sun, 25 Jul 2010 07:08:59 +0000 (07:08 +0000)
FS/FS/cust_pay.pm

index f15c85b..c55dd48 100644 (file)
@@ -770,6 +770,11 @@ sub _upgrade_data {  #class method
 
     my $cust_pay_pending =
       qsearchs('cust_pay_pending', { 'paynum' => $na->paynum } );
+    unless ( $cust_pay_pending ) {
+      warn " *** WARNING: not-yet recoverable N/A card for payment ".
+           $na->paynum. " (no cust_pay_pending)\n";
+      next;
+    }
     $na->$_($cust_pay_pending->$_) for qw( payinfo paymask );
     my $error = $na->replace;
     if ( $error ) {