diff --git a/config/default.json b/config/default.json index db047de6..f24efc6c 100644 --- a/config/default.json +++ b/config/default.json @@ -33,5 +33,8 @@ }, "priceChecking": { "endpoint": "/form/addons/point-of-sales" + }, + "match": { + "endpoint": "/form/addons/match" } } diff --git a/package-lock.json b/package-lock.json index 04e1ec4e..ca2acd98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2861,56 +2861,6 @@ "object.getownpropertydescriptors": "^2.0.3" } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.3.3", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.3.3.tgz", - "integrity": "sha512-/1GzCuQ6MRORbC+leKTKoTGtpQt60bYe0gDGEextSteA2OM+v201FPha5jzmjQzVhRcwieZeUvezAtG5a/e5cw==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true, - "optional": true - }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "optional": true - }, - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - } - } - }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -17933,6 +17883,32 @@ } } }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.5.0", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz", + "integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + }, + "dependencies": { + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + } + } + }, "vue-multipane": { "version": "0.9.5", "resolved": "https://registry.npmjs.org/vue-multipane/-/vue-multipane-0.9.5.tgz", diff --git a/src/api/ADempiere/form/match.js b/src/api/ADempiere/form/match.js new file mode 100644 index 00000000..2cfbe3ec --- /dev/null +++ b/src/api/ADempiere/form/match.js @@ -0,0 +1,75 @@ +// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution +// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. +// Contributor(s): Elsio Sanchez elsiosanches@gmail.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 . + +// Get Instance for connectionimport { +import { request } from '@/utils/ADempiere/request' +import { config } from '@/utils/ADempiere/config' + +// Receipts List +export function receipts({ + businessPartnerUuid, + formUuid +}) { + return request({ + url: `${config.match.endpoint}/receipts`, + method: 'get', + params: { + business_partner_uuid: businessPartnerUuid, + form_uuid: formUuid + } + }) + .then(receiptsListResponse => { + return receiptsListResponse + }) +} +// Invoices List +export function invoces({ + businessPartnerUuid, + formUuid +}) { + return request({ + url: `${config.match.endpoint}/invoices`, + method: 'get', + params: { + business_partner_uuid: businessPartnerUuid, + form_uuid: formUuid + } + }) + .then(invocesListResponse => { + return invocesListResponse + }) +} +// Process Receipt +export function processReceipt({ + businessPartnerUuid, + receiptUuid, + invoceUuid, + formUuid +}) { + return request({ + url: `${config.match.endpoint}/process-receipt`, + method: 'post', + params: { + business_partner_uuid: businessPartnerUuid, + receipt_uuid: receiptUuid, + invoce_uuid: invoceUuid, + form_uuid: formUuid + } + }) + .then(response => { + return response + }) +} diff --git a/src/components/ADempiere/Carousel/index.vue b/src/components/ADempiere/Carousel/index.vue index 3cf41478..79cb53ef 100644 --- a/src/components/ADempiere/Carousel/index.vue +++ b/src/components/ADempiere/Carousel/index.vue @@ -27,7 +27,7 @@ {{ item.description }}

-
+
diff --git a/src/components/ADempiere/Form/VMatch/components/Invoices/index.vue b/src/components/ADempiere/Form/VMatch/components/Invoices/index.vue new file mode 100644 index 00000000..ed082174 --- /dev/null +++ b/src/components/ADempiere/Form/VMatch/components/Invoices/index.vue @@ -0,0 +1,55 @@ + + + + diff --git a/src/components/ADempiere/Form/VMatch/components/Receipt/index.vue b/src/components/ADempiere/Form/VMatch/components/Receipt/index.vue new file mode 100644 index 00000000..1e5e4782 --- /dev/null +++ b/src/components/ADempiere/Form/VMatch/components/Receipt/index.vue @@ -0,0 +1,171 @@ + + + + diff --git a/src/components/ADempiere/Form/VMatch/components/SearchCriteria/index.vue b/src/components/ADempiere/Form/VMatch/components/SearchCriteria/index.vue new file mode 100644 index 00000000..d9d71a80 --- /dev/null +++ b/src/components/ADempiere/Form/VMatch/components/SearchCriteria/index.vue @@ -0,0 +1,48 @@ + + + + diff --git a/src/components/ADempiere/Form/VMatch/components/tableFrom.vue b/src/components/ADempiere/Form/VMatch/components/tableFrom.vue new file mode 100644 index 00000000..1dcefe23 --- /dev/null +++ b/src/components/ADempiere/Form/VMatch/components/tableFrom.vue @@ -0,0 +1,211 @@ + + + + + + + diff --git a/src/components/ADempiere/Form/VMatch/fieldList.js b/src/components/ADempiere/Form/VMatch/fieldList.js new file mode 100644 index 00000000..74a2b230 --- /dev/null +++ b/src/components/ADempiere/Form/VMatch/fieldList.js @@ -0,0 +1,134 @@ +// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution +// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. +// Contributor(s): Elsio Sanchez elsiosanches@gmail.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 . + +// List of fields to send in search +// import language from '@/lang' + +export default [ + { + columnName: 'C_BPartner_ID', + tableName: 'M_InOut', + isFromDictionary: true, + overwriteDefinition: { + handleFocusGained: true, + handleFocusLost: true, + handleKeyPressed: true, + handleKeyReleased: true, + handleActionKeyPerformed: true, + handleActionPerformed: true, + size: 24, + sequence: 3, + isActiveLogics: true, + isMandatory: true + } + }, + // M_Product_ID + { + columnName: 'M_Product_ID', + // elementColumnName: 'M_Product_ID', + tableName: 'M_MatchInv', + isFromDictionary: true, + overwriteDefinition: { + handleKeyPressed: true, + handleKeyReleased: true, + handleActionKeyPerformed: true, + handleActionPerformed: true, + size: 24, + sequence: 4 + } + }, + // Date From + { + elementColumnName: 'Date_From', + isFromDictionary: true, + overwriteDefinition: { + handleFocusGained: true, + handleFocusLost: true, + handleKeyPressed: true, + handleKeyReleased: true, + handleActionKeyPerformed: true, + handleActionPerformed: true, + size: 24, + name: 'Fecha Desde', + componentPath: 'FieldDate', + sequence: 6, + isActiveLogics: true, + isMandatory: true + } + }, + // Date To + { + elementColumnName: 'Date_To', + isFromDictionary: true, + overwriteDefinition: { + handleFocusGained: true, + handleFocusLost: true, + handleKeyPressed: true, + handleKeyReleased: true, + handleActionKeyPerformed: true, + handleActionPerformed: true, + size: 24, + name: 'Fecha Hasta', + sequence: 7, + componentPath: 'FieldDate', + isActiveLogics: true, + isMandatory: true + } + }, + // Assign From + { + elementColumnName: 'Assign_From', + isFromDictionary: true, + overwriteDefinition: { + size: 24, + sequence: 0, + name: 'Asignar Desde', + handleActionPerformed: true, + handleContentSelection: true, + handleActionKeyPerformed: true, + componentPath: 'FieldSelect' + } + }, + // Assign To + { + elementColumnName: 'Assign_To', + isFromDictionary: true, + overwriteDefinition: { + size: 24, + sequence: 1, + name: 'Asignar Hasta', + handleActionPerformed: true, + handleContentSelection: true, + handleActionKeyPerformed: true, + componentPath: 'FieldSelect' + } + }, + // Search Mode + { + elementColumnName: 'Search_Mode', + isFromDictionary: true, + overwriteDefinition: { + size: 24, + sequence: 2, + name: 'Modo de Búsqueda', + handleActionKeyPerformed: true, + handleActionPerformed: true, + isActiveLogics: true, + componentPath: 'FieldSelect', + isMandatory: true + } + } +] diff --git a/src/components/ADempiere/Form/VMatch/index.vue b/src/components/ADempiere/Form/VMatch/index.vue new file mode 100644 index 00000000..273bce76 --- /dev/null +++ b/src/components/ADempiere/Form/VMatch/index.vue @@ -0,0 +1,216 @@ + + + + + + diff --git a/src/components/ADempiere/Form/VMatch/labelTable.js b/src/components/ADempiere/Form/VMatch/labelTable.js new file mode 100644 index 00000000..46f14eba --- /dev/null +++ b/src/components/ADempiere/Form/VMatch/labelTable.js @@ -0,0 +1,63 @@ +// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution +// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. +// Contributor(s): Elsio Sanchez elsiosanches@gmail.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 . + +// List of fields to send in search +import language from '@/lang' + +export default [ + { + columnName: 'nrDocument', + label: language.t('form.match.table.nrDocument'), + isNumeric: false, + size: '150' + }, + { + columnName: 'date', + label: language.t('table.recentItems.date'), + isNumeric: false, + size: '150' + }, + { + columnName: 'C_BPartner_ID', + label: language.t('form.pos.order.BusinessPartnerCreate.businessPartner'), + isNumeric: false, + size: '200' + }, + { + columnName: 'noLínea', + label: language.t('form.pos.order.numberLines'), + isNumeric: true, + size: '150' + }, + { + columnName: 'product', + label: language.t('form.pos.tableProduct.product'), + isNumeric: true, + size: '150' + }, + { + columnName: 'quantity', + label: language.t('form.pos.tableProduct.quantity'), + isNumeric: true, + size: '150' + }, + { + columnName: 'assigned', + label: language.t('form.match.field.assigning'), + isNumeric: true, + size: '150' + } +] diff --git a/src/components/ADempiere/Form/index.vue b/src/components/ADempiere/Form/index.vue index 7447bfd9..e0c4d36c 100644 --- a/src/components/ADempiere/Form/index.vue +++ b/src/components/ADempiere/Form/index.vue @@ -57,6 +57,9 @@ export default { case 'WFActivity': form = import('@/components/ADempiere/Form/WorkflowActivity') break + case 'VMatch': + form = import('@/components/ADempiere/Form/VMatch') + break case 'VPOS': form = import('@/components/ADempiere/Form/VPOS') break diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index 9ce2c4c9..fc9456cf 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -587,6 +587,30 @@ export default { title: 'Change Log', description: 'Workflow timeline' } + }, + match: { + title: { + invoice: 'Invoice', + deliveryReceipt: 'Delivery / Receipt' + }, + description: { + searchCriteria: 'Select a Business Partner to check the pending documents to be assigned', + invoice: 'Select an Invoice to assign the corresponding Delivery/Receipt to', + deliveryReceipt: 'Select at least one Delivery/Receipt to which you require to assign the selected invoice' + }, + field: { + toAssigned: 'To be Assigned', + assigning: 'Assigning', + difference: 'Difference' + }, + filtersSearch: { + sameBusinessPartner: 'Same Business Partner', + sameProduct: 'Same Product ', + sameQuantity: 'SameQuantity ' + }, + table: { + nrDocument: 'Nr Document' + } } } } diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index 2d3a3579..033fefe4 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -435,7 +435,7 @@ export default { tax: 'Impuesto', total: 'Total', itemQuantity: 'Cantidad de Árticulo', - numberLines: 'Cantidad de Lineas', + numberLines: 'Numero de Lineas', pointSale: 'Punto de Venta', collect: 'Cobrar', collections: 'Cobros', @@ -569,6 +569,30 @@ export default { description: 'Linea de tiempo del flujo de trabajo' } } + }, + match: { + title: { + invoice: 'Factura', + deliveryReceipt: 'Entrega / Recibo' + }, + description: { + searchCriteria: 'Seleccione un Socio de Negocio para verificar los documentos pendientes por asignar', + invoice: 'Seleccione una Factura para asignar las Entrega/Recibo correspondiente', + deliveryReceipt: 'Seleccione al menos una Entrega/Recibo a la cual requiere asignar la factura seleccionada' + }, + field: { + toAssigned: 'Para ser Asignadas', + assigning: 'Asignando', + difference: 'Diferencia' + }, + filtersSearch: { + sameBusinessPartner: 'Mismo Socio del Negocio', + sameProduct: 'Mismo Producto ', + sameQuantity: 'Misma Cantidad ' + }, + table: { + nrDocument: 'Nr Docuemnto' + } } } } diff --git a/src/store/modules/ADempiere/form/VMatch.js b/src/store/modules/ADempiere/form/VMatch.js new file mode 100644 index 00000000..3f3996be --- /dev/null +++ b/src/store/modules/ADempiere/form/VMatch.js @@ -0,0 +1,122 @@ +import { + receipts, + invoces, + processReceipt +} from '@/api/ADempiere/form/match.js' +import { showMessage } from '@/utils/ADempiere/notification.js' + +const match = { + invoices: [], + receipts: [], + selectedReceipt: [], + selectedInvoce: [] +} + +export default { + state: match, + mutations: { + setInvoiceLisMatch(state, list) { + state.invoices = list + }, + setReceiptsListMatch(state, list) { + state.receipts = list + }, + setSelectedReceiptMatch(state, select) { + state.selectedReceipt = select + }, + setSelectedInvoceMatch(state, select) { + state.selectedInvoce = select + } + }, + actions: { + serverReceiptsList({ commit }, { + businessPartnerUuid, + formUuid + }) { + receipts({ + businessPartnerUuid, + formUuid + }) + .then(response => { + commit('setReceiptsListMatch', response) + }) + .catch(error => { + console.warn(`serverReceiptsList: ${error.message}. Code: ${error.code}.`) + showMessage({ + type: 'error', + message: error.message, + showClose: true + }) + }) + }, + serverInvocesList({ commit }, { + businessPartnerUuid, + formUuid + }) { + invoces({ + businessPartnerUuid, + formUuid + }) + .then(response => { + commit('setInvoiceLisMatch', response) + }) + .catch(error => { + console.warn(`serverInvocesList: ${error.message}. Code: ${error.code}.`) + showMessage({ + type: 'error', + message: error.message, + showClose: true + }) + }) + }, + processAssignment({ commit }, { + businessPartnerUuid, + receiptUuid, + invoceUuid, + formUuid + }) { + processReceipt({ + businessPartnerUuid, + receiptUuid, + invoceUuid, + formUuid + }) + .then(response => { + showMessage({ + type: 'success', + message: response.message, + showClose: true + }) + }) + .catch(error => { + console.warn(`processAssignment: ${error.message}. Code: ${error.code}.`) + showMessage({ + type: 'error', + message: error.message, + showClose: true + }) + }) + }, + selectedelectedReceiptsMatch({ commit }, select) { + commit('setSelectedReceiptMatch', select) + }, + selectedInvoceMatch({ commit }, select) { + console.log({ select }) + commit('setSelectedInvoceMatch', select) + } + }, + getters: { + getInvoiceMatch: (state) => { + return state.invoices + }, + getReceiptsMatch: (state) => { + return state.receipts + }, + getSelectedReceiptsMatch: (state) => { + return state.selectedReceipt + }, + getSelectedInvoceMatch: (state) => { + return state.selectedInvoce + } + } +}