cec24bd093fab4a9b8450a579a77ee15b1ba46d5
[freeside.git] / httemplate / edit / cust_main / top_misc.html
1 <% &ntable("#cccccc") %>
2
3 %# tags
4 <% include('/elements/tr-select-cust_tag.html',
5              'custnum' => $custnum,
6              'cgi'     => $cgi,
7           )
8 %>
9
10 %# agent
11 <% include('/elements/tr-select-agent.html', 
12               'curr_value'    => $cust_main->agentnum,
13               'label'         => "<B>${r}Agent</B>",
14               'empty_label'   => 'Select agent',
15               'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ),
16            )
17 %>
18
19 %# agent_custid
20 % if ( $conf->exists('cust_main-edit_agent_custid') ) {
21
22     <TR>
23       <TD ALIGN="right">Customer identifier</TD>
24       <TD><INPUT TYPE="text" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>"></TD>
25     </TR>
26
27 % } else {
28
29     <INPUT TYPE="hidden" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>">
30
31 % }
32
33 %# referral (advertising source)
34 %my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
35 %if ( $custnum && ! $conf->exists('editreferrals') ) {
36
37   <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
38
39 % } else { 
40
41    <% include('/elements/tr-select-part_referral.html',
42                 'curr_value' => $refnum
43              )
44    %>
45 % } 
46
47
48 %# referring customer
49 %my $referring_cust_main = '';
50 %if ( $cust_main->referral_custnum
51 %     and $referring_cust_main =
52 %           qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
53 %     and ! $curuser->access_right('Edit referring customer')
54 %) {
55
56   <TR>
57     <TD ALIGN="right">Referring customer</TD>
58     <TD>
59       <A HREF="<% popurl(1) %>/cust_main.cgi?<% $cust_main->referral_custnum %>"><% $cust_main->referral_custnum %>: <% $referring_cust_main->name %></A>
60     </TD>
61   </TR>
62   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<% $cust_main->referral_custnum %>">
63
64 % } elsif ( ! $conf->exists('disable_customer_referrals') ) { 
65
66   <TR>
67     <TD ALIGN="right">Referring customer</TD>
68     <TD>
69       <!-- <INPUT TYPE="text" NAME="referral_custnum" VALUE=""> -->
70       <% include('/elements/search-cust_main.html',
71                     'field_name' => 'referral_custnum',
72                     'curr_value' => $cust_main->referral_custnum,
73                  )
74       %>
75     </TD>
76   </TR>
77
78 % } else { 
79   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">
80 % } 
81
82 %# signup date
83 % if ( $conf->exists('cust_main-edit_signupdate') ) {
84     <% include('/elements/tr-input-date-field.html', {
85                   'name'        => 'signupdate',
86                   'value'       => $cust_main->signupdate,
87                   'label'       => 'Signup date',
88                   'format'      => ( $conf->config('date_format') || "%m/%d/%Y" ),
89               })
90     %>
91 % }
92
93 </TABLE>
94
95 <%init>
96
97 my( $cust_main, %opt ) = @_;
98
99 my $custnum = $opt{'custnum'};
100
101 my $conf = new FS::Conf;
102
103 my $curuser = $FS::CurrentUser::CurrentUser;
104
105 my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
106
107 </%init>