@@ -50,7 +50,7 @@
},
computed: mapGetters({
total: 'getTotal',
- currency: 'getDefaultCurrency'
+ currency: 'getCurrency'
}),
methods: mapActions([
'fetchData'
@@ -1,10 +1,20 @@
<template lang="pug">
.summary
- h2 Aquí se va un resumen
+ h2 {{ getTotal() }}
</template>
<script>
+ import { mapGetters } from 'vuex'
+
export default {
+ computed: mapGetters({
+ total: 'getTotal'
+ }),
+ methods: {
+ getTotal() {
+ return accounting.formatMoney(this.total, '₲', 0, '.', ',')
+ }
}
</script>
@@ -6,8 +6,11 @@ const getters = {
getCompany(state) {
return state.company
- getDefaultCurrency(state) {
+ getCurrency(state) {
return state.company ? state.company.currency : ''
+ },
+ getCurrencySymbol(state) {
+ return state.company ? state.company.currency.symbol : '$'