diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2018-10-01 12:03:01 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2018-10-01 12:03:01 -0700 |
| commit | d5988a9f7a3617de33da3058f2e9f1151b24420e (patch) | |
| tree | 3ed8d80cd6a81f160c76c90fcf089e81fe7ffddf /bin/cust_main.restore-paymask | |
| parent | 1ab515df162a76347d8146cae4ff34656cc4bcd3 (diff) | |
| parent | b6088672c87e2c5984183326b4c0e2d9bd6c34f6 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'bin/cust_main.restore-paymask')
| -rwxr-xr-x | bin/cust_main.restore-paymask | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/cust_main.restore-paymask b/bin/cust_main.restore-paymask index c6c8a75ec..14dddd1b5 100755 --- a/bin/cust_main.restore-paymask +++ b/bin/cust_main.restore-paymask @@ -15,10 +15,14 @@ foreach my $cust_main ( my $custnum = $cust_main->custnum; + my $paydate = $cust_main->paydate; + my $paymask = FS::Record->scalar_sql(qq[ - SELECT paymask FROM h_cust_main WHERE custnum = $custnum AND history_action = 'replace_old' AND paymask IS NOT NULL AND paymask != 'N/A (tokenized)' ORDER BY historynum desc LIMIT 1 + SELECT paymask FROM h_cust_main WHERE custnum = $custnum AND history_action = 'replace_old' AND paymask IS NOT NULL AND paymask != 'N/A (tokenized)' AND paydate = '$paydate' ORDER BY historynum desc LIMIT 1 ]); + next unless length($paymask); + #dbh->do( print qq[UPDATE cust_main SET paymask = '$paymask' WHERE custnum = $custnum;] |
