From 90deabf9d2607e3a67c1b5b912357928f76b5da9 Mon Sep 17 00:00:00 2001 From: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Thu, 19 Aug 2021 07:57:28 -0400 Subject: [PATCH] Add converted order total (#1072) Co-authored-by: elsiosanchez --- .../ADempiere/Form/VPOS/Collection/index.vue | 2 +- .../Form/VPOS/Collection/typeCollection.vue | 2 +- .../ADempiere/Form/VPOS/Options/index.vue | 2 +- .../ADempiere/Form/VPOS/Order/index.vue | 17 ++++++++++------- src/components/ADempiere/Form/VPOS/posMixin.js | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/ADempiere/Form/VPOS/Collection/index.vue b/src/components/ADempiere/Form/VPOS/Collection/index.vue index 58242141..8dda8cc4 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/index.vue @@ -638,7 +638,7 @@ export default { if (!this.isEmptyValue(this.convertionsList)) { let rate payment.forEach((pay) => { - rate = this.convertionsList.find(currency => currency.currencyTo.uuid === pay.currencyUuid) + rate = this.convertionsList.find(currency => !this.isEmptyValue(currency.currencyTo) && currency.currencyTo.uuid === pay.currencyUuid) if (!rate) { if (this.currentPointOfSales.priceList.currency.uuid !== pay.currencyUuid) { this.searchConversion(pay.currencyUuid) diff --git a/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue b/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue index fcb0a1f7..49be9531 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue @@ -184,7 +184,7 @@ export default { formatDate, formatPrice, iSOCode(value) { - const currencyPay = this.convertionsList.find(currency => currency.currencyTo.uuid === value.currencyUuid) + const currencyPay = this.convertionsList.find(currency => !this.isEmptyValue(currency.currencyTo) && currency.currencyTo.uuid === value.currencyUuid) if (!currencyPay) { return '' } diff --git a/src/components/ADempiere/Form/VPOS/Options/index.vue b/src/components/ADempiere/Form/VPOS/Options/index.vue index d90cd8c5..3e130c15 100644 --- a/src/components/ADempiere/Form/VPOS/Options/index.vue +++ b/src/components/ADempiere/Form/VPOS/Options/index.vue @@ -696,7 +696,7 @@ export default { } }).catch(() => { }).finally(() => { - this.$store.commit('setListPayments', []) + this.$store.commit('setListPayments', {}) const { templateBusinessPartner } = this.currentPointOfSales this.$store.commit('updateValuesOfContainer', { containerUuid: this.metadata.containerUuid, diff --git a/src/components/ADempiere/Form/VPOS/Order/index.vue b/src/components/ADempiere/Form/VPOS/Order/index.vue index 4a8e2450..fd39f639 100644 --- a/src/components/ADempiere/Form/VPOS/Order/index.vue +++ b/src/components/ADempiere/Form/VPOS/Order/index.vue @@ -62,7 +62,7 @@ @command="changeDocumentType" > - + {{ currentDocumentType.name }} @@ -335,14 +335,15 @@

{{ $t('form.pos.order.seller') }}: {{ currentOrder.salesRepresentative.name }}

-

{{ $t('form.pos.order.subTotal') }}:{{ formatPrice(currentOrder.totalLines, pointOfSalesCurrency.iSOCode) }}

-

{{ $t('form.pos.order.tax') }}:{{ getOrderTax(pointOfSalesCurrency.iSOCode) }}

+

{{ $t('form.pos.order.subTotal') }}:{{ formatPrice(currentOrder.totalLines, pointOfSalesCurrency.iSOCode) }}

+

{{ $t('form.pos.order.tax') }}:{{ getOrderTax(pointOfSalesCurrency.iSOCode) }}

{{ $t('form.pos.order.total') }}:

+

{{ $t('form.pos.collect.convertedAmount') }}: {{ formatPrice(currentOrder.grandTotal / totalAmountConverted, currentPointOfSales.displayCurrency.iso_code) }}

{{ $t('form.pos.order.order') }}: {{ currentOrder.documentNo }}

{{ $t('form.pos.order.date') }}: - + {{ orderDate }}

{{ $t('form.pos.order.type') }}:{{ currentOrder.documentType.name }}

{{ $t('form.pos.order.itemQuantity') }} - + {{ getItemQuantity }}

{{ $t('form.pos.order.numberLines') }} - + {{ numberOfLines }} -

+ +

diff --git a/src/components/ADempiere/Form/VPOS/posMixin.js b/src/components/ADempiere/Form/VPOS/posMixin.js index cf17512a..dee9b151 100644 --- a/src/components/ADempiere/Form/VPOS/posMixin.js +++ b/src/components/ADempiere/Form/VPOS/posMixin.js @@ -593,7 +593,7 @@ export default { } }).catch(() => { }).finally(() => { - this.$store.commit('setListPayments', []) + this.$store.commit('setListPayments', {}) const { templateBusinessPartner } = this.currentPointOfSales this.$store.commit('updateValuesOfContainer', { containerUuid: this.metadata.containerUuid,