diff --git a/src/components/ADempiere/Form/VPOS/Collection/index.vue b/src/components/ADempiere/Form/VPOS/Collection/index.vue index 63189fea..45008d56 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/index.vue @@ -19,6 +19,7 @@ +
@@ -59,14 +60,22 @@

- Tasa del Día: + {{ $t('form.pos.collect.dayRate') }}: + - {{ - dateRate.iSOCode - }} - {{ - formatConversionCurrenty(dateRate.amountConvertion) - }} + + {{ + formatPrice(formatConversionCurrenty(dateRate.amountConvertion), dateRate.iSOCode) + }} + + + {{ + dateRate.iSOCode + }} + {{ + formatConversionCurrenty(dateRate.amountConvertion) + }} +

@@ -82,11 +91,12 @@ > + @@ -101,6 +111,7 @@
+ - + @@ -571,7 +582,11 @@ export default { let sum = 0 if (cash) { cash.forEach((pay) => { - sum += pay.amount + if (!this.isEmptyValue(pay.divideRate)) { + sum += pay.amountConvertion / pay.divideRate + } else { + sum += pay.amount + } }) } return sum diff --git a/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue b/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue index 9163705d..c7953e6a 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/typeCollection.vue @@ -68,7 +68,10 @@ style="padding-bottom: 20px;" >

- + + {{ formatPrice(value.multiplyRate, currency.iSOCode) }} + + {{ formatPrice(value.amount, currency.iSOCode) }}

@@ -148,6 +151,10 @@ export default { }, conevertionAmount() { return this.$store.getters.getConvertionPayment + }, + // Validate if there is a payment in a different type of currency to the point + paymentCurrency() { + return this.$store.getters.posAttributes.currentPointOfSales.currentOrder.listPayments.payments.find(pay => pay.currencyUuid !== this.currency.uuid) } }, watch: { @@ -172,23 +179,21 @@ export default { methods: { formatDate, formatPrice, + // If there are payments in another currency, search for conversion convertingPaymentMethods() { - const currencyUuid = this.isAddTypePay.find(pay => pay.currencyUuid !== this.currency.uuid) - if (!this.isEmptyValue(currencyUuid)) { + if (!this.isEmptyValue(this.paymentCurrency)) { requestGetConversionRate({ conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid, currencyFromUuid: this.currency.uuid, - currencyToUuid: currencyUuid.currencyUuid + currencyToUuid: this.paymentCurrency.currencyUuid }) .then(response => { - this.isAddTypePay.forEach(element => { - console.log({ element }) + this.$store.getters.posAttributes.currentPointOfSales.currentOrder.listPayments.payments.forEach(element => { if (element.currencyUuid !== this.pointOfSalesCurrency.uuid) { - element.amount = element.amount / response.multiplyRate - element.amountConvertion = element.amount / response.divideRate + element.multiplyRate = element.amount / response.multiplyRate + element.amountConvertion = element.multiplyRate / response.divideRate + element.divideRate = response.multiplyRate element.currencyConvertion = response.currencyTo - } else { - element.currencyConvertion = {} } }) this.$store.commit('setListPayments', { @@ -251,6 +256,7 @@ export default { paymentUuid }) }, + // Payment card label tenderTypeDisplaye({ tableName, query diff --git a/src/components/ADempiere/Form/VPOS/Options/index.vue b/src/components/ADempiere/Form/VPOS/Options/index.vue index 44b91ec9..a623bc28 100644 --- a/src/components/ADempiere/Form/VPOS/Options/index.vue +++ b/src/components/ADempiere/Form/VPOS/Options/index.vue @@ -389,8 +389,8 @@ export default { processOrder({ posUuid, orderUuid: this.$route.query.action, - createPayments: !this.isEmptyValue(this.currentOrder.listPayments), - payments: this.currentOrder.listPayments + createPayments: false, + payments: [] }) .then(response => { this.$store.dispatch('reloadOrder', response.uuid) diff --git a/src/components/ADempiere/Form/VPOS/Order/index.vue b/src/components/ADempiere/Form/VPOS/Order/index.vue index c1cc02e1..6a3cd2d3 100644 --- a/src/components/ADempiere/Form/VPOS/Order/index.vue +++ b/src/components/ADempiere/Form/VPOS/Order/index.vue @@ -371,18 +371,18 @@ export default { return 12 } if (this.isEmptyValue(this.currentOrder)) { - return 14 + return 9 } - return 11 + return 7 }, colFieldProductCode() { if (this.isMobile) { return 12 } if (this.isEmptyValue(this.currentOrder)) { - return 9 + return 14 } - return 7 + return 11 }, shortsKey() { return { diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index 333fb674..1c16d340 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -472,6 +472,7 @@ export default { change: 'Change', convertAmount: 'Convert Quantity', fullPayment: 'Full Payment', + dayRate: 'Day Rate', TenderType: { directDeposit: 'Direct Deposit', creditCard: 'Credit Card', diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index 74e5e19e..1ddff1b5 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -447,6 +447,7 @@ export default { change: 'Cambio', convertAmount: 'Convertir Cantidad', fullPayment: 'Cobro Completo', + dayRate: 'Tasa del Día', TenderType: { directDeposit: 'Depósito Directo', creditCard: 'Tarjeta de Crédito', diff --git a/src/store/modules/ADempiere/data/actions.js b/src/store/modules/ADempiere/data/actions.js index b61f596b..89e0df9d 100644 --- a/src/store/modules/ADempiere/data/actions.js +++ b/src/store/modules/ADempiere/data/actions.js @@ -732,7 +732,6 @@ const actions = { sqlStatement }) { // const contextInforField = getters.getContextInfoField(contextInfoUuid, sqlStatement) - // console.log({ contextInforField }) // if (contextInforField) { // return contextInforField // } @@ -742,7 +741,6 @@ const actions = { query: sqlStatement }) .then(contextInfoResponse => { - console.log({ contextInfoResponse }) commit('setContextInfoField', { contextInfoUuid, sqlStatement, diff --git a/src/store/modules/ADempiere/pointOfSales/payments/actions.js b/src/store/modules/ADempiere/pointOfSales/payments/actions.js index 7ff87b38..1db89801 100644 --- a/src/store/modules/ADempiere/pointOfSales/payments/actions.js +++ b/src/store/modules/ADempiere/pointOfSales/payments/actions.js @@ -123,7 +123,8 @@ export default { if (!isEmptyValue(response.currencyTo)) { const currency = { ...response.currencyTo, - amountConvertion: response.divideRate + amountConvertion: response.divideRate, + multiplyRate: response.multiplyRate } dispatch('addRateConvertion', currency) }