diff options
author | Mark Wells <mark@freeside.biz> | 2014-10-31 15:45:50 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-10-31 15:45:50 -0700 |
commit | 7516e3da0f17eeecba27219ef96a8b5f46af2083 (patch) | |
tree | 772fe13627910a7d0774871633697f2a4d1c6faf /FS/FS/detail_format | |
parent | f31a9212ab3835b815aa87a86cca3b19babcaaff (diff) |
tax engine refactoring for Avalara and Billsoft tax vendors, #25718
Diffstat (limited to 'FS/FS/detail_format')
-rw-r--r-- | FS/FS/detail_format/sum_count.pm | 4 | ||||
-rw-r--r-- | FS/FS/detail_format/sum_duration.pm | 4 | ||||
-rw-r--r-- | FS/FS/detail_format/sum_duration_prefix.pm | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/FS/FS/detail_format/sum_count.pm b/FS/FS/detail_format/sum_count.pm index c40fcb8..253956f 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. @@ -33,6 +34,8 @@ sub append { $subtotal->{count}++; $subtotal->{amount} += $object->rated_price if $object->freesidestatus ne 'no-charge'; + + push @$acctids, $cdr->acctid; } } @@ -68,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 diff --git a/FS/FS/detail_format/sum_duration.pm b/FS/FS/detail_format/sum_duration.pm index 1b967b4..c41bed3 100644 --- a/FS/FS/detail_format/sum_duration.pm +++ b/FS/FS/detail_format/sum_duration.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. @@ -34,6 +35,8 @@ sub append { $subtotal->{duration} += $object->rated_seconds; $subtotal->{amount} += $object->rated_price if $object->freesidestatus ne 'no-charge'; + + push @$acctids, $cdr->acctid; } } @@ -70,6 +73,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 diff --git a/FS/FS/detail_format/sum_duration_prefix.pm b/FS/FS/detail_format/sum_duration_prefix.pm index cd7bbe3..3c33dc1 100644 --- a/FS/FS/detail_format/sum_duration_prefix.pm +++ b/FS/FS/detail_format/sum_duration_prefix.pm @@ -24,6 +24,7 @@ my $prefix_length = 6; sub append { my $self = shift; my $prefixes = ($self->{prefixes} ||= {}); + my $acctids = ($self->{acctids} ||= []); foreach my $cdr (@_) { my (undef, $phonenum) = $cdr->parse_number( column => ( $self->{inbound} ? 'src' : 'dst' ), @@ -52,6 +53,8 @@ sub append { $subtotal->{duration} += $object->rated_seconds; $subtotal->{amount} += $object->rated_price if $object->freesidestatus ne 'no-charge'; + + push @$acctids, $cdr->acctid; } } @@ -91,6 +94,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 $prefix } |