Compare commits

...

378 Commits

Author SHA1 Message Date
Guillermo Bonet c79867188a Merge branch 'test' into dev
gitea/salix/pipeline/head There was a failure building this commit Details
2025-02-14 12:36:24 +01:00
Guillermo Bonet dce263992e fix: refs #8227 Roadmap columns
gitea/salix/pipeline/head This commit looks good Details
2025-02-14 12:36:06 +01:00
Carlos Andrés a874b96c5e revert a119d9f7fb
gitea/salix/pipeline/head There was a failure building this commit Details
revert feat: invoiceIn move deductible field from head to lines
2025-02-14 11:32:45 +00:00
Carlos Andrés a119d9f7fb feat: invoiceIn move deductible field from head to lines
gitea/salix/pipeline/head This commit looks good Details
2025-02-14 12:29:56 +01:00
Guillermo Bonet 309a287748 Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-14 12:08:43 +01:00
Guillermo Bonet d9e177d6b4 Merge pull request 'feat: refs #8227 Update roadmap triggers to manage eta adjustments and prevent recursive calls' (!3428) from 8227-roadmapChanges into test
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3428
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-14 10:54:18 +00:00
Guillermo Bonet aca49505bd Merge branch 'test' into 8227-roadmapChanges
gitea/salix/pipeline/pr-test This commit looks good Details
2025-02-14 10:52:40 +00:00
Guillermo Bonet 28deadfbad fix: refs #8573 version
gitea/salix/pipeline/head This commit looks good Details
2025-02-14 10:37:08 +01:00
Guillermo Bonet d6f08d7e27 feat: refs #8227 update roadmap triggers and views, remove obsolete trigger and column
gitea/salix/pipeline/pr-test This commit looks good Details
2025-02-14 10:04:04 +01:00
Alex Moreno 8110e88aa7 fix: vnUser, default false
gitea/salix/pipeline/head There was a failure building this commit Details
2025-02-14 08:29:55 +01:00
Ivan Mas 9000becf07 Merge pull request 'refactor: refs #8573 add fk to expedition.hostFk' (!3447) from 8573-addFkExpeditionHost into dev
gitea/salix/pipeline/head There was a failure building this commit Details
Reviewed-on: #3447
Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
2025-02-14 07:06:21 +00:00
Ivan Mas 5a37bd332e Merge branch 'dev' into 8573-addFkExpeditionHost
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-14 06:55:47 +00:00
Alex Moreno 44ed6254c3 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-14 07:02:45 +01:00
Carlos Andrés 4e9bcf530b Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/pr-dev This commit looks good Details
gitea/salix/pipeline/head This commit looks good Details
2025-02-13 18:59:26 +01:00
Carlos Andrés b06ffdff52 Actualizar modules/ticket/back/methods/ticket/closeAll.js
gitea/salix/pipeline/head This commit looks good Details
2025-02-13 16:42:20 +00:00
Carlos Andrés 536203e0a1 Merge pull request 'fix: facturacion por consignatario en el cierre nocturno y unificación de backs' (!3453) from Hotfix-cierre-facturacion into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3453
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-13 16:37:00 +00:00
Ivan Mas 13a76e5c70 Merge branch 'dev' into 8573-addFkExpeditionHost
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-13 15:43:56 +00:00
Ivan Mas caa921020d refactor: refs #8573 update before alter table
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-13 16:41:29 +01:00
Carlos Andrés 7f32a10c06 fix: facturacion por consignatario en el cierre nocturno y unificación de backs
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-13 15:22:37 +01:00
Guillermo Bonet 845ce8d6d8 feat: refs #8227 Minor changes
gitea/salix/pipeline/pr-test There was a failure building this commit Details
2025-02-13 14:36:09 +01:00
Guillermo Bonet 4042679c9b feat: refs #8227 Grants
gitea/salix/pipeline/pr-test There was a failure building this commit Details
2025-02-13 14:12:44 +01:00
Pako Natek 86091571cd Merge pull request 'fix(item_getBalance): refs #8408 availabled field prevails over landed' (!3449) from 8408-Disponible-por-zonas-y-horas into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3449
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-13 12:39:29 +00:00
Carlos Andrés b2071994da fix: update closeAll method to improve date handling and ticket selection logic
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-13 13:28:14 +01:00
Carlos Satorres cd258eb44e Merge pull request 'fix: refs #6553 remove business' (!3451) from 6553-warnFixBusinessSummary into test
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3451
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-13 11:14:15 +00:00
Jorge Penadés e99fbca255 Merge pull request 'feat: refs #8571 enhance email formatting in sendToSupport function with structured HTML table' (!3445) from 8571-hotfix-notShowToken into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3445
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-13 11:01:37 +00:00
Jorge Penadés fa12debcd7 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into 8571-hotfix-notShowToken
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-13 11:59:36 +01:00
Carlos Satorres 1b7026fa00 fix: refs #6553 remove business
gitea/salix/pipeline/pr-test This commit looks good Details
2025-02-13 10:46:48 +01:00
Guillermo Bonet bd53f7367c Merge branch 'test' into 8227-roadmapChanges
gitea/salix/pipeline/pr-test This commit looks good Details
2025-02-13 08:34:20 +00:00
Guillermo Bonet 92ab3648e7 feat: refs #8227 Fix tests
gitea/salix/pipeline/pr-test This commit looks good Details
2025-02-13 09:22:45 +01:00
Pablo Natek 4b7c20075b Merge pull request 'feat: refs #6897 add search method and enhance ACL permissions for Entry model' (!3448) from 6897-addItemSearch into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3448
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-13 07:59:58 +00:00
Pako Natek 3a1849326b fix(item_getBalance): refs #8408 availabled field prevails over landed
gitea/salix/pipeline/pr-dev This commit looks good Details
Refs: #8408
2025-02-13 08:41:13 +01:00
Pako Natek d773aec0f5 Merge pull request 'feat(productionControl and collection_new): refs #8575 new itempackingtype a' (!3444) from 8575-itemPackingType-Altillo into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3444
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-13 06:45:37 +00:00
Pako Natek 317c152c66 Merge branch 'dev' into 8575-itemPackingType-Altillo
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-13 06:41:43 +00:00
Pablo Natek 514ddf1045 feat: refs #6897 add search method and enhance ACL permissions for Entry model
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-12 19:40:22 +01:00
Ivan Mas f12c47cdf8 Merge branch 'dev' into 8573-addFkExpeditionHost
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-12 16:11:53 +00:00
Ivan Mas 5404f895b2 refactor: refs #8573 add fk to expedition.hostFk
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-12 17:08:45 +01:00
Javier Segarra 0b8a54d057 Merge pull request 'Fix TicketNegative' (!3446) from fix_ticketNegative into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3446
Reviewed-by: Jon Elias <jon@verdnatura.es>
2025-02-12 15:43:59 +00:00
Jon Elias 307c8d92df Merge branch 'dev' into fix_ticketNegative
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-12 15:30:09 +00:00
Javier Segarra f631aa1314 fix: remotMethodCtx
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-12 16:26:01 +01:00
Guillermo Bonet 8959eb21f6 Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-12 14:37:34 +01:00
Guillermo Bonet 5543da2c80 Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2025-02-12 14:37:10 +01:00
Guillermo Bonet ef9ca5f56c Merge pull request 'refactor: refs #6944 Update ticket_setState to improve state change logic and user tracking' (!3439) from 6944-stateNoRepeat into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3439
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-12 13:36:14 +00:00
Carlos Andrés 65a4967d46 fix: update maxShipped to use toDate in closeAll method
gitea/salix/pipeline/head This commit looks good Details
2025-02-12 14:16:43 +01:00
Jorge Penadés 3754ede42d feat: refs #8571 enhance email formatting in sendToSupport function with structured HTML table
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-12 14:15:53 +01:00
Guillermo Bonet ba3909a984 refactor: refs #6944 Requested changes
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-12 14:13:39 +01:00
Pako Natek b95db2eff1 feat(productionControl and collection_new): refs #8575 new itempackingtype a
gitea/salix/pipeline/pr-dev This commit looks good Details
Refs: #8575
2025-02-12 13:45:07 +01:00
Carlos Andrés 9785ab5a7d feat: enhance ticket closure process with error handling and email notifications
gitea/salix/pipeline/head This commit looks good Details
2025-02-12 13:23:57 +01:00
Carlos Andrés b40981aa03 feat: enhance ticket closure process with error handling and email notifications
gitea/salix/pipeline/head This commit looks good Details
2025-02-12 13:18:18 +01:00
Carlos Andrés fad95f2cf9 Merge pull request 'hotFix_daily_addressInvoice_2' (!3441) from hotFix_daily_addressInvoice_2 into test
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3441
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-12 11:22:08 +00:00
Alex Moreno 5d155ef6bd Merge branch 'test' into hotFix_daily_addressInvoice_2
gitea/salix/pipeline/pr-test This commit looks good Details
2025-02-12 11:17:27 +00:00
Carlos Andrés 1c9417556b feat: enhance ticket closure process with error handling and email notifications
gitea/salix/pipeline/pr-test There was a failure building this commit Details
2025-02-12 12:13:23 +01:00
Guillermo Bonet e7c027a8b1 refactor: refs #6944 Update ticket_setState to improve state change logic and user tracking
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-12 10:06:48 +01:00
Javi Gallego 1c8ad94ab8 fix: update SQL fixture values and enhance getVideoList method with transaction handling
gitea/salix/pipeline/head This commit looks good Details
2025-02-12 09:51:56 +01:00
Pablo Natek 8d0fec4ffd Merge pull request 'feat: refs #6897 add EntryConfig model and enhance entry filtering with new parameters' (!3366) from 6897-refactorEntryBuyList into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3366
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-12 06:37:43 +00:00
Pablo Natek c0b1f3337c Merge branch 'dev' into 6897-refactorEntryBuyList
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-11 15:50:28 +00:00
Pablo Natek f347d9668f refactor: refs #6897 improve variable scope and query parameters in recalcEntryPrices.js
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-11 16:50:00 +01:00
Carlos Satorres 798d8a514e Merge pull request 'fix: hotfix delivery-note' (!3437) from hotfix-producerPdf into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3437
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-11 15:13:27 +00:00
Carlos Satorres b49df364bf Merge branch 'master' into hotfix-producerPdf
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-11 14:58:16 +00:00
Carlos Satorres 92232b34ce fix: hotfix delivery-note
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-11 15:55:08 +01:00
Alex Moreno 3fbd740a2b fix: address invoice daily
gitea/salix/pipeline/pr-master There was a failure building this commit Details
2025-02-11 14:31:26 +01:00
Guillermo Bonet f682e3cfe6 Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-11 13:26:18 +01:00
Guillermo Bonet 0a33e05bff Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2025-02-11 13:26:02 +01:00
Guillermo Bonet a387e3ae92 feat: refs #7162 Add packages and packagesList to ticket_doCmr procedure
gitea/salix/pipeline/head This commit looks good Details
2025-02-11 13:25:30 +01:00
Pablo Natek 96248132a1 refactor: refs #6897 sql fixture data for improved readability and consistency
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-11 13:02:50 +01:00
Pablo Natek 454fbcb7ce Merge branch 'dev' of https: refs #6897//gitea.verdnatura.es/verdnatura/salix into 6897-refactorEntryBuyList
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-11 12:38:42 +01:00
Javier Segarra 5df24d0e70 Merge pull request '#6321 - Negative tickets' (!1945) from 6321_negative_tickets into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #1945
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-11 08:45:32 +00:00
Javier Segarra 095e561c82 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-11 08:43:21 +00:00
Pako Natek 0bd345b6de Merge pull request '8408-Disponible-por-zonas-y-horas' (!3432) from 8408-Disponible-por-zonas-y-horas into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3432
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-11 07:50:15 +00:00
Pako Natek b4fe620f2e Merge branch 'dev' into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-11 07:47:16 +00:00
Pako Natek 5a8f7b2c1a Merge branch '8408-Disponible-por-zonas-y-horas' of https://gitea.verdnatura.es/verdnatura/salix into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-11 08:46:26 +01:00
Pako Natek fbf56ff0cf fix(available_refresh): refs #8408 more availabled cases
refs#8408
2025-02-11 08:46:24 +01:00
Pablo Natek 5ab45831e7 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6897-refactorEntryBuyList 2025-02-11 08:19:31 +01:00
Pako Natek cdb91c06c2 Merge pull request '8408-Disponible-por-zonas-y-horas' (!3431) from 8408-Disponible-por-zonas-y-horas into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3431
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-11 07:16:38 +00:00
Pako Natek 1a92a00cce Merge branch 'dev' into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-11 07:12:25 +00:00
Pako Natek 5d674139fa Merge branch '8408-Disponible-por-zonas-y-horas' of https://gitea.verdnatura.es/verdnatura/salix into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-10 14:00:36 +01:00
Pako Natek ec5ef3d7f8 fix(item_getStock): refs #8408 field availabled used for itementryin selection
Refs: #8408
2025-02-10 14:00:34 +01:00
Guillermo Bonet 75b6867be8 feat: refs #8227 Minor change
gitea/salix/pipeline/pr-test There was a failure building this commit Details
2025-02-10 13:06:05 +01:00
Guillermo Bonet e19e50de14 feat: refs #8227 Update roadmap triggers to manage eta adjustments and prevent recursive calls
gitea/salix/pipeline/pr-test There was a failure building this commit Details
2025-02-10 13:04:23 +01:00
Pablo Natek 6110295cc2 fix: refs #6897 update entry_clone method to return newEntryId instead of result
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-10 11:40:54 +01:00
Pako Natek 4d5d38592f Merge pull request 'feat(catalog_calculate): refs #8408 new concept availabled' (!3425) from 8408-Disponible-por-zonas-y-horas into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3425
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-10 06:47:01 +00:00
Pako Natek f7f221e2bc Merge branch 'dev' into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-10 06:36:15 +00:00
Pako Natek 17749b0ced Merge branch '8408-Disponible-por-zonas-y-horas' of https://gitea.verdnatura.es/verdnatura/salix into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-10 07:34:19 +01:00
Pako Natek b60f251c56 fix(catalog_calculate): refs #8408 remove comments
resf#8408
2025-02-10 07:34:15 +01:00
Guillermo Bonet 0ecf1f281a Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-10 07:27:04 +01:00
Guillermo Bonet a002168f61 Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2025-02-10 07:26:53 +01:00
Guillermo Bonet 50a295d495 fix: refs #7162 Update JOIN condition for agencyMode in ticket_doCmr
gitea/salix/pipeline/head This commit looks good Details
2025-02-10 07:25:39 +01:00
Pablo Natek 2f0cd27ed8 Merge branch 'dev' of https: refs #6897//gitea.verdnatura.es/verdnatura/salix into 6897-refactorEntryBuyList
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-09 18:26:52 +01:00
Pablo Natek 6ea4e3096e feat: refs #6897 add maxLockTime parameter to entryConfig insert statement
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-09 18:24:39 +01:00
Javier Segarra e748c3ea68 feat: refs #6321 minor changes
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-07 22:40:00 +01:00
Javier Segarra fce6b13d2d Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 16:19:58 +01:00
Javier Segarra 9bb273807d feat: refs #6321 i18n negativeReplaced 2025-02-07 16:18:26 +01:00
Guillermo Bonet 08140894a8 Merge branch 'dev' into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 14:06:28 +00:00
Guillermo Bonet d7a25b06bf Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-07 15:05:41 +01:00
Guillermo Bonet 8261b35559 Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2025-02-07 15:05:20 +01:00
Guillermo Bonet b56468d3aa fix: refs #7024 Test
gitea/salix/pipeline/head This commit looks good Details
2025-02-07 15:05:04 +01:00
Pako Natek e22a21290b Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 8408-Disponible-por-zonas-y-horas 2025-02-07 14:37:20 +01:00
Pako Natek adf416a086 fix: refs #8408 hour time on catalog_calculate
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-07 14:29:50 +01:00
Guillermo Bonet ec3210a5c0 Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-07 14:28:28 +01:00
Guillermo Bonet b1d2441d2e Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2025-02-07 14:27:56 +01:00
Guillermo Bonet 95d2823666 fix: refs #7024 Deleted dated check
gitea/salix/pipeline/head This commit looks good Details
2025-02-07 14:27:27 +01:00
Pako Natek ca39edd010 fix: refs #8408 test
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-07 14:04:17 +01:00
Jon Elias f04933a9c1 Merge pull request 'Fix[ItemFixedPrice]: Fixed item name filter' (!3427) from Hotfix-FixedPriceNameFilter into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3427
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-07 12:44:42 +00:00
Jon Elias 516f409ae5 Merge branch 'dev' into Hotfix-FixedPriceNameFilter
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 12:42:20 +00:00
Jon Elias d76db10e67 fix: fixed item name filter
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 13:39:53 +01:00
Pako Natek 466a0a58d9 fix(catalog_calculate): refs #8408 delete commented lines
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
refs#8408
2025-02-07 12:59:41 +01:00
Pako Natek 74583d899a Merge branch 'dev' into 8408-Disponible-por-zonas-y-horas
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-07 11:53:30 +00:00
Pako Natek ba323bb7bf fix(fixtures.before): refs #8408 rollback changes
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
refs#8408
2025-02-07 12:53:15 +01:00
Carlos Andrés f851a0b73b Merge pull request 'HOTFIX: before save checkAccessAcl' (!3426) from hotfix_client_beforeSave_ACL into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3426
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-07 10:18:43 +00:00
Javier Segarra 23134deab5 fix: before save checkAccessAcl
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-07 11:11:22 +01:00
Guillermo Bonet 21d9369250 fix: refs #8172 Version fix
gitea/salix/pipeline/head This commit looks good Details
2025-02-07 11:04:10 +01:00
Pako Natek a4f3975340 feat(catalog_calculate): refs #8408 new concept availabled
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
Refs: #8408
2025-02-07 10:40:00 +01:00
Guillermo Bonet 1a274648a7 Merge pull request 'refactor: refs #8172 Created table parkingCoordinates' (!3320) from 8172-parkingCoordinates into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3320
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
2025-02-07 09:38:55 +00:00
Guillermo Bonet 6fd1c35819 Merge branch 'dev' into 8172-parkingCoordinates
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 10:36:35 +01:00
Javier Segarra f4dbddbe15 fix: refs #6321 dates in fixtures.before
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 09:54:55 +01:00
Javier Segarra ef4d639499 Merge pull request '#7601 - Different agency fot future tickets' (!3420) from 7601_futureAgency into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3420
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-07 08:32:47 +00:00
Javier Segarra 9322360979 fix: refs #6321 dates in fixtures.before
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-07 08:41:49 +01:00
Jon Elias 18fe468623 Merge pull request 'Hotfix[InvoiceOutList]: Fixed company filter' (!3424) from Hotfix-InvoiceOutCompanyFilter into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3424
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-07 07:12:33 +00:00
Javier Segarra 47c3878a74 Merge branch 'dev' into 7601_futureAgency
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 07:06:54 +00:00
Javier Segarra e035a73e06 feat: refs #6321 i18n es negativeReplaced
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-07 07:57:10 +01:00
Jon Elias a6de493271 Merge branch 'master' into Hotfix-InvoiceOutCompanyFilter
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-07 06:56:49 +00:00
Javier Segarra d185530839 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-07 07:56:05 +01:00
Jon Elias 200f159c6b fix: style
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-07 07:55:08 +01:00
Javier Segarra 9390c0efed test: refs #6321 getSimilar.spec.js 2025-02-07 07:53:00 +01:00
Jon Elias ec01c6b0c2 fix: fixed company filter
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-07 07:51:18 +01:00
Robert Ferrús 860d86d19e Merge pull request '6702-missageSaleCloned' (!3404) from 6702-missageSaleCloned into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3404
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-07 06:51:05 +00:00
Javier Segarra c4e64db9b9 Merge branch '6321_negative_tickets' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-06 23:23:00 +01:00
Javier Segarra ba58746a03 fix: refs #6321 test 2025-02-06 23:22:58 +01:00
Jorge Penadés fa098661b6 Merge pull request 'fix: add await' (!3422) from hotfix-addAwait into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3422
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
2025-02-06 16:53:52 +00:00
Jorge Penadés 6a83cec33f fix: add await
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-06 17:43:58 +01:00
Javier Segarra 35bf9abcf4 Merge branch 'dev' into 7601_futureAgency
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-06 16:15:27 +00:00
Javier Segarra 8398a30e4f Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-06 14:58:55 +00:00
Javier Segarra 4e4d6c3b6a fix: refs #6321 fixtures
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-06 15:20:44 +01:00
Javier Segarra 9626b6c0ff feat: refs #6321 update itemLackDetail 2025-02-06 15:19:39 +01:00
Javier Segarra 338e833c0b feat: refs #6321 i18n 2025-02-06 15:19:23 +01:00
Javier Segarra 8170eafa36 feat: refs #6321 remove ticketConfig var 2025-02-06 15:19:07 +01:00
Robert Ferrús aa44d0e727 Merge branch 'dev' of https: refs #6702//gitea.verdnatura.es/verdnatura/salix into 6702-missageSaleCloned
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-06 14:31:37 +01:00
Guillermo Bonet 9f302fac24 Merge branch 'test' into dev
gitea/salix/pipeline/head There was a failure building this commit Details
2025-02-06 13:47:36 +01:00
Guillermo Bonet 92ca3a2582 Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2025-02-06 13:47:17 +01:00
Carlos Andrés 2e8e2329ec fix: refs #8535 deploy
gitea/salix/pipeline/head This commit looks good Details
2025-02-06 13:44:22 +01:00
Robert Ferrús 73a7a4cbd3 Merge pull request 'feat: refs #8487 delete appointment from travel view' (!3421) from 8487-modifyTravelView into test
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3421
Reviewed-by: Robert Ferrús <robert@verdnatura.es>
2025-02-06 12:32:12 +00:00
Javier Segarra ab0667f85c feat: retrive requested fields
gitea/salix/pipeline/pr-dev Build queued... Details
2025-02-06 12:31:46 +00:00
Ivan Mas f12a690bef feat: refs #8487 delete appointment from travel view
gitea/salix/pipeline/pr-test This commit looks good Details
2025-02-06 13:28:44 +01:00
Guillermo Bonet beed658f61 fix: refs #8535 deploy
gitea/salix/pipeline/head This commit looks good Details
2025-02-06 13:21:32 +01:00
Guillermo Bonet 110a5212c0 fix: refs #8535 deploy
gitea/salix/pipeline/head This commit looks good Details
2025-02-06 12:55:01 +01:00
Javier Segarra 4c786be3af Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-06 12:34:41 +01:00
Javier Segarra 4c7b8212da feat: refs #6321 changes 2025-02-06 12:27:59 +01:00
Guillermo Bonet e9e3a5f128 Merge pull request 'feat: refs #8535 sistema de warnings' (!3418) from 8535-log-mandate into master
gitea/salix/pipeline/head There was a failure building this commit Details
Reviewed-on: #3418
Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
2025-02-06 11:18:57 +00:00
Carlos Andrés fa5888f931 Merge branch 'master' of https: refs #8535//gitea.verdnatura.es/verdnatura/salix into 8535-log-mandate
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-06 11:53:57 +01:00
Carlos Andrés 9b2c0f1c48 feat: refs #8535 log table mandate
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-06 11:46:39 +01:00
Javier Segarra 3dd64e4257 feat: refs #6321 sql lackDetail step3 2025-02-06 10:31:43 +01:00
Javier Segarra e736c95fb6 feat: refs #6321 sql lackDetail step2 2025-02-06 10:29:48 +01:00
Javier Segarra 1af01ad747 feat: refs #6321 sql lackDetail step1 2025-02-06 10:26:38 +01:00
Jorge Penadés 97be16b344 Merge pull request 'feat: refs #7119 add VehicleState model with data source configuration' (!3328) from 7119-createVehicle into dev
gitea/salix/pipeline/head There was a failure building this commit Details
gitea/salix/pipeline/pr-dev This commit looks good Details
Reviewed-on: #3328
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-06 09:24:09 +00:00
Jorge Penadés 9ba517b648 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-06 10:20:22 +01:00
Juanjo Breso b0dd1d4fff Merge pull request 'feat: refs #269518 isFragile item and itemType' (!3419) from 269518-ticket_getWarnings_isFragile into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3419
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-06 08:18:27 +00:00
Juanjo Breso 8df36f296a feat: refs #269518 isFragile item and itemType
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-06 09:11:48 +01:00
Javier Segarra 24411f9af1 fix: refs #6321 revert change
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-06 08:17:03 +01:00
Javier Segarra b2cbded2dc feat: refs #6321 defaultAlertLevelCode
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-06 01:06:02 +01:00
Javier Segarra 1f6f7b9975 feat: refs #6321 updates requested
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-06 00:34:08 +01:00
Carlos Andrés 37b735b988 feat: refs #8535 sistema de warnings
gitea/salix/pipeline/pr-master This commit looks good Details
2025-02-05 17:21:36 +01:00
Javier Segarra da90d43f7a Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-05 15:36:44 +01:00
Javier Segarra e02dcf23b7 feat: refs #6321 add columns ticketConfigs 2025-02-05 15:36:01 +01:00
Jose Antonio Tubau abf73f5705 Merge pull request 'feat: refs #8304 add ACL entry for WorkerDms with high privileges' (!3353) from 8304-workerChangesAndFixes into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3353
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-05 12:23:04 +00:00
Jose Antonio Tubau 0a25595ed5 Merge branch 'dev' into 8304-workerChangesAndFixes
gitea/salix/pipeline/pr-test This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-05 13:00:44 +01:00
Alex Moreno 1ee5af96a5 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2025-02-05 11:16:32 +01:00
Alex Moreno e89c12f753 fix: refs #7943 better "relation": "business",
gitea/salix/pipeline/head This commit looks good Details
2025-02-05 10:52:20 +01:00
Alex Moreno f216166806 fix: refs #7943 better "relation": "business",
gitea/salix/pipeline/head This commit looks good Details
2025-02-05 10:16:14 +01:00
Pablo Natek 26faaad5b4 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6897-refactorEntryBuyList
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-05 08:03:48 +01:00
Jon Elias 502b48718c Merge pull request '#7965 - unifyProblems' (!2990) from 7965-unifyProblems into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #2990
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-02-05 06:51:54 +00:00
Pablo Natek e4cd30bc27 feat: refs #6897 add groupingMode and hasMinPrice parameters to getBuyList method
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-05 07:34:47 +01:00
Javier Segarra 55eb882754 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-04 23:42:47 +01:00
Javier Segarra 272c7c0289 perf: refs #6321 minor changes
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-04 23:42:16 +01:00
Jon Elias 55063e488c Merge pull request '#7127 modify days when adding lines to a claim' (!3195) from 7127-ModifyDaysToAddSales into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3195
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2025-02-04 13:45:20 +00:00
Alex Moreno da36016f5b build: init version
gitea/salix/pipeline/head This commit looks good Details
2025-02-04 14:43:31 +01:00
Alex Moreno 4b903c5bad Merge pull request '8524-devToTest' (!3415) from 8524-devToTest into test
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3415
Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
2025-02-04 13:42:14 +00:00
Javier Segarra 5d209314f6 feat: refs #6321 use Date.vnNew
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-04 14:09:48 +01:00
Javier Segarra 0111373471 Merge branch 'dev' of https: refs #6321//gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-04 14:00:00 +01:00
Javier Segarra 550b0871f0 feat: refs #6321 changes
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-04 13:45:59 +01:00
Javier Segarra 410f3e73dc Merge branch 'dev' of https: refs #6321//gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-04 09:54:41 +01:00
Pablo Natek 13d9cac340 test: refs #6897 update expected results in item and tag filter tests
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-03 14:19:39 +01:00
Robert Ferrús 14a48bf4c6 Merge branch 'dev' into 6702-missageSaleCloned
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-03 12:37:12 +00:00
Pablo Natek 8f3bf46165 Merge branch 'dev' of https: refs #6897//gitea.verdnatura.es/verdnatura/salix into 6897-refactorEntryBuyList
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-03 13:36:20 +01:00
Pablo Natek e7dd1f6a58 feat: refs #6897 add recalcEntryPrices method and enhance ACL permissions for entry operations
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-03 13:16:48 +01:00
Robert Ferrús d79c19d92a feat: refs #6702 delete line
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-03 12:42:38 +01:00
Robert Ferrús 0646d2e817 feat: refs #6702 changes request
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-03 12:41:51 +01:00
Robert Ferrús d98476b777 Merge branch 'dev' into 6702-missageSaleCloned
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-03 06:11:47 +00:00
Robert Ferrús 1a8ce32833 Merge branch 'dev' into 6702-missageSaleCloned
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-31 12:17:08 +00:00
Robert Ferrús 9d3a4257b7 feat: refs #6702 translations
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-31 12:53:48 +01:00
Robert Ferrús f484c3e653 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6702-missageSaleCloned 2025-01-31 11:59:00 +01:00
Javier Segarra 49c6df42a7 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-31 10:20:42 +00:00
Robert Ferrús 948bdbd2c6 feat: refs #6702 refs #6701 changes
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-31 08:19:39 +01:00
Robert Ferrús ce447b7de6 Merge branch 'dev' of https: refs #6702//gitea.verdnatura.es/verdnatura/salix into 6702-missageSaleCloned
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-31 07:14:10 +01:00
Robert Ferrús 1e18e48f8c feat: refs #6702 es.json delete changes
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-31 07:09:42 +01:00
Javier Segarra 767c891317 perf: refs #6321 remove comments
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-31 01:17:23 +01:00
Javier Segarra 2574e59c71 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-31 01:07:53 +01:00
Javier Segarra cd7add3497 feat: refs #6321 debug 2025-01-31 01:07:39 +01:00
Javier Segarra 7fdd3d1eb8 feat: refs #6321 fix methods 2025-01-31 01:07:28 +01:00
Javier Segarra 9791f3b935 fix: refs #6321 fixtures 2025-01-31 01:06:57 +01:00
Javier Segarra b8894ca67d feat: refs #6321 i18n replaceItem 2025-01-31 01:04:34 +01:00
Javier Segarra 75b4202a7b feat: refs #6321 remove origin 2025-01-31 01:04:14 +01:00
Jorge Penadés 77623b489b feat: refs #7119 add new vehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-30 10:55:36 +01:00
Jorge Penadés a0dc8f8104 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-30 10:26:40 +01:00
Javier Segarra dc6f93c241 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-30 08:54:04 +01:00
Javier Segarra 811feb9fee feat: refs #6321 tour 2025-01-29 23:46:19 +01:00
Jorge Penadés 2f364ebc76 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-29 16:40:37 +01:00
Jorge Penadés a463a8f4d8 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-29 14:49:07 +01:00
Javier Segarra ac053814e6 test: refs #6321 fixing test 2025-01-29 12:26:42 +01:00
Jorge Penadés 2b443266b2 Merge branch 'dev' of https: refs #7119//gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-29 11:51:21 +01:00
Javier Segarra a93e8b28db fix: refs #6321 getSimilar
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-28 23:37:56 +01:00
Jorge Penadés 051c6ffcbc refactor(vehicle filter): refs #7119 simplify search condition to use logical OR for ID and number plate
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-28 12:23:24 +01:00
Jorge Penadés 2eabfaaa8f Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-28 11:44:59 +01:00
Javier Segarra 10eef6d1b6 feat: refs #6321 updates
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-28 08:45:00 +01:00
Javier Segarra 1a0992da78 feat: refs #6321 changes 2025-01-27 12:04:18 +01:00
Pablo Natek ef5c2ab3a2 feat: refs #6897 add cloneEntry and deleteEntry methods with corresponding ACL permissions
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-27 08:11:41 +01:00
Javier Segarra bd54eacda1 feat: refs #6321 alternative alertLevel 2025-01-26 02:36:39 +01:00
Javier Segarra 36192c14ec Merge branch 'dev' into 6321_negative_tickets 2025-01-25 09:10:45 +01:00
Jorge Penadés fb653c1eca fix: refs #7119 rollback
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-24 16:42:10 +01:00
Jorge Penadés ec7bbd13b1 refactor: refs #7119 update vehicle filter logic and improve test cases
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-24 16:37:35 +01:00
Jorge Penadés 2346205072 Merge branch 'dev' of https: refs #7119//gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-24 16:14:09 +01:00
Jorge Penadés 3fba81b41e feat: refs #7119 add 'id' filter option and enhance bank policy model with dmsFk field
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-24 10:46:35 +01:00
Jorge Penadés f8e4561a59 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-24 09:37:10 +01:00
Jorge Penadés 3a449896cd feat: refs #7119 update vehicle permissions and enhance vehicle model with new fields
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-23 18:02:53 +01:00
Jose Antonio Tubau e22a472e97 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 8304-workerChangesAndFixes
gitea/salix/pipeline/pr-test There was a failure building this commit Details
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-23 15:06:03 +01:00
Javier Segarra c3361fd49b Merge branch 'dev' into 6321_negative_tickets 2025-01-23 14:48:28 +01:00
Jorge Penadés 3ea67675da feat: refs #7119 add VehicleType model and update vehicle permissions for delivery roles
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-23 10:53:53 +01:00
Jorge Penadés 0440582e2b Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-23 10:09:47 +01:00
Jose Antonio Tubau d3b22ce6c9 Merge branch '8304-workerChangesAndFixes' of https://gitea.verdnatura.es/verdnatura/salix into 8304-workerChangesAndFixes
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-22 16:17:38 +01:00
Jose Antonio Tubau e05f740c3d Merge branch 'dev' into 8304-workerChangesAndFixes 2025-01-22 16:17:35 +01:00
Jose Antonio Tubau 171296f2db Merge branch 'dev' into 8304-workerChangesAndFixes
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-22 11:43:14 +00:00
Jorge Penadés 49e08fbf45 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle 2025-01-22 12:42:25 +01:00
Javier Segarra 2a4bad5034 Merge branch 'dev' into 6321_negative_tickets 2025-01-21 23:43:07 +01:00
Jorge Penadés 2ae0097fa8 feat: refs #7119 add vehicle type management and delivery role permissions
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-21 15:48:20 +01:00
Jose Antonio Tubau 7f5224ebca feat: refs #8304 add ACL entries for Business and Worker models and update worker model relationships
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-21 14:45:13 +01:00
Jose Antonio Tubau b20dee8382 feat: refs #8304 add notes field to business model
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-21 12:28:34 +01:00
Jorge Penadés 55a0a5bc9a feat: refs #7119 add delivery role permissions
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-21 11:52:09 +01:00
Jorge Penadés e343e457ee Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-21 10:48:08 +01:00
Jorge Penadés 3d2a7cfb66 feat: refs #7119 update ACLs for vehicle management and refine vehicle filter logic
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-20 18:05:33 +01:00
Jorge Penadés 946d08e543 feat: refs #7119 update ACLs and remove unused models for vehicle management
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-20 17:29:18 +01:00
Javier Segarra 1560c48af2 feat: refs #6321 improve query 2025-01-20 14:32:26 +01:00
Jorge Penadés ecedc84164 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-20 14:28:30 +01:00
Pablo Natek f8a156b7ab feat: refs #6897 add EntryConfig model and enhance entry filtering with new parameters
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-17 08:11:18 +01:00
Carlos Andrés f79bc2a665 Merge branch 'dev' into 7965-unifyProblems
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-15 17:37:32 +00:00
Carlos Andrés 948ad3a752 Merge branch 'dev' into 7965-unifyProblems
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-15 10:16:25 +00:00
Javier Segarra 84dfdcb79a Merge branch 'dev' into 6321_negative_tickets 2025-01-14 12:43:25 +01:00
Jose Antonio Tubau 0e8d9137ed feat: refs #8304 add privilege check for WorkerDms filter method
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-10 13:48:03 +01:00
Jose Antonio Tubau a167e7fada feat: refs #8304 add ACL entry for WorkerDms with high privileges
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-10 13:42:29 +01:00
Carlos Andrés 2d8bda2b56 fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-09 15:46:04 +01:00
Carlos Andrés 09b4b2cf1b fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-09 11:52:30 +01:00
Carlos Andrés 638a8e344d fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-09 10:34:49 +01:00
Carlos Andrés 8f99b14510 fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-09 08:43:14 +01:00
Carlos Andrés 71fcce4ed7 Merge branch 'dev' into 7965-unifyProblems
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-01-09 08:13:42 +01:00
Robert Ferrús eca2ff84ef feat: refs #6702 changes
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-01-02 07:49:49 +01:00
Jorge Penadés bc495ed51e feat: refs #7119 add VehicleNotes model and update vehicle filter SQL query
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-30 17:55:27 +01:00
Jorge Penadés 68e42206c8 feat: refs #7119 enhance vehicle filter method with additional parameters and improve SQL query structure
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-12-30 17:31:56 +01:00
Jorge Penadés e9b0b1b7a3 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-30 15:56:57 +01:00
Jorge Penadés 8a6482ada5 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-30 09:31:19 +01:00
Jorge Penadés 921edb238c feat: refs #7119 add Ppe model and establish relationships in Vehicle model
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-27 16:55:59 +01:00
Jorge Penadés 0de4ce9b3c feat: refs #7119 add BankPolicy and FuelType models
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-27 15:36:19 +01:00
Jorge Penadés 9731d13a9a feat: refs #7119 add updateAttributes ACL
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-27 12:21:46 +01:00
Jorge Penadés 4d7387af18 feat: refs #7119 add deleteById permission for deliveryBoss role in ACL for Vehicle model
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-26 17:52:36 +01:00
Jorge Penadés b01e4894c9 feat: refs #7119 remove vehicleStateFk argument from filter method and simplify search logic
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-26 17:02:37 +01:00
Jorge Penadés f8c1e2aacf feat: refs #7119 add search and filter capabilities to Vehicle model and update related SQL fixtures
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-26 16:36:50 +01:00
Jorge Penadés fffd095ab3 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7119-createVehicle
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-26 09:43:39 +01:00
Jorge Penadés 9aa790ecfd feat: refs #7119 add isKmTruckRate field to Vehicle model and filter
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-24 13:27:32 +01:00
Jorge Penadés 39fc196464 feat: refs #7119 add VehicleEvent and VehicleState models with associated methods and SQL fixtures
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-24 13:01:23 +01:00
Jorge Penadés 086b7aed4b feat: refs #7119 add VehicleState model with data source configuration
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-12-24 10:40:17 +01:00
Robert Ferrús 9b2fb7a430 feat: refs #6702 sale fix Self.ticketWeekly 2024-12-19 11:32:15 +01:00
Robert Ferrús 0652d11112 feat: refs #6702 updatePrice message 2024-12-19 10:29:50 +01:00
Guillermo Bonet a8cf01ca19 refactor: refs #8172 Removed column and row columns
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-12-18 14:36:59 +01:00
Guillermo Bonet 6300795e52 refactor: refs #8172 Created table parkingCoordinates
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-12-18 13:17:47 +01:00
Robert Ferrús 46c4f4786a feat: refs #6702 saleCloned 2024-12-18 12:03:48 +01:00
Javier Segarra 53298bd9ca Merge branch 'dev' into 6321_negative_tickets 2024-12-09 14:24:34 +01:00
Jon Elias 8fedd78938 fix: refs #7965 filter and sales back tests
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-29 12:47:24 +01:00
Jon Elias 568661021a feat: refs #7965 added #6242 back to unify PR
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-29 11:54:53 +01:00
Jon Elias 632c1b2fc7 Merge branch 'dev' of https: refs #7965//gitea.verdnatura.es/verdnatura/salix into 7965-unifyProblems
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-29 11:51:21 +01:00
Carlos Andrés 4e0a81464c fix: test
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-02 15:12:57 +02:00
Carlos Andrés 99c70a533a fix: test
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-10-02 14:25:27 +02:00
Carlos Andrés 5f230ff122 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7965-unifyProblems 2024-10-02 14:23:53 +02:00
Carlos Andrés 6a5cf1a57f fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-10-01 15:46:51 +02:00
Carlos Andrés bb1695eac6 fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-30 16:39:55 +02:00
Carlos Andrés af4d1ad513 Merge branch 'dev' into 7965-unifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-30 14:31:48 +02:00
Carlos Andrés 69cafd5a04 fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-30 14:30:15 +02:00
Javier Segarra 62dd5cb675 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-24 22:12:21 +02:00
Javier Segarra c6490f6740 feat(salix): refs #6321 #6321 fixtures.before 2024-09-24 22:12:11 +02:00
Javier Segarra c876022fe5 feat(salix): refs #6321 #6321 TODO 2024-09-24 13:54:32 +02:00
Javier Segarra 2cb57225ff perf(salix): refs #6321 #7677 itemLackDetail 2024-09-21 00:26:55 +02:00
Carlos Andrés 712bfe7368 fix: refs #7965 UnifyProblems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-19 20:15:38 +02:00
Javier Segarra 5e38d18fed Merge branch 'dev' into 6321_negative_tickets 2024-09-19 09:34:55 +02:00
Javier Segarra a93dd79fe2 Merge branch 'dev' into 6321_negative_tickets 2024-09-19 00:00:42 +02:00
Javier Segarra 36297009e1 perf(salix): refs #6321 #7677 itemLackDetail 2024-09-17 16:43:09 +02:00
Carlos Andrés 750b83bb45 fix: refs #7760 tmp.ticketIPT
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-16 19:03:12 +02:00
Carlos Andrés 91fac11fa0 fix: refs #7760 tmp.ticketIPT 2024-09-16 18:21:12 +02:00
Javier Segarra 03fcabd7f6 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-16 09:58:20 +02:00
Javier Segarra e76e2a15f2 feat(salix): refs #6321 #6321 TODO 2024-09-13 09:44:09 +02:00
Javier Segarra 09a7918ab3 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets 2024-09-13 08:51:28 +02:00
Javier Segarra fb851c3bdd feat: refs #6321 implement VnTable 2024-09-12 13:33:22 +02:00
Javier Segarra 94f99ccee1 fix(salix): refs #6321 #6321 remove ticketMethod clone 2024-09-11 11:58:58 +02:00
Javier Segarra 844e96583b Merge branch 'dev' of https: refs #6321//gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets 2024-09-11 08:45:42 +02:00
Javier Segarra f77163102c Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-07-23 10:43:12 +02:00
Javier Segarra b2d58a1d6f Merge branch 'dev' into 6321_negative_tickets 2024-07-22 17:30:25 +02:00
Javier Segarra 0e97c453ed Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-07-22 16:47:05 +02:00
Javier Segarra 7ec47f2f80 Merge branch 'dev' into 6321_negative_tickets 2024-07-22 10:21:50 +02:00
Javier Segarra c9c9d5973d test(salix): refs #6321 #6321 fix test
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-07-20 00:36:59 +02:00
Javier Segarra 7e8c2eebe5 feat: refs #6321 restore fixtures.before.sql 2024-07-19 19:38:21 +02:00
Javier Segarra 212f84aa9b revert commit 2024-07-19 11:41:33 +02:00
Javier Segarra 48b8bda49a Merge branch 'dev' into 6321_negative_tickets 2024-07-19 09:42:42 +02:00
Javier Segarra ac7c28cd27 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-07-18 22:02:22 +02:00
Javier Segarra 99efdffe58 feat(salix): refs #6321 #6321 retrieve observationType 2024-07-04 09:39:06 +02:00
Javier Segarra 8b72b7211e feat(salix): refs #7380 #7380 new typeObservation
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-07-03 23:06:13 +02:00
Javier Segarra 14e14eea2a feat(salix): refs #7380 #7380 client.substitutionAllowed new field 2024-07-03 23:06:06 +02:00
Javier Segarra b5ea2f12ff Merge remote-tracking branch 'origin/dev' into 6321_negative_tickets 2024-07-03 23:05:42 +02:00
Javier Segarra 37de252e15 Merge branch 'dev' into 6321_negative_tickets 2024-07-02 12:22:35 +02:00
Javier Segarra a1c48974c9 Merge branch 'dev' into 6321_negative_tickets 2024-06-20 12:21:24 +02:00
Javier Segarra e87c8ee5a7 feat(Salix): refs #6321 #6427 change url endpoint 2024-06-18 13:17:29 +02:00
Javier Segarra dba76a4f6b test(Salix): refs #6321 #6321 add default items as Proposal 2024-06-17 12:38:36 +02:00
Javier Segarra e45ac6424c perf(salix): refs #6321 #6321 updates 2024-06-14 11:43:06 +02:00
Javier Segarra ab85b8e703 Merge branch 'dev' into 6321_negative_tickets 2024-06-12 22:37:14 +02:00
Javier Segarra 2cbd610bc2 perf(salix): refs #6321 #7563 add ink.showOrder to procedure 2024-06-12 22:19:59 +02:00
Javier Segarra 02bc3afcda Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-06-11 13:53:30 +02:00
Javier Segarra 64a4a78308 feat(salix): refs #6321 updates 2024-06-10 17:09:25 +02:00
Javier Segarra 149aeac54e Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-06-04 09:26:15 +02:00
Javier Segarra 7468f87808 feat(salix): refs #6321 #6321 improve split mehtod
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-30 07:46:10 +02:00
Javier Segarra aab7a7ec73 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-28 12:45:50 +02:00
Javier Segarra 4fe1d80e7c feat(salix): refs #6321 default value when days is not present 2024-05-24 14:00:41 +02:00
Javier Segarra 8366cfa348 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-24 11:12:52 +02:00
Javier Segarra 70f245fd2d Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-15 16:25:44 +02:00
Javier Segarra 3401f0d745 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-15 08:55:10 +02:00
Javier Segarra befc128950 feat(salix): refs #6321 Sale_itemReplace 2024-05-15 08:36:13 +02:00
Javier Segarra 5c0b25bb30 Merge branch '6321_negative_tickets' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-13 13:51:20 +02:00
Javier Segarra 888f15049a feat(salix): refs #6321 #6321 New arg 2024-05-13 13:51:04 +02:00
Jorge Penadés cfea648103 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-13 13:25:52 +02:00
Javier Segarra e30c66313f Merge branch 'dev' into 6321_negative_tickets 2024-05-08 12:29:06 +02:00
Javier Segarra de7469419a feat(salix): refs #6321 #6321 getSimilar minor update 2024-05-03 07:23:12 +02:00
Javier Segarra 7caea44427 feat(salix): refs #6321 #6321 getSimilar
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-02 13:53:28 +02:00
Javier Segarra 63d07cb082 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-05-02 12:47:59 +02:00
Javier Segarra cb76075bf8 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-29 11:55:39 +02:00
Javier Segarra d638e31a1a Merge branch 'dev' into 6321_negative_tickets 2024-04-23 19:15:45 +02:00
Javier Segarra caaa4fdd30 Merge remote-tracking branch 'origin/dev' into 6321_negative_tickets 2024-04-23 11:45:59 +02:00
Javier Segarra 68158f341d feat(salix): refs #6321 #6331 publish negativeOrigin model 2024-04-22 14:09:27 +02:00
Javier Segarra 5a5032f6e6 Merge remote-tracking branch 'origin/dev' into 6321_negative_tickets 2024-04-22 13:34:06 +02:00
Javier Segarra 41f0b6aa93 Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-16 05:13:35 +00:00
Javier Segarra e0712645a2 refs #6321 test: fix
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-08 12:17:32 +02:00
Javier Segarra 3dd162b683 refs #6321 test: fix
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-08 12:16:07 +02:00
Javier Segarra 25fc39ef2b refs #6321 perf: change descriptions
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-08 11:33:32 +02:00
Javier Segarra 134c468589 Merge branch 'dev' into 6321_negative_tickets 2024-04-08 11:30:48 +02:00
Javier Segarra c4f8734d44 refs #6321 fix: param
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-03 09:48:56 +02:00
Javier Segarra cc3f2da639 refs #6321 perf: minor change
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-02 15:02:33 +02:00
Javier Segarra 586f37afd2 refs #6321 perf: add arguments into procedure 2024-04-02 13:28:26 +02:00
Juanjo Breso 9a80f8c2ce minor change 2024-04-02 10:45:29 +02:00
Javier Segarra d08535ac18 refs #6321 minor changes
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-04-02 08:04:27 +02:00
Javier Segarra 5d24844256 refs #6321 test: debug use TIMEOUT
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-04-01 16:12:52 +02:00
Javier Segarra 601f5db080 refs #6321 test: spliy 2024-04-01 16:11:30 +02:00
Javier Segarra 59498179ec refs #6321 test: itemLackDetail 2024-04-01 14:05:45 +02:00
Javier Segarra d225821a41 refs #6321 test: itemLack
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-04-01 13:59:35 +02:00
Javier Segarra d62c55dc9f refs #6321 test: negativeOrigin 2024-04-01 13:11:58 +02:00
Javier Segarra 2cff160c6a Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-28 23:50:51 +00:00
Javier Segarra 65a6174e2b refs #6321 updates
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-28 12:01:06 +01:00
Javier Segarra e6fe245b27 refs #6321 feat: new split method
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-27 14:09:25 +01:00
Javier Segarra d8d0ced918 Merge branch 'dev' into 6321_negative_tickets 2024-03-27 09:54:02 +01:00
Javier Segarra a943e39ba7 refs #6321 feat: negativeOrigin 2024-03-22 22:44:37 +01:00
Javier Segarra e085bc7f1e Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-21 07:47:39 +01:00
Javier Segarra 44c4e6a16e Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-15 09:47:10 +01:00
Javier Segarra 6c0706cc56 refs #6321 perf: query to retrieve results 2024-03-15 09:33:06 +01:00
Javier Segarra f83f7808c8 refs #6321 feat: negativeOrigin method 2024-03-15 09:32:36 +01:00
Javier Segarra 6a12af2eb9 refs #6321 feat: add producerFk
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-14 15:26:30 +01:00
Javier Segarra ed6b25455b refs #5858 feat: improve itemLackDetail 2024-03-13 14:27:45 +01:00
Javier Segarra c8446eb9a1 refs #6321 perf: updatemethod
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-13 09:20:32 +01:00
Javier Segarra d1e7e13333 refs #6321 feat: acl
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-06 14:37:28 +01:00
Javier Segarra 7c8fa52da0 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets 2024-03-06 14:30:02 +01:00
Javier Segarra 871447cc6e refs #6321 feat: updates
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-03-05 08:07:54 +01:00
Javier Segarra bc09ad7da7 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets 2024-01-29 11:07:31 +01:00
Javier Segarra 1a21dda00b refs #6321 feat itemLackDetail
gitea/salix/pipeline/head There was a failure building this commit Details
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-01-29 09:55:44 +01:00
Javier Segarra 895d9bff64 refs #6321 feat itemLAck with SQL 2024-01-29 09:55:34 +01:00
Javier Segarra f49444c19f Merge branch '6321_negative_tickets' of https://gitea.verdnatura.es/verdnatura/salix into 6321_negative_tickets
gitea/salix/pipeline/head There was a failure building this commit Details
2024-01-23 09:42:59 +01:00
Javier Segarra 48d9a3934a Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/head This commit looks good Details
2024-01-22 19:29:47 +00:00
Javier Segarra 2bcb6366b2 refs #6321 feat: vCustomWhere 2024-01-22 10:10:38 +01:00
Javier Segarra 0111aa1b75 refs #6321 feat: fixtures and update procedure 2024-01-22 09:56:10 +01:00
Javier Segarra 91f5ee3b93 refs #6321 feat: new remoteMethod
gitea/salix/pipeline/head This commit looks good Details
2024-01-20 12:29:41 +01:00
126 changed files with 5332 additions and 2973 deletions

