From 9792616eca51979fbc18cfff9b3d2f5360af8d0e Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 24 Oct 2011 21:21:05 +0000 Subject: [PATCH 1/1] fix display of duration on inbound packages with use_duraiton, RT#14370 --- FS/FS/part_pkg/voip_inbound.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/FS/FS/part_pkg/voip_inbound.pm b/FS/FS/part_pkg/voip_inbound.pm index ec7dad6bd..e3af5aaf5 100644 --- a/FS/FS/part_pkg/voip_inbound.pm +++ b/FS/FS/part_pkg/voip_inbound.pm @@ -272,12 +272,16 @@ sub calc_usage { if ( $charge > 0 ) { $charges += $charge; - my @call_details = ($cdr->downstream_csv( 'format' => $output_format, - 'charge' => $charge, - 'minutes' => $minutes, - 'granularity' => $granularity, - ) - ); + my @call_details = ( + $cdr->downstream_csv( 'format' => $output_format, + 'charge' => $charge, + 'seconds' => ($use_duration + ? $cdr->duration + : $cdr->billsec + ), + 'granularity' => $granularity, + ) + ); push @$details, [ 'C', $call_details[0], -- 2.11.0