X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FTemplate_Mixin.pm;h=51f89f7172d40f658cd6ca5a4ed488001d65995d;hp=edbb4d4408eb99d3e1c21e89b6f86e0f8da89742;hb=709a481dd9a9f29009505356603db66613bf2cb6;hpb=fc5bf4070e3d34c6f6298fb3c61263644fa71ade diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index edbb4d440..51f89f717 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -1396,6 +1396,14 @@ sub print_generic { $other_money_char. sprintf('%.2f', $self->charged - $taxtotal ); if ( $multisection ) { + + if ( $conf->config_bool('invoice_sections_with_taxes', $cust_main->agentnum) ) { + # If all tax items are displayed in location/category sections, + # remove the empty tax section + @sections = grep{ $_ ne $tax_section } @sections + unless grep{ $_->{section} eq $tax_section } @detail_items; + } + if ( $taxtotal > 0 ) { # there are taxes, so prepare the section to be displayed. # $taxtotal already includes any line items that were already in the @@ -1409,14 +1417,7 @@ sub print_generic { $tax_section->{'description'} = $self->mt($tax_description); $tax_section->{'summarized'} = ''; - if ( $conf->config_bool('invoice_sections_with_taxes', $cust_main->agentnum) ) { - - # If all tax items are displayed in location/category sections, - # remove the empty tax section - @sections = grep{ $_ ne $tax_section } @sections - unless grep{ $_->{section} eq $tax_section } @detail_items; - - } elsif ( !grep $tax_section, @sections ) { + if ( !grep $tax_section, @sections ) { # append it if it's not already there push @sections, $tax_section; @@ -3196,6 +3197,7 @@ sub _items_fee { push @items, { feepart => $cust_bill_pkg->feepart, + billpkgnum => $cust_bill_pkg->billpkgnum, amount => sprintf('%.2f', $cust_bill_pkg->setup + $cust_bill_pkg->recur), description => $desc, pkg_tax => \@pkg_tax,