create a default finance section and have hidden sectionless line items remain sectio...
authorjeff <jeff>
Mon, 23 Aug 2010 16:47:13 +0000 (16:47 +0000)
committerjeff <jeff>
Mon, 23 Aug 2010 16:47:13 +0000 (16:47 +0000)
FS/FS/cust_bill.pm
FS/FS/cust_bill_pkg_display.pm

index 7e0e995..85f8285 100644 (file)
@@ -2340,7 +2340,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_' : '';
@@ -3313,6 +3314,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;
   }
index e9da18d..a864ec1 100644 (file)
@@ -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;
       }