From 85f924fc33977baf06507c9ca7323325d002f4d2 Mon Sep 17 00:00:00 2001 From: elsiosanchez Date: Wed, 8 Sep 2021 11:13:01 -0400 Subject: [PATCH] Error when opening the collection with a new order --- .../ADempiere/Form/VPOS/Collection/index.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/ADempiere/Form/VPOS/Collection/index.vue b/src/components/ADempiere/Form/VPOS/Collection/index.vue index efbc0cd3a83..d846110ad9b 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/index.vue @@ -288,15 +288,21 @@ export default { listPayments() { const listLocal = this.$store.getters.getPaymentBox const listServer = this.currentOrder.listPayments - if (!this.sendToServer) { + if (!this.sendToServer && !this.isEmptyValue(listServer)) { return listServer.payments.filter(payment => !payment.isRefund) } - return listLocal + return listLocal.paymentBox }, isLoadedPayments() { + if (this.isEmptyValue(this.currentOrder.listPayments)) { + return false + } return this.currentOrder.listPayments.isLoaded }, paymentBox() { + if (this.isEmptyValue(this.listPayments)) { + return [] + } const payment = this.listPayments.filter(pay => { return pay.isVisible }) @@ -716,7 +722,7 @@ export default { formatPrice, sumCash(cash) { let sum = 0 - if (cash) { + if (!this.isEmptyValue(cash)) { cash.forEach((pay) => { const amount = this.convertAmount(pay.currencyUuid) if (!this.isEmptyValue(pay.divideRate)) {