'seconds', 'int', 'NULL', '', '', '',
'weight', 'int', '', '', '', '',
'plan', 'varchar', 'NULL', $char_d, '', '',
+ 'plandata', 'text', 'NULL', '', '', '',
'reason', 'int', 'NULL', '', '', '',
'disabled', 'char', 'NULL', 1, '', '',
],
'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, '', '',
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 = '' ",
),
});
$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;
}