summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/TemplateItem_Mixin.pm4
-rw-r--r--FS/FS/Template_Mixin.pm3
-rw-r--r--FS/FS/part_pkg.pm5
3 files changed, 7 insertions, 5 deletions
diff --git a/FS/FS/TemplateItem_Mixin.pm b/FS/FS/TemplateItem_Mixin.pm
index 324f05248..8b0e16a2d 100644
--- a/FS/FS/TemplateItem_Mixin.pm
+++ b/FS/FS/TemplateItem_Mixin.pm
@@ -52,10 +52,10 @@ line item, and for generic taxes, simply returns "Tax".
=cut
sub desc {
- my $self = shift;
+ my( $self, $locale ) = @_;
if ( $self->pkgnum > 0 ) {
- $self->itemdesc || $self->part_pkg->pkg;
+ $self->itemdesc || $self->part_pkg->pkg_locale($locale);
} else {
my $desc = $self->itemdesc || 'Tax';
$desc .= ' '. $self->itemcomment if $self->itemcomment =~ /\S/;
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index e3958a436..2e78f12f4 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2181,6 +2181,7 @@ sub _items_cust_bill_pkg {
my $cust_main = $self->cust_main;#for per-agent cust_bill-line_item-ate_style
# and location labels
+ my $locale = $cust_main->locale;
my @b = ();
my ($s, $r, $u) = ( undef, undef, undef );
@@ -2225,7 +2226,7 @@ sub _items_cust_bill_pkg {
my $type = $display->type;
- my $desc = $cust_bill_pkg->desc;
+ my $desc = $cust_bill_pkg->desc( $cust_main->locale );
$desc = substr($desc, 0, $maxlength). '...'
if $format eq 'latex' && length($desc) > $maxlength;
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 40fb1dcb4..e788269f7 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -719,13 +719,14 @@ sub propagate {
=item pkg_locale LOCALE
Returns a customer-viewable string representing this package for the given
-locale, from the part_pkg_msgcat table. If no localized string is found,
-returns the base pkg field.
+locale, from the part_pkg_msgcat table. If the given locale is empty or no
+localized string is found, returns the base pkg field.
=cut
sub pkg_locale {
my( $self, $locale ) = @_;
+ return $self->pkg unless $locale;
my $part_pkg_msgcat = $self->part_pkg_msgcat($locale) or return $self->pkg;
$part_pkg_msgcat->pkg;
}