From 986f27a48cda0395f9d8c103cb3848d2a17696e2 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Tue, 22 Jul 2025 17:44:09 +0200 Subject: [PATCH] Added Multiple Tax Percentages Fixed Pagebreak colspan --- pages/createDocument/edit/[[id]].vue | 37 ++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 00b89dc..ab8d7a0 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -644,6 +644,7 @@ const documentTotal = computed(() => { let totalNet = 0 let total19 = 0 let total7 = 0 + let total0 = 0 itemInfo.value.rows.filter(i => !i.optional && !i.alternative).forEach(row => { if(!['pagebreak','title','text'].includes(row.mode)){ @@ -698,6 +699,7 @@ const documentTotal = computed(() => { totalNet: totalNet, total19: total19, total7: total7, + total0: total0, totalGross: totalGross, totalGrossAlreadyPaid: totalGrossAlreadyPaid, totalSumToPay: sumToPay @@ -1013,9 +1015,32 @@ const getDocumentData = () => { endText: templateEndText(generateContext(itemInfo.value, contactData)), startText: templateStartText(generateContext(itemInfo.value, contactData)), rows: rows, + totalArray: [ + { + label: "Nettobetrag", + content: renderCurrency(documentTotal.value.totalNet), + }, + ... rows.find(i => i.taxPercent === 19) ? [{ + label: "zzgl. 19% USt", + content: renderCurrency(documentTotal.value.total19), + }] : [], + ... rows.find(i => i.taxPercent === 7) ? [{ + label: "zzgl. 7% USt", + content: renderCurrency(documentTotal.value.total7), + }]: [], + ...rows.find(i => i.taxPercent === 0) ? [{ + label: "zzgl. 0% USt", + content: renderCurrency(documentTotal.value.total0), + }] : [], + { + label: "Gesamtbetrag", + content: renderCurrency(documentTotal.value.totalGross), + }, + ], total: { totalNet: renderCurrency(documentTotal.value.totalNet), total19: renderCurrency(documentTotal.value.total19), + total0: renderCurrency(documentTotal.value.total0), totalGross: renderCurrency(documentTotal.value.totalGross), totalGrossAlreadyPaid: renderCurrency(documentTotal.value.totalGrossAlreadyPaid), totalSumToPay: renderCurrency(documentTotal.value.totalSumToPay), @@ -2064,7 +2089,7 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = { @@ -2693,10 +2718,18 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = { Netto: {{renderCurrency(documentTotal.totalNet)}} - + zzgl. 19 % USt: {{renderCurrency(documentTotal.total19)}} + + zzgl. 7 % USt: + {{renderCurrency(documentTotal.total7)}} + + + zzgl. 0 % USt: + {{renderCurrency(documentTotal.total0)}} + Brutto: {{renderCurrency(documentTotal.totalGross)}}