From 9f4306b57b80aa9fb41d03e5618b7ce121d0d86d Mon Sep 17 00:00:00 2001 From: Brett Porcelli Date: Wed, 2 Nov 2022 10:13:59 -0400 Subject: [PATCH 1/5] fix: order exemption certificates by created date --- includes/class-sst-certificates.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/class-sst-certificates.php b/includes/class-sst-certificates.php index af224161..a7503745 100644 --- a/includes/class-sst-certificates.php +++ b/includes/class-sst-certificates.php @@ -166,6 +166,16 @@ public static function get_certificates_formatted( $user_id = 0 ) { $certificates[ $id ] = self::format_certificate( $raw_cert ); } + // Sort by created date ascending. + uasort( $certificates, function( $cert_a, $cert_b ) { + $date_a = $cert_a['CreatedDate']; + $date_b = $cert_b['CreatedDate']; + if ( $date_a === $date_b ) { + return 0; + } + return $date_a < $date_b ? -1 : 1; + } ); + return $certificates; } From 53c821090a31550a04bf0c5924fa1ad7a1e0f3fa Mon Sep 17 00:00:00 2001 From: Brett Porcelli Date: Wed, 2 Nov 2022 10:14:36 -0400 Subject: [PATCH 2/5] fix(test): remove coupons after coupon tests --- cypress/e2e/frontend/coupon-calculations.cy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/frontend/coupon-calculations.cy.js b/cypress/e2e/frontend/coupon-calculations.cy.js index 4beaaeeb..5adc77f7 100644 --- a/cypress/e2e/frontend/coupon-calculations.cy.js +++ b/cypress/e2e/frontend/coupon-calculations.cy.js @@ -25,6 +25,7 @@ describe('Coupon calculations', () => { cy.addProductToCart('General Product'); cy.visit('/cart/'); + removeCoupon(); cy.get('.shipping-calculator-button').click(); cy.get('#calc_shipping_state').select('NY', {force: true}); @@ -34,7 +35,7 @@ describe('Coupon calculations', () => { cy.waitForBlockedElements(); }); - beforeEach(() => { + afterEach(() => { removeCoupon(); }); From 157e1cf1d2f1510446d9d4b9e965535d2f722994 Mon Sep 17 00:00:00 2001 From: Brett Porcelli Date: Wed, 2 Nov 2022 10:15:12 -0400 Subject: [PATCH 3/5] fix(test): wait for clearCookies before running rest api test --- cypress/e2e/rest/create-order.cy.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/rest/create-order.cy.js b/cypress/e2e/rest/create-order.cy.js index 66dc83f3..70ca07f4 100644 --- a/cypress/e2e/rest/create-order.cy.js +++ b/cypress/e2e/rest/create-order.cy.js @@ -16,11 +16,11 @@ describe('REST API order calculations', () => { }; // Clear out any auth cookies to avoid 401s. - cy.clearCookies(); - - cy.request(requestOptions).then((response) => { - expect(response.status).to.eq(201); - expect(parseFloat(response.body.total_tax)).to.be.gt(0); + cy.clearCookies().then(() => { + cy.request(requestOptions).then((response) => { + expect(response.status).to.eq(201); + expect(parseFloat(response.body.total_tax)).to.be.gt(0); + }); }); }); }); From 49d3e0f7e4c92c6bda6ba4fe8ab90ea2caa4d5d7 Mon Sep 17 00:00:00 2001 From: Brett Porcelli Date: Wed, 2 Nov 2022 10:17:00 -0400 Subject: [PATCH 4/5] chore(deps): bump tested WC version to 7.1 --- simple-sales-tax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple-sales-tax.php b/simple-sales-tax.php index 4931d9e8..746af0a2 100644 --- a/simple-sales-tax.php +++ b/simple-sales-tax.php @@ -13,7 +13,7 @@ * Requires at least: 4.5.0 * Tested up to: 6.1.0 * WC requires at least: 3.0.0 - * WC tested up to: 7.0.0 + * WC tested up to: 7.1.0 * * @category Plugin * @copyright Copyright © 2022 The Federal Tax Authority, LLC From e0facca1b3eea42fe5570714f9c9fd027b176aa8 Mon Sep 17 00:00:00 2001 From: Brett Porcelli Date: Wed, 2 Nov 2022 10:20:54 -0400 Subject: [PATCH 5/5] chore: prep for 7.0.3 release --- changelog.txt | 8 ++++++++ includes/class-simplesalestax.php | 2 +- languages/simple-sales-tax.pot | 4 ++-- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- simple-sales-tax.php | 2 +- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index 46ed9422..fcba9792 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,14 @@ Changelog for Simple Sales Tax Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). += [7.0.3] - 2022-11-02 = + +Fixed: +- Order exemption certificates by created date in certificate table + +Changed: +- Bump tested WooCommerce version to 7.1 + = [7.0.2] - 2022-10-14 = Fixed: diff --git a/includes/class-simplesalestax.php b/includes/class-simplesalestax.php index 9a0bfe93..3a06028d 100644 --- a/includes/class-simplesalestax.php +++ b/includes/class-simplesalestax.php @@ -20,7 +20,7 @@ final class SimpleSalesTax { * * @var string */ - public $version = '7.0.2'; + public $version = '7.0.3'; /** * The singleton plugin instance. diff --git a/languages/simple-sales-tax.pot b/languages/simple-sales-tax.pot index dad7baf6..40ac302c 100644 --- a/languages/simple-sales-tax.pot +++ b/languages/simple-sales-tax.pot @@ -2,9 +2,9 @@ # This file is distributed under the same license as the Simple Sales Tax package. msgid "" msgstr "" -"Project-Id-Version: Simple Sales Tax 7.0.2\n" +"Project-Id-Version: Simple Sales Tax 7.0.3\n" "Report-Msgid-Bugs-To: https://github.com/bporcelli/simplesalestax/issues\n" -"POT-Creation-Date: 2022-10-14 15:29:54+00:00\n" +"POT-Creation-Date: 2022-11-02 14:20:28+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/package-lock.json b/package-lock.json index f93eedb4..e7a6833c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "simplesalestax", - "version": "7.0.2", + "version": "7.0.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 604b3770..6006f77a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simplesalestax", - "version": "7.0.2", + "version": "7.0.3", "description": "A TaxCloud integration for WooCommerce.", "scripts": { "build": "grunt", diff --git a/readme.txt b/readme.txt index 7482b640..29806b6d 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: taxcloud, bporcelli Tags: woocommerce, taxcloud, tax, taxes, sales tax, tax calculation, sales tax compliance, sales tax filing, sales tax reporting Requires at least: 4.5 Tested up to: 6.1 -Stable tag: 7.0.2 +Stable tag: 7.0.3 Requires PHP: 5.5 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html diff --git a/simple-sales-tax.php b/simple-sales-tax.php index 746af0a2..1b6e7944 100644 --- a/simple-sales-tax.php +++ b/simple-sales-tax.php @@ -6,7 +6,7 @@ * Author: TaxCloud * Author URI: https://taxcloud.com * GitHub Plugin URI: https://github.com/bporcelli/simplesalestax - * Version: 7.0.2 + * Version: 7.0.3 * Text Domain: simple-sales-tax * Domain Path: /languages/ *