diff options
| author | Mitch Jackson <mitch@freeside.biz> | 2018-05-19 20:31:02 +0000 |
|---|---|---|
| committer | Mitch Jackson <mitch@freeside.biz> | 2018-05-19 21:34:25 +0000 |
| commit | 504ec7fd59d124142d98dd0539aa48ee5e8963ae (patch) | |
| tree | 03a7d3be1c2b050e70af2f5901d6c0125a2aa0a3 /FS/FS/Template_Mixin.pm | |
| parent | 63c66b013cbb8429b4f0f3796dd8ea5fe221a2c1 (diff) | |
RT# 79363 Hide empty tax section, invoice_sections_with_taxes
Diffstat (limited to 'FS/FS/Template_Mixin.pm')
| -rw-r--r-- | FS/FS/Template_Mixin.pm | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index ebdcd6d46..1bae5bc40 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; |
