[freeside-commits] freeside/FS/FS cdr.pm,1.66.2.3,1.66.2.4
Ivan,,,
ivan at wavetail.420.am
Sun Apr 10 10:07:29 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv13850
Modified Files:
Tag: FREESIDE_2_1_BRANCH
cdr.pm
Log Message:
fix rounding of minute-granularity CDRs, RT#12101
Index: cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr.pm,v
retrieving revision 1.66.2.3
retrieving revision 1.66.2.4
diff -u -w -d -r1.66.2.3 -r1.66.2.4
--- cdr.pm 21 Feb 2011 16:36:41 -0000 1.66.2.3
+++ cdr.pm 10 Apr 2011 17:07:27 -0000 1.66.2.4
@@ -552,8 +552,7 @@
my $conf = new FS::Conf;
my $date_format = $conf->config('date_format') || '%m/%d/%Y';
- # This is now smarter, and shows the call duration in the
- # largest units that accurately reflect the granularity.
+ # call duration in the largest units that accurately reflect the granularity
my $duration_sub = sub {
my($cdr, %opt) = @_;
my $sec = $opt{seconds} || $cdr->billsec;
@@ -562,7 +561,9 @@
return '1 call';
}
elsif ( $opt{granularity} == 60 ) {#full minutes
- return sprintf("%.0fm",$sec/60);
+ my $min = int($sec/60);
+ $min++ if $sec%60;
+ return $min.'m';
}
else { #anything else
return sprintf("%dm %ds", $sec/60, $sec%60);
More information about the freeside-commits
mailing list