Added getIsPaid

This commit is contained in:
2025-06-26 11:37:51 +02:00
parent 0209c49503
commit fe8aa2e758

View File

@@ -139,6 +139,13 @@ export const useSum = () => {
} }
} }
return {getIncomingInvoiceSum, getCreatedDocumentSum, getCreatedDocumentSumDetailed} const getIsPaid = (createddocument,createddocuments) => {
let amountPaid = 0
createddocument.statementallocations.forEach(allocation => amountPaid += allocation.amount)
return Number(amountPaid.toFixed(2)) === getCreatedDocumentSum(createddocument,createddocuments)
}
return {getIncomingInvoiceSum, getCreatedDocumentSum, getCreatedDocumentSumDetailed, getIsPaid}
} }