Skip to content

Commit

Permalink
update order when adding a payment (#1160)
Browse files Browse the repository at this point in the history
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
  • Loading branch information
elsiosanchez and elsiosanchez authored Sep 6, 2021
1 parent f63d91b commit 43c7e1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/ADempiere/Form/VPOS/Collection/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,7 @@ export default {
const orderUuid = list.orderUuid
const paymentUuid = list.uuid
this.$store.dispatch('deletetPayments', {
posUuid: this.currentPointOfSales.uuid,
orderUuid,
paymentUuid
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export default {
const orderUuid = key.orderUuid
const paymentUuid = key.uuid
this.$store.dispatch('deletetPayments', {
posUuid: this.currentPointOfSales.uuid,
orderUuid,
paymentUuid
})
Expand Down
5 changes: 5 additions & 0 deletions src/store/modules/ADempiere/pointOfSales/payments/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default {
.then(response => {
const orderUuid = response.orderUuid
dispatch('listPayments', { orderUuid })
dispatch('updateOrder', { posUuid, orderUuid })
})
.catch(error => {
console.warn(`ListPaymentsFromServer: ${error.message}. Code: ${error.code}.`)
Expand Down Expand Up @@ -219,6 +220,7 @@ export default {
.then(response => {
const orderUuid = response.orderUuid
dispatch('listPayments', { orderUuid })
dispatch('updateOrder', { posUuid, orderUuid })
return {
...response,
type: 'Success'
Expand Down Expand Up @@ -249,6 +251,7 @@ export default {
.then(response => {
const orderUuid = response.order_uuid
dispatch('listPayments', { orderUuid })
dispatch('updateOrder', { posUuid, orderUuid })
return {
...response,
type: 'Success'
Expand All @@ -269,6 +272,7 @@ export default {
}
},
deletetPayments({ dispatch }, {
posUuid,
orderUuid,
paymentUuid
}) {
Expand All @@ -277,6 +281,7 @@ export default {
})
.then(response => {
dispatch('listPayments', { orderUuid })
dispatch('updateOrder', { posUuid, orderUuid })
})
.catch(error => {
console.warn(`ListPaymentsFromServer: ${error.message}. Code: ${error.code}.`)
Expand Down

0 comments on commit 43c7e1c

Please sign in to comment.