From c8cd96b69c9c1ede44c06c04f2703079d1afdf2b Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 23 Aug 2010 16:47:00 +0000 Subject: [PATCH] create a default finance section and have hidden sectionless line items remain sectionless --- FS/FS/cust_bill.pm | 4 +++- FS/FS/cust_bill_pkg_display.pm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 8468f3abf..e4215bf2b 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2386,7 +2386,8 @@ sub print_generic { qsearchs('pkg_class', { classnum => $conf->config('finance_pkgclass') }); $invoice_data{finance_section} = $pkg_class->categoryname; } - $invoice_data{finance_amount} = '0.00'; + $invoice_data{finance_amount} = '0.00'; + $invoice_data{finance_section} ||= 'Finance Charges'; #avoid config confusion my $countrydefault = $conf->config('countrydefault') || 'US'; my $prefix = $cust_main->has_ship_address ? 'ship_' : ''; @@ -3359,6 +3360,7 @@ sub _items_sections { if ( $summarypage ) { @sections = grep { exists($subtotal{$_}) || ! _pkg_category($_)->disabled } map { $_->categoryname } qsearch('pkg_category', {}); + push @sections, '' if exists($subtotal{''}); } else { @sections = keys %subtotal; } diff --git a/FS/FS/cust_bill_pkg_display.pm b/FS/FS/cust_bill_pkg_display.pm index e9da18dec..a864ec114 100644 --- a/FS/FS/cust_bill_pkg_display.pm +++ b/FS/FS/cust_bill_pkg_display.pm @@ -55,7 +55,7 @@ sub section { my $section = $self->getfield('section'); unless ($section) { my $cust_bill_pkg = $self->cust_bill_pkg; - if ( $cust_bill_pkg->pkgnum > 0 ) { + if ( $cust_bill_pkg->pkgnum > 0 && !$cust_bill_pkg->hidden ) { my $part_pkg = $cust_bill_pkg->part_pkg; $section = $part_pkg->categoryname if $part_pkg; } -- 2.11.0