X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main_county.pm;h=28f69c2627124ef09818a58a85171aa736a1c841;hb=91249e69d7126b456ba444686ab9f7485c121534;hp=56d29da940040f082ae31b5d2b90a12989c9369a;hpb=20bb426a02c0ea54d8feaea7c5da51735ab70293;p=freeside.git diff --git a/FS/FS/cust_main_county.pm b/FS/FS/cust_main_county.pm index 56d29da94..28f69c262 100644 --- a/FS/FS/cust_main_county.pm +++ b/FS/FS/cust_main_county.pm @@ -57,6 +57,10 @@ currently supported: =item tax - percentage +=item taxclass + +=item exempt_amount + =back =head1 METHODS @@ -97,11 +101,15 @@ methods. sub check { my $self = shift; + $self->exempt_amount(0) unless $self->exempt_amount; + $self->ut_numbern('taxnum') || $self->ut_textn('state') || $self->ut_textn('county') || $self->ut_text('country') || $self->ut_float('tax') + || $self->ut_textn('taxclass') # ... + || $self->ut_money('exempt_amount') ; } @@ -126,7 +134,8 @@ sub regionselector { @cust_main_county = qsearch('cust_main_county', {} ); foreach my $c ( @cust_main_county ) { $countyflag=1 if $c->county; - push @{$cust_main_county{$c->country}{$c->state}}, $c->county; + #push @{$cust_main_county{$c->country}{$c->state}}, $c->county; + $cust_main_county{$c->country}{$c->state}{$c->county} = 1; } # } $countyflag=1 if $selected_county; @@ -171,7 +180,8 @@ END $script_html .= "\nif ( country == \"$country\" ) {\n"; foreach my $state ( sort keys %{$cust_main_county{$country}} ) { $script_html .= "\nif ( state == \"$state\" ) {\n"; - foreach my $county ( sort @{$cust_main_county{$country}{$state}} ) { + #foreach my $county ( sort @{$cust_main_county{$country}{$state}} ) { + foreach my $county ( sort keys %{$cust_main_county{$country}{$state}} ) { my $text = $county || '(n/a)'; $script_html .= qq!opt(what.form.${prefix}county, "$county", "$text");\n!;