View File

@ -13,6 +13,7 @@ RUN apt-get update \
graphicsmagick \ graphicsmagick \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \ && apt-get install -y --no-install-recommends nodejs \
&& npm install -g corepack@0.31.0 \
&& corepack enable pnpm && corepack enable pnpm
# Puppeteer # Puppeteer

View File

@ -33,25 +33,52 @@ module.exports = Self => {
const emailUser = const emailUser =
await Self.app.models.EmailUser.findById(userId, {fields: ['email']}); await Self.app.models.EmailUser.findById(userId, {fields: ['email']});
let html = `<h2>Motivo: ${reason}</h2>`; const tableStyle = 'width:100%; border-collapse: collapse; text-align: left;';
html += `<h3>Usuario: ${userId} ${emailUser.email}</h3>`; const thStyle = 'padding: 8px; border: 1px solid #ddd; background-color: #f4f4f4;';
html += `<h3>Additional Data:</h3>`; const tdStyle = 'padding: 8px; border: 1px solid #ddd;';
html += '<ul>'; const tdBoldStyle = 'padding: 8px; border: 1px solid #ddd; font-weight: bold;';
const subTdStyle = 'padding: 6px; border: 1px solid #ddd;';
const subTdBoldStyle = 'padding: 6px; border: 1px solid #ddd; font-weight: bold;';
let html = `
<h2>Motivo: ${reason}</h2>
<h3>Usuario: ${userId} ${emailUser.email}</h3>
<h3>Additional Data:</h3>
<table style="${tableStyle}">
<thead>
<tr>
<th style="${thStyle}">Clave</th><th style="${thStyle}">Valor</th></tr>
</thead>
<tbody>`;
for (const [key, val] of Object.entries(additionalData)) { for (const [key, val] of Object.entries(additionalData)) {
if (key !== 'config') html += `<li>${key}: ${parse(val)}</li>`; if (key !== 'config') {
else { html += `<tr>
html += `<li>${key}:</li><ul style="list-style-type: square;">`; <td style="${tdBoldStyle}">${key}</td>
for (const [confKey, confVal] of Object.entries(val)) <td style="${tdStyle}">${parse(val)}</td>
html += `<li>${confKey}: ${parse(confVal)}</li>`; </tr>`;
html += '</ul>'; } else {
html += `<tr>
<td style="${tdBoldStyle}">${key}</td>
<td style="${tdStyle}">
<table style="${tableStyle}">
<tbody>`;
for (const [confKey, confVal] of Object.entries(val)) {
html += `<tr>
<td style="${subTdBoldStyle}">${confKey}</td>
<td style="${subTdStyle}">${parse(confVal)}</td>
</tr>`;
}
html += `</tbody></table></td></tr>`;
} }
} }
html += '</ul>'; html += `</tbody></table>`;
const {message, path, name} = additionalData; const {message, path, name} = additionalData;
const err = name && message ? `${name}: ${message}` : name || message || '';
await smtp.send({ await smtp.send({
to: `${config.app.reportEmail}, ${emailUser.email}`, to: `${config.app.reportEmail}, ${emailUser.email}`,
subject: `[Support-Salix] ${path} ${name}: ${message}`, subject: `[Support-Salix] ${path.split('?')[0]} ${err}`,
html html
}); });
}; };

View File

@ -54,7 +54,8 @@
"type": "string" "type": "string"
}, },
"hasGrant": { "hasGrant": {
"type": "boolean" "type": "boolean",
"default": false
}, },
"passExpired": { "passExpired": {
"type": "date" "type": "date"
@ -168,6 +169,7 @@
"emailVerified", "emailVerified",
"twoFactor" "twoFactor"
] ]
} }
} }
} }

View File

