X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=fe0e329c3af4fde57bcdd26071e251b59c148311;hb=4d0db1129018d2f598091edbbffeb09b23c64d99;hp=742b35958a8c81e2081e120e018709e8400b4437;hpb=0a7d9371d3514312edd8661c621876cece4d5221;p=freeside.git diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 742b35958..fe0e329c3 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -1,74 +1,91 @@ -<% - my( $cust_main ) = @_; - my $conf = new FS::Conf; -%> + -<%= ntable("#cccccc") %> - - + + -<% - my @agents = qsearch( 'agent', {} ); - my $agent; - unless ( scalar(@agents) == 1 ) { - $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); -%> - - - + + -<% - } else { - $agent = $agents[0]; - } - - if ( $cust_main->agent_custid ) { -%> - +% my @part_tag = $cust_main->part_tag; +% if ( $conf->config('cust_tag-location') =~ /^(cust_misc|)$/ && @part_tag ) { - - + + +% } -<% - } +%unless ( scalar(@agentnums) == 1 +% && !$curuser->access_right('View customers of all agents') ) { +% my $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); + + + + +% } - unless ( FS::part_referral->num_part_referral == 1 ) { - my $referral = qsearchs('part_referral', { - 'refnum' => $cust_main->refnum - } ); -%> +% 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 +% } ); - - + + +% } + + - + -
<%= &ntable("#cccccc",2) %>
Customer number<%= $cust_main->custnum %><% mt('Customer number') |h %><% $cust_main->display_custnum %>
Agent<%= $agent->agentnum %>: <%= $agent->agent %><% mt('Status') |h %><% $status_label %>
Agent customer ref#<%= $cust_main->agent_custid %><% mt('Tags') |h %> +% foreach my $part_tag ( @part_tag ) { + tagcolor) + ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"' + : '' %> + ><% $part_tag->tagname.': '. $part_tag->tagdesc |h %> +
+% } +
<% mt('Agent') |h %><% $agent->agentnum %>: <% $agent->agent %>
Advertising source<%= $referral->refnum %>: <%= $referral->referral%><% 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 %>
Order taker<%= $cust_main->otaker %><% mt('Advertising source') |h %><% $referral->refnum %>: <% $referral->referral%>
Referring Customer<% mt('Referring Customer') |h %> +% +% my $referring_cust_main = ''; +% if ( $cust_main->referral_custnum +% && ( $referring_cust_main = +% qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) +% ) +% ) { +% + +<%$referring_cust_main->display_custnum %>: <% - my $referring_cust_main = ''; - if ( $cust_main->referral_custnum - && ( $referring_cust_main = - qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) - ) - ) { -%> - -<%=$cust_main->referral_custnum %>: -<%= ( $referring_cust_main->company ? $referring_cust_main->company. ' ('. $referring_cust_main->last. ', '. $referring_cust_main->first. @@ -76,11 +93,120 @@ : $referring_cust_main->last. ', '. $referring_cust_main->first ) %> +% } -<% } %>
+ + <% mt('Order taker') |h %> + <% $cust_main->otaker %> + + + <% mt('Signup Date') |h %> + <% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %> + + +% 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}$/ ) { + <% mt('NRIC') |h %> +% } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) { + <% mt('Old IC/Passport') |h %> +% #} else { +% # warn "unknown national_id format"; +%# +% } + <% $cust_main->national_id |h %> + +% } 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, +% 'time_zone' =>'floating', +% ) +% : ''; + + + <% mt('Date of Birth') |h %> + <% $dt ? $dt->strftime($date_format) : '' %> + + +% 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' +% ); + + + <% mt('Spouse Date of Birth') |h %> + <% $dt ? $dt->strftime($date_format) : '' %> + + +% } +% } # 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', +% ) +% : ''; + + + <% mt('Anniversary Date') |h %> + <% $dt ? $dt->strftime($date_format) : '' %> + + +% } + +% if ( $cust_main->district ) { + + + <% mt('Tax district') |h %> + <% $cust_main->ship_location->district %> + + +% } + + +% if ( $conf->exists('ticket_system-selfservice_edit_subject') ) { + + + <% mt('Edit ticket subjects') %> + <% $cust_main->edit_subject ? 'yes' : 'no' %> + + +% } + +% foreach (sort { $a cmp $b } $cust_main->virtual_fields) { + <% $cust_main->pvf($_)->widget('HTML', 'view', $cust_main->getfield($_)) %> +% } + + +<%init> + +my( $cust_main ) = @_; +my $conf = new FS::Conf; +my $date_format = ($conf->config('date_format') || "%m/%d/%Y"); + +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)'; +} + +