AmpersandHQ / magento2-disable-stock-reservation

This module disables the inventory reservation logic introduced as part of MSI in Magento 2.3.3
GNU Lesser General Public License v3.0
211 stars 60 forks source link

refund fixes from @markfischmann - #92 and #93 #101

Closed convenient closed 1 year ago

convenient commented 1 year ago

This PR is the following PRs by @markfischmann with tests added

Both of the following occur when you create a refund with "return to stock" set for the order item.

https://github.com/AmpersandHQ/magento2-disable-stock-reservation/pull/101/commits/49cb210030a7b9d5a7d5cbb1a4429635aa6be904 has failing tests which show a refund from 95 -> 105 instead of 95 -> 100

1) CheckoutCest: Prevent double refund quantity on shipped order
 Test  tests/acceptance/CheckoutCest.php:preventDoubleRefundQuantityOnShippedOrder
 Step  Assert equals 100,"105.0000","The quantity should be reset to 100 after the refund"
 Fail  The quantity should be reset to 100 after the refund
Failed asserting that '105.0000' matches expected 100.

Also it shows that the product does not go is_in_stock=1 after a refund

2) CheckoutCest: Product goes back in stock when order is refunded
 Test  tests/acceptance/CheckoutCest.php:productGoesBackInStockWhenOrderIsRefunded
 Step  Assert equals 1,0,"Product did not go to is_in_stock=1 after a refund"
 Fail  Product did not go to is_in_stock=1 after a refund
Failed asserting that 0 matches expected 1.

After merging in the branches, and making a few additional tweaks to fix static analysis and di compilation, everything goes green.