From: Jonathan Prykop Date: Fri, 6 Feb 2015 01:05:00 +0000 (-0600) Subject: RT#28246: Add more details to Change History for Discounts X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;ds=sidebyside;h=03113ec3660629e7e378d08c57aae6e0b67c297a;p=freeside.git RT#28246: Add more details to Change History for Discounts --- diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html index 34ce70b6c..9e32bef33 100644 --- a/httemplate/elements/change_history_common.html +++ b/httemplate/elements/change_history_common.html @@ -172,6 +172,18 @@ 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, @@ -183,6 +195,7 @@ my %h_table_labelsub = ( 'h_svc_external' => $svc_labelsub, 'h_svc_phone' => $svc_labelsub, #'h_phone_device' + 'h_cust_pkg_discount' => $discount_labelsub, ); my $cust_pkg_date_format = '%b %o, %Y';