X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fdetail_format%2Fsum_duration_prefix.pm;h=cd7bbe3cc9d41c93c22617137ae6302fc85b0a3b;hb=ce27e05645c490fb75c21395b4f6f79d8f4e81e7;hp=d70ad0e5ae612d082f295c82ef99234a4c5df546;hpb=81a993ab0d0f15d896144f60cbf9477fdf693f76;p=freeside.git diff --git a/FS/FS/detail_format/sum_duration_prefix.pm b/FS/FS/detail_format/sum_duration_prefix.pm index d70ad0e5a..cd7bbe3cc 100644 --- a/FS/FS/detail_format/sum_duration_prefix.pm +++ b/FS/FS/detail_format/sum_duration_prefix.pm @@ -25,7 +25,10 @@ sub append { my $self = shift; my $prefixes = ($self->{prefixes} ||= {}); foreach my $cdr (@_) { - my $phonenum = $self->{inbound} ? $cdr->src : $cdr->dst; + my (undef, $phonenum) = $cdr->parse_number( + column => ( $self->{inbound} ? 'src' : 'dst' ), + ); + $phonenum =~ /^(\d{$prefix_length})/; my $prefix = $1 || 'other'; warn "$me appending ".$cdr->dst." to $prefix\n" if $DEBUG; @@ -71,7 +74,7 @@ sub finish { $prefix, map({ $_->{count}, - (int($_->{duration}/60) . ' min'), + sprintf('%.01f min', $_->{duration}/60), } @subtotals ), $self->money_char . sprintf('%.02f',$total_amount), );