This PR adds an optional parameter to Tax_Builder::build_line_tax_from_rate to prevent saving some tax rates to WooCommerce. This will prevent saving any tax rates that are calculated based on taxes applied to line items which are used as variables of other calculations. Another solution to this would be to expose the private method build_woocommerce_rate but I wanted to get your feedback on this. I have ran this patch both in my staging environment and production now for a few days and everything has been going smooth.
Here are some photos of the production data after the application of the patch.
This is the tax rate saved to the order item which is the rate percent my customer uses to send to an upstream provider as explained in #221. It now matches the correct value from taxjar sales tax calculation.
Here are various rates that have been calculated over the course of a few days for taxable orders. All of which are now matching the taxjar sales tax calculator values.
Closes #221
This PR adds an optional parameter to Tax_Builder::build_line_tax_from_rate to prevent saving some tax rates to WooCommerce. This will prevent saving any tax rates that are calculated based on taxes applied to line items which are used as variables of other calculations. Another solution to this would be to expose the private method
build_woocommerce_rate
but I wanted to get your feedback on this. I have ran this patch both in my staging environment and production now for a few days and everything has been going smooth.Here are some photos of the production data after the application of the patch.
This is the tax rate for this orders ZIP code from the taxjar sales tax calculator.
This is the tax rate saved to the order item which is the rate percent my customer uses to send to an upstream provider as explained in #221. It now matches the correct value from taxjar sales tax calculation.
Here are various rates that have been calculated over the course of a few days for taxable orders. All of which are now matching the taxjar sales tax calculator values.
Click-Test Versions
Specs Passing