+);
+
+my $discounts = {};
+my $discount_descripsub = sub {
+ my($item) = @_;
+ die "Could not find part_pkg for pkgpart " . $item->pkgpart
+ unless $item->part_pkg;
+ $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,