Compare commits

...

165 Commits

Author SHA1 Message Date
Alex Moreno a9e3cad8ba refactor: streamline image build process in run.sh
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-12 12:39:08 +02:00
Jorge Penadés 93e29fdde6 Merge pull request 'fix: refs #7967 show userErr & useNotify composable' (!1725) from 7939-showUserErr into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1725
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-12 10:35:45 +00:00
Jorge Penadés 22747995cb Merge branch 'dev' of https: refs #7939//gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-12 10:42:00 +02:00
Jon Elias 33a6e5ebd3 Merge pull request '#8180: Notify if the closing zone has tickets for that day' (!1746) from 8180-CloseZoneWithTickets into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1746
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-05-12 08:19:22 +00:00
Jon Elias 86a3192c17 Merge branch '8180-CloseZoneWithTickets' of https://gitea.verdnatura.es/verdnatura/salix-front into 8180-CloseZoneWithTickets
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-12 10:13:16 +02:00
Jon Elias 85074b3ca4 fix: refs #8180 test isolation due to notifications 2025-05-12 10:13:14 +02:00
Jon Elias de4e5ce669 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8180-CloseZoneWithTickets 2025-05-12 09:49:08 +02:00
Jon Elias 90fb1485b0 Merge branch 'dev' into 8180-CloseZoneWithTickets
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-12 07:38:30 +00:00
Alex Moreno 5b5ce033f0 fix: skip RoadMap test suite for temporary exclusion
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-12 09:36:01 +02:00
Jon Elias e470fa70e2 Merge branch 'dev' into 8180-CloseZoneWithTickets
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-12 07:06:02 +00:00
Alex Moreno 8b61d1a4c7 Merge pull request 'feat(ExtraCommunity): refs #8105 add data-cy attribute for testing and create integration tests' (!1786) from 8105-travels_bySupplier into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1786
Reviewed-by: Jon Elias <jon@verdnatura.es>
2025-05-09 08:01:24 +00:00
Alex Moreno 8f3621efc6 Merge branch 'dev' into 8105-travels_bySupplier
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 08:00:05 +00:00
Jon Elias 50f1b5b326 Merge pull request 'fix: fixed label and increased test coverage' (!1777) from Fix-VnBankDetail into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1777
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-09 07:59:48 +00:00
Jon Elias 7cacdbdf94 Merge branch 'dev' into Fix-VnBankDetail
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 07:54:25 +00:00
Alex Moreno 7afd6b3dcd Merge branch 'dev' into 8105-travels_bySupplier
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 06:39:10 +00:00
Alex Moreno 51402f9f3f test: enable OrderCatalog tests by removing skip
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-09 08:09:52 +02:00
Alex Moreno a4c4d987c7 Merge pull request 'test: refs #8862 add Cypress isolation tests for various ticket and zone components' (!1698) from 8862-testIsolationFalse into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1698
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-09 06:05:14 +00:00
Alex Moreno b1bde7be97 fix: refs #8862 skip OrderCatalog tests to prevent isolation issues
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 07:18:01 +02:00
Alex Moreno 5c927cec4b Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
2025-05-09 05:08:19 +00:00
Pau Rovira ab0d2e60b7 Merge pull request 'feat: #8406 upgraded CrudModel' (!1627) from 8406-crudModelUpdate into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1627
Reviewed-by: Jorge Penadés <jorgep@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-08 14:44:15 +00:00
Pau Rovira 0502abfca5 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-08 14:17:54 +00:00
Alex Moreno b1ef9b1bd3 Merge pull request 'feat: refs #7248 modify VnNotes' (!1336) from 7248-tablesObservation into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1336
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-08 13:04:24 +00:00
Benjamin Esteve 68d1f3cb18 Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 12:58:01 +00:00
Alex Moreno debae747db Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 10:53:36 +00:00
Alex Moreno 671f0c1e67 Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-08 10:21:53 +00:00
Javier Segarra cbb36d0ec7 fix: minor bug related with vnTable selectAll
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-08 10:28:03 +02:00
Alex Moreno beeeedbb84 feat(ExtraCommunity): refs #8105 add data-cy attribute for testing and create integration tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 10:21:32 +02:00
Benjamin Esteve 34fc2d403d Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 07:07:24 +00:00
Alex Moreno fca1c77791 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-08 08:26:20 +02:00
Alex Moreno b993428201 fix(VnUserLink): stop when workerId is null
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-08 08:26:05 +02:00
Jon Elias d3b6223473 perf: refs #8180 simplify ticket checking by combining hasTickets logic
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-07 17:24:14 +02:00
Jon Elias b68f4331b8 Merge branch '8180-CloseZoneWithTickets' of https://gitea.verdnatura.es/verdnatura/salix-front into 8180-CloseZoneWithTickets
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-07 16:53:25 +02:00
Jon Elias 9d500a0655 refactor: refs #8180 get data from front instead of back 2025-05-07 16:53:23 +02:00
Javier Segarra 035530c4ce Merge pull request 'fix: fixed a problem when trying to order by shipped' (!1784) from hotfix-customerConsumptionOrder into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1784
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2025-05-07 14:24:15 +00:00
Javier Segarra 3ed45ec8e1 Merge branch 'master' into hotfix-customerConsumptionOrder
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-07 14:20:24 +00:00
Jon Elias 20aea5b7df Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8180-CloseZoneWithTickets 2025-05-07 16:15:44 +02:00
Alex Moreno 5bb452186e fix: refs #7248 update user filter property name in VehicleNotes component
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 15:04:02 +02:00
Benjamin Esteve 148e49b153 Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-05-07 11:32:03 +00:00
Alex Moreno 7dd6cc71e2 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation 2025-05-07 13:29:54 +02:00
Alex Moreno d611a7387c Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-07 13:06:35 +02:00
Alex Moreno 03dd5831c2 fix: update description assignment logic based on supplier reference
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-07 13:06:21 +02:00
Pau Rovira 69f1f4d47c fix: fixed a problem when trying to order by shipped
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-07 09:44:41 +00:00
Jon Elias 44d395054a Merge pull request 'Hotfix[CustomerNewPayment]: Description field not changing automatically' (!1783) from Fix-CustomerBalanceDescription into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1783
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-07 09:41:00 +00:00
Benjamin Esteve cfe64d644e Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 11:35:54 +02:00
Jon Elias e8ea2ebaa2 Merge branch 'master' into Fix-CustomerBalanceDescription
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-07 08:57:36 +00:00
Jon Elias a3c917f82a fix: make data be reactive and use template values
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details
2025-05-07 10:55:09 +02:00
Alex Moreno 9d643a5a32 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-07 10:54:35 +02:00
Alex Moreno b70e23498b Merge pull request 'hotFix(VnUserLink): improve worker existence check and refactor template logic' (!1773) from hotFix_VnUserLink_whenNotIsWorker into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1773
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
Reviewed-by: Jon Elias <jon@verdnatura.es>
2025-05-07 08:54:03 +00:00
Benjamin Esteve 91c627324a Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 10:23:56 +02:00
Alex Moreno 8ae5d8b238 Merge pull request 'chore: run eslint fix and prettier write' (!1782) from run_eslint_and_prettier into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1782
Reviewed-by: Jon Elias <jon@verdnatura.es>
2025-05-07 08:22:01 +00:00
Alex Moreno 6b51996c36 Merge branch 'master' into hotFix_VnUserLink_whenNotIsWorker
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-07 08:19:23 +00:00
Alex Moreno 3647b2b09b fix: skip test by commit d18dd7b9ae
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-07 10:14:36 +02:00
Benjamin Esteve 5cad6103a5 feat: refs #8862 enable test isolation for multiple spec files
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 10:13:03 +02:00
Jon Elias efd2738553 fix: skip failling e2e in jenkins
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-07 10:02:21 +02:00
Jon Elias cc33568c27 fix: description field not changing
gitea/salix-front/pipeline/pr-master This commit is unstable Details
2025-05-07 09:57:10 +02:00
Alex Moreno d5fc3423d6 Merge branch '7248-tablesObservation' of https://gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 09:56:04 +02:00
Alex Moreno e064f9e706 fix: refs #7248 rename workerFk to userFk in CustomerDefaulter component 2025-05-07 09:55:48 +02:00
Alex Moreno cb47858f65 Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-05-07 07:49:56 +00:00
Alex Moreno 686edc0b51 Revert "fix: refs #7248 update exprBuilder for workerFk and calculate total amount in CustomerBalanceDueTotal"
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
This reverts commit 5f9d498700.
2025-05-07 09:49:17 +02:00
Alex Moreno b3c2df5940 test: skip VnShortcuts test suite and ensure spinner waits in beforeEach
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-07 09:40:34 +02:00
Alex Moreno c4c6758a6c fix: simplify waitForElement command and ensure selector exists before scrolling
gitea/salix-front/pipeline/pr-master This commit is unstable Details
2025-05-07 07:56:45 +02:00
Alex Moreno de89eb437f chore: run eslint fix and prettier write
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 07:51:55 +02:00
Alex Moreno 876f40b4a3 Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 05:36:55 +00:00
Alex Moreno a55c03f945 fix: enhance waitForElement command to ensure element exists and is visible
gitea/salix-front/pipeline/pr-master This commit is unstable Details
2025-05-07 07:27:54 +02:00
Alex Moreno 34892316d7 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into hotFix_VnUserLink_whenNotIsWorker 2025-05-07 07:21:31 +02:00
Javier Segarra 2bdc05951a fix: ticketEditMana i18n label
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-06 18:44:53 +02:00
Javier Segarra 112dcca245 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-06 15:20:30 +02:00
Javier Segarra d18dd7b9ae fix: remove rule required 2025-05-06 15:20:28 +02:00
Javier Segarra 382a2e0321 Merge pull request 'fix: fix Description & TicketId filters on CustomerConsumption' (!1779) from hotfix-customerConsumptionFilters into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1779
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2025-05-06 13:09:05 +00:00
Alex Moreno f8b1966c2a Merge pull request 'feat: refs #8767 enable download and corrective invoice tests' (!1778) from 8767-invoiceInDescriptor_e2e into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1778
Reviewed-by: Jon Elias <jon@verdnatura.es>
2025-05-06 12:33:58 +00:00
Pau Rovira 6c8ccd011a fix: merge
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-06 14:12:27 +02:00
Pau Rovira 761948d5b3 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into hotfix-customerConsumptionFilters
gitea/salix-front/pipeline/pr-master Build started... Details
2025-05-06 14:10:56 +02:00
Pau Rovira af065eb66e fix: fix Description & TicketId filters on CustomerConsumption
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details
2025-05-06 14:07:16 +02:00
Benjamin Esteve 53cea184cc Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-06 10:40:01 +00:00
Javier Segarra 6f43f2df04 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-06 12:35:52 +02:00
Javier Segarra 5a54debbc0 fix: #347390 ticketWeekly 2025-05-06 12:35:45 +02:00
Alex Moreno 00010c1db3 feat: refs #8767 enable download and corrective invoice tests
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-06 11:56:42 +02:00
Jon Elias 7f7c86def2 Merge branch 'dev' into Fix-VnBankDetail
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-06 09:34:21 +00:00
Alex Moreno 6f3b768fca Merge branch 'hotFix_VnUserLink_whenNotIsWorker' of https://gitea.verdnatura.es/verdnatura/salix-front into hotFix_VnUserLink_whenNotIsWorker
gitea/salix-front/pipeline/pr-master This commit is unstable Details
2025-05-06 11:27:52 +02:00
Alex Moreno 88b460ee99 test: add VnUserLink stub to VnDmsList and VnLog tests 2025-05-06 11:27:50 +02:00
Javier Segarra 8c81c813b9 Merge branch 'master' into hotFix_VnUserLink_whenNotIsWorker
gitea/salix-front/pipeline/pr-master Something is wrong with the build of this commit Details
2025-05-06 09:25:59 +00:00
Jon Elias 5e17117db3 fix: fixed label and increased test coverage
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-06 11:24:45 +02:00
Jon Elias ddecd0ae9a Merge pull request 'Hotfix[CustomerBalance]: Allow negative amount' (!1776) from Hotfix-CustomerBalanceNegativeAmount into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1776
Reviewed-by: Pablo Natek <pablone@verdnatura.es>
2025-05-06 09:20:36 +00:00
Jon Elias fc2a89b479 Merge branch 'master' into Hotfix-CustomerBalanceNegativeAmount
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-06 09:16:12 +00:00
Pablo Natek 2d4a4dc7aa Merge branch 'master' into Hotfix-CustomerBalanceNegativeAmount
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-06 08:29:15 +00:00
Jon Elias 9aa1b104c8 fix: allow negative amount
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details
2025-05-06 10:28:11 +02:00
Alex Moreno ebfc9daacd fix(VnUserLink): initialize isWorker to false and simplify error handling
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details
2025-05-06 10:17:04 +02:00
Alex Moreno 8f1533d496 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into hotFix_VnUserLink_whenNotIsWorker 2025-05-06 10:16:25 +02:00
Alex Moreno 494369c8f7 Merge branch 'dev' of https: refs #8862//gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-06 09:38:43 +02:00
Jon Elias de93eba293 Merge branch 'dev' into 8180-CloseZoneWithTickets
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-05 14:40:04 +00:00
Alex Moreno 353dcd2567 fix(VnUserLink): improve worker existence check and refactor template logic
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details
2025-05-05 14:36:37 +02:00
Jon Elias 48b5cfe69b Merge branch 'dev' into 8180-CloseZoneWithTickets
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-05 11:35:54 +00:00
Pau Rovira b213ffca3e Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-05 05:54:10 +00:00
Alex Moreno 334d39eeef Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-30 12:21:21 +00:00
Jorge Penadés 4e650378a4 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-30 11:03:32 +02:00
Alex Moreno 5f9d498700 fix: refs #7248 update exprBuilder for workerFk and calculate total amount in CustomerBalanceDueTotal
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-30 10:53:04 +02:00
Jorge Penadés 47f8abe013 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-30 10:15:56 +02:00
Alex Moreno 98c73f8462 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation 2025-04-30 09:38:45 +02:00
Jorge Penadés be88029197 Merge branch '7939-showUserErr' of https://gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-29 17:14:37 +02:00
Jorge Penadés 6ab54908ed Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr 2025-04-29 17:14:29 +02:00
Pau Rovira 0efa72e4a8 Merge branch '8406-crudModelUpdate' of https://gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-29 10:25:00 +02:00
Pau Rovira 81d50bb118 fix: refs #8406 removed duplicated filter 2025-04-29 10:24:58 +02:00
Alex Moreno 160ff54a66 Merge branch 'dev' of https: refs #8862//gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-29 09:04:28 +02:00
Pau Rovira 8a2e301bb7 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-29 06:16:24 +00:00
Pau Rovira 004890a3a9 Merge branch '8406-crudModelUpdate' of https://gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-04-29 08:14:50 +02:00
Pau Rovira 7424d7eb9a fix: refs #8406 remove unused code 2025-04-29 08:14:42 +02:00
Alex Moreno 8e33c79446 Merge branch 'dev' into 7939-showUserErr 2025-04-28 09:49:58 +00:00
Pau Rovira 4cc46e5181 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-28 07:07:45 +00:00
Jorge Penadés c432709a04 feat: refs #7939 add VnSelectExpense
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-25 17:20:45 +02:00
Jorge Penadés dd218361f0 fix: refs #7939 add orderBy property to columns configuration in EntryPreAccount.vue
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-25 14:17:46 +02:00
Jorge Penadés 3ceabd5831 refactor: refs #7939 streamline logout tests and improve session expiration error handling
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-25 13:28:32 +02:00
Jorge Penadés 8dd67efeb9 fix: refs #7939 normalize login route check to be case insensitive
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-25 13:16:50 +02:00
Pau Rovira bb59be3023 Merge branch 'dev' of https: refs #8406//gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-25 13:16:49 +02:00
Pau Rovira 971194c0f6 Merge branch 'dev' of https: refs #8406//gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-04-25 13:15:29 +02:00
Jorge Penadés a8222788ca Merge branch '7939-showUserErr' of https://gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-25 12:51:33 +02:00
Jorge Penadés c31218e4fe Merge branch 'dev' of https: refs #7939//gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr 2025-04-25 12:51:30 +02:00
Alex Moreno 8e10d9d09d Merge branch 'dev' into 7939-showUserErr 2025-04-25 07:56:29 +00:00
Jon Elias b85407d8c2 feat: refs #8180 not allow to close a zone if there are tickets for that day
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-24 14:24:20 +02:00
Alex Moreno 1ceb6b1aef refactor: refs #7248 remove unused state management and simplify body structure in ClaimNotes component
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-24 12:51:23 +02:00
Alex Moreno 4f12a31b1a Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-24 10:38:13 +00:00
Alex Moreno 9c6ffc76cb Merge branch 'dev' of https: refs #7248//gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-24 09:39:08 +02:00
Alex Moreno 442f3dbd48 Merge branch 'dev' of https: refs #7248//gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
2025-04-24 09:38:31 +02:00
Pau Rovira 092a29d555 Merge branch '8406-crudModelUpdate' of https://gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-23 13:53:37 +02:00
Pau Rovira 8e08f65173 feat: refs #8406 add empty row on loading InvoiceInVat 2025-04-23 13:53:34 +02:00
Pau Rovira e4003c6116 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
2025-04-23 10:09:52 +00:00
Pau Rovira aedcda4799 refactor: refs #8406 simplified code
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-23 11:19:55 +02:00
Pau Rovira 10d8db6de3 feat: refs #8406 make tabulation to ignore selection checkbox
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-23 08:58:23 +02:00
Pau Rovira d36be31927 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-23 05:20:47 +00:00
Jorge Penadés 753fa8489c Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-22 16:50:36 +02:00
Jorge Penadés a8d39a9b96 feat(login): refs #7939 add session expiration handling and improve error notifications
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-22 16:48:13 +02:00
Pau Rovira 5c6fc94dd6 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-22 11:43:13 +00:00
Jorge Penadés 81308230ec Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7939-showUserErr
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-22 13:10:06 +02:00
Pau Rovira 35914be54a Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-17 11:31:28 +00:00
Jorge Penadés 5b870c2c2c fix: refs #7939 show userErr & useNotify composable
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-17 11:39:48 +02:00
Pau Rovira 0fa1b6ee9d Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-17 08:40:11 +00:00
Pau Rovira d838d9b55a feat: refs #8406 "add" button on a bottom bar in CrudModel
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-16 14:58:18 +02:00
Benjamin Esteve 03cced3ac6 Merge branch '8862-testIsolationFalse' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-16 10:44:43 +02:00
Benjamin Esteve 1cf9d08a90 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse 2025-04-16 10:44:39 +02:00
Alex Moreno 00ed2b2f6e Merge branch '8862-testIsolationFalse' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 14:11:24 +02:00
Alex Moreno 1a27833081 test: refs #8862 disable test isolation for InvoiceOut list spec 2025-04-15 14:11:22 +02:00
Benjamin Esteve 8dd6926ab7 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-15 13:33:27 +02:00
Benjamin Esteve 608086bd8d test: refs #8862 enable test isolation for Cmr list spec
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-15 12:59:10 +02:00
Benjamin Esteve 395c3a8ec9 test: refs #8862 enable test isolation for multiple account and invoice specs
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 12:29:49 +02:00
Benjamin Esteve 8d6a15eefd test: refs #8862 enable test isolation for InvoiceInDescriptor and VnLog specs
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 12:12:16 +02:00
Benjamin Esteve 2bfd2b09f2 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 11:37:17 +02:00
Benjamin Esteve b7cfabd1a2 test: refs #8862 add Cypress integration tests for ticket and zone functionalities
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-04-15 11:36:37 +02:00
Benjamin Esteve 19550188b8 test: refs #8862 enable test isolation for VnLocation tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 11:16:15 +02:00
Benjamin Esteve d477b6c477 test: refs #8862 enable test isolation for TicketSale tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 10:23:15 +02:00
Benjamin Esteve 4d9912e9b5 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 09:13:50 +02:00
Benjamin Esteve 97c63c2689 refactor: refs #8862 enable test isolation for Cmr list tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 09:08:44 +02:00
Pau Rovira 36d306e827 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-14 11:38:13 +00:00
Benjamin Esteve 3a8f6455d3 refactor: refs #8862 update timeout settings for Cypress tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 12:43:27 +02:00
Benjamin Esteve f3f1ec8039 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 12:38:25 +02:00
Benjamin Esteve 01744012bc Merge branch '8862-testIsolationFalse' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 12:13:11 +02:00
Benjamin Esteve 0f17aa13ae refactor: refs #8862 update timeout settings for Cypress tests 2025-04-11 12:13:08 +02:00
Benjamin Esteve d5a2c880cc Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 09:53:28 +00:00
Benjamin Esteve b22d693a44 test: refs #8862 add Cypress isolation tests for various ticket and zone components
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-10 12:57:09 +02:00
Pau Rovira 5703798781 fix: refs #8406 fixed front test
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-03 09:56:46 +02:00
Pau Rovira c075f39576 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-03 06:52:24 +00:00
Pau Rovira 87c1c16d26 feat: refs #8406 added new insertion with tabulation
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-03 08:38:03 +02:00
Pau Rovira 5b42e97d83 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-03-24 10:07:01 +00:00
Pau Rovira e874375276 feat: refs #8406 upgraded CrudModel 2025-03-24 11:05:36 +01:00
Robert Ferrús be69781e17 Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-02-07 06:05:37 +00:00
Robert Ferrús 523cacbffe Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-02-05 12:35:23 +00:00
Robert Ferrús 9c8aaf65d1 feat: refs #7248 modify VnNotes
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-02-05 13:32:01 +01:00
211 changed files with 5532 additions and 1446 deletions

