From f68b9a8351fc3fc22c39249e070ecb0c51c59347 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 14 Sep 2011 19:26:37 +0000 Subject: [PATCH] removing legacy part_pkg fields --- FS/FS/Schema.pm | 2 +- FS/FS/part_pkg.pm | 40 +--------------------------------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 187887f26..694498ea2 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -576,6 +576,7 @@ sub tables_hashref { 'seconds', 'int', 'NULL', '', '', '', 'weight', 'int', '', '', '', '', 'plan', 'varchar', 'NULL', $char_d, '', '', + 'plandata', 'text', 'NULL', '', '', '', 'reason', 'int', 'NULL', '', '', '', 'disabled', 'char', 'NULL', 1, '', '', ], @@ -1624,7 +1625,6 @@ sub tables_hashref { 'setuptax', 'char', 'NULL', 1, '', '', 'recurtax', 'char', 'NULL', 1, '', '', 'plan', 'varchar', 'NULL', $char_d, '', '', - 'plandata', 'text', 'NULL', '', '', '', 'disabled', 'char', 'NULL', 1, '', '', 'custom', 'char', 'NULL', 1, '', '', 'taxclass', 'varchar', 'NULL', $char_d, '', '', diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 70b896c34..44db5473e 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -1362,8 +1362,6 @@ sub _upgrade_data { # class method my @part_pkg = qsearch({ 'table' => 'part_pkg', 'extra_sql' => "WHERE ". join(' OR ', - ( map "($_ IS NOT NULL AND $_ != '' )", - qw( plandata setup recur ) ), 'plan IS NULL', "plan = '' ", ), }); @@ -1374,43 +1372,7 @@ sub _upgrade_data { # class method $part_pkg->plan('flat'); } - if ( length($part_pkg->option('setup_fee')) == 0 - && $part_pkg->setup =~ /^\s*([\d\.]+)\s*$/ ) { - - my $opt = new FS::part_pkg_option { - 'pkgpart' => $part_pkg->pkgpart, - 'optionname' => 'setup_fee', - 'optionvalue' => $1, - }; - my $error = $opt->insert; - die $error if $error; - - - #} else { - # die "Can't parse part_pkg.setup for fee; convert pkgnum ". - # $part_pkg->pkgnum. " manually: ". $part_pkg->setup. "\n"; - } - $part_pkg->setup(''); - - if ( length($part_pkg->option('recur_fee')) == 0 - && $part_pkg->recur =~ /^\s*([\d\.]+)\s*$/ ) { - - my $opt = new FS::part_pkg_option { - 'pkgpart' => $part_pkg->pkgpart, - 'optionname' => 'recur_fee', - 'optionvalue' => $1, - }; - my $error = $opt->insert; - die $error if $error; - - - #} else { - # die "Can't parse part_pkg.setup for fee; convert pkgnum ". - # $part_pkg->pkgnum. " manually: ". $part_pkg->setup. "\n"; - } - $part_pkg->recur(''); - - $part_pkg->replace; #this should take care of plandata, right? + $part_pkg->replace; } -- 2.11.0