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

This commit is contained in:
Carlos R. L. Rodrigues
2024-08-27 11:21:10 -03:00
committed by GitHub
parent 0c4f4c8a11
commit ff6fcfb139
5 changed files with 56 additions and 0 deletions
@@ -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,
}
})