Compare commits
368 Commits
8205-geoFk
...
dev
Author | SHA1 | Date |
---|---|---|
Alex Moreno | 9d289fa11e | |
Alex Moreno | ded035285b | |
Alex Moreno | 05b383ecb0 | |
Sergio De la torre | 6f73758cad | |
Sergio De la torre | c50ff6a43a | |
Sergio De la torre | eee73f001d | |
Sergio De la torre | 7f17cd59e7 | |
Sergio De la torre | ef68884fe0 | |
Sergio De la torre | b5e27707a7 | |
Sergio De la torre | 0340612645 | |
Guillermo Bonet | aa62f1d483 | |
Guillermo Bonet | 86a2b1de1e | |
Guillermo Bonet | 9584ffcf5b | |
Guillermo Bonet | 04180bf8da | |
Guillermo Bonet | 5998002420 | |
Guillermo Bonet | fff6979921 | |
Guillermo Bonet | 7a5ed0ff23 | |
Guillermo Bonet | 934507569e | |
Guillermo Bonet | e6abb1d759 | |
Guillermo Bonet | 044a22bc3e | |
PAU ROVIRA ROSALENY | 5ef1d615a7 | |
PAU ROVIRA ROSALENY | 1cdeadb59d | |
Guillermo Bonet | e636d43f04 | |
Guillermo Bonet | a666cfa4cd | |
Javi Gallego | d4b7d54052 | |
Guillermo Bonet | 1aa1fbda6c | |
Guillermo Bonet | 69b78b6bf1 | |
Javi Gallego | 125b7730e7 | |
Guillermo Bonet | 4d98c340d2 | |
Javi Gallego | b8dbaec46c | |
Robert Ferrús | 03c974db12 | |
Javi Gallego | 69f1e76307 | |
Robert Ferrús | 0e8b4d92bf | |
Carlos Andrés | c24b008567 | |
Ivan Mas | 8da1d866e3 | |
Ivan Mas | 416e6c81f1 | |
Guillermo Bonet | c2ca9cfbe5 | |
Jon Elias | d0df1c1f42 | |
Robert Ferrús | 620d14355c | |
Carlos Satorres | d95482ea54 | |
Carlos Satorres | d9716154bb | |
Carlos Satorres | 01072f7cbc | |
Alex Moreno | e273733832 | |
Javi Gallego | 44765b5a64 | |
Robert Ferrús | 2585cce627 | |
Alex Moreno | 48ad72ac98 | |
Alex Moreno | b4686def94 | |
Alex Moreno | 6aa898ee59 | |
Alex Moreno | 105a5045cf | |
Jon Elias | 29e6a99983 | |
Robert Ferrús | 0891fc6665 | |
Alex Moreno | 43edb1f82e | |
Alex Moreno | 00577056dd | |
Alex Moreno | 6e56bdeeb1 | |
Robert Ferrús | c4870d52de | |
Javi Gallego | c15a3bfe50 | |
Alex Moreno | e15fc01267 | |
Alex Moreno | 13455f6a20 | |
Alex Moreno | 951376af2f | |
Alex Moreno | 9d05b16404 | |
Jose Antonio Tubau | 1cd7eda4ac | |
Robert Ferrús | f6f8f2214c | |
Robert Ferrús | 1c30de5eee | |
Robert Ferrús | bdaaffbbd7 | |
Robert Ferrús | 26a319832c | |
Sergio De la torre | 5ce23ee122 | |
Sergio De la torre | 1ac75d87ad | |
Robert Ferrús | ac48d5a406 | |
Sergio De la torre | a1e1d4fa72 | |
Sergio De la torre | 12fa87a93c | |
Guillermo Bonet | e01d7c1fc6 | |
Guillermo Bonet | e2763a4da9 | |
Guillermo Bonet | 6a85272085 | |
Robert Ferrús | 446ffac7f8 | |
Guillermo Bonet | 4e608eccc8 | |
Guillermo Bonet | 2f0a79da3f | |
Guillermo Bonet | 18adbf9c69 | |
Guillermo Bonet | 1787cd3102 | |
Guillermo Bonet | 2141d7d95d | |
Alex Moreno | c8cfbf8d40 | |
Alex Moreno | 1783f6f7e0 | |
Jorge Penadés | bd5610afb6 | |
Jorge Penadés | 1bca1eb8e6 | |
Jorge Penadés | 7391beb29e | |
Carlos Satorres | e17eb518dd | |
Carlos Satorres | cafe6d812a | |
Carlos Satorres | d258de1194 | |
Alex Moreno | 2becb20d01 | |
Guillermo Bonet | 6b39e5c651 | |
Guillermo Bonet | 15ac9bfd0a | |
Guillermo Bonet | d0d1950e75 | |
Robert Ferrús | eba9a1e38c | |
Jorge Penadés | 50a95ed3c4 | |
Jorge Penadés | b12c3bb72f | |
Jorge Penadés | 412638d590 | |
Jorge Penadés | 838617e3f6 | |
Jorge Penadés | f557b41feb | |
Javi Gallego | 53c604762a | |
Ivan Mas | f9666b8e60 | |
Ivan Mas | 14b88b1ad6 | |
Jorge Penadés | c07e30a89c | |
Javi Gallego | be56313706 | |
Robert Ferrús | bdbc02e1b7 | |
Alex Moreno | f1b45a3903 | |
Alex Moreno | e57e9ee9dd | |
Alex Moreno | 60933216f7 | |
Alex Moreno | a4e22485c0 | |
Alex Moreno | ecc877e07d | |
Alex Moreno | 9842f70bec | |
Sergio De la torre | 71006797af | |
Javi Gallego | 0d822d03c9 | |
Sergio De la torre | 70ad6e2624 | |
Javi Gallego | 1816b6de67 | |
Alex Moreno | c0c75c1bee | |
Alex Moreno | 5ab06ef6e4 | |
Robert Ferrús | 94ccdabe89 | |
Ivan Mas | 0940a31288 | |
Javi Gallego | dbd8d816c0 | |
Guillermo Bonet | 2572182a89 | |
Robert Ferrús | 8417030438 | |
Guillermo Bonet | c83e6a8bbd | |
Ivan Mas | b68ffb0819 | |
Ivan Mas | 23fb04876c | |
Guillermo Bonet | 065f13557b | |
Javi Gallego | 786f1fe661 | |
Javi Gallego | 73d5d508ce | |
Jon Elias | b1dda9f82b | |
Jon Elias | c06f2c4e6f | |
Alex Moreno | 1d8dcdf63f | |
Alex Moreno | b83499c180 | |
Robert Ferrús | f04f88d2fc | |
Javi Gallego | 399081f83c | |
Javi Gallego | 4f3c101e42 | |
Alex Moreno | 1cd083ac68 | |
Alex Moreno | a713ef64e8 | |
Alex Moreno | 48d4bab706 | |
Alex Moreno | 72bf27f08d | |
Jon Elias | c3a5a5da27 | |
Jon Elias | ecee47f859 | |
Robert Ferrús | 5c42130495 | |
Jon Elias | ad0c1eb4c5 | |
Alex Moreno | dc52c08c15 | |
Alex Moreno | e0a5a3cd8c | |
Pablo Natek | 79ee81117b | |
Pablo Natek | 67c484cd87 | |
Alex Moreno | cfe886b687 | |
Ivan Mas | 8822fde7fb | |
Pablo Natek | 98b68a2c74 | |
Sergio De la torre | 05b8c3451a | |
Jon Elias | fb57a1fa31 | |
Jon Elias | 5221b9254a | |
Alex Moreno | 7092226c01 | |
Alex Moreno | bf80cbbf4a | |
Javier Segarra | c80ce7d7a7 | |
Javi Gallego | 0ad26b336d | |
Javi Gallego | 1f23ebf6d5 | |
Ivan Mas | 1cc6e37697 | |
Jorge Penadés | 879ffcad64 | |
Javi Gallego | be50c91299 | |
Javi Gallego | a26de63660 | |
Javi Gallego | 8ca5808554 | |
Javi Gallego | 49d87ea44f | |
Javi Gallego | 98e2483565 | |
Javi Gallego | 5acd4520f8 | |
Jose Antonio Tubau | 48d2d1d327 | |
Jose Antonio Tubau | 49263a5458 | |
Jose Antonio Tubau | 0665453465 | |
Jose Antonio Tubau | a2218b41f8 | |
Jorge Penadés | 549cb7633e | |
Jorge Penadés | 4887fa0cae | |
Ivan Mas | c59cae9f74 | |
Ivan Mas | da4968f8b1 | |
Jorge Penadés | 6abbf3ec1d | |
Jorge Penadés | 1f7dae2514 | |
Pablo Natek | ea4b118015 | |
Javi Gallego | a99d7adfe8 | |
Pablo Natek | b838e988e0 | |
Pablo Natek | 49c30890e5 | |
Javi Gallego | 9ae27e104e | |
Carlos Andrés | 8ca8e11f1c | |
Carlos Andrés | 83d46d0a28 | |
Ivan Mas | b7666f5395 | |
Ivan Mas | 148ab57b1a | |
Javi Gallego | 6c2d7641f5 | |
Ivan Mas | 5620242d7e | |
Ivan Mas | 1ba23ad450 | |
Carlos Andrés | 94136d35ff | |
Jorge Penadés | c0893f8684 | |
Ivan Mas | ae220007e4 | |
Ivan Mas | ab5cf0f497 | |
Alex Moreno | 42c3cdae5d | |
Alex Moreno | 0f40d6d0ec | |
Alex Moreno | cfee497adb | |
Alex Moreno | 64d9c7e52f | |
Alex Moreno | 116ec5b107 | |
Jorge Penadés | dd5d9bcb08 | |
Jorge Penadés | 7a3339b623 | |
Jorge Penadés | 3deaa8a95b | |
Jorge Penadés | 8f1fb0a120 | |
Jose Antonio Tubau | 43d5243766 | |
Alex Moreno | 1a8b05c46b | |
Ivan Mas | af86bb24c4 | |
Jorge Penadés | 52a0e718c7 | |
Jorge Penadés | 31952725aa | |
Carlos Satorres | 539edeb26a | |
Carlos Satorres | 148b82ea93 | |
Jorge Penadés | 9ac8e60f0c | |
Jorge Penadés | b935878dd6 | |
Jorge Penadés | f965f7aa52 | |
Carlos Satorres | acfafa1c72 | |
Jorge Penadés | b4c8e16019 | |
Carlos Satorres | acccb4abc3 | |
Jorge Penadés | 6476eb28e6 | |
Alex Moreno | 2cd1991a96 | |
Alex Moreno | 21f4e2aad7 | |
Guillermo Bonet | db2a102a88 | |
Guillermo Bonet | 4f4eb389c9 | |
Carlos Satorres | 26b0ea647d | |
Robert Ferrús | 68715a8c36 | |
Alex Moreno | 863f204247 | |
Juanjo Breso | 8166414678 | |
Juanjo Breso | 6a3cbed3dd | |
Juanjo Breso | 5a7ac8dcb3 | |
Juanjo Breso | 48064d6393 | |
Juanjo Breso | de69a8db1d | |
Juanjo Breso | 11db90c67c | |
Juanjo Breso | deb1b68c49 | |
Juanjo Breso | 7232bfb7a6 | |
Juanjo Breso | d03a2ced04 | |
Guillermo Bonet | fda2c5725a | |
Carlos Satorres | f9434871d8 | |
Carlos Satorres | 5f43c0440c | |
Carlos Satorres | 576641d09d | |
Carlos Satorres | 1090a78e10 | |
Carlos Satorres | a6bb381b74 | |
Robert Ferrús | 4ba8c91c1e | |
Guillermo Bonet | 5346dd845e | |
Carlos Satorres | 692b1070e8 | |
Robert Ferrús | d14621c2d2 | |
Guillermo Bonet | 36705a028e | |
Robert Ferrús | e7e6c88ec5 | |
Carlos Satorres | 1e471ac20f | |
Carlos Satorres | d620f722b5 | |
Carlos Satorres | 32d9a3ace1 | |
Guillermo Bonet | 71fb3996cd | |
Jorge Penadés | d9eab36160 | |
Jorge Penadés | 4612bf2e9b | |
Guillermo Bonet | d9a6e8a1c9 | |
Guillermo Bonet | d42ff07547 | |
Carlos Satorres | e70ace613e | |
Carlos Satorres | 10c28b03da | |
Guillermo Bonet | 57c3cc8546 | |
Jose Antonio Tubau | 9c32dc5707 | |
Carlos Satorres | 72f369dc49 | |
Carlos Satorres | b14268ef1b | |
Guillermo Bonet | eadffe1ed9 | |
Robert Ferrús | 1d7e69cb25 | |
Guillermo Bonet | e1db7a86f6 | |
Guillermo Bonet | 233f45a07a | |
Carlos Satorres | 09e7ee4e43 | |
Carlos Andrés | ec2b6dd0c2 | |
Carlos Andrés | 11827207ba | |
Javi Gallego | e748e9a012 | |
Guillermo Bonet | 00b5333ab7 | |
Guillermo Bonet | bfad016ec4 | |
Sergio De la torre | 2c672951c6 | |
Sergio De la torre | 31a6db5da0 | |
Guillermo Bonet | 05ba85219b | |
Guillermo Bonet | 95d7c7f227 | |
Jorge Penadés | c83f34859a | |
Carlos Satorres | f66b3f1cbd | |
Carlos Satorres | dcd8b1ee15 | |
Carlos Satorres | cd214b3526 | |
Carlos Satorres | d35e785bee | |
Carlos Satorres | e9d304f2ba | |
Carlos Satorres | 1970b9c0db | |
Jorge Penadés | 8b37d99287 | |
Carlos Satorres | 43697eaba7 | |
Carlos Satorres | 9c53fe9f60 | |
Carlos Satorres | b3eb8334ca | |
Carlos Satorres | efcf4d225b | |
Carlos Satorres | 201b9b049b | |
Guillermo Bonet | 65e195d77d | |
Jorge Penadés | addb093b6b | |
Jorge Penadés | c0b1fe3994 | |
Guillermo Bonet | 186ef52518 | |
Guillermo Bonet | bc072208d7 | |
Guillermo Bonet | 252a029c98 | |
Juanjo Breso | 0d26c52d5d | |
Robert Ferrús | 7886adb8f5 | |
Juanjo Breso | 193e628118 | |
Juanjo Breso | 28ab6b2266 | |
Jorge Penadés | 2a2b4b139b | |
Guillermo Bonet | c8ec94bed9 | |
Juanjo Breso | ce58a9ab2c | |
Juanjo Breso | 8797635101 | |
Juanjo Breso | 10558853a2 | |
Carlos Satorres | 391f1d8c97 | |
Jorge Penadés | 46448d5fc2 | |
Jorge Penadés | fcb842d948 | |
Guillermo Bonet | cba5d88c5e | |
Jorge Penadés | f69dfbd5aa | |
Jorge Penadés | 7c2c56ed9a | |
Guillermo Bonet | 85baf151d9 | |
Guillermo Bonet | e279cc4b47 | |
Guillermo Bonet | 0bb9282953 | |
Guillermo Bonet | 8960b54664 | |
Jorge Penadés | db8ab307ab | |
Jorge Penadés | ea5bf85b55 | |
Jorge Penadés | 5b04debfb1 | |
Jorge Penadés | 9d26a9df7d | |
Robert Ferrús | b49595fb13 | |
Jorge Penadés | 00085f2b99 | |
Jorge Penadés | 59b5dd5a36 | |
Jorge Penadés | ac87905351 | |
Jorge Penadés | c9cf96676b | |
Jorge Penadés | 163c6ddd20 | |
Jorge Penadés | 9ece52c5ce | |
Jorge Penadés | 03bf115831 | |
Jorge Penadés | 332e1c62d9 | |
Jorge Penadés | 1f6e401e39 | |
Jorge Penadés | c270ec3723 | |
Robert Ferrús | 7afd14a301 | |
Jorge Penadés | 7d5ae9dfbd | |
Jorge Penadés | f92543a628 | |
Jorge Penadés | ba51052d88 | |
Jorge Penadés | 4bb3305704 | |
Jorge Penadés | 5db1262e08 | |
Jorge Penadés | 4234e614fb | |
Robert Ferrús | e3971848e8 | |
Robert Ferrús | 70042c02aa | |
Robert Ferrús | d9aa11b3e9 | |
Jorge Penadés | 6ab25c2ff5 | |
Jorge Penadés | a68e287b23 | |
Jorge Penadés | 9a645c3288 | |
Jorge Penadés | ad35a354a9 | |
Robert Ferrús | 72b2bd688e | |
Robert Ferrús | 5a92fe1691 | |
Robert Ferrús | 96902afc83 | |
Ivan Mas | 10e332ca85 | |
Robert Ferrús | 69314171ea | |
Jorge Penadés | 2f3efa15ba | |
Jorge Penadés | 88e92648e9 | |
Jorge Penadés | 3db6ab0778 | |
Jorge Penadés | 41512a0516 | |
Jorge Penadés | e9df8e06c8 | |
Jorge Penadés | 72dcb84523 | |
Jorge Penadés | 611cd12392 | |
Jorge Penadés | 598813cbd1 | |
Jorge Penadés | 679dd6929b | |
Juanjo Breso | f1370d6960 | |
Jon Elias | 2c0f596175 | |
Ivan Mas | bbc4eff922 | |
Ivan Mas | c593b95935 | |
Jon Elias | da824516f3 | |
Jon Elias | 2ec0d7f186 | |
Carlos Andrés | 2a1fa8ca68 | |
Carlos Andrés | ca3ac64072 | |
Jon Elias | e91386dc92 | |
Jon Elias | f4015117e3 | |
Jon Elias | 8e2359a672 | |
Jon Elias | ce77d4bf2b | |
Jon Elias | a6799cba0f | |
Jon Elias | 698ef3dec3 | |
Jon Elias | 5d4b79e313 | |
Jon Elias | 451e3bebef | |
Jon Elias | da749a5dcb | |
Jon Elias | 6fbc5a1a54 |
131
CHANGELOG.md
131
CHANGELOG.md
|
@ -1,3 +1,134 @@
|
||||||
|
# Version 25.00 - 2025-01-14
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- feat: refs #7235 add serialType parameter to getInvoiceDate and implement corresponding tests by:jgallego
|
||||||
|
- feat: refs #7301 update lastEntriesFilter to include landedDate and enhance test cases (origin/7301-removeRedundantInventories) by:pablone
|
||||||
|
- feat: refs #7880 error code and translations by:ivanm
|
||||||
|
- feat: refs #7924 add isCustomInspectionRequired field to item and update related logic by:jgallego
|
||||||
|
- feat: refs #8167 update canBeInvoiced method to include active status check and improve test cases by:jgallego
|
||||||
|
- feat: refs #8167 update locale and improve invoicing logic with error handling by:jgallego
|
||||||
|
- feat: refs #8246 added relation for the front's new field by:Jon
|
||||||
|
- feat: refs #8266 added itemFk and needed fixtures by:jtubau
|
||||||
|
- feat: refs #8324 country unique by:Carlos Andrés
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- feat: refs #8266 added itemFk and needed fixtures by:jtubau
|
||||||
|
- fix: add isCustomInspectionRequired column to item table for customs inspection indication by:jgallego
|
||||||
|
- fix: canBeInvoiced only in makeInvoice by:alexm
|
||||||
|
- fix: hotFix getMondayWeekYear by:alexm
|
||||||
|
- fix: refs #6598 update ACL property assignment by:jorgep
|
||||||
|
- fix: refs #6861 refs#6861 addPrevOK by:sergiodt
|
||||||
|
- fix: refs #7301 remove debug console log and update test cases in lastEntriesFilter by:pablone
|
||||||
|
- fix: refs #7301 update SQL fixtures and improve lastEntriesFilter logic by:pablone
|
||||||
|
|
||||||
|
# Version 24.52 - 2024-01-07
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: pullinfo by:alexm
|
||||||
|
- chore: refs #8002 drop comments by:jorgep
|
||||||
|
- chore: refs #8002 drop useless code by:jorgep
|
||||||
|
- feat: added translations and show error in item-type by:Jon
|
||||||
|
- feat: modified data to be equal as the updated back by:Jon
|
||||||
|
- feat: refs #4460 invoiceIn refund by:Carlos Andrés
|
||||||
|
- feat: refs #4466 invoiceIn refund by:Carlos Andrés
|
||||||
|
- feat: refs #6583 add new opt in where builder by:jorgep
|
||||||
|
- feat: refs #6583 add tests by:jorgep
|
||||||
|
- feat: refs #6583 retrieve cloned sale by:jorgep
|
||||||
|
- feat: refs #6583 rollback by:jorgep
|
||||||
|
- feat: refs #7301 add inventory-config and acl by:pablone
|
||||||
|
- feat: refs #7301 update SQL fixtures and enhance lastEntriesFilter logic by:pablone
|
||||||
|
- feat: refs #7882 Added locationiq service by:guillermo
|
||||||
|
- feat: refs #7882 Added osrm service by:guillermo
|
||||||
|
- feat: refs #7882 Added tests by:guillermo
|
||||||
|
- feat: refs #7882 Fixed problems osrm service by:guillermo
|
||||||
|
- feat: refs #7882 Osrm service by:guillermo
|
||||||
|
- feat: refs #7882 Reequested changes by:guillermo
|
||||||
|
- feat: refs #7882 Requested changes by:guillermo
|
||||||
|
- feat: refs #7936 add back test for updateInvoiceIn by:jorgep
|
||||||
|
- feat: refs #7936 add company filter by:jorgep
|
||||||
|
- feat: refs #7936 add currency check to updateInvoiceIn by:jorgep
|
||||||
|
- feat: refs #7936 add currency handling in invoiceIn trigger by:jorgep
|
||||||
|
- feat: refs #7936 add locale by:jorgep
|
||||||
|
- feat: refs #7936 add minimum due date by:jorgep
|
||||||
|
- feat: refs #7936 add reference rates for currency in fixtures by:jorgep
|
||||||
|
- feat: refs #7936 add save validation by:jorgep
|
||||||
|
- feat: refs #7936 add SiiTypeInvoiceIn model and update invoice correction logic by:jorgep
|
||||||
|
- feat: refs #7936 add tests for invoiceIn by:jorgep
|
||||||
|
- feat: refs #7936 add tests for invoiceIn filter by:jorgep
|
||||||
|
- feat: refs #7936 add validation to InvoiceIn & InvoiceInTax by:jorgep
|
||||||
|
- feat: refs #7936 return country code & is vies fields by:jorgep
|
||||||
|
- feat: refs #8002 adjust to lilium by:jorgep
|
||||||
|
- feat: refs #8002 drop support btn by:jorgep
|
||||||
|
- feat: refs #8174 Changed datatype incompatibility access by:guillermo
|
||||||
|
- feat: refs #8174 Created table sim by:guillermo
|
||||||
|
- feat: refs #8174 create table simsupplier by:Jbreso
|
||||||
|
- feat: refs #8174 fix by:Jbreso
|
||||||
|
- feat: refs#8174 simSupplier by:Jbreso
|
||||||
|
- feat: refs #8190 entry_getCommission by:robert
|
||||||
|
- feat: refs #8190 entry_getCommission change request by:robert
|
||||||
|
- feat: refs #8218 Added time and code in mistakeType by:guillermo
|
||||||
|
- feat: refs #8293 include zone data by:Jtubau
|
||||||
|
- refactor: refs #6583 entry report table style by:jorgep
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- refactor: refs #6583 entry report table style by:jorgep
|
||||||
|
- refactor: refs #6583 use warehouseId var by:jorgep
|
||||||
|
- refactor: refs #7301 update entry and item filter tests to validate results against specific criteria by:pablone
|
||||||
|
- refactor: refs #7882 Added ACL's by:guillermo
|
||||||
|
- refactor: refs #7882 Deleted quadminds files by:guillermo
|
||||||
|
- refactor: refs #7936 add transaction & tests by:jorgep
|
||||||
|
- refactor: refs #7936 remove old trigger and add isRaid column to travel table by:jorgep
|
||||||
|
- refactor: refs #7936 remove schema by:jorgep
|
||||||
|
- refactor: refs #8002 use loop wip by:jorgep
|
||||||
|
- refactor: refs #8004 simplify SQL query by removing redundant aliases by:pablone
|
||||||
|
- refactor: refs #8262 Deprecated inventoryFailure by:guillermo
|
||||||
|
- refactor: refs #8266 changed expedition item name by:Jtubau
|
||||||
|
- refactor: refs #8272 delete bi.rotacion by:ivanm
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- feat: refs #7301 update SQL fixtures and enhance lastEntriesFilter logic by:pablone
|
||||||
|
- feat: refs #7936 add reference rates for currency in fixtures by:jorgep
|
||||||
|
- feat: refs #8174 fix by:Jbreso
|
||||||
|
- fix: 8174 pasar PIN a CHAR by:Jbreso
|
||||||
|
- fix: monitorPayMethodFilter by:carlossa
|
||||||
|
- fix: refs #6389 back by:carlossa
|
||||||
|
- fix: refs #6389 filter by:carlossa
|
||||||
|
- fix: refs #6389 packing by:carlossa
|
||||||
|
- fix: refs #6389 saleMonitor filter by:carlossa
|
||||||
|
- fix: refs #6389 salesFilter by:carlossa
|
||||||
|
- fix: refs #6583 drop focus by:jorgep
|
||||||
|
- fix: refs #6583 update onlyWithDestination logic to handle null values correctly by:jorgep
|
||||||
|
- fix: refs #7028 fix confirm deny by:carlossa
|
||||||
|
- fix: refs #7028 fix pr by:carlossa
|
||||||
|
- fix: refs #7028 fix tback findById by:carlossa
|
||||||
|
- fix: refs #7028 fix userError by:carlossa
|
||||||
|
- fix: refs #7028 remove ifs by:carlossa
|
||||||
|
- fix: refs #7028 requesterId fix by:carlossa
|
||||||
|
- fix: refs #7028 requesterId fix salesPerson by:carlossa
|
||||||
|
- fix: refs #7031 fix vnPrice by:carlossa
|
||||||
|
- fix: refs #7031 remove check by:carlossa
|
||||||
|
- fix: refs #7301 update ACL insertion to use INSERT IGNORE and refine property value by:pablone
|
||||||
|
- fix: refs #7936 add IF NOT EXISTS to isRaid column in travel table by:jorgep
|
||||||
|
- fix: refs #7936 change type by:jorgep
|
||||||
|
- fix: refs #7936 check if insert in hook & change test description by:jorgep
|
||||||
|
- fix: refs #7936 conflicts by:jorgep
|
||||||
|
- fix: refs #7936 locale by:jorgep
|
||||||
|
- fix: refs #7936 update Spanish locale for SII terms by:jorgep
|
||||||
|
- fix: refs #8174 fix by:Jbreso
|
||||||
|
- fix: refs#8174 fix by:Jbreso
|
||||||
|
- fix: refs8174 pasar a char el PIN by:Jbreso
|
||||||
|
- fix: refs #8174 Version by:guillermo
|
||||||
|
- fix: refs #8251 add eng template by:carlossa
|
||||||
|
- fix: refs #8315 fixture claimDevelopment by:alexm
|
||||||
|
|
||||||
# Version 24.48 - 2024-11-25
|
# Version 24.48 - 2024-11-25
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -27,38 +27,46 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.sendCheckingPresence = async(ctx, recipientId, message) => {
|
Self.sendCheckingPresence = async(ctx, recipientId, message) => {
|
||||||
if (!recipientId) return false;
|
|
||||||
const models = Self.app.models;
|
|
||||||
|
|
||||||
const userId = ctx.req.accessToken.userId;
|
const userId = ctx.req.accessToken.userId;
|
||||||
const sender = await models.VnUser.findById(userId, {fields: ['id']});
|
|
||||||
const recipient = await models.VnUser.findById(recipientId, null);
|
|
||||||
|
|
||||||
// Prevent sending messages to yourself
|
|
||||||
if (recipientId == userId) return false;
|
|
||||||
if (!recipient)
|
|
||||||
throw new Error(`Could not send message "${message}" to worker id ${recipientId} from user ${userId}`);
|
|
||||||
|
|
||||||
if (!isProduction())
|
|
||||||
message = `[Test:Environment to user ${userId}] ` + message;
|
|
||||||
|
|
||||||
const chat = await models.Chat.create({
|
|
||||||
senderFk: sender.id,
|
|
||||||
recipient: `@${recipient.name}`,
|
|
||||||
dated: Date.vnNew(),
|
|
||||||
checkUserStatus: 1,
|
|
||||||
message: message,
|
|
||||||
status: 'sending',
|
|
||||||
attempts: 0
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Self.sendCheckingUserStatus(chat);
|
const models = Self.app.models;
|
||||||
await Self.updateChat(chat, 'sent');
|
const sender = await models.VnUser.findById(userId, {fields: ['id']});
|
||||||
} catch (error) {
|
const error = `Could not send message from user ${userId}`;
|
||||||
await Self.updateChat(chat, 'error', error);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
if (!recipientId) throw new Error(error);
|
||||||
|
const recipient = await models.VnUser.findById(recipientId, null);
|
||||||
|
if (!recipient)
|
||||||
|
throw new Error(error);
|
||||||
|
|
||||||
|
// Prevent sending messages to yourself
|
||||||
|
if (recipientId == userId) return false;
|
||||||
|
|
||||||
|
if (!isProduction())
|
||||||
|
message = `[Test:Environment to user ${userId}] ` + message;
|
||||||
|
|
||||||
|
const chat = await models.Chat.create({
|
||||||
|
senderFk: sender.id,
|
||||||
|
recipient: `@${recipient.name}`,
|
||||||
|
dated: Date.vnNew(),
|
||||||
|
checkUserStatus: 1,
|
||||||
|
message: message,
|
||||||
|
status: 'sending',
|
||||||
|
attempts: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await Self.sendCheckingUserStatus(chat);
|
||||||
|
await Self.updateChat(chat, 'sent');
|
||||||
|
} catch (error) {
|
||||||
|
await Self.updateChat(chat, 'error', error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
await Self.rawSql(`
|
||||||
|
INSERT INTO util.debug (variable, value)
|
||||||
|
VALUES ('sendCheckingPresence_error', ?)
|
||||||
|
`, [`User: ${userId}, recipient: ${recipientId}, message: ${message}, error: ${e}`]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,6 +40,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
const sales = await Self.rawSql(`
|
const sales = await Self.rawSql(`
|
||||||
SELECT s.ticketFk,
|
SELECT s.ticketFk,
|
||||||
|
NULL ticketOrder,
|
||||||
sgd.saleGroupFk,
|
sgd.saleGroupFk,
|
||||||
s.id saleFk,
|
s.id saleFk,
|
||||||
s.itemFk,
|
s.itemFk,
|
||||||
|
@ -83,6 +84,7 @@ module.exports = Self => {
|
||||||
GROUP BY s.id, ish.id, p.code, p2.code
|
GROUP BY s.id, ish.id, p.code, p2.code
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT s.ticketFk,
|
SELECT s.ticketFk,
|
||||||
|
DENSE_RANK() OVER (ORDER BY ss.id),
|
||||||
sgd.saleGroupFk,
|
sgd.saleGroupFk,
|
||||||
s.id saleFk,
|
s.id saleFk,
|
||||||
s.itemFk,
|
s.itemFk,
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
const axios = require('axios');
|
||||||
|
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('optimize', {
|
||||||
|
description: 'Return optimized coords',
|
||||||
|
accessType: 'READ',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'addressIds',
|
||||||
|
type: 'array',
|
||||||
|
required: true
|
||||||
|
}, {
|
||||||
|
arg: 'firstAddressId',
|
||||||
|
type: 'number',
|
||||||
|
required: false
|
||||||
|
}, {
|
||||||
|
arg: 'lastAddressId',
|
||||||
|
type: 'number',
|
||||||
|
required: false
|
||||||
|
}],
|
||||||
|
returns: {
|
||||||
|
type: 'object',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/optimize`,
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.optimize = async(addressIds, firstAddressId, lastAddressId) => {
|
||||||
|
const models = Self.app.models;
|
||||||
|
try {
|
||||||
|
const osrmConfig = await models.OsrmConfig.findOne();
|
||||||
|
if (!osrmConfig) throw new UserError(`OSRM service is not configured`);
|
||||||
|
|
||||||
|
let coords = [];
|
||||||
|
if (firstAddressId) {
|
||||||
|
const address = await models.Address.findById(firstAddressId);
|
||||||
|
if (address.latitude && address.longitude) {
|
||||||
|
coords.push({
|
||||||
|
addressId: address.id,
|
||||||
|
latitude: address.latitude.toFixed(6),
|
||||||
|
longitude: address.longitude.toFixed(6)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const addressId of addressIds) {
|
||||||
|
const address = await models.Address.findById(addressId);
|
||||||
|
if (address.latitude && address.longitude) {
|
||||||
|
coords.push({
|
||||||
|
addressId,
|
||||||
|
latitude: address.latitude.toFixed(6),
|
||||||
|
longitude: address.longitude.toFixed(6)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastAddressId) {
|
||||||
|
const firstAddress = await models.Address.findById(lastAddressId);
|
||||||
|
if (firstAddress.latitude && firstAddress.longitude) {
|
||||||
|
coords.push({
|
||||||
|
addressId: firstAddress.id,
|
||||||
|
latitude: firstAddress.latitude.toFixed(6),
|
||||||
|
longitude: firstAddress.longitude.toFixed(6)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!coords.length) throw new UserError('No address has coordinates');
|
||||||
|
|
||||||
|
const concatCoords = coords
|
||||||
|
.map(coord => `${coord.longitude},${coord.latitude}`)
|
||||||
|
.join(';');
|
||||||
|
const response = await axios.post(`
|
||||||
|
${osrmConfig.url}/trip/v1/driving/${concatCoords}?source=first&destination=last&roundtrip=true
|
||||||
|
`);
|
||||||
|
const tolerance = osrmConfig.tolerance;
|
||||||
|
for (const waypoint of response.data.waypoints) {
|
||||||
|
const longitude = waypoint.location[0];
|
||||||
|
const latitude = waypoint.location[1];
|
||||||
|
|
||||||
|
const matchedAddress = coords.find(coord =>
|
||||||
|
coord.position === undefined &&
|
||||||
|
Math.abs(coord.latitude - latitude) <= tolerance &&
|
||||||
|
Math.abs(coord.longitude - longitude) <= tolerance
|
||||||
|
);
|
||||||
|
if (matchedAddress)
|
||||||
|
matchedAddress.position = waypoint.waypoint_index;
|
||||||
|
}
|
||||||
|
coords.sort((a, b) => {
|
||||||
|
const posA = a.position !== undefined ? a.position : Infinity;
|
||||||
|
const posB = b.position !== undefined ? b.position : Infinity;
|
||||||
|
return posA - posB;
|
||||||
|
});
|
||||||
|
|
||||||
|
return coords;
|
||||||
|
} catch (err) {
|
||||||
|
switch (err.response?.data?.code) {
|
||||||
|
case 'NoTrips':
|
||||||
|
throw new UserError('No trips found because input coordinates are not connected');
|
||||||
|
case 'NotImplemented':
|
||||||
|
throw new UserError('This request is not supported');
|
||||||
|
case 'InvalidOptions':
|
||||||
|
throw new UserError('Invalid options or too many coordinates');
|
||||||
|
default:
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,33 @@
|
||||||
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
|
describe('osrmConfig optimize()', function() {
|
||||||
|
it('should send coords, receive OSRM response, and return a correctly ordered result', async function() {
|
||||||
|
const result = await models.OsrmConfig.optimize([4, 3], 1, 2);
|
||||||
|
|
||||||
|
// Verifications
|
||||||
|
expect(Array.isArray(result)).toBe(true);
|
||||||
|
expect(result.length).toBe(4);
|
||||||
|
|
||||||
|
// Check the order
|
||||||
|
expect(result[0].addressId).toBe(1);
|
||||||
|
expect(result[1].addressId).toBe(4);
|
||||||
|
expect(result[2].addressId).toBe(3);
|
||||||
|
expect(result[3].addressId).toBe(2);
|
||||||
|
|
||||||
|
// Check the coordinates format
|
||||||
|
expect(result[0].latitude).toBe('10.111111');
|
||||||
|
expect(result[0].longitude).toBe('-74.111111');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if no addresses are provided', async function() {
|
||||||
|
let error;
|
||||||
|
try {
|
||||||
|
await models.OsrmConfig.optimize([], null);
|
||||||
|
} catch (e) {
|
||||||
|
error = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(error).toBeDefined();
|
||||||
|
expect(error.message).toBe('No address has coordinates');
|
||||||
|
});
|
||||||
|
});
|
|
@ -19,7 +19,7 @@ module.exports = Self => {
|
||||||
if (acl.principalType == 'ROLE' && acl.permission == 'ALLOW') {
|
if (acl.principalType == 'ROLE' && acl.permission == 'ALLOW') {
|
||||||
const staticAcl = {
|
const staticAcl = {
|
||||||
model: model.name,
|
model: model.name,
|
||||||
property: '*',
|
property: acl.property,
|
||||||
accessType: acl.accessType,
|
accessType: acl.accessType,
|
||||||
permission: acl.permission,
|
permission: acl.permission,
|
||||||
principalType: acl.principalType,
|
principalType: acl.principalType,
|
||||||
|
|
|
@ -22,7 +22,7 @@ module.exports = Self => {
|
||||||
description: 'The user email'
|
description: 'The user email'
|
||||||
}, {
|
}, {
|
||||||
arg: 'lang',
|
arg: 'lang',
|
||||||
type: 'string',
|
type: 'any',
|
||||||
description: 'The user lang'
|
description: 'The user lang'
|
||||||
}, {
|
}, {
|
||||||
arg: 'twoFactor',
|
arg: 'twoFactor',
|
||||||
|
|
|
@ -88,6 +88,9 @@
|
||||||
"Language": {
|
"Language": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"OsrmConfig": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"Machine": {
|
"Machine": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
require('../methods/osrm-config/optimize')(Self);
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "OsrmConfig",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "osrmConfig"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true,
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"tolerance": {
|
||||||
|
"type": "number",
|
||||||
|
"required": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,7 +4,7 @@ USE `util`;
|
||||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
|
||||||
INSERT INTO `version` VALUES ('vn-database','11377','d3fe5098277c3935c434838b53facb271f84ebec','2024-12-10 07:22:33','11379');
|
INSERT INTO `version` VALUES ('vn-database','11391','43edb1f82e88dcc44eedc8501b93c1fac66d71e9','2025-01-14 07:32:09','11407');
|
||||||
|
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL);
|
||||||
|
@ -1078,11 +1078,13 @@ INSERT INTO `versionLog` VALUES ('vn-database','11315','00-firstScript.sql','jen
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11316','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11316','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11317','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11317','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11319','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11319','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11320','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2025-01-14 07:32:07',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11321','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11321','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11322','00-entryAcl.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11322','00-entryAcl.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11324','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-13 10:49:47',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11324','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-13 10:49:47',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11325','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11325','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11326','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11326','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11327','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:24',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11330','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11330','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11331','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11331','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11332','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11332','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
||||||
|
@ -1110,6 +1112,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','11348','00-firstScript.sql','jen
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11349','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11349','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11350','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11350','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11351','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11351','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11352','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:24',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11353','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11353','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11354','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11354','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11355','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11355','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||||
|
@ -1120,6 +1123,8 @@ INSERT INTO `versionLog` VALUES ('vn-database','11362','00-firstScript.sql','jen
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11363','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11363','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11366','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11366','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11367','00-deprecate.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11367','00-deprecate.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:04',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11368','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:32',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11368','01-acls.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:32',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11369','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:05',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11369','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:05',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11371','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:05',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11371','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:05',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11371','01-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:47',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11371','01-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:20:47',NULL,NULL);
|
||||||
|
@ -1128,7 +1133,16 @@ INSERT INTO `versionLog` VALUES ('vn-database','11371','03-firstScript.sql','jen
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11372','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-09 13:30:30',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11372','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-09 13:30:30',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11373','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-02 16:09:01',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11373','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-02 16:09:01',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11375','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-03 08:58:20',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11375','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-03 08:58:20',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11376','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:32',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','11377','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:22:31',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','11377','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-12-10 07:22:31',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11378','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:32',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11379','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:32',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11379','01-secScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:32',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11384','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:32',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11385','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-07 07:46:33',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11390','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2025-01-14 07:32:08',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11391','00-itemAlter.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2025-01-14 07:32:08',NULL,NULL);
|
||||||
|
INSERT INTO `versionLog` VALUES ('vn-database','11400','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2025-01-09 09:55:24',NULL,NULL);
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
@ -1505,6 +1519,7 @@ INSERT INTO `roleInherit` VALUES (378,101,15,19294);
|
||||||
INSERT INTO `roleInherit` VALUES (379,103,121,19294);
|
INSERT INTO `roleInherit` VALUES (379,103,121,19294);
|
||||||
INSERT INTO `roleInherit` VALUES (381,119,123,19295);
|
INSERT INTO `roleInherit` VALUES (381,119,123,19295);
|
||||||
INSERT INTO `roleInherit` VALUES (382,48,72,783);
|
INSERT INTO `roleInherit` VALUES (382,48,72,783);
|
||||||
|
INSERT INTO `roleInherit` VALUES (383,114,111,19295);
|
||||||
|
|
||||||
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
|
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
|
||||||
|
|
||||||
|
@ -2128,7 +2143,7 @@ INSERT INTO `ACL` VALUES (746,'Claim','getSummary','READ','ALLOW','ROLE','claimV
|
||||||
INSERT INTO `ACL` VALUES (747,'CplusRectificationType','*','READ','ALLOW','ROLE','administrative',NULL);
|
INSERT INTO `ACL` VALUES (747,'CplusRectificationType','*','READ','ALLOW','ROLE','administrative',NULL);
|
||||||
INSERT INTO `ACL` VALUES (748,'SiiTypeInvoiceOut','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
INSERT INTO `ACL` VALUES (748,'SiiTypeInvoiceOut','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
||||||
INSERT INTO `ACL` VALUES (749,'InvoiceCorrectionType','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
INSERT INTO `ACL` VALUES (749,'InvoiceCorrectionType','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
||||||
INSERT INTO `ACL` VALUES (750,'InvoiceOut','transfer','WRITE','ALLOW','ROLE','administrative',NULL);
|
INSERT INTO `ACL` VALUES (750,'InvoiceOut','transfer','WRITE','ALLOW','ROLE','administrative',13657);
|
||||||
INSERT INTO `ACL` VALUES (751,'Application','executeProc','*','ALLOW','ROLE','employee',NULL);
|
INSERT INTO `ACL` VALUES (751,'Application','executeProc','*','ALLOW','ROLE','employee',NULL);
|
||||||
INSERT INTO `ACL` VALUES (752,'Application','executeFunc','*','ALLOW','ROLE','employee',NULL);
|
INSERT INTO `ACL` VALUES (752,'Application','executeFunc','*','ALLOW','ROLE','employee',NULL);
|
||||||
INSERT INTO `ACL` VALUES (753,'NotificationSubscription','getList','READ','ALLOW','ROLE','employee',NULL);
|
INSERT INTO `ACL` VALUES (753,'NotificationSubscription','getList','READ','ALLOW','ROLE','employee',NULL);
|
||||||
|
@ -2301,9 +2316,9 @@ INSERT INTO `ACL` VALUES (938,'Worker','__get__mail','READ','ALLOW','ROLE','hr',
|
||||||
INSERT INTO `ACL` VALUES (939,'Machine','*','*','ALLOW','ROLE','productionBoss',10578);
|
INSERT INTO `ACL` VALUES (939,'Machine','*','*','ALLOW','ROLE','productionBoss',10578);
|
||||||
INSERT INTO `ACL` VALUES (940,'ItemTypeLog','find','READ','ALLOW','ROLE','employee',10578);
|
INSERT INTO `ACL` VALUES (940,'ItemTypeLog','find','READ','ALLOW','ROLE','employee',10578);
|
||||||
INSERT INTO `ACL` VALUES (941,'Entry','buyLabel','READ','ALLOW','ROLE','employee',10578);
|
INSERT INTO `ACL` VALUES (941,'Entry','buyLabel','READ','ALLOW','ROLE','employee',10578);
|
||||||
INSERT INTO `ACL` VALUES (942,'Cmr','filter','READ','ALLOW','ROLE','production',10578);
|
INSERT INTO `ACL` VALUES (942,'Cmr','filter','READ','ALLOW','ROLE','employee',19295);
|
||||||
INSERT INTO `ACL` VALUES (943,'Cmr','downloadZip','READ','ALLOW','ROLE','production',10578);
|
INSERT INTO `ACL` VALUES (943,'Cmr','downloadZip','READ','ALLOW','ROLE','employee',19295);
|
||||||
INSERT INTO `ACL` VALUES (944,'Cmr','print','READ','ALLOW','ROLE','production',10578);
|
INSERT INTO `ACL` VALUES (944,'Cmr','print','READ','ALLOW','ROLE','employee',19295);
|
||||||
INSERT INTO `ACL` VALUES (945,'Collection','create','WRITE','ALLOW','ROLE','productionBoss',10578);
|
INSERT INTO `ACL` VALUES (945,'Collection','create','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||||
INSERT INTO `ACL` VALUES (946,'Collection','upsert','WRITE','ALLOW','ROLE','productionBoss',10578);
|
INSERT INTO `ACL` VALUES (946,'Collection','upsert','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||||
INSERT INTO `ACL` VALUES (947,'Collection','replaceById','WRITE','ALLOW','ROLE','productionBoss',10578);
|
INSERT INTO `ACL` VALUES (947,'Collection','replaceById','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||||
|
@ -2317,7 +2332,6 @@ INSERT INTO `ACL` VALUES (954,'RouteComplement','find','READ','ALLOW','ROLE','de
|
||||||
INSERT INTO `ACL` VALUES (955,'RouteComplement','create','WRITE','ALLOW','ROLE','delivery',10578);
|
INSERT INTO `ACL` VALUES (955,'RouteComplement','create','WRITE','ALLOW','ROLE','delivery',10578);
|
||||||
INSERT INTO `ACL` VALUES (956,'RouteComplement','deleteById','WRITE','ALLOW','ROLE','delivery',10578);
|
INSERT INTO `ACL` VALUES (956,'RouteComplement','deleteById','WRITE','ALLOW','ROLE','delivery',10578);
|
||||||
INSERT INTO `ACL` VALUES (957,'SaleGroup','find','READ','ALLOW','ROLE','production',10578);
|
INSERT INTO `ACL` VALUES (957,'SaleGroup','find','READ','ALLOW','ROLE','production',10578);
|
||||||
INSERT INTO `ACL` VALUES (958,'Worker','canCreateAbsenceInPast','WRITE','ALLOW','ROLE','hr',10578);
|
|
||||||
INSERT INTO `ACL` VALUES (959,'WorkerRelative','updateAttributes','*','ALLOW','ROLE','hr',10578);
|
INSERT INTO `ACL` VALUES (959,'WorkerRelative','updateAttributes','*','ALLOW','ROLE','hr',10578);
|
||||||
INSERT INTO `ACL` VALUES (960,'WorkerRelative','crud','WRITE','ALLOW','ROLE','hr',10578);
|
INSERT INTO `ACL` VALUES (960,'WorkerRelative','crud','WRITE','ALLOW','ROLE','hr',10578);
|
||||||
INSERT INTO `ACL` VALUES (961,'WorkerRelative','findById','*','ALLOW','ROLE','hr',10578);
|
INSERT INTO `ACL` VALUES (961,'WorkerRelative','findById','*','ALLOW','ROLE','hr',10578);
|
||||||
|
@ -2369,6 +2383,12 @@ INSERT INTO `ACL` VALUES (1006,'Entry','latestBuysFilter','READ','ALLOW','ROLE',
|
||||||
INSERT INTO `ACL` VALUES (1007,'ItemShelving','getItemsByReviewOrder','READ','ALLOW','ROLE','production',19294);
|
INSERT INTO `ACL` VALUES (1007,'ItemShelving','getItemsByReviewOrder','READ','ALLOW','ROLE','production',19294);
|
||||||
INSERT INTO `ACL` VALUES (1008,'Entry','buyLabelSupplier','READ','ALLOW','ROLE','employee',19295);
|
INSERT INTO `ACL` VALUES (1008,'Entry','buyLabelSupplier','READ','ALLOW','ROLE','employee',19295);
|
||||||
INSERT INTO `ACL` VALUES (1009,'Entry','buyLabel','READ','ALLOW','ROLE','supplier',19295);
|
INSERT INTO `ACL` VALUES (1009,'Entry','buyLabel','READ','ALLOW','ROLE','supplier',19295);
|
||||||
|
INSERT INTO `ACL` VALUES (1010,'InventoryConfig','find','READ','ALLOW','ROLE','buyer',10578);
|
||||||
|
INSERT INTO `ACL` VALUES (1011,'SiiTypeInvoiceIn','find','READ','ALLOW','ROLE','salesPerson',10578);
|
||||||
|
INSERT INTO `ACL` VALUES (1012,'OsrmConfig','optimize','READ','ALLOW','ROLE','employee',10578);
|
||||||
|
INSERT INTO `ACL` VALUES (1013,'Route','optimizePriority','*','ALLOW','ROLE','employee',10578);
|
||||||
|
INSERT INTO `ACL` VALUES (1014,'Worker','canModifyAbsenceInPast','WRITE','ALLOW','ROLE','hr',10578);
|
||||||
|
INSERT INTO `ACL` VALUES (1015,'Worker','__get__sip','READ','ALLOW','ROLE','employee',19294);
|
||||||
|
|
||||||
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
|
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
|
||||||
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
||||||
|
@ -2525,9 +2545,8 @@ INSERT INTO `companyI18n` VALUES (442,'en','In compliance with the provisions of
|
||||||
INSERT INTO `companyI18n` VALUES (442,'fr','Conformément aux dispositions de la loi organique 15/1999 sur la protection des données personnelles, nous vous informons que les données personnelles que vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous pouvez à tout moment, exercer les droits d``accès, de rectification, d``annulation et d``opposition, en communiquant par écrit au siège social de la société. Le dossier a pour objet la gestion administrative, la comptabilité et la facturation.');
|
INSERT INTO `companyI18n` VALUES (442,'fr','Conformément aux dispositions de la loi organique 15/1999 sur la protection des données personnelles, nous vous informons que les données personnelles que vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous pouvez à tout moment, exercer les droits d``accès, de rectification, d``annulation et d``opposition, en communiquant par écrit au siège social de la société. Le dossier a pour objet la gestion administrative, la comptabilité et la facturation.');
|
||||||
INSERT INTO `companyI18n` VALUES (442,'pt','Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão administrativa, contabilidade e facturação.');
|
INSERT INTO `companyI18n` VALUES (442,'pt','Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão administrativa, contabilidade e facturação.');
|
||||||
|
|
||||||
INSERT INTO `cplusRectificationType` VALUES (1,'Campo vacio');
|
INSERT INTO `cplusRectificationType` VALUES (1,'S – Por sustitución');
|
||||||
INSERT INTO `cplusRectificationType` VALUES (2,'I – Por diferencias');
|
INSERT INTO `cplusRectificationType` VALUES (2,'I – Por diferencias');
|
||||||
INSERT INTO `cplusRectificationType` VALUES (3,'S – Por sustitución');
|
|
||||||
|
|
||||||
INSERT INTO `cplusSubjectOp` VALUES (1,'Campo vacio');
|
INSERT INTO `cplusSubjectOp` VALUES (1,'Campo vacio');
|
||||||
INSERT INTO `cplusSubjectOp` VALUES (2,'S1 – Sujeta – No exenta');
|
INSERT INTO `cplusSubjectOp` VALUES (2,'S1 – Sujeta – No exenta');
|
||||||
|
@ -2619,6 +2638,8 @@ INSERT INTO `claimResult` VALUES (26,'Decepcion/Esperaba mas');
|
||||||
INSERT INTO `claimResult` VALUES (27,'Otros');
|
INSERT INTO `claimResult` VALUES (27,'Otros');
|
||||||
INSERT INTO `claimResult` VALUES (28,'Baboso/Cocido');
|
INSERT INTO `claimResult` VALUES (28,'Baboso/Cocido');
|
||||||
INSERT INTO `claimResult` VALUES (29,'Videocámaras');
|
INSERT INTO `claimResult` VALUES (29,'Videocámaras');
|
||||||
|
INSERT INTO `claimResult` VALUES (30,'Manipulado');
|
||||||
|
INSERT INTO `claimResult` VALUES (31,'ReclamReclamado PR/AG');
|
||||||
|
|
||||||
INSERT INTO `component` VALUES (10,'Precios Especiales',4,NULL,NULL,1,'specialPrices',0);
|
INSERT INTO `component` VALUES (10,'Precios Especiales',4,NULL,NULL,1,'specialPrices',0);
|
||||||
INSERT INTO `component` VALUES (14,'porte extra por dia semana',6,NULL,NULL,1,'extraCostPerWeekDay',0);
|
INSERT INTO `component` VALUES (14,'porte extra por dia semana',6,NULL,NULL,1,'extraCostPerWeekDay',0);
|
||||||
|
@ -2710,7 +2731,7 @@ INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',122,123,NULL,72,0,0,
|
||||||
INSERT INTO `department` VALUES (125,'spainTeam3','EQUIPO ESPAÑA 3',59,60,1118,0,0,0,2,0,43,'/1/43/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
INSERT INTO `department` VALUES (125,'spainTeam3','EQUIPO ESPAÑA 3',59,60,1118,0,0,0,2,0,43,'/1/43/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||||
INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL,NULL,NULL);
|
INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL,NULL,NULL);
|
||||||
INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',31,32,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'PALLETIZING');
|
INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',31,32,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'PALLETIZING');
|
||||||
INSERT INTO `department` VALUES (130,NULL,'REVISION',33,34,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'ON_CHECKING');
|
INSERT INTO `department` VALUES (130,'reviewers','REVISION',33,34,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'ON_CHECKING');
|
||||||
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',105,106,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
|
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',105,106,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
|
||||||
INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',61,62,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',61,62,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||||
INSERT INTO `department` VALUES (133,'franceTeamManagement','EQUIPO GESTIÓN FRANCIA',63,64,9751,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'gestionfrancia@verdnatura.es',0,0,0,0,NULL,NULL,'3300',NULL);
|
INSERT INTO `department` VALUES (133,'franceTeamManagement','EQUIPO GESTIÓN FRANCIA',63,64,9751,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'gestionfrancia@verdnatura.es',0,0,0,0,NULL,NULL,'3300',NULL);
|
||||||
|
@ -2725,12 +2746,12 @@ INSERT INTO `department` VALUES (146,NULL,'VERDNACOLOMBIA',3,4,NULL,72,0,0,2,0,2
|
||||||
INSERT INTO `department` VALUES (147,'spainTeamAsia','EQUIPO ESPAÑA ASIA',71,72,40214,0,0,0,2,0,43,'/1/43/','esA_equipo',1,'esA@verdnatura.es',0,0,0,0,NULL,NULL,'5500',NULL);
|
INSERT INTO `department` VALUES (147,'spainTeamAsia','EQUIPO ESPAÑA ASIA',71,72,40214,0,0,0,2,0,43,'/1/43/','esA_equipo',1,'esA@verdnatura.es',0,0,0,0,NULL,NULL,'5500',NULL);
|
||||||
INSERT INTO `department` VALUES (148,'franceTeamCatchment','EQUIPO CAPTACIÓN FRANCIA',73,74,25178,0,0,0,2,0,43,'/1/43/',NULL,1,NULL,0,0,0,0,NULL,NULL,'6000',NULL);
|
INSERT INTO `department` VALUES (148,'franceTeamCatchment','EQUIPO CAPTACIÓN FRANCIA',73,74,25178,0,0,0,2,0,43,'/1/43/',NULL,1,NULL,0,0,0,0,NULL,NULL,'6000',NULL);
|
||||||
INSERT INTO `department` VALUES (149,'spainTeamCatchment','EQUIPO ESPAÑA CAPTACIÓN',75,76,1203,0,0,0,2,0,43,'/1/43/','es_captacion_equipo',1,'es_captacion@verdnatura.es',0,0,0,0,NULL,NULL,'5700',NULL);
|
INSERT INTO `department` VALUES (149,'spainTeamCatchment','EQUIPO ESPAÑA CAPTACIÓN',75,76,1203,0,0,0,2,0,43,'/1/43/','es_captacion_equipo',1,'es_captacion@verdnatura.es',0,0,0,0,NULL,NULL,'5700',NULL);
|
||||||
INSERT INTO `department` VALUES (150,'spainTeamLevanteIslands','EQUIPO ESPAÑA LEVANTE/ISLAS',77,78,1118,0,0,0,2,0,43,'/1/43/','es_levanteislas_equipo',1,'levanteislas.verdnatura@gmail.com',0,0,0,0,NULL,NULL,'5000',NULL);
|
INSERT INTO `department` VALUES (150,'spainTeamLevanteIslands','EQUIPO ESPAÑA LEVANTE',77,78,1118,0,0,0,2,0,43,'/1/43/','es_levante_equipo',1,'es_levante@verdnatura.es',0,0,0,0,NULL,NULL,'5000',NULL);
|
||||||
INSERT INTO `department` VALUES (151,'spainTeamNorthwest','EQUIPO ESPAÑA NOROESTE',79,80,7102,0,0,0,2,0,43,'/1/43/','es_noroeste_equipo',1,'noroeste.verdnatura@gmail.com',0,0,0,0,NULL,NULL,'5300',NULL);
|
INSERT INTO `department` VALUES (151,'spainTeamNorthwest','EQUIPO ESPAÑA NOROESTE',79,80,7102,0,0,0,2,0,43,'/1/43/','es_noroeste_equipo',1,'es_noroeste@verdnatura.es',0,0,0,0,NULL,NULL,'5300',NULL);
|
||||||
INSERT INTO `department` VALUES (152,'spainTeamNortheast','EQUIPO ESPAÑA NORESTE',81,82,1118,0,0,0,2,0,43,'/1/43/','es_noreste_equipo',1,'noreste.verdnatura@gmail.com',0,0,0,0,NULL,NULL,'5200',NULL);
|
INSERT INTO `department` VALUES (152,'spainTeamNortheast','EQUIPO ESPAÑA NORESTE',81,82,1118,0,0,0,2,0,43,'/1/43/','es_noreste_equipo',1,'es_noreste@verdnatura.es',0,0,0,0,NULL,NULL,'5200',NULL);
|
||||||
INSERT INTO `department` VALUES (153,'spainTeamSouth','EQUIPO ESPAÑA SUR',83,84,36578,0,0,0,2,0,43,'/1/43/','es_sur_equipo',1,'sur.verdnatura@gmail.com',0,0,0,0,NULL,NULL,'5400',NULL);
|
INSERT INTO `department` VALUES (153,'spainTeamSouth','EQUIPO ESPAÑA SUR',83,84,36578,0,0,0,2,0,43,'/1/43/','es_sur_equipo',1,'es_sur@verdnatura.es',0,0,0,0,NULL,NULL,'5400',NULL);
|
||||||
INSERT INTO `department` VALUES (154,'spainTeamCenter','EQUIPO ESPAÑA CENTRO',85,86,4661,0,0,0,2,0,43,'/1/43/','es_centro_equipo',1,'centro.verdnatura@gmail.com',0,0,0,0,NULL,NULL,'5100',NULL);
|
INSERT INTO `department` VALUES (154,'spainTeamCenter','EQUIPO ESPAÑA CENTRO',85,86,4661,0,0,0,2,0,43,'/1/43/','es_centro_equipo',1,'es_centro@verdnatura.es',0,0,0,0,NULL,NULL,'5100',NULL);
|
||||||
INSERT INTO `department` VALUES (155,'spainTeamVip','EQUIPO ESPAÑA VIP',87,88,5432,0,0,0,2,0,43,'/1/43/','es_vip_equipo',1,'vip.verdnatura@gmail.com',0,0,0,0,NULL,NULL,'5600',NULL);
|
INSERT INTO `department` VALUES (155,'spainTeamVip','EQUIPO ESPAÑA VIP',87,88,5432,0,0,0,2,0,43,'/1/43/','es_vip_equipo',1,'es_vip@verdnatura.es',0,0,0,0,NULL,NULL,'5600',NULL);
|
||||||
|
|
||||||
INSERT INTO `docuware` VALUES (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N',NULL);
|
INSERT INTO `docuware` VALUES (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N',NULL);
|
||||||
INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL);
|
INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL);
|
||||||
|
@ -3031,6 +3052,7 @@ INSERT INTO `message` VALUES (20,'clientNotVerified','Incomplete tax data, pleas
|
||||||
INSERT INTO `message` VALUES (21,'quantityLessThanMin','The quantity cannot be less than the minimum');
|
INSERT INTO `message` VALUES (21,'quantityLessThanMin','The quantity cannot be less than the minimum');
|
||||||
INSERT INTO `message` VALUES (22,'ORDER_ROW_UNAVAILABLE','The ordered quantity exceeds the available');
|
INSERT INTO `message` VALUES (22,'ORDER_ROW_UNAVAILABLE','The ordered quantity exceeds the available');
|
||||||
INSERT INTO `message` VALUES (23,'AMOUNT_NOT_MATCH_GROUPING','The quantity ordered does not match the grouping');
|
INSERT INTO `message` VALUES (23,'AMOUNT_NOT_MATCH_GROUPING','The quantity ordered does not match the grouping');
|
||||||
|
INSERT INTO `message` VALUES (24,'orderLinesWithZero','There are empty lines. Please delete them');
|
||||||
|
|
||||||
INSERT INTO `metatag` VALUES (2,'title','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración');
|
INSERT INTO `metatag` VALUES (2,'title','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración');
|
||||||
INSERT INTO `metatag` VALUES (3,'description','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración. Envío a toda España, pedidos por internet o por teléfono.');
|
INSERT INTO `metatag` VALUES (3,'description','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración. Envío a toda España, pedidos por internet o por teléfono.');
|
||||||
|
|
|
@ -979,7 +979,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','bi','officeBoss','Greuge_Evolution'
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','claimManager','rotacion','alexm@%','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','claimManager','rotacion','alexm@%','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','grafana','sale','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','grafana','sale','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','zonePromo__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','zonePromo__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','accountingConfig','alexm@%','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','accountingConfig','carlosap@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','accountingType','alexm@%','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','accountingType','alexm@%','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','agencyMode','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','agencyMode','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','cache','employee','visible','juan@10.5.1.2','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','cache','employee','visible','juan@10.5.1.2','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -1417,9 +1417,11 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','accountDetail',
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','project','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','project','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','machineDetail','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','machineDetail','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','workerActivityType','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','workerActivityType','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerSalesAssistant','route','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','delivery','zoneConfig','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerSalesAssistant','route','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','workCenter','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','workCenter','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerSalesAssistant','Rutas','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerSalesAssistant','Rutas','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','marketingBoss','specialPrice','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','genericAllocation','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','genericAllocation','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','businessReasonEnd','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','businessReasonEnd','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -1488,6 +1490,14 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemBaseTag',
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemBreederTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemBreederTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemShelvingLog','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemShelvingLog','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemTextureTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemTextureTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','travelThermograph','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','thermograph','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerSalesAssistant','Tickets','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','sim','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','zoneGeo','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','itemCampaign','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemCampaign','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','campaign','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
|
||||||
|
@ -1873,6 +1883,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','subordinateget
|
||||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_afterUpsert','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_afterUpsert','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','grafana','dayend','FUNCTION','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
INSERT IGNORE INTO `procs_priv` VALUES ('','util','grafana','dayend','FUNCTION','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||||
INSERT IGNORE INTO `procs_priv` VALUES ('','srt','production','buffer_settypebyname','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
INSERT IGNORE INTO `procs_priv` VALUES ('','srt','production','buffer_settypebyname','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||||
|
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','grafana','clientGetMana','FUNCTION','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','barcodeToItem','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','barcodeToItem','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','ticket_splititempackingtype','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','ticket_splititempackingtype','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','entry_getCommission','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','entry_getCommission','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||||
|
|
|
@ -2569,28 +2569,6 @@ SET character_set_client = utf8;
|
||||||
1 AS `Consumo` */;
|
1 AS `Consumo` */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
|
|
||||||
--
|
|
||||||
-- Temporary table structure for view `rotacion`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `rotacion`;
|
|
||||||
/*!50001 DROP VIEW IF EXISTS `rotacion`*/;
|
|
||||||
SET @saved_cs_client = @@character_set_client;
|
|
||||||
SET character_set_client = utf8;
|
|
||||||
/*!50001 CREATE VIEW `rotacion` AS SELECT
|
|
||||||
1 AS `Id_Article`,
|
|
||||||
1 AS `warehouse_id`,
|
|
||||||
1 AS `total`,
|
|
||||||
1 AS `rotacion`,
|
|
||||||
1 AS `cm3`,
|
|
||||||
1 AS `almacenaje`,
|
|
||||||
1 AS `manipulacion`,
|
|
||||||
1 AS `auxiliar`,
|
|
||||||
1 AS `mermas`,
|
|
||||||
1 AS `cm3reparto`,
|
|
||||||
1 AS `grams` */;
|
|
||||||
SET character_set_client = @saved_cs_client;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `rutasBoard`
|
-- Table structure for table `rutasBoard`
|
||||||
--
|
--
|
||||||
|
@ -6271,19 +6249,27 @@ BEGIN
|
||||||
* @param vDateFrom Fecha desde
|
* @param vDateFrom Fecha desde
|
||||||
* @param vDateTo Fecha hasta
|
* @param vDateTo Fecha hasta
|
||||||
*/
|
*/
|
||||||
IF vDateFrom IS NULL THEN
|
DECLARE vDaysInYear INT;
|
||||||
SET vDateFrom = util.VN_CURDATE() - INTERVAL WEEKDAY(util.VN_CURDATE()) DAY;
|
SET vDaysInYear = DATEDIFF(util.lastDayOfYear(CURDATE()), util.firstDayOfYear(CURDATE()));
|
||||||
|
|
||||||
|
SET vDateFrom = COALESCE(vDateFrom, util.VN_CURDATE());
|
||||||
|
SET vDateTo = COALESCE(vDateTo, util.VN_CURDATE());
|
||||||
|
|
||||||
|
IF DATEDIFF(vDateTo, vDateFrom) > vDaysInYear THEN
|
||||||
|
CALL util.throw('The period cannot be longer than one year');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF vDateTo IS NULL THEN
|
-- Obtiene el primer día de la semana de esa fecha
|
||||||
SET vDateTo = vDateFrom + INTERVAL 6 DAY;
|
SET vDateFrom = DATE_SUB(vDateFrom, INTERVAL ((WEEKDAY(vDateFrom) + 1) % 7) DAY);
|
||||||
END IF;
|
|
||||||
|
-- Obtiene el último día de la semana de esa fecha
|
||||||
|
SET vDateTo = DATE_ADD(vDateTo, INTERVAL (6 - ((WEEKDAY(vDateTo) + 1) % 7)) DAY);
|
||||||
|
|
||||||
CALL cache.last_buy_refresh(FALSE);
|
CALL cache.last_buy_refresh(FALSE);
|
||||||
|
|
||||||
REPLACE bs.waste
|
REPLACE bs.waste
|
||||||
SELECT YEAR(t.shipped),
|
SELECT YEARWEEK(t.shipped, 6) DIV 100,
|
||||||
WEEK(t.shipped, 4),
|
WEEK(t.shipped, 6),
|
||||||
it.workerFk,
|
it.workerFk,
|
||||||
it.id,
|
it.id,
|
||||||
s.itemFk,
|
s.itemFk,
|
||||||
|
@ -6329,9 +6315,9 @@ BEGIN
|
||||||
JOIN cache.last_buy lb ON lb.item_id = i.id
|
JOIN cache.last_buy lb ON lb.item_id = i.id
|
||||||
AND lb.warehouse_id = w.id
|
AND lb.warehouse_id = w.id
|
||||||
JOIN vn.buy b ON b.id = lb.buy_id
|
JOIN vn.buy b ON b.id = lb.buy_id
|
||||||
WHERE t.shipped BETWEEN vDateFrom AND vDateTo
|
WHERE t.shipped BETWEEN vDateFrom AND util.dayEnd(vDateTo)
|
||||||
AND w.isManaged
|
AND w.isManaged
|
||||||
GROUP BY YEAR(t.shipped), WEEK(t.shipped, 4), i.id;
|
GROUP BY YEARWEEK(t.shipped, 6) DIV 100, WEEK(t.shipped, 6), i.id;
|
||||||
END ;;
|
END ;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
@ -13829,7 +13815,7 @@ BEGIN
|
||||||
) INTO vHas0Amount;
|
) INTO vHas0Amount;
|
||||||
|
|
||||||
IF vHas0Amount THEN
|
IF vHas0Amount THEN
|
||||||
CALL util.throw('Hay líneas vacías. Por favor, elimínelas');
|
CALL util.throw('orderLinesWithZero');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
@ -17481,10 +17467,10 @@ BEGIN
|
||||||
/**
|
/**
|
||||||
* Traslada la info de contabilidad relacionada con las facturas recibidas
|
* Traslada la info de contabilidad relacionada con las facturas recibidas
|
||||||
*
|
*
|
||||||
* @vInvoiceInFk Factura recibida
|
* @param vInvoiceInFk Factura recibida
|
||||||
* @vXDiarioFk Id tabla XDiario
|
* @param vXDiarioFk Id tabla XDiario
|
||||||
*/
|
*/
|
||||||
DECLARE vInvoiceInOriginalFk INT;
|
DECLARE vInvoiceInOriginalFk INT;
|
||||||
DECLARE vDone BOOL DEFAULT FALSE;
|
DECLARE vDone BOOL DEFAULT FALSE;
|
||||||
DECLARE vBase DOUBLE;
|
DECLARE vBase DOUBLE;
|
||||||
DECLARE vVat DOUBLE;
|
DECLARE vVat DOUBLE;
|
||||||
|
@ -17502,7 +17488,7 @@ BEGIN
|
||||||
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
|
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
|
||||||
|
|
||||||
DECLARE vCursor CURSOR FOR
|
DECLARE vCursor CURSOR FOR
|
||||||
SELECT it.taxableBase,
|
SELECT SUM(it.taxableBase),
|
||||||
CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)),
|
CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)),
|
||||||
t.PorcentajeIva,
|
t.PorcentajeIva,
|
||||||
it.transactionTypeSageFk,
|
it.transactionTypeSageFk,
|
||||||
|
@ -17682,9 +17668,9 @@ BEGIN
|
||||||
WHERE correctingFk = vInvoiceInFk;
|
WHERE correctingFk = vInvoiceInFk;
|
||||||
|
|
||||||
IF vInvoiceInOriginalFk THEN
|
IF vInvoiceInOriginalFk THEN
|
||||||
|
|
||||||
UPDATE movContaIVA mci
|
UPDATE movContaIVA mci
|
||||||
JOIN vn.invoiceInRefund iir ON iir.invoiceInRefundFk = vInvoiceInFk
|
JOIN vn.invoiceInCorrection iic ON iic.correctingFk = vInvoiceInFk
|
||||||
|
JOIN vn.siiTypeInvoiceIn st ON st.id = iic.siiTypeInvoiceInFk
|
||||||
JOIN (SELECT issued,
|
JOIN (SELECT issued,
|
||||||
SUM(sub.taxableBase) taxableBase,
|
SUM(sub.taxableBase) taxableBase,
|
||||||
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
||||||
|
@ -17693,7 +17679,7 @@ BEGIN
|
||||||
ti.PorcentajeIva
|
ti.PorcentajeIva
|
||||||
FROM vn.invoiceIn i
|
FROM vn.invoiceIn i
|
||||||
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
||||||
JOIN sage.TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
JOIN TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
||||||
WHERE i.id = vInvoiceInOriginalFk
|
WHERE i.id = vInvoiceInOriginalFk
|
||||||
GROUP BY ti.CodigoIva)sub
|
GROUP BY ti.CodigoIva)sub
|
||||||
)invoiceInOriginal
|
)invoiceInOriginal
|
||||||
|
@ -17706,7 +17692,6 @@ BEGIN
|
||||||
mci.CuotaIvaOriginal = invoiceInOriginal.vat,
|
mci.CuotaIvaOriginal = invoiceInOriginal.vat,
|
||||||
mci.ClaveOperacionFactura = co.ClaveOperacionFactura_
|
mci.ClaveOperacionFactura = co.ClaveOperacionFactura_
|
||||||
WHERE mci.id = vXDiarioFk;
|
WHERE mci.id = vXDiarioFk;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
END ;;
|
END ;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
@ -18178,6 +18163,7 @@ BEGIN
|
||||||
UPDATE movContaIVA mci
|
UPDATE movContaIVA mci
|
||||||
JOIN vn.invoiceOut i ON i.id = vInvoiceOutCorrectedFk
|
JOIN vn.invoiceOut i ON i.id = vInvoiceOutCorrectedFk
|
||||||
JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutCorrectedFk
|
JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutCorrectedFk
|
||||||
|
JOIN vn.siiTypeInvoiceOut st ON st.id = ic.siiTypeInvoiceOutFk
|
||||||
JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase,
|
JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase,
|
||||||
SUM(IF(IFNULL(e.vatFk, TRUE), iot.vat, 0)) vat,
|
SUM(IF(IFNULL(e.vatFk, TRUE), iot.vat, 0)) vat,
|
||||||
SUM(IF(IFNULL(e.vatFk, TRUE), 0, iot.vat)) equ
|
SUM(IF(IFNULL(e.vatFk, TRUE), 0, iot.vat)) equ
|
||||||
|
@ -18186,8 +18172,8 @@ BEGIN
|
||||||
WHERE iot.invoiceOutFk = vInvoiceOutCorrectedFk
|
WHERE iot.invoiceOutFk = vInvoiceOutCorrectedFk
|
||||||
) tax
|
) tax
|
||||||
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
||||||
SET mci.TipoRectificativa = 2,
|
SET mci.TipoRectificativa = ic.cplusRectificationTypeFk,
|
||||||
mci.ClaseAbonoRectificativas = 1,
|
mci.ClaseAbonoRectificativas = REGEXP_REPLACE(st.`code`, '[^0-9]', ''),
|
||||||
mci.FechaFacturaOriginal = i.issued,
|
mci.FechaFacturaOriginal = i.issued,
|
||||||
mci.FechaOperacion = i.issued,
|
mci.FechaOperacion = i.issued,
|
||||||
mci.BaseImponibleOriginal = tax.taxableBase,
|
mci.BaseImponibleOriginal = tax.taxableBase,
|
||||||
|
@ -28944,6 +28930,7 @@ CREATE TABLE `country` (
|
||||||
`isSocialNameUnique` tinyint(1) NOT NULL DEFAULT 1,
|
`isSocialNameUnique` tinyint(1) NOT NULL DEFAULT 1,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `country_unique` (`code`),
|
UNIQUE KEY `country_unique` (`code`),
|
||||||
|
UNIQUE KEY `country_unique_name` (`name`),
|
||||||
KEY `currency_id_fk_idx` (`currencyFk`),
|
KEY `currency_id_fk_idx` (`currencyFk`),
|
||||||
KEY `country_Ix4` (`name`),
|
KEY `country_Ix4` (`name`),
|
||||||
KEY `continent_id_fk_idx` (`continentFk`),
|
KEY `continent_id_fk_idx` (`continentFk`),
|
||||||
|
@ -29528,14 +29515,16 @@ CREATE TABLE `deviceProductionUser` (
|
||||||
`userFk` int(10) unsigned NOT NULL,
|
`userFk` int(10) unsigned NOT NULL,
|
||||||
`created` timestamp NULL DEFAULT current_timestamp(),
|
`created` timestamp NULL DEFAULT current_timestamp(),
|
||||||
`editorFk` int(10) unsigned DEFAULT NULL,
|
`editorFk` int(10) unsigned DEFAULT NULL,
|
||||||
`simSerialNumber` text DEFAULT NULL,
|
`simFk` varchar(25) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `deviceProductionUser_unique` (`deviceProductionFk`),
|
UNIQUE KEY `deviceProductionUser_unique` (`deviceProductionFk`),
|
||||||
KEY `userFgn_idx` (`userFk`),
|
KEY `userFgn_idx` (`userFk`),
|
||||||
KEY `deviceProductionUser_fk_editor` (`editorFk`),
|
KEY `deviceProductionUser_fk_editor` (`editorFk`),
|
||||||
|
KEY `deviceProductionUser_sim_FK` (`simFk`),
|
||||||
CONSTRAINT `deviceProductionUser_PK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `deviceProductionUser_PK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `deviceProductionUser_deviceProduction_FK` FOREIGN KEY (`deviceProductionFk`) REFERENCES `deviceProduction` (`id`),
|
CONSTRAINT `deviceProductionUser_deviceProduction_FK` FOREIGN KEY (`deviceProductionFk`) REFERENCES `deviceProduction` (`id`),
|
||||||
CONSTRAINT `deviceProductionUser_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`)
|
CONSTRAINT `deviceProductionUser_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
|
||||||
|
CONSTRAINT `deviceProductionUser_sim_FK` FOREIGN KEY (`simFk`) REFERENCES `sim` (`code`) ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
@ -31354,13 +31343,27 @@ CREATE TABLE `inventoryConfig` (
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `inventoryFailure`
|
-- Table structure for table `inventoryFailureCause__`
|
||||||
--
|
--
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `inventoryFailure`;
|
DROP TABLE IF EXISTS `inventoryFailureCause__`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `inventoryFailure` (
|
CREATE TABLE `inventoryFailureCause__` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`description` varchar(100) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='@deprecated 2024-12-16';
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `inventoryFailure__`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `inventoryFailure__`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE `inventoryFailure__` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`dated` date NOT NULL,
|
`dated` date NOT NULL,
|
||||||
`itemFk` int(11) NOT NULL,
|
`itemFk` int(11) NOT NULL,
|
||||||
|
@ -31381,22 +31384,8 @@ CREATE TABLE `inventoryFailure` (
|
||||||
CONSTRAINT `inventoryFailure_fk2` FOREIGN KEY (`throwerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `inventoryFailure_fk2` FOREIGN KEY (`throwerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `inventoryFailure_fk3` FOREIGN KEY (`guiltyFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `inventoryFailure_fk3` FOREIGN KEY (`guiltyFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `inventoryFailure_fk4` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `inventoryFailure_fk4` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `inventoryFailure_fk5` FOREIGN KEY (`causeFk`) REFERENCES `inventoryFailureCause` (`id`) ON UPDATE CASCADE
|
CONSTRAINT `inventoryFailure_fk5` FOREIGN KEY (`causeFk`) REFERENCES `inventoryFailureCause__` (`id`) ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='@deprecated 2024-12-16';
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `inventoryFailureCause`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `inventoryFailureCause`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `inventoryFailureCause` (
|
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`description` varchar(100) NOT NULL,
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -31554,18 +31543,18 @@ CREATE TABLE `invoiceInCorrection` (
|
||||||
`correctingFk` mediumint(8) unsigned NOT NULL COMMENT 'Factura rectificativa',
|
`correctingFk` mediumint(8) unsigned NOT NULL COMMENT 'Factura rectificativa',
|
||||||
`correctedFk` mediumint(8) unsigned NOT NULL COMMENT 'Factura rectificada',
|
`correctedFk` mediumint(8) unsigned NOT NULL COMMENT 'Factura rectificada',
|
||||||
`cplusRectificationTypeFk` int(10) unsigned NOT NULL,
|
`cplusRectificationTypeFk` int(10) unsigned NOT NULL,
|
||||||
`siiTypeInvoiceOutFk` int(10) unsigned NOT NULL,
|
`siiTypeInvoiceInFk` int(10) unsigned NOT NULL,
|
||||||
`invoiceCorrectionTypeFk` int(11) NOT NULL DEFAULT 3,
|
`invoiceCorrectionTypeFk` int(11) NOT NULL DEFAULT 3,
|
||||||
PRIMARY KEY (`correctingFk`),
|
PRIMARY KEY (`correctingFk`),
|
||||||
KEY `invoiceInCorrection_correctedFk` (`correctedFk`),
|
KEY `invoiceInCorrection_correctedFk` (`correctedFk`),
|
||||||
KEY `invoiceInCorrection_cplusRectificationTypeFk` (`cplusRectificationTypeFk`),
|
KEY `invoiceInCorrection_cplusRectificationTypeFk` (`cplusRectificationTypeFk`),
|
||||||
KEY `invoiceInCorrection_siiTypeInvoiceOut` (`siiTypeInvoiceOutFk`),
|
KEY `invoiceInCorrection_siiTypeInvoiceIn` (`siiTypeInvoiceInFk`),
|
||||||
KEY `invoiceInCorrection_invoiceCorrectionTypeFk` (`invoiceCorrectionTypeFk`),
|
KEY `invoiceInCorrection_invoiceCorrectionTypeFk` (`invoiceCorrectionTypeFk`),
|
||||||
CONSTRAINT `invoiceInCorrection_correctedFk` FOREIGN KEY (`correctedFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `invoiceInCorrection_correctedFk` FOREIGN KEY (`correctedFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `invoiceInCorrection_correctingFk` FOREIGN KEY (`correctingFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `invoiceInCorrection_correctingFk` FOREIGN KEY (`correctingFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `invoiceInCorrection_cplusRectificationTypeFk` FOREIGN KEY (`cplusRectificationTypeFk`) REFERENCES `cplusRectificationType` (`id`) ON UPDATE CASCADE,
|
CONSTRAINT `invoiceInCorrection_cplusRectificationTypeFk` FOREIGN KEY (`cplusRectificationTypeFk`) REFERENCES `cplusRectificationType` (`id`) ON UPDATE CASCADE,
|
||||||
CONSTRAINT `invoiceInCorrection_invoiceCorrectionTypeFk` FOREIGN KEY (`invoiceCorrectionTypeFk`) REFERENCES `invoiceCorrectionType` (`id`) ON UPDATE CASCADE,
|
CONSTRAINT `invoiceInCorrection_invoiceCorrectionTypeFk` FOREIGN KEY (`invoiceCorrectionTypeFk`) REFERENCES `invoiceCorrectionType` (`id`) ON UPDATE CASCADE,
|
||||||
CONSTRAINT `invoiceInCorrection_siiTypeInvoiceOut` FOREIGN KEY (`siiTypeInvoiceOutFk`) REFERENCES `siiTypeInvoiceOut` (`id`) ON UPDATE CASCADE
|
CONSTRAINT `invoiceInCorrection_siiTypeInvoiceIn` FOREIGN KEY (`siiTypeInvoiceInFk`) REFERENCES `siiTypeInvoiceIn` (`id`) ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
@ -31991,6 +31980,7 @@ CREATE TABLE `item` (
|
||||||
`value12` varchar(50) DEFAULT NULL,
|
`value12` varchar(50) DEFAULT NULL,
|
||||||
`tag13` varchar(20) DEFAULT NULL,
|
`tag13` varchar(20) DEFAULT NULL,
|
||||||
`value13` varchar(50) DEFAULT NULL,
|
`value13` varchar(50) DEFAULT NULL,
|
||||||
|
`isCustomInspectionRequired` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Indicates if the item requires physical inspection at customs',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `item_supplyResponseFk_idx` (`supplyResponseFk`),
|
UNIQUE KEY `item_supplyResponseFk_idx` (`supplyResponseFk`),
|
||||||
KEY `Color` (`inkFk`),
|
KEY `Color` (`inkFk`),
|
||||||
|
@ -33837,7 +33827,9 @@ DROP TABLE IF EXISTS `mistakeType`;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `mistakeType` (
|
CREATE TABLE `mistakeType` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`code` varchar(50) DEFAULT NULL,
|
||||||
`description` varchar(45) NOT NULL,
|
`description` varchar(45) NOT NULL,
|
||||||
|
`time` int(10) DEFAULT NULL COMMENT 'Segundos que se suelen tardar en arreglar el fallo',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
@ -34204,6 +34196,22 @@ CREATE TABLE `osTicketConfig` (
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `osrmConfig`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `osrmConfig`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE `osrmConfig` (
|
||||||
|
`id` int(10) unsigned NOT NULL,
|
||||||
|
`url` varchar(100) NOT NULL COMMENT 'Dirección base de la API',
|
||||||
|
`tolerance` decimal(6,6) NOT NULL DEFAULT 0.000000 COMMENT 'Tolerancia entre las coordenadas enviadas y las retornadas',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
CONSTRAINT `osrmConfig_check` CHECK (`id` = 1)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `outgoingInvoiceVat`
|
-- Table structure for table `outgoingInvoiceVat`
|
||||||
--
|
--
|
||||||
|
@ -35763,26 +35771,6 @@ CREATE TABLE `punchState` (
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Table for storing punches that have cars with errors';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Table for storing punches that have cars with errors';
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `quadmindsApiConfig`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `quadmindsApiConfig`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `quadmindsApiConfig` (
|
|
||||||
`id` int(10) unsigned NOT NULL,
|
|
||||||
`url` varchar(255) DEFAULT NULL,
|
|
||||||
`key` varchar(255) DEFAULT NULL,
|
|
||||||
`maxObjects` int(11) DEFAULT NULL COMMENT 'Número máximo de objetos en el array por petición',
|
|
||||||
`limit` int(11) DEFAULT NULL COMMENT 'Limite de objetos solicitados por petición',
|
|
||||||
`orderTimeFrom` varchar(5) DEFAULT NULL COMMENT 'Inicio de ventana horaria de pedido',
|
|
||||||
`orderTimeTo` varchar(5) DEFAULT NULL COMMENT 'Fin de ventana horaria de pedido',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
CONSTRAINT `quadMindsConfig_check` CHECK (`id` = 1)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `quality`
|
-- Table structure for table `quality`
|
||||||
--
|
--
|
||||||
|
@ -37542,6 +37530,23 @@ CREATE TABLE `siiTypeInvoiceOut` (
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Tipo de Factura Emitidas en el suministro de inmediato';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Tipo de Factura Emitidas en el suministro de inmediato';
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `sim`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `sim`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE `sim` (
|
||||||
|
`code` varchar(25) NOT NULL COMMENT 'No se ha puesto BIGINT por incompatibilidad con Access',
|
||||||
|
`line` varchar(15) NOT NULL CHECK (`line` regexp '^[0-9]+$'),
|
||||||
|
`ext` int(4) NOT NULL,
|
||||||
|
`pin` varchar(4) NOT NULL CHECK (`pin` regexp '^[0-9]+$'),
|
||||||
|
`puk` varchar(15) NOT NULL CHECK (`pin` regexp '^[0-9]+$'),
|
||||||
|
PRIMARY KEY (`code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `sinister`
|
-- Table structure for table `sinister`
|
||||||
--
|
--
|
||||||
|
@ -41255,7 +41260,7 @@ CREATE TABLE `zone` (
|
||||||
`hour` datetime NOT NULL,
|
`hour` datetime NOT NULL,
|
||||||
`agencyModeFk` int(11) NOT NULL,
|
`agencyModeFk` int(11) NOT NULL,
|
||||||
`travelingDays` int(11) NOT NULL DEFAULT 1,
|
`travelingDays` int(11) NOT NULL DEFAULT 1,
|
||||||
`price` double NOT NULL DEFAULT 0 CHECK (`price` > 0),
|
`price` decimal(10,2) DEFAULT NULL,
|
||||||
`bonus` double NOT NULL DEFAULT 0,
|
`bonus` double NOT NULL DEFAULT 0,
|
||||||
`isVolumetric` tinyint(1) NOT NULL DEFAULT 0,
|
`isVolumetric` tinyint(1) NOT NULL DEFAULT 0,
|
||||||
`inflation` decimal(5,2) NOT NULL DEFAULT 1.00,
|
`inflation` decimal(5,2) NOT NULL DEFAULT 1.00,
|
||||||
|
@ -41264,11 +41269,14 @@ CREATE TABLE `zone` (
|
||||||
`code` varchar(45) DEFAULT NULL,
|
`code` varchar(45) DEFAULT NULL,
|
||||||
`editorFk` int(10) unsigned DEFAULT NULL,
|
`editorFk` int(10) unsigned DEFAULT NULL,
|
||||||
`itemMaxLength` int(11) DEFAULT NULL COMMENT 'Longitud maxima para articulos acostados que esa agencia puede transportar',
|
`itemMaxLength` int(11) DEFAULT NULL COMMENT 'Longitud maxima para articulos acostados que esa agencia puede transportar',
|
||||||
|
`addressFk` int(11) DEFAULT NULL COMMENT 'Punto de distribución de donde salen para repartir',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `fk_zone_2_idx` (`agencyModeFk`),
|
KEY `fk_zone_2_idx` (`agencyModeFk`),
|
||||||
KEY `zone_name_idx` (`name`),
|
KEY `zone_name_idx` (`name`),
|
||||||
KEY `zone_fk_editor` (`editorFk`),
|
KEY `zone_fk_editor` (`editorFk`),
|
||||||
|
KEY `zone_address_FK` (`addressFk`),
|
||||||
CONSTRAINT `fk_zone_2` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
CONSTRAINT `fk_zone_2` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
CONSTRAINT `zone_address_FK` FOREIGN KEY (`addressFk`) REFERENCES `address` (`id`) ON UPDATE CASCADE,
|
||||||
CONSTRAINT `zone_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`)
|
CONSTRAINT `zone_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
@ -41318,7 +41326,10 @@ CREATE TABLE `zoneConfig` (
|
||||||
`id` int(10) unsigned NOT NULL,
|
`id` int(10) unsigned NOT NULL,
|
||||||
`scope` int(10) unsigned NOT NULL,
|
`scope` int(10) unsigned NOT NULL,
|
||||||
`forwardDays` int(10) NOT NULL DEFAULT 7 COMMENT 'days forward to show zone_upcomingDeliveries',
|
`forwardDays` int(10) NOT NULL DEFAULT 7 COMMENT 'days forward to show zone_upcomingDeliveries',
|
||||||
|
`defaultAddressFk` int(11) DEFAULT NULL COMMENT 'Punto de distribución por defecto',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `zoneConfig_address_FK` (`defaultAddressFk`),
|
||||||
|
CONSTRAINT `zoneConfig_address_FK` FOREIGN KEY (`defaultAddressFk`) REFERENCES `address` (`id`) ON UPDATE CASCADE,
|
||||||
CONSTRAINT `zoneConfig_check` CHECK (`id` = 1)
|
CONSTRAINT `zoneConfig_check` CHECK (`id` = 1)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
@ -43244,6 +43255,7 @@ BEGIN
|
||||||
DECLARE vCurrentCommission INT;
|
DECLARE vCurrentCommission INT;
|
||||||
DECLARE vIsNotEUR INT;
|
DECLARE vIsNotEUR INT;
|
||||||
DECLARE vLastEntryFk INT;
|
DECLARE vLastEntryFk INT;
|
||||||
|
DECLARE vLanded INT;
|
||||||
|
|
||||||
SELECT count(*) INTO vIsNotEUR
|
SELECT count(*) INTO vIsNotEUR
|
||||||
FROM currency c
|
FROM currency c
|
||||||
|
@ -43259,23 +43271,25 @@ BEGIN
|
||||||
|
|
||||||
RETURN IFNULL(vCommission, 0);
|
RETURN IFNULL(vCommission, 0);
|
||||||
ELSE
|
ELSE
|
||||||
|
SELECT landed INTO vLanded
|
||||||
|
FROM travel
|
||||||
|
WHERE id = vTravelFk;
|
||||||
|
|
||||||
SELECT e.id INTO vLastEntryFk
|
SELECT e.id INTO vLastEntryFk
|
||||||
FROM `entry` e
|
FROM `entry` e
|
||||||
JOIN travel tr ON tr.id = e.travelFk
|
JOIN travel tr ON tr.id = e.travelFk
|
||||||
WHERE e.supplierFk = vSupplierFk
|
WHERE e.supplierFk = vSupplierFk
|
||||||
ORDER BY tr.landed DESC
|
ORDER BY (vLanded <= tr.landed), tr.landed DESC
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
IF vLastEntryFk THEN
|
IF vLastEntryFk THEN
|
||||||
SELECT commission INTO vCurrentCommission
|
SELECT commission INTO vCurrentCommission
|
||||||
FROM `entry`
|
FROM `entry`
|
||||||
WHERE id = vLastEntryFk;
|
WHERE id = vLastEntryFk;
|
||||||
|
|
||||||
ELSE
|
ELSE
|
||||||
SELECT commission INTO vCurrentCommission
|
SELECT commission INTO vCurrentCommission
|
||||||
FROM supplier s
|
FROM supplier s
|
||||||
WHERE s.id = vSupplierFk;
|
WHERE s.id = vSupplierFk;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RETURN vCurrentCommission;
|
RETURN vCurrentCommission;
|
||||||
|
@ -49455,7 +49469,7 @@ BEGIN
|
||||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND NOT ce.isGreuge
|
AND NOT ce.isGreuge
|
||||||
AND cs.code = 'resolved';
|
AND cs.code = 'resolved';
|
||||||
|
|
||||||
|
@ -49480,7 +49494,7 @@ BEGIN
|
||||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND NOT ce.isGreuge
|
AND NOT ce.isGreuge
|
||||||
AND cs.code = 'resolved'
|
AND cs.code = 'resolved'
|
||||||
AND c.isChargedToMana;
|
AND c.isChargedToMana;
|
||||||
|
@ -49491,7 +49505,7 @@ BEGIN
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
SET ce.isGreuge = TRUE
|
SET ce.isGreuge = TRUE
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND NOT ce.isGreuge
|
AND NOT ce.isGreuge
|
||||||
AND cs.code = 'resolved';
|
AND cs.code = 'resolved';
|
||||||
|
|
||||||
|
@ -49570,7 +49584,7 @@ BEGIN
|
||||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND cs.code = 'resolved'
|
AND cs.code = 'resolved'
|
||||||
AND c.ticketCreated >= util.VN_CURDATE() - INTERVAL 1 YEAR
|
AND c.ticketCreated >= util.VN_CURDATE() - INTERVAL 1 YEAR
|
||||||
GROUP BY c.clientFk
|
GROUP BY c.clientFk
|
||||||
|
@ -56857,67 +56871,6 @@ BEGIN
|
||||||
|
|
||||||
UPDATE greugeConfig
|
UPDATE greugeConfig
|
||||||
SET lastNotifyCheck = vTimeEnd;
|
SET lastNotifyCheck = vTimeEnd;
|
||||||
END ;;
|
|
||||||
DELIMITER ;
|
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
|
||||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
|
||||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
|
||||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
|
||||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
|
||||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
|
||||||
/*!50003 DROP PROCEDURE IF EXISTS `inventoryFailureAdd` */;
|
|
||||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
||||||
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
||||||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
|
||||||
/*!50003 SET character_set_client = utf8mb4 */ ;
|
|
||||||
/*!50003 SET character_set_results = utf8mb4 */ ;
|
|
||||||
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
|
||||||
DELIMITER ;;
|
|
||||||
CREATE DEFINER=`vn`@`localhost` PROCEDURE `inventoryFailureAdd`()
|
|
||||||
BEGIN
|
|
||||||
|
|
||||||
DECLARE done BOOL DEFAULT FALSE;
|
|
||||||
DECLARE vTicketFk INT;
|
|
||||||
|
|
||||||
DECLARE rs CURSOR FOR
|
|
||||||
SELECT id FROM vn.ticket
|
|
||||||
WHERE shipped = util.yesterday()
|
|
||||||
AND clientFk = 400
|
|
||||||
AND warehouseFk IN (1,44);
|
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
|
|
||||||
|
|
||||||
OPEN rs;
|
|
||||||
|
|
||||||
FETCH rs INTO vTicketFk;
|
|
||||||
|
|
||||||
WHILE NOT done DO
|
|
||||||
|
|
||||||
INSERT INTO vn.inventoryFailure(dated, itemFk, quantity, value, warehouseFk, throwerFk)
|
|
||||||
SELECT t.shipped,
|
|
||||||
s.itemFk,
|
|
||||||
s.quantity,
|
|
||||||
b.buyingValue + b.freightValue + b.packageValue + b.comissionValue,
|
|
||||||
t.warehouseFk,
|
|
||||||
w.id
|
|
||||||
FROM vn.ticket t
|
|
||||||
JOIN vn.sale s ON s.ticketFk = t.id
|
|
||||||
LEFT JOIN cache.last_buy lb ON lb.warehouse_id = t.warehouseFk AND item_id = s.itemFk
|
|
||||||
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
|
||||||
LEFT JOIN vn.worker w ON w.code = LEFT(s.concept, 3)
|
|
||||||
WHERE t.id = vTicketFk
|
|
||||||
AND s.quantity > 0;
|
|
||||||
|
|
||||||
FETCH rs INTO vTicketFk;
|
|
||||||
|
|
||||||
END WHILE;
|
|
||||||
|
|
||||||
|
|
||||||
CLOSE rs;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
END ;;
|
END ;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
@ -57927,7 +57880,7 @@ BEGIN
|
||||||
ii.cplusTaxBreakFk,
|
ii.cplusTaxBreakFk,
|
||||||
ii.cplusSubjectOpFk,
|
ii.cplusSubjectOpFk,
|
||||||
ii.siiTypeInvoiceInFk,
|
ii.siiTypeInvoiceInFk,
|
||||||
ii.cplusRectificationTypeFk,
|
ic.cplusRectificationTypeFk,
|
||||||
ii.booked,
|
ii.booked,
|
||||||
IFNULL(a.isUeeMember, c.isUeeMember) isUeeMember,
|
IFNULL(a.isUeeMember, c.isUeeMember) isUeeMember,
|
||||||
(c.id = cc.id) isSameCountry,
|
(c.id = cc.id) isSameCountry,
|
||||||
|
@ -57950,6 +57903,7 @@ BEGIN
|
||||||
e.name expenseName
|
e.name expenseName
|
||||||
FROM invoiceIn ii
|
FROM invoiceIn ii
|
||||||
JOIN supplier s ON s.id = ii.supplierFk
|
JOIN supplier s ON s.id = ii.supplierFk
|
||||||
|
LEFT JOIN invoiceInCorrection ic ON ic.correctingFk = ii.id
|
||||||
LEFT JOIN province p ON p.id = s.provinceFk
|
LEFT JOIN province p ON p.id = s.provinceFk
|
||||||
LEFT JOIN autonomy a ON a.id = p.autonomyFk
|
LEFT JOIN autonomy a ON a.id = p.autonomyFk
|
||||||
JOIN country c ON c.id = s.countryFk
|
JOIN country c ON c.id = s.countryFk
|
||||||
|
@ -62647,10 +62601,6 @@ BEGIN
|
||||||
SET itemFk = vItemNew
|
SET itemFk = vItemNew
|
||||||
WHERE itemFk = vItemOld;
|
WHERE itemFk = vItemOld;
|
||||||
|
|
||||||
UPDATE inventoryFailure
|
|
||||||
SET itemFk = vItemNew
|
|
||||||
WHERE itemFk = vItemOld;
|
|
||||||
|
|
||||||
UPDATE genericAllocation
|
UPDATE genericAllocation
|
||||||
SET itemFk = vItemNew
|
SET itemFk = vItemNew
|
||||||
WHERE itemFk = vItemOld;
|
WHERE itemFk = vItemOld;
|
||||||
|
@ -68721,10 +68671,11 @@ BEGIN
|
||||||
TRUE,
|
TRUE,
|
||||||
sc.userFk,
|
sc.userFk,
|
||||||
s.id
|
s.id
|
||||||
FROM vn.sectorCollection sc
|
FROM sectorCollection sc
|
||||||
JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
|
JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
|
||||||
JOIN vn.saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk
|
JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk
|
||||||
JOIN vn.state s ON s.code = 'OK PREVIOUS'
|
JOIN state s ON s.code = 'OK PREVIOUS'
|
||||||
|
JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk
|
||||||
WHERE sc.id = vSectorCollectionFk;
|
WHERE sc.id = vSectorCollectionFk;
|
||||||
END ;;
|
END ;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
@ -73325,7 +73276,8 @@ BEGIN
|
||||||
IFNULL(dest.nickname, origin.nickname) nickname,
|
IFNULL(dest.nickname, origin.nickname) nickname,
|
||||||
dest.landed,
|
dest.landed,
|
||||||
dest.preparation,
|
dest.preparation,
|
||||||
origin.departmentFk
|
origin.departmentFk,
|
||||||
|
origin.saleClonedFk
|
||||||
FROM (
|
FROM (
|
||||||
SELECT s.ticketFk,
|
SELECT s.ticketFk,
|
||||||
c.salesPersonFk workerFk,
|
c.salesPersonFk workerFk,
|
||||||
|
@ -73346,11 +73298,13 @@ BEGIN
|
||||||
t.warehouseFk,
|
t.warehouseFk,
|
||||||
t.companyFk,
|
t.companyFk,
|
||||||
t.agencyModeFk,
|
t.agencyModeFk,
|
||||||
wd.departmentFk
|
wd.departmentFk,
|
||||||
|
sc.saleClonedFk
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN client c ON c.id = t.clientFk
|
JOIN client c ON c.id = t.clientFk
|
||||||
JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk
|
JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk
|
||||||
JOIN sale s ON s.ticketFk = t.id
|
JOIN sale s ON s.ticketFk = t.id
|
||||||
|
LEFT JOIN saleCloned sc ON sc.saleClonedFk = s.id
|
||||||
JOIN saleVolume sv ON sv.saleFk = s.id
|
JOIN saleVolume sv ON sv.saleFk = s.id
|
||||||
JOIN item i ON i.id = s.itemFk
|
JOIN item i ON i.id = s.itemFk
|
||||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||||
|
@ -77747,8 +77701,8 @@ BEGIN
|
||||||
* @param vIsRaid idRaid value
|
* @param vIsRaid idRaid value
|
||||||
* @param vDaysInForward daysInForward value
|
* @param vDaysInForward daysInForward value
|
||||||
*/
|
*/
|
||||||
IF (NOT vIsRaid AND vDaysInForward IS NOT NULL) OR (vIsRaid AND vDaysInForward IS NULL) THEN
|
IF NOT vIsRaid AND vDaysInForward THEN
|
||||||
CALL util.throw('The raid information is not correct');
|
CALL util.throw('If daysInForward has a value, the raid cannot be unchecked');
|
||||||
END IF;
|
END IF;
|
||||||
END ;;
|
END ;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
@ -78115,22 +78069,15 @@ BEGIN
|
||||||
DECLARE vDone BOOL DEFAULT FALSE;
|
DECLARE vDone BOOL DEFAULT FALSE;
|
||||||
DECLARE vBuyerEmail VARCHAR(40);
|
DECLARE vBuyerEmail VARCHAR(40);
|
||||||
DECLARE vTravelLink TEXT;
|
DECLARE vTravelLink TEXT;
|
||||||
DECLARE vMailBody TEXT DEFAULT '';
|
DECLARE vMailBody TEXT;
|
||||||
|
DECLARE vDaysBetweenDates INT;
|
||||||
|
DECLARE vSubject VARCHAR(30);
|
||||||
|
|
||||||
DECLARE vCur CURSOR FOR
|
DECLARE vTravels CURSOR FOR
|
||||||
SELECT GROUP_CONCAT(DISTINCT
|
SELECT GROUP_CONCAT(DISTINCT travelLink ORDER BY id SEPARATOR '\n\r'),
|
||||||
CONCAT('https://salix.verdnatura.es/#!/travel/',
|
buyerEmail
|
||||||
ttm.travelFk,
|
FROM tTravelToMove
|
||||||
'/summary ')
|
GROUP BY buyerEmail;
|
||||||
ORDER BY ttm.travelFk SEPARATOR '\n\r') travelLink,
|
|
||||||
CONCAT(u.name, '@verdnatura.es') buyerEmail
|
|
||||||
FROM tTravelToMove ttm
|
|
||||||
JOIN entry e ON e.travelFk = ttm.travelFk
|
|
||||||
JOIN buy b ON b.entryFk = e.id
|
|
||||||
JOIN item i ON i.id = b.itemFk
|
|
||||||
JOIN itemType it ON it.id = i.typeFk
|
|
||||||
JOIN account.user u ON u.id = it.workerFk
|
|
||||||
GROUP BY u.name;
|
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
|
|
||||||
|
@ -78141,35 +78088,50 @@ BEGIN
|
||||||
END;
|
END;
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tTravelToMove
|
CREATE OR REPLACE TEMPORARY TABLE tTravelToMove
|
||||||
SELECT id travelFk,
|
WITH travels AS (
|
||||||
util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded
|
SELECT id,
|
||||||
FROM travel
|
CONCAT('https://salix.verdnatura.es/#!/travel/', id,'/summary') travelLink,
|
||||||
|
util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded,
|
||||||
|
util.VN_CURDATE() - INTERVAL DATEDIFF(landed, shipped) + daysInForward DAY newShipped
|
||||||
|
FROM vn.travel
|
||||||
WHERE isRaid
|
WHERE isRaid
|
||||||
AND daysInForward;
|
AND daysInForward
|
||||||
|
)SELECT t.id,
|
||||||
|
t.travelLink,
|
||||||
|
t.newLanded,
|
||||||
|
t.newShipped,
|
||||||
|
CONCAT(u.name, '@verdnatura.es') buyerEmail
|
||||||
|
FROM travels t
|
||||||
|
STRAIGHT_JOIN vn.entry e ON e.travelFk = t.id
|
||||||
|
JOIN vn.buy b ON b.entryFk = e.id
|
||||||
|
JOIN vn.item i ON i.id = b.itemFk
|
||||||
|
JOIN vn.itemType it ON it.id = i.typeFk
|
||||||
|
JOIN account.user u ON u.id = it.workerFk
|
||||||
|
GROUP BY t.id;
|
||||||
|
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
|
||||||
UPDATE travel tr
|
UPDATE travel tr
|
||||||
JOIN tTravelToMove ttm ON ttm.travelFk = tr.id
|
JOIN tTravelToMove ttm ON ttm.id = tr.id
|
||||||
SET tr.landed = ttm.newLanded;
|
SET tr.landed = ttm.newLanded,
|
||||||
|
tr.shipped = ttm.newShipped;
|
||||||
|
|
||||||
OPEN vCur;
|
OPEN vTravels;
|
||||||
|
|
||||||
l: LOOP
|
l: LOOP
|
||||||
SET vDone = FALSE;
|
SET vDone = FALSE;
|
||||||
FETCH vCur INTO vTravelLink, vBuyerEmail;
|
FETCH vTravels INTO vTravelLink, vBuyerEmail;
|
||||||
|
|
||||||
IF vDone THEN
|
IF vDone THEN
|
||||||
LEAVE l;
|
LEAVE l;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
CALL `vn`.`mail_insert`(
|
SET vSubject = 'Cambio de fecha en Redadas',
|
||||||
vBuyerEmail,
|
vMailBody = CONCAT('Se ha movido los siguientes travels: \n\r ', vTravelLink);
|
||||||
'noreply@verdnatura.es',
|
|
||||||
'Cambio de fecha en Redadas',
|
CALL mail_insert(vBuyerEmail, 'noreply@verdnatura.es', vSubject, vMailBody);
|
||||||
CONCAT('Se ha movido los siguientes travels: \n\r ', vTravelLink));
|
|
||||||
END LOOP;
|
END LOOP;
|
||||||
CLOSE vCur;
|
CLOSE vTravels;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
DROP TEMPORARY TABLE tTravelToMove;
|
DROP TEMPORARY TABLE tTravelToMove;
|
||||||
END ;;
|
END ;;
|
||||||
|
@ -85618,24 +85580,6 @@ USE `bi`;
|
||||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||||
|
|
||||||
--
|
|
||||||
-- Final view structure for view `rotacion`
|
|
||||||
--
|
|
||||||
|
|
||||||
/*!50001 DROP VIEW IF EXISTS `rotacion`*/;
|
|
||||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
|
||||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
|
||||||
/*!50001 SET character_set_client = utf8mb4 */;
|
|
||||||
/*!50001 SET character_set_results = utf8mb4 */;
|
|
||||||
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
|
|
||||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
|
||||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
|
||||||
/*!50001 VIEW `rotacion` AS select `ic`.`itemFk` AS `Id_Article`,`ic`.`warehouseFk` AS `warehouse_id`,`ic`.`quantity` AS `total`,`ic`.`rotation` AS `rotacion`,`ic`.`cm3` AS `cm3`,`ic`.`storage` AS `almacenaje`,`ic`.`handling` AS `manipulacion`,`ic`.`extraCharge` AS `auxiliar`,`ic`.`wasted` AS `mermas`,`ic`.`cm3delivery` AS `cm3reparto`,`ic`.`grams` AS `grams` from `vn`.`itemCost` `ic` */;
|
|
||||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
|
||||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
|
||||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Final view structure for view `tarifa_componentes`
|
-- Final view structure for view `tarifa_componentes`
|
||||||
--
|
--
|
||||||
|
@ -90949,4 +90893,4 @@ USE `vn2008`;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2024-12-10 8:17:51
|
-- Dump completed on 2025-01-14 6:39:04
|
||||||
|
|
|
@ -5701,7 +5701,7 @@ BEGIN
|
||||||
|
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
IF (SELECT COUNT(*) FROM vn.invoiceIn
|
IF (SELECT COUNT(*) FROM invoiceIn
|
||||||
WHERE supplierRef = NEW.supplierRef
|
WHERE supplierRef = NEW.supplierRef
|
||||||
AND supplierFk = NEW.supplierFk
|
AND supplierFk = NEW.supplierFk
|
||||||
AND YEAR(issued) = YEAR(NEW.issued)
|
AND YEAR(issued) = YEAR(NEW.issued)
|
||||||
|
@ -5713,7 +5713,7 @@ BEGIN
|
||||||
IF NEW.supplierFk != OLD.supplierFk THEN
|
IF NEW.supplierFk != OLD.supplierFk THEN
|
||||||
CALL supplier_checkIsActive(NEW.supplierFk);
|
CALL supplier_checkIsActive(NEW.supplierFk);
|
||||||
SELECT withholdingSageFk INTO vWithholdingSageFk
|
SELECT withholdingSageFk INTO vWithholdingSageFk
|
||||||
FROM vn.supplier
|
FROM supplier
|
||||||
WHERE id = NEW.supplierFk;
|
WHERE id = NEW.supplierFk;
|
||||||
SET NEW.withholdingSageFk = vWithholdingSageFk;
|
SET NEW.withholdingSageFk = vWithholdingSageFk;
|
||||||
END IF;
|
END IF;
|
||||||
|
@ -5737,25 +5737,31 @@ DELIMITER ;;
|
||||||
AFTER UPDATE ON `invoiceIn`
|
AFTER UPDATE ON `invoiceIn`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
IF NEW.issued != OLD.issued
|
DECLARE vIsEuro BOOL;
|
||||||
OR NEW.currencyFk != OLD.currencyFk THEN
|
|
||||||
|
SELECT `code` = 'EUR' INTO vIsEuro
|
||||||
|
FROM currency
|
||||||
|
WHERE id = NEW.currencyFk;
|
||||||
|
|
||||||
|
IF (NOT NEW.issued <=> OLD.issued
|
||||||
|
OR NEW.currencyFk <> OLD.currencyFk) THEN
|
||||||
|
|
||||||
UPDATE invoiceInTax iit
|
UPDATE invoiceInTax iit
|
||||||
JOIN invoiceIn ii ON ii.id = iit.invoiceInFk
|
JOIN invoiceIn ii ON ii.id = iit.invoiceInFk
|
||||||
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
||||||
AND rr.currencyFk = ii.currencyFk
|
AND rr.currencyFk = ii.currencyFk
|
||||||
SET iit.taxableBase = IF(iit.foreignValue IS NULL, iit.taxableBase, iit.foreignValue / rr.value)
|
SET iit.taxableBase = IF(vIsEuro, iit.taxableBase, iit.foreignValue / rr.value),
|
||||||
|
iit.foreignValue = IF(vIsEuro, NULL, iit.foreignValue)
|
||||||
WHERE ii.id = NEW.id;
|
WHERE ii.id = NEW.id;
|
||||||
|
|
||||||
UPDATE invoiceInDueDay iidd
|
UPDATE invoiceInDueDay iidd
|
||||||
JOIN invoiceIn ii ON ii.id = iidd.invoiceInFk
|
JOIN invoiceIn ii ON ii.id = iidd.invoiceInFk
|
||||||
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
||||||
AND rr.currencyFk = ii.currencyFk
|
AND rr.currencyFk = ii.currencyFk
|
||||||
SET iidd.amount = IF(iidd.foreignValue IS NULL, iidd.amount, iidd.foreignValue / rr.value)
|
SET iidd.amount = IF(vIsEuro, iidd.amount, iidd.foreignValue / rr.value),
|
||||||
|
iidd.foreignValue = IF(vIsEuro, NULL, iidd.foreignValue)
|
||||||
WHERE ii.id = NEW.id;
|
WHERE ii.id = NEW.id;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
END */;;
|
END */;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
@ -8161,6 +8167,7 @@ BEGIN
|
||||||
OR !(NEW.workerFk <=> OLD.workerFk)
|
OR !(NEW.workerFk <=> OLD.workerFk)
|
||||||
OR !(NEW.m3 <=> OLD.m3)
|
OR !(NEW.m3 <=> OLD.m3)
|
||||||
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)
|
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)
|
||||||
|
OR !(NEW.dated <=> OLD.dated)
|
||||||
OR !(NEW.vehicleFk <=> OLD.vehicleFk)THEN
|
OR !(NEW.vehicleFk <=> OLD.vehicleFk)THEN
|
||||||
CALL route_calcCommission(NEW.id);
|
CALL route_calcCommission(NEW.id);
|
||||||
END IF;
|
END IF;
|
||||||
|
@ -10582,6 +10589,10 @@ BEGIN
|
||||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
IF NOT (NEW.isRaid <=> OLD.isRaid) OR NOT (NEW.daysInForward <=> OLD.daysInForward) THEN
|
||||||
|
CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward);
|
||||||
|
END IF;
|
||||||
|
|
||||||
IF NOT (NEW.awbFk <=> OLD.awbFk)THEN
|
IF NOT (NEW.awbFk <=> OLD.awbFk)THEN
|
||||||
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
||||||
FROM travel t
|
FROM travel t
|
||||||
|
@ -11488,4 +11499,4 @@ USE `vn2008`;
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2024-12-10 8:18:11
|
-- Dump completed on 2025-01-14 6:39:25
|
||||||
|
|
|
@ -158,13 +158,13 @@ INSERT INTO `account`.`mailForward`(`account`, `forwardTo`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
|
INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`, `hasToDownloadRate`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'EUR', 'Euro', 1),
|
(1, 'EUR', 'Euro', 1, FALSE),
|
||||||
(2, 'USD', 'Dollar USA', 1.4),
|
(2, 'USD', 'Dollar USA', 1.4, TRUE),
|
||||||
(3, 'GBP', 'Libra', 1),
|
(3, 'GBP', 'Libra', 1, TRUE),
|
||||||
(4, 'JPY', 'Yen Japones', 1),
|
(4, 'JPY', 'Yen Japones', 1, FALSE),
|
||||||
(5, 'CNY', 'Yuan Chino', 1.2);
|
(5, 'CNY', 'Yuan Chino', 1.2, TRUE);
|
||||||
|
|
||||||
INSERT INTO `vn`.`country`(`id`, `name`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`)
|
INSERT INTO `vn`.`country`(`id`, `name`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -426,50 +426,50 @@ INSERT INTO `vn`.`clientConfig`(`id`, `riskTolerance`, `maxCreditRows`, `maxPric
|
||||||
(1, 200, 10, 0.25, 2, 4, 5, 300.00, 1, 1, 2);
|
(1, 200, 10, 0.25, 2, 4, 5, 300.00, 1, 1, 2);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`address`(`id`, `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `phone`, `mobile`, `isActive`, `clientFk`, `agencyModeFk`, `longitude`, `latitude`, `isEqualizated`, `isDefaultAddress`)
|
INSERT INTO `vn`.`address`(`id`, `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `phone`, `mobile`, `isActive`, `clientFk`, `agencyModeFk`, `longitude`, `latitude`, `isEqualizated`, `isDefaultAddress`, `customsAgentFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Bruce Wayne', '1007 Mountain Drive, Gotham', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1101, 2, NULL, NULL, 0, 1),
|
(1, 'Bruce Wayne', '1007 Mountain Drive, Gotham', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1101, 2, -74.1111111, 10.1111111, 0, 1, 1),
|
||||||
(2, 'Petter Parker', '20 Ingram Street', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1102, 2, NULL, NULL, 0, 1),
|
(2, 'Petter Parker', '20 Ingram Street', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1102, 2, -74.2222222, 10.2222222, 0, 1, NULL),
|
||||||
(3, 'Clark Kent', '344 Clinton Street', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1103, 2, NULL, NULL, 0, 1),
|
(3, 'Clark Kent', '344 Clinton Street', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1103, 2, -74.3333333, 10.3333333, 0, 1, NULL),
|
||||||
(4, 'Tony Stark', '10880 Malibu Point', 'Gotham', 46460, 1, 1111111111, 222222222, 1 , 1104, 2, NULL, NULL, 0, 1),
|
(4, 'Tony Stark', '10880 Malibu Point', 'Gotham', 46460, 1, 1111111111, 222222222, 1 , 1104, 2, -74.4444444, 10.4444444, 0, 1, NULL),
|
||||||
(5, 'Max Eisenhardt', 'Unknown Whereabouts', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 1),
|
(5, 'Max Eisenhardt', 'Unknown Whereabouts', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 1, NULL),
|
||||||
(6, 'DavidCharlesHaller', 'Evil hideout', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 1),
|
(6, 'DavidCharlesHaller', 'Evil hideout', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 1, NULL),
|
||||||
(7, 'Hank Pym', 'Anthill', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 1),
|
(7, 'Hank Pym', 'Anthill', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 1, NULL),
|
||||||
(8, 'Charles Xavier', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Gotham', 46460, 5, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 1),
|
(8, 'Charles Xavier', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Gotham', 46460, 5, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 1, NULL),
|
||||||
(9, 'Bruce Banner', 'Somewhere in New York', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 1),
|
(9, 'Bruce Banner', 'Somewhere in New York', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 1, NULL),
|
||||||
(10, 'Jessica Jones', 'NYCC 2015 Poster', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 1),
|
(10, 'Jessica Jones', 'NYCC 2015 Poster', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 1, NULL),
|
||||||
(11, 'Missing', 'The space', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1111, 10, NULL, NULL, 0, 1),
|
(11, 'Missing', 'The space', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1111, 10, NULL, NULL, 0, 1, NULL),
|
||||||
(12, 'Trash', 'New York city', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1112, 10, NULL, NULL, 0, 1),
|
(12, 'Trash', 'New York city', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1112, 10, NULL, NULL, 0, 1, NULL),
|
||||||
(101, 'Somewhere in Thailand', 'address 01', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(101, 'Somewhere in Thailand', 'address 01', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(102, 'Somewhere in Poland', 'address 02', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
|
(102, 'Somewhere in Poland', 'address 02', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(103, 'Somewhere in Japan', 'address 03', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
|
(103, 'Somewhere in Japan', 'address 03', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(104, 'Somewhere in Spain', 'address 04', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
|
(104, 'Somewhere in Spain', 'address 04', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(105, 'Somewhere in Potugal', 'address 05', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
|
(105, 'Somewhere in Potugal', 'address 05', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(106, 'Somewhere in UK', 'address 06', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
|
(106, 'Somewhere in UK', 'address 06', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(107, 'Somewhere in Valencia', 'address 07', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
|
(107, 'Somewhere in Valencia', 'address 07', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(108, 'Somewhere in Gotham', 'address 08', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
|
(108, 'Somewhere in Gotham', 'address 08', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(109, 'Somewhere in London', 'address 09', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(109, 'Somewhere in London', 'address 09', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(110, 'Somewhere in Algemesi', 'address 10', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(110, 'Somewhere in Algemesi', 'address 10', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(111, 'Somewhere in Carlet', 'address 11', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(111, 'Somewhere in Carlet', 'address 11', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(112, 'Somewhere in Campanar', 'address 12', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(112, 'Somewhere in Campanar', 'address 12', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(113, 'Somewhere in Malilla', 'address 13', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(113, 'Somewhere in Malilla', 'address 13', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(114, 'Somewhere in France', 'address 14', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(114, 'Somewhere in France', 'address 14', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(115, 'Somewhere in Birmingham', 'address 15', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(115, 'Somewhere in Birmingham', 'address 15', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(116, 'Somewhere in Scotland', 'address 16', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(116, 'Somewhere in Scotland', 'address 16', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(117, 'Somewhere in nowhere', 'address 17', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(117, 'Somewhere in nowhere', 'address 17', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(118, 'Somewhere over the rainbow', 'address 18', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(118, 'Somewhere over the rainbow', 'address 18', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(119, 'Somewhere in Alberic', 'address 19', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(119, 'Somewhere in Alberic', 'address 19', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(120, 'Somewhere in Montortal', 'address 20', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
|
(120, 'Somewhere in Montortal', 'address 20', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(121, 'the bat cave', 'address 21', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1101, 2, NULL, NULL, 0, 0),
|
(121, 'the bat cave', 'address 21', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1101, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(122, 'NY roofs', 'address 22', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1102, 2, NULL, NULL, 0, 0),
|
(122, 'NY roofs', 'address 22', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1102, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(123, 'The phone box', 'address 23', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1103, 2, NULL, NULL, 0, 0),
|
(123, 'The phone box', 'address 23', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1103, 2, -74.555555, 10.555555, 0, 0, NULL),
|
||||||
(124, 'Stark tower Gotham', 'address 24', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1104, 2, NULL, NULL, 0, 0),
|
(124, 'Stark tower Gotham', 'address 24', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1104, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(125, 'The plastic cell', 'address 25', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 0),
|
(125, 'The plastic cell', 'address 25', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(126, 'Many places', 'address 26', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 0),
|
(126, 'Many places', 'address 26', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(127, 'Your pocket', 'address 27', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 0),
|
(127, 'Your pocket', 'address 27', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(128, 'Cerebro', 'address 28', 'Gotham', 46460, 5, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 0),
|
(128, 'Cerebro', 'address 28', 'Gotham', 46460, 5, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(129, 'Luke Cages Bar', 'address 29', 'Gotham', 'EC170150', 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 0),
|
(129, 'Luke Cages Bar', 'address 29', 'Gotham', 'EC170150', 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 0, NULL),
|
||||||
(130, 'Non valid address', 'address 30', 'Gotham', 46460, 1, 1111111111, 222222222, 0, 1101, 2, NULL, NULL, 0, 0);
|
(130, 'Non valid address', 'address 30', 'Gotham', 46460, 1, 1111111111, 222222222, 0, 1101, 2, NULL, NULL, 0, 0, NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`address`( `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `isActive`, `clientFk`, `agencyModeFk`, `isDefaultAddress`)
|
INSERT INTO `vn`.`address`( `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `isActive`, `clientFk`, `agencyModeFk`, `isDefaultAddress`)
|
||||||
SELECT name, CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, 1, id, 2, 1
|
SELECT name, CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, 1, id, 2, 1
|
||||||
|
@ -648,13 +648,13 @@ INSERT INTO `vn`.`invoiceOutSerial`
|
||||||
('X', 'Exportación global', 0, 'WORLD', 0, 'global'),
|
('X', 'Exportación global', 0, 'WORLD', 0, 'global'),
|
||||||
('N', 'Múltiple Intracomunitaria', 0, 'CEE', 1, 'multiple');
|
('N', 'Múltiple Intracomunitaria', 0, 'CEE', 1, 'multiple');
|
||||||
|
|
||||||
INSERT INTO `vn`.`invoiceOut`(`id`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `hasPdf`)
|
INSERT INTO `vn`.`invoiceOut`(`id`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `hasPdf`, `customsAgentFk`, `incotermsFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'T', 1026.24, util.VN_CURDATE(), 1101, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
|
(1, 'E', 1026.24, util.VN_CURDATE(), 1101, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0, 1, 'FAS'),
|
||||||
(2, 'T', 121.36, util.VN_CURDATE(), 1102, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
|
(2, 'T', 121.36, util.VN_CURDATE(), 1102, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0, NULL, NULL),
|
||||||
(3, 'T', 8.88, util.VN_CURDATE(), 1103, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
|
(3, 'T', 8.88, util.VN_CURDATE(), 1103, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0, NULL, NULL),
|
||||||
(4, 'T', 8.88, util.VN_CURDATE(), 1104, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
|
(4, 'T', 8.88, util.VN_CURDATE(), 1104, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0, NULL, NULL),
|
||||||
(5, 'A', 8.88, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1103, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 442, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 0);
|
(5, 'A', 8.88, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1103, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 442, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 0, NULL, NULL);
|
||||||
|
|
||||||
UPDATE `vn`.`invoiceOut` SET ref = 'T1111111' WHERE id = 1;
|
UPDATE `vn`.`invoiceOut` SET ref = 'T1111111' WHERE id = 1;
|
||||||
UPDATE `vn`.`invoiceOut` SET ref = 'T2222222' WHERE id = 2;
|
UPDATE `vn`.`invoiceOut` SET ref = 'T2222222' WHERE id = 2;
|
||||||
|
@ -694,22 +694,22 @@ INSERT INTO `vn`.`invoiceOutExpense`(`id`, `invoiceOutFk`, `amount`, `expenseFk`
|
||||||
(6, 4, 8.07, 2000000000, util.VN_CURDATE()),
|
(6, 4, 8.07, 2000000000, util.VN_CURDATE()),
|
||||||
(7, 5, 8.07, 2000000000, util.VN_CURDATE());
|
(7, 5, 8.07, 2000000000, util.VN_CURDATE());
|
||||||
|
|
||||||
INSERT INTO `vn`.`zone` (`id`, `name`, `hour`, `agencyModeFk`, `travelingDays`, `price`, `bonus`, `itemMaxSize`)
|
INSERT INTO `vn`.`zone`
|
||||||
VALUES
|
(`id`, `name`, `hour`, `agencyModeFk`, `travelingDays`, `price`, `bonus`, `itemMaxSize`, `priceOptimum`)
|
||||||
(1, 'Zone pickup A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 1, 0, 100),
|
VALUES
|
||||||
(2, 'Zone pickup B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 1, 0, 100),
|
(1, 'Zone pickup A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 1, 0, 100, 1),
|
||||||
(3, 'Zone 247 A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100),
|
(2, 'Zone pickup B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 1, 0, 100, 1),
|
||||||
(4, 'Zone 247 B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100),
|
(3, 'Zone 247 A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100, 1),
|
||||||
(5, 'Zone expensive A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100),
|
(4, 'Zone 247 B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100, 1),
|
||||||
(6, 'Zone expensive B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100),
|
(5, 'Zone expensive A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100, 500),
|
||||||
(7, 'Zone refund', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 23, 0, 1, 0, 100),
|
(6, 'Zone expensive B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100, 500),
|
||||||
(8, 'Zone others', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 10, 0, 1, 0, 100),
|
(7, 'Zone refund', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 23, 0, 1, 0, 100, 0.5),
|
||||||
(9, 'Zone superMan', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 2, 0, 1, 0, 100),
|
(8, 'Zone others', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 10, 0, 1, 0, 100, 0.5),
|
||||||
(10, 'Zone teleportation', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 3, 0, 1, 0, 100),
|
(9, 'Zone superMan', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 2, 0, 1, 0, 100, 0.5),
|
||||||
(11, 'Zone pickup C', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 1, 0, 100),
|
(10, 'Zone teleportation', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 3, 0, 1, 0, 100, 0.5),
|
||||||
(12, 'Zone entanglement', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 4, 0, 1, 0, 100),
|
(11, 'Zone pickup C', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 1, 0, 100, 0.5),
|
||||||
(13, 'Zone quantum break', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 5, 0, 1, 0, 100);
|
(12, 'Zone entanglement', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 4, 0, 1, 0, 100, 0.5),
|
||||||
|
(13, 'Zone quantum break', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 5, 0, 1, 0, 100, 0.5);
|
||||||
|
|
||||||
INSERT INTO `vn`.`zoneWarehouse` (`id`, `zoneFk`, `warehouseFk`)
|
INSERT INTO `vn`.`zoneWarehouse` (`id`, `zoneFk`, `warehouseFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -974,26 +974,30 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`)
|
||||||
('SER', 'Services'),
|
('SER', 'Services'),
|
||||||
('VT', 'Sales');
|
('VT', 'Sales');
|
||||||
|
|
||||||
INSERT INTO `vn`.`item`(`id`, `typeFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenseFk`,
|
INSERT INTO `vn`.`item`(
|
||||||
`comment`, `relevancy`, `image`, `subName`, `minPrice`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`, `weightByPiece`)
|
`id`, `typeFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenseFk`,
|
||||||
VALUES
|
`comment`, `relevancy`, `image`, `subName`, `minPrice`, `family`, `isFloramondo`, `genericFk`,
|
||||||
(1, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 'EMB', 0, NULL, 'V', 0, 3),
|
`itemPackingTypeFk`, `hasMinPrice`, `weightByPiece`, `isCustomInspectionRequired`
|
||||||
(2, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 'VT', 0, NULL, 'H', 0, 2),
|
)
|
||||||
(3, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 'VT', 0, NULL, NULL, 0, 5),
|
VALUES
|
||||||
(4, 1, 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(1, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 'EMB', 0, NULL, 'V', 0, 3, 1),
|
||||||
(5, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(2, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 'VT', 0, NULL, 'H', 0, 2, 1),
|
||||||
(6, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(3, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 'VT', 0, NULL, NULL, 0, 5, 0),
|
||||||
(7, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(4, 1, 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(8, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(5, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(9, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL),
|
(6, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(10, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(7, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(11, 1, 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(8, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(12, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL),
|
(9, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL, 0),
|
||||||
(13, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 'VT', 1, NULL, NULL, 1, NULL),
|
(10, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(14, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL),
|
(11, 1, 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(15, 4, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL),
|
(12, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0),
|
||||||
(16, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL),
|
(13, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 'VT', 1, NULL, NULL, 1, NULL, 0),
|
||||||
(71, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL);
|
(14, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL, 0),
|
||||||
|
(15, 4, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL, 0),
|
||||||
|
(16, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL, 0),
|
||||||
|
(71, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0);
|
||||||
|
|
||||||
|
|
||||||
-- Update the taxClass after insert of the items
|
-- Update the taxClass after insert of the items
|
||||||
UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2
|
UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2
|
||||||
|
@ -1516,7 +1520,8 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
|
||||||
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2, 10, FALSE, NULL),
|
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2, 10, FALSE, NULL),
|
||||||
(10, DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), 5, 1, 1, 50.00, 500, 'nineth travel', 1, 2, 10, TRUE, 2),
|
(10, DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), 5, 1, 1, 50.00, 500, 'nineth travel', 1, 2, 10, TRUE, 2),
|
||||||
(11, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE(), 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL),
|
(11, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE(), 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL),
|
||||||
(12, util.VN_CURDATE() , util.VN_CURDATE() + INTERVAL 1 DAY, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL);
|
(12, util.VN_CURDATE() , util.VN_CURDATE() + INTERVAL 1 DAY, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL),
|
||||||
|
(13, util.VN_CURDATE() - INTERVAL 1 MONTH - INTERVAL 1 DAY, util.VN_CURDATE() - INTERVAL 1 MONTH, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `evaNotes`, `typeFk`)
|
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `evaNotes`, `typeFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1529,8 +1534,9 @@ INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed
|
||||||
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 'observation seven', 'product'),
|
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 'observation seven', 'product'),
|
||||||
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, '', 'product'),
|
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, '', 'product'),
|
||||||
(9, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 9', 1, '', 'product'),
|
(9, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 9', 1, '', 'product'),
|
||||||
(10, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 10',1, '', 'product'),
|
(10, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2010', 'Movement 10',1, '', 'product'),
|
||||||
(11, 4, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 11',0, '', 'product'),
|
(11, 4, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 1, 442, 'IN2011', 'Movement 11',0, '', 'product'),
|
||||||
|
(12, 4, util.VN_CURDATE() - INTERVAL 1 MONTH, 13, 1, 442, 'IN2012', 'Movement 12',0, '', 'product'),
|
||||||
(99, 69, util.VN_CURDATE() - INTERVAL 1 MONTH, 11, 0, 442, 'IN2009', 'Movement 99',0, '', 'product');
|
(99, 69, util.VN_CURDATE() - INTERVAL 1 MONTH, 11, 0, 442, 'IN2009', 'Movement 99',0, '', 'product');
|
||||||
|
|
||||||
INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `defaultSupplierFk`)
|
INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `defaultSupplierFk`)
|
||||||
|
@ -1572,7 +1578,8 @@ INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `sal
|
||||||
(14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 'grouping', NULL, 0.00, 7.30, 7.00, 0, 1, 0, 4, util.VN_CURDATE()),
|
(14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 'grouping', NULL, 0.00, 7.30, 7.00, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
|
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(16, 99,1,50.0000, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.60, 99.40, 0, 1, 0, 1.00, '2024-07-30 08:13:51.000'),
|
(16, 99,1,50.0000, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.60, 99.40, 0, 1, 0, 1.00, '2024-07-30 08:13:51.000'),
|
||||||
(17, 11, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE() - INTERVAL 2 MONTH);
|
(17, 11, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE() - INTERVAL 2 MONTH),
|
||||||
|
(18, 12, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'grouping', NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE() - INTERVAL 2 MONTH);
|
||||||
|
|
||||||
INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_id`, `agency_id`, `address_id`, `company_id`, `note`, `source_app`, `confirmed`,`total`, `date_make`, `first_row_stamp`, `confirm_date`)
|
INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_id`, `agency_id`, `address_id`, `company_id`, `note`, `source_app`, `confirmed`,`total`, `date_make`, `first_row_stamp`, `confirm_date`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1922,7 +1929,7 @@ INSERT INTO `vn`.`claimDestination`(`id`, `description`, `addressFk`)
|
||||||
|
|
||||||
INSERT INTO `vn`.`claimDevelopment`(`id`, `claimFk`, `claimResponsibleFk`, `workerFk`, `claimReasonFk`, `claimResultFk`, `claimRedeliveryFk`, `claimDestinationFk`)
|
INSERT INTO `vn`.`claimDevelopment`(`id`, `claimFk`, `claimResponsibleFk`, `workerFk`, `claimReasonFk`, `claimResultFk`, `claimRedeliveryFk`, `claimDestinationFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, 21, 1, 1, 2, 5),
|
(1, 1, 1, 21, 7, 1, 2, 5),
|
||||||
(2, 1, 2, 21, 7, 2, 2, 5),
|
(2, 1, 2, 21, 7, 2, 2, 5),
|
||||||
(3, 2, 7, 21, 9, 3, 2, 5),
|
(3, 2, 7, 21, 9, 3, 2, 5),
|
||||||
(4, 3, 7, 21, 15, 8, 2, 5),
|
(4, 3, 7, 21, 15, 8, 2, 5),
|
||||||
|
@ -3965,7 +3972,7 @@ VALUES(1, '');
|
||||||
|
|
||||||
INSERT INTO dipole.expedition_PrintOut (expeditionFk, ticketFk, addressFk, street, postalCode, city, shopName, isPrinted, created, printerFk, routeFk, parkingCode,
|
INSERT INTO dipole.expedition_PrintOut (expeditionFk, ticketFk, addressFk, street, postalCode, city, shopName, isPrinted, created, printerFk, routeFk, parkingCode,
|
||||||
truckName, clientFk, phone, province, agency, m3, workerCode, itemFk, quantity, longName, shelvingFk, comments)
|
truckName, clientFk, phone, province, agency, m3, workerCode, itemFk, quantity, longName, shelvingFk, comments)
|
||||||
VALUES(1, 1, 0, ' ', ' ', ' ', ' ', 0, '2001-01-01 00:00:00', 1, 0, ' ', ' ', 0, NULL, '', NULL, 0.000, NULL, 10, NULL, NULL, 'NCC', NULL);
|
VALUES(1, 1, 0, ' ', ' ', ' ', ' ', 0, '2001-01-01 00:00:00', 1, 0, ' ', ' ', 0, NULL, '', NULL, 0.000, NULL, 10, NULL, 'Ranged Reinforced weapon sniper rifle 700mm' , 'NCC', NULL);
|
||||||
|
|
||||||
INSERT INTO vn.accountDetail
|
INSERT INTO vn.accountDetail
|
||||||
(id, value, accountDetailTypeFk, supplierAccountFk)
|
(id, value, accountDetailTypeFk, supplierAccountFk)
|
||||||
|
@ -4038,6 +4045,13 @@ INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
|
||||||
INSERT INTO vn.workerIrpf (workerFk,spouseNif, geographicMobilityDate)
|
INSERT INTO vn.workerIrpf (workerFk,spouseNif, geographicMobilityDate)
|
||||||
VALUES (1106,'26493101E','2019-09-20');
|
VALUES (1106,'26493101E','2019-09-20');
|
||||||
|
|
||||||
|
INSERT INTO vn.referenceRate (currencyFk, dated, value)
|
||||||
|
VALUES (2, '2000-12-01', 1.0495),
|
||||||
|
(2, '2001-01-01', 1.0531),
|
||||||
|
(2, '2001-02-01', 7.6347);
|
||||||
|
|
||||||
|
INSERT IGNORE INTO vn.osrmConfig (id,url,tolerance)
|
||||||
|
VALUES (1,'https://router.project-osrm.org', 0.002);
|
||||||
|
|
||||||
INSERT IGNORE INTO vn.inventoryConfig
|
INSERT IGNORE INTO vn.inventoryConfig
|
||||||
SET id = 1,
|
SET id = 1,
|
||||||
|
|
|
@ -10,19 +10,27 @@ BEGIN
|
||||||
* @param vDateFrom Fecha desde
|
* @param vDateFrom Fecha desde
|
||||||
* @param vDateTo Fecha hasta
|
* @param vDateTo Fecha hasta
|
||||||
*/
|
*/
|
||||||
IF vDateFrom IS NULL THEN
|
DECLARE vDaysInYear INT;
|
||||||
SET vDateFrom = util.VN_CURDATE() - INTERVAL WEEKDAY(util.VN_CURDATE()) DAY;
|
SET vDaysInYear = DATEDIFF(util.lastDayOfYear(CURDATE()), util.firstDayOfYear(CURDATE()));
|
||||||
|
|
||||||
|
SET vDateFrom = COALESCE(vDateFrom, util.VN_CURDATE());
|
||||||
|
SET vDateTo = COALESCE(vDateTo, util.VN_CURDATE());
|
||||||
|
|
||||||
|
IF DATEDIFF(vDateTo, vDateFrom) > vDaysInYear THEN
|
||||||
|
CALL util.throw('The period cannot be longer than one year');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF vDateTo IS NULL THEN
|
-- Obtiene el primer día de la semana de esa fecha
|
||||||
SET vDateTo = vDateFrom + INTERVAL 6 DAY;
|
SET vDateFrom = DATE_SUB(vDateFrom, INTERVAL ((WEEKDAY(vDateFrom) + 1) % 7) DAY);
|
||||||
END IF;
|
|
||||||
|
-- Obtiene el último día de la semana de esa fecha
|
||||||
|
SET vDateTo = DATE_ADD(vDateTo, INTERVAL (6 - ((WEEKDAY(vDateTo) + 1) % 7)) DAY);
|
||||||
|
|
||||||
CALL cache.last_buy_refresh(FALSE);
|
CALL cache.last_buy_refresh(FALSE);
|
||||||
|
|
||||||
REPLACE bs.waste
|
REPLACE bs.waste
|
||||||
SELECT YEAR(t.shipped),
|
SELECT YEARWEEK(t.shipped, 6) DIV 100,
|
||||||
WEEK(t.shipped, 4),
|
WEEK(t.shipped, 6),
|
||||||
it.workerFk,
|
it.workerFk,
|
||||||
it.id,
|
it.id,
|
||||||
s.itemFk,
|
s.itemFk,
|
||||||
|
@ -68,8 +76,8 @@ BEGIN
|
||||||
JOIN cache.last_buy lb ON lb.item_id = i.id
|
JOIN cache.last_buy lb ON lb.item_id = i.id
|
||||||
AND lb.warehouse_id = w.id
|
AND lb.warehouse_id = w.id
|
||||||
JOIN vn.buy b ON b.id = lb.buy_id
|
JOIN vn.buy b ON b.id = lb.buy_id
|
||||||
WHERE t.shipped BETWEEN vDateFrom AND vDateTo
|
WHERE t.shipped BETWEEN vDateFrom AND util.dayEnd(vDateTo)
|
||||||
AND w.isManaged
|
AND w.isManaged
|
||||||
GROUP BY YEAR(t.shipped), WEEK(t.shipped, 4), i.id;
|
GROUP BY YEARWEEK(t.shipped, 6) DIV 100, WEEK(t.shipped, 6), i.id;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -107,7 +107,7 @@ BEGIN
|
||||||
) INTO vHas0Amount;
|
) INTO vHas0Amount;
|
||||||
|
|
||||||
IF vHas0Amount THEN
|
IF vHas0Amount THEN
|
||||||
CALL util.throw('Hay líneas vacías. Por favor, elimínelas');
|
CALL util.throw('orderLinesWithZero');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
|
|
@ -4,10 +4,10 @@ BEGIN
|
||||||
/**
|
/**
|
||||||
* Traslada la info de contabilidad relacionada con las facturas recibidas
|
* Traslada la info de contabilidad relacionada con las facturas recibidas
|
||||||
*
|
*
|
||||||
* @vInvoiceInFk Factura recibida
|
* @param vInvoiceInFk Factura recibida
|
||||||
* @vXDiarioFk Id tabla XDiario
|
* @param vXDiarioFk Id tabla XDiario
|
||||||
*/
|
*/
|
||||||
DECLARE vInvoiceInOriginalFk INT;
|
DECLARE vInvoiceInOriginalFk INT;
|
||||||
DECLARE vDone BOOL DEFAULT FALSE;
|
DECLARE vDone BOOL DEFAULT FALSE;
|
||||||
DECLARE vBase DOUBLE;
|
DECLARE vBase DOUBLE;
|
||||||
DECLARE vVat DOUBLE;
|
DECLARE vVat DOUBLE;
|
||||||
|
@ -205,9 +205,9 @@ BEGIN
|
||||||
WHERE correctingFk = vInvoiceInFk;
|
WHERE correctingFk = vInvoiceInFk;
|
||||||
|
|
||||||
IF vInvoiceInOriginalFk THEN
|
IF vInvoiceInOriginalFk THEN
|
||||||
|
|
||||||
UPDATE movContaIVA mci
|
UPDATE movContaIVA mci
|
||||||
JOIN vn.invoiceInRefund iir ON iir.invoiceInRefundFk = vInvoiceInFk
|
JOIN vn.invoiceInCorrection iic ON iic.correctingFk = vInvoiceInFk
|
||||||
|
JOIN vn.siiTypeInvoiceIn st ON st.id = iic.siiTypeInvoiceInFk
|
||||||
JOIN (SELECT issued,
|
JOIN (SELECT issued,
|
||||||
SUM(sub.taxableBase) taxableBase,
|
SUM(sub.taxableBase) taxableBase,
|
||||||
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
||||||
|
@ -216,7 +216,7 @@ BEGIN
|
||||||
ti.PorcentajeIva
|
ti.PorcentajeIva
|
||||||
FROM vn.invoiceIn i
|
FROM vn.invoiceIn i
|
||||||
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
||||||
JOIN sage.TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
JOIN TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
||||||
WHERE i.id = vInvoiceInOriginalFk
|
WHERE i.id = vInvoiceInOriginalFk
|
||||||
GROUP BY ti.CodigoIva)sub
|
GROUP BY ti.CodigoIva)sub
|
||||||
)invoiceInOriginal
|
)invoiceInOriginal
|
||||||
|
@ -229,7 +229,6 @@ BEGIN
|
||||||
mci.CuotaIvaOriginal = invoiceInOriginal.vat,
|
mci.CuotaIvaOriginal = invoiceInOriginal.vat,
|
||||||
mci.ClaveOperacionFactura = co.ClaveOperacionFactura_
|
mci.ClaveOperacionFactura = co.ClaveOperacionFactura_
|
||||||
WHERE mci.id = vXDiarioFk;
|
WHERE mci.id = vXDiarioFk;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -169,6 +169,7 @@ BEGIN
|
||||||
UPDATE movContaIVA mci
|
UPDATE movContaIVA mci
|
||||||
JOIN vn.invoiceOut i ON i.id = vInvoiceOutCorrectedFk
|
JOIN vn.invoiceOut i ON i.id = vInvoiceOutCorrectedFk
|
||||||
JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutCorrectedFk
|
JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutCorrectedFk
|
||||||
|
JOIN vn.siiTypeInvoiceOut st ON st.id = ic.siiTypeInvoiceOutFk
|
||||||
JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase,
|
JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase,
|
||||||
SUM(IF(IFNULL(e.vatFk, TRUE), iot.vat, 0)) vat,
|
SUM(IF(IFNULL(e.vatFk, TRUE), iot.vat, 0)) vat,
|
||||||
SUM(IF(IFNULL(e.vatFk, TRUE), 0, iot.vat)) equ
|
SUM(IF(IFNULL(e.vatFk, TRUE), 0, iot.vat)) equ
|
||||||
|
@ -177,8 +178,8 @@ BEGIN
|
||||||
WHERE iot.invoiceOutFk = vInvoiceOutCorrectedFk
|
WHERE iot.invoiceOutFk = vInvoiceOutCorrectedFk
|
||||||
) tax
|
) tax
|
||||||
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
||||||
SET mci.TipoRectificativa = 2,
|
SET mci.TipoRectificativa = ic.cplusRectificationTypeFk,
|
||||||
mci.ClaseAbonoRectificativas = 1,
|
mci.ClaseAbonoRectificativas = REGEXP_REPLACE(st.`code`, '[^0-9]', ''),
|
||||||
mci.FechaFacturaOriginal = i.issued,
|
mci.FechaFacturaOriginal = i.issued,
|
||||||
mci.FechaOperacion = i.issued,
|
mci.FechaOperacion = i.issued,
|
||||||
mci.BaseImponibleOriginal = tax.taxableBase,
|
mci.BaseImponibleOriginal = tax.taxableBase,
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` EVENT `vn`.`client_setPackagesDiscountFactor`
|
||||||
|
ON SCHEDULE EVERY 1 DAY
|
||||||
|
STARTS '2024-10-18 03:00:00.000'
|
||||||
|
ON COMPLETION PRESERVE
|
||||||
|
ENABLE
|
||||||
|
DO CALL client_setPackagesDiscountFactor()$$
|
||||||
|
DELIMITER ;
|
|
@ -11,6 +11,7 @@ BEGIN
|
||||||
DECLARE vCurrentCommission INT;
|
DECLARE vCurrentCommission INT;
|
||||||
DECLARE vIsNotEUR INT;
|
DECLARE vIsNotEUR INT;
|
||||||
DECLARE vLastEntryFk INT;
|
DECLARE vLastEntryFk INT;
|
||||||
|
DECLARE vLanded INT;
|
||||||
|
|
||||||
SELECT count(*) INTO vIsNotEUR
|
SELECT count(*) INTO vIsNotEUR
|
||||||
FROM currency c
|
FROM currency c
|
||||||
|
@ -26,23 +27,25 @@ BEGIN
|
||||||
|
|
||||||
RETURN IFNULL(vCommission, 0);
|
RETURN IFNULL(vCommission, 0);
|
||||||
ELSE
|
ELSE
|
||||||
|
SELECT landed INTO vLanded
|
||||||
|
FROM travel
|
||||||
|
WHERE id = vTravelFk;
|
||||||
|
|
||||||
SELECT e.id INTO vLastEntryFk
|
SELECT e.id INTO vLastEntryFk
|
||||||
FROM `entry` e
|
FROM `entry` e
|
||||||
JOIN travel tr ON tr.id = e.travelFk
|
JOIN travel tr ON tr.id = e.travelFk
|
||||||
WHERE e.supplierFk = vSupplierFk
|
WHERE e.supplierFk = vSupplierFk
|
||||||
ORDER BY tr.landed DESC
|
ORDER BY (vLanded <= tr.landed), tr.landed DESC
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
IF vLastEntryFk THEN
|
IF vLastEntryFk THEN
|
||||||
SELECT commission INTO vCurrentCommission
|
SELECT commission INTO vCurrentCommission
|
||||||
FROM `entry`
|
FROM `entry`
|
||||||
WHERE id = vLastEntryFk;
|
WHERE id = vLastEntryFk;
|
||||||
|
|
||||||
ELSE
|
ELSE
|
||||||
SELECT commission INTO vCurrentCommission
|
SELECT commission INTO vCurrentCommission
|
||||||
FROM supplier s
|
FROM supplier s
|
||||||
WHERE s.id = vSupplierFk;
|
WHERE s.id = vSupplierFk;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RETURN vCurrentCommission;
|
RETURN vCurrentCommission;
|
||||||
|
|
|
@ -231,7 +231,19 @@ BEGIN
|
||||||
SELECT tcc.warehouseFK,
|
SELECT tcc.warehouseFK,
|
||||||
tcc.itemFk,
|
tcc.itemFk,
|
||||||
c2.id,
|
c2.id,
|
||||||
z.inflation * ROUND(ic.cm3delivery * (IFNULL(zo.price,5000) - IFNULL(zo.bonus,0)) / (1000 * vc.standardFlowerBox) , 4) cost
|
z.inflation
|
||||||
|
* ROUND(
|
||||||
|
ic.cm3delivery
|
||||||
|
* (
|
||||||
|
(
|
||||||
|
zo.priceOptimum + (( zo.price - zo.priceOptimum) * 2 * ( 1 - c.packagesDiscountFactor))
|
||||||
|
)
|
||||||
|
- IFNULL(zo.bonus, 0)
|
||||||
|
)
|
||||||
|
/ (1000 * vc.standardFlowerBox),
|
||||||
|
4
|
||||||
|
) cost
|
||||||
|
|
||||||
FROM tmp.ticketComponentCalculate tcc
|
FROM tmp.ticketComponentCalculate tcc
|
||||||
JOIN item i ON i.id = tcc.itemFk
|
JOIN item i ON i.id = tcc.itemFk
|
||||||
JOIN tmp.zoneOption zo ON zo.zoneFk = vZoneFk
|
JOIN tmp.zoneOption zo ON zo.zoneFk = vZoneFk
|
||||||
|
@ -239,6 +251,7 @@ BEGIN
|
||||||
JOIN agencyMode am ON am.id = z.agencyModeFk
|
JOIN agencyMode am ON am.id = z.agencyModeFk
|
||||||
JOIN vn.volumeConfig vc
|
JOIN vn.volumeConfig vc
|
||||||
JOIN vn.component c2 ON c2.code = 'delivery'
|
JOIN vn.component c2 ON c2.code = 'delivery'
|
||||||
|
JOIN `client` c on c.id = vClientFk
|
||||||
LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk
|
LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk
|
||||||
AND ic.itemFk = tcc.itemFk
|
AND ic.itemFk = tcc.itemFk
|
||||||
HAVING cost <> 0;
|
HAVING cost <> 0;
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
DELIMITER $$
|
||||||
|
|
||||||
|
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
||||||
|
PROCEDURE `vn`.`client_setPackagesDiscountFactor`()
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Set the discount factor for the packages of the clients.
|
||||||
|
*/
|
||||||
|
UPDATE client c
|
||||||
|
JOIN (
|
||||||
|
SELECT t.clientFk,
|
||||||
|
LEAST((
|
||||||
|
SUM(t.packages) / COUNT(DISTINCT DATE(t.shipped))
|
||||||
|
) / cc.packagesOptimum, 1) discountFactor
|
||||||
|
FROM ticket t
|
||||||
|
JOIN clientConfig cc ON TRUE
|
||||||
|
WHERE t.shipped > util.VN_CURDATE() - INTERVAL cc.monthsToCalcOptimumPrice MONTH
|
||||||
|
AND t.packages
|
||||||
|
GROUP BY t.clientFk
|
||||||
|
) ca ON c.id = ca.clientFk
|
||||||
|
SET c.packagesDiscountFactor = ca.discountFactor;
|
||||||
|
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
|
@ -1,48 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`inventoryFailureAdd`()
|
|
||||||
BEGIN
|
|
||||||
|
|
||||||
DECLARE done BOOL DEFAULT FALSE;
|
|
||||||
DECLARE vTicketFk INT;
|
|
||||||
|
|
||||||
DECLARE rs CURSOR FOR
|
|
||||||
SELECT id FROM vn.ticket
|
|
||||||
WHERE shipped = util.yesterday()
|
|
||||||
AND clientFk = 400
|
|
||||||
AND warehouseFk IN (1,44);
|
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
|
|
||||||
|
|
||||||
OPEN rs;
|
|
||||||
|
|
||||||
FETCH rs INTO vTicketFk;
|
|
||||||
|
|
||||||
WHILE NOT done DO
|
|
||||||
|
|
||||||
INSERT INTO vn.inventoryFailure(dated, itemFk, quantity, value, warehouseFk, throwerFk)
|
|
||||||
SELECT t.shipped,
|
|
||||||
s.itemFk,
|
|
||||||
s.quantity,
|
|
||||||
b.buyingValue + b.freightValue + b.packageValue + b.comissionValue,
|
|
||||||
t.warehouseFk,
|
|
||||||
w.id
|
|
||||||
FROM vn.ticket t
|
|
||||||
JOIN vn.sale s ON s.ticketFk = t.id
|
|
||||||
LEFT JOIN cache.last_buy lb ON lb.warehouse_id = t.warehouseFk AND item_id = s.itemFk
|
|
||||||
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
|
||||||
LEFT JOIN vn.worker w ON w.code = LEFT(s.concept, 3)
|
|
||||||
WHERE t.id = vTicketFk
|
|
||||||
AND s.quantity > 0;
|
|
||||||
|
|
||||||
FETCH rs INTO vTicketFk;
|
|
||||||
|
|
||||||
END WHILE;
|
|
||||||
|
|
||||||
|
|
||||||
CLOSE rs;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -43,7 +43,7 @@ BEGIN
|
||||||
ii.cplusTaxBreakFk,
|
ii.cplusTaxBreakFk,
|
||||||
ii.cplusSubjectOpFk,
|
ii.cplusSubjectOpFk,
|
||||||
ii.siiTypeInvoiceInFk,
|
ii.siiTypeInvoiceInFk,
|
||||||
ii.cplusRectificationTypeFk,
|
ic.cplusRectificationTypeFk,
|
||||||
ii.booked,
|
ii.booked,
|
||||||
IFNULL(a.isUeeMember, c.isUeeMember) isUeeMember,
|
IFNULL(a.isUeeMember, c.isUeeMember) isUeeMember,
|
||||||
(c.id = cc.id) isSameCountry,
|
(c.id = cc.id) isSameCountry,
|
||||||
|
@ -66,6 +66,7 @@ BEGIN
|
||||||
e.name expenseName
|
e.name expenseName
|
||||||
FROM invoiceIn ii
|
FROM invoiceIn ii
|
||||||
JOIN supplier s ON s.id = ii.supplierFk
|
JOIN supplier s ON s.id = ii.supplierFk
|
||||||
|
LEFT JOIN invoiceInCorrection ic ON ic.correctingFk = ii.id
|
||||||
LEFT JOIN province p ON p.id = s.provinceFk
|
LEFT JOIN province p ON p.id = s.provinceFk
|
||||||
LEFT JOIN autonomy a ON a.id = p.autonomyFk
|
LEFT JOIN autonomy a ON a.id = p.autonomyFk
|
||||||
JOIN country c ON c.id = s.countryFk
|
JOIN country c ON c.id = s.countryFk
|
||||||
|
|
|
@ -34,6 +34,7 @@ BEGIN
|
||||||
DECLARE vMaxShipped DATE;
|
DECLARE vMaxShipped DATE;
|
||||||
DECLARE vDone BOOL;
|
DECLARE vDone BOOL;
|
||||||
DECLARE vTicketFk INT;
|
DECLARE vTicketFk INT;
|
||||||
|
DECLARE vAddressFk INT;
|
||||||
DECLARE vCursor CURSOR FOR
|
DECLARE vCursor CURSOR FOR
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM tmp.ticketToInvoice;
|
FROM tmp.ticketToInvoice;
|
||||||
|
@ -48,11 +49,13 @@ BEGIN
|
||||||
DATE(vInvoiceDate) >= invoiceOut_getMaxIssued(
|
DATE(vInvoiceDate) >= invoiceOut_getMaxIssued(
|
||||||
vSerial,
|
vSerial,
|
||||||
t.companyFk,
|
t.companyFk,
|
||||||
YEAR(vInvoiceDate))
|
YEAR(vInvoiceDate)),
|
||||||
|
t.addressFk
|
||||||
INTO vClientFk,
|
INTO vClientFk,
|
||||||
vCompanyFk,
|
vCompanyFk,
|
||||||
vMaxShipped,
|
vMaxShipped,
|
||||||
vIsCorrectInvoiceDate
|
vIsCorrectInvoiceDate,
|
||||||
|
vAddressFk
|
||||||
FROM tmp.ticketToInvoice tt
|
FROM tmp.ticketToInvoice tt
|
||||||
JOIN ticket t ON t.id = tt.id;
|
JOIN ticket t ON t.id = tt.id;
|
||||||
|
|
||||||
|
@ -105,7 +108,9 @@ BEGIN
|
||||||
clientFk,
|
clientFk,
|
||||||
dued,
|
dued,
|
||||||
companyFk,
|
companyFk,
|
||||||
siiTypeInvoiceOutFk
|
siiTypeInvoiceOutFk,
|
||||||
|
customsAgentFk,
|
||||||
|
incotermsFk
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
1,
|
1,
|
||||||
|
@ -118,9 +123,12 @@ BEGIN
|
||||||
vCplusCorrectingInvoiceTypeFk,
|
vCplusCorrectingInvoiceTypeFk,
|
||||||
IF(vSerial = vSimplifiedSerial,
|
IF(vSerial = vSimplifiedSerial,
|
||||||
vCplusSimplifiedInvoiceTypeFk,
|
vCplusSimplifiedInvoiceTypeFk,
|
||||||
vCplusStandardInvoiceTypeFk))
|
vCplusStandardInvoiceTypeFk)),
|
||||||
FROM client
|
a.customsAgentFk,
|
||||||
WHERE id = vClientFk;
|
a.incotermsFk
|
||||||
|
FROM client c
|
||||||
|
JOIN address a ON a.id = vAddressFk
|
||||||
|
WHERE c.id = vClientFk;
|
||||||
|
|
||||||
SET vNewInvoiceId = LAST_INSERT_ID();
|
SET vNewInvoiceId = LAST_INSERT_ID();
|
||||||
|
|
||||||
|
|
|
@ -164,10 +164,6 @@ BEGIN
|
||||||
SET itemFk = vItemNew
|
SET itemFk = vItemNew
|
||||||
WHERE itemFk = vItemOld;
|
WHERE itemFk = vItemOld;
|
||||||
|
|
||||||
UPDATE inventoryFailure
|
|
||||||
SET itemFk = vItemNew
|
|
||||||
WHERE itemFk = vItemOld;
|
|
||||||
|
|
||||||
UPDATE genericAllocation
|
UPDATE genericAllocation
|
||||||
SET itemFk = vItemNew
|
SET itemFk = vItemNew
|
||||||
WHERE itemFk = vItemOld;
|
WHERE itemFk = vItemOld;
|
||||||
|
|
|
@ -16,10 +16,11 @@ BEGIN
|
||||||
TRUE,
|
TRUE,
|
||||||
sc.userFk,
|
sc.userFk,
|
||||||
s.id
|
s.id
|
||||||
FROM vn.sectorCollection sc
|
FROM sectorCollection sc
|
||||||
JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
|
JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
|
||||||
JOIN vn.saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk
|
JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk
|
||||||
JOIN vn.state s ON s.code = 'OK PREVIOUS'
|
JOIN state s ON s.code = 'OK PREVIOUS'
|
||||||
|
JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk
|
||||||
WHERE sc.id = vSectorCollectionFk;
|
WHERE sc.id = vSectorCollectionFk;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -52,7 +52,8 @@ BEGIN
|
||||||
IFNULL(dest.nickname, origin.nickname) nickname,
|
IFNULL(dest.nickname, origin.nickname) nickname,
|
||||||
dest.landed,
|
dest.landed,
|
||||||
dest.preparation,
|
dest.preparation,
|
||||||
origin.departmentFk
|
origin.departmentFk,
|
||||||
|
origin.saleClonedFk
|
||||||
FROM (
|
FROM (
|
||||||
SELECT s.ticketFk,
|
SELECT s.ticketFk,
|
||||||
c.salesPersonFk workerFk,
|
c.salesPersonFk workerFk,
|
||||||
|
@ -73,11 +74,13 @@ BEGIN
|
||||||
t.warehouseFk,
|
t.warehouseFk,
|
||||||
t.companyFk,
|
t.companyFk,
|
||||||
t.agencyModeFk,
|
t.agencyModeFk,
|
||||||
wd.departmentFk
|
wd.departmentFk,
|
||||||
|
sc.saleClonedFk
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN client c ON c.id = t.clientFk
|
JOIN client c ON c.id = t.clientFk
|
||||||
JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk
|
JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk
|
||||||
JOIN sale s ON s.ticketFk = t.id
|
JOIN sale s ON s.ticketFk = t.id
|
||||||
|
LEFT JOIN saleCloned sc ON sc.saleClonedFk = s.id
|
||||||
JOIN saleVolume sv ON sv.saleFk = s.id
|
JOIN saleVolume sv ON sv.saleFk = s.id
|
||||||
JOIN item i ON i.id = s.itemFk
|
JOIN item i ON i.id = s.itemFk
|
||||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||||
|
|
|
@ -1,26 +1,27 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`zone_getAddresses`(
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`zone_getAddresses`(
|
||||||
vSelf INT,
|
vSelf INT,
|
||||||
vShipped DATE,
|
vLanded DATE,
|
||||||
vDepartmentFk INT
|
vDepartmentFk INT
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Devuelve un listado de todos los clientes activos
|
* Devuelve un listado de todos los clientes activos
|
||||||
* con consignatarios a los que se les puede
|
* con consignatarios a los que se les puede
|
||||||
* vender producto para esa zona.
|
* entregar producto para esa zona.
|
||||||
*
|
*
|
||||||
* @param vSelf Id de zona
|
* @param vSelf Id de zona
|
||||||
* @param vShipped Fecha de envio
|
* @param vLanded Fecha de entrega
|
||||||
* @param vDepartmentFk Id de departamento
|
* @param vDepartmentFk Id de departamento | NULL para mostrar todos
|
||||||
* @return Un select
|
* @return Un select
|
||||||
*/
|
*/
|
||||||
CALL zone_getPostalCode(vSelf);
|
CALL zone_getPostalCode(vSelf);
|
||||||
|
|
||||||
WITH clientWithTicket AS (
|
WITH clientWithTicket AS (
|
||||||
SELECT clientFk
|
SELECT DISTINCT clientFk
|
||||||
FROM vn.ticket
|
FROM vn.ticket
|
||||||
WHERE shipped BETWEEN vShipped AND util.dayEnd(vShipped)
|
WHERE landed BETWEEN vLanded AND util.dayEnd(vLanded)
|
||||||
|
AND NOT isDeleted
|
||||||
)
|
)
|
||||||
SELECT c.id,
|
SELECT c.id,
|
||||||
c.name,
|
c.name,
|
||||||
|
@ -30,7 +31,7 @@ BEGIN
|
||||||
u.name username,
|
u.name username,
|
||||||
aai.invoiced,
|
aai.invoiced,
|
||||||
cnb.lastShipped,
|
cnb.lastShipped,
|
||||||
cwt.clientFk
|
IF(cwt.clientFk, TRUE, FALSE) hasTicket
|
||||||
FROM vn.client c
|
FROM vn.client c
|
||||||
JOIN vn.worker w ON w.id = c.salesPersonFk
|
JOIN vn.worker w ON w.id = c.salesPersonFk
|
||||||
JOIN vn.workerDepartment wd ON wd.workerFk = w.id
|
JOIN vn.workerDepartment wd ON wd.workerFk = w.id
|
||||||
|
@ -50,7 +51,7 @@ BEGIN
|
||||||
AND c.isActive
|
AND c.isActive
|
||||||
AND ct.code = 'normal'
|
AND ct.code = 'normal'
|
||||||
AND bt.code <> 'worker'
|
AND bt.code <> 'worker'
|
||||||
AND (d.id = vDepartmentFk OR NOT vDepartmentFk)
|
AND (d.id = vDepartmentFk OR vDepartmentFk IS NULL)
|
||||||
GROUP BY c.id;
|
GROUP BY c.id;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.zoneNodes;
|
DROP TEMPORARY TABLE tmp.zoneNodes;
|
||||||
|
|
|
@ -30,6 +30,7 @@ BEGIN
|
||||||
TIME(IFNULL(e.`hour`, z.`hour`)) `hour`,
|
TIME(IFNULL(e.`hour`, z.`hour`)) `hour`,
|
||||||
l.travelingDays,
|
l.travelingDays,
|
||||||
IFNULL(e.price, z.price) price,
|
IFNULL(e.price, z.price) price,
|
||||||
|
IFNULL(e.priceOptimum, z.priceOptimum) priceOptimum,
|
||||||
IFNULL(e.bonus, z.bonus) bonus,
|
IFNULL(e.bonus, z.bonus) bonus,
|
||||||
l.landed,
|
l.landed,
|
||||||
vShipped shipped
|
vShipped shipped
|
||||||
|
|
|
@ -3,24 +3,30 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`invoiceIn_afterUpdate`
|
||||||
AFTER UPDATE ON `invoiceIn`
|
AFTER UPDATE ON `invoiceIn`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
IF NEW.issued != OLD.issued
|
DECLARE vIsEuro BOOL;
|
||||||
OR NEW.currencyFk != OLD.currencyFk THEN
|
|
||||||
|
SELECT `code` = 'EUR' INTO vIsEuro
|
||||||
|
FROM currency
|
||||||
|
WHERE id = NEW.currencyFk;
|
||||||
|
|
||||||
|
IF (NOT NEW.issued <=> OLD.issued
|
||||||
|
OR NEW.currencyFk <> OLD.currencyFk) THEN
|
||||||
|
|
||||||
UPDATE invoiceInTax iit
|
UPDATE invoiceInTax iit
|
||||||
JOIN invoiceIn ii ON ii.id = iit.invoiceInFk
|
JOIN invoiceIn ii ON ii.id = iit.invoiceInFk
|
||||||
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
||||||
AND rr.currencyFk = ii.currencyFk
|
AND rr.currencyFk = ii.currencyFk
|
||||||
SET iit.taxableBase = IF(iit.foreignValue IS NULL, iit.taxableBase, iit.foreignValue / rr.value)
|
SET iit.taxableBase = IF(vIsEuro, iit.taxableBase, iit.foreignValue / rr.value),
|
||||||
|
iit.foreignValue = IF(vIsEuro, NULL, iit.foreignValue)
|
||||||
WHERE ii.id = NEW.id;
|
WHERE ii.id = NEW.id;
|
||||||
|
|
||||||
UPDATE invoiceInDueDay iidd
|
UPDATE invoiceInDueDay iidd
|
||||||
JOIN invoiceIn ii ON ii.id = iidd.invoiceInFk
|
JOIN invoiceIn ii ON ii.id = iidd.invoiceInFk
|
||||||
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
|
||||||
AND rr.currencyFk = ii.currencyFk
|
AND rr.currencyFk = ii.currencyFk
|
||||||
SET iidd.amount = IF(iidd.foreignValue IS NULL, iidd.amount, iidd.foreignValue / rr.value)
|
SET iidd.amount = IF(vIsEuro, iidd.amount, iidd.foreignValue / rr.value),
|
||||||
|
iidd.foreignValue = IF(vIsEuro, NULL, iidd.foreignValue)
|
||||||
WHERE ii.id = NEW.id;
|
WHERE ii.id = NEW.id;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -22,6 +22,7 @@ BEGIN
|
||||||
OR !(NEW.workerFk <=> OLD.workerFk)
|
OR !(NEW.workerFk <=> OLD.workerFk)
|
||||||
OR !(NEW.m3 <=> OLD.m3)
|
OR !(NEW.m3 <=> OLD.m3)
|
||||||
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)
|
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)
|
||||||
|
OR !(NEW.dated <=> OLD.dated)
|
||||||
OR !(NEW.vehicleFk <=> OLD.vehicleFk)THEN
|
OR !(NEW.vehicleFk <=> OLD.vehicleFk)THEN
|
||||||
CALL route_calcCommission(NEW.id);
|
CALL route_calcCommission(NEW.id);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerManaExcluded_beforeInsert`
|
||||||
|
BEFORE INSERT ON `workerManaExcluded`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
DELETE FROM workerMana
|
||||||
|
WHERE workerFk = NEW.workerFk;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,9 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerManaExcluded_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `workerManaExcluded`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
DELETE FROM workerMana
|
||||||
|
WHERE workerFk = NEW.workerFk;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,10 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerMana_beforeInsert`
|
||||||
|
BEFORE INSERT ON `workerMana`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
IF (SELECT EXISTS(SELECT TRUE FROM workerManaExcluded WHERE workerFk = NEW.workerFk)) THEN
|
||||||
|
CALL util.throw('Worker is excluded from mana');
|
||||||
|
END IF;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,10 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerMana_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `workerMana`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
IF (SELECT EXISTS(SELECT TRUE FROM workerManaExcluded WHERE workerFk = NEW.workerFk)) THEN
|
||||||
|
CALL util.throw('Worker is excluded from mana');
|
||||||
|
END IF;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -3,10 +3,12 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerTimeControl_after
|
||||||
AFTER DELETE ON `workerTimeControl`
|
AFTER DELETE ON `workerTimeControl`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO workerLog
|
IF account.myUser_getId() IS NOT NULL THEN
|
||||||
SET `action` = 'delete',
|
INSERT INTO workerLog
|
||||||
`changedModel` = 'WorkerTimeControl',
|
SET `action` = 'delete',
|
||||||
`changedModelId` = OLD.id,
|
`changedModel` = 'WorkerTimeControl',
|
||||||
`userFk` = account.myUser_getId();
|
`changedModelId` = OLD.id,
|
||||||
|
`userFk` = account.myUser_getId();
|
||||||
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
ALTER TABLE vn.invoiceOut ADD COLUMN IF NOT EXISTS customsAgentFk INT(11) DEFAULT NULL AFTER siiTrascendencyInvoiceOutFk;
|
||||||
|
ALTER TABLE vn.invoiceOut ADD COLUMN IF NOT EXISTS incotermsFk varchar(3) DEFAULT NULL AFTER customsAgentFk;
|
||||||
|
|
||||||
|
ALTER TABLE vn.invoiceOut ADD CONSTRAINT invoiceOut_customsAgentFk FOREIGN KEY (customsAgentFk)
|
||||||
|
REFERENCES vn.customsAgent (id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
ALTER TABLE vn.invoiceOut ADD CONSTRAINT invoiceOut_incotermsFk FOREIGN KEY (incotermsFk)
|
||||||
|
REFERENCES vn.incoterms (`code`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
UPDATE vn.invoiceOut io
|
||||||
|
JOIN vn.client c ON c.id = io.clientFk
|
||||||
|
JOIN vn.ticket t ON t.clientFk = c.id
|
||||||
|
JOIN vn.address a ON a.id = t.addressFk
|
||||||
|
SET io.customsAgentFk = a.customsAgentFk,
|
||||||
|
io.incotermsFk = a.incotermsFk;
|
|
@ -0,0 +1,11 @@
|
||||||
|
INSERT INTO hedera.message (code, description)
|
||||||
|
VALUES ('orderLinesWithZero','There are empty lines. Please delete them');
|
||||||
|
|
||||||
|
INSERT INTO hedera.messageI18n (code, lang, description)
|
||||||
|
VALUES ('orderLinesWithZero','es','Hay líneas vacías. Por favor, elimínelas');
|
||||||
|
|
||||||
|
INSERT INTO hedera.messageI18n (code, lang, description)
|
||||||
|
VALUES ('orderLinesWithZero','fr','Il y a des lignes vides. Veuillez les supprimer');
|
||||||
|
|
||||||
|
INSERT INTO hedera.messageI18n (code, lang, description)
|
||||||
|
VALUES ('orderLinesWithZero','pt','Existem linhas vazias. Por favor, apague-os');
|
|
@ -0,0 +1,185 @@
|
||||||
|
CREATE TABLE IF NOT EXISTS `vn`.`sim` (
|
||||||
|
`code` VARCHAR(25) COMMENT 'No se ha puesto BIGINT por incompatibilidad con Access',
|
||||||
|
`line` VARCHAR(15) NOT NULL CHECK (`line` REGEXP '^[0-9]+$'),
|
||||||
|
`ext` INT(4) NOT NULL,
|
||||||
|
`pin` VARCHAR(4) NOT NULL CHECK (`pin` REGEXP '^[0-9]+$'),
|
||||||
|
`puk` VARCHAR(15) NOT NULL CHECK (`pin` REGEXP '^[0-9]+$'),
|
||||||
|
PRIMARY KEY (`code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
||||||
|
ALTER TABLE vn.deviceProductionUser CHANGE simSerialNumber simFk VARCHAR(25) DEFAULT NULL NULL;
|
||||||
|
ALTER TABLE vn.deviceProductionUser MODIFY COLUMN simFk VARCHAR(25) DEFAULT NULL NULL;
|
||||||
|
|
||||||
|
INSERT IGNORE INTO `vn`.`sim` (`line`, `ext`, `pin`, `code`, `puk`) VALUES
|
||||||
|
('621188151', 2209, '1486', '3456985220092508','14213470'),
|
||||||
|
('621188152', 2210, '8765', '3456985220092509','99473093'),
|
||||||
|
('621188153', 2211, '3064', '3456985220092510','52967210'),
|
||||||
|
('621188759', 2081, '3700', '3456985220123637','56600999'),
|
||||||
|
('621188760', 2082, '3259', '345698522023638','87492404'),
|
||||||
|
('621188761', 2083, '2790', '3456985220123639','94009456'),
|
||||||
|
('621188762', 2084, '2480', '3456985220123644','1484999'),
|
||||||
|
('621188763', 2085, '6876', '3456985220123641','36577064'),
|
||||||
|
('621188766', 2086, '7775', '3456985220123642','80761698'),
|
||||||
|
('621188769', 2088, '4027', '3456985220123643','37921712'),
|
||||||
|
('621188771', 2089, '8797', '3456985220123640','63092540'),
|
||||||
|
('621188772', 2090, '8404', '3456985220123645','21014997'),
|
||||||
|
('621188773', 2091, '5481', '3456985220123646','16317277'),
|
||||||
|
('621188774', 2092, '9632', '3456985220123647','22235994'),
|
||||||
|
('621188775', 2093, '4654', '3456985220123648','28506486'),
|
||||||
|
('621188838', 2094, '1392', '3456985220123649','29498627'),
|
||||||
|
('621188839', 2095, '7774', '3456985220123650','46263490'),
|
||||||
|
('621188840', 2096, '7304', '3456985220123658','8212044'),
|
||||||
|
('621188841', 2097, '5569', '3456985220123652','81597658'),
|
||||||
|
('621188842', 2098, '4944', '3456985220123653','24961501'),
|
||||||
|
('621188843', 2099, '5142', '3456985220123654','17035634'),
|
||||||
|
('621188844', 2111, '7245', '3456985220123655','90231951'),
|
||||||
|
('621188846', 2110, '6590', '3456985220123656','72201537'),
|
||||||
|
('667680207', 2564, '4042', '34569832200759166','48401979'),
|
||||||
|
('667680315', 2565, '7143', '34569832200759372','32143252'),
|
||||||
|
('667680318', 2566, '6342', '34569832200759364','39597112'),
|
||||||
|
('667680413', 2567, '5580', '34569832200759356','32786992'),
|
||||||
|
('667680463', 2568, '0171', '34569832200759349','34240853'),
|
||||||
|
('667688217', 2569, '2500', '34569832200759331','5687589'),
|
||||||
|
('633603945', 2212, '7129', '34569832200759323','51554019'),
|
||||||
|
('622130186', 2213, '4826', '34569832200759307','19623551'),
|
||||||
|
('633973424', 2214, '8535', '34569832200759299','94619307'),
|
||||||
|
('633703828', 2215, '8628', '34569832200759281','22468012'),
|
||||||
|
('622025110', 2216, '2399', '34569832200759273','34602918'),
|
||||||
|
('622924867', 2217, '5665', '34569832200759265','26920216'),
|
||||||
|
('722409630', 2218, '5211', '34569832200759240','93750137'),
|
||||||
|
('623590529', 2219, '0493', '34569832200759208','47077088'),
|
||||||
|
('633243462', 2220, '6902', '34569832200759174','6421962'),
|
||||||
|
('633047286', 2221, '5592', '34569832200759182','32069439'),
|
||||||
|
('744716801', 2112, '9184', '34569832200759190','57049814'),
|
||||||
|
('655995021', 2131, '8896', '34569852202049093','19497356'),
|
||||||
|
('685522718', 2132, '1955', '34569852202049101','28519879'),
|
||||||
|
('674587213', 2994, '2006', '34569332200223743','62360135'),
|
||||||
|
('674587227', 2993, '9271', '34569332200223750','81628192'),
|
||||||
|
('674587229', 2993, '0900', '34569332200223768','91119071'),
|
||||||
|
('674587231', 2992, '5007', '34569332200223776','45826232'),
|
||||||
|
('674587234', 2991, '1378', '34569332200223784','91245744'),
|
||||||
|
('674587240', 2990, '0905', '34569332200223792','13083224'),
|
||||||
|
('674587245', 2989, '9059', '34569332200223800','15291807'),
|
||||||
|
('674587250', 2988, '8188', '34569332200223818','83017918'),
|
||||||
|
('674587254', 2987, '2962', '34569332200223826','92809271'),
|
||||||
|
('674587256', 2986, '0358', '34569332200223834','81067040'),
|
||||||
|
('674592713', 2570, '2537', '34569332200230672','82325850'),
|
||||||
|
('697832478', 2579, '0936', '34568732200494825','49658372'),
|
||||||
|
('697832176', 2571, '5944', '34568732200494742','19039461'),
|
||||||
|
('697832477', 2572, '5138', '34568732200494759','25712504'),
|
||||||
|
('697832178', 2573, '4597', '34568732200494767','66241760'),
|
||||||
|
('697832182', 2574, '9241', '34568732200494775','07342562'),
|
||||||
|
('697832196', 2575, '2995', '34568732200494783','53929026'),
|
||||||
|
('697832214', 2576, '7434', '34568732200494791','49698432'),
|
||||||
|
('697832230', 2577, '7004', '34568732200494809','21578612'),
|
||||||
|
('697832235', 2578, '9674', '34568732200494817','93090700'),
|
||||||
|
('673420375', 2599, '5430', '34562052300117259','35911412'),
|
||||||
|
('673420367', 2598, '8402', '34562052300117242','924654'),
|
||||||
|
('673420361', 2597, '5125', '34562052300117234','12027970'),
|
||||||
|
('673420355', 2596, '5069', '34562052300117226','34978149'),
|
||||||
|
('673420348', 2595, '8911', '34562052300117218','4228121'),
|
||||||
|
('673420346', 2594, '2461', '34562052300117200','67670772'),
|
||||||
|
('673420345', 2593, '2226', '34562052300117192','90586404'),
|
||||||
|
('673420306', 2592, '3355', '34562052300117184','97850017'),
|
||||||
|
('673420257', 2591, '9395', '34562052300117176','50713786'),
|
||||||
|
('673420231', 2590, '1378', '34562052300117168','50151763'),
|
||||||
|
('673420223', 2589, '9580', '34562052300117150','99534550'),
|
||||||
|
('673420216', 2588, '4955', '34562052300117143','317554'),
|
||||||
|
('673420203', 2587, '6742', '34562052300117135','69321531'),
|
||||||
|
('673420201', 2586, '1659', '34562052300117127','54720480'),
|
||||||
|
('673420199', 2585, '7823', '34562052300117119','22923796'),
|
||||||
|
('673420198', 2584, '1787', '34562052300117101','54414630'),
|
||||||
|
('673420168', 2583, '6334', '34562052300117093','50694894'),
|
||||||
|
('673420147', 2582, '8951', '34562052300117085','1402535'),
|
||||||
|
('673420125', 2581, '3068', '34562052300117077','86216200'),
|
||||||
|
('673420124', 2580, '9517', '34562052300117069','42504099'),
|
||||||
|
('600294609', 2715, '7474', '34569832304894588','55923317'),
|
||||||
|
('600084713', 2703, '8342', '34569832304894570','8392636'),
|
||||||
|
('600084732', 2704, '1625', '34569832304894513','75477452'),
|
||||||
|
('600084850', 2705, '9896', '34569832304894653','28589813'),
|
||||||
|
('600084951', 2706, '5520', '34569832304894661','75353012'),
|
||||||
|
('600084978', 2707, '2698', '34569832304894679','9005523'),
|
||||||
|
('600085403', 2708, '0837', '34569832304894646','77051152'),
|
||||||
|
('600085513', 2709, '3106', '34569832304894687','41571002'),
|
||||||
|
('600293916', 2712, '8990', '34569832304894620','95188676'),
|
||||||
|
('600294160', 2714, '6376', '34569832304894703','79879896'),
|
||||||
|
('671919529', 2975, '9184', '34569832304806236','7535392'),
|
||||||
|
('671919942', 2981, '0328', '34569832304806269','31052894'),
|
||||||
|
('671919530', 2976, '0344', '34569832304806251','89860304'),
|
||||||
|
('671919533', 2977, '0668', '34569832304806244','42921771'),
|
||||||
|
('671919535', 2978, '0105', '34569832304806277','31009417'),
|
||||||
|
('671919537', 2979, '0881', '34569832304806285','33479769'),
|
||||||
|
('671919540', 2980, '9874', '34569832304806293','14103929'),
|
||||||
|
('671919525', 2972, '2089', '34569832304806301','45903729'),
|
||||||
|
('671919527', 2973, '8206', '34569832304806368','1586035'),
|
||||||
|
('671919528', 2974, '2532', '34569832304806327','62310124'),
|
||||||
|
('673668717', 2836, '7973', '34562032301044223','15635496'),
|
||||||
|
('673668734', 2837, '4457', '34562032301044231','18313118'),
|
||||||
|
('673668738', 2824, '2911', '34562032301044249','30875583'),
|
||||||
|
('673668745', 2838, '7253', '34562032301044256','62754222'),
|
||||||
|
('673668796', 2839, '0068', '34562032301044264','15556829'),
|
||||||
|
('673668803', 2840, '2386', '34562032301044272','17572287'),
|
||||||
|
('673669591', 2850, '3833', '34562032301044280','34828896'),
|
||||||
|
('673668808', 2841, '3584', '34562032301044298','16234497'),
|
||||||
|
('673670102', 2851, '3554', '34562032301044306','23652625'),
|
||||||
|
('673670131', 2852, '4412', '34562032301044314','88611709'),
|
||||||
|
('673670135', 2827, '6058', '34562032301044322','53918579'),
|
||||||
|
('673670201', 2828, '8066', '34562032301044330','92369343'),
|
||||||
|
('673670225', 2829, '4592', '34562032301044348','24126635'),
|
||||||
|
('673670236', 2830, '2974', '34562032301044355','88608465'),
|
||||||
|
('673671485', 2849, '0349', '34562032301044363','44944874'),
|
||||||
|
('673461977', 2871, '1728', '34562032400157090','46975780'),
|
||||||
|
('673461975', 2870, '4734', '34562032400157082','69628432'),
|
||||||
|
('673461972', 2867, '6276', '34562032400157058','53338365'),
|
||||||
|
('673461979', 2872, '6043', '34562032400157108','36525197'),
|
||||||
|
('673461958', 2859, '3164', '34562032400156977','58947831'),
|
||||||
|
('673461957', 2857, '8685', '34562032400156969','15826386'),
|
||||||
|
('673461944', 2853, '1073', '34562032400156910','20452195'),
|
||||||
|
('673461974', 2869, '7121', '34562032400157074','32044645'),
|
||||||
|
('673461973', 2868, '8022', '34562032400157066','29282044'),
|
||||||
|
('673461971', 2866, '3089', '34562032400157041','66149978'),
|
||||||
|
('673461969', 2865, '7555', '34562032400157033','78391293'),
|
||||||
|
('673461960', 2860, '5203', '34562032400156985','37138232'),
|
||||||
|
('673461952', 2855, '6915', '34562032400156936','62724661'),
|
||||||
|
('673461949', 2854, '8706', '34562032400156928','5594345'),
|
||||||
|
('673461966', 2863, '2496', '34562032400157017','93450666'),
|
||||||
|
('673461968', 2864, '3703', '34562032400157025','23208841'),
|
||||||
|
('673461963', 2862, '9364', '34562032400157009','29712130'),
|
||||||
|
('673462719', 2873, '9387', '34562032400156951','50434348'),
|
||||||
|
('673461962', 2861, '8441', '34562032400156993','39686909'),
|
||||||
|
('673461956', 2826, '5392', '34562032400156944','5496107'),
|
||||||
|
('673465284', 2694, '1523', '34562032400171349','14554994'),
|
||||||
|
('673465282', 2692, '4645', '34562032400171323','24871187'),
|
||||||
|
('673465283', 2693, '5253', '34562032400171331','28303238'),
|
||||||
|
('673465841', 2696, '0849', '34562032400171257','21673222'),
|
||||||
|
('673465258', 2679, '4140', '34562032400171174','39793881'),
|
||||||
|
('673465263', 2680, '6922', '34562032400171182','12253261'),
|
||||||
|
('673465265', 2681, '9112', '34562032400171190','93894366'),
|
||||||
|
('673465267', 2682, '3259', '34562032400171208','2342189'),
|
||||||
|
('673465268', 2683, '8540', '34562032400171216','63886925'),
|
||||||
|
('673465285', 2695, '4167', '34562032400171356','79227618'),
|
||||||
|
('673465270', 2684, '4292', '34562032400171224','19216349'),
|
||||||
|
('673465272', 2685, '4007', '34562032400171232','14396903'),
|
||||||
|
('673465273', 2686, '6894', '34562032400171240','13569394'),
|
||||||
|
('673465274', 2687, '5268', '34562032400171265','59453667'),
|
||||||
|
('673465275', 2688, '0232', '34562032400171273','62324713'),
|
||||||
|
('673465276', 2689, '2720', '34562032400171281','65977200'),
|
||||||
|
('673465843', 2698, '4773', '34562032400171364','78387158'),
|
||||||
|
('673465842', 2697, '3729', '34562032400171315','94201789'),
|
||||||
|
('673465280', 2691, '0503', '34562032400171307','12298533'),
|
||||||
|
('673465279', 2690, '8239', '34562032400171299','76183877');
|
||||||
|
|
||||||
|
UPDATE vn.deviceProductionUser
|
||||||
|
SET simFk = NULL
|
||||||
|
WHERE id IN (
|
||||||
|
SELECT dpu.id
|
||||||
|
FROM vn.deviceProductionUser dpu
|
||||||
|
LEFT JOIN vn.sim s ON s.code = dpu.simFk
|
||||||
|
WHERE s.code IS NULL
|
||||||
|
AND dpu.simFk IS NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_sim_FK
|
||||||
|
FOREIGN KEY (simFk) REFERENCES vn.sim(code) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
GRANT SELECT, INSERT, DELETE, UPDATE ON TABLE vn.sim TO hr;
|
|
@ -0,0 +1,48 @@
|
||||||
|
USE vn;
|
||||||
|
|
||||||
|
DROP TRIGGER IF EXISTS invoiceIn_beforeUpdate;
|
||||||
|
|
||||||
|
UPDATE invoiceIn
|
||||||
|
SET cplusRectificationTypeFk = NULL
|
||||||
|
WHERE cplusRectificationTypeFk = 1;
|
||||||
|
|
||||||
|
DELETE IGNORE FROM cplusRectificationType WHERE id = 1;
|
||||||
|
|
||||||
|
UPDATE cplusRectificationType
|
||||||
|
SET id = 1
|
||||||
|
WHERE id = 3;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`invoiceIn_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `invoiceIn`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
DECLARE vWithholdingSageFk INT;
|
||||||
|
|
||||||
|
IF NOT (NEW.supplierRef <=> OLD.supplierRef) AND NOT util.checkPrintableChars(NEW.supplierRef) THEN
|
||||||
|
CALL util.throw('The invoiceIn reference contains invalid characters');
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
|
IF (SELECT COUNT(*) FROM invoiceIn
|
||||||
|
WHERE supplierRef = NEW.supplierRef
|
||||||
|
AND supplierFk = NEW.supplierFk
|
||||||
|
AND YEAR(issued) = YEAR(NEW.issued)
|
||||||
|
AND id <> NEW.id
|
||||||
|
) THEN
|
||||||
|
CALL util.throw('reference duplicated');
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF NEW.supplierFk != OLD.supplierFk THEN
|
||||||
|
CALL supplier_checkIsActive(NEW.supplierFk);
|
||||||
|
SELECT withholdingSageFk INTO vWithholdingSageFk
|
||||||
|
FROM supplier
|
||||||
|
WHERE id = NEW.supplierFk;
|
||||||
|
SET NEW.withholdingSageFk = vWithholdingSageFk;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
|
||||||
|
VALUES('SiiTypeInvoiceIn', 'find', 'READ', 'ALLOW', 'ROLE', 'salesPerson');
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS vn.invoiceInCorrection;
|
||||||
|
|
||||||
|
CREATE TABLE `invoiceInCorrection` (
|
||||||
|
`correctingFk` mediumint(8) unsigned NOT NULL COMMENT 'Factura rectificativa',
|
||||||
|
`correctedFk` mediumint(8) unsigned NOT NULL COMMENT 'Factura rectificada',
|
||||||
|
`cplusRectificationTypeFk` int(10) unsigned NOT NULL,
|
||||||
|
`siiTypeInvoiceInFk` int(10) unsigned NOT NULL,
|
||||||
|
`invoiceCorrectionTypeFk` int(11) NOT NULL DEFAULT 3,
|
||||||
|
PRIMARY KEY (`correctingFk`),
|
||||||
|
KEY `invoiceInCorrection_correctedFk` (`correctedFk`),
|
||||||
|
KEY `invoiceInCorrection_cplusRectificationTypeFk` (`cplusRectificationTypeFk`),
|
||||||
|
KEY `invoiceInCorrection_siiTypeInvoiceIn` (`siiTypeInvoiceInFk`),
|
||||||
|
KEY `invoiceInCorrection_invoiceCorrectionTypeFk` (`invoiceCorrectionTypeFk`),
|
||||||
|
CONSTRAINT `invoiceInCorrection_correctedFk` FOREIGN KEY (`correctedFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `invoiceInCorrection_correctingFk` FOREIGN KEY (`correctingFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `invoiceInCorrection_cplusRectificationTypeFk` FOREIGN KEY (`cplusRectificationTypeFk`) REFERENCES `cplusRectificationType` (`id`) ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `invoiceInCorrection_invoiceCorrectionTypeFk` FOREIGN KEY (`invoiceCorrectionTypeFk`) REFERENCES `invoiceCorrectionType` (`id`) ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `invoiceInCorrection_siiTypeInvoiceIn` FOREIGN KEY (`siiTypeInvoiceInFk`) REFERENCES `siiTypeInvoiceIn` (`id`) ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
CREATE TABLE `vn`.`osrmConfig` (
|
||||||
|
`id` int(10) unsigned NOT NULL,
|
||||||
|
`url` varchar(100) NOT NULL COMMENT 'Dirección base de la API',
|
||||||
|
`tolerance` decimal(6,6) NOT NULL DEFAULT 0 COMMENT 'Tolerancia entre las coordenadas enviadas y las retornadas',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
CONSTRAINT `osrmConfig_check` CHECK (`id` = 1)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
||||||
|
-- Para que no de error al añadir la FK de zone
|
||||||
|
UPDATE vn.zone
|
||||||
|
SET price = 0.1
|
||||||
|
WHERE price = 0;
|
||||||
|
|
||||||
|
ALTER TABLE vn.`zone`
|
||||||
|
ADD addressFk int(11) DEFAULT NULL COMMENT 'Punto de distribución de donde salen para repartir',
|
||||||
|
ADD CONSTRAINT zone_address_FK FOREIGN KEY (addressFk) REFERENCES vn.address(id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
ALTER TABLE vn.zoneConfig
|
||||||
|
ADD defaultAddressFk int(11) DEFAULT NULL NULL COMMENT 'Punto de distribución por defecto',
|
||||||
|
ADD CONSTRAINT zoneConfig_address_FK FOREIGN KEY (defaultAddressFk) REFERENCES vn.address(id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
@ -0,0 +1,5 @@
|
||||||
|
INSERT IGNORE INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||||
|
VALUES ('OsrmConfig','optimize','READ','ALLOW','ROLE','employee'),
|
||||||
|
('Route', 'optimizePriority','*','ALLOW','ROLE','employee');
|
||||||
|
INSERT IGNORE INTO vn.osrmConfig (id,url,tolerance)
|
||||||
|
VALUES (1,'https://router.project-osrm.org', 0.002);
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE vn.mistakeType
|
||||||
|
ADD `time` int(10) NULL COMMENT 'Segundos que se suelen tardar en arreglar el fallo',
|
||||||
|
ADD code varchar(50) DEFAULT NULL NULL AFTER id;
|
|
@ -0,0 +1,5 @@
|
||||||
|
RENAME TABLE vn.inventoryFailure TO vn.inventoryFailure__;
|
||||||
|
ALTER TABLE vn.inventoryFailure__ COMMENT='@deprecated 2024-12-16';
|
||||||
|
|
||||||
|
RENAME TABLE vn.inventoryFailureCause TO vn.inventoryFailureCause__;
|
||||||
|
ALTER TABLE vn.inventoryFailureCause__ COMMENT='@deprecated 2024-12-16';
|
|
@ -0,0 +1,8 @@
|
||||||
|
CREATE TABLE IF NOT EXISTS vn.productionCountry(
|
||||||
|
countryFk MEDIUMINT(8) UNSIGNED NOT NULL,
|
||||||
|
volumeGrowthEstimatePercent DECIMAL(6, 2) COMMENT 'Porcentaje estimado de crecimiento del volumen',
|
||||||
|
PRIMARY KEY (countryFk),
|
||||||
|
CONSTRAINT productionCountryVolume_countryFK
|
||||||
|
FOREIGN KEY (countryFk) REFERENCES vn.country (id)
|
||||||
|
ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
) COMMENT = 'Datos de producción por país'
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
ALTER TABLE vn.country
|
||||||
|
ADD CONSTRAINT country_unique_name UNIQUE KEY (name);
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE `vn`.`item`
|
||||||
|
ADD COLUMN `isCustomInspectionRequired` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Indicates if the item requires physical inspection at customs';
|
|
@ -0,0 +1,5 @@
|
||||||
|
DELETE FROM vn.workerMana
|
||||||
|
WHERE workerFk IN (
|
||||||
|
SELECT workerFk
|
||||||
|
FROM vn.workerManaExcluded
|
||||||
|
);
|
|
@ -0,0 +1,5 @@
|
||||||
|
ALTER TABLE `vn`.`zoneEvent`
|
||||||
|
ADD COLUMN `priceOptimum` DECIMAL(10,2) NULL COMMENT 'Precio mínimo que puede pagar un bulto'
|
||||||
|
AFTER `price`,
|
||||||
|
ADD CONSTRAINT `ck_zoneEvent_priceOptimum`
|
||||||
|
CHECK (priceOptimum <= price)
|
|
@ -0,0 +1,5 @@
|
||||||
|
ALTER TABLE `vn`.`zone`
|
||||||
|
ADD COLUMN `priceOptimum` DECIMAL(10,2) NOT NULL COMMENT 'Precio mínimo que puede pagar un bulto'
|
||||||
|
AFTER `price`,
|
||||||
|
ADD CONSTRAINT `ck_zone_priceOptimum`
|
||||||
|
CHECK (priceOptimum <= price)
|
|
@ -0,0 +1,2 @@
|
||||||
|
UPDATE `vn`.`zone`
|
||||||
|
SET `priceOptimum` = `price`;
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE `vn`.`client`
|
||||||
|
ADD COLUMN `packagesDiscountFactor` DECIMAL(4,3) NOT NULL DEFAULT 1.000
|
||||||
|
COMMENT 'Porcentaje de ajuste entre el numero de bultos medio del cliente, y el número medio óptimo para las zonas en las que compra';
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE `vn`.`clientConfig`
|
||||||
|
ADD COLUMN `packagesOptimum` INT UNSIGNED NOT NULL DEFAULT 20 COMMENT 'Numero de bultos por cliente/dia para conseguir el precio optimo',
|
||||||
|
ADD COLUMN `monthsToCalcOptimumPrice` TINYINT UNSIGNED NOT NULL DEFAULT 3 COMMENT 'Número de meses a usar para el cálculo de client.packagesDiscountFactor';
|
|
@ -0,0 +1,4 @@
|
||||||
|
DELETE FROM salix.ACL WHERE property = 'canCreateAbsenceInPast';
|
||||||
|
|
||||||
|
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||||
|
VALUES ('Worker','canModifyAbsenceInPast','WRITE','ALLOW','ROLE','hr');
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE `vn`.`entry`
|
||||||
|
ADD COLUMN `initialTemperature` decimal(10,2) DEFAULT NULL COMMENT 'Temperatura de como lo recibimos del proveedor ej. en colombia',
|
||||||
|
ADD COLUMN `finalTemperature` decimal(10,2) DEFAULT NULL COMMENT 'Temperatura final de como llega a nuestras instalaciones';
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE `vn`.`currency`
|
||||||
|
ADD COLUMN `hasToDownloadRate` TINYINT(1) NOT NULL DEFAULT 0 comment 'Si se guarda el tipo de cambio diariamente en referenceRate';
|
|
@ -0,0 +1,3 @@
|
||||||
|
UPDATE `vn`.`currency`
|
||||||
|
SET `hasToDownloadRate` = TRUE
|
||||||
|
WHERE `code` IN ('USD', 'CNY', 'GBP');
|
|
@ -0,0 +1,2 @@
|
||||||
|
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||||
|
VALUES ('VnUser','adminUser','WRITE','ALLOW','ROLE','sysadmin');
|
|
@ -0,0 +1,2 @@
|
||||||
|
RENAME TABLE bi.f_tvc TO bi.f_tvc__;
|
||||||
|
ALTER TABLE bi.f_tvc__ COMMENT='@deprecated 2025-01-15';
|
|
@ -0,0 +1 @@
|
||||||
|
CREATE INDEX ticket_landed_IDX USING BTREE ON vn.ticket (landed);
|
|
@ -238,25 +238,11 @@ describe('Ticket Edit sale path', () => {
|
||||||
await page.waitToClick(selectors.globalItems.cancelButton);
|
await page.waitToClick(selectors.globalItems.cancelButton);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should select the third sale and create a claim of it', async() => {
|
it('should select the third sale and delete it', async() => {
|
||||||
await page.accessToSearchResult('16');
|
|
||||||
await page.accessToSection('ticket.card.sale');
|
|
||||||
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
|
|
||||||
await page.waitToClick(selectors.ticketSales.moreMenu);
|
|
||||||
await page.waitToClick(selectors.ticketSales.moreMenuCreateClaim);
|
|
||||||
await page.waitToClick(selectors.globalItems.acceptButton);
|
|
||||||
await page.waitForNavigation();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should search for a ticket then access to the sales section', async() => {
|
|
||||||
await page.goBack();
|
|
||||||
await page.goBack();
|
|
||||||
await page.loginAndModule('salesPerson', 'ticket');
|
await page.loginAndModule('salesPerson', 'ticket');
|
||||||
await page.accessToSearchResult('16');
|
await page.accessToSearchResult('16');
|
||||||
await page.accessToSection('ticket.card.sale');
|
await page.accessToSection('ticket.card.sale');
|
||||||
});
|
|
||||||
|
|
||||||
it('should select the third sale and delete it', async() => {
|
|
||||||
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
|
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
|
||||||
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
|
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
|
||||||
await page.waitToClick(selectors.globalItems.acceptButton);
|
await page.waitToClick(selectors.globalItems.acceptButton);
|
||||||
|
|
|
@ -75,7 +75,7 @@ describe('Ticket Edit basic data path', () => {
|
||||||
const result = await page
|
const result = await page
|
||||||
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
|
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
|
||||||
|
|
||||||
expect(result).toContain('-€228.25');
|
expect(result).toContain('-€111.75');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should select a new reason for the changes made then click on finalize`, async() => {
|
it(`should select a new reason for the changes made then click on finalize`, async() => {
|
||||||
|
|
|
@ -211,6 +211,7 @@
|
||||||
"Name should be uppercase": "Name should be uppercase",
|
"Name should be uppercase": "Name should be uppercase",
|
||||||
"You cannot update these fields": "You cannot update these fields",
|
"You cannot update these fields": "You cannot update these fields",
|
||||||
"CountryFK cannot be empty": "Country cannot be empty",
|
"CountryFK cannot be empty": "Country cannot be empty",
|
||||||
|
"No tickets to invoice": "There are no tickets to invoice that meet the invoicing requirements",
|
||||||
"You are not allowed to modify the alias": "You are not allowed to modify the alias",
|
"You are not allowed to modify the alias": "You are not allowed to modify the alias",
|
||||||
"You already have the mailAlias": "You already have the mailAlias",
|
"You already have the mailAlias": "You already have the mailAlias",
|
||||||
"This machine is already in use.": "This machine is already in use.",
|
"This machine is already in use.": "This machine is already in use.",
|
||||||
|
@ -246,8 +247,11 @@
|
||||||
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
|
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
|
||||||
"The raid information is not correct": "The raid information is not correct",
|
"The raid information is not correct": "The raid information is not correct",
|
||||||
"Payment method is required": "Payment method is required",
|
"Payment method is required": "Payment method is required",
|
||||||
"Sales already moved": "Sales already moved",
|
"Price cannot be blank": "Price cannot be blank",
|
||||||
"Holidays to past days not available": "Holidays to past days not available",
|
"There are tickets to be invoiced": "There are tickets to be invoiced",
|
||||||
"There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first",
|
"The address of the customer must have information about Incoterms and Customs Agent": "The address of the customer must have information about Incoterms and Customs Agent",
|
||||||
"Price cannot be blank": "Price cannot be blank"
|
"Sales already moved": "Sales already moved",
|
||||||
|
"Holidays to past days not available": "Holidays to past days not available",
|
||||||
|
"Incorrect delivery order alert on route": "Incorrect delivery order alert on route: {{ route }} zone: {{ zone }}",
|
||||||
|
"Ticket has been delivered out of order": "The ticket {{ticket}} {{{fullUrl}}} has been delivered out of order."
|
||||||
}
|
}
|
|
@ -339,7 +339,7 @@
|
||||||
"Incorrect pin": "Pin incorrecto.",
|
"Incorrect pin": "Pin incorrecto.",
|
||||||
"You already have the mailAlias": "Ya tienes este alias de correo",
|
"You already have the mailAlias": "Ya tienes este alias de correo",
|
||||||
"The alias cant be modified": "Este alias de correo no puede ser modificado",
|
"The alias cant be modified": "Este alias de correo no puede ser modificado",
|
||||||
"No tickets to invoice": "No hay tickets para facturar",
|
"No tickets to invoice": "No hay tickets para facturar que cumplan los requisitos de facturación",
|
||||||
"this warehouse has not dms": "El Almacén no acepta documentos",
|
"this warehouse has not dms": "El Almacén no acepta documentos",
|
||||||
"This ticket already has a cmr saved": "Este ticket ya tiene un cmr guardado",
|
"This ticket already has a cmr saved": "Este ticket ya tiene un cmr guardado",
|
||||||
"Name should be uppercase": "El nombre debe ir en mayúscula",
|
"Name should be uppercase": "El nombre debe ir en mayúscula",
|
||||||
|
@ -390,8 +390,11 @@
|
||||||
"The web user's email already exists": "El correo del usuario web ya existe",
|
"The web user's email already exists": "El correo del usuario web ya existe",
|
||||||
"Sales already moved": "Ya han sido transferidas",
|
"Sales already moved": "Ya han sido transferidas",
|
||||||
"The raid information is not correct": "La información de la redada no es correcta",
|
"The raid information is not correct": "La información de la redada no es correcta",
|
||||||
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero",
|
|
||||||
"Price cannot be blank": "Price cannot be blank",
|
|
||||||
"An item type with the same code already exists": "Un tipo con el mismo código ya existe",
|
"An item type with the same code already exists": "Un tipo con el mismo código ya existe",
|
||||||
"Holidays to past days not available": "Las vacaciones a días pasados no están disponibles"
|
"Holidays to past days not available": "Las vacaciones a días pasados no están disponibles",
|
||||||
|
"All tickets have a route order": "Todos los tickets tienen orden de ruta",
|
||||||
|
"There are tickets to be invoiced": "La zona tiene tickets por facturar",
|
||||||
|
"Incorrect delivery order alert on route": "Alerta de orden de entrega incorrecta en ruta: {{ route }} zona: {{ zone }}",
|
||||||
|
"Ticket has been delivered out of order": "El ticket {{ticket}} {{{fullUrl}}} no ha sigo entregado en su orden.",
|
||||||
|
"Price cannot be blank": "El precio no puede estar en blanco"
|
||||||
}
|
}
|
|
@ -339,7 +339,7 @@
|
||||||
"Incorrect pin": "Pin incorrect.",
|
"Incorrect pin": "Pin incorrect.",
|
||||||
"You already have the mailAlias": "Vous avez déjà cet alias de courrier",
|
"You already have the mailAlias": "Vous avez déjà cet alias de courrier",
|
||||||
"The alias cant be modified": "Cet alias de courrier ne peut pas être modifié",
|
"The alias cant be modified": "Cet alias de courrier ne peut pas être modifié",
|
||||||
"No tickets to invoice": "Pas de tickets à facturer",
|
"No tickets to invoice": "Il n'y a pas de tickets à facturer qui répondent aux exigences de facturation",
|
||||||
"this warehouse has not dms": "L'entrepôt n'accepte pas les documents",
|
"this warehouse has not dms": "L'entrepôt n'accepte pas les documents",
|
||||||
"This ticket already has a cmr saved": "Ce ticket a déjà un cmr enregistré",
|
"This ticket already has a cmr saved": "Ce ticket a déjà un cmr enregistré",
|
||||||
"Name should be uppercase": "Le nom doit être en majuscules",
|
"Name should be uppercase": "Le nom doit être en majuscules",
|
||||||
|
@ -362,9 +362,11 @@
|
||||||
"The invoices have been created but the PDFs could not be generated": "La facture a été émise mais le PDF n'a pas pu être généré",
|
"The invoices have been created but the PDFs could not be generated": "La facture a été émise mais le PDF n'a pas pu être généré",
|
||||||
"It has been invoiced but the PDF of refund not be generated": "Il a été facturé mais le PDF de remboursement n'a pas été généré",
|
"It has been invoiced but the PDF of refund not be generated": "Il a été facturé mais le PDF de remboursement n'a pas été généré",
|
||||||
"Cannot send mail": "Impossible d'envoyer le mail",
|
"Cannot send mail": "Impossible d'envoyer le mail",
|
||||||
"Original invoice not found": "Facture originale introuvable",
|
"Original invoice not found": "Facture originale introuvable",
|
||||||
"The quantity claimed cannot be greater than the quantity of the line": "Le montant réclamé ne peut pas être supérieur au montant de la ligne",
|
"The quantity claimed cannot be greater than the quantity of the line": "Le montant réclamé ne peut pas être supérieur au montant de la ligne",
|
||||||
"You do not have permission to modify the booked field": "Vous n'avez pas la permission de modifier le champ comptabilisé",
|
"You do not have permission to modify the booked field": "Vous n'avez pas la permission de modifier le champ comptabilisé",
|
||||||
"ticketLostExpedition": "Le ticket [{{ticketId}}]({{{ticketUrl}}}) a l'expédition perdue suivante : {{expeditionId}}",
|
"ticketLostExpedition": "Le ticket [{{ticketId}}]({{{ticketUrl}}}) a l'expédition perdue suivante : {{expeditionId}}",
|
||||||
"The web user's email already exists": "L'email de l'internaute existe déjà"
|
"The web user's email already exists": "L'email de l'internaute existe déjà",
|
||||||
|
"Incorrect delivery order alert on route": "Alerte de bon de livraison incorrect sur l'itinéraire: {{ route }} zone : {{ zone }}",
|
||||||
|
"Ticket has been delivered out of order": "Le ticket {{ticket}} {{{fullUrl}}} a été livré hors ordre."
|
||||||
}
|
}
|
|
@ -339,7 +339,7 @@
|
||||||
"Incorrect pin": "PIN incorreto.",
|
"Incorrect pin": "PIN incorreto.",
|
||||||
"You already have the mailAlias": "Você já tem o alias de e-mail",
|
"You already have the mailAlias": "Você já tem o alias de e-mail",
|
||||||
"The alias cant be modified": "O alias não pode ser modificado",
|
"The alias cant be modified": "O alias não pode ser modificado",
|
||||||
"No tickets to invoice": "Não há tickets para faturar",
|
"No tickets to invoice": "Não há bilhetes para faturar que atendam aos requisitos de faturamento",
|
||||||
"this warehouse has not dms": "Este armazém não tem DMS",
|
"this warehouse has not dms": "Este armazém não tem DMS",
|
||||||
"This ticket already has a cmr saved": "Este ticket já tem um CMR salvo",
|
"This ticket already has a cmr saved": "Este ticket já tem um CMR salvo",
|
||||||
"Name should be uppercase": "O nome deve estar em maiúsculas",
|
"Name should be uppercase": "O nome deve estar em maiúsculas",
|
||||||
|
@ -365,5 +365,7 @@
|
||||||
"Cannot send mail": "Não é possível enviar o email",
|
"Cannot send mail": "Não é possível enviar o email",
|
||||||
"The quantity claimed cannot be greater than the quantity of the line": "O valor reclamado não pode ser superior ao valor da linha",
|
"The quantity claimed cannot be greater than the quantity of the line": "O valor reclamado não pode ser superior ao valor da linha",
|
||||||
"ticketLostExpedition": "O ticket [{{ticketId}}]({{{ticketUrl}}}) tem a seguinte expedição perdida: {{expeditionId}}",
|
"ticketLostExpedition": "O ticket [{{ticketId}}]({{{ticketUrl}}}) tem a seguinte expedição perdida: {{expeditionId}}",
|
||||||
"The web user's email already exists": "O e-mail do utilizador da web já existe."
|
"The web user's email already exists": "O e-mail do utilizador da web já existe.",
|
||||||
|
"Incorrect delivery order alert on route": "Alerta de ordem de entrega incorreta na rota: {{ route }} zona: {{ zone }}",
|
||||||
|
"Ticket has been delivered out of order": "O ticket {{ticket}} {{{fullUrl}}} foi entregue fora de ordem."
|
||||||
}
|
}
|
|
@ -36,7 +36,7 @@ module.exports = Self => {
|
||||||
if (!myOptions.transaction) {
|
if (!myOptions.transaction) {
|
||||||
tx = await Self.beginTransaction({});
|
tx = await Self.beginTransaction({});
|
||||||
myOptions.transaction = tx;
|
myOptions.transaction = tx;
|
||||||
};
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const user = await models.VnUser.findOne({
|
const user = await models.VnUser.findOne({
|
||||||
|
|
|
@ -80,6 +80,12 @@ module.exports = Self => {
|
||||||
description: 'The claimResponsible id',
|
description: 'The claimResponsible id',
|
||||||
http: {source: 'query'}
|
http: {source: 'query'}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
arg: 'zoneFk',
|
||||||
|
type: 'string',
|
||||||
|
description: 'The zone name',
|
||||||
|
http: {source: 'query'}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
arg: 'myTeam',
|
arg: 'myTeam',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
@ -174,6 +180,8 @@ module.exports = Self => {
|
||||||
to.setHours(23, 59, 59, 999);
|
to.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
return {'cl.created': {between: [value, to]}};
|
return {'cl.created': {between: [value, to]}};
|
||||||
|
case 'zoneFk':
|
||||||
|
return {'t.zoneFk': value};
|
||||||
case 'myTeam':
|
case 'myTeam':
|
||||||
if (value)
|
if (value)
|
||||||
return {'cl.workerFk': {inq: teamMembersId}};
|
return {'cl.workerFk': {inq: teamMembersId}};
|
||||||
|
@ -195,11 +203,15 @@ module.exports = Self => {
|
||||||
u.name AS workerName,
|
u.name AS workerName,
|
||||||
cs.code stateCode,
|
cs.code stateCode,
|
||||||
cs.description stateDescription,
|
cs.description stateDescription,
|
||||||
cl.created
|
cl.created,
|
||||||
|
z.name zoneName,
|
||||||
|
z.id zoneId
|
||||||
FROM claim cl
|
FROM claim cl
|
||||||
LEFT JOIN client c ON c.id = cl.clientFk
|
LEFT JOIN client c ON c.id = cl.clientFk
|
||||||
LEFT JOIN account.user u ON u.id = cl.workerFk
|
LEFT JOIN account.user u ON u.id = cl.workerFk
|
||||||
LEFT JOIN claimState cs ON cs.id = cl.claimStateFk`
|
LEFT JOIN claimState cs ON cs.id = cl.claimStateFk
|
||||||
|
LEFT JOIN ticket t ON t.id = cl.ticketFk
|
||||||
|
LEFT JOIN zone z ON z.id = t.zoneFk`
|
||||||
);
|
);
|
||||||
|
|
||||||
stmt.merge(conn.makeSuffix(filter));
|
stmt.merge(conn.makeSuffix(filter));
|
||||||
|
|
|
@ -2,7 +2,7 @@ const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
module.exports = function(Self) {
|
module.exports = function(Self) {
|
||||||
Self.remoteMethod('canBeInvoiced', {
|
Self.remoteMethod('canBeInvoiced', {
|
||||||
description: 'Change property isEqualizated in all client addresses',
|
description: 'Check if a client can be invoiced',
|
||||||
accessType: 'READ',
|
accessType: 'READ',
|
||||||
accepts: [
|
accepts: [
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ module.exports = function(Self) {
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
const client = await models.Client.findById(id, {
|
const client = await models.Client.findById(id, {
|
||||||
fields: ['id', 'isTaxDataChecked', 'hasToInvoice', 'payMethodFk'],
|
fields: ['id', 'isTaxDataChecked', 'hasToInvoice', 'payMethodFk', 'isActive'],
|
||||||
include:
|
include:
|
||||||
{
|
{
|
||||||
relation: 'payMethod',
|
relation: 'payMethod',
|
||||||
|
@ -53,9 +53,6 @@ module.exports = function(Self) {
|
||||||
if (client.payMethod().code === 'wireTransfer' && !company.supplierAccountFk)
|
if (client.payMethod().code === 'wireTransfer' && !company.supplierAccountFk)
|
||||||
throw new UserError('The company has not informed the supplier account for bank transfers');
|
throw new UserError('The company has not informed the supplier account for bank transfers');
|
||||||
|
|
||||||
if (client.isTaxDataChecked && client.hasToInvoice)
|
return client.isTaxDataChecked && client.hasToInvoice && client.isActive;
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -52,6 +52,14 @@ module.exports = function(Self) {
|
||||||
arg: 'customsAgentFk',
|
arg: 'customsAgentFk',
|
||||||
type: 'number'
|
type: 'number'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
arg: 'longitude',
|
||||||
|
type: 'number'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'latitude',
|
||||||
|
type: 'number'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
arg: 'isActive',
|
arg: 'isActive',
|
||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
|
|
|
@ -8,6 +8,8 @@ describe('client canBeInvoiced()', () => {
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId}
|
accessToken: {userId: userId}
|
||||||
};
|
};
|
||||||
|
let tx;
|
||||||
|
let options;
|
||||||
|
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||||
|
@ -15,60 +17,45 @@ describe('client canBeInvoiced()', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
beforeEach(async() => {
|
||||||
|
tx = await models.Client.beginTransaction({});
|
||||||
|
options = {transaction: tx};
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async() => {
|
||||||
|
await tx.rollback();
|
||||||
|
});
|
||||||
|
|
||||||
it('should return falsy for a client without the data checked', async() => {
|
it('should return falsy for a client without the data checked', async() => {
|
||||||
const tx = await models.Client.beginTransaction({});
|
const client = await models.Client.findById(clientId, null, options);
|
||||||
|
await client.updateAttribute('isTaxDataChecked', false, options);
|
||||||
|
|
||||||
try {
|
const canBeInvoiced = await models.Client.canBeInvoiced(clientId, companyId, options);
|
||||||
const options = {transaction: tx};
|
|
||||||
|
|
||||||
const client = await models.Client.findById(clientId, null, options);
|
expect(canBeInvoiced).toEqual(false);
|
||||||
await client.updateAttribute('isTaxDataChecked', false, options);
|
});
|
||||||
|
|
||||||
const canBeInvoiced = await models.Client.canBeInvoiced(clientId, companyId, options);
|
it('should return falsy for a client not active', async() => {
|
||||||
|
const client = await models.Client.findById(clientId, null, options);
|
||||||
|
await client.updateAttribute('isActive', false, options);
|
||||||
|
|
||||||
expect(canBeInvoiced).toEqual(false);
|
const canBeInvoiced = await models.Client.canBeInvoiced(clientId, companyId, options);
|
||||||
|
|
||||||
await tx.rollback();
|
expect(canBeInvoiced).toEqual(false);
|
||||||
} catch (e) {
|
|
||||||
await tx.rollback();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return falsy for a client with invoicing disabled', async() => {
|
it('should return falsy for a client with invoicing disabled', async() => {
|
||||||
const tx = await models.Client.beginTransaction({});
|
const client = await models.Client.findById(clientId, null, options);
|
||||||
|
await client.updateAttribute('hasToInvoice', false, options);
|
||||||
|
|
||||||
try {
|
const canBeInvoiced = await models.Client.canBeInvoiced(clientId, companyId, options);
|
||||||
const options = {transaction: tx};
|
|
||||||
|
|
||||||
const client = await models.Client.findById(clientId, null, options);
|
expect(canBeInvoiced).toEqual(false);
|
||||||
await client.updateAttribute('hasToInvoice', false, options);
|
|
||||||
|
|
||||||
const canBeInvoiced = await models.Client.canBeInvoiced(clientId, companyId, options);
|
|
||||||
|
|
||||||
expect(canBeInvoiced).toEqual(false);
|
|
||||||
|
|
||||||
await tx.rollback();
|
|
||||||
} catch (e) {
|
|
||||||
await tx.rollback();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return truthy for an invoiceable client', async() => {
|
it('should return truthy for an invoiceable client', async() => {
|
||||||
const tx = await models.Client.beginTransaction({});
|
const canBeInvoiced = await models.Client.canBeInvoiced(clientId, companyId, options);
|
||||||
|
|
||||||
try {
|
expect(canBeInvoiced).toEqual(true);
|
||||||
const options = {transaction: tx};
|
|
||||||
|
|
||||||
const canBeInvoiced = await models.Client.canBeInvoiced(clientId, companyId, options);
|
|
||||||
|
|
||||||
expect(canBeInvoiced).toEqual(true);
|
|
||||||
|
|
||||||
await tx.rollback();
|
|
||||||
} catch (e) {
|
|
||||||
await tx.rollback();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
describe('Address updateAddress', () => {
|
describe('Address updateAddress', () => {
|
||||||
const clientId = 1101;
|
const clientId = 1102;
|
||||||
const addressId = 1;
|
const addressId = 2;
|
||||||
const provinceId = 5;
|
const provinceId = 5;
|
||||||
const incotermsId = 'FAS';
|
const incotermsId = 'FAS';
|
||||||
const customAgentOneId = 1;
|
const customAgentOneId = 1;
|
||||||
|
|
|
@ -72,6 +72,14 @@ module.exports = function(Self) {
|
||||||
{
|
{
|
||||||
arg: 'isLogifloraAllowed',
|
arg: 'isLogifloraAllowed',
|
||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'longitude',
|
||||||
|
type: 'any',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'latitude',
|
||||||
|
type: 'any',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
|
|
@ -94,7 +94,7 @@ module.exports = Self => {
|
||||||
AND r1.started = r2.maxStarted
|
AND r1.started = r2.maxStarted
|
||||||
) r ON r.clientFk = c.id
|
) r ON r.clientFk = c.id
|
||||||
LEFT JOIN workerDepartment wd ON wd.workerFk = u.id
|
LEFT JOIN workerDepartment wd ON wd.workerFk = u.id
|
||||||
JOIN department dp ON dp.id = wd.departmentFk
|
LEFT JOIN department dp ON dp.id = wd.departmentFk
|
||||||
WHERE
|
WHERE
|
||||||
d.created = ?
|
d.created = ?
|
||||||
AND d.amount > 0
|
AND d.amount > 0
|
||||||
|
|
|
@ -84,6 +84,11 @@
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "CustomsAgent",
|
"model": "CustomsAgent",
|
||||||
"foreignKey": "customsAgentFk"
|
"foreignKey": "customsAgentFk"
|
||||||
|
},
|
||||||
|
"postcode": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Postcode",
|
||||||
|
"foreignKey": "postalCode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
},
|
},
|
||||||
"created": {
|
"created": {
|
||||||
"type": "date"
|
"type": "date"
|
||||||
|
},
|
||||||
|
"workerFk": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
|
@ -119,6 +119,16 @@ module.exports = Self => {
|
||||||
arg: 'invoiceAmount',
|
arg: 'invoiceAmount',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
description: `The invoice amount`
|
description: `The invoice amount`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'initialTemperature',
|
||||||
|
type: 'number',
|
||||||
|
description: 'Initial temperature value'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'finalTemperature',
|
||||||
|
type: 'number',
|
||||||
|
description: 'Final temperature value'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -170,6 +180,10 @@ module.exports = Self => {
|
||||||
case 'invoiceInFk':
|
case 'invoiceInFk':
|
||||||
param = `e.${param}`;
|
param = `e.${param}`;
|
||||||
return {[param]: value};
|
return {[param]: value};
|
||||||
|
case 'initialTemperature':
|
||||||
|
return {'e.initialTemperature': {lte: value}};
|
||||||
|
case 'finalTemperature':
|
||||||
|
return {'e.finalTemperature': {gte: value}};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
filter = mergeFilters(ctx.args.filter, {where});
|
filter = mergeFilters(ctx.args.filter, {where});
|
||||||
|
@ -204,6 +218,8 @@ module.exports = Self => {
|
||||||
e.gestDocFk,
|
e.gestDocFk,
|
||||||
e.invoiceInFk,
|
e.invoiceInFk,
|
||||||
e.invoiceAmount,
|
e.invoiceAmount,
|
||||||
|
e.initialTemperature,
|
||||||
|
e.finalTemperature,
|
||||||
t.landed,
|
t.landed,
|
||||||
s.name supplierName,
|
s.name supplierName,
|
||||||
s.nickname supplierAlias,
|
s.nickname supplierAlias,
|
||||||
|
|
|
@ -68,6 +68,12 @@
|
||||||
},
|
},
|
||||||
"invoiceAmount": {
|
"invoiceAmount": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"initialTemperature": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"finalTemperature": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
|
@ -18,3 +18,5 @@ columns:
|
||||||
withholdingSageFk: withholding
|
withholdingSageFk: withholding
|
||||||
expenseFkDeductible: expense deductible
|
expenseFkDeductible: expense deductible
|
||||||
editorFk: editor
|
editorFk: editor
|
||||||
|
siiTrasCendencyInvoiceInFk: SII tax regime
|
||||||
|
siiTypeInvoiceInFk: SII Type
|
|
@ -5,7 +5,7 @@ columns:
|
||||||
serial: serie
|
serial: serie
|
||||||
supplierFk: proveedor
|
supplierFk: proveedor
|
||||||
issued: fecha emisión
|
issued: fecha emisión
|
||||||
supplierRef: referéncia proveedor
|
supplierRef: referencia proveedor
|
||||||
isBooked: facturado
|
isBooked: facturado
|
||||||
currencyFk: moneda
|
currencyFk: moneda
|
||||||
created: creado
|
created: creado
|
||||||
|
@ -18,3 +18,5 @@ columns:
|
||||||
withholdingSageFk: código de retención
|
withholdingSageFk: código de retención
|
||||||
expenseFkDeductible: gasto deducible
|
expenseFkDeductible: gasto deducible
|
||||||
editorFk: editor
|
editorFk: editor
|
||||||
|
siiTrasCendencyInvoiceInFk: régimen fiscal SII
|
||||||
|
siiTypeInvoiceInFk: tipo SII
|
|
@ -44,7 +44,7 @@ module.exports = Self => {
|
||||||
correctingFk: clone.id,
|
correctingFk: clone.id,
|
||||||
correctedFk: id,
|
correctedFk: id,
|
||||||
cplusRectificationTypeFk: invoiceType,
|
cplusRectificationTypeFk: invoiceType,
|
||||||
siiTypeInvoiceOutFk: invoiceClass,
|
siiTypeInvoiceInFk: invoiceClass,
|
||||||
invoiceCorrectionTypeFk: invoiceReason
|
invoiceCorrectionTypeFk: invoiceReason
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
|
|
|
@ -13,66 +13,114 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.exchangeRateUpdate = async() => {
|
Self.exchangeRateUpdate = async(options = {}) => {
|
||||||
const response = await axios.get('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml');
|
|
||||||
const xmlData = response.data;
|
|
||||||
|
|
||||||
const doc = new DOMParser({errorHandler: {warning: () => {}}})?.parseFromString(xmlData, 'text/xml');
|
|
||||||
const cubes = doc?.getElementsByTagName('Cube');
|
|
||||||
if (!cubes || cubes.length === 0)
|
|
||||||
throw new UserError('No cubes found. Exiting the method.');
|
|
||||||
|
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
|
const myOptions = {};
|
||||||
|
let tx;
|
||||||
|
|
||||||
const maxDateRecord = await models.ReferenceRate.findOne({order: 'dated DESC'});
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
const maxDate = maxDateRecord?.dated ? new Date(maxDateRecord.dated) : null;
|
if (!myOptions.transaction) {
|
||||||
|
tx = await Self.beginTransaction({});
|
||||||
|
myOptions.transaction = tx;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await axios.get('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml');
|
||||||
|
const xmlData = response.data;
|
||||||
|
|
||||||
|
const doc = new DOMParser({errorHandler: {warning: () => {}}})
|
||||||
|
.parseFromString(xmlData, 'text/xml');
|
||||||
|
const cubes = doc?.getElementsByTagName('Cube');
|
||||||
|
if (!cubes || cubes.length === 0)
|
||||||
|
throw new UserError('No cubes found. Exiting the method.');
|
||||||
|
|
||||||
|
const currencies = await models.Currency.find({where: {hasToDownloadRate: true}}, myOptions);
|
||||||
|
const maxDateRecord = await models.ReferenceRate.findOne({order: 'dated DESC'}, myOptions);
|
||||||
|
const maxDate = maxDateRecord?.dated ? new Date(maxDateRecord.dated) : null;
|
||||||
|
let lastProcessedDate = maxDate;
|
||||||
|
|
||||||
|
for (const cube of Array.from(cubes)) {
|
||||||
|
if (cube.nodeType === doc.ELEMENT_NODE && cube.attributes.getNamedItem('time')) {
|
||||||
|
const xmlDate = new Date(cube.getAttribute('time'));
|
||||||
|
const xmlDateWithoutTime = new Date(
|
||||||
|
xmlDate.getFullYear(),
|
||||||
|
xmlDate.getMonth(),
|
||||||
|
xmlDate.getDate()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!maxDate || xmlDateWithoutTime > maxDate) {
|
||||||
|
if (lastProcessedDate && xmlDateWithoutTime > lastProcessedDate) {
|
||||||
|
for (const currency of currencies) {
|
||||||
|
await fillMissingDates(
|
||||||
|
models, currency, lastProcessedDate, xmlDateWithoutTime, myOptions
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const cube of Array.from(cubes)) {
|
|
||||||
if (cube.nodeType === doc.ELEMENT_NODE && cube.attributes.getNamedItem('time')) {
|
|
||||||
const xmlDate = new Date(cube.getAttribute('time'));
|
|
||||||
const xmlDateWithoutTime = new Date(xmlDate.getFullYear(), xmlDate.getMonth(), xmlDate.getDate());
|
|
||||||
if (!maxDate || maxDate < xmlDateWithoutTime) {
|
|
||||||
for (const rateCube of Array.from(cube.childNodes)) {
|
for (const rateCube of Array.from(cube.childNodes)) {
|
||||||
if (rateCube.nodeType === doc.ELEMENT_NODE) {
|
if (rateCube.nodeType === doc.ELEMENT_NODE) {
|
||||||
const currencyCode = rateCube.getAttribute('currency');
|
const currencyCode = rateCube.getAttribute('currency');
|
||||||
const rate = rateCube.getAttribute('rate');
|
const rate = rateCube.getAttribute('rate');
|
||||||
if (['USD', 'CNY', 'GBP'].includes(currencyCode)) {
|
const currency = currencies.find(c => c.code === currencyCode);
|
||||||
const currency = await models.Currency.findOne({where: {code: currencyCode}});
|
if (currency) {
|
||||||
if (!currency) throw new UserError(`Currency not found for code: ${currencyCode}`);
|
|
||||||
const existingRate = await models.ReferenceRate.findOne({
|
const existingRate = await models.ReferenceRate.findOne({
|
||||||
where: {currencyFk: currency.id, dated: xmlDate}
|
where: {currencyFk: currency.id, dated: xmlDateWithoutTime}
|
||||||
});
|
}, myOptions);
|
||||||
|
|
||||||
if (existingRate) {
|
if (existingRate) {
|
||||||
if (existingRate.value !== rate)
|
if (existingRate.value !== rate)
|
||||||
await existingRate.updateAttributes({value: rate});
|
await existingRate.updateAttributes({value: rate}, myOptions);
|
||||||
} else {
|
} else {
|
||||||
await models.ReferenceRate.create({
|
await models.ReferenceRate.create({
|
||||||
currencyFk: currency.id,
|
currencyFk: currency.id,
|
||||||
dated: xmlDate,
|
dated: xmlDateWithoutTime,
|
||||||
value: rate
|
value: rate
|
||||||
});
|
}, myOptions);
|
||||||
}
|
|
||||||
const monday = 1;
|
|
||||||
if (xmlDateWithoutTime.getDay() === monday) {
|
|
||||||
const saturday = new Date(xmlDateWithoutTime);
|
|
||||||
saturday.setDate(xmlDateWithoutTime.getDate() - 2);
|
|
||||||
const sunday = new Date(xmlDateWithoutTime);
|
|
||||||
sunday.setDate(xmlDateWithoutTime.getDate() - 1);
|
|
||||||
|
|
||||||
for (const date of [saturday, sunday]) {
|
|
||||||
await models.ReferenceRate.upsertWithWhere(
|
|
||||||
{currencyFk: currency.id, dated: date},
|
|
||||||
{currencyFk: currency.id, dated: date, value: rate}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastProcessedDate = xmlDateWithoutTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tx) await tx.commit();
|
||||||
|
} catch (error) {
|
||||||
|
if (tx) await tx.rollback();
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async function getLastValidRate(models, currencyId, date, myOptions) {
|
||||||
|
return models.ReferenceRate.findOne({
|
||||||
|
where: {currencyFk: currencyId, dated: {lt: date}},
|
||||||
|
order: 'dated DESC'
|
||||||
|
}, myOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fillMissingDates(models, currency, startDate, endDate, myOptions) {
|
||||||
|
const cursor = new Date(startDate);
|
||||||
|
cursor.setDate(cursor.getDate() + 1);
|
||||||
|
while (cursor < endDate) {
|
||||||
|
const existingRate = await models.ReferenceRate.findOne({
|
||||||
|
where: {currencyFk: currency.id, dated: cursor}
|
||||||
|
}, myOptions);
|
||||||
|
|
||||||
|
if (!existingRate) {
|
||||||
|
const lastValid = await getLastValidRate(models, currency.id, cursor, myOptions);
|
||||||
|
if (lastValid) {
|
||||||
|
await models.ReferenceRate.create({
|
||||||
|
currencyFk: currency.id,
|
||||||
|
dated: new Date(cursor),
|
||||||
|
value: lastValid.value
|
||||||
|
}, myOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cursor.setDate(cursor.getDate() + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -91,6 +91,10 @@ module.exports = Self => {
|
||||||
{
|
{
|
||||||
arg: 'supplierActivityFk',
|
arg: 'supplierActivityFk',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'companyFk',
|
||||||
|
type: 'number',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -161,8 +165,8 @@ module.exports = Self => {
|
||||||
: {'ii.id': {nin: correcteds.map(x => x.correctingFk)}};
|
: {'ii.id': {nin: correcteds.map(x => x.correctingFk)}};
|
||||||
case 'correctedFk':
|
case 'correctedFk':
|
||||||
return {'ii.id': {inq: correctings.map(x => x.correctingFk)}};
|
return {'ii.id': {inq: correctings.map(x => x.correctingFk)}};
|
||||||
case 'supplierActivityFk':
|
case 'companyFk':
|
||||||
return {'s.supplierActivityFk': value};
|
return {'ii.companyFk': value};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -184,7 +188,9 @@ module.exports = Self => {
|
||||||
s.name supplierName,
|
s.name supplierName,
|
||||||
s.account,
|
s.account,
|
||||||
SUM(iid.amount) amount,
|
SUM(iid.amount) amount,
|
||||||
sub.code awbCode
|
sub.code awbCode,
|
||||||
|
c.code,
|
||||||
|
MIN(iid.dueDated) dueDated
|
||||||
FROM invoiceIn ii
|
FROM invoiceIn ii
|
||||||
JOIN supplier s ON s.id = ii.supplierFk
|
JOIN supplier s ON s.id = ii.supplierFk
|
||||||
LEFT JOIN invoiceInDueDay iid ON iid.invoiceInFk = ii.id
|
LEFT JOIN invoiceInDueDay iid ON iid.invoiceInFk = ii.id
|
||||||
|
@ -199,7 +205,8 @@ module.exports = Self => {
|
||||||
GROUP BY de.duaFk
|
GROUP BY de.duaFk
|
||||||
) sub ON sub.duaFk = d.id
|
) sub ON sub.duaFk = d.id
|
||||||
LEFT JOIN company co ON co.id = ii.companyFk
|
LEFT JOIN company co ON co.id = ii.companyFk
|
||||||
LEFT JOIN dms dm ON dm.id = ii.docFk`
|
LEFT JOIN dms dm ON dm.id = ii.docFk
|
||||||
|
JOIN company c ON c.id = ii.companyFk`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const sqlWhere = conn.makeWhere(filter.where);
|
const sqlWhere = conn.makeWhere(filter.where);
|
||||||
|
|
|
@ -15,11 +15,11 @@ describe('invoiceIn corrective()', () => {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('La función corrective debería devolver un id cuando se ejecuta correctamente', async() => {
|
it('should return an id when executed correctly', async() => {
|
||||||
const originalId = 1;
|
const originalId = 1;
|
||||||
const invoiceReason = 3;
|
const invoiceReason = 3;
|
||||||
const invoiceType = 2;
|
const invoiceType = 2;
|
||||||
const invoiceClass = 1;
|
const invoiceClass = 8;
|
||||||
const cloneId = await models.InvoiceIn.corrective(ctx,
|
const cloneId = await models.InvoiceIn.corrective(ctx,
|
||||||
originalId, invoiceReason, invoiceType, invoiceClass, options);
|
originalId, invoiceReason, invoiceType, invoiceClass, options);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ describe('invoiceIn corrective()', () => {
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
expect(correction.cplusRectificationTypeFk).toEqual(invoiceType);
|
expect(correction.cplusRectificationTypeFk).toEqual(invoiceType);
|
||||||
expect(correction.siiTypeInvoiceOutFk).toEqual(invoiceClass);
|
expect(correction.siiTypeInvoiceInFk).toEqual(invoiceClass);
|
||||||
expect(correction.invoiceCorrectionTypeFk).toEqual(invoiceReason);
|
expect(correction.invoiceCorrectionTypeFk).toEqual(invoiceReason);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,52 +1,190 @@
|
||||||
describe('exchangeRateUpdate functionality', function() {
|
describe('exchangeRateUpdate functionality', function() {
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
let tx; let options;
|
||||||
|
|
||||||
beforeEach(function() {
|
function formatYmd(d) {
|
||||||
spyOn(axios, 'get').and.returnValue(Promise.resolve({
|
const mm = (d.getMonth() + 1).toString().padStart(2, '0');
|
||||||
data: `<Cube>
|
const dd = d.getDate().toString().padStart(2, '0');
|
||||||
<Cube time='2024-04-12'>
|
return `${d.getFullYear()}-${mm}-${dd}`;
|
||||||
<Cube currency='USD' rate='1.1'/>
|
}
|
||||||
<Cube currency='CNY' rate='1.2'/>
|
|
||||||
</Cube>
|
afterEach(async() => {
|
||||||
</Cube>`
|
await tx.rollback();
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should process XML data and update or create rates in the database', async function() {
|
beforeEach(async() => {
|
||||||
|
tx = await models.Sale.beginTransaction({});
|
||||||
|
options = {transaction: tx};
|
||||||
|
spyOn(axios, 'get').and.returnValue(Promise.resolve({data: ''}));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should process XML data and create rates', async function() {
|
||||||
|
const d1 = Date.vnNew();
|
||||||
|
const d4 = Date.vnNew();
|
||||||
|
d4.setDate(d4.getDate() + 1);
|
||||||
|
const xml = `<Cube>
|
||||||
|
<Cube time='${formatYmd(d1)}'>
|
||||||
|
<Cube currency='USD' rate='1.1'/>
|
||||||
|
<Cube currency='CNY' rate='1.2'/>
|
||||||
|
</Cube>
|
||||||
|
<Cube time='${formatYmd(d4)}'>
|
||||||
|
<Cube currency='USD' rate='1.3'/>
|
||||||
|
</Cube>
|
||||||
|
</Cube>`;
|
||||||
|
axios.get.and.returnValue(Promise.resolve({data: xml}));
|
||||||
spyOn(models.ReferenceRate, 'findOne').and.returnValue(Promise.resolve(null));
|
spyOn(models.ReferenceRate, 'findOne').and.returnValue(Promise.resolve(null));
|
||||||
spyOn(models.ReferenceRate, 'create').and.returnValue(Promise.resolve());
|
spyOn(models.ReferenceRate, 'create').and.returnValue(Promise.resolve());
|
||||||
|
await models.InvoiceIn.exchangeRateUpdate(options);
|
||||||
|
|
||||||
await models.InvoiceIn.exchangeRateUpdate();
|
expect(models.ReferenceRate.create).toHaveBeenCalledTimes(3);
|
||||||
|
|
||||||
expect(models.ReferenceRate.create).toHaveBeenCalledTimes(2);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not create or update rates when no XML data is available', async function() {
|
it('should handle no data', async function() {
|
||||||
axios.get.and.returnValue(Promise.resolve({}));
|
axios.get.and.returnValue(Promise.resolve({}));
|
||||||
spyOn(models.ReferenceRate, 'create');
|
spyOn(models.ReferenceRate, 'create');
|
||||||
|
let e;
|
||||||
let thrownError = null;
|
|
||||||
try {
|
try {
|
||||||
await models.InvoiceIn.exchangeRateUpdate();
|
await models.InvoiceIn.exchangeRateUpdate(options);
|
||||||
} catch (error) {
|
} catch (err) {
|
||||||
thrownError = error;
|
e = err;
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(thrownError.message).toBe('No cubes found. Exiting the method.');
|
expect(e.message).toBe('No cubes found. Exiting the method.');
|
||||||
|
expect(models.ReferenceRate.create).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle errors gracefully', async function() {
|
it('should handle errors', async function() {
|
||||||
axios.get.and.returnValue(Promise.reject(new Error('Network error')));
|
axios.get.and.returnValue(Promise.reject(new Error('Network error')));
|
||||||
let error;
|
let e;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await models.InvoiceIn.exchangeRateUpdate();
|
await models.InvoiceIn.exchangeRateUpdate(options);
|
||||||
} catch (e) {
|
} catch (err) {
|
||||||
error = e;
|
e = err;
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(error).toBeDefined();
|
expect(e).toBeDefined();
|
||||||
expect(error.message).toBe('Network error');
|
expect(e.message).toBe('Network error');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should update existing rate', async function() {
|
||||||
|
const existingRate = await models.ReferenceRate.findOne({
|
||||||
|
order: 'id DESC'
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
if (!existingRate) return fail('No ReferenceRate records in DB');
|
||||||
|
|
||||||
|
const currency = await models.Currency.findById(existingRate.currencyFk, null, options);
|
||||||
|
|
||||||
|
const xml = `<Cube>
|
||||||
|
<Cube time='${formatYmd(existingRate.dated)}'>
|
||||||
|
<Cube currency='${currency.code}' rate='2.22'/>
|
||||||
|
</Cube>
|
||||||
|
</Cube>`;
|
||||||
|
|
||||||
|
axios.get.and.returnValue(Promise.resolve({data: xml}));
|
||||||
|
|
||||||
|
await models.InvoiceIn.exchangeRateUpdate(options);
|
||||||
|
|
||||||
|
const updatedRate = await models.ReferenceRate.findById(existingRate.id, null, options);
|
||||||
|
|
||||||
|
expect(updatedRate.value).toBeCloseTo('2.22');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not update if same rate', async function() {
|
||||||
|
const existingRate = await models.ReferenceRate.findOne({order: 'id DESC'}, options);
|
||||||
|
if (!existingRate) return fail('No existing ReferenceRate in DB');
|
||||||
|
|
||||||
|
const currency = await models.Currency.findById(existingRate.currencyFk, null, options);
|
||||||
|
|
||||||
|
const oldValue = existingRate.value;
|
||||||
|
const xml = `<Cube>
|
||||||
|
<Cube time='${formatYmd(existingRate.dated)}'>
|
||||||
|
<Cube currency='${currency.code}' rate='${oldValue}'/>
|
||||||
|
</Cube>
|
||||||
|
</Cube>`;
|
||||||
|
|
||||||
|
axios.get.and.returnValue(Promise.resolve({data: xml}));
|
||||||
|
|
||||||
|
await models.InvoiceIn.exchangeRateUpdate(options);
|
||||||
|
|
||||||
|
const updatedRate = await models.ReferenceRate.findById(existingRate.id, null, options);
|
||||||
|
|
||||||
|
expect(updatedRate.value).toBe(oldValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should backfill missing dates', async function() {
|
||||||
|
const lastRate = await models.ReferenceRate.findOne({order: 'dated DESC'}, options);
|
||||||
|
if (!lastRate) return fail('No existing ReferenceRate data in DB');
|
||||||
|
|
||||||
|
const currency = await models.Currency.findById(lastRate.currencyFk, null, options);
|
||||||
|
|
||||||
|
const d1 = new Date(lastRate.dated);
|
||||||
|
d1.setDate(d1.getDate() + 1);
|
||||||
|
const d4 = new Date(lastRate.dated);
|
||||||
|
d4.setDate(d4.getDate() + 4);
|
||||||
|
|
||||||
|
const xml = `<Cube>
|
||||||
|
<Cube time='${formatYmd(d1)}'>
|
||||||
|
<Cube currency='${currency.code}' rate='1.0'/>
|
||||||
|
</Cube>
|
||||||
|
<Cube time='${formatYmd(d4)}'>
|
||||||
|
<Cube currency='${currency.code}' rate='2.0'/>
|
||||||
|
</Cube>
|
||||||
|
</Cube>`;
|
||||||
|
|
||||||
|
axios.get.and.returnValue(Promise.resolve({data: xml}));
|
||||||
|
|
||||||
|
const beforeCount = await models.ReferenceRate.count({}, options);
|
||||||
|
await models.InvoiceIn.exchangeRateUpdate(options);
|
||||||
|
const afterCount = await models.ReferenceRate.count({}, options);
|
||||||
|
|
||||||
|
expect(afterCount - beforeCount).toBe(4);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create entries for day1 and day2 from the feed, and not backfill day3', async function() {
|
||||||
|
const lastRate = await models.ReferenceRate.findOne({order: 'dated DESC'}, options);
|
||||||
|
if (!lastRate) return fail('No existing ReferenceRate data in DB');
|
||||||
|
|
||||||
|
const currency = await models.Currency.findById(lastRate.currencyFk, null, options);
|
||||||
|
if (!currency) return fail(`No currency for ID ${lastRate.currencyFk}`);
|
||||||
|
|
||||||
|
const day1 = new Date(lastRate.dated);
|
||||||
|
day1.setDate(day1.getDate() + 1);
|
||||||
|
|
||||||
|
const day2 = new Date(lastRate.dated);
|
||||||
|
day2.setDate(day2.getDate() + 2);
|
||||||
|
|
||||||
|
const day3 = new Date(lastRate.dated);
|
||||||
|
day3.setDate(day3.getDate() + 3);
|
||||||
|
|
||||||
|
const xml = `<Cube>
|
||||||
|
<Cube time='${formatYmd(day1)}'>
|
||||||
|
<Cube currency='${currency.code}' rate='1.1'/>
|
||||||
|
</Cube>
|
||||||
|
<Cube time='${formatYmd(day2)}'>
|
||||||
|
<Cube currency='${currency.code}' rate='2.2'/>
|
||||||
|
</Cube>
|
||||||
|
</Cube>`;
|
||||||
|
|
||||||
|
axios.get.and.returnValue(Promise.resolve({data: xml}));
|
||||||
|
|
||||||
|
await models.InvoiceIn.exchangeRateUpdate(options);
|
||||||
|
|
||||||
|
const day3Record = await models.ReferenceRate.findOne({
|
||||||
|
where: {currencyFk: currency.id, dated: day3}
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
expect(day3Record).toBeNull();
|
||||||
|
|
||||||
|
const day1Record = await models.ReferenceRate.findOne({
|
||||||
|
where: {currencyFk: currency.id, dated: day1}
|
||||||
|
}, options);
|
||||||
|
const day2Record = await models.ReferenceRate.findOne({
|
||||||
|
where: {currencyFk: currency.id, dated: day2}
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
expect(day1Record.value).toBeCloseTo('1.1');
|
||||||
|
expect(day2Record.value).toBeCloseTo('2.2');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -166,4 +166,21 @@ describe('InvoiceIn filter()', () => {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return the invoice in matching companyFk', async() => {
|
||||||
|
const tx = await models.InvoiceIn.beginTransaction({});
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const company = await models.Company.findOne({}, options);
|
||||||
|
const invoicesByCompany = await models.InvoiceIn.find({where: {companyFk: company.id}}, options);
|
||||||
|
const filteredInvoices = await models.InvoiceIn.filter({args: {companyFk: company.id}}, {}, options);
|
||||||
|
|
||||||
|
expect(filteredInvoices.length).toEqual(invoicesByCompany.length);
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
|
describe('invoiceIn', () => {
|
||||||
|
let options;
|
||||||
|
let tx;
|
||||||
|
const invoiceId = 1;
|
||||||
|
const supplierId = 791;
|
||||||
|
const currencyId = 1;
|
||||||
|
const companyId = 442;
|
||||||
|
|
||||||
|
beforeEach(async() => {
|
||||||
|
tx = await models.InvoiceIn.beginTransaction({});
|
||||||
|
options = {transaction: tx};
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async() => {
|
||||||
|
await tx.rollback();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow insert for new instance', async() => {
|
||||||
|
const newInvoice = {
|
||||||
|
supplierFk: supplierId,
|
||||||
|
issued: Date.vnNew(),
|
||||||
|
operated: Date.vnNew(),
|
||||||
|
currencyFk: currencyId,
|
||||||
|
companyFk: companyId,
|
||||||
|
isBooked: false
|
||||||
|
};
|
||||||
|
|
||||||
|
const createdInvoice = await models.InvoiceIn.create(newInvoice, options);
|
||||||
|
|
||||||
|
expect(createdInvoice).toBeDefined();
|
||||||
|
expect(createdInvoice.id).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if trying to update a booked invoice', async() => {
|
||||||
|
const invoice = await models.InvoiceIn.findById(invoiceId, null, options);
|
||||||
|
await invoice.updateAttribute('isBooked', true, options);
|
||||||
|
|
||||||
|
let error;
|
||||||
|
try {
|
||||||
|
await invoice.updateAttribute('supplierFk', supplierId, options);
|
||||||
|
} catch (err) {
|
||||||
|
error = err;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(error.message).toBe('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if trying to delete a booked invoice', async() => {
|
||||||
|
const invoice = await models.InvoiceIn.findById(invoiceId, null, options);
|
||||||
|
await invoice.updateAttribute('isBooked', true, options);
|
||||||
|
|
||||||
|
let error;
|
||||||
|
try {
|
||||||
|
await models.InvoiceIn.deleteById(invoiceId, options);
|
||||||
|
} catch (err) {
|
||||||
|
error = err;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(error.message).toBe('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,74 @@
|
||||||
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
|
describe('invoiceInTax', () => {
|
||||||
|
let options;
|
||||||
|
let tx;
|
||||||
|
const invoiceInId = 1;
|
||||||
|
const invoiceInTaxId = 1;
|
||||||
|
beforeEach(async() => {
|
||||||
|
tx = await models.InvoiceInTax.beginTransaction({});
|
||||||
|
options = {transaction: tx};
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async() => {
|
||||||
|
await tx.rollback();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if trying to save a tax from a booked invoice', async() => {
|
||||||
|
const invoiceIn = await models.InvoiceIn.findById(invoiceInId, null, options);
|
||||||
|
await invoiceIn.updateAttributes({isBooked: true}, options);
|
||||||
|
const invoiceInTax = await models.InvoiceInTax.findById(invoiceInTaxId, null, options);
|
||||||
|
let error;
|
||||||
|
try {
|
||||||
|
await invoiceInTax.updateAttribute('taxableBase', 100, options);
|
||||||
|
} catch (err) {
|
||||||
|
error = err;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(error.message).toBe('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow save if the invoice is not booked', async() => {
|
||||||
|
const invoiceIn = await models.InvoiceIn.findById(invoiceInId, null, options);
|
||||||
|
await invoiceIn.updateAttribute('isBooked', false, options);
|
||||||
|
|
||||||
|
const invoiceInTax = await models.InvoiceInTax.findById(invoiceInTaxId, null, options);
|
||||||
|
await invoiceInTax.updateAttribute('taxableBase', 100, options);
|
||||||
|
|
||||||
|
const updatedInvoiceInTax = await models.InvoiceInTax.findById(invoiceInTaxId, null, options);
|
||||||
|
|
||||||
|
expect(updatedInvoiceInTax.taxableBase).toBe(100);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if trying to delete a tax from a booked invoice', async() => {
|
||||||
|
const invoiceIn = await models.InvoiceIn.findById(invoiceInId, null, options);
|
||||||
|
await invoiceIn.updateAttribute('isBooked', true, options);
|
||||||
|
|
||||||
|
let error;
|
||||||
|
try {
|
||||||
|
await models.InvoiceInTax.destroyById(invoiceInTaxId, options);
|
||||||
|
} catch (err) {
|
||||||
|
error = err;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(error).toBeDefined();
|
||||||
|
expect(error.message).toBe('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow delete if the invoice is not booked', async() => {
|
||||||
|
const invoiceIn = await models.InvoiceIn.findById(invoiceInId, null, options);
|
||||||
|
await invoiceIn.updateAttribute('isBooked', false, options);
|
||||||
|
|
||||||
|
let error;
|
||||||
|
try {
|
||||||
|
await models.InvoiceInTax.destroyById(invoiceInTaxId, options);
|
||||||
|
} catch (err) {
|
||||||
|
error = err;
|
||||||
|
}
|
||||||
|
|
||||||
|
const deletedInvoiceInTax = await models.InvoiceInTax.findById(invoiceInTaxId, null, options);
|
||||||
|
|
||||||
|
expect(error).toBeUndefined();
|
||||||
|
expect(deletedInvoiceInTax).toBeNull();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,59 @@
|
||||||
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
|
const invoiceInId = 1;
|
||||||
|
const supplierId = 791;
|
||||||
|
describe('invoiceIn updateInvoiceIn()', () => {
|
||||||
|
const ctx = beforeAll.getCtx();
|
||||||
|
let options;
|
||||||
|
let tx;
|
||||||
|
|
||||||
|
beforeEach(async() => {
|
||||||
|
options = {transaction: tx};
|
||||||
|
tx = await models.Sale.beginTransaction({});
|
||||||
|
options.transaction = tx;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async() => {
|
||||||
|
await tx.rollback();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should update the invoice', async() => {
|
||||||
|
const invoiceBefore = await models.InvoiceIn.findById(invoiceInId, null, options);
|
||||||
|
await update(ctx, options);
|
||||||
|
const invoiceAfter = await models.InvoiceIn.findById(invoiceInId, null, options);
|
||||||
|
|
||||||
|
expect(invoiceAfter.supplierFk).not.toBe(invoiceBefore.supplierFk);
|
||||||
|
expect(invoiceAfter.supplierFk).toBe(supplierId);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not update the invoice if is booked', async() => {
|
||||||
|
let error;
|
||||||
|
try {
|
||||||
|
await models.InvoiceIn.toBook(ctx, invoiceInId, options);
|
||||||
|
await update(ctx, options);
|
||||||
|
} catch (e) {
|
||||||
|
error = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(error.message).toBe('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
async function update(ctx, opts) {
|
||||||
|
const supplierRef = 'mockRef';
|
||||||
|
const currencyId = 1;
|
||||||
|
await models.InvoiceIn.updateInvoiceIn(ctx,
|
||||||
|
invoiceInId,
|
||||||
|
supplierId,
|
||||||
|
supplierRef,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
currencyId,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
opts);
|
||||||
|
}
|
|
@ -37,7 +37,13 @@ module.exports = Self => {
|
||||||
{
|
{
|
||||||
relation: 'supplier',
|
relation: 'supplier',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'name']
|
fields: ['id', 'name', 'isVies', 'countryFk'],
|
||||||
|
include: [{
|
||||||
|
relation: 'country',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'code']
|
||||||
|
}
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,7 +52,8 @@ module.exports = Self => {
|
||||||
accountingEntries = await models.Xdiario.count({ASIEN: asien}, myOptions);
|
accountingEntries = await models.Xdiario.count({ASIEN: asien}, myOptions);
|
||||||
|
|
||||||
await models.Xdiario.destroyAll({ASIEN: asien}, myOptions);
|
await models.Xdiario.destroyAll({ASIEN: asien}, myOptions);
|
||||||
await Self.updateAll({id: invoiceInId}, {isBooked: false}, myOptions);
|
const invoiceIn = await Self.findById(invoiceInId, myOptions);
|
||||||
|
await invoiceIn.updateAttribute('isBooked', false, myOptions);
|
||||||
} else {
|
} else {
|
||||||
const linkedBookEntry = await models.Xdiario.findOne({
|
const linkedBookEntry = await models.Xdiario.findOne({
|
||||||
fields: ['ASIEN'],
|
fields: ['ASIEN'],
|
||||||
|
|
|
@ -82,7 +82,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const invoiceIn = await Self.findById(id, null, myOptions);
|
const invoiceIn = await Self.findById(id, null, myOptions);
|
||||||
invoiceIn.updateAttributes({supplierFk,
|
await invoiceIn.updateAttributes({supplierFk,
|
||||||
supplierRef,
|
supplierRef,
|
||||||
issued,
|
issued,
|
||||||
operated,
|
operated,
|
||||||
|
@ -94,6 +94,7 @@ module.exports = Self => {
|
||||||
companyFk,
|
companyFk,
|
||||||
withholdingSageFk
|
withholdingSageFk
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
return invoiceIn;
|
return invoiceIn;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -28,11 +28,10 @@
|
||||||
"model": "InvoiceCorrectionType",
|
"model": "InvoiceCorrectionType",
|
||||||
"foreignKey": "invoiceCorrectionTypeFk"
|
"foreignKey": "invoiceCorrectionTypeFk"
|
||||||
},
|
},
|
||||||
"siiTypeInvoiceOut": {
|
"siiTypeInvoiceIn": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "SiiTypeInvoiceOut",
|
"model": "SiiTypeInvoiceIn",
|
||||||
"foreignKey": "siiTypeInvoiceOutFk"
|
"foreignKey": "siiTypeInvoiceInFk"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.observe('before save', async function(ctx) {
|
||||||
|
if (ctx.isNewInstance) return;
|
||||||
|
|
||||||
|
const models = Self.app.models;
|
||||||
|
const invoiceIn = await models.InvoiceIn.findById(ctx.currentInstance.invoiceInFk, null, ctx.options);
|
||||||
|
if (invoiceIn.isBooked) throw new UserError('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.observe('before delete', async function(ctx) {
|
||||||
|
const models = Self.app.models;
|
||||||
|
const invoiceInTax = await Self.findById(ctx.where.id, null, ctx.options);
|
||||||
|
const invoiceIn = await models.InvoiceIn.findById(invoiceInTax.invoiceInFk, null, ctx.options);
|
||||||
|
if (invoiceIn.isBooked) throw new UserError('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
|
};
|
|
@ -22,12 +22,11 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"expenseFk": {
|
"expenseFk": {
|
||||||
"type": "number"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"created": {
|
"created": {
|
||||||
"type": "date"
|
"type": "date"
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
"invoiceIn": {
|
"invoiceIn": {
|
||||||
|
|
|
@ -19,4 +19,25 @@ module.exports = Self => {
|
||||||
return new UserError(`This invoice has a linked vehicle.`);
|
return new UserError(`This invoice has a linked vehicle.`);
|
||||||
return err;
|
return err;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Self.observe('before save', async function(ctx) {
|
||||||
|
if (ctx.isNewInstance) return;
|
||||||
|
|
||||||
|
const changes = ctx.data || ctx.instance;
|
||||||
|
const orgData = ctx.currentInstance;
|
||||||
|
let isNotEditable = orgData.isBooked || (!orgData.isBooked && changes.isBooked);
|
||||||
|
|
||||||
|
if (isNotEditable) {
|
||||||
|
for (const [key, value] of Object.entries(changes)) {
|
||||||
|
if (key !== 'isBooked' && value !== orgData[key])
|
||||||
|
throw new UserError('InvoiceIn is already booked');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.observe('before delete', async function(ctx) {
|
||||||
|
const invoiceIn = await Self.findById(ctx.where.id, null, ctx.options);
|
||||||
|
if (invoiceIn.isBooked) throw new UserError('InvoiceIn is already booked');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethodCtx('clientsToInvoice', {
|
Self.remoteMethodCtx('clientsToInvoice', {
|
||||||
description: 'Get the clients to make global invoicing',
|
description: 'Get the clients to make global invoicing',
|
||||||
|
@ -47,7 +49,6 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Packaging liquidation
|
|
||||||
const vIsAllInvoiceable = false;
|
const vIsAllInvoiceable = false;
|
||||||
await Self.rawSql('CALL ticketPackaging_add(?, ?, ?, ?)', [
|
await Self.rawSql('CALL ticketPackaging_add(?, ?, ?, ?)', [
|
||||||
clientId,
|
clientId,
|
||||||
|
@ -71,12 +72,10 @@ module.exports = Self => {
|
||||||
AND t.shipped BETWEEN ? AND util.dayEnd(?)
|
AND t.shipped BETWEEN ? AND util.dayEnd(?)
|
||||||
AND (t.clientFk = ? OR ? IS NULL )
|
AND (t.clientFk = ? OR ? IS NULL )
|
||||||
AND t.companyFk = ?
|
AND t.companyFk = ?
|
||||||
AND c.hasToInvoice
|
|
||||||
AND c.isTaxDataChecked
|
|
||||||
AND c.isActive
|
|
||||||
AND NOT t.isDeleted
|
AND NOT t.isDeleted
|
||||||
GROUP BY IF(c.hasToInvoiceByAddress, a.id, c.id)
|
GROUP BY IF(c.hasToInvoiceByAddress, a.id, c.id)
|
||||||
HAVING SUM(t.totalWithVat) > 0;`;
|
HAVING SUM(t.totalWithVat) > 0
|
||||||
|
ORDER BY c.id`;
|
||||||
|
|
||||||
const addresses = await Self.rawSql(query, [
|
const addresses = await Self.rawSql(query, [
|
||||||
minShipped,
|
minShipped,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue