X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FBilling.pm;h=c0c15e44c863a6e7548e586ee84277d10c11aedf;hp=47cbbf17e9596d9b52513b6727c06c5b572a9df6;hb=07ed221540128b8c75f4cb5a2af1e01b25fa8e18;hpb=14f234a943f1e4b5bbc6fe90254b8f5ca677f028 diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index 47cbbf17e..c0c15e44c 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -1651,10 +1651,28 @@ sub _handle_taxes { my @taxes = (); # entries are cust_main_county objects my %taxhash_elim = %taxhash; my @elim = qw( district city county state ); + + # WA state district city names are not stable in the WA tax tables + # Allow districts to match with just a district id + if ( $taxhash{district} ) { + @taxes = qsearch( cust_main_county => { + district => $taxhash{district}, + taxclass => $taxhash{taxclass}, + }); + if ( !scalar(@taxes) && $taxhash{taxclass} ) { + qsearch( cust_main_county => { + district => $taxhash{district}, + taxclass => '', + }); + } + } + do { #first try a match with taxclass - @taxes = qsearch( 'cust_main_county', \%taxhash_elim ); + if ( !scalar(@taxes) ) { + @taxes = qsearch( 'cust_main_county', \%taxhash_elim ); + } if ( !scalar(@taxes) && $taxhash_elim{'taxclass'} ) { #then try a match without taxclass