X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Ftop_misc.html;h=c19f347c3297b6cb32372002b148210bdc669c33;hb=622c72770c971ae44d37dfb59a0f25972051a25a;hp=ebd9b927c76df2b8ad67b2d96c5aa21a3c28eab4;hpb=b799e8a48e0ea4e192d51fc445c3bee14c55e687;p=freeside.git diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index ebd9b927c..c19f347c3 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -27,18 +27,22 @@ 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'; } else { if ( document.getElementById('company').value.length == 0 ) { document.getElementById('company_row').style.display = 'none'; } document.getElementById('contacts_div').style.display = 'none'; + document.getElementById('spouse_row').style.display = ''; } } var ship_locked_agents = <% encode_json(\%ship_locked_agents) %>; - var ship_fields = ['address1', 'city', 'state', 'zip', 'country', - 'latitude', 'longitude', 'district']; + var ship_fields = [ + 'locationname', 'address1',<% $conf->exists('cust_main-no_city_in_address') ? '' : q( 'city',) %> 'state', 'zip', 'country', + 'latitude', 'longitude', 'district' + ]; function agent_changed(what) { var agentnum = what.value; @@ -79,6 +83,7 @@ } <&| /elements/onload.js &> + rescom_changed(document.getElementById('residential_commercial_Residential')); agent_changed(document.getElementById('agentnum')) @@ -154,9 +159,10 @@ % } else { - <& /elements/tr-select-part_referral.html, - 'curr_value' => $refnum - &> + <& /elements/tr-select-part_referral.html, + 'curr_value' => $refnum, + 'label' => "${r}".emt('Advertising source')."" + &> % } @@ -235,6 +241,8 @@ my( $cust_main, %opt ) = @_; my $custnum = $opt{'custnum'}; +my $conf = new FS::Conf; + if ( $cgi->param('error') ) { $cust_main->set('residential_commercial', ($cgi->param('residential_commercial') eq 'Commercial') @@ -248,12 +256,13 @@ if ( $cgi->param('error') ) { : 'Residential' ); } else { #new customer - #config to default to commercial and/or disable residential when someone needs - $cust_main->set('residential_commercial', 'Residential'); + $cust_main->set('residential_commercial', + $conf->exists('cust_main-default_commercial') + ? 'Commercial' + : 'Residential' + ); } -my $conf = new FS::Conf; - my $curuser = $FS::CurrentUser::CurrentUser; my $r = qq!* !; @@ -267,7 +276,10 @@ foreach (qsearch('agent',{})) { my $agent_ship_location = $cust_main->ship_location; $ship_locked_agents{$agentnum} = +{ map { $_ => $agent_ship_location->$_ } - qw(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') + ) }; }