+ } elsif ( $rating_method eq 'single_price' ) {
+
+ # a little false laziness w/below
+
+ my $granularity = 60;
+
+ # length($cdr->billsec) ? $cdr->billsec : $cdr->duration;
+ my $seconds = $use_duration ? $cdr->duration : $cdr->billsec;
+
+ $seconds += $granularity - ( $seconds % $granularity )
+ if $seconds # don't granular-ize 0 billsec calls (bills them)
+ ;#&& $granularity; # 0 is per call
+ my $minutes = sprintf("%.1f", $seconds / 60);
+ $minutes =~ s/\.0$// ;# if $granularity == 60;
+
+ $charge = sprintf('%.2f', ( $self->option('min_charge') * $minutes )
+ + 0.00000001 ); #so 1.005 rounds to 1.01
+
+ $charge =
+ $charges += $charge;
+
+ @call_details = ($cdr->downstream_csv( 'format' => $output_format,
+ 'charge' => $charge,
+ )
+ );
+