From 2577ec64e83b09acf9058205fc02c2323aea30dc Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 24 Jun 2010 08:17:55 +0000 Subject: [PATCH] get section subtotalling right --- FS/FS/cust_bill.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 46c591ecf..13937c651 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -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; -- 2.11.0