update: upgrade pouchdb
remove total tab and merge with balance
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user