summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2010-10-23 08:33:30 +0000
committermark <mark>2010-10-23 08:33:30 +0000
commit3ebd1b1c76dde66e1204f0b678a2620cbd5ae254 (patch)
treeaf47e23f82ecbb9998f8fdc9eae1eecb67c89f16
parent701d8f35fff2ed748efa6b46cd3cf9cc46e47729 (diff)
fix contract_end bug, RT#10319
-rw-r--r--FS/FS/cust_pkg.pm3
-rw-r--r--FS/FS/part_pkg_option.pm4
2 files changed, 7 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index cad18b628..c810f131f 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -3251,6 +3251,9 @@ sub bulk_change {
sub _upgrade_data { # class method
my ($class, %opts) = @_;
$class->_upgrade_otaker(%opts);
+ my $sql =('UPDATE cust_pkg SET contract_end = NULL WHERE contract_end = -1');
+ my $sth = dbh->prepare($sql);
+ $sth->execute or die $sth->errstr;
}
=back
diff --git a/FS/FS/part_pkg_option.pm b/FS/FS/part_pkg_option.pm
index 3cb330b1f..142622bf5 100644
--- a/FS/FS/part_pkg_option.pm
+++ b/FS/FS/part_pkg_option.pm
@@ -137,6 +137,10 @@ sub _upgrade_data { # class method
$sth = dbh->prepare($sql) or die dbh->errstr;
$sth->execute or die $sth->errstr;
+ $sql = "UPDATE part_pkg_option SET optionvalue = NULL WHERE ".
+ "optionname = 'contract_end_months' AND optionvalue = '(none)'";
+ $sth = dbh->prepare($sql) or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
'';
}