From c96ff65bc7183c75f09d9ca1b3c0f87a5fe7a344 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Mon, 3 Mar 2025 11:31:44 +0100 Subject: [PATCH] Added CustomSurchargePercentage Added RowEdit Modal --- pages/createDocument/edit/[[id]].vue | 92 +++++++++++++++++++++++----- stores/data.js | 7 +++ 2 files changed, 83 insertions(+), 16 deletions(-) diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 3ade854..9a3139c 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -1030,7 +1030,8 @@ const saveDocument = async (state,resetup = false) => { linkedDocument: itemInfo.value.linkedDocument, agriculture: itemInfo.value.agriculture, letterhead: itemInfo.value.letterhead, - usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices + usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices, + customSurchargePercentage: itemInfo.value.customSurchargePercentage, } if(route.params.id) { @@ -1104,18 +1105,26 @@ const getTextTemplateByType = (type, pos) => { } +const updateCustomSurcharge = () => { + itemInfo.value.rows.forEach(row => { + if(!["pagebreak","title","free","text"].includes(row.mode)) { + setRowData(row) + } + }) +} + const setRowData = (row) => { console.log(row) if(row.service) { 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 + 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(row.product) { row.unit = products.value.find(i => i.id === row.product).unit - row.price = products.value.find(i => i.id === row.product).sellingPrice + 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 } @@ -1519,6 +1528,20 @@ const setRowData = (row) => { v-model="itemInfo.paymentDays" /> + + + + + { Pos. - Name - Menge - Einheit - Preis - Steuer - Rabatt - Beschreibung - Gesamt + Name + Menge + Einheit + Preis + Steuer + Rabatt + + Gesamt { - + + + + + + + + + + + + + + + -