diff options
| author | ivan <ivan> | 2010-09-30 01:11:08 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2010-09-30 01:11:08 +0000 |
| commit | 02698a28301ecc52f55660d8c18539524a9d10b2 (patch) | |
| tree | 21531fe341e6c6fe5d64da370273093413a080e5 | |
| parent | a4b49caf753d9001a4a71de847b1126a2de6d8ab (diff) | |
improve signup date recovery, especially in the edit case
| -rw-r--r-- | FS/FS/cust_main.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index fc781d2a5..d9cf8686c 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -4611,7 +4611,7 @@ sub _upgrade_data { #class method foreach my $sql ( 'UPDATE h_cust_main SET paycvv = NULL WHERE paycvv IS NOT NULL', - 'UPDATE cust_main SET signupdate = (SELECT signupdate FROM h_cust_main WHERE h_cust_main.custnum = cust_main.custnum ORDER BY historynum ASC LIMIT 1) WHERE signupdate IS NULL', + 'UPDATE cust_main SET signupdate = (SELECT signupdate FROM h_cust_main WHERE signupdate IS NOT NULL AND h_cust_main.custnum = cust_main.custnum ORDER BY historynum DESC LIMIT 1) WHERE signupdate IS NULL', ) { my $sth = dbh->prepare($sql) or die dbh->errstr; $sth->execute or die $sth->errstr; |
