Added Saldo and Count

This commit is contained in:
2025-05-13 17:06:55 +02:00
parent a9ea5982cf
commit a0ffdce1bb
2 changed files with 115 additions and 12 deletions

View File

@@ -53,7 +53,8 @@ const renderedAllocations = computed(() => {
date: i.date,
partner: i.vendor.name,
description: i.description,
color: i.expense ? "red" : "green"
color: i.expense ? "red" : "green",
expense: i.expense
}
}))
})
@@ -61,6 +62,24 @@ const renderedAllocations = computed(() => {
return [...tempstatementallocations, ... incominginvoicesallocations]
})
const saldo = computed(() => {
let value = 0
renderedAllocations.value.forEach(i => {
if(i.incominginvoiceid) {
if(i.expense) {
value = value - i.amount
} else {
value += i.amount
}
} else {
value += i.amount
}
})
return value
})
</script>
<template>
@@ -102,6 +121,14 @@ const renderedAllocations = computed(() => {
<td>Name:</td>
<td>{{itemInfo.label}}</td>
</tr>
<tr>
<td>Anzahl:</td>
<td>{{renderedAllocations.length}}</td>
</tr>
<tr>
<td>Saldo:</td>
<td>{{useCurrency(saldo)}}</td>
</tr>
<tr>
<td>Beschreibung:</td>
<td>{{itemInfo.description}}</td>