mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
fix report download & payments delete issue
This commit is contained in:
@ -136,7 +136,9 @@ export const fatchItemUnit = ({ commit, dispatch, state }, id) => {
|
|||||||
export const deleteItemUnit = ({ commit, dispatch, state }, id) => {
|
export const deleteItemUnit = ({ commit, dispatch, state }, id) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
window.axios.delete(`/api/units/${id}`).then((response) => {
|
window.axios.delete(`/api/units/${id}`).then((response) => {
|
||||||
|
if (!response.data.error) {
|
||||||
commit(types.DELETE_ITEM_UNIT, id)
|
commit(types.DELETE_ITEM_UNIT, id)
|
||||||
|
}
|
||||||
resolve(response)
|
resolve(response)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
reject(err)
|
reject(err)
|
||||||
|
|||||||
@ -154,7 +154,9 @@ export const fetchPaymentMode = ({ commit, dispatch, state }, data) => {
|
|||||||
export const deletePaymentMode = ({ commit, dispatch, state }, id) => {
|
export const deletePaymentMode = ({ commit, dispatch, state }, id) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
window.axios.delete(`/api/payment-methods/${id}`).then((response) => {
|
window.axios.delete(`/api/payment-methods/${id}`).then((response) => {
|
||||||
|
if (!response.data.error) {
|
||||||
commit(types.DELETE_PAYMENT_MODE, id)
|
commit(types.DELETE_PAYMENT_MODE, id)
|
||||||
|
}
|
||||||
resolve(response)
|
resolve(response)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
reject(err)
|
reject(err)
|
||||||
|
|||||||
@ -199,11 +199,9 @@ export default {
|
|||||||
if (!this.getReports()) {
|
if (!this.getReports()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
|
||||||
this.url += '&download=true'
|
|
||||||
} else {
|
|
||||||
window.open(this.getReportUrl + '&download=true')
|
window.open(this.getReportUrl + '&download=true')
|
||||||
}
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|||||||
@ -203,11 +203,8 @@ export default {
|
|||||||
if (!this.getReports()) {
|
if (!this.getReports()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
|
||||||
this.url += '&download=true'
|
|
||||||
} else {
|
|
||||||
window.open(this.getReportUrl + '&download=true')
|
window.open(this.getReportUrl + '&download=true')
|
||||||
}
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|||||||
@ -234,11 +234,8 @@ export default {
|
|||||||
if (!this.getReports()) {
|
if (!this.getReports()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
|
||||||
this.url += '&download=true'
|
|
||||||
} else {
|
|
||||||
window.open(this.getReportUrl + '&download=true')
|
window.open(this.getReportUrl + '&download=true')
|
||||||
}
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.selectedType === 'By Customer') {
|
if (this.selectedType === 'By Customer') {
|
||||||
this.url = `${this.customerSiteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.customerSiteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
|
|||||||
@ -49,7 +49,8 @@
|
|||||||
<div class="col-sm-8 reports-tab-container">
|
<div class="col-sm-8 reports-tab-container">
|
||||||
<iframe :src="getReportUrl" class="reports-frame-style"/>
|
<iframe :src="getReportUrl" class="reports-frame-style"/>
|
||||||
<a class="base-button btn btn-primary btn-lg report-view-button" @click="viewReportsPDF">
|
<a class="base-button btn btn-primary btn-lg report-view-button" @click="viewReportsPDF">
|
||||||
<font-awesome-icon icon="file-pdf" class="vue-icon icon-left svg-inline--fa fa-download fa-w-16 mr-2" /> <span>{{ $t('reports.view_pdf') }}</span>
|
<font-awesome-icon icon="file-pdf" class="vue-icon icon-left svg-inline--fa fa-download fa-w-16 mr-2" />
|
||||||
|
<span>{{ $t('reports.view_pdf') }}</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -199,11 +200,9 @@ export default {
|
|||||||
if (!this.getReports()) {
|
if (!this.getReports()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
|
||||||
this.url += '&download=true'
|
|
||||||
} else {
|
|
||||||
window.open(this.url + '&download=true')
|
window.open(this.url + '&download=true')
|
||||||
}
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|||||||
Reference in New Issue
Block a user