X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=71e8d6973fbd579a132aca639ca1a6b806ea823b;hb=25b0525eb1f0d018b893a7bdc96b92a8f446020f;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..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,16 +85,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];
+%init>