[freeside-commits] freeside/FS/FS cust_bill.pm, 1.299.2.19, 1.299.2.20

Erik Levinson levinse at wavetail.420.am
Tue Feb 22 13:18:24 PST 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv30251/FS/FS

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	cust_bill.pm 
Log Message:
invoice customizations, RT11467

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.299.2.19
retrieving revision 1.299.2.20
diff -u -w -d -r1.299.2.19 -r1.299.2.20
--- cust_bill.pm	21 Feb 2011 18:29:49 -0000	1.299.2.19
+++ cust_bill.pm	22 Feb 2011 21:18:22 -0000	1.299.2.20
@@ -4161,6 +4161,9 @@
       # 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 @@
 	    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 @@
 	    }
 	}
       }
+
+      # 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];
+		my @newextdesc;
+		foreach my $extdesc ( @extdesc ) {
 		$extdesc =~ s/scriptsize/normalsize/g if $format eq 'latex';
-		$line->{'ext_description'} = [ $extdesc ];
+		    push @newextdesc, $extdesc;
+		}
+		$line->{'ext_description'} = \@newextdesc;
 		$line->{'section'} = $newsection;
 		push @newlines, $line;
 	    }
 	}
       }
+
       return(\@newsections, \@newlines);
   }
 



More information about the freeside-commits mailing list