update: upgrade pouchdb

remove total tab and merge with balance
This commit is contained in:
Julien Calixte
2019-08-25 12:27:01 +02:00
parent a41f199eb9
commit 4ae0e97679
4 changed files with 298 additions and 388 deletions

View File

@@ -1,5 +1,6 @@
<template>
<div class="chart-balance">
<p>{{ $tc('account.total', statOrdered.length, { count: statOrdered.length }) }}</p>
<table class="table is-hoverable is-striped" v-if="stats.length">
<tbody>
<tr v-for="(stat, k) in statOrdered" :key="k">
@@ -13,6 +14,12 @@
<td v-else class="conclude" :class="getColor(stat.balance.amount)"></td>
</tr>
</tbody>
<tfoot>
<tr class="is-selected">
<th scope="row" class="total">total</th>
<th class="numeric" colspan="2">{{ totalCost | money(currency) }}</th>
</tr>
</tfoot>
</table>
<div v-else>Aucune dépense faite</div>
</div>
@@ -43,6 +50,10 @@ export default class ChartBalance extends Vue {
a.balance.amount < b.balance.amount ? 1 : -1
)
}
public get totalCost(): number {
return this.stats.reduce((a: number, b: IStat) => a + b.value, 0)
}
}
</script>