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 |
{
- Beschreibung bearbeiten
+ Zeile bearbeiten
-
+
+
+ {{option}} %
+
+
+ {{row.taxPercent}} %
+
+
+
+
+
+
+ %
+
+
+
+
+
+
+
+
-
{
key: "customPaymentDays",
label: "Zahlungsziel in Tagen",
inputType: "number"
+ }, {
+ key: "customSurchargePercentage",
+ label: "Individueller Aufschlag",
+ inputType: "number"
}, {
key: "infoData.street",
label: "Straße + Hausnummer",
@@ -1520,6 +1524,7 @@ export const useDataStore = defineStore('data', () => {
inputType: "select",
selectDataType: "units",
selectOptionAttribute: "name",
+ required: true,
selectSearchAttributes: ['name'],
},
{
@@ -2286,6 +2291,8 @@ export const useDataStore = defineStore('data', () => {
name = "Farbe"
}else if(key === "customPaymentDays") {
name = "Zahlungsziel in Tagen"
+ }else if(key === "customSurchargePercentage") {
+ name = "Individueller Aufschlag"
}else if(key === "powerInKW") {
name = "Leistung"
} else if(key === "driver") {