From 658bd015caa50faaa47cca00c0f3767de21f5e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 14 Feb 2025 12:41:11 +0100 Subject: [PATCH 01/32] feat: refs #8529 invoiceIn move deductible field from head to lines --- .../InvoiceIn/Card/InvoiceInBasicData.vue | 28 ++++--------------- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 4 --- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 15 ++++++++++ 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index 905ddebb2b0..9fe365a3850 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -143,20 +143,12 @@ function deleteFile(dmsFk) { - - + option-label="withholding" + />
- - - @@ -313,7 +296,6 @@ function deleteFile(dmsFk) { supplierFk: Proveedor Expedition date: Fecha expedición Operation date: Fecha operación - Undeductible VAT: Iva no deducible Document: Documento Download file: Descargar archivo Entry date: Fecha asiento diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index d358601d316..f2393a56d4c 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -272,10 +272,6 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; :label="t('invoiceIn.summary.sage')" :value="entity.sageWithholding?.withholding" /> - [ sortable: true, align: 'left', }, + { + name: 'isDeductible', + label: t('Deductible'), + field: (row) => row.isDeductible, + model: 'isDeductible', + align: 'center', + }, { name: 'sageiva', label: t('Sage iva'), @@ -119,6 +126,7 @@ const filter = { 'foreignValue', 'taxTypeSageFk', 'transactionTypeSageFk', + 'isDeductible', ], where: { invoiceInFk: route.params.id, @@ -227,6 +235,11 @@ function setCursor(ref) { + + \ No newline at end of file From 816a6197c72bd11b3e44a10d700569738491e937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 3 Mar 2025 18:05:19 +0100 Subject: [PATCH 05/32] feat: refs #8529 enhance InvoiceInVat component with data-cy attribute for isDeductible checkbox --- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 5 ++++- .../invoiceIn/invoiceInBasicData.spec.js | 6 +----- .../invoiceIn/invoiceInDescriptor.spec.js | 4 ++-- .../integration/invoiceIn/invoiceInVat.spec.js | 13 ++++++++++++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index 0f8f9a6c540..7077c9a59bf 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -237,7 +237,10 @@ function setCursor(ref) { es: Model: Modelo @@ -190,4 +305,6 @@ es: Do you want to remove this PDA?: ¿Desea eliminar este PDA? You can only have one PDA: Solo puedes tener un PDA si no eres autonomo This PDA is already assigned to another user: Este PDA ya está asignado a otro usuario + Are you sure you want to send it?: ¿Seguro que quieres enviarlo? + Sign PDA: Firmar PDA diff --git a/src/pages/Worker/Department/Card/DepartmentDescriptor.vue b/src/pages/Worker/Department/Card/DepartmentDescriptor.vue index 4b7dfd9b80d..82065859350 100644 --- a/src/pages/Worker/Department/Card/DepartmentDescriptor.vue +++ b/src/pages/Worker/Department/Card/DepartmentDescriptor.vue @@ -4,7 +4,7 @@ import { useRoute, useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { useVnConfirm } from 'composables/useVnConfirm'; import VnLv from 'src/components/ui/VnLv.vue'; -import CardDescriptor from 'src/components/ui/CardDescriptor.vue'; +import EntityDescriptor from 'src/components/ui/EntityDescriptor.vue'; import axios from 'axios'; import useNotify from 'src/composables/useNotify.js'; @@ -40,7 +40,7 @@ const removeDepartment = async () => { const { openConfirmationModal } = useVnConfirm(); - + diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue index 8210ba0e33b..44dfd32b4cb 100644 --- a/src/pages/Worker/WorkerFilter.vue +++ b/src/pages/Worker/WorkerFilter.vue @@ -35,7 +35,7 @@ const getLocale = (label) => { diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue index a8cb05afccc..fc5c04b41bb 100644 --- a/src/pages/Zone/ZoneDeliveryPanel.vue +++ b/src/pages/Zone/ZoneDeliveryPanel.vue @@ -95,8 +95,7 @@ watch( :filter-options="['code']" hide-selected dense - outlined - rounded + filled map-key="geoFk" data-cy="ZoneDeliveryDaysPostcodeSelect" > @@ -128,8 +127,7 @@ watch( option-label="name" hide-selected dense - outlined - rounded + filled data-cy="ZoneDeliveryDaysAgencySelect" />
diff --git a/test/cypress/integration/vnComponent/VnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js index e857457a7d1..ae0013150ce 100644 --- a/test/cypress/integration/vnComponent/VnLog.spec.js +++ b/test/cypress/integration/vnComponent/VnLog.spec.js @@ -25,7 +25,7 @@ describe('VnLog', () => { it('should show claimDescriptor', () => { cy.dataCy('iconLaunch-claimFk').first().click(); - cy.dataCy('cardDescriptor_subtitle').contains('1'); + cy.dataCy('vnDescriptor_subtitle').contains('1'); cy.dataCy('iconLaunch-claimFk').first().click(); }); }); diff --git a/test/cypress/integration/worker/workerPda.spec.js b/test/cypress/integration/worker/workerPda.spec.js index 31ec19eda0e..2623e81cf42 100644 --- a/test/cypress/integration/worker/workerPda.spec.js +++ b/test/cypress/integration/worker/workerPda.spec.js @@ -1,23 +1,80 @@ describe('WorkerPda', () => { - const select = '[data-cy="pda-dialog-select"]'; + const deviceId = 4; beforeEach(() => { - cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/worker/1110/pda`); }); - it('assign pda', () => { - cy.addBtnClick(); - cy.get(select).click(); - cy.get(select).type('{downArrow}{enter}'); - cy.get('.q-notification__message').should('have.text', 'Data created'); + it('assign and delete pda', () => { + creatNewPDA(); + cy.checkNotification('Data created'); + cy.visit(`/#/worker/1110/pda`); + removeNewPDA(); + cy.checkNotification('PDA deallocated'); }); - it('delete pda', () => { - cy.get('.btn-delete').click(); - cy.get( - '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' - ).click(); - cy.get('.q-notification__message').should('have.text', 'PDA deallocated'); + it('send and download pdf to docuware', () => { + //Send + cy.intercept('POST', '/api/Docuwares/upload-pda-pdf', (req) => { + req.reply({ + statusCode: 200, + body: {}, + }); + }); + + creatNewPDA(); + + cy.dataCy('workerPda-send').click(); + cy.clickConfirm(); + cy.checkNotification('PDF sended to signed'); + + //Download + cy.intercept('POST', /\/api\/Docuwares\/Jones%20Jessica\/checkFile/, (req) => { + req.reply({ + statusCode: 200, + body: { + id: deviceId, + state: 'Firmado', + }, + }); + }); + cy.get('#st-actions').contains('refresh').click(); + cy.intercept('GET', '/api/Docuwares/download-pda-pdf**', (req) => { + req.reply({ + statusCode: 200, + body: {}, + }); + }); + + cy.dataCy('workerPda-download').click(); + removeNewPDA(); }); + + it('send 2 pdfs to docuware', () => { + cy.intercept('POST', '/api/Docuwares/upload-pda-pdf', (req) => { + req.reply({ + statusCode: 200, + body: {}, + }); + }); + + creatNewPDA(); + creatNewPDA(2); + cy.selectRows([1, 2]); + cy.get('#st-actions').contains('Send').click(); + cy.checkNotification('PDF sended to signed'); + + removeNewPDA(); + }); + + function creatNewPDA(id = deviceId) { + cy.addBtnClick(); + cy.selectOption('[data-cy="pda-dialog-select"]', id); + cy.saveCard(); + } + + function removeNewPDA() { + cy.dataCy('workerPda-remove').first().click(); + cy.clickConfirm(); + } }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index de25959b2ca..fe8d38e7999 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -371,7 +371,7 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => { }); Cypress.Commands.add('openActionsDescriptor', () => { - cy.get('[data-cy="cardDescriptor"] [data-cy="descriptor-more-opts"]').click(); + cy.get('[data-cy="vnDescriptor"] [data-cy="descriptor-more-opts"]').click(); }); Cypress.Commands.add('openUserPanel', () => { @@ -466,16 +466,16 @@ Cypress.Commands.add('validateDescriptor', (toCheck = {}) => { const popupSelector = popup ? '[role="menu"] ' : ''; - if (title) cy.get(`${popupSelector}[data-cy="cardDescriptor_title"]`).contains(title); + if (title) cy.get(`${popupSelector}[data-cy="vnDescriptor_title"]`).contains(title); if (description) - cy.get(`${popupSelector}[data-cy="cardDescriptor_description"]`).contains( + cy.get(`${popupSelector}[data-cy="vnDescriptor_description"]`).contains( description, ); if (subtitle) - cy.get(`${popupSelector}[data-cy="cardDescriptor_subtitle"]`).contains(subtitle); + cy.get(`${popupSelector}[data-cy="vnDescriptor_subtitle"]`).contains(subtitle); for (const index in listbox) - cy.get(`${popupSelector}[data-cy="cardDescriptor_listbox"] > *`) + cy.get(`${popupSelector}[data-cy="vnDescriptor_listbox"] > *`) .eq(index) .should('contain.text', listbox[index]); }); From 88c61c8a856b79bd289efaaa022ead0b26f1334c Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 24 Mar 2025 14:27:18 +0100 Subject: [PATCH 24/32] fix: warmFix quasar build async function --- src/composables/downloadFile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/composables/downloadFile.js b/src/composables/downloadFile.js index 302836e09e9..0c4e8edb653 100644 --- a/src/composables/downloadFile.js +++ b/src/composables/downloadFile.js @@ -5,18 +5,19 @@ import { exportFile } from 'quasar'; const { getTokenMultimedia } = useSession(); const token = getTokenMultimedia(); -const appUrl = (await getUrl('', 'lilium')).replace('/#/', ''); export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) { + const appUrl = await getAppUrl(); const response = await axios.get( url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`, - { responseType: 'blob' } + { responseType: 'blob' }, ); download(response); } export async function downloadDocuware(url, params) { + const appUrl = await getAppUrl(); const response = await axios.get(`${appUrl}/api/` + url, { responseType: 'blob', params, @@ -32,3 +33,7 @@ function download(response) { exportFile(filename, response.data); } + +async function getAppUrl() { + return (await getUrl('', 'lilium')).replace('/#/', ''); +} From 535fe011f61f3511ff5cc2df7c1a942cb668c97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 24 Mar 2025 17:51:29 +0100 Subject: [PATCH 25/32] feat: refs #8529 add isDeductible column and localization for InvoiceIn summary --- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 16 ++++++++++++++++ src/pages/InvoiceIn/Card/InvoiceInVat.vue | 3 +-- src/pages/InvoiceIn/locale/en.yml | 1 + src/pages/InvoiceIn/locale/es.yml | 1 + .../invoiceIn/invoiceInDescriptor.spec.js | 3 --- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index 4f1140a9a23..d5fded4bc73 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -40,6 +40,13 @@ const vatColumns = ref([ sortable: true, align: 'left', }, + { + name: 'isDeductible', + label: 'invoiceIn.isDeductible', + field: (row) => row.isDeductible, + sortable: true, + align: 'center', + }, { name: 'vat', label: 'invoiceIn.summary.sageVat', @@ -331,6 +338,15 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; +