- my @invoice_details_sort;
-
- foreach my $cdr (@cdrs) {
-
- my $charge_min = $cdr->tmp_rated_minutes;
-
- my $charge = sprintf('%.4f', ( $min_charge * $charge_min )
- + 0.0000000001 ); #so 1.00005 rounds to 1.0001
-
-
- if ( $charge > 0 ) {
- $charges += $charge;
-
- my $detail =
- $cdr->downstream_csv( 'format' => $output_format,
- 'charge' => $charge,
- 'seconds' => ($use_duration ?
- $cdr->duration :
- $cdr->billsec),
- 'granularity' => $granularity,
- );
-
- my $call_details =
- { format => 'C',
- detail => $detail,
- amount => $charge,
- #classnum => $cdr->calltypenum, #classnum
- #phonenum => $phonenum, #XXX need this to sort on them
- accountcode => $cdr->accountcode,
- startdate => $cdr->startdate,
- duration => $cdr->tmp_rated_seconds,
- };
-
- #warn " adding details on charge to invoice: [ ".
- # join(', ', @{$call_details} ). " ]"
- # if ( $DEBUG && ref($call_details) );
- push @invoice_details_sort, [ $call_details, $cdr->calldate_unix ];
+
+ $options{'status'} = 'processing-tiered';
+
+ foreach my $cust_svc (@cust_svc) {
+
+ my $svc_x;
+ if( $self->option('bill_inactive_svcs',1) ) {
+ $svc_x = $cust_svc->h_svc_x($$sdate, $last_bill);