summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevinse <levinse>2011-02-22 21:18:22 +0000
committerlevinse <levinse>2011-02-22 21:18:22 +0000
commit4798f202bfbf344a6e72c5a8ca2fe116bfe0b908 (patch)
tree33a30e66917faba49216d95aca51a5cfa6f5336d
parentff66f46fe9bf4da32aa1f16807bdffd5fa8e0386 (diff)
invoice customizations, RT11467
-rw-r--r--FS/FS/cust_bill.pm22
1 files changed, 17 insertions, 5 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 95a3a991d..9fbe34e94 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -4161,6 +4161,9 @@ sub _items_svc_phone_sections {
# this only works with Latex
my @newlines;
my @newsections;
+
+ # after this, we'll have only two sections per DID:
+ # Calls Summary and Calls Detail
foreach my $section ( @sections ) {
if($section->{'post_total'}) {
$section->{'description'} = 'Calls Summary: '.$section->{'phonenum'};
@@ -4183,8 +4186,11 @@ sub _items_svc_phone_sections {
push @newsections, \%calls_detail;
}
}
+
+ # after this, each usage class is collapsed/summarized into a single
+ # line under the Calls Summary section
foreach my $newsection ( @newsections ) {
- if($newsection->{'post_total'}) {
+ if($newsection->{'post_total'}) { # this means Calls Summary
foreach my $section ( @sections ) {
next unless ($section->{'phonenum'} eq $newsection->{'phonenum'}
&& !$section->{'post_total'});
@@ -4206,21 +4212,27 @@ sub _items_svc_phone_sections {
}
}
}
+
+ # after this, Calls Details is populated with all CDRs
foreach my $newsection ( @newsections ) {
- if(!$newsection->{'post_total'}) {
+ if(!$newsection->{'post_total'}) { # this means Calls Details
foreach my $line ( @lines ) {
next unless (scalar(@{$line->{'ext_description'}}) &&
$line->{'section'}->{'phonenum'} eq $newsection->{'phonenum'}
);
my @extdesc = @{$line->{'ext_description'}};
- my $extdesc = $extdesc[0];
- $extdesc =~ s/scriptsize/normalsize/g if $format eq 'latex';
- $line->{'ext_description'} = [ $extdesc ];
+ my @newextdesc;
+ foreach my $extdesc ( @extdesc ) {
+ $extdesc =~ s/scriptsize/normalsize/g if $format eq 'latex';
+ push @newextdesc, $extdesc;
+ }
+ $line->{'ext_description'} = \@newextdesc;
$line->{'section'} = $newsection;
push @newlines, $line;
}
}
}
+
return(\@newsections, \@newlines);
}