From 38d3d49ecb697c18f6e1b5f02c385e88d19107ba Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Tue, 12 Mar 2024 16:24:27 -0500 Subject: [PATCH] Solucion a comentarios 34 --- src/css/fonts/icon.eot:Zone.Identifier | 3 - src/css/fonts/icon.svg:Zone.Identifier | 3 - src/css/fonts/icon.ttf:Zone.Identifier | 3 - src/css/fonts/icon.woff:Zone.Identifier | 3 - src/css/fonts/selection.json:Zone.Identifier | 3 - src/css/icons.scss.css:Zone.Identifier | 3 - src/css/icons.scss:Zone.Identifier | 3 - src/i18n/en/index.js | 8 +- src/i18n/es/index.js | 8 +- src/pages/Customer/Card/CustomerBalance.vue | 278 +++++++----------- .../Customer/Card/CustomerCreditContracts.vue | 152 +++++----- .../Customer/Card/CustomerCreditOpinion.vue | 1 - src/pages/Customer/Card/CustomerWebAccess.vue | 54 ++-- .../components/CustomerAddressCreate.vue | 119 ++++---- .../CustomerCreditContractsCreate.vue | 1 - .../components/CustomerCreditCreate.vue | 35 ++- .../CustomerFileManagementCreate.vue | 21 +- .../components/CustomerFileManagementEdit.vue | 23 +- .../components/CustomerNewCustomsAgent.vue | 1 - 19 files changed, 313 insertions(+), 409 deletions(-) delete mode 100644 src/css/fonts/icon.eot:Zone.Identifier delete mode 100644 src/css/fonts/icon.svg:Zone.Identifier delete mode 100644 src/css/fonts/icon.ttf:Zone.Identifier delete mode 100644 src/css/fonts/icon.woff:Zone.Identifier delete mode 100644 src/css/fonts/selection.json:Zone.Identifier delete mode 100644 src/css/icons.scss.css:Zone.Identifier delete mode 100644 src/css/icons.scss:Zone.Identifier diff --git a/src/css/fonts/icon.eot:Zone.Identifier b/src/css/fonts/icon.eot:Zone.Identifier deleted file mode 100644 index 133a3af6f..000000000 --- a/src/css/fonts/icon.eot:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=C:\Users\cmari\Downloads\Salix-font1.68.zip diff --git a/src/css/fonts/icon.svg:Zone.Identifier b/src/css/fonts/icon.svg:Zone.Identifier deleted file mode 100644 index 133a3af6f..000000000 --- a/src/css/fonts/icon.svg:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=C:\Users\cmari\Downloads\Salix-font1.68.zip diff --git a/src/css/fonts/icon.ttf:Zone.Identifier b/src/css/fonts/icon.ttf:Zone.Identifier deleted file mode 100644 index 133a3af6f..000000000 --- a/src/css/fonts/icon.ttf:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=C:\Users\cmari\Downloads\Salix-font1.68.zip diff --git a/src/css/fonts/icon.woff:Zone.Identifier b/src/css/fonts/icon.woff:Zone.Identifier deleted file mode 100644 index 133a3af6f..000000000 --- a/src/css/fonts/icon.woff:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=C:\Users\cmari\Downloads\Salix-font1.68.zip diff --git a/src/css/fonts/selection.json:Zone.Identifier b/src/css/fonts/selection.json:Zone.Identifier deleted file mode 100644 index 133a3af6f..000000000 --- a/src/css/fonts/selection.json:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=C:\Users\cmari\Downloads\Salix-font1.68.zip diff --git a/src/css/icons.scss.css:Zone.Identifier b/src/css/icons.scss.css:Zone.Identifier deleted file mode 100644 index 133a3af6f..000000000 --- a/src/css/icons.scss.css:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=C:\Users\cmari\Downloads\Salix-font1.68.zip diff --git a/src/css/icons.scss:Zone.Identifier b/src/css/icons.scss:Zone.Identifier deleted file mode 100644 index 133a3af6f..000000000 --- a/src/css/icons.scss:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=C:\Users\cmari\Downloads\Salix-font1.68.zip diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 4722d0576..3c46eb140 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -176,11 +176,11 @@ export default { securedCredit: 'Secured credit', payMethod: 'Pay method', debt: 'Debt', - isDisabled: 'Customer is disabled', - isFrozen: 'Customer is frozen', - webAccountInactive: 'Web account inactive', + isFrozen: 'Customer frozen', hasDebt: 'Customer has debt', - notChecked: 'Customer not checked', + isDisabled: 'Customer inactive', + notChecked: 'Customer no checked', + webAccountInactive: 'Web account inactive', noWebAccess: 'Web access is disabled', businessType: 'Business type', passwordRequirements: diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index e69f92b6d..3724d3ba0 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -175,11 +175,11 @@ export default { securedCredit: 'Crédito asegurado', payMethod: 'Método de pago', debt: 'Riesgo', - isDisabled: 'El cliente está desactivado', - isFrozen: 'El cliente está congelado', + isFrozen: 'Cliente congelado', + hasDebt: 'Cliente con riesgo', + isDisabled: 'Cliente inactivo', + notChecked: 'Cliente no comprobado', webAccountInactive: 'Sin acceso web', - hasDebt: 'El cliente tiene riesgo', - notChecked: 'El cliente no está comprobado', noWebAccess: 'El acceso web está desactivado', businessType: 'Tipo de negocio', passwordRequirements: diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index bd8337346..ec836935c 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -46,62 +46,6 @@ const filter = { where: { clientFk: route.params.id, companyFk: user.value.companyFk }, }; -const tableColumnComponents = { - date: { - component: 'span', - props: () => {}, - event: () => {}, - }, - creationDate: { - component: 'span', - props: () => {}, - event: () => {}, - }, - employee: { - component: QBtn, - props: () => ({ flat: true, color: 'blue', noCaps: true }), - event: () => {}, - }, - reference: { - component: 'div', - props: () => {}, - event: () => {}, - }, - bank: { - component: 'span', - props: () => {}, - event: () => {}, - }, - debit: { - component: 'span', - props: () => {}, - event: () => {}, - }, - havings: { - component: 'span', - props: () => {}, - event: () => {}, - }, - balance: { - component: 'span', - props: () => {}, - event: () => {}, - }, - conciliated: { - component: QCheckbox, - props: (prop) => ({ - disable: true, - 'model-value': Boolean(prop.value), - }), - event: () => {}, - }, - actions: { - component: 'div', - props: () => {}, - event: () => {}, - }, -}; - const columns = computed(() => [ { align: 'left', @@ -151,8 +95,8 @@ const columns = computed(() => [ }, { align: 'left', - field: (value) => value.debit - value.credit, - format: (value) => toCurrency(value), + field: 'balance', + format: (value) => value && toCurrency(value), label: t('Balance'), name: 'balance', }, @@ -190,6 +134,16 @@ const getData = () => { }; const onFetch = (data) => { + if (clientRisks.value?.length && data.length) { + data[0].balance = clientRisks.value[0]?.amount || 0; + + data.reduce((prev, curr) => { + const netMovement = prev.debit - prev.credit; + curr.balance = prev.balance - netMovement; + return curr; + }); + } + receiptsData.value = data; }; @@ -213,10 +167,10 @@ const updateCompanyId = (id) => { getData(); }; -const saveFieldValue = async (event) => { +const saveFieldValue = async (row) => { try { - const payload = { description: event.value }; - await axios.patch(`Receipts/${event.key}`, payload); + const payload = { description: row.description }; + await axios.patch(`Receipts/${row.id}`, payload); } catch (err) { return err; } @@ -228,13 +182,6 @@ const sendEmailAction = () => { diff --git a/src/pages/Customer/components/CustomerCreditContractsCreate.vue b/src/pages/Customer/components/CustomerCreditContractsCreate.vue index d8361faa7..d902e7a97 100644 --- a/src/pages/Customer/components/CustomerCreditContractsCreate.vue +++ b/src/pages/Customer/components/CustomerCreditContractsCreate.vue @@ -25,7 +25,6 @@ const toCustomerCreditContracts = () => { diff --git a/src/pages/Customer/components/CustomerCreditCreate.vue b/src/pages/Customer/components/CustomerCreditCreate.vue index 3671f1001..ae6d4de89 100644 --- a/src/pages/Customer/components/CustomerCreditCreate.vue +++ b/src/pages/Customer/components/CustomerCreditCreate.vue @@ -1,15 +1,22 @@ diff --git a/src/pages/Customer/components/CustomerFileManagementCreate.vue b/src/pages/Customer/components/CustomerFileManagementCreate.vue index 6d76c2b72..8970eaaaf 100644 --- a/src/pages/Customer/components/CustomerFileManagementCreate.vue +++ b/src/pages/Customer/components/CustomerFileManagementCreate.vue @@ -57,18 +57,21 @@ watch([client, findOne], ([newClient, newFindOne]) => { const saveData = async () => { try { const formData = new FormData(); + const files = dms.value.files; - if (dms.value.files) { - for (let i = 0; i < dms.value.files.length; i++) - formData.append(dms.value.files[i].name, dms.value.files[i]); + if (files && files.length > 0) { + for (let file of files) { + formData.append(file.name, file); + } dms.value.hasFileAttached = true; + + const url = `clients/${route.params.id}/uploadFile`; + await axios.post(url, formData, { + params: dms.value, + }); + notify('globals.dataSaved', 'positive'); + toCustomerFileManagement(); } - const url = `clients/${route.params.id}/uploadFile`; - await axios.post(url, formData, { - params: dms.value, - }); - notify('globals.dataSaved', 'positive'); - toCustomerFileManagement(); } catch (error) { notify(error.message, 'negative'); } diff --git a/src/pages/Customer/components/CustomerFileManagementEdit.vue b/src/pages/Customer/components/CustomerFileManagementEdit.vue index f1279b938..b5e0d4b7d 100644 --- a/src/pages/Customer/components/CustomerFileManagementEdit.vue +++ b/src/pages/Customer/components/CustomerFileManagementEdit.vue @@ -43,20 +43,21 @@ const setCurrentDms = (data) => { const saveData = async () => { try { const formData = new FormData(); + const files = dms.value.files; - if (dms.value.files) { - for (let i = 0; i < dms.value.files.length; i++) - formData.append(dms.value.files[i].name, dms.value.files[i]); + if (files && files.length > 0) { + for (let file of files) { + formData.append(file.name, file); + } dms.value.hasFileAttached = true; + + const url = `dms/${route.params.dmsId}/updateFile`; + await axios.post(url, formData, { + params: dms.value, + }); + notify('globals.dataSaved', 'positive'); + toCustomerFileManagement(); } - - const url = `dms/${route.params.dmsId}/updateFile`; - await axios.post(url, formData, { - params: dms.value, - }); - - notify('globals.dataSaved', 'positive'); - toCustomerFileManagement(); } catch (error) { notify(error.message, 'negative'); } diff --git a/src/pages/Customer/components/CustomerNewCustomsAgent.vue b/src/pages/Customer/components/CustomerNewCustomsAgent.vue index 44c94f0d9..062fd0254 100644 --- a/src/pages/Customer/components/CustomerNewCustomsAgent.vue +++ b/src/pages/Customer/components/CustomerNewCustomsAgent.vue @@ -17,7 +17,6 @@ const onDataSaved = (dataSaved) => {