blob: 91b304b5d71857fd6e1d2c5eb5fa4f4729f5fa1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
<% ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
<TR>
<TD ALIGN="right">Customer number</TD>
<TD BGCOLOR="#ffffff"><% $cust_main->display_custnum %></TD>
</TR>
<TR>
<TD ALIGN="right">Status</TD>
<TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% ucfirst($cust_main->status) %></B></FONT></TD>
</TR>
%my $agent;
%if ( $num_agents == 1 ) {
% my @agents = qsearchs( 'agent', {} );
% $agent = $agents[0];
%} else {
% $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
<TR>
<TD ALIGN="right">Agent</TD>
<TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
</TR>
% }
% if ( $cust_main->agent_custid
% && ! $conf->exists('cust_main-default_agent_custid') ) {
<TR>
<TD ALIGN="right">Agent customer ref#</TD>
<TD BGCOLOR="#ffffff"><% $cust_main->agent_custid %></TD>
</TR>
%
% }
%
% unless ( FS::part_referral->num_part_referral == 1 ) {
% my $referral = qsearchs('part_referral', {
% 'refnum' => $cust_main->refnum
% } );
%
<TR>
<TD ALIGN="right">Advertising source</TD>
<TD BGCOLOR="#ffffff"><% $referral->refnum %>: <% $referral->referral%></TD>
</TR>
% }
<TR>
<TD ALIGN="right">Referring Customer</TD>
<TD BGCOLOR="#ffffff">
%
% my $referring_cust_main = '';
% if ( $cust_main->referral_custnum
% && ( $referring_cust_main =
% qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
% )
% ) {
%
<A HREF="<% popurl(1) %>cust_main.cgi?<% $cust_main->referral_custnum %>"><%$cust_main->referral_custnum %>:
<%
( $referring_cust_main->company
? $referring_cust_main->company. ' ('.
$referring_cust_main->last. ', '. $referring_cust_main->first.
')'
: $referring_cust_main->last. ', '. $referring_cust_main->first
)
%></A>
% }
</TD>
</TR>
<TR>
<TD ALIGN="right">Order taker</TD>
<TD BGCOLOR="#ffffff"><% $cust_main->otaker %></TD>
</TR>
<TR>
<TD ALIGN="right">Signup Date</TD>
<TD BGCOLOR="#ffffff"><% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %></TD>
</TR>
% if ( $conf->exists('cust_main-enable_birthdate') ) {
% my $dt = $cust_main->birthdate ne ''
% ? DateTime->from_epoch( 'epoch' => $cust_main->birthdate,
% 'time_zone' =>'floating',
% )
% : '';
<TR>
<TD ALIGN="right">Date of Birth</TD>
<TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD>
</TR>
% }
</TABLE></TD></TR></TABLE>
<%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>
|