signup date fix?
[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 %# class
27 <% include('/elements/tr-select-cust_class.html',
28              'curr_value'  => $cust_main->classnum,
29              'label'       => "Class",
30              #'empty_label' => '(none)',
31              #'disable_empty' => 
32           )
33 %>
34
35 %# referral (advertising source)
36 %my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
37 %if ( $custnum && ! $conf->exists('editreferrals') ) {
38
39   <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
40
41 % } else { 
42
43    <% include('/elements/tr-select-part_referral.html',
44                 'curr_value' => $refnum
45              )
46    %>
47 % } 
48
49
50 %# referring customer
51 %my $referring_cust_main = '';
52 %if ( $cust_main->referral_custnum
53 %     and $referring_cust_main =
54 %           qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
55 %     and ! $curuser->access_right('Edit referring customer')
56 %) {
57
58   <TR>
59     <TD ALIGN="right">Referring customer</TD>
60     <TD>
61       <A HREF="<% popurl(1) %>/cust_main.cgi?<% $cust_main->referral_custnum %>"><% $cust_main->referral_custnum %>: <% $referring_cust_main->name %></A>
62     </TD>
63   </TR>
64   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<% $cust_main->referral_custnum %>">
65
66 % } elsif ( ! $conf->exists('disable_customer_referrals') ) { 
67
68   <TR>
69     <TD ALIGN="right">Referring customer</TD>
70     <TD>
71       <!-- <INPUT TYPE="text" NAME="referral_custnum" VALUE=""> -->
72       <% include('/elements/search-cust_main.html',
73                     'field_name' => 'referral_custnum',
74                     'curr_value' => $cust_main->referral_custnum,
75                  )
76       %>
77     </TD>
78   </TR>
79
80 % } else { 
81   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">
82 % } 
83
84 %# signup date
85 % if ( $conf->exists('cust_main-edit_signupdate') ) {
86     <% include('/elements/tr-input-date-field.html', {
87                   'name'        => 'signupdate',
88                   'value'       => $cust_main->signupdate,
89                   'label'       => 'Signup date',
90                   'format'      => ( $conf->config('date_format') || "%m/%d/%Y" ),
91               })
92     %>
93 % }
94
95 </TABLE>
96
97 <%init>
98
99 my( $cust_main, %opt ) = @_;
100
101 my $custnum = $opt{'custnum'};
102
103 my $conf = new FS::Conf;
104
105 my $curuser = $FS::CurrentUser::CurrentUser;
106
107 my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
108
109 </%init>