Changes
This commit is contained in:
@@ -93,6 +93,7 @@
|
||||
</template>
|
||||
<template #date-data="{row}">
|
||||
<span v-if="row.date">{{row.date ? dayjs(row.date).format("DD.MM.YY") : ''}}</span>
|
||||
<span v-if="row.documentDate">{{row.documentDate ? dayjs(row.documentDate).format("DD.MM.YY") : ''}}</span>
|
||||
</template>
|
||||
<template #dueDate-data="{row}">
|
||||
<span :class="dayjs(row.dueDate).diff(dayjs()) <= 0 ? ['text-rose-500'] : '' ">{{row.dueDate ? dayjs(row.dueDate).format("DD.MM.YY") : ''}}</span>
|
||||
@@ -108,6 +109,9 @@
|
||||
>
|
||||
{{getRowAmount(row) === 0 ? '' : `${String(getRowAmount(row).toFixed(2)).replace('.',',')} €`}}
|
||||
</div>
|
||||
<div v-else class="text-right">
|
||||
{{calculateDocSum(row.rows)}} €
|
||||
</div>
|
||||
</template>
|
||||
</UTable>
|
||||
|
||||
@@ -141,6 +145,11 @@ const templateColumns = [
|
||||
label: "Status.",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: "amount",
|
||||
label: "Betrag",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'partner',
|
||||
label: "Kunde / Lieferant",
|
||||
@@ -166,11 +175,6 @@ const templateColumns = [
|
||||
label: "Fällig:",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: "amount",
|
||||
label: "Betrag",
|
||||
sortable: true
|
||||
},
|
||||
]
|
||||
const selectedColumns = ref(templateColumns)
|
||||
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
|
||||
@@ -233,6 +237,18 @@ const filteredRows = computed(() => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const calculateDocSum = (rows) => {
|
||||
let sum = 0
|
||||
|
||||
rows.forEach(row => {
|
||||
if(row.mode !== "pagebreak") {
|
||||
sum += row.price * row.quantity * ( row.taxPercent + 100)/100
|
||||
}
|
||||
})
|
||||
|
||||
return sum.toFixed(2)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user