X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_credit.html;h=dbf0ff333688453765184e25f94cda88ea9dcbe8;hb=6f58ae775b905cd462dd0faafee95973414a45d2;hp=7738494db7cdf633d7fc19c25def413821415651;hpb=ed741d82e6ef8b2c66985f6b54d5cb26e0a70acb;p=freeside.git diff --git a/httemplate/search/cust_credit.html b/httemplate/search/cust_credit.html index 7738494db..dbf0ff333 100755 --- a/httemplate/search/cust_credit.html +++ b/httemplate/search/cust_credit.html @@ -56,33 +56,62 @@ if ($unapplied) { push @header, emt('Date'), emt('By'), emt('Reason'), - FS::UI::Web::cust_header(), + emt('Info'), ; push @fields, sub { time2str('%b %d %Y', shift->_date ) }, 'otaker', - 'reason', - \&FS::UI::Web::cust_fields, + 'reason_only', + 'addlinfo', ; -push @sort_fields, '_date', 'otaker', 'reason', FS::UI::Web::cust_sort_fields(); -$align .= 'rll'.FS::UI::Web::cust_aligns(); +push @sort_fields, '_date', 'otaker', 'reasonnum', 'addlinfo'; +$align .= 'rlll'; push @links, '', '', '', - ( map { $_ ne 'Cust. Status' ? $clink : '' } - FS::UI::Web::cust_header() - ), + '', ; push @color, '', '', '', - FS::UI::Web::cust_colors(), + '', ; push @style, '', '', '', - FS::UI::Web::cust_styles(), + '', ; +# insert customer email after 'Reason' if this is a commission report +if ( $cgi->param('commission_salesnum') or $cgi->param('commission_agentnum') ) { + my $sub_customer_email = sub { + my $cust_credit = shift; + my $cust_event = $cust_credit->cust_event or return ''; + my $cust_X = $cust_event->cust_X or return ''; + my $cust_main = $cust_X->cust_main or return ''; + my ($email) = $cust_main->invoicing_list_emailonly; + return encode_entities("<$email>") if length($email); + ''; + }; + push @header, ''; + push @fields, $sub_customer_email; + push @sort_fields, ''; + $align .= 'l'; + push @links, ''; + push @color, ''; + push @style, ''; +} + +# cust fields +push @header, FS::UI::Web::cust_header(); +push @fields, \&FS::UI::Web::cust_fields; +push @sort_fields, FS::UI::Web::cust_sort_fields; +$align .= FS::UI::Web::cust_aligns(); +push @links, map { $_ ne 'Cust. Status' ? $clink : '' } + FS::UI::Web::cust_header(); +push @color, FS::UI::Web::cust_colors(); +push @style, FS::UI::Web::cust_styles(); + + my @search = (); my $addl_from = '';