% &ntable("#cccccc") %>
%# agent
<% include('/elements/tr-select-agent.html', 
              'curr_value'    => $cust_main->agentnum,
              'label'         => "${r}Agent",
              'empty_label'   => 'Select agent',
              'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ),
           )
%>
%# agent_custid
% if ( $conf->exists('cust_main-edit_agent_custid') ) {
    
      | Customer identifier |  | 
% } else {
    
% }
%# referral (advertising source)
%my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
%if ( $custnum && ! $conf->exists('editreferrals') ) {
  
% } else { 
   <% include('/elements/tr-select-part_referral.html',
                'curr_value' => $refnum
             )
   %>
% } 
%# referring customer
%my $referring_cust_main = '';
%if ( $cust_main->referral_custnum
%     and $referring_cust_main =
%           qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
%) {
  
    | Referring customer | <% $cust_main->referral_custnum %>: <% $referring_cust_main->name %> | 
  
% } elsif ( ! $conf->exists('disable_customer_referrals') ) { 
  
    | Referring customer | <% include('/elements/search-cust_main.html',
                    'field_name' => 'referral_custnum',
                 )
      %> | 
% } else { 
  
% } 
%# signup date
% if ( $conf->exists('cust_main-edit_signupdate') ) {
    <% include('/elements/tr-input-date-field.html', {
                  'name'        => 'signupdate',
                  'value'       => $cust_main->signupdate,
                  'label'       => 'Signup date',
                  'format'      => $conf->config('date_format') || "%m/%d/%Y",
              })
    %>
% }
<%init>
my( $cust_main, %opt ) = @_;
my $custnum = $opt{'custnum'};
my $conf = new FS::Conf;
my $r = qq!* !;
%init>