in rated CDR packages, multiply included minutes by package quantity, #71003
[freeside.git] / FS / FS / part_pkg / voip_sqlradacct.pm
index b856b5c..299d5c1 100644 (file)
@@ -19,10 +19,7 @@ $DEBUG = 1;
   'inherit_fields' => [ 'global_Mixin' ],
   'fields' => {
     'ratenum'   => { 'name' => 'Rate plan',
-                     'type' => 'select',
-                     'select_table' => 'rate',
-                     'select_key'   => 'ratenum',
-                     'select_label' => 'ratename',
+                     'type' => 'select-rate',
                    },
   },
   'fieldorder' => [qw( ratenum ignore_unrateable )],
@@ -31,7 +28,7 @@ $DEBUG = 1;
 
 sub price_info {
     my $self = shift;
-    my $str = $self->SUPER::price_info;
+    my $str = $self->SUPER::price_info(@_);
     $str .= " plus usage" if $str;
     $str;
 }
@@ -134,7 +131,8 @@ sub calc_recur {
       # find the price and add detail to the invoice
       ###
 
-      $included_min{$regionnum} = $rate_detail->min_included
+      $included_min{$regionnum} =
+          ($rate_detail->min_included * $cust_pkg->quantity || 1)
         unless exists $included_min{$regionnum};
 
       my $granularity = $rate_detail->sec_granularity;