blob: 69e120573ed89b2210acc8f414ae53b02c3663ec (
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
|
<%
my( $cust_main ) = @_;
%>
<%= ntable("#cccccc") %><TR><TD><%= &ntable("#cccccc",2) %>
<TR>
<TD ALIGN="right">Customer number</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->custnum %></TD>
</TR>
<%
my @agents = qsearch( 'agent', {} );
my $agent;
unless ( scalar(@agents) == 1 ) {
$agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
%>
<TR>
<TD ALIGN="right">Agent</TD>
<TD BGCOLOR="#ffffff"><%= $agent->agentnum %>: <%= $agent->agent %></TD>
</TR>
<%
} else {
$agent = $agents[0];
}
my @referrals = qsearch( 'part_referral', {} );
unless ( scalar(@referrals) == 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">Order taker</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->otaker %></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>
</TABLE></TD></TR></TABLE>
|