fix(core-flows,order): return damaged items (#8818)

This commit is contained in:
Carlos R. L. Rodrigues authored and GitHub committed 2024-08-27 11:21:10 -03:00
1 parent 0c4f4c8a11
commit ff6fcfb139
5 files changed
+56

No files matched your search

@@ -237,12 +237,24 @@ export const confirmReturnReceiveWorkflow = createWorkflow(
itemUpdates[itemId].received_quantity,
act.details!.quantity as BigNumberInput
)
if (act.action === ChangeActionType.RECEIVE_DAMAGED_RETURN_ITEM) {
itemUpdates[itemId].damaged_quantity = MathBN.add(
itemUpdates[itemId].damaged_quantity,
act.details!.quantity as BigNumberInput
)
}
return
}
itemUpdates[itemId] = {
id: itemMap[itemId],
received_quantity: act.details!.quantity,
damaged_quantity:
act.action === ChangeActionType.RECEIVE_DAMAGED_RETURN_ITEM
? act.details!.quantity
: 0,
}
})