View File

@ -26,7 +26,7 @@ if (branchName) {
const splitedMsg = msg.split(':'); const splitedMsg = msg.split(':');
if (splitedMsg.length > 1) { if (splitedMsg.length > 1) {
const finalMsg = splitedMsg[0] + ': ' + referenceTag + splitedMsg.slice(1).join(':'); const finalMsg = `${splitedMsg[0]}: ${referenceTag}${splitedMsg.slice(1).join(':')}`;
writeFileSync(msgPath, finalMsg); writeFileSync(msgPath, finalMsg);
} }
} }

View File

@ -1,6 +1,9 @@
import { defineConfig } from 'cypress'; import { defineConfig } from 'cypress';
let urlHost, reporter, reporterOptions, timeouts; let urlHost;
let reporter;
let reporterOptions;
let timeouts;
if (process.env.CI) { if (process.env.CI) {
urlHost = 'front'; urlHost = 'front';
@ -61,5 +64,6 @@ export default defineConfig({
...timeouts, ...timeouts,
includeShadowDom: true, includeShadowDom: true,
waitForAnimations: true, waitForAnimations: true,
testIsolation: false,
}, },
}); });

View File

@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<title><%= productName %></title> <title><%= productName %></title>
@ -12,7 +12,12 @@
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>"
/> />
<link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png" /> <link
rel="icon"
type="image/png"
sizes="128x128"
href="icons/favicon-128x128.png"
/>
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png" /> <link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png" /> <link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png" /> <link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png" />

View File

@ -1,4 +1,3 @@
/* eslint-disable */
// https://github.com/michael-ciniawsky/postcss-load-config // https://github.com/michael-ciniawsky/postcss-load-config
import autoprefixer from 'autoprefixer'; import autoprefixer from 'autoprefixer';

View File

