[freeside-commits] freeside/FS/FS cust_bill.pm, 1.299.2.6, 1.299.2.7

Ivan,,, ivan at wavetail.420.am
Fri Feb 4 18:38:47 PST 2011


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

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	cust_bill.pm 
Log Message:
add some debug tracing to invoice generation, RT#11452

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.299.2.6
retrieving revision 1.299.2.7
diff -u -w -d -r1.299.2.6 -r1.299.2.7
--- cust_bill.pm	31 Jan 2011 06:23:33 -0000	1.299.2.6
+++ cust_bill.pm	5 Feb 2011 02:38:45 -0000	1.299.2.7
@@ -2186,6 +2186,9 @@
                      'template' => [ '{', '}' ],
                    );
 
+  warn "$me print_generic creating template\n"
+    if $DEBUG > 1;
+
   #create the template
   my $template = $params{template} ? $params{template} : $self->_agent_template;
   my $templatefile = "invoice_$format";
@@ -2203,12 +2206,18 @@
     @invoice_template = _translate_old_latex_format(@invoice_template);
   } 
 
+  warn "$me print_generic creating T:T object\n"
+    if $DEBUG > 1;
+
   my $text_template = new Text::Template(
     TYPE => 'ARRAY',
     SOURCE => \@invoice_template,
     DELIMITERS => $delimiters{$format},
   );
 
+  warn "$me print_generic compiling T:T object\n"
+    if $DEBUG > 1;
+
   $text_template->compile()
     or die "Can't compile $templatefile: $Text::Template::ERROR\n";
 
@@ -2322,6 +2331,8 @@
                            );
   my $embolden_function = $embolden_functions{$format};
 
+  warn "$me generating template variables\n"
+    if $DEBUG > 1;
 
   # generate template variables
   my $returnaddress;
@@ -2375,6 +2386,9 @@
 
   }
 
+  warn "$me generating invoice data\n"
+    if $DEBUG > 1;
+
   my $agentnum = $self->cust_main->agentnum;
 
   my %invoice_data = (
@@ -2497,7 +2511,9 @@
   }
   $invoice_data{'summarypage'} = $summarypage;
 
-  #do variable substitution in notes, footer, smallfooter
+  warn "$me substituting variables in notes, footer, smallfooter\n"
+    if $DEBUG > 1;
+
   foreach my $include (qw( notes footer smallfooter coupon )) {
 
     my $inc_file = $conf->key_orbase("invoice_${format}$include", $template);
@@ -2568,6 +2584,9 @@
   $invoice_data{'buf'} = \@buf;
   $invoice_data{'sections'} = \@sections;
 
+  warn "$me generating sections\n"
+    if $DEBUG > 1;
+
   my $previous_section = { 'description' => 'Previous Charges',
                            'subtotal'    => $other_money_char.
                                             sprintf('%.2f', $pr_total),
@@ -2638,6 +2657,9 @@
          )
   {
 
+    warn "$me adding previous balances\n"
+      if $DEBUG > 1;
+
     foreach my $line_item ( $self->_items_previous ) {
 
       my $detail = {
@@ -2672,6 +2694,9 @@
   }
  
   if ( $conf->exists('svc_phone-did-summary') ) {
+      warn "$me adding DID summary\n"
+        if $DEBUG > 1;
+
       my ($didsummary,$minutes) = $self->_did_summary;
       my $didsummary_desc = 'DID Activity Summary (Past 30 days)';
       push @detail_items, 
@@ -2683,6 +2708,9 @@
 
   foreach my $section (@sections, @$late_sections) {
 
+    warn "$me adding $section section\n"
+      if $DEBUG > 1;
+
     # begin some normalization
     $section->{'subtotal'} = $section->{'amount'}
       if $multisection
@@ -2767,6 +2795,9 @@
     unshift @sections, $previous_section if $pr_total;
   }
 
+  warn "$me adding taxes\n"
+    if $DEBUG > 1;
+
   foreach my $tax ( $self->_items_tax ) {
 
     $taxtotal += $tax->{'amount'};



More information about the freeside-commits mailing list