X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=2cfe0263f8c2d9333d16521c0c79536dd5d84743;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=f06a4fbd20f0da75c47c085f2eb75028fb952468;hpb=8e3dfb380406e145494a5fffa7a0e4aab7b38253;p=freeside.git diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index f06a4fbd2..2cfe0263f 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -1,76 +1,71 @@ -<% - my( $cust_main ) = @_; - my $conf = new FS::Conf; -%> - -<%= ntable("#cccccc") %><%= &ntable("#cccccc",2) %> +<% ntable("#cccccc") %><% &ntable("#cccccc",2) %> Customer number - <%= $cust_main->custnum %> + <% $cust_main->display_custnum %> Status - <%= ucfirst($cust_main->status) %> - - -<% - my @agents = qsearch( 'agent', {} ); - my $agent; - unless ( scalar(@agents) == 1 ) { - $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); -%> - - - Agent - <%= $agent->agentnum %>: <%= $agent->agent %> + <% ucfirst($cust_main->status) %> -<% - } else { - $agent = $agents[0]; - } - - if ( $cust_main->agent_custid ) { -%> +%my $agent; +%if ( $num_agents == 1 ) { +% my @agents = qsearchs( 'agent', {} ); +% $agent = $agents[0]; +%} else { +% $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); + + Agent + <% $agent->agentnum %>: <% $agent->agent %> + +% } + +% if ( $cust_main->agent_custid +% && ! $conf->exists('cust_main-default_agent_custid') ) { Agent customer ref# - <%= $cust_main->agent_custid %> + <% $cust_main->agent_custid %> +% +% } -<% - } +% #if ( $cust_main->classnum ) { + + Class + <% $cust_main->classname || '(none)' %> + +% #} - unless ( FS::part_referral->num_part_referral == 1 ) { - my $referral = qsearchs('part_referral', { - 'refnum' => $cust_main->refnum - } ); -%> +% unless ( FS::part_referral->num_part_referral == 1 ) { +% my $referral = qsearchs('part_referral', { +% 'refnum' => $cust_main->refnum +% } ); Advertising source - <%= $referral->refnum %>: <%= $referral->referral%> + <% $referral->refnum %>: <% $referral->referral%> +% } -<% } %> Referring Customer +% +% my $referring_cust_main = ''; +% if ( $cust_main->referral_custnum +% && ( $referring_cust_main = +% qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) +% ) +% ) { +% + +<%$cust_main->referral_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. @@ -78,16 +73,54 @@ : $referring_cust_main->last. ', '. $referring_cust_main->first ) %> +% } -<% } %> Order taker - <%= $cust_main->otaker %> + <% $cust_main->otaker %> + + Signup Date + <% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %> + + +% if ( $conf->exists('cust_main-enable_birthdate') ) { +% my $dt = $cust_main->birthdate ne '' +% ? DateTime->from_epoch( 'epoch' => $cust_main->birthdate, +% 'time_zone' =>'floating', +% ) +% : ''; + + + Date of Birth + <% $dt ? $dt->strftime($date_format) : '' %> + + +% } + +% if ( $conf->exists('cust_main-require_censustract') ) { + + + Census tract + <% $cust_main->censustract %> + + +% } + +<%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]; +