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 #104

Closed convenient closed 1 year ago

convenient commented 1 year ago

In 2.4.5 there were changes to the refunds process.

This PR

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/323291753a4a9f3f8c09f9d08933d5740799d7a2 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.