+ if ( $use_pkgloc and $h_cust_pkg->locationnum ) {
+ # then this package already had a locationnum assigned, and that's
+ # the one to use for tax calculation
+ $tax_loc{$pkgnum} = FS::cust_location->by_key($h_cust_pkg->locationnum);
+ } else {
+ # use the customer's bill or ship loc, which was inserted earlier
+ $tax_loc{$pkgnum} = $default_tax_loc;
+ }
+