@ -13,7 +13,7 @@ import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
import path from 'path'; import path from 'path';
const target = `http://${process.env.CI ? 'back' : 'localhost'}:3000`; const target = `http://${process.env.CI ? 'back' : 'localhost'}:3000`;
export default configure(function (/* ctx */) { export default configure((/* ctx */) => {
return { return {
eslint: { eslint: {
// fix: true, // fix: true,

View File

@ -1,8 +1,6 @@
{ {
"@quasar/testing-unit-vitest": { "@quasar/testing-unit-vitest": {
"options": [ "options": ["scripts"]
"scripts"
]
}, },
"@quasar/qcalendar": {} "@quasar/qcalendar": {}
} }

View File

@ -39,7 +39,7 @@ quasar.iconMapFn = (iconName) => {
<template> <template>
<RouterView /> <RouterView />
<VnScroll/> <VnScroll />
</template> </template>
<style lang="scss"> <style lang="scss">

View File

@ -11,8 +11,8 @@ export default function (component, key, value) {
}; };
break; break;
case 'undefined': case 'undefined':
throw new Error('unknown prop: ' + key); throw new Error(`unknown prop: ${key}`);
default: default:
throw new Error('unhandled type: ' + typeof prop); throw new Error(`unhandled type: ${typeof prop}`);
} }
} }

View File

@ -9,7 +9,7 @@ export default {
const keyBindingMap = routes const keyBindingMap = routes
.filter((route) => route.meta.keyBinding) .filter((route) => route.meta.keyBinding)
.reduce((map, route) => { .reduce((map, route) => {
map['Key' + route.meta.keyBinding.toUpperCase()] = route.path; map[`Key${route.meta.keyBinding.toUpperCase()}`] = route.path;
return map; return map;
}, {}); }, {});

View File

@ -1,4 +1,3 @@
/* eslint-disable eslint/export */
export * from './defaults/qTable'; export * from './defaults/qTable';
export * from './defaults/qInput'; export * from './defaults/qInput';
export * from './defaults/qSelect'; export * from './defaults/qSelect';

View File

@ -7,7 +7,7 @@ import { QLayout } from 'quasar';
import mainShortcutMixin from './mainShortcutMixin'; import mainShortcutMixin from './mainShortcutMixin';
import { useCau } from 'src/composables/useCau'; import { useCau } from 'src/composables/useCau';
export default boot(({ app }) => { export default boot(({ app, router }) => {
QForm.mixins = [qFormMixin]; QForm.mixins = [qFormMixin];
QLayout.mixins = [mainShortcutMixin]; QLayout.mixins = [mainShortcutMixin];
@ -22,14 +22,19 @@ export default boot(({ app }) => {
} }
switch (response?.status) { switch (response?.status) {
case 401:
if (!router.currentRoute.value.name.toLowerCase().includes('login')) {
message = 'errors.sessionExpired';
} else message = 'login.loginError';
break;
case 403:
if (!message || message.toLowerCase() === 'access denied')
message = 'errors.accessDenied';
case 422: case 422:
if (error.name == 'ValidationError') if (error.name == 'ValidationError')
message += message += ` "${responseError.details.context}.${Object.keys(
' "' + responseError.details.codes,
responseError.details.context + ).join(',')}"`;
'.' +
Object.keys(responseError.details.codes).join(',') +
'"';
break; break;
case 500: case 500:
message = 'errors.statusInternalServerError'; message = 'errors.statusInternalServerError';

View File

@ -25,7 +25,7 @@ const autonomiesRef = ref([]);
const onDataSaved = (dataSaved, requestResponse) => { const onDataSaved = (dataSaved, requestResponse) => {
requestResponse.autonomy = autonomiesRef.value.opts.find( requestResponse.autonomy = autonomiesRef.value.opts.find(
(autonomy) => autonomy.id == requestResponse.autonomyFk (autonomy) => autonomy.id == requestResponse.autonomyFk,
); );
emit('onDataSaved', dataSaved, requestResponse); emit('onDataSaved', dataSaved, requestResponse);
}; };

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { computed, ref, useAttrs, watch } from 'vue'; import { computed, ref, useAttrs, watch, nextTick } from 'vue';
import { useRouter, onBeforeRouteLeave } from 'vue-router'; import { useRouter, onBeforeRouteLeave } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
@ -42,7 +42,15 @@ const $props = defineProps({
}, },
dataRequired: { dataRequired: {
type: Object, type: Object,
default: () => {}, default: () => ({}),
},
dataDefault: {
type: Object,
default: () => ({}),
},
insertOnLoad: {
type: Boolean,
default: false,
}, },
defaultSave: { defaultSave: {
type: Boolean, type: Boolean,
@ -87,6 +95,7 @@ const formData = ref();
const saveButtonRef = ref(null); const saveButtonRef = ref(null);
const watchChanges = ref(); const watchChanges = ref();
const formUrl = computed(() => $props.url); const formUrl = computed(() => $props.url);
const rowsContainer = ref(null);
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
@ -122,9 +131,11 @@ async function fetch(data) {
const rows = keyData ? data[keyData] : data; const rows = keyData ? data[keyData] : data;
resetData(rows); resetData(rows);
emit('onFetch', rows); emit('onFetch', rows);
$props.insertOnLoad && await insert();
return rows; return rows;
} }
function resetData(data) { function resetData(data) {
if (!data) return; if (!data) return;
if (data && Array.isArray(data)) { if (data && Array.isArray(data)) {
@ -135,9 +146,16 @@ function resetData(data) {
formData.value = JSON.parse(JSON.stringify(data)); formData.value = JSON.parse(JSON.stringify(data));
if (watchChanges.value) watchChanges.value(); //destroy watcher if (watchChanges.value) watchChanges.value(); //destroy watcher
watchChanges.value = watch(formData, () => (hasChanges.value = true), { deep: true }); watchChanges.value = watch(formData, (nVal) => {
} hasChanges.value = false;
const filteredNewData = nVal.filter(row => !isRowEmpty(row) || row[$props.primaryKey]);
const filteredOriginal = originalData.value.filter(row => row[$props.primaryKey]);
const changes = getDifferences(filteredOriginal, filteredNewData);
hasChanges.value = !isEmpty(changes);
}, { deep: true });
}
async function reset() { async function reset() {
await fetch(originalData.value); await fetch(originalData.value);
hasChanges.value = false; hasChanges.value = false;
@ -165,7 +183,9 @@ async function onSubmit() {
}); });
} }
isLoading.value = true; isLoading.value = true;
await saveChanges($props.saveFn ? formData.value : null); await saveChanges($props.saveFn ? formData.value : null);
} }
async function onSubmitAndGo() { async function onSubmitAndGo() {
@ -174,6 +194,10 @@ async function onSubmitAndGo() {
} }
async function saveChanges(data) { async function saveChanges(data) {
formData.value = formData.value.filter(row =>
row[$props.primaryKey] || !isRowEmpty(row)
);
if ($props.saveFn) { if ($props.saveFn) {
$props.saveFn(data, getChanges); $props.saveFn(data, getChanges);
isLoading.value = false; isLoading.value = false;
@ -203,14 +227,32 @@ async function saveChanges(data) {
}); });
} }
async function insert(pushData = $props.dataRequired) { async function insert(pushData = { ...$props.dataRequired, ...$props.dataDefault }) {
const $index = formData.value.length formData.value = formData.value.filter(row => !isRowEmpty(row));
? formData.value[formData.value.length - 1].$index + 1
: 0; const lastRow = formData.value.at(-1);
formData.value.push(Object.assign({ $index }, pushData)); const isLastRowEmpty = lastRow ? isRowEmpty(lastRow) : false;
hasChanges.value = true;
if (formData.value.length && isLastRowEmpty) return;
const $index = formData.value.length ? formData.value.at(-1).$index + 1 : 0;
const nRow = Object.assign({ $index }, pushData);
formData.value.push(nRow);
const hasChange = Object.keys(nRow).some(key => !isChange(nRow, key));
if (hasChange) hasChanges.value = true;
} }
function isRowEmpty(row) {
return Object.keys(row).every(key => isChange(row, key));
}
function isChange(row,key){
return !row[key] || key == '$index' || Object.hasOwn($props.dataRequired || {}, key);
}
async function remove(data) { async function remove(data) {
if (!data.length) if (!data.length)
return quasar.notify({ return quasar.notify({
@ -227,10 +269,8 @@ async function remove(data) {
newData = newData.filter( newData = newData.filter(
(form) => !preRemove.some((index) => index == form.$index), (form) => !preRemove.some((index) => index == form.$index),
); );
const changes = getChanges(); formData.value = newData;
if (!changes.creates?.length && !changes.updates?.length) hasChanges.value = JSON.stringify(removeIndexField(formData.value)) !== JSON.stringify(removeIndexField(originalData.value));
hasChanges.value = false;
fetch(newData);
} }
if (ids.length) { if (ids.length) {
quasar quasar
@ -248,9 +288,8 @@ async function remove(data) {
newData = newData.filter((form) => !ids.some((id) => id == form[pk])); newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
fetch(newData); fetch(newData);
}); });
} else {
reset();
} }
emit('update:selected', []); emit('update:selected', []);
} }
@ -261,7 +300,7 @@ function getChanges() {
const pk = $props.primaryKey; const pk = $props.primaryKey;
for (const [i, row] of formData.value.entries()) { for (const [i, row] of formData.value.entries()) {
if (!row[pk]) { if (!row[pk]) {
creates.push(row); creates.push(Object.assign(row, { ...$props.dataRequired }));
} else if (originalData.value[i]) { } else if (originalData.value[i]) {
const data = getDifferences(originalData.value[i], row); const data = getDifferences(originalData.value[i], row);
if (!isEmpty(data)) { if (!isEmpty(data)) {
@ -287,6 +326,33 @@ function isEmpty(obj) {
return !Object.keys(obj).length; return !Object.keys(obj).length;
} }
function removeIndexField(data) {
if (Array.isArray(data)) {
return data.map(({ $index, ...rest }) => rest);
} else if (typeof data === 'object' && data !== null) {
const { $index, ...rest } = data;
return rest;
}
}
async function handleTab(event) {
event.preventDefault();
const { shiftKey, target } = event;
const focusableSelector = `tbody tr td:not(:first-child) :is(a, button, input, textarea, select, details):not([disabled])`;
const focusableElements = rowsContainer.value?.querySelectorAll(focusableSelector);
const currentIndex = Array.prototype.indexOf.call(focusableElements, target);
const index = shiftKey ? currentIndex - 1 : currentIndex + 1;
const isLast = target === focusableElements[focusableElements.length - 1];
const isFirst = currentIndex === 0;
if ((shiftKey && !isFirst) || (!shiftKey && !isLast))
focusableElements[index]?.focus();
else if (isLast) {
await insert();
await nextTick();
}
}
async function reload(params) { async function reload(params) {
const data = await vnPaginateRef.value.fetch(params); const data = await vnPaginateRef.value.fetch(params);
fetch(data); fetch(data);
@ -312,12 +378,14 @@ watch(formUrl, async () => {
v-bind="$attrs" v-bind="$attrs"
> >
<template #body v-if="formData"> <template #body v-if="formData">
<div ref="rowsContainer" @keydown.tab="handleTab">
<slot <slot
name="body" name="body"
:rows="formData" :rows="formData"
:validate="validate" :validate="validate"
:filter="filter" :filter="filter"
></slot> ></slot>
</div>
</template> </template>
</VnPaginate> </VnPaginate>
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && hasSubToolbar"> <Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && hasSubToolbar">
@ -347,8 +415,16 @@ watch(formUrl, async () => {
<QBtnDropdown <QBtnDropdown
v-if="$props.goTo && $props.defaultSave" v-if="$props.goTo && $props.defaultSave"
@click="onSubmitAndGo" @click="onSubmitAndGo"
:label="tMobile('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" :label="
:title="t('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" tMobile('globals.saveAndContinue') +
' ' +
t('globals.' + $props.goTo.split('/').pop())
"
:title="
t('globals.saveAndContinue') +
' ' +
t('globals.' + $props.goTo.split('/').pop())
"
:disable="!hasChanges" :disable="!hasChanges"
color="primary" color="primary"
icon="save" icon="save"

View File

@ -8,10 +8,8 @@ import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
import { useWeekdayStore } from 'src/stores/useWeekdayStore'; import { useWeekdayStore } from 'src/stores/useWeekdayStore';
import useWeekdaysOrder from 'src/composables/getWeekdays'; import useWeekdaysOrder from 'src/composables/getWeekdays';
const formatDate = (dateToFormat, format = 'YYYY-MM-DD') => ( const formatDate = (dateToFormat, format = 'YYYY-MM-DD') =>
date.formatDate(dateToFormat, format) date.formatDate(dateToFormat, format);
);
const props = defineProps({ const props = defineProps({
year: { year: {
@ -67,7 +65,7 @@ const handleDateClick = (timestamp) => {
emit('onDateSelected', { emit('onDateSelected', {
date, date,
isNewMode: !event, isNewMode: !event,
event: event?.[0] || null event: event?.[0] || null,
}); });
}; };
@ -107,7 +105,11 @@ defineExpose({ getEventByTimestamp, handleDateClick });
mini-mode mini-mode
> >
<template #day="{ scope: { timestamp } }"> <template #day="{ scope: { timestamp } }">
<slot name="day" :timestamp="timestamp" :getEventAttrs="getEventAttrs"> <slot
name="day"
:timestamp="timestamp"
:getEventAttrs="getEventAttrs"
>
<QBtn <QBtn
v-if="getEventByTimestamp(timestamp)" v-if="getEventByTimestamp(timestamp)"
v-bind="{ ...getEventAttrs(timestamp) }" v-bind="{ ...getEventAttrs(timestamp) }"

View File

@ -16,7 +16,7 @@ const props = defineProps({
additionalProps: { additionalProps: {
type: Object, type: Object,
default: () => ({}), default: () => ({}),
} },
}); });
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -74,7 +74,7 @@ const date = computed({
const headerTitle = computed(() => { const headerTitle = computed(() => {
if (!months.value?.length) return ''; if (!months.value?.length) return '';
const getMonthName = date => const getMonthName = (date) =>
`${weekdayStore.getLocaleMonths[date.getMonth()].locale} ${date.getFullYear()}`; `${weekdayStore.getLocaleMonths[date.getMonth()].locale} ${date.getFullYear()}`;
return `${getMonthName(months.value[0])} - ${getMonthName(months.value[months.value.length - 1])}`; return `${getMonthName(months.value[0])} - ${getMonthName(months.value[months.value.length - 1])}`;
}); });
@ -87,7 +87,7 @@ const step = (direction) => {
defineExpose({ defineExpose({
firstDay, firstDay,
lastDay lastDay,
}); });
</script> </script>
@ -119,7 +119,7 @@ defineExpose({
:year="month.getFullYear()" :year="month.getFullYear()"
:month-date="month" :month-date="month"
v-bind="additionalProps" v-bind="additionalProps"
@on-date-selected="data => emit('onDateSelected', data)" @on-date-selected="(data) => emit('onDateSelected', data)"
/> />
</div> </div>
</QCard> </QCard>

View File

@ -380,8 +380,16 @@ defineExpose({
data-cy="saveAndContinueDefaultBtn" data-cy="saveAndContinueDefaultBtn"
v-if="$props.goTo" v-if="$props.goTo"
@click="saveAndGo" @click="saveAndGo"
:label="tMobile('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" :label="
:title="t('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" tMobile('globals.saveAndContinue') +
' ' +
t('globals.' + $props.goTo.split('/').pop())
"
:title="
t('globals.saveAndContinue') +
' ' +
t('globals.' + $props.goTo.split('/').pop())
"
:disable="!hasChanges" :disable="!hasChanges"
color="primary" color="primary"
icon="save" icon="save"

View File

@ -26,7 +26,7 @@ async function redirect() {
if (route?.params?.id) if (route?.params?.id)
return (window.location.href = await getUrl( return (window.location.href = await getUrl(
`${section}/${route.params.id}/summary` `${section}/${route.params.id}/summary`,
)); ));
return (window.location.href = await getUrl(section + '/index')); return (window.location.href = await getUrl(section + '/index'));
} }

View File

@ -55,7 +55,7 @@ const refund = async () => {
(data) => ( (data) => (
(rectificativeTypeOptions = data), (rectificativeTypeOptions = data),
(invoiceParams.cplusRectificationTypeFk = data.filter( (invoiceParams.cplusRectificationTypeFk = data.filter(
(type) => type.description == 'I Por diferencias' (type) => type.description == 'I Por diferencias',
)[0].id) )[0].id)
) )
" "
@ -68,7 +68,7 @@ const refund = async () => {
(data) => ( (data) => (
(siiTypeInvoiceOutsOptions = data), (siiTypeInvoiceOutsOptions = data),
(invoiceParams.siiTypeInvoiceOutFk = data.filter( (invoiceParams.siiTypeInvoiceOutFk = data.filter(
(type) => type.code == 'R4' (type) => type.code == 'R4',
)[0].id) )[0].id)
) )
" "

View File

@ -52,7 +52,7 @@ watch(
} else filter.value.where = {}; } else filter.value.where = {};
await provincesFetchDataRef.value.fetch({}); await provincesFetchDataRef.value.fetch({});
emit('onProvinceFetched', provincesOptions.value); emit('onProvinceFetched', provincesOptions.value);
} },
); );
</script> </script>

View File

@ -181,6 +181,10 @@ const col = computed(() => {
newColumn.component = 'checkbox'; newColumn.component = 'checkbox';
if ($props.default && !newColumn.component) newColumn.component = $props.default; if ($props.default && !newColumn.component) newColumn.component = $props.default;
if (typeof newColumn.component !== 'string') {
newColumn.attrs = { ...newColumn.component.attrs, autofocus: $props.autofocus };
newColumn.event = { ...newColumn.component.event, ...$props?.eventHandlers };
}
return newColumn; return newColumn;
}); });

View File

@ -684,8 +684,10 @@ const handleHeaderSelection = (evt, data) => {
ref="CrudModelRef" ref="CrudModelRef"
@on-fetch=" @on-fetch="
(...args) => { (...args) => {
if ($props.multiCheck.expand) {
selectAll = false; selectAll = false;
selected = []; selected = [];
}
emit('onFetch', ...args); emit('onFetch', ...args);
} }
" "

View File

@ -6,7 +6,7 @@ export default function (initialFooter, data) {
}); });
return acc; return acc;
}, },
{ ...initialFooter } { ...initialFooter },
); );
return footer; return footer;
} }

View File

@ -193,11 +193,11 @@ describe('CrudModel', () => {
}); });
it('should set originalData and formatData with data and generate watchChanges', async () => { it('should set originalData and formatData with data and generate watchChanges', async () => {
data = { data = [{
name: 'Tony', name: 'Tony',
lastName: 'Stark', lastName: 'Stark',
age: 42, age: 42,
}; }];
vm.resetData(data); vm.resetData(data);
@ -241,7 +241,7 @@ describe('CrudModel', () => {
await vm.saveChanges(data); await vm.saveChanges(data);
expect(postMock).toHaveBeenCalledWith(vm.url + '/crud', data); expect(postMock).toHaveBeenCalledWith(`${vm.url}/crud`, data);
expect(vm.isLoading).toBe(false); expect(vm.isLoading).toBe(false);
expect(vm.hasChanges).toBe(false); expect(vm.hasChanges).toBe(false);
expect(vm.originalData).toEqual(JSON.parse(JSON.stringify(vm.formData))); expect(vm.originalData).toEqual(JSON.parse(JSON.stringify(vm.formData)));

View File

@ -142,14 +142,14 @@ describe('getRoutes', () => {
const fn = (props) => getRoutes(props, getMethodA, getMethodB); const fn = (props) => getRoutes(props, getMethodA, getMethodB);
it('should call getMethodB when source is card', () => { it('should call getMethodB when source is card', () => {
let props = { source: 'methodB' }; const props = { source: 'methodB' };
fn(props); fn(props);
expect(getMethodB).toHaveBeenCalled(); expect(getMethodB).toHaveBeenCalled();
expect(getMethodA).not.toHaveBeenCalled(); expect(getMethodA).not.toHaveBeenCalled();
}); });
it('should call getMethodA when source is main', () => { it('should call getMethodA when source is main', () => {
let props = { source: 'methodA' }; const props = { source: 'methodA' };
fn(props); fn(props);
expect(getMethodA).toHaveBeenCalled(); expect(getMethodA).toHaveBeenCalled();
@ -157,7 +157,7 @@ describe('getRoutes', () => {
}); });
it('should call getMethodA when source is not exists or undefined', () => { it('should call getMethodA when source is not exists or undefined', () => {
let props = { source: 'methodC' }; const props = { source: 'methodC' };
expect(() => fn(props)).toThrowError('Method not defined'); expect(() => fn(props)).toThrowError('Method not defined');
expect(getMethodA).not.toHaveBeenCalled(); expect(getMethodA).not.toHaveBeenCalled();

View File

@ -72,7 +72,7 @@ const getBankEntities = (data) => {
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]" :acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
:options="bankEntities" :options="bankEntities"
hide-selected hide-selected
option-label="name" option-label="bic"
option-value="id" option-value="id"
v-model="bankEntityFk" v-model="bankEntityFk"
@update:model-value="$emit('updateBic', { iban, bankEntityFk })" @update:model-value="$emit('updateBic', { iban, bankEntityFk })"

View File

@ -15,7 +15,7 @@ let root = ref(null);
watchEffect(() => { watchEffect(() => {
matched.value = currentRoute.value.matched.filter( matched.value = currentRoute.value.matched.filter(
(matched) => !!matched?.meta?.title || !!matched?.meta?.icon (matched) => !!matched?.meta?.title || !!matched?.meta?.icon,
); );
breadcrumbs.value.length = 0; breadcrumbs.value.length = 0;
if (!matched.value[0]) return; if (!matched.value[0]) return;

View File

@ -30,7 +30,7 @@ const onClick = async () => {
params: { filter: JSON.stringify(filter) }, params: { filter: JSON.stringify(filter) },
}; };
try { try {
const { data } = axios.get(props.url, params); const { data } = await axios.get(props.url, params);
rows.value = data; rows.value = data;
} catch (error) { } catch (error) {
const response = error.response; const response = error.response;
@ -83,7 +83,7 @@ defineEmits(['update:selected', 'select:all']);
/> />
<span <span
v-else v-else
v-text="t('records', { rows: rows.length ?? 0 })" v-text="t('records', { rows: rows?.length ?? 0 })"
/> />
</QItemLabel> </QItemLabel>
</QItemSection> </QItemSection>

View File

@ -21,7 +21,7 @@ watch(
(newValue) => { (newValue) => {
if (!modelValue.value) return; if (!modelValue.value) return;
modelValue.value = formatLocation(newValue) ?? null; modelValue.value = formatLocation(newValue) ?? null;
} },
); );
const mixinRules = [requiredFieldRule]; const mixinRules = [requiredFieldRule];
@ -45,7 +45,7 @@ const formatLocation = (obj, properties = locationProperties) => {
}); });
const filteredParts = parts.filter( const filteredParts = parts.filter(
(part) => part !== null && part !== undefined && part !== '' (part) => part !== null && part !== undefined && part !== '',
); );
return filteredParts.join(', '); return filteredParts.join(', ');

View File

@ -2,7 +2,7 @@
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue'; import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
const props = defineProps({ const props = defineProps({
scrollTarget: { type: [String, Object], default: 'window' } scrollTarget: { type: [String, Object], default: 'window' },
}); });
const scrollPosition = ref(0); const scrollPosition = ref(0);
@ -39,7 +39,7 @@ const updateScrollContainer = (container) => {
}; };
defineExpose({ defineExpose({
updateScrollContainer updateScrollContainer,
}); });
const initScrollContainer = async () => { const initScrollContainer = async () => {
@ -51,11 +51,10 @@ const initScrollContainer = async () => {
scrollContainer = window; scrollContainer = window;
} }
if (!scrollContainer) return if (!scrollContainer) return;
scrollContainer.addEventListener('scroll', onScroll); scrollContainer.addEventListener('scroll', onScroll);
}; };
onMounted(() => { onMounted(() => {
initScrollContainer(); initScrollContainer();
}); });
@ -97,4 +96,3 @@ onUnmounted(() => {
filter: brightness(0.8); filter: brightness(0.8);
} }
</style> </style>

View File

@ -0,0 +1,49 @@
<script setup>
import { ref, useTemplateRef } from 'vue';
import { useI18n } from 'vue-i18n';
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
import VnSelectDialog from './VnSelectDialog.vue';
import CreateNewExpenseForm from '../CreateNewExpenseForm.vue';
import FetchData from '../FetchData.vue';
const model = defineModel({ type: [String, Number, Object] });
const { t } = useI18n();
const expenses = ref([]);
const selectDialogRef = useTemplateRef('selectDialogRef');
async function autocompleteExpense(evt) {
const val = evt.target.value;
if (!val || isNaN(val)) return;
const lookup = expenses.value.find(({ id }) => id == useAccountShortToStandard(val));
if (selectDialogRef.value)
selectDialogRef.value.vnSelectDialogRef.vnSelectRef.toggleOption(lookup);
}
</script>
<template>
<VnSelectDialog
v-bind="$attrs"
ref="selectDialogRef"
v-model="model"
:options="expenses"
option-value="id"
:option-label="(x) => `${x.id}: ${x.name}`"
:filter-options="['id', 'name']"
:tooltip="t('Create a new expense')"
:acls="[{ model: 'Expense', props: '*', accessType: 'WRITE' }]"
@keydown.tab.prevent="autocompleteExpense"
>
<template #form>
<CreateNewExpenseForm @on-data-saved="$refs.expensesRef.fetch()" />
</template>
</VnSelectDialog>
<FetchData
ref="expensesRef"
url="Expenses"
auto-load
@on-fetch="(data) => (expenses = data)"
/>
</template>
<i18n>
es:
Create a new expense: Crear nuevo gasto
</i18n>

View File

@ -40,4 +40,11 @@ describe('VnBankDetail Component', () => {
await vm.autofillBic('ES1234567891324567891234'); await vm.autofillBic('ES1234567891324567891234');
expect(vm.bankEntityFk).toBe(null); expect(vm.bankEntityFk).toBe(null);
}); });
it('should not update bankEntityFk if IBAN country is not ES', async () => {
vm.bankEntities = bankEntities;
await vm.autofillBic('FR1420041010050500013M02606');
expect(vm.bankEntityFk).toBe(null);
});
}); });

View File

@ -35,7 +35,7 @@ describe('VnSmsDialog', () => {
expect.objectContaining({ expect.objectContaining({
message: 'You must enter a new password', message: 'You must enter a new password',
type: 'negative', type: 'negative',
}) }),
); );
}); });
@ -47,7 +47,7 @@ describe('VnSmsDialog', () => {
expect.objectContaining({ expect.objectContaining({
message: `Passwords don't match`, message: `Passwords don't match`,
type: 'negative', type: 'negative',
}) }),
); );
}); });

View File

@ -25,6 +25,9 @@ describe('VnDmsList', () => {
deleteModel: 'WorkerDms', deleteModel: 'WorkerDms',
downloadModel: 'WorkerDms', downloadModel: 'WorkerDms',
}, },
global: {
stubs: ['VnUserLink'],
},
}).vm; }).vm;
}); });

View File

@ -6,8 +6,8 @@ function buildComponent(data) {
return createWrapper(VnLocation, { return createWrapper(VnLocation, {
global: { global: {
props: { props: {
location: data location: data,
} },
}, },
}).vm; }).vm;
} }
@ -24,7 +24,7 @@ describe('formatLocation', () => {
postcode: '46680', postcode: '46680',
city: 'Algemesi', city: 'Algemesi',
province: { name: 'Valencia' }, province: { name: 'Valencia' },
country: { name: 'Spain' } country: { name: 'Spain' },
}; };
}); });
@ -47,7 +47,12 @@ describe('formatLocation', () => {
}); });
it('should return the country', () => { it('should return the country', () => {
const location = { ...locationBase, postcode: undefined, city: undefined, province: undefined }; const location = {
...locationBase,
postcode: undefined,
city: undefined,
province: undefined,
};
const vm = buildComponent(location); const vm = buildComponent(location);
expect(vm.formatLocation(location)).toEqual('Spain'); expect(vm.formatLocation(location)).toEqual('Spain');
}); });
@ -61,7 +66,7 @@ describe('showLabel', () => {
code: '46680', code: '46680',
town: 'Algemesi', town: 'Algemesi',
province: 'Valencia', province: 'Valencia',
country: 'Spain' country: 'Spain',
}; };
}); });
@ -84,7 +89,12 @@ describe('showLabel', () => {
}); });
it('should show the label with country', () => { it('should show the label with country', () => {
const location = { ...locationBase, code: undefined, town: undefined, province: undefined }; const location = {
...locationBase,
code: undefined,
town: undefined,
province: undefined,
};
const vm = buildComponent(location); const vm = buildComponent(location);
expect(vm.showLabel(location)).toEqual('Spain'); expect(vm.showLabel(location)).toEqual('Spain');
}); });

View File

