diff options
author | Mitch Jackson <mitch@freeside.biz> | 2019-06-12 03:22:57 -0400 |
---|---|---|
committer | Mitch Jackson <mitch@freeside.biz> | 2019-06-12 03:54:40 -0400 |
commit | 885556b3b066581111b485b78ac33033f2b469db (patch) | |
tree | 5686ff79e1e64eb221121887ef3a7f3cc87eae3f /FS/FS/cust_main | |
parent | c1aab36c38e3a5a9882aa099c1d3e21cc77f99f0 (diff) |
RT# 80488 Ensure WA distrct taxes are properly applied
Diffstat (limited to 'FS/FS/cust_main')
-rw-r--r-- | FS/FS/cust_main/Billing.pm | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index 5f8dd9b..aadc8e1 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -1649,10 +1649,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 |