woocommerce/plugins
Ian Yu-Hsun Lin bce9536128
Fix inconsistent behaviour for Net Sales in Analytics for full refund (#51262)
* Update primary key to composite (order_item_id, order_id) in the wc_order_product_lookup table

* Add full refunded order record to wc_order_product_lookup table

* Delete order items in order product lookup when the order is full refund

The previous commit will add the order item with negative net revenue
when the order is fully refunded. But the items sold in the products
analytics page is incorrect, because there was a DB record of an order item with
positive net revenue, and the product analytics query simply sums up all
the positive net revenue.

* Revert "Update primary key to composite (order_item_id, order_id) in the wc_order_product_lookup table"

This reverts commit 785a665217.

* Delete order item with negative sales recorded earlier due to partial refund

* Extract the logic of delete full refunded orders to a separate method

* Add changefile(s) from automation for the following project(s): woocommerce

* Revert "Extract the logic of delete full refunded orders to a separate method"

This reverts commit 47325f69d6.

* Revert "Delete order item with negative sales recorded earlier due to partial refund"

This reverts commit 18751d6193.

* Revert "Delete order items in order product lookup when the order is full refund"

This reverts commit 1af8158e35.

* Revert "Revert "Update primary key to composite (order_item_id, order_id) in the wc_order_product_lookup table""

This reverts commit b682c393bf.

* Remove the partially refunded order item if exists

* Update analytics order stats test

Since we have added refunded order line items in wc_order_product_lookup
table, the unique product count should also relect the amount of
refunded products.

* Ignore refunded products in extended info for analytic orders report

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-23 21:52:53 +08:00
..
woo-ai Fix typos. (#50047) 2024-08-23 18:26:09 +01:00
woocommerce Fix inconsistent behaviour for Net Sales in Analytics for full refund (#51262) 2024-09-23 21:52:53 +08:00
woocommerce-admin Changes to IAM footer (#51315) 2024-09-12 18:28:48 +05:30
woocommerce-beta-tester Enhance WooCommerce version checking for remote logging reliability (#51009) 2024-08-30 20:25:52 +08:00
woocommerce-blocks [Experimental] Delayed Account Creation Block (#50934) 2024-09-12 11:18:13 +01:00