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