agent-virtualize credit card surcharge percentage, RT#72961
[freeside.git] / FS / FS / part_pkg_option.pm
index 9708f11..2858ba7 100644 (file)
@@ -1,12 +1,10 @@
 package FS::part_pkg_option;
+use base qw(FS::Record);
 
 use strict;
-use vars qw( @ISA );
-use FS::Record qw( qsearch qsearchs dbh );
+use FS::Record qw( dbh ); # qw( qsearch qsearchs dbh );
 use FS::part_pkg;
 
-@ISA = qw(FS::Record);
-
 =head1 NAME
 
 FS::part_pkg_option - Object methods for part_pkg_option records
@@ -127,11 +125,20 @@ sub check {
 sub _upgrade_data {  # class method
   my ($class, %opts) = @_;
 
-  my $sql = "UPDATE part_pkg_option SETUP optionname = 'recur_fee'".
+  my $sql = "UPDATE part_pkg_option SET optionname = 'recur_fee'".
             " WHERE optionname = 'recur_flat'";
   my $sth = dbh->prepare($sql) or die dbh->errstr;
   $sth->execute or die $sth->errstr;
 
+  $sql = "UPDATE part_pkg_option SET optionname = 'recur_method',".
+            "optionvalue = 'prorate'  WHERE optionname = 'enable_prorate'";
+  $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;
   '';
 
 }