Added CustomSurchargePercentage
Added RowEdit Modal
This commit is contained in:
@@ -1030,7 +1030,8 @@ const saveDocument = async (state,resetup = false) => {
|
|||||||
linkedDocument: itemInfo.value.linkedDocument,
|
linkedDocument: itemInfo.value.linkedDocument,
|
||||||
agriculture: itemInfo.value.agriculture,
|
agriculture: itemInfo.value.agriculture,
|
||||||
letterhead: itemInfo.value.letterhead,
|
letterhead: itemInfo.value.letterhead,
|
||||||
usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices
|
usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices,
|
||||||
|
customSurchargePercentage: itemInfo.value.customSurchargePercentage,
|
||||||
}
|
}
|
||||||
|
|
||||||
if(route.params.id) {
|
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) => {
|
const setRowData = (row) => {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
if(row.service) {
|
if(row.service) {
|
||||||
row.unit = services.value.find(i => i.id === row.service).unit
|
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.description = services.value.find(i => i.id === row.service).description
|
||||||
row.taxPercent = services.value.find(i => i.id === row.service).taxPercentage
|
row.taxPercent = services.value.find(i => i.id === row.service).taxPercentage
|
||||||
}
|
}
|
||||||
|
|
||||||
if(row.product) {
|
if(row.product) {
|
||||||
row.unit = products.value.find(i => i.id === row.product).unit
|
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.description = products.value.find(i => i.id === row.product).description
|
||||||
row.taxPercent = products.value.find(i => i.id === row.product).taxPercentage
|
row.taxPercent = products.value.find(i => i.id === row.product).taxPercentage
|
||||||
}
|
}
|
||||||
@@ -1519,6 +1528,20 @@ const setRowData = (row) => {
|
|||||||
v-model="itemInfo.paymentDays"
|
v-model="itemInfo.paymentDays"
|
||||||
/>
|
/>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
class="w-full"
|
||||||
|
label="Individueller Aufschlag:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
type="number"
|
||||||
|
v-model="itemInfo.customSurchargePercentage"
|
||||||
|
@change="updateCustomSurcharge"
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 text-xs">%</span>
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
|
</UFormGroup>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
label="Ansprechpartner:"
|
label="Ansprechpartner:"
|
||||||
@@ -1758,14 +1781,14 @@ const setRowData = (row) => {
|
|||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Pos.</th>
|
<th>Pos.</th>
|
||||||
<th>Name</th>
|
<th class="pl-2">Name</th>
|
||||||
<th>Menge</th>
|
<th class="pl-2">Menge</th>
|
||||||
<th>Einheit</th>
|
<th class="pl-2">Einheit</th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Preis</th>
|
<th class="pl-2" v-if="itemInfo.type !== 'deliveryNotes'">Preis</th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Steuer</th>
|
<th class="pl-2" v-if="itemInfo.type !== 'deliveryNotes'">Steuer</th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Rabatt</th>
|
<th class="pl-2" v-if="itemInfo.type !== 'deliveryNotes'">Rabatt</th>
|
||||||
<th>Beschreibung</th>
|
<th class="pl-2"> </th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Gesamt</th>
|
<th class="pl-2" v-if="itemInfo.type !== 'deliveryNotes'">Gesamt</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<draggable
|
<draggable
|
||||||
@@ -2033,14 +2056,51 @@ const setRowData = (row) => {
|
|||||||
<UModal v-model="row.showEdit">
|
<UModal v-model="row.showEdit">
|
||||||
<UCard>
|
<UCard>
|
||||||
<template #header>
|
<template #header>
|
||||||
Beschreibung bearbeiten
|
Zeile bearbeiten
|
||||||
</template>
|
</template>
|
||||||
<UTextarea
|
<UFormGroup
|
||||||
v-model="row.description"
|
label="Umsatzsteuer:"
|
||||||
|
v-if="itemInfo.type !== 'deliveryNotes'"
|
||||||
>
|
>
|
||||||
|
<USelectMenu
|
||||||
|
:options="[19,7,0]"
|
||||||
|
v-model="row.taxPercent"
|
||||||
|
:disabled="itemInfo.taxType === '13b UStG' || itemInfo.taxType === '19 UStG'"
|
||||||
|
>
|
||||||
|
<template #option="{option}">
|
||||||
|
{{option}} %
|
||||||
|
</template>
|
||||||
|
<template #label>
|
||||||
|
{{row.taxPercent}} %
|
||||||
|
</template>
|
||||||
|
</USelectMenu>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Rabatt:"
|
||||||
|
v-if="itemInfo.type !== 'deliveryNotes'"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="row.discountPercent"
|
||||||
|
type="number"
|
||||||
|
step="0.01"
|
||||||
|
placeholder="0"
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 text-xs">%</span>
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Beschreibung:"
|
||||||
|
>
|
||||||
|
<UTextarea
|
||||||
|
v-model="row.description"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
</UTextarea>
|
||||||
|
</UFormGroup>
|
||||||
|
|
||||||
</UTextarea>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<UButton
|
<UButton
|
||||||
@click="row.showEdit = false"
|
@click="row.showEdit = false"
|
||||||
|
|||||||
@@ -216,6 +216,10 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "customPaymentDays",
|
key: "customPaymentDays",
|
||||||
label: "Zahlungsziel in Tagen",
|
label: "Zahlungsziel in Tagen",
|
||||||
inputType: "number"
|
inputType: "number"
|
||||||
|
}, {
|
||||||
|
key: "customSurchargePercentage",
|
||||||
|
label: "Individueller Aufschlag",
|
||||||
|
inputType: "number"
|
||||||
}, {
|
}, {
|
||||||
key: "infoData.street",
|
key: "infoData.street",
|
||||||
label: "Straße + Hausnummer",
|
label: "Straße + Hausnummer",
|
||||||
@@ -1520,6 +1524,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
inputType: "select",
|
inputType: "select",
|
||||||
selectDataType: "units",
|
selectDataType: "units",
|
||||||
selectOptionAttribute: "name",
|
selectOptionAttribute: "name",
|
||||||
|
required: true,
|
||||||
selectSearchAttributes: ['name'],
|
selectSearchAttributes: ['name'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2286,6 +2291,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
name = "Farbe"
|
name = "Farbe"
|
||||||
}else if(key === "customPaymentDays") {
|
}else if(key === "customPaymentDays") {
|
||||||
name = "Zahlungsziel in Tagen"
|
name = "Zahlungsziel in Tagen"
|
||||||
|
}else if(key === "customSurchargePercentage") {
|
||||||
|
name = "Individueller Aufschlag"
|
||||||
}else if(key === "powerInKW") {
|
}else if(key === "powerInKW") {
|
||||||
name = "Leistung"
|
name = "Leistung"
|
||||||
} else if(key === "driver") {
|
} else if(key === "driver") {
|
||||||
|
|||||||
Reference in New Issue
Block a user