@ -90,7 +90,7 @@ describe('VnLog', () => {
vm = createWrapper(VnLog, { vm = createWrapper(VnLog, {
global: { global: {
stubs: ['FetchData', 'vue-i18n'], stubs: ['FetchData', 'vue-i18n', 'VnUserLink'],
mocks: { mocks: {
fetch: vi.fn(), fetch: vi.fn(),
}, },

View File

@ -2,13 +2,14 @@ import { createWrapper } from 'app/test/vitest/helper';
import VnSmsDialog from 'components/common/VnSmsDialog.vue'; import VnSmsDialog from 'components/common/VnSmsDialog.vue';
import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest'; import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest';
describe('VnSmsDialog', () => { describe('VnSmsDialog', () => {
let vm; let vm;
const orderId = 1; const orderId = 1;
const shipped = new Date(); const shipped = new Date();
const phone = '012345678'; const phone = '012345678';
const promise = (response) => {return response;}; const promise = (response) => {
return response;
};
const template = 'minAmount'; const template = 'minAmount';
const locale = 'en'; const locale = 'en';
@ -17,13 +18,13 @@ describe('VnSmsDialog', () => {
propsData: { propsData: {
data: { data: {
orderId, orderId,
shipped shipped,
}, },
template, template,
locale, locale,
phone, phone,
promise promise,
} },
}).vm; }).vm;
}); });
@ -35,7 +36,9 @@ describe('VnSmsDialog', () => {
it('should update the message value with the correct template and parameters', () => { it('should update the message value with the correct template and parameters', () => {
vm.updateMessage(); vm.updateMessage();
expect(vm.message).toEqual(`A minimum amount of 50€ (VAT excluded) is required for your order ${orderId} of ${shipped} to receive it without additional shipping costs.`); expect(vm.message).toEqual(
`A minimum amount of 50€ (VAT excluded) is required for your order ${orderId} of ${shipped} to receive it without additional shipping costs.`,
);
}); });
}); });
@ -47,7 +50,7 @@ describe('VnSmsDialog', () => {
orderId, orderId,
shipped, shipped,
destination: phone, destination: phone,
message: vm.message message: vm.message,
}; };
await vm.send(); await vm.send();

View File

@ -17,7 +17,7 @@ const token = getTokenMultimedia();
const { t } = useI18n(); const { t } = useI18n();
const src = computed( const src = computed(
() => `/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}` () => `/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`,
); );
const title = computed(() => $props.title?.toUpperCase() || t('globals.system')); const title = computed(() => $props.title?.toUpperCase() || t('globals.system'));
const showLetter = ref(false); const showLetter = ref(false);

View File

@ -13,7 +13,7 @@ const src = computed({
get() { get() {
return new URL( return new URL(
`../../assets/${$props.logo}${Dark.isActive ? '_dark' : ''}.svg`, `../../assets/${$props.logo}${Dark.isActive ? '_dark' : ''}.svg`,
import.meta.url import.meta.url,
).href; ).href;
}, },
}); });

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { ref, reactive, useAttrs, computed, onMounted, nextTick, } from 'vue'; import { ref, reactive, useAttrs, computed, onMounted, nextTick } from 'vue';
import { onBeforeRouteLeave , useRouter, useRoute} from 'vue-router'; import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
@ -34,7 +34,8 @@ const $props = defineProps({
addNote: { type: Boolean, default: false }, addNote: { type: Boolean, default: false },
selectType: { type: Boolean, default: false }, selectType: { type: Boolean, default: false },
justInput: { type: Boolean, default: false }, justInput: { type: Boolean, default: false },
goTo: { type: String, default: '', }, goTo: { type: String, default: '' },
useUserRelation: { type: Boolean, default: true },
}); });
const { t } = useI18n(); const { t } = useI18n();
@ -47,13 +48,33 @@ const newNote = reactive({ text: null, observationTypeFk: null });
const observationTypes = ref([]); const observationTypes = ref([]);
const vnPaginateRef = ref(); const vnPaginateRef = ref();
const defaultObservationType = computed(() => const defaultObservationType = computed(
observationTypes.value.find(ot => ot.code === 'salesPerson')?.id () => observationTypes.value.find((ot) => ot.code === 'salesPerson')?.id,
); );
let savedNote = false; let savedNote = false;
let originalText; let originalText;
onBeforeRouteLeave((to, from, next) => {
if (
(newNote.text && !$props.justInput) ||
(newNote.text !== originalText && $props.justInput)
)
quasar.dialog({
component: VnConfirm,
componentProps: {
title: t('globals.unsavedPopup.title'),
message: t('globals.unsavedPopup.subtitle'),
promise: () => next(),
},
});
else next();
});
onMounted(() => {
nextTick(() => (componentIsRendered.value = true));
});
function handleClick(e) { function handleClick(e) {
if (e.shiftKey && e.key === 'Enter') return; if (e.shiftKey && e.key === 'Enter') return;
if ($props.justInput) confirmAndUpdate(); if ($props.justInput) confirmAndUpdate();
@ -108,22 +129,6 @@ async function update() {
); );
} }
onBeforeRouteLeave((to, from, next) => {
if (
(newNote.text && !$props.justInput) ||
(newNote.text !== originalText && $props.justInput)
)
quasar.dialog({
component: VnConfirm,
componentProps: {
title: t('globals.unsavedPopup.title'),
message: t('globals.unsavedPopup.subtitle'),
promise: () => next(),
},
});
else next();
});
function fetchData([data]) { function fetchData([data]) {
newNote.text = data?.notes; newNote.text = data?.notes;
originalText = data?.notes; originalText = data?.notes;
@ -132,28 +137,65 @@ function fetchData([data]) {
const handleObservationTypes = (data) => { const handleObservationTypes = (data) => {
observationTypes.value = data; observationTypes.value = data;
if(defaultObservationType.value) { if (defaultObservationType.value) {
newNote.observationTypeFk = defaultObservationType.value; newNote.observationTypeFk = defaultObservationType.value;
} }
}; };
onMounted(() => {
nextTick(() => (componentIsRendered.value = true));
});
async function saveAndGo() { async function saveAndGo() {
savedNote = false; savedNote = false;
await insert(); await insert();
await savedNote;
router.push({ path: $props.goTo }); router.push({ path: $props.goTo });
} }
function getUserFilter() {
const newUserFilter = $props.userFilter ?? {};
const userInclude = {
relation: 'user',
scope: {
fields: ['id', 'nickname', 'name'],
},
};
if (newUserFilter.include) {
if (Array.isArray(newUserFilter.include)) {
newUserFilter.include.push(userInclude);
} else {
newUserFilter.include = [userInclude, newUserFilter.include];
}
} else {
newUserFilter.include = userInclude;
}
if ($props.useUserRelation) {
return {
...newUserFilter,
...$props.userFilter,
};
}
return $props.filter;
}
</script> </script>
<template> <template>
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && componentIsRendered && $props.goTo && !route.path.includes('summary')"> <Teleport
to="#st-actions"
v-if="
stateStore?.isSubToolbarShown() &&
componentIsRendered &&
$props.goTo &&
!route.path.includes('summary')
"
>
<QBtn <QBtn
:label="tMobile('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" :label="
:title="t('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" tMobile('globals.saveAndContinue') +
' ' +
t('globals.' + $props.goTo.split('/').pop())
"
:title="
t('globals.saveAndContinue') +
' ' +
t('globals.' + $props.goTo.split('/').pop())
"
color="primary" color="primary"
icon="save" icon="save"
@click="saveAndGo" @click="saveAndGo"
@ -227,16 +269,14 @@ async function saveAndGo() {
:url="$props.url" :url="$props.url"
order="created DESC" order="created DESC"
:limit="0" :limit="0"
:user-filter="userFilter" :user-filter="getUserFilter()"
:filter="filter" :filter="filter"
auto-load auto-load
ref="vnPaginateRef" ref="vnPaginateRef"
class="show" class="show"
v-bind="$attrs" v-bind="$attrs"
:search-url="false" :search-url="false"
@on-fetch=" @on-fetch="newNote.text = ''"
newNote.text = '';
"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<TransitionGroup name="list" tag="div" class="column items-center full-width"> <TransitionGroup name="list" tag="div" class="column items-center full-width">
@ -248,15 +288,15 @@ async function saveAndGo() {
<QCardSection horizontal> <QCardSection horizontal>
<VnAvatar <VnAvatar
:descriptor="false" :descriptor="false"
:worker-id="note.workerFk" :worker-id="note.user?.id"
size="md" size="md"
:title="note.worker?.user.nickname" :title="note.user?.nickname"
/> />
<div class="full-width row justify-between q-pa-xs"> <div class="full-width row justify-between q-pa-xs">
<div> <div>
<VnUserLink <VnUserLink
:name="`${note.worker.user.name}`" :name="`${note.user?.name}`"
:worker-id="note.worker.id" :worker-id="note.user?.id"
/> />
<QBadge <QBadge
class="q-ml-xs" class="q-ml-xs"

View File

@ -87,7 +87,7 @@ function formatNumber(number) {
<QItemLabel caption>{{ <QItemLabel caption>{{
date.formatDate( date.formatDate(
row.sms.created, row.sms.created,
'YYYY-MM-DD HH:mm:ss' 'YYYY-MM-DD HH:mm:ss',
) )
}}</QItemLabel> }}</QItemLabel>
<QItemLabel class="row center"> <QItemLabel class="row center">

View File

@ -37,8 +37,7 @@ onBeforeUnmount(() => stateStore.toggleSubToolbar() && hasSubToolbar);
class="justify-end sticky" class="justify-end sticky"
> >
<slot name="st-data"> <slot name="st-data">
<div id="st-data" :class="{ 'full-width': !actionsChildCount() }"> <div id="st-data" :class="{ 'full-width': !actionsChildCount() }"></div>
</div>
</slot> </slot>
<QSpace /> <QSpace />
<slot name="st-actions"> <slot name="st-actions">

View File

@ -1,18 +1,39 @@
<script setup> <script setup>
import AccountDescriptorProxy from 'src/pages/Account/Card/AccountDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { ref, onMounted } from 'vue';
defineProps({ import axios from 'axios';
const $props = defineProps({
name: { type: String, default: null }, name: { type: String, default: null },
tag: { type: String, default: null }, tag: { type: String, default: null },
workerId: { type: Number, default: null }, workerId: { type: Number, default: null },
defaultName: { type: Boolean, default: false }, defaultName: { type: Boolean, default: false },
}); });
const isWorker = ref(false);
onMounted(async () => {
if (!$props.workerId) return;
try {
const {
data: { exists },
} = await axios(`/Workers/${$props.workerId}/exists`);
isWorker.value = exists;
} catch (error) {
if (error.status === 403) return;
throw error;
}
});
</script> </script>
<template> <template>
<slot name="link"> <slot name="link">
<span :class="{ link: workerId }"> <span :class="{ link: workerId }">
{{ defaultName ? name ?? $t('globals.system') : name }} {{ defaultName ? (name ?? $t('globals.system')) : name }}
</span> </span>
</slot> </slot>
<WorkerDescriptorProxy v-if="workerId" :id="workerId" /> <WorkerDescriptorProxy
v-if="isWorker"
:id="workerId"
@on-fetch="(data) => (isWorker = data?.workerId !== undefined)"
/>
<AccountDescriptorProxy v-else :id="workerId" />
</template> </template>

View File

@ -12,12 +12,12 @@ function generateWrapper(storage = 'images') {
id: 123, id: 123,
zoomResolution: '400x400', zoomResolution: '400x400',
storage, storage,
} },
}); });
wrapper = wrapper.wrapper; wrapper = wrapper.wrapper;
vm = wrapper.vm; vm = wrapper.vm;
vm.timeStamp = 'timestamp'; vm.timeStamp = 'timestamp';
}; }
vi.mock('src/composables/useSession', () => ({ vi.mock('src/composables/useSession', () => ({
useSession: () => ({ useSession: () => ({
@ -31,7 +31,6 @@ vi.mock('src/composables/useRole', () => ({
}), }),
})); }));
describe('VnImg', () => { describe('VnImg', () => {
beforeEach(() => { beforeEach(() => {
isEmployeeMock.mockReset(); isEmployeeMock.mockReset();
@ -63,7 +62,9 @@ describe('VnImg', () => {
generateWrapper(); generateWrapper();
await vm.$nextTick(); await vm.$nextTick();
const url = vm.getUrl(); const url = vm.getUrl();
expect(url).toBe('/api/images/catalog/200x200/123/download?access_token=token&timestamp'); expect(url).toBe(
'/api/images/catalog/200x200/123/download?access_token=token&timestamp',
);
}); });
it('should return /api/{storage}/{collection}/{curResolution}/{id}/download?access_token={token}&{timeStamp} when zoom is true and role is employee and storage is not dms', async () => { it('should return /api/{storage}/{collection}/{curResolution}/{id}/download?access_token={token}&{timeStamp} when zoom is true and role is employee and storage is not dms', async () => {
@ -71,7 +72,9 @@ describe('VnImg', () => {
generateWrapper(); generateWrapper();
await vm.$nextTick(); await vm.$nextTick();
const url = vm.getUrl(true); const url = vm.getUrl(true);
expect(url).toBe('/api/images/catalog/400x400/123/download?access_token=token&timestamp'); expect(url).toBe(
'/api/images/catalog/400x400/123/download?access_token=token&timestamp',
);
}); });
}); });

View File

@ -53,26 +53,26 @@ describe('useAcl', () => {
expect( expect(
acl.hasAny([ acl.hasAny([
{ model: 'Worker', props: 'updateAttributes', accessType: 'WRITE' }, { model: 'Worker', props: 'updateAttributes', accessType: 'WRITE' },
]) ]),
).toBeFalsy(); ).toBeFalsy();
}); });
it('should return false if no roles matched', async () => { it('should return false if no roles matched', async () => {
expect( expect(
acl.hasAny([{ model: 'Worker', props: 'holidays', accessType: 'READ' }]) acl.hasAny([{ model: 'Worker', props: 'holidays', accessType: 'READ' }]),
).toBeTruthy(); ).toBeTruthy();
}); });
describe('*', () => { describe('*', () => {
it('should return true if an acl matched', async () => { it('should return true if an acl matched', async () => {
expect( expect(
acl.hasAny([{ model: 'Address', props: '*', accessType: 'WRITE' }]) acl.hasAny([{ model: 'Address', props: '*', accessType: 'WRITE' }]),
).toBeTruthy(); ).toBeTruthy();
}); });
it('should return false if no acls matched', async () => { it('should return false if no acls matched', async () => {
expect( expect(
acl.hasAny([{ model: 'Worker', props: '*', accessType: 'READ' }]) acl.hasAny([{ model: 'Worker', props: '*', accessType: 'READ' }]),
).toBeFalsy(); ).toBeFalsy();
}); });
}); });
@ -80,13 +80,15 @@ describe('useAcl', () => {
describe('$authenticated', () => { describe('$authenticated', () => {
it('should return false if no acls matched', async () => { it('should return false if no acls matched', async () => {
expect( expect(
acl.hasAny([{ model: 'Url', props: 'getByUser', accessType: '*' }]) acl.hasAny([{ model: 'Url', props: 'getByUser', accessType: '*' }]),
).toBeFalsy(); ).toBeFalsy();
}); });
it('should return true if an acl matched', async () => { it('should return true if an acl matched', async () => {
expect( expect(
acl.hasAny([{ model: 'Url', props: 'getByUser', accessType: 'READ' }]) acl.hasAny([
{ model: 'Url', props: 'getByUser', accessType: 'READ' },
]),
).toBeTruthy(); ).toBeTruthy();
}); });
}); });
@ -96,7 +98,7 @@ describe('useAcl', () => {
expect( expect(
acl.hasAny([ acl.hasAny([
{ model: 'TpvTransaction', props: 'start', accessType: 'READ' }, { model: 'TpvTransaction', props: 'start', accessType: 'READ' },
]) ]),
).toBeFalsy(); ).toBeFalsy();
}); });
@ -104,7 +106,7 @@ describe('useAcl', () => {
expect( expect(
acl.hasAny([ acl.hasAny([
{ model: 'TpvTransaction', props: 'start', accessType: 'WRITE' }, { model: 'TpvTransaction', props: 'start', accessType: 'WRITE' },
]) ]),
).toBeTruthy(); ).toBeTruthy();
}); });
}); });

View File

