From: Ivan Kohler Date: Fri, 26 Jul 2019 18:14:05 +0000 (-0700) Subject: Merge branch 'master' of git.freeside.biz:/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=07ed221540128b8c75f4cb5a2af1e01b25fa8e18;hp=-c Merge branch 'master' of git.freeside.biz:/home/git/freeside --- 07ed221540128b8c75f4cb5a2af1e01b25fa8e18 diff --combined FS/FS/cust_main/Billing.pm index 47cbbf17e,aadc8e1e9..c0c15e44c --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@@ -1087,9 -1087,7 +1087,9 @@@ sub _make_lines } $lineitems++ - if $cust_pkg->waive_setup && $part_pkg->can('prorate_setup') && $part_pkg->prorate_setup($cust_pkg, $time); + if $cust_pkg->waive_setup + && $part_pkg->can('prorate_setup') + && $part_pkg->prorate_setup($cust_pkg, $time); if ( $cust_pkg->get('setup') ) { # don't change it @@@ -1651,10 -1649,28 +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