From 855f527a871d5efb38b4b7c8e922f698643ad743 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Tue, 4 Mar 2025 17:07:22 +0100 Subject: [PATCH] Fixed TaxType, Added Taxtype to Quotes and Confirmation Orders --- pages/createDocument/edit/[[id]].vue | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 027fa3b..f6a495d 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -404,6 +404,12 @@ const addPosition = (mode) => { if(row.id > lastId) lastId = row.id }) + let taxPercentage = 19 + + if(['13b UStG','19 UStG'].includes(itemInfo.value.taxType)) { + taxPercentage = 0 + } + if(mode === 'free'){ let rowData = { id: uuidv4(), @@ -412,7 +418,7 @@ const addPosition = (mode) => { quantity: 1, unit: 1, price: 0, - taxPercent: 19, + taxPercent: taxPercentage, discountPercent: 0 } @@ -424,7 +430,7 @@ const addPosition = (mode) => { mode: "normal", quantity: 1, price: 0, - taxPercent: 19, + taxPercent: taxPercentage, discountPercent: 0, unit: 1 }) @@ -434,7 +440,7 @@ const addPosition = (mode) => { mode: "service", quantity: 1, price: 0, - taxPercent: 19, + taxPercent: taxPercentage, discountPercent: 0, unit: 1 } @@ -1134,14 +1140,24 @@ const setRowData = (row) => { row.unit = services.value.find(i => i.id === row.service).unit row.price = (services.value.find(i => i.id === row.service).sellingPriceComposed.total || services.value.find(i => i.id === row.service).sellingPrice) * (1 + itemInfo.value.customSurchargePercentage /100) row.description = services.value.find(i => i.id === row.service).description - row.taxPercent = services.value.find(i => i.id === row.service).taxPercentage + + if(['13b UStG','19 UStG'].includes(itemInfo.value.taxType)) { + row.taxPercent = 0 + } else { + row.taxPercent = services.value.find(i => i.id === row.service).taxPercentage + } } if(row.product) { row.unit = products.value.find(i => i.id === row.product).unit row.price = products.value.find(i => i.id === row.product).sellingPrice * (1 + itemInfo.value.customSurchargePercentage /100) row.description = products.value.find(i => i.id === row.product).description - row.taxPercent = products.value.find(i => i.id === row.product).taxPercentage + + if(['13b UStG','19 UStG'].includes(itemInfo.value.taxType)) { + row.taxPercent = 0 + } else { + row.taxPercent = products.value.find(i => i.id === row.product).taxPercentage + } } @@ -1299,7 +1315,7 @@ const setRowData = (row) => {