[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm, 1.130, 1.131
Mark Wells
mark at wavetail.420.am
Fri Dec 16 14:06:30 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv23507/FS/FS/part_pkg
Modified Files:
voip_cdr.pm
Log Message:
better summarization of zero-charge CDRs, #15535
Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -w -d -r1.130 -r1.131
--- voip_cdr.pm 13 Dec 2011 20:40:28 -0000 1.130
+++ voip_cdr.pm 16 Dec 2011 22:06:28 -0000 1.131
@@ -788,8 +788,9 @@
} #if(there is a rate_detail)
- if ( $charge > 0 ) {
- #just use FS::cust_bill_pkg_detail objects?
+ #if ( $charge > 0 ) {
+ # generate a detail record for every call; filter out $charge = 0
+ # later.
my $call_details;
my $phonenum = $svc_x->phonenum;
@@ -821,7 +822,7 @@
};
}
push @invoice_details_sort, [ $call_details, $cdr->calldate_unix ];
- }
+ #} $charge > 0
# if the customer flag is on, call "downstream_csv" or something
# like it to export the call downstream!
@@ -844,10 +845,13 @@
my @sorted_invoice_details =
sort { @{$a}[1] <=> @{$b}[1] } @invoice_details_sort;
foreach my $sorted_call_detail ( @sorted_invoice_details ) {
- push @$details, @{$sorted_call_detail}[0];
+ my $d = $sorted_call_detail->[0];
+ push @$details, $d if $d->{amount} > 0;
}
}
else { #$self->sum_usage
+ my $count = scalar(@invoice_details_sort);
+ if ( $count > 0 ) {
my $sum_detail = {
amount => 0,
format => 'C',
@@ -872,11 +876,11 @@
seconds => $sum_detail->{duration},
charge => sprintf('%.2f',$sum_detail->{amount}),
phonenum => $sum_detail->{phonenum},
- count => scalar(@invoice_details_sort),
+ count => $count,
);
push @$details, $sum_detail;
+ } # if $count > 0
} #if $self->sum_usage
-
} # $cust_svc
unshift @$details, { format => 'C',
More information about the freeside-commits
mailing list