From c93e10d1ea0304bea31416c31706a92998fa0159 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 18 Jun 2014 18:43:55 -0700 Subject: [PATCH] fix (part of) 3.x performance regression on customers with tons of invoices, RT#29646, RT#12367 --- FS/FS/Template_Mixin.pm | 2 +- FS/FS/cust_bill.pm | 8 ++++++-- FS/FS/cust_bill_ApplicationCommon.pm | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index 1c373f95d..64f0149fc 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -1821,7 +1821,7 @@ configured for the back-office. Use _date_pretty for end-customer display use. sub _date_pretty_unlocalized { my $self = shift; - $self->time2str($date_format, $self->_date); + time2str($date_format, $self->_date); } =item _items_sections OPTIONS diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 58288b4b5..f36ff3b07 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2458,7 +2458,9 @@ sub invoice_barcode { =item invnum_date_pretty Returns a string with the invoice number and date, for example: -"Invoice #54 (3/20/2008)" +"Invoice #54 (3/20/2008)". + +Intended for back-end context, with regard to translation and date formatting. =cut @@ -2467,7 +2469,9 @@ Returns a string with the invoice number and date, for example: # instead of backoffice configured date format) sub invnum_date_pretty { my $self = shift; - $self->mt('Invoice #'). $self->invnum. ' ('. $self->_date_pretty_unlocalized. ')'; + #$self->mt('Invoice #'). + 'Invoice #'. #XXX should be translated ala web UI user (not invoice customer) + $self->invnum. ' ('. $self->_date_pretty_unlocalized. ')'; } #sub _items_extra_usage_sections { diff --git a/FS/FS/cust_bill_ApplicationCommon.pm b/FS/FS/cust_bill_ApplicationCommon.pm index d8ccdd0bf..75d2647cb 100644 --- a/FS/FS/cust_bill_ApplicationCommon.pm +++ b/FS/FS/cust_bill_ApplicationCommon.pm @@ -503,6 +503,8 @@ sub cust_bill { Returns a string representing the invoice (see L), for example: "applied to Invoice #54 (3/20/2008)" +Intended for back-end context, with regard to translation and date formatting. + =cut sub applied_to_invoice { -- 2.11.0