From 6122b642688061d80ca2d373fefc838bb83ce5e5 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 23 Apr 2025 09:48:59 +0200 Subject: [PATCH 1/7] feat: refs #8930 add vehicle management to invoice summary and vehicle linking functionality --- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 82 +++++++++- src/pages/InvoiceIn/Card/InvoiceInVehicle.vue | 112 +++++++++++++ src/pages/InvoiceIn/locale/en.yml | 8 + src/pages/InvoiceIn/locale/es.yml | 8 + src/router/modules/invoiceIn.js | 10 ++ .../invoiceIn/invoiceInSummary.spec.js | 147 ++++++++++++++++-- .../invoiceIn/invoiceInVehicle.spec.js | 57 +++++++ 7 files changed, 412 insertions(+), 12 deletions(-) create mode 100644 src/pages/InvoiceIn/Card/InvoiceInVehicle.vue create mode 100644 test/cypress/integration/invoiceIn/invoiceInVehicle.spec.js diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index 74936f00a..4032c022f 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -11,6 +11,7 @@ import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorP import InvoiceIntoBook from '../InvoiceInToBook.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import InvoiceInDescriptorMenu from './InvoiceInDescriptorMenu.vue'; +import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue'; const props = defineProps({ id: { type: [Number, String], default: 0 } }); const { t } = useI18n(); @@ -161,6 +162,22 @@ const intrastatColumns = ref([ }, ]); +const vehicleColumns = ref([ + { + name: 'numberPlate', + label: 'invoiceIn.summary.vehicle', + field: (row) => row.vehicleInvoiceIn?.numberPlate, + format: (value) => value, + align: 'left', + }, + { + name: 'amount', + label: 'invoiceIn.list.amount', + field: (row) => toCurrency(row.vehicleInvoiceIn?.amount), + align: 'left', + }, +]); + onMounted(async () => { invoiceInUrl.value = `${await getUrl('')}invoiceIn/${entityId.value}/`; }); @@ -186,6 +203,8 @@ const getTotalTax = (tax) => tax.reduce((acc, cur) => acc + taxRate(cur.taxableBase, cur.taxTypeSage?.rate), 0); const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; +const getVehicleTotalAmount = (vehicles) => + vehicles.reduce((acc, cur) => acc + cur.amount, 0); diff --git a/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue new file mode 100644 index 000000000..4853b166c --- /dev/null +++ b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/pages/InvoiceIn/locale/en.yml b/src/pages/InvoiceIn/locale/en.yml index a7a8d2469..f809d8ff2 100644 --- a/src/pages/InvoiceIn/locale/en.yml +++ b/src/pages/InvoiceIn/locale/en.yml @@ -63,10 +63,18 @@ invoiceIn: net: Net stems: Stems country: Country + vehicle: Vehicle params: + invoiceInFk: Invoice nº + vehicleFk: Vehicle + amount: Amount search: Id or supplier name correctedFk: Corrected isBooked: Is booked account: Ledger account correctingFk: Rectificative noMatch: No match with the vat({totalTaxableBase}) + linkVehicleToInvoiceIn: Link vehicle to invoice + unlinkedVehicle: Unlinked vehicle + unlinkVehicle: Unlink vehicle + unlinkVehicleConfirmation: This vehicle will be unlinked from this invoice! Continue anyway? diff --git a/src/pages/InvoiceIn/locale/es.yml b/src/pages/InvoiceIn/locale/es.yml index c593f5a08..7f7de6e6d 100644 --- a/src/pages/InvoiceIn/locale/es.yml +++ b/src/pages/InvoiceIn/locale/es.yml @@ -61,10 +61,18 @@ invoiceIn: net: Neto stems: Tallos country: País + vehicle: Vehículo params: + invoiceInFk: Factura nº + vehicleFk: Vehículo + amount: Importe search: Id o nombre proveedor correctedFk: Rectificada isBooked: Contabilizada account: Cuenta contable correctingFk: Rectificativa noMatch: No cuadra con el iva({totalTaxableBase}) + linkVehicleToInvoiceIn: Vincular vehículo a factura + unlinkedVehicle: Vehículo desvinculado + unlinkVehicle: Desvincular vehículo + unlinkVehicleConfirmation: Este vehículo se desvinculará de esta factura! ¿Continuar de todas formas? diff --git a/src/router/modules/invoiceIn.js b/src/router/modules/invoiceIn.js index b8021e69f..ccd7b8520 100644 --- a/src/router/modules/invoiceIn.js +++ b/src/router/modules/invoiceIn.js @@ -18,6 +18,7 @@ const invoiceInCard = { 'InvoiceInIntrastat', 'InvoiceInCorrective', 'InvoiceInLog', + 'InvoiceInVehicle', ], }, children: [ @@ -75,6 +76,15 @@ const invoiceInCard = { }, component: () => import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'), }, + { + name: 'InvoiceInVehicle', + path: 'vehicle', + meta: { + title: 'vehicle', + icon: 'directions_car', + }, + component: () => import('src/pages/InvoiceIn/Card/InvoiceInVehicle.vue'), + }, { name: 'InvoiceInLog', path: 'log', diff --git a/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js b/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js index 72dbdd9a8..fede6091f 100644 --- a/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js @@ -1,24 +1,153 @@ describe('InvoiceInSummary', () => { + const url = '/#/invoice-in/1/summary'; + + const selectors = { + supplierLink: '[data-cy="invoiceInSummary_supplier"]', + vehicleLink: '[data-cy="invoiceInSummary_vehicle"]', + descriptorOpenSummaryBtn: '.q-menu .descriptor [data-cy="openSummaryBtn"]', + descriptorGoToSummaryBtn: '.q-menu .descriptor [data-cy="goToSummaryBtn"]', + summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]', + supplierDescriptorTitle: '[data-cy="vnDescriptor_description"]', + vehicleDescriptorTitle: '[data-cy="vnDescriptor_title"]', + }; + + const sectionSelectors = { + basicDataIcon: 'InvoiceInBasicData-menu-item', + vatIcon: 'InvoiceInVat-menu-item', + dueDayIcon: 'InvoiceInDueDay-menu-item', + intrastatIcon: 'InvoiceInIntrastat-menu-item', + vehicleIcon: 'InvoiceInVehicle-menu-item', + logIcon: 'InvoiceInLog-menu-item', + }; + + const titlesLinks = { + basicData: '[data-cy="basicDataTitleLink"].link', + vat: '[data-cy="vatTitleLink"].link', + dueDay: '[data-cy="dueDayTitleLink"].link', + intrastat: '[data-cy="intrastatTitleLink"].link', + vehicle: '[data-cy="vehicleTitleLink"].link', + }; + + const basePath = 'invoice-in/1/'; + const sectionRegex = { + basicData: new RegExp(`${basePath}basic-data`), + vat: new RegExp(`${basePath}vat`), + dueDay: new RegExp(`${basePath}due-day`), + intrastat: new RegExp(`${basePath}intrastat`), + vehicle: new RegExp(`${basePath}vehicle`), + log: new RegExp(`${basePath}log`), + }; + + const supplierSummaryUrlRegex = /supplier\/\d+\/summary/; + const vehicleSummaryUrlRegex = /vehicle\/\d+\/summary/; beforeEach(() => { cy.login('administrative'); - cy.visit('/#/invoice-in/3/summary'); + cy.visit(url); + }); + + it('Should redirect to the corresponding section when clicking on the icons in the left menu', () => { + cy.dataCy(sectionSelectors.basicDataIcon).click(); + cy.location().should('match', sectionRegex.basicData); + + cy.visit(url); + cy.dataCy(sectionSelectors.vatIcon).click(); + cy.location().should('match', sectionRegex.vat); + + cy.visit(url); + cy.dataCy(sectionSelectors.dueDayIcon).click(); + cy.location().should('match', sectionRegex.dueDay); + + cy.visit(url); + cy.dataCy(sectionSelectors.intrastatIcon).click(); + cy.location().should('match', sectionRegex.intrastat); + + cy.visit(url); + cy.dataCy(sectionSelectors.vehicleIcon).click(); + cy.location().should('match', sectionRegex.vehicle); + + cy.visit(url); + cy.dataCy(sectionSelectors.logIcon).click(); + cy.location().should('match', sectionRegex.log); + }); + + describe('Title links redirections', () => { + it('Should redirect to invoiceIn basic-data when clicking on basic-data title link', () => { + cy.get(titlesLinks.basicData).click(); + cy.location().should('match', sectionRegex.basicData); + }); + + it('Should redirect to invoiceIn vat when clicking on basic-data title link', () => { + cy.get(titlesLinks.vat).click(); + cy.location().should('match', sectionRegex.vat); + }); + + it('Should redirect to invoiceIn due-day when clicking on basic-data title link', () => { + cy.get(titlesLinks.dueDay).click(); + cy.location().should('match', sectionRegex.dueDay); + }); + + it('Should redirect to invoiceIn intrastat when clicking on basic-data title link', () => { + cy.get(titlesLinks.intrastat).click(); + cy.location().should('match', sectionRegex.intrastat); + }); + + it('Should redirect to invoiceIn vehicle when clicking on basic-data title link', () => { + cy.get(titlesLinks.vehicle).click(); + cy.location().should('match', sectionRegex.vehicle); + }); }); it('should booking and unbooking the invoice properly', () => { + cy.visit('/#/invoice-in/3/summary'); const checkbox = '[data-cy="vnLvIs booked"] > .q-checkbox'; cy.dataCy('invoiceInSummary_book').click(); cy.dataCy('VnConfirm_confirm').click(); cy.validateCheckbox(checkbox); }); - it('should open the supplier descriptor popup', () => { - cy.intercept('GET', /Suppliers\/\d+/).as('getSupplier'); - cy.dataCy('invoiceInSummary_supplier').then(($el) => { - const description = $el.text().trim(); - $el.click(); - cy.wait('@getSupplier').then(() => - cy.validateDescriptor({ description, popup: true }), - ); + describe('Supplier pop-ups', () => { + it('Should redirect to the supplier summary from the supplier descriptor pop-up', () => { + cy.checkRedirectionFromPopUp({ + selectorToClick: selectors.supplierLink, + steps: [selectors.descriptorGoToSummaryBtn], + expectedUrlRegex: supplierSummaryUrlRegex, + expectedTextSelector: selectors.supplierDescriptorTitle, + }); + }); + + it('Should redirect to the supplier summary from summary pop-up from the supplier descriptor pop-up', () => { + cy.checkRedirectionFromPopUp({ + selectorToClick: selectors.supplierLink, + steps: [ + selectors.descriptorOpenSummaryBtn, + selectors.summaryGoToSummaryBtn, + ], + expectedUrlRegex: supplierSummaryUrlRegex, + expectedTextSelector: selectors.supplierDescriptorTitle, + }); + }); + }); + + describe('Vehicle pop-ups', () => { + it('Should redirect to the vehicle summary from the vehicle descriptor pop-up', () => { + cy.checkRedirectionFromPopUp({ + selectorToClick: selectors.vehicleLink, + steps: [selectors.descriptorGoToSummaryBtn], + expectedUrlRegex: vehicleSummaryUrlRegex, + expectedTextSelector: selectors.vehicleDescriptorTitle, + }); + }); + + it('Should redirect to the vehicle summary from summary pop-up from the vehicle descriptor pop-up', () => { + cy.checkRedirectionFromPopUp({ + selectorToClick: selectors.vehicleLink, + steps: [ + selectors.descriptorOpenSummaryBtn, + selectors.summaryGoToSummaryBtn, + ], + expectedUrlRegex: vehicleSummaryUrlRegex, + expectedTextSelector: selectors.vehicleDescriptorTitle, + }); }); }); }); diff --git a/test/cypress/integration/invoiceIn/invoiceInVehicle.spec.js b/test/cypress/integration/invoiceIn/invoiceInVehicle.spec.js new file mode 100644 index 000000000..177d676e8 --- /dev/null +++ b/test/cypress/integration/invoiceIn/invoiceInVehicle.spec.js @@ -0,0 +1,57 @@ +describe('InvoiceInVehicle', () => { + const selectors = { + tableActionUnlink: 'tableAction-0', + firstVehicleLink: + 'tr:first-child > [data-col-field="vehicleFk"] > .no-padding > .link', + descriptorOpenSummaryBtn: '.q-menu .descriptor [data-cy="openSummaryBtn"]', + descriptorGoToSummaryBtn: '.q-menu .descriptor [data-cy="goToSummaryBtn"]', + summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]', + descriptorTitle: '[data-cy="vnDescriptor_title"]', + }; + const vehicleSummaryUrlRegex = /vehicle\/\d+\/summary/; + + beforeEach(() => { + cy.login('administrative'); + cy.visit(`/#/invoice-in/1/vehicle`); + }); + + it('should link vehicle to the invoice', () => { + const data = { + Vehicle: { val: '2222-IMK', type: 'select' }, + Amount: { val: 125 }, + }; + cy.addBtnClick(); + cy.fillInForm(data); + cy.dataCy('FormModelPopup_save').click(); + cy.checkNotification('Data created'); + }); + + it('should unlink vehicle to the invoice', () => { + cy.dataCy(selectors.tableActionUnlink).last().click(); + cy.clickConfirm(); + cy.checkNotification('Unlinked vehicle'); + }); + + describe('Vehicle pop-ups', () => { + it('Should redirect to the vehicle summary from the vehicle descriptor pop-up', () => { + cy.checkRedirectionFromPopUp({ + selectorToClick: selectors.firstVehicleLink, + steps: [selectors.descriptorGoToSummaryBtn], + expectedUrlRegex: vehicleSummaryUrlRegex, + expectedTextSelector: selectors.descriptorTitle, + }); + }); + + it('Should redirect to the vehicle summary from summary pop-up from the vehicle descriptor pop-up', () => { + cy.checkRedirectionFromPopUp({ + selectorToClick: selectors.firstVehicleLink, + steps: [ + selectors.descriptorOpenSummaryBtn, + selectors.summaryGoToSummaryBtn, + ], + expectedUrlRegex: vehicleSummaryUrlRegex, + expectedTextSelector: selectors.descriptorTitle, + }); + }); + }); +}); -- 2.40.1 From db2a0b2685d59530f8dc1d668805eac5c6019eed Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 23 Apr 2025 14:35:05 +0200 Subject: [PATCH 2/7] refactor: refs #8930 update vehicle labels to use global translations and clean up unused keys in locale files --- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 34 +++++++++---------- src/pages/InvoiceIn/Card/InvoiceInVehicle.vue | 2 +- src/pages/InvoiceIn/locale/en.yml | 12 ------- src/pages/InvoiceIn/locale/es.yml | 13 +------ 4 files changed, 19 insertions(+), 42 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index 4032c022f..e1a399f93 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -12,6 +12,7 @@ import InvoiceIntoBook from '../InvoiceInToBook.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import InvoiceInDescriptorMenu from './InvoiceInDescriptorMenu.vue'; import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue'; +import { getTotal } from 'src/composables/getTotal'; const props = defineProps({ id: { type: [Number, String], default: 0 } }); const { t } = useI18n(); @@ -165,7 +166,7 @@ const intrastatColumns = ref([ const vehicleColumns = ref([ { name: 'numberPlate', - label: 'invoiceIn.summary.vehicle', + label: 'globals.vehicle', field: (row) => row.vehicleInvoiceIn?.numberPlate, format: (value) => value, align: 'left', @@ -203,8 +204,6 @@ const getTotalTax = (tax) => tax.reduce((acc, cur) => acc + taxRate(cur.taxableBase, cur.taxTypeSage?.rate), 0); const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; -const getVehicleTotalAmount = (vehicles) => - vehicles.reduce((acc, cur) => acc + cur.amount, 0); - + @@ -440,10 +440,10 @@ const getVehicleTotalAmount = (vehicles) => - + - + @@ -517,7 +517,7 @@ const getVehicleTotalAmount = (vehicles) => {{ toCurrency( - getVehicleTotalAmount(entity.vehicleInvoiceIn), + getTotal(entity.vehicleInvoiceIn, 'amount'), ) }} @@ -538,15 +538,15 @@ const getVehicleTotalAmount = (vehicles) => @media (min-width: $breakpoint-md) { .summaryBody { - .vat { + .col-65 { flex: 65%; } - .due-day { + .col-30 { flex: 30%; } - .vat, - .due-day { + .col-65, + .col-30 { .q-table th { padding-right: 0; } diff --git a/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue index 4853b166c..a02673459 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue @@ -24,7 +24,7 @@ const columns = computed(() => [ { align: 'left', name: 'vehicleFk', - label: t('invoiceIn.summary.vehicle'), + label: t('globals.vehicle'), component: 'select', attrs: { url: 'vehicles', diff --git a/src/pages/InvoiceIn/locale/en.yml b/src/pages/InvoiceIn/locale/en.yml index f809d8ff2..0a320a9df 100644 --- a/src/pages/InvoiceIn/locale/en.yml +++ b/src/pages/InvoiceIn/locale/en.yml @@ -34,14 +34,6 @@ invoiceIn: originalInvoice: Original invoice entry: Entry emailEmpty: The email can't be empty - card: - client: Client - company: Company - customerCard: Customer card - ticketList: Ticket List - vat: Vat - dueDay: Due day - intrastat: Intrastat summary: currency: Currency issued: Expedition date @@ -63,11 +55,7 @@ invoiceIn: net: Net stems: Stems country: Country - vehicle: Vehicle params: - invoiceInFk: Invoice nº - vehicleFk: Vehicle - amount: Amount search: Id or supplier name correctedFk: Corrected isBooked: Is booked diff --git a/src/pages/InvoiceIn/locale/es.yml b/src/pages/InvoiceIn/locale/es.yml index 7f7de6e6d..34ad62986 100644 --- a/src/pages/InvoiceIn/locale/es.yml +++ b/src/pages/InvoiceIn/locale/es.yml @@ -33,13 +33,6 @@ invoiceIn: originalInvoice: Factura origen entry: Entrada emailEmpty: El email no puede estar vacío - card: - client: Cliente - company: Empresa - customerCard: Ficha del cliente - ticketList: Listado de tickets - vat: Iva - dueDay: Fecha de vencimiento summary: currency: Divisa docNumber: Número documento @@ -52,7 +45,7 @@ invoiceIn: expense: Gasto taxableBase: Base imp. rate: Tasa - sageTransaction: Sage transación + sageTransaction: Sage transacción dueDay: Fecha bank: Caja foreignValue: Divisa @@ -61,11 +54,7 @@ invoiceIn: net: Neto stems: Tallos country: País - vehicle: Vehículo params: - invoiceInFk: Factura nº - vehicleFk: Vehículo - amount: Importe search: Id o nombre proveedor correctedFk: Rectificada isBooked: Contabilizada -- 2.40.1 From 4287efa7006168970399c35a3ec1b72fc84f8346 Mon Sep 17 00:00:00 2001 From: jtubau Date: Thu, 24 Apr 2025 07:13:24 +0200 Subject: [PATCH 3/7] refactor: refs #8930 update class names for readability --- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index e1a399f93..e3fa78a8d 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -338,7 +338,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; - + `#/invoice-in/${entityId.value}/${param}`; - + `#/invoice-in/${entityId.value}/${param}`; - + `#/invoice-in/${entityId.value}/${param}`; - + `#/invoice-in/${entityId.value}/${param}`; @media (min-width: $breakpoint-md) { .summaryBody { - .col-65 { + .col-extend { flex: 65%; } - .col-30 { + .col-shrink { flex: 30%; } - .col-65, - .col-30 { + .col-extend, + .col-shrink { .q-table th { padding-right: 0; } -- 2.40.1 From ab5d85f392bae1724a0a75c1c619ce573d9ca7bb Mon Sep 17 00:00:00 2001 From: jtubau Date: Fri, 25 Apr 2025 11:11:12 +0200 Subject: [PATCH 4/7] refactor: refs #8930 update title link redirection tests for clarity and consistency --- .../integration/invoiceIn/invoiceInSummary.spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js b/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js index fede6091f..ed6e818ef 100644 --- a/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js @@ -76,22 +76,22 @@ describe('InvoiceInSummary', () => { cy.location().should('match', sectionRegex.basicData); }); - it('Should redirect to invoiceIn vat when clicking on basic-data title link', () => { + it('Should redirect to invoiceIn vat when clicking on vat title link', () => { cy.get(titlesLinks.vat).click(); cy.location().should('match', sectionRegex.vat); }); - it('Should redirect to invoiceIn due-day when clicking on basic-data title link', () => { + it('Should redirect to invoiceIn due-day when clicking on due-day title link', () => { cy.get(titlesLinks.dueDay).click(); cy.location().should('match', sectionRegex.dueDay); }); - it('Should redirect to invoiceIn intrastat when clicking on basic-data title link', () => { + it('Should redirect to invoiceIn intrastat when clicking on intrastat title link', () => { cy.get(titlesLinks.intrastat).click(); cy.location().should('match', sectionRegex.intrastat); }); - it('Should redirect to invoiceIn vehicle when clicking on basic-data title link', () => { + it('Should redirect to invoiceIn vehicle when clicking on vehicle title link', () => { cy.get(titlesLinks.vehicle).click(); cy.location().should('match', sectionRegex.vehicle); }); @@ -101,7 +101,7 @@ describe('InvoiceInSummary', () => { cy.visit('/#/invoice-in/3/summary'); const checkbox = '[data-cy="vnLvIs booked"] > .q-checkbox'; cy.dataCy('invoiceInSummary_book').click(); - cy.dataCy('VnConfirm_confirm').click(); + cy.clickConfirm(); cy.validateCheckbox(checkbox); }); -- 2.40.1 From b2584c021b945fcba63f390c2d2ff644900bd9ae Mon Sep 17 00:00:00 2001 From: jtubau Date: Fri, 25 Apr 2025 13:48:38 +0200 Subject: [PATCH 5/7] test: refs #8930 update invoice booking flow to use confirmation dialog --- test/cypress/integration/invoiceIn/invoiceInSummary.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js b/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js index ed6e818ef..47569d7de 100644 --- a/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInSummary.spec.js @@ -98,11 +98,12 @@ describe('InvoiceInSummary', () => { }); it('should booking and unbooking the invoice properly', () => { - cy.visit('/#/invoice-in/3/summary'); const checkbox = '[data-cy="vnLvIs booked"] > .q-checkbox'; cy.dataCy('invoiceInSummary_book').click(); - cy.clickConfirm(); + cy.dataCy('VnConfirm_confirm').click(); cy.validateCheckbox(checkbox); + cy.selectDescriptorOption(); + cy.dataCy('VnConfirm_confirm').click(); }); describe('Supplier pop-ups', () => { -- 2.40.1 From eb8e0d1334abe3befac04d517bbfc5e157049e5d Mon Sep 17 00:00:00 2001 From: jtubau Date: Tue, 29 Apr 2025 09:43:29 +0200 Subject: [PATCH 6/7] refactor: refs #8930 update amount column configuration --- src/pages/InvoiceIn/Card/InvoiceInVehicle.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue index a02673459..217511b4e 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue @@ -44,6 +44,8 @@ const columns = computed(() => [ align: 'left', name: 'amount', label: t('invoiceIn.list.amount'), + component: 'number', + create: true, format: (row) => toCurrency(row.amount), cardVisible: true, }, @@ -101,12 +103,12 @@ async function unassignVehicle(id) { - -- 2.40.1 From 0c04c0602445a68ad1d63d42d8c40d2c24b23268 Mon Sep 17 00:00:00 2001 From: jtubau Date: Tue, 29 Apr 2025 09:43:43 +0200 Subject: [PATCH 7/7] refactor: refs #8930 remove unused template for create dialog in InvoiceInVehicle component --- src/pages/InvoiceIn/Card/InvoiceInVehicle.vue | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue index 217511b4e..520fc95a6 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVehicle.vue @@ -103,12 +103,5 @@ async function unassignVehicle(id) { - -- 2.40.1