X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fchange_history_common.html;fp=httemplate%2Felements%2Fchange_history_common.html;h=9fc85aa53fac074f16a0c3c4bc7c375a09b15052;hb=73d97ad71884ce66b435f0e8d85e5bf99cda3712;hp=9e32bef33c632cd28ca195e2c55602665292654f;hpb=4d0db1129018d2f598091edbbffeb09b23c64d99;p=freeside.git
diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html
index 9e32bef33..9fc85aa53 100644
--- a/httemplate/elements/change_history_common.html
+++ b/httemplate/elements/change_history_common.html
@@ -106,6 +106,9 @@
$item->fields
)
%>
+% if ( $single_cust && $h_table_descripsub{$item->table} ) {
+ <% &{ $h_table_descripsub{$item->table} }( $item ) %>
+% }
@@ -172,18 +175,6 @@ my $svc_labelsub = sub {
$label. ': '. encode_entities($item->label($item->history_date)). '';
};
-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 . ': ' . encode_entities($d->description_short) . '';
-};
-
my %h_table_labelsub = (
'h_cust_pkg' => $pkg_labelsub,
'h_svc_acct' => $svc_labelsub,
@@ -195,7 +186,24 @@ my %h_table_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};
+ '(' . encode_entities($d->description_short) . ''
+ . ' on ' . encode_entities($pkgpart{$item->pkgpart}) . ')';
+};
+
+my %h_table_descripsub = (
+ 'h_cust_pkg_discount' => $discount_descripsub,
);
my $cust_pkg_date_format = '%b %o, %Y';