fix(medusa): Correct inventory quantity calculation (#3881)
* initial fix * add changeset
This commit is contained in:
5
.changeset/ninety-foxes-approve.md
Normal file
5
.changeset/ninety-foxes-approve.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
Fix(medusa): inventory quantity calculations
|
||||
@@ -674,7 +674,7 @@ class ProductVariantInventoryService extends TransactionBaseService {
|
||||
})
|
||||
|
||||
variant.inventory_quantity = locations.reduce(
|
||||
(acc, next) => acc + (next.stocked_quantity || 0),
|
||||
(acc, next) => acc + (next.stocked_quantity - next.reserved_quantity),
|
||||
0
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user