summaryrefslogtreecommitdiff
path: root/FS/FS/TemplateItem_Mixin.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-02-26 18:43:43 -0800
committerIvan Kohler <ivan@freeside.biz>2014-02-26 18:43:43 -0800
commitedb76c8cd4f4066e32f64ab92909a0f95d85ae23 (patch)
tree1530365ef167493b673bec48c9ed3a937abb2da0 /FS/FS/TemplateItem_Mixin.pm
parent33043da94faf7538a568b4064a511d35b4c7caf5 (diff)
fix invoice for cust_bill_pkg missing cust_pkg, RT#27745
Diffstat (limited to 'FS/FS/TemplateItem_Mixin.pm')
-rw-r--r--FS/FS/TemplateItem_Mixin.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/FS/FS/TemplateItem_Mixin.pm b/FS/FS/TemplateItem_Mixin.pm
index bf857a9..fa20c24 100644
--- a/FS/FS/TemplateItem_Mixin.pm
+++ b/FS/FS/TemplateItem_Mixin.pm
@@ -61,14 +61,19 @@ sub desc {
my( $self, $locale ) = @_;
if ( $self->pkgnum > 0 ) {
- $self->itemdesc || $self->part_pkg->pkg_locale($locale);
+ return $self->itemdesc if $self->itemdesc;
+ my $part_pkg = $self->part_pkg or return 'UNKNOWN';
+ return $part_pkg->pkg_locale($locale);
+
} elsif ( $self->feepart ) {
- $self->part_fee->itemdesc_locale($locale);
+ return $self->part_fee->itemdesc_locale($locale);
+
} else { # by the process of elimination it must be a tax
my $desc = $self->itemdesc || 'Tax';
$desc .= ' '. $self->itemcomment if $self->itemcomment =~ /\S/;
- $desc;
+ return $desc;
}
+
}
=item time_period_pretty PART_PKG, AGENTNUM