X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FTemplateItem_Mixin.pm;h=fa20c240f7d5e59d33c24f473d22bef0cbb9d911;hp=664432975e4c966be306c779d2e2efc9fb1c1869;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=48fc9f425ec3454f4346089318994ae6c1e080a8 diff --git a/FS/FS/TemplateItem_Mixin.pm b/FS/FS/TemplateItem_Mixin.pm index 664432975..fa20c240f 100644 --- a/FS/FS/TemplateItem_Mixin.pm +++ b/FS/FS/TemplateItem_Mixin.pm @@ -48,7 +48,7 @@ sub part_pkg { } -=item desc +=item desc LOCALE Returns a description for this line item. For typical line items, this is the I field of the corresponding B object (see L). @@ -61,12 +61,19 @@ sub desc { my( $self, $locale ) = @_; if ( $self->pkgnum > 0 ) { - $self->itemdesc || $self->part_pkg->pkg_locale($locale); - } else { + return $self->itemdesc if $self->itemdesc; + my $part_pkg = $self->part_pkg or return 'UNKNOWN'; + return $part_pkg->pkg_locale($locale); + + } elsif ( $self->feepart ) { + 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 @@ -100,7 +107,7 @@ sub time_period_pretty { if ( defined($date_style) && $date_style eq 'month_of' ) { # (now watch, someone's going to make us do Chinese) $time_period = $self->mt('The month of [_1]', - $self->time2str_local('The month of %B', $self->sdate) + $self->time2str_local('%B', $self->sdate) ); } elsif ( defined($date_style) && $date_style eq 'X_month' ) { my $desc = $conf->config( 'cust_bill-line_item-date_description',