Magento Asked by Nathan on December 27, 2020
Magento version: 2.3.5-p1
(magento/module-inventory-sales) version: 1.0.8
—
The backorder quantity shown in checkout and stored in sales_order_item
.qty_backordered
can be wrong when there are reservations for the product. The backorder quantity is calculated using the current stock count, not the salable count which considers reservations.
—
Example:
sales_order_item
.qty_backordered
, but should be 2 qty).—
The culprit is here:
vendor/magento/module-inventory-sales/Model/IsProductSalableCondition/BackOrderNotifyCustomerCondition.php
Line: $backOrderQty = $requestedQty - $stockItemData[GetStockItemDataInterface::QUANTITY];
The stock qty is being used to calculate the backorder qty, so reservations are not considered.
—
It’s not even consistent in ignoring reservations though, as they are correctly considered when checking if add to cart should be allowed here:
vendor/magento/module-inventory-sales/Model/IsProductSalableCondition/IsSalableWithReservationsCondition.php
—
I know that this is due to the order not being shipped yet, so the stock isn’t being decreased yet. But still, surely this isn’t intentional? You cannot sell the same salable qty multiple times to different customers. I haven’t found an answer for this, which makes me think I’m missing something. Thanks in advance.
I found this: https://github.com/magento/inventory/pull/2452
This is a known bug that will be fixed in 2.4 They say you can pull the fix into 2.3.5 if necessary.
Answered by Nathan on December 27, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP