This commit was manufactured by cvs2svn to create tag 'freeside_2_1_0'.
[freeside.git] / httemplate / view / cust_main / misc.html
1 <% ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
2
3 <TR>
4   <TD ALIGN="right">Customer&nbsp;number</TD>
5   <TD BGCOLOR="#ffffff"><% $cust_main->display_custnum %></TD>
6 </TR>
7
8 <TR>
9   <TD ALIGN="right">Status</TD>
10   <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% ucfirst($cust_main->status) %></B></FONT></TD>
11 </TR>
12
13 %my $agent;
14 %if ( $num_agents == 1 ) {
15 %  my @agents = qsearchs( 'agent', {} );
16 %  $agent = $agents[0];
17 %} else {
18 %  $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
19    <TR>
20      <TD ALIGN="right">Agent</TD>
21      <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
22    </TR>
23 % }
24
25 %  if ( $cust_main->agent_custid
26 %       && ! $conf->exists('cust_main-default_agent_custid') ) {
27
28 <TR>
29   <TD ALIGN="right">Agent customer ref#</TD>
30   <TD BGCOLOR="#ffffff"><% $cust_main->agent_custid %></TD>
31 </TR>
32 %
33 %  }
34
35 %  #if ( $cust_main->classnum ) {
36      <TR>
37        <TD ALIGN="right">Class</TD>
38        <TD BGCOLOR="#ffffff"><% $cust_main->classname || '(none)' %></TD>
39      </TR>
40 %  #}
41
42 %  unless ( FS::part_referral->num_part_referral == 1 ) {
43 %    my $referral = qsearchs('part_referral', {
44 %      'refnum' => $cust_main->refnum
45 %    } );
46
47 <TR>
48   <TD ALIGN="right">Advertising&nbsp;source</TD>
49   <TD BGCOLOR="#ffffff"><% $referral->refnum %>: <% $referral->referral%></TD>
50 </TR>
51 % } 
52
53
54 <TR>
55   <TD ALIGN="right">Referring&nbsp;Customer</TD>
56   <TD BGCOLOR="#ffffff">
57 %
58 %  my $referring_cust_main = '';
59 %  if ( $cust_main->referral_custnum
60 %       && ( $referring_cust_main =
61 %            qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
62 %          )
63 %     ) {
64 %
65
66
67 <A HREF="<% popurl(1) %>cust_main.cgi?<% $cust_main->referral_custnum %>"><%$cust_main->referral_custnum %>: 
68 <%
69   ( $referring_cust_main->company
70       ? $referring_cust_main->company. ' ('.
71           $referring_cust_main->last. ', '. $referring_cust_main->first.
72           ')'
73       : $referring_cust_main->last. ', '. $referring_cust_main->first
74   )
75 %></A>
76 % } 
77
78
79   </TD>
80 </TR>
81
82 <TR>
83   <TD ALIGN="right">Order taker</TD>
84   <TD BGCOLOR="#ffffff"><% $cust_main->otaker %></TD>
85 </TR>
86
87   <TR>
88     <TD ALIGN="right">Signup Date</TD>
89     <TD BGCOLOR="#ffffff"><% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %></TD>
90   </TR>
91
92 % if ( $conf->exists('cust_main-enable_birthdate') ) {
93 %   my $dt = $cust_main->birthdate ne ''
94 %              ? DateTime->from_epoch( 'epoch'     => $cust_main->birthdate,
95 %                                      'time_zone' =>'floating',
96 %                                    )
97 %              : '';
98
99   <TR>
100     <TD ALIGN="right">Date of Birth</TD>
101     <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD>
102   </TR>
103
104 % }
105
106 % if ( $conf->exists('cust_main-require_censustract') ) {
107
108   <TR>
109     <TD ALIGN="right">Census tract</TD>
110     <TD BGCOLOR="#ffffff"><% $cust_main->censustract  %></TD>
111   </TR>
112
113 % }
114
115 </TABLE></TD></TR></TABLE>
116 <%init>
117
118 my( $cust_main ) = @_;
119 my $conf = new FS::Conf;
120 my $date_format = ($conf->config('date_format') || "%m/%d/%Y");
121
122 my $sth = dbh->prepare('SELECT COUNT(*) FROM agent') or die dbh->errstr;
123 $sth->execute or die $sth->errstr;
124 my $num_agents = $sth->fetchrow_arrayref->[0];
125
126 </%init>