summaryrefslogtreecommitdiff
path: root/FS/FS/Template_Mixin.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2018-04-11 13:26:11 -0700
committerIvan Kohler <ivan@freeside.biz>2018-04-11 13:26:11 -0700
commit52868a4e0abe9e0a9aa78fe04ca5a3462c3bc5a6 (patch)
tree1896bc23b6b8555f743cb6e81f88f1453d945072 /FS/FS/Template_Mixin.pm
parenta71bb4db524387e97d57c0884f940f615fa78852 (diff)
optimize invoice display with sections, RT#80177
Diffstat (limited to 'FS/FS/Template_Mixin.pm')
-rw-r--r--FS/FS/Template_Mixin.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 2dde3ca..2091c48 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2679,7 +2679,13 @@ sub _items_sections {
foreach my $display ($cust_bill_pkg->cust_bill_pkg_display) {
next if ( $display->summary && $opt{summary} );
- my $section = $display->section;
+ #my $section = $display->section;
+ #false laziness with the method, but for efficiency inside this loop
+ my $section = $display->get('section');
+ if ( !$section && !$cust_bill_pkg->hidden ) {
+ $section = $cust_bill_pkg->get('categoryname'); #cust_bill->cust_bill_pkg added it (XXX quotations / quotation_section)
+ }
+
my $type = $display->type;
# Set $section = undef if we're sectioning by location and this
# line item _has_ a location (i.e. isn't a fee).
@@ -3104,6 +3110,8 @@ sub _items_fee {
my @cust_bill_pkg = grep { $_->feepart } $self->cust_bill_pkg;
my $escape_function = $options{escape_function};
+ my $locale = $self->cust_main->locale;
+
my @items;
foreach my $cust_bill_pkg (@cust_bill_pkg) {
# cache this, so we don't look it up again in every section
@@ -3144,7 +3152,7 @@ sub _items_fee {
$self->mt('from invoice #[_1] on [_2]', $_, $base_invnums{$_})
);
}
- my $desc = $part_fee->itemdesc_locale($self->cust_main->locale);
+ my $desc = $part_fee->itemdesc_locale($locale);
# but not escape the base description line
my @pkg_tax = $cust_bill_pkg->_pkg_tax_list