feat: correct total tax on incoming invoices

This commit is contained in:
2026-08-09 16:35:47 +02:00
parent 94008e8072
commit 8301d8777e
14 changed files with 129 additions and 103 deletions

View File

@@ -152,6 +152,12 @@ export const getIncomingInvoiceTaxBreakdown = (invoice: any) => {
}
})
if (invoice?.taxAmountOverride !== null && invoice?.taxAmountOverride !== undefined && invoice?.taxAmountOverride !== "") {
const correction = Number(invoice.taxAmountOverride) - breakdown.tax19 - breakdown.tax7
if (breakdown.tax19 !== 0 || breakdown.net19 !== 0) breakdown.tax19 += correction
else if (breakdown.tax7 !== 0 || breakdown.net7 !== 0) breakdown.tax7 += correction
}
return {
net19: Number(breakdown.net19.toFixed(2)),
tax19: Number(breakdown.tax19.toFixed(2)),