X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Ftop_misc.html;h=7ba167b7fe4a907be6446b2d82314c09e12bd743;hp=2d1d978e304485f4ae969fcf4fb0982deb87b4d3;hb=9b4209f91ad9e3c4cef7deebfb0180f6faf1d0dc;hpb=5561349c87fdcc646c18010ea57925f90170f321 diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index 2d1d978e3..7ba167b7f 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -1,4 +1,49 @@ -<% &ntable("#cccccc") %> + + + + + + + + + + + + % foreach my $field ($cust_main->virtual_fields) { <% $cust_main->pvf($field)->widget('HTML', 'edit',$cust_main->getfield($field)) %> @@ -144,6 +189,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' : '' %> + >