1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

Error adding payment (#1091)

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-08-20 15:58:33 -04:00 committed by GitHub
parent 54a4612e7b
commit ef92f37712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

View File

@ -777,8 +777,12 @@ export default {
tenderTypeCode,
currencyUuid: this.dayRate.currencyTo.uuid
})
.then((response) => {
if (response.type !== 'error') {
this.addCollect()
}
})
}
this.addCollect()
},
updateServer(listPaymentsLocal) {
const posUuid = this.currentPointOfSales.uuid

View File

@ -199,7 +199,7 @@ export default {
return undefined
})
if (isEmptyValue(listPayments)) {
createPayment({
return createPayment({
posUuid,
orderUuid,
invoiceUuid,
@ -215,6 +215,10 @@ export default {
.then(response => {
const orderUuid = response.order_uuid
dispatch('listPayments', { orderUuid })
return {
...response,
type: 'Success'
}
})
.catch(error => {
console.warn(`ListPaymentsFromServer: ${error.message}. Code: ${error.code}.`)
@ -223,9 +227,13 @@ export default {
message: error.message,
showClose: true
})
return {
...error,
type: 'error'
}
})
} else {
updatePayment({
return updatePayment({
paymentUuid: listPayments.uuid,
bankUuid,
referenceNo,
@ -237,6 +245,10 @@ export default {
.then(response => {
const orderUuid = response.order_uuid
dispatch('listPayments', { orderUuid })
return {
...response,
type: 'Success'
}
})
.catch(error => {
console.warn(`ListPaymentsFromServer: ${error.message}. Code: ${error.code}.`)
@ -245,6 +257,10 @@ export default {
message: error.message,
showClose: true
})
return {
...error,
type: 'error'
}
})
}
},