CDR type separation and summary formats, #15535
[freeside.git] / FS / FS / part_pkg.pm
index 70b896c..ed5fa96 100644 (file)
@@ -1296,6 +1296,9 @@ sub calc_units  { 0; }
 #fallback for everything except bulk.pm
 sub hide_svc_detail { 0; }
 
+#fallback for packages that can't/won't summarize usage
+sub sum_usage { 0; }
+
 =item recur_cost_permonth CUST_PKG
 
 recur_cost divided by freq (only supported for monthly and longer frequencies)
@@ -1362,8 +1365,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 +1375,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;
 
   }