summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/cust_main.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index e0855d847..806db00bd 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -5451,11 +5451,12 @@ sub _upgrade_next_recnum {
my $recnum = shift @$recnums;
return $recnum if $recnum;
my $tclass = 'FS::'.$table;
+ my $paycardtypecheck = ($table ne 'cust_pay_pending') ? q( OR paycardtype = 'Tokenized') : '';
my $sql = 'SELECT '.$tclass->primary_key.
' FROM '.$table.
' WHERE '.$tclass->primary_key.' > '.$$lastrecnum.
" AND payby IN ( 'CARD', 'DCRD', 'CHEK', 'DCHK' ) ".
- " AND ( length(payinfo) < 80 OR paycardtype = 'Tokenized' ) ".
+ " AND ( length(payinfo) < 80$paycardtypecheck ) ".
' ORDER BY '.$tclass->primary_key.' LIMIT 500';
my $sth = $dbh->prepare($sql) or die $dbh->errstr;
$sth->execute() or die $sth->errstr;