X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbasics.html;h=c3768ac427aa1bf41aa5c2c6010c2a877259f274;hb=b2fd002f3285b70311642f8ff0025598d42bd16e;hp=2ca6f65a539653f9027cced184765fff64e903d4;hpb=b6260b4f39cf34b9e0e5b8560ef88c8881ba0766;p=freeside.git diff --git a/httemplate/edit/cust_main/basics.html b/httemplate/edit/cust_main/basics.html index 2ca6f65a5..c3768ac42 100644 --- a/httemplate/edit/cust_main/basics.html +++ b/httemplate/edit/cust_main/basics.html @@ -25,22 +25,32 @@ function rescom_changed(what) { if ( what.checked == (what.value == 'Commercial' ) ) { - document.getElementById('company_row').style.display = ''; - document.getElementById('contacts_div').style.display = ''; - document.getElementById('spouse_row').style.display = 'none'; + $('#company_label').slideDown(); + $('#company_input').slideDown(); + $('#contacts_div').slideDown(); + $('#spouse_label').slideUp(); + $('#spouse_last_input').slideUp(); + $('#spouse_first_input').slideUp(); + $('#invoice_email_label').slideUp(); + $('#invoice_email_input').slideUp(); } else { if ( document.getElementById('company').value.length == 0 ) { - document.getElementById('company_row').style.display = 'none'; + $('#company_label').slideUp(); + $('#company_input').slideUp(); } - document.getElementById('contacts_div').style.display = 'none'; - document.getElementById('spouse_row').style.display = ''; + $('#contacts_div').slideUp(); + $('#spouse_label').slideDown(); + $('#spouse_last_input').slideDown(); + $('#spouse_first_input').slideDown(); + $('#invoice_email_label').slideDown(); + $('#invoice_email_input').slideDown(); } } var ship_locked_agents = <% encode_json(\%ship_locked_agents) %>; var ship_fields = [ - 'locationname', 'address1', 'city', 'state', 'zip', 'country', + 'locationname', 'address1',<% $conf->exists('cust_main-no_city_in_address') ? '' : q( 'city',) %> 'state', 'zip', 'country', 'latitude', 'longitude', 'district' ]; @@ -50,6 +60,7 @@ % # unlock/lock service location var f = what.form; + var was_same = f['same'].checked; if ( ship_locked_agents[agentnum] ) { % # For this agent, the service location (except address2) % # should be locked to the agent's location. @@ -66,16 +77,25 @@ % # disabled, then they contain some agent's address, which is % # no longer meaningful. So set them back to the customer's % # current location. + var is_same = true; for(var i=0; i rescom_changed(document.getElementById('residential_commercial_Residential')); agent_changed(document.getElementById('agentnum')); - samechanged(document.getElementById('same')); + + if ( $('#same').prop('checked') ) { + $('#div_ship_location').hide(); + } else { + $('#div_ship_location').show(); + } + @@ -285,7 +311,10 @@ foreach (qsearch('agent',{})) { my $agent_ship_location = $cust_main->ship_location; $ship_locked_agents{$agentnum} = +{ map { $_ => $agent_ship_location->$_ } - qw(locationname address1 city state zip country latitude longitude district) + ( + qw(locationname address1 state zip country latitude longitude district), + ($conf->exists('cust_main-no_city_in_address') ? () : 'city') + ) }; }