summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authormark <mark>2010-09-29 18:39:04 +0000
committermark <mark>2010-09-29 18:39:04 +0000
commit8faaca01acec8b6820d3bd9aaf2a4b240a91660b (patch)
tree67f9efa4f0ca97cf548cbb5f7f9677367101f885 /FS
parent19f051397b95490022d043001819963726055eb0 (diff)
restore missing signup dates during upgrade, RT#9972
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index b1b2753ea..fc781d2a5 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4609,9 +4609,13 @@ sub process_bill_and_collect {
sub _upgrade_data { #class method
my ($class, %opts) = @_;
- my $sql = 'UPDATE h_cust_main SET paycvv = NULL WHERE paycvv IS NOT NULL';
- my $sth = dbh->prepare($sql) or die dbh->errstr;
- $sth->execute or die $sth->errstr;
+ 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',
+ ) {
+ my $sth = dbh->prepare($sql) or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ }
local($ignore_expired_card) = 1;
local($ignore_illegal_zip) = 1;