mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
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:
@ -9,6 +9,7 @@
|
||||
<script>
|
||||
import Chart from 'chart.js'
|
||||
import Utils from '../../helpers/utilities'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -46,9 +47,20 @@ export default {
|
||||
type: Function,
|
||||
require: false,
|
||||
default: Function
|
||||
},
|
||||
FormatGraphMoney: {
|
||||
type: Function,
|
||||
require: false,
|
||||
default: Function
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters('currency', [
|
||||
'defaultCurrency'
|
||||
])
|
||||
},
|
||||
|
||||
watch: {
|
||||
labels (val) {
|
||||
this.update()
|
||||
@ -56,6 +68,7 @@ export default {
|
||||
},
|
||||
|
||||
mounted () {
|
||||
let self = this
|
||||
let context = this.$refs.graph.getContext('2d')
|
||||
let options = {
|
||||
responsive: true,
|
||||
@ -64,7 +77,7 @@ export default {
|
||||
enabled: true,
|
||||
callbacks: {
|
||||
label: function (tooltipItem, data) {
|
||||
return Utils.formatGraphMoney(tooltipItem.value)
|
||||
return self.FormatGraphMoney(tooltipItem.value, self.defaultCurrency)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -224,6 +224,7 @@ export default {
|
||||
action: 'Acción',
|
||||
notes: 'Notas',
|
||||
tax: 'Impuesto',
|
||||
send_estimate: 'Enviar presupuesto',
|
||||
estimate_template: 'Plantilla de estimación',
|
||||
convert_to_invoice: 'Convertir a factura',
|
||||
mark_as_sent: 'Marcar como enviado',
|
||||
|
||||
@ -130,7 +130,7 @@ export const markAsRejected = ({ commit, dispatch, state }, data) => {
|
||||
|
||||
export const markAsSent = ({ commit, dispatch, state }, data) => {
|
||||
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)
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
|
||||
@ -96,6 +96,7 @@
|
||||
<line-chart
|
||||
v-if="isLoaded"
|
||||
:format-money="$utils.formatMoney"
|
||||
:format-graph-money="$utils.formatGraphMoney"
|
||||
:invoices="getChartInvoices"
|
||||
:expenses="getChartExpenses"
|
||||
:receipts="getReceiptTotals"
|
||||
|
||||
Reference in New Issue
Block a user