@ -18,7 +18,7 @@ export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile',
export async function downloadDocuware(url, params) { export async function downloadDocuware(url, params) {
const appUrl = await getAppUrl(); const appUrl = await getAppUrl();
const response = await axios.get(`${appUrl}/api/` + url, { const response = await axios.get(`${appUrl}/api/${url}`, {
responseType: 'blob', responseType: 'blob',
params, params,
}); });

View File

@ -20,5 +20,5 @@ export function getColAlign(col) {
if (/^is[A-Z]/.test(col.name) || /^has[A-Z]/.test(col.name)) align = 'center'; if (/^is[A-Z]/.test(col.name) || /^has[A-Z]/.test(col.name)) align = 'center';
return 'text-' + (align ?? 'center'); return `text-${align ?? 'center'}`;
} }

View File

@ -1,10 +1,10 @@
export function getDateQBadgeColor(date) { export function getDateQBadgeColor(date) {
let today = Date.vnNew(); const today = Date.vnNew();
today.setHours(0, 0, 0, 0); today.setHours(0, 0, 0, 0);
let timeTicket = new Date(date); const timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0); timeTicket.setHours(0, 0, 0, 0);
let comparation = today - timeTicket; const comparation = today - timeTicket;
if (comparation == 0) return 'warning'; if (comparation == 0) return 'warning';
if (comparation < 0) return 'success'; if (comparation < 0) return 'success';

View File

@ -2,9 +2,8 @@ import { ref } from 'vue';
import moment from 'moment'; import moment from 'moment';
export default function useWeekdaysOrder() { export default function useWeekdaysOrder() {
const firstDay = moment().weekday(1).day(); const firstDay = moment().weekday(1).day();
const weekdays = [...Array(7).keys()].map(i => (i + firstDay) % 7); const weekdays = [...Array(7).keys()].map((i) => (i + firstDay) % 7);
return ref(weekdays); return ref(weekdays);
} }

View File

@ -7,7 +7,7 @@ export async function beforeSave(data, getChanges, modelOrigin) {
const patchPromises = []; const patchPromises = [];
for (const change of changes) { for (const change of changes) {
let patchData = {}; const patchData = {};
if ('hasMinPrice' in change.data) { if ('hasMinPrice' in change.data) {
patchData.hasMinPrice = change.data?.hasMinPrice; patchData.hasMinPrice = change.data?.hasMinPrice;

View File

@ -1,7 +1,6 @@
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
export default function() { export default function () {
const quasar = useQuasar(); const quasar = useQuasar();
return quasar.screen.gt.xs ? 'q-pa-md': 'q-pa-xs'; return quasar.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs';
} }

View File

@ -6,7 +6,7 @@ export function djb2a(string) {
} }
export function useColor(value) { export function useColor(value) {
return '#' + colors[djb2a(value || '') % colors.length]; return `#${colors[djb2a(value || '') % colors.length]}`;
} }
const colors = [ const colors = [

View File

@ -15,18 +15,16 @@ export function usePrintService() {
message: t('globals.notificationSent'), message: t('globals.notificationSent'),
type: 'positive', type: 'positive',
icon: 'check', icon: 'check',
}) }),
); );
} }
function openReport(path, params, isNewTab = '_self') { function openReport(path, params, isNewTab = '_self') {
if (typeof params === 'string') params = JSON.parse(params); if (typeof params === 'string') params = JSON.parse(params);
params = Object.assign( params = {
{
access_token: getTokenMultimedia(), access_token: getTokenMultimedia(),
}, ...params,
params };
);
const query = new URLSearchParams(params).toString(); const query = new URLSearchParams(params).toString();
window.open(`api/${path}?${query}`, isNewTab); window.open(`api/${path}?${query}`, isNewTab);

View File

@ -17,7 +17,7 @@ export function useSession() {
let intervalId = null; let intervalId = null;
function setSession(data) { function setSession(data) {
let keepLogin = data.keepLogin; const keepLogin = data.keepLogin;
const storage = keepLogin ? localStorage : sessionStorage; const storage = keepLogin ? localStorage : sessionStorage;
storage.setItem(TOKEN, data.token); storage.setItem(TOKEN, data.token);
storage.setItem(TOKEN_MULTIMEDIA, data.tokenMultimedia); storage.setItem(TOKEN_MULTIMEDIA, data.tokenMultimedia);

View File

@ -8,7 +8,7 @@ export function useVnConfirm() {
message, message,
promise, promise,
successFn, successFn,
customHTML = {} customHTML = {},
) => { ) => {
const { component, props } = customHTML; const { component, props } = customHTML;
Dialog.create({ Dialog.create({
@ -19,7 +19,7 @@ export function useVnConfirm() {
message: message, message: message,
promise: promise, promise: promise,
}, },
{ customHTML: () => h(component, props) } { customHTML: () => h(component, props) },
), ),
}).onOk(async () => { }).onOk(async () => {
if (successFn) successFn(); if (successFn) successFn();

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,8 @@
@font-face { @font-face {
font-family: 'icon'; font-family: 'icon';
src: url('fonts/icon.eot?uocffs'); src: url('fonts/icon.eot?uocffs');
src: url('fonts/icon.eot?uocffs#iefix') format('embedded-opentype'), src:
url('fonts/icon.eot?uocffs#iefix') format('embedded-opentype'),
url('fonts/icon.ttf?uocffs') format('truetype'), url('fonts/icon.ttf?uocffs') format('truetype'),
url('fonts/icon.woff?uocffs') format('woff'), url('fonts/icon.woff?uocffs') format('woff'),
url('fonts/icon.svg?uocffs#icon') format('svg'); url('fonts/icon.svg?uocffs#icon') format('svg');
@ -10,7 +11,8 @@
font-display: block; font-display: block;
} }
[class^="icon-"], [class*=" icon-"] { [class^='icon-'],
[class*=' icon-'] {
/* use !important to prevent issues with browser extensions that change fonts */ /* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icon' !important; font-family: 'icon' !important;
speak: never; speak: never;
@ -26,428 +28,428 @@
} }
.icon-inactive-car:before { .icon-inactive-car:before {
content: "\e978"; content: '\e978';
} }
.icon-hasItemLost:before { .icon-hasItemLost:before {
content: "\e957"; content: '\e957';
} }
.icon-hasItemDelay:before { .icon-hasItemDelay:before {
content: "\e96d"; content: '\e96d';
} }
.icon-add_entries:before { .icon-add_entries:before {
content: "\e953"; content: '\e953';
} }
.icon-100:before { .icon-100:before {
content: "\e901"; content: '\e901';
} }
.icon-Client_unpaid:before { .icon-Client_unpaid:before {
content: "\e98c"; content: '\e98c';
} }
.icon-History:before { .icon-History:before {
content: "\e902"; content: '\e902';
} }
.icon-Person:before { .icon-Person:before {
content: "\e903"; content: '\e903';
} }
.icon-accessory:before { .icon-accessory:before {
content: "\e904"; content: '\e904';
} }
.icon-account:before { .icon-account:before {
content: "\e905"; content: '\e905';
} }
.icon-actions:before { .icon-actions:before {
content: "\e907"; content: '\e907';
} }
.icon-addperson:before { .icon-addperson:before {
content: "\e908"; content: '\e908';
} }
.icon-agencia_tributaria:before { .icon-agencia_tributaria:before {
content: "\e948"; content: '\e948';
} }
.icon-agency:before { .icon-agency:before {
content: "\e92a"; content: '\e92a';
} }
.icon-agency-term:before { .icon-agency-term:before {
content: "\e909"; content: '\e909';
} }
.icon-albaran:before { .icon-albaran:before {
content: "\e92c"; content: '\e92c';
} }
.icon-anonymous:before { .icon-anonymous:before {
content: "\e90b"; content: '\e90b';
} }
.icon-apps:before { .icon-apps:before {
content: "\e90c"; content: '\e90c';
} }
.icon-artificial:before { .icon-artificial:before {
content: "\e90d"; content: '\e90d';
} }
.icon-attach:before { .icon-attach:before {
content: "\e90e"; content: '\e90e';
} }
.icon-barcode:before { .icon-barcode:before {
content: "\e90f"; content: '\e90f';
} }
.icon-basket:before { .icon-basket:before {
content: "\e910"; content: '\e910';
} }
.icon-basketadd:before { .icon-basketadd:before {
content: "\e911"; content: '\e911';
} }
.icon-bin:before { .icon-bin:before {
content: "\e913"; content: '\e913';
} }
.icon-botanical:before { .icon-botanical:before {
content: "\e914"; content: '\e914';
} }
.icon-bucket:before { .icon-bucket:before {
content: "\e915"; content: '\e915';
} }
.icon-buscaman:before { .icon-buscaman:before {
content: "\e916"; content: '\e916';
} }
.icon-buyrequest:before { .icon-buyrequest:before {
content: "\e917"; content: '\e917';
} }
.icon-calc_volum .path1:before { .icon-calc_volum .path1:before {
content: "\e918"; content: '\e918';
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
} }
.icon-calc_volum .path2:before { .icon-calc_volum .path2:before {
content: "\e919"; content: '\e919';
margin-left: -1em; margin-left: -1em;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
} }
.icon-calc_volum .path3:before { .icon-calc_volum .path3:before {
content: "\e91c"; content: '\e91c';
margin-left: -1em; margin-left: -1em;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
} }
.icon-calc_volum .path4:before { .icon-calc_volum .path4:before {
content: "\e91d"; content: '\e91d';
margin-left: -1em; margin-left: -1em;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
} }
.icon-calc_volum .path5:before { .icon-calc_volum .path5:before {
content: "\e91e"; content: '\e91e';
margin-left: -1em; margin-left: -1em;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
} }
.icon-calc_volum .path6:before { .icon-calc_volum .path6:before {
content: "\e91f"; content: '\e91f';
margin-left: -1em; margin-left: -1em;
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
} }
.icon-calendar:before { .icon-calendar:before {
content: "\e920"; content: '\e920';
} }
.icon-catalog:before { .icon-catalog:before {
content: "\e921"; content: '\e921';
} }
.icon-claims:before { .icon-claims:before {
content: "\e922"; content: '\e922';
} }
.icon-client:before { .icon-client:before {
content: "\e923"; content: '\e923';
} }
.icon-clone:before { .icon-clone:before {
content: "\e924"; content: '\e924';
} }
.icon-columnadd:before { .icon-columnadd:before {
content: "\e925"; content: '\e925';
} }
.icon-columndelete:before { .icon-columndelete:before {
content: "\e926"; content: '\e926';
} }
.icon-components:before { .icon-components:before {
content: "\e927"; content: '\e927';
} }
.icon-consignatarios:before { .icon-consignatarios:before {
content: "\e928"; content: '\e928';
} }
.icon-control:before { .icon-control:before {
content: "\e929"; content: '\e929';
} }
.icon-credit:before { .icon-credit:before {
content: "\e92b"; content: '\e92b';
} }
.icon-defaulter:before { .icon-defaulter:before {
content: "\e92d"; content: '\e92d';
} }
.icon-deletedTicket:before { .icon-deletedTicket:before {
content: "\e92e"; content: '\e92e';
} }
.icon-deleteline:before { .icon-deleteline:before {
content: "\e92f"; content: '\e92f';
} }
.icon-delivery:before { .icon-delivery:before {
content: "\e930"; content: '\e930';
} }
.icon-deliveryprices:before { .icon-deliveryprices:before {
content: "\e932"; content: '\e932';
} }
.icon-details:before { .icon-details:before {
content: "\e933"; content: '\e933';
} }
.icon-dfiscales:before { .icon-dfiscales:before {
content: "\e934"; content: '\e934';
} }
.icon-disabled:before { .icon-disabled:before {
content: "\e935"; content: '\e935';
} }
.icon-doc:before { .icon-doc:before {
content: "\e936"; content: '\e936';
} }
.icon-entry:before { .icon-entry:before {
content: "\e937"; content: '\e937';
} }
.icon-entry_lastbuys:before { .icon-entry_lastbuys:before {
content: "\e91a"; content: '\e91a';
} }
.icon-exit:before { .icon-exit:before {
content: "\e938"; content: '\e938';
} }
.icon-eye:before { .icon-eye:before {
content: "\e939"; content: '\e939';
} }
.icon-fixedPrice:before { .icon-fixedPrice:before {
content: "\e93a"; content: '\e93a';
} }
.icon-flower:before { .icon-flower:before {
content: "\e93b"; content: '\e93b';
} }
.icon-frozen:before { .icon-frozen:before {
content: "\e93c"; content: '\e93c';
} }
.icon-fruit:before { .icon-fruit:before {
content: "\e93d"; content: '\e93d';
} }
.icon-funeral:before { .icon-funeral:before {
content: "\e93e"; content: '\e93e';
} }
.icon-grafana:before { .icon-grafana:before {
content: "\e906"; content: '\e906';
} }
.icon-greenery:before { .icon-greenery:before {
content: "\e93f"; content: '\e93f';
} }
.icon-greuge:before { .icon-greuge:before {
content: "\e940"; content: '\e940';
} }
.icon-grid:before { .icon-grid:before {
content: "\e941"; content: '\e941';
} }
.icon-handmade:before { .icon-handmade:before {
content: "\e942"; content: '\e942';
} }
.icon-handmadeArtificial:before { .icon-handmadeArtificial:before {
content: "\e943"; content: '\e943';
} }
.icon-headercol:before { .icon-headercol:before {
content: "\e945"; content: '\e945';
} }
.icon-info:before { .icon-info:before {
content: "\e946"; content: '\e946';
} }
.icon-inventory:before { .icon-inventory:before {
content: "\e947"; content: '\e947';
} }
.icon-invoice:before { .icon-invoice:before {
content: "\e968"; content: '\e968';
color: #5f5f5f; color: #5f5f5f;
} }
.icon-invoice-in:before { .icon-invoice-in:before {
content: "\e949"; content: '\e949';
} }
.icon-invoice-in-create:before { .icon-invoice-in-create:before {
content: "\e94a"; content: '\e94a';
} }
.icon-invoice-out:before { .icon-invoice-out:before {
content: "\e94b"; content: '\e94b';
} }
.icon-isTooLittle:before { .icon-isTooLittle:before {
content: "\e94c"; content: '\e94c';
} }
.icon-item:before { .icon-item:before {
content: "\e94d"; content: '\e94d';
} }
.icon-languaje:before { .icon-languaje:before {
content: "\e970"; content: '\e970';
} }
.icon-lines:before { .icon-lines:before {
content: "\e94e"; content: '\e94e';
} }
.icon-linesprepaired:before { .icon-linesprepaired:before {
content: "\e94f"; content: '\e94f';
} }
.icon-link-to-corrected:before { .icon-link-to-corrected:before {
content: "\e931"; content: '\e931';
} }
.icon-link-to-correcting:before { .icon-link-to-correcting:before {
content: "\e944"; content: '\e944';
} }
.icon-logout:before { .icon-logout:before {
content: "\e973"; content: '\e973';
} }
.icon-mana:before { .icon-mana:before {
content: "\e950"; content: '\e950';
} }
.icon-mandatory:before { .icon-mandatory:before {
content: "\e951"; content: '\e951';
} }
.icon-net:before { .icon-net:before {
content: "\e952"; content: '\e952';
} }
.icon-newalbaran:before { .icon-newalbaran:before {
content: "\e954"; content: '\e954';
} }
.icon-niche:before { .icon-niche:before {
content: "\e955"; content: '\e955';
} }
.icon-no036:before { .icon-no036:before {
content: "\e956"; content: '\e956';
} }
.icon-noPayMethod:before { .icon-noPayMethod:before {
content: "\e958"; content: '\e958';
} }
.icon-notes:before { .icon-notes:before {
content: "\e959"; content: '\e959';
} }
.icon-noweb:before { .icon-noweb:before {
content: "\e95a"; content: '\e95a';
} }
.icon-onlinepayment:before { .icon-onlinepayment:before {
content: "\e95b"; content: '\e95b';
} }
.icon-package:before { .icon-package:before {
content: "\e95c"; content: '\e95c';
} }
.icon-payment:before { .icon-payment:before {
content: "\e95d"; content: '\e95d';
} }
.icon-pbx:before { .icon-pbx:before {
content: "\e95e"; content: '\e95e';
} }
.icon-pets:before { .icon-pets:before {
content: "\e95f"; content: '\e95f';
} }
.icon-photo:before { .icon-photo:before {
content: "\e960"; content: '\e960';
} }
.icon-plant:before { .icon-plant:before {
content: "\e961"; content: '\e961';
} }
.icon-polizon:before { .icon-polizon:before {
content: "\e962"; content: '\e962';
} }
.icon-preserved:before { .icon-preserved:before {
content: "\e963"; content: '\e963';
} }
.icon-recovery:before { .icon-recovery:before {
content: "\e964"; content: '\e964';
} }
.icon-regentry:before { .icon-regentry:before {
content: "\e965"; content: '\e965';
} }
.icon-reserva:before { .icon-reserva:before {
content: "\e966"; content: '\e966';
} }
.icon-revision:before { .icon-revision:before {
content: "\e967"; content: '\e967';
} }
.icon-risk:before { .icon-risk:before {
content: "\e969"; content: '\e969';
} }
.icon-saysimple:before { .icon-saysimple:before {
content: "\e912"; content: '\e912';
} }
.icon-services:before { .icon-services:before {
content: "\e96a"; content: '\e96a';
} }
.icon-settings:before { .icon-settings:before {
content: "\e96b"; content: '\e96b';
} }
.icon-shipment:before { .icon-shipment:before {
content: "\e96c"; content: '\e96c';
} }
.icon-sign:before { .icon-sign:before {
content: "\e90a"; content: '\e90a';
} }
.icon-sms:before { .icon-sms:before {
content: "\e96e"; content: '\e96e';
} }
.icon-solclaim:before { .icon-solclaim:before {
content: "\e96f"; content: '\e96f';
} }
.icon-solunion:before { .icon-solunion:before {
content: "\e971"; content: '\e971';
} }
.icon-splitline:before { .icon-splitline:before {
content: "\e972"; content: '\e972';
} }
.icon-splur:before { .icon-splur:before {
content: "\e974"; content: '\e974';
} }
.icon-stowaway:before { .icon-stowaway:before {
content: "\e975"; content: '\e975';
} }
.icon-supplier:before { .icon-supplier:before {
content: "\e976"; content: '\e976';
} }
.icon-supplierfalse:before { .icon-supplierfalse:before {
content: "\e977"; content: '\e977';
} }
.icon-tags:before { .icon-tags:before {
content: "\e979"; content: '\e979';
} }
.icon-tax:before { .icon-tax:before {
content: "\e97a"; content: '\e97a';
} }
.icon-thermometer:before { .icon-thermometer:before {
content: "\e97b"; content: '\e97b';
} }
.icon-ticket:before { .icon-ticket:before {
content: "\e97c"; content: '\e97c';
} }
.icon-ticketAdd:before { .icon-ticketAdd:before {
content: "\e97e"; content: '\e97e';
} }
.icon-traceability:before { .icon-traceability:before {
content: "\e97f"; content: '\e97f';
} }
.icon-transaction:before { .icon-transaction:before {
content: "\e91b"; content: '\e91b';
} }
.icon-treatments:before { .icon-treatments:before {
content: "\e980"; content: '\e980';
} }
.icon-trolley:before { .icon-trolley:before {
content: "\e900"; content: '\e900';
} }
.icon-troncales:before { .icon-troncales:before {
content: "\e982"; content: '\e982';
} }
.icon-unavailable:before { .icon-unavailable:before {
content: "\e983"; content: '\e983';
} }
.icon-visible_columns:before { .icon-visible_columns:before {
content: "\e984"; content: '\e984';
} }
.icon-volume:before { .icon-volume:before {
content: "\e985"; content: '\e985';
} }
.icon-wand:before { .icon-wand:before {
content: "\e986"; content: '\e986';
} }
.icon-web:before { .icon-web:before {
content: "\e987"; content: '\e987';
} }
.icon-wiki:before { .icon-wiki:before {
content: "\e989"; content: '\e989';
} }
.icon-worker:before { .icon-worker:before {
content: "\e98a"; content: '\e98a';
} }
.icon-zone:before { .icon-zone:before {
content: "\e98b"; content: '\e98b';
} }

View File

@ -30,10 +30,12 @@ export function isValidDate(date) {
export function toDateFormat(date, locale = 'es-ES', opts = {}) { export function toDateFormat(date, locale = 'es-ES', opts = {}) {
if (!isValidDate(date)) return ''; if (!isValidDate(date)) return '';
const format = Object.assign( const format = {
{ year: 'numeric', month: '2-digit', day: '2-digit' }, year: 'numeric',
opts month: '2-digit',
); day: '2-digit',
...opts,
};
return new Date(date).toLocaleDateString(locale, format); return new Date(date).toLocaleDateString(locale, format);
} }
@ -104,17 +106,17 @@ export function secondsToHoursMinutes(seconds, includeHSuffix = true) {
const hours = Math.floor(seconds / 3600); const hours = Math.floor(seconds / 3600);
const remainingMinutes = seconds % 3600; const remainingMinutes = seconds % 3600;
const minutes = Math.floor(remainingMinutes / 60); const minutes = Math.floor(remainingMinutes / 60);
const formattedHours = hours < 10 ? '0' + hours : hours; const formattedHours = hours < 10 ? `0${hours}` : hours;
const formattedMinutes = minutes < 10 ? '0' + minutes : minutes; const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;
// Append "h." if includeHSuffix is true // Append "h." if includeHSuffix is true
const suffix = includeHSuffix ? ' h.' : ''; const suffix = includeHSuffix ? ' h.' : '';
// Return formatted string // Return formatted string
return formattedHours + ':' + formattedMinutes + suffix; return `${formattedHours}:${formattedMinutes}${suffix}`;
} }
export function getTimeDifferenceWithToday(date) { export function getTimeDifferenceWithToday(date) {
let today = Date.vnNew(); const today = Date.vnNew();
today.setHours(0, 0, 0, 0); today.setHours(0, 0, 0, 0);
date = new Date(date); date = new Date(date);

View File

@ -5,12 +5,12 @@
* @return {Object} The fields as object * @return {Object} The fields as object
*/ */
function fieldsToObject(fields) { function fieldsToObject(fields) {
let fieldsObj = {}; const fieldsObj = {};
if (Array.isArray(fields)) { if (Array.isArray(fields)) {
for (let field of fields) fieldsObj[field] = true; for (const field of fields) fieldsObj[field] = true;
} else if (typeof fields == 'object') { } else if (typeof fields == 'object') {
for (let field in fields) { for (const field in fields) {
if (fields[field]) fieldsObj[field] = true; if (fields[field]) fieldsObj[field] = true;
} }
} }
@ -26,7 +26,7 @@ function fieldsToObject(fields) {
* @return {Array} The merged fields as an array * @return {Array} The merged fields as an array
*/ */
function mergeFields(src, dst) { function mergeFields(src, dst) {
let fields = {}; const fields = {};
Object.assign(fields, fieldsToObject(src), fieldsToObject(dst)); Object.assign(fields, fieldsToObject(src), fieldsToObject(dst));
return Object.keys(fields); return Object.keys(fields);
} }
@ -39,7 +39,7 @@ function mergeFields(src, dst) {
* @return {Array} The merged wheres * @return {Array} The merged wheres
*/ */
function mergeWhere(src, dst) { function mergeWhere(src, dst) {
let and = []; const and = [];
if (src) and.push(src); if (src) and.push(src);
if (dst) and.push(dst); if (dst) and.push(dst);
return simplifyOperation(and, 'and'); return simplifyOperation(and, 'and');
@ -53,7 +53,7 @@ function mergeWhere(src, dst) {
* @return {Object} The result filter * @return {Object} The result filter
*/ */
function mergeFilters(src, dst) { function mergeFilters(src, dst) {
let res = Object.assign({}, dst); const res = { ...dst };
if (!src) return res; if (!src) return res;
@ -80,12 +80,12 @@ function simplifyOperation(operation, operator) {
} }
function buildFilter(params, builderFunc) { function buildFilter(params, builderFunc) {
let and = []; const and = [];
for (let param in params) { for (const param in params) {
let value = params[param]; const value = params[param];
if (value == null) continue; if (value == null) continue;
let expr = builderFunc(param, value); const expr = builderFunc(param, value);
if (expr) and.push(expr); if (expr) and.push(expr);
} }
return simplifyOperation(and, 'and'); return simplifyOperation(and, 'and');

View File

@ -1,14 +1,14 @@
export default function getDifferences(obj1, obj2) { export default function getDifferences(obj1, obj2) {
let diff = {}; const diff = {};
delete obj1.$index; delete obj1.$index;
delete obj2.$index; delete obj2.$index;
for (let key in obj1) { for (const key in obj1) {
if (obj2[key] && JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) { if (obj2[key] && JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) {
diff[key] = obj2[key]; diff[key] = obj2[key];
} }
} }
for (let key in obj2) { for (const key in obj2) {
if ( if (
obj1[key] === undefined || obj1[key] === undefined ||
JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key]) JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])

View File

@ -1,10 +1,10 @@
export default function toDateString(date) { export default function toDateString(date) {
let day = date.getDate(); let day = date.getDate();
let month = date.getMonth() + 1; let month = date.getMonth() + 1;
let year = date.getFullYear(); const year = date.getFullYear();
if (day < 10) day = `0${day}`; if (day < 10) day = `0${day}`;
if (month < 10) month = `0${month}`; if (month < 10) month = `0${month}`;
return `${year}-${month}-${day}` return `${year}-${month}-${day}`;
} }

View File

@ -1,5 +1,5 @@
export default function toLowerCamel(value) { export default function toLowerCamel(value) {
if (!value) return; if (!value) return;
if (typeof (value) !== 'string') return value; if (typeof value !== 'string') return value;
return value.charAt(0).toLowerCase() + value.slice(1); return value.charAt(0).toLowerCase() + value.slice(1);
} }

View File

@ -9,7 +9,7 @@ export default function formatDate(dateVal) {
const dateZeroTime = new Date(dateVal); const dateZeroTime = new Date(dateVal);
dateZeroTime.setHours(0, 0, 0, 0); dateZeroTime.setHours(0, 0, 0, 0);
const diff = Math.trunc( const diff = Math.trunc(
(today.getTime() - dateZeroTime.getTime()) / (1000 * 3600 * 24) (today.getTime() - dateZeroTime.getTime()) / (1000 * 3600 * 24),
); );
let format; let format;
if (diff === 0) format = t('globals.today'); if (diff === 0) format = t('globals.today');

View File

@ -11,12 +11,12 @@ for (const file in files) {
translations[lang] = g.default; translations[lang] = g.default;
}) })
.finally(() => { .finally(() => {
const actualLang = lang + '.yml'; const actualLang = `${lang}.yml`;
for (const module in modules) { for (const module in modules) {
if (!module.endsWith(actualLang)) continue; if (!module.endsWith(actualLang)) continue;
modules[module]().then((t) => { modules[module]().then((t) => {
Object.assign(translations[lang], t.default); Object.assign(translations[lang], t.default);
}) });
} }
}); });
} }

View File

@ -400,6 +400,8 @@ errors:
updateUserConfig: Error updating user config updateUserConfig: Error updating user config
tokenConfig: Error fetching token config tokenConfig: Error fetching token config
writeRequest: The requested operation could not be completed writeRequest: The requested operation could not be completed
sessionExpired: Your session has expired. Please log in again
accessDenied: Access denied
claimBeginningQuantity: Cannot import a line with a claimed quantity of 0 claimBeginningQuantity: Cannot import a line with a claimed quantity of 0
login: login:
title: Login title: Login

View File

@ -396,6 +396,8 @@ errors:
updateUserConfig: Error al actualizar la configuración de usuario updateUserConfig: Error al actualizar la configuración de usuario
tokenConfig: Error al obtener configuración de token tokenConfig: Error al obtener configuración de token
writeRequest: No se pudo completar la operación solicitada writeRequest: No se pudo completar la operación solicitada
sessionExpired: Tu sesión ha expirado, por favor vuelve a iniciar sesión
accessDenied: Acceso denegado
claimBeginningQuantity: No se puede importar una linea sin una cantidad reclamada claimBeginningQuantity: No se puede importar una linea sin una cantidad reclamada
login: login:
title: Inicio de sesión title: Inicio de sesión

View File

@ -80,7 +80,7 @@ const killSession = async ({ userId, created }) => {
openConfirmationModal( openConfirmationModal(
t('Session will be killed'), t('Session will be killed'),
t('Are you sure you want to continue?'), t('Are you sure you want to continue?'),
() => killSession(row) () => killSession(row),
) )
" "
outline outline

View File

@ -57,7 +57,7 @@ watch(
store.url = urlPath.value; store.url = urlPath.value;
store.filter = filter; store.filter = filter;
fetchAliases(); fetchAliases();
} },
); );
const fetchAliases = () => paginateRef.value.fetch(); const fetchAliases = () => paginateRef.value.fetch();
@ -91,7 +91,7 @@ const fetchAliases = () => paginateRef.value.fetch();
openConfirmationModal( openConfirmationModal(
t('User will be removed from alias'), t('User will be removed from alias'),
t('Are you sure you want to continue?'), t('Are you sure you want to continue?'),
() => deleteAlias(row) () => deleteAlias(row),
) )
" "
> >

View File

@ -28,7 +28,7 @@ const loading = ref(false);
const hasDataChanged = computed( const hasDataChanged = computed(
() => () =>
formData.value.forwardTo !== initialData.value.forwardTo || formData.value.forwardTo !== initialData.value.forwardTo ||
initialData.value.hasData !== hasData.value initialData.value.hasData !== hasData.value,
); );
const fetchMailForwards = async () => { const fetchMailForwards = async () => {
@ -77,7 +77,7 @@ const setInitialData = async () => {
watch( watch(
() => route.params.id, () => route.params.id,
() => setInitialData() () => setInitialData(),
); );
onMounted(async () => await setInitialData()); onMounted(async () => await setInitialData());

View File

@ -14,7 +14,7 @@ const rolesOptions = ref([]);
const formModelRef = ref(); const formModelRef = ref();
watch( watch(
() => route.params.id, () => route.params.id,
() => formModelRef.value.reset() () => formModelRef.value.reset(),
); );
</script> </script>
<template> <template>

View File

@ -44,7 +44,7 @@ watch(
store.filter = filter.value; store.filter = filter.value;
store.limit = 0; store.limit = 0;
fetchSubRoles(); fetchSubRoles();
} },
); );
const fetchSubRoles = () => paginateRef.value.fetch(); const fetchSubRoles = () => paginateRef.value.fetch();

View File

@ -43,7 +43,7 @@ watch(
store.url = urlPath.value; store.url = urlPath.value;
store.filter = filter.value; store.filter = filter.value;
fetchSubRoles(); fetchSubRoles();
} },
); );
const fetchSubRoles = () => paginateRef.value.fetch(); const fetchSubRoles = () => paginateRef.value.fetch();

View File

@ -178,7 +178,7 @@ async function save(data) {
} }
async function importToNewRefundTicket() { async function importToNewRefundTicket() {
try{ try {
await post(`ClaimBeginnings/${claimId}/importToNewRefundTicket`); await post(`ClaimBeginnings/${claimId}/importToNewRefundTicket`);
await claimActionsForm.value.reload(); await claimActionsForm.value.reload();
quasar.notify({ quasar.notify({
@ -187,7 +187,7 @@ async function importToNewRefundTicket() {
}); });
} catch (error) { } catch (error) {
const errorMessage = error.response?.data?.error?.message; const errorMessage = error.response?.data?.error?.message;
notify( t(errorMessage), 'negative' ); notify(t(errorMessage), 'negative');
} }
} }

View File

@ -138,6 +138,7 @@ const columns = computed(() => [
:filter="developmentsFilter" :filter="developmentsFilter"
ref="claimDevelopmentForm" ref="claimDevelopmentForm"
:data-required="{ claimFk: route.params.id }" :data-required="{ claimFk: route.params.id }"
:insert-on-load="true"
v-model:selected="selected" v-model:selected="selected"
@save-changes="$router.push(`/claim/${route.params.id}/action`)" @save-changes="$router.push(`/claim/${route.params.id}/action`)"
:default-save="false" :default-save="false"
@ -238,7 +239,9 @@ const columns = computed(() => [
<style lang="scss" scoped> <style lang="scss" scoped>
.grid-style-transition { .grid-style-transition {
transition: transform 0.28s, background-color 0.28s; transition:
transform 0.28s,
background-color 0.28s;
} }
</style> </style>

View File

@ -79,7 +79,7 @@ const columns = computed(() => [
field: ({ sale }) => sale.quantity, field: ({ sale }) => sale.quantity,
sortable: true, sortable: true,
style: 'padding-right: 2%;', style: 'padding-right: 2%;',
headerStyle: 'padding-right: 2%;' headerStyle: 'padding-right: 2%;',
}, },
{ {
name: 'claimed', name: 'claimed',
@ -113,7 +113,7 @@ const columns = computed(() => [
format: (value) => toCurrency(value), format: (value) => toCurrency(value),
sortable: true, sortable: true,
style: 'padding-right: 2%;', style: 'padding-right: 2%;',
headerStyle: 'padding-right: 2%;' headerStyle: 'padding-right: 2%;',
}, },
]); ]);
@ -160,7 +160,7 @@ function fillClaimedQuantities() {
const formData = claimLinesForm.value.formData; const formData = claimLinesForm.value.formData;
let hasChanges = false; let hasChanges = false;
const selectedRows = formData.filter(row => selected.value.includes(row)); const selectedRows = formData.filter((row) => selected.value.includes(row));
for (const row of selectedRows) { for (const row of selectedRows) {
if (row.quantity === 0 || row.quantity === null) { if (row.quantity === 0 || row.quantity === null) {
@ -181,8 +181,6 @@ function fillClaimedQuantities() {
}); });
} }
} }
</script> </script>
<template> <template>
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> <Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()">
@ -210,7 +208,6 @@ function fillClaimedQuantities() {
auto-load auto-load
/> />
<div class="q-pa-md"> <div class="q-pa-md">
<CrudModel <CrudModel
data-key="claimLines" data-key="claimLines"
ref="claimLinesForm" ref="claimLinesForm"
@ -236,12 +233,7 @@ function fillClaimedQuantities() {
> >
<template #body-cell-claimed="{ row }"> <template #body-cell-claimed="{ row }">
<QTd auto-width align="right" class="text-primary shrink"> <QTd auto-width align="right" class="text-primary shrink">
<QInput <QInput v-model.number="row.quantity" type="number" dense />
v-model.number="row.quantity"
type="number"
dense
/>
</QTd> </QTd>
</template> </template>
<template #body-cell-description="{ row, value }"> <template #body-cell-description="{ row, value }">
@ -297,7 +289,6 @@ function fillClaimedQuantities() {
type="number" type="number"
dense dense
autofocus autofocus
/> />
</QItemLabel> </QItemLabel>
</template> </template>

View File

@ -1,12 +1,9 @@
<script setup> <script setup>
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useState } from 'src/composables/useState';
import VnNotes from 'src/components/ui/VnNotes.vue'; import VnNotes from 'src/components/ui/VnNotes.vue';
const route = useRoute(); const route = useRoute();
const state = useState();
const user = state.getUser();
const $props = defineProps({ const $props = defineProps({
id: { type: [Number, String], default: null }, id: { type: [Number, String], default: null },
@ -15,24 +12,13 @@ const $props = defineProps({
const claimId = computed(() => $props.id || route.params.id); const claimId = computed(() => $props.id || route.params.id);
const claimFilter = { const claimFilter = {
fields: ['id', 'created', 'workerFk', 'text'], fields: ['id', 'created', 'userFk', 'text'],
include: {
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName'],
include: { include: {
relation: 'user', relation: 'user',
scope: { scope: {
fields: ['id', 'nickname', 'name'], fields: ['id', 'nickname', 'name'],
}, },
}, },
},
},
};
const body = {
claimFk: claimId.value,
workerFk: user.value.id,
}; };
</script> </script>
@ -43,7 +29,9 @@ const body = {
:add-note="$props.addNote" :add-note="$props.addNote"
:user-filter="claimFilter" :user-filter="claimFilter"
:filter="{ where: { claimFk: claimId } }" :filter="{ where: { claimFk: claimId } }"
:body="body" :body="{
claimFk: claimId,
}"
v-bind="$attrs" v-bind="$attrs"
style="overflow-y: auto" style="overflow-y: auto"
/> />

View File

@ -210,7 +210,7 @@ function onDrag() {
class="all-pointer-events absolute delete-button zindex" class="all-pointer-events absolute delete-button zindex"
@click.stop="viewDeleteDms(index)" @click.stop="viewDeleteDms(index)"
round round
:data-cy="`delete-button-${index+1}`" :data-cy="`delete-button-${index + 1}`"
/> />
<QIcon <QIcon
name="play_circle" name="play_circle"
@ -228,7 +228,7 @@ function onDrag() {
class="rounded-borders cursor-pointer fit" class="rounded-borders cursor-pointer fit"
@click="openDialog(media.dmsFk)" @click="openDialog(media.dmsFk)"
v-if="!media.isVideo" v-if="!media.isVideo"
:data-cy="`file-${index+1}`" :data-cy="`file-${index + 1}`"
> >
</QImg> </QImg>
<video <video
@ -237,7 +237,7 @@ function onDrag() {
muted="muted" muted="muted"
v-if="media.isVideo" v-if="media.isVideo"
@click="openDialog(media.dmsFk)" @click="openDialog(media.dmsFk)"
:data-cy="`file-${index+1}`" :data-cy="`file-${index + 1}`"
/> />
</QCard> </QCard>
</div> </div>

View File

@ -27,7 +27,7 @@ describe('ClaimDescriptorMenu', () => {
await vm.remove(); await vm.remove();
expect(vm.quasar.notify).toHaveBeenCalledWith( expect(vm.quasar.notify).toHaveBeenCalledWith(
expect.objectContaining({ type: 'positive' }) expect.objectContaining({ type: 'positive' }),
); );
}); });
}); });

View File

@ -17,6 +17,7 @@ import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.v
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnSelect from 'components/common/VnSelect.vue'; import VnSelect from 'components/common/VnSelect.vue';
import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputDate from 'components/common/VnInputDate.vue';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
const arrayData = useArrayData('Customer'); const arrayData = useArrayData('Customer');
const { t } = useI18n(); const { t } = useI18n();
@ -50,7 +51,7 @@ const columns = computed(() => [
label: t('globals.ticket'), label: t('globals.ticket'),
cardVisible: true, cardVisible: true,
columnFilter: { columnFilter: {
inWhere: true, name: 'ticketId',
}, },
}, },
{ {
@ -84,7 +85,8 @@ const columns = computed(() => [
label: t('globals.description'), label: t('globals.description'),
columnClass: 'expand', columnClass: 'expand',
columnFilter: { columnFilter: {
inWhere: true, name: 'description',
}, },
}, },
{ {
@ -92,17 +94,10 @@ const columns = computed(() => [
label: t('globals.quantity'), label: t('globals.quantity'),
cardVisible: true, cardVisible: true,
visible: true, visible: true,
columnFilter: { columnFilter: false
inWhere: true,
},
},
{
name: 'grouped',
label: t('Group by items'),
component: 'checkbox',
visible: false,
orderBy: false,
}, },
]); ]);
onBeforeMount(async () => { onBeforeMount(async () => {
@ -170,7 +165,6 @@ const updateDateParams = (value, params) => {
v-if="campaignList" v-if="campaignList"
data-key="CustomerConsumption" data-key="CustomerConsumption"
url="Clients/consumption" url="Clients/consumption"
:order="['itemTypeFk', 'itemName', 'itemSize', 'description']"
:filter="{ where: { clientFk: route.params.id } }" :filter="{ where: { clientFk: route.params.id } }"
:columns="columns" :columns="columns"
search-url="consumption" search-url="consumption"
@ -218,9 +212,9 @@ const updateDateParams = (value, params) => {
<div v-if="row.subName" class="subName"> <div v-if="row.subName" class="subName">
{{ row.subName }} {{ row.subName }}
</div> </div>
<FetchedTags :item="row" /> <FetchedTags :item="row" :columns="6"/>
</template> </template>
<template #moreFilterPanel="{ params }"> <template #moreFilterPanel="{ params, searchFn}">
<div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl"> <div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl">
<VnSelect <VnSelect
:filled="true" :filled="true"
@ -290,6 +284,13 @@ const updateDateParams = (value, params) => {
class="q-px-xs q-pt-none fit" class="q-px-xs q-pt-none fit"
dense dense
/> />
<VnCheckbox
v-model="params.grouped"
:label="t('Group by items')"
class="q-px-xs q-pt-none fit"
dense
@update:modelValue="() => searchFn()"
/>
</div> </div>
</template> </template>
</VnTable> </VnTable>

View File

@ -117,8 +117,6 @@ async function acceptPropagate({ isEqualizated }) {
option-value="id" option-value="id"
v-model="data.sageTaxTypeFk" v-model="data.sageTaxTypeFk"
data-cy="sageTaxTypeFk" data-cy="sageTaxTypeFk"
:required="data.isTaxDataChecked"
:rules="[(val) => validations.required(data.isTaxDataChecked, val)]"
/> />
<VnSelect <VnSelect
:label="t('Sage transaction type')" :label="t('Sage transaction type')"
@ -128,10 +126,6 @@ async function acceptPropagate({ isEqualizated }) {
option-value="id" option-value="id"
data-cy="sageTransactionTypeFk" data-cy="sageTransactionTypeFk"
v-model="data.sageTransactionTypeFk" v-model="data.sageTransactionTypeFk"
:required="data.isTaxDataChecked"
:rules="[
(val) => validations.required(data.sageTransactionTypeFk, val),
]"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">

View File

@ -1,12 +1,15 @@
<script setup> <script setup>
import VnNotes from 'src/components/ui/VnNotes.vue'; import VnNotes from 'src/components/ui/VnNotes.vue';
import { useState } from 'src/composables/useState';
const state = useState();
const user = state.getUser();
</script> </script>
<template> <template>
<VnNotes <VnNotes
url="clientObservations" url="clientObservations"
:add-note="true" :add-note="true"
:filter="{ where: { clientFk: $route.params.id } }" :filter="{ where: { clientFk: $route.params.id } }"
:body="{ clientFk: $route.params.id }" :body="{ clientFk: $route.params.id, userFk: user.id }"
style="overflow-y: auto" style="overflow-y: auto"
:select-type="true" :select-type="true"
required required

View File

@ -50,8 +50,11 @@ const filterClientFindOne = {
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>
<QCheckbox :label="t('Unpaid client')" v-model="data.unpaid" <QCheckbox
data-cy="UnpaidCheckBox" /> :label="t('Unpaid client')"
v-model="data.unpaid"
data-cy="UnpaidCheckBox"
/>
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md" v-show="data.unpaid"> <VnRow class="row q-gutter-md q-mb-md" v-show="data.unpaid">

View File

@ -76,7 +76,7 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'workerFk', name: 'userFk',
label: t('Author'), label: t('Author'),
tooltip: t('Worker who made the last observation'), tooltip: t('Worker who made the last observation'),
columnFilter: { columnFilter: {
@ -155,7 +155,7 @@ function exprBuilder(param, value) {
return { [`c.${param}`]: value }; return { [`c.${param}`]: value };
case 'payMethod': case 'payMethod':
return { [`c.payMethodFk`]: value }; return { [`c.payMethodFk`]: value };
case 'workerFk': case 'userFk':
return { [`co.${param}`]: value }; return { [`co.${param}`]: value };
case 'departmentFk': case 'departmentFk':
return { [`c.${param}`]: value }; return { [`c.${param}`]: value };
@ -229,10 +229,10 @@ function exprBuilder(param, value) {
<DepartmentDescriptorProxy :id="row.departmentFk" /> <DepartmentDescriptorProxy :id="row.departmentFk" />
</span> </span>
</template> </template>
<template #column-workerFk="{ row }"> <template #column-userFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
{{ row.workerName }} {{ row.workerName }}
<WorkerDescriptorProxy :id="row.workerFk" /> <WorkerDescriptorProxy :id="row.userFk" />
</span> </span>
</template> </template>
</VnTable> </VnTable>

View File

@ -224,7 +224,7 @@ const toCustomerFileManagement = () => {
<QTooltip max-width="30rem"> <QTooltip max-width="30rem">
{{ {{
`${t( `${t(
'Allowed content types' 'Allowed content types',
)}: ${allowedContentTypes.join(', ')}` )}: ${allowedContentTypes.join(', ')}`
}} }}
</QTooltip> </QTooltip>

View File

@ -200,7 +200,7 @@ const toCustomerFileManagement = () => {
<QTooltip max-width="30rem"> <QTooltip max-width="30rem">
{{ {{
`${t( `${t(
'Allowed content types' 'Allowed content types',
)}: ${allowedContentTypes.join(', ')}` )}: ${allowedContentTypes.join(', ')}`
}} }}
</QTooltip> </QTooltip>

View File

@ -130,20 +130,22 @@ async function onDataSaved(formData, { id }) {
} }
} }
async function getSupplierClientReferences(value) { async function getSupplierClientReferences(data) {
if (!value) return (initialData.description = ''); if (!data) return (initialData.description = '');
const params = { bankAccount: value }; const params = { bankAccount: data.compensationAccount };
const { data } = await axios(`Clients/getClientOrSupplierReference`, { params }); const { data: reference } = await axios(`Clients/getClientOrSupplierReference`, {
if (!data.clientId) { params,
initialData.description = t('Supplier Compensation Reference', { });
supplierId: data.supplierId, if (reference.supplierId) {
supplierName: data.supplierName, data.description = t('Supplier Compensation Reference', {
supplierId: reference.supplierId,
supplierName: reference.supplierName,
}); });
return; return;
} }
initialData.description = t('Client Compensation Reference', { data.description = t('Client Compensation Reference', {
clientId: data.clientId, clientId: reference.clientId,
clientName: data.clientName, clientName: reference.clientName,
}); });
} }
@ -222,6 +224,7 @@ async function getAmountPaid() {
clearable clearable
v-model.number="data.amountPaid" v-model.number="data.amountPaid"
data-cy="paymentAmount" data-cy="paymentAmount"
:positive="false"
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>
@ -251,7 +254,7 @@ async function getAmountPaid() {
:label="t('Compensation account')" :label="t('Compensation account')"
clearable clearable
v-model="data.compensationAccount" v-model="data.compensationAccount"
@blur="getSupplierClientReferences(data.compensationAccount)" @blur="getSupplierClientReferences(data)"
/> />
</VnRow> </VnRow>
</div> </div>
@ -287,6 +290,9 @@ async function getAmountPaid() {
</template> </template>
<i18n> <i18n>
en:
Supplier Compensation Reference: ({supplierId}) Ntro Proveedor {supplierName}
Client Compensation Reference: ({clientId}) Ntro Cliente {clientName}
es: es:
New payment: Añadir pago New payment: Añadir pago
Date: Fecha Date: Fecha

View File

@ -13,4 +13,4 @@ export async function getClient(clientId, _filter = {}) {
}; };
const params = { filter: JSON.stringify(filter) }; const params = { filter: JSON.stringify(filter) };
return await axios.get('Clients', { params }); return await axios.get('Clients', { params });
}; }

View File

@ -123,3 +123,4 @@ customer:
ticketFk: Ticket Id ticketFk: Ticket Id
description: Description description: Description
quantity: Quantity quantity: Quantity
ticketId: Ticket

View File

@ -123,3 +123,4 @@ customer:
ticketFk: Id Ticket ticketFk: Id Ticket
description: Descripción description: Descripción
quantity: Cantidad quantity: Cantidad
ticketId: Ticket

View File

@ -126,7 +126,7 @@ const fetchBuys = async (buys) => {
const params = { buys }; const params = { buys };
const { data } = await axios.post( const { data } = await axios.post(
`Entries/${route.params.id}/importBuysPreview`, `Entries/${route.params.id}/importBuysPreview`,
params params,
); );
importData.value.buys = data; importData.value.buys = data;
}; };

View File

@ -73,6 +73,7 @@ const columns = computed(() => [
optionLabel: 'code', optionLabel: 'code',
options: companies.value, options: companies.value,
}, },
orderBy: false,
}, },
{ {
name: 'warehouse', name: 'warehouse',

View File

@ -90,6 +90,7 @@ const columns = computed(() => [
auto-load auto-load
:data-required="{ invoiceInFk: invoiceInId }" :data-required="{ invoiceInFk: invoiceInId }"
:filter="filter" :filter="filter"
:insert-on-load="true"
v-model:selected="rowsSelected" v-model:selected="rowsSelected"
@on-fetch="(data) => (invoceInIntrastat = data)" @on-fetch="(data) => (invoceInIntrastat = data)"
> >

View File

@ -1,21 +1,16 @@
<script setup> <script setup>
import { ref, computed, nextTick } from 'vue'; import { ref, computed, markRaw } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import { getTotal } from 'src/composables/getTotal'; import { getTotal } from 'src/composables/getTotal';
import { toCurrency } from 'src/filters'; import { toCurrency } from 'src/filters';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import CrudModel from 'src/components/CrudModel.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import CreateNewExpenseForm from 'src/components/CreateNewExpenseForm.vue';
import { getExchange } from 'src/composables/getExchange'; import { getExchange } from 'src/composables/getExchange';
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard'; import VnTable from 'src/components/VnTable/VnTable.vue';
import VnSelectExpense from 'src/components/common/VnSelectExpense.vue';
const { t } = useI18n(); const { t } = useI18n();
const arrayData = useArrayData(); const arrayData = useArrayData();
const route = useRoute(); const route = useRoute();
const invoiceIn = computed(() => arrayData.store.data); const invoiceIn = computed(() => arrayData.store.data);
@ -24,100 +19,142 @@ const expenses = ref([]);
const sageTaxTypes = ref([]); const sageTaxTypes = ref([]);
const sageTransactionTypes = ref([]); const sageTransactionTypes = ref([]);
const rowsSelected = ref([]); const rowsSelected = ref([]);
const invoiceInFormRef = ref(); const invoiceInVatTableRef = ref();
defineProps({ defineProps({ actionIcon: { type: String, default: 'add' } });
actionIcon: {
type: String, function taxRate(invoiceInTax) {
default: 'add', const sageTaxTypeId = invoiceInTax.taxTypeSageFk;
}, const taxRateSelection = sageTaxTypes.value.find(
}); (transaction) => transaction.id == sageTaxTypeId,
);
const taxTypeSage = taxRateSelection?.rate ?? 0;
const taxableBase = invoiceInTax?.taxableBase ?? 0;
return (taxTypeSage / 100) * taxableBase;
}
const columns = computed(() => [ const columns = computed(() => [
{ {
name: 'expense', name: 'expenseFk',
label: t('Expense'), label: t('Expense'),
field: (row) => row.expenseFk, component: markRaw(VnSelectExpense),
options: expenses.value, format: (row) => {
model: 'expenseFk', const expense = expenses.value.find((e) => e.id === row.expenseFk);
optionValue: 'id', return expense ? `${expense.id}: ${expense.name}` : row.expenseFk;
optionLabel: (row) => `${row.id}: ${row.name}`, },
sortable: true, sortable: true,
align: 'left', align: 'left',
isEditable: true,
create: true,
width: '250px',
}, },
{ {
name: 'taxablebase', name: 'taxableBase',
label: t('Taxable base'), label: t('Taxable base'),
field: (row) => row.taxableBase, component: 'number',
model: 'taxableBase', attrs: {
clearable: true,
'clear-icon': 'close',
},
sortable: true, sortable: true,
align: 'left', align: 'left',
isEditable: true,
create: true,
}, },
{ {
name: 'isDeductible', name: 'isDeductible',
label: t('invoiceIn.isDeductible'), label: t('invoiceIn.isDeductible'),
field: (row) => row.isDeductible, component: 'checkbox',
model: 'isDeductible',
align: 'center', align: 'center',
isEditable: true,
create: true,
createAttrs: {
defaultValue: true,
},
width: '100px',
}, },
{ {
name: 'sageiva', name: 'taxTypeSageFk',
label: t('Sage iva'), label: t('Sage iva'),
field: (row) => row.taxTypeSageFk, component: 'select',
attrs: {
options: sageTaxTypes.value, options: sageTaxTypes.value,
model: 'taxTypeSageFk',
optionValue: 'id', optionValue: 'id',
optionLabel: (row) => `${row.id}: ${row.vat}`, optionLabel: (row) => `${row.id}: ${row.vat}`,
filterOptions: ['id', 'vat'],
'data-cy': 'vat-sageiva',
},
format: (row) => {
const taxType = sageTaxTypes.value.find((t) => t.id === row.taxTypeSageFk);
return taxType ? `${taxType.id}: ${taxType.vat}` : row.taxTypeSageFk;
},
sortable: true, sortable: true,
align: 'left', align: 'left',
isEditable: true,
create: true,
}, },
{ {
name: 'sagetransaction', name: 'transactionTypeSageFk',
label: t('Sage transaction'), label: t('Sage transaction'),
field: (row) => row.transactionTypeSageFk, component: 'select',
attrs: {
options: sageTransactionTypes.value, options: sageTransactionTypes.value,
model: 'transactionTypeSageFk',
optionValue: 'id', optionValue: 'id',
optionLabel: (row) => `${row.id}: ${row.transaction}`, optionLabel: (row) => `${row.id}: ${row.transaction}`,
filterOptions: ['id', 'transaction'],
},
format: (row) => {
const transType = sageTransactionTypes.value.find(
(t) => t.id === row.transactionTypeSageFk,
);
return transType
? `${transType.id}: ${transType.transaction}`
: row.transactionTypeSageFk;
},
sortable: true, sortable: true,
align: 'left', align: 'left',
isEditable: true,
create: true,
}, },
{ {
name: 'rate', name: 'rate',
label: t('Rate'), label: t('Rate'),
sortable: true, sortable: false,
field: (row) => taxRate(row, row.taxTypeSageFk), format: (row) => taxRate(row).toFixed(2),
align: 'left', align: 'left',
}, },
{ {
name: 'foreignvalue', name: 'foreignValue',
label: t('Foreign value'), label: t('Foreign value'),
component: 'number',
sortable: true, sortable: true,
field: (row) => row.foreignValue,
align: 'left', align: 'left',
create: true,
disable: !isNotEuro(currency.value),
}, },
{ {
name: 'total', name: 'total',
label: 'Total', label: t('Total'),
align: 'left', align: 'left',
format: (row) => (Number(row.taxableBase || 0) + Number(taxRate(row))).toFixed(2),
}, },
]); ]);
const tableRows = computed(
() => invoiceInVatTableRef.value?.CrudModelRef?.formData || [],
);
const taxableBaseTotal = computed(() => { const taxableBaseTotal = computed(() => {
return getTotal(invoiceInFormRef.value.formData, 'taxableBase'); return getTotal(tableRows.value, 'taxableBase');
}); });
const taxRateTotal = computed(() => { const taxRateTotal = computed(() => {
return getTotal(invoiceInFormRef.value.formData, null, { return tableRows.value.reduce((sum, row) => sum + Number(taxRate(row)), 0);
cb: taxRate,
});
}); });
const combinedTotal = computed(() => { const combinedTotal = computed(() => {
return +taxableBaseTotal.value + +taxRateTotal.value; return +taxableBaseTotal.value + +taxRateTotal.value;
}); });
const filter = { const filter = computed(() => ({
fields: [ fields: [
'id', 'id',
'invoiceInFk', 'invoiceInFk',
@ -131,388 +168,75 @@ const filter = {
where: { where: {
invoiceInFk: route.params.id, invoiceInFk: route.params.id,
}, },
}; }));
const isNotEuro = (code) => code != 'EUR'; const isNotEuro = (code) => code != 'EUR';
function taxRate(invoiceInTax) { async function handleForeignValueUpdate(val, row) {
const sageTaxTypeId = invoiceInTax.taxTypeSageFk; if (!isNotEuro(currency.value)) return;
const taxRateSelection = sageTaxTypes.value.find( row.taxableBase = await getExchange(
(transaction) => transaction.id == sageTaxTypeId, val,
invoiceIn.value?.currencyFk,
invoiceIn.value?.issued,
); );
const taxTypeSage = taxRateSelection?.rate ?? 0;
const taxableBase = invoiceInTax?.taxableBase ?? 0;
return ((taxTypeSage / 100) * taxableBase).toFixed(2);
}
function autocompleteExpense(evt, row, col, ref) {
const val = evt.target.value;
if (!val) return;
const param = isNaN(val) ? row[col.model] : val;
const lookup = expenses.value.find(
({ id }) => id == useAccountShortToStandard(param),
);
ref.vnSelectDialogRef.vnSelectRef.toggleOption(lookup);
}
function setCursor(ref) {
nextTick(() => {
const select = ref.vnSelectDialogRef
? ref.vnSelectDialogRef.vnSelectRef
: ref.vnSelectRef;
select.$el.querySelector('input').setSelectionRange(0, 0);
});
} }
</script> </script>
<template> <template>
<FetchData <FetchData url="Expenses" auto-load @on-fetch="(data) => (expenses = data)" />
ref="expensesRef"
url="Expenses"
auto-load
@on-fetch="(data) => (expenses = data)"
/>
<FetchData url="SageTaxTypes" auto-load @on-fetch="(data) => (sageTaxTypes = data)" /> <FetchData url="SageTaxTypes" auto-load @on-fetch="(data) => (sageTaxTypes = data)" />
<FetchData <FetchData
url="sageTransactionTypes" url="sageTransactionTypes"
auto-load auto-load
@on-fetch="(data) => (sageTransactionTypes = data)" @on-fetch="(data) => (sageTransactionTypes = data)"
/> />
<CrudModel <VnTable
ref="invoiceInFormRef"
v-if="invoiceIn" v-if="invoiceIn"
ref="invoiceInVatTableRef"
data-key="InvoiceInTaxes" data-key="InvoiceInTaxes"
url="InvoiceInTaxes" url="InvoiceInTaxes"
save-url="InvoiceInTaxes/crud"
:filter="filter" :filter="filter"
:data-required="{ invoiceInFk: $route.params.id }" :data-required="{ invoiceInFk: $route.params.id }"
:insert-on-load="true"
auto-load auto-load
v-model:selected="rowsSelected" v-model:selected="rowsSelected"
:go-to="`/invoice-in/${$route.params.id}/due-day`"
>
<template #body="{ rows }">
<QTable
v-model:selected="rowsSelected"
selection="multiple"
:columns="columns" :columns="columns"
:rows="rows" :is-editable="true"
row-key="$index" :table="{ selection: 'multiple', 'row-key': '$index' }"
:grid="$q.screen.lt.sm" footer
> :right-search="false"
<template #body-cell-expense="{ row, col }"> :column-search="false"
<QTd> :disable-option="{ card: true }"
<VnSelectDialog class="q-pa-none"
:ref="`expenseRef-${row.$index}`" :create="{
v-model="row[col.model]" urlCreate: 'InvoiceInTaxes',
:options="col.options" title: t('Add tax'),
:option-value="col.optionValue" formInitialData: { invoiceInFk: $route.params.id, isDeductible: true },
:option-label="col.optionLabel" onDataSaved: () => invoiceInVatTableRef.reload(),
:filter-options="['id', 'name']"
:tooltip="t('Create a new expense')"
:acls="[
{ model: 'Expense', props: '*', accessType: 'WRITE' },
]"
@keydown.tab.prevent="
autocompleteExpense(
$event,
row,
col,
$refs[`expenseRef-${row.$index}`],
)
"
@update:model-value="
setCursor($refs[`expenseRef-${row.$index}`])
"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
{{ `${scope.opt.id}: ${scope.opt.name}` }}
</QItem>
</template>
<template #form>
<CreateNewExpenseForm
@on-data-saved="$refs.expensesRef.fetch()"
/>
</template>
</VnSelectDialog>
</QTd>
</template>
<template #body-cell-isDeductible="{ row }">
<QTd align="center">
<QCheckbox
v-model="row.isDeductible"
data-cy="isDeductible_checkbox"
/>
</QTd>
</template>
<template #body-cell-taxablebase="{ row }">
<QTd shrink>
<VnInputNumber
clear-icon="close"
v-model="row.taxableBase"
clearable
/>
</QTd>
</template>
<template #body-cell-sageiva="{ row, col }">
<QTd>
<VnSelect
:ref="`sageivaRef-${row.$index}`"
v-model="row[col.model]"
:options="col.options"
:option-value="col.optionValue"
:option-label="col.optionLabel"
:filter-options="['id', 'vat']"
data-cy="vat-sageiva"
@update:model-value="
setCursor($refs[`sageivaRef-${row.$index}`])
"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt.vat }}</QItemLabel>
<QItemLabel>
{{ `#${scope.opt.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QTd>
</template>
<template #body-cell-sagetransaction="{ row, col }">
<QTd>
<VnSelect
:ref="`sagetransactionRef-${row.$index}`"
v-model="row[col.model]"
:options="col.options"
:option-value="col.optionValue"
:option-label="col.optionLabel"
:filter-options="['id', 'transaction']"
@update:model-value="
setCursor($refs[`sagetransactionRef-${row.$index}`])
"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
scope.opt.transaction
}}</QItemLabel>
<QItemLabel>
{{ `#${scope.opt.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QTd>
</template>
<template #body-cell-foreignvalue="{ row }">
<QTd shrink>
<VnInputNumber
:class="{
'no-pointer-events': !isNotEuro(currency),
}" }"
:disable="!isNotEuro(currency)" :crud-model="{ goTo: `/invoice-in/${$route.params.id}/due-day` }"
v-model="row.foreignValue" >
@update:model-value=" <template #column-footer-taxableBase>
async (val) => {
if (!isNotEuro(currency)) return;
row.taxableBase = await getExchange(
val,
row.currencyFk,
invoiceIn.issued,
);
}
"
/>
</QTd>
</template>
<template #bottom-row>
<QTr class="bg">
<QTd />
<QTd />
<QTd>
{{ toCurrency(taxableBaseTotal) }} {{ toCurrency(taxableBaseTotal) }}
</QTd> </template>
<QTd /> <template #column-footer-rate>
<QTd />
<QTd />
<QTd>
{{ toCurrency(taxRateTotal) }} {{ toCurrency(taxRateTotal) }}
</QTd> </template>
<QTd /> <template #column-footer-total>
<QTd>
{{ toCurrency(combinedTotal) }} {{ toCurrency(combinedTotal) }}
</QTd>
</QTr>
</template> </template>
</VnTable>
<template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
<QCard bordered flat class="q-my-xs">
<QCardSection>
<QCheckbox v-model="props.selected" dense />
</QCardSection>
<QSeparator />
<QList>
<QItem>
<VnSelectDialog
:label="t('Expense')"
class="full-width"
v-model="props.row['expenseFk']"
:options="expenses"
option-value="id"
:option-label="(row) => `${row.id}:${row.name}`"
:filter-options="['id', 'name']"
:tooltip="t('Create a new expense')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
{{ `${scope.opt.id}: ${scope.opt.name}` }}
</QItem>
</template>
<template #form>
<CreateNewExpenseForm />
</template>
</VnSelectDialog>
</QItem>
<QItem>
<VnInputNumber
:label="t('Taxable base')"
:class="{
'no-pointer-events': isNotEuro(currency),
}"
class="full-width"
:disable="isNotEuro(currency)"
clear-icon="close"
v-model="props.row.taxableBase"
clearable
/>
</QItem>
<QItem>
<VnSelect
:label="t('Sage iva')"
class="full-width"
v-model="props.row['taxTypeSageFk']"
:options="sageTaxTypes"
option-value="id"
:option-label="(row) => `${row.id}:${row.vat}`"
:filter-options="['id', 'vat']"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
scope.opt.vat
}}</QItemLabel>
<QItemLabel>
{{ `#${scope.opt.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItem>
<QItem>
<VnSelect
class="full-width"
v-model="props.row['transactionTypeSageFk']"
:options="sageTransactionTypes"
option-value="id"
:option-label="
(row) => `${row.id}:${row.transaction}`
"
:filter-options="['id', 'transaction']"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
scope.opt.transaction
}}</QItemLabel>
<QItemLabel>
{{ `#${scope.opt.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItem>
<QItem>
{{ toCurrency(taxRate(props.row), currency) }}
</QItem>
<QItem>
<VnInputNumber
:label="t('Foreign value')"
class="full-width"
:class="{
'no-pointer-events': !isNotEuro(currency),
}"
:disable="!isNotEuro(currency)"
v-model="props.row.foreignValue"
/>
</QItem>
</QList>
</QCard>
</div>
</template>
</QTable>
</template>
</CrudModel>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn
color="primary"
icon="add"
size="lg"
v-shortcut="'+'"
round
@click="invoiceInFormRef.insert()"
>
<QTooltip>{{ t('Add tax') }}</QTooltip>
</QBtn>
</QPageSticky>
</template> </template>
<style lang="scss" scoped>
.bg {
background-color: var(--vn-light-gray);
}
@media (max-width: $breakpoint-xs) {
.q-dialog {
.q-card {
&__section:not(:first-child) {
.q-item {
flex-direction: column;
.q-checkbox {
margin-top: 2rem;
}
}
}
}
}
}
.q-item {
min-height: 0;
}
.default-icon {
cursor: pointer;
border-radius: 50px;
background-color: $primary;
}
</style>
<i18n> <i18n>
es: es:
Expense: Gasto Expense: Gasto
Create a new expense: Crear nuevo gasto Create a new expense: Crear nuevo gasto
Add tax: Crear gasto Add tax: Añadir Gasto/IVA # Changed label slightly
Taxable base: Base imp. Taxable base: Base imp.
Sage tax: Sage iva Sage iva: Sage iva # Kept original label
Sage transaction: Sage transacción Sage transaction: Sage transacción
Rate: Tasa Rate: Cuota # Changed label
Foreign value: Divisa Foreign value: Divisa
Total: Total
invoiceIn.isDeductible: Deducible
</i18n> </i18n>

View File

@ -3,7 +3,7 @@ import axios from 'axios';
export async function setRectificative(route) { export async function setRectificative(route) {
const card = route.matched.find((route) => route.name === 'InvoiceInCard'); const card = route.matched.find((route) => route.name === 'InvoiceInCard');
const corrective = card.children.find( const corrective = card.children.find(
(route) => route.name === 'InvoiceInCorrective' (route) => route.name === 'InvoiceInCorrective',
); );
corrective.meta.hidden = !( corrective.meta.hidden = !(

View File

@ -51,6 +51,7 @@ const submit = async (rows) => {
<CrudModel <CrudModel
:data-required="{ itemFk: route.params.id }" :data-required="{ itemFk: route.params.id }"
:default-remove="false" :default-remove="false"
:insert-on-load="true"
:filter="{ :filter="{
fields: ['id', 'itemFk', 'code'], fields: ['id', 'itemFk', 'code'],
where: { itemFk: route.params.id }, where: { itemFk: route.params.id },

View File

@ -76,15 +76,22 @@ const insertTag = (rows) => {
model="ItemTags" model="ItemTags"
url="ItemTags" url="ItemTags"
:data-required="{ :data-required="{
$index: undefined,
itemFk: route.params.id, itemFk: route.params.id,
priority: undefined,
tag: { tag: {
isFree: undefined, isFree: true,
value: undefined,
name: undefined,
},
}"
:data-default="{
tag: {
isFree: true,
value: undefined, value: undefined,
name: undefined, name: undefined,
}, },
tagFk: undefined, tagFk: undefined,
priority: undefined,
}" }"
:default-remove="false" :default-remove="false"
:user-filter="{ :user-filter="{

View File

@ -1,12 +1,11 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { Notify } from 'quasar';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import VnInputPassword from 'src/components/common/VnInputPassword.vue'; import VnInputPassword from 'src/components/common/VnInputPassword.vue';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { useLogin } from 'src/composables/useLogin'; import { useLogin } from 'src/composables/useLogin';
import useNotify from 'src/composables/useNotify';
import VnLogo from 'components/ui/VnLogo.vue'; import VnLogo from 'components/ui/VnLogo.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import axios from 'axios'; import axios from 'axios';
@ -15,16 +14,14 @@ const session = useSession();
const loginCache = useLogin(); const loginCache = useLogin();
const router = useRouter(); const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const { notify } = useNotify();
const username = ref(''); const username = ref('');
const password = ref(''); const password = ref('');
const keepLogin = ref(true); const keepLogin = ref(true);
async function onSubmit() { async function onSubmit() {
const params = { const params = { user: username.value, password: password.value };
user: username.value,
password: password.value,
};
try { try {
const { data } = await axios.post('Accounts/login', params); const { data } = await axios.post('Accounts/login', params);
if (!data) return; if (!data) return;
@ -33,11 +30,7 @@ async function onSubmit() {
await session.setLogin(data); await session.setLogin(data);
} catch (res) { } catch (res) {
if (res.response?.data?.error?.code === 'REQUIRES_2FA') { if (res.response?.data?.error?.code === 'REQUIRES_2FA') {
Notify.create({ notify(t('login.twoFactorRequired'), 'warning', 'phoneLink_lock');
message: t('login.twoFactorRequired'),
icon: 'phoneLink_lock',
type: 'warning',
});
params.keepLogin = keepLogin.value; params.keepLogin = keepLogin.value;
loginCache.setUser(params); loginCache.setUser(params);
return router.push({ return router.push({
@ -45,10 +38,7 @@ async function onSubmit() {
query: router.currentRoute.value?.query, query: router.currentRoute.value?.query,
}); });
} }
Notify.create({ throw res;
message: t('login.loginError'),
type: 'negative',
});
} }
} }
</script> </script>

View File

@ -37,7 +37,7 @@ async function onSubmit() {
await axios.post( await axios.post(
'VnUsers/reset-password', 'VnUsers/reset-password',
{ newPassword: newPassword.value }, { newPassword: newPassword.value },
{ headers } { headers },
); );
router.push('Login'); router.push('Login');
quasar.notify({ quasar.notify({

View File

@ -71,9 +71,7 @@ onMounted(async () => (stateStore.rightDrawer = false));
auto-load auto-load
/> />
<QCard v-if="volumeSummary" class="order-volume-summary q-pa-lg"> <QCard v-if="volumeSummary" class="order-volume-summary q-pa-lg">
<VnLv <VnLv :label="`${t('total')}: `" :value="`${volumeSummary?.totalVolume} m³`" />
:label="`${t('total')}: `"
:value="`${volumeSummary?.totalVolume} m³`" />
<VnLv <VnLv
:label="`${t('boxes')}: `" :label="`${t('boxes')}: `"
:value="`${dashIfEmpty(volumeSummary?.totalBoxes)} U`" :value="`${dashIfEmpty(volumeSummary?.totalBoxes)} U`"

View File

@ -3,5 +3,10 @@ import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue';
import VnCard from 'src/components/common/VnCard.vue'; import VnCard from 'src/components/common/VnCard.vue';
</script> </script>
<template> <template>
<VnCard data-key="Agency" url="Agencies" :descriptor="AgencyDescriptor" :filter="{ where: { id: $route.params.id } }" /> <VnCard
data-key="Agency"
url="Agencies"
:descriptor="AgencyDescriptor"
:filter="{ where: { id: $route.params.id } }"
/>
</template> </template>

View File

@ -9,7 +9,7 @@ export async function getAgencies(formData, client, _filter = {}) {
}; };
let agency = null; let agency = null;
let params = { const params = {
filter: JSON.stringify(filter), filter: JSON.stringify(filter),
warehouseFk: formData.warehouseId, warehouseFk: formData.warehouseId,
addressFk: formData.addressId, addressFk: formData.addressId,

Some files were not shown because too many files have changed in this diff Show More