optimize CDR rating after timed rate perf regression, RT#15739
[freeside.git] / httemplate / edit / cust_main.cgi
index 1c188dc..e823f7c 100755 (executable)
@@ -15,7 +15,7 @@
 <INPUT TYPE="hidden" NAME="prospectnum" VALUE="<% $prospectnum %>">
 
 % if ( $custnum ) { 
-  Customer #<B><% $cust_main->display_custnum %></B> - 
+  <% mt('Customer #') |h %><B><% $cust_main->display_custnum %></B> - 
   <B><FONT COLOR="#<% $cust_main->statuscolor %>">
     <% ucfirst($cust_main->status) %>
   </FONT></B>
 %    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>Billing address</B></FONT>
+<FONT SIZE="+1"><B><% mt('Billing address') |h %></B></FONT>
 
 <& cust_main/contact.html,
              'cust_main'    => $cust_main,
@@ -73,7 +74,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 +104,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';
@@ -193,8 +194,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',
@@ -209,7 +210,7 @@ function samechanged(what) {
 <INPUT TYPE    = "button"
        NAME    = "submitButton"
        ID      = "submitButton"
-       VALUE   = "<% $custnum ?  "Apply Changes" : "Add Customer" %>"
+       VALUE   = "<% $custnum ?  emt("Apply changes") : emt("Add Customer") %>"
        onClick = "this.disabled=true; bottomfixup(this.form);"
 >
 </FORM>
@@ -308,6 +309,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 +343,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;
@@ -366,7 +369,7 @@ my %keep = map { $_=>1 } qw( error tagnum lock_agentnum lock_pkgpart );
 $cgi->delete( grep !$keep{$_}, $cgi->param );
 
 my $title = $custnum ? 'Edit Customer' : 'Add Customer';
-$title = emt($title);
+$title = mt($title);
 $title .= ": ". $cust_main->name if $custnum;
 
 my $r = qq!<font color="#ff0000">*</font>&nbsp;!;