Added getIsPaid
This commit is contained in:
@@ -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}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user