get section subtotalling right
authorjeff <jeff>
Thu, 24 Jun 2010 08:17:55 +0000 (08:17 +0000)
committerjeff <jeff>
Thu, 24 Jun 2010 08:17:55 +0000 (08:17 +0000)
FS/FS/cust_bill.pm

index 46c591e..13937c6 100644 (file)
@@ -2575,6 +2575,12 @@ sub print_generic {
 
   foreach my $section (@sections, @$late_sections) {
 
+    # begin some normalization
+    $section->{'subtotal'} = $section->{'amount'}
+      if $multisection
+         && !exists($section->{subtotal})
+         && exists($section->{amount});
+
     $invoice_data{finance_amount} = sprintf('%.2f', $section->{'subtotal'} )
       if ( $invoice_data{finance_section} &&
            $section->{'description'} eq $invoice_data{finance_section} );
@@ -2583,7 +2589,7 @@ sub print_generic {
                              sprintf('%.2f', $section->{'subtotal'})
       if $multisection;
 
-    # begin some normalization
+    # continue some normalization
     $section->{'amount'}   = $section->{'subtotal'}
       if $multisection;