more contact-aware new customer screen, RT#16819
[freeside.git] / httemplate / edit / cust_main.cgi
index 002fd57..3994313 100755 (executable)
   <& cust_main/birthdate.html, $cust_main &>
 % }
 
-%# latitude and longitude
-% if ( $conf->exists('cust_main-require_censustract') ) {
-%   my ($latitude, $longitude) = $cust_main->service_coordinates;
-%   $latitude ||= $conf->config('company_latitude') || '';
-%   $longitude ||= $conf->config('company_longitude') || '';
-  <INPUT NAME="latitude" TYPE="hidden" VALUE="<% $latitude |h %>">
-  <INPUT NAME="longitude" TYPE="hidden" VALUE="<% $longitude |h %>">
-% }
-
 %# contact info
 
 %  my $same_checked = '';
 %    push @ship_style, 'background-color:#dddddd';
 %    foreach (
 %      qw( last first company address1 address2 city county state zip country
-%          daytime night fax )
+%          latitude longitude coord_auto
+%          daytime night fax mobile )
 %    ) {
 %      $cust_main->set("ship_$_", $cust_main->get($_) );
 %    }
 %  }
 
 <BR>
-<FONT SIZE="+1"><B><% mt('Billing address') |h %></B></FONT>
+<FONT CLASS="fsinnerbox-title"><% mt('Billing address') |h %></FONT>
 
 <& cust_main/contact.html,
              'cust_main'    => $cust_main,
@@ -73,7 +65,7 @@
 <SCRIPT>
 function bill_changed(what) {
   if ( what.form.same.checked ) {
-% for (qw( last first company address1 address2 city zip daytime night fax )) { 
+% for (qw( last first company address1 address2 city zip latitude longitude coord_auto daytime night fax mobile )) { 
     what.form.ship_<%$_%>.value = what.form.<%$_%>.value;
 % } 
 
@@ -103,7 +95,7 @@ function samechanged(what) {
   if ( what.checked ) {
     bill_changed(what);
 
-%   my @fields = qw( last first company address1 address2 city city_select county state zip country daytime night fax );
+%   my @fields = qw( last first company address1 address2 city city_select county state zip country latitude longitude daytime night fax mobile );
 %   for (@fields) { 
       what.form.ship_<%$_%>.disabled = true;
       what.form.ship_<%$_%>.style.backgroundColor = '#dddddd';
@@ -135,9 +127,9 @@ function samechanged(what) {
 </SCRIPT>
 
 <BR>
-<FONT SIZE="+1"><B><% mt('Service address') |h %></B></FONT>
+<FONT CLASS="fsinnerbox-title"><% mt('Service address') |h %></FONT>
 
-(<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)" <%$same_checked%>><% mt('same as billing address') |h %>)
+<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)" <%$same_checked%>><% mt('same as billing address') |h %>
 <& cust_main/contact.html,
              'cust_main' => $cust_main,
              'pre'       => 'ship_',
@@ -146,17 +138,23 @@ function samechanged(what) {
              'style'     => \@ship_style
 &>
 
+<& cust_main/contacts_new.html,
+             'cust_main' => $cust_main,
+&>
+
 %# billing info
 <& cust_main/billing.html, $cust_main,
                'payinfo'        => $payinfo,
                'invoicing_list' => \@invoicing_list,
 &>
+<BR>
 
 % my $ro_comments = $conf->exists('cust_main-use_comments')?'':'readonly';
 % if (!$ro_comments || $cust_main->comments) {
 
-    <BR><% mt('Comments') |h %> 
-    <% &ntable("#cccccc") %>
+    <BR>
+    <FONT CLASS="fsinnerbox-title"><% mt('Comments') |h %></FONT>
+    <TABLE CLASS="fsinnerbox">
       <TR>
         <TD>
           <TEXTAREA NAME = "comments"
@@ -193,8 +191,8 @@ function samechanged(what) {
 
 %# cust_main/bottomfixup.js
 % foreach my $hidden (
-%    'payauto',
-%    'payinfo', 'payinfo1', 'payinfo2', 'paytype',
+%    'payauto', 'billday',
+%    'payinfo', 'payinfo1', 'payinfo2', 'payinfo3', 'paytype',
 %    'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv',
 %    'paystart_month', 'paystart_year', 'payissue',
 %    'payip',
@@ -203,7 +201,7 @@ function samechanged(what) {
     <INPUT TYPE="hidden" NAME="<% $hidden %>" VALUE="">
 % } 
 
-<& cust_main/bottomfixup.html &>
+<& cust_main/bottomfixup.html, 'custnum' => $custnum &>
 
 <BR>
 <INPUT TYPE    = "button"
@@ -212,6 +210,7 @@ function samechanged(what) {
        VALUE   = "<% $custnum ?  emt("Apply changes") : emt("Add Customer") %>"
        onClick = "this.disabled=true; bottomfixup(this.form);"
 >
+<BR><BR>
 </FORM>
 
 <& /elements/footer.html &>
@@ -308,6 +307,8 @@ if ( $cgi->param('error') ) {
 
   $custnum='';
   $cust_main = new FS::cust_main ( {} );
+  $cust_main->agentnum( $conf->config('default_agentnum') )
+    if $conf->exists('default_agentnum');
   $cust_main->otaker( &getotaker );
   $cust_main->referral_custnum( $cgi->param('referral_custnum') );
   @invoicing_list = ();
@@ -340,7 +341,7 @@ if ( $cgi->param('error') ) {
     my $cust_location = $qual->cust_location;
     $cust_location->dealternize;
     $cust_main->$_( $cust_location->$_ )
-      foreach qw( address1 address2 city county state zip country geocode );
+      foreach qw( address1 address2 city county state zip country latitude longitude coord_auto geocode );
 
     #locationnum -> package order
     $locationnum = $qual->locationnum;