From 395f58e0de1fe6bb1e4909e27550c0facac12d9f Mon Sep 17 00:00:00 2001 From: dallendalton Date: Mon, 22 Nov 2021 14:43:24 -0700 Subject: [PATCH] Fix dynamic tax code issues (#206) * Fix issue where dynamic rate was being used on shipping when save rates was enabled. * Version 4.0.1 --- CHANGELOG.md | 4 ++++ includes/TaxCalculation/class-tax-builder.php | 4 ++-- readme.txt | 6 +++++- taxjar-woocommerce.php | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85170e1..38d4d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 4.0.1 (2021-11-19) +* Change dynamic tax rate ID to 999999999 to help prevent issues with 3rd parties ingesting exported WooCommerce order data +* Fix issue where shipping was still utilizing dynamic tax rate when the save rates setting was enabled. + # 4.0.0 (2021-11-11) * Refactor cart tax calculation to stop calculation events from triggering twice * Fix issue with tax calculation on dynamically created products and variations diff --git a/includes/TaxCalculation/class-tax-builder.php b/includes/TaxCalculation/class-tax-builder.php index e75da25..b448fac 100644 --- a/includes/TaxCalculation/class-tax-builder.php +++ b/includes/TaxCalculation/class-tax-builder.php @@ -22,7 +22,7 @@ */ class Tax_Builder { - const TAX_RATE_ID = 999999999999999; + const TAX_RATE_ID = 999999999; /** * Determines whether to create a WooCommerce tax rate during tax calculation. @@ -185,7 +185,7 @@ public function build_shipping_tax( $applied_rate, $taxable_amount ) { $woo_rate = $this->create_woocommerce_rate( $applied_rate * 100 ); $wc_rate = $this->build_woocommerce_rate( $applied_rate * 100, $woo_rate['id'] ); } else { - $wc_rate = $this->build_woocommerce_rate( $applied_rate * 100 ); + $wc_rate = []; } } else { $wc_rate = $this->build_woocommerce_rate( $applied_rate * 100 ); diff --git a/readme.txt b/readme.txt index 7fb953e..c9efbc5 100755 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: taxjar, tonkapark, fastdivision Tags: woocommerce, taxjar, tax, taxes, sales tax, tax calculation, sales tax compliance, sales tax filing Requires at least: 5.4 Tested up to: 5.8.2 -Stable tag: 4.0.0 +Stable tag: 4.0.1 License: GPLv2 or later URI: http://www.gnu.org/licenses/gpl-2.0.html WC requires at least: 5.4.0 @@ -95,6 +95,10 @@ Our plans come with filings included, with additional filings available for purc == Changelog == += 4.0.1 (2021-11-19) +* Change dynamic tax rate ID to 999999999 to help prevent issues with 3rd parties ingesting exported WooCommerce order data +* Fix issue where shipping was still utilizing dynamic tax rate when the save rates setting was enabled. + = 4.0.0 (2021-11-11) * Refactor cart tax calculation to stop calculation events from triggering twice * Fix issue with tax calculation on dynamically created products and variations diff --git a/taxjar-woocommerce.php b/taxjar-woocommerce.php index 972ba3b..b687717 100755 --- a/taxjar-woocommerce.php +++ b/taxjar-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: TaxJar - Sales Tax Automation for WooCommerce * Plugin URI: https://www.taxjar.com/woocommerce-sales-tax-plugin/ * Description: Save hours every month by putting your sales tax on autopilot. Automated, multi-state sales tax calculation, collection, and filing. - * Version: 4.0.0 + * Version: 4.0.1 * Author: TaxJar * Author URI: https://www.taxjar.com * WC requires at least: 5.4.0 @@ -43,7 +43,7 @@ */ final class WC_Taxjar { - static $version = '4.0.0'; + static $version = '4.0.1'; public static $minimum_woocommerce_version = '5.4.0'; /**