% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
+<THEAD>
<TR>
<TH CLASS="grid" BGCOLOR="#cccccc">User</TH>
<TH CLASS="grid" BGCOLOR="#cccccc">Date</TH>
<TH CLASS="grid" BGCOLOR="#cccccc">Action</TH>
<TH CLASS="grid" BGCOLOR="#cccccc">Description</TH>
</TR>
+</THEAD>
% foreach my $item ( @history ) {
% my $history_other = '';
<TR>
<TD ALIGN="left" CLASS="grid" BGCOLOR="<% $bgcolor %>">
-% my $otaker;
+% my $otaker = '';
% if ( $item->history_usernum ) {
% $access_user{ $item->history_usernum } ||=
-% qsearchs('access_user', { 'usernum' => $item->history_usernum });
+% FS::access_user->by_key( $item->history_usernum );
% $otaker = $access_user{ $item->history_usernum }->username
% if $access_user{ $item->history_usernum };
% }
<TD ALIGN="center" CLASS="grid" BGCOLOR="<% $bgcolor %>">
% my $label = '';
-% if ( $item->table eq 'legacy_cust_bill' ) {
+% if ( $item->table eq 'legacy_cust_history' ) {
% $label = $item->item;
% } else {
% $label = $item->table;
</TD>
<TD ALIGN="left" CLASS="grid" BGCOLOR="<% $bgcolor %>">
-% if ( $item->table eq 'legacy_cust_bill' ) {
+% my $description = '';
+% if ( $item->table eq 'legacy_cust_history' ) {
<% $item->description |h %>
+% } elsif ( $item->table eq 'h_cust_tag' ) {
+% $description = &{ $h_table_descripsub{$item->table} }( $item, $tables{'cust_tag'} )
+% if $single_cust && $h_table_descripsub{$item->table};
+ <% $description %>
% } else {
<% join(', ',
map { my $value = ( $_ =~ /(^pay(info|cvv)|^ss|_password)$/ )
% if ( $single_cust && $h_table_descripsub{$item->table} ) {
<% &{ $h_table_descripsub{$item->table} }( $item ) %>
% }
-% }
+% }
</TD>
</TR>
my %action = (
'insert' => 'Insert', #'Create',
- 'replace_old' => 'Change from',
- 'replace_new' => 'Change to',
+ 'replace_old' => "Change\xA0from",
+ 'replace_new' => "Change\xA0to",
'delete' => 'Remove',
);
$label. ': <b>'. encode_entities($item->label($item->history_date)). '</b>';
};
+my $tag_labelsub = sub {
+ my($item, $label) = @_;
+ my $part_tag = qsearchs('part_tag',{ tagnum => $item->tagnum });
+ $label. ': <SPAN STYLE="background-color: #'.$part_tag->tagcolor.'">'. encode_entities($part_tag->tagname). '</SPAN>';
+};
+
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_tag' => $tag_labelsub,
);
+my $tag_descripsub = sub {
+ my($item, $label) = @_;
+ my $part_tag = qsearchs('part_tag',{ tagnum => $item->tagnum });
+ '<SPAN STYLE="background-color: #'.$part_tag->tagcolor.'">'. encode_entities($part_tag->tagname). '</SPAN>';
+};
+
my $discounts = {};
my $discount_descripsub = sub {
my($item) = @_;
my %h_table_descripsub = (
'h_cust_pkg_discount' => $discount_descripsub,
+ 'h_cust_tag' => $tag_descripsub,
);
my $cust_pkg_date_format = '%b %o, %Y';