diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue index 5f0a014a..ef19712a 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue @@ -75,7 +75,7 @@
-
+
@@ -363,12 +363,37 @@ export default { } return require('@/image/ADempiere/pos/typePayment/' + image) }, + selectPayment(payment) { + this.selectionTypeRefund = payment + this.$store.commit('updateValueOfField', { + containerUuid: this.renderComponentContainer, + columnName: 'PayAmt', + value: this.change + }) + }, addRefund() { const values = this.$store.getters.getValuesView({ containerUuid: this.renderComponentContainer, format: 'object' }) values.tenderType = this.selectionTypeRefund.name + const emptyMandatoryFields = this.$store.getters.getFieldsListEmptyMandatory({ containerUuid: this.renderComponentContainer, formatReturn: 'name' }) + if (!this.isEmptyValue(emptyMandatoryFields)) { + this.$message({ + type: 'warning', + message: this.$t('notifications.mandatoryFieldMissing') + emptyMandatoryFields, + duration: 1500, + showClose: true + }) + return + } + Object.keys(values).forEach(element => { + this.$store.commit('updateValueOfField', { + containerUuid: this.renderComponentContainer, + columnName: element, + value: undefined + }) + }) this.$store.dispatch('addRefundLoaded', values) this.selectionTypeRefund = {} }, @@ -411,20 +436,11 @@ export default { optionSelected({ posUuid, orderUuid, customerDetails, payments }) { switch (this.option) { case 2: - if (this.isEmptyValue(this.emptyFieldGiftCard)) { - this.completePreparedOrder(posUuid, orderUuid, payments) - this.$store.commit('dialogoInvoce', { show: false, success: true }) - } else { - this.$message({ - type: 'warn', - message: this.$t('notifications.mandatoryFieldMissing') + this.emptyFieldGiftCard, - duration: 1500, - showClose: true - }) - } + this.completePreparedOrder(posUuid, orderUuid, payments) + this.$store.commit('dialogoInvoce', { show: false, success: true }) break case 3: - if (this.isEmptyValue(this.emptyMandatoryFields)) { + if (!this.isEmptyValue(this.refundLoaded)) { this.completePreparedOrder(posUuid, orderUuid, payments) overdrawnInvoice({ posUuid, @@ -452,11 +468,11 @@ export default { this.$store.commit('dialogoInvoce', { show: false, success: true }) } else { this.$message({ - type: 'warn', - message: this.$t('notifications.mandatoryFieldMissing') + this.emptyMandatoryFields, - duration: 1500, + type: 'warning', + message: this.$t('form.pos.collect.overdrawnInvoice.addPayment'), showClose: true }) + return } break default: diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/fieldsListACH.js b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/fieldsListACH.js index 375ba94b..c783a33b 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/fieldsListACH.js +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/fieldsListACH.js @@ -102,7 +102,8 @@ export default [ size: 24, isNumericField: true, isActiveLogics: true, - isMandatory: true + isMandatory: true, + isReadOnly: true } } ] diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/index.vue index ef0e0043..ceb58a29 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/ACH/index.vue @@ -32,6 +32,21 @@ :metadata-field="field" /> + + + + + + +
@@ -100,7 +115,6 @@ export default { return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code }, maximumDailyRefundAllowed() { - console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code) return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed }, maximumRefundAllowed() { @@ -145,13 +159,6 @@ export default { return this.$store.getters.getPaymentTypeList } }, - created() { - this.$store.commit('updateValueOfField', { - containerUuid: 'ACH', - columnName: 'PayAmt', - value: this.change - }) - }, methods: { formatPrice, close() { diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/fieldsListCash.js b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/fieldsListCash.js index ac71e906..316e43ef 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/fieldsListCash.js +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/fieldsListCash.js @@ -29,7 +29,8 @@ export default [ size: 24, isNumericField: true, isActiveLogics: true, - isMandatory: true + isMandatory: true, + isReadOnly: true } } ] diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/index.vue index 43dd907f..e47dbc15 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/index.vue @@ -118,7 +118,6 @@ export default { return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code }, maximumDailyRefundAllowed() { - console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code) return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed }, maximumRefundAllowed() { @@ -196,13 +195,6 @@ export default { } } }, - created() { - this.$store.commit('updateValueOfField', { - containerUuid: 'Cash', - columnName: 'PayAmt', - value: this.change - }) - }, methods: { formatPrice, close() { diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/index.vue index 90eabae0..54270762 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/index.vue @@ -103,7 +103,6 @@ export default { return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code }, maximumDailyRefundAllowed() { - console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code) return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed }, maximumRefundAllowed() { @@ -181,13 +180,6 @@ export default { } } }, - created() { - this.$store.commit('updateValueOfField', { - containerUuid: 'Cash', - columnName: 'PayAmt', - value: this.change - }) - }, methods: { formatPrice, close() { diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/fieldsListMobilePayment.js b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/fieldsListMobilePayment.js index 74f70164..9f517e8f 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/fieldsListMobilePayment.js +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/fieldsListMobilePayment.js @@ -86,7 +86,8 @@ export default [ size: 24, isNumericField: true, isActiveLogics: true, - isMandatory: true + isMandatory: true, + isReadOnly: true } } ] diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/index.vue index ebd31f3f..6ae685cb 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/index.vue @@ -32,6 +32,21 @@ :metadata-field="field" /> + + + + + + +
diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/fieldsList.js b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/fieldsList.js index d64231f3..69a52c44 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/fieldsList.js +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/fieldsList.js @@ -58,7 +58,8 @@ export default [ size: 24, isNumericField: true, isActiveLogics: true, - isMandatory: true + isMandatory: true, + isReadOnly: true } } ] diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/index.vue index f33cd9e1..352f8ab7 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/index.vue @@ -74,8 +74,8 @@ export default { type: Object, default: () => { return { - uuid: 'zelle', - containerUuid: 'zelle' + uuid: 'Zelle', + containerUuid: 'Zelle' } } } @@ -100,7 +100,6 @@ export default { return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code }, maximumDailyRefundAllowed() { - console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code) return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed }, maximumRefundAllowed() { @@ -145,13 +144,6 @@ export default { return this.$store.getters.getPaymentTypeList } }, - created() { - this.$store.commit('updateValueOfField', { - containerUuid: 'zelle', - columnName: 'PayAmt', - value: this.change - }) - }, methods: { formatPrice, close() { diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/typeRefund/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/typeRefund/index.vue index 0e74a748..f3b5f1ab 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/typeRefund/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/typeRefund/index.vue @@ -149,27 +149,6 @@ export default { return this.$store.state['pointOfSales/point/index'].conversionsList } }, - // watch: { - // listPaymentType(value) { - // if (!this.isEmptyValue(value.reference)) { - // this.tenderTypeDisplaye({ - // tableName: value.reference.tableName, - // query: value.reference.query - // }) - // } - // } - // }, - // created() { - // if (!this.isEmptyValue(this.isAddTypePay)) { - // this.convertingPaymentMethods() - // } - // if (!this.isEmptyValue(this.listPaymentType.reference)) { - // this.tenderTypeDisplaye({ - // tableName: this.listPaymentType.reference.tableName, - // query: this.listPaymentType.reference.query - // }) - // } - // }, methods: { formatDate, formatPrice, diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index 890e3399..f0675b7d 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -504,7 +504,8 @@ export default { dailyLimit: 'Daily Limit', customerLimit: 'Order Limit', available: 'Available', - emptyPayment: 'Payment method not supported' + emptyPayment: 'Unsupported payment method', + addPayment: 'You must add a change type to complete the operation' } }, keyLayout: { diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index 57918408..30052574 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -480,7 +480,8 @@ export default { dailyLimit: 'Limite Diario', customerLimit: 'Limite Order', available: 'Disponible', - emptyPayment: 'Método de pago no soportado' + emptyPayment: 'Método de pago no soportado', + addPayment: 'Debe agregar un tipo de vuelto para completar la operación' } }, keyLayout: {