@ -77,8 +77,8 @@ INSERT INTO `vn`.`agency` (`name`, `warehouseFk`, `isOwn`, `isAnyVolumeAllowed`)
('Otra agencia ', '1', '0', '0'); ('Otra agencia ', '1', '0', '0');
INSERT INTO `vn`.`expedition` (`agencyModeFk`, `ticketFk`, `isBox`, `counter`, `workerFk`, `externalId`, `packagingFk`, `hostFk`, `itemPackingTypeFk`, `hasNewRoute`) VALUES INSERT INTO `vn`.`expedition` (`agencyModeFk`, `ticketFk`, `isBox`, `counter`, `workerFk`, `externalId`, `packagingFk`, `hostFk`, `itemPackingTypeFk`, `hasNewRoute`) VALUES
('1', '1', 1, '1', '1', '1', '1', 'pc00', 'F', 0), ('1', '1', 1, '1', '1', '1', '1', 'pc1', 'F', 0),
('1', '1', 1, '2', '1', '1', '1', 'pc00', 'F', 0); ('1', '1', 1, '2', '1', '1', '1', 'pc1', 'F', 0);
INSERT INTO vn.client (id,name,defaultAddressFk,street,fi,email,dueDay,isTaxDataChecked,accountingAccount,city,provinceFk,postcode,socialName,contact,credit,countryFk,quality,riskCalculated) VALUES INSERT INTO vn.client (id,name,defaultAddressFk,street,fi,email,dueDay,isTaxDataChecked,accountingAccount,city,provinceFk,postcode,socialName,contact,credit,countryFk,quality,riskCalculated) VALUES
(100,'root',110,'Valle de la muerte','74974747G','root@mydomain.com',0,1,'4300000078','ALGEMESI',1,'46680','rootSocial','rootContact',500.0,1,10,'2025-01-01'); (100,'root',110,'Valle de la muerte','74974747G','root@mydomain.com',0,1,'4300000078','ALGEMESI',1,'46680','rootSocial','rootContact',500.0,1,10,'2025-01-01');

View File

