X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=71e8d6973fbd579a132aca639ca1a6b806ea823b;hb=94667348a71b2d7186861871ec6516958e6c4583;hp=121c0522a8e2d84bcd3ac94efd64d116cba4e52f;hpb=7c1d5f4ce778b4ab56301a042076e7c1dce46152;p=freeside.git diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 121c0522a..71e8d6973 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 } ); -% +%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 %> + +% } - - Agent - <% $agent->agentnum %>: <% $agent->agent %> - -% -% } else { -% $agent = $agents[0]; -% } -% -% if ( $cust_main->agent_custid ) { -% - +% if ( $cust_main->agent_custid +% && ! $conf->exists('cust_main-default_agent_custid') ) { Agent customer ref# @@ -97,18 +85,37 @@ % if ( $conf->exists('cust_main-enable_birthdate') ) { -% eval "use DateTime;"; -% die $@ if $@; -% 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 ? $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]; +