Added net Sums to Tax
This commit is contained in:
@@ -643,8 +643,11 @@ const renderCurrency = (value, currency = "€") => {
|
||||
const documentTotal = computed(() => {
|
||||
let totalNet = 0
|
||||
let total19 = 0
|
||||
let totalNet19 = 0
|
||||
let total7 = 0
|
||||
let totalNet7 = 0
|
||||
let total0 = 0
|
||||
let totalNet0 = 0
|
||||
|
||||
itemInfo.value.rows.filter(i => !i.optional && !i.alternative).forEach(row => {
|
||||
if(!['pagebreak','title','text'].includes(row.mode)){
|
||||
@@ -653,8 +656,12 @@ const documentTotal = computed(() => {
|
||||
|
||||
if(row.taxPercent === 19) {
|
||||
total19 = total19 + Number(rowPrice * 0.19)
|
||||
totalNet19 += Number(rowPrice)
|
||||
} else if(row.taxPercent === 7) {
|
||||
total7 = total7 + Number(rowPrice * 0.07)
|
||||
totalNet7 += Number(rowPrice)
|
||||
} else if(row.taxPercent === 0) {
|
||||
totalNet0 += Number(rowPrice)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -698,8 +705,11 @@ const documentTotal = computed(() => {
|
||||
titleSums: titleSums,
|
||||
totalNet: totalNet,
|
||||
total19: total19,
|
||||
totalNet19: totalNet19,
|
||||
total7: total7,
|
||||
totalNet7: totalNet7,
|
||||
total0: total0,
|
||||
totalNet0: totalNet0,
|
||||
totalGross: totalGross,
|
||||
totalGrossAlreadyPaid: totalGrossAlreadyPaid,
|
||||
totalSumToPay: sumToPay
|
||||
@@ -1021,15 +1031,15 @@ const getDocumentData = () => {
|
||||
content: renderCurrency(documentTotal.value.totalNet),
|
||||
},
|
||||
... rows.find(i => i.taxPercent === 19) ? [{
|
||||
label: "zzgl. 19% USt",
|
||||
label: `zzgl. 19% USt auf ${renderCurrency(documentTotal.value.totalNet19)}`,
|
||||
content: renderCurrency(documentTotal.value.total19),
|
||||
}] : [],
|
||||
... rows.find(i => i.taxPercent === 7) ? [{
|
||||
label: "zzgl. 7% USt",
|
||||
label: `zzgl. 7% USt auf ${renderCurrency(documentTotal.value.totalNet7)}`,
|
||||
content: renderCurrency(documentTotal.value.total7),
|
||||
}]: [],
|
||||
...rows.find(i => i.taxPercent === 0) ? [{
|
||||
label: "zzgl. 0% USt",
|
||||
label: `zzgl. 0% USt auf ${renderCurrency(documentTotal.value.totalNet0)}`,
|
||||
content: renderCurrency(documentTotal.value.total0),
|
||||
}] : [],
|
||||
{
|
||||
@@ -2719,15 +2729,15 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
||||
<td class="text-right">{{renderCurrency(documentTotal.totalNet)}}</td>
|
||||
</tr>
|
||||
<tr v-if="itemInfo.taxType === 'Standard' && itemInfo.rows.find(i => i.taxPercent === 19)">
|
||||
<td class="font-bold">zzgl. 19 % USt:</td>
|
||||
<td class="font-bold">zzgl. 19 % USt auf {{renderCurrency(documentTotal.totalNet19)}}:</td>
|
||||
<td class="text-right">{{renderCurrency(documentTotal.total19)}}</td>
|
||||
</tr>
|
||||
<tr v-if="itemInfo.taxType === 'Standard' && itemInfo.rows.find(i => i.taxPercent === 7)">
|
||||
<td class="font-bold">zzgl. 7 % USt:</td>
|
||||
<td class="font-bold">zzgl. 7 % USt auf {{renderCurrency(documentTotal.totalNet7)}}:</td>
|
||||
<td class="text-right">{{renderCurrency(documentTotal.total7)}}</td>
|
||||
</tr>
|
||||
<tr v-if="itemInfo.taxType === 'Standard' && itemInfo.rows.find(i => i.taxPercent === 0)">
|
||||
<td class="font-bold">zzgl. 0 % USt:</td>
|
||||
<td class="font-bold">zzgl. 0 % USt auf {{renderCurrency(documentTotal.totalNet0)}}:</td>
|
||||
<td class="text-right">{{renderCurrency(documentTotal.total0)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user