$item->fields
)
%>
+% if ( $single_cust && $h_table_descripsub{$item->table} ) {
+ <% &{ $h_table_descripsub{$item->table} }( $item ) %>
+% }
</TD>
</TR>
$label. ': <b>'. encode_entities($item->label($item->history_date)). '</b>';
};
-my $discounts = {};
-my $discount_labelsub = sub {
- my($item, $label) = @_;
- my $dnum = $item->discountnum;
- $discounts->{$dnum} ||= qsearchs({
- 'table'=>'discount',
- 'hashref'=>{'discountnum'=>$dnum}
- });
- my $d = $discounts->{$dnum};
- $label . ': <b>' . encode_entities($d->description_short) . '<b>';
-};
-
my %h_table_labelsub = (
'h_cust_pkg' => $pkg_labelsub,
'h_svc_acct' => $svc_labelsub,
'h_svc_external' => $svc_labelsub,
'h_svc_phone' => $svc_labelsub,
#'h_phone_device'
- 'h_cust_pkg_discount' => $discount_labelsub,
+);
+
+my $discounts = {};
+my $discount_descripsub = sub {
+ my($item) = @_;
+ $pkgpart{$item->pkgpart} ||= $item->part_pkg->pkg;
+ my $dnum = $item->discountnum;
+ $discounts->{$dnum} ||= qsearchs({
+ 'table'=>'discount',
+ 'hashref'=>{'discountnum'=>$dnum}
+ });
+ my $d = $discounts->{$dnum};
+ '(<b>' . encode_entities($d->description_short) . '</b>'
+ . ' on <b>' . encode_entities($pkgpart{$item->pkgpart}) . '</b>)';
+};
+
+my %h_table_descripsub = (
+ 'h_cust_pkg_discount' => $discount_descripsub,
);
my $cust_pkg_date_format = '%b %o, %Y';