From 63827f50be90b3774c7d312f9ac049e69111e3d3 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 26 Feb 2014 18:43:44 -0800 Subject: [PATCH] fix invoice for cust_bill_pkg missing cust_pkg, RT#27745 --- FS/FS/TemplateItem_Mixin.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/FS/FS/TemplateItem_Mixin.pm b/FS/FS/TemplateItem_Mixin.pm index bf857a98a..fa20c240f 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 -- 2.11.0