X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fdetail_format%2Fsum_count.pm;h=253956f0d6d6ec64ea3db629de1558f27e597c62;hb=7516e3da0f17eeecba27219ef96a8b5f46af2083;hp=5cf87c7f414de862da75a34d9857485403f212e2;hpb=a25b4a4f96f93c8824d9e5a02591d464848d4f75;p=freeside.git diff --git a/FS/FS/detail_format/sum_count.pm b/FS/FS/detail_format/sum_count.pm index 5cf87c7f4..253956f0d 100644 --- a/FS/FS/detail_format/sum_count.pm +++ b/FS/FS/detail_format/sum_count.pm @@ -24,6 +24,7 @@ sub header_detail { sub append { my $self = shift; my $svcnums = ($self->{svcnums} ||= {}); + my $acctids = $self->{acctids} ||= []; foreach my $cdr (@_) { my $object = $self->{inbound} ? $cdr->cdr_termination(1) : $cdr; my $svcnum = $object->svcnum; # yes, $object->svcnum. @@ -31,7 +32,10 @@ sub append { my $subtotal = ($svcnums->{$svcnum} ||= { count => 0, duration => 0, amount => 0 }); $subtotal->{count}++; - $subtotal->{amount} += $object->rated_price; + $subtotal->{amount} += $object->rated_price + if $object->freesidestatus ne 'no-charge'; + + push @$acctids, $cdr->acctid; } } @@ -67,6 +71,7 @@ sub finish { startdate => '', #could use the earliest startdate in the bunch? regionname => '', #no, we're using prefix instead detail => $self->csv->string, + acctid => $self->{acctids}, }); } #foreach $svcnum