From ee1fcf75fbf630bcade551f739215d8931071955 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 26 Mar 2025 12:57:02 +0100 Subject: [PATCH 01/40] refactor: refs #7638 enhance CmrList component with additional fields and improved formatting --- src/pages/Route/Cmr/CmrList.vue | 265 +++++++++++++++++++++++++++----- 1 file changed, 230 insertions(+), 35 deletions(-) diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue index 170f73bc0..3c331ec46 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/Cmr/CmrList.vue @@ -6,13 +6,18 @@ import { useRoute } from 'vue-router'; import { useSession } from 'src/composables/useSession'; import { toDateHourMin } from 'filters/index'; import { useStateStore } from 'src/stores/useStateStore'; +import { dashIfEmpty } from 'src/filters'; +import AgencyDescriptorProxy from '../Agency/Card/AgencyDescriptorProxy.vue'; +import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import RouteDescriptorProxy from '../Card/RouteDescriptorProxy.vue'; +import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue'; -import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnTable from 'components/VnTable/VnTable.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; +import VnInput from 'src/components/common/VnInput.vue'; const route = useRoute(); const { t } = useI18n(); @@ -30,39 +35,117 @@ const userParams = { const columns = computed(() => [ { - align: 'left', + align: 'right', name: 'cmrFk', - label: t('route.cmr.params.cmrFk'), + label: t('cmr.params.cmrFk'), chip: { condition: () => true, }, isId: true, }, { - align: 'center', - name: 'hasCmrDms', - label: t('route.cmr.params.hasCmrDms'), - component: 'checkbox', - cardVisible: true, - }, - { - align: 'left', - label: t('route.cmr.params.ticketFk'), + align: 'right', + label: t('cmr.params.ticketFk'), name: 'ticketFk', }, { - align: 'left', - label: t('route.cmr.params.routeFk'), + align: 'right', + label: t('cmr.params.routeFk'), name: 'routeFk', }, { - align: 'left', - label: t('route.cmr.params.clientFk'), + label: t('cmr.params.client'), name: 'clientFk', + component: 'select', + attrs: { + url: 'Clients', + fields: ['id', 'name'], + }, + columnFilter: { + name: 'clientFk', + attrs: { + url: 'Clients', + fields: ['id', 'name'], + }, + }, }, { - align: 'right', - label: t('route.cmr.params.countryFk'), + label: t('cmr.params.agency'), + name: 'agencyModeFk', + component: 'select', + attrs: { + url: 'Agencies', + fields: ['id', 'name'], + }, + columnFilter: { + name: 'agencyModeFk', + attrs: { + url: 'Agencies', + fields: ['id', 'name'], + }, + }, + format: ({ agencyName }) => agencyName, + }, + { + label: t('cmr.params.supplier'), + name: 'supplierFk', + component: 'select', + attrs: { + url: 'suppliers', + fields: ['id', 'name'], + }, + columnFilter: { + name: 'supplierFk', + attrs: { + url: 'suppliers', + fields: ['id', 'name'], + }, + }, + }, + { + label: t('cmr.params.sender'), + name: 'addressFromFk', + component: 'select', + attrs: { + url: 'Addresses', + fields: ['id', 'nickname'], + optionValue: 'id', + optionLabel: 'nickname', + }, + columnFilter: { + name: 'addressFromFk', + attrs: { + url: 'Addresses', + fields: ['id', 'nickname'], + optionValue: 'id', + optionLabel: 'nickname', + }, + }, + format: ({ origin }) => origin, + }, + { + label: t('cmr.params.destination'), + name: 'addressToFk', + component: 'select', + attrs: { + url: 'addresses', + fields: ['id', 'nickname'], + optionValue: 'id', + optionLabel: 'nickname', + }, + columnFilter: { + name: 'addressToFk', + attrs: { + url: 'addresses', + fields: ['id', 'nickname'], + optionValue: 'id', + optionLabel: 'nickname', + }, + }, + format: ({ destination }) => destination, + }, + { + label: t('cmr.params.country'), name: 'countryFk', component: 'select', attrs: { @@ -79,16 +162,61 @@ const columns = computed(() => [ format: ({ countryName }) => countryName, }, { - align: 'right', - label: t('route.cmr.params.shipped'), - name: 'shipped', - cardVisible: true, + label: t('cmr.params.created'), + name: 'created', component: 'date', - format: ({ shipped }) => toDateHourMin(shipped), + format: ({ created }) => dashIfEmpty(toDateHourMin(created)), }, { - align: 'right', - label: t('route.cmr.params.warehouseFk'), + label: t('cmr.params.shipped'), + name: 'shipped', + component: 'date', + format: ({ shipped }) => dashIfEmpty(toDateHourMin(shipped)), + }, + { + label: t('cmr.params.etd'), + name: 'ead', + component: 'date', + format: ({ ead }) => dashIfEmpty(toDateHourMin(ead)), + toolTip: t('cmr.params.etdTooltip'), + }, + { + label: t('globals.landed'), + name: 'landed', + component: 'date', + format: ({ landed }) => dashIfEmpty(toDateHourMin(landed)), + }, + { + align: 'left', + label: t('cmr.params.packageList'), + name: 'packagesList', + columnFilter: false, + }, + { + align: 'left', + label: t('cmr.params.observation'), + name: 'observation', + columnFilter: false, + }, + { + align: 'left', + label: t('cmr.params.senderInstructions'), + name: 'senderInstruccions', + columnFilter: false, + }, + { + align: 'left', + label: t('cmr.params.paymentInstructions'), + name: 'paymentInstruccions', + columnFilter: false, + }, + { + align: 'left', + label: t('cmr.params.vehiclePlate'), + name: 'truckPlate', + }, + { + label: t('cmr.params.warehouse'), name: 'warehouseFk', component: 'select', attrs: { @@ -96,7 +224,6 @@ const columns = computed(() => [ fields: ['id', 'name'], }, columnFilter: { - inWhere: true, name: 'warehouseFk', attrs: { url: 'warehouses', @@ -105,12 +232,23 @@ const columns = computed(() => [ }, format: ({ warehouseName }) => warehouseName, }, + { + align: 'left', + name: 'specialAgreements', + label: t('cmr.params.specialAgreements'), + columnFilter: false, + }, + { + name: 'hasCmrDms', + label: t('cmr.params.hasCmrDms'), + component: 'checkbox', + }, { align: 'center', name: 'tableActions', actions: [ { - title: t('route.cmr.params.viewCmr'), + title: t('cmr.params.viewCmr'), icon: 'visibility', isPrimary: true, action: (row) => window.open(getCmrUrl(row?.cmrFk), '_blank'), @@ -151,11 +289,7 @@ function downloadPdfs() { } + + + + + + + + From f2e4fff69aaaddffcebe788e7c7a1b93b0f05b7a Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 26 Mar 2025 12:57:14 +0100 Subject: [PATCH 02/40] refactor: refs #7638 add localization support for Cmr and Route components in English and Spanish --- src/pages/Route/Cmr/locale/en.yml | 31 +++++++++++++++++++++++++++++++ src/pages/Route/Cmr/locale/es.yml | 31 +++++++++++++++++++++++++++++++ src/pages/Route/locale/en.yml | 23 +++++------------------ src/pages/Route/locale/es.yml | 7 ++++++- 4 files changed, 73 insertions(+), 19 deletions(-) create mode 100644 src/pages/Route/Cmr/locale/en.yml create mode 100644 src/pages/Route/Cmr/locale/es.yml diff --git a/src/pages/Route/Cmr/locale/en.yml b/src/pages/Route/Cmr/locale/en.yml new file mode 100644 index 000000000..49b9895f8 --- /dev/null +++ b/src/pages/Route/Cmr/locale/en.yml @@ -0,0 +1,31 @@ +cmr: + search: Search Cmr + searchInfo: You can search Cmr by Id + params: + agency: Agency + client: Client + cmrFk: CMR id + country: Country + created: Created + destination: Destination + downloadCmrs: Download CMRs + etd: ETD + etdTooltip: Estimated Time Delivery + hasCmrDms: Attached in gestdoc + observation: Observation + packageList: Package List + paymentInstructions: Payment instructions + routeFk: Route id + results: results + search: General search + sender: Sender + senderInstructions: Sender instructions + shipped: Shipped + specialAgreements: Special agreements + supplier: Carrier + ticketFk: Ticket id + vehiclePlate: Vehicle plate + viewCmr: View CMR + warehouse: Warehouse + 'true': 'Yes' + 'false': 'No' \ No newline at end of file diff --git a/src/pages/Route/Cmr/locale/es.yml b/src/pages/Route/Cmr/locale/es.yml new file mode 100644 index 000000000..b419a238b --- /dev/null +++ b/src/pages/Route/Cmr/locale/es.yml @@ -0,0 +1,31 @@ +cmr: + search: Buscar Cmr + searchInfo: Puedes buscar cmr por id + params: + agency: Agencia + client: Cliente + cmrFk: Id cmr + country: País + created: Creado + destination: Destinatario + downloadCmrs: Descargar CMRs + etd: ETD + etdTooltip: Fecha estimada de entrega + hasCmrDms: Adjunto en gestdoc + observation: Observaciones + packageList: Listado embalajes + paymentInstructions: Instrucciones de pago + routeFk: Id ruta + results: Resultados + search: Busqueda general + sender: Remitente + senderInstructions: Instrucciones de envío + shipped: F. envío + specialAgreements: Acuerdos especiales + supplier: Transportista + ticketFk: Id ticket + vehiclePlate: Matrícula + viewCmr: Ver CMR + warehouse: Almacén + 'true': 'Si' + 'false': 'No' \ No newline at end of file diff --git a/src/pages/Route/locale/en.yml b/src/pages/Route/locale/en.yml index 283b61855..206100b6b 100644 --- a/src/pages/Route/locale/en.yml +++ b/src/pages/Route/locale/en.yml @@ -51,6 +51,11 @@ route: agencyModeName: Agency route isOwn: Own isAnyVolumeallowed: Any volume allowed + created: Created + addressFromFk: Sender + addressToFk: Destination + landed: Landed + ead: EAD Worker: Worker Agency: Agency Vehicle: Vehicle @@ -70,21 +75,3 @@ route: searchInfo: You can search by route reference dated: Dated preview: Preview - cmr: - search: Search Cmr - searchInfo: You can search Cmr by Id - params: - results: results - cmrFk: CMR id - hasCmrDms: Attached in gestdoc - 'true': 'Yes' - 'false': 'No' - ticketFk: Ticketd id - routeFk: Route id - countryFk: Country - clientFk: Client id - warehouseFk: Warehouse - shipped: Preparation date - viewCmr: View CMR - downloadCmrs: Download CMRs - search: General search diff --git a/src/pages/Route/locale/es.yml b/src/pages/Route/locale/es.yml index 2785ded31..fe3ba08be 100644 --- a/src/pages/Route/locale/es.yml +++ b/src/pages/Route/locale/es.yml @@ -47,11 +47,16 @@ route: routeFk: Id ruta clientFk: Id cliente countryFk: Pais - shipped: Fecha preparación + shipped: F. envío agencyModeName: Agencia Ruta agencyAgreement: Agencia Acuerdo isOwn: Propio isAnyVolumeAllowed: Cualquier volumen + created: Creado + addressFromFk: Remitente + addressToFk: Destinatario + landed: F. entrega + ead: ETD Worker: Trabajador Agency: Agencia Vehicle: Vehículo From af612f937936fa975a8ed414158f2ec53f0ccbab Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 26 Mar 2025 13:28:18 +0100 Subject: [PATCH 03/40] test: refs #7638 add route, agency, and carrier pop-up redirection tests in CmrList component --- .../integration/route/cmr/cmrList.spec.js | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/test/cypress/integration/route/cmr/cmrList.spec.js b/test/cypress/integration/route/cmr/cmrList.spec.js index d33508e3a..452a696bd 100644 --- a/test/cypress/integration/route/cmr/cmrList.spec.js +++ b/test/cypress/integration/route/cmr/cmrList.spec.js @@ -5,6 +5,9 @@ describe('Cmr list', () => { const selectors = { ticket: getLinkSelector('ticketFk'), client: getLinkSelector('clientFk'), + route: getLinkSelector('routeFk'), + agency: getLinkSelector('agencyModeFk'), + carrier: getLinkSelector('supplierFk'), lastRowSelectCheckBox: '.q-virtual-scroll__content > tr:last-child > :nth-child(1) > .q-checkbox', downloadBtn: '#subToolbar > .q-btn', @@ -21,6 +24,10 @@ describe('Cmr list', () => { const data = { ticket: '1', client: 'Bruce Wayne', + route: 'first route', + routeId: '1', + agency: 'inhouse pickup', + carrier: 'PLANTS SL', }; beforeEach(() => { @@ -69,6 +76,26 @@ describe('Cmr list', () => { }); }); + describe('Route pop-ups', () => { + it('Should redirect to the route summary from the route descriptor pop-up', () => { + cy.get(selectors.route).should('be.visible').click(); + cy.containContent(selectors.descriptorId, data.routeId); + cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click(); + cy.url().should('include', '/route/1/summary'); + cy.containContent(selectors.summaryTitle, data.route); + }); + + it('Should redirect to the route summary from summary pop-up from the route descriptor pop-up', () => { + cy.get(selectors.route).should('be.visible').click(); + cy.containContent(selectors.descriptorId, data.routeId); + cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click(); + cy.containContent(selectors.summaryTitle, data.route); + cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click(); + cy.url().should('include', '/route/1/summary'); + cy.containContent(selectors.summaryTitle, data.route); + }); + }); + describe('Client pop-ups', () => { it('Should redirect to the client summary from the client descriptor pop-up', () => { cy.get(selectors.client).should('be.visible').click(); @@ -88,4 +115,44 @@ describe('Cmr list', () => { cy.containContent(selectors.summaryTitle, data.client); }); }); + + describe('Agency pop-ups', () => { + it('Should redirect to the agency summary from the agency descriptor pop-up', () => { + cy.get(selectors.agency).should('be.visible').click(); + cy.containContent(selectors.descriptorTitle, data.agency); + cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click(); + cy.url().should('include', '/agency/1/summary'); + cy.containContent(selectors.summaryTitle, data.agency); + }); + + it('Should redirect to the agency summary from summary pop-up from the agency descriptor pop-up', () => { + cy.get(selectors.agency).should('be.visible').click(); + cy.containContent(selectors.descriptorTitle, data.agency); + cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click(); + cy.containContent(selectors.summaryTitle, data.agency); + cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click(); + cy.url().should('include', '/agency/1/summary'); + cy.containContent(selectors.summaryTitle, data.agency); + }); + }); + + describe('Carrier pop-ups', () => { + it('Should redirect to the supplier summary from the supplier descriptor pop-up', () => { + cy.get(selectors.carrier).should('be.visible').click(); + cy.containContent(selectors.descriptorTitle, data.carrier); + cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click(); + cy.url().should('include', '/supplier/1/summary'); + cy.containContent(selectors.summaryTitle, data.carrier); + }); + + it('Should redirect to the supplier summary from summary pop-up from the supplier descriptor pop-up', () => { + cy.get(selectors.carrier).should('be.visible').click(); + cy.containContent(selectors.descriptorTitle, data.carrier); + cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click(); + cy.containContent(selectors.summaryTitle, data.carrier); + cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click(); + cy.url().should('include', '/supplier/1/summary'); + cy.containContent(selectors.summaryTitle, data.carrier); + }); + }); }); From ac19803fcd96410bb955d4b12ed9cb3ce1852491 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 26 Mar 2025 13:28:51 +0100 Subject: [PATCH 04/40] refactor: refs #7638 add cmrFk order --- src/pages/Route/Cmr/CmrList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue index 3c331ec46..98e1bda02 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/Cmr/CmrList.vue @@ -308,7 +308,7 @@ function downloadPdfs() { :data-key url="Cmrs/filter" :columns="columns" - :order="['shipped DESC']" + :order="['shipped DESC', 'cmrFk ASC']" :user-params="userParams" default-mode="table" v-model:selected="selectedRows" From 84dbf9691e258f89199bcc8851d9b405666845cd Mon Sep 17 00:00:00 2001 From: benjaminedc Date: Thu, 3 Apr 2025 12:25:11 +0200 Subject: [PATCH 05/40] feat: refs #8828 add warehouse filtering for tickets and travels --- src/components/FilterTravelForm.vue | 10 ++++++++++ src/components/RegularizeStockForm.vue | 5 +++++ src/pages/Entry/EntryFilter.vue | 10 ++++++++++ .../Card/BasicData/TicketBasicDataForm.vue | 5 +++++ .../Ticket/Negative/TicketLackFilter.vue | 11 ++++++++++- src/pages/Ticket/TicketAdvanceFilter.vue | 5 +++++ src/pages/Ticket/TicketCreate.vue | 17 ++++++++++------- src/pages/Ticket/TicketCreateDialog.vue | 19 +++++++++++-------- src/pages/Ticket/TicketFilter.vue | 11 ++++++++++- src/pages/Ticket/TicketFutureFilter.vue | 5 +++++ src/pages/Ticket/TicketList.vue | 11 ++++++++++- src/pages/Ticket/TicketWeekly.vue | 3 +++ src/pages/Ticket/locale/en.yml | 1 + src/pages/Travel/Card/TravelBasicData.vue | 12 ++++++++++-- src/pages/Travel/ExtraCommunityFilter.vue | 8 ++++++-- src/pages/Travel/TravelCreate.vue | 10 ++++++++++ src/pages/Travel/TravelFilter.vue | 10 ++++++++++ src/pages/Travel/TravelList.vue | 2 ++ 18 files changed, 133 insertions(+), 22 deletions(-) diff --git a/src/components/FilterTravelForm.vue b/src/components/FilterTravelForm.vue index 4aad327b2..8655ad8ad 100644 --- a/src/components/FilterTravelForm.vue +++ b/src/components/FilterTravelForm.vue @@ -156,6 +156,11 @@ const selectTravel = ({ id }) => { option-label="name" option-value="id" v-model="travelFilterParams.warehouseOutFk" + :where="{ + isOrigin: { + neq: 0, + }, + }" /> { option-label="name" option-value="id" v-model="travelFilterParams.warehouseInFk" + :where="{ + isDestiny: { + neq: 0, + }, + }" /> { url="Warehouses" @on-fetch="(data) => (warehousesOptions = data)" auto-load + :where="{ + isInventory: { + neq: 0, + }, + }" /> {