fix(medusa): Correct inventory quantity calculation (#3881)
* initial fix * add changeset
This commit is contained in:
1 parent
f132535056
commit
0d0e9bf206
2 files changed
+6
-1
No files matched your search
@@ -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(
|
variant.inventory_quantity = locations.reduce(
|
||||||
(acc, next) => acc + (next.stocked_quantity || 0),
|
(acc, next) => acc + (next.stocked_quantity - next.reserved_quantity),
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user