Merge branch 'linechart-formatmoney' into 'master'

Linechart formatmoney and change rout for mark as sent

See merge request mohit.panjvani/crater-web!3
This commit is contained in:
Mohit Panjwani
2019-11-12 10:02:59 +00:00
4 changed files with 17 additions and 2 deletions

View File

@ -9,6 +9,7 @@
<script> <script>
import Chart from 'chart.js' import Chart from 'chart.js'
import Utils from '../../helpers/utilities' import Utils from '../../helpers/utilities'
import { mapGetters } from 'vuex'
export default { export default {
props: { props: {
@ -46,9 +47,20 @@ export default {
type: Function, type: Function,
require: false, require: false,
default: Function default: Function
},
FormatGraphMoney: {
type: Function,
require: false,
default: Function
} }
}, },
computed: {
...mapGetters('currency', [
'defaultCurrency'
])
},
watch: { watch: {
labels (val) { labels (val) {
this.update() this.update()
@ -56,6 +68,7 @@ export default {
}, },
mounted () { mounted () {
let self = this
let context = this.$refs.graph.getContext('2d') let context = this.$refs.graph.getContext('2d')
let options = { let options = {
responsive: true, responsive: true,
@ -64,7 +77,7 @@ export default {
enabled: true, enabled: true,
callbacks: { callbacks: {
label: function (tooltipItem, data) { label: function (tooltipItem, data) {
return Utils.formatGraphMoney(tooltipItem.value) return self.FormatGraphMoney(tooltipItem.value, self.defaultCurrency)
} }
} }
}, },

View File

@ -224,6 +224,7 @@ export default {
action: 'Acción', action: 'Acción',
notes: 'Notas', notes: 'Notas',
tax: 'Impuesto', tax: 'Impuesto',
send_estimate: 'Enviar presupuesto',
estimate_template: 'Plantilla de estimación', estimate_template: 'Plantilla de estimación',
convert_to_invoice: 'Convertir a factura', convert_to_invoice: 'Convertir a factura',
mark_as_sent: 'Marcar como enviado', mark_as_sent: 'Marcar como enviado',

View File

@ -130,7 +130,7 @@ export const markAsRejected = ({ commit, dispatch, state }, data) => {
export const markAsSent = ({ commit, dispatch, state }, data) => { export const markAsSent = ({ commit, dispatch, state }, data) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
window.axios.post(`/api/estimates/sent`, data).then((response) => { window.axios.post(`/api/estimates/mark-as-sent`, data).then((response) => {
// commit(types.UPDATE_INVOICE, response.data) // commit(types.UPDATE_INVOICE, response.data)
resolve(response) resolve(response)
}).catch((err) => { }).catch((err) => {

View File

@ -96,6 +96,7 @@
<line-chart <line-chart
v-if="isLoaded" v-if="isLoaded"
:format-money="$utils.formatMoney" :format-money="$utils.formatMoney"
:format-graph-money="$utils.formatGraphMoney"
:invoices="getChartInvoices" :invoices="getChartInvoices"
:expenses="getChartExpenses" :expenses="getChartExpenses"
:receipts="getReceiptTotals" :receipts="getReceiptTotals"