@ -214,15 +214,15 @@ INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`,`bossFk`, `phone
(1109, 'HLK', 'Bruce' , 'Banner', 19, 432978109), (1109, 'HLK', 'Bruce' , 'Banner', 19, 432978109),
(1110, 'JJJ', 'Jessica' , 'Jones' , 19, 432978110); (1110, 'JJJ', 'Jessica' , 'Jones' , 19, 432978110);
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`) INSERT INTO `vn`.`parking` (`id`, `sectorFk`, `code`, `pickingOrder`)
VALUES VALUES
('1', 700, '01', 1, '700-01', 70001), ('1', 1, '700-01', 70001),
('2', 700, '02', 2, '700-02', 70002), ('2', 2, '700-02', 70002),
('3', 100, '01', 1, '100-01', 1), ('3', 1, '100-01', 1),
(32397, 100, '02', 1, 'A-47-1', 1165), (32397, 1, 'A-47-1', 1165),
(34831, 200, '01', 1, 'K-26-2', 20220), (34831, 1, 'K-26-2', 20220),
(34965, 200, '02', 2, 'L-08-4', 21800), (34965, 2, 'L-08-4', 21800),
(39096, 200, '03', 2, 'LR-02-3', 99999); (39096, 2, 'LR-02-3', 99999);
INSERT INTO `vn`.`shelving` (`code`, `parkingFk`, `isPrinted`, `priority`, `userFk`, `isRecyclable`) INSERT INTO `vn`.`shelving` (`code`, `parkingFk`, `isPrinted`, `priority`, `userFk`, `isRecyclable`)
VALUES VALUES
@ -798,7 +798,8 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF
(34, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1103, 'BEJAR', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL), (34, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1103, 'BEJAR', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
(35, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Somewhere in Philippines', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL), (35, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Somewhere in Philippines', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
(36, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Ant-Man Adventure', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL), (36, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Ant-Man Adventure', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
(37, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1110, 'Deadpool swords', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL); (37, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1110, 'Deadpool swords', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
(1000000, NULL, 1, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1, 'employee', 131, NULL, 0, 1, 1.00, 0.00, CURDATE(), NULL, NULL, '', NULL);
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`) INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
VALUES VALUES
@ -854,14 +855,15 @@ INSERT INTO `vn`.`deliveryPoint` (`id`, `name`, `ubication`)
VALUES VALUES
(1, 'Gotham','1007 Mountain Drive, Gotham'); (1, 'Gotham','1007 Mountain Drive, Gotham');
INSERT INTO `vn`.`vehicle`(`id`, `numberPlate`, `tradeMark`, `model`, `companyFk`, `warehouseFk`, `description`, `m3`, `isActive`, `deliveryPointFk`) INSERT INTO `vn`.`vehicle`(`id`, `numberPlate`, `tradeMark`, `model`, `companyFk`, `warehouseFk`, `description`, `m3`, `isActive`, `deliveryPointFk`, `chassis`, `leasing`, `supplierFk`, `fuelTypeFk`, `bankPolicyFk`)
VALUES VALUES
(1, '3333-BAT', 'WAYNE INDUSTRIES', 'BATMOBILE', 442, 1, 'The ultimate war machine', 50, 1, 1), (1, '3333-BAT', 'WAYNE INDUSTRIES', 'BATMOBILE', 442, 1, 'The ultimate war machine', 50, 1, 1, 'XCSC133C60', 'Wayne leasing', 1, 1, 1),
(2, '1111-IMK', 'STARK INDUSTRIES', 'MARK-III', 442, 1, 'Iron-Man Heavy Armor MARK-III', 18, 1, 1), (2, '1111-IMK', 'STARK INDUSTRIES', 'MARK-III', 442, 1, 'Iron-Man Heavy Armor MARK-III', 18, 1, 1, '', '', 2, 2, 2),
(3, '2222-IMK', 'STARK INDUSTRIES', 'MARK-VI', 442, 1, 'Iron-Man Heavy Armor MARK-VI', 16, 1, 1), (3, '2222-IMK', 'STARK INDUSTRIES', 'MARK-VI', 442, 1, 'Iron-Man Heavy Armor MARK-VI', 16, 1, 1, '', '', 442, 2, null),
(4, '3333-IMK', 'STARK INDUSTRIES', 'MARK-VII', 442, 1, 'Iron-Man Heavy Armor MARK-VII', 14, 1, 1), (4, '3333-IMK', 'STARK INDUSTRIES', 'MARK-VII', 442, 1, 'Iron-Man Heavy Armor MARK-VII', 14, 1, 1, '', '', 442, 3, null),
(5, '4444-IMK', 'STARK INDUSTRIES', 'MARK-XLII', 442, 1, 'Iron-Man Heavy Armor MARK-XLII', 13, 1, 1), (5, '4444-IMK', 'STARK INDUSTRIES', 'MARK-XLII', 442, 1, 'Iron-Man Heavy Armor MARK-XLII', 13, 1, 1, '', '', 442, 4, null),
(6, '5555-IMK', 'STARK INDUSTRIES', 'MARK-XLV', 442, 1, 'Iron-Man Heavy Armor MARK-XLV', 12, 0, 1); (6, '5555-IMK', 'STARK INDUSTRIES', 'MARK-XLV', 442, 1, 'Iron-Man Heavy Armor MARK-XLV', 12, 0, 1, '', '', 442, 5, null),
(7, '5555-SHI', 'SHIELD', 'Quinjet', 442, 1, 'High-speed jet used by the Avengers', 30, 1, 1, 'QJ12345', 'SHIELD leasing', 1, 1, 1);
INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`, `inventoried`) INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`, `inventoried`)
VALUES VALUES
@ -922,17 +924,18 @@ INSERT INTO `vn`.`itemType`(`id`, `code`, `name`, `categoryFk`, `life`, `workerF
(5, 'CON', 'Container', 3, NULL, 35, 1, 'warm', 0), (5, 'CON', 'Container', 3, NULL, 35, 1, 'warm', 0),
(6, 'ALS', 'Alstroemeria', 1, 31, 16, 0, 'warm', 1); (6, 'ALS', 'Alstroemeria', 1, 31, 16, 0, 'warm', 1);
INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`, `hex`) INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`, `hex`, `hexJson`)
VALUES VALUES
('YEL', 'Yellow', 1, 1, 'F4D03F'), ('YEL', 'Yellow', 1, 1, 'F4D03F', '{"value": ["F4D03F"]}'),
('BLU', 'Blue', 1, 2, '5DADE2'), ('BLU', 'Blue', 1, 2, '5DADE2', '{"value": ["5DADE2"]}'),
('RED', 'Red', 1, 3, 'EC7063'), ('RED', 'Red', 1, 3, 'EC7063', '{"value": ["EC7063"]}'),
('SLV', 'Silver', 1, 4, 'CACFD2'), ('SLV', 'Silver', 1, 4, 'CACFD2', '{"value": ["CACFD2"]}'),
('BRW', 'Brown', 1, 5, 'DC7633'), ('BRW', 'Brown', 1, 5, 'DC7633', '{"value": ["DC7633"]}'),
('BLK', 'Black', 1, 6, '000000'), ('BLK', 'Black', 1, 6, '000000', '{"value": ["000000"]}'),
('BAS', 'Blue/Silver', 1, 7, '5DADE2'), ('BAS', 'Blue/Silver', 1, 7, '5DADE2', '{"value": ["5DADE2"]}'),
('GRN', 'Green', 1, 8, '28A745'), ('GRN', 'Green', 1, 8, '28A745', '{"value": ["28A745"]}'),
('WHT', 'White', 1, 9, 'FFFFFF'); ('WHT', 'White', 1, 9, 'FFFFFF', '{"value": ["FFFFFF"]}'),
('RGB', 'Red/Green/Blue', 1, 9, 'FFFFFF', '{"value": ["EC7063","5DADE2","28A745"]}');
INSERT INTO `vn`.`origin`(`id`,`code`, `name`) INSERT INTO `vn`.`origin`(`id`,`code`, `name`)
VALUES VALUES
@ -982,26 +985,28 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`)
INSERT INTO `vn`.`item`( INSERT INTO `vn`.`item`(
`id`, `typeFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenseFk`, `id`, `typeFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenseFk`,
`comment`, `relevancy`, `image`, `subName`, `minPrice`, `family`, `isFloramondo`, `genericFk`, `comment`, `relevancy`, `image`, `subName`, `minPrice`, `family`, `isFloramondo`, `genericFk`,
`itemPackingTypeFk`, `hasMinPrice`, `weightByPiece`, `isCustomInspectionRequired` `itemPackingTypeFk`, `hasMinPrice`, `packingOut`, `weightByPiece`, `isCustomInspectionRequired`
) )
VALUES VALUES
(1, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 'EMB', 0, NULL, 'V', 0, 3, 1), (1, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 'EMB', 0, NULL, 'V', 0, NULL, 3, 1),
(2, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 'VT', 0, NULL, 'H', 0, 2, 1), (2, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 'VT', 0, NULL, 'H', 0, NULL, 2, 1),
(3, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 'VT', 0, NULL, NULL, 0, 5, 0), (3, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 5, 0),
(4, 1, 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0), (4, 1, 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, NULL, 0),
(5, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0), (5, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, NULL, 0),
(6, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0), (6, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, NULL, 0),
(7, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0), (7, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, NULL, 0),
(8, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', 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, NULL, 0),
(9, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL, 0), (9, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL, NULL, 0),
(10, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', 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, NULL, 0),
(11, 1, 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', 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, NULL, 0),
(12, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', 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, NULL, 0),
(13, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 'VT', 1, NULL, NULL, 1, NULL, 0), (13, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 'VT', 1, NULL, NULL, 1, NULL, NULL, 0),
(14, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL, 0), (14, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL, NULL, 0),
(15, 4, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL, 0), (15, 4, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL, NULL, 0),
(16, 6, 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, NULL, 0),
(71, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, 0); (71, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL, NULL, 0),
(72, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, NULL, NULL, 1, 'VT', 0, NULL, NULL, 1, 1, NULL, 0),
(88, 1, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, NULL, NULL,10, 'VT', 0, NULL, NULL, 1, NULL, NULL, 0);
-- Update the taxClass after insert of the items -- Update the taxClass after insert of the items
@ -1090,12 +1095,12 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
(5, 1, 2, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'), (5, 1, 2, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
(6, 1, 3, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 'hasComponentLack'), (6, 1, 3, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 'hasComponentLack'),
(7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.74, 0, 0, 0, util.VN_CURDATE(), NULL), (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.74, 0, 0, 0, util.VN_CURDATE(), NULL),
(8, 4, 11, 'Melee weapon heavy shield 100cm', 10, 1.79, 0, 0, 0, util.VN_CURDATE(), NULL), (8, 4, 11, 'Melee weapon heavy shield 100cm', 10, 1.79, 0, 0, 0, util.VN_CURDATE(), 'hasItemLost,hasRounding'),
(9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), (9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
(10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE(), NULL), (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE(), NULL),
(11, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), (11, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
(12, 4, 16, 'Melee weapon heavy shield 100cm', 20, 1.71, 0, 0, 0, util.VN_CURDATE(), NULL), (12, 4, 16, 'Melee weapon heavy shield 100cm', 20, 1.71, 0, 0, 0, util.VN_CURDATE(), NULL),
(13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE(), NULL), (13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE(), 'hasItemLost'),
(14, 1, 8, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), (14, 1, 8, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
(15, 1, 19, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), (15, 1, 19, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
(16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
@ -1106,25 +1111,26 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
(21, 1, 6, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'), (21, 1, 6, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
(22, 1, 7, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (22, 1, 7, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
(23, 1, 9, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (23, 1, 9, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
(24, 1, 10, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (24, 1, 10, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasItemShortage,hasComponentLack'),
(25, 4, 12, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (25, 4, 12, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasItemLost'),
(26, 4, 13, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (26, 4, 13, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasItemLost'),
(27, 4, 14, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (27, 4, 14, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasItemShortage,hasComponentLack,hasItemLost'),
(28, 4, 15, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (28, 4, 15, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasItemLost'),
(29, 4, 17, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (29, 4, 17, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasItemShortage,hasComponentLack'),
(30, 4, 18, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (30, 4, 18, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasItemShortage,hasComponentLack'),
(31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE(), NULL), (31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE(), 'hasRounding'),
(32, 1, 24, 'Ranged weapon longbow 200cm', -1, 8.07, 0, 0, 0, util.VN_CURDATE(), NULL), (32, 1, 24, 'Ranged weapon longbow 200cm', -1, 8.07, 0, 0, 0, util.VN_CURDATE(), NULL),
(33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE(), NULL), (33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE(), NULL),
(34, 4, 28, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (34, 4, 28, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasItemLost'),
(35, 4, 29, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (35, 4, 29, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasItemLost'),
(37, 4, 31, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), NULL), (37, 4, 31, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), NULL),
(36, 4, 30, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (36, 4, 30, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasItemLost'),
(38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 'hasComponentLack'), (38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 'hasComponentLack'),
(39, 1, 32, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (39, 1, 32, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
(40, 2, 34, 'Melee weapon combat fist 15cm', 10.00, 3.91, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (40, 2, 34, 'Melee weapon combat fist 15cm', 10.00, 3.91, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasItemLost'),
(41, 2, 35, 'Melee weapon combat fist 15cm', 8.00, 3.01, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'), (41, 2, 35, 'Melee weapon combat fist 15cm', 8.00, 3.01, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasRounding,hasItemLost'),
(42, 2, 36, 'Melee weapon combat fist 15cm', 6.00, 2.50, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'); (42, 2, 36, 'Melee weapon combat fist 15cm', 6.00, 2.50, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack,hasRounding,hasItemLost'),
(43, 88, 1000000, 'Chest medical box 2', 15.00, 10.00, 0, 0, 0, CURDATE(), '');
INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`) INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
VALUES VALUES
@ -1456,7 +1462,21 @@ INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
(98, 14, 23, '1', 7), (98, 14, 23, '1', 7),
(99, 15, 92, 'Trolley', 2), (99, 15, 92, 'Trolley', 2),
(100, 16, 92, 'Pallet', 2), (100, 16, 92, 'Pallet', 2),
(101, 71, 92, 'Shipping cost', 2); (101, 71, 92, 'Shipping cost', 2),
(102, 88, 56, 'Chest', 1),
(103, 88, 58, 'ammo box', 2),
(104, 88, 27, '100cm', 3),
(105, 88, 36, 'Stark Industries', 4),
(106, 88, 1, 'White', 5),
(107, 88, 67, 'supply', 6),
(108, 88, 23, '13', 7),
(109, 72, 56, 'Mistic weapon', 1),
(110, 72, 58, 'Stormbreaker', 2),
(111, 72, 27, '200cm', 3),
(112, 72, 36, 'Stark Industries', 4),
(113, 72, 1, 'Red/Green/Blue', 5),
(114, 72, 67, '-1 precission', 6),
(115, 72, 23, '1', 7);
INSERT INTO `vn`.`itemTypeTag`(`id`, `itemTypeFk`, `tagFk`, `priority`) INSERT INTO `vn`.`itemTypeTag`(`id`, `itemTypeFk`, `tagFk`, `priority`)
VALUES VALUES
@ -1526,7 +1546,8 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
(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); (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),
(14, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE() + INTERVAL 1 DAY, 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
@ -1542,10 +1563,11 @@ INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed
(10, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2010', '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 -2 MONTH), 1, 1, 442, 'IN2011', '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'), (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'),
(100, 1, util.VN_CURDATE() , 14, 0, 442, 'IN2009','Movement 100',0, '', 'product');
INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `defaultSupplierFk`) INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `maxLockTime`, `defaultSupplierFk`)
VALUES (2, 4, 1); VALUES (2, 4, 300, 1);
INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWasteQuantity`, `saleExternalWaste`, `saleFaultWaste`, `saleContainerWaste`, `saleBreakWaste`, `saleOtherWaste`) INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWasteQuantity`, `saleExternalWaste`, `saleFaultWaste`, `saleContainerWaste`, `saleBreakWaste`, `saleOtherWaste`)
VALUES VALUES
@ -1565,26 +1587,35 @@ INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `sal
('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 6, 1, '186', '0', '51', '53.12', '56.20', '56.20', '56.20'), ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 6, 1, '186', '0', '51', '53.12', '56.20', '56.20', '56.20'),
('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 7, 1, '277', '0', '53.12', '56.20', '56.20', '56.20', '56.20'); ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 7, 1, '277', '0', '53.12', '56.20', '56.20', '56.20', '56.20');
INSERT INTO vn.buy(id,entryFk,itemFk,buyingValue,quantity,packagingFk,stickers,freightValue,packageValue,comissionValue,packing,grouping,groupingMode,location,price1,price2,price3,printedStickers,isChecked,isIgnored,weight,created) INSERT INTO edi.supplier (supplier_id,company_name,entry_date,expiry_date,change_date_time,isAllowedDirectSales,isBanned)
VALUES (1,'MV', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 1, 0);
INSERT INTO edi.ekt (id,`ref`,qty,pro,pri,ok,scanned)
VALUES (1, 1234, 1, 1, 1.1, 1, 1);
INSERT INTO vn.buy(id,entryFk,itemFk,buyingValue,quantity,packagingFk,stickers,freightValue,packageValue,comissionValue,packing,grouping,groupingMode,location,price1,price2,price3,printedStickers,isChecked,isIgnored,ektFk,weight,created)
VALUES VALUES
(1, 1, 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), ( 1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, NULL, 1, util.VN_CURDATE() - INTERVAL 2 MONTH),
(2, 2, 1, 50, 100, 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 1 MONTH), ( 2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, NULL, 1, util.VN_CURDATE() - INTERVAL 1 MONTH),
(3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, NULL, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE()), ( 3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, NULL, NULL, 0.00, 99.6, 99.4, 0, 1, 0, NULL, 1, util.VN_CURDATE()),
(4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, NULL, NULL, 0.00, 7.30, 7.00, 0, 1, 0, 2.5, util.VN_CURDATE()), ( 4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, NULL, NULL, 0.00, 7.30, 7.00, 0, 1, 0, NULL, 2.5, util.VN_CURDATE()),
(5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, NULL, NULL, 0.00, 78.3, 75.6, 0, 1, 0, 2.5, util.VN_CURDATE()), ( 5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, NULL, NULL, 0.00, 78.3, 75.6, 0, 1, 0, NULL, 2.5, util.VN_CURDATE()),
(6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 'grouping', NULL, 0.00, 99.6, 99.4, 0, 1, 0, 2.5, util.VN_CURDATE()), ( 6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 'grouping', NULL, 0.00, 99.6, 99.4, 0, 1, 0, NULL, 2.5, util.VN_CURDATE()),
(7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 'packing', NULL, 0.00, 30.50, 29.00, 0, 1, 0, 2.5, util.VN_CURDATE()), ( 7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 'packing', NULL, 0.00, 30.50, 29.00, 0, 1, 0, NULL, 2.5, util.VN_CURDATE()),
(8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 2.5, util.VN_CURDATE()), ( 8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, NULL, 2.5, util.VN_CURDATE()),
(9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()), ( 9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, NULL, 4, util.VN_CURDATE()),
(10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, 4, util.VN_CURDATE()), (10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, NULL, 4, util.VN_CURDATE()),
(11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()), (11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, NULL, 4, util.VN_CURDATE()),
(12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()), (12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, NULL, 4, util.VN_CURDATE()),
(13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, 4, util.VN_CURDATE()), (13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 'packing', NULL, 0.00, 99.6, 99.4, 0, 1, 0, NULL, 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()), (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, NULL, 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, NULL, 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, NULL, 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, NULL, 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); (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, NULL, 1, util.VN_CURDATE() - INTERVAL 2 MONTH),
(19, 100, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'grouping', NULL, 0.00, 99.6, 99.4, 0, 1, 0, NULL, 1, util.VN_CURDATE()),
(20, 100, 2, 5, 450, 3, 2, 1.000, 1.000, 0.000, 10, 10, NULL, NULL, 0.00, 7.30, 7.00, 0, 1, 0, NULL, 2.5, util.VN_CURDATE()),
(21, 100,72, 55, 500, 5, 3, 1.000, 1.000, 0.000, 1, 1, 'packing', NULL, 0.00, 78.3, 75.6, 0, 1, 0, 1, 3, util.VN_CURDATE()),
(10000002, 12,88, 50.0000, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'grouping', NULL, 0.00, 99.60, 99.40, 0, 1, 0, 1.00, 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
@ -2754,11 +2785,11 @@ INSERT INTO `vn`.`roadmapAddress` (`addressFk`)
(3), (3),
(4); (4);
INSERT INTO `vn`.`roadmap` (`id`, `name`, `tractorPlate`, `trailerPlate`, `phone`, `supplierFk`, `etd`, `eta`, `observations`, `editorFk`, `price`, `driverName`) INSERT INTO `vn`.`roadmap` (`id`, `name`, `tractorPlate`, `trailerPlate`, `phone`, `supplierFk`, `etd`, `observations`, `editorFk`, `price`, `driverName`)
VALUES VALUES
(1, 'val-algemesi', '1234-BCD', '9876-BCD', '111111111', 1, util.VN_NOW(), DATE_ADD(util.VN_NOW(), INTERVAL 2 DAY), 'this is test observation', 1, 15, 'Batman'), (1, 'val-algemesi', '1234-BCD', '9876-BCD', '111111111', 1, util.VN_NOW(), 'this is test observation', 1, 15, 'Batman'),
(2, 'alg-valencia', '2345-CDF', '8765-BCD', '111111111', 1, util.VN_NOW(), DATE_ADD(util.VN_NOW(), INTERVAL 5 DAY), 'test observation', 1, 20, 'Robin'), (2, 'alg-valencia', '2345-CDF', '8765-BCD', '111111111', 1, util.VN_NOW(), 'test observation', 1, 20, 'Robin'),
(3, 'alz-algemesi', '3456-DFG', '7654-BCD', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 3 DAY), DATE_ADD(util.VN_NOW(), INTERVAL 6 DAY), 'observations...', 2, 25, 'Driverman'); (3, 'alz-algemesi', '3456-DFG', '7654-BCD', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 3 DAY), 'observations...', 2, 25, 'Driverman');
INSERT INTO `vn`.`roadmapStop` (`id`, `roadmapFk`, `roadmapAddressFk`, `eta`, `description`, `editorFk`) INSERT INTO `vn`.`roadmapStop` (`id`, `roadmapFk`, `roadmapAddressFk`, `eta`, `description`, `editorFk`)
VALUES VALUES
@ -4071,3 +4102,43 @@ UPDATE vn.worker
SET isFreelance=1 SET isFreelance=1
WHERE firstName='deliveryFreelancer'; WHERE firstName='deliveryFreelancer';
INSERT INTO vn.vehicleState (state, hasToNotify)
VALUES
('Operativo', NULL),
('Prestado', NULL),
('Robado', NULL),
('Taller', NULL),
('Targeta SOLRED', NULL),
('Via T SOLRED', NULL),
('ITV', NULL);
INSERT INTO vn.vehicleEvent (started, finished, vehicleStateFk, description, vehicleFk, userFk, notified)
VALUES
('2000-12-01', '2000-12-02', 4, 'cambio de aceite', 5, 103, NULL),
('2000-12-15', '2000-12-18', 2, 'viaje fin de curso', 5, 103, NULL),
('2000-12-20', '2001-01-01', 3, 'llaves puestas', 2, 103, NULL);
INSERT INTO vn.fuelType (id, name, code)
VALUES
(1, 'gasoil', 'gasoil'),
(2, 'gas', 'gas'),
(3, 'adblue', 'adblue'),
(4, 'gasolina', 'gasolina'),
(5, 'gasoil-frigo', 'gasoil-frigo'),
(6, 'electrico', 'electric');
INSERT INTO vn.bankPolicy (id, `ref`, amount, committedFee, nonCommittedFee, annualFee, started, ended, accountingFk, companyFk, supplierFk, description, hasGuarantee, dmsFk, notaryFk, currencyFk, amortizationTypeFk, periodicityTypeFk, insuranceExpired)
VALUES
(1, '11112222', 500000.0, 0.028, 0.0, 0.001, '2001-01-01', '2001-02-01', 1, 442, NULL, NULL, 0, NULL, NULL, 1, NULL, NULL, NULL),
(2, '33334444', 100000.0, 0.017, 0.0, 0.0, '2001-01-01', '2001-02-01', 1, 2, NULL, NULL, 0, NULL, NULL, 2, NULL, NULL, NULL);
INSERT INTO vn.ppe (id, amortization, firstAmortizated, lastAmortizated, finished, value, planFk, groupFk, account, endowment, elementAccount, nature, location, discharged, cause, isInvestmentAsset, workerFk, companyFk, description, isDone)
VALUES
(1, 0.00, '2001-01-01', NULL, NULL, 700.95, 16, 4, '3456000000', '4320000000', '12345', 'INMOVILIZADO', 'V02', NULL, NULL, 0, NULL, 442, 'UTILLAJE LASER ROTATIVO AUTONIVELANTE 500M', NULL),
(2, 0.00, '2001-01-01', NULL, NULL, 400.00, 16, 4, '5678000000', '1230000000', '67891', 'INMOVILIZADO', 'V02', NULL, NULL, 0, NULL, 442, 'UTILLAJE BALANZA Z100 150KILOS', NULL);
INSERT IGNORE INTO vn.vehicleType (id, name)
VALUES (1,'vehículo empresa'),
(2, 'furgoneta'),
(3, 'cabeza tractora'),
(4, 'remolque');

View File

@ -89,12 +89,12 @@ proc: BEGIN
AND (ir.ended IS NULL OR i.shipped <= ir.ended) AND (ir.ended IS NULL OR i.shipped <= ir.ended)
AND i.warehouseFk = vWarehouse AND i.warehouseFk = vWarehouse
UNION ALL UNION ALL
SELECT i.itemFk, i.landed, i.quantity SELECT i.itemFk, IFNULL(i.availabled, i.landed), i.quantity
FROM vn.itemEntryIn i FROM vn.itemEntryIn i
JOIN itemRange ir ON ir.itemFk = i.itemFk JOIN itemRange ir ON ir.itemFk = i.itemFk
WHERE i.landed >= vStartDate WHERE IFNULL(i.availabled, i.landed) >= vStartDate
AND IFNULL(i.availabled, i.landed) <= vAvailabled AND IFNULL(i.availabled, i.landed) <= vAvailabled
AND (ir.ended IS NULL OR i.landed <= ir.ended) AND (ir.ended IS NULL OR IFNULL(i.availabled, i.landed) <= ir.ended)
AND i.warehouseInFk = vWarehouse AND i.warehouseInFk = vWarehouse
UNION ALL UNION ALL
SELECT i.itemFk, i.shipped, i.quantity SELECT i.itemFk, i.shipped, i.quantity

View File

@ -19,13 +19,15 @@ BEGIN
* @return tmp.ticketComponentPrice * @return tmp.ticketComponentPrice
*/ */
DECLARE vAvailableCalc INT; DECLARE vAvailableCalc INT;
DECLARE vAvailableNoRaidsCalc INT; DECLARE vAvailabled DATETIME;
DECLARE vDone BOOL;
DECLARE vHour INT;
DECLARE vShipped DATE; DECLARE vShipped DATE;
DECLARE vWarehouseFk SMALLINT; DECLARE vWarehouseFk SMALLINT;
DECLARE vZoneFk INT; DECLARE vZoneFk INT;
DECLARE vDone BOOL;
DECLARE cTravelTree CURSOR FOR DECLARE cTravelTree CURSOR FOR
SELECT zoneFk, warehouseFk, shipped FROM tmp.zoneGetShipped; SELECT zoneFk, warehouseFk, shipped, `hour` FROM tmp.zoneGetShipped;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
@ -66,14 +68,15 @@ BEGIN
OPEN cTravelTree; OPEN cTravelTree;
l: LOOP l: LOOP
SET vDone = FALSE; SET vDone = FALSE;
FETCH cTravelTree INTO vZoneFk, vWarehouseFk, vShipped; FETCH cTravelTree INTO vZoneFk, vWarehouseFk, vShipped, vHour;
SET vAvailabled = vShipped + INTERVAL HOUR(vHour) HOUR;
IF vDone THEN IF vDone THEN
LEAVE l; LEAVE l;
END IF; END IF;
CALL `cache`.available_refresh(vAvailableCalc, FALSE, vWarehouseFk, vShipped); CALL `cache`.available_refresh(vAvailableCalc, FALSE, vWarehouseFk, vAvailabled);
CALL `cache`.availableNoRaids_refresh(vAvailableNoRaidsCalc, FALSE, vWarehouseFk, vShipped);
CALL buy_getUltimate(NULL, vWarehouseFk, vShipped); CALL buy_getUltimate(NULL, vWarehouseFk, vShipped);
INSERT INTO tmp.ticketLot (warehouseFk, itemFk, available, buyFk, zoneFk) INSERT INTO tmp.ticketLot (warehouseFk, itemFk, available, buyFk, zoneFk)
@ -83,31 +86,10 @@ BEGIN
bu.buyFk, bu.buyFk,
vZoneFk vZoneFk
FROM `cache`.available a FROM `cache`.available a
LEFT JOIN cache.availableNoRaids anr ON anr.item_id = a.item_id
AND anr.calc_id = vAvailableNoRaidsCalc
JOIN tmp.item i ON i.itemFk = a.item_id JOIN tmp.item i ON i.itemFk = a.item_id
JOIN item it ON it.id = i.itemFk JOIN item it ON it.id = i.itemFk
JOIN `zone` z ON z.id = vZoneFk JOIN `zone` z ON z.id = vZoneFk
LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = a.item_id LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = a.item_id
LEFT JOIN edi.supplyResponse sr ON sr.ID = it.supplyResponseFk
LEFT JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
LEFT JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID
LEFT JOIN (SELECT isVNHSupplier, isEarlyBird, TRUE AS itemAllowed
FROM addressFilter af
JOIN (SELECT ad.provinceFk, p.countryFk, ad.isLogifloraAllowed
FROM address ad
JOIN province p ON p.id = ad.provinceFk
WHERE ad.id = vAddressFk
) sub2 ON sub2.provinceFk <=> IFNULL(af.provinceFk, sub2.provinceFk)
AND sub2.countryFk <=> IFNULL(af.countryFk, sub2.countryFk)
AND sub2.isLogifloraAllowed <=> IFNULL(af.isLogifloraAllowed, sub2.isLogifloraAllowed)
WHERE vWarehouseFk = af.warehouseFk
AND (vShipped < af.beforeDated
OR ISNULL(af.beforeDated)
OR vShipped > af.afterDated
OR ISNULL(af.afterDated))
) sub ON sub.isVNHSupplier = v.isVNHSupplier
AND (sub.isEarlyBird = mp.isEarlyBird OR ISNULL(sub.isEarlyBird))
JOIN agencyMode am ON am.id = vAgencyModeFk JOIN agencyMode am ON am.id = vAgencyModeFk
JOIN agency ag ON ag.id = am.agencyFk JOIN agency ag ON ag.id = am.agencyFk
JOIN itemType itt ON itt.id = it.typeFk JOIN itemType itt ON itt.id = it.typeFk
@ -124,7 +106,6 @@ BEGIN
AND ait.itemTypeFk = itt.id AND ait.itemTypeFk = itt.id
WHERE a.calc_id = vAvailableCalc WHERE a.calc_id = vAvailableCalc
AND a.available > 0 AND a.available > 0
AND (sub.itemAllowed OR NOT it.isFloramondo OR anr.available > 0)
AND (ag.isAnyVolumeAllowed OR NOT itt.isUnconventionalSize) AND (ag.isAnyVolumeAllowed OR NOT itt.isUnconventionalSize)
AND (it.`size` IS NULL AND (it.`size` IS NULL
OR IF(itc.isReclining, OR IF(itc.isReclining,

View File

@ -160,9 +160,11 @@ BEGIN
OR (NOT s.isPreparable AND NOT s.isPrintable) OR (NOT s.isPreparable AND NOT s.isPrintable)
OR pb.collectionH IS NOT NULL OR pb.collectionH IS NOT NULL
OR pb.collectionV IS NOT NULL OR pb.collectionV IS NOT NULL
OR pb.collectionA IS NOT NULL
OR pb.collectionN IS NOT NULL OR pb.collectionN IS NOT NULL
OR (NOT pb.H AND pb.V > 0 AND vItemPackingTypeFk = 'H') OR (NOT pb.H AND pb.V + pb.A > 0 AND vItemPackingTypeFk = 'H')
OR (NOT pb.V AND vItemPackingTypeFk = 'V') OR (NOT pb.V AND vItemPackingTypeFk = 'V')
OR (NOT pb.A AND vItemPackingTypeFk = 'A')
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking) OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
OR LENGTH(pb.problem) OR LENGTH(pb.problem)
OR pb.lines > vLinesLimit OR pb.lines > vLinesLimit

View File

@ -30,7 +30,7 @@ BEGIN
WITH entriesIn AS ( WITH entriesIn AS (
SELECT 'entry' originType, SELECT 'entry' originType,
e.id originId, e.id originId,
tr.landed shipped, IFNULL(tr.availabled, tr.landed) shipped,
b.quantity `in`, b.quantity `in`,
NULL `out`, NULL `out`,
st.alertLevel , st.alertLevel ,
@ -54,7 +54,7 @@ BEGIN
OR (util.VN_CURDATE() AND tr.isReceived), OR (util.VN_CURDATE() AND tr.isReceived),
'DELIVERED', 'DELIVERED',
'FREE') 'FREE')
WHERE tr.landed >= vDateInventory WHERE IFNULL(tr.availabled, tr.landed) >= vDateInventory
AND tr.warehouseInFk = vWarehouseFk AND tr.warehouseInFk = vWarehouseFk
AND (s.id <> vSupplierInventoryFk OR vDated IS NULL) AND (s.id <> vSupplierInventoryFk OR vDated IS NULL)
AND b.itemFk = vItemFk AND b.itemFk = vItemFk
@ -99,7 +99,7 @@ BEGIN
), ),
sales AS ( sales AS (
WITH itemSales AS ( WITH itemSales AS (
SELECT DATE(t.shipped) shipped, SELECT DATE(t.shipped) + INTERVAL HOUR(z.`hour`) HOUR shipped,
s.quantity, s.quantity,
st2.alertLevel, st2.alertLevel,
st2.name, st2.name,
@ -114,6 +114,7 @@ BEGIN
cb.claimFk cb.claimFk
FROM vn.sale s FROM vn.sale s
JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.ticket t ON t.id = s.ticketFk
JOIN vn.`zone` z ON z.id = t.zoneFk
LEFT JOIN vn.ticketState ts ON ts.ticketFk = t.id LEFT JOIN vn.ticketState ts ON ts.ticketFk = t.id
LEFT JOIN vn.state st ON st.code = ts.code LEFT JOIN vn.state st ON st.code = ts.code
JOIN vn.client c ON c.id = t.clientFk JOIN vn.client c ON c.id = t.clientFk
@ -189,14 +190,15 @@ BEGIN
SELECT * FROM sales SELECT * FROM sales
UNION ALL UNION ALL
SELECT * FROM orders SELECT * FROM orders
ORDER BY shipped, ORDER BY DATE(shipped),
(inventorySupplierFk = entityId) DESC, (inventorySupplierFk = entityId) DESC,
alertLevel DESC, alertLevel DESC,
isTicket, isTicket,
`order` DESC, `order` DESC,
isPicked DESC, isPicked DESC,
`in` DESC, `in` DESC,
`out` DESC; `out` DESC,
shipped;
IF vDated IS NULL THEN IF vDated IS NULL THEN
SET @a := 0; SET @a := 0;
@ -205,7 +207,7 @@ BEGIN
SELECT t.originType, SELECT t.originType,
t.originId, t.originId,
DATE(@shipped:= t.shipped) shipped, @shipped:= t.shipped,
t.alertLevel, t.alertLevel,
t.stateName, t.stateName,
t.reference, t.reference,

View File

@ -1,5 +1,16 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_getLack`(IN vForce BOOLEAN, IN vDays INT) CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_getLack`(
vSelf INT,
vForce BOOLEAN,
vDays INT,
vLongname VARCHAR(255),
vProducerName VARCHAR(255),
vColor VARCHAR(255),
vSize INT,
vOrigen INT,
vLack INT,
vWarehouseFk INT
)
BEGIN BEGIN
/** /**
* Calcula una tabla con el máximo negativo visible para cada producto y almacen * Calcula una tabla con el máximo negativo visible para cada producto y almacen
@ -47,6 +58,14 @@ BEGIN
WHERE w.isForTicket WHERE w.isForTicket
AND ic.display AND ic.display
AND it.code != 'GEN' AND it.code != 'GEN'
AND (vSelf IS NULL OR i.id = vSelf)
AND (vLongname IS NULL OR i.name = vLongname)
AND (vProducerName IS NULL OR p.`name` LIKE CONCAT('%', vProducerName, '%'))
AND (vColor IS NULL OR vColor = i.inkFk)
AND (vSize IS NULL OR vSize = i.`size`)
AND (vOrigen IS NULL OR vOrigen = w.id)
AND (vLack IS NULL OR vLack = sub.amount)
AND (vWarehouseFk IS NULL OR vWarehouseFk = w.id)
GROUP BY i.id, w.id GROUP BY i.id, w.id
HAVING lack < 0; HAVING lack < 0;

View File

@ -82,14 +82,19 @@ BEGIN
AND it.priority = vPriority AND it.priority = vPriority
LEFT JOIN vn.tag t ON t.id = it.tagFk LEFT JOIN vn.tag t ON t.id = it.tagFk
LEFT JOIN vn.buy b ON b.id = bu.buyFk LEFT JOIN vn.buy b ON b.id = bu.buyFk
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id
AND iss.warehouseFk = vWarehouseFk
LEFT JOIN vn.ink ink ON ink.id = i.tag5
JOIN itemTags its JOIN itemTags its
WHERE a.available > 0 WHERE a.available > 0
AND (i.typeFk = its.typeFk OR NOT vShowType) AND (i.typeFk = its.typeFk OR NOT vShowType)
AND i.id <> vSelf AND i.id <> vSelf
ORDER BY `counter` DESC, ORDER BY (a.available > 0) DESC,
`counter` DESC,
(t.name = its.name) DESC, (t.name = its.name) DESC,
(it.value = its.value) DESC, (it.value = its.value) DESC,
(i.tag5 = its.tag5) DESC, (i.tag5 = its.tag5) DESC,
(ink.`showOrder`) DESC,
match5 DESC, match5 DESC,
(i.tag6 = its.tag6) DESC, (i.tag6 = its.tag6) DESC,
match6 DESC, match6 DESC,

View File

@ -35,8 +35,8 @@ BEGIN
SELECT iei.itemFk, iei.quantity SELECT iei.itemFk, iei.quantity
FROM itemEntryIn iei FROM itemEntryIn iei
JOIN item i ON i.id = iei.itemFk JOIN item i ON i.id = iei.itemFk
WHERE iei.landed >= util.VN_CURDATE() WHERE IFNULL(iei.availabled, iei.landed) >= util.VN_CURDATE()
AND iei.landed < vDated AND IFNULL(iei.availabled, iei.landed) < vDated
AND iei.warehouseInFk = vWarehouseFk AND iei.warehouseInFk = vWarehouseFk
AND (vItemFk IS NULL OR iei.itemFk = vItemFk) AND (vItemFk IS NULL OR iei.itemFk = vItemFk)
UNION ALL UNION ALL

View File

@ -1,16 +1,18 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`prepareTicketList`(vStartingDate DATETIME, vEndingDate DATETIME) CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`prepareTicketList`(
vStartingDate DATETIME,
vEndingDate DATETIME
)
BEGIN BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.productionTicket; DROP TEMPORARY TABLE IF EXISTS tmp.productionTicket;
CREATE TEMPORARY TABLE tmp.productionTicket CREATE TEMPORARY TABLE tmp.productionTicket
(PRIMARY KEY (ticketFk)) (PRIMARY KEY (ticketFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT t.id ticketFk, t.clientFk SELECT t.id ticketFk
FROM ticket t FROM ticket t
JOIN alertLevel al ON al.code = 'DELIVERED' JOIN alertLevel al ON al.code = 'DELIVERED'
LEFT JOIN ticketState ts ON ts.ticketFk = t.id LEFT JOIN ticketState ts ON ts.ticketFk = t.id
JOIN client c ON c.id = t.clientFk JOIN client c ON c.id = t.clientFk
WHERE c.typeFk IN ('normal','handMaking','internalUse') WHERE c.typeFk IN ('normal','handMaking','internalUse')
AND ( AND (
t.shipped BETWEEN util.VN_CURDATE() AND vEndingDate t.shipped BETWEEN util.VN_CURDATE() AND vEndingDate

View File

@ -24,24 +24,31 @@ proc: BEGIN
CALL prepareTicketList(util.yesterday(), vEndingDate); CALL prepareTicketList(util.yesterday(), vEndingDate);
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
SELECT * FROM tmp.productionTicket;
CALL prepareClientList();
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_getProblems
(INDEX (ticketFk)) (INDEX (ticketFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT tt.ticketFk, tt.clientFk, t.warehouseFk, t.shipped SELECT ticketFk
FROM tmp.productionTicket tt FROM tmp.productionTicket;
JOIN ticket t ON t.id = tt.ticketFk;
CALL ticket_getProblems(vIsTodayRelative); CALL ticket_getProblems(vIsTodayRelative);
CREATE OR REPLACE TEMPORARY TABLE tmp.productionBuffer CREATE OR REPLACE TEMPORARY TABLE tmp.productionBuffer
(PRIMARY KEY(ticketFk), previaParking VARCHAR(255)) (PRIMARY KEY(ticketFk), previaParking VARCHAR(255))
ENGINE = MEMORY ENGINE = MEMORY
WITH saleProblemsDescription AS(
SELECT s.ticketFk,
LEFT(CONCAT('F: ', GROUP_CONCAT(CONCAT(i.id, ' ', i.longName) SEPARATOR ', ')), 250) itemShortage,
LEFT(CONCAT('R: ', GROUP_CONCAT(CONCAT(i2.id, ' ', i2.longName) SEPARATOR ', ')), 250) itemDelay,
LEFT(CONCAT('I: ', GROUP_CONCAT(CONCAT(i3.id, ' ', i3.longName) SEPARATOR ', ')), 250) itemLost
FROM tmp.saleProblems sp
JOIN vn.sale s ON s.id = sp.saleFk
LEFT JOIN vn.item i ON i.id = s.itemFk AND sp.hasItemShortage
LEFT JOIN vn.item i2 ON i2.id = s.itemFk AND sp.hasItemDelay
LEFT JOIN vn.item i3 ON i3.id = s.itemFk AND sp.hasItemLost
WHERE hasItemShortage OR hasItemDelay OR hasItemLost
GROUP BY s.ticketFk
)
SELECT tt.ticketFk, SELECT tt.ticketFk,
tt.clientFk, t.clientFk,
t.warehouseFk, t.warehouseFk,
t.nickname, t.nickname,
t.packages, t.packages,
@ -59,7 +66,17 @@ proc: BEGIN
0 `lines`, 0 `lines`,
CAST( 0 AS DECIMAL(5,2)) m3, CAST( 0 AS DECIMAL(5,2)) m3,
CAST( 0 AS DECIMAL(5,2)) preparationRate, CAST( 0 AS DECIMAL(5,2)) preparationRate,
"" problem, TRIM(CAST(CONCAT( IFNULL(sp.itemShortage, ''),
IFNULL(sp.itemDelay, ''),
IFNULL(sp.itemLost, ''),
IF(tpr.isFreezed, ' CONGELADO',''),
IF(tpr.hasHighRisk, ' RIESGO',''),
IF(tpr.hasTicketRequest, ' COD 100',''),
IF(tpr.isTaxDataChecked, '',' FICHA INCOMPLETA'),
IF(tpr.hasComponentLack, ' COMPONENTES', ''),
IF(HOUR(util.VN_NOW()) < IF(HOUR(t.shipped), HOUR(t.shipped), COALESCE(HOUR(zc.hour),HOUR(z.hour)))
AND tpr.isTooLittle, ' PEQUEÑO', '')
) AS char(255))) problem,
IFNULL(tls.state,2) state, IFNULL(tls.state,2) state,
w.code workerCode, w.code workerCode,
DATE(t.shipped) shipped, DATE(t.shipped) shipped,
@ -74,31 +91,34 @@ proc: BEGIN
pk.code parking, pk.code parking,
0 H, 0 H,
0 V, 0 V,
0 A,
0 N, 0 N,
st.isOk, st.isOk,
ag.isOwn, ag.isOwn,
rm.bufferFk rm.bufferFk
FROM tmp.productionTicket tt FROM tmp.productionTicket tt
JOIN ticket t ON tt.ticketFk = t.id JOIN vn.ticket t ON tt.ticketFk = t.id
JOIN alertLevel al ON al.code = 'FREE' JOIN vn.alertLevel al ON al.code = 'FREE'
LEFT JOIN ticketStateToday tst ON tst.ticketFk = t.id LEFT JOIN vn.ticketStateToday tst ON tst.ticketFk = t.id
LEFT JOIN `state` st ON st.id = tst.state LEFT JOIN vn.`state` st ON st.id = tst.state
LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN vn.client c ON c.id = t.clientFk
LEFT JOIN worker wk ON wk.id = c.salesPersonFk LEFT JOIN vn.worker wk ON wk.id = c.salesPersonFk
JOIN address a ON a.id = t.addressFk JOIN vn.address a ON a.id = t.addressFk
LEFT JOIN province p ON p.id = a.provinceFk LEFT JOIN vn.province p ON p.id = a.provinceFk
JOIN agencyMode am ON am.id = t.agencyModeFk JOIN vn.agencyMode am ON am.id = t.agencyModeFk
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk JOIN vn.deliveryMethod dm ON dm.id = am.deliveryMethodFk
JOIN agency ag ON ag.id = am.agencyFk JOIN vn.agency ag ON ag.id = am.agencyFk
LEFT JOIN ticketState tls ON tls.ticketFk = tt.ticketFk LEFT JOIN vn.ticketState tls ON tls.ticketFk = tt.ticketFk
LEFT JOIN ticketLastUpdated tlu ON tlu.ticketFk = tt.ticketFk LEFT JOIN vn.ticketLastUpdated tlu ON tlu.ticketFk = tt.ticketFk
LEFT JOIN worker w ON w.id = tls.userFk LEFT JOIN vn.worker w ON w.id = tls.userFk
LEFT JOIN routesMonitor rm ON rm.routeFk = t.routeFk LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
LEFT JOIN `zone` z ON z.id = t.zoneFk LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
LEFT JOIN zoneClosure zc ON zc.zoneFk = t.zoneFk LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk
AND DATE(t.shipped) = zc.dated AND DATE(t.shipped) = zc.dated
LEFT JOIN ticketParking tp ON tp.ticketFk = t.id LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id
LEFT JOIN parking pk ON pk.id = tp.parkingFk LEFT JOIN vn.parking pk ON pk.id = tp.parkingFk
LEFT JOIN tmp.ticketProblems tpr ON tpr.ticketFk = tt.ticketFk
LEFT JOIN saleProblemsDescription sp ON sp.ticketFk = tt.ticketFk
WHERE t.warehouseFk = vWarehouseFk WHERE t.warehouseFk = vWarehouseFk
AND dm.code IN ('AGENCY', 'DELIVERY', 'PICKUP'); AND dm.code IN ('AGENCY', 'DELIVERY', 'PICKUP');
@ -119,21 +139,9 @@ proc: BEGIN
CHANGE COLUMN `problem` `problem` VARCHAR(255), CHANGE COLUMN `problem` `problem` VARCHAR(255),
ADD COLUMN `collectionH` INT, ADD COLUMN `collectionH` INT,
ADD COLUMN `collectionV` INT, ADD COLUMN `collectionV` INT,
ADD COLUMN `collectionA` INT,
ADD COLUMN `collectionN` INT; ADD COLUMN `collectionN` INT;
UPDATE tmp.productionBuffer pb
JOIN tmp.ticket_problems tp ON tp.ticketFk = pb.ticketFk
SET pb.problem = TRIM(CAST(CONCAT( IFNULL(tp.itemShortage, ''),
IFNULL(tp.itemDelay, ''),
IFNULL(tp.itemLost, ''),
IF(tp.isFreezed, ' CONGELADO',''),
IF(tp.hasHighRisk, ' RIESGO',''),
IF(tp.hasTicketRequest, ' COD 100',''),
IF(tp.isTaxDataChecked, '',' FICHA INCOMPLETA'),
IF(tp.hasComponentLack, ' COMPONENTES', ''),
IF(HOUR(util.VN_NOW()) < pb.HH AND tp.isTooLittle, ' PEQUEÑO', '')
) AS char(255)));
-- Clientes Nuevos o Recuperados -- Clientes Nuevos o Recuperados
UPDATE tmp.productionBuffer pb UPDATE tmp.productionBuffer pb
LEFT JOIN bs.clientNewBorn cnb ON cnb.clientFk = pb.clientFk LEFT JOIN bs.clientNewBorn cnb ON cnb.clientFk = pb.clientFk
@ -173,11 +181,13 @@ proc: BEGIN
SELECT ticketFk, SELECT ticketFk,
SUM(sub.H) H, SUM(sub.H) H,
SUM(sub.V) V, SUM(sub.V) V,
SUM(sub.A) A,
SUM(sub.N) N SUM(sub.N) N
FROM ( FROM (
SELECT t.ticketFk, SELECT t.ticketFk,
SUM(i.itemPackingTypeFk = 'H') H, SUM(i.itemPackingTypeFk = 'H') H,
SUM(i.itemPackingTypeFk = 'V') V, SUM(i.itemPackingTypeFk = 'V') V,
SUM(i.itemPackingTypeFk = 'A') A,
SUM(i.itemPackingTypeFk IS NULL) N SUM(i.itemPackingTypeFk IS NULL) N
FROM tmp.productionTicket t FROM tmp.productionTicket t
JOIN sale s ON s.ticketFk = t.ticketFk JOIN sale s ON s.ticketFk = t.ticketFk
@ -190,6 +200,7 @@ proc: BEGIN
JOIN tItemPackingType ti ON ti.ticketFk = pb.ticketFk JOIN tItemPackingType ti ON ti.ticketFk = pb.ticketFk
SET pb.H = ti.H, SET pb.H = ti.H,
pb.V = ti.V, pb.V = ti.V,
pb.A = ti.A,
pb.N = ti.N; pb.N = ti.N;
-- Colecciones segun tipo de encajado -- Colecciones segun tipo de encajado
@ -197,6 +208,7 @@ proc: BEGIN
JOIN ticketCollection tc ON pb.ticketFk = tc.ticketFk JOIN ticketCollection tc ON pb.ticketFk = tc.ticketFk
SET pb.collectionH = IF(pb.H, tc.collectionFk, NULL), SET pb.collectionH = IF(pb.H, tc.collectionFk, NULL),
pb.collectionV = IF(pb.V, tc.collectionFk, NULL), pb.collectionV = IF(pb.V, tc.collectionFk, NULL),
pb.collectionA = IF(pb.A, tc.collectionFk, NULL),
pb.collectionN = IF(pb.N, tc.collectionFk, NULL); pb.collectionN = IF(pb.N, tc.collectionFk, NULL);
-- Previa pendiente -- Previa pendiente
@ -278,7 +290,8 @@ proc: BEGIN
DROP TEMPORARY TABLE DROP TEMPORARY TABLE
tmp.productionTicket, tmp.productionTicket,
tmp.ticket, tmp.ticket,
tmp.ticket_problems, tmp.ticketProblems,
tmp.saleProblems,
tmp.ticketWithPrevia, tmp.ticketWithPrevia,
tItemShelvingStock, tItemShelvingStock,
tItemPackingType; tItemPackingType;

View File

@ -1,14 +1,14 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`sale_getProblems`( CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`sale_getProblems`(
vIsTodayRelative tinyint(1) vIsTodayRelative TINYINT(1)
) )
BEGIN BEGIN
/** /**
* Calcula los problemas de cada venta para un conjunto de tickets. * Calcula los problemas para un conjunto de sale
* *
* @param vIsTodayRelative Indica si se calcula el disponible como si todo saliera hoy * @param vIsTodayRelative Indica si se calcula el disponible como si todo saliera hoy
* @table tmp.sale_getProblems(ticketFk, clientFk, warehouseFk, shipped) Tickets a calcular * @table tmp.sale(saleFk) Identificadores de los sale a calcular
* @return tmp.sale_problems * @return tmp.saleProblems
*/ */
DECLARE vWarehouseFk INT; DECLARE vWarehouseFk INT;
DECLARE vDate DATE; DECLARE vDate DATE;
@ -16,71 +16,27 @@ BEGIN
DECLARE vVisibleCache INT; DECLARE vVisibleCache INT;
DECLARE vDone BOOL; DECLARE vDone BOOL;
DECLARE vCursor CURSOR FOR DECLARE vCursor CURSOR FOR
SELECT DISTINCT warehouseFk, IF(vIsTodayRelative, util.VN_CURDATE(), DATE(shipped)) SELECT t.warehouseFk, IF(vIsTodayRelative, util.VN_CURDATE(), DATE(t.shipped)) dated
FROM tmp.sale_getProblems FROM tmp.sale ts
WHERE shipped BETWEEN util.VN_CURDATE() JOIN sale s ON s.id = ts.saleFk
AND util.dayEnd(util.VN_CURDATE() + INTERVAL IF(vIsTodayRelative, 9.9, 1.9) DAY); JOIN ticket t ON t.id = s.ticketFk
WHERE t.shipped BETWEEN util.VN_CURDATE()
AND util.dayEnd(util.VN_CURDATE() + INTERVAL IF(vIsTodayRelative, 9.9, 1.9) DAY)
GROUP BY warehouseFk, dated;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_problems ( CREATE OR REPLACE TEMPORARY TABLE tmp.saleProblems(
ticketFk INT(11),
saleFk INT(11), saleFk INT(11),
isFreezed INTEGER(1) DEFAULT 0, hasItemShortage BOOL DEFAULT FALSE,
risk DECIMAL(10,1) DEFAULT 0, hasItemLost BOOL DEFAULT FALSE,
hasRisk TINYINT(1) DEFAULT 0, hasComponentLack BOOL DEFAULT FALSE,
hasHighRisk TINYINT(1) DEFAULT 0, hasItemDelay BOOL DEFAULT FALSE,
hasTicketRequest INTEGER(1) DEFAULT 0, hasRounding BOOL DEFAULT FALSE,
itemShortage VARCHAR(255), PRIMARY KEY (saleFk)
isTaxDataChecked INTEGER(1) DEFAULT 1, ) ENGINE = MEMORY;
itemDelay VARCHAR(255),
itemLost VARCHAR(255),
hasComponentLack INTEGER(1),
hasRounding VARCHAR(255),
isTooLittle BOOL DEFAULT FALSE,
isVip BOOL DEFAULT FALSE,
PRIMARY KEY (ticketFk, saleFk)
); -- No memory
INSERT INTO tmp.sale_problems(ticketFk, CREATE OR REPLACE TEMPORARY TABLE tItemShelving
saleFk,
isFreezed,
risk,
hasRisk,
hasHighRisk,
hasTicketRequest,
isTaxDataChecked,
hasComponentLack,
isTooLittle)
SELECT sgp.ticketFk,
s.id,
IF(FIND_IN_SET('isFreezed', t.problem), TRUE, FALSE) isFreezed,
t.risk,
IF(FIND_IN_SET('hasRisk', t.problem), TRUE, FALSE) hasRisk,
IF(FIND_IN_SET('hasHighRisk', t.problem), TRUE, FALSE) hasHighRisk,
IF(FIND_IN_SET('hasTicketRequest', t.problem), TRUE, FALSE) hasTicketRequest,
IF(FIND_IN_SET('isTaxDataChecked', t.problem), FALSE, TRUE) isTaxDataChecked,
IF(FIND_IN_SET('hasComponentLack', s.problem), TRUE, FALSE) hasComponentLack,
IF(FIND_IN_SET('isTooLittle', t.problem)
AND util.VN_NOW() < (util.VN_CURDATE() + INTERVAL HOUR(zc.`hour`) HOUR) + INTERVAL MINUTE(zc.`hour`) MINUTE,
TRUE, FALSE) isTooLittle
FROM tmp.sale_getProblems sgp
JOIN ticket t ON t.id = sgp.ticketFk
LEFT JOIN sale s ON s.ticketFk = t.id
LEFT JOIN item i ON i.id = s.itemFk
LEFT JOIN zoneClosure zc ON zc.zoneFk = t.zoneFk
AND zc.dated = util.VN_CURDATE()
WHERE s.problem <> '' OR t.problem <> '' OR t.risk
GROUP BY t.id, s.id;
INSERT INTO tmp.sale_problems(ticketFk, isVip)
SELECT sgp.ticketFk, TRUE
FROM tmp.sale_getProblems sgp
JOIN client c ON c.id = sgp.clientFk
WHERE c.businessTypeFk = 'VIP'
ON DUPLICATE KEY UPDATE isVIP = TRUE;
CREATE OR REPLACE TEMPORARY TABLE tItemShelvingStock_byWarehouse
(INDEX (itemFk, warehouseFk)) (INDEX (itemFk, warehouseFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT ish.itemFk itemFk, SELECT ish.itemFk itemFk,
@ -92,6 +48,14 @@ BEGIN
JOIN sector s ON s.id = p.sectorFk JOIN sector s ON s.id = p.sectorFk
GROUP BY ish.itemFk, s.warehouseFk; GROUP BY ish.itemFk, s.warehouseFk;
-- Componentes: Algún componente obligatorio no se ha calcualdo
INSERT INTO tmp.saleProblems(saleFk, hasComponentLack)
SELECT s.id, TRUE
FROM tmp.sale ts
JOIN sale s ON s.id = ts.saleFk
WHERE FIND_IN_SET('hasComponentLack', s.problem)
GROUP BY s.id;
-- Disponible, faltas, inventario y retrasos -- Disponible, faltas, inventario y retrasos
OPEN vCursor; OPEN vCursor;
l: LOOP l: LOOP
@ -108,15 +72,11 @@ BEGIN
-- Faltas: visible, disponible y ubicado son menores que la cantidad vendida -- Faltas: visible, disponible y ubicado son menores que la cantidad vendida
CALL cache.visible_refresh(vVisibleCache, FALSE, vWarehouseFk); CALL cache.visible_refresh(vVisibleCache, FALSE, vWarehouseFk);
INSERT INTO tmp.sale_problems(ticketFk, itemShortage, saleFk) INSERT INTO tmp.saleProblems(saleFk, hasItemShortage)
SELECT ticketFk, problem, saleFk SELECT s.id, TRUE
FROM ( FROM tmp.sale ts
SELECT sgp.ticketFk, JOIN sale s ON s.id = ts.saleFk
LEFT(CONCAT('F: ', GROUP_CONCAT(i.id, ' ', i.longName, ' ')), 250) problem, JOIN ticket t ON t.id = s.ticketFk
s.id saleFk
FROM tmp.sale_getProblems sgp
JOIN ticket t ON t.id = sgp.ticketFk
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
JOIN itemType it ON it.id = i.typeFk JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk JOIN itemCategory ic ON ic.id = it.categoryFk
@ -124,11 +84,11 @@ BEGIN
AND v.calc_id = vVisibleCache AND v.calc_id = vVisibleCache
LEFT JOIN cache.available av ON av.item_id = i.id LEFT JOIN cache.available av ON av.item_id = i.id
AND av.calc_id = vAvailableCache AND av.calc_id = vAvailableCache
LEFT JOIN tItemShelvingStock_byWarehouse issw ON issw.itemFk = i.id LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
AND issw.warehouseFk = t.warehouseFk AND tis.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) < s.quantity WHERE (s.quantity > v.visible OR (s.quantity > 0 AND v.visible IS NULL))
AND IFNULL(av.available, 0) < 0 AND (av.available < 0 OR av.available IS NULL)
AND IFNULL(issw.visible, 0) < s.quantity AND (s.quantity > tis.visible OR tis.visible IS NULL)
AND NOT s.isPicked AND NOT s.isPicked
AND NOT s.reserved AND NOT s.reserved
AND ic.merchandise AND ic.merchandise
@ -136,28 +96,24 @@ BEGIN
AND NOT i.generic AND NOT i.generic
AND util.VN_CURDATE() = vDate AND util.VN_CURDATE() = vDate
AND t.warehouseFk = vWarehouseFk AND t.warehouseFk = vWarehouseFk
GROUP BY sgp.ticketFk) sub GROUP BY s.id
ON DUPLICATE KEY UPDATE itemShortage = sub.problem, saleFk = sub.saleFk; ON DUPLICATE KEY UPDATE hasItemShortage = TRUE;
-- Inventario: Visible suficiente, pero ubicado menor a la cantidad vendida -- Inventario: Visible suficiente, pero ubicado menor a la cantidad vendida
INSERT INTO tmp.sale_problems(ticketFk, itemLost, saleFk) INSERT INTO tmp.saleProblems(saleFk, hasItemLost)
SELECT ticketFk, problem, saleFk SELECT s.id, TRUE
FROM ( FROM tmp.sale ts
SELECT sgp.ticketFk, JOIN sale s ON s.id = ts.saleFk
LEFT(GROUP_CONCAT('I: ', i.id, ' ', i.longName, ' '), 250) problem, JOIN ticket t ON t.id = s.ticketFk
s.id saleFk
FROM tmp.sale_getProblems sgp
JOIN ticket t ON t.id = sgp.ticketFk
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
JOIN itemType it ON it.id = i.typeFk JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN cache.visible v ON v.item_id = s.itemFk LEFT JOIN cache.visible v ON v.item_id = s.itemFk
AND v.calc_id = vVisibleCache AND v.calc_id = vVisibleCache
LEFT JOIN tItemShelvingStock_byWarehouse issw ON issw.itemFk = i.id LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
AND issw.warehouseFk = t.warehouseFk AND tis.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) >= s.quantity WHERE (v.visible >= s.quantity OR v.visible IS NULL)
AND IFNULL(issw.visible, 0) < s.quantity AND (s.quantity > tis.visible AND tis.visible IS NOT NULL)
AND s.quantity > 0 AND s.quantity > 0
AND NOT s.isPicked AND NOT s.isPicked
AND NOT s.reserved AND NOT s.reserved
@ -166,20 +122,15 @@ BEGIN
AND NOT i.generic AND NOT i.generic
AND util.VN_CURDATE() = vDate AND util.VN_CURDATE() = vDate
AND t.warehouseFk = vWarehouseFk AND t.warehouseFk = vWarehouseFk
GROUP BY sgp.ticketFk GROUP BY s.id
) sub ON DUPLICATE KEY UPDATE hasItemLost = TRUE;
ON DUPLICATE KEY UPDATE itemLost = sub.problem, saleFk = sub.saleFk;
-- Retraso: Disponible suficiente, pero no visible ni ubicado -- Retraso: Disponible suficiente, pero no visible ni ubicado
INSERT INTO tmp.sale_problems(ticketFk, itemDelay, saleFk) INSERT INTO tmp.saleProblems(saleFk, hasItemDelay)
SELECT ticketFk, problem, saleFk SELECT s.id, TRUE
FROM ( FROM tmp.sale ts
SELECT sgp.ticketFk, JOIN sale s ON s.id = ts.saleFk
LEFT(GROUP_CONCAT('R: ', i.id, ' ', i.longName, ' '), 250) problem, JOIN ticket t ON t.id = s.ticketFk
s.id saleFk
FROM tmp.sale_getProblems sgp
JOIN ticket t ON t.id = sgp.ticketFk
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
JOIN itemType it ON it.id = i.typeFk JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk JOIN itemCategory ic ON ic.id = it.categoryFk
@ -187,11 +138,11 @@ BEGIN
AND v.calc_id = vVisibleCache AND v.calc_id = vVisibleCache
LEFT JOIN cache.available av ON av.item_id = i.id LEFT JOIN cache.available av ON av.item_id = i.id
AND av.calc_id = vAvailableCache AND av.calc_id = vAvailableCache
LEFT JOIN tItemShelvingStock_byWarehouse issw ON issw.itemFk = i.id LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
AND issw.warehouseFk = t.warehouseFk AND tis.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) < s.quantity WHERE (s.quantity > v.visible AND v.visible IS NULL)
AND IFNULL(av.available, 0) >= 0 AND (av.available >= 0 OR av.available IS NULL)
AND IFNULL(issw.visible, 0) < s.quantity AND (s.quantity > tis.visible AND tis.visible IS NOT NULL)
AND s.quantity > 0 AND s.quantity > 0
AND NOT s.isPicked AND NOT s.isPicked
AND NOT s.reserved AND NOT s.reserved
@ -200,34 +151,29 @@ BEGIN
AND NOT i.generic AND NOT i.generic
AND util.VN_CURDATE() = vDate AND util.VN_CURDATE() = vDate
AND t.warehouseFk = vWarehouseFk AND t.warehouseFk = vWarehouseFk
GROUP BY sgp.ticketFk GROUP BY s.id
) sub ON DUPLICATE KEY UPDATE hasItemDelay = TRUE;
ON DUPLICATE KEY UPDATE itemDelay = sub.problem, saleFk = sub.saleFk;
-- Redondeo: cantidad incorrecta con respecto al grouping -- Redondeo: cantidad incorrecta con respecto al grouping
CALL buy_getUltimate(NULL, vWarehouseFk, vDate); CALL buy_getUltimate(NULL, vWarehouseFk, vDate);
INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
SELECT ticketFk, problem, saleFk INSERT INTO tmp.saleProblems(saleFk, hasRounding)
FROM ( SELECT s.id, TRUE
SELECT sgp.ticketFk, FROM tmp.sale ts
s.id saleFk, JOIN sale s ON s.id = ts.saleFk
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem JOIN ticket t ON t.id = s.ticketFk
FROM tmp.sale_getProblems sgp
JOIN ticket t ON t.id = sgp.ticketFk
AND t.warehouseFk = vWarehouseFk AND t.warehouseFk = vWarehouseFk
JOIN sale s ON s.ticketFk = sgp.ticketFk
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
JOIN buy b ON b.id = bu.buyFk JOIN buy b ON b.id = bu.buyFk
WHERE MOD(s.quantity, b.`grouping`) WHERE MOD(s.quantity, b.`grouping`)
GROUP BY sgp.ticketFk GROUP BY s.id
)sub ON DUPLICATE KEY UPDATE hasRounding = TRUE;
ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
DROP TEMPORARY TABLE tmp.buyUltimate; DROP TEMPORARY TABLE tmp.buyUltimate;
END LOOP; END LOOP;
CLOSE vCursor; CLOSE vCursor;
DROP TEMPORARY TABLE tItemShelvingStock_byWarehouse; DROP TEMPORARY TABLE tItemShelving;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,25 +1,25 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`sale_getProblemsByTicket`(IN vTicketFk INT, IN vIsTodayRelative TINYINT(1)) CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`sale_getProblemsByTicket`(
IN vTicketFk INT,
IN vIsTodayRelative TINYINT(1)
)
BEGIN BEGIN
/** /**
* Calcula los problemas de cada venta * Calcula los problemas de cada venta para un tickets.
* para un conjunto de tickets.
* *
* @return Problems result * @return Problems result
*/ */
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_getProblems CREATE OR REPLACE TEMPORARY TABLE tmp.sale
(INDEX (ticketFk)) (INDEX (saleFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT t.id ticketFk, t.clientFk, t.warehouseFk, t.shipped SELECT id saleFk FROM sale WHERE ticketFk = vTicketFk;
FROM ticket t
WHERE t.id = vTicketFk;
CALL sale_getProblems(vIsTodayRelative); CALL sale_getProblems(vIsTodayRelative);
SELECT * FROM tmp.sale_problems; SELECT * FROM tmp.saleProblems;
DROP TEMPORARY TABLE DROP TEMPORARY TABLE
tmp.sale_getProblems, tmp.saleProblems,
tmp.sale_problems; tmp.sale;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -25,9 +25,11 @@ BEGIN
DECLARE vNewSaleFk INT; DECLARE vNewSaleFk INT;
DECLARE vFinalPrice DECIMAL(10,2); DECLARE vFinalPrice DECIMAL(10,2);
DECLARE vIsRequiredTx BOOL DEFAULT NOT @@in_transaction;
DECLARE EXIT HANDLER FOR SQLEXCEPTION DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN BEGIN
ROLLBACK; CALL util.tx_rollback(vIsRequiredTx);
RESIGNAL; RESIGNAL;
END; END;
@ -129,6 +131,6 @@ BEGIN
VALUES(vItemFk, vNewItemFk, 1) VALUES(vItemFk, vNewItemFk, 1)
ON DUPLICATE KEY UPDATE counter = counter + 1; ON DUPLICATE KEY UPDATE counter = counter + 1;
COMMIT; CALL util.tx_commit(vIsRequiredTx);
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -30,11 +30,16 @@ BEGIN
st.code stateCode, st.code stateCode,
sub2.code futureStateCode, sub2.code futureStateCode,
st.classColor, st.classColor,
sub2.classColor futureClassColor sub2.classColor futureClassColor,
am.id agencyFk,
am.name agency,
sub2.agencyModeFk futureAgencyFk,
sub2.agencyMode futureAgency
FROM vn.saleVolume sv FROM vn.saleVolume sv
JOIN vn.sale s ON s.id = sv.saleFk JOIN vn.sale s ON s.id = sv.saleFk
JOIN vn.item i ON i.id = s.itemFk JOIN vn.item i ON i.id = s.itemFk
JOIN vn.ticket t ON t.id = sv.ticketFk JOIN vn.ticket t ON t.id = sv.ticketFk
JOIN vn.agencyMode am ON am.id = t.agencyModeFk
JOIN vn.address a ON a.id = t.addressFk JOIN vn.address a ON a.id = t.addressFk
JOIN vn.province p ON p.id = a.provinceFk JOIN vn.province p ON p.id = a.provinceFk
JOIN vn.country c ON c.id = p.countryFk JOIN vn.country c ON c.id = p.countryFk
@ -54,8 +59,11 @@ BEGIN
st.name state, st.name state,
st.code, st.code,
st.classColor, st.classColor,
am.id agencyModeFk,
am.name agencyMode,
GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) iptd GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) iptd
FROM vn.ticket t FROM vn.ticket t
JOIN vn.agencyMode am ON am.id = t.agencyModeFk
JOIN vn.ticketState ts ON ts.ticketFk = t.id JOIN vn.ticketState ts ON ts.ticketFk = t.id
JOIN vn.state st ON st.id = ts.stateFk JOIN vn.state st ON st.id = ts.stateFk
JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.sale s ON s.ticketFk = t.id

View File

@ -10,14 +10,11 @@ BEGIN
DECLARE vDone BOOL; DECLARE vDone BOOL;
DECLARE vClientFk INT; DECLARE vClientFk INT;
DECLARE vCurTicketFk INT; DECLARE vCurTicketFk INT;
DECLARE vIsTaxDataChecked BOOL;
DECLARE vCompanyFk INT;
DECLARE vShipped DATE;
DECLARE vNewInvoiceId INT; DECLARE vNewInvoiceId INT;
DECLARE vHasDailyInvoice BOOL; DECLARE vHasDailyInvoice BOOL;
DECLARE vWithPackage BOOL; DECLARE vWithPackage BOOL;
DECLARE vHasToInvoice BOOL; DECLARE vHasToInvoice BOOL;
DECLARE vSerial VARCHAR(2); DECLARE vStateCode VARCHAR(45);
DECLARE cur CURSOR FOR DECLARE cur CURSOR FOR
SELECT ticketFk FROM tmp.ticket_close; SELECT ticketFk FROM tmp.ticket_close;
@ -38,18 +35,11 @@ BEGIN
LEAVE proc; LEAVE proc;
END IF; END IF;
SELECT SELECT c.id,
c.id,
c.isTaxDataChecked,
t.companyFk,
t.shipped,
c.hasDailyInvoice, c.hasDailyInvoice,
w.isManaged, w.isManaged,
c.hasToInvoice c.hasToInvoice
INTO vClientFk, INTO vClientFk,
vIsTaxDataChecked,
vCompanyFk,
vShipped,
vHasDailyInvoice, vHasDailyInvoice,
vWithPackage, vWithPackage,
vHasToInvoice vHasToInvoice
@ -59,7 +49,7 @@ BEGIN
WHERE t.id = vCurTicketFk; WHERE t.id = vCurTicketFk;
INSERT INTO ticketPackaging (ticketFk, packagingFk, quantity) INSERT INTO ticketPackaging (ticketFk, packagingFk, quantity)
(SELECT vCurTicketFk, p.id, COUNT(*) SELECT vCurTicketFk, p.id, COUNT(*)
FROM expedition e FROM expedition e
JOIN packaging p ON p.id = e.packagingFk JOIN packaging p ON p.id = e.packagingFk
JOIN ticket t ON t.id = e.ticketFk JOIN ticket t ON t.id = e.ticketFk
@ -68,39 +58,35 @@ BEGIN
WHERE e.ticketFk = vCurTicketFk AND p.isPackageReturnable WHERE e.ticketFk = vCurTicketFk AND p.isPackageReturnable
AND vWithPackage AND vWithPackage
AND NOT dm.`code`= 'PICKUP' AND NOT dm.`code`= 'PICKUP'
GROUP BY p.itemFk); GROUP BY p.itemFk;
-- No retornables o no catalogados -- No retornables o no catalogados
INSERT INTO sale (itemFk, ticketFk, concept, quantity, price, isPriceFixed) INSERT INTO sale (
(SELECT e.freightItemFk, vCurTicketFk, i.name, COUNT(*) AS amount, getSpecialPrice(e.freightItemFk, vClientFk), 1 itemFk,
ticketFk,
concept,
quantity,
price, isPriceFixed
)SELECT e.freightItemFk,
vCurTicketFk,
i.name,
COUNT(*) amount,
getSpecialPrice(e.freightItemFk, vClientFk),
TRUE
FROM expedition e FROM expedition e
JOIN item i ON i.id = e.freightItemFk JOIN item i ON i.id = e.freightItemFk
LEFT JOIN packaging p ON p.itemFk = i.id LEFT JOIN packaging p ON p.itemFk = i.id
WHERE e.ticketFk = vCurTicketFk AND IFNULL(p.isPackageReturnable, 0) = 0 WHERE e.ticketFk = vCurTicketFk
AND (p.isPackageReturnable = 0 OR p.isPackageReturnable IS NULL)
AND getSpecialPrice(e.freightItemFk, vClientFk) > 0 AND getSpecialPrice(e.freightItemFk, vClientFk) > 0
GROUP BY e.freightItemFk); GROUP BY e.freightItemFk;
IF(vHasDailyInvoice) AND vHasToInvoice THEN IF vHasDailyInvoice AND vHasToInvoice THEN
SELECT invoiceSerial(vClientFk, vCompanyFk, 'quick') INTO vSerial; SET vStateCode = 'DELIVERED';
IF vSerial IS NULL THEN
CALL util.throw('Cannot booking without a serial');
END IF;
CALL ticket_setState(vCurTicketFk, 'DELIVERED');
IF vIsTaxDataChecked THEN
CALL invoiceOut_newFromClient(
vClientFk,
vSerial,
vShipped,
vCompanyFk,
NULL,
NULL,
vNewInvoiceId);
END IF;
ELSE ELSE
CALL ticket_setState(vCurTicketFk, (SELECT vn.getAlert3State(vCurTicketFk))); SELECT getAlert3State(vCurTicketFk) INTO vStateCode;
END IF; END IF;
CALL ticket_setState(vCurTicketFk, vStateCode);
END LOOP; END LOOP;
CLOSE cur; CLOSE cur;

View File

@ -1,5 +1,7 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_doCmr`(vSelf INT) CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_doCmr`(
vSelf INT
)
BEGIN BEGIN
/** /**
* Crea u actualiza la información del CMR asociado con * Crea u actualiza la información del CMR asociado con
@ -19,6 +21,7 @@ BEGIN
a.id addressFk, a.id addressFk,
c2.defaultAddressFk, c2.defaultAddressFk,
IFNULL(sat.supplierFk, su.id) supplierFk, IFNULL(sat.supplierFk, su.id) supplierFk,
t.packages,
t.landed t.landed
FROM ticket t FROM ticket t
JOIN client c ON c.id = t.clientFk JOIN client c ON c.id = t.clientFk
@ -33,7 +36,7 @@ BEGIN
LEFT JOIN route r ON r.id = t.routeFk LEFT JOIN route r ON r.id = t.routeFk
LEFT JOIN worker wo ON wo.id = r.workerFk LEFT JOIN worker wo ON wo.id = r.workerFk
LEFT JOIN vehicle v ON v.id = r.vehicleFk LEFT JOIN vehicle v ON v.id = r.vehicleFk
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk LEFT JOIN agencyMode am ON am.id = t.agencyModeFk
LEFT JOIN agency ag ON ag.id = am.agencyFk LEFT JOIN agency ag ON ag.id = am.agencyFk
LEFT JOIN supplierAgencyTerm sat ON sat.agencyFk = ag.id LEFT JOIN supplierAgencyTerm sat ON sat.agencyFk = ag.id
AND wo.isFreelance AND wo.isFreelance
@ -52,6 +55,7 @@ BEGIN
c.addressToFk = t.addressFk, c.addressToFk = t.addressFk,
c.addressFromFk = t.defaultAddressFk, c.addressFromFk = t.defaultAddressFk,
c.supplierFk = t.supplierFk, c.supplierFk = t.supplierFk,
c.packagesList = t.packages,
c.ead = t.landed c.ead = t.landed
WHERE id = vCmrFk; WHERE id = vCmrFk;
ELSE ELSE
@ -62,6 +66,7 @@ BEGIN
addressToFk, addressToFk,
addressFromFk, addressFromFk,
supplierFk, supplierFk,
packagesList,
ead ead
) )
SELECT * FROM tTicket; SELECT * FROM tTicket;

View File

@ -1,53 +1,109 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_getProblems`( CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_getProblems`(
vIsTodayRelative tinyint(1) vIsTodayRelative TINYINT(1)
) )
BEGIN BEGIN
/** /**
* Calcula los problemas para un conjunto de tickets. * Calcula los problemas para un conjunto de tickets.
* Agrupados por ticket
* *
* @table tmp.sale_getProblems(ticketFk, clientFk, warehouseFk, shipped) Identificadores de los tickets a calcular * @param vIsTodayRelative Indica si se calcula el disponible como si todo saliera hoy
* @return tmp.ticket_problems * @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular
* @return tmp.ticketProblems, tmp.saleProblems
*/ */
CREATE OR REPLACE TEMPORARY TABLE tmp.sale (
saleFk INT(11),
PRIMARY KEY (saleFk)
) ENGINE = MEMORY
SELECT DISTINCT s.id saleFk
FROM tmp.ticket tt
JOIN ticket t ON t.id = tt.ticketFk
JOIN sale s ON s.ticketFk = t.id
GROUP BY s.id;
CALL sale_getProblems(vIsTodayRelative); CALL sale_getProblems(vIsTodayRelative);
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket_problems CREATE OR REPLACE TEMPORARY TABLE tmp.ticketProblems (
(PRIMARY KEY (ticketFk)) ticketFk INT(11),
ENGINE = MEMORY isFreezed BOOL DEFAULT FALSE,
SELECT ticketFk, risk DECIMAL(10,1) DEFAULT 0,
MAX(isFreezed) isFreezed, hasRisk BOOL DEFAULT FALSE,
MAX(risk) risk, hasHighRisk BOOL DEFAULT FALSE,
MAX(hasRisk) hasRisk, hasTicketRequest BOOL DEFAULT FALSE,
MAX(hasHighRisk) hasHighRisk, isTaxDataChecked BOOL DEFAULT FALSE,
MAX(hasTicketRequest) hasTicketRequest, isTooLittle BOOL DEFAULT FALSE,
MAX(itemShortage) itemShortage, isVip BOOL DEFAULT FALSE,
MIN(isTaxDataChecked) isTaxDataChecked, hasItemShortage BOOL DEFAULT FALSE,
MAX(hasComponentLack) hasComponentLack, hasItemDelay BOOL DEFAULT FALSE,
MAX(isTooLittle) isTooLittle, hasItemLost BOOL DEFAULT FALSE,
MAX(itemDelay) itemDelay, hasComponentLack BOOL DEFAULT FALSE,
MAX(hasRounding) hasRounding, hasRounding BOOL DEFAULT FALSE,
MAX(itemLost) itemLost, PRIMARY KEY (ticketFk)
MAX(isVip) isVip, ) ENGINE = MEMORY
WITH hasItemShortage AS(
SELECT s.ticketFk
FROM tmp.saleProblems sp
JOIN vn.sale s ON s.id = sp.saleFk
WHERE sp.hasItemShortage
GROUP BY s.ticketFk
),hasItemLost AS(
SELECT s.ticketFk
FROM tmp.saleProblems sp
JOIN vn.sale s ON s.id = sp.saleFk
WHERE sp.hasItemLost
GROUP BY s.ticketFk
),hasRounding AS(
SELECT s.ticketFk
FROM tmp.saleProblems sp
JOIN vn.sale s ON s.id = sp.saleFk
WHERE sp.hasRounding
GROUP BY s.ticketFk
), hasItemDelay AS(
SELECT s.ticketFk
FROM tmp.saleProblems sp
JOIN vn.sale s ON s.id = sp.saleFk
WHERE sp.hasItemDelay
GROUP BY s.ticketFk
), hasComponentLack AS(
SELECT s.ticketFk
FROM tmp.saleProblems sp
JOIN vn.sale s ON s.id = sp.saleFk
WHERE sp.hasComponentLack
GROUP BY s.ticketFk
)SELECT tt.ticketFk,
FIND_IN_SET('isFreezed', t.problem) > 0 isFreezed,
t.risk,
FIND_IN_SET('hasRisk', t.problem) > 0 hasRisk,
FIND_IN_SET('hasHighRisk', t.problem) > 0 hasHighRisk,
FIND_IN_SET('hasTicketRequest', t.problem) > 0 hasTicketRequest,
FIND_IN_SET('isTaxDataChecked', t.problem) > 0 isTaxDataChecked,
FIND_IN_SET('isTooLittle', t.problem) > 0
AND util.VN_NOW() < (util.VN_CURDATE() +
INTERVAL HOUR(zc.`hour`) HOUR) +
INTERVAL MINUTE(zc.`hour`) MINUTE isTooLittle,
c.businessTypeFk = 'VIP' isVip,
NOT (his.ticketFk IS NULL) hasItemShortage,
NOT (hid.ticketFk IS NULL) hasItemDelay,
NOT (hil.ticketFk IS NULL) hasItemLost,
NOT (hcl.ticketFk IS NULL) hasComponentLack,
NOT (hr.ticketFk IS NULL) hasRounding,
0 totalProblems 0 totalProblems
FROM tmp.sale_problems FROM tmp.ticket tt
GROUP BY ticketFk; JOIN vn.ticket t ON t.id = tt.ticketFk
JOIN vn.client c ON c.id = t.clientFk
LEFT JOIN hasItemShortage his ON his.ticketFk = t.id
LEFT JOIN hasItemLost hil ON hil.ticketFk = t.id
LEFT JOIN hasRounding hr ON hr.ticketFk = t.id
LEFT JOIN hasItemDelay hid ON hid.ticketFk = t.id
LEFT JOIN hasComponentLack hcl ON hcl.ticketFk = t.id
LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk
AND zc.dated = util.VN_CURDATE()
GROUP BY t.id;
UPDATE tmp.ticket_problems UPDATE tmp.ticketProblems
SET totalProblems = ( SET totalProblems = isFreezed + hasHighRisk + hasTicketRequest +
(isFreezed) + isTaxDataChecked + hasComponentLack + hasItemDelay +
(hasHighRisk) + isTooLittle + hasItemLost + hasRounding + hasItemShortage + isVip;
(hasTicketRequest) +
(!isTaxDataChecked) +
(hasComponentLack) +
(itemDelay IS NOT NULL) +
(isTooLittle) +
(itemLost IS NOT NULL) +
(hasRounding IS NOT NULL) +
(itemShortage IS NOT NULL) +
(isVip)
);
DROP TEMPORARY TABLE tmp.sale_problems; DROP TEMPORARY TABLE tmp.sale;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -25,7 +25,7 @@ BEGIN
LEFT JOIN agencyMode am ON am.id = tt.agencyModeFk LEFT JOIN agencyMode am ON am.id = tt.agencyModeFk
LEFT JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk LEFT JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
WHERE dm.code IN ('AGENCY') WHERE dm.code IN ('AGENCY')
AND it.isFragile; AND (it.isFragile OR i.isFragile);
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket_warnings CREATE OR REPLACE TEMPORARY TABLE tmp.ticket_warnings
(PRIMARY KEY (ticketFk)) (PRIMARY KEY (ticketFk))

View File

@ -3,21 +3,25 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_setState`(
vSelf INT, vSelf INT,
vStateCode VARCHAR(255) COLLATE utf8_general_ci vStateCode VARCHAR(255) COLLATE utf8_general_ci
) )
BEGIN proc:BEGIN
/** /**
* Modifica el estado de un ticket si se cumplen las condiciones necesarias. * Modifica el estado de un ticket si se cumplen las condiciones necesarias.
* *
* @param vSelf el id del ticket * @param vSelf el id del ticket
* @param vStateCode estado a modificar del ticket * @param vStateCode estado a modificar del ticket
*/ */
DECLARE vticketAlertLevel INT; DECLARE vTicketAlertLevel INT;
DECLARE vTicketStateCode VARCHAR(255); DECLARE vTicketStateCode VARCHAR(255) COLLATE utf8_general_ci;
DECLARE vCanChangeState BOOL; DECLARE vCanChangeState BOOL;
DECLARE vPackedAlertLevel INT; DECLARE vPackedAlertLevel INT;
DECLARE vZoneFk INT; DECLARE vZoneFk INT;
DECLARE vOldWorkerFk INT;
DECLARE vNewWorkerFk INT;
SELECT s.alertLevel, s.`code`, t.zoneFk SET vNewWorkerFk = account.myUser_getId();
INTO vticketAlertLevel, vTicketStateCode, vZoneFk
SELECT s.alertLevel, s.`code`, t.zoneFk, tt.userFk
INTO vTicketAlertLevel, vTicketStateCode, vZoneFk, vOldWorkerFk
FROM state s FROM state s
JOIN ticketTracking tt ON tt.stateFk = s.id JOIN ticketTracking tt ON tt.stateFk = s.id
JOIN ticket t ON t.id = tt.ticketFk JOIN ticket t ON t.id = tt.ticketFk
@ -33,24 +37,27 @@ BEGIN
SET vCanChangeState = (( SET vCanChangeState = ((
vStateCode <> 'ON_CHECKING' AND vStateCode <> 'CHECKED') OR vStateCode <> 'ON_CHECKING' AND vStateCode <> 'CHECKED') OR
vticketAlertLevel < vPackedAlertLevel vTicketAlertLevel < vPackedAlertLevel
) AND NOT ( ) AND NOT (
vTicketStateCode IN ('CHECKED', 'CHECKING') vTicketStateCode IN ('CHECKED', 'CHECKING')
AND vStateCode IN ('PREPARED', 'ON_PREPARATION') AND vStateCode IN ('PREPARED', 'ON_PREPARATION')
); );
IF vCanChangeState THEN IF vCanChangeState THEN
INSERT INTO ticketTracking (stateFk, ticketFk, userFk)
SELECT id, vSelf, account.myUser_getId()
FROM state
WHERE `code` = vStateCode COLLATE utf8_unicode_ci;
IF vStateCode = 'PACKED' THEN IF vStateCode = 'PACKED' THEN
CALL ticket_doCmr(vSelf); CALL ticket_doCmr(vSelf);
END IF; END IF;
IF vStateCode = vTicketStateCode AND vOldWorkerFk = vNewWorkerFk THEN
LEAVE proc;
END IF;
INSERT INTO ticketTracking (stateFk, ticketFk, userFk)
SELECT id, vSelf, vNewWorkerFk
FROM state
WHERE `code` = vStateCode COLLATE utf8_unicode_ci;
ELSE ELSE
CALL util.throw('INCORRECT_TICKET_STATE'); CALL util.throw('INCORRECT_TICKET_STATE');
END IF; END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -10,7 +10,6 @@ BEGIN
IF NEW.isBooked = OLD.isBooked AND ( IF NEW.isBooked = OLD.isBooked AND (
NOT (NEW.supplierFk <=> OLD.supplierFk) OR NOT (NEW.supplierFk <=> OLD.supplierFk) OR
NOT (NEW.dated <=> OLD.dated) OR
NOT (NEW.travelFk <=> OLD.travelFk) OR NOT (NEW.travelFk <=> OLD.travelFk) OR
NOT (NEW.companyFk <=> OLD.companyFk) OR NOT (NEW.companyFk <=> OLD.companyFk) OR
NOT (NEW.invoiceInFk <=> OLD.invoiceInFk) OR NOT (NEW.invoiceInFk <=> OLD.invoiceInFk) OR

View File

@ -0,0 +1,12 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`mandate_afterDelete`
AFTER DELETE ON `mandate`
FOR EACH ROW
BEGIN
INSERT INTO mandateLog
SET `action` = 'delete',
`changedModel` = 'mandate',
`changedModelId` = OLD.id,
`userFk` = account.myUser_getId();
END$$
DELIMITER ;

View File

@ -3,6 +3,8 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`mandate_beforeInsert`
BEFORE INSERT ON `mandate` BEFORE INSERT ON `mandate`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
SET NEW.editorFk = account.myUser_getId();
IF (NEW.code IS NULL) THEN IF (NEW.code IS NULL) THEN
SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT
FROM information_schema.TABLES FROM information_schema.TABLES

View File

@ -0,0 +1,8 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`mandate_beforeUpdate`
BEFORE INSERT ON `mandate`
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
END$$
DELIMITER ;

View File

@ -1,26 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmapStop_beforeDelete`
BEFORE DELETE ON `roadmapStop`
FOR EACH ROW
BEGIN
DECLARE vMaxEta DATETIME;
DECLARE vRoadmapEta DATETIME;
IF OLD.roadmapFk IS NOT NULL THEN
SELECT MAX(eta) INTO vMaxEta
FROM roadmapStop
WHERE roadmapFk = OLD.roadmapFk
AND id <> OLD.id;
SELECT eta INTO vRoadmapEta
FROM roadmap
WHERE id = OLD.roadmapFk;
IF vMaxEta <> vRoadmapEta OR vMaxEta IS NULL THEN
UPDATE roadmap
SET eta = vMaxEta
WHERE id = OLD.roadmapFk;
END IF;
END IF;
END$$
DELIMITER ;

View File

@ -3,8 +3,6 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmapStop_beforeInser
BEFORE INSERT ON `roadmapStop` BEFORE INSERT ON `roadmapStop`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
DECLARE vRoadmapEta DATETIME;
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
IF NEW.description IS NOT NULL THEN IF NEW.description IS NOT NULL THEN
@ -16,17 +14,5 @@ BEGIN
CALL util.throw('Departure time can not be after arrival time'); CALL util.throw('Departure time can not be after arrival time');
END IF; END IF;
END IF; END IF;
IF NEW.roadmapFk IS NOT NULL AND NEW.eta IS NOT NULL THEN
SELECT eta INTO vRoadmapEta
FROM roadmap
WHERE id = NEW.roadmapFk;
IF vRoadmapEta < NEW.eta OR vRoadmapEta IS NULL THEN
UPDATE roadmap
SET eta = NEW.eta
WHERE id = NEW.roadmapFk;
END IF;
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -3,40 +3,17 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmapStop_beforeUpdat
BEFORE UPDATE ON `roadmapStop` BEFORE UPDATE ON `roadmapStop`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
DECLARE vMaxEta DATETIME;
DECLARE vCurrentEta DATETIME;
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
IF NOT (NEW.description <=> OLD.description) THEN IF NOT (NEW.description <=> OLD.description) THEN
SET NEW.description = UCASE(NEW.description); SET NEW.description = UCASE(NEW.description);
END IF; END IF;
IF (NOT (NEW.roadmapFk <=> OLD.roadmapFk) AND NEW.roadmapFk IS NOT NULL) IF NOT (NEW.roadmapFk <=> OLD.roadmapFk) OR NOT (NEW.eta <=> OLD.eta) THEN
OR (NOT (NEW.eta <=> OLD.eta)) THEN
IF NEW.eta < (SELECT etd FROM roadmap WHERE id = NEW.roadmapFk) THEN IF NEW.eta < (SELECT etd FROM roadmap WHERE id = NEW.roadmapFk) THEN
CALL util.throw('Departure time can not be after arrival time'); CALL util.throw('Departure time can not be after arrival time');
END IF; END IF;
SELECT MAX(eta) INTO vMaxEta
FROM roadmapStop
WHERE roadmapFk = NEW.roadmapFk
AND id <> OLD.id;
IF vMaxEta < NEW.eta OR vMaxEta IS NULL THEN
SET vMaxEta = NEW.eta;
END IF;
SELECT eta INTO vCurrentEta
FROM roadmap
WHERE id = NEW.roadmapFk;
IF (vMaxEta <> vCurrentEta OR vMaxEta IS NULL) OR vMaxEta IS NOT NULL THEN
UPDATE roadmap
SET eta = vMaxEta
WHERE id = NEW.roadmapFk;
END IF;
END IF; END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,17 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmap_afterUpdate`
AFTER UPDATE ON `roadmap`
FOR EACH ROW
BEGIN
DECLARE vSeconds INT;
IF NOT (NEW.etd <=> OLD.etd) THEN
SET vSeconds = TIME_TO_SEC(TIMEDIFF(NEW.etd, OLD.etd));
IF vSeconds IS NOT NULL AND vSeconds <> 0 THEN
UPDATE roadmapStop
SET eta = eta + INTERVAL vSeconds SECOND
WHERE roadmapFk = NEW.id;
END IF;
END IF;
END$$
DELIMITER ;

View File

@ -3,6 +3,8 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmap_beforeUpdate`
BEFORE UPDATE ON `roadmap` BEFORE UPDATE ON `roadmap`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
DECLARE vSeconds INT;
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
IF NOT (NEW.name <=> OLD.name) THEN IF NOT (NEW.name <=> OLD.name) THEN
@ -37,5 +39,15 @@ BEGIN
FROM worker w FROM worker w
WHERE w.id = NEW.driverChangeFk); WHERE w.id = NEW.driverChangeFk);
END IF; END IF;
IF NOT (NEW.etd <=> OLD.etd) THEN
SET vSeconds = TIME_TO_SEC(TIMEDIFF(NEW.etd, OLD.etd));
IF vSeconds <> 0 THEN
UPDATE roadmapStop
SET eta = eta + INTERVAL vSeconds SECOND
WHERE roadmapFk = NEW.id;
END IF;
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -0,0 +1,8 @@
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`roadmapEta`
AS SELECT `roadmapFk` AS id,
MAX(`eta`) AS `eta`
FROM `vn`.`roadmapStop`
WHERE `roadmapFk` IS NOT NULL
GROUP BY `roadmapFk`;

View File

@ -16,7 +16,6 @@ AS SELECT `t`.`id` AS `id`,
`t`.`kg` AS `kg`, `t`.`kg` AS `kg`,
`t`.`cargoSupplierFk` AS `cargoSupplierFk`, `t`.`cargoSupplierFk` AS `cargoSupplierFk`,
`t`.`totalEntries` AS `totalEntries`, `t`.`totalEntries` AS `totalEntries`,
`t`.`appointment` AS `appointment`,
`t`.`awbFk` AS `awbFk`, `t`.`awbFk` AS `awbFk`,
`t`.`isRaid` AS `isRaid`, `t`.`isRaid` AS `isRaid`,
`t`.`daysInForward` AS `daysInForward` `t`.`daysInForward` AS `daysInForward`

View File

@ -0,0 +1,6 @@
INSERT IGNORE INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES
('Ticket','itemLack','READ','ALLOW','ROLE','employee'),
('Ticket','itemLackDetail','READ','ALLOW','ROLE','employee'),
('Ticket','split','WRITE','ALLOW','ROLE','employee'),
('Sale','replaceItem','WRITE','ALLOW','ROLE','employee');

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.ticketConfig ADD lackAlertPrice int(11) DEFAULT 30 NOT NULL COMMENT 'Value to alert when item proposal exceed price';
ALTER TABLE vn.ticketConfig ADD lackScopeDays int(11) DEFAULT 2 NOT NULL COMMENT 'Number of days to look back for ticket with negatives';

View File

@ -0,0 +1,3 @@
-- Place your SQL code here
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('Ticket','getTicketProblems','READ','ALLOW','ROLE','employee');

View File

@ -0,0 +1,23 @@
CREATE TABLE vn.parkingCoordinates (
parkingFk int(11) NOT NULL,
x varchar(5) NOT NULL,
y varchar(5) NOT NULL,
z varchar(5) NOT NULL,
CONSTRAINT parkingCoordinates_pk PRIMARY KEY (parkingFk),
CONSTRAINT parkingCoordinates_parking_FK FOREIGN KEY (parkingFk) REFERENCES vn.parking(id) ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci;
INSERT INTO vn.parkingCoordinates (parkingFk, x, y, z)
SELECT id, `column`, `row`, `floor`
FROM vn.parking
WHERE `column` IS NOT NULL
OR `row` IS NOT NULL
OR `floor` IS NOT NULL;
ALTER TABLE vn.parking
DROP COLUMN `column`,
DROP COLUMN `row`,
DROP COLUMN `floor`;

View File

@ -0,0 +1,41 @@
USE vn;
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES ('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'administrative'),
('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('Vehicle', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
('Vehicle', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('Vehicle', 'findById', 'READ', 'ALLOW', 'ROLE', 'administrative'),
('Vehicle', 'findById', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('Vehicle', '__get__active', 'READ', 'ALLOW', 'ROLE', 'employee'),
('Vehicle', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
('Vehicle', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('Vehicle', 'create', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
('Vehicle', 'create', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('BankPolicy', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
('BankPolicy', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('VehicleState', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
('VehicleState', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative' ),
('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant' ),
('VehicleType', 'find', 'READ', 'ALLOW', 'ROLE', 'employee'),
('DeliveryPoint', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('DeliveryPoint', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative');
CREATE TABLE IF NOT EXISTS vehicleType (
id INT(11) PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(45) NOT NULL
);
INSERT IGNORE INTO vehicleType (id, name)
VALUES (1,'vehículo empresa'),
(2, 'furgoneta'),
(3, 'cabeza tractora'),
(4, 'remolque');
ALTER TABLE vehicle ADD COLUMN importCooler decimal(10,2) DEFAULT NULL;
ALTER TABLE vehicle ADD COLUMN vehicleTypeFk INT(11) DEFAULT 1;
ALTER TABLE vehicle ADD CONSTRAINT fk_vehicle_vehicleType FOREIGN KEY (vehicleTypeFk) REFERENCES vehicleType(id);

View File

@ -0,0 +1,90 @@
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('Entry','getBuyList','READ','ALLOW','ROLE','buyer'),
('Entry','getBuyUltimate','READ','ALLOW','ROLE','buyer'),
('Entry','search','READ','ALLOW','ROLE','buyer'),
('Entry','create','WRITE','ALLOW','ROLE','buyer'),
('Entry','cloneEntry','WRITE','ALLOW','ROLE','buyer'),
('Entry','deleteEntry','WRITE','ALLOW','ROLE','buyer'),
('Entry','recalcEntryPrices','WRITE','ALLOW','ROLE','buyer'),
('EntryType','find','READ','ALLOW','ROLE','buyer'),
('EntryConfig','findOne','READ','ALLOW','ROLE','buyer');
ALTER TABLE vn.ink ADD IF NOT EXISTS hexJson TEXT NOT NULL;
UPDATE vn.ink
SET hexJson = CONCAT('{"value": ["',hex,'"]}');
UPDATE vn.ink
SET hexJson = CASE `name`
WHEN 'Blanco/Naranja' THEN '{"value": ["FFFFFF", "FFA500"]}'
WHEN 'Sin especificar' THEN '{"value": ["808080"]}'
WHEN '2 Colores' THEN '{"value": ["000000", "FFFFFF"]}'
WHEN 'Amarillo/Marrón' THEN '{"value": ["FFFF00", "8B4513"]}'
WHEN 'Amarillo/Naranja' THEN '{"value": ["FFFF00", "FFA500"]}'
WHEN 'Rosa/Blanco/Amarillo' THEN '{"value": ["FFC0CB", "FFFFFF", "FFFF00"]}'
WHEN 'Rosa/Amarillo' THEN '{"value": ["FFC0CB", "FFFF00"]}'
WHEN 'Antracita' THEN '{"value": ["2F2F2F"]}'
WHEN 'Azul/Amarillo' THEN '{"value": ["0000FF", "FFFF00"]}'
WHEN 'Azul Claro' THEN '{"value": ["ADD8E6"]}'
WHEN 'Azul/Marron' THEN '{"value": ["0000FF", "8B4513"]}'
WHEN 'Azul/Verde' THEN '{"value": ["0000FF", "008000"]}'
WHEN 'Blanco/Amarillo' THEN '{"value": ["FFFFFF", "FFFF00"]}'
WHEN 'Blaugrana' THEN '{"value": ["A50044", "004D98"]}'
WHEN 'Blanco/Negro' THEN '{"value": ["FFFFFF", "000000"]}'
WHEN 'Blanco/Verde' THEN '{"value": ["FFFFFF", "008000"]}'
WHEN 'Blanco/Azul' THEN '{"value": ["FFFFFF", "0000FF"]}'
WHEN 'Blanco/Rosa' THEN '{"value": ["FFFFFF", "FFC0CB"]}'
WHEN 'Cognac/Verde' THEN '{"value": ["9A463D", "008000"]}'
WHEN 'Champagne/Verde' THEN '{"value": ["F7E7CE", "008000"]}'
WHEN 'Camuflaje' THEN '{"value": ["6B8E23", "556B2F", "8B4513"]}'
WHEN 'Crema/Rosa' THEN '{"value": ["FFFDD0", "FFC0CB"]}'
WHEN 'Fucsia/Amarillo' THEN '{"value": ["FF00FF", "FFFF00"]}'
WHEN 'Fucsia/Blanco' THEN '{"value": ["FF00FF", "FFFFFF"]}'
WHEN 'Fucsia/Crema' THEN '{"value": ["FF00FF", "FFFDD0"]}'
WHEN 'Fucsia/Rosa' THEN '{"value": ["FF00FF", "FFC0CB"]}'
WHEN 'Fucsia/Verde' THEN '{"value": ["FF00FF", "008000"]}'
WHEN 'Granate/Blanco' THEN '{"value": ["800000", "FFFFFF"]}'
WHEN 'Gris Lila' THEN '{"value": ["808080", "C8A2C8"]}'
WHEN 'Lavanda/Amarillo' THEN '{"value": ["E6E6FA", "FFFF00"]}'
WHEN 'Lavanda/Gris' THEN '{"value": ["E6E6FA", "808080"]}'
WHEN 'Lividum' THEN '{"value": ["702963"]}'
WHEN 'Morado/Amarillo' THEN '{"value": ["800080", "FFFF00"]}'
WHEN 'Marrón/Blanco' THEN '{"value": ["8B4513", "FFFFFF"]}'
WHEN 'Marron/Gris' THEN '{"value": ["8B4513", "808080"]}'
WHEN 'Marron/Negro' THEN '{"value": ["8B4513", "000000"]}'
WHEN 'Marrón/Verde' THEN '{"value": ["8B4513", "008000"]}'
WHEN 'Matizado' THEN '{"value": ["D3D3D3", "808080", "FFFFFF"]}'
WHEN 'Mixto' THEN '{"value": ["FF0000", "0000FF", "008000", "FFFF00"]}'
WHEN 'Marrón Oscuro' THEN '{"value": ["654321"]}'
WHEN 'Naranja/Marron' THEN '{"value": ["FFA500", "8B4513"]}'
WHEN 'Naranja/Rosa' THEN '{"value": ["FFA500", "FFC0CB"]}'
WHEN 'Ocre/Burgundi' THEN '{"value": ["CC7722", "800020"]}'
WHEN 'Oro/Plata' THEN '{"value": ["FFD700", "C0C0C0"]}'
WHEN 'Oro/Negro' THEN '{"value": ["FFD700", "000000"]}'
WHEN 'Oro/Verde' THEN '{"value": ["FFD700", "008000"]}'
WHEN 'Purpura/Blanco' THEN '{"value": ["800080", "FFFFFF"]}'
WHEN 'Purpura/Rosa' THEN '{"value": ["800080", "FFC0CB"]}'
WHEN 'Pastel' THEN '{"value": ["FFB6C1", "87CEFA", "98FB98"]}'
WHEN 'Plata' THEN '{"value": ["C0C0C0"]}'
WHEN 'Plata/Verde' THEN '{"value": ["C0C0C0", "008000"]}'
WHEN 'Rojo/Amarillo' THEN '{"value": ["FF0000", "FFFF00"]}'
WHEN 'Rojo/Blanco' THEN '{"value": ["FF0000", "FFFFFF"]}'
WHEN 'Rojo/Naranja' THEN '{"value": ["FF0000", "FFA500"]}'
WHEN 'Rojo/Oro' THEN '{"value": ["FF0000", "FFD700"]}'
WHEN 'Rojo/Verde' THEN '{"value": ["FF0000", "008000"]}'
WHEN 'Rosa/Lila' THEN '{"value": ["FFC0CB", "C8A2C8"]}'
WHEN 'Rosa/Naranja' THEN '{"value": ["FFC0CB", "FFA500"]}'
WHEN 'Rojo/Rosa' THEN '{"value": ["FF0000", "FFC0CB"]}'
WHEN 'Rosa empolvado' THEN '{"value": ["E6B8AF"]}'
WHEN 'Rosa/Verde' THEN '{"value": ["FFC0CB", "008000"]}'
WHEN 'Topo/Blanco' THEN '{"value": ["8B8589", "FFFFFF"]}'
WHEN 'Topo' THEN '{"value": ["8B8589"]}'
WHEN 'Transparente' THEN '{"value": ["00000000"]}'
WHEN 'Verde/Amarillo' THEN '{"value": ["008000", "FFFF00"]}'
WHEN 'Verde/Negro' THEN '{"value": ["008000", "000000"]}'
WHEN 'Variado' THEN '{"value": ["FF0000", "0000FF", "008000", "FFFF00", "FFA500"]}'
WHEN 'Verde Claro/Morado' THEN '{"value": ["90EE90", "800080"]}'
WHEN 'Verde/Lila' THEN '{"value": ["008000", "C8A2C8"]}'
WHEN 'Vaquero Neon' THEN '{"value": ["1560BD", "FFFF00"]}'
ELSE hexJson
END;

View File

@ -0,0 +1,6 @@
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES
('WorkerDms', 'hasHighPrivs', 'READ', 'ALLOW', 'ROLE', 'hr'),
('Business', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'hr'),
('Worker', '__get__business', 'READ', 'ALLOW', 'ROLE', 'hr')
;

View File

@ -0,0 +1,23 @@
CREATE OR REPLACE TABLE vn.mandateLog (
`id` int(11) NOT NULL AUTO_INCREMENT,
`originFk` int(11) DEFAULT NULL,
`userFk` int(10) unsigned DEFAULT NULL,
`action` set('insert','update','delete','select') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`changedModel` enum('client') NOT NULL DEFAULT 'client',
`oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
`newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
`changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
`summaryId` varchar(30) DEFAULT NULL,
`reason` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `logMandate_userFk` (`userFk`),
KEY `mandateLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
KEY `mandateLog_originFk` (`originFk`,`creationDate`),
KEY `mandateLog_creationDate_IDX` (`creationDate` DESC) USING BTREE,
CONSTRAINT `mandateUserFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
ALTER TABLE vn.mandate ADD editorFk INT UNSIGNED DEFAULT NULL NULL;

View File

@ -0,0 +1 @@
ALTER TABLE vn.recovery DROP FOREIGN KEY cliente333;

View File

@ -0,0 +1,3 @@
ALTER TABLE vn.roadmap
MODIFY COLUMN dollyPlate varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL COMMENT
'Vehículo sin motor diseñado para conectarse a una unidad tractora, un camión o un vehículo tractor con fuerte potencia de tracción';

View File

@ -0,0 +1,3 @@
ALTER TABLE vn.volumeConfig ADD COLUMN id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
GRANT UPDATE (palletM3) ON vn.volumeConfig TO deliveryBoss;

View File

@ -0,0 +1,3 @@
ALTER TABLE vn.vehicle
MODIFY COLUMN typeFk enum('car','van','truck','trailer','tug','dolly','trailerLink')
CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 'van' NOT NULL;

View File

@ -0,0 +1 @@
ALTER TABLE vn.roadmap DROP COLUMN eta;

View File

@ -0,0 +1,8 @@
UPDATE vn.expedition e
JOIN (
SELECT id
FROM vn.expedition
WHERE hostFk COLLATE utf8mb3_unicode_ci NOT IN
(SELECT code COLLATE utf8mb3_unicode_ci FROM vn.host WHERE code IS NOT NULL)
) s ON e.id = s.id
SET e.hostFk = 'pc336';

View File

@ -0,0 +1,9 @@
ALTER TABLE vn.expedition
MODIFY COLUMN hostFk VARCHAR(30) COLLATE utf8mb3_general_ci;
ALTER TABLE vn.expedition
ADD CONSTRAINT fk_expedition_host_code
FOREIGN KEY (hostFk)
REFERENCES host(code)
ON UPDATE CASCADE
ON DELETE CASCADE;

View File

@ -58,10 +58,10 @@
"Swift / BIC can't be empty": "Swift / BIC can't be empty", "Swift / BIC can't be empty": "Swift / BIC can't be empty",
"Deleted sales from ticket": "I have deleted the following lines from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}", "Deleted sales from ticket": "I have deleted the following lines from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}",
"Added sale to ticket": "I have added the following line to the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}", "Added sale to ticket": "I have added the following line to the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
"Changed sale discount": "I have changed the following lines discounts from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}", "Changed sale discount": "I have changed the following lines discounts from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}} {{ticketWeekly}}",
"Created claim": "I have created the claim [{{claimId}}]({{{claimUrl}}}) for the following lines from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}", "Created claim": "I have created the claim [{{claimId}}]({{{claimUrl}}}) for the following lines from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
"Changed sale price": "I have changed the price of [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) from {{oldPrice}}€ ➔ *{{newPrice}}€* of the ticket [{{ticketId}}]({{{ticketUrl}}})", "Changed sale price": "I have changed the price of [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) from {{oldPrice}}€ ➔ *{{newPrice}}€* of the ticket [{{ticketId}}]({{{ticketUrl}}}) {{ticketWeekly}}",
"Changed sale quantity": "I have changed {{changes}} of the ticket [{{ticketId}}]({{{ticketUrl}}})", "Changed sale quantity": "I have changed {{changes}} of the ticket [{{ticketId}}]({{{ticketUrl}}}) {{ticketWeekly}}",
"Changes in sales": "the quantity of [{{itemId}} {{concept}}]({{{itemUrl}}}) from {{oldQuantity}} ➔ *{{newQuantity}}*", "Changes in sales": "the quantity of [{{itemId}} {{concept}}]({{{itemUrl}}}) from {{oldQuantity}} ➔ *{{newQuantity}}*",
"Changed sale reserved state": "I have changed the following lines reserved state from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}", "Changed sale reserved state": "I have changed the following lines reserved state from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
"Bought units from buy request": "Bought {{quantity}} units of [{{itemId}} {{concept}}]({{{urlItem}}}) for the ticket id [{{ticketId}}]({{{url}}})", "Bought units from buy request": "Bought {{quantity}} units of [{{itemId}} {{concept}}]({{{urlItem}}}) for the ticket id [{{ticketId}}]({{{url}}})",
@ -234,6 +234,7 @@
"It has been invoiced but the PDF of refund not be generated": "It has been invoiced but the PDF of refund not be generated", "It has been invoiced but the PDF of refund not be generated": "It has been invoiced but the PDF of refund not be generated",
"Cannot add holidays on this day": "Cannot add holidays on this day", "Cannot add holidays on this day": "Cannot add holidays on this day",
"Cannot send mail": "Cannot send mail", "Cannot send mail": "Cannot send mail",
"This worker already exists": "This worker already exists",
"CONSTRAINT `chkParkingCodeFormat` failed for `vn`.`parking`": "CONSTRAINT `chkParkingCodeFormat` failed for `vn`.`parking`", "CONSTRAINT `chkParkingCodeFormat` failed for `vn`.`parking`": "CONSTRAINT `chkParkingCodeFormat` failed for `vn`.`parking`",
"This postcode already exists": "This postcode already exists", "This postcode already exists": "This postcode already exists",
"Original invoice not found": "Original invoice not found", "Original invoice not found": "Original invoice not found",
@ -253,5 +254,8 @@
"Sales already moved": "Sales already moved", "Sales already moved": "Sales already moved",
"Holidays to past days not available": "Holidays to past days not available", "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 }}", "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}} of route {{{fullUrl}}} has been delivered out of order." "Ticket has been delivered out of order": "The ticket {{ticket}} of route {{{fullUrl}}} has been delivered out of order.",
"clonedFromTicketWeekly": ", that is a cloned sale from ticket {{ ticketWeekly }}",
"negativeReplaced": "Replaced item [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} with [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} from ticket [{{ticketId}}]({{{ticketUrl}}})",
"The tag and priority can't be repeated": "The tag and priority can't be repeated"
} }

View File

@ -121,10 +121,10 @@
"Incoterms is required for a non UEE member": "El incoterms es requerido para los clientes extracomunitarios", "Incoterms is required for a non UEE member": "El incoterms es requerido para los clientes extracomunitarios",
"Deleted sales from ticket": "He eliminado las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}", "Deleted sales from ticket": "He eliminado las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}",
"Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}", "Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
"Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}", "Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}} {{ticketWeekly}}",
"Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}", "Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
"Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}})", "Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}}) {{ticketWeekly}} ",
"Changed sale quantity": "He cambiado {{changes}} del ticket [{{ticketId}}]({{{ticketUrl}}})", "Changed sale quantity": "He cambiado {{changes}} del ticket [{{ticketId}}]({{{ticketUrl}}}) {{ticketWeekly}}",
"Changes in sales": "la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}*", "Changes in sales": "la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}*",
"State": "Estado", "State": "Estado",
"regular": "normal", "regular": "normal",
@ -396,6 +396,7 @@
"There are tickets to be invoiced": "La zona tiene tickets por facturar", "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 }}", "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 sido entregado en su orden.", "Ticket has been delivered out of order": "El ticket {{ticket}} {{{fullUrl}}} no ha sido entregado en su orden.",
"Price cannot be blank": "El precio no puede estar en blanco" "Price cannot be blank": "El precio no puede estar en blanco",
"clonedFromTicketWeekly": ", que es una linea clonada del ticket {{ticketWeekly}}",
"negativeReplaced": "Sustituido el articulo [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} por [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} del ticket [{{ticketId}}]({{{ticketUrl}}})"
} }

View File

@ -368,5 +368,6 @@
"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 }}", "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}} de la route {{{fullUrl}}} a été livré hors service." "Ticket has been delivered out of order": "Le ticket {{ticket}} de la route {{{fullUrl}}} a été livré hors service.",
"negativeReplaced": "Remplacé l'article [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} par [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} du ticket [{{ticketId}}]({{{ticketUrl}}})"
} }

View File

@ -367,5 +367,6 @@
"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 }}", "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}} da rota {{{fullUrl}}} foi entregue fora de ordem." "Ticket has been delivered out of order": "O ticket {{ticket}} da rota {{{fullUrl}}} foi entregue fora de ordem.",
"negativeReplaced": "Substituído o artigo [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} por [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} do ticket [{{ticketId}}]({{{ticketUrl}}})"
} }

View File

@ -1,4 +1,4 @@
name: muestra name: plantilla
columns: columns:
id: id id: id
created: creado created: creado

View File

@ -0,0 +1,10 @@
name: mandate
columns:
id: id
clientFk: client
companyFk: company
code: code
created: created
finished: finished
mandateTypeFk: mandate type
editorFk: editor

View File

@ -0,0 +1,10 @@
name: mandate
columns:
id: id
clientFk: cliente
companyFk: empresa
code: código
created: creado
finished: finalizado
mandateTypeFk: tipo de mandato
editorFk: editor

View File

@ -248,9 +248,10 @@ module.exports = Self => {
const models = Self.app.models; const models = Self.app.models;
const loopBackContext = LoopBackContext.getCurrentContext(); const loopBackContext = LoopBackContext.getCurrentContext();
const accessToken = {req: loopBackContext.active.accessToken};
const editVerifiedDataWithoutTaxDataChecked = models.ACL.checkAccessAcl( const accessToken = {req: {accessToken: loopBackContext.active.accessToken}};
const editVerifiedDataWithoutTaxDataChecked = await models.ACL.checkAccessAcl(
accessToken, accessToken,
'Client', 'Client',
'editVerifiedDataWithoutTaxDataCheck', 'editVerifiedDataWithoutTaxDataCheck',

View File

@ -1,6 +1,9 @@
{ {
"name": "Mandate", "name": "Mandate",
"base": "VnModel", "base": "VnModel",
"mixins": {
"Loggable": true
},
"options": { "options": {
"mysql": { "mysql": {
"table": "mandate" "table": "mandate"

View File

@ -0,0 +1,303 @@
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
const buildFilter = require('vn-loopback/util/filter').buildFilter;
const mergeFilters = require('vn-loopback/util/filter').mergeFilters;
module.exports = Self => {
Self.remoteMethodCtx('getBuyList', {
description: 'Returns buys for editing of one entry',
accessType: 'READ',
accepts: [{
arg: 'entryFk',
type: 'number',
required: true,
description: 'The entry id',
http: {source: 'path'}
},
{
arg: 'filter',
type: 'object',
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string'
},
{
arg: 'isIgnored',
type: 'boolean',
description: 'check if the buy is ignored',
http: {source: 'query'}
},
{
arg: 'itemFk',
type: 'number',
description: 'item id',
http: {source: 'query'}
},
{
arg: 'name',
type: 'string',
description: 'item name',
http: {source: 'query'}
},
{
arg: 'size',
type: 'number',
description: 'item size',
http: {source: 'query'}
},
{
arg: 'stickers',
type: 'number',
description: 'sticker quantity',
http: {source: 'query'}
},
{
arg: 'packagingFk',
type: 'number',
description: 'packaging id',
http: {source: 'query'}
},
{
arg: 'weight',
type: 'number',
description: 'weight',
http: {source: 'query'}
},
{
arg: 'packing',
type: 'number',
description: 'packing quantity',
http: {source: 'query'}
},
{
arg: 'grouping',
type: 'number',
description: 'grouping quantity',
http: {source: 'query'}
},
{
arg: 'quantity',
type: 'number',
http: {source: 'query'}
},
{
arg: 'buyingValue',
type: 'number',
http: {source: 'query'}
},
{
arg: 'amount',
type: 'number',
description: 'buying value * quantity',
http: {source: 'query'}
},
{
arg: 'price2',
type: 'number',
description: 'price for the package',
http: {source: 'query'}
},
{
arg: 'price3',
type: 'number',
description: 'price for the box',
http: {source: 'query'}
},
{
arg: 'minPrice',
type: 'number',
description: 'item minimum price',
http: {source: 'query'}
},
{
arg: 'packingOut',
type: 'number',
description: 'quantity of package on a vn box',
http: {source: 'query'}
},
{
arg: 'comment',
type: 'string',
description: 'item comment',
http: {source: 'query'}
},
{
arg: 'subName',
type: 'string',
description: 'supplier name',
http: {source: 'query'}
},
{
arg: 'subName',
type: 'string',
description: 'supplier name',
http: {source: 'query'}
},
{
arg: 'company_name',
type: 'string',
description: 'company name',
http: {source: 'query'}
},
{
arg: 'workerFk',
type: 'number',
description: 'buyer id',
http: {source: 'query'}
},
{
arg: 'itemTypeFk',
type: 'number',
description: 'item family id',
http: {source: 'query'}
},
{
arg: 'groupingMode',
type: 'string',
description: 'grouping mode',
http: {source: 'query'}
},
{
arg: 'hasMinPrice',
type: 'boolean',
description: 'grouping mode',
http: {source: 'query'}
},
{
arg: 'groupBy',
type: 'string',
description: 'group by',
http: {source: 'query'}
},
],
returns: {
type: ['object'],
root: true
},
http: {
path: `/:entryFk/getBuyList`,
verb: 'GET'
}
});
Self.getBuyList = async(ctx, entryFk, filter, options) => {
const myOptions = {};
if (typeof options == 'object')
Object.assign(myOptions, options);
let conn = Self.dataSource.connector;
let where = buildFilter(ctx.args, (param, value) => {
switch (param) {
case 'name':
case 'subName':
case 'company_name':
case 'comment':
return {[param]: {like: `%${value}%`}};
case 'size':
case 'isIgnored':
case 'itemFk':
case 'stickers':
case 'packagingFk':
case 'weight':
case 'packing':
case 'grouping':
case 'quantity':
case 'buyingValue':
case 'amount':
case 'price2':
case 'price3':
case 'packingOut':
case 'minPrice':
case 'workerFk':
case 'itemTypeFk':
case 'groupingMode':
case 'hasMinPrice':
return {[param]: value};
}
});
filter = mergeFilters(filter, {where});
let stmts = [];
let stmt;
const selectFields = `b.id,
b.isIgnored,
b.itemFk,
b.printedStickers,
b.stickers,
b.packagingFk,
b.weight,
b.packing,
b.groupingMode,
b.grouping,
b.quantity,
b.buyingValue,
ROUND(b.buyingValue * b.quantity, 2) amount,
b.isChecked,
b.price2,
b.price3,
i.name,
i.size,
i.minPrice,
i.hasMinPrice,
i.packingOut,
i.comment,
i.subName,
i.tag5,
i.value5,
i.tag6,
i.value6,
i.tag7,
i.value7,
i.tag8,
i.value8,
i.tag9,
i.value9,
i.tag10,
i.value10,
s.company_name,
ik.hexJson,
it.workerFk,
it.id itemTypeFk
`;
const groupByFields = `SUM(b.printedStickers) printedStickers,
SUM(b.packing) packing,
SUM(b.stickers) stickers,
SUM(b.weight) weight,
SUM(b.quantity) quantity,
SUM(ROUND(b.buyingValue * b.quantity, 2)) amount
`;
const groupBy = ctx.args.groupBy;
stmt = new ParameterizedSQL(
`SELECT *
FROM(
SELECT
${ groupBy ? groupByFields : selectFields}
FROM item i
LEFT JOIN ink ik ON ik.id = i.inkFk
LEFT JOIN buy b ON b.itemFk = i.id
LEFT JOIN edi.ekt e ON e.id = b.ektFk
LEFT JOIN edi.supplier s ON e.pro = s.supplier_id
LEFT JOIN itemType it ON it.id = i.typeFk
WHERE b.entryFk = ?
${groupBy ?? ''}
) sub`,
[entryFk]
);
stmt.merge(conn.makeSuffix(filter));
let itemsIndex = stmts.push(stmt) - 1;
let sql = ParameterizedSQL.join(stmts, ';');
let result = await conn.executeStmt(sql, myOptions);
if (groupBy && result.length) {
const buys = await Self.app.models.Buy.find({where: {entryFk}}, myOptions);
const buysChecked = buys.filter(buy => buy?.isChecked);
result[0].isChecked = buysChecked.length === buys.length;
}
return itemsIndex === 0 ? result : result[itemsIndex];
};
};

View File

@ -0,0 +1,46 @@
module.exports = Self => {
Self.remoteMethodCtx('getBuyUltimate', {
description: 'Returns the last buy of the item',
accessType: 'READ',
accepts: [
{
arg: 'itemFk',
type: 'number',
required: true
}, {
arg: 'warehouseFk',
type: 'number',
required: true
}, {
arg: 'date',
type: 'date',
required: true
}
],
returns: {
type: 'object',
root: true
},
http: {
path: `/getBuyUltimate`,
verb: 'GET'
}
});
Self.getBuyUltimate = async(ctx, itemFk, warehouseFk, date, options) => {
const myOptions = {};
if (typeof options == 'object')
Object.assign(myOptions, options);
await Self.rawSql('CALL vn.buy_getUltimate(?, ?, ?)', [itemFk, warehouseFk, date], myOptions);
return Self.rawSql(
`SELECT b.*
FROM cache.last_buy lb
JOIN buy b ON b.id = lb.buy_id
WHERE lb.item_id = ?
ORDER BY (lb.warehouse_id = ?) desc
LIMIT 1`,
[itemFk, warehouseFk], myOptions
);
};
};

View File

@ -0,0 +1,46 @@
module.exports = Self => {
Self.remoteMethodCtx('cloneEntry', {
description: 'Clones an entry',
accessType: 'WRITE',
accepts: [{
arg: 'id',
type: 'number',
required: true,
description: 'The entry id',
http: {source: 'path'}
}],
returns: {
type: 'object',
root: true
},
http: {
path: `/:id/cloneEntry`,
verb: 'POST'
}
});
Self.cloneEntry = async(ctx, id, options) => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
await Self.rawSql('CALL entry_clone(?, @newEntryId)', [id], myOptions);
const result = await Self.rawSql('SELECT @newEntryId', [], myOptions);
const newEntryId = result[0]['@newEntryId'];
if (tx) await tx.commit();
return newEntryId;
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};

View File

@ -0,0 +1,48 @@
module.exports = Self => {
Self.remoteMethodCtx('deleteEntry', {
description: 'Clones an entry',
accessType: 'WRITE',
accepts: [{
arg: 'id',
type: 'number',
required: true,
description: 'The entry id',
http: {source: 'path'}
}],
http: {
path: `/:id/deleteEntry`,
verb: 'POST'
}
});
Self.deleteEntry = async(ctx, id, options) => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
const entry = await Self.findById(id, null, myOptions);
await entry.updateAttribute('travelFk', null, myOptions);
await Self.rawSql('DELETE FROM vn.duaEntry WHERE entryFk = ?;', [id], myOptions);
await Self.rawSql(`
DELETE i.*
FROM vn.invoiceIn i
JOIN vn.entry e ON e.invoiceInFk = i.id
WHERE e.id = ?`, [id], myOptions
);
if (tx) await tx.commit();
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};

View File

@ -129,7 +129,68 @@ module.exports = Self => {
arg: 'finalTemperature', arg: 'finalTemperature',
type: 'number', type: 'number',
description: 'Final temperature value' description: 'Final temperature value'
} },
{
arg: 'isExcludedFromAvailable',
type: 'boolean',
description: `landing date`
},
{
arg: 'isReceived',
type: 'boolean',
description: `travel received`
},
{
arg: 'isRaid',
type: 'boolean',
description: `travel isRaid`
},
{
arg: 'landed',
type: 'date',
description: `landing date`
},
{
arg: 'invoiceNumber',
type: 'string',
description: `entry invoice`
},
{
arg: 'reference',
type: 'string',
description: `entry reference`
},
{
arg: 'awbCode',
type: 'string',
description: `awb code`
},
{
arg: 'agencyModeId',
type: 'number',
description: `agency mode id`
},
{
arg: 'evaNotes',
type: 'string',
description: `observation`
},
{
arg: 'warehouseInFk',
type: 'number',
description: `warehouse in id`
},
{
arg: 'warehouseOutFk',
type: 'number',
description: `warehouse out id`
},
{
arg: 'entryTypeCode',
type: 'string',
description: 'entry type code'
},
], ],
returns: { returns: {
type: ['object'], type: ['object'],
@ -156,19 +217,12 @@ module.exports = Self => {
{'s.name': {like: `%${value}%`}}, {'s.name': {like: `%${value}%`}},
{'s.nickname': {like: `%${value}%`}} {'s.nickname': {like: `%${value}%`}}
]}; ]};
case 'invoiceNumber':
case 'reference':
case 'ref': case 'ref':
case 'evaNotes':
param = `e.${param}`; param = `e.${param}`;
return {[param]: {like: `%${value}%`}}; return {[param]: {like: `%${value}%`}};
case 'created':
return {'e.created': {gte: value}};
case 'from':
return {'t.landed': {gte: value}};
case 'fromShipped':
return {'t.shipped': {gte: value}};
case 'to':
return {'t.landed': {lte: value}};
case 'toShipped':
return {'t.shipped': {lte: value}};
case 'id': case 'id':
case 'isBooked': case 'isBooked':
case 'isConfirmed': case 'isConfirmed':
@ -178,8 +232,20 @@ module.exports = Self => {
case 'currencyFk': case 'currencyFk':
case 'supplierFk': case 'supplierFk':
case 'invoiceInFk': case 'invoiceInFk':
param = `e.${param}`; case 'isExcludedFromAvailable':
return {[param]: value}; return {[`e.${param}`]: value};
case 'isReceived':
case 'landed':
case 'isRaid':
case 'warehouseInFk':
case 'warehouseOutFk':
return {[`t.${param}`]: value};
case 'awbCode':
return {'a.code': {like: `%${value}%`}};
case 'agencyModeId':
return {[`am.id`]: value};
case 'entryTypeCode':
return {[`et.code`]: value};
case 'initialTemperature': case 'initialTemperature':
return {'e.initialTemperature': {lte: value}}; return {'e.initialTemperature': {lte: value}};
case 'finalTemperature': case 'finalTemperature':
@ -197,15 +263,14 @@ module.exports = Self => {
const stmts = []; const stmts = [];
let stmt; let stmt;
stmt = new ParameterizedSQL( stmt = new ParameterizedSQL(
`SELECT `SELECT e.id,
e.id,
e.supplierFk, e.supplierFk,
e.dated, e.dated,
e.reference, e.reference,
e.invoiceNumber, e.invoiceNumber,
e.isBooked, e.isBooked,
e.isExcludedFromAvailable, e.isExcludedFromAvailable,
e.evaNotes observation, e.evaNotes,
e.isConfirmed, e.isConfirmed,
e.isOrdered, e.isOrdered,
t.isRaid, t.isRaid,
@ -227,15 +292,27 @@ module.exports = Self => {
cu.code currencyCode, cu.code currencyCode,
t.shipped, t.shipped,
t.landed, t.landed,
t.ref AS travelRef, t.ref travelRef,
t.warehouseInFk, t.warehouseInFk,
w.name warehouseInName w.name warehouseInName,
t.warehouseOutFk,
w2.name warehouseOutName,
a.code awbCode,
am.id agencyModeId,
am.name agencyModeName,
et.code entryTypeCode,
et.description entryTypeDescription,
t.isReceived
FROM vn.entry e FROM vn.entry e
JOIN vn.supplier s ON s.id = e.supplierFk JOIN vn.supplier s ON s.id = e.supplierFk
JOIN vn.travel t ON t.id = e.travelFk LEFT JOIN vn.travel t ON t.id = e.travelFk
JOIN vn.warehouse w ON w.id = t.warehouseInFk LEFT JOIN vn.warehouse w ON w.id = t.warehouseInFk
JOIN vn.company co ON co.id = e.companyFk LEFT JOIN vn.warehouse w2 ON w2.id = t.warehouseOutFk
JOIN vn.currency cu ON cu.id = e.currencyFk` LEFT JOIN vn.company co ON co.id = e.companyFk
LEFT JOIN vn.currency cu ON cu.id = e.currencyFk
LEFT JOIN vn.awb a ON a.id = t.awbFk
LEFT JOIN vn.agencyMode am ON am.id = t.agencyModeFk
LEFT JOIN vn.entryType et ON et.code = e.typeFk`
); );
stmt.merge(conn.makeWhere(filter.where)); stmt.merge(conn.makeWhere(filter.where));

View File

@ -0,0 +1,49 @@
module.exports = Self => {
Self.remoteMethodCtx('recalcEntryPrices', {
description: 'Clones an entry',
accessType: 'WRITE',
accepts: [{
arg: 'entryFk',
type: 'number',
required: true,
description: 'The entry id',
http: {source: 'path'}
}],
returns: {
type: 'object',
root: true
},
http: {
path: `/:entryFk/recalcEntryPrices`,
verb: 'POST'
}
});
Self.recalcEntryPrices = async(ctx, entryFk, options) => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
const entry = await Self.findById(entryFk, myOptions);
const entryConfig = await Self.app.models.EntryConfig.findOne({}, myOptions);
if (entry.supplierFk === entryConfig.inventorySupplierFk) return;
try {
const result = await Self.rawSql('CALL vn.buy_recalcPricesByEntry(?)', [entryFk], myOptions);
if (tx) await tx.commit();
return result[0];
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};

View File

@ -31,5 +31,8 @@
}, },
"InventoryConfig": { "InventoryConfig": {
"dataSource": "vn" "dataSource": "vn"
},
"EntryConfig": {
"dataSource": "vn"
} }
} }

View File

@ -0,0 +1,30 @@
{
"name": "EntryConfig",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "entryConfig"
}
},
"properties": {
"defaultEntry": {
"type": "number",
"id": true
},
"mailToNotify": {
"type": "string"
},
"inventorySupplierFk": {
"type": "number"
},
"maxLockTime": {
"type": "number"
},
"defaultSupplierFk": {
"type": "number"
}
}
}

View File

@ -15,8 +15,13 @@ module.exports = Self => {
require('../methods/entry/transfer')(Self); require('../methods/entry/transfer')(Self);
require('../methods/entry/labelSupplier')(Self); require('../methods/entry/labelSupplier')(Self);
require('../methods/entry/buyLabelSupplier')(Self); require('../methods/entry/buyLabelSupplier')(Self);
require('../methods/entry-buys/getBuyList')(Self);
require('../methods/entry-buys/getBuyUltimate')(Self);
require('../methods/entry/cloneEntry')(Self);
require('../methods/entry/deleteEntry')(Self);
require('../methods/entry/recalcEntryPrices')(Self);
Self.observe('before save', async function(ctx, options) { Self.observe('before save', async(ctx, options) => {
if (ctx.isNewInstance) return; if (ctx.isNewInstance) return;
const changes = ctx.data || ctx.instance; const changes = ctx.data || ctx.instance;

View File

@ -56,8 +56,7 @@
"required": true "required": true
}, },
"travelFk": { "travelFk": {
"type": "number", "type": "number"
"required": true
}, },
"companyFk": { "companyFk": {
"type": "number", "type": "number",
@ -74,6 +73,12 @@
}, },
"finalTemperature": { "finalTemperature": {
"type": "number" "type": "number"
},
"lockerUserFk":{
"type": "number"
},
"locked":{
"type": "date"
} }
}, },
"relations": { "relations": {
@ -107,6 +112,16 @@
"type": "belongsTo", "type": "belongsTo",
"model": "EntryType", "model": "EntryType",
"foreignKey": "typeFk" "foreignKey": "typeFk"
},
"invoiceIn": {
"type": "belongsTo",
"model": "InvoiceIn",
"foreignKey": "invoiceInFk"
},
"user": {
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "lockerUserFk"
} }
} }
} }

View File

@ -29,9 +29,9 @@ describe('entry_isEditable trigger', () => {
}); });
async function prepareEntry(isBooked, typeFk) { async function prepareEntry(isBooked, typeFk) {
let newCreated = Date.vnNew(); const companyFk = 69;
await entry.updateAttributes({isBooked, typeFk}, options); await entry.updateAttributes({isBooked, typeFk}, options);
await entry.updateAttributes({dated: newCreated}, options); await entry.updateAttributes({companyFk}, options);
} }
it('should throw an error when entry is booked and typeFk is null', async() => { it('should throw an error when entry is booked and typeFk is null', async() => {

View File

@ -32,6 +32,12 @@ module.exports = Self => {
description: 'The client id', description: 'The client id',
http: {source: 'query'} http: {source: 'query'}
}, },
{
arg: 'companyFk',
type: 'integer',
description: 'The company id',
http: {source: 'query'}
},
{ {
arg: 'fi', arg: 'fi',
type: 'string', type: 'string',
@ -148,6 +154,7 @@ module.exports = Self => {
i.hasPdf, i.hasPdf,
i.customsAgentFk, i.customsAgentFk,
c.socialName AS clientSocialName, c.socialName AS clientSocialName,
i.companyFk,
co.code AS companyCode, co.code AS companyCode,
ca.fiscalName AS customsAgentName ca.fiscalName AS customsAgentName
FROM invoiceOut i FROM invoiceOut i

View File

@ -22,6 +22,11 @@ module.exports = Self => {
type: 'integer', type: 'integer',
description: 'The item id', description: 'The item id',
}, },
{
arg: 'name',
type: 'string',
description: 'The item name',
},
{ {
arg: 'typeFk', arg: 'typeFk',
type: 'integer', type: 'integer',
@ -112,6 +117,8 @@ module.exports = Self => {
: {'it.code': {like: `%${value}%`}}; : {'it.code': {like: `%${value}%`}};
case 'categoryFk': case 'categoryFk':
return {'it.categoryFk': value}; return {'it.categoryFk': value};
case 'name':
return {'i.name': {like: `%${value}%`}};
case 'buyerFk': case 'buyerFk':
return {'it.workerFk': value}; return {'it.workerFk': value};
case 'warehouseFk': case 'warehouseFk':

View File

@ -0,0 +1,43 @@
module.exports = Self => {
Self.remoteMethodCtx('getSimilar', {
description: 'Returns list of items with similar item requested',
accessType: 'READ',
accepts: [
{
arg: 'filter',
type: 'Object',
required: true,
description: 'Filter defining where and paginated data',
http: {source: 'query'}
}
],
returns: {
type: ['Object'],
root: true
},
http: {
path: `/getSimilar`,
verb: 'GET'
}
});
Self.getSimilar = async(ctx, filter, options) => {
const myOptions = {userId: ctx.req.accessToken.userId};
if (typeof options == 'object')
Object.assign(myOptions, options);
const {where} = filter;
const query = [
filter.itemFk,
where.warehouseFk,
where.date,
where.showType,
where.scopeDays
];
const [results] = await Self.rawSql('CALL vn.item_getSimilar(?, ?, ?, ?, ?)', query, myOptions);
return results;
};
};

View File

@ -0,0 +1,38 @@
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
module.exports = Self => {
Self.remoteMethodCtx('search', {
description: 'Returns an array of search results for a specified item',
accepts: [{
arg: 'filter',
type: 'object',
description: 'Filter to define conditions and paginate the data.',
required: true
}],
returns: {
type: ['object'],
root: true
},
http: {
path: `/search`,
verb: 'GET'
}
});
Self.search = async(ctx, filter) => {
const conn = Self.dataSource.connector;
const stmt = new ParameterizedSQL(`
SELECT *
FROM(
SELECT i.id, i.name, i.size, p.name producerName
FROM item i
LEFT JOIN producer p ON p.id = i.producerFk
) sub
`);
stmt.merge(conn.makeSuffix(filter));
return conn.executeStmt(stmt);
};
};

View File

@ -89,7 +89,7 @@ describe('item filter()', () => {
const ctx = {args: {filter: filter, workerFk: 16}, req: {accessToken: {userId: 1}}}; const ctx = {args: {filter: filter, workerFk: 16}, req: {accessToken: {userId: 1}}};
const result = await models.Item.filter(ctx, filter, options); const result = await models.Item.filter(ctx, filter, options);
expect(result.length).toEqual(2); expect(result.length).toEqual(3);
expect(result[0].id).toEqual(16); expect(result[0].id).toEqual(16);
expect(result[1].id).toEqual(71); expect(result[1].id).toEqual(71);

View File

@ -0,0 +1,49 @@
const models = require('vn-loopback/server/server').models;
describe('Item get similar', () => {
let options;
let tx;
const ctx = beforeAll.getCtx();
beforeAll.mockLoopBackContext();
beforeEach(async() => {
tx = await models.Item.beginTransaction({});
options = {transaction: tx};
});
afterEach(async() => {
if (tx)
await tx.rollback();
});
it('should return similar items', async() => {
const filter = {
itemFk: 88, sales: 43,
where: {
'scopeDays': '2',
'showType': true,
'alertLevelCode': 'FREE',
'date': '2001-01-01T11:00:00.000Z',
'warehouseFk': 1
}
};
const result = await models.Item.getSimilar(ctx, filter, options);
expect(result.length).toEqual(2);
});
it('should return empty array is if not exists', async() => {
const filter = {
itemFk: 88, sales: 43,
where: {
'scopeDays': '2',
'showType': true,
'alertLevelCode': 'FREE',
'date': '2001-01-01T11:00:00.000Z',
'warehouseFk': 60
}
};
const result = await models.Item.getSimilar(ctx, filter, options);
expect(result.length).toEqual(0);
});
});

View File

@ -26,7 +26,7 @@ describe('tag filterValue()', () => {
const filter = {where: {value: 'Blue'}, limit: 5}; const filter = {where: {value: 'Blue'}, limit: 5};
const result = await models.Tag.filterValue(colorTagId, filter, options); const result = await models.Tag.filterValue(colorTagId, filter, options);
expect(result.length).toEqual(2); expect(result.length).toEqual(3);
expect(result[0].value).toEqual('Blue'); expect(result[0].value).toEqual('Blue');
expect(result[1].value).toEqual('Blue/Silver'); expect(result[1].value).toEqual('Blue/Silver');

View File

@ -17,6 +17,9 @@
}, },
"showOrder": { "showOrder": {
"type": "number" "type": "number"
},
"hexJson": {
"type": "string"
} }
}, },
"acls": [ "acls": [

View File

@ -5,6 +5,7 @@ module.exports = Self => {
require('../methods/item/clone')(Self); require('../methods/item/clone')(Self);
require('../methods/item/updateTaxes')(Self); require('../methods/item/updateTaxes')(Self);
require('../methods/item/getBalance')(Self); require('../methods/item/getBalance')(Self);
require('../methods/item/getSimilar')(Self);
require('../methods/item/lastEntriesFilter')(Self); require('../methods/item/lastEntriesFilter')(Self);
require('../methods/item/getSummary')(Self); require('../methods/item/getSummary')(Self);
require('../methods/item/getCard')(Self); require('../methods/item/getCard')(Self);
@ -17,6 +18,7 @@ module.exports = Self => {
require('../methods/item/buyerWasteEmail')(Self); require('../methods/item/buyerWasteEmail')(Self);
require('../methods/item/setVisibleDiscard')(Self); require('../methods/item/setVisibleDiscard')(Self);
require('../methods/item/get')(Self); require('../methods/item/get')(Self);
require('../methods/item/search')(Self);
Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'}); Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'});

View File

@ -258,10 +258,10 @@ module.exports = Self => {
stmts.push(`SET SESSION optimizer_search_depth = @_optimizer_search_depth`); stmts.push(`SET SESSION optimizer_search_depth = @_optimizer_search_depth`);
stmt = new ParameterizedSQL(` stmt = new ParameterizedSQL(`
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_getProblems CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
(INDEX (ticketFk)) (INDEX (ticketFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped SELECT f.id ticketFk
FROM tmp.filter f FROM tmp.filter f
LEFT JOIN alertLevel al ON al.id = f.alertLevel LEFT JOIN alertLevel al ON al.id = f.alertLevel
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL) WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
@ -282,7 +282,7 @@ module.exports = Self => {
stmts.push('CALL ticket_getWarnings()'); stmts.push('CALL ticket_getWarnings()');
stmt = new ParameterizedSQL(` stmt = new ParameterizedSQL(`
UPDATE tmp.ticket_problems UPDATE tmp.ticketProblems
SET risk = IF(hasRisk, risk, 0) SET risk = IF(hasRisk, risk, 0)
`); `);
stmts.push(stmt); stmts.push(stmt);
@ -290,7 +290,7 @@ module.exports = Self => {
stmt = new ParameterizedSQL(` stmt = new ParameterizedSQL(`
SELECT * SELECT *
FROM tmp.filter f FROM tmp.filter f
LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id LEFT JOIN tmp.ticketProblems tp ON tp.ticketFk = f.id
LEFT JOIN tmp.ticket_warnings tw ON tw.ticketFk = f.id LEFT JOIN tmp.ticket_warnings tw ON tw.ticketFk = f.id
`); `);
stmts.push(stmt); stmts.push(stmt);
@ -307,8 +307,8 @@ module.exports = Self => {
{'tp.hasRisk': true}, {'tp.hasRisk': true},
{'tp.hasTicketRequest': true}, {'tp.hasTicketRequest': true},
{'tp.hasComponentLack': true}, {'tp.hasComponentLack': true},
{'tp.isTaxDataChecked': false}, {'tp.isTaxDataChecked': true},
{'tp.itemShortage': {neq: null}}, {'tp.hasItemShortage': true},
{'tp.isTooLittle': true} {'tp.isTooLittle': true}
]}; ]};
} else if (hasProblems === false) { } else if (hasProblems === false) {
@ -317,8 +317,8 @@ module.exports = Self => {
{'tp.hasRisk': false}, {'tp.hasRisk': false},
{'tp.hasTicketRequest': false}, {'tp.hasTicketRequest': false},
{'tp.hasComponentLack': false}, {'tp.hasComponentLack': false},
{'tp.isTaxDataChecked': true}, {'tp.isTaxDataChecked': false},
{'tp.itemShortage': null}, {'tp.hasItemShortage': false},
{'tp.isTooLittle': false} {'tp.isTooLittle': false}
]}; ]};
} }
@ -392,9 +392,9 @@ module.exports = Self => {
stmts.push(` stmts.push(`
DROP TEMPORARY TABLE DROP TEMPORARY TABLE
tmp.ticket,
tmp.filter, tmp.filter,
tmp.ticket_problems, tmp.ticketProblems,
tmp.sale_getProblems,
tmp.sale_getWarnings, tmp.sale_getWarnings,
tmp.ticket_warnings tmp.ticket_warnings
`); `);

View File

@ -68,7 +68,7 @@ describe('SalesMonitor salesFilter()', () => {
const filter = {}; const filter = {};
const result = await models.SalesMonitor.salesFilter(ctx, filter, options); const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
expect(result.length).toEqual(4); expect(result.length).toEqual(5);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {

View File

@ -31,7 +31,7 @@ describe('route getSuggestedTickets()', () => {
const length = result.length; const length = result.length;
const anyResult = result[Math.floor(Math.random() * Math.floor(length))]; const anyResult = result[Math.floor(Math.random() * Math.floor(length))];
expect(result.length).toEqual(4); expect(result.length).toEqual(5);
expect(anyResult.zoneFk).toEqual(1); expect(anyResult.zoneFk).toEqual(1);
expect(anyResult.agencyModeFk).toEqual(8); expect(anyResult.agencyModeFk).toEqual(8);

View File

@ -14,7 +14,7 @@ describe('route unlink()', () => {
let tickets = await models.Route.getSuggestedTickets(routeId, options); let tickets = await models.Route.getSuggestedTickets(routeId, options);
expect(zoneAgencyModes.length).toEqual(4); expect(zoneAgencyModes.length).toEqual(4);
expect(tickets.length).toEqual(3); expect(tickets.length).toEqual(4);
await models.Route.unlink(agencyModeId, zoneId, options); await models.Route.unlink(agencyModeId, zoneId, options);

View File

@ -0,0 +1,128 @@
const {ParameterizedSQL} = require('loopback-connector');
const {buildFilter, mergeFilters} = require('vn-loopback/util/filter');
module.exports = Self => {
Self.remoteMethodCtx('filter', {
description: 'Find all instances of the model matched by filter from the data source.',
accessType: 'READ',
accepts: [{
arg: 'filter',
type: 'object',
description: 'Filter defining where, order, skip and limit - must be a JSON-encoded string',
http: {source: 'query'}
}, {
arg: 'search',
type: 'string',
description: 'Searchs the vehicle by id or numberPlate',
http: {source: 'query'}
}, {
arg: 'id',
type: 'number'
}, {
arg: 'description',
type: 'string'
}, {
arg: 'companyFk',
type: 'number'
}, {
arg: 'tradeMark',
type: 'string'
}, {
arg: 'numberPlate',
type: 'string'
}, {
arg: 'warehouseFk',
type: 'number'
}, {
arg: 'chassis',
type: 'string'
}, {
arg: 'leasing',
type: 'string'
}, {
arg: 'countryCodeFk',
type: 'string'
}, {
arg: 'vehicleTypeFk',
type: 'number'
}, {
arg: 'vehicleStateFk',
type: 'number'
}],
returns: {
type: ['object'],
root: true
},
http: {
path: `/filter`,
verb: `GET`
}
});
Self.filter = async(ctx, filter, options) => {
const conn = Self.dataSource.connector;
const myOptions = {};
if (typeof options == 'object') Object.assign(myOptions, options);
const where = buildFilter(ctx.args, (param, value) => {
switch (param) {
case 'search':
return {or: [{'v.id': value}, {numberPlate: {like: `%${value}%`}}]};
case 'id':
return {'v.id': value};
case 'description':
case 'tradeMark':
case 'numberPlate':
case 'chassis':
case 'leasing':
return {[param]: {like: `%${value}%`}};
case 'companyFk':
case 'warehouseFk':
case 'countryCodeFk':
case 'vehicleStateFk':
case 'vehicleTypeFk':
return {[param]: value};
}
});
filter = mergeFilters(filter, {where});
const stmt = new ParameterizedSQL(`
SELECT v.id,
v.numberPlate,
v.tradeMark,
v.model,
v.m3,
v.description,
v.isActive,
v.countryCodeFk,
v.chassis,
v.leasing,
vt.name type,
w.name warehouse,
c.code company,
sub.state
FROM vehicle v
JOIN vehicleType vt ON vt.id = v.vehicleTypeFk
LEFT JOIN warehouse w ON w.id = v.warehouseFk
LEFT JOIN company c ON c.id = v.companyFk
LEFT JOIN (
SELECT e.vehicleFk,
e.vehicleStateFk,
s.state,
ROW_NUMBER() OVER (PARTITION BY e.vehicleFk ORDER BY e.started DESC) rn
FROM vehicleEvent e
LEFT JOIN vehicleState s ON e.vehicleStateFk = s.id
) sub ON sub.vehicleFk = v.id AND sub.rn = 1
`);
const sqlWhere = conn.makeWhere(filter.where);
stmt.merge(sqlWhere);
stmt.merge(conn.makePagination(filter));
const sql = ParameterizedSQL.join([stmt], ';');
return conn.executeStmt(sql, myOptions);
};
};

View File

@ -0,0 +1,127 @@
const {models} = require('vn-loopback/server/server');
describe('Vehicle filter()', () => {
const deliveryAssiId = 123;
const ctx = beforeAll.getCtx(deliveryAssiId);
let options;
let tx;
beforeEach(async() => {
ctx.args = {};
options = {};
tx = await models.Sale.beginTransaction({});
options.transaction = tx;
});
afterEach(async() => {
await tx.rollback();
});
it('should return the vehicles matching "search"', async() => {
const {id} = await models.Vehicle.findById(1, null, options);
const {numberPlate} = await models.Vehicle.findById(2, null, options);
ctx.args = {search: id};
const [searchResult] = await models.Vehicle.filter(ctx);
ctx.args = {search: numberPlate};
const [searchResult2] = await models.Vehicle.filter(ctx);
expect(searchResult.id).toEqual(id);
expect(searchResult2.numberPlate).toEqual(numberPlate);
});
it('should return the vehicles matching "companyFk"', async() => {
const company = await models.Company.findOne({where: {code: 'VNL'}}, options);
ctx.args = {companyFk: company.id};
const searchResult = await models.Vehicle.filter(ctx, null, options);
searchResult.forEach(record => {
expect(record.company).toEqual(company.code);
});
});
it('should return the vehicles matching "tradeMark"', async() => {
const tradeMark = 'WAYNE INDUSTRIES';
ctx.args = {tradeMark};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.tradeMark).toEqual(tradeMark);
});
});
it('should return the vehicles matching "numberPlate"', async() => {
const {numberPlate} = await models.Vehicle.findById(1, null, options);
ctx.args = {numberPlate};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.numberPlate).toEqual(numberPlate);
});
});
it('should return the vehicles matching "warehouseFk"', async() => {
const warehouse = await models.Warehouse.findById(1, null, options);
ctx.args = {warehouseFk: warehouse.id};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.warehouse).toEqual(warehouse.name);
});
});
it('should return the vehicles matching "chassis"', async() => {
const {chassis} = await models.Vehicle.findById(1, null, options);
ctx.args = {chassis};
const [searchResult] = await models.Vehicle.filter(ctx);
expect(searchResult.chassis).toEqual(chassis);
});
it('should return the vehicles matching "leasing"', async() => {
const leasing = 'Wayne leasing';
ctx.args = {leasing};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.leasing).toEqual(leasing);
});
});
it('should return the vehicles matching "countryCodeFk"', async() => {
const countryCodeFk = 'ES';
ctx.args = {countryCodeFk};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.countryCodeFk).toEqual(countryCodeFk);
});
});
it('should return the vehicles matching "vehicleTypeFk"', async() => {
const {name, id} = await models.VehicleType.findById(1, null, options);
ctx.args = {vehicleTypeFk: id};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.type).toEqual(name);
});
});
it('should return the vehicles matching "vehicleStateFk"', async() => {
const {state, id} = await models.VehicleState.findById(3);
ctx.args = {vehicleStateFk: id};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.state).toEqual(state);
});
});
it('should return the vehicles matching "description"', async() => {
const {description} = await models.Vehicle.findById(2);
ctx.args = {description};
const searchResult = await models.Vehicle.filter(ctx);
searchResult.forEach(record => {
expect(record.description).toEqual(description);
});
});
});

View File

@ -5,12 +5,21 @@
"AgencyTermConfig": { "AgencyTermConfig": {
"dataSource": "vn" "dataSource": "vn"
}, },
"BankPolicy": {
"dataSource": "vn"
},
"Cmr": { "Cmr": {
"dataSource": "vn" "dataSource": "vn"
}, },
"DeliveryPoint": { "DeliveryPoint": {
"dataSource": "vn" "dataSource": "vn"
}, },
"FuelType": {
"dataSource": "vn"
},
"Ppe": {
"dataSource": "vn"
},
"RoadmapAddress": { "RoadmapAddress": {
"dataSource": "vn" "dataSource": "vn"
}, },
@ -35,6 +44,12 @@
"Vehicle": { "Vehicle": {
"dataSource": "vn" "dataSource": "vn"
}, },
"VehicleState": {
"dataSource": "vn"
},
"VehicleType": {
"dataSource": "vn"
},
"RoutesMonitor": { "RoutesMonitor": {
"dataSource": "vn" "dataSource": "vn"
} }

View File

@ -0,0 +1,21 @@
{
"name": "BankPolicy",
"base": "VnModel",
"options": {
"mysql": {
"table": "bankPolicy"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"ref": {
"type": "string"
},
"dmsFk": {
"type": "number"
}
}
}

View File

@ -0,0 +1,30 @@
{
"name": "FuelType",
"base": "VnModel",
"options": {
"mysql": {
"table": "fuelType"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string"
},
"code": {
"type": "string"
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}

View File

@ -0,0 +1,15 @@
{
"name": "Ppe",
"base": "VnModel",
"options": {
"mysql": {
"table": "ppe"
}
},
"properties": {
"id": {
"type": "number",
"id": true
}
}
}

View File

@ -33,7 +33,7 @@
"observations": { "observations": {
"type": "string" "type": "string"
}, },
"userFk": { "editorFk": {
"type": "number" "type": "number"
}, },
"price": { "price": {

View File

@ -15,16 +15,13 @@
"roadmapFk": { "roadmapFk": {
"type": "number" "type": "number"
}, },
"addressFk": {
"type": "number"
},
"eta": { "eta": {
"type": "date" "type": "date"
}, },
"description": { "description": {
"type": "string" "type": "string"
}, },
"userFk": { "editorFk": {
"type": "number" "type": "number"
} }
}, },
@ -37,7 +34,7 @@
"address": { "address": {
"type": "belongsTo", "type": "belongsTo",
"model": "RoadmapAddress", "model": "RoadmapAddress",
"foreignKey": "addressFk" "foreignKey": "roadmapAddressFk"
} }
} }
} }

View File

@ -0,0 +1,21 @@
{
"name": "VehicleState",
"base": "VnModel",
"options": {
"mysql": {
"table": "vehicleState"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"state": {
"type": "string"
},
"hasToNotify": {
"type": "number"
}
}
}

View File

@ -0,0 +1,19 @@
{
"name": "VehicleType",
"base": "VnModel",
"options": {
"mysql": {
"table": "vehicleType"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string"
}
}
}

View File

@ -1,3 +1,4 @@
module.exports = Self => { module.exports = Self => {
require('../methods/vehicle/sorted')(Self); require('../methods/vehicle/sorted')(Self);
require('../methods/vehicle/filter')(Self);
}; };

View File

@ -29,6 +29,39 @@
}, },
"isActive": { "isActive": {
"type": "number" "type": "number"
},
"countryCodeFk": {
"type": "string"
},
"chassis": {
"type": "string"
},
"leasing": {
"type": "string"
},
"isKmTruckRate": {
"type": "number"
},
"fuelTypeFk": {
"type": "number"
},
"import": {
"type": "number"
},
"importCooler": {
"type": "number"
},
"vin": {
"type": "string"
},
"ppeFk": {
"type": "number"
},
"vehicleTypeFk": {
"type": "number"
},
"deliveryPointFk": {
"type": "number"
} }
}, },
"relations": { "relations": {
@ -46,21 +79,57 @@
"type": "belongsTo", "type": "belongsTo",
"model": "DeliveryPoint", "model": "DeliveryPoint",
"foreignKey": "deliveryPointFk" "foreignKey": "deliveryPointFk"
},
"event": {
"type": "hasMany",
"model": "VehicleEvent",
"foreignKey": "vehicleFk",
"property": "id"
},
"supplier": {
"type": "belongsTo",
"model": "Supplier",
"foreignKey": "supplierFk"
},
"supplierCooler": {
"type": "belongsTo",
"model": "Supplier",
"foreignKey": "supplierCoolerFk"
},
"bankPolicy": {
"type": "belongsTo",
"model": "BankPolicy",
"foreignKey": "bankPolicyFk"
},
"fuelType": {
"type": "belongsTo",
"model": "FuelType",
"foreignKey": "fuelTypeFk"
},
"ppe": {
"type": "hasOne",
"model": "Ppe",
"foreignKey": "id",
"property": "ppeFk"
},
"type": {
"type": "hasOne",
"model": "VehicleType",
"foreignKey": "id",
"property": "vehicleTypeFk"
} }
}, },
"scope": { "scopes": {
"active": {
"fields": [
"id",
"numberPlate"
],
"where": { "where": {
"isActive": { "isActive": {
"neq": false "neq": false
} }
} }
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
} }
] }
} }

View File

@ -12,14 +12,6 @@
"id": true, "id": true,
"description": "Identifier" "description": "Identifier"
}, },
"column": {
"type": "string",
"required": true
},
"row": {
"type": "string",
"required": true
},
"code": { "code": {
"type": "string" "type": "string"
}, },

View File

@ -7,6 +7,6 @@ describe('Supplier getItemsPackaging()', () => {
expect(item.id).toEqual(1); expect(item.id).toEqual(1);
expect(item.name).toEqual('Ranged weapon longbow 200cm'); expect(item.name).toEqual('Ranged weapon longbow 200cm');
expect(item.quantity).toEqual(5000); expect(item.quantity).toEqual(5000);
expect(item.quantityTotal).toEqual(5100); expect(item.quantityTotal).toEqual(5200);
}); });
}); });

View File

@ -49,7 +49,7 @@ module.exports = Self => {
ps.monitorId, ps.monitorId,
e.created e.created
FROM expedition e FROM expedition e
JOIN host h ON Convert(h.code USING utf8mb3) COLLATE utf8mb3_unicode_ci = e.hostFk JOIN host h ON h.code = e.hostFk
JOIN packingSite ps ON ps.hostFk = h.id JOIN packingSite ps ON ps.hostFk = h.id
WHERE e.id = ?;`; WHERE e.id = ?;`;
const [expedition] = await models.Expedition.rawSql(query, [id]); const [expedition] = await models.Expedition.rawSql(query, [id]);

View File

@ -44,12 +44,14 @@ module.exports = Self => {
ps.monitorId, ps.monitorId,
e.created e.created
FROM expedition e FROM expedition e
JOIN host h ON Convert(h.code USING utf8mb3) COLLATE utf8mb3_unicode_ci = e.hostFk JOIN host h ON h.code = e.hostFk
JOIN packingSite ps ON ps.hostFk = h.id JOIN packingSite ps ON ps.hostFk = h.id
WHERE e.id = ?;`; WHERE e.id = ?;`;
const [expedition] = await models.PackingSiteConfig.rawSql(query, [id]);
const [expedition] = await models.PackingSiteConfig.rawSql(query, [id], myOptions);
if (!from && !expedition) return []; if (!from && !expedition) return [];
let start = new Date(expedition.created); let start = new Date(expedition.created);
let end = new Date(start.getTime() + (packingSiteConfig.avgBoxingTime * 1000)); let end = new Date(start.getTime() + (packingSiteConfig.avgBoxingTime * 1000));
@ -57,9 +59,13 @@ module.exports = Self => {
start.setHours(from, 0, 0); start.setHours(from, 0, 0);
end.setHours(to, 0, 0); end.setHours(to, 0, 0);
} }
const offset = start.getTimezoneOffset(); const offset = start.getTimezoneOffset();
start = new Date(start.getTime() - (offset * 60 * 1000)); start = new Date(start.getTime() - (offset * 60 * 1000));
end = new Date(end.getTime() - (offset * 60 * 1000)); end = new Date(end.getTime() - (offset * 60 * 1000));
const minutes = start.getMinutes();
const roundedMinutes = minutes - (minutes % 15);
start.setMinutes(roundedMinutes, 0, 0);
const videoUrl = const videoUrl =
`/${packingSiteConfig.shinobiToken}/videos/${packingSiteConfig.shinobiGroupKey}/${expedition.monitorId}`; `/${packingSiteConfig.shinobiToken}/videos/${packingSiteConfig.shinobiGroupKey}/${expedition.monitorId}`;
@ -73,6 +79,7 @@ module.exports = Self => {
} catch (e) { } catch (e) {
return []; return [];
} }
return response.data.videos.map(video => video.filename); return response.data.videos.map(video => video.filename);
}; };
}; };

View File

@ -2,35 +2,28 @@ const models = require('vn-loopback/server/server').models;
const axios = require('axios'); const axios = require('axios');
describe('boxing getVideoList()', () => { describe('boxing getVideoList()', () => {
it('should return video list', async() => { let tx;
const tx = await models.PackingSiteConfig.beginTransaction({}); let options;
try { beforeEach(async() => {
const options = {transaction: tx}; tx = await models.PackingSiteConfig.beginTransaction({});
options = {transaction: tx};
const id = 1; });
const from = 1;
const to = 2;
const response = {
data: {
videos: [{
id: 1,
filename: 'video1.mp4'
}]
}
};
spyOn(axios, 'get').and.returnValue(new Promise(resolve => resolve(response)));
const result = await models.Boxing.getVideoList(id, from, to, options);
expect(result[0]).toEqual(response.data.videos[0].filename);
afterEach(async() => {
await tx.rollback(); await tx.rollback();
} catch (e) { });
await tx.rollback();
throw e; it('should make the correct API call', async() => {
} const expedition = await models.Expedition.findById(15, null, options);
await expedition.updateAttribute('created', '2000-12-01 07:07:00', options);
const axiosSpy = spyOn(axios, 'get').and.callThrough();
await models.Boxing.getVideoList(expedition.id, undefined, undefined, options);
const expectedStartTime = '2000-12-01T07:00:00';
const calledUrl = axiosSpy.calls.mostRecent().args[0];
expect(calledUrl).toContain(`start=${expectedStartTime}`);
}); });
}); });

View File

@ -0,0 +1,99 @@
module.exports = Self => {
Self.remoteMethodCtx('replaceItem', {
description: 'Replace item from sale',
accessType: 'WRITE',
accepts: [
{
arg: 'saleFk',
type: 'number',
required: true,
},
{
arg: 'substitutionFk',
type: 'number',
required: true
},
{
arg: 'quantity',
type: 'number',
required: true
}
],
returns: {
type: 'object',
root: true
},
http: {
path: `/replaceItem`,
verb: 'POST'
}
});
Self.replaceItem = async(ctx, saleFk, substitutionFk, quantity, options) => {
const myOptions = {userId: ctx.req.accessToken.userId};
let tx;
const $t = ctx.req.__;
const models = Self.app.models;
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
const replaceItemQuery = {
sql: 'CALL sale_replaceItem(?,?,?)',
query: [saleFk, substitutionFk, quantity]
};
const resultReplaceItem = await Self.rawSql(replaceItemQuery.sql, replaceItemQuery.query, myOptions);
const sale = await models.Sale.findById(saleFk, {
fields: ['id', 'ticketFk', 'itemFk', 'quantity', 'price'],
include: [
{
relation: 'ticket',
scope: {
fields: ['id']
},
}, {
relation: 'item',
scope: {
fields: ['id', 'name', 'longName']
}
}
]
}, myOptions);
const salesPersonQuery = {
sql: 'SELECT vn.client_getSalesPersonByTicket(?)',
query: [sale.ticketFk]
};
const salesPerson = await Self.rawSql(salesPersonQuery.sql, salesPersonQuery.query, myOptions);
const url = await models.Url.getUrl();
const substitution = await models.Item.findById(substitutionFk, {
fields: ['id', 'name', 'longName']
}, myOptions);
const message = $t('negativeReplaced', {
oldItemId: sale.itemFk,
oldItem: sale.item().longName,
oldItemUrl: `${url}item/${sale.itemFk}/summary`,
newItemId: substitution.id,
newItem: substitution.longName,
newItemUrl: `${url}item/${substitution.id}/summary`,
ticketId: sale.ticketFk,
ticketUrl: `${url}ticket/${sale.ticketFk}/sale`
});
await models.Chat.sendCheckingPresence(ctx, salesPerson.id, message);
return resultReplaceItem;
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};

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