X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=cb465f57e116c39943dd7af7d1fe5f7b8a04e301;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hp=060da87dd0be5c9cc4734ef764ebf259c697b660;hpb=987b49fbf7754b4954018e258d27a6ea72499f84;p=freeside.git diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 060da87dd..cb465f57e 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -1,54 +1,61 @@ -<% ntable("#cccccc") %><% &ntable("#cccccc",2) %> +<% mt('Miscellaneous information') |h %> + +% my @part_tag = $cust_main->part_tag; +% if ( $conf->config('cust_tag-location') =~ /^(cust_misc|)$/ && @part_tag ) { - - - - - - - + + - -%my $agent; -%if ( $num_agents == 1 ) { -% my @agents = qsearchs( 'agent', {} ); -% $agent = $agents[0]; -%} else { -% $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); - - - - % } % if ( $cust_main->agent_custid % && ! $conf->exists('cust_main-default_agent_custid') ) { - + % % } -% + +% #if ( $cust_main->classnum ) { + + + + +% #} + +% if ( $cust_main->salesnum ) { + + + + +% } + % unless ( FS::part_referral->num_part_referral == 1 ) { % my $referral = qsearchs('part_referral', { % 'refnum' => $cust_main->refnum % } ); -% - - - + + % } - - + - - + + - - + + +% my $id_country = $conf->config('national_id-country'); +% if ( $id_country ) { +% if ( $id_country eq 'MY' ) { + +% my($old, $nric) = ( '', ''); +% if ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { + +% } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) { + +% #} else { +% # warn "unknown national_id format"; +%# +% } + + +% } else { +% warn "unknown national_id-country $id_country"; +% } +% } + % if ( $conf->exists('cust_main-enable_birthdate') ) { -% my $dt = DateTime->from_epoch(epoch => $cust_main->birthdate, -% time_zone=>'floating', -% ); +% my $dt = $cust_main->birthdate ne '' +% ? DateTime->from_epoch( 'epoch' => $cust_main->birthdate, +% 'time_zone' =>'floating', +% ) +% : ''; + + + + + + +% 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' +% ); - - + + +% } +% } # 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', +% ) +% : ''; + + + + + + +% } + +% if ( $cust_main->district ) { + + + + + + +% } + + +% if ( $conf->exists('ticket_system-selfservice_edit_subject') ) { + + + + + + +% } + +% foreach (sort { $a cmp $b } $cust_main->virtual_fields) { + <% $cust_main->pvf($_)->widget('HTML', 'view', $cust_main->getfield($_)) %> % } -
Customer number<% $cust_main->display_custnum %>
Status<% ucfirst($cust_main->status) %><% mt('Tags') |h %> +% foreach my $part_tag ( @part_tag ) { + tagcolor) + ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"' + : '' %> + ><% $part_tag->tagname.': '. $part_tag->tagdesc |h %> +
+% } +
Agent<% $agent->agentnum %>: <% $agent->agent %>
Agent customer ref#<% mt('Agent customer ref#') |h %> <% $cust_main->agent_custid %>
<% mt('Class') |h %><% $cust_main->classname || '('.emt('none').')' %>
<% mt('Sales Person') |h %><% $cust_main->salesperson |h %>
Advertising source<% $referral->refnum %>: <% $referral->referral%><% mt('Advertising source') |h %><% $referral->refnum %>: <% $referral->referral%>
Referring Customer + <% mt('Referring Customer') |h %> % % my $referring_cust_main = ''; % if ( $cust_main->referral_custnum @@ -59,7 +66,7 @@ % -<%$cust_main->referral_custnum %>: +<%$referring_cust_main->display_custnum %>: <% ( $referring_cust_main->company ? $referring_cust_main->company. ' ('. @@ -75,36 +82,113 @@
Order taker<% $cust_main->otaker %><% mt('Order taker') |h %><% $cust_main->otaker %>
Signup Date<% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %><% mt('Signup Date') |h %><% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %>
<% mt('NRIC') |h %><% mt('Old IC/Passport') |h %><% $cust_main->national_id |h %>
<% mt('Date of Birth') |h %><% $dt ? $dt->strftime($date_format) : '' %>
Date of Birth<% $cust_main->birthdate ne '' ? $dt->strftime($date_format) : '' %><% mt('Spouse Date of Birth') |h %><% $dt ? $dt->strftime($date_format) : '' %>
<% mt('Anniversary Date') |h %><% $dt ? $dt->strftime($date_format) : '' %>
<% mt('Tax district') |h %><% $cust_main->ship_location->district %>
<% emt('Edit ticket subjects') %><% $cust_main->edit_subject ? 'yes' : 'no' %>
+ <%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 = $cust_main->status_label; +if ($cust_main->is_status_delay_cancel) { + $status_label .= ' (Cancelled)'; +}