Added Saldo and Count
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user