X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=c7399ae7e52d0eb819c9f55de3f030a101fb32a1;hb=24389dff37b486ed4f0281bd50a3ff1ee77ae74d;hp=91b304b5d71857fd6e1d2c5eb5fa4f4729f5fa1a;hpb=17451727f5f483394ca894a48e8fa3abe91d5a2b;p=freeside.git diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 91b304b5d..c7399ae7e 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -1,23 +1,36 @@ -<% ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %> +<TABLE CLASS="fsinnerbox"> <TR> - <TD ALIGN="right">Customer number</TD> + <TD ALIGN="right"><% mt('Customer number') |h %></TD> <TD BGCOLOR="#ffffff"><% $cust_main->display_custnum %></TD> </TR> <TR> - <TD ALIGN="right">Status</TD> - <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% ucfirst($cust_main->status) %></B></FONT></TD> + <TD ALIGN="right"><% mt('Status') |h %></TD> + <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% $status_label %></B></FONT></TD> </TR> -%my $agent; -%if ( $num_agents == 1 ) { -% my @agents = qsearchs( 'agent', {} ); -% $agent = $agents[0]; -%} else { -% $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); +% my @part_tag = $cust_main->part_tag; +% if ( $conf->config('cust_tag-location') =~ /^(cust_misc|)$/ && @part_tag ) { +<TR> + <TD ALIGN="right"><% mt('Tags') |h %></TD> + <TD BGCOLOR="#ffffff"> +% foreach my $part_tag ( @part_tag ) { + <FONT <% length($part_tag->tagcolor) + ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"' + : '' %> + ><% $part_tag->tagname.': '. $part_tag->tagdesc |h %></FONT> + <BR> +% } + </TD> +</TR> +% } + +%unless ( scalar(@agentnums) == 1 +% && !$curuser->access_right('View customers of all agents') ) { +% my $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); <TR> - <TD ALIGN="right">Agent</TD> + <TD ALIGN="right"><% mt('Agent') |h %></TD> <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD> </TR> % } @@ -26,28 +39,40 @@ % && ! $conf->exists('cust_main-default_agent_custid') ) { <TR> - <TD ALIGN="right">Agent customer ref#</TD> + <TD ALIGN="right"><% mt('Agent customer ref#') |h %></TD> <TD BGCOLOR="#ffffff"><% $cust_main->agent_custid %></TD> </TR> % % } -% + +% #if ( $cust_main->classnum ) { + <TR> + <TD ALIGN="right"><% mt('Class') |h %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->classname || '('.emt('none').')' %></TD> + </TR> +% #} + +% if ( $cust_main->salesnum ) { + <TR> + <TD ALIGN="right"><% mt('Sales Person') |h %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->salesperson |h %></TD> + </TR> +% } + % unless ( FS::part_referral->num_part_referral == 1 ) { % my $referral = qsearchs('part_referral', { % 'refnum' => $cust_main->refnum % } ); -% - <TR> - <TD ALIGN="right">Advertising source</TD> + <TD ALIGN="right"><% mt('Advertising source') |h %></TD> <TD BGCOLOR="#ffffff"><% $referral->refnum %>: <% $referral->referral%></TD> </TR> % } <TR> - <TD ALIGN="right">Referring Customer</TD> + <TD ALIGN="right"><% mt('Referring Customer') |h %></TD> <TD BGCOLOR="#ffffff"> % % my $referring_cust_main = ''; @@ -59,7 +84,7 @@ % -<A HREF="<% popurl(1) %>cust_main.cgi?<% $cust_main->referral_custnum %>"><%$cust_main->referral_custnum %>: +<A HREF="<% popurl(1) %>cust_main.cgi?<% $cust_main->referral_custnum %>"><%$referring_cust_main->display_custnum %>: <% ( $referring_cust_main->company ? $referring_cust_main->company. ' ('. @@ -75,15 +100,35 @@ </TR> <TR> - <TD ALIGN="right">Order taker</TD> + <TD ALIGN="right"><% mt('Order taker') |h %></TD> <TD BGCOLOR="#ffffff"><% $cust_main->otaker %></TD> </TR> <TR> - <TD ALIGN="right">Signup Date</TD> + <TD ALIGN="right"><% mt('Signup Date') |h %></TD> <TD BGCOLOR="#ffffff"><% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %></TD> </TR> +% my $id_country = $conf->config('national_id-country'); +% if ( $id_country ) { +% if ( $id_country eq 'MY' ) { + <TR> +% my($old, $nric) = ( '', ''); +% if ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { + <TD ALIGN="right"><% mt('NRIC') |h %></TD> +% } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) { + <TD ALIGN="right"><% mt('Old IC/Passport') |h %></TD> +% #} else { +% # warn "unknown national_id format"; +%# <TD ALIGN="right"></TD> +% } + <TD BGCOLOR="#ffffff"><% $cust_main->national_id |h %></TD> + </TR> +% } else { +% warn "unknown national_id-country $id_country"; +% } +% } + % if ( $conf->exists('cust_main-enable_birthdate') ) { % my $dt = $cust_main->birthdate ne '' % ? DateTime->from_epoch( 'epoch' => $cust_main->birthdate, @@ -92,21 +137,76 @@ % : ''; <TR> - <TD ALIGN="right">Date of Birth</TD> + <TD ALIGN="right"><% mt('Date of Birth') |h %></TD> <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD> </TR> +% if ( $conf->exists('cust_main-enable_spouse') +% and $cust_main->spouse_birthdate ) { +% my $dt = DateTime->from_epoch( +% 'epoch' => $cust_main->spouse_birthdate, +% 'time_zone' =>'floating' +% ); + + <TR> + <TD ALIGN="right"><% mt('Spouse Date of Birth') |h %></TD> + <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD> + </TR> + +% } +% } # enable_birthdate + +% if ( $conf->exists('cust_main-enable_anniversary_date') ) { +% my $dt = $cust_main->anniversary_date ne '' +% ? DateTime->from_epoch( 'epoch' => $cust_main->anniversary_date, +% 'time_zone' =>'floating', +% ) +% : ''; + + <TR> + <TD ALIGN="right"><% mt('Anniversary Date') |h %></TD> + <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD> + </TR> + +% } + +% if ( $cust_main->district ) { + + <TR> + <TD ALIGN="right"><% mt('Tax district') |h %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->ship_location->district %></TD> + </TR> + % } -</TABLE></TD></TR></TABLE> + +% if ( $conf->exists('ticket_system-selfservice_edit_subject') ) { + + <TR> + <TD ALIGN="right"><% emt('Edit ticket subjects') %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->edit_subject ? 'yes' : 'no' %></TD> + </TR> + +% } + +% foreach (sort { $a cmp $b } $cust_main->virtual_fields) { + <% $cust_main->pvf($_)->widget('HTML', 'view', $cust_main->getfield($_)) %> +% } + +</TABLE> <%init> my( $cust_main ) = @_; my $conf = new FS::Conf; my $date_format = ($conf->config('date_format') || "%m/%d/%Y"); -my $sth = dbh->prepare('SELECT COUNT(*) FROM agent') or die dbh->errstr; -$sth->execute or die $sth->errstr; -my $num_agents = $sth->fetchrow_arrayref->[0]; +my $curuser = $FS::CurrentUser::CurrentUser; + +my @agentnums = $curuser->agentnums; + +my $status_label = ucfirst($cust_main->status); +if ($cust_main->is_status_delay_cancel) { + $status_label .= ' (Cancelled)'; +} </%init>