X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=4e602e750ddf226a24e6b31688598a1af9e18813;hb=3655e84e27d09f175d992f175d3cfb8a1f2c0c09;hp=89d35eeb51e425a2ba7300c2ce9a81a19e750055;hpb=055fa6decdbd89e00f2b6e3faf77b068eea38c93;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 89d35eeb5..4e602e750 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -9805,7 +9805,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;