Previous PRs addressed issues with SORTING of TaxJar sync date values in various sales order grids, but have not addressed FILTERING of values.
For legacy reasons due to porting the original M1 integration to M2, TaxJar sync date data has historically been stored directly on Magento core entity tables. Our extension would then use an after-plugin method to perform a left join between the grid table (like sales_order_grid) to the corresponding primary table (like sales_order) so that our sync date value (sales_order.tj_salestax_sync_date) can be included in grid-collection data.
Because Magento's grid collection query includes a generic created_at column (no table specified like main_table.created_at), and our left join operation introduces a second table with a created_at column, it creates an ambiguous query which errors out if merchant attempts to filter a sales grid by ANY value.
Description
Adds tj_sales_creditmemo_metadata table and API interfaces, following conventions of similar tj_sales_order_metadata table which was previously implemented for storing order tax calculation data.
Adds columns tj_sales_order_metadata.synced_at and tj_sales_creditmemo_metadata.synced_at
Patch file migrates TaxJar transaction sync dates that are stored directly on core tables to module-specific tables.
Deprecates improperly namespaced interface Api/Data/Sales/MetadataRepositoryInterface.php (should be removed in next Major release)
Implements creditmemo metadata entities
Fix sales order and creditmemo grid filtering bug by refactoring TJ Sync Date leftJoin in plugin method
Fix additional UI bug - Sales order view manual sync button can be rendered without corresponding JS if order is syncable but has not been synced, see view/adminhtml/templates/order/view/synced.phtml
Context
Closes #341
Previous PRs addressed issues with SORTING of TaxJar sync date values in various sales order grids, but have not addressed FILTERING of values.
For legacy reasons due to porting the original M1 integration to M2, TaxJar sync date data has historically been stored directly on Magento core entity tables. Our extension would then use an after-plugin method to perform a left join between the grid table (like
sales_order_grid
) to the corresponding primary table (likesales_order
) so that our sync date value (sales_order.tj_salestax_sync_date
) can be included in grid-collection data.Because Magento's grid collection query includes a generic
created_at
column (no table specified likemain_table.created_at
), and our left join operation introduces a second table with acreated_at
column, it creates an ambiguous query which errors out if merchant attempts to filter a sales grid by ANY value.Description
tj_sales_creditmemo_metadata
table and API interfaces, following conventions of similartj_sales_order_metadata
table which was previously implemented for storing order tax calculation data.tj_sales_order_metadata.synced_at
andtj_sales_creditmemo_metadata.synced_at
Api/Data/Sales/MetadataRepositoryInterface.php
(should be removed in next Major release)leftJoin
in plugin methodPerformance
Break-fix
Testing
WIP
https://user-images.githubusercontent.com/47947793/192032355-e183f8f2-9bb5-46e5-a407-22d51aab01cd.mov
Versions