X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr.pm;h=4d4c767f0da8a52f6d3d3836bfd476aea3bb55d7;hb=a846aefc07208e8c4c0b0f223b90918828ce2bb4;hp=b3cceb4aab5e4dc12471f59c2e598d3b75513dd8;hpb=b0c05606c571c67e750ccd3c34c35d5e77345aba;p=freeside.git diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index b3cceb4aa..4d4c767f0 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -495,8 +495,9 @@ sub set_status_and_rated_price { rated_price => $rated_price, status => $status, }); - $term->rated_seconds($opt{rated_seconds}) if exists($opt{rated_seconds}); - $term->rated_minutes($opt{rated_minutes}) if exists($opt{rated_minutes}); + foreach (qw(rated_seconds rated_minutes rated_granularity)) { + $term->set($_, $opt{$_}) if exists($opt{$_}); + } $term->svcnum($svcnum) if $svcnum; return $term->insert; @@ -927,8 +928,10 @@ sub rate_prefix { # by default, set the included minutes for this region/time to # what's in the rate_detail - $included_min->{$regionnum}{$ratetimenum} = $rate_detail->min_included - unless exists $included_min->{$regionnum}{$ratetimenum}; + if (!exists( $included_min->{$regionnum}{$ratetimenum} )) { + $included_min->{$regionnum}{$ratetimenum} = + ($rate_detail->min_included * $cust_pkg->quantity || 1); + } if ( $included_min->{$regionnum}{$ratetimenum} >= $minutes ) { $charge_sec = 0; @@ -1262,6 +1265,10 @@ my %export_names = ( 'name' => 'Number of calls, one line per service', 'invoice_header' => 'Caller,Rate,Messages,Price', }, + 'sum_duration' => { + 'name' => 'Summary, one line per service', + 'invoice_header' => 'Caller,Rate,Calls,Minutes,Price', + }, 'sum_duration_prefix' => { 'name' => 'Summary, one line per destination prefix', 'invoice_header' => 'Caller,Rate,Calls,Minutes,Price', @@ -1270,6 +1277,10 @@ my %export_names = ( 'name' => 'Summary, one line per usage class', 'invoice_header' => 'Caller,Class,Calls,Price', }, + 'sum_duration_accountcode' => { + 'name' => 'Summary, one line per accountcode', + 'invoice_header' => 'Caller,Rate,Calls,Minutes,Price', + }, ); my %export_formats = ();