From 7c6112c896205052c16908fccc30a154a263e84e Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 14 Feb 2025 14:16:26 +0100 Subject: [PATCH 01/39] refactor: refs #8606 modified table height and deleted void file --- src/pages/Zone/Card/ZoneCalendar.vue | 0 src/pages/Zone/ZoneList.vue | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 src/pages/Zone/Card/ZoneCalendar.vue diff --git a/src/pages/Zone/Card/ZoneCalendar.vue b/src/pages/Zone/Card/ZoneCalendar.vue deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue index 1fa539c91..cbe0d516d 100644 --- a/src/pages/Zone/ZoneList.vue +++ b/src/pages/Zone/ZoneList.vue @@ -116,7 +116,7 @@ const columns = computed(() => [ }, }, { - align: 'left', + align: 'center', name: 'hour', label: t('list.close'), cardVisible: true, @@ -191,6 +191,7 @@ function formatRow(row) { :columns="columns" redirect="zone" :right-search="false" + table-height="85vh" > - - - - +
+
+ + + + +
+
@@ -246,3 +253,20 @@ es: Search zone: Buscar zona You can search zones by id or name: Puedes buscar zonas por id o nombre + + From 6f2d8d0a937afccbccde25701dfcdbc1a5a00bc4 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 17 Feb 2025 13:53:28 +0100 Subject: [PATCH 03/39] feat: refs #8599 modified tests to be more complete and added new ones --- .../invoiceOut/invoiceOutList.spec.js | 46 +++++++---- .../invoiceOutNegativeBases.spec.js | 19 +++++ .../invoiceOut/invoiceOutSummary.spec.js | 76 ++++++++++++++----- 3 files changed, 109 insertions(+), 32 deletions(-) diff --git a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js index 82f0fa3b6..df85e130e 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js @@ -1,6 +1,14 @@ /// describe('InvoiceOut list', () => { const serial = 'Española rapida'; + const columnCheckbox = + '.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner'; + const firstRowDescriptor = + 'tbody > :nth-child(1) > [data-col-field="clientFk"] > .no-padding > .link'; + const firstRowCheckbox = + 'tbody > :nth-child(1) > :nth-child(1) > .q-checkbox > .q-checkbox__inner '; + const summaryPopupIcon = '.header > :nth-child(2) > .q-btn__content > .q-icon'; + const filterBtn = '.q-scrollarea__content > .q-btn--standard > .q-btn__content'; beforeEach(() => { cy.viewport(1920, 1080); @@ -9,18 +17,27 @@ describe('InvoiceOut list', () => { cy.typeSearchbar('{enter}'); }); - it('should search and filter an invoice and enter to the summary', () => { - cy.typeSearchbar('1{enter}'); - cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click(); - cy.get('.header > a.q-btn > .q-btn__content').click(); - cy.typeSearchbar('{enter}'); - cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}'); + it('should download one pdf', () => { + cy.get(firstRowCheckbox).click(); + cy.dataCy('InvoiceOutDownloadPdfBtn').click(); }); - it('should download all pdfs', () => { - cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click(); + it('should download all pdfs, then open the descriptor', () => { + cy.get(columnCheckbox).click(); cy.dataCy('InvoiceOutDownloadPdfBtn').click(); - cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click(); + }); + + it('should open the client descriptor', () => { + cy.get(firstRowDescriptor).click(); + cy.get(summaryPopupIcon).click(); + }); + + it('should create a manual invoice and enter to its summary', () => { + cy.dataCy('vnTableCreateBtn').click(); + cy.dataCy('InvoiceOutCreateTicketinput').type(8); + cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial); + cy.dataCy('FormModelPopup_save').click(); + cy.checkNotification('Data created'); }); it('should give an error when manual invoicing a ticket that is already invoiced', () => { @@ -31,11 +48,10 @@ describe('InvoiceOut list', () => { cy.checkNotification('This ticket is already invoiced'); }); - it('should create a manual invoice and enter to its summary', () => { - cy.dataCy('vnTableCreateBtn').click(); - cy.dataCy('InvoiceOutCreateTicketinput').type(8); - cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial); - cy.dataCy('FormModelPopup_save').click(); - cy.checkNotification('Data created'); + it('should filter the results by client ID, then check the first result is correct', () => { + cy.dataCy('Customer ID_input').type('1103'); + cy.get(filterBtn).click(); + cy.get(firstRowDescriptor).click(); + cy.get('.q-item > .q-item__label').should('include.text', '1103'); }); }); diff --git a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js index 02b7fbb43..dc8235c1a 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js @@ -1,11 +1,30 @@ /// describe('InvoiceOut negative bases', () => { + const clientDescriptor = + ':nth-child(1) > [data-col-field="clientId"] > .no-padding > .link'; + const ticketDescriptor = + ':nth-child(1) > [data-col-field="ticketFk"] > .no-padding > .link'; + const workerDescriptor = + ':nth-child(1) > [data-col-field="workerName"] > .no-padding > .link'; + beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/invoice-out/negative-bases`); }); + it('should open the posible descriptors', () => { + cy.get(clientDescriptor).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '1101'); + cy.get(ticketDescriptor).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '23'); + cy.get(workerDescriptor).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '18'); + }); + it('should filter and download as CSV', () => { cy.get('input[name="ticketFk"]').type('23{enter}'); cy.get('#subToolbar > .q-btn').click(); diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js index 44b0a9961..d774a4935 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js @@ -5,25 +5,54 @@ describe('InvoiceOut summary', () => { Type: { val: 'Error in customer data', type: 'select' }, }; + const firstTicketRowDescriptor = 'tbody > :nth-child(1) > :nth-child(1) > .q-btn'; + const firstClientRowDescriptor = + 'tbody > :nth-child(1) > :nth-child(2) > .q-btn > .q-btn__content'; + const toCustomerSummary = '[href="#/customer/1101"]'; + const toTicketList = '[href="#/ticket/list?table={%22refFk%22:%22T1111111%22}"]'; + beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); - cy.visit(`/#/invoice-out/list`); + cy.visit(`/#/invoice-out/1/summary`); }); - it('should generate the invoice PDF', () => { - cy.typeSearchbar('T1111111{enter}'); - cy.dataCy('descriptor-more-opts').click(); - cy.get('.q-menu > .q-list > :nth-child(6)').click(); - cy.dataCy('VnConfirm_confirm').click(); - cy.checkNotification('The invoice PDF document has been regenerated'); + it('open the descriptors', () => { + cy.get(firstTicketRowDescriptor).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '1'); + cy.get(firstClientRowDescriptor).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '1101'); }); - it('should refund the invoice ', () => { + + it('should open the client summary and the ticket list', () => { + cy.get(toCustomerSummary).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '1101'); + }); + + it('should open the ticket list', () => { + cy.get(toTicketList).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('[data-cy="vnFilterPanelChip"]').should('include.text', 'T1111111'); + }); + + it('should transfer the invoice ', () => { cy.typeSearchbar('T1111111{enter}'); cy.dataCy('descriptor-more-opts').click(); - cy.get('.q-menu > .q-list > :nth-child(7)').click(); - cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click(); - cy.checkNotification('The following refund ticket have been created'); + cy.get('.q-menu > .q-list > :nth-child(1)').click(); + cy.fillInForm(transferInvoice); + cy.get('.q-mt-lg > .q-btn').click(); + cy.checkNotification('Transferred invoice'); + }); + + it('should send the invoice', () => { + cy.dataCy('descriptor-more-opts').click(); + cy.get('.q-menu > .q-list > :nth-child(3)').click(); + cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(1)').click(); + cy.get('.q-btn--unelevated').click(); + cy.checkNotification('Notification sent'); }); it('should delete an invoice ', () => { @@ -33,12 +62,25 @@ describe('InvoiceOut summary', () => { cy.dataCy('VnConfirm_confirm').click(); cy.checkNotification('InvoiceOut deleted'); }); - it('should transfer the invoice ', () => { - cy.typeSearchbar('T1111111{enter}'); + + it('shpuld book the invoice', () => { cy.dataCy('descriptor-more-opts').click(); - cy.get('.q-menu > .q-list > :nth-child(1)').click(); - cy.fillInForm(transferInvoice); - cy.get('.q-mt-lg > .q-btn').click(); - cy.checkNotification('Transferred invoice'); + cy.get('.q-menu > .q-list > :nth-child(5)').click(); + cy.dataCy('VnConfirm_confirm').click(); + cy.checkNotification('InvoiceOut booked'); + }); + + it('should generate the invoice PDF', () => { + cy.dataCy('descriptor-more-opts').click(); + cy.get('.q-menu > .q-list > :nth-child(6)').click(); + cy.dataCy('VnConfirm_confirm').click(); + cy.checkNotification('The invoice PDF document has been regenerated'); + }); + + it('should refund the invoice ', () => { + cy.dataCy('descriptor-more-opts').click(); + cy.get('.q-menu > .q-list > :nth-child(7)').click(); + cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click(); + cy.checkNotification('The following refund ticket have been created'); }); }); From 5ce7c7f597d56b078319b673013100e0b6e1c293 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 18 Feb 2025 09:05:38 +0100 Subject: [PATCH 04/39] fix: refs #8606 fixed list e2e test --- src/pages/Zone/ZoneFilterPanel.vue | 8 +++++++- test/cypress/integration/zone/zoneList.spec.js | 11 ++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pages/Zone/ZoneFilterPanel.vue b/src/pages/Zone/ZoneFilterPanel.vue index 3a35527ab..bbe12189a 100644 --- a/src/pages/Zone/ZoneFilterPanel.vue +++ b/src/pages/Zone/ZoneFilterPanel.vue @@ -38,7 +38,12 @@ const agencies = ref([]); - - -en: - params: - search: Contains - clientFk: Customer - fi: FI - amount: Amount - min: Min - max: Max - hasPdf: Has PDF - issued: Issued - created: Created - dued: Dued -es: - params: - search: Contiene - clientFk: Cliente - fi: CIF - amount: Importe - min: Min - max: Max - hasPdf: Tiene PDF - issued: Emitida - created: Creada - dued: Vencida - Customer ID: ID cliente - FI: CIF - Amount: Importe - Has PDF: Tiene PDF - Issued: Fecha emisión - Created: Fecha creación - Dued: Fecha vencimiento - diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index c7d7ba9f4..873ab030f 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -71,14 +71,6 @@ const columns = computed(() => [ inWhere: true, }, }, - { - align: 'left', - name: 'issued', - label: t('invoiceOut.summary.issued'), - component: 'date', - format: (row) => toDate(row.issued), - columnField: { component: null }, - }, { align: 'left', name: 'clientFk', diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index 135eb9aca..b062678a0 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -10,6 +10,8 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue'; import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; +import InvoiceOutNegativeBasesFilter from './InvoiceOutNegativeBasesFilter.vue'; +import RightMenu from 'src/components/common/RightMenu.vue'; const { t } = useI18n(); const tableRef = ref(); @@ -97,16 +99,19 @@ const columns = computed(() => [ align: 'left', name: 'isActive', label: t('invoiceOut.negativeBases.active'), + component: 'checkbox', }, { align: 'left', name: 'hasToInvoice', label: t('invoiceOut.negativeBases.hasToInvoice'), + component: 'checkbox', }, { align: 'left', - name: 'hasVerifiedData', + name: 'isTaxDataChecked', label: t('invoiceOut.negativeBases.verifiedData'), + component: 'checkbox', }, { align: 'left', @@ -142,7 +147,7 @@ const downloadCSV = async () => { await invoiceOutGlobalStore.getNegativeBasesCsv( userParams.from, userParams.to, - filterParams + filterParams, ); }; @@ -154,6 +159,11 @@ const downloadCSV = async () => { + + + { auto-load :is-editable="false" :use-model="true" + :right-search="false" >