feat(core-flows,dashboard): add fixes to allow only outbound or inbound claims (#8590)
what: - allows completing claim with only inbound items - allows completing claim with only outbound items - validates against creating claims when an active change order is present
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { AdminPaymentCollection } from "@medusajs/types"
|
||||
|
||||
export const getTotalCaptured = (
|
||||
paymentCollections: AdminPaymentCollection[]
|
||||
) =>
|
||||
paymentCollections.reduce((acc, paymentCollection) => {
|
||||
acc =
|
||||
acc +
|
||||
((paymentCollection.captured_amount as number) -
|
||||
(paymentCollection.refunded_amount as number))
|
||||
return acc
|
||||
}, 0)
|
||||
Reference in New Issue
Block a user