Compare commits
322 Commits
8194-VnSel
...
dev
Author | SHA1 | Date |
---|---|---|
Alex Moreno | 4480b58551 | |
Alex Moreno | 79c86e271c | |
Alex Moreno | 068b2dc9aa | |
Alex Moreno | 89a13e8886 | |
Carlos Andrés | 658551e085 | |
Guillermo Bonet | bf8b9e4283 | |
Guillermo Bonet | 8428c7a205 | |
Alex Moreno | f1fc5edac3 | |
Alex Moreno | d364e30cf0 | |
Robert Ferrús | 4f8bf00786 | |
Robert Ferrús | bedf7d8a3a | |
Alex Moreno | 50796df06a | |
Alex Moreno | 36de1ad400 | |
Robert Ferrús | 650acccbee | |
Carlos Andrés | 67c257ce0e | |
Javier Segarra | 7a3e2c0a9b | |
Javier Segarra | 280a70a145 | |
Jon Elias | ddfcc0aff5 | |
Jon Elias | 4193710123 | |
Jon Elias | 6263481a3e | |
Javier Segarra | d74bad50cb | |
Javier Segarra | 07274002cf | |
Jon Elias | 61d0d71538 | |
Robert Ferrús | 547455d976 | |
Robert Ferrús | 97c12bced3 | |
Javier Segarra | 1bbce5f828 | |
Javier Segarra | 8bc3c1610b | |
Robert Ferrús | 5c79c6bfef | |
Guillermo Bonet | 7315d117c0 | |
Guillermo Bonet | 41fb880c0e | |
Alex Moreno | 1ae53791bf | |
Alex Moreno | a251e348a8 | |
Guillermo Bonet | 4af309ce8d | |
Javier Segarra | 8daa08b99c | |
Alex Moreno | fe34eefc55 | |
Alex Moreno | 118e346a07 | |
Guillermo Bonet | 55b9e3ddcd | |
Jon Elias | aaab41fe97 | |
Jon Elias | b2e99230b3 | |
Jon Elias | 1a0406b5b1 | |
Javier Segarra | c287c04894 | |
Javier Segarra | 89a2486f62 | |
Javier Segarra | 3a695bdfe1 | |
Javier Segarra | 507b78f5e8 | |
Javier Segarra | 827f6032b6 | |
William Buezas | 63f0db459c | |
Javier Segarra | 38d8dbab8e | |
Javier Segarra | e23c6bc144 | |
Javier Segarra | a7f5c13acf | |
Jorge Penadés | 33de645e37 | |
Jon Elias | 5889dbf3de | |
Jon Elias | d2cee10141 | |
Jon Elias | 7d28037c29 | |
Jon Elias | e94c99662d | |
Jon Elias | e764f4066f | |
Javier Segarra | dc156e44b6 | |
Jon Elias | 6b95df0202 | |
Jon Elias | 07ba02aec8 | |
Javier Segarra | bfb0915da0 | |
Javier Segarra | 13ee4625be | |
Javier Segarra | 1f752e19f2 | |
Javier Segarra | abec8035a9 | |
Javier Segarra | fd9dd7ae55 | |
William Buezas | 4a562acd92 | |
Javier Segarra | 72a481ae5b | |
Javier Segarra | b61d6e6cbe | |
Javier Segarra | e3bdea2197 | |
William Buezas | a2d84c48c0 | |
Javier Segarra | ff91ca2dfe | |
Javier Segarra | bc0d7f110d | |
Javier Segarra | 4539a73efc | |
Javier Segarra | cf34204f82 | |
Javier Segarra | 1b3500bbce | |
Javier Segarra | 21eda340a8 | |
Javier Segarra | 511a5bc614 | |
Alex Moreno | 9086b7d48d | |
Javier Segarra | 1af90f695e | |
Carlos Andrés | b20803e6b9 | |
Carlos Satorres | 75986bf7a8 | |
Carlos Satorres | c5f2be688c | |
Carlos Satorres | 4008f50781 | |
Carlos Satorres | 728055352d | |
Carlos Satorres | ad8d5b5e9a | |
Javier Segarra | ac1153b14c | |
Javier Segarra | 0e9fe82d3d | |
Javier Segarra | 63536ea0f5 | |
Jorge Penadés | 9c5125a4d2 | |
Jorge Penadés | 15c1898044 | |
Jorge Penadés | a33f801543 | |
Jorge Penadés | 84adc40c18 | |
Alex Moreno | 7feea110a6 | |
Alex Moreno | 2076072eeb | |
Alex Moreno | 8fbf7fed43 | |
Alex Moreno | 1e4cda6c6a | |
Alex Moreno | 1ce1f1f8e0 | |
Javier Segarra | c3510aea60 | |
Javier Segarra | e28d026ca9 | |
Javier Segarra | 4e5754ccb5 | |
Javier Segarra | 6c6144864f | |
Javier Segarra | c0d427ecb9 | |
Javier Segarra | 1cbe134e27 | |
Javier Segarra | a45c40f796 | |
Javier Segarra | 7650997c24 | |
Javier Segarra | f6e97efe78 | |
Javier Segarra | 7e924bc791 | |
Javier Segarra | 2ead484026 | |
Alex Moreno | 594fc60eec | |
Javier Segarra | 1974fd4663 | |
Javier Segarra | 4735d98afc | |
Jorge Penadés | 8688f2a3aa | |
Jorge Penadés | 5bdf9bc57e | |
Javier Segarra | 28c9aceb80 | |
Alex Moreno | 209266d843 | |
Javier Segarra | 4821c43d0d | |
Carlos Satorres | 2c492e88d5 | |
Javier Segarra | 582a3b333a | |
Carlos Satorres | dfcaf4e692 | |
Carlos Satorres | 2bc2217406 | |
Jorge Penadés | 34062d3fc4 | |
Carlos Satorres | 5dd508c559 | |
Javier Segarra | 60590f6c97 | |
William Buezas | 62cd952e84 | |
William Buezas | 0e55f7abdc | |
Javier Segarra | ec96f6bea7 | |
Alex Moreno | ee2450c82f | |
Alex Moreno | 655a76ff62 | |
Alex Moreno | fbd57dc96b | |
Jon Elias | 843c54fcc1 | |
Alex Moreno | 8e7cb9c46e | |
Javier Segarra | a99f64f66a | |
Jon Elias | f3429297cf | |
Javier Segarra | 3e06ba3c18 | |
Javier Segarra | 4bd14927de | |
Javier Segarra | b62935494a | |
Jon Elias | d191d88e81 | |
Javier Segarra | caca9aea71 | |
Javier Segarra | 424dfc0a5c | |
Jorge Penadés | 6c30ea9e7a | |
Jorge Penadés | e994ae72b6 | |
Jorge Penadés | a1284cefc2 | |
Jon Elias | c558636799 | |
Jorge Penadés | a3f56aaf24 | |
Jon Elias | 1dedf00fef | |
Jon Elias | a1aa9337c8 | |
Javier Segarra | c4f2ea032c | |
Javier Segarra | b8ac82bc75 | |
Alex Moreno | e10e0d01e6 | |
Javier Segarra | feb752f75c | |
Javier Segarra | fb4de9cda9 | |
Javier Segarra | a45bf4c83b | |
Javier Segarra | 8d59cfa9c3 | |
Javier Segarra | 7f87df1225 | |
Javier Segarra | 2fa8c3f88a | |
Javier Segarra | 4fa5d47481 | |
Javier Segarra | 30a2da027b | |
Javier Segarra | 8a1a748c92 | |
Javier Segarra | 4233385267 | |
Javier Segarra | 276dc233c1 | |
Javier Segarra | 12dcb51fbe | |
Jorge Penadés | 8b52629b0b | |
Jorge Penadés | 3a4c0e729a | |
Javier Segarra | 148e255665 | |
Jorge Penadés | 9d8698fa2f | |
Javier Segarra | 87d3dd6fa8 | |
Jorge Penadés | 661cc0b5ee | |
Alex Moreno | 01ffb663f1 | |
William Buezas | be1cd824d8 | |
Jorge Penadés | 0eeb22d40a | |
Jorge Penadés | 7048f96565 | |
Jorge Penadés | 50fbf64cf9 | |
Jorge Penadés | c72fa52851 | |
Alex Moreno | 6276843613 | |
Alex Moreno | 14d2ddfa83 | |
Alex Moreno | ef426dc579 | |
Alex Moreno | 4913cf2c29 | |
Javier Segarra | 651b67e98f | |
Alex Moreno | 94361f18fa | |
Alex Moreno | 142302193e | |
Alex Moreno | 9d7f2b95e8 | |
Jorge Penadés | 1beeccef7a | |
Jorge Penadés | 3d4f7d8860 | |
Alex Moreno | 2db0369b74 | |
Javier Segarra | 1c2c2538ed | |
Alex Moreno | 1709795cf9 | |
Alex Moreno | 26c1394321 | |
Alex Moreno | 367f660508 | |
Javier Segarra | 4ea0d04b86 | |
Alex Moreno | 9019d4ff90 | |
Alex Moreno | 522f32aa9a | |
Jorge Penadés | 55f9023201 | |
Jorge Penadés | d1055ad572 | |
Javier Segarra | 8a4a6061e7 | |
Javier Segarra | c6b547bc55 | |
Javier Segarra | e2f092948e | |
Javier Segarra | aae475bf4c | |
Javier Segarra | ce28757a1a | |
Alex Moreno | bf29be1c5f | |
Alex Moreno | 8cbf40f465 | |
Alex Moreno | 3b03f0dfee | |
Carlos Satorres | 095c1f477f | |
Carlos Satorres | 3352cea0e7 | |
William Buezas | 86d19218de | |
Javier Segarra | 94514a3254 | |
Carlos Andrés | 6c866e48a0 | |
Carlos Andrés | e04d77f55e | |
Carlos Andrés | 5268140d8b | |
William Buezas | ec40ef9351 | |
Carlos Andrés | 977512cae0 | |
Carlos Andrés | 242bf6f318 | |
Carlos Satorres | a0f804ab78 | |
Carlos Satorres | 69498cccf9 | |
Carlos Satorres | 518ed40c91 | |
Alex Moreno | fdc71a13ff | |
Alex Moreno | bf0bda0e27 | |
Carlos Satorres | 8a972507a4 | |
Javier Segarra | 3bc5c9bd6a | |
Carlos Satorres | 837f42d21f | |
Jon Elias | 0cefe391cb | |
Jon Elias | 747bc4af76 | |
Jon Elias | 5ff95c2b93 | |
Alex Moreno | 0c3581f3dc | |
Javier Segarra | f36363dbd2 | |
Javier Segarra | e5434e7436 | |
Carlos Satorres | 991ef7b243 | |
Javier Segarra | 0434332ec4 | |
Javier Segarra | 81d7b9f04f | |
Javier Segarra | 6f324b44b8 | |
Javier Segarra | 5a90434425 | |
Jon Elias | e943838dbe | |
Jon Elias | 4d8d56eb6e | |
Alex Moreno | 9e41459da4 | |
Alex Moreno | 6b8470d6e1 | |
Javier Segarra | 350c28eef0 | |
Alex Moreno | 44f2ecca28 | |
Alex Moreno | c5acde22a3 | |
Alex Moreno | c1e06325d3 | |
William Buezas | 8e411125bf | |
Javier Segarra | 3b5d385d22 | |
Carlos Andrés | 087ec5f39f | |
Jorge Penadés | 7039b68bba | |
Jorge Penadés | 9632fb7c75 | |
Jorge Penadés | 43f94ede64 | |
Javi Gallego | bc173d9f6a | |
Carlos Andrés | c21785b1f6 | |
Carlos Andrés | 16133faca7 | |
Jorge Penadés | ad93e16896 | |
Alex Moreno | 42d24359cd | |
Alex Moreno | abd79283ff | |
Carlos Satorres | 258da0f60b | |
Javi Gallego | 2a1cc49499 | |
Jorge Penadés | 0274dfcef2 | |
Carlos Andrés | 317e9ad034 | |
Javier Segarra | d6aedad38e | |
Javier Segarra | deb6467af8 | |
Javier Segarra | 9da0488184 | |
Carlos Satorres | 093e6cb0e8 | |
Carlos Satorres | 131cd2de8c | |
Carlos Satorres | 2d5d1c549b | |
Carlos Satorres | c59baf9cf5 | |
Javier Segarra | 226f604f9d | |
Alex Moreno | 51beef3cbe | |
Javier Segarra | e10ee5e6c7 | |
Alex Moreno | 32fdc836f9 | |
Javier Segarra | 1fb927488a | |
Carlos Satorres | 2806c94fdb | |
Javier Segarra | 68c9baa7f6 | |
Alex Moreno | e032d5988b | |
Javier Segarra | b4ee19bcde | |
Jorge Penadés | 9665a3407f | |
Jorge Penadés | 85aeda337f | |
Javier Segarra | e6f8b87890 | |
Carlos Andrés | 5da6e9b2ca | |
Javier Segarra | 65100fcf25 | |
Javier Segarra | 5515f55bf6 | |
Jon Elias | 98017df57d | |
Jon Elias | 7cef1d11be | |
Jon Elias | cf6695f7ff | |
Carlos Andrés | 8c20b8736b | |
Alex Moreno | c2db7be8cd | |
William Buezas | 28bfda869a | |
Javier Segarra | 73072794ee | |
Javier Segarra | 2f06eea8ea | |
Jon Elias | a64575c7cc | |
Jon Elias | 452ba788c9 | |
William Buezas | d8c1bd5b16 | |
Javier Segarra | 4116f681b0 | |
Javier Segarra | 95758e2564 | |
Javier Segarra | 8e37d22164 | |
Javier Segarra | 69e6f0f467 | |
Javier Segarra | e8ad185873 | |
Javier Segarra | 69a2eae542 | |
Javier Segarra | 1a0a2d9442 | |
Javier Segarra | c7c9c13944 | |
Javier Segarra | 703aaa1f38 | |
Jon Elias | cc85d4ab4b | |
Jon Elias | 9533c1a97e | |
Alex Moreno | 9ac3316567 | |
Jorge Penadés | 4572817699 | |
Carlos Andrés | b460a0be2f | |
Carlos Andrés | 18593cc3f9 | |
Carlos Andrés | 4a0c15ed90 | |
William Buezas | 4bfbd1925e | |
Carlos Andrés | e9fad1a44e | |
Carlos Andrés | fc73149dcf | |
Carlos Satorres | 04f6107909 | |
Carlos Satorres | 780af58747 | |
Carlos Satorres | 8b2fbefc35 | |
Carlos Satorres | eea6276264 | |
Carlos Satorres | adbf1af453 | |
Jorge Penadés | 53399c8f74 | |
Carlos Satorres | 847cf6a5b4 | |
Jon Elias | e13090bb3b | |
Carlos Satorres | 1aefad58e9 | |
Carlos Satorres | 237b3ed4df | |
Jorge Penadés | 4e5a4ae7a3 | |
Jorge Penadés | fb7087d38a | |
Carlos Satorres | 5d8f9dbd72 | |
Carlos Satorres | ee2f80e9bb | |
Carlos Satorres | 87bce8fc21 | |
Carlos Satorres | b2c2f42243 | |
Carlos Satorres | 657dbc6761 | |
Carlos Satorres | 3bfbed9e54 |
186
CHANGELOG.md
186
CHANGELOG.md
|
@ -1,3 +1,189 @@
|
|||
# Version 24.48 - 2024-11-25
|
||||
|
||||
### Added 🆕
|
||||
|
||||
- chore: correct checkNotification (fix_customer_issues) by:alexm
|
||||
- chore: perf (warmFix_order_equalSalix) by:alexm
|
||||
- chore: refs #6818 add spaces by:jorgep
|
||||
- chore: refs #6818 drop useless code & comment by:jorgep
|
||||
- chore: refs #7273 sticky add btn & refactor by:jorgep
|
||||
- chore: refs #7524 fix test by:jorgep
|
||||
- chore: refs #8039 not required by:alexm
|
||||
- chore: refs #8078 fiz tests by:jorgep
|
||||
- chore: refs #8078 rollback ref by:jorgep
|
||||
- chore: remove console.log (warmFix_invoiceOut_Global) by:alexm
|
||||
- chore: typo (fix_itemType-redirection) by:alexm
|
||||
- feat: #6943 use openURL quasar by:Javier Segarra
|
||||
- feat: #7782 add cypress report by:Javier Segarra
|
||||
- feat: #7782 cypress.config watchForFileChanges by:Javier Segarra
|
||||
- feat: #7782 npm run resetDatabase by:Javier Segarra
|
||||
- feat: #7782 waitUntil domContentLoad by:Javier Segarra
|
||||
- feat: added composable to confirm orders by:Jon
|
||||
- feat: add /reports in gitignore (warmFix_reports_in_gitignore) by:alexm
|
||||
- feat: apply changes for customerModule by:Javier Segarra
|
||||
- feat: disabled buttons by:Javier Segarra
|
||||
- feat: move buttons to DescriptorMenu by:Javier Segarra
|
||||
- feat: refs #6818 add icon by:jorgep
|
||||
- feat: refs #6818 fetch url & default channel by:jorgep
|
||||
- feat: refs #6818 saysimple integration by:jorgep
|
||||
- feat: refs #6839 module searching (6839-addSearchMenu) by:jorgep
|
||||
- feat: refs #6839 normalize search by:jorgep
|
||||
- feat: refs #6919 sync entry data by:jorgep
|
||||
- feat: refs #7006 itemType basic data new inputs by:guillermo
|
||||
- feat: refs #7006 itemTypeLog added by:guillermo
|
||||
- feat: refs #7193 modified parking to use the scope and corrected small errors by:Jon
|
||||
- feat: refs #7206 added inactive label and corrected minor errors by:Jon
|
||||
- feat: refs #7308 #7308 remove warnings related to useSession by:Javier Segarra
|
||||
- feat: refs #7349 usa back con permisos by:jgallego
|
||||
- feat: refs #7524 add front test by:jorgep
|
||||
- feat: refs #7874 improve vn-notes ui by:jorgep
|
||||
- feat: refs #7970 notify changes by:Jon
|
||||
- feat(): refs #8039 canceledError not notify by:alexm
|
||||
- feat: refs #8039 notify error unify by:alexm
|
||||
- feat: refs #8039 show duplicate request in local by:alexm
|
||||
- feat: refs #8078 add shortcut multi selection by:jorgep
|
||||
- feat: refs #8078 add tests by:jorgep
|
||||
- feat: refs#8087 Redadas en travel by:Carlos Andrés
|
||||
- feat: refs #8087 Traspasar redadas a travels by:Carlos Andrés
|
||||
- feat: remove comments by:Javier Segarra
|
||||
- feat(Supplier): add companySize by:alexm
|
||||
- feat: use composable to unify logic by:Javier Segarra
|
||||
- feat(VnInput): empty to null by:alexm
|
||||
- feat(VnSelect): order data equal salix by:alexm
|
||||
- feat(VnSelect): refs #7136 add scroll (7136-vnSelect_paginate_simplify_2) by:alexm
|
||||
|
||||
### Changed 📦
|
||||
|
||||
- chore: perf (warmFix_order_equalSalix) by:alexm
|
||||
- chore: refs #7273 sticky add btn & refactor by:jorgep
|
||||
- fix: better performance (warmFix_accountAcls) by:alexm
|
||||
- perf: minor bugs detected by:Javier Segarra
|
||||
- perf: refs #6943 #6943 merge command by:Javier Segarra
|
||||
- perf: refs #7283 #7283 declare composable inst4ead code duplicated by:Javier Segarra
|
||||
- perf: refs #7283 #7283 handle composable i18n by:Javier Segarra
|
||||
- perf: refs #7283 #7283 handle i18n by:Javier Segarra
|
||||
- perf: refs #7283 #7283 i18n params by:Javier Segarra
|
||||
- perf: refs #7308 #7308 remove comments by:Javier Segarra
|
||||
- perf: remove appendParams by:Javier Segarra
|
||||
- perf: use const in VnLocation by:Javier Segarra
|
||||
- perf: use required instead :required="true" by:Javier Segarra
|
||||
- refactor: apply QPopupProxy by:wbuezas
|
||||
- refactor: changed confirmOrder directory by:Jon
|
||||
- refactor: change keyup.enter for update:model-value by:wbuezas
|
||||
- refactor(InvoiceInBasicData): use VnDms by:alexm
|
||||
- refactor: modified composable by:Jon
|
||||
- refactor: refs #6818 change channel source by:jorgep
|
||||
- refactor: refs #6818 channel logic by:jorgep
|
||||
- refactor: refs #6919 export filter by:jorgep
|
||||
- refactor: refs #7132 1st wave of changes in global translations files by:Jon
|
||||
- refactor: refs #7132 account's module translations by:Jon
|
||||
- refactor: refs #7132 customer's module translations by:Jon
|
||||
- refactor: refs #7132 deleted pageTitles repeated by:Jon
|
||||
- refactor: refs #7132 delete duplicate translations' keys by:Jon
|
||||
- refactor: refs #7132 deleted useless code by:Jon
|
||||
- refactor: refs #7132 global translations files changed by:Jon
|
||||
- refactor: refs #7266 Changed method name by:guillermo
|
||||
- refactor: refs #7950 Created cmr model by:guillermo
|
||||
- refactor: refs #7970 added emit by:Jon
|
||||
- refactor: refs #7970 refactored VnConfirm to emit events by:Jon
|
||||
- refactor: refs #8185 modified LeftMenu to avoid duplicates by:Jon
|
||||
- refactor: remove unused variable by:wbuezas
|
||||
- refactor: revert catalog changes by:Jon
|
||||
- refactor: small change by:wbuezas
|
||||
- test: refactor e2e by:alexm
|
||||
- test: refs #8039 add hasNotify and, refactor: agencyWorkCenter test by:alexm
|
||||
|
||||
### Fixed 🛠️
|
||||
|
||||
- chore: refs #7524 fix test by:jorgep
|
||||
- fix: better performance (warmFix_accountAcls) by:alexm
|
||||
- fix: catalog view category and type filter by:wbuezas
|
||||
- fix: category and tags filters by:Jon
|
||||
- fix: changed route.query by:Jon
|
||||
- fix: change type vnput by:Javier Segarra
|
||||
- fix(ClaimList): stateCode orderBy priority by:alexm
|
||||
- fix: entryFilters by:carlossa
|
||||
- fix: filter panel by:Jon
|
||||
- fix(InvoiceOutGlobal): parallelism by:alexm
|
||||
- fix: itemBotanical by:Javier Segarra
|
||||
- fix: itemType redirection and fix filters by:alexm
|
||||
- fix: logout spec (warmFix_logout.spec) by:alexm
|
||||
- fix: merge errors by:alexm
|
||||
- fix: order catalog by:wbuezas
|
||||
- fix: order catalog fixes by:wbuezas
|
||||
- fix: refs #6818 use right icon by:jorgep
|
||||
- fix: refs #6896 fixed module problems by:Jon
|
||||
- fix: refs #7193 fixed e2e test by:Jon
|
||||
- fix: refs #7206 deleted duplicate code by:Jon
|
||||
- fix: refs #7273 use same filter by:jorgep
|
||||
- fix: refs #7283 #7283 bugs by:Javier Segarra
|
||||
- fix: refs #7283 #7283 ItemDiary subToolbar by:Javier Segarra
|
||||
- fix: refs #7283 #7283 ItemSummary bugs by:Javier Segarra
|
||||
- fix: refs #7283 Account image resolution by:guillermo
|
||||
- fix: refs #7283 css by:jorgep
|
||||
- fix: refs #7283 filter by:carlossa
|
||||
- fix: refs #7283 fix image by:carlossa
|
||||
- fix: refs #7283 fix pr by:carlossa
|
||||
- fix: refs #7283 fix preview by:carlossa
|
||||
- fix: refs #7283 fix required by:carlossa
|
||||
- fix: refs #7283 item filters by:carlossa
|
||||
- fix: refs #7283 itemtype fix by:carlossa
|
||||
- fix: refs #7283 order translation by:carlossa
|
||||
- fix: refs #7283 preview by:carlossa
|
||||
- fix: refs #7283 tooltips !Item by:Javier Segarra
|
||||
- fix: refs #7306 clean warning by:carlossa
|
||||
- fix: refs #7310 clean warning by:carlossa
|
||||
- fix: refs #7323 locale #7396 by:jorgep
|
||||
- fix: refs #7323 show advanced fields by:jorgep
|
||||
- fix: refs #7349 dependencia no usada by:jgallego
|
||||
- fix: refs #7524 e2e & worker module by:jorgep
|
||||
- fix: refs #7874 add title by:jorgep
|
||||
- fix: refs #7874 show name by:jorgep
|
||||
- fix: refs #7943 use correct data-key by:jorgep
|
||||
- fix: refs #7943 use summary by:jorgep
|
||||
- fix: refs #8039 bad tests by:alexm
|
||||
- fix: refs #8039 o not handle unnecessary errors by:alexm
|
||||
- fix: refs #8078 e2e #7970 by:jorgep
|
||||
- fix: refs #8078 handleSelection by:jorgep
|
||||
- fix: refs #8078 improve cy command (8078-enableMultiSelection) by:jorgep
|
||||
- fix: refs #8078 improve handleSelection by:jorgep
|
||||
- fix: reset category by:wbuezas
|
||||
- fix: tag chips by:Jon
|
||||
- fix: vnSearchbar spec (warmFix_vnSearchBar.spec) by:alexm
|
||||
- fix(VnSelect): setOptions when applyFilter by:alexm
|
||||
- fix: worker test e2e by:Jon
|
||||
- Merge branch 'dev' into fix_customer_issues by:Javier Segarra
|
||||
- refactor: revert catalog changes by:Jon
|
||||
- refs #7283 fix conflicts by:carlossa
|
||||
- refs #7283 fix descriptorproxy by:carlossa
|
||||
- refs #7283 fixedPrice by:carlossa
|
||||
- refs #7283 fixedPrices by:carlossa
|
||||
- refs #7283 fix itemFixed by:carlossa
|
||||
- refs #7283 fix itemFixedPrice by:carlossa
|
||||
- refs #7283 fix itemMigration by:carlossa
|
||||
- refs #7283 fix itemMigration list filters by:carlossa
|
||||
- refs #7283 fix items by:carlossa
|
||||
- refs #7283 fix items error get images by:carlossa
|
||||
- refs #7283 fix items images by:carlossa
|
||||
- refs #7283 fix request by:carlossa
|
||||
- refs #7283 fix searchbar by:carlossa
|
||||
- refs #7283 fix viewSummary by:carlossa
|
||||
- refs #7283 fix yml list basicData by:carlossa
|
||||
- refs #7283 itemRequest fix by:carlossa
|
||||
- refs #7283 itemRequest fix deny by:carlossa
|
||||
- refs #7283 itemRequest fix reload by:carlossa
|
||||
- refs #72983 fix filters by:carlossa
|
||||
- revert: commit by:Javier Segarra
|
||||
- revert e57a253c6f649382da187d1129449d265fb26d3b by:Javier Segarra
|
||||
- test: #8162 fix clientList spec by:Javier Segarra
|
||||
- test: #8162 fix vnLocation spec by:Javier Segarra
|
||||
- test: fix arrayData by:Javier Segarra
|
||||
- test: fix e2e by:alexm
|
||||
- test: fix e2e by:Javier Segarra
|
||||
- test: refs #8039 fix WorkerNotification e2e by:alexm
|
||||
- test: refs #8039 fix ZoneWarehouse e2e by:alexm
|
||||
- warmfix: ItemLastEntries to date (origin/warmfix_itemLastEntriesFilter) by:Javier Segarra
|
||||
|
||||
# Version 24.40 - 2024-10-02
|
||||
|
||||
### Added 🆕
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
const { defineConfig } = require('cypress');
|
||||
// https://docs.cypress.io/app/tooling/reporters
|
||||
// https://docs.cypress.io/app/references/configuration
|
||||
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
|
@ -16,6 +19,7 @@ module.exports = defineConfig({
|
|||
reporterOptions: {
|
||||
charts: true,
|
||||
reportPageTitle: 'Cypress Inline Reporter',
|
||||
reportFilename: '[status]_[datetime]-report',
|
||||
embeddedScreenshots: true,
|
||||
reportDir: 'test/cypress/reports',
|
||||
inlineAssets: true,
|
||||
|
|
|
@ -9,8 +9,6 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import FormModelPopup from './FormModelPopup.vue';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
defineProps({ showEntityField: { type: Boolean, default: true } });
|
||||
|
||||
const emit = defineEmits(['onDataSaved']);
|
||||
const { t } = useI18n();
|
||||
const bicInputRef = ref(null);
|
||||
|
@ -18,17 +16,16 @@ const state = useState();
|
|||
|
||||
const customer = computed(() => state.get('customer'));
|
||||
|
||||
const countriesFilter = {
|
||||
fields: ['id', 'name', 'code'],
|
||||
};
|
||||
|
||||
const bankEntityFormData = reactive({
|
||||
name: null,
|
||||
bic: null,
|
||||
countryFk: customer.value?.countryFk,
|
||||
id: null,
|
||||
});
|
||||
|
||||
const countriesFilter = {
|
||||
fields: ['id', 'name', 'code'],
|
||||
};
|
||||
|
||||
const countriesOptions = ref([]);
|
||||
|
||||
const onDataSaved = (...args) => {
|
||||
|
@ -44,7 +41,6 @@ onMounted(async () => {
|
|||
<template>
|
||||
<FetchData
|
||||
url="Countries"
|
||||
:filter="countriesFilter"
|
||||
auto-load
|
||||
@on-fetch="(data) => (countriesOptions = data)"
|
||||
/>
|
||||
|
@ -54,6 +50,7 @@ onMounted(async () => {
|
|||
:title="t('title')"
|
||||
:subtitle="t('subtitle')"
|
||||
:form-initial-data="bankEntityFormData"
|
||||
:filter="countriesFilter"
|
||||
@on-data-saved="onDataSaved"
|
||||
>
|
||||
<template #form-inputs="{ data, validate }">
|
||||
|
@ -85,7 +82,13 @@ onMounted(async () => {
|
|||
:rules="validate('bankEntity.countryFk')"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="showEntityField" class="col">
|
||||
<div
|
||||
v-if="
|
||||
countriesOptions.find((c) => c.id === data.countryFk)?.code ==
|
||||
'ES'
|
||||
"
|
||||
class="col"
|
||||
>
|
||||
<VnInput
|
||||
:label="t('id')"
|
||||
v-model="data.id"
|
||||
|
|
|
@ -17,10 +17,6 @@ const $props = defineProps({
|
|||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
provinces: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const { t } = useI18n();
|
||||
|
||||
|
@ -48,15 +44,16 @@ const onDataSaved = (...args) => {
|
|||
<template #form-inputs="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnInput
|
||||
:label="t('Names')"
|
||||
:label="t('Name')"
|
||||
v-model="data.name"
|
||||
:rules="validate('city.name')"
|
||||
required
|
||||
/>
|
||||
<VnSelectProvince
|
||||
:province-selected="$props.provinceSelected"
|
||||
:country-fk="$props.countryFk"
|
||||
v-model="data.provinceFk"
|
||||
:provinces="$props.provinces"
|
||||
required
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
@ -22,12 +22,14 @@ const postcodeFormData = reactive({
|
|||
townFk: null,
|
||||
});
|
||||
|
||||
const townsFetchDataRef = ref(null);
|
||||
const provincesFetchDataRef = ref(null);
|
||||
const countriesOptions = ref([]);
|
||||
const townsFetchDataRef = ref(false);
|
||||
const countriesRef = ref(false);
|
||||
const townsRef = ref(false);
|
||||
const provincesFetchDataRef = ref(false);
|
||||
const provincesOptions = ref([]);
|
||||
const townsOptions = ref([]);
|
||||
const town = ref({});
|
||||
const townFilter = ref({});
|
||||
const countryFilter = ref({});
|
||||
|
||||
function onDataSaved(formData) {
|
||||
const newPostcode = {
|
||||
|
@ -39,7 +41,7 @@ function onDataSaved(formData) {
|
|||
({ id }) => id === formData.provinceFk
|
||||
);
|
||||
newPostcode.province = provinceObject?.name;
|
||||
const countryObject = countriesOptions.value.find(
|
||||
const countryObject = countriesRef.value.opts.find(
|
||||
({ id }) => id === formData.countryFk
|
||||
);
|
||||
newPostcode.country = countryObject?.name;
|
||||
|
@ -56,10 +58,19 @@ async function onCityCreated(newTown, formData) {
|
|||
}
|
||||
|
||||
function setTown(newTown, data) {
|
||||
if (!newTown) return;
|
||||
town.value = newTown;
|
||||
data.provinceFk = newTown.provinceFk;
|
||||
data.countryFk = newTown.province.countryFk;
|
||||
data.provinceFk = newTown?.provinceFk ?? newTown;
|
||||
data.countryFk = newTown?.province?.countryFk ?? newTown;
|
||||
}
|
||||
|
||||
async function setCountry(countryFk, data) {
|
||||
data.townFk = null;
|
||||
data.provinceFk = null;
|
||||
data.countryFk = countryFk;
|
||||
}
|
||||
|
||||
async function handleProvinces(data) {
|
||||
provincesOptions.value = data;
|
||||
}
|
||||
|
||||
async function setProvince(id, data) {
|
||||
|
@ -73,61 +84,16 @@ async function onProvinceCreated(data) {
|
|||
await provincesFetchDataRef.value.fetch({
|
||||
where: { countryFk: postcodeFormData.countryFk },
|
||||
});
|
||||
postcodeFormData.provinceFk.value = data.id;
|
||||
postcodeFormData.provinceFk = data.id;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [postcodeFormData.countryFk],
|
||||
async (newCountryFk, oldValueFk) => {
|
||||
if (Array.isArray(newCountryFk)) {
|
||||
newCountryFk = newCountryFk[0];
|
||||
}
|
||||
if (Array.isArray(oldValueFk)) {
|
||||
oldValueFk = oldValueFk[0];
|
||||
}
|
||||
if (!!oldValueFk && newCountryFk !== oldValueFk) {
|
||||
postcodeFormData.provinceFk = null;
|
||||
postcodeFormData.townFk = null;
|
||||
}
|
||||
if (oldValueFk !== newCountryFk) {
|
||||
await provincesFetchDataRef.value.fetch({
|
||||
where: {
|
||||
countryFk: newCountryFk,
|
||||
},
|
||||
});
|
||||
await townsFetchDataRef.value.fetch({
|
||||
where: {
|
||||
const whereTowns = computed(() => {
|
||||
return {
|
||||
provinceFk: {
|
||||
inq: provincesOptions.value.map(({ id }) => id),
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => postcodeFormData.provinceFk,
|
||||
async (newProvinceFk, oldValueFk) => {
|
||||
if (Array.isArray(newProvinceFk)) {
|
||||
newProvinceFk = newProvinceFk[0];
|
||||
}
|
||||
if (newProvinceFk !== oldValueFk) {
|
||||
await townsFetchDataRef.value.fetch({
|
||||
where: { provinceFk: newProvinceFk },
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
async function handleProvinces(data) {
|
||||
provincesOptions.value = data;
|
||||
}
|
||||
async function handleTowns(data) {
|
||||
townsOptions.value = data;
|
||||
}
|
||||
async function handleCountries(data) {
|
||||
countriesOptions.value = data;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -139,14 +105,6 @@ async function handleCountries(data) {
|
|||
auto-load
|
||||
url="Provinces/location"
|
||||
/>
|
||||
<FetchData
|
||||
ref="townsFetchDataRef"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
@on-fetch="handleTowns"
|
||||
auto-load
|
||||
url="Towns/location"
|
||||
/>
|
||||
|
||||
<FormModelPopup
|
||||
url-create="postcodes"
|
||||
|
@ -164,19 +122,26 @@ async function handleCountries(data) {
|
|||
v-model="data.code"
|
||||
:rules="validate('postcode.code')"
|
||||
clearable
|
||||
required
|
||||
/>
|
||||
<VnSelectDialog
|
||||
ref="townsRef"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
auto-load
|
||||
url="Towns/location"
|
||||
:where="whereTowns"
|
||||
:label="t('City')"
|
||||
@update:model-value="(value) => setTown(value, data)"
|
||||
:tooltip="t('Create city')"
|
||||
v-model="data.townFk"
|
||||
:options="townsOptions"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:rules="validate('postcode.city')"
|
||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||
:emit-value="false"
|
||||
:clearable="true"
|
||||
required
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
@ -193,7 +158,6 @@ async function handleCountries(data) {
|
|||
<CreateNewCityForm
|
||||
:country-fk="data.countryFk"
|
||||
:province-selected="data.provinceFk"
|
||||
:provinces="provincesOptions"
|
||||
@on-data-saved="
|
||||
(_, requestResponse) =>
|
||||
onCityCreated(requestResponse, data)
|
||||
|
@ -208,20 +172,25 @@ async function handleCountries(data) {
|
|||
:province-selected="data.provinceFk"
|
||||
@update:model-value="(value) => setProvince(value, data)"
|
||||
v-model="data.provinceFk"
|
||||
:clearable="true"
|
||||
:provinces="provincesOptions"
|
||||
@on-province-fetched="handleProvinces"
|
||||
@on-province-created="onProvinceCreated"
|
||||
required
|
||||
/>
|
||||
<VnSelect
|
||||
url="Countries"
|
||||
ref="countriesRef"
|
||||
:limit="30"
|
||||
:filter="countryFilter"
|
||||
:sort-by="['name ASC']"
|
||||
auto-load
|
||||
url="Countries"
|
||||
required
|
||||
:label="t('Country')"
|
||||
@update:options="handleCountries"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="data.countryFk"
|
||||
:rules="validate('postcode.countryFk')"
|
||||
@update:model-value="(value) => setCountry(value, data)"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
@ -21,34 +20,24 @@ const $props = defineProps({
|
|||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
provinces: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const autonomiesOptions = ref([]);
|
||||
const autonomiesRef = ref([]);
|
||||
|
||||
const onDataSaved = (dataSaved, requestResponse) => {
|
||||
requestResponse.autonomy = autonomiesOptions.value.find(
|
||||
requestResponse.autonomy = autonomiesRef.value.opts.find(
|
||||
(autonomy) => autonomy.id == requestResponse.autonomyFk
|
||||
);
|
||||
emit('onDataSaved', dataSaved, requestResponse);
|
||||
};
|
||||
const where = computed(() => {
|
||||
if (!$props.countryFk) {
|
||||
return {};
|
||||
}
|
||||
return { countryFk: $props.countryFk };
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (autonomiesOptions = data)"
|
||||
auto-load
|
||||
:filter="{
|
||||
where: {
|
||||
countryFk: $props.countryFk,
|
||||
},
|
||||
}"
|
||||
url="Autonomies/location"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
/>
|
||||
<FormModelPopup
|
||||
:title="t('New province')"
|
||||
:subtitle="t('Please, ensure you put the correct data!')"
|
||||
|
@ -63,10 +52,17 @@ const onDataSaved = (dataSaved, requestResponse) => {
|
|||
:label="t('Name')"
|
||||
v-model="data.name"
|
||||
:rules="validate('province.name')"
|
||||
required
|
||||
/>
|
||||
<VnSelect
|
||||
required
|
||||
ref="autonomiesRef"
|
||||
auto-load
|
||||
:where="where"
|
||||
url="Autonomies/location"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
:label="t('Autonomy')"
|
||||
:options="autonomiesOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
|
|
|
@ -10,6 +10,7 @@ import VnPaginate from 'components/ui/VnPaginate.vue';
|
|||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import SkeletonTable from 'components/ui/SkeletonTable.vue';
|
||||
import { tMobile } from 'src/composables/tMobile';
|
||||
import getDifferences from 'src/filters/getDifferences';
|
||||
|
||||
const { push } = useRouter();
|
||||
const quasar = useQuasar();
|
||||
|
@ -94,6 +95,7 @@ defineExpose({
|
|||
saveChanges,
|
||||
getChanges,
|
||||
formData,
|
||||
originalData,
|
||||
vnPaginateRef,
|
||||
});
|
||||
|
||||
|
@ -174,14 +176,13 @@ async function saveChanges(data) {
|
|||
const changes = data || getChanges();
|
||||
try {
|
||||
await axios.post($props.saveUrl || $props.url + '/crud', changes);
|
||||
} catch (e) {
|
||||
return (isLoading.value = false);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
originalData.value = JSON.parse(JSON.stringify(formData.value));
|
||||
if (changes.creates?.length) await vnPaginateRef.value.fetch();
|
||||
|
||||
hasChanges.value = false;
|
||||
isLoading.value = false;
|
||||
emit('saveChanges', data);
|
||||
quasar.notify({
|
||||
type: 'positive',
|
||||
|
@ -267,28 +268,6 @@ function getChanges() {
|
|||
return changes;
|
||||
}
|
||||
|
||||
function getDifferences(obj1, obj2) {
|
||||
let diff = {};
|
||||
delete obj1.$index;
|
||||
delete obj2.$index;
|
||||
|
||||
for (let key in obj1) {
|
||||
if (obj2[key] && JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
for (let key in obj2) {
|
||||
if (
|
||||
obj1[key] === undefined ||
|
||||
JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])
|
||||
) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
function isEmpty(obj) {
|
||||
if (obj == null) return true;
|
||||
if (obj === undefined) return true;
|
||||
|
@ -394,6 +373,7 @@ watch(formUrl, async () => {
|
|||
@click="onSubmit"
|
||||
:disable="!hasChanges"
|
||||
:title="t('globals.save')"
|
||||
data-cy="crudModelDefaultSaveBtn"
|
||||
/>
|
||||
<slot name="moreAfterActions" />
|
||||
</QBtnGroup>
|
||||
|
|
|
@ -156,7 +156,6 @@ const rotateRight = () => {
|
|||
};
|
||||
|
||||
const onSubmit = () => {
|
||||
try {
|
||||
if (!newPhoto.files && !newPhoto.url) {
|
||||
notify(t('Select an image'), 'negative');
|
||||
return;
|
||||
|
@ -173,9 +172,6 @@ const onSubmit = () => {
|
|||
newPhoto.blob = file;
|
||||
})
|
||||
.then(() => makeRequest());
|
||||
} catch (err) {
|
||||
console.error('Error uploading image');
|
||||
}
|
||||
};
|
||||
|
||||
const makeRequest = async () => {
|
||||
|
|
|
@ -51,7 +51,6 @@ const onDataSaved = () => {
|
|||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
const rowsToEdit = $props.rows.map((row) => ({ id: row.id, itemFk: row.itemFk }));
|
||||
const payload = {
|
||||
|
@ -63,9 +62,6 @@ const onSubmit = async () => {
|
|||
await axios.post($props.editUrl, payload);
|
||||
onDataSaved();
|
||||
isLoading.value = false;
|
||||
} catch (err) {
|
||||
console.error('Error submitting table cell edit');
|
||||
}
|
||||
};
|
||||
|
||||
const closeForm = () => {
|
||||
|
|
|
@ -84,7 +84,6 @@ const tableColumns = computed(() => [
|
|||
]);
|
||||
|
||||
const onSubmit = async () => {
|
||||
try {
|
||||
let filter = itemFilter;
|
||||
const params = itemFilterParams;
|
||||
const where = {};
|
||||
|
@ -109,9 +108,6 @@ const onSubmit = async () => {
|
|||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
tableRows.value = data;
|
||||
} catch (err) {
|
||||
console.error('Error fetching entries items');
|
||||
}
|
||||
};
|
||||
|
||||
const closeForm = () => {
|
||||
|
|
|
@ -86,7 +86,6 @@ const tableColumns = computed(() => [
|
|||
]);
|
||||
|
||||
const onSubmit = async () => {
|
||||
try {
|
||||
let filter = travelFilter;
|
||||
const params = travelFilterParams;
|
||||
const where = {};
|
||||
|
@ -109,9 +108,6 @@ const onSubmit = async () => {
|
|||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
tableRows.value = data;
|
||||
} catch (err) {
|
||||
console.error('Error fetching travels');
|
||||
}
|
||||
};
|
||||
|
||||
const closeForm = () => {
|
||||
|
|
|
@ -91,6 +91,10 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
maxWidth: {
|
||||
type: [String, Boolean],
|
||||
default: '800px',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
||||
const modelValue = computed(
|
||||
|
@ -106,6 +110,7 @@ const originalData = ref({});
|
|||
const formData = computed(() => state.get(modelValue));
|
||||
const defaultButtons = computed(() => ({
|
||||
save: {
|
||||
dataCy: 'saveDefaultBtn',
|
||||
color: 'primary',
|
||||
icon: 'save',
|
||||
label: 'globals.save',
|
||||
|
@ -113,6 +118,7 @@ const defaultButtons = computed(() => ({
|
|||
type: 'submit',
|
||||
},
|
||||
reset: {
|
||||
dataCy: 'resetDefaultBtn',
|
||||
color: 'primary',
|
||||
icon: 'restart_alt',
|
||||
label: 'globals.reset',
|
||||
|
@ -203,7 +209,9 @@ async function save() {
|
|||
isLoading.value = true;
|
||||
try {
|
||||
formData.value = trimData(formData.value);
|
||||
const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
|
||||
const body = $props.mapper
|
||||
? $props.mapper(formData.value, originalData.value)
|
||||
: formData.value;
|
||||
const method = $props.urlCreate ? 'post' : 'patch';
|
||||
const url =
|
||||
$props.urlCreate || $props.urlUpdate || $props.url || arrayData.store.url;
|
||||
|
@ -283,6 +291,7 @@ defineExpose({
|
|||
@submit="save"
|
||||
@reset="reset"
|
||||
class="q-pa-md"
|
||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||
id="formModel"
|
||||
>
|
||||
<QCard>
|
||||
|
@ -317,6 +326,7 @@ defineExpose({
|
|||
:title="t(defaultButtons.reset.label)"
|
||||
/>
|
||||
<QBtnDropdown
|
||||
data-cy="saveAndContinueDefaultBtn"
|
||||
v-if="$props.goTo"
|
||||
@click="saveAndGo"
|
||||
:label="tMobile('globals.saveAndContinue')"
|
||||
|
@ -371,7 +381,6 @@ defineExpose({
|
|||
color: black;
|
||||
}
|
||||
#formModel {
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
|||
|
||||
const emit = defineEmits(['onSubmit']);
|
||||
|
||||
defineProps({
|
||||
const $props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
|
@ -25,16 +25,21 @@ defineProps({
|
|||
type: String,
|
||||
default: '',
|
||||
},
|
||||
submitOnEnter: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const closeButton = ref(null);
|
||||
const isLoading = ref(false);
|
||||
|
||||
const onSubmit = () => {
|
||||
if ($props.submitOnEnter) {
|
||||
emit('onSubmit');
|
||||
closeForm();
|
||||
}
|
||||
};
|
||||
|
||||
const closeForm = () => {
|
||||
|
|
|
@ -88,7 +88,6 @@ const applyTags = (params, search) => {
|
|||
};
|
||||
|
||||
const fetchItemTypes = async (id) => {
|
||||
try {
|
||||
const filter = {
|
||||
fields: ['id', 'name', 'categoryFk'],
|
||||
where: { categoryFk: id },
|
||||
|
@ -99,9 +98,6 @@ const fetchItemTypes = async (id) => {
|
|||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
itemTypesOptions.value = data;
|
||||
} catch (err) {
|
||||
console.error('Error fetching item types', err);
|
||||
}
|
||||
};
|
||||
|
||||
const getCategoryClass = (category, params) => {
|
||||
|
@ -111,7 +107,6 @@ const getCategoryClass = (category, params) => {
|
|||
};
|
||||
|
||||
const getSelectedTagValues = async (tag) => {
|
||||
try {
|
||||
if (!tag?.selectedTag?.id) return;
|
||||
tag.value = null;
|
||||
const filter = {
|
||||
|
@ -125,9 +120,6 @@ const getSelectedTagValues = async (tag) => {
|
|||
params,
|
||||
});
|
||||
tag.valueOptions = data;
|
||||
} catch (err) {
|
||||
console.error('Error getting selected tag values');
|
||||
}
|
||||
};
|
||||
|
||||
const removeTag = (index, params, search) => {
|
||||
|
|
|
@ -39,14 +39,10 @@ const refund = async () => {
|
|||
invoiceCorrectionTypeFk: invoiceParams.invoiceCorrectionTypeFk,
|
||||
};
|
||||
|
||||
try {
|
||||
const { data } = await axios.post('InvoiceOuts/refundAndInvoice', params);
|
||||
notify(t('Refunded invoice'), 'positive');
|
||||
const [id] = data?.refundId || [];
|
||||
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
||||
} catch (err) {
|
||||
console.error('Error refunding invoice', err);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ const makeInvoice = async () => {
|
|||
makeInvoice: checked.value,
|
||||
};
|
||||
|
||||
try {
|
||||
if (checked.value && hasToInvoiceByAddress) {
|
||||
const response = await new Promise((resolve) => {
|
||||
quasar
|
||||
|
@ -76,9 +75,6 @@ const makeInvoice = async () => {
|
|||
notify(t('Transferred invoice'), 'positive');
|
||||
const id = data?.[0];
|
||||
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
||||
} catch (err) {
|
||||
console.error('Error transfering invoice', err);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
|
@ -7,7 +7,7 @@ import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
||||
|
||||
const emit = defineEmits(['onProvinceCreated']);
|
||||
const emit = defineEmits(['onProvinceCreated', 'onProvinceFetched']);
|
||||
const $props = defineProps({
|
||||
countryFk: {
|
||||
type: Number,
|
||||
|
@ -17,20 +17,23 @@ const $props = defineProps({
|
|||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
provinces: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const provinceFk = defineModel({ type: Number, default: null });
|
||||
|
||||
const { validate } = useValidator();
|
||||
const { t } = useI18n();
|
||||
|
||||
const filter = ref({
|
||||
include: { relation: 'country' },
|
||||
where: {
|
||||
countryFk: $props.countryFk,
|
||||
},
|
||||
});
|
||||
const provincesOptions = ref($props.provinces);
|
||||
provinceFk.value = $props.provinceSelected;
|
||||
const provincesFetchDataRef = ref();
|
||||
|
||||
provinceFk.value = $props.provinceSelected;
|
||||
if (!$props.countryFk) {
|
||||
filter.value.where = {};
|
||||
}
|
||||
async function onProvinceCreated(_, data) {
|
||||
await provincesFetchDataRef.value.fetch({ where: { countryFk: $props.countryFk } });
|
||||
provinceFk.value = data.id;
|
||||
|
@ -39,25 +42,33 @@ async function onProvinceCreated(_, data) {
|
|||
async function handleProvinces(data) {
|
||||
provincesOptions.value = data;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => $props.countryFk,
|
||||
async () => {
|
||||
if ($props.countryFk) {
|
||||
filter.value.where.countryFk = $props.countryFk;
|
||||
} else filter.value.where = {};
|
||||
await provincesFetchDataRef.value.fetch({});
|
||||
emit('onProvinceFetched', provincesOptions.value);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
ref="provincesFetchDataRef"
|
||||
:filter="{
|
||||
include: { relation: 'country' },
|
||||
where: {
|
||||
countryFk: $props.countryFk,
|
||||
},
|
||||
}"
|
||||
:filter="filter"
|
||||
@on-fetch="handleProvinces"
|
||||
url="Provinces"
|
||||
auto-load
|
||||
/>
|
||||
<VnSelectDialog
|
||||
:label="t('Province')"
|
||||
:options="$props.provinces"
|
||||
:options="provincesOptions"
|
||||
:tooltip="t('Create province')"
|
||||
hide-selected
|
||||
:clearable="true"
|
||||
v-model="provinceFk"
|
||||
:rules="validate && validate('postcode.provinceFk')"
|
||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||
|
|
|
@ -394,7 +394,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
:name="col.orderBy ?? col.name"
|
||||
:data-key="$attrs['data-key']"
|
||||
:search-url="searchUrl"
|
||||
:vertical="true"
|
||||
:vertical="false"
|
||||
/>
|
||||
</div>
|
||||
<slot
|
||||
|
@ -737,6 +737,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
data-cy="vnTableCreateBtn"
|
||||
/>
|
||||
<QTooltip self="top right">
|
||||
{{ createForm?.title }}
|
||||
|
|
|
@ -58,7 +58,6 @@ const getConfig = async (url, filter) => {
|
|||
};
|
||||
|
||||
const fetchViewConfigData = async () => {
|
||||
try {
|
||||
const userConfigFilter = {
|
||||
where: { tableCode: $props.tableCode, userFk: user.value.id },
|
||||
};
|
||||
|
@ -83,13 +82,9 @@ const fetchViewConfigData = async () => {
|
|||
$props.allColumns.forEach((col) => (defaultColumns[col] = true));
|
||||
setUserConfigViewData(defaultColumns);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error fetching config view data', err);
|
||||
}
|
||||
};
|
||||
|
||||
const saveConfig = async () => {
|
||||
try {
|
||||
const params = {};
|
||||
const configuration = {};
|
||||
|
||||
|
@ -128,9 +123,6 @@ const saveConfig = async () => {
|
|||
emitSavedConfig();
|
||||
notify('globals.dataSaved', 'positive');
|
||||
popupProxyRef.value.hide();
|
||||
} catch (err) {
|
||||
console.error('Error saving user view config', err);
|
||||
}
|
||||
};
|
||||
|
||||
const emitSavedConfig = () => {
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { QInput } from 'quasar';
|
||||
|
||||
const props = defineProps({
|
||||
const $props = defineProps({
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
insertable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
||||
|
||||
let internalValue = ref(props.modelValue);
|
||||
let internalValue = ref($props.modelValue);
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
() => $props.modelValue,
|
||||
(newVal) => {
|
||||
internalValue.value = newVal;
|
||||
}
|
||||
|
@ -28,8 +32,46 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
const handleKeydown = (e) => {
|
||||
if (e.key === 'Backspace') return;
|
||||
if (e.key === '.') {
|
||||
accountShortToStandard();
|
||||
// TODO: Fix this setTimeout, with nextTick doesn't work
|
||||
setTimeout(() => {
|
||||
setCursorPosition(0, e.target);
|
||||
}, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($props.insertable && e.key.match(/[0-9]/)) {
|
||||
handleInsertMode(e);
|
||||
}
|
||||
};
|
||||
function setCursorPosition(pos, el = vnInputRef.value) {
|
||||
el.focus();
|
||||
el.setSelectionRange(pos, pos);
|
||||
}
|
||||
const vnInputRef = ref(false);
|
||||
const handleInsertMode = (e) => {
|
||||
e.preventDefault();
|
||||
const input = e.target;
|
||||
const cursorPos = input.selectionStart;
|
||||
const { maxlength } = vnInputRef.value;
|
||||
let currentValue = internalValue.value;
|
||||
if (!currentValue) currentValue = e.key;
|
||||
const newValue = e.key;
|
||||
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
|
||||
internalValue.value =
|
||||
currentValue.substring(0, cursorPos) +
|
||||
newValue +
|
||||
currentValue.substring(cursorPos + 1);
|
||||
}
|
||||
nextTick(() => {
|
||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||
});
|
||||
};
|
||||
function accountShortToStandard() {
|
||||
internalValue.value = internalValue.value.replace(
|
||||
internalValue.value = internalValue.value?.replace(
|
||||
'.',
|
||||
'0'.repeat(11 - internalValue.value.length)
|
||||
);
|
||||
|
@ -37,5 +79,5 @@ function accountShortToStandard() {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<q-input v-model="internalValue" />
|
||||
<QInput @keydown="handleKeydown" ref="vnInputRef" v-model="internalValue" />
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, ref, useAttrs } from 'vue';
|
||||
import { computed, ref, useAttrs, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRequired } from 'src/composables/useRequired';
|
||||
|
||||
|
@ -34,6 +34,14 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
insertable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
maxlength: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const vnInputRef = ref(null);
|
||||
|
@ -69,6 +77,9 @@ const mixinRules = [
|
|||
requiredFieldRule,
|
||||
...($attrs.rules ?? []),
|
||||
(val) => {
|
||||
const { maxlength } = vnInputRef.value;
|
||||
if (maxlength && +val.length > maxlength)
|
||||
return t(`maxLength`, { value: maxlength });
|
||||
const { min, max } = vnInputRef.value.$attrs;
|
||||
if (!min) return null;
|
||||
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
|
||||
|
@ -78,6 +89,33 @@ const mixinRules = [
|
|||
}
|
||||
},
|
||||
];
|
||||
|
||||
const handleKeydown = (e) => {
|
||||
if (e.key === 'Backspace') return;
|
||||
|
||||
if ($props.insertable && e.key.match(/[0-9]/)) {
|
||||
handleInsertMode(e);
|
||||
}
|
||||
};
|
||||
|
||||
const handleInsertMode = (e) => {
|
||||
e.preventDefault();
|
||||
const input = e.target;
|
||||
const cursorPos = input.selectionStart;
|
||||
const { maxlength } = vnInputRef.value;
|
||||
let currentValue = value.value;
|
||||
if (!currentValue) currentValue = e.key;
|
||||
const newValue = e.key;
|
||||
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
|
||||
value.value =
|
||||
currentValue.substring(0, cursorPos) +
|
||||
newValue +
|
||||
currentValue.substring(cursorPos + 1);
|
||||
}
|
||||
nextTick(() => {
|
||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -89,10 +127,12 @@ const mixinRules = [
|
|||
:type="$attrs.type"
|
||||
:class="{ required: isRequired }"
|
||||
@keyup.enter="emit('keyup.enter')"
|
||||
@keydown="handleKeydown"
|
||||
:clearable="false"
|
||||
:rules="mixinRules"
|
||||
:lazy-rules="true"
|
||||
hide-bottom-space
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
||||
>
|
||||
<template v-if="$slots.prepend" #prepend>
|
||||
<slot name="prepend" />
|
||||
|
@ -101,7 +141,13 @@ const mixinRules = [
|
|||
<QIcon
|
||||
name="close"
|
||||
size="xs"
|
||||
v-if="hover && value && !$attrs.disabled && $props.clearable"
|
||||
v-if="
|
||||
hover &&
|
||||
value &&
|
||||
!$attrs.disabled &&
|
||||
!$attrs.readonly &&
|
||||
$props.clearable
|
||||
"
|
||||
@click="
|
||||
() => {
|
||||
value = null;
|
||||
|
@ -123,9 +169,11 @@ const mixinRules = [
|
|||
<i18n>
|
||||
en:
|
||||
inputMin: Must be more than {value}
|
||||
maxLength: The value exceeds {value} characters
|
||||
inputMax: Must be less than {value}
|
||||
es:
|
||||
inputMin: Debe ser mayor a {value}
|
||||
maxLength: El valor excede los {value} carácteres
|
||||
inputMax: Debe ser menor a {value}
|
||||
</i18n>
|
||||
<style lang="scss">
|
||||
|
|
|
@ -138,8 +138,6 @@ onMounted(() => {
|
|||
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
||||
});
|
||||
|
||||
defineExpose({ opts: myOptions });
|
||||
|
||||
const arrayDataKey =
|
||||
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
||||
|
||||
|
@ -259,6 +257,30 @@ async function onScroll({ to, direction, from, index }) {
|
|||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ opts: myOptions });
|
||||
|
||||
function handleKeyDown(event) {
|
||||
if (event.key === 'Tab') {
|
||||
event.preventDefault();
|
||||
|
||||
const inputValue = vnSelectRef.value?.inputValue;
|
||||
|
||||
if (inputValue) {
|
||||
const matchingOption = myOptions.value.find(
|
||||
(option) =>
|
||||
option[optionLabel.value].toLowerCase() === inputValue.toLowerCase()
|
||||
);
|
||||
|
||||
if (matchingOption) {
|
||||
emit('update:modelValue', matchingOption[optionValue.value]);
|
||||
} else {
|
||||
emit('update:modelValue', inputValue);
|
||||
}
|
||||
vnSelectRef.value?.hidePopup();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -269,6 +291,7 @@ async function onScroll({ to, direction, from, index }) {
|
|||
:option-value="optionValue"
|
||||
v-bind="$attrs"
|
||||
@filter="filterHandler"
|
||||
@keydown="handleKeyDown"
|
||||
:emit-value="nullishToTrue($attrs['emit-value'])"
|
||||
:map-options="nullishToTrue($attrs['map-options'])"
|
||||
:use-input="nullishToTrue($attrs['use-input'])"
|
||||
|
@ -283,10 +306,11 @@ async function onScroll({ to, direction, from, index }) {
|
|||
:input-debounce="useURL ? '300' : '0'"
|
||||
:loading="isLoading"
|
||||
@virtual-scroll="onScroll"
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||
>
|
||||
<template v-if="isClearable" #append>
|
||||
<template #append>
|
||||
<QIcon
|
||||
v-show="value"
|
||||
v-show="isClearable && value"
|
||||
name="close"
|
||||
@click.stop="
|
||||
() => {
|
||||
|
@ -299,7 +323,22 @@ async function onScroll({ to, direction, from, index }) {
|
|||
/>
|
||||
</template>
|
||||
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
<div v-if="slotName == 'append'">
|
||||
<QIcon
|
||||
v-show="isClearable && value"
|
||||
name="close"
|
||||
@click.stop="
|
||||
() => {
|
||||
value = null;
|
||||
emit('remove');
|
||||
}
|
||||
"
|
||||
class="cursor-pointer"
|
||||
size="xs"
|
||||
/>
|
||||
<slot name="append" v-if="$slots.append" v-bind="slotData ?? {}" />
|
||||
</div>
|
||||
<slot v-else :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
</QSelect>
|
||||
</template>
|
||||
|
|
|
@ -86,7 +86,7 @@ async function send() {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<QDialog ref="dialogRef">
|
||||
<QDialog ref="dialogRef" data-cy="vnSmsDialog">
|
||||
<QCard class="q-pa-sm">
|
||||
<QCardSection class="row items-center q-pb-none">
|
||||
<span class="text-h6 text-grey">
|
||||
|
@ -161,6 +161,7 @@ async function send() {
|
|||
:loading="isLoading"
|
||||
color="primary"
|
||||
unelevated
|
||||
data-cy="sendSmsBtn"
|
||||
/>
|
||||
</QCardActions>
|
||||
</QCard>
|
||||
|
|
|
@ -74,6 +74,9 @@ const arrayData = useArrayData($props.dataKey, {
|
|||
const route = useRoute();
|
||||
const store = arrayData.store;
|
||||
const userParams = ref({});
|
||||
|
||||
defineExpose({ search, sanitizer, params: userParams });
|
||||
|
||||
onMounted(() => {
|
||||
userParams.value = $props.modelValue ?? {};
|
||||
emit('init', { params: userParams.value });
|
||||
|
@ -197,7 +200,7 @@ const customTags = computed(() =>
|
|||
|
||||
async function remove(key) {
|
||||
userParams.value[key] = undefined;
|
||||
search();
|
||||
await search();
|
||||
emit('remove', key);
|
||||
emit('update:modelValue', userParams.value);
|
||||
}
|
||||
|
@ -223,8 +226,6 @@ function sanitizer(params) {
|
|||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
defineExpose({ search, sanitizer, userParams });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -272,6 +273,7 @@ defineExpose({ search, sanitizer, userParams });
|
|||
:key="chip.label"
|
||||
:removable="!unremovableParams?.includes(chip.label)"
|
||||
@remove="remove(chip.label)"
|
||||
data-cy="vnFilterPanelChip"
|
||||
>
|
||||
<slot name="tags" :tag="chip" :format-fn="formatValue">
|
||||
<div class="q-gutter-x-xs">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { reactive, useAttrs, onBeforeMount, capitalize } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { parsePhone } from 'src/filters';
|
||||
const props = defineProps({
|
||||
phoneNumber: { type: [String, Number], default: null },
|
||||
channel: { type: Number, default: null },
|
||||
|
@ -24,9 +25,9 @@ onBeforeMount(async () => {
|
|||
.data;
|
||||
if (!channel) channel = defaultChannel;
|
||||
|
||||
config[
|
||||
type
|
||||
].href = `${url}?customerIdentity=%2B${props.phoneNumber}&channelId=${channel}`;
|
||||
config[type].href = `${url}?customerIdentity=%2B${parsePhone(
|
||||
props.phoneNumber
|
||||
)}&channelId=${channel}`;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -101,6 +101,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
@click="insert"
|
||||
class="q-mb-xs"
|
||||
dense
|
||||
data-cy="saveNote"
|
||||
/>
|
||||
</template>
|
||||
</VnInput>
|
||||
|
|
|
@ -132,10 +132,24 @@ const addFilter = async (filter, params) => {
|
|||
|
||||
async function fetch(params) {
|
||||
useArrayData(props.dataKey, params);
|
||||
arrayData.reset(['filter.skip', 'skip']);
|
||||
await arrayData.fetch({ append: false });
|
||||
if (!store.hasMoreData) isLoading.value = false;
|
||||
arrayData.reset(['filter.skip', 'skip', 'page']);
|
||||
await arrayData.fetch({ append: false, updateRouter: mounted.value });
|
||||
return emitStoreData();
|
||||
}
|
||||
|
||||
async function update(params) {
|
||||
useArrayData(props.dataKey, params);
|
||||
const { limit, skip } = store;
|
||||
store.limit = limit + skip;
|
||||
store.skip = 0;
|
||||
await arrayData.fetch({ append: false });
|
||||
store.limit = limit;
|
||||
store.skip = skip;
|
||||
return emitStoreData();
|
||||
}
|
||||
|
||||
function emitStoreData() {
|
||||
if (!store.hasMoreData) isLoading.value = false;
|
||||
emit('onFetch', store.data);
|
||||
return store.data;
|
||||
}
|
||||
|
@ -181,7 +195,7 @@ async function onLoad(index, done) {
|
|||
done(isDone);
|
||||
}
|
||||
|
||||
defineExpose({ fetch, addFilter, paginate });
|
||||
defineExpose({ fetch, update, addFilter, paginate });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -130,6 +130,7 @@ async function search() {
|
|||
dense
|
||||
standout
|
||||
autofocus
|
||||
data-cy="vnSearchBar"
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<script setup>
|
||||
import { useRoute } from 'vue-router';
|
||||
import { defineProps } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
routeName: {
|
||||
|
|
|
@ -1,11 +1,24 @@
|
|||
import { useSession } from 'src/composables/useSession';
|
||||
import { getUrl } from './getUrl';
|
||||
import axios from 'axios';
|
||||
import { exportFile } from 'quasar';
|
||||
|
||||
const { getTokenMultimedia } = useSession();
|
||||
const token = getTokenMultimedia();
|
||||
|
||||
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
||||
let appUrl = await getUrl('', 'lilium');
|
||||
appUrl = appUrl.replace('/#/', '');
|
||||
window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
|
||||
const appUrl = (await getUrl('', 'lilium')).replace('/#/', '');
|
||||
const response = await axios.get(
|
||||
url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`,
|
||||
{ responseType: 'blob' }
|
||||
);
|
||||
|
||||
const contentDisposition = response.headers['content-disposition'];
|
||||
const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(contentDisposition);
|
||||
const filename =
|
||||
matches != null && matches[1]
|
||||
? matches[1].replace(/['"]/g, '')
|
||||
: 'downloaded-file';
|
||||
|
||||
exportFile(filename, response.data);
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
const params = { filter };
|
||||
|
||||
Object.assign(params, userParams);
|
||||
params.filter.skip = store.skip;
|
||||
if (params.filter) params.filter.skip = store.skip;
|
||||
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
||||
if (store.order?.length) params.filter.order = [...store.order];
|
||||
else delete params.filter.order;
|
||||
|
|
|
@ -241,7 +241,7 @@ input::-webkit-inner-spin-button {
|
|||
th,
|
||||
td {
|
||||
padding: 1px 10px 1px 10px;
|
||||
max-width: 100px;
|
||||
max-width: 130px;
|
||||
div span {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
export default function getDifferences(obj1, obj2) {
|
||||
let diff = {};
|
||||
delete obj1.$index;
|
||||
delete obj2.$index;
|
||||
|
||||
for (let key in obj1) {
|
||||
if (obj2[key] && JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
for (let key in obj2) {
|
||||
if (
|
||||
obj1[key] === undefined ||
|
||||
JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])
|
||||
) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
export default function getUpdatedValues(keys, formData) {
|
||||
return keys.reduce((acc, key) => {
|
||||
acc[key] = formData[key];
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
|
@ -11,11 +11,17 @@ import dashIfEmpty from './dashIfEmpty';
|
|||
import dateRange from './dateRange';
|
||||
import toHour from './toHour';
|
||||
import dashOrCurrency from './dashOrCurrency';
|
||||
import getDifferences from './getDifferences';
|
||||
import getUpdatedValues from './getUpdatedValues';
|
||||
import getParamWhere from './getParamWhere';
|
||||
import parsePhone from './parsePhone';
|
||||
import isDialogOpened from './isDialogOpened';
|
||||
|
||||
export {
|
||||
getUpdatedValues,
|
||||
getDifferences,
|
||||
isDialogOpened,
|
||||
parsePhone,
|
||||
toLowerCase,
|
||||
toLowerCamel,
|
||||
toDate,
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
export default function (phone, prefix = 34) {
|
||||
if (phone.startsWith('+')) {
|
||||
return `${phone.slice(1)}`;
|
||||
}
|
||||
if (phone.startsWith('00')) {
|
||||
return `${phone.slice(2)}`;
|
||||
}
|
||||
if (phone.startsWith(prefix) && phone.length === prefix.length + 9) {
|
||||
return `${prefix}${phone.slice(prefix.length)}`;
|
||||
}
|
||||
return `${prefix}${phone}`;
|
||||
}
|
|
@ -60,7 +60,7 @@ globals:
|
|||
reference: Reference
|
||||
agency: Agency
|
||||
warehouseOut: Warehouse Out
|
||||
wareHouseIn: Warehouse In
|
||||
warehouseIn: Warehouse In
|
||||
landed: Landed
|
||||
shipped: Shipped
|
||||
totalEntries: Total entries
|
||||
|
@ -298,6 +298,7 @@ globals:
|
|||
clientsActionsMonitor: Clients and actions
|
||||
serial: Serial
|
||||
medical: Mutual
|
||||
pit: IRPF
|
||||
RouteExtendedList: Router
|
||||
wasteRecalc: Waste recaclulate
|
||||
operator: Operator
|
||||
|
@ -767,7 +768,8 @@ travel:
|
|||
thermographs: Thermographs
|
||||
hb: HB
|
||||
basicData:
|
||||
daysInForward: Days in forward
|
||||
daysInForward: Automatic movement (Raid)
|
||||
isRaid: Raid
|
||||
thermographs:
|
||||
temperature: Temperature
|
||||
destination: Destination
|
||||
|
|
|
@ -303,6 +303,7 @@ globals:
|
|||
clientsActionsMonitor: Clientes y acciones
|
||||
serial: Facturas por serie
|
||||
medical: Mutua
|
||||
pit: IRPF
|
||||
wasteRecalc: Recalcular mermas
|
||||
operator: Operario
|
||||
parking: Parking
|
||||
|
@ -761,7 +762,8 @@ travel:
|
|||
thermographs: Termógrafos
|
||||
hb: HB
|
||||
basicData:
|
||||
daysInForward: Días redada
|
||||
daysInForward: Desplazamiento automatico (redada)
|
||||
isRaid: Redada
|
||||
thermographs:
|
||||
temperature: Temperatura
|
||||
destination: Destino
|
||||
|
|
|
@ -11,21 +11,13 @@ const { t } = useI18n();
|
|||
const { notify } = useNotify();
|
||||
|
||||
const onSynchronizeAll = async () => {
|
||||
try {
|
||||
notify(t('Synchronizing in the background'), 'positive');
|
||||
await axios.patch(`Accounts/syncAll`);
|
||||
} catch (error) {
|
||||
console.error('Error synchronizing all accounts', error);
|
||||
}
|
||||
};
|
||||
|
||||
const onSynchronizeRoles = async () => {
|
||||
try {
|
||||
await axios.patch(`RoleInherits/sync`);
|
||||
notify(t('Roles synchronized!'), 'positive');
|
||||
} catch (error) {
|
||||
console.error('Error synchronizing roles', error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ const columns = computed(() => [
|
|||
},
|
||||
]);
|
||||
const deleteAcl = async ({ id }) => {
|
||||
try {
|
||||
await new Promise((resolve) => {
|
||||
quasar
|
||||
.dialog({
|
||||
|
@ -131,9 +130,6 @@ const deleteAcl = async ({ id }) => {
|
|||
await axios.delete(`ACLs/${id}`);
|
||||
tableRef.value.reload();
|
||||
notify('ACL removed', 'positive');
|
||||
} catch (error) {
|
||||
console.error('Error deleting Acl: ', error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -34,13 +34,9 @@ const refresh = () => paginateRef.value.fetch();
|
|||
const navigate = (id) => router.push({ name: 'AccountSummary', params: { id } });
|
||||
|
||||
const killSession = async ({ userId, created }) => {
|
||||
try {
|
||||
await axios.post(`${urlPath}/killSession`, { userId, created });
|
||||
paginateRef.value.fetch();
|
||||
notify(t('Session killed'), 'positive');
|
||||
} catch (error) {
|
||||
console.error('Error killing session', error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -40,12 +40,8 @@ const formUrlCreate = ref(null);
|
|||
const formUrlUpdate = ref(null);
|
||||
const formCustomFn = ref(null);
|
||||
const onTestConection = async () => {
|
||||
try {
|
||||
await axios.get(`LdapConfigs/test`);
|
||||
notify(t('LDAP connection established!'), 'positive');
|
||||
} catch (error) {
|
||||
console.error('Error testing connection', error);
|
||||
}
|
||||
};
|
||||
const getInitialLdapConfig = async () => {
|
||||
try {
|
||||
|
@ -72,14 +68,10 @@ const getInitialLdapConfig = async () => {
|
|||
}
|
||||
};
|
||||
const deleteMailForward = async () => {
|
||||
try {
|
||||
await axios.delete(URL_UPDATE);
|
||||
initialData.value = { ...DEFAULT_DATA };
|
||||
hasData.value = false;
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error deleting mail forward', err);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => await getInitialLdapConfig());
|
||||
|
|
|
@ -46,12 +46,8 @@ const formUrlUpdate = ref(null);
|
|||
const formCustomFn = ref(null);
|
||||
|
||||
const onTestConection = async () => {
|
||||
try {
|
||||
await axios.get(`SambaConfigs/test`);
|
||||
notify(t('Samba connection established!'), 'positive');
|
||||
} catch (error) {
|
||||
console.error('Error testing connection', error);
|
||||
}
|
||||
};
|
||||
|
||||
const getInitialSambaConfig = async () => {
|
||||
|
@ -79,14 +75,10 @@ const getInitialSambaConfig = async () => {
|
|||
};
|
||||
|
||||
const deleteMailForward = async () => {
|
||||
try {
|
||||
await axios.delete(URL_UPDATE);
|
||||
initialData.value = { ...DEFAULT_DATA };
|
||||
hasData.value = false;
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error deleting mail forward', err);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => await getInitialSambaConfig());
|
||||
|
|
|
@ -44,13 +44,9 @@ const removeAlias = () => {
|
|||
cancel: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
try {
|
||||
await axios.delete(`MailAliases/${entityId.value}`);
|
||||
notify(t('Alias removed'), 'positive');
|
||||
router.push({ name: 'AccountAlias' });
|
||||
} catch (err) {
|
||||
console.error('Error removing alias');
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -44,32 +44,23 @@ const fetchMailForwards = async () => {
|
|||
try {
|
||||
const response = await axios.get(`MailForwards/${route.params.id}`);
|
||||
return response.data;
|
||||
} catch (err) {
|
||||
console.error('Error fetching mail forwards', err);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const deleteMailForward = async () => {
|
||||
try {
|
||||
await axios.delete(`MailForwards/${route.params.id}`);
|
||||
formData.value.forwardTo = null;
|
||||
initialData.value.forwardTo = null;
|
||||
initialData.value.hasData = hasData.value;
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error deleting mail forward', err);
|
||||
}
|
||||
};
|
||||
|
||||
const updateMailForward = async () => {
|
||||
try {
|
||||
await axios.patch('MailForwards', formData.value);
|
||||
initialData.value = { ...formData.value };
|
||||
initialData.value.hasData = hasData.value;
|
||||
} catch (err) {
|
||||
console.error('Error creating mail forward', err);
|
||||
}
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
|
|
|
@ -32,12 +32,8 @@ const filter = {
|
|||
where: { id: entityId },
|
||||
};
|
||||
const removeRole = async () => {
|
||||
try {
|
||||
await axios.delete(`VnRoles/${entityId.value}`);
|
||||
notify(t('Role removed'), 'positive');
|
||||
} catch (error) {
|
||||
console.error('Error deleting role', error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ async function remove() {
|
|||
</QMenu>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QItem @click="confirmRemove()" v-ripple clickable>
|
||||
<QItem @click="confirmRemove()" v-ripple clickable data-cy="deleteClaim">
|
||||
<QItemSection avatar>
|
||||
<QIcon name="delete" />
|
||||
</QItemSection>
|
||||
|
|
|
@ -130,7 +130,7 @@ function cancel() {
|
|||
<template #body-cell-description="{ row, value }">
|
||||
<QTd auto-width align="right" class="link">
|
||||
{{ value }}
|
||||
<ItemDescriptorProxy :id="row.itemFk"></ItemDescriptorProxy>
|
||||
<ItemDescriptorProxy :id="row.itemFk" />
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
|
|
|
@ -25,7 +25,7 @@ const claimFilter = computed(() => {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname'],
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -95,6 +95,7 @@ const columns = computed(() => [
|
|||
optionLabel: 'description',
|
||||
},
|
||||
},
|
||||
orderBy: 'priority',
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { onBeforeMount, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
|
@ -52,7 +53,6 @@ const addressFilter = {
|
|||
|
||||
onBeforeMount(() => {
|
||||
const { id } = route.params;
|
||||
getAddressesData(id);
|
||||
getClientData(id);
|
||||
});
|
||||
|
||||
|
@ -60,23 +60,10 @@ watch(
|
|||
() => route.params.id,
|
||||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
getAddressesData(newValue);
|
||||
getClientData(newValue);
|
||||
}
|
||||
);
|
||||
|
||||
const getAddressesData = async (id) => {
|
||||
try {
|
||||
const { data } = await axios.get(`Clients/${id}/addresses`, {
|
||||
params: { filter: JSON.stringify(addressFilter) },
|
||||
});
|
||||
addresses.value = data;
|
||||
sortAddresses();
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
};
|
||||
|
||||
const getClientData = async (id) => {
|
||||
try {
|
||||
const { data } = await axios.get(`Clients/${id}`);
|
||||
|
@ -101,9 +88,9 @@ const setDefault = (address) => {
|
|||
});
|
||||
};
|
||||
|
||||
const sortAddresses = () => {
|
||||
if (!client.value || !addresses.value) return;
|
||||
addresses.value = addresses.value.sort((a, b) => {
|
||||
const sortAddresses = (data) => {
|
||||
if (!client.value || !data) return;
|
||||
addresses.value = data.sort((a, b) => {
|
||||
return isDefaultAddress(b) - isDefaultAddress(a);
|
||||
});
|
||||
};
|
||||
|
@ -124,8 +111,17 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
@on-fetch="sortAddresses"
|
||||
auto-load
|
||||
data-key="CustomerAddresses"
|
||||
order="id DESC"
|
||||
ref="vnPaginateRef"
|
||||
:filter="addressFilter"
|
||||
:url="`Clients/${route.params.id}/addresses`"
|
||||
/>
|
||||
<div class="full-width flex justify-center">
|
||||
<QCard class="card-width q-pa-lg" v-if="addresses.length">
|
||||
<QCard class="card-width q-pa-lg">
|
||||
<QCardSection>
|
||||
<div
|
||||
v-for="(item, index) in addresses"
|
||||
|
@ -167,7 +163,7 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
<div>{{ item.street }}</div>
|
||||
<div>
|
||||
{{ item.postalCode }} - {{ item.city }},
|
||||
{{ item.province.name }}
|
||||
{{ item.province?.name }}
|
||||
</div>
|
||||
<div>
|
||||
{{ item.phone }}
|
||||
|
|
|
@ -256,10 +256,10 @@ const showBalancePdf = ({ id }) => {
|
|||
{{ toCurrency(balances[rowIndex]?.balance) }}
|
||||
</template>
|
||||
<template #column-description="{ row }">
|
||||
<div class="link" v-if="row.isInvoice">
|
||||
<span class="link" v-if="row.isInvoice" @click.stop>
|
||||
{{ t('bill', { ref: row.description }) }}
|
||||
<InvoiceOutDescriptorProxy :id="row.description" />
|
||||
</div>
|
||||
<InvoiceOutDescriptorProxy :id="row.id" />
|
||||
</span>
|
||||
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
|
||||
{{ row.description }}
|
||||
</span>
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -30,6 +31,13 @@ const exprBuilder = (param, value) => {
|
|||
and: [{ active: { neq: false } }, handleSalesModelValue(value)],
|
||||
};
|
||||
};
|
||||
|
||||
function onBeforeSave(formData, originalData) {
|
||||
return getUpdatedValues(
|
||||
Object.keys(getDifferences(formData, originalData)),
|
||||
formData
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -43,7 +51,12 @@ const exprBuilder = (param, value) => {
|
|||
@on-fetch="(data) => (businessTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FormModel :url="`Clients/${route.params.id}`" auto-load model="customer">
|
||||
<FormModel
|
||||
:url="`Clients/${route.params.id}`"
|
||||
auto-load
|
||||
model="customer"
|
||||
:mapper="onBeforeSave"
|
||||
>
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnInput
|
||||
|
@ -94,6 +107,7 @@ const exprBuilder = (param, value) => {
|
|||
:rules="validate('client.phone')"
|
||||
clearable
|
||||
v-model="data.phone"
|
||||
data-cy="customerPhone"
|
||||
/>
|
||||
<VnInput
|
||||
:label="t('customer.summary.mobile')"
|
||||
|
|
|
@ -28,12 +28,7 @@ const getBankEntities = (data, formData) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FormModel
|
||||
:url-update="`Clients/${route.params.id}`"
|
||||
:url="`Clients/${route.params.id}/getCard`"
|
||||
auto-load
|
||||
model="customer"
|
||||
>
|
||||
<FormModel :url-update="`Clients/${route.params.id}`" auto-load model="customer">
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
|
|
|
@ -93,22 +93,6 @@ const columns = computed(() => [
|
|||
<WorkerDescriptorProxy :id="row.worker.id" />
|
||||
</template>
|
||||
</VnTable>
|
||||
<!-- <QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:rows="rows"
|
||||
hide-bottom
|
||||
row-key="id"
|
||||
v-model:selected="selected"
|
||||
class="card-width q-px-lg"
|
||||
>
|
||||
<template #body-cell-employee="{ row }">
|
||||
<QTd @click.stop>
|
||||
<span class="link">{{ row.worker.user.nickname }}</span>
|
||||
<WorkerDescriptorProxy :id="row.clientFk" />
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable> -->
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -36,7 +36,10 @@ const entityId = computed(() => {
|
|||
});
|
||||
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => (data.value = useCardDescription(entity?.name, entity?.id));
|
||||
const setData = (entity) => {
|
||||
data.value = useCardDescription(entity?.name, entity?.id);
|
||||
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
|
||||
};
|
||||
const debtWarning = computed(() => {
|
||||
return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';
|
||||
});
|
||||
|
|
|
@ -34,7 +34,6 @@ function handleLocation(data, location) {
|
|||
/>
|
||||
<FormModel
|
||||
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
||||
:url="`Clients/${route.params.id}/getCard`"
|
||||
auto-load
|
||||
model="customer"
|
||||
>
|
||||
|
|
|
@ -1,164 +1,82 @@
|
|||
<script setup>
|
||||
import { computed, onBeforeMount, ref, watch, nextTick } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import axios from 'axios';
|
||||
import useNotify from 'src/composables/useNotify';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
const formModelRef = ref(false);
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const { notify } = useNotify();
|
||||
const stateStore = useStateStore();
|
||||
|
||||
const amountInputRef = ref(null);
|
||||
const initialDated = Date.vnNew();
|
||||
const unpaidClient = ref(false);
|
||||
const isLoading = ref(false);
|
||||
const amount = ref(null);
|
||||
const dated = ref(initialDated);
|
||||
|
||||
const initialData = ref({
|
||||
dated: initialDated,
|
||||
dated: Date.vnNew(),
|
||||
amount: null,
|
||||
});
|
||||
|
||||
const hasChanged = computed(() => {
|
||||
return (
|
||||
initialData.value.dated !== dated.value ||
|
||||
initialData.value.amount !== amount.value
|
||||
);
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
getData(route.params.id);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
getData(newValue);
|
||||
}
|
||||
);
|
||||
|
||||
const getData = async (id) => {
|
||||
const filter = { where: { clientFk: id } };
|
||||
try {
|
||||
const { data } = await axios.get('ClientUnpaids', {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
if (data.length) {
|
||||
setValues(data[0]);
|
||||
} else {
|
||||
defaultValues();
|
||||
}
|
||||
} catch (error) {
|
||||
defaultValues();
|
||||
}
|
||||
};
|
||||
|
||||
const setValues = (data) => {
|
||||
unpaidClient.value = true;
|
||||
amount.value = data.amount;
|
||||
dated.value = data.dated;
|
||||
initialData.value = data;
|
||||
};
|
||||
|
||||
const defaultValues = () => {
|
||||
unpaidClient.value = false;
|
||||
initialData.value.amount = null;
|
||||
setInitialData();
|
||||
};
|
||||
|
||||
const setInitialData = () => {
|
||||
amount.value = initialData.value.amount;
|
||||
dated.value = initialData.value.dated;
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
isLoading.value = true;
|
||||
|
||||
const payload = {
|
||||
amount: amount.value,
|
||||
const filterClientFindOne = {
|
||||
fields: ['unpaid', 'dated', 'amount'],
|
||||
where: {
|
||||
clientFk: route.params.id,
|
||||
dated: dated.value,
|
||||
},
|
||||
};
|
||||
try {
|
||||
await axios.patch('ClientUnpaids', payload);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
unpaidClient.value = true;
|
||||
} catch (error) {
|
||||
notify('errors.writeRequest', 'negative');
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => unpaidClient.value,
|
||||
async (val) => {
|
||||
await nextTick();
|
||||
if (val) amountInputRef.value.focus();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport v-if="stateStore?.isSubToolbarShown()" to="#st-actions">
|
||||
<QBtnGroup push class="q-gutter-x-sm">
|
||||
<QBtn
|
||||
:disabled="!hasChanged"
|
||||
:label="t('globals.reset')"
|
||||
:loading="isLoading"
|
||||
@click="setInitialData"
|
||||
color="primary"
|
||||
flat
|
||||
icon="restart_alt"
|
||||
type="reset"
|
||||
<FetchData
|
||||
:filter="filterClientFindOne"
|
||||
auto-load
|
||||
url="ClientUnpaids"
|
||||
@on-fetch="
|
||||
(data) => {
|
||||
const unpaid = data.length == 1;
|
||||
initialData = { ...data[0], unpaid };
|
||||
}
|
||||
"
|
||||
/>
|
||||
<QBtn
|
||||
:disabled="!hasChanged"
|
||||
:label="t('globals.save')"
|
||||
:loading="isLoading"
|
||||
@click="onSubmit"
|
||||
color="primary"
|
||||
icon="save"
|
||||
/>
|
||||
</QBtnGroup>
|
||||
</Teleport>
|
||||
|
||||
<div class="full-width flex justify-center">
|
||||
<QCard class="card-width q-pa-lg">
|
||||
<QForm>
|
||||
<QCard>
|
||||
<FormModel
|
||||
v-if="'unpaid' in initialData"
|
||||
:observe-form-changes="false"
|
||||
ref="formModelRef"
|
||||
model="unpaid"
|
||||
url-update="ClientUnpaids"
|
||||
:mapper="(formData) => ({ ...formData, clientFk: route.params.id })"
|
||||
:form-initial-data="initialData"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
<div class="col">
|
||||
<QCheckbox :label="t('Unpaid client')" v-model="unpaidClient" />
|
||||
</div>
|
||||
<QCheckbox :label="t('Unpaid client')" v-model="data.unpaid" />
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md" v-show="unpaidClient">
|
||||
<VnRow class="row q-gutter-md q-mb-md" v-show="data.unpaid">
|
||||
<div class="col">
|
||||
<VnInputDate :label="t('Date')" v-model="dated" />
|
||||
<VnInputDate
|
||||
data-cy="customerUnpaidDate"
|
||||
:label="t('Date')"
|
||||
v-model="data.dated"
|
||||
/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<VnInput
|
||||
<VnInputNumber
|
||||
data-cy="customerUnpaidAmount"
|
||||
ref="amountInputRef"
|
||||
:label="t('Amount')"
|
||||
clearable
|
||||
type="number"
|
||||
v-model="amount"
|
||||
v-model="data.amount"
|
||||
autofocus
|
||||
>
|
||||
<template #append>€</template></VnInput
|
||||
<template #append>€</template></VnInputNumber
|
||||
>
|
||||
</div>
|
||||
</VnRow>
|
||||
</QForm>
|
||||
</template>
|
||||
</FormModel>
|
||||
</QCard>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -25,10 +25,9 @@ async function hasCustomerRole() {
|
|||
</script>
|
||||
<template>
|
||||
<FormModel
|
||||
url="VnUsers/preview"
|
||||
:url-update="`Clients/${route.params.id}/updateUser`"
|
||||
:filter="filter"
|
||||
model="webAccess"
|
||||
model="customer"
|
||||
:mapper="
|
||||
({ active, name, email }) => {
|
||||
return {
|
||||
|
@ -42,7 +41,7 @@ async function hasCustomerRole() {
|
|||
auto-load
|
||||
>
|
||||
<template #form="{ data, validate }">
|
||||
<QCheckbox :label="t('Enable web access')" v-model="data.active" />
|
||||
<QCheckbox :label="t('Enable web access')" v-model="data.account.active" />
|
||||
<VnInput :label="t('User')" clearable v-model="data.name" />
|
||||
<VnInput
|
||||
:label="t('Recovery email')"
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<script setup>
|
||||
import { computed, onBeforeMount, ref, watch } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import axios from 'axios';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
|
||||
import { toCurrency, toDateHourMin } from 'src/filters';
|
||||
|
||||
|
@ -20,10 +20,11 @@ const filter = {
|
|||
{ relation: 'mandateType', scope: { fields: ['id', 'name'] } },
|
||||
{ relation: 'company', scope: { fields: ['id', 'code'] } },
|
||||
],
|
||||
where: { clientFk: null },
|
||||
where: { clientFk: route.params.id },
|
||||
order: ['created DESC'],
|
||||
limit: 20,
|
||||
};
|
||||
const ClientDmsRef = ref(false);
|
||||
|
||||
const tableColumnComponents = {
|
||||
state: {
|
||||
|
@ -50,7 +51,7 @@ const tableColumnComponents = {
|
|||
component: CustomerCheckIconTooltip,
|
||||
props: ({ row }) => ({
|
||||
transaction: row,
|
||||
promise: refreshData,
|
||||
promise: () => ClientDmsRef.value.fetch(),
|
||||
}),
|
||||
event: () => {},
|
||||
},
|
||||
|
@ -89,38 +90,16 @@ const columns = computed(() => [
|
|||
name: 'validate',
|
||||
},
|
||||
]);
|
||||
|
||||
onBeforeMount(() => {
|
||||
getData(route.params.id);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
getData(newValue);
|
||||
}
|
||||
);
|
||||
|
||||
const getData = async (id) => {
|
||||
filter.where.clientFk = id;
|
||||
try {
|
||||
const { data } = await axios.get('clients/transactions', {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
rows.value = data;
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
};
|
||||
|
||||
const refreshData = () => {
|
||||
getData(route.params.id);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="full-width flex justify-center">
|
||||
<FetchData
|
||||
ref="ClientDmsRef"
|
||||
:filter="filter"
|
||||
@on-fetch="(data) => (rows = data)"
|
||||
auto-load
|
||||
url="Clients/transactions"
|
||||
/>
|
||||
<QPage class="card-width q-pa-lg">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
|
@ -135,13 +114,9 @@ const refreshData = () => {
|
|||
<QTr :props="props">
|
||||
<component
|
||||
:is="tableColumnComponents[props.col.name].component"
|
||||
@click="
|
||||
tableColumnComponents[props.col.name].event(props)
|
||||
"
|
||||
@click="tableColumnComponents[props.col.name].event(props)"
|
||||
class="rounded-borders q-pa-sm"
|
||||
v-bind="
|
||||
tableColumnComponents[props.col.name].props(props)
|
||||
"
|
||||
v-bind="tableColumnComponents[props.col.name].props(props)"
|
||||
>
|
||||
{{ props.value }}
|
||||
</component>
|
||||
|
@ -154,7 +129,6 @@ const refreshData = () => {
|
|||
{{ t('globals.noResults') }}
|
||||
</h5>
|
||||
</QPage>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -101,8 +101,8 @@ const exprBuilder = (param, value) => {
|
|||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection
|
||||
><VnSelect
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
url="Provinces"
|
||||
:label="t('Province')"
|
||||
v-model="params.provinceFk"
|
||||
|
@ -120,14 +120,12 @@ const exprBuilder = (param, value) => {
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-md">
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput :label="t('City')" v-model="params.city" is-outlined />
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput :label="t('Phone')" v-model="params.phone" is-outlined>
|
||||
<template #prepend>
|
||||
|
@ -136,7 +134,7 @@ const exprBuilder = (param, value) => {
|
|||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput :label="t('Email')" v-model="params.email" is-outlined>
|
||||
<template #prepend>
|
||||
|
@ -145,7 +143,8 @@ const exprBuilder = (param, value) => {
|
|||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
url="Zones"
|
||||
:label="t('Zone')"
|
||||
|
@ -160,9 +159,9 @@ const exprBuilder = (param, value) => {
|
|||
outlined
|
||||
rounded
|
||||
auto-load
|
||||
/>
|
||||
/></QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('Postcode')"
|
||||
|
@ -171,7 +170,6 @@ const exprBuilder = (param, value) => {
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QExpansionItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
@ -203,7 +201,6 @@ es:
|
|||
Salesperson: Comercial
|
||||
Province: Provincia
|
||||
City: Ciudad
|
||||
More options: Más opciones
|
||||
Phone: Teléfono
|
||||
Email: Email
|
||||
Zone: Zona
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<script setup>
|
||||
import { onBeforeMount, reactive, ref } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import axios from 'axios';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
|
@ -25,20 +24,6 @@ const agencyModes = ref([]);
|
|||
const incoterms = ref([]);
|
||||
const customsAgents = ref([]);
|
||||
|
||||
onBeforeMount(() => {
|
||||
urlCreate.value = `Clients/${route.params.id}/createAddress`;
|
||||
getCustomsAgents();
|
||||
});
|
||||
|
||||
const getCustomsAgents = async () => {
|
||||
const { data } = await axios.get('CustomsAgents');
|
||||
customsAgents.value = data;
|
||||
};
|
||||
|
||||
const refreshData = () => {
|
||||
getCustomsAgents();
|
||||
};
|
||||
|
||||
const toCustomerAddress = () => {
|
||||
router.push({
|
||||
name: 'CustomerAddress',
|
||||
|
@ -54,6 +39,11 @@ function handleLocation(data, location) {
|
|||
data.provinceFk = provinceFk;
|
||||
data.countryFk = countryFk;
|
||||
}
|
||||
|
||||
function onAgentCreated(requestResponse, data) {
|
||||
customsAgents.value.push(requestResponse);
|
||||
data.customsAgentFk = requestResponse.id;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -139,6 +129,7 @@ function handleLocation(data, location) {
|
|||
/>
|
||||
|
||||
<VnSelectDialog
|
||||
url="CustomsAgents"
|
||||
:label="t('Customs agent')"
|
||||
:options="customsAgents"
|
||||
hide-selected
|
||||
|
@ -148,7 +139,12 @@ function handleLocation(data, location) {
|
|||
:tooltip="t('Create a new expense')"
|
||||
>
|
||||
<template #form>
|
||||
<CustomerNewCustomsAgent @on-data-saved="refreshData()" />
|
||||
<CustomerNewCustomsAgent
|
||||
@on-data-saved="
|
||||
(_, requestResponse) =>
|
||||
onAgentCreated(requestResponse, data)
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</VnSelectDialog>
|
||||
</VnRow>
|
||||
|
|
|
@ -144,7 +144,7 @@ function handleLocation(data, location) {
|
|||
:url="`Addresses/${route.params.addressId}`"
|
||||
@on-data-saved="onDataSaved()"
|
||||
auto-load
|
||||
model="client"
|
||||
model="customer"
|
||||
>
|
||||
<template #moreActions>
|
||||
<QBtn
|
||||
|
|
|
@ -106,7 +106,6 @@ const setParams = (params) => {
|
|||
};
|
||||
|
||||
const getPreview = async () => {
|
||||
try {
|
||||
const params = {
|
||||
recipientId: entityId,
|
||||
};
|
||||
|
@ -125,9 +124,6 @@ const getPreview = async () => {
|
|||
htmlContent: data,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
notify('Errors getting preview', 'negative');
|
||||
}
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
|
|
|
@ -42,13 +42,9 @@ const setData = (entity) => {
|
|||
};
|
||||
|
||||
const removeDepartment = async () => {
|
||||
try {
|
||||
await axios.post(`/Departments/${entityId.value}/removeChild`, entityId.value);
|
||||
router.push({ name: 'WorkerDepartment' });
|
||||
notify('department.departmentRemoved', 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error removing department');
|
||||
}
|
||||
};
|
||||
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
|
|
@ -236,13 +236,9 @@ const copyOriginalRowsData = (rows) => {
|
|||
};
|
||||
|
||||
const saveChange = async (field, { rowIndex, row }) => {
|
||||
try {
|
||||
if (originalRowDataCopy.value[rowIndex][field] == row[field]) return;
|
||||
await axios.patch(`Buys/${row.id}`, row);
|
||||
originalRowDataCopy.value[rowIndex][field] = row[field];
|
||||
} catch (err) {
|
||||
console.error('Error saving changes', err);
|
||||
}
|
||||
};
|
||||
|
||||
const openRemoveDialog = async () => {
|
||||
|
@ -260,15 +256,11 @@ const openRemoveDialog = async () => {
|
|||
},
|
||||
})
|
||||
.onOk(async () => {
|
||||
try {
|
||||
await deleteBuys();
|
||||
const notifyMessage = t(
|
||||
`Buy${rowsSelected.value.length > 1 ? 's' : ''} deleted`
|
||||
);
|
||||
notify(notifyMessage, 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error deleting buys');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -282,7 +274,6 @@ const importBuys = () => {
|
|||
};
|
||||
|
||||
const toggleGroupingMode = async (buy, mode) => {
|
||||
try {
|
||||
const groupingMode = mode === 'grouping' ? mode : 'packing';
|
||||
const newGroupingMode = buy.groupingMode === groupingMode ? null : groupingMode;
|
||||
const params = {
|
||||
|
@ -290,9 +281,6 @@ const toggleGroupingMode = async (buy, mode) => {
|
|||
};
|
||||
await axios.patch(`Buys/${buy.id}`, params);
|
||||
buy.groupingMode = newGroupingMode;
|
||||
} catch (err) {
|
||||
console.error('Error toggling grouping mode');
|
||||
}
|
||||
};
|
||||
|
||||
const lockIconType = (groupingMode, mode) => {
|
||||
|
|
|
@ -123,20 +123,15 @@ const fillData = async (rawData) => {
|
|||
};
|
||||
|
||||
const fetchBuys = async (buys) => {
|
||||
try {
|
||||
const params = { buys };
|
||||
const { data } = await axios.post(
|
||||
`Entries/${route.params.id}/importBuysPreview`,
|
||||
params
|
||||
);
|
||||
importData.value.buys = data;
|
||||
} catch (err) {
|
||||
console.error('Error fetching buys');
|
||||
}
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
try {
|
||||
const params = importData.value;
|
||||
const hasAnyEmptyRow = params.buys.some((buy) => {
|
||||
return buy.itemFk === null;
|
||||
|
@ -150,9 +145,6 @@ const onSubmit = async () => {
|
|||
await axios.post(`Entries/${route.params.id}/importBuys`, params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
redirectToBuysView();
|
||||
} catch (err) {
|
||||
console.error('Error importing buys', err);
|
||||
}
|
||||
};
|
||||
|
||||
const redirectToBuysView = () => {
|
||||
|
|
|
@ -147,12 +147,9 @@ async function setEntryData(data) {
|
|||
}
|
||||
|
||||
const fetchEntryBuys = async () => {
|
||||
try {
|
||||
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
|
||||
if (data) entryBuys.value = data;
|
||||
} catch (err) {
|
||||
console.error('Error fetching entry buys');
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -82,11 +82,11 @@ const entriesTableColumns = computed(() => [
|
|||
</QCardSection>
|
||||
<QCardActions align="right">
|
||||
<QBtn
|
||||
:label="t('printLabels')"
|
||||
:label="t('myEntries.printLabels')"
|
||||
color="primary"
|
||||
icon="print"
|
||||
:loading="isLoading"
|
||||
@click="openReport(`Entries/${entityId}/print`)"
|
||||
@click="openReport(`Entries/${entityId}/labelSupplier`)"
|
||||
unelevated
|
||||
autofocus
|
||||
/>
|
||||
|
@ -126,7 +126,9 @@ const entriesTableColumns = computed(() => [
|
|||
"
|
||||
unelevated
|
||||
>
|
||||
<QTooltip>{{ t('viewLabel') }}</QTooltip>
|
||||
<QTooltip>{{
|
||||
t('myEntries.viewLabel')
|
||||
}}</QTooltip>
|
||||
</QBtn>
|
||||
</QTr>
|
||||
</template>
|
||||
|
|
|
@ -221,7 +221,7 @@ onMounted(async () => {
|
|||
t('entry.list.tableVisibleColumns.isExcludedFromAvailable')
|
||||
}}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="!!row.daysInForward" name="vn:net" color="primary">
|
||||
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
||||
<QTooltip>
|
||||
{{
|
||||
t('globals.raid', { daysInForward: row.daysInForward })
|
||||
|
|
|
@ -30,8 +30,6 @@ const recalc = async () => {
|
|||
isLoading.value = true;
|
||||
await axios.post('Applications/waste_addSales/execute-proc', params);
|
||||
notify('wasteRecalc.recalcOk', 'positive');
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ const columns = computed(() => [
|
|||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('printLabels'),
|
||||
title: t('myEntries.printLabels'),
|
||||
icon: 'print',
|
||||
isPrimary: true,
|
||||
action: (row) => printBuys(row.id),
|
||||
|
|
|
@ -184,5 +184,4 @@ es:
|
|||
Amount: Importe
|
||||
Issued: Fecha factura
|
||||
Id or supplier: Id o proveedor
|
||||
More options: Más opciones
|
||||
</i18n>
|
||||
|
|
|
@ -61,7 +61,6 @@ const showSendInvoiceDialog = (type) => {
|
|||
};
|
||||
|
||||
const sendEmailInvoice = async ({ address }) => {
|
||||
try {
|
||||
if (!address) notify(`The email can't be empty`, 'negative');
|
||||
|
||||
if (invoiceFormType.value === 'pdf') {
|
||||
|
@ -70,16 +69,10 @@ const sendEmailInvoice = async ({ address }) => {
|
|||
recipient: address,
|
||||
});
|
||||
} else {
|
||||
return sendEmail(
|
||||
`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-csv-email`,
|
||||
{
|
||||
return sendEmail(`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-csv-email`, {
|
||||
recipientId: $props.invoiceOutData.client.id,
|
||||
recipient: address,
|
||||
}
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error sending email', err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -88,34 +81,21 @@ const redirectToInvoiceOutList = () => {
|
|||
};
|
||||
|
||||
const deleteInvoice = async () => {
|
||||
try {
|
||||
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/delete`);
|
||||
notify(t('InvoiceOut deleted'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error deleting invoice out', err);
|
||||
}
|
||||
};
|
||||
|
||||
const bookInvoice = async () => {
|
||||
try {
|
||||
await axios.post(`InvoiceOuts/${$props.invoiceOutData.ref}/book`);
|
||||
notify(t('InvoiceOut booked'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error booking invoice out', err);
|
||||
}
|
||||
};
|
||||
|
||||
const generateInvoicePdf = async () => {
|
||||
try {
|
||||
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/createPdf`);
|
||||
notify(t('The invoice PDF document has been regenerated'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error generating invoice out pdf', err);
|
||||
}
|
||||
};
|
||||
|
||||
const refundInvoice = async (withWarehouse) => {
|
||||
try {
|
||||
const params = { ref: $props.invoiceOutData.ref, withWarehouse: withWarehouse };
|
||||
const { data } = await axios.post('InvoiceOuts/refund', params);
|
||||
location.href = window.origin + `/#/ticket/${data[0].id}/sale`;
|
||||
|
@ -125,9 +105,6 @@ const refundInvoice = async (withWarehouse) => {
|
|||
}),
|
||||
'positive'
|
||||
);
|
||||
} catch (err) {
|
||||
console.error('Error generating invoice out pdf', err);
|
||||
}
|
||||
};
|
||||
|
||||
const showTransferInvoiceForm = async () => {
|
||||
|
|
|
@ -83,8 +83,6 @@ const states = ref();
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
|
@ -105,14 +103,9 @@ const states = ref();
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.dued"
|
||||
:label="t('Dued')"
|
||||
is-outlined
|
||||
/>
|
||||
<VnInputDate v-model="params.dued" :label="t('Dued')" is-outlined />
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QExpansionItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
@ -149,5 +142,4 @@ es:
|
|||
Issued: Fecha emisión
|
||||
Created: Fecha creación
|
||||
Dued: Fecha vencimiento
|
||||
More options: Más opciones
|
||||
</i18n>
|
||||
|
|
|
@ -60,8 +60,15 @@ const columns = computed(() => [
|
|||
label: t('globals.reference'),
|
||||
isTitle: true,
|
||||
component: 'select',
|
||||
attrs: { url: MODEL, optionLabel: 'ref', optionValue: 'id' },
|
||||
attrs: {
|
||||
url: MODEL,
|
||||
optionLabel: 'ref',
|
||||
optionValue: 'ref',
|
||||
},
|
||||
columnField: { component: null },
|
||||
columnFilter: {
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -135,15 +142,10 @@ onMounted(() => (stateStore.rightDrawer = true));
|
|||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
||||
function openPdf(id) {
|
||||
try {
|
||||
openReport(`${MODEL}/${id}/download`);
|
||||
} catch (err) {
|
||||
console.error('Error opening PDF', err);
|
||||
}
|
||||
}
|
||||
|
||||
function downloadPdf() {
|
||||
try {
|
||||
if (selectedRows.value.size === 0) return;
|
||||
const selectedCardsArray = Array.from(selectedRows.value.values());
|
||||
|
||||
|
@ -151,9 +153,7 @@ function downloadPdf() {
|
|||
const [invoiceOut] = selectedCardsArray;
|
||||
openPdf(invoiceOut.id);
|
||||
} else {
|
||||
const invoiceOutIdsArray = selectedCardsArray.map(
|
||||
(invoiceOut) => invoiceOut.id
|
||||
);
|
||||
const invoiceOutIdsArray = selectedCardsArray.map((invoiceOut) => invoiceOut.id);
|
||||
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
||||
|
||||
const params = {
|
||||
|
@ -162,9 +162,6 @@ function downloadPdf() {
|
|||
|
||||
openReport(`${MODEL}/downloadZip`, params);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error opening PDF');
|
||||
}
|
||||
}
|
||||
|
||||
watchEffect(selectedRows);
|
||||
|
@ -254,10 +251,7 @@ watchEffect(selectedRows);
|
|||
@update:model-value="fetchClientAddress"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem
|
||||
v-bind="scope.itemProps"
|
||||
@click="selectedClient(scope.opt)"
|
||||
>
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
#{{ scope.opt?.id }} -
|
||||
|
@ -296,18 +290,17 @@ watchEffect(selectedRows);
|
|||
: ''
|
||||
} `
|
||||
}}
|
||||
<span>
|
||||
{{
|
||||
<span>{{
|
||||
scope.opt?.nickname
|
||||
}}</span
|
||||
>
|
||||
}}</span>
|
||||
<span
|
||||
v-if="
|
||||
scope.opt?.province ||
|
||||
scope.opt?.city ||
|
||||
scope.opt?.street
|
||||
"
|
||||
>, {{ scope.opt?.street }},
|
||||
>
|
||||
, {{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }},
|
||||
{{
|
||||
scope.opt?.province?.name
|
||||
|
@ -316,8 +309,8 @@ watchEffect(selectedRows);
|
|||
{{
|
||||
scope.opt?.agencyMode
|
||||
?.name
|
||||
}}</span
|
||||
>
|
||||
}}
|
||||
</span>
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -170,7 +170,7 @@ onMounted(async () => {
|
|||
from.value = getDate(_from, 'from');
|
||||
const _to = Date.vnNew();
|
||||
_to.setDate(_to.getDate() + 10);
|
||||
to.value = getDate(Date.vnNew(), 'to');
|
||||
to.value = getDate(_to, 'to');
|
||||
|
||||
updateFilter();
|
||||
|
||||
|
|
|
@ -45,13 +45,9 @@ const arrayData = useArrayData('ItemShelvings', {
|
|||
const rows = computed(() => arrayData.store.data || []);
|
||||
|
||||
const applyColumnFilter = async (col) => {
|
||||
try {
|
||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
||||
params[paramKey] = col.columnFilter.filterValue;
|
||||
await arrayData.addFilter({ filter: null, params });
|
||||
} catch (err) {
|
||||
console.error('Error applying column filter', err);
|
||||
}
|
||||
};
|
||||
|
||||
const getInputEvents = (col) => {
|
||||
|
@ -173,15 +169,11 @@ const totalLabels = computed(() =>
|
|||
);
|
||||
|
||||
const removeLines = async () => {
|
||||
try {
|
||||
const itemShelvingIds = rowsSelected.value.map((row) => row.itemShelvingFk);
|
||||
await axios.post('ItemShelvings/deleteItemShelvings', { itemShelvingIds });
|
||||
rowsSelected.value = [];
|
||||
notify('shelvings.shelvingsRemoved', 'positive');
|
||||
await arrayData.fetch({ append: false });
|
||||
} catch (err) {
|
||||
console.error('Error removing lines', err);
|
||||
}
|
||||
};
|
||||
onMounted(async () => {
|
||||
await arrayData.fetch({ append: false });
|
||||
|
|
|
@ -19,7 +19,6 @@ const tagOptions = ref([]);
|
|||
const valueOptionsMap = ref(new Map());
|
||||
|
||||
const getSelectedTagValues = async (tag) => {
|
||||
try {
|
||||
if (!tag.tagFk && tag.tag.isFree) return;
|
||||
const filter = {
|
||||
fields: ['value'],
|
||||
|
@ -32,9 +31,6 @@ const getSelectedTagValues = async (tag) => {
|
|||
params,
|
||||
});
|
||||
valueOptionsMap.value.set(tag.tagFk, data);
|
||||
} catch (err) {
|
||||
console.error('Error getting selected tag values');
|
||||
}
|
||||
};
|
||||
|
||||
const onItemTagsFetched = async (itemTags) => {
|
||||
|
@ -70,6 +66,7 @@ const insertTag = (rows) => {
|
|||
<FetchData
|
||||
url="Tags"
|
||||
:filter="{ fields: ['id', 'name', 'isFree', 'sourceTable'] }"
|
||||
sort-by="name"
|
||||
@on-fetch="(data) => (tagOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
|
|
@ -32,7 +32,6 @@ const ItemTaxRef = ref(null);
|
|||
const taxesOptions = ref([]);
|
||||
|
||||
const submitTaxes = async (data) => {
|
||||
try {
|
||||
let payload = data.map((tax) => ({
|
||||
id: tax.id,
|
||||
taxClassFk: tax.taxClassFk,
|
||||
|
@ -40,9 +39,6 @@ const submitTaxes = async (data) => {
|
|||
|
||||
await axios.post(`Items/updateTaxes`, payload);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error saving taxes', err);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
@ -221,24 +221,16 @@ const updateMinPrice = async (value, props) => {
|
|||
};
|
||||
|
||||
const upsertPrice = async (props, resetMinPrice = false) => {
|
||||
try {
|
||||
const { row } = props;
|
||||
if (tableRef.value.CrudModelRef.getChanges().updates.length > 0) {
|
||||
if (resetMinPrice) row.hasMinPrice = 0;
|
||||
await upsertFixedPrice(row);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error editing price', err);
|
||||
}
|
||||
};
|
||||
|
||||
async function upsertFixedPrice(row) {
|
||||
try {
|
||||
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
|
||||
return data;
|
||||
} catch (err) {
|
||||
console.error('Error editing price', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveOnRowChange(row) {
|
||||
|
@ -321,14 +313,10 @@ const onEditCellDataSaved = async () => {
|
|||
};
|
||||
|
||||
const removeFuturePrice = async () => {
|
||||
try {
|
||||
rowsSelected.value.forEach(({ id }) => {
|
||||
const rowIndex = fixedPrices.value.findIndex(({ id }) => id === id);
|
||||
removePrice(id, rowIndex);
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Error removing price', err);
|
||||
}
|
||||
};
|
||||
|
||||
function confirmRemove(item, isFuture) {
|
||||
|
@ -345,13 +333,9 @@ function confirmRemove(item, isFuture) {
|
|||
}
|
||||
|
||||
const removePrice = async (id) => {
|
||||
try {
|
||||
await axios.delete(`FixedPrices/${id}`);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
tableRef.value.reload({});
|
||||
} catch (err) {
|
||||
console.error('Error removing price', err);
|
||||
}
|
||||
};
|
||||
const dateStyle = (date) =>
|
||||
date
|
||||
|
|
|
@ -55,7 +55,6 @@ const onCategoryChange = async (categoryFk, search) => {
|
|||
};
|
||||
|
||||
const getSelectedTagValues = async (tag) => {
|
||||
try {
|
||||
if (!tag?.selectedTag?.id) return;
|
||||
tag.value = null;
|
||||
const filter = {
|
||||
|
@ -68,9 +67,6 @@ const getSelectedTagValues = async (tag) => {
|
|||
params,
|
||||
});
|
||||
tag.valueOptions = data;
|
||||
} catch (err) {
|
||||
console.error('Error getting selected tag values');
|
||||
}
|
||||
};
|
||||
|
||||
const applyTags = (params, search) => {
|
||||
|
|
|
@ -173,7 +173,6 @@ const getBadgeColor = (date) => {
|
|||
};
|
||||
|
||||
const changeQuantity = async (request) => {
|
||||
try {
|
||||
if (request.saleFk) {
|
||||
const params = {
|
||||
quantity: request.saleQuantity,
|
||||
|
@ -183,13 +182,9 @@ const changeQuantity = async (request) => {
|
|||
notify(t('globals.dataSaved'), 'positive');
|
||||
confirmRequest(request);
|
||||
} else confirmRequest(request);
|
||||
} catch (error) {
|
||||
console.error('Error changing quantity:: ', error);
|
||||
}
|
||||
};
|
||||
|
||||
const confirmRequest = async (request) => {
|
||||
try {
|
||||
if (request.itemFk && request.saleQuantity) {
|
||||
const params = {
|
||||
itemFk: request.itemFk,
|
||||
|
@ -197,17 +192,11 @@ const confirmRequest = async (request) => {
|
|||
attenderFk: request.attenderFk,
|
||||
};
|
||||
|
||||
const { data } = await axios.post(
|
||||
`TicketRequests/${request.id}/confirm`,
|
||||
params
|
||||
);
|
||||
const { data } = await axios.post(`TicketRequests/${request.id}/confirm`, params);
|
||||
request.itemDescription = data.concept;
|
||||
request.isOk = true;
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error confirming request:: ', error);
|
||||
}
|
||||
};
|
||||
|
||||
const getState = (isOk) => {
|
||||
|
|
|
@ -103,15 +103,11 @@ const getBadgeColor = (date) => {
|
|||
};
|
||||
|
||||
const removeOrders = async () => {
|
||||
try {
|
||||
const selectedIds = selectedRows.value.map((row) => row.id);
|
||||
const params = { deletes: selectedIds };
|
||||
await axios.post('SalesMonitors/deleteOrders', params);
|
||||
selectedRows.value = [];
|
||||
await table.value.reload();
|
||||
} catch (err) {
|
||||
console.error('Error deleting orders', err);
|
||||
}
|
||||
};
|
||||
|
||||
const openTab = (id) =>
|
||||
|
|
|
@ -18,7 +18,7 @@ const groupedStates = ref();
|
|||
const handleScopeDays = (params, days, callback) => {
|
||||
const [from, to] = dateRange(Date.vnNew());
|
||||
if (!days) {
|
||||
Object.assign(params, { from, to, scopeDays: 1 });
|
||||
Object.assign(params, { from, to, scopeDays: 0 });
|
||||
} else {
|
||||
params.from = from;
|
||||
to.setDate(to.getDate() + days);
|
||||
|
@ -59,7 +59,7 @@ const getLocale = (label) => {
|
|||
</template>
|
||||
<template #customTags="{ params, searchFn, formatFn }">
|
||||
<VnFilterPanelChip
|
||||
v-if="params.scopeDays"
|
||||
v-if="params.scopeDays !== null"
|
||||
removable
|
||||
@remove="handleScopeDays(params, null, searchFn)"
|
||||
>
|
||||
|
|
|
@ -25,11 +25,8 @@ const provinceOpts = ref([]);
|
|||
const stateOpts = ref([]);
|
||||
const zoneOpts = ref([]);
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const from = Date.vnNew();
|
||||
from.setHours(0, 0, 0, 0);
|
||||
const to = new Date(from.getTime());
|
||||
to.setDate(to.getDate() + 1);
|
||||
to.setHours(23, 59, 59, 999);
|
||||
|
||||
const [from, to] = dateRange(Date.vnNew());
|
||||
const stateColors = {
|
||||
notice: 'info',
|
||||
success: 'positive',
|
||||
|
@ -340,7 +337,7 @@ const openTab = (id) =>
|
|||
auto-load
|
||||
:row-click="({ id }) => openTab(id)"
|
||||
:disable-option="{ card: true }"
|
||||
:user-params="{ from, to, scopeDays: 1 }"
|
||||
:user-params="{ from, to, scopeDays: 0 }"
|
||||
>
|
||||
<template #top-left>
|
||||
<QBtn
|
||||
|
@ -350,7 +347,7 @@ const openTab = (id) =>
|
|||
class="q-mr-sm"
|
||||
dense
|
||||
flat
|
||||
@click="$refs.tableRef.reload()"
|
||||
@click="tableRef.CrudModelRef.vnPaginateRef.update()"
|
||||
>
|
||||
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -31,21 +31,11 @@ const applyTags = () => {
|
|||
emit('applyTags', tagInfo);
|
||||
};
|
||||
|
||||
const removeTagGroupParam = (valIndex = null) => {
|
||||
if (!valIndex) {
|
||||
tagValues.value = [{}];
|
||||
} else {
|
||||
(tagValues.value || []).splice(valIndex, 1);
|
||||
}
|
||||
};
|
||||
|
||||
const getSelectedTagValues = async (tag) => {
|
||||
try {
|
||||
if (!tag?.id) return;
|
||||
const filter = {
|
||||
fields: ['value'],
|
||||
order: 'value ASC',
|
||||
limit: 30,
|
||||
};
|
||||
|
||||
const url = `Tags/${tag?.id}/filterValue`;
|
||||
|
@ -54,24 +44,12 @@ const getSelectedTagValues = async (tag) => {
|
|||
params,
|
||||
});
|
||||
tagOptions.value = data;
|
||||
} catch (err) {
|
||||
console.error('Error getting selected tag values');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<QForm @submit="applyTags(tagValues)" class="all-pointer-events">
|
||||
<QCard class="q-pa-sm column q-pa-lg">
|
||||
<QBtn
|
||||
round
|
||||
color="primary"
|
||||
style="position: absolute; z-index: 1; right: 0; top: 0"
|
||||
icon="search"
|
||||
type="submit"
|
||||
>
|
||||
</QBtn>
|
||||
|
||||
<QForm @submit="applyTags()" class="all-pointer-events">
|
||||
<QCard class="q-pa-sm column q-pa-lg" data-cy="catalogFilterValueDialog">
|
||||
<VnSelect
|
||||
:label="t('params.tag')"
|
||||
v-model="selectedTag"
|
||||
|
@ -84,17 +62,8 @@ const getSelectedTagValues = async (tag) => {
|
|||
rounded
|
||||
:emit-value="false"
|
||||
use-input
|
||||
@update:model-value="($event) => getSelectedTagValues($event)"
|
||||
/>
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
flat
|
||||
class="filter-icon q-mb-md"
|
||||
size="md"
|
||||
dense
|
||||
:disabled="!selectedTag || !tagValues[0].value"
|
||||
@click="tagValues.unshift({})"
|
||||
@update:model-value="getSelectedTagValues"
|
||||
data-cy="catalogFilterValueDialogTagSelect"
|
||||
/>
|
||||
<div
|
||||
v-for="(value, index) in tagValues"
|
||||
|
@ -106,7 +75,7 @@ const getSelectedTagValues = async (tag) => {
|
|||
v-if="!selectedTag?.isFree && tagOptions"
|
||||
:label="t('components.itemsFilterPanel.value')"
|
||||
v-model="value.value"
|
||||
:options="tagOptions || []"
|
||||
:options="tagOptions"
|
||||
option-value="value"
|
||||
option-label="value"
|
||||
dense
|
||||
|
@ -124,8 +93,8 @@ const getSelectedTagValues = async (tag) => {
|
|||
:label="t('components.itemsFilterPanel.value')"
|
||||
:disable="!value"
|
||||
is-outlined
|
||||
:is-clearable="false"
|
||||
class="col"
|
||||
data-cy="catalogFilterValueDialogValueInput"
|
||||
/>
|
||||
<QBtn
|
||||
icon="delete"
|
||||
|
@ -135,11 +104,25 @@ const getSelectedTagValues = async (tag) => {
|
|||
rounded
|
||||
flat
|
||||
class="filter-icon col-2"
|
||||
:disabled="!value.value"
|
||||
@click="removeTagGroupParam(index)"
|
||||
@click="tagValues.splice(index, 1)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
flat
|
||||
class="filter-icon q-mb-md"
|
||||
size="md"
|
||||
dense
|
||||
@click="tagValues.push({})"
|
||||
/>
|
||||
<QBtn
|
||||
color="primary"
|
||||
icon="search"
|
||||
type="submit"
|
||||
:label="$t('globals.search')"
|
||||
/>
|
||||
</QCard>
|
||||
</QForm>
|
||||
</template>
|
||||
|
|
|
@ -22,7 +22,6 @@ const agencyList = ref([]);
|
|||
const addressList = ref([]);
|
||||
|
||||
const fetchAddressList = async (addressId) => {
|
||||
try {
|
||||
const { data } = await axios.get('addresses', {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
|
@ -35,17 +34,12 @@ const fetchAddressList = async (addressId) => {
|
|||
if (addressList.value?.length === 1) {
|
||||
state.get(ORDER_MODEL).addressFk = addressList.value[0].id;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`Error fetching addresses`, err);
|
||||
return err.response;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchAgencyList = async (landed, addressFk) => {
|
||||
if (!landed || !addressFk) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||
params: {
|
||||
addressFk,
|
||||
|
@ -53,10 +47,6 @@ const fetchAgencyList = async (landed, addressFk) => {
|
|||
},
|
||||
});
|
||||
agencyList.value = data;
|
||||
} catch (err) {
|
||||
console.error(`Error fetching agencies`, err);
|
||||
return err.response;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchOrderDetails = (order) => {
|
||||
|
@ -92,12 +82,8 @@ const orderFilter = {
|
|||
};
|
||||
|
||||
const onClientChange = async (clientId) => {
|
||||
try {
|
||||
const { data } = await axios.get(`Clients/${clientId}`);
|
||||
await fetchAddressList(data.defaultAddressFk);
|
||||
} catch (error) {
|
||||
console.error('Error al cambiar el cliente:', error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
<script setup>
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { onBeforeMount, onMounted, onUnmounted, ref, computed, watch } from 'vue';
|
||||
import { onMounted, onUnmounted, ref, computed, watch } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||
import CatalogItem from 'components/ui/CatalogItem.vue';
|
||||
import OrderCatalogFilter from 'pages/Order/Card/OrderCatalogFilter.vue';
|
||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||
import CatalogItem from 'src/components/ui/CatalogItem.vue';
|
||||
import OrderCatalogFilter from 'src/pages/Order/Card/OrderCatalogFilter.vue';
|
||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import getParamWhere from 'src/filters/getParamWhere';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
const arrayData = useArrayData('OrderCatalogList');
|
||||
const dataKey = 'OrderCatalogList';
|
||||
const arrayData = useArrayData(dataKey);
|
||||
const store = arrayData.store;
|
||||
const showFilter = ref(null);
|
||||
const tags = ref([]);
|
||||
|
||||
let catalogParams = {
|
||||
|
@ -25,27 +24,6 @@ let catalogParams = {
|
|||
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
|
||||
};
|
||||
|
||||
onBeforeMount(() => {
|
||||
const whereParams = getParamWhere(route);
|
||||
if (whereParams) {
|
||||
const formattedWhereParams = {};
|
||||
if (whereParams.and) {
|
||||
whereParams.and.forEach((item) => {
|
||||
Object.assign(formattedWhereParams, item);
|
||||
});
|
||||
} else {
|
||||
Object.assign(formattedWhereParams, whereParams);
|
||||
}
|
||||
|
||||
catalogParams = {
|
||||
...catalogParams,
|
||||
...formattedWhereParams,
|
||||
};
|
||||
} else {
|
||||
showFilter.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
stateStore.rightDrawer = true;
|
||||
checkOrderConfirmation();
|
||||
|
@ -89,7 +67,7 @@ function extractValueTags(items) {
|
|||
);
|
||||
tagValue.value = resultValueTags;
|
||||
}
|
||||
const autoLoad = computed(() => !!catalogParams.categoryFk);
|
||||
const autoLoad = computed(() => !!JSON.parse(route?.query.table ?? '{}')?.categoryFk);
|
||||
|
||||
watch(
|
||||
() => store.data,
|
||||
|
@ -102,7 +80,7 @@ watch(
|
|||
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="OrderCatalogList"
|
||||
:data-key="dataKey"
|
||||
:user-params="catalogParams"
|
||||
:static-params="['orderFk', 'orderBy']"
|
||||
:redirect="false"
|
||||
|
@ -111,24 +89,22 @@ watch(
|
|||
:info="t('You can search items by name or id')"
|
||||
/>
|
||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||
<QScrollArea v-if="showFilter" class="fit text-grey-8">
|
||||
<QScrollArea class="fit text-grey-8">
|
||||
<OrderCatalogFilter
|
||||
data-key="OrderCatalogList"
|
||||
:data-key="dataKey"
|
||||
:tag-value="tagValue"
|
||||
:tags="tags"
|
||||
:initial-catalog-params="catalogParams"
|
||||
/>
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
||||
<div class="full-width">
|
||||
<VnPaginate
|
||||
data-key="OrderCatalogList"
|
||||
:data-key="dataKey"
|
||||
url="Orders/CatalogFilter"
|
||||
:limit="50"
|
||||
:user-params="catalogParams"
|
||||
@on-fetch="showFilter = true"
|
||||
:update-router="false"
|
||||
:auto-load="autoLoad"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
|
@ -142,6 +118,7 @@ watch(
|
|||
:item="row"
|
||||
is-catalog
|
||||
class="fill-icon"
|
||||
data-cy="orderCatalogItem"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, ref, onMounted } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import axios from 'axios';
|
||||
|
@ -8,7 +8,6 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
|||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import getParamWhere from 'src/filters/getParamWhere';
|
||||
import CatalogFilterValueDialog from 'src/pages/Order/Card/CatalogFilterValueDialog.vue';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
|
||||
|
@ -33,10 +32,8 @@ const route = useRoute();
|
|||
const arrayData = useArrayData(props.dataKey);
|
||||
|
||||
const categoryList = ref(null);
|
||||
const selectedCategoryFk = ref(null);
|
||||
const typeList = ref([]);
|
||||
const selectedTypeFk = ref(null);
|
||||
const generalSearchParam = ref(null);
|
||||
const searchByTag = ref(null);
|
||||
|
||||
const vnFilterPanelRef = ref();
|
||||
const orderByList = ref([
|
||||
|
@ -53,45 +50,31 @@ const orderBySelected = ref('relevancy DESC, name');
|
|||
const orderWaySelected = ref('ASC');
|
||||
|
||||
const resetCategory = (params, search) => {
|
||||
selectedCategoryFk.value = null;
|
||||
typeList.value = null;
|
||||
params.categoryFk = null;
|
||||
params.typeFk = null;
|
||||
arrayData.store.userFilter = null;
|
||||
removeTagGroupParam(params, search);
|
||||
};
|
||||
|
||||
const selectCategory = (params, category, search) => {
|
||||
if (params.categoryFk === category?.id) {
|
||||
resetCategory(params, search);
|
||||
params.categoryFk = null;
|
||||
} else {
|
||||
selectedCategoryFk.value = category?.id;
|
||||
params.categoryFk = category?.id;
|
||||
params.typeFk = null;
|
||||
selectedTypeFk.value = null;
|
||||
loadTypes(category?.id);
|
||||
}
|
||||
search();
|
||||
};
|
||||
|
||||
const loadTypes = async (categoryFk = selectedCategoryFk.value) => {
|
||||
const selectCategory = async (params, category, search) => {
|
||||
if (vnFilterPanelRef.value.params.categoryFk === category?.id) {
|
||||
resetCategory(params, search);
|
||||
return;
|
||||
}
|
||||
params.typeFk = null;
|
||||
params.categoryFk = category.id;
|
||||
await loadTypes(category?.id);
|
||||
await search();
|
||||
};
|
||||
|
||||
const loadTypes = async (id) => {
|
||||
const { data } = await axios.get(`Orders/${route.params.id}/getItemTypeAvailable`, {
|
||||
params: { itemCategoryId: categoryFk },
|
||||
params: { itemCategoryId: id },
|
||||
});
|
||||
typeList.value = data;
|
||||
};
|
||||
|
||||
const selectedCategory = computed(() => {
|
||||
return (categoryList.value || []).find(
|
||||
(category) => category?.id === selectedCategoryFk.value
|
||||
);
|
||||
});
|
||||
|
||||
const selectedType = computed(() => {
|
||||
return (typeList.value || []).find((type) => type?.id === selectedTypeFk.value);
|
||||
});
|
||||
|
||||
function exprBuilder(param, value) {
|
||||
switch (param) {
|
||||
case 'categoryFk':
|
||||
|
@ -115,13 +98,23 @@ const applyTags = (tagInfo, params, search) => {
|
|||
search();
|
||||
};
|
||||
|
||||
const removeTagGroupParam = (params, search, valIndex = null) => {
|
||||
if (!valIndex) {
|
||||
async function onSearchByTag(value) {
|
||||
if (!value.target.value) return;
|
||||
if (!vnFilterPanelRef.value.params?.tagGroups) {
|
||||
vnFilterPanelRef.value.params.tagGroups = [];
|
||||
}
|
||||
|
||||
vnFilterPanelRef.value.params.tagGroups.push({
|
||||
values: [{ value: value.target.value }],
|
||||
});
|
||||
searchByTag.value = null;
|
||||
}
|
||||
|
||||
const removeTagGroupParam = (params, search, valIndex) => {
|
||||
if (!valIndex && valIndex !== 0) {
|
||||
params.tagGroups = null;
|
||||
search();
|
||||
} else {
|
||||
params.tagGroups.splice(valIndex, 1);
|
||||
search();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -133,7 +126,8 @@ const setCategoryList = (data) => {
|
|||
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
||||
}));
|
||||
|
||||
selectedCategoryFk.value && loadTypes();
|
||||
vnFilterPanelRef.value.params.categoryFk &&
|
||||
loadTypes(vnFilterPanelRef.value.params.categoryFk);
|
||||
};
|
||||
|
||||
const getCategoryClass = (category, params) => {
|
||||
|
@ -149,35 +143,29 @@ function addOrder(value, field, params) {
|
|||
params.orderBy = JSON.stringify(orderBy);
|
||||
vnFilterPanelRef.value.search();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
selectedCategoryFk.value = getParamWhere(route, 'categoryFk');
|
||||
selectedTypeFk.value = getParamWhere(route, 'typeFk');
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
||||
<FetchData url="ItemCategories" auto-load @on-fetch="setCategoryList" />
|
||||
<VnFilterPanel
|
||||
ref="vnFilterPanelRef"
|
||||
:data-key="props.dataKey"
|
||||
:hidden-tags="['orderFk', 'orderBy']"
|
||||
:un-removable-params="['orderFk', 'orderBy']"
|
||||
:hidden-tags="['filter', 'orderFk', 'orderBy']"
|
||||
:unremovable-params="['orderFk', 'orderBy']"
|
||||
:expr-builder="exprBuilder"
|
||||
:custom-tags="['tagGroups', 'categoryFk']"
|
||||
:redirect="false"
|
||||
search-url="params"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<strong v-if="tag.label === 'typeFk'">
|
||||
{{ t(selectedType?.name || '') }}
|
||||
<strong v-if="tag.label === 'typeFk' && typeList">
|
||||
{{ t(typeList.find((t) => t.id == tag.value)?.name || '') }}
|
||||
</strong>
|
||||
<div v-else class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
<span>{{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #customTags="{ tags: customTags, params, searchFn }">
|
||||
<template #customTags="{ params, tags: customTags, searchFn }">
|
||||
<template v-for="customTag in customTags" :key="customTag.label">
|
||||
<VnFilterPanelChip
|
||||
v-for="(tag, valIndex) in Array.isArray(customTag.value)
|
||||
|
@ -190,9 +178,15 @@ onMounted(() => {
|
|||
? resetCategory(params, searchFn)
|
||||
: removeTagGroupParam(params, searchFn, valIndex)
|
||||
"
|
||||
data-cy="catalogFilterCustomTag"
|
||||
>
|
||||
<strong v-if="customTag.label === 'categoryFk'">
|
||||
{{ t(selectedCategory?.name || '') }}
|
||||
<strong v-if="customTag.label === 'categoryFk' && categoryList">
|
||||
{{
|
||||
t(
|
||||
categoryList.find((c) => c.id == customTag.value)?.name ||
|
||||
''
|
||||
)
|
||||
}}
|
||||
</strong>
|
||||
<strong v-if="tag?.tagSelection?.name" class="q-mr-xs">
|
||||
{{ tag.tagSelection.name }}:
|
||||
|
@ -218,6 +212,7 @@ onMounted(() => {
|
|||
:name="category.icon"
|
||||
class="category-icon"
|
||||
@click="selectCategory(params, category, searchFn)"
|
||||
data-cy="catalogFilterCategory"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t(category.name) }}
|
||||
|
@ -239,13 +234,9 @@ onMounted(() => {
|
|||
emit-value
|
||||
use-input
|
||||
sort-by="name ASC"
|
||||
:disable="!selectedCategoryFk"
|
||||
@update:model-value="
|
||||
(value) => {
|
||||
selectedTypeFk = value;
|
||||
searchFn();
|
||||
}
|
||||
"
|
||||
:disable="!params.categoryFk"
|
||||
@update:model-value="searchFn()"
|
||||
data-cy="catalogFilterType"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
@ -288,34 +279,29 @@ onMounted(() => {
|
|||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
|
||||
<QItem class="q-mt-lg">
|
||||
<VnSelect
|
||||
<QItem class="q-mt-lg q-pa-none">
|
||||
<VnInput
|
||||
:label="t('components.itemsFilterPanel.value')"
|
||||
:options="props.tagValue"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:is-clearable="false"
|
||||
v-model="generalSearchParam"
|
||||
@update:model-value="
|
||||
applyTags(
|
||||
{ values: [{ value: generalSearchParam }] },
|
||||
params,
|
||||
searchFn
|
||||
)
|
||||
"
|
||||
v-model="searchByTag"
|
||||
@keyup.enter="(val) => onSearchByTag(val, params)"
|
||||
data-cy="catalogFilterValueInput"
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="search" />
|
||||
</template>
|
||||
<template #after>
|
||||
<template #append>
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
flat
|
||||
color="primary"
|
||||
size="md"
|
||||
dense
|
||||
data-cy="catalogFilterValueDialogBtn"
|
||||
/>
|
||||
<QPopupProxy>
|
||||
<CatalogFilterValueDialog
|
||||
|
@ -327,7 +313,7 @@ onMounted(() => {
|
|||
/>
|
||||
</QPopupProxy>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</VnInput>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
</template>
|
||||
|
|
|
@ -20,7 +20,6 @@ const addressList = ref([]);
|
|||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||
|
||||
const fetchAddressList = async (addressId) => {
|
||||
try {
|
||||
const { data } = await axios.get('addresses', {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
|
@ -33,17 +32,12 @@ const fetchAddressList = async (addressId) => {
|
|||
if (addressList.value?.length === 1) {
|
||||
state.get(ORDER_MODEL).addressId = addressList.value[0].id;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`Error fetching addresses`, err);
|
||||
return err.response;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchAgencyList = async (landed, addressFk) => {
|
||||
if (!landed || !addressFk) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||
params: {
|
||||
addressFk,
|
||||
|
@ -51,10 +45,6 @@ const fetchAgencyList = async (landed, addressFk) => {
|
|||
},
|
||||
});
|
||||
agencyList.value = data;
|
||||
} catch (err) {
|
||||
console.error(`Error fetching agencies`, err);
|
||||
return err.response;
|
||||
}
|
||||
};
|
||||
|
||||
const $props = defineProps({
|
||||
|
@ -70,12 +60,8 @@ const initialFormState = reactive({
|
|||
});
|
||||
|
||||
const onClientChange = async (clientId = $props.clientFk) => {
|
||||
try {
|
||||
const { data } = await axios.get(`Clients/${clientId}`);
|
||||
await fetchAddressList(data.defaultAddressFk);
|
||||
} catch (error) {
|
||||
console.error('Error al cambiar el cliente:', error);
|
||||
}
|
||||
};
|
||||
|
||||
async function onDataSaved(_, id) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu
|
|||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import { toDateTimeFormat } from 'src/filters/date';
|
||||
import { useRoute } from 'vue-router';
|
||||
import dataByOrder from 'src/utils/dataByOrder';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
@ -149,7 +150,12 @@ onMounted(() => {
|
|||
});
|
||||
async function fetchClientAddress(id, formData = {}) {
|
||||
const { data } = await axios.get(`Clients/${id}`, {
|
||||
params: { filter: { include: { relation: 'addresses' } } },
|
||||
params: {
|
||||
filter: {
|
||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
||||
include: { relation: 'addresses' },
|
||||
},
|
||||
},
|
||||
});
|
||||
addressesList.value = data.addresses;
|
||||
formData.addressId = data.defaultAddressFk;
|
||||
|
@ -162,7 +168,7 @@ async function fetchAgencies({ landed, addressId }) {
|
|||
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||
params: { addressFk: addressId, landed },
|
||||
});
|
||||
agencyList.value = data;
|
||||
agencyList.value = dataByOrder(data, 'agencyMode ASC');
|
||||
}
|
||||
|
||||
const getDateColor = (date) => {
|
||||
|
@ -253,22 +259,27 @@ const getDateColor = (date) => {
|
|||
@update:model-value="() => fetchAgencies(data)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
:class="{
|
||||
'color-vn-label': !scope.opt?.isActive,
|
||||
}"
|
||||
<QItem
|
||||
v-bind="scope.itemProps"
|
||||
:class="{ disabled: !scope.opt.isActive }"
|
||||
>
|
||||
{{
|
||||
`${
|
||||
!scope.opt?.isActive
|
||||
? t('basicData.inactive')
|
||||
: ''
|
||||
} `
|
||||
}}
|
||||
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }}
|
||||
<QItemSection style="min-width: min-content" avatar>
|
||||
<QIcon
|
||||
v-if="
|
||||
scope.opt.isActive && data.addressId === scope.opt.id
|
||||
"
|
||||
size="sm"
|
||||
color="grey"
|
||||
name="star"
|
||||
class="fill-icon"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ scope.opt.nickname }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ `${scope.opt.street}, ${scope.opt.city}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -24,13 +24,14 @@ const supplier = ref(null);
|
|||
const supplierAccountRef = ref(null);
|
||||
const wireTransferFk = ref(null);
|
||||
const bankEntitiesOptions = ref([]);
|
||||
const filteredBankEntitiesOptions = ref([]);
|
||||
|
||||
const onBankEntityCreated = async (dataSaved, rowData) => {
|
||||
await bankEntitiesRef.value.fetch();
|
||||
rowData.bankEntityFk = dataSaved.id;
|
||||
};
|
||||
|
||||
const onChangesSaved = () => {
|
||||
const onChangesSaved = async () => {
|
||||
if (supplier.value.payMethodFk !== wireTransferFk.value)
|
||||
quasar
|
||||
.dialog({
|
||||
|
@ -47,7 +48,6 @@ const onChangesSaved = () => {
|
|||
};
|
||||
|
||||
const setWireTransfer = async () => {
|
||||
try {
|
||||
const params = {
|
||||
id: route.params.id,
|
||||
payMethodFk: wireTransferFk.value,
|
||||
|
@ -55,16 +55,36 @@ const setWireTransfer = async () => {
|
|||
|
||||
await axios.patch(`Suppliers/${route.params.id}`, params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error setting wire transfer', err);
|
||||
}
|
||||
};
|
||||
|
||||
function findBankFk(value, row) {
|
||||
row.bankEntityFk = null;
|
||||
if (!value) return;
|
||||
|
||||
const bankEntityFk = bankEntitiesOptions.value.find((b) => b.id == value.slice(4, 8));
|
||||
if (bankEntityFk) row.bankEntityFk = bankEntityFk.id;
|
||||
}
|
||||
|
||||
function bankEntityFilter(val, update) {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
filteredBankEntitiesOptions.value = bankEntitiesOptions.value.filter(
|
||||
(bank) =>
|
||||
bank.bic.toLowerCase().startsWith(needle) ||
|
||||
bank.name.toLowerCase().includes(needle)
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
ref="bankEntitiesRef"
|
||||
url="BankEntities"
|
||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||
@on-fetch="
|
||||
(data) => {
|
||||
(bankEntitiesOptions = data), (filteredBankEntitiesOptions = data);
|
||||
}
|
||||
"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
|
@ -102,6 +122,7 @@ const setWireTransfer = async () => {
|
|||
<VnInput
|
||||
:label="t('supplier.accounts.iban')"
|
||||
v-model="row.iban"
|
||||
@update:model-value="(value) => findBankFk(value, row)"
|
||||
:required="true"
|
||||
>
|
||||
<template #append>
|
||||
|
@ -113,7 +134,9 @@ const setWireTransfer = async () => {
|
|||
<VnSelectDialog
|
||||
:label="t('worker.create.bankEntity')"
|
||||
v-model="row.bankEntityFk"
|
||||
:options="bankEntitiesOptions"
|
||||
:options="filteredBankEntitiesOptions"
|
||||
:default-filter="false"
|
||||
@filter="(val, update) => bankEntityFilter(val, update)"
|
||||
option-label="bic"
|
||||
option-value="id"
|
||||
hide-selected
|
||||
|
@ -126,7 +149,6 @@ const setWireTransfer = async () => {
|
|||
(_, requestResponse) =>
|
||||
onBankEntityCreated(requestResponse, row)
|
||||
"
|
||||
:show-entity-field="false"
|
||||
/>
|
||||
</template>
|
||||
<template #option="scope">
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import VnAccountNumber from 'src/components/common/VnAccountNumber.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -100,10 +101,13 @@ function handleLocation(data, location) {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInput
|
||||
<VnAccountNumber
|
||||
v-model="data.account"
|
||||
:label="t('supplier.fiscalData.account')"
|
||||
clearable
|
||||
data-cy="supplierFiscalDataAccount"
|
||||
insertable
|
||||
:maxlength="10"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('supplier.fiscalData.sageTaxTypeFk')"
|
||||
|
|
|
@ -124,8 +124,7 @@ const columns = computed(() => [
|
|||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
Search suppliers: Search suppliers
|
||||
es:
|
||||
Search suppliers: Buscar proveedores
|
||||
Create Supplier: Crear proveedor
|
||||
</i18n>
|
||||
|
|
|
@ -33,6 +33,7 @@ const canEditZone = useAcl().hasAny([
|
|||
const agencyFetchRef = ref();
|
||||
const warehousesOptions = ref([]);
|
||||
const companiesOptions = ref([]);
|
||||
const currenciesOptions = ref([]);
|
||||
const agenciesOptions = ref([]);
|
||||
const zonesOptions = ref([]);
|
||||
const addresses = ref([]);
|
||||
|
|
|
@ -321,10 +321,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
<div class="column">
|
||||
<span v-for="(saleComponent, index) in row.components" :key="index">
|
||||
{{ toCurrency(saleComponent.value * row.quantity, 'EUR', 3) }}
|
||||
<!-- <QTooltip>
|
||||
{{ saleComponent.component?.name }}:
|
||||
{{ toCurrency(saleComponent.value, 'EUR', 3) }}
|
||||
</QTooltip> -->
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -130,6 +130,7 @@ function ticketFilter(ticket) {
|
|||
<QBadge
|
||||
text-color="black"
|
||||
:color="entity.ticketState.state.classColor"
|
||||
data-cy="ticketDescriptorStateBadge"
|
||||
>
|
||||
{{ entity.ticketState.state.name }}
|
||||
</QBadge>
|
||||
|
@ -174,7 +175,7 @@ function ticketFilter(ticket) {
|
|||
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="entity.problem.includes('hasRisk')"
|
||||
v-if="entity?.problem?.includes('hasRisk')"
|
||||
name="vn:risk"
|
||||
size="xs"
|
||||
color="primary"
|
||||
|
|
|
@ -239,7 +239,7 @@ function makeInvoiceDialog() {
|
|||
}
|
||||
async function makeInvoice() {
|
||||
const params = {
|
||||
ticketsIds: [parseInt(ticketId)],
|
||||
ticketsIds: [parseInt(ticketId.value)],
|
||||
};
|
||||
await axios.post(`Tickets/invoiceTicketsAndPdf`, params);
|
||||
|
||||
|
@ -265,7 +265,7 @@ async function transferClient(client) {
|
|||
|
||||
async function addTurn(day) {
|
||||
const params = {
|
||||
ticketFk: parseInt(ticketId),
|
||||
ticketFk: parseInt(ticketId.value),
|
||||
weekDay: day,
|
||||
agencyModeFk: ticket.value.agencyModeFk,
|
||||
};
|
||||
|
@ -280,7 +280,7 @@ async function addTurn(day) {
|
|||
|
||||
async function createRefund(withWarehouse) {
|
||||
const params = {
|
||||
ticketsIds: [parseInt(ticketId)],
|
||||
ticketsIds: [parseInt(ticketId.value)],
|
||||
withWarehouse: withWarehouse,
|
||||
negative: true,
|
||||
};
|
||||
|
@ -368,7 +368,7 @@ async function uploadDocuware(force) {
|
|||
|
||||
const { data } = await axios.post(`Docuwares/upload`, {
|
||||
fileCabinet: 'deliveryNote',
|
||||
ticketIds: [parseInt(ticketId)],
|
||||
ticketIds: [parseInt(ticketId.value)],
|
||||
});
|
||||
|
||||
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
|
||||
|
@ -676,7 +676,7 @@ async function uploadDocuware(force) {
|
|||
<VnConfirm
|
||||
ref="weightDialog"
|
||||
:title="t('Set weight')"
|
||||
:message="t('This ticket may be invoiced, do you want to continue?')"
|
||||
:message="false"
|
||||
:promise="actions.setWeight"
|
||||
>
|
||||
<template #customHTML>
|
||||
|
@ -741,7 +741,6 @@ es:
|
|||
Ticket invoiced: Ticket facturado
|
||||
Set weight: Establecer peso
|
||||
Weight set: Peso establecido
|
||||
This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar?
|
||||
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
||||
This ticket will be removed from current route! Continue anyway?: ¡Se eliminará el ticket de la ruta actual! ¿Continuar de todas formas?
|
||||
You are going to delete this ticket: Vas a eliminar este ticket
|
||||
|
|
|
@ -75,6 +75,7 @@ const cancel = () => {
|
|||
dense
|
||||
style="width: 50%"
|
||||
@click="save()"
|
||||
data-cy="saveManaBtn"
|
||||
>
|
||||
{{ t('globals.save') }}
|
||||
</QBtn>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue