diff --git a/CHANGELOG.md b/CHANGELOG.md index 10b7c73f7..dd75a00a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,187 @@ +# Version 25.10 - 2025-03-11 + +### Added 🆕 + +- chore: refs #6695 empty commit by:alexm +- chore: refs #6695 get docker compose version by:alexm +- chore: refs #6695 try use docker compose by:alexm +- feat: add --browser chromium by:Javier Segarra +- feat: docker pull back image by:alexm +- feat(jenkinsE2E): refs #6695 new image by:alexm +- feat(jenkinsE2E): refs #6695 try fix db by:alexm +- feat(jenkinsE2E): refs #6695 try new sintax by:alexm +- feat(Jenkinsfile): refs #8714 add CHANGE_TARGET environment variable logging (origin/8714-devToTest, 8714-devToTest) by:alexm +- feat: refs #6695 add additional test directories for Cypress integration tests in Jenkinsfile by:alexm +- feat: refs #6695 add cypress-cache volume to docker-compose.e2e.yml by:alexm +- feat: refs #6695 add Dockerfile for Cypress setup and update Jenkinsfile for installation steps by:alexm +- feat: refs #6695 add setup and e2e testing by:alexm +- feat: refs #6695 better stages for e2e by:alexm +- feat: refs #6695 better stages for e2e rollback by:alexm +- feat: refs #6695 install Cypress during Jenkins pipeline setup by:alexm +- feat: refs #6695 jenkins run e2e by:alexm +- feat: refs #6695 jenkins run e2e front deteach by:alexm +- feat: refs #6695 jenkins run e2e rebuild by:alexm +- feat: refs #6695 jenkins run e2e remove ports by:alexm +- feat: refs #6695 jenkins run e2e try down and rm by:alexm +- feat: refs #6695 jenkins run e2e try fix db by:alexm +- feat: refs #6695 jenkins run e2e whitout rebuild by:alexm +- feat: refs #6695 pull salix-back image and use by:alexm +- feat: refs #6695 run e2e in docker by:alexm +- feat: refs #6695 run front by:alexm +- feat: refs #6695 run front quasar build by:alexm +- feat: refs #6695 run parallel e2e in local by:alexm +- feat: refs #6695 update cypress cache path command in Jenkinsfile by:alexm +- feat: refs #6695 update cypress-cache volume path in docker-compose.e2e.yml by:alexm +- feat: refs #6695 update cypress command in Jenkinsfile and docker-compose.e2e.yml by:alexm +- feat: refs #6695 update Docker configurations and Cypress settings for improved local development (origin/6695-docker_push_2, 6695-docker_push_2) by:alexm +- feat: refs #6695 when failure, clean by:alexm +- feat: refs #7937 add import claim button to ClaimAction component by:jgallego +- feat: refs #7937 add shelving selection to claim actions with data fetching by:jgallego +- feat: refs #8348 Added grouping by:guillermo +- feat: refs #8402 added lost filters from Salix by:Jon +- feat: refs #8484 add addressId to createForm in CustomerDescriptor by:jorgep +- feat: refs #8484 overwrite Cypress visit command to ensure main element exists by:jorgep +- feat: refs #8555 added new filter field and translations by:Jon +- feat: refs #8593 added summary button & modified e2e tests by:provira +- feat: refs #8593 changed parking to VnTable and modified e2e tests by:provira +- feat: refs #8599 added new test and translations by:Jon +- feat: refs #8599 modified tests to be more complete and added new ones by:Jon +- feat: refs #8697 enable data-cy attribute for VnTable, update test cases to remove skips and adjust selectors by:pablone +- feat: rename test:unit by test:front by:Javier Segarra +- feat: try run salix back by:alexm +- fix: style w-80 by:Javier Segarra +- Merge pull request 'fix: style' (!1425) from warmfix_vntable_card_style into test by:Javier Segarra + +### Changed 📦 + +- ci: refs #6695 Docker & Jenkinsfile fixes/refactor by:Juan Ferrer Toribio +- ci: refs #6695 refactor Cypress setup in Jenkinsfile and replace local docker-compose with new configuration by:alexm +- perf: refs #6695 only necessary by:alexm +- refactor: adjust translation to standardize it by:Jon +- refactor: refs #6695 comment out vnComponent tests in Jenkinsfile by:alexm +- refactor: refs #6695 improve group size calculation for parallel test execution in Jenkinsfile by:alexm +- refactor: refs #6695 improve parallel test execution logic in Jenkinsfile by:alexm +- refactor: refs #6695 simplify Docker cleanup commands in Jenkinsfile by:alexm +- refactor: refs #6695 update Docker setup for Cypress and remove obsolete files by:alexm +- refactor: refs #6695 update E2E test execution to support parallel groups and improve by:alexm +- refactor: refs #6695 update Jenkinsfile and Dockerfile to use 'developer' by:alexm +- refactor: refs #6695 update Jenkinsfile to run E2E tests in parallel and simplify docker-compose command by:alexm +- refactor: refs #6897 clean up Cypress configuration and improve entry list filtering (origin/6897-fixEntryE2e) by:pablone +- refactor: refs #7414 update VnLog component to change display order value changes on update action by:jtubau +- refactor: refs #7937 align columns to the right and add shelvingCode to ClaimSummaryAction by:jgallego +- refactor: refs #8484 add data-cy attribute for claim photo image and update test to use it by:jorgep +- refactor: refs #8484 clean up test files by removing commented issue references and updating test cases by:jorgep +- refactor: refs #8484 enhance login command with session management and clean up unused commands by:jtubau +- refactor: refs #8484 improve search input behavior and enhance visit command with DOM content load by:jtubau +- refactor: refs #8484 improve selectOption command with retry logic for visibility checks by:jtubau +- refactor: refs #8484 remove comment in wagonCreate.spec.js by:jtubau +- refactor: refs #8484 remove redundant visit command overwrite by:jorgep +- refactor: refs #8484 remove unnecessary domContentLoad calls from client tests by:jorgep +- refactor: refs #8484 remove unnecessary intercepts and waits in ticket and zone tests by:jorgep +- refactor: refs #8484 simplify image dialog test by using aliases for elements by:jorgep +- refactor: refs #8484 streamline assertions in ClaimNotes test by:jorgep +- refactor: refs #8484 streamline login command and remove commented code by:jorgep +- refactor: refs #8484 update specPattern to include all spec files and remove data-cy attribute by:jorgep +- refactor: refs #8594 update vehicle summary tests to use expected variable for consistency by:jtubau +- refactor: refs #8599 corrected it name by:Jon +- refactor: refs #8599 invoice out list e2e by:Jon +- refactor: refs #8599 requested changes by:Jon +- refactor: refs #8606 modified table height and deleted void file by:Jon +- refactor: refs #8606 modified table width and order by:Jon +- refactor: refs #8606 modified upcoming deliveries view by:Jon +- refactor: refs #8606 translations by:Jon +- refactor: refs #8618 simplify selectors and improve test readability in routeExtendedList.spec.js by:jtubau +- refactor: refs #8620 update RouteAutonomous to notify on data save and change invoice reference display by:jtubau +- refactor: remove default browser setting from Cypress configuration by:alexm +- refactor: remove unused variables by:alexm +- refactor: skip claimNotes by:alexm +- refactor: update labels and conditions in Claim components by:jgallego +- refactor: use constant for account input selector in VnAccountNumber tests by:alexm + +### Fixed 🛠️ + +- build: refs #6695 cypress-setup fix volume by:alexm +- build: refs #6695 cypress-setup fix volume (origin/6695-docker_push, 6695-docker_push) by:alexm +- ci: refs #6695 cypress reporter fix by:Juan Ferrer Toribio +- ci: refs #6695 Docker & Jenkinsfile fixes/refactor by:Juan Ferrer Toribio +- ci: refs #6695 JUnit report fixes by:Juan Ferrer Toribio +- ci: refs #6695 vitest junit file fix by:Juan Ferrer Toribio +- feat(jenkinsE2E): refs #6695 try fix db by:alexm +- feat: refs #6695 jenkins run e2e try fix db by:alexm +- fix: add data-cy attribute to card button for improved testing by:jtubau +- fix: added lost code by:Jon +- fix: add --init flag to Cypress Docker container for improved stability by:alexm +- fix: add mapper before Save by:Javier Segarra +- fix: cy.domContentLoad(); not exist by:alexm +- fix: elements position by:Javier Segarra +- fix: fixed select not filtering when typing by:Jon +- fix: fixed wagonTypeCreate test (origin/wagonTypeTestFix) by:PAU ROVIRA ROSALENY +- fix: fix sctions by:carlossa +- fix(Jenkinsfile): enhance Docker registry credentials handling with dynamic URL (origin/warmFix_use_withDockerRegistry, warmFix_use_withDockerRegistry) by:alexm +- fix(Jenkinsfile): update Docker registry credentials handling in E2E stage by:alexm +- fix: junit report by:alexm +- fix: merge revert by:alexm +- fix: merge test to dev by:alexm +- fix: prevent 'cypress run' error to show junit by:alexm +- fix: refs #6695 add --volumes flag to docker-compose down command by:alexm +- fix: refs #6695 checkErrors(folderName) by:alexm +- fix: refs #6695 clientBasicData by:alexm +- fix: refs #6695 dockerFile by:alexm +- fix: refs #6695 e2e.sh by:alexm +- fix: refs #6695 e2e stockBought by:alexm +- fix: refs #6695 fix e2e's by:alexm +- fix: refs #6695 storage by:alexm +- fix: refs #6695 try by:alexm +- fix: refs #6695 try parallel by:alexm +- fix: refs #6695 update Cypress cache handling and increase wait timeout for elements by:alexm +- fix: refs #6695 update Cypress configuration and Docker setup for improved testing by:alexm +- fix: refs #6695 update E2E stages to run tests in parallel for specific folders by:alexm +- fix: refs #6695 update remove Cypress installation by:alexm +- fix: refs #6695 zoneWarehouse est by:alexm +- fix: refs #6943 e2e clientList, formModel by:carlossa +- fix: refs #6943 formModel workerDepartment by:carlossa +- fix: refs #7323 e2e (origin/7323-fixe2e) by:carlossa +- fix: refs #7323 notification manager by:carlossa +- fix: refs #7414 updated default value rendering for non-update scenarios by:jtubau +- fix: refs #7414 update VnLog.vue to correctly display log actions and values by:jtubau +- fix: refs #7937 update claimId in ClaimAction test to reflect correct value (origin/7937-claimAgile) by:jgallego +- fix: refs #8484 ensure document is fully loaded before visiting pages in tests by:jorgep +- fix: refs #8484 fixed some tests to enable previously skipped cases and enhance functionality by:jtubau +- fix: refs #8484 remove unused addressId from createForm in CustomerDescriptor.vue by:jtubau +- fix: refs #8484 rollback by:jorgep +- fix: refs #8484 update Boss field type to 'selectWorker' and add selectWorkerOption command by:jtubau +- fix: refs #8484 update Boss type from 'selectWorker' to 'select' by:jorgep +- fix: refs #8484 update parking list URL to correct shelving path in integration test by:jtubau +- fix: refs #8484 update selector for buyLabel button in myEntry test by:jtubau +- fix: refs #8484 update selector for removing wagon type in wagonCreate.spec.js by:jtubau +- fix: refs #8484 update wagon type deletion selector and clean up unused code in commands.js by:jtubau +- fix: refs #8593 fixed parking e2e tests by:provira +- fix: refs #8606 fixed list e2e test by:Jon +- fix: refs #8620 add module name to InvoiceInSummary by:jtubau +- fix: refs #8623 fixed different errors by:Jon +- fix: remove info by:carlossa +- fix: remove old end-to-end test files before building Docker image by:alexm +- fix: revert cypress.config by:alexm +- fix: style w-80 by:Javier Segarra +- fix: unnecessary function by:alexm +- fix: update docker-compose command to remove volumes on teardown by:alexm +- fix: update Jenkinsfile to remove specific end-to-end test files by:alexm +- fix: update Jenkinsfile to use environment variable for Docker registry credentials by:alexm +- fix: warmFix vnInput dataCy by:alexm +- Merge pull request 'fix: style' (!1425) from warmfix_vntable_card_style into test by:Javier Segarra +- revert: browser chromium package.json by:Javier Segarra +- Revert "revert 1015acefb7e400be2d8b5958dba69b4d98276b34" by:alexm +- test: refs #6695 e2e fix allowedHosts by:alexm +- test: refs #6695 e2e fix back image by:alexm +- test: refs #6695 e2e fix base urls by:alexm +- test: refs #6695 e2e fix command by:alexm +- test: refs #6695 e2e fix connection db by:alexm +- test: refs #6695 e2e fix network by:alexm +- test: refs #6695 e2e fix sequential by:alexm +- test: refs #6695 fix e2e by:alexm +- test: refs #6695 fix e2e command by:alexm +- test: refs #6695 fix selectOption command by:alexm + # Version 25.08 - 2025-03-04 ### Added 🆕 diff --git a/Jenkinsfile b/Jenkinsfile index 63577dad5..2f11556b5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -120,6 +120,8 @@ pipeline { def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' + sh "docker-compose ${env.COMPOSE_PARAMS} pull back" + sh "docker-compose ${env.COMPOSE_PARAMS} pull db" sh "docker-compose ${env.COMPOSE_PARAMS} up -d" image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") { diff --git a/README.md b/README.md index 262e12e58..d280e29ce 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,18 @@ pnpm run test:front pnpm run test:e2e ``` +### Run e2e parallel + +```bash +pnpm run test:e2e:parallel +``` + +### View e2e parallel report + +```bash +pnpm run test:e2e:summary +``` + ### Build the app for production ```bash diff --git a/docs/Dockerfile.dev b/docs/Dockerfile.dev index 84a4d80bc..3117e2c20 100644 --- a/docs/Dockerfile.dev +++ b/docs/Dockerfile.dev @@ -25,6 +25,8 @@ RUN apt-get update \ libnss3 \ libxss1 \ libxtst6 \ + mesa-vulkan-drivers \ + vulkan-tools \ xauth \ xvfb \ && apt-get clean \ diff --git a/package.json b/package.json index 33b730b9e..076cbbb14 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", "test:e2e": "cypress open", "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run", - "test:e2e:parallel": "bash ./test/cypress/cypressParallel.sh", + "test:e2e:parallel": "bash ./test/cypress/run.sh", "test:e2e:summary": "bash ./test/cypress/summary.sh", "test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test:front": "vitest", @@ -56,6 +56,7 @@ "eslint-plugin-cypress": "^4.1.0", "eslint-plugin-vue": "^9.32.0", "husky": "^8.0.0", + "junit-merge": "^2.0.0", "mocha": "^11.1.0", "postcss": "^8.4.23", "prettier": "^3.4.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 168fb9e0d..51fc75469 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,6 +91,9 @@ devDependencies: husky: specifier: ^8.0.0 version: 8.0.3 + junit-merge: + specifier: ^2.0.0 + version: 2.0.0 mocha: specifier: ^11.1.0 version: 11.1.0 @@ -4860,6 +4863,10 @@ packages: universalify: 2.0.1 dev: true + /fs-readdir-recursive@1.1.0: + resolution: {integrity: sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==} + dev: true + /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -5640,6 +5647,16 @@ packages: verror: 1.10.0 dev: true + /junit-merge@2.0.0: + resolution: {integrity: sha512-qwENzBWcdHPazNqPO0fKyFIqEyaSKyO0iyBeIU4Y/scjkXYpwTi88P2S/PWecqgMhzG2MOCwXk8QB9ucvXeIPw==} + hasBin: true + dependencies: + commander: 2.20.3 + fs-readdir-recursive: 1.1.0 + mkdirp: 0.5.6 + xmldoc: 1.3.0 + dev: true + /keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} dependencies: @@ -6037,7 +6054,6 @@ packages: hasBin: true dependencies: minimist: 1.2.8 - dev: false /mlly@1.7.4: resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} @@ -7253,6 +7269,10 @@ packages: resolution: {integrity: sha512-5f3k2PbGGp+YtKJjOItpg3P99IMD84E4HOvcfleTb5joCHNXYLsR9yWFPOYGgaeMPDubQILTCMdsFb2OMeOjtg==} dev: true + /sax@1.4.1: + resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} + dev: true + /scheduler@0.25.0: resolution: {integrity: sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==} dev: true @@ -8689,6 +8709,12 @@ packages: engines: {node: '>=4.0'} dev: true + /xmldoc@1.3.0: + resolution: {integrity: sha512-y7IRWW6PvEnYQZNZFMRLNJw+p3pezM4nKYPfr15g4OOW9i8VpeydycFuipE2297OvZnh3jSb2pxOt9QpkZUVng==} + dependencies: + sax: 1.4.1 + dev: true + /xunit-viewer@10.6.1(@babel/runtime@7.26.9)(@codemirror/autocomplete@6.18.6)(@codemirror/language@6.10.8)(@codemirror/lint@6.8.4)(@codemirror/search@6.5.10)(@codemirror/state@6.5.2)(@codemirror/theme-one-dark@6.1.2)(@codemirror/view@6.36.3)(codemirror@6.0.1)(react-dom@19.0.0)(react@19.0.0): resolution: {integrity: sha512-ZMprLPVhCQJf2KD56tv2hlOjc4T+KnUe1E9DkEBHnuliOq7IOXWJf61pxyBMo/7H83B7Ln0DIeWNMMbx/3I7Jg==} hasBin: true diff --git a/src/components/FilterItemForm.vue b/src/components/FilterItemForm.vue index cacfde1b3..cca8d80c3 100644 --- a/src/components/FilterItemForm.vue +++ b/src/components/FilterItemForm.vue @@ -188,7 +188,7 @@ const selectItem = ({ id }) => { > - {{ row.id }} + {{ row.id }} diff --git a/src/components/FilterTravelForm.vue b/src/components/FilterTravelForm.vue index c522d0269..4aad327b2 100644 --- a/src/components/FilterTravelForm.vue +++ b/src/components/FilterTravelForm.vue @@ -196,7 +196,7 @@ const selectTravel = ({ id }) => { > - {{ row.id }} + {{ row.id }} diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 9a9949499..8e83bf579 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -77,6 +77,7 @@ watch( function findMatches(search, item) { const matches = []; function findRoute(search, item) { + if (!item?.children) return; for (const child of item.children) { if (search?.indexOf(child.name) > -1) { matches.push(child); @@ -92,7 +93,7 @@ function findMatches(search, item) { } function addChildren(module, route, parent) { - const menus = route?.meta?.menu ?? route?.menus?.[props.source]; //backwards compatible + const menus = route?.meta?.menu; if (!menus) return; const matches = findMatches(menus, route); @@ -107,11 +108,7 @@ function getRoutes() { main: getMainRoutes, card: getCardRoutes, }; - try { - handleRoutes[props.source](); - } catch (error) { - throw new Error(`Method is not defined`); - } + handleRoutes[props.source](); } function getMainRoutes() { const modules = Object.assign([], navigation.getModules().value); @@ -122,7 +119,6 @@ function getMainRoutes() { ); if (!moduleDef) continue; item.children = []; - addChildren(item.module, moduleDef, item.children); } @@ -132,21 +128,16 @@ function getMainRoutes() { function getCardRoutes() { const currentRoute = route.matched[1]; const currentModule = toLowerCamel(currentRoute.name); - let moduleDef = routes.find((route) => toLowerCamel(route.name) === currentModule); + let moduleDef; - if (!moduleDef) return; - if (!moduleDef?.menus) moduleDef = betaGetRoutes(); - addChildren(currentModule, moduleDef, items.value); -} - -function betaGetRoutes() { - let menuRoute; let index = route.matched.length - 1; - while (!menuRoute && index > 0) { - if (route.matched[index]?.meta?.menu) menuRoute = route.matched[index]; + while (!moduleDef && index > 0) { + if (route.matched[index]?.meta?.menu) moduleDef = route.matched[index]; index--; } - return menuRoute; + + if (!moduleDef) return; + addChildren(currentModule, moduleDef, items.value); } async function togglePinned(item, event) { diff --git a/src/components/TicketProblems.vue b/src/components/TicketProblems.vue index 255bea9cd..59be95035 100644 --- a/src/components/TicketProblems.vue +++ b/src/components/TicketProblems.vue @@ -28,6 +28,17 @@ defineProps({ row: { type: Object, required: true } }); {{ t('ticketSale.reserved') }} + + + {{ t('Ticket deleted') }} + + { (data) => ( (rectificativeTypeOptions = data), (transferInvoiceParams.cplusRectificationTypeFk = data.filter( - (type) => type.description == 'I – Por diferencias' + (type) => type.description == 'I – Por diferencias', )[0].id) ) " @@ -100,7 +100,7 @@ const makeInvoice = async () => { (data) => ( (siiTypeInvoiceOutsOptions = data), (transferInvoiceParams.siiTypeInvoiceOutFk = data.filter( - (type) => type.code == 'R4' + (type) => type.code == 'R4', )[0].id) ) " @@ -122,7 +122,6 @@ const makeInvoice = async () => { { :row-index="index" > @@ -1136,9 +1148,13 @@ es: .grid-create { display: grid; - grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); + grid-template-columns: 1fr 1fr; + max-width: 100%; grid-gap: 20px; margin: 0 auto; + .col-span-2 { + grid-column: span 2; + } } .flex-one { diff --git a/src/components/__tests__/Leftmenu.spec.js b/src/components/__tests__/Leftmenu.spec.js index 4ab8b527f..0bcc587ac 100644 --- a/src/components/__tests__/Leftmenu.spec.js +++ b/src/components/__tests__/Leftmenu.spec.js @@ -15,10 +15,7 @@ vi.mock('src/router/modules', () => ({ meta: { title: 'customers', icon: 'vn:client', - }, - menus: { - main: ['CustomerList', 'CustomerCreate'], - card: ['CustomerBasicData'], + menu: ['CustomerList', 'CustomerCreate'], }, children: [ { @@ -50,14 +47,6 @@ vi.mock('src/router/modules', () => ({ ], }, }, - { - path: 'create', - name: 'CustomerCreate', - meta: { - title: 'createCustomer', - icon: 'vn:addperson', - }, - }, ], }, ], @@ -98,7 +87,7 @@ vi.spyOn(vueRouter, 'useRoute').mockReturnValue({ icon: 'vn:client', moduleName: 'Customer', keyBinding: 'c', - menu: 'customer', + menu: ['customer'], }, }, ], @@ -260,15 +249,6 @@ describe('Leftmenu as main', () => { }); }); - it('should handle a single matched route with a menu', () => { - const route = { - matched: [{ meta: { menu: 'customer' } }], - }; - - const result = vm.betaGetRoutes(); - - expect(result.meta.menu).toEqual(route.matched[0].meta.menu); - }); it('should get routes for main source', () => { vm.props.source = 'main'; vm.getRoutes(); @@ -351,8 +331,9 @@ describe('addChildren', () => { it('should handle routes with no meta menu', () => { const route = { - meta: {}, - menus: {}, + meta: { + menu: [], + }, }; const parent = []; diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index 44002c22a..620dc2ad2 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -1,50 +1,56 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/src/components/common/VnCardBeta.vue b/src/components/common/VnCardBeta.vue deleted file mode 100644 index 620dc2ad2..000000000 --- a/src/components/common/VnCardBeta.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index a29d1d429..744f84e6d 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -5,7 +5,7 @@ import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue'; import { useArrayData } from 'composables/useArrayData'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useState } from 'src/composables/useState'; -import { useRoute } from 'vue-router'; +import { useRoute, useRouter } from 'vue-router'; import { useClipboard } from 'src/composables/useClipboard'; import VnMoreOptions from './VnMoreOptions.vue'; @@ -42,6 +42,7 @@ const $props = defineProps({ const state = useState(); const route = useRoute(); +const router = useRouter(); const { t } = useI18n(); const { copyText } = useClipboard(); const { viewSummary } = useSummaryDialog(); @@ -50,6 +51,9 @@ let store; let entity; const isLoading = ref(false); const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName); +const DESCRIPTOR_PROXY = 'DescriptorProxy'; +const moduleName = ref(); +const isSameModuleName = route.matched[1].meta.moduleName !== moduleName.value; defineExpose({ getData }); onBeforeMount(async () => { @@ -76,15 +80,18 @@ onBeforeMount(async () => { ); }); -const routeName = computed(() => { - const DESCRIPTOR_PROXY = 'DescriptorProxy'; - +function getName() { let name = $props.dataKey; if ($props.dataKey.includes(DESCRIPTOR_PROXY)) { name = name.split(DESCRIPTOR_PROXY)[0]; } - return `${name}Summary`; + return name; +} +const routeName = computed(() => { + let routeName = getName(); + return `${routeName}Summary`; }); + async function getData() { store.url = $props.url; store.filter = $props.filter ?? {}; @@ -120,20 +127,35 @@ function copyIdText(id) { const emit = defineEmits(['onFetch']); -const iconModule = computed(() => route.matched[1].meta.icon); -const toModule = computed(() => - route.matched[1].path.split('/').length > 2 - ? route.matched[1].redirect - : route.matched[1].children[0].redirect, -); +const iconModule = computed(() => { + moduleName.value = getName(); + if (isSameModuleName) { + return router.options.routes[1].children.find((r) => r.name === moduleName.value) + ?.meta?.icon; + } else { + return route.matched[1].meta.icon; + } +}); + +const toModule = computed(() => { + moduleName.value = getName(); + if (isSameModuleName) { + return router.options.routes[1].children.find((r) => r.name === moduleName.value) + ?.children[0]?.redirect; + } else { + return route.matched[1].path.split('/').length > 2 + ? route.matched[1].redirect + : route.matched[1].children[0].redirect; + } +}); - + :icon="iconModule" color="white" class="link" - :to="$attrs['to-module'] ?? toModule" + :to="toModule" > {{ t('globals.goToModuleIndex') }} - + + - [ :right-search="false" > - - diff --git a/src/pages/Account/Alias/Card/AliasCard.vue b/src/pages/Account/Alias/Card/AliasCard.vue index f37bd7d0f..f3faa5bee 100644 --- a/src/pages/Account/Alias/Card/AliasCard.vue +++ b/src/pages/Account/Alias/Card/AliasCard.vue @@ -1,10 +1,10 @@ - $props.id || route.params.id); - - {{ t('globals.summary.basicData') }} - - + diff --git a/src/pages/Account/Card/AccountCard.vue b/src/pages/Account/Card/AccountCard.vue index a5037e301..e102415c7 100644 --- a/src/pages/Account/Card/AccountCard.vue +++ b/src/pages/Account/Card/AccountCard.vue @@ -1,10 +1,10 @@ - $props.id || route.params.id); - - {{ $t('globals.pageTitles.basicData') }} - - + diff --git a/src/pages/Account/Role/Card/RoleCard.vue b/src/pages/Account/Role/Card/RoleCard.vue index ef5b9db04..43ad22b90 100644 --- a/src/pages/Account/Role/Card/RoleCard.vue +++ b/src/pages/Account/Role/Card/RoleCard.vue @@ -1,9 +1,9 @@ - $props.id || route.params.id); - - {{ t('globals.pageTitles.basicData') }} - - + diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index baa36710c..a499d8b5d 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -328,7 +328,7 @@ async function post(query, params) { -import VnCardBeta from 'components/common/VnCardBeta.vue'; +import VnCard from 'components/common/VnCard.vue'; import ClaimDescriptor from './ClaimDescriptor.vue'; import filter from './ClaimFilter.js'; - { - + - + + {{ entity?.client?.department?.name || '-' }} + + - + + {{ claim?.client?.department?.name || '-' }} + + @@ -271,7 +274,7 @@ function claimUrl(section) { - + {{ claim.client?.name }} diff --git a/src/pages/Claim/Card/ClaimSummaryAction.vue b/src/pages/Claim/Card/ClaimSummaryAction.vue index e5273902c..577ac2a65 100644 --- a/src/pages/Claim/Card/ClaimSummaryAction.vue +++ b/src/pages/Claim/Card/ClaimSummaryAction.vue @@ -80,7 +80,7 @@ const columns = [ :right-search="false" :column-search="false" :disable-option="{ card: true, table: true }" - search-url="actions" + :search-url="false" :filter="{ where: { claimFk: $props.id } }" :columns="columns" :limit="0" diff --git a/src/pages/Claim/ClaimFilter.vue b/src/pages/Claim/ClaimFilter.vue index 0fe7fc588..37146865c 100644 --- a/src/pages/Claim/ClaimFilter.vue +++ b/src/pages/Claim/ClaimFilter.vue @@ -44,15 +44,14 @@ const props = defineProps({ is-outlined /> diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue index 41d0c5598..06996c2c1 100644 --- a/src/pages/Claim/ClaimList.vue +++ b/src/pages/Claim/ClaimList.vue @@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'; import { toDate } from 'filters/index'; import ClaimFilter from './ClaimFilter.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue'; import ClaimSummary from './Card/ClaimSummary.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; @@ -48,6 +49,20 @@ const columns = computed(() => [ }, columnClass: 'expand', }, + { + align: 'left', + name: 'departmentFk', + label: t('customer.summary.team'), + component: 'select', + attrs: { + url: 'Departments', + }, + create: true, + columnField: { + component: null, + }, + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), + }, { align: 'left', label: t('claim.attendedBy'), @@ -152,6 +167,12 @@ const STATE_COLOR = { + + + {{ row.departmentName || '-' }} + + + diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index 36ec4763e..9c9d1b50b 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -8,7 +8,6 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; -import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; import { getDifferences, getUpdatedValues } from 'src/filters'; const route = useRoute(); @@ -37,7 +36,7 @@ const exprBuilder = (param, value) => { function onBeforeSave(formData, originalData) { return getUpdatedValues( Object.keys(getDifferences(formData, originalData)), - formData + formData, ); } @@ -119,16 +118,11 @@ function onBeforeSave(formData, originalData) { /> - {{ t( - 'In case of a company succession, specify the grantor company' + 'In case of a company succession, specify the grantor company', ) }} diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 75fcb98fa..8c70646c1 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -1,10 +1,10 @@ - { :value="toCurrency(entity.debt)" :info="t('customer.summary.riskInfo')" /> - + - - {{ dashIfEmpty(entity.salesPersonUser) }} + + ({ flat: true, color: 'blue' }), + props: () => ({ flat: true }), event: ({ row }) => downloadFile(row.dmsFk), }, employee: { component: QBtn, - props: () => ({ flat: true, color: 'blue' }), + props: () => ({ flat: true }), event: () => {}, }, created: { @@ -214,8 +214,17 @@ const toCustomerFileManagementCreate = () => { v-bind="tableColumnComponents[props.col.name].props(props)" > - {{ props.value }} + + {{ props.value }} + + [ @@ -32,7 +30,7 @@ const columns = computed(() => [ { align: 'left', cardVisible: true, - format: ({ company }) => company.code, + format: ({ company }) => company?.code, label: t('globals.company'), name: 'company', }, @@ -65,7 +63,8 @@ const columns = computed(() => [ { {{ t('globals.params.email') }} - + - + + + + -import { reactive, ref } from 'vue'; -import { useI18n } from 'vue-i18n'; - -import FetchData from 'components/FetchData.vue'; -import FormModel from 'components/FormModel.vue'; -import VnRow from 'components/ui/VnRow.vue'; -import VnSelect from 'src/components/common/VnSelect.vue'; -import VnLocation from 'src/components/common/VnLocation.vue'; -import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; - -const { t } = useI18n(); - -const initialData = reactive({ - active: true, - isEqualizated: false, -}); - -const workersOptions = ref([]); -const businessTypesOptions = ref([]); - -function handleLocation(data, location) { - const { town, code, provinceFk, countryFk } = location ?? {}; - data.postcode = code; - data.city = town; - data.provinceFk = provinceFk; - data.countryFk = countryFk; -} - - - - (workersOptions = data)" - auto-load - url="Workers/search?departmentCodes" - /> - (businessTypesOptions = data)" - auto-load - url="BusinessTypes" - /> - - - - - - - - - - - - - - - - - - - - handleLocation(data, location)" - > - - - - - - - - - {{ - t('customer.basicData.youCanSaveMultipleEmails') - }} - - - - - - - - - - - - - -es: - Comercial name: Nombre comercial - Salesperson: Comercial - Business type: Tipo de negocio - Tax number: NIF / CIF - Business name: Razón social - Street: Dirección fiscal - Postcode: Código postal - City: Población - Province: Provincia - Country: País - Web user: Usuario web - Email: Email - Is equalizated: Recargo de equivalencia - diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue index 1c5a08304..2ace6dd02 100644 --- a/src/pages/Customer/CustomerFilter.vue +++ b/src/pages/Customer/CustomerFilter.vue @@ -3,7 +3,6 @@ import { useI18n } from 'vue-i18n'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnSelect from 'components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; -import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const { t } = useI18n(); defineProps({ @@ -65,22 +64,15 @@ const exprBuilder = (param, value) => { - @@ -164,7 +156,6 @@ en: params: search: Contains fi: FI - salesPersonFk: Salesperson provinceFk: Province isActive: Is active city: City @@ -191,7 +182,6 @@ es: sageTaxTypeFk: Tipo de impuesto Sage sageTransactionTypeFk: Tipo de impuesto Sage payMethodFk: Forma de pago - salesPersonFk: Comercial provinceFk: Provincia city: Ciudad phone: Teléfono @@ -201,7 +191,6 @@ es: name: Nombre postcode: CP FI: NIF - Salesperson: Comercial Province: Provincia City: Ciudad Phone: Teléfono diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index 0bfca7910..b721a6ad9 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -10,7 +10,6 @@ import CustomerFilter from './CustomerFilter.vue'; import VnTable from 'components/VnTable/VnTable.vue'; import VnLocation from 'src/components/common/VnLocation.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; -import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; import VnSection from 'src/components/common/VnSection.vue'; const { t } = useI18n(); @@ -73,30 +72,17 @@ const columns = computed(() => [ }, { align: 'left', - name: 'salesPersonFk', - label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'), + name: 'departmentFk', + label: t('customer.summary.team'), component: 'select', attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name', 'firstName'], - where: { role: 'salesPerson' }, - optionFilter: 'firstName', + url: 'Departments', }, - columnFilter: { - component: 'select', - attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name', 'firstName'], - where: { role: 'salesPerson' }, - optionLabel: 'firstName', - optionValue: 'id', - }, - }, - create: false, + create: true, columnField: { component: null, }, - format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson), + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), }, { align: 'left', @@ -155,6 +141,9 @@ const columns = computed(() => [ inWhere: true, }, columnClass: 'expand', + attrs: { + uppercase: true, + }, }, { align: 'left', @@ -446,36 +435,6 @@ function handleLocation(data, location) { redirect="customer" > - - - - - - - - {{ scope.opt?.name }} - {{ scope.opt?.nickname }}, - {{ scope.opt?.code }} - - - - [ }, }, }, - { - align: 'left', - name: 'isWorker', - label: t('Is worker'), - }, - { - align: 'left', - name: 'salesPersonFk', - label: t('Salesperson'), - columnFilter: { - component: 'select', - attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name'], - where: { role: 'salesPerson' }, - useLike: false, - optionValue: 'id', - optionLabel: 'name', - optionFilter: 'firstName', - }, - }, - }, { align: 'left', name: 'departmentFk', @@ -153,6 +131,11 @@ const columns = computed(() => [ label: t('Has recovery'), name: 'hasRecovery', }, + { + align: 'left', + name: 'isWorker', + label: t('customer.params.isWorker'), + }, ]); const viewAddObservation = (rowsSelected) => { @@ -167,7 +150,6 @@ const viewAddObservation = (rowsSelected) => { function exprBuilder(param, value) { switch (param) { - case 'salesPersonFk': case 'creditInsurance': case 'countryFk': return { [`c.${param}`]: value }; @@ -176,7 +158,7 @@ function exprBuilder(param, value) { case 'workerFk': return { [`co.${param}`]: value }; case 'departmentFk': - return { [`wd.${param}`]: value }; + return { [`c.${param}`]: value }; case 'amount': case 'clientFk': return { [`d.${param}`]: value }; @@ -241,12 +223,6 @@ function exprBuilder(param, value) { - - - {{ row.salesPersonName }} - - - {{ row.departmentName }} @@ -265,8 +241,6 @@ function exprBuilder(param, value) { es: Add observation: Añadir observación Client: Cliente - Is worker: Es trabajador - Salesperson: Comercial Department: Departamento Country: País P. Method: F. Pago @@ -281,5 +255,5 @@ es: Credit I.: Crédito A. Credit insurance: Crédito asegurado From: Desde - Has recovery: Tiene recobro + Has recovery: Recobro diff --git a/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue b/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue index ce86c6435..0eab7b7c5 100644 --- a/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue +++ b/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue @@ -15,19 +15,12 @@ const props = defineProps({ }, }); -const salespersons = ref(); const countries = ref(); const authors = ref(); const departments = ref(); - (salespersons = data)" - auto-load - url="Workers/activeWithInheritedRole" - /> (countries = data)" auto-load url="Countries" /> (authors = data)" @@ -62,29 +55,6 @@ const departments = ref(); @update:model-value="searchFn()" /> - - - - - - - - [ }, { align: 'left', - label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'), - name: 'salesPersonFk', + name: 'departmentFk', + label: t('customer.summary.team'), component: 'select', attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name'], - where: { role: 'salesPerson' }, - optionFilter: 'firstName', - useLike: false, + url: 'Departments', }, - visible: false, + columnField: { + component: null, + }, + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), }, ]); @@ -96,7 +95,7 @@ const columns = computed(() => [ - - - - - - + {{ t('New payment') }} - - - - - setPaymentType(value, options) + (value, options) => setPaymentType(data, value, options) " :emit-value="false" + data-cy="paymentBank" > @@ -245,8 +220,28 @@ async function getAmountPaid() { @update:model-value="calculateFromAmount($event)" clearable v-model.number="data.amountPaid" + data-cy="paymentAmount" /> + + + + + {{ t('Compensation') }} @@ -287,27 +282,8 @@ async function getAmountPaid() { - - - - - + diff --git a/src/pages/Customer/locale/en.yml b/src/pages/Customer/locale/en.yml index b6d495335..6724a5a7b 100644 --- a/src/pages/Customer/locale/en.yml +++ b/src/pages/Customer/locale/en.yml @@ -20,7 +20,7 @@ customer: name: Name contact: Contact mobile: Mobile - salesPerson: Sales person + team: Team contactChannel: Contact channel socialName: Social name fiscalId: Fiscal ID @@ -78,7 +78,6 @@ customer: id: Identifier socialName: Social name fi: Tax number - salesPersonFk: Salesperson creditInsurance: Credit insurance phone: Phone street: Street diff --git a/src/pages/Customer/locale/es.yml b/src/pages/Customer/locale/es.yml index f50d049da..4a266e07a 100644 --- a/src/pages/Customer/locale/es.yml +++ b/src/pages/Customer/locale/es.yml @@ -20,7 +20,7 @@ customer: name: Nombre contact: Contacto mobile: Móvil - salesPerson: Comercial + team: Equipo contactChannel: Canal de contacto socialName: Razón social fiscalId: NIF/CIF @@ -78,7 +78,6 @@ customer: id: Identificador socialName: Razón social fi: NIF / CIF - salesPersonFk: Comercial creditInsurance: Crédito asegurado phone: Teléfono street: Dirección fiscal diff --git a/src/pages/Entry/Card/EntryCard.vue b/src/pages/Entry/Card/EntryCard.vue index be82289f4..50f8b8e55 100644 --- a/src/pages/Entry/Card/EntryCard.vue +++ b/src/pages/Entry/Card/EntryCard.vue @@ -1,10 +1,10 @@ - + (itemTypeWorkersOptions = data)" + /> { - + diff --git a/src/pages/InvoiceIn/Card/InvoiceInCard.vue b/src/pages/InvoiceIn/Card/InvoiceInCard.vue index 34cc26437..a1bae87a6 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInCard.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInCard.vue @@ -1,5 +1,5 @@ - import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue'; -import VnCardBeta from 'components/common/VnCardBeta.vue'; +import VnCard from 'components/common/VnCard.vue'; import filter from './InvoiceOutFilter.js'; - + diff --git a/src/pages/InvoiceOut/InvoiceOutFilter.vue b/src/pages/InvoiceOut/InvoiceOutFilter.vue index 648b8e4e6..99524e0d6 100644 --- a/src/pages/InvoiceOut/InvoiceOutFilter.vue +++ b/src/pages/InvoiceOut/InvoiceOutFilter.vue @@ -7,6 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputNumber from 'src/components/common/VnInputNumber.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; const { t } = useI18n(); const props = defineProps({ @@ -30,7 +31,7 @@ const states = ref(); @@ -38,13 +39,17 @@ const states = ref(); - + @@ -88,14 +93,31 @@ const states = ref(); - + + + + + + diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index a6ec9923e..3390ef33a 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -8,7 +8,7 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { usePrintService } from 'src/composables/usePrintService'; import VnTable from 'src/components/VnTable/VnTable.vue'; import InvoiceOutSummary from './Card/InvoiceOutSummary.vue'; -import { toCurrency, toDate } from 'src/filters/index'; +import { toCurrency, toDate, dashIfEmpty } from 'src/filters/index'; import { QBtn } from 'quasar'; import axios from 'axios'; import InvoiceOutFilter from './InvoiceOutFilter.vue'; @@ -16,6 +16,7 @@ import VnRow from 'src/components/ui/VnRow.vue'; import VnRadio from 'src/components/common/VnRadio.vue'; import VnInput from 'src/components/common/VnInput.vue'; import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue'; +import DepartmentDescriptorProxy from '../Worker/Department/Card/DepartmentDescriptorProxy.vue'; import VnSection from 'src/components/common/VnSection.vue'; const { t } = useI18n(); @@ -54,6 +55,14 @@ const columns = computed(() => [ name: 'id', }, }, + { + align: 'left', + name: 'issued', + label: t('invoiceOut.summary.issued'), + component: 'date', + format: (row) => toDate(row.issued), + columnField: { component: null }, + }, { align: 'left', name: 'ref', @@ -86,6 +95,20 @@ const columns = computed(() => [ component: null, }, }, + { + align: 'left', + name: 'departmentFk', + label: t('customer.summary.team'), + cardVisible: true, + component: 'select', + attrs: { + url: 'Departments', + }, + columnField: { + component: null, + }, + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), + }, { align: 'left', name: 'companyFk', @@ -185,7 +208,7 @@ watchEffect(selectedRows); prefix="invoiceOut" :array-data-props="{ url: 'InvoiceOuts/filter', - order: ['id DESC'], + order: 'id DESC', }" > @@ -229,8 +252,14 @@ watchEffect(selectedRows); + + + {{ dashIfEmpty(row.departmentName) }} + + + - + @@ -396,7 +425,6 @@ watchEffect(selectedRows); :label=" t('invoiceOutList.tableVisibleColumns.taxArea') " - :options="taxAreasOptions" option-label="code" option-value="code" /> diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index b062678a0..432cd07d7 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -8,7 +8,7 @@ import { useInvoiceOutGlobalStore } from 'src/stores/invoiceOutGlobal.js'; import { useArrayData } from 'src/composables/useArrayData'; import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue'; import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue'; -import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue'; +import DepartmentDescriptorProxy from '../Worker/Department/Card/DepartmentDescriptorProxy.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import InvoiceOutNegativeBasesFilter from './InvoiceOutNegativeBasesFilter.vue'; import RightMenu from 'src/components/common/RightMenu.vue'; @@ -115,18 +115,16 @@ const columns = computed(() => [ }, { align: 'left', - label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'), - name: 'workerName', + name: 'departmentFk', + label: t('customer.summary.team'), component: 'select', attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name'], - where: { role: 'salesPerson' }, + url: 'Departments', }, columnField: { component: null, }, - format: (row, dashIfEmpty) => dashIfEmpty(row.workerName), + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), }, ]); @@ -198,10 +196,10 @@ const downloadCSV = async () => { - + - {{ row.workerName }} - + {{ row.departmentName }} + diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue index cd9836bb7..b24c8b247 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue @@ -20,7 +20,7 @@ const props = defineProps({ @@ -129,12 +129,15 @@ const props = defineProps({ - diff --git a/src/pages/InvoiceOut/locale/en.yml b/src/pages/InvoiceOut/locale/en.yml index 17d198351..9d6a4a244 100644 --- a/src/pages/InvoiceOut/locale/en.yml +++ b/src/pages/InvoiceOut/locale/en.yml @@ -1,6 +1,7 @@ invoiceOut: search: Search invoice searchInfo: You can search by invoice reference + externalRef: External Ref. params: id: ID company: Company @@ -12,7 +13,6 @@ invoiceOut: isActive: Active hasToInvoice: Has to invoice hasVerifiedData: Verified data - workerName: Worker isTaxDataChecked: Verified data amount: Amount clientFk: Client @@ -26,6 +26,7 @@ invoiceOut: max: Max hasPdf: Has PDF search: Contains + departmentFk: Department card: issued: Issued customerCard: Customer card diff --git a/src/pages/InvoiceOut/locale/es.yml b/src/pages/InvoiceOut/locale/es.yml index 3df95d6b2..f9448cd9b 100644 --- a/src/pages/InvoiceOut/locale/es.yml +++ b/src/pages/InvoiceOut/locale/es.yml @@ -1,6 +1,7 @@ invoiceOut: search: Buscar factura emitida searchInfo: Puedes buscar por referencia de la factura + externalRef: Ref. externa params: id: ID company: Empresa @@ -12,7 +13,6 @@ invoiceOut: isActive: Activo hasToInvoice: Debe facturar hasVerifiedData: Datos verificados - workerName: Comercial isTaxDataChecked: Datos comprobados amount: Importe clientFk: Cliente @@ -26,6 +26,7 @@ invoiceOut: max: Max hasPdf: Tiene PDF search: Contiene + departmentFk: Departamento card: issued: Fecha emisión customerCard: Ficha del cliente diff --git a/src/pages/Item/Card/ItemCard.vue b/src/pages/Item/Card/ItemCard.vue index 610b77a02..ddd21fe36 100644 --- a/src/pages/Item/Card/ItemCard.vue +++ b/src/pages/Item/Card/ItemCard.vue @@ -1,9 +1,9 @@ - [ columnClass: 'expand', }, { + align: 'left', label: t('item.buyRequest.requester'), name: 'requesterName', component: 'select', @@ -77,6 +79,19 @@ const columns = computed(() => [ }, columnClass: 'shrink', }, + { + align: 'left', + name: 'departmentFk', + label: t('customer.summary.team'), + component: 'select', + attrs: { + url: 'Departments', + }, + columnField: { + component: null, + }, + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), + }, { label: t('item.buyRequest.requested'), name: 'quantity', @@ -107,6 +122,7 @@ const columns = computed(() => [ }, columnClass: 'shrink', }, + { label: t('globals.item'), name: 'item', @@ -262,6 +278,12 @@ const onDenyAccept = (_, responseData) => { + + + {{ row.departmentName }} + + + diff --git a/src/pages/Item/ItemRequestFilter.vue b/src/pages/Item/ItemRequestFilter.vue index c2a63ddd9..a29203df3 100644 --- a/src/pages/Item/ItemRequestFilter.vue +++ b/src/pages/Item/ItemRequestFilter.vue @@ -221,7 +221,7 @@ en: attenderFk: Atender clientFk: Client id warehouseFk: Warehouse - requesterFk: Salesperson + requesterFk: Requester from: From to: To mine: For me @@ -239,7 +239,7 @@ es: attenderFk: Comprador clientFk: Id cliente warehouseFk: Almacén - requesterFk: Comercial + requesterFk: Solicitante from: Desde to: Hasta mine: Para mi diff --git a/src/pages/Item/ItemType/Card/ItemTypeCard.vue b/src/pages/Item/ItemType/Card/ItemTypeCard.vue index 84e810de5..bd41b1be2 100644 --- a/src/pages/Item/ItemType/Card/ItemTypeCard.vue +++ b/src/pages/Item/ItemType/Card/ItemTypeCard.vue @@ -1,11 +1,11 @@ - summaryRef.value.fetch()); @@ -62,13 +63,10 @@ async function setItemTypeData(data) { - - {{ t('globals.summary.basicData') }} - - + diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml index 9d27fc96e..ff8df26d4 100644 --- a/src/pages/Item/locale/en.yml +++ b/src/pages/Item/locale/en.yml @@ -84,7 +84,7 @@ item: attenderFk: Atender clientFk: Client id warehouseFk: Warehouse - requesterFk: Salesperson + requesterFk: Requester from: From to: To mine: For me diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml index 935f5160b..7b768d0cb 100644 --- a/src/pages/Item/locale/es.yml +++ b/src/pages/Item/locale/es.yml @@ -93,7 +93,7 @@ item: attenderFk: Comprador clientFk: Id cliente warehouseFk: Almacén - requesterFk: Comercial + requesterFk: Solicitante from: Desde to: Hasta mine: Para mi diff --git a/src/pages/Monitor/MonitorClients.vue b/src/pages/Monitor/MonitorClients.vue index c1958cdcb..278b0b26f 100644 --- a/src/pages/Monitor/MonitorClients.vue +++ b/src/pages/Monitor/MonitorClients.vue @@ -31,7 +31,7 @@ function exprBuilder(param, value) { switch (param) { case 'clientFk': return { [`c.id`]: value }; - case 'salesPersonFk': + case 'departmentFk': return { [`c.${param}`]: value }; } } @@ -62,25 +62,17 @@ const columns = computed(() => [ columnFilter: false, }, { - label: t('salesClientsTable.salesPerson'), - name: 'salesPersonFk', - field: 'salesPerson', align: 'left', + name: 'departmentFk', + label: t('customer.summary.team'), + component: 'select', + attrs: { + url: 'Departments', + }, columnField: { component: null, }, - optionFilter: 'firstName', - columnFilter: { - component: 'select', - attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name'], - sortBy: 'nickname ASC', - where: { role: 'salesPerson' }, - useLike: false, - }, - }, - columnClass: 'no-padding', + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), }, { label: t('salesClientsTable.client'), @@ -128,9 +120,9 @@ const columns = computed(() => [ - - - + + + diff --git a/src/pages/Monitor/MonitorOrders.vue b/src/pages/Monitor/MonitorOrders.vue index 873f8abb4..2679f7224 100644 --- a/src/pages/Monitor/MonitorOrders.vue +++ b/src/pages/Monitor/MonitorOrders.vue @@ -1,9 +1,9 @@ - - + - {{ entity?.client?.salesPersonUser?.name || '-' }} - + {{ entity?.client?.department?.name || '-' }} + diff --git a/src/pages/Order/Card/OrderFilter.js b/src/pages/Order/Card/OrderFilter.js index 3e521b92c..d45578529 100644 --- a/src/pages/Order/Card/OrderFilter.js +++ b/src/pages/Order/Card/OrderFilter.js @@ -10,14 +10,14 @@ export default { relation: 'client', scope: { fields: [ - 'salesPersonFk', + 'departmentFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked', ], include: { - relation: 'salesPersonUser', + relation: 'department', scope: { fields: ['id', 'name'] }, }, }, diff --git a/src/pages/Order/Card/OrderFilter.vue b/src/pages/Order/Card/OrderFilter.vue index c387be241..42578423f 100644 --- a/src/pages/Order/Card/OrderFilter.vue +++ b/src/pages/Order/Card/OrderFilter.vue @@ -6,7 +6,6 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnSelect from 'components/common/VnSelect.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnInput from 'components/common/VnInput.vue'; -import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const { t } = useI18n(); const props = defineProps({ @@ -62,15 +61,15 @@ const sourceList = ref([]); outlined rounded /> - [ }, { align: 'left', - name: 'salesPersonFk', - label: t('module.salesPerson'), - columnFilter: { - component: 'select', - inWhere: true, - attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name'], - where: { role: 'salesPerson' }, - useLike: false, - optionValue: 'id', - optionLabel: 'name', - optionFilter: 'firstName', - }, + name: 'departmentFk', + label: t('customer.summary.team'), + component: 'select', + attrs: { + url: 'Departments', }, - format: (row) => row?.name, + create: true, + columnField: { + component: null, + }, + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), }, { align: 'center', @@ -156,9 +151,7 @@ const columns = computed(() => [ onMounted(async () => { if (!route.query) return; if (route.query?.createForm) { - const query = JSON.parse(route.query?.createForm); - formInitialData.value = query; - await onClientSelected({ ...formInitialData.value, clientFk: query?.clientFk }); + await onClientSelected(JSON.parse(route.query?.createForm)); } else if (route.query?.table) { const query = JSON.parse(route.query?.table); const clientFk = query?.clientFk; @@ -177,7 +170,6 @@ watch( tableRef.value.create.formInitialData = formInitialData.value; } }, - { immediate: true }, ); async function onClientSelected({ clientFk }, formData = {}) { @@ -191,13 +183,17 @@ async function onClientSelected({ clientFk }, formData = {}) { addressOptions.value = data; formData.defaultAddressFk = data[0].client.defaultAddressFk; formData.addressId = formData.defaultAddressFk; - - formInitialData.value = { addressId: formData.addressId, clientFk }; + formInitialData.value = { ...formData, clientFk }; await fetchAgencies(formData); } -async function fetchAgencies({ landed, addressId }) { - if (!landed || !addressId) return (agencyList.value = []); +async function fetchAgencies(formData) { + const { landed, addressId } = formData; + if (!landed || !addressId) { + formData.defaultAddressFk = formInitialData.value.defaultAddressFk; + + return (agencyList.value = []); + } const { data } = await axios.get('Agencies/landsThatDay', { params: { @@ -220,6 +216,11 @@ const getDateColor = (date) => { if (difference == 0) return 'bg-warning'; if (difference < 0) return 'bg-success'; }; + +const isDefaultAddress = (opt, data) => { + const addressId = data.defaultAddressFk ?? data.addressId; + return addressId === opt.id && opt.isActive; +}; @@ -258,10 +259,10 @@ const getDateColor = (date) => { - + - {{ row?.name }} - + {{ row?.departmentName }} + @@ -310,10 +311,7 @@ const getDateColor = (date) => { > [ }, { align: 'left', - label: t('isOwn'), + label: t('agency.isOwn'), name: 'isOwn', component: 'checkbox', + columnFilter: { + inWhere: true, + }, cardVisible: true, }, { align: 'left', - label: t('isAnyVolumeAllowed'), + label: t('agency.isAnyVolumeAllowed'), name: 'isAnyVolumeAllowed', component: 'checkbox', + columnFilter: { + inWhere: true, + }, cardVisible: true, }, { @@ -58,9 +67,10 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('Client ticket list'), + title: t('globals.pageTitles.summary'), icon: 'preview', - action: (row) => navigate(row.id), + action: (row) => viewSummary(row?.id, AgencySummary), + isPrimary: true, }, ], }, @@ -82,7 +92,7 @@ const columns = computed(() => [ [ justify-content: center; } - - es: - isOwn: Tiene propietario - isAnyVolumeAllowed: Permite cualquier volumen - en: - isOwn: Has owner - isAnyVolumeAllowed: Allows any volume - diff --git a/src/pages/Route/Agency/Card/AgencyBasicData.vue b/src/pages/Route/Agency/Card/AgencyBasicData.vue index 4270b136c..4f8f17163 100644 --- a/src/pages/Route/Agency/Card/AgencyBasicData.vue +++ b/src/pages/Route/Agency/Card/AgencyBasicData.vue @@ -21,7 +21,7 @@ const warehouses = ref([]); @on-fetch="(data) => (warehouses = data)" auto-load /> - + diff --git a/src/pages/Route/Agency/Card/AgencyCard.vue b/src/pages/Route/Agency/Card/AgencyCard.vue index 7dc31f8ba..c21298470 100644 --- a/src/pages/Route/Agency/Card/AgencyCard.vue +++ b/src/pages/Route/Agency/Card/AgencyCard.vue @@ -1,7 +1,7 @@ - + diff --git a/src/pages/Route/Agency/Card/AgencyDescriptorProxy.vue b/src/pages/Route/Agency/Card/AgencyDescriptorProxy.vue new file mode 100644 index 000000000..e5c1249b2 --- /dev/null +++ b/src/pages/Route/Agency/Card/AgencyDescriptorProxy.vue @@ -0,0 +1,20 @@ + + + + + + diff --git a/src/pages/Route/Agency/Card/AgencySummary.vue b/src/pages/Route/Agency/Card/AgencySummary.vue index 71a6d1066..ab274939a 100644 --- a/src/pages/Route/Agency/Card/AgencySummary.vue +++ b/src/pages/Route/Agency/Card/AgencySummary.vue @@ -6,29 +6,31 @@ import { useI18n } from 'vue-i18n'; import CardSummary from 'components/ui/CardSummary.vue'; import VnLv from 'components/ui/VnLv.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; +import VnCheckbox from 'components/common/VnCheckbox.vue'; +const route = useRoute(); const $props = defineProps({ id: { type: Number, default: 0 } }); const { t } = useI18n(); -const entityId = computed(() => $props.id || useRoute().params.id); +const entityId = computed(() => $props.id || route.params.id); - + {{ agency.name }} - - diff --git a/src/pages/Route/Agency/locale/en.yml b/src/pages/Route/Agency/locale/en.yml index 93f8b4aaa..78a687f2e 100644 --- a/src/pages/Route/Agency/locale/en.yml +++ b/src/pages/Route/Agency/locale/en.yml @@ -1,11 +1,12 @@ agency: search: Search agency - searchInfo: You can search by name + searchInfo: You can search by name and by id isOwn: Own isAnyVolumeAllowed: Any volume allowed + removeItem: Agency removed successfully notification: - removeItemError: Error removing agency - removeItem: WorkCenter removed successfully + removeItemError: Error removing work center + removeItem: Work center removed successfully pageTitles: agency: Agency searchBar: diff --git a/src/pages/Route/Agency/locale/es.yml b/src/pages/Route/Agency/locale/es.yml index 1efed0e9c..b6237a9f7 100644 --- a/src/pages/Route/Agency/locale/es.yml +++ b/src/pages/Route/Agency/locale/es.yml @@ -1,15 +1,14 @@ agency: search: Buscar agencia - searchInfo: Puedes buscar por nombre + searchInfo: Puedes buscar por nombre y por id isOwn: Propio isAnyVolumeAllowed: Cualquier volumen removeItem: Agencia eliminada correctamente notification: - removeItemError: Error al eliminar la agencia + removeItemError: Error al eliminar la el centro de trabajo removeItem: Centro de trabajo eliminado correctamente pageTitles: agency: Agencia searchBar: info: Puedes buscar por nombre o id label: Buscar agencia... - diff --git a/src/pages/Route/Card/RouteCard.vue b/src/pages/Route/Card/RouteCard.vue index c178dc6bf..b71f7d088 100644 --- a/src/pages/Route/Card/RouteCard.vue +++ b/src/pages/Route/Card/RouteCard.vue @@ -1,10 +1,10 @@ - { const filter = { where: { routeFk: $props.id ? $props.id : route.params.id }, }; - const { data } = await axios.get('Tickets/findOne', { + const { data } = await axios.get('Tickets/filter', { params: { filter: JSON.stringify(filter), }, }); - zoneId.value = data.zoneFk; + + if (!data.length) return; + const firstRecord = data[0]; + + zoneId.value = firstRecord.zoneFk; const { data: zoneData } = await axios.get(`Zones/${zoneId.value}`); zone.value = zoneData.name; }; diff --git a/src/pages/Route/Card/RouteDescriptorProxy.vue b/src/pages/Route/Card/RouteDescriptorProxy.vue index 1ff39a51e..7553469f3 100644 --- a/src/pages/Route/Card/RouteDescriptorProxy.vue +++ b/src/pages/Route/Card/RouteDescriptorProxy.vue @@ -7,6 +7,10 @@ const $props = defineProps({ type: Number, required: true, }, + summary: { + type: Object, + default: null, + }, }); diff --git a/src/pages/Route/Card/RouteFilter.vue b/src/pages/Route/Card/RouteFilter.vue index 21858102b..cb5158517 100644 --- a/src/pages/Route/Card/RouteFilter.vue +++ b/src/pages/Route/Card/RouteFilter.vue @@ -25,7 +25,7 @@ const emit = defineEmits(['search']); > - {{ t(`params.${tag.label}`) }}: + {{ t(`route.params.${tag.label}`) }}: {{ formatFn(tag.value) }} @@ -33,6 +33,7 @@ const emit = defineEmits(['search']); @@ -146,7 +147,7 @@ const emit = defineEmits(['search']); @@ -154,38 +155,3 @@ const emit = defineEmits(['search']); - - -en: - params: - warehouseFk: Warehouse - description: Description - m3: m³ - scopeDays: Days Onward - vehicleFk: Vehicle - agencyModeFk: Agency - workerFk: Worker - from: From - to: To - Served: Served -es: - params: - warehouseFk: Almacén - description: Descripción - m3: m³ - scopeDays: Días en adelante - vehicleFk: Vehículo - agencyModeFk: Agencia - workerFk: Trabajador - from: Desde - to: Hasta - Warehouse: Almacén - Description: Descripción - Vehicle: Vehículo - Agency: Agencia - Worker: Trabajador - From: Desde - To: Hasta - Served: Servida - Days Onward: Días en adelante - diff --git a/src/pages/Route/Card/RouteSummary.vue b/src/pages/Route/Card/RouteSummary.vue index 3051972b2..f68628095 100644 --- a/src/pages/Route/Card/RouteSummary.vue +++ b/src/pages/Route/Card/RouteSummary.vue @@ -135,7 +135,7 @@ const ticketColumns = ref([ @@ -168,7 +168,7 @@ const ticketColumns = ref([ {{ value }} @@ -230,7 +230,7 @@ const ticketColumns = ref([ - + {{ value }} @@ -238,7 +238,7 @@ const ticketColumns = ref([ - + {{ value }} diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue index b3eaf3b48..d0683e481 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/Cmr/CmrList.vue @@ -2,28 +2,38 @@ import { onBeforeMount, onMounted, computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { Notify } from 'quasar'; +import { useRoute } from 'vue-router'; import { useSession } from 'src/composables/useSession'; import { toDateHourMin } from 'filters/index'; import { useStateStore } from 'src/stores/useStateStore'; -import axios from 'axios'; 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'; +const route = useRoute(); const { t } = useI18n(); const { getTokenMultimedia } = useSession(); const token = getTokenMultimedia(); const state = useStateStore(); -const warehouses = ref([]); const selectedRows = ref([]); +const dataKey = 'CmrList'; +const shipped = Date.vnNew(); +shipped.setHours(0, 0, 0, 0); +shipped.setDate(shipped.getDate() - 1); +const userParams = { + shipped: null, +}; + + const columns = computed(() => [ { align: 'left', name: 'cmrFk', - label: t('route.cmr.list.cmrFk'), + label: t('route.cmr.params.cmrFk'), chip: { condition: () => true, }, @@ -32,62 +42,67 @@ const columns = computed(() => [ { align: 'center', name: 'hasCmrDms', - label: t('route.cmr.list.hasCmrDms'), + label: t('route.cmr.params.hasCmrDms'), component: 'checkbox', cardVisible: true, }, { align: 'left', - label: t('route.cmr.list.ticketFk'), + label: t('route.cmr.params.ticketFk'), name: 'ticketFk', }, { align: 'left', - label: t('route.cmr.list.routeFk'), + label: t('route.cmr.params.routeFk'), name: 'routeFk', }, { align: 'left', - label: t('route.cmr.list.clientFk'), + label: t('route.cmr.params.clientFk'), name: 'clientFk', }, { align: 'right', - label: t('route.cmr.list.country'), + label: t('route.cmr.params.countryFk'), name: 'countryFk', - cardVisible: true, + component: 'select', attrs: { url: 'countries', fields: ['id', 'name'], - optionLabel: 'name', - optionValue: 'id', }, columnFilter: { - inWhere: true, - component: 'select', + name: 'countryFk', + attrs: { + url: 'countries', + fields: ['id', 'name'], + }, }, format: ({ countryName }) => countryName, }, { align: 'right', - label: t('route.cmr.list.shipped'), + label: t('route.cmr.params.shipped'), name: 'shipped', cardVisible: true, - columnFilter: { - component: 'date', - inWhere: true, - }, + component: 'date', format: ({ shipped }) => toDateHourMin(shipped), }, { align: 'right', + label: t('route.cmr.params.warehouseFk'), name: 'warehouseFk', - label: t('globals.warehouse'), - columnFilter: { - component: 'select', - }, + component: 'select', attrs: { - options: warehouses.value, + url: 'warehouses', + fields: ['id', 'name'], + }, + columnFilter: { + inWhere: true, + name: 'warehouseFk', + attrs: { + url: 'warehouses', + fields: ['id', 'name'], + }, }, format: ({ warehouseName }) => warehouseName, }, @@ -96,7 +111,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('Ver cmr'), + title: t('route.cmr.params.viewCmr'), icon: 'visibility', isPrimary: true, action: (row) => window.open(getCmrUrl(row?.cmrFk), '_blank'), @@ -105,13 +120,17 @@ const columns = computed(() => [ }, ]); -onBeforeMount(async () => { - const { data } = await axios.get('Warehouses'); - warehouses.value = data; +onBeforeMount(() => { + initializeFromQuery(); }); onMounted(() => (state.rightDrawer = true)); +const initializeFromQuery = () => { + const query = route.query.table ? JSON.parse(route.query.table) : {}; + shipped.value = query.shipped || shipped.toISOString(); + Object.assign(userParams, { shipped }); +}; function getApiUrl() { return new URL(window.location).origin; } @@ -133,6 +152,11 @@ function downloadPdfs() { } + - {{ t('route.cmr.list.downloadCmrs') }} + {{ t('route.cmr.params.downloadCmrs') }} { -import VnCardBeta from 'components/common/VnCardBeta.vue'; +import VnCard from 'components/common/VnCard.vue'; import RoadmapDescriptor from 'pages/Route/Roadmap/RoadmapDescriptor.vue'; - + diff --git a/src/pages/Route/Roadmap/RoadmapDescriptor.vue b/src/pages/Route/Roadmap/RoadmapDescriptor.vue index baa864a15..198bcf8c7 100644 --- a/src/pages/Route/Roadmap/RoadmapDescriptor.vue +++ b/src/pages/Route/Roadmap/RoadmapDescriptor.vue @@ -15,6 +15,10 @@ const $props = defineProps({ required: false, default: null, }, + summary: { + type: Object, + default: null, + }, }); const route = useRoute(); @@ -26,7 +30,12 @@ const entityId = computed(() => { - + diff --git a/src/pages/Route/RouteAutonomous.vue b/src/pages/Route/RouteAutonomous.vue index 3047cdf86..15db2a55f 100644 --- a/src/pages/Route/RouteAutonomous.vue +++ b/src/pages/Route/RouteAutonomous.vue @@ -13,6 +13,7 @@ import RouteSummary from 'pages/Route/Card/RouteSummary.vue'; import RouteDescriptorProxy from 'pages/Route/Card/RouteDescriptorProxy.vue'; import InvoiceInDescriptorProxy from 'pages/InvoiceIn/Card/InvoiceInDescriptorProxy.vue'; import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue'; +import AgencyDescriptorProxy from 'pages/Route/Agency/Card/AgencyDescriptorProxy.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnDms from 'components/common/VnDms.vue'; import VnTable from 'components/VnTable/VnTable.vue'; @@ -236,10 +237,16 @@ onUnmounted(() => (stateStore.rightDrawer = false)); selection: 'multiple', }" > - + - {{ row.routeFk }} - + {{ row?.agencyModeName }} + + + + + + {{ row?.agencyAgreement }} + diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue index a7e192765..fb19323c9 100644 --- a/src/pages/Route/RouteExtendedList.vue +++ b/src/pages/Route/RouteExtendedList.vue @@ -38,7 +38,7 @@ const routeFilter = { }; const columns = computed(() => [ { - align: 'center', + align: 'right', name: 'id', label: 'Id', chip: { @@ -46,11 +46,11 @@ const columns = computed(() => [ }, isId: true, columnFilter: false, + width: '25px', }, { - align: 'center', name: 'workerFk', - label: t('route.Worker'), + label: t('globals.worker'), create: true, component: 'select', attrs: { @@ -71,9 +71,8 @@ const columns = computed(() => [ format: (row, dashIfEmpty) => dashIfEmpty(row.workerUserName), }, { - align: 'center', name: 'agencyModeFk', - label: t('route.Agency'), + label: t('globals.agency'), isTitle: true, cardVisible: true, create: true, @@ -90,9 +89,8 @@ const columns = computed(() => [ format: (row, dashIfEmpty) => dashIfEmpty(row.agencyName), }, { - align: 'center', name: 'vehicleFk', - label: t('route.Vehicle'), + label: t('globals.vehicle'), cardVisible: true, create: true, component: 'select', @@ -111,9 +109,8 @@ const columns = computed(() => [ format: (row, dashIfEmpty) => dashIfEmpty(row.vehiclePlateNumber), }, { - align: 'center', name: 'dated', - label: t('route.Date'), + label: t('globals.date'), columnFilter: false, cardVisible: true, create: true, @@ -122,9 +119,8 @@ const columns = computed(() => [ dated === '0000-00-00' ? dashIfEmpty(null) : toDate(dated), }, { - align: 'center', name: 'from', - label: t('route.From'), + label: t('globals.from'), visible: false, cardVisible: true, create: true, @@ -132,9 +128,8 @@ const columns = computed(() => [ format: ({ from }) => toDate(from), }, { - align: 'center', name: 'to', - label: t('route.To'), + label: t('globals.to'), visible: false, cardVisible: true, create: true, @@ -142,30 +137,31 @@ const columns = computed(() => [ format: ({ date }) => toDate(date), }, { - align: 'center', + align: 'right', name: 'm3', label: 'm3', cardVisible: true, columnClass: 'shrink', + width: '50px', }, { - align: 'center', name: 'started', label: t('route.hourStarted'), component: 'time', columnFilter: false, format: ({ started }) => toHour(started), + width: '50px', }, { - align: 'center', name: 'finished', label: t('route.hourFinished'), component: 'time', columnFilter: false, format: ({ finished }) => toHour(finished), + width: '50px', }, { - align: 'center', + align: 'right', name: 'kmStart', label: t('route.KmStart'), columnClass: 'shrink', @@ -173,7 +169,7 @@ const columns = computed(() => [ visible: false, }, { - align: 'center', + align: 'right', name: 'kmEnd', label: t('route.KmEnd'), columnClass: 'shrink', @@ -181,16 +177,15 @@ const columns = computed(() => [ visible: false, }, { - align: 'center', + align: 'left', name: 'description', - label: t('route.Description'), + label: t('globals.description'), isTitle: true, create: true, component: 'input', field: 'description', }, { - align: 'center', name: 'isOk', label: t('route.Served'), component: 'checkbox', @@ -202,7 +197,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('route.Add tickets'), + title: t('route.addTicket'), icon: 'vn:ticketAdd', action: (row) => openTicketsDialog(row?.id), isPrimary: true, @@ -214,7 +209,7 @@ const columns = computed(() => [ isPrimary: true, }, { - title: t('route.Route summary'), + title: t('route.routeSummary'), icon: 'arrow_forward', action: (row) => navigate(row?.id), isPrimary: true, @@ -276,11 +271,13 @@ const openTicketsDialog = (id) => { - {{ t('route.Select the starting date') }} + + {{ t('route.extendedList.selectStartingDate') }} + @@ -288,7 +285,7 @@ const openTicketsDialog = (id) => { @@ -339,7 +336,7 @@ const openTicketsDialog = (id) => { :disable="!selectedRows?.length" @click="confirmationDialog = true" > - {{ t('route.Clone Selected Routes') }} + {{ t('route.extendedList.cloneSelectedRoutes') }} { :disable="!selectedRows?.length" @click="showRouteReport" > - {{ t('route.Download selected routes as PDF') }} + {{ + t('route.extendedList.downloadSelectedRoutes') + }} { :disable="!selectedRows?.length" @click="markAsServed()" > - {{ t('route.Mark as served') }} + {{ t('route.extendedList.markServed') }} diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 5723e2f0d..7fc1027ea 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -7,8 +7,11 @@ import RouteSummary from 'pages/Route/Card/RouteSummary.vue'; import RouteFilter from 'pages/Route/Card/RouteFilter.vue'; import VnTable from 'components/VnTable/VnTable.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +import AgencyDescriptorProxy from 'src/pages/Route/Agency/Card/AgencyDescriptorProxy.vue'; +import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue'; import VnSection from 'src/components/common/VnSection.vue'; import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; +import RouteTickets from './RouteTickets.vue'; const { t } = useI18n(); const { viewSummary } = useSummaryDialog(); @@ -24,6 +27,12 @@ const routeFilter = { }, ], }; + +function redirectToTickets(id) { + const url = `#/route/${id}/tickets`; + window.open(url, '_blank'); +} + const columns = computed(() => [ { align: 'right', @@ -34,25 +43,29 @@ const columns = computed(() => [ condition: () => true, }, columnFilter: false, + width: '25px', }, { - align: 'left', name: 'workerFk', - label: t('route.Worker'), + label: t('gloabls.worker'), component: markRaw(VnSelectWorker), create: true, - cardVisible: true, format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef), columnFilter: false, + width: '100px', }, { - align: 'left', - name: 'agencyName', - label: t('route.Agency'), + name: 'workerFk', + label: t('globals.worker'), + visible: false, cardVisible: true, }, { - label: t('route.Agency'), + name: 'agencyName', + label: t('globals.agency'), + }, + { + label: t('globals.Agency'), name: 'agencyModeFk', component: 'select', attrs: { @@ -68,14 +81,18 @@ const columns = computed(() => [ visible: false, }, { - align: 'left', - name: 'vehiclePlateNumber', - label: t('route.Vehicle'), + name: 'agencyName', + label: t('globals.agency'), + visible: false, cardVisible: true, }, + { + name: 'vehiclePlateNumber', + label: t('globals.vehicle'), + }, { name: 'vehicleFk', - label: t('route.Vehicle'), + label: t('globals.Vehicle'), cardVisible: true, component: 'select', attrs: { @@ -93,25 +110,27 @@ const columns = computed(() => [ visible: false, }, { - align: 'left', + align: 'center', name: 'started', label: t('route.hourStarted'), cardVisible: true, columnFilter: false, - format: (row) => toHour(row.started), + format: ({ started }) => toHour(started), + width: '50px', }, { - align: 'left', + align: 'center', name: 'finished', label: t('route.hourFinished'), cardVisible: true, columnFilter: false, - format: (row) => toHour(row.started), + format: ({ finished }) => toHour(finished), + width: '50px', }, { align: 'left', name: 'description', - label: t('route.Description'), + label: t('globals.description'), cardVisible: true, isTitle: true, create: true, @@ -119,7 +138,6 @@ const columns = computed(() => [ columnFilter: false, }, { - align: 'left', name: 'isOk', label: t('route.Served'), component: 'checkbox', @@ -130,6 +148,12 @@ const columns = computed(() => [ align: 'right', name: 'tableActions', actions: [ + { + title: t('globals.pageTitles.tickets'), + icon: 'vn:ticket', + action: (row) => redirectToTickets(row?.id), + isPrimary: true, + }, { title: t('components.smartCard.viewSummary'), icon: 'preview', @@ -155,6 +179,7 @@ const columns = computed(() => [ [ + + + {{ row?.agencyName }} + + + + + + {{ row?.vehiclePlateNumber }} + + + diff --git a/src/pages/Route/RouteRoadmap.vue b/src/pages/Route/RouteRoadmap.vue index 23b1b1d5b..c981b86a5 100644 --- a/src/pages/Route/RouteRoadmap.vue +++ b/src/pages/Route/RouteRoadmap.vue @@ -2,13 +2,11 @@ import { useI18n } from 'vue-i18n'; import { computed, ref } from 'vue'; import { dashIfEmpty } from 'src/filters'; -import { toDate, toDateHourMin } from 'filters/index'; +import { toDate, toDateHourMin, toCurrency } from 'filters/index'; import { useQuasar } from 'quasar'; import { useSummaryDialog } from 'composables/useSummaryDialog'; -import toCurrency from 'filters/toCurrency'; import axios from 'axios'; -import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnTable from 'components/VnTable/VnTable.vue'; import RoadmapSummary from 'pages/Route/Roadmap/RoadmapSummary.vue'; @@ -17,6 +15,8 @@ import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputTime from 'src/components/common/VnInputTime.vue'; import VnSection from 'src/components/common/VnSection.vue'; import RoadmapFilter from './Roadmap/RoadmapFilter.vue'; +import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue'; +import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; const { viewSummary } = useSummaryDialog(); const { t } = useI18n(); @@ -33,7 +33,7 @@ const columns = computed(() => [ { align: 'left', name: 'name', - label: t('Roadmap'), + label: t('route.roadmap.roadmap'), create: true, cardVisible: true, columnFilter: { @@ -41,9 +41,9 @@ const columns = computed(() => [ }, }, { - align: 'left', + align: 'center', name: 'etd', - label: t('ETD'), + label: t('route.roadmap.etd'), component: 'date', columnFilter: { inWhere: true, @@ -54,7 +54,7 @@ const columns = computed(() => [ { align: 'left', name: 'supplierFk', - label: t('Carrier'), + label: t('route.roadmap.carrier'), component: 'select', attrs: { url: 'suppliers', @@ -65,21 +65,21 @@ const columns = computed(() => [ }, { name: 'tractorPlate', - label: t('Plate'), + label: t('route.roadmap.vehicle'), field: (row) => row.tractorPlate, sortable: true, align: 'left', }, { name: 'price', - label: t('Price'), - field: (row) => toCurrency(row.price), + label: t('route.roadmap.price'), + format: ({ price }) => toCurrency(price), sortable: true, - align: 'left', + align: 'right', }, { name: 'observations', - label: t('Observations'), + label: t('route.roadmap.observations'), field: (row) => dashIfEmpty(row.observations), sortable: true, align: 'left', @@ -89,7 +89,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('Ver cmr'), + title: t('route.roadmap.seeCmr'), icon: 'preview', isPrimary: true, action: (row) => viewSummary(row?.id, RoadmapSummary), @@ -124,8 +124,8 @@ function confirmRemove() { .dialog({ component: VnConfirm, componentProps: { - title: t('Selected roadmaps will be removed'), - message: t('Are you sure you want to continue?'), + title: t('route.roadmap.selectedRoadmapsRemoved'), + message: t('route.roadmap.areYouSure'), promise: removeSelection, }, }) @@ -157,15 +157,24 @@ function exprBuilder(param, value) { - {{ t('Select the estimated date of departure (ETD)') }} + {{ t('route.roadmap.selectEtd') }} - + - + {{ t('globals.clone') }} @@ -181,7 +190,7 @@ function exprBuilder(param, value) { :disable="!selectedRows?.length" @click="isCloneDialogOpen = true" > - {{ t('Clone Selected Routes') }} + {{ t('route.roadmap.cloneSelected') }} - {{ t('Delete roadmap(s)') }} + {{ t('route.roadmap.deleteRoadmap') }} @@ -222,7 +231,7 @@ function exprBuilder(param, value) { redirect="route/roadmap" :create="{ urlCreate: 'Roadmaps', - title: t('Create routemap'), + title: t('route.roadmap.createRoadmap'), onDataSaved: ({ id }) => tableRef.redirect(id), formInitialData: {}, }" @@ -232,7 +241,10 @@ function exprBuilder(param, value) { {{ toDateHourMin(row.etd) }} - {{ row.supplierFk }} + + {{ row.driverName }} + + @@ -251,21 +263,3 @@ function exprBuilder(param, value) { gap: 12px; } - -es: - Create routemap: Crear troncal - Search roadmaps: Buscar troncales - You can search by roadmap reference: Puedes buscar por referencia del troncal - Delete roadmap(s): Eliminar troncal(es) - Selected roadmaps will be removed: Los troncales seleccionadas serán eliminados - Are you sure you want to continue?: ¿Seguro que quieres continuar? - The date can't be empty: La fecha no puede estar vacía - Clone Selected Routes: Clonar rutas seleccionadas - Create roadmap: Crear troncal - Roadmap: Troncal - Carrier: Transportista - Plate: Matrícula - Price: Precio - Observations: Observaciones - Select the estimated date of departure (ETD): Selecciona la fecha estimada de salida - diff --git a/src/pages/Route/RouteTickets.vue b/src/pages/Route/RouteTickets.vue index adc7dfdaa..b17fb543f 100644 --- a/src/pages/Route/RouteTickets.vue +++ b/src/pages/Route/RouteTickets.vue @@ -37,9 +37,9 @@ const columns = computed(() => [ align: 'left', }, { - name: 'city', - label: t('City'), - field: (row) => row?.city, + name: 'client', + label: t('Client'), + field: (row) => row?.nickname, sortable: false, align: 'left', }, @@ -51,9 +51,9 @@ const columns = computed(() => [ align: 'center', }, { - name: 'client', - label: t('Client'), - field: (row) => row?.nickname, + name: 'city', + label: t('City'), + field: (row) => row?.city, sortable: false, align: 'left', }, diff --git a/src/pages/Route/Vehicle/Card/VehicleCard.vue b/src/pages/Route/Vehicle/Card/VehicleCard.vue index f59420aa2..b6038c24c 100644 --- a/src/pages/Route/Vehicle/Card/VehicleCard.vue +++ b/src/pages/Route/Vehicle/Card/VehicleCard.vue @@ -1,10 +1,10 @@ - +import { computed } from 'vue'; +import { useRoute } from 'vue-router'; import VnLv from 'src/components/ui/VnLv.vue'; import CardDescriptor from 'components/ui/CardDescriptor.vue'; import axios from 'axios'; import useNotify from 'src/composables/useNotify.js'; const { notify } = useNotify(); + +const props = defineProps({ + id: { + type: Number, + required: false, + default: null, + }, +}); + +const route = useRoute(); +const entityId = computed(() => props.id || route.params.id); +import VehicleDescriptor from 'pages/Route/Vehicle/Card/VehicleDescriptor.vue'; +import VehicleSummary from './VehicleSummary.vue'; + +const $props = defineProps({ + id: { + type: Number, + required: true, + }, + summary: { + type: Object, + default: null, + }, +}); + + + + + + diff --git a/src/pages/Route/Vehicle/Card/VehicleSummary.vue b/src/pages/Route/Vehicle/Card/VehicleSummary.vue index e4b0a9497..13d4bbc9d 100644 --- a/src/pages/Route/Vehicle/Card/VehicleSummary.vue +++ b/src/pages/Route/Vehicle/Card/VehicleSummary.vue @@ -13,12 +13,13 @@ const props = defineProps({ id: { type: [Number, String], default: null } }); const route = useRoute(); const entityId = computed(() => props.id || +route.params.id); +const baseLink = `#/${route.meta.moduleName.toLowerCase()}/vehicle/${entityId.value}`; const links = { - 'basic-data': `#/vehicle/${entityId.value}/basic-data`, - notes: `#/vehicle/${entityId.value}/notes`, - dms: `#/vehicle/${entityId.value}/dms`, - 'invoice-in': `#/vehicle/${entityId.value}/invoice-in`, - events: `#/vehicle/${entityId.value}/events`, + 'basic-data': `${baseLink}/basic-data`, + notes: `${baseLink}/notes`, + dms: `${baseLink}/dms`, + 'invoice-in': `${baseLink}/invoice-in`, + events: `${baseLink}/events`, }; @@ -54,7 +55,10 @@ const links = { {{ entity.supplier?.name }} - + @@ -63,6 +67,7 @@ const links = { {{ entity.supplierCooler?.name }} diff --git a/src/pages/Route/Vehicle/VehicleList.vue b/src/pages/Route/Vehicle/VehicleList.vue index e5b945010..a79cc2e35 100644 --- a/src/pages/Route/Vehicle/VehicleList.vue +++ b/src/pages/Route/Vehicle/VehicleList.vue @@ -116,6 +116,7 @@ const columns = computed(() => [ title: t('components.smartCard.openSummary'), icon: 'preview', action: (row) => viewSummary(row.id, VehicleSummary), + isPrimary: true, }, ], }, diff --git a/src/pages/Route/locale/en.yml b/src/pages/Route/locale/en.yml index cc445f412..283b61855 100644 --- a/src/pages/Route/locale/en.yml +++ b/src/pages/Route/locale/en.yml @@ -1,48 +1,79 @@ route: + filter: + Served: Served + extendedList: + selectStartingDate: Select the starting date + startingDate: Starting date + cloneSelectedRoutes: Clone selected routes + downloadSelectedRoutes: Download selected routes as PDF + markServed: Mark as served roadmap: + roadmap: Roadmap + carrier: Carrier + vehicle: Vehicle + price: Price + observations: Observations + etd: ETD + dateCantEmpty: The date can't be empty + createRoadmap: Create roadmap + deleteRoadmap: Delete roadmap(s) + cloneSelected: Clone selected routes + selectedRoadmapsRemoved: Selected roadmaps will be removed + areYouSure: Are you sure you want to continue? + selectEtd: Select the estimated date of departure (ETD) search: Search roadmap searchInfo: You can search by roadmap reference params: + warehouseFk: Warehouse + description: Description + m3: m³ + scopeDays: Days Onward + vehicleFk: Vehicle + agencyModeFk: Agency + workerFk: Worker + from: From + to: To + isOk: Served etd: ETD tractorPlate: Plate price: Price observations: Observations - id: ID + id: Id name: Name cmrFk: CMR id hasCmrDms: Attached in gestdoc ticketFk: Ticketd id routeFk: Route id + clientFk: Client id + countryFk: Country shipped: Shipped agencyAgreement: Agency agreement agencyModeName: Agency route + isOwn: Own + isAnyVolumeallowed: Any volume allowed Worker: Worker Agency: Agency Vehicle: Vehicle Description: Description hourStarted: H.Start hourFinished: H.End - dated: Dated - From: From - To: To + createRoute: Create route Date: Date KmStart: Km start KmEnd: Km end Served: Served - Clone Selected Routes: Clone selected routes - Select the starting date: Select the starting date - Stating date: Starting date - Cancel: Cancel - Mark as served: Mark as served - Download selected routes as PDF: Download selected routes as PDF - Add ticket: Add ticket - Summary: Summary + addTicket: Add ticket + routeSummary: Go to summary Route is closed: Route is closed Route is not served: Route is not served search: Search route searchInfo: You can search by route reference + dated: Dated + preview: Preview cmr: - list: + search: Search Cmr + searchInfo: You can search Cmr by Id + params: results: results cmrFk: CMR id hasCmrDms: Attached in gestdoc @@ -50,8 +81,10 @@ route: 'false': 'No' ticketFk: Ticketd id routeFk: Route id - country: Country + countryFk: Country clientFk: Client id + warehouseFk: Warehouse shipped: Preparation date viewCmr: View CMR - downloadCmrs: Download CMRs \ No newline at end of file + downloadCmrs: Download CMRs + search: General search diff --git a/src/pages/Route/locale/es.yml b/src/pages/Route/locale/es.yml index 51d43774a..2785ded31 100644 --- a/src/pages/Route/locale/es.yml +++ b/src/pages/Route/locale/es.yml @@ -1,21 +1,57 @@ route: + filter: + Served: Servida + extendedList: + selectStartingDate: Seleccione la fecha de inicio + statingDate: Fecha de inicio + cloneSelectedRoutes: Clonar rutas seleccionadas + downloadSelectedRoutes: Descargar rutas seleccionadas como PDF + markServed: Marcar como servidas roadmap: + roadmap: Troncal + carrier: Transportista + vehicle: Vehículo + price: Precio + observations: Observaciones + etd: ETD + dateCantEmpty: La fecha no puede estar vacía + createRoadmap: Crear troncal + deleteRoadmap: Eliminar troncal(es) + cloneSelected: Clonar rutas seleccionadas + selectedRoadmapsRemoved: Los troncales seleccionadas serán eliminados + areYouSure: ¿Seguro que quieres continuar? + selectEtd: Selecciona la fecha estimada de salida search: Buscar troncales searchInfo: Puedes buscar por referencia del troncal params: - agencyModeName: Agencia Ruta - agencyAgreement: Agencia Acuerdo - id: Id - name: Troncal + warehouseFk: Almacén + description: Descripción + m3: m³ + scopeDays: Días adelante + vehicleFk: Vehículo + agencyModeFk: Agencia + workerFk: Trabajador + from: Desde + to: Hasta + isOk: Servida etd: ETD tractorPlate: Matrícula price: Precio observations: Observaciones + id: Id + name: Troncal cmrFk: Id CMR hasCmrDms: Gestdoc + search: Búsqueda general ticketFk: Id ticket - routeFK: Id ruta + routeFk: Id ruta + clientFk: Id cliente + countryFk: Pais shipped: Fecha preparación + agencyModeName: Agencia Ruta + agencyAgreement: Agencia Acuerdo + isOwn: Propio + isAnyVolumeAllowed: Cualquier volumen Worker: Trabajador Agency: Agencia Vehicle: Vehículo @@ -23,25 +59,18 @@ route: hourStarted: H.Inicio hourFinished: H.Fin createRoute: Crear ruta - From: Desde - To: Hasta Date: Fecha KmStart: Km inicio KmEnd: Km fin Served: Servida - Clone Selected Routes: Clonar rutas seleccionadas - Select the starting date: Seleccione la fecha de inicio - Stating date: Fecha de inicio - Cancel: Cancelar - Mark as served: Marcar como servidas - Download selected routes as PDF: Descargar rutas seleccionadas como PDF - Add ticket: Añadir tickets - preview: Vista previa - Summary: Resumen + addTicket: Añadir tickets + routeSummary: Ir a vista previa Route is closed: La ruta está cerrada Route is not served: La ruta no está servida search: Buscar rutas searchInfo: Puedes buscar por referencia de la ruta + dated: Fecha + preview: Vista previa cmr: list: results: resultados @@ -55,4 +84,4 @@ route: clientFk: Id cliente shipped: Fecha preparación viewCmr: Ver CMR - downloadCmrs: Descargar CMRs \ No newline at end of file + downloadCmrs: Descargar CMRs diff --git a/src/pages/Shelving/Card/ShelvingCard.vue b/src/pages/Shelving/Card/ShelvingCard.vue index 9e0ac8ad2..e2fb79fb0 100644 --- a/src/pages/Shelving/Card/ShelvingCard.vue +++ b/src/pages/Shelving/Card/ShelvingCard.vue @@ -1,11 +1,11 @@ - - + diff --git a/src/pages/Shelving/Card/ShelvingSummary.vue b/src/pages/Shelving/Card/ShelvingSummary.vue index f89ff4d78..4a6669624 100644 --- a/src/pages/Shelving/Card/ShelvingSummary.vue +++ b/src/pages/Shelving/Card/ShelvingSummary.vue @@ -6,6 +6,7 @@ import VnLv from 'components/ui/VnLv.vue'; import VnUserLink from 'components/ui/VnUserLink.vue'; import filter from './ShelvingFilter.js'; import ShelvingDescriptorMenu from './ShelvingDescriptorMenu.vue'; +import VnTitle from 'src/components/common/VnTitle.vue'; const $props = defineProps({ id: { @@ -38,13 +39,10 @@ const entityId = computed(() => $props.id || route.params.id); - - {{ $t('globals.pageTitles.basicData') }} - - + -import VnCardBeta from 'components/common/VnCardBeta.vue'; +import VnCard from 'components/common/VnCard.vue'; import ParkingDescriptor from 'pages/Shelving/Parking/Card/ParkingDescriptor.vue'; import filter from './ParkingFilter.js'; - - - {{ t('globals.pageTitles.basicData') }} - - + import SupplierDescriptor from './SupplierDescriptor.vue'; -import VnCardBeta from 'src/components/common/VnCardBeta.vue'; +import VnCard from 'src/components/common/VnCard.vue'; import filter from './SupplierFilter.js'; - { - {{ buy.itemName }} + {{ buy.itemName }} diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index d1d437a19..ec89d77e0 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -172,6 +172,7 @@ const filterColumns = computed(() => { > { shipped: ticket.value.shipped, }; const { data } = await axios.post( - `tickets/${ticket.value.id}/priceDifference`, - params + `tickets/${formData.value.id}/priceDifference`, + params, ); ticket.value.sale = data; }; @@ -71,8 +71,8 @@ const submit = async () => { }; const { data } = await axios.post( - `tickets/${ticket.value.id}/componentUpdate`, - params + `tickets/${formData.value.id}/componentUpdate`, + params, ); if (!data) return; @@ -99,7 +99,7 @@ const onNextStep = async () => { openConfirmationModal( t('basicData.negativesConfirmTitle'), t('basicData.negativesConfirmMessage'), - submitWithNegatives + submitWithNegatives, ); else submit(); } diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue index e22d5799a..19dbd608c 100644 --- a/src/pages/Ticket/Card/TicketCard.vue +++ b/src/pages/Ticket/Card/TicketCard.vue @@ -1,10 +1,10 @@ - { return $props.id || route.params.id; }); const problems = ref({}); +const originalTicket = ref(); function ticketFilter(ticket) { return JSON.stringify({ clientFk: ticket.clientFk }); } +async function getClaims() { + const userFilter = { where: { refundTicketFk: entityId.value } }; + const { data } = await axios.get(`TicketRefunds`, { + params: { filter: JSON.stringify(userFilter) }, + }); + if (!data) return; + originalTicket.value = data[0]?.originalTicketFk; +} +async function getProblems() { + const { data } = await axios.get(`Tickets/${entityId.value}/getTicketProblems`); + if (!data) return; + problems.value = data[0]; +} +function getInfo() { + getClaims(); + getProblems(); +} - ([problems] = data)" - /> @@ -73,12 +88,12 @@ function ticketFilter(ticket) { - + - + + {{ entity?.client?.department?.name || '-' }} + + - + @@ -129,6 +144,15 @@ function ticketFilter(ticket) { > {{ t('ticket.card.newOrder') }} + + {{ t('ticket.card.ticketClaimed') }} + diff --git a/src/pages/Ticket/Card/TicketEditMana.vue b/src/pages/Ticket/Card/TicketEditMana.vue index ff40a6592..266c82ccd 100644 --- a/src/pages/Ticket/Card/TicketEditMana.vue +++ b/src/pages/Ticket/Card/TicketEditMana.vue @@ -33,7 +33,7 @@ const save = (sale = $props.sale) => { }; const getMana = async () => { - const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`); + const { data } = await axios.get(`Tickets/${route.params.id}/getDepartmentMana`); mana.value = data; await getUsesMana(); }; diff --git a/src/pages/Ticket/Card/TicketFilter.js b/src/pages/Ticket/Card/TicketFilter.js index 7846f1658..daa204a7a 100644 --- a/src/pages/Ticket/Card/TicketFilter.js +++ b/src/pages/Ticket/Card/TicketFilter.js @@ -12,7 +12,7 @@ export default { fields: [ 'id', 'name', - 'salesPersonFk', + 'departmentFk', 'phone', 'mobile', 'email', @@ -29,7 +29,7 @@ export default { fields: ['id', 'lang'], }, }, - { relation: 'salesPersonUser' }, + { relation: 'department' }, ], }, }, diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue index e69d489c0..2fb305cc3 100644 --- a/src/pages/Ticket/Card/TicketSale.vue +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -174,22 +174,26 @@ const getSaleTotal = (sale) => { return price - discount; }; -const getRowUpdateInputEvents = (sale) => ({ - 'keyup.enter': () => { - changeQuantity(sale); - }, - blur: () => { - changeQuantity(sale); - }, -}); +const getRowUpdateInputEvents = (sale) => { + return { + 'keyup.enter': () => { + changeQuantity(sale); + }, + blur: () => { + changeQuantity(sale); + }, + }; +}; const resetChanges = async () => { arrayData.fetch({ append: false }); tableRef.value.reload(); + selectedRows.value = []; }; const changeQuantity = async (sale) => { if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity) return; + else sale.originalQuantity = sale.quantity; if (!sale.id) return addSale(sale); if (await isSalePrepared(sale)) { @@ -235,7 +239,7 @@ const addSale = async (sale) => { notify('globals.dataSaved', 'positive'); sale.isNew = false; - arrayData.fetch({}); + resetChanges(); }; const changeConcept = async (sale) => { if (await isSalePrepared(sale)) { @@ -258,6 +262,18 @@ const DEFAULT_EDIT = { oldQuantity: null, }; const edit = ref({ ...DEFAULT_EDIT }); +const usesMana = ref(null); + +const getUsesMana = async () => { + const { data } = await axios.get('Sales/usesMana'); + usesMana.value = data; +}; + +const getMana = async () => { + const { data } = await axios.get(`Tickets/${route.params.id}/getDepartmentMana`); + mana.value = data; + await getUsesMana(); +}; const selectedValidSales = computed(() => { if (!sales.value) return; @@ -310,7 +326,7 @@ const changeDiscount = async (sale) => { } }; -const updateDiscounts = async (sales, newDiscount = null) => { +const updateDiscounts = async (sales, newDiscount) => { const salesTracking = await fetchSalesTracking(); const someSaleIsPrepared = salesTracking.some((sale) => @@ -320,12 +336,11 @@ const updateDiscounts = async (sales, newDiscount = null) => { else updateDiscount(sales, newDiscount); }; -const updateDiscount = async (sales, newDiscount = null) => { - const saleIds = sales.map((sale) => sale.id); - const _newDiscount = newDiscount || edit.value.discount; +const updateDiscount = async (sales, newDiscount = 0) => { + const salesIds = sales.map(({ id }) => id); const params = { - salesIds: saleIds, - newDiscount: _newDiscount, + salesIds, + newDiscount, manaCode: manaCode.value, }; await axios.post(`Tickets/${route.params.id}/updateDiscount`, params); @@ -474,7 +489,7 @@ const endNewRow = (row) => { }; async function confirmUpdate(cb) { - await quasar + quasar .dialog({ component: VnConfirm, componentProps: { @@ -664,6 +679,7 @@ watch( selection: 'multiple', }" :right-search="false" + :search-url="false" :column-search="false" :disable-option="{ card: true }" auto-load @@ -703,7 +719,7 @@ watch( - + @@ -751,7 +767,7 @@ watch( {{ row?.item?.subName.toUpperCase() }} - + { } return false; }); -const hasReserves = computed(() => props.sales.some((sale) => sale.reserved == true)); - const sendSms = async (params) => { await axios.post(`Tickets/${ticket.value.id}/sendSms`, params); notify(t('SMS sent'), 'positive'); @@ -144,14 +142,6 @@ const onCreateClaimAccepted = async () => { push({ name: 'ClaimBasicData', params: { id: data.id } }); }; -const setReserved = async (reserved) => { - const params = { ticketId: ticket.value.id, sales: props.sales, reserved: reserved }; - await axios.post(`Sales/reserve`, params); - props.sales.forEach((sale) => { - sale.reserved = reserved; - }); -}; - const createRefund = async (withWarehouse) => { if (!props.ticket) return; @@ -252,18 +242,6 @@ const createRefund = async (withWarehouse) => { {{ t('Mark as reserved') }} - - - {{ t('Unmark as reserved') }} - - {{ t('Refund') }} diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index 5838efa88..a19ab3779 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -13,9 +13,9 @@ import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import { getUrl } from 'src/composables/getUrl'; import useNotify from 'src/composables/useNotify.js'; import { useArrayData } from 'composables/useArrayData'; -import VnUserLink from 'src/components/ui/VnUserLink.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; +import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnToSummary from 'src/components/ui/VnToSummary.vue'; @@ -152,12 +152,14 @@ onMounted(async () => { - + - + + {{ entity?.client?.department?.name || '-' }} + + diff --git a/src/pages/Ticket/Negative/TicketLackTable.vue b/src/pages/Ticket/Negative/TicketLackTable.vue index 176e8f7ad..c9c2a7cad 100644 --- a/src/pages/Ticket/Negative/TicketLackTable.vue +++ b/src/pages/Ticket/Negative/TicketLackTable.vue @@ -225,7 +225,7 @@ function onBuysFetched(data) { /> - + {{ item?.longName ?? item.name }} diff --git a/src/pages/Ticket/TicketAdvance.vue b/src/pages/Ticket/TicketAdvance.vue index 94b4623aa..bf3593acd 100644 --- a/src/pages/Ticket/TicketAdvance.vue +++ b/src/pages/Ticket/TicketAdvance.vue @@ -259,7 +259,7 @@ const moveTicketsAdvance = async () => { destinationId: ticket.id, originShipped: ticket.futureShipped, destinationShipped: ticket.shipped, - salesPersonFk: ticket.workerFk, + departmentFk: ticket.departmentFk, }); } const params = { tickets: ticketsToMove }; @@ -285,7 +285,7 @@ const progressAdd = () => { t('advanceTickets.moveTicketSuccess', { ticketsNumber: progressLength.value - splitErrors.value.length, }), - 'positive' + 'positive', ); } }; @@ -345,16 +345,16 @@ watch( originElRef.value.setAttribute('colspan', '9'); destinationElRef.value.textContent = `${t( - 'advanceTickets.destination' + 'advanceTickets.destination', )} ${toDateFormat(vnTableRef.value.params.dateToAdvance)}`; originElRef.value.textContent = `${t('advanceTickets.origin')} ${toDateFormat( - vnTableRef.value.params.dateFuture + vnTableRef.value.params.dateFuture, )}`; newRow.append(destinationElRef.value, originElRef.value); head.insertBefore(newRow, firstRow); }, - { once: true, inmmediate: true } + { once: true, inmmediate: true }, ); watch( @@ -362,14 +362,14 @@ watch( () => { if (originElRef.value && destinationElRef.value) { destinationElRef.value.textContent = `${t( - 'advanceTickets.destination' + 'advanceTickets.destination', )} ${toDateFormat(vnTableRef.value.params.dateToAdvance)}`; originElRef.value.textContent = `${t('advanceTickets.origin')} ${toDateFormat( - vnTableRef.value.params.dateFuture + vnTableRef.value.params.dateFuture, )}`; } }, - { deep: true } + { deep: true }, ); @@ -405,7 +405,7 @@ watch( t(`advanceTickets.advanceTitleSubtitle`, { selectedTickets: selectedTickets.length, }), - moveTicketsAdvance + moveTicketsAdvance, ) " > @@ -423,7 +423,7 @@ watch( t(`advanceTickets.advanceWithoutNegativeSubtitle`, { selectedTickets: selectedTickets.length, }), - splitTickets + splitTickets, ) " > diff --git a/src/pages/Ticket/TicketFilter.vue b/src/pages/Ticket/TicketFilter.vue index bdf75c826..f959157f6 100644 --- a/src/pages/Ticket/TicketFilter.vue +++ b/src/pages/Ticket/TicketFilter.vue @@ -97,15 +97,15 @@ const getGroupedStates = (data) => { - @@ -308,7 +308,6 @@ en: from: From shipped: Shipped to: To - salesPersonFk: Salesperson stateFk: State groupedStates: Grouped State refFk: Invoice Ref. @@ -336,7 +335,6 @@ es: from: Desde shipped: F. envío to: Hasta - salesPersonFk: Comercial stateFk: Estado groupedStates: Estado agrupado refFk: Ref. Factura @@ -355,7 +353,6 @@ es: Order ID: ID Pedido From: Desde To: Hasta - Salesperson: Comercial State: Estado Invoice Ref.: Ref. Factura My team: Mi equipo diff --git a/src/pages/Ticket/TicketFuture.vue b/src/pages/Ticket/TicketFuture.vue index 92911cd25..588379ed9 100644 --- a/src/pages/Ticket/TicketFuture.vue +++ b/src/pages/Ticket/TicketFuture.vue @@ -160,7 +160,7 @@ const moveTicketsFuture = async () => { destinationId: ticket.futureId, originShipped: ticket.shipped, destinationShipped: ticket.futureShipped, - salesPersonFk: ticket.salesPersonFk, + departmentFk: ticket.departmentFk, }; }); diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index b2e13fcb6..c603246d1 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -17,6 +17,7 @@ import TicketFilter from './TicketFilter.vue'; import VnInput from 'src/components/common/VnInput.vue'; import FetchData from 'src/components/FetchData.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; import { toTimeFormat } from 'src/filters/date'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; @@ -54,8 +55,7 @@ onBeforeMount(() => { onMounted(async () => { if (!route.query) return; if (route.query?.createForm) { - formInitialData.value = JSON.parse(route.query?.createForm); - await onClientSelected(formInitialData.value); + await onClientSelected(JSON.parse(route.query?.createForm)); } else if (route.query?.table) { const query = route.query?.table; const clientId = +JSON.parse(query)?.clientFk; @@ -100,22 +100,16 @@ const columns = computed(() => [ }, { align: 'left', - label: t('ticketList.salesPerson'), - name: 'salesPersonFk', + name: 'departmentFk', + label: t('customer.summary.team'), component: 'select', attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name'], - where: { role: 'salesPerson' }, - optionFilter: 'firstName', - useLike: false, + url: 'Departments', }, columnField: { component: null, }, - columnClass: 'expand', - cardVisible: true, - format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson), + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), }, { align: 'left', @@ -273,12 +267,18 @@ const fetchAddresses = async (formData) => { return; } const { data } = await getAddresses(formData.clientId); - formInitialData.value = { clientId: formData.clientId }; - if (!data) return; + + if (!data) { + formInitialData.value = { clientId: formData.clientId }; + return; + } addressesOptions.value = data; selectedClient.value = data[0].client; formData.addressId = selectedClient.value.defaultAddressFk; - formInitialData.value.addressId = formData.addressId; + formInitialData.value = { + clientId: formData.clientId, + addressId: formData.addressId, + }; }; watch( () => route.query.table, @@ -514,10 +514,10 @@ function setReference(data) { - + - {{ dashIfEmpty(row.userName) }} - + {{ dashIfEmpty(row.departmentName) }} + diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue index 0e18fe028..d6493550b 100644 --- a/src/pages/Ticket/TicketWeekly.vue +++ b/src/pages/Ticket/TicketWeekly.vue @@ -5,7 +5,7 @@ import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelectCache from 'src/components/common/VnSelectCache.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; -import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import { useStateStore } from 'stores/useStateStore'; import { useVnConfirm } from 'composables/useVnConfirm'; @@ -112,23 +112,17 @@ const columns = computed(() => [ }, { align: 'left', - name: 'id', - label: t('weeklyTickets.salesperson'), - columnFilter: { - component: 'select', - alias: 'u', - attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name'], - where: { role: 'salesperson' }, - }, - inWhere: true, + name: 'departmentFk', + label: t('customer.summary.team'), + component: 'select', + attrs: { + url: 'Departments', }, + create: true, columnField: { component: null, }, - cardVisible: true, - format: (row) => row.userName, + format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName), }, { align: 'right', @@ -142,9 +136,9 @@ const columns = computed(() => [ openConfirmationModal( t('You are going to delete this weekly ticket'), t( - 'This ticket will be removed from weekly tickets! Continue anyway?' + 'This ticket will be removed from weekly tickets! Continue anyway?', ), - () => deleteWeekly(row.ticketFk) + () => deleteWeekly(row.ticketFk), ), isPrimary: true, }, @@ -219,10 +213,10 @@ onMounted(async () => { - + - {{ row.userName }} - + {{ row.departmentName }} + diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml index cdbb22d9b..9eb8ce8cb 100644 --- a/src/pages/Ticket/locale/en.yml +++ b/src/pages/Ticket/locale/en.yml @@ -136,7 +136,6 @@ purchaseRequest: weeklyTickets: id: Ticket ID shipment: Shipment - salesperson: Salesperson search: Search weekly tickets searchInfo: Search weekly tickets by id or client id ticketSaleTracking: @@ -172,7 +171,7 @@ tracking: addState: Add state package: package: Package - added: Added + added: D. Added addPackage: Add package removePackage: Remove package ticketList: @@ -181,7 +180,6 @@ ticketList: state: State shipped: Shipped zone: Zone - salesPerson: Sales person totalWithVat: Total with VAT summary: Summary client: Customer diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index 75d3c6a2b..62013d9c5 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -58,7 +58,6 @@ basicData: weeklyTickets: id: ID Ticket shipment: Salida - salesperson: Comercial search: Buscar por tickets programados searchInfo: Buscar tickets programados por el identificador o el identificador del cliente advanceTickets: @@ -162,7 +161,7 @@ expedition: removeExpedition: Eliminar expedición package: package: Embalaje - added: Añadido + added: F. Creacion addPackage: Añadir embalaje removePackage: Quitar embalaje ticketSaleTracking: @@ -186,7 +185,6 @@ ticketList: state: Estado shipped: F. Envío zone: Zona - salesPerson: Comercial totalWithVat: Total con IVA summary: Resumen client: Cliente diff --git a/src/pages/Travel/Card/TravelCard.vue b/src/pages/Travel/Card/TravelCard.vue index cb09eafd6..479b47fb9 100644 --- a/src/pages/Travel/Card/TravelCard.vue +++ b/src/pages/Travel/Card/TravelCard.vue @@ -1,10 +1,10 @@ - -import VnCard from 'components/common/VnCard.vue'; +import VnCard from 'src/components/common/VnCard.vue'; - + diff --git a/src/pages/Wagon/WagonList.vue b/src/pages/Wagon/WagonList.vue index e716686d1..16c5fca63 100644 --- a/src/pages/Wagon/WagonList.vue +++ b/src/pages/Wagon/WagonList.vue @@ -8,6 +8,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue'; import { computed, ref } from 'vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; +import VnSection from 'src/components/common/VnSection.vue'; const quasar = useQuasar(); const arrayData = useArrayData('WagonList'); @@ -15,6 +16,7 @@ const store = arrayData.store; const router = useRouter(); const { t } = useI18n(); const tableRef = ref(); +const dataKey = 'WagonList'; const filter = { include: { relation: 'type', @@ -75,101 +77,110 @@ function navigate(id) { } async function remove(row) { - try { - await axios.delete(`Wagons/${row.id}`).then(async () => { - quasar.notify({ - message: t('wagon.list.removeItem'), - type: 'positive', - }); - store.data.splice(store.data.indexOf(row), 1); - window.location.reload(); + await axios.delete(`Wagons/${row.id}`).then(async () => { + quasar.notify({ + message: t('wagon.list.removeItem'), + type: 'positive', }); - } catch (error) { - // - } + store.data.splice(store.data.indexOf(row), 1); + window.location.reload(); + }); } - - - - - - - + - - + + + + + + + + + + + {{ t('wagon.warnings.noData') }} + + + + - - - - {{ t('wagon.warnings.noData') }} - - - - + - + es: Create new wagon: Crear nuevo vagón - \ No newline at end of file + diff --git a/src/pages/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue index a78983e5c..b8c1c54df 100644 --- a/src/pages/Worker/Card/WorkerBasicData.vue +++ b/src/pages/Worker/Card/WorkerBasicData.vue @@ -96,6 +96,7 @@ async function setAdvancedSummary(data) { option-label="name" option-value="code" v-model="data.maritalStatus" + data-cy="MaritalStatus" /> @@ -107,6 +108,7 @@ async function setAdvancedSummary(data) { option-label="name" option-value="id" v-model="data.originCountryFk" + data-cy="country" /> - + diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue index 3b7a62025..591dadcd2 100644 --- a/src/pages/Worker/Card/WorkerCard.vue +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -1,9 +1,9 @@ - { { :value="entity.user?.emailUser?.email" copy /> - + diff --git a/src/pages/Worker/Card/WorkerOperator.vue b/src/pages/Worker/Card/WorkerOperator.vue index 8ab802b9f..34d9ba020 100644 --- a/src/pages/Worker/Card/WorkerOperator.vue +++ b/src/pages/Worker/Card/WorkerOperator.vue @@ -98,12 +98,14 @@ watch( @@ -116,6 +118,7 @@ watch( option-value="code" v-model="row.itemPackingTypeFk" :required="true" + data-cy="itemPackingType" /> @@ -132,6 +136,7 @@ watch( hide-selected option-label="description" v-model="row.sectorFk" + data-cy="sector" /> @@ -160,11 +166,13 @@ watch( :label="t('worker.operator.linesLimit')" v-model="row.linesLimit" lazy-rules + data-cy="linesLimit" /> @@ -172,6 +180,7 @@ watch( :label="t('worker.operator.sizeLimit')" v-model="row.sizeLimit" lazy-rules + data-cy="sizeLimit" /> { :label="t('familySituation')" clearable v-model="data.familySituation" + data-cy="familySituation" + /> + - { clearable v-model="data.childPension" :label="t(`childPension`)" + data-cy="childPension" /> @@ -190,12 +198,14 @@ const deleteRelative = async (id) => { type="number" v-model="row.birthed" :label="t(`birthed`)" + data-cy="birthed" /> { - + (isEditMode.value ? t('Edit entry') : t('Add time') const urlCreate = computed(() => isEditMode.value ? `WorkerTimeControls/${$props.entryId}/updateTimeEntry` - : `WorkerTimeControls/${route.params.id}/addTimeEntry` + : `WorkerTimeControls/${route.params.id}/addTimeEntry`, ); onBeforeMount(() => { @@ -83,6 +83,7 @@ onBeforeMount(() => { autofocus :required="true" :is-clearable="false" + data-cy="entryHour" /> { option-value="code" option-label="description" hide-selected + data-cy="entryType" /> diff --git a/src/pages/Worker/Department/Card/DepartmentCard.vue b/src/pages/Worker/Department/Card/DepartmentCard.vue index 2e3f11521..0fbc90332 100644 --- a/src/pages/Worker/Department/Card/DepartmentCard.vue +++ b/src/pages/Worker/Department/Card/DepartmentCard.vue @@ -1,9 +1,9 @@ - - + -import { useRoute } from 'vue-router'; -import { computed } from 'vue'; - -import VnCard from 'components/common/VnCard.vue'; +import VnCard from 'src/components/common/VnCard.vue'; import ZoneDescriptor from './ZoneDescriptor.vue'; -import ZoneFilterPanel from '../ZoneFilterPanel.vue'; -import filter from './ZoneFilter.js'; - -const route = useRoute(); -const routeName = computed(() => route.name); - -function notIsLocations(ifIsFalse, ifIsTrue) { - if (routeName.value != 'ZoneLocations') return ifIsFalse; - return ifIsTrue; -} - - + diff --git a/src/pages/Zone/Card/ZoneEventExclusionForm.vue b/src/pages/Zone/Card/ZoneEventExclusionForm.vue index 4b6aa52bd..3828c998f 100644 --- a/src/pages/Zone/Card/ZoneEventExclusionForm.vue +++ b/src/pages/Zone/Card/ZoneEventExclusionForm.vue @@ -171,9 +171,10 @@ onMounted(() => { openConfirmationModal( t('eventsPanel.deleteTitle'), t('eventsPanel.deleteSubtitle'), - () => deleteEvent() + () => deleteEvent(), ) " + data-cy="ZoneEventExclusionDeleteBtn" /> { diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue index 1e6debd25..2fa7dfb43 100644 --- a/src/pages/Zone/Card/ZoneEvents.vue +++ b/src/pages/Zone/Card/ZoneEvents.vue @@ -1,18 +1,14 @@ - - - + + + + + { await fetchData(); }, - { immediate: true, deep: true } + { immediate: true, deep: true }, ); const formatWdays = (event) => { @@ -178,9 +176,10 @@ onMounted(async () => { openConfirmationModal( t('zone.deleteTitle'), t('zone.deleteSubtitle'), - () => deleteEvent(event.id) + () => deleteEvent(event.id), ) " + data-cy="ZoneEventsPanelDeleteBtn" > {{ t('eventsPanel.delete') }} diff --git a/src/pages/Zone/Card/ZoneLocationsTree.vue b/src/pages/Zone/Card/ZoneLocationsTree.vue index 5c87faf99..d5d7d52b6 100644 --- a/src/pages/Zone/Card/ZoneLocationsTree.vue +++ b/src/pages/Zone/Card/ZoneLocationsTree.vue @@ -1,6 +1,7 @@ + + + { - - + diff --git a/src/pages/Zone/Card/ZoneSearchbar.vue b/src/pages/Zone/Card/ZoneSearchbar.vue deleted file mode 100644 index d1188a1e8..000000000 --- a/src/pages/Zone/Card/ZoneSearchbar.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/src/pages/Zone/Card/ZoneSummary.vue b/src/pages/Zone/Card/ZoneSummary.vue index 5b29b495b..2c56fa3e2 100644 --- a/src/pages/Zone/Card/ZoneSummary.vue +++ b/src/pages/Zone/Card/ZoneSummary.vue @@ -60,10 +60,11 @@ onMounted(async () => { #{{ entity.id }} - {{ entity.name }} diff --git a/src/pages/Zone/ZoneDeliveryDays.vue b/src/pages/Zone/ZoneDeliveryDays.vue index d95c64d8b..ddde3f6b3 100644 --- a/src/pages/Zone/ZoneDeliveryDays.vue +++ b/src/pages/Zone/ZoneDeliveryDays.vue @@ -3,7 +3,6 @@ import { ref } from 'vue'; import ZoneDeliveryPanel from './ZoneDeliveryPanel.vue'; import ZoneCalendarGrid from './ZoneCalendarGrid.vue'; import RightMenu from 'src/components/common/RightMenu.vue'; -import ZoneSearchbar from './Card/ZoneSearchbar.vue'; const firstDay = ref(null); const lastDay = ref(null); @@ -11,7 +10,6 @@ const events = ref([]); - diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue index 993ec274f..a8cb05afc 100644 --- a/src/pages/Zone/ZoneDeliveryPanel.vue +++ b/src/pages/Zone/ZoneDeliveryPanel.vue @@ -89,7 +89,7 @@ watch( v-model="formData.geoFk" url="Postcodes/location" :fields="['geoFk', 'code', 'townFk', 'countryFk']" - :sort-by="['code ASC']" + :sort-by="'code ASC'" option-value="geoFk" option-label="code" :filter-options="['code']" diff --git a/src/pages/Zone/ZoneFilterPanel.vue b/src/pages/Zone/ZoneFilterPanel.vue deleted file mode 100644 index ff65479e4..000000000 --- a/src/pages/Zone/ZoneFilterPanel.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - (agencies = data)" - auto-load - /> - - - - {{ t(`filterPanel.${tag.label}`) }}: - {{ tag.value }} - - - - - - - - - - - - - - - - - diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue index eb54ec15b..869b0c12c 100644 --- a/src/pages/Zone/ZoneList.vue +++ b/src/pages/Zone/ZoneList.vue @@ -14,9 +14,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnInputTime from 'src/components/common/VnInputTime.vue'; -import RightMenu from 'src/components/common/RightMenu.vue'; -import ZoneFilterPanel from './ZoneFilterPanel.vue'; -import ZoneSearchbar from './Card/ZoneSearchbar.vue'; +import VnSection from 'src/components/common/VnSection.vue'; const { t } = useI18n(); const router = useRouter(); @@ -25,7 +23,7 @@ const { viewSummary } = useSummaryDialog(); const { openConfirmationModal } = useVnConfirm(); const tableRef = ref(); const warehouseOptions = ref([]); - +const dataKey = 'ZoneList'; const tableFilter = { include: [ { @@ -114,6 +112,7 @@ const columns = computed(() => [ columnFilter: { inWhere: true, }, + columnClass: 'shrink-column', }, { align: 'left', @@ -169,77 +168,128 @@ function formatRow(row) { return dashIfEmpty(`${row?.address?.nickname}, ${row?.address?.postcode?.town?.name} (${row?.address?.province?.name})`); } + +const exprBuilder = (param, value) => { + switch (param) { + case 'name': + return { + name: { like: `%${value}%` }, + }; + case 'code': + return { + code: { like: `%${value}%` }, + }; + case 'agencyModeFk': + return { + agencyModeFk: value, + }; + case 'search': + return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } }; + case 'price': + return { + price: value, + }; + } +}; - - - - - - - - - {{ dashIfEmpty(formatRow(row)) }} + + + + + + {{ dashIfEmpty(formatRow(row)) }} + + + + + + + + + + + + + - - - - - - - - - - + + + es: Search zone: Buscar zona diff --git a/src/pages/Zone/ZoneUpcoming.vue b/src/pages/Zone/ZoneUpcoming.vue index adcdfbc04..b8664dc2f 100644 --- a/src/pages/Zone/ZoneUpcoming.vue +++ b/src/pages/Zone/ZoneUpcoming.vue @@ -7,7 +7,6 @@ import FetchData from 'components/FetchData.vue'; import { toDateFormat } from 'src/filters/date.js'; import { useWeekdayStore } from 'src/stores/useWeekdayStore'; -import ZoneSearchbar from './Card/ZoneSearchbar.vue'; const { t } = useI18n(); const weekdayStore = useWeekdayStore(); @@ -31,7 +30,7 @@ const columns = computed(() => [ label: t('list.id'), name: 'id', field: 'zoneFk', - align: 'left', + align: 'center', }, ]); @@ -53,7 +52,6 @@ onMounted(() => weekdayStore.initStore()); @on-fetch="(data) => (details = data)" auto-load /> - diff --git a/src/pages/Zone/locale/en.yml b/src/pages/Zone/locale/en.yml index e53e7b560..22f4b1ae6 100644 --- a/src/pages/Zone/locale/en.yml +++ b/src/pages/Zone/locale/en.yml @@ -11,10 +11,13 @@ zone: m3Max: Max m³ deleteTitle: This item will be deleted deleteSubtitle: Are you sure you want to continue? - volumetric: Volumetric bonus: Bonus closing: Closing travelingDays: Traveling days + search: Search zone + searchInfo: Search zone by id or name + searchLocations: Search locations + searchLocationsInfo: Search locations by post code list: clone: Clone id: Id @@ -30,6 +33,7 @@ list: confirmCloneTitle: All it's properties will be copied confirmCloneSubtitle: Do you want to clone this zone? warehouse: Warehouse + isVolumetric: Volumetric createZone: Create zone zoneSummary: Summary addressFk: Address diff --git a/src/pages/Zone/locale/es.yml b/src/pages/Zone/locale/es.yml index bc31e74a9..777bc1c03 100644 --- a/src/pages/Zone/locale/es.yml +++ b/src/pages/Zone/locale/es.yml @@ -15,6 +15,10 @@ zone: bonus: Bonificación closing: Cierre travelingDays: Días de viaje + search: Buscar zona + searchInfo: Buscar zona por Id o nombre + searchLocations: Buscar localización + searchLocationsInfo: Buscar localización por código postal list: clone: Clonar id: Id diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index 67b00b161..a33ed6be5 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -4,8 +4,8 @@ const customerCard = { name: 'CustomerCard', path: ':id', component: () => import('src/pages/Customer/Card/CustomerCard.vue'), - redirect: { name: 'CustomerSummary' }, - meta: { + redirect: { name: 'CustomerSummary' }, + meta: { menu: [ 'CustomerBasicData', 'CustomerFiscalData', @@ -40,8 +40,7 @@ const customerCard = { title: 'basicData', icon: 'vn:settings', }, - component: () => - import('src/pages/Customer/Card/CustomerBasicData.vue'), + component: () => import('src/pages/Customer/Card/CustomerBasicData.vue'), }, { path: 'fiscal-data', @@ -50,8 +49,7 @@ const customerCard = { title: 'fiscalData', icon: 'vn:dfiscales', }, - component: () => - import('src/pages/Customer/Card/CustomerFiscalData.vue'), + component: () => import('src/pages/Customer/Card/CustomerFiscalData.vue'), }, { path: 'billing-data', @@ -60,8 +58,7 @@ const customerCard = { title: 'billingData', icon: 'vn:payment', }, - component: () => - import('src/pages/Customer/Card/CustomerBillingData.vue'), + component: () => import('src/pages/Customer/Card/CustomerBillingData.vue'), }, { path: 'address', @@ -85,9 +82,7 @@ const customerCard = { title: 'address-create', }, component: () => - import( - 'src/pages/Customer/components/CustomerAddressCreate.vue' - ), + import('src/pages/Customer/components/CustomerAddressCreate.vue'), }, { path: ':addressId', @@ -125,8 +120,7 @@ const customerCard = { title: 'credits', icon: 'vn:credit', }, - component: () => - import('src/pages/Customer/Card/CustomerCredits.vue'), + component: () => import('src/pages/Customer/Card/CustomerCredits.vue'), }, { path: 'greuges', @@ -135,8 +129,7 @@ const customerCard = { title: 'greuges', icon: 'vn:greuge', }, - component: () => - import('src/pages/Customer/Card/CustomerGreuges.vue'), + component: () => import('src/pages/Customer/Card/CustomerGreuges.vue'), }, { path: 'balance', @@ -145,8 +138,7 @@ const customerCard = { title: 'balance', icon: 'balance', }, - component: () => - import('src/pages/Customer/Card/CustomerBalance.vue'), + component: () => import('src/pages/Customer/Card/CustomerBalance.vue'), }, { path: 'recoveries', @@ -155,8 +147,7 @@ const customerCard = { title: 'recoveries', icon: 'vn:recovery', }, - component: () => - import('src/pages/Customer/Card/CustomerRecoveries.vue'), + component: () => import('src/pages/Customer/Card/CustomerRecoveries.vue'), }, { path: 'web-access', @@ -165,8 +156,7 @@ const customerCard = { title: 'webAccess', icon: 'vn:web', }, - component: () => - import('src/pages/Customer/Card/CustomerWebAccess.vue'), + component: () => import('src/pages/Customer/Card/CustomerWebAccess.vue'), }, { path: 'log', @@ -247,9 +237,7 @@ const customerCard = { title: 'creditOpinion', }, component: () => - import( - 'src/pages/Customer/Card/CustomerCreditOpinion.vue' - ), + import('src/pages/Customer/Card/CustomerCreditOpinion.vue'), }, ], }, @@ -319,9 +307,7 @@ const customerCard = { title: 'samples', }, component: () => - import( - 'src/pages/Customer/Card/CustomerSamples.vue' - ), + import('src/pages/Customer/Card/CustomerSamples.vue'), }, { path: 'create', @@ -376,9 +362,7 @@ const customerCard = { title: 'fileManagement', }, component: () => - import( - 'src/pages/Customer/Card/CustomerFileManagement.vue' - ), + import('src/pages/Customer/Card/CustomerFileManagement.vue'), }, { path: 'file-management', @@ -420,8 +404,7 @@ const customerCard = { meta: { title: 'unpaid', }, - component: () => - import('src/pages/Customer/Card/CustomerUnpaid.vue'), + component: () => import('src/pages/Customer/Card/CustomerUnpaid.vue'), }, ], }, @@ -429,7 +412,7 @@ const customerCard = { }; export default { - name: 'Customer', + name: 'Customer', path: '/customer', meta: { title: 'customers', @@ -469,15 +452,6 @@ export default { customerCard, ], }, - { - path: 'create', - name: 'CustomerCreate', - meta: { - title: 'customerCreate', - icon: 'add', - }, - component: () => import('src/pages/Customer/CustomerCreate.vue'), - }, { path: 'payments', name: 'CustomerPayments', diff --git a/src/router/modules/route.js b/src/router/modules/route.js index e8e6c1f31..07759d325 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -232,7 +232,6 @@ export default { path: '', name: 'RouteIndexMain', redirect: { name: 'RouteList' }, - component: () => import('src/pages/Route/RouteList.vue'), children: [ { name: 'RouteList', @@ -241,6 +240,7 @@ export default { title: 'list', icon: 'view_list', }, + component: () => import('src/pages/Route/RouteList.vue'), }, routeCard, ], @@ -280,7 +280,6 @@ export default { title: 'RouteRoadmap', icon: 'vn:troncales', }, - component: () => import('src/pages/Route/RouteRoadmap.vue'), children: [ { name: 'RoadmapList', @@ -289,6 +288,7 @@ export default { title: 'list', icon: 'view_list', }, + component: () => import('src/pages/Route/RouteRoadmap.vue'), }, roadmapCard, ], @@ -310,7 +310,6 @@ export default { title: 'agency', icon: 'garage_home', }, - component: () => import('src/pages/Route/Agency/AgencyList.vue'), children: [ { name: 'AgencyList', @@ -319,6 +318,8 @@ export default { title: 'list', icon: 'view_list', }, + component: () => + import('src/pages/Route/Agency/AgencyList.vue'), }, agencyCard, ], @@ -331,7 +332,6 @@ export default { title: 'vehicle', icon: 'directions_car', }, - component: () => import('src/pages/Route/Vehicle/VehicleList.vue'), children: [ { path: 'list', @@ -340,6 +340,8 @@ export default { title: 'vehicleList', icon: 'directions_car', }, + component: () => + import('src/pages/Route/Vehicle/VehicleList.vue'), }, vehicleCard, ], diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js index 4a322d305..798c671eb 100644 --- a/src/router/modules/wagon.js +++ b/src/router/modules/wagon.js @@ -1,52 +1,60 @@ import { RouterView } from 'vue-router'; +const wagonCard = { + name: 'WagonCard', + path: ':id', + component: () => import('src/pages/Wagon/Card/WagonCard.vue'), + redirect: { name: 'WagonEdit' }, + meta: { + menu: ['WagonEdit'], + }, + children: [ + { + path: 'edit', + name: 'WagonEdit', + meta: { + title: 'wagonEdit', + icon: 'edit', + }, + component: () => import('src/pages/Wagon/WagonCreate.vue'), + }, + ], +}; + export default { - path: '/wagon', name: 'Wagon', + path: '/wagon', meta: { title: 'wagons', icon: 'vn:trolley', moduleName: 'Wagon', + menu: ['WagonList', 'WagonTypeList', 'WagonCounter'], }, component: RouterView, redirect: { name: 'WagonMain' }, - menus: { - main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'], - card: [], - }, children: [ { - path: '/wagon', + path: '', name: 'WagonMain', component: () => import('src/components/common/VnModule.vue'), - redirect: { name: 'WagonList' }, + redirect: { name: 'WagonIndexMain' }, children: [ { - path: 'list', - name: 'WagonList', - meta: { - title: 'list', - icon: 'vn:trolley', - }, + path: '', + name: 'WagonIndexMain', + redirect: { name: 'WagonList' }, component: () => import('src/pages/Wagon/WagonList.vue'), - }, - { - path: 'create', - name: 'WagonCreate', - meta: { - title: 'wagonCreate', - icon: 'create', - }, - component: () => import('src/pages/Wagon/WagonCreate.vue'), - }, - { - path: ':id/edit', - name: 'WagonEdit', - meta: { - title: 'wagonEdit', - icon: 'edit', - }, - component: () => import('src/pages/Wagon/WagonCreate.vue'), + children: [ + { + name: 'WagonList', + path: 'list', + meta: { + title: 'list', + icon: 'view_list', + }, + }, + wagonCard, + ], }, { path: 'counter', @@ -57,40 +65,32 @@ export default { }, component: () => import('src/pages/Wagon/WagonCounter.vue'), }, - ], - }, - { - path: '/wagon/type', - name: 'WagonTypeMain', - component: () => import('src/components/common/VnModule.vue'), - redirect: { name: 'WagonTypeList' }, - children: [ { - path: 'list', - name: 'WagonTypeList', - meta: { - title: 'typesList', - icon: 'view_list', - }, - component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'), - }, - { - path: 'create', - name: 'WagonTypeCreate', - meta: { - title: 'typeCreate', - icon: 'create', - }, - component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'), - }, - { - path: ':id/edit', - name: 'WagonTypeEdit', - meta: { - title: 'typeEdit', - icon: 'edit', - }, - component: () => import('src/pages/Wagon/Type/WagonTypeEdit.vue'), + path: 'type', + name: 'WagonTypeMain', + redirect: { name: 'WagonTypeList' }, + children: [ + { + path: 'list', + name: 'WagonTypeList', + meta: { + title: 'typesList', + icon: 'view_list', + }, + component: () => + import('src/pages/Wagon/Type/WagonTypeList.vue'), + }, + { + path: ':id/edit', + name: 'WagonTypeEdit', + meta: { + title: 'typeEdit', + icon: 'edit', + }, + component: () => + import('src/pages/Wagon/Type/WagonTypeEdit.vue'), + }, + ], }, ], }, diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js index f400a708e..f48a715b9 100644 --- a/src/router/modules/zone.js +++ b/src/router/modules/zone.js @@ -1,24 +1,12 @@ import { RouterView } from 'vue-router'; -export default { - path: '/zone', - name: 'Zone', +const zoneCard = { + name: 'ZoneCard', + path: ':id', + component: () => import('src/pages/Zone/Card/ZoneCard.vue'), + redirect: { name: 'ZoneSummary' }, meta: { - title: 'zones', - icon: 'vn:zone', - moduleName: 'Zone', - keyBinding: 'z', - }, - component: RouterView, - redirect: { name: 'ZoneMain' }, - menus: { - main: [ - 'ZoneList', - 'ZoneDeliveryDays', - 'ZoneUpcomingList', - 'ZoneUpcomingDeliveries', - ], - card: [ + menu: [ 'ZoneBasicData', 'ZoneWarehouses', 'ZoneHistory', @@ -28,19 +16,102 @@ export default { }, children: [ { - path: '/zone', + name: 'ZoneSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => import('src/pages/Zone/Card/ZoneSummary.vue'), + }, + { + path: 'basic-data', + name: 'ZoneBasicData', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'), + }, + { + path: 'location', + name: 'ZoneLocations', + meta: { + title: 'locations', + icon: 'my_location', + }, + component: () => import('src/pages/Zone/Card/ZoneLocations.vue'), + }, + { + path: 'warehouses', + name: 'ZoneWarehouses', + meta: { + title: 'warehouses', + icon: 'home', + }, + component: () => import('src/pages/Zone/Card/ZoneWarehouses.vue'), + }, + { + path: 'log', + name: 'ZoneHistory', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Zone/Card/ZoneLog.vue'), + }, + { + path: 'events', + name: 'ZoneEvents', + meta: { + title: 'calendar', + icon: 'vn:calendar', + }, + component: () => import('src/pages/Zone/Card/ZoneEvents.vue'), + }, + ], +}; + +export default { + name: 'Zone', + path: '/zone', + meta: { + title: 'zones', + icon: 'vn:zone', + moduleName: 'Zone', + keyBinding: 'z', + menu: [ + 'ZoneList', + 'ZoneDeliveryDays', + 'ZoneUpcomingList', + 'ZoneUpcomingDeliveries', + ], + }, + component: RouterView, + redirect: { name: 'ZoneMain' }, + children: [ + { name: 'ZoneMain', + path: '', component: () => import('src/components/common/VnModule.vue'), - redirect: { name: 'ZoneList' }, + redirect: { name: 'ZoneIndexMain' }, children: [ { - path: 'list', - name: 'ZoneList', - meta: { - title: 'zonesList', - icon: 'view_list', - }, + path: '', + name: 'ZoneIndexMain', + redirect: { name: 'ZoneList' }, component: () => import('src/pages/Zone/ZoneList.vue'), + children: [ + { + name: 'ZoneList', + path: 'list', + meta: { + title: 'list', + icon: 'view_list', + }, + }, + zoneCard, + ], }, { path: 'delivery-days', @@ -62,67 +133,5 @@ export default { }, ], }, - { - name: 'ZoneCard', - path: ':id', - component: () => import('src/pages/Zone/Card/ZoneCard.vue'), - redirect: { name: 'ZoneSummary' }, - children: [ - { - name: 'ZoneSummary', - path: 'summary', - meta: { - title: 'summary', - icon: 'launch', - }, - component: () => import('src/pages/Zone/Card/ZoneSummary.vue'), - }, - { - name: 'ZoneBasicData', - path: 'basic-data', - meta: { - title: 'basicData', - icon: 'vn:settings', - }, - component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'), - }, - { - name: 'ZoneLocations', - path: 'location', - meta: { - title: 'locations', - icon: 'my_location', - }, - component: () => import('src/pages/Zone/Card/ZoneLocations.vue'), - }, - { - name: 'ZoneWarehouses', - path: 'warehouses', - meta: { - title: 'warehouses', - icon: 'home', - }, - component: () => import('src/pages/Zone/Card/ZoneWarehouses.vue'), - }, - { - name: 'ZoneHistory', - path: 'log', - meta: { - title: 'log', - icon: 'history', - }, - component: () => import('src/pages/Zone/Card/ZoneLog.vue'), - }, - { - name: 'ZoneEvents', - path: 'events', - meta: { - title: 'calendar', - icon: 'vn:calendar', - }, - component: () => import('src/pages/Zone/Card/ZoneEvents.vue'), - }, - ], - }, ], }; diff --git a/test/cypress/integration/claim/claimAction.spec.js b/test/cypress/integration/claim/claimAction.spec.js index b0a16a2ad..8f406ad2f 100644 --- a/test/cypress/integration/claim/claimAction.spec.js +++ b/test/cypress/integration/claim/claimAction.spec.js @@ -1,5 +1,5 @@ /// -describe('ClaimAction', () => { +describe.skip('ClaimAction', () => { const claimId = 1; const firstRow = 'tbody > :nth-child(1)'; @@ -15,12 +15,14 @@ describe('ClaimAction', () => { cy.get('[title="Import claim"]').click(); }); - it('should change destination', () => { + // https://redmine.verdnatura.es/issues/8756 + xit('should change destination', () => { const rowData = [true, null, null, 'Bueno']; cy.fillRow(firstRow, rowData); }); - it('should change destination from other button', () => { + // https://redmine.verdnatura.es/issues/8756 + xit('should change destination from other button', () => { const rowData = [true]; cy.fillRow(firstRow, rowData); @@ -33,7 +35,8 @@ describe('ClaimAction', () => { cy.get('[title="Regularize"]').click(); }); - it('should remove the line', () => { + // https://redmine.verdnatura.es/issues/8756 + xit('should remove the line', () => { cy.fillRow(firstRow, [true]); cy.removeCard(); cy.clickConfirm(); diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index b84b4f958..ac0460029 100755 --- a/test/cypress/integration/claim/claimPhoto.spec.js +++ b/test/cypress/integration/claim/claimPhoto.spec.js @@ -1,5 +1,5 @@ /// -describe('ClaimPhoto', () => { +describe.skip('ClaimPhoto', () => { const carrouselClose = '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'; beforeEach(() => { diff --git a/test/cypress/integration/client/clientBalance.spec.js b/test/cypress/integration/client/clientBalance.spec.js index abfa74cec..fff6a5e04 100644 --- a/test/cypress/integration/client/clientBalance.spec.js +++ b/test/cypress/integration/client/clientBalance.spec.js @@ -1,11 +1,13 @@ /// describe('Client balance', () => { beforeEach(() => { - cy.viewport(1280, 720); cy.login('developer'); cy.visit('#/customer/1101/balance'); }); - it('Should load layout', () => { - cy.get('.q-page').should('be.visible'); + it('Should create a mandate', () => { + cy.get('.q-page-sticky > div > .q-btn').click(); + cy.selectOption('[data-cy="paymentBank"]', 2); + cy.dataCy('paymentAmount_input').clear().type('100'); + cy.saveCard(); }); }); diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index b29ad74af..467c6c37d 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -1,5 +1,5 @@ /// -describe('Client list', () => { +describe.skip('Client list', () => { beforeEach(() => { cy.login('developer'); cy.visit('/#/customer/list', { @@ -25,7 +25,7 @@ describe('Client list', () => { 'Web user': { val: `user_test_${randomInt}` }, Street: { val: `C/ STREET ${randomInt}` }, Email: { val: `user.test${randomInt}@cypress.com` }, - 'Sales person': { val: 'salesPerson', type: 'select' }, + Team: { val: 'Informatica', type: 'select' }, Location: { val: '46000', type: 'select' }, 'Business type': { val: 'others', type: 'select' }, }; diff --git a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js index d3a84d226..b8b42fa4b 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js @@ -13,7 +13,6 @@ describe('InvoiceOut list', () => { ':nth-child(1) > .text-right > [data-cy="tableAction-0"] > .q-btn__content > .q-icon'; beforeEach(() => { - cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/invoice-out/list`); cy.typeSearchbar('{enter}'); @@ -41,7 +40,7 @@ describe('InvoiceOut list', () => { }); it('should filter the results by client ID, then check the first result is correct', () => { - cy.dataCy('Customer ID_input').type('1103'); + cy.dataCy('Client 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 0039f6240..9c6eef2ed 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js @@ -16,9 +16,9 @@ describe('InvoiceOut negative bases', () => { cy.get(getDescriptors('ticketFk')).click(); cy.get('.descriptor').should('be.visible'); cy.get('.q-item > .q-item__label').should('include.text', '23'); - cy.get(getDescriptors('workerName')).click(); + cy.get(getDescriptors('departmentFk')).click(); cy.get('.descriptor').should('be.visible'); - cy.get('.q-item > .q-item__label').should('include.text', '18'); + cy.get('.q-item > .q-item__label').should('include.text', '155'); }); it('should filter and download as CSV', () => { diff --git a/test/cypress/integration/order/orderList.spec.js b/test/cypress/integration/order/orderList.spec.js index 1c954622f..c48b317a8 100644 --- a/test/cypress/integration/order/orderList.spec.js +++ b/test/cypress/integration/order/orderList.spec.js @@ -1,5 +1,9 @@ /// describe('OrderList', () => { + const clientCreateSelect = '#formModel [data-cy="Client_select"]'; + const addressCreateSelect = '#formModel [data-cy="Address_select"]'; + const agencyCreateSelect = '#formModel [data-cy="Agency_select"]'; + beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); @@ -8,16 +12,14 @@ describe('OrderList', () => { it('create order', () => { cy.get('[data-cy="vnTableCreateBtn"]').click(); - cy.get('[data-cy="Client_select"]').type('1101'); - cy.get('.q-menu').contains('Bruce Wayne').click(); - cy.get('[data-cy="Address_select"]').click(); + cy.selectOption(clientCreateSelect, 1101); + cy.get(addressCreateSelect).click(); cy.get( '.q-menu > div> div.q-item:nth-child(1) >div.q-item__section--avatar > i', ).should('have.text', 'star'); - cy.get('.q-menu > div> .q-item:nth-child(1)').click(); cy.dataCy('landedDate').find('input').type('06/01/2001'); - cy.get('.q-card [data-cy="Agency_select"]').click(); - cy.get('.q-menu > div> .q-item:nth-child(1)').click(); + cy.selectOption(agencyCreateSelect, 1); + cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale'); cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click(); cy.wait('@orderSale'); @@ -32,8 +34,8 @@ describe('OrderList', () => { cy.dataCy('Customer ID_input').type('1101{enter}'); cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('landedDate').find('input').type('06/01/2001'); - cy.get('.q-card [data-cy="Agency_select"]').click(); - cy.get('.q-menu > div> .q-item:nth-child(1)').click(); + cy.selectOption(agencyCreateSelect, 1); + cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale'); cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click(); cy.wait('@orderSale'); @@ -54,11 +56,12 @@ describe('OrderList', () => { `[href="#/order/list?createForm={%22clientFk%22:${clientId},%22addressId%22:1}"] > .q-btn__content > .q-icon`, ).click(); cy.dataCy('vnTableCreateBtn').click(); - cy.get('[data-cy="Client_select"]').should('have.value', 'Bruce Wayne'); - cy.get('[data-cy="Address_select"]').should('have.value', 'Bruce Wayne'); + + cy.get(clientCreateSelect).should('have.value', 'Bruce Wayne'); + cy.get(addressCreateSelect).should('have.value', 'Bruce Wayne'); cy.dataCy('landedDate').find('input').type('06/01/2001'); - cy.get('.q-card [data-cy="Agency_select"]').click(); - cy.get('.q-menu > div> .q-item:nth-child(1)').click(); + cy.selectOption(agencyCreateSelect, 1); + cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale'); cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click(); cy.wait('@orderSale'); diff --git a/test/cypress/integration/outLogin/login.spec.js b/test/cypress/integration/outLogin/login.spec.js index 2bd5a8c3b..22e30dd8e 100755 --- a/test/cypress/integration/outLogin/login.spec.js +++ b/test/cypress/integration/outLogin/login.spec.js @@ -12,7 +12,7 @@ describe('Login', () => { cy.get('button[type="submit"]').click(); cy.get('.q-notification__message').should( 'have.text', - 'Invalid username or password' + 'Invalid username or password', ); }); @@ -23,7 +23,7 @@ describe('Login', () => { cy.get('button[type="submit"]').click(); cy.get('.q-notification__message').should( 'have.text', - 'Invalid username or password' + 'Invalid username or password', ); }); @@ -33,7 +33,7 @@ describe('Login', () => { cy.get('button[type="submit"]').click(); cy.get('.q-notification__message').should( 'have.text', - 'You have successfully logged in' + 'You have successfully logged in', ); cy.url().should('contain', '/dashboard'); }); @@ -44,7 +44,7 @@ describe('Login', () => { cy.get('button[type="submit"]').click(); cy.get('.q-notification__message').should( 'have.text', - 'You have successfully logged in' + 'You have successfully logged in', ); cy.url().should('contain', '/dashboard'); cy.get('#user').click(); @@ -61,14 +61,4 @@ describe('Login', () => { cy.get('button[type="submit"]').click(); cy.url().should('contain', '/dashboard'); }); - - // ticket creation is not yet implemented, use this test once it is - // it(`should get redirected to ticket creation after login since salesPerson can do it`, () => { - // cy.visit('/#/ticket/create', { failOnStatusCode: false }); - // cy.url().should('contain', '/#/login?redirect=/ticket/create'); - // cy.get('input[aria-label="Username"]').type('salesPerson'); - // cy.get('input[aria-label="Password"]').type('nightmare'); - // cy.get('button[type="submit"]').click(); - // cy.url().should('contain', '/#/ticket/create'); - // }) }); diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/outLogin/logout.spec.js index 373f0cc93..b3583e4d3 100644 --- a/test/cypress/integration/outLogin/logout.spec.js +++ b/test/cypress/integration/outLogin/logout.spec.js @@ -24,12 +24,21 @@ describe('Logout', () => { }, }, statusMessage: 'AUTHORIZATION_REQUIRED', - }); + }).as('badRequest'); }); it('when token not exists', () => { + const exceptionHandler = (err) => { + if (err.code === 'AUTHORIZATION_REQUIRED') return; + }; + Cypress.on('uncaught:exception', exceptionHandler); + cy.get('.q-list').first().should('be.visible').click(); + cy.wait('@badRequest'); + cy.checkNotification('Authorization Required'); + + Cypress.off('uncaught:exception', exceptionHandler); }); }); }); diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js index 5679ceba1..22a1a0143 100644 --- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js +++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js @@ -1,27 +1,34 @@ describe.skip('AgencyWorkCenter', () => { + const selectors = { + workCenter: 'workCenter_select', + popupSave: 'FormModelPopup_save', + popupCancel: 'FormModelPopup_cancel', + remove: 'removeWorkCenterBtn', + }; + + const messages = { + dataCreated: 'Data created', + alreadyAssigned: 'This workCenter is already assigned to this agency', + removed: 'WorkCenter removed successfully', + }; + beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/route/agency/11/workCenter`); }); - const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon'; - const workCenterCombobox = 'input[role="combobox"]'; - it('check workCenter crud', () => { - // create - cy.get(createButton).click(); - cy.get(workCenterCombobox).type('workCenterOne{enter}'); + it('Should add work center, check already assigned and remove work center', () => { + cy.addBtnClick(); + cy.selectOption('[data-cy="workCenter_select"]', 'workCenterOne'); + cy.dataCy(selectors.popupSave).click(); cy.checkNotification('Data created'); - - // expect error when duplicate - cy.get(createButton).click(); - cy.selectOption(workCenterCombobox, 'workCenterOne'); - cy.get('[data-cy="FormModelPopup_save"]').click(); - cy.checkNotification('This workCenter is already assigned to this agency'); - cy.get('[data-cy="FormModelPopup_cancel"]').click(); - - // delete - cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click(); - cy.checkNotification('WorkCenter removed successfully'); + cy.addBtnClick(); + cy.selectOption('[data-cy="workCenter_select"]', 'workCenterOne'); + cy.dataCy(selectors.popupSave).click(); + cy.checkNotification(messages.alreadyAssigned); + cy.dataCy(selectors.popupCancel).click(); + cy.dataCy(selectors.remove).click(); + cy.checkNotification(messages.removed); }); }); diff --git a/test/cypress/integration/route/roadMap/roadmapList.spec.js b/test/cypress/integration/route/roadMap/roadmapList.spec.js index 6d46b2cf6..35c0c2b02 100644 --- a/test/cypress/integration/route/roadMap/roadmapList.spec.js +++ b/test/cypress/integration/route/roadMap/roadmapList.spec.js @@ -1,12 +1,74 @@ describe('RoadMap', () => { + const getSelector = (colField) => + `tr:last-child > [data-col-field="${colField}"] > .no-padding`; + + const selectors = { + roadmap: getSelector('name'), + id: getSelector('id'), + etd: getSelector('etd'), + summaryHeader: '.summaryHeader > :nth-child(2)', + summaryGoToSummaryBtn: '.summaryHeader > a > .q-icon', + summaryBtn: 'tableAction-0', + inputRoadmap: 'Roadmap_input', + checkbox: '.q-virtual-scroll__content tr:last-child .q-checkbox', + cloneFormBtn: '.q-card__actions > .q-btn--standard', + cloneBtn: '#subToolbar > :nth-child(3)', + deleteBtn: ':nth-child(4) > .q-btn__content', + confirmBtn: 'VnConfirm_confirm', + inputEtd: 'ETD_inputDate', + }; + + const data = { + roadmap: 'TEST-ROADMAP', + etd: '01/01/2025', + }; + + const dataCreated = 'Data created'; + const summaryUrl = '/summary'; + beforeEach(() => { + cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/route/roadmap`); + cy.typeSearchbar('{enter}'); }); + + it('Should list roadmaps', () => { + cy.get('.q-table') + .children() + .should('be.visible') + .should('have.length.greaterThan', 0); + }); + it('Route list create roadmap and redirect', () => { cy.addBtnClick(); - cy.get('input[name="name"]').type('roadMapTestOne{enter}'); - cy.get('.q-notification__message').should('have.text', 'Data created'); - cy.url().should('include', '/summary'); + cy.dataCy(selectors.inputRoadmap).type(`${data.roadmap}{enter}`); + cy.checkNotification(dataCreated); + cy.url().should('include', summaryUrl); + }); + + it('open summary', () => { + cy.dataCy(selectors.summaryBtn).last().click(); + cy.get(selectors.summaryHeader).should('contain', data.roadmap); + cy.get(selectors.summaryGoToSummaryBtn).click(); + cy.get(selectors.summaryHeader).should('contain', data.roadmap); + }); + + it('Should clone selected roadmap with new ETD', () => { + cy.get(selectors.checkbox).click(); + cy.get(selectors.cloneBtn).click(); + cy.dataCy(selectors.inputEtd).click().type(`${data.etd}{enter}`); + cy.get(selectors.cloneFormBtn).click(); + cy.get(selectors.etd).should('contain', data.etd); + }); + + it('Should delete selected roadmap', () => { + cy.get(selectors.id).then(($el) => { + cy.get(selectors.checkbox).click(); + cy.get(selectors.deleteBtn).click(); + cy.dataCy(selectors.confirmBtn).click(); + cy.typeSearchbar('{enter}'); + cy.get(selectors.id).should('not.have.text', $el.text); + }); }); }); diff --git a/test/cypress/integration/route/routeAutonomous.spec.js b/test/cypress/integration/route/routeAutonomous.spec.js index acf82bd95..08fd7d7ea 100644 --- a/test/cypress/integration/route/routeAutonomous.spec.js +++ b/test/cypress/integration/route/routeAutonomous.spec.js @@ -1,4 +1,4 @@ -describe('RouteAutonomous', () => { +describe.skip('RouteAutonomous', () => { const getLinkSelector = (colField) => `tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`; diff --git a/test/cypress/integration/route/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js index e3505ad60..5fda93b25 100644 --- a/test/cypress/integration/route/routeExtendedList.spec.js +++ b/test/cypress/integration/route/routeExtendedList.spec.js @@ -32,18 +32,18 @@ describe.skip('Route extended list', () => { const originalFields = [ { selector: selectors.worker, type: 'select', value: 'logistic' }, - { selector: selectors.agency, type: 'select', value: 'Super-Man delivery' }, + { selector: selectors.agency, type: 'select', value: 'inhouse pickup' }, { selector: selectors.vehicle, type: 'select', value: '3333-IMK' }, - { selector: selectors.date, type: 'date', value: '01/02/2024' }, + { selector: selectors.date, type: 'date', value: '01/01/2001' }, { selector: selectors.description, type: 'input', value: 'Test route' }, { selector: selectors.served, type: 'checkbox', value: checkboxState.uncheck }, ]; const updateFields = [ { selector: selectors.worker, type: 'select', value: 'salesperson' }, - { selector: selectors.agency, type: 'select', value: 'inhouse pickup' }, + { selector: selectors.agency, type: 'select', value: 'Super-Man delivery' }, { selector: selectors.vehicle, type: 'select', value: '1111-IMK' }, - { selector: selectors.date, type: 'date', value: '01/01/2001' }, + { selector: selectors.date, type: 'date', value: '11/01/2001' }, { selector: selectors.description, type: 'input', value: 'Description updated' }, { selector: selectors.served, type: 'checkbox', value: checkboxState.check }, ]; @@ -57,11 +57,11 @@ describe.skip('Route extended list', () => { break; case 'input': cy.get(selector).should('be.visible').click(); - cy.dataCy('null_input').clear().type(`${value}{enter}`); + cy.dataCy('null_input').clear().type(`${value}`); break; case 'date': cy.get(selector).should('be.visible').click(); - cy.dataCy('null_inputDate').clear().type(`${value}{enter}`); + cy.dataCy('null_inputDate').clear().type(`${value}`); break; case 'checkbox': cy.get(selector).should('be.visible').click().click(); @@ -76,15 +76,6 @@ describe.skip('Route extended list', () => { cy.typeSearchbar('{enter}'); }); - after(() => { - cy.visit(url); - cy.typeSearchbar('{enter}'); - cy.get(selectors.lastRowSelectCheckBox).click(); - - cy.get(selectors.removeBtn).click(); - cy.dataCy(selectors.confirmBtn).click(); - }); - it('Should list routes', () => { cy.get('.q-table') .children() @@ -97,9 +88,9 @@ describe.skip('Route extended list', () => { const data = { Worker: { val: 'logistic', type: 'select' }, - Agency: { val: 'Super-Man delivery', type: 'select' }, + Agency: { val: 'inhouse pickup', type: 'select' }, Vehicle: { val: '3333-IMK', type: 'select' }, - Date: { val: '02-01-2024', type: 'date' }, + Date: { val: '01-01-2001', type: 'date' }, From: { val: '01-01-2024', type: 'date' }, To: { val: '10-01-2024', type: 'date' }, 'Km start': { val: 1000 }, @@ -129,7 +120,7 @@ describe.skip('Route extended list', () => { it('Should clone selected route', () => { cy.get(selectors.lastRowSelectCheckBox).click(); cy.get(selectors.cloneBtn).click(); - cy.dataCy('route.Starting date_inputDate').type('10-05-2001{enter}'); + cy.dataCy('route.Starting date_inputDate').type('10-05-2001').click(); cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click(); cy.validateContent(selectors.date, '05/10/2001'); }); @@ -142,10 +133,6 @@ describe.skip('Route extended list', () => { const fileName = 'download.zip'; cy.readFile(`${downloadsFolder}/${fileName}`).should('exist'); - - cy.task('deleteFile', `${downloadsFolder}/${fileName}`).then((deleted) => { - expect(deleted).to.be.true; - }); }); it('Should mark as served the selected route', () => { @@ -165,6 +152,13 @@ describe.skip('Route extended list', () => { cy.checkNotification(dataSaved); }); + it('Should add ticket to route', () => { + cy.dataCy('tableAction-0').last().click(); + cy.get(selectors.firstTicketsRowSelectCheckBox).click(); + cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click(); + cy.checkNotification(dataSaved); + }); + it('Should save changes in route', () => { updateFields.forEach(({ selector, type, value }) => { fillField(selector, type, value); @@ -175,18 +169,15 @@ describe.skip('Route extended list', () => { cy.typeSearchbar('{enter}'); - updateFields.forEach(({ selector, value }) => { + updateFields.forEach(({ selector, value, type }) => { + if (type === 'date') { + const [month, day, year] = value.split('/'); + value = `${day}/${month}/${year}`; + } cy.validateContent(selector, value); }); }); - it('Should add ticket to route', () => { - cy.dataCy('tableAction-0').last().click(); - cy.get(selectors.firstTicketsRowSelectCheckBox).click(); - cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click(); - cy.checkNotification(dataSaved); - }); - it('Should open summary pop-up when click summuary icon', () => { cy.dataCy('tableAction-1').last().click(); cy.get('.summaryHeader > :nth-child(2').should('contain', updateFields[4].value); diff --git a/test/cypress/integration/shelving/parking/parkingList.spec.js b/test/cypress/integration/shelving/parking/parkingList.spec.js index ca1877621..7372da164 100644 --- a/test/cypress/integration/shelving/parking/parkingList.spec.js +++ b/test/cypress/integration/shelving/parking/parkingList.spec.js @@ -2,7 +2,7 @@ describe('ParkingList', () => { const searchbar = '#searchbar input'; const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none'; - const summaryHeader = '.summaryBody .header'; + const summaryHeader = '.header-link'; beforeEach(() => { cy.viewport(1920, 1080); diff --git a/test/cypress/integration/shelving/shelvingList.spec.js b/test/cypress/integration/shelving/shelvingList.spec.js index 745dd1b78..20b72e419 100644 --- a/test/cypress/integration/shelving/shelvingList.spec.js +++ b/test/cypress/integration/shelving/shelvingList.spec.js @@ -16,8 +16,8 @@ describe('ShelvingList', () => { it('should redirect from preview to basic-data', () => { cy.typeSearchbar('{enter}'); cy.dataCy('cardBtn').eq(0).click(); - cy.get('.q-card > .header').click(); - cy.url().should('include', '/shelving/1/basic-data'); + cy.get('.summaryHeader > .header > .q-icon').click(); + cy.url().should('include', '/shelving/1/summary'); }); it('should filter and redirect if only one result', () => { diff --git a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js index 90566bbcf..b4997fa69 100644 --- a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js +++ b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js @@ -1,5 +1,5 @@ /// -describe('Ticket Lack detail', () => { +describe.skip('Ticket Lack detail', () => { beforeEach(() => { cy.login('developer'); cy.intercept('GET', /\/api\/Tickets\/itemLack\/5.*$/, { @@ -138,7 +138,7 @@ describe('Ticket Lack detail', () => { cy.get('[data-cy="itemProposal"]').click(); cy.wait('@getItemGetSimilar'); }); - describe('Replace item if', () => { + describe.skip('Replace item if', () => { it('Quantity is less than available', () => { cy.get(':nth-child(1) > .text-right > .q-btn').click(); }); diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js index 25ee05033..2409dd149 100644 --- a/test/cypress/integration/ticket/ticketList.spec.js +++ b/test/cypress/integration/ticket/ticketList.spec.js @@ -38,8 +38,8 @@ describe('TicketList', () => { it('filter client and create ticket', () => { cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar'); searchResults(); + cy.wait('@ticketSearchbar'); - cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter'); cy.dataCy('Customer ID_input').clear('1'); cy.dataCy('Customer ID_input').type('1101{enter}'); diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js index 81ea761c4..6d84f214c 100644 --- a/test/cypress/integration/ticket/ticketSale.spec.js +++ b/test/cypress/integration/ticket/ticketSale.spec.js @@ -1,139 +1,14 @@ /// +const firstRow = 'tbody > :nth-child(1)'; describe('TicketSale', () => { - describe.skip('Free ticket #31', () => { - beforeEach(() => { - cy.login('developer'); - cy.viewport(1920, 1080); - cy.visit('/#/ticket/31/sale'); - }); - - const firstRow = 'tbody > :nth-child(1)'; - - const selectFirstRow = () => { - cy.waitForElement(firstRow); - cy.get(firstRow).find('.q-checkbox__inner').click(); - }; - - it('it should add item to basket', () => { - cy.window().then((win) => { - cy.stub(win, 'open').as('windowOpen'); - }); - cy.dataCy('ticketSaleAddToBasketBtn').should('exist'); - cy.dataCy('ticketSaleAddToBasketBtn').click(); - cy.get('@windowOpen').should('be.calledWithMatch', /\/order\/\d+\/catalog/); - }); - - it('should send SMS', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.waitForElement('[data-cy="sendShortageSMSItem"]'); - cy.dataCy('sendShortageSMSItem').should('exist'); - cy.dataCy('sendShortageSMSItem').click(); - cy.dataCy('vnSmsDialog').should('exist'); - cy.dataCy('sendSmsBtn').click(); - cy.checkNotification('SMS sent'); - }); - - it('should recalculate price when "Recalculate price" is clicked', () => { - cy.intercept('POST', '**/recalculatePrice').as('recalculatePrice'); - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.waitForElement('[data-cy="recalculatePriceItem"]'); - cy.dataCy('recalculatePriceItem').should('exist'); - cy.dataCy('recalculatePriceItem').click(); - cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200); - cy.checkNotification('Data saved'); - }); - - it('should update discount when "Update discount" is clicked', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.waitForElement('[data-cy="updateDiscountItem"]'); - cy.dataCy('updateDiscountItem').should('exist'); - cy.dataCy('updateDiscountItem').click(); - cy.waitForElement('[data-cy="ticketSaleDiscountInput"]'); - cy.dataCy('ticketSaleDiscountInput').find('input').focus(); - cy.dataCy('ticketSaleDiscountInput').find('input').type('10'); - cy.dataCy('saveManaBtn').click(); - cy.waitForElement('.q-notification__message'); - cy.checkNotification('Data saved'); - }); - - it('adds claim', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.dataCy('createClaimItem').click(); - cy.dataCy('VnConfirm_confirm').click(); - cy.url().should('contain', 'claim/'); - // Delete created claim to avoid cluttering the database - cy.dataCy('descriptor-more-opts').click(); - cy.dataCy('deleteClaim').click(); - cy.dataCy('VnConfirm_confirm').click(); - cy.checkNotification('Data deleted'); - }); - - it('marks row as reserved', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.waitForElement('[data-cy="markAsReservedItem"]'); - cy.dataCy('markAsReservedItem').click(); - cy.dataCy('ticketSaleReservedIcon').should('exist'); - }); - - it('unmarks row as reserved', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.waitForElement('[data-cy="unmarkAsReservedItem"]'); - cy.dataCy('unmarkAsReservedItem').click(); - cy.dataCy('ticketSaleReservedIcon').should('not.exist'); - }); - - it('refunds row with warehouse', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.dataCy('ticketSaleRefundItem').click(); - cy.dataCy('ticketSaleRefundWithWarehouse').click(); - cy.checkNotification('The following refund ticket have been created'); - }); - - it('refunds row without warehouse', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.dataCy('ticketSaleRefundItem').click(); - cy.dataCy('ticketSaleRefundWithoutWarehouse').click(); - cy.checkNotification('The following refund ticket have been created'); - }); - - it('transfer sale to a new ticket', () => { - cy.visit('/#/ticket/32/sale'); - cy.get('.q-item > .q-item__label').should('have.text', ' #32'); - selectFirstRow(); - cy.dataCy('ticketSaleTransferBtn').click(); - cy.dataCy('ticketTransferPopup').should('exist'); - cy.dataCy('ticketTransferNewTicketBtn').click(); - cy.get('.q-item > .q-item__label').should('not.have.text', ' #32'); - }); - - it('should redirect to ticket logs', () => { - cy.get(firstRow).find('.q-btn:last').click(); - cy.url().should('match', /\/ticket\/31\/log/); - }); - }); - describe.skip('Ticket prepared #23', () => { + describe('Ticket #23', () => { beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); cy.visit('/#/ticket/23/sale'); }); - const firstRow = 'tbody > :nth-child(1)'; - - const selectFirstRow = () => { - cy.waitForElement(firstRow); - cy.get(firstRow).find('.q-checkbox__inner').click(); - }; - it('update price', () => { const price = Number((Math.random() * 99 + 1).toFixed(2)); cy.waitForElement(firstRow); @@ -148,7 +23,7 @@ describe('TicketSale', () => { cy.get('[data-col-field="price"]') .find('.q-btn > .q-btn__content') - .should('have.text', `€${price}`); + .should('contain.text', `€${price}`); }); it('update discount', () => { const discount = Math.floor(Math.random() * 100) + 1; @@ -196,8 +71,128 @@ describe('TicketSale', () => { .should('have.value', `${quantity}`); }); }); -}); + describe('Ticket to add claim #24', () => { + beforeEach(() => { + cy.login('developer'); + cy.viewport(1920, 1080); + cy.visit('/#/ticket/24/sale'); + }); + it('adds claim', () => { + selectFirstRow(); + cy.dataCy('ticketSaleMoreActionsDropdown').click(); + cy.dataCy('createClaimItem').click(); + cy.dataCy('VnConfirm_confirm').click(); + cy.url().should('contain', 'claim/'); + // Delete created claim to avoid cluttering the database + cy.dataCy('descriptor-more-opts').click(); + cy.dataCy('deleteClaim').click(); + cy.dataCy('VnConfirm_confirm').click(); + }); + }); + describe('Free ticket #31', () => { + beforeEach(() => { + cy.login('developer'); + cy.viewport(1920, 1080); + cy.visit('/#/ticket/31/sale'); + }); + + it('it should add item to basket', () => { + cy.window().then((win) => { + cy.stub(win, 'open').as('windowOpen'); + }); + cy.dataCy('ticketSaleAddToBasketBtn').should('exist'); + cy.dataCy('ticketSaleAddToBasketBtn').click(); + cy.get('@windowOpen').should('be.calledWithMatch', /\/order\/\d+\/catalog/); + }); + + it('should send SMS', () => { + selectFirstRow(); + cy.dataCy('ticketSaleMoreActionsDropdown').click(); + cy.waitForElement('[data-cy="sendShortageSMSItem"]'); + cy.dataCy('sendShortageSMSItem').should('exist'); + cy.dataCy('sendShortageSMSItem').click(); + cy.dataCy('vnSmsDialog').should('exist'); + cy.dataCy('sendSmsBtn').click(); + cy.checkNotification('SMS sent'); + }); + + it('should recalculate price when "Recalculate price" is clicked', () => { + cy.intercept('POST', '**/recalculatePrice').as('recalculatePrice'); + selectFirstRow(); + cy.dataCy('ticketSaleMoreActionsDropdown').click(); + cy.waitForElement('[data-cy="recalculatePriceItem"]'); + cy.dataCy('recalculatePriceItem').should('exist'); + cy.dataCy('recalculatePriceItem').click(); + cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200); + cy.checkNotification('Data saved'); + cy.dataCy('ticketSaleMoreActionsDropdown').should('be.disabled'); + }); + + it('should update discount when "Update discount" is clicked', () => { + selectFirstRow(); + cy.dataCy('ticketSaleMoreActionsDropdown').click(); + cy.waitForElement('[data-cy="updateDiscountItem"]'); + cy.dataCy('updateDiscountItem').should('exist'); + cy.dataCy('updateDiscountItem').click(); + cy.waitForElement('[data-cy="ticketSaleDiscountInput"]'); + cy.dataCy('ticketSaleDiscountInput').find('input').focus(); + cy.dataCy('ticketSaleDiscountInput').find('input').type('10'); + cy.dataCy('saveManaBtn').click(); + cy.waitForElement('.q-notification__message'); + cy.checkNotification('Data saved'); + cy.dataCy('ticketSaleMoreActionsDropdown').should('be.disabled'); + }); + + it('adds claim', () => { + selectFirstRow(); + cy.dataCy('ticketSaleMoreActionsDropdown').click(); + cy.dataCy('createClaimItem').click(); + cy.dataCy('VnConfirm_confirm').click(); + cy.checkNotification('Future ticket date not allowed'); + }); + + it('refunds row with warehouse', () => { + selectFirstRow(); + cy.dataCy('ticketSaleMoreActionsDropdown').click(); + cy.dataCy('ticketSaleRefundItem').click(); + cy.dataCy('ticketSaleRefundWithWarehouse').click(); + cy.checkNotification('The following refund ticket have been created'); + }); + + it('refunds row without warehouse', () => { + selectFirstRow(); + cy.dataCy('ticketSaleMoreActionsDropdown').click(); + cy.dataCy('ticketSaleRefundItem').click(); + cy.dataCy('ticketSaleRefundWithoutWarehouse').click(); + cy.checkNotification('The following refund ticket have been created'); + }); + + it('should redirect to ticket logs', () => { + cy.get(firstRow).find('.q-btn:last').click(); + cy.url().should('match', /\/ticket\/31\/log/); + }); + }); + describe('Ticket to transfer #32', () => { + beforeEach(() => { + cy.login('developer'); + cy.viewport(1920, 1080); + cy.visit('/#/ticket/32/sale'); + }); + it('transfer sale to a new ticket', () => { + cy.get('.q-item > .q-item__label').should('have.text', ' #32'); + selectFirstRow(); + cy.dataCy('ticketSaleTransferBtn').click(); + cy.dataCy('ticketTransferPopup').should('exist'); + cy.dataCy('ticketTransferNewTicketBtn').click(); + cy.get('.q-item > .q-item__label').should('not.have.text', ' #32'); + }); + }); +}); +function selectFirstRow() { + cy.waitForElement(firstRow); + cy.get(firstRow).find('.q-checkbox__inner').click(); +} function handleVnConfirm() { cy.get('[data-cy="VnConfirm_confirm"]').click(); cy.waitForElement('.q-notification__message'); diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js index 6d185ea69..88855fdf9 100644 --- a/test/cypress/integration/wagon/wagonCreate.spec.js +++ b/test/cypress/integration/wagon/wagonCreate.spec.js @@ -1,4 +1,4 @@ -describe.skip('WagonCreate', () => { +describe('WagonCreate', () => { beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); @@ -17,7 +17,7 @@ describe.skip('WagonCreate', () => { '.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]', ).type('100'); cy.selectOption('[data-cy="Type_select"]', '1'); - + cy.dataCy('FormModelPopup_save').click(); cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click(); }); }); diff --git a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js index 49d7d9f01..915927a6d 100644 --- a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js +++ b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js @@ -2,7 +2,7 @@ describe('WagonTypeCreate', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); - cy.visit('/#/wagon/type/create'); + cy.visit('/#/wagon/type/list'); cy.waitForElement('.q-page', 6000); }); diff --git a/test/cypress/integration/worker/workerBasicData.spec.js b/test/cypress/integration/worker/workerBasicData.spec.js new file mode 100644 index 000000000..cf452a044 --- /dev/null +++ b/test/cypress/integration/worker/workerBasicData.spec.js @@ -0,0 +1,15 @@ +describe('WorkerBasicData', () => { + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('developer'); + cy.visit('/#/worker/1107/basic-data'); + }); + + it('should modify worker summary', () => { + cy.dataCy('MaritalStatus').type('Married'); + cy.dataCy('fi').type('42572374H'); + cy.dataCy('country').type('Alemania'); + cy.saveCard(); + cy.checkNotification('Data saved'); + }); +}); diff --git a/test/cypress/integration/worker/workerBusiness.spec.js b/test/cypress/integration/worker/workerBusiness.spec.js new file mode 100644 index 000000000..46da28cd6 --- /dev/null +++ b/test/cypress/integration/worker/workerBusiness.spec.js @@ -0,0 +1,34 @@ +describe.skip('WorkerBusiness', () => { + const saveBtn = '.q-mt-lg > .q-btn--standard'; + const contributionCode = `Representantes de comercio`; + const contractType = `INDEFINIDO A TIEMPO COMPLETO`; + + const Business = { + 'Start Date': { val: '26-12-2002', type: 'date' }, + Company: { val: `VNL`, type: 'select' }, + Department: { val: `RECICLAJE`, type: 'select' }, + 'Professional Category': { val: `employee`, type: 'select' }, + 'Work Calendar': { val: `General schedule`, type: 'select' }, + 'Work Center': { val: `Silla`, type: 'select' }, + 'Contract Category': { val: `INFORMATICA`, type: 'select' }, + 'Contribution Code': { val: contributionCode, type: 'select' }, + Rate: { val: `5` }, + 'Contract Type': { val: contractType, type: 'select' }, + 'Transport Workers Salary': { val: `1000` }, + }; + + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('hr'); + cy.visit('/#/worker/1107/business'); + cy.addCard(); + }); + + it('should create a business', () => { + cy.fillInForm({ + ...Business, + }); + cy.get(saveBtn).click(); + cy.checkNotification('Data created'); + }); +}); diff --git a/test/cypress/integration/worker/workerMutual.spec.js b/test/cypress/integration/worker/workerMutual.spec.js new file mode 100644 index 000000000..a6d2c5f4f --- /dev/null +++ b/test/cypress/integration/worker/workerMutual.spec.js @@ -0,0 +1,23 @@ +/// +describe('WorkerMutual', () => { + const userId = 1106; + const saveBtn = '.q-mt-lg > .q-btn--standard'; + const medicalReview = { + Date: { val: '01-01-2001', type: 'date' }, + 'Formation Center': { val: '1', type: 'select' }, + Invoice: { val: '24532' }, + Amount: { val: '540' }, + }; + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('developer'); + cy.visit(`/#/worker/${userId}/medical`); + cy.addCard(); + }); + + it('should create a medical Review', () => { + cy.fillInForm(medicalReview); + cy.get(saveBtn).click(); + cy.checkNotification('Data created'); + }); +}); diff --git a/test/cypress/integration/worker/workerNotes.spec.js b/test/cypress/integration/worker/workerNotes.spec.js new file mode 100644 index 000000000..661314ac9 --- /dev/null +++ b/test/cypress/integration/worker/workerNotes.spec.js @@ -0,0 +1,13 @@ +/// +describe('WorkerNotes', () => { + const userId = 1106; + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('developer'); + cy.visit(`/#/worker/${userId}/notes`); + }); + + it('Should load layout', () => { + cy.get('.q-card').should('be.visible'); + }); +}); diff --git a/test/cypress/integration/worker/workerOperator.spec.js b/test/cypress/integration/worker/workerOperator.spec.js new file mode 100644 index 000000000..95839aeba --- /dev/null +++ b/test/cypress/integration/worker/workerOperator.spec.js @@ -0,0 +1,19 @@ +/// +describe('WorkerOperator', () => { + const userId = 1106; + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('hr'); + cy.visit(`/#/worker/${userId}/operator`); + }); + + it('should fill the operator form', () => { + cy.dataCy('numberOfWagons').type('4'); + cy.dataCy('linesLimit').type('6'); + cy.dataCy('volumeLimit').type('3'); + cy.dataCy('sizeLimit').type('3'); + cy.saveCard(); + + cy.checkNotification('Data saved'); + }); +}); diff --git a/test/cypress/integration/worker/workerPit.spec.js b/test/cypress/integration/worker/workerPit.spec.js index 19cbebc20..04f232648 100644 --- a/test/cypress/integration/worker/workerPit.spec.js +++ b/test/cypress/integration/worker/workerPit.spec.js @@ -1,19 +1,5 @@ describe('WorkerPit', () => { - const familySituationInput = '[data-cy="Family Situation_input"]'; - const familySituation = '1'; - const childPensionInput = '[data-cy="Child Pension_input"]'; - const childPension = '120'; - const spouseNifInput = '[data-cy="Spouse Pension_input"]'; - const spouseNif = '65117125P'; - const spousePensionInput = '[data-cy="Spouse Pension_input"]'; - const spousePension = '120'; const addRelative = '[data-cy="addRelative"]'; - const isDescendantSelect = '[data-cy="Descendant/Ascendant"]'; - const Descendant = 'Descendiente'; - const birthedInput = '[data-cy="Birth Year_input"]'; - const birthed = '2002'; - const adoptionYearInput = '[data-cy="Adoption Year_input"]'; - const adoptionYear = '2004'; const saveRelative = '[data-cy="workerPitRelativeSaveBtn"]'; const savePIT = '#st-actions > .q-btn-group > .q-btn--standard'; @@ -24,15 +10,15 @@ describe('WorkerPit', () => { }); it('complete PIT', () => { - cy.get(familySituationInput).type(familySituation); - cy.get(childPensionInput).type(childPension); - cy.get(spouseNifInput).type(spouseNif); - cy.get(spousePensionInput).type(spousePension); + cy.dataCy('familySituation').type('1'); + cy.dataCy('childPension').type('120'); + cy.dataCy('spouseNif').type('65117125P'); + cy.dataCy('spousePension').type('120'); cy.get(savePIT).click(); cy.get(addRelative).click(); - cy.get(isDescendantSelect).type(Descendant); - cy.get(birthedInput).type(birthed); - cy.get(adoptionYearInput).type(adoptionYear); + cy.dataCy('Descendant/Ascendant').type('Descendiente'); + cy.dataCy('birthed').type('2002'); + cy.dataCy('adoptionYear').type('2004'); cy.get(saveRelative).click(); }); }); diff --git a/test/cypress/integration/worker/workerSummary.spec.js b/test/cypress/integration/worker/workerSummary.spec.js index 3d70fdf96..c50b2c943 100644 --- a/test/cypress/integration/worker/workerSummary.spec.js +++ b/test/cypress/integration/worker/workerSummary.spec.js @@ -1,4 +1,6 @@ describe('WorkerSummary', () => { + const departmentDescriptor = ':nth-child(1) > :nth-child(3) > .value > .link'; + const roleDescriptor = ':nth-child(3) > :nth-child(4) > .value > .link'; beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); @@ -10,7 +12,17 @@ describe('WorkerSummary', () => { cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss'); cy.get(':nth-child(1) > :nth-child(2) > .value > span').should( 'have.text', - 'salesBossNick' + 'salesBossNick', ); }); + + it('should try descriptors', () => { + cy.waitForElement('.summaryHeader'); + cy.get(departmentDescriptor).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '43'); + cy.get(roleDescriptor).click(); + cy.get('.descriptor').should('be.visible'); + cy.get('.q-item > .q-item__label').should('include.text', '19'); + }); }); diff --git a/test/cypress/integration/zone/zoneCalendar.spec.js b/test/cypress/integration/zone/zoneCalendar.spec.js index d71c29142..07661a17d 100644 --- a/test/cypress/integration/zone/zoneCalendar.spec.js +++ b/test/cypress/integration/zone/zoneCalendar.spec.js @@ -1,20 +1,18 @@ describe('ZoneCalendar', () => { const addEventBtn = '.q-page-sticky > div > .q-btn'; const submitBtn = '.q-mt-lg > .q-btn--standard'; - const deleteBtn = '.q-item__section--side > .q-btn'; - const from = '.q-field__control-container > [data-cy="ZoneEventsFromDate"]'; - const to = '.q-field__control-container > [data-cy="ZoneEventsToDate"]'; + const deleteBtn = '[data-cy="ZoneEventsPanelDeleteBtn"]'; beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); - cy.visit(`/#/zone/11/events`); + cy.visit(`/#/zone/13/events`); }); it('should include a one day event, then delete it', () => { cy.get(addEventBtn).click(); cy.dataCy('ZoneEventInclusionDayRadio').click(); - cy.get('.q-card > :nth-child(5)').type('02/04/2001'); + cy.get('.q-card > :nth-child(5)').type('01/01/2001'); cy.get(submitBtn).click(); cy.get(deleteBtn).click(); cy.dataCy('VnConfirm_confirm').click(); @@ -47,7 +45,7 @@ describe('ZoneCalendar', () => { cy.get( '.q-current-day > .q-calendar-month__day--content > [data-cy="ZoneCalendarDay"]', ).click(); - cy.get('.q-mt-lg > :nth-child(2)').click(); + cy.dataCy('ZoneEventExclusionDeleteBtn').click(); cy.dataCy('VnConfirm_confirm').click(); }); }); diff --git a/test/cypress/integration/zone/zoneCreate.spec.js b/test/cypress/integration/zone/zoneCreate.spec.js index 9ef1945bf..fadf5b07f 100644 --- a/test/cypress/integration/zone/zoneCreate.spec.js +++ b/test/cypress/integration/zone/zoneCreate.spec.js @@ -1,4 +1,4 @@ -describe.skip('ZoneCreate', () => { +describe('ZoneCreate', () => { const data = { Name: { val: 'Zone pickup D' }, Price: { val: '3' }, diff --git a/test/cypress/integration/zone/zoneList.spec.js b/test/cypress/integration/zone/zoneList.spec.js index b1b0db3fc..c84b1b017 100644 --- a/test/cypress/integration/zone/zoneList.spec.js +++ b/test/cypress/integration/zone/zoneList.spec.js @@ -1,26 +1,18 @@ describe('ZoneList', () => { const agency = 'inhouse pickup'; + const firstSummaryIcon = + ':nth-child(1) > .q-table--col-auto-width > [data-cy="tableAction-0"]'; beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); cy.visit('/#/zone/list'); - }); - - it('should filter by agency', () => { - cy.dataCy('zoneFilterPanelAgencySelect').type(agency); - cy.get('.q-menu .q-item').contains(agency).click(); - cy.get(':nth-child(1) > [data-col-field="agencyModeFk"]').should( - 'include.text', - agency, - ); + cy.typeSearchbar('{enter}'); }); it('should open the zone summary', () => { - cy.dataCy('zoneFilterPanelAgencySelect').type(agency); - cy.get('.q-menu .q-item').contains(agency).click(); - cy.dataCy('tableAction-0').eq(1).click(); + cy.get(firstSummaryIcon).click(); cy.get('.header > .q-icon').click(); - cy.url().should('include', 'zone/2/summary'); + cy.url().should('include', 'zone/1/summary'); }); it('should clone the zone', () => { @@ -29,7 +21,5 @@ describe('ZoneList', () => { cy.dataCy('VnConfirm_confirm').click(); cy.url().should('not.include', 'zone/2/'); cy.url().should('match', /zone\/\d+\/basic-data/); - cy.get('.list-box > :nth-child(1)').should('include.text', agency); - cy.get('.title > span').should('include.text', 'Zone pickup B'); }); }); diff --git a/test/cypress/integration/zone/zoneLocations.spec.js b/test/cypress/integration/zone/zoneLocations.spec.js index 04b7f1991..3a52d276c 100644 --- a/test/cypress/integration/zone/zoneLocations.spec.js +++ b/test/cypress/integration/zone/zoneLocations.spec.js @@ -1,9 +1,10 @@ -describe('ZoneLocations', () => { +describe.skip('ZoneLocations', () => { const data = { Warehouse: { val: 'Warehouse One', type: 'select' }, }; - const postalCode = '[style=""] > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > .q-tree__node--parent > .q-tree__node-collapsible > .q-tree__children' + const postalCode = + '[style=""] > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > .q-tree__node--parent > .q-tree__node-collapsible > .q-tree__children'; beforeEach(() => { cy.viewport(1280, 720); @@ -12,12 +13,14 @@ describe('ZoneLocations', () => { }); it('should show all locations on entry', () => { - cy.get('.q-tree > :nth-child(1) > :nth-child(2) > :nth-child(1)').children().should('have.length', 9); + cy.get('.q-tree > :nth-child(1) > :nth-child(2) > :nth-child(1)') + .children() + .should('have.length', 9); }); it('should be able to search by postal code', () => { cy.get('#searchbarForm').type('46680'); cy.get('.router-link-active > .q-icon').click(); - cy.get(postalCode).should('include.text', '46680') + cy.get(postalCode).should('include.text', '46680'); }); }); diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js index b2c1c1ed2..bca5ced22 100644 --- a/test/cypress/integration/zone/zoneWarehouse.spec.js +++ b/test/cypress/integration/zone/zoneWarehouse.spec.js @@ -1,4 +1,4 @@ -describe.skip('ZoneWarehouse', () => { +describe('ZoneWarehouse', () => { const data = { Warehouse: { val: 'Warehouse Two', type: 'select' }, }; diff --git a/test/cypress/run.sh b/test/cypress/run.sh index 1f506aa57..0f8c59902 100755 --- a/test/cypress/run.sh +++ b/test/cypress/run.sh @@ -1,24 +1,39 @@ #!/bin/bash +salix_dir="${1:-$HOME/Projects/salix}" +salix_dir=$(eval echo "$salix_dir") + +echo "$salix_dir" + +current_dir=$(pwd) + cleanup() { - if [[ -z "$ended" ]]; then - ended=true - docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml down -v - fi + docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml down -v } trap cleanup SIGINT -#CLEAN +# CLEAN rm -rf test/cypress/screenshots rm -f test/cypress/results/* rm -f test/cypress/reports/* rm -f junit/e2e-*.xml -#RUN +# RUN export CI=true export TZ=Europe/Madrid +# IMAGES +docker build -t registry.verdnatura.es/salix-back:dev -f "$salix_dir/back/Dockerfile" "$salix_dir" +cd "$salix_dir" && npx myt run -t +docker exec vn-database sh -c "rm -rf /mysql-template" +docker exec vn-database sh -c "cp -a /var/lib/mysql /mysql-template" +docker commit vn-database registry.verdnatura.es/salix-db:dev +docker rm -f vn-database +cd "$current_dir" +docker build -f ./docs/Dockerfile.dev -t lilium-dev . +# END IMAGES + docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml up -d docker run -it --rm \ diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index a3ac82739..9f953f938 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -62,12 +62,7 @@ Cypress.Commands.overwrite('visit', (originalFn, url, options, waitRequest = tru originalFn(url, options); cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete')); cy.waitUntil(() => cy.get('main').should('exist')); - if (waitRequest) - cy.get('body').then(($body) => { - if ($body.find('[data-cy="loading-spinner"]').length) { - cy.get('[data-cy="loading-spinner"]').should('not.be.visible'); - } - }); + if (waitRequest) cy.waitSpinner(); }); Cypress.Commands.add('waitForElement', (element) => { @@ -99,6 +94,14 @@ Cypress.Commands.add('getValue', (selector) => { }); }); +Cypress.Commands.add('waitSpinner', () => { + cy.get('body').then(($body) => { + if ($body.find('[data-cy="loading-spinner"]').length) { + cy.get('[data-cy="loading-spinner"]').should('not.be.visible'); + } + }); +}); + // Fill Inputs Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => { cy.waitForElement(selector, timeout); @@ -116,6 +119,7 @@ Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => { function selectItem(selector, option, ariaControl, hasWrite = true) { if (!hasWrite) cy.wait(100); + cy.waitSpinner(); getItems(ariaControl).then((items) => { const matchingItem = items @@ -135,6 +139,7 @@ function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) { .should('exist') .find('.q-item') .should('exist') + .should('be.visible') .then(($items) => { if (!$items?.length || $items.first().text().trim() === '') { if (Cypress._.now() - startTime > timeout) { diff --git a/test/cypress/support/index.js b/test/cypress/support/index.js index 87e869b6d..b0f0fb3b1 100644 --- a/test/cypress/support/index.js +++ b/test/cypress/support/index.js @@ -40,6 +40,11 @@ style.innerHTML = ` `; document.head.appendChild(style); +// FIXME: https://redmine.verdnatura.es/issues/8771 +Cypress.on('uncaught:exception', (err) => { + if (err.code === 'ERR_CANCELED') return false; +}); + const waitForApiReady = (url, maxRetries = 20, delay = 1000) => { let retries = 0;
{{ t('route.Select the starting date') }}
+ {{ t('route.extendedList.selectStartingDate') }} +
- {{ t('Select the estimated date of departure (ETD)') }} + {{ t('route.roadmap.selectEtd') }}