diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue index 6ee9a9a0..82a2df02 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue @@ -59,33 +59,33 @@
- {{ $t('form.pos.collect.overdrawnInvoice.above') }} - - {{ $t('form.pos.collect.overdrawnInvoice.dailyLimit') }}: {{ formatPrice(maximumDailyRefundAllowed, currency.iSOCode) }} | {{ formatPrice(0, isoCode) }} | {{ $t('form.pos.collect.overdrawnInvoice.available') }}: {{ formatPrice(maximumDailyRefundAllowed, currency.iSOCode) }} | {{ formatPrice(0, isoCode) }}
- {{ $t('form.pos.collect.overdrawnInvoice.customerLimit') }}: {{ formatPrice(maximumRefundAllowed, currency.iSOCode) }} | {{ formatPrice(0, isoCode) }} -
+ {{ $t('form.pos.collect.overdrawnInvoice.above') }} +
-
+
-
+
- {{ payment.name }} + {{ payment.name }}
-

Nombre

-

Cedula

-

Telefono

-

Banco

-

Descripcion

-
+
+ +
+ +
+
@@ -113,11 +120,11 @@
+ @@ -143,9 +157,13 @@ import posMixin from '@/components/ADempiere/Form/VPOS/posMixin.js' import fieldsListOverdrawnInvoice from './fieldsListOverdrawnInvoice.js' import { overdrawnInvoice } from '@/api/ADempiere/form/point-of-sales.js' import { processOrder } from '@/api/ADempiere/form/point-of-sales.js' +import typeRefund from './typeRefund/index.vue' export default { name: 'OverdrawnInvoice', + components: { + typeRefund + }, mixins: [ formMixin, posMixin @@ -185,6 +203,7 @@ export default { return { option: 1, optionTypePay: 0, + selectionTypeRefund: {}, fieldsList: fieldsListOverdrawnInvoice, currentFieldCurrency: '', currentPaymentType: '' @@ -193,18 +212,21 @@ export default { computed: { componentRender() { let typePay - switch (this.optionTypePay) { + switch (this.selectionTypeRefund.key) { case 'P': - typePay = () => import('./paymentTypeChange/MobilePayment.vue') + typePay = () => import('./paymentTypeChange/MobilePayment/index') break case 'X': - typePay = () => import('./paymentTypeChange/cash/index.vue') + typePay = () => import('./paymentTypeChange/Cash/index.vue') break case 'A': - typePay = () => import('./paymentTypeChange/ACH/index.vue') + typePay = () => import('./paymentTypeChange/ACH/index') + break + case 'M': + typePay = () => import('./paymentTypeChange/GiftCards/index.vue') break case 'Z': - typePay = () => import('./paymentTypeChange/zelle/index.vue') + typePay = () => import('./paymentTypeChange/Zelle/index.vue') break default: typePay = () => import('./paymentTypeChange/empty.vue') @@ -212,6 +234,27 @@ export default { } return typePay }, + renderComponentContainer() { + let container + switch (this.selectionTypeRefund.key) { + case 'P': + container = 'MobilePayment' + break + case 'A': + container = 'ACH' + break + case 'X': + container = 'Cash' + break + case 'M': + container = 'GiftCards' + break + case 'Z': + container = 'Zelle' + break + } + return container + }, showDialogo() { return this.$store.state['pointOfSales/payments/index'].dialogoInvoce.show }, @@ -263,11 +306,26 @@ export default { return this.$store.getters.getFieldsListEmptyMandatory({ containerUuid: 'OverdrawnInvoice', formatReturn: 'name' }) }, paymentTypeList() { - return this.$store.getters.getPaymentTypeList + return this.$store.getters.getPaymentTypeList.filter(type => type.is_allowed_to_refund) + }, + refundLoaded() { + return this.$store.getters.getRefundLoaded } }, + mounted() { + this.selectionTypeRefund = {} + }, methods: { formatPrice, + addRefund() { + const values = this.$store.getters.getValuesView({ + containerUuid: this.renderComponentContainer, + format: 'object' + }) + values.tenderType = this.selectionTypeRefund.name + this.$store.dispatch('addRefundLoaded', values) + this.selectionTypeRefund = {} + }, success() { const customerDetails = [] this.fieldsList.forEach(element => { @@ -286,8 +344,10 @@ export default { customerDetails, payments: this.currentOrder.listPayments.payments }) + this.selectionTypeRefund = {} }, close() { + this.selectionTypeRefund = {} this.$store.commit('dialogoInvoce', { show: false }) }, changeCurrency(value) { 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 a296f7fb..375ba94b 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 @@ -96,7 +96,7 @@ export default [ columnName: 'PayAmt', isFromDictionary: true, overwriteDefinition: { - sequence: 0, + sequence: 3, handleContentSelection: true, handleActionPerformed: true, size: 24, 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 similarity index 100% rename from src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/cash/fieldsListCash.js rename to src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/fieldsListCash.js 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 similarity index 100% rename from src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/cash/index.vue rename to src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Cash/index.vue diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/fieldsListGiftCards.js b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/fieldsListGiftCards.js new file mode 100644 index 00000000..b1dd6801 --- /dev/null +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/fieldsListGiftCards.js @@ -0,0 +1,45 @@ +// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution +// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. +// Contributor(s): Yamel Senih ysenih@erpya.com www.erpya.com +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export default [ + // Name + { + elementColumnName: 'Name', + columnName: 'Name', + tableName: 'C_BPartner', + tabindex: '1', + isFromDictionary: true, + overwriteDefinition: { + sequence: 0, + isCustomField: true, + size: 24, + isMandatory: true + } + }, + // Code + { + elementColumnName: 'Value', + columnName: 'Value', + isFromDictionary: true, + tabindex: '0', + overwriteDefinition: { + sequence: 1, + isCustomField: true, + size: 24, + isMandatory: true + } + } +] 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 new file mode 100644 index 00000000..90eabae0 --- /dev/null +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/GiftCards/index.vue @@ -0,0 +1,268 @@ + + + + + + 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 new file mode 100644 index 00000000..74f70164 --- /dev/null +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/fieldsListMobilePayment.js @@ -0,0 +1,92 @@ +// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution +// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. +// Contributor(s): Yamel Senih ysenih@erpya.com www.erpya.com +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +const tableName = 'C_Payment' + +export default [ + // Name + { + elementColumnName: 'Name', + columnName: 'Name', + tableName: 'C_BPartner', + tabindex: '1', + isFromDictionary: true, + overwriteDefinition: { + sequence: 0, + isCustomField: true, + size: 24, + isMandatory: true + } + }, + // Code + { + elementColumnName: 'Value', + columnName: 'Value', + isFromDictionary: true, + tabindex: '0', + overwriteDefinition: { + sequence: 1, + isCustomField: true, + size: 24, + isMandatory: true + } + }, + // Phone + { + elementColumnName: 'Phone', + columnName: 'Phone', + tableName: 'AD_user', + tabindex: '4', + isFromDictionary: true, + overwriteDefinition: { + sequence: 2, + isCustomField: true, + size: 24, + isMandatory: true + } + }, + // Bank + { + tableName, + columnName: 'C_Bank_ID', + isFromDictionary: true, + overwriteDefinition: { + sequence: 6, + handleActionKeyPerformed: true, + handleActionPerformed: true, + handleContentSelection: true, + displayLogic: `@TenderType@<>'X'|| @TenderType@<>'Z'`, + size: 24, + isActiveLogics: true, + isMandatory: true + } + }, + { + tableName, + elementColumnName: 'PayAmt', + columnName: 'PayAmt', + isFromDictionary: true, + overwriteDefinition: { + sequence: 3, + handleContentSelection: true, + handleActionPerformed: true, + size: 24, + isNumericField: true, + isActiveLogics: true, + isMandatory: true + } + } +] diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/index.vue similarity index 95% rename from src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment.vue rename to src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/index.vue index fbf7806c..ebd31f3f 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/MobilePayment/index.vue @@ -23,7 +23,7 @@ > @@ -41,7 +41,7 @@ import { formatPrice } from '@/utils/ADempiere/valueFormat.js' import formMixin from '@/components/ADempiere/Form/formMixin' import posMixin from '@/components/ADempiere/Form/VPOS/posMixin.js' -import fieldsListOverdrawnInvoice from '../fieldsListOverdrawnInvoice.js' +import fieldsListMobilePayment from './fieldsListMobilePayment.js' export default { name: 'MobilePayment', @@ -74,8 +74,8 @@ export default { type: Object, default: () => { return { - uuid: 'OverdrawnInvoice', - containerUuid: 'OverdrawnInvoice' + uuid: 'MobilePayment', + containerUuid: 'MobilePayment' } } } @@ -84,7 +84,7 @@ export default { return { option: 1, typePay: 0, - fieldsList: fieldsListOverdrawnInvoice, + fieldsList: fieldsListMobilePayment, currentFieldCurrency: '', currentPaymentType: '' } 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 similarity index 98% rename from src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/zelle/fieldsList.js rename to src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/fieldsList.js index abc880e1..d64231f3 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 @@ -52,7 +52,7 @@ export default [ columnName: 'PayAmt', isFromDictionary: true, overwriteDefinition: { - sequence: 0, + sequence: 1, handleContentSelection: true, handleActionPerformed: true, size: 24, 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 similarity index 100% rename from src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/zelle/index.vue rename to src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/paymentTypeChange/Zelle/index.vue diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/typeRefund/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/typeRefund/index.vue new file mode 100644 index 00000000..0e74a748 --- /dev/null +++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/typeRefund/index.vue @@ -0,0 +1,298 @@ + + + + + + diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index 0239e4c1..cb3e3796 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -502,7 +502,7 @@ export default { returnMoney: 'Return money in another form of payment', adjustDocument: 'You want to Adjust Document', dailyLimit: 'Daily Limit', - customerLimit: 'Customer Limit', + customerLimit: 'Order Limit', available: 'Available', emptyPayment: 'Payment method not supported' } diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index c07556ce..7c701801 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -478,7 +478,7 @@ export default { returnMoney: 'Devolver dinero en otra forma de pago', adjustDocument: 'Desea Ajustar Documento', dailyLimit: 'Limite Diario', - customerLimit: 'Limite Cliente', + customerLimit: 'Limite Order', available: 'Disponible', emptyPayment: 'Método de pago no soportado' } diff --git a/src/store/modules/ADempiere/pointOfSales/payments/actions.js b/src/store/modules/ADempiere/pointOfSales/payments/actions.js index 23051c67..d07b6577 100644 --- a/src/store/modules/ADempiere/pointOfSales/payments/actions.js +++ b/src/store/modules/ADempiere/pointOfSales/payments/actions.js @@ -311,5 +311,10 @@ export default { } }) commit('setCurrencyDisplaye', displaycurrency) + }, + addRefundLoaded({ commit, state }, refund) { + const addRefund = state.refundLoaded + addRefund.push(refund) + commit('setRefundLoaded', addRefund) } } diff --git a/src/store/modules/ADempiere/pointOfSales/payments/getters.js b/src/store/modules/ADempiere/pointOfSales/payments/getters.js index 31c5e7d1..4d740c1b 100644 --- a/src/store/modules/ADempiere/pointOfSales/payments/getters.js +++ b/src/store/modules/ADempiere/pointOfSales/payments/getters.js @@ -48,5 +48,8 @@ export default { }, getConvertionRate: (state) => { return state.convertionRate + }, + getRefundLoaded: (state) => { + return state.refundLoaded } } diff --git a/src/store/modules/ADempiere/pointOfSales/payments/mutations.js b/src/store/modules/ADempiere/pointOfSales/payments/mutations.js index 6ad65ba4..daa87648 100644 --- a/src/store/modules/ADempiere/pointOfSales/payments/mutations.js +++ b/src/store/modules/ADempiere/pointOfSales/payments/mutations.js @@ -64,5 +64,8 @@ export default { type, success } + }, + setRefundLoaded(state, refund) { + state.refundLoaded = refund } } diff --git a/src/store/modules/ADempiere/pointOfSales/payments/state.js b/src/store/modules/ADempiere/pointOfSales/payments/state.js index e6d2da57..88b98acc 100644 --- a/src/store/modules/ADempiere/pointOfSales/payments/state.js +++ b/src/store/modules/ADempiere/pointOfSales/payments/state.js @@ -31,6 +31,7 @@ export default { convertion: {}, fieldCurrency: {}, convertionRate: [], + refundLoaded: [], dialogoInvoce: { show: false, type: 0,