X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Ftop_misc.html;h=cfed8e4f61bc7c3a1770bf8d5214072fcc451516;hb=3d18177c158acc492e9322677b11c8089df0fbc0;hp=2d1d978e304485f4ae969fcf4fb0982deb87b4d3;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index 2d1d978e3..cfed8e4f6 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -1,4 +1,38 @@ -<% &ntable("#cccccc") %> + + + + + + + + + + + % foreach my $field ($cust_main->virtual_fields) { <% $cust_main->pvf($field)->widget('HTML', 'edit',$cust_main->getfield($field)) %> @@ -80,7 +114,7 @@ @@ -144,6 +178,23 @@ my( $cust_main, %opt ) = @_; my $custnum = $opt{'custnum'}; +if ( $cgi->param('error') ) { + $cust_main->set('residential_commercial', + ($cgi->param('residential_commercial') eq 'Commercial') + ? 'Commercial' + : 'Residential' + ); +} elsif ( $custnum ) { #editing + $cust_main->set('residential_commercial', + length($cust_main->company) + ? 'Commercial' + : 'Residential' + ); +} else { #new customer + #config to default to commercial and/or disable residential when someone needs + $cust_main->set('residential_commercial', 'Residential'); +} + my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser;
Residentialresidential_commercial eq 'Commercial' ? '' : 'CHECKED' %> + >
Commercialresidential_commercial eq 'Commercial' ? 'CHECKED' : '' %> + >
<% mt('Referring customer') |h %> - <% $cust_main->referral_custnum %>: <% $referring_cust_main->name %> + <% $cust_main->referral_custnum %>: <% $referring_cust_main->name |h %>