X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=2cfe0263f8c2d9333d16521c0c79536dd5d84743;hb=b7c314a198c60a6f9236950994113aa422aa77ff;hp=9528db2437f6bb3ba762364e60462242a3fae671;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 9528db243..2cfe0263f 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -1,41 +1,29 @@ -% -% my( $cust_main ) = @_; -% my $conf = new FS::Conf; -% my $date_format = ($conf->config('date_format') || "%m/%d/%Y"); -% - - <% 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 %> - -% -% } 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# @@ -43,13 +31,18 @@ % % } -% + +% #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 % } ); -% - Advertising source @@ -97,16 +90,37 @@ % 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', +% ) +% : ''; Date of Birth - <% $cust_main->birthdate ne '' ? $dt->strftime($date_format) : '' %> + <% $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]; +