refactor: refs #7457 Added from param if not exists #2502
414
CHANGELOG.md
414
CHANGELOG.md
|
@ -1,3 +1,417 @@
|
||||||
|
# Version 24.38 - 2024-09-17
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #7323 filter data by:jorgep
|
||||||
|
- chore: refs #7323 fix test by:jorgep
|
||||||
|
- chore: refs #7323 worker changes by:jorgep
|
||||||
|
- chore: refs #7323 worker changes wip by:jorgep
|
||||||
|
- chore: refs #7524 add select limit by:jorgep
|
||||||
|
- feat(AccessToken&ACL): refs #7547 upgrade security by:alexm
|
||||||
|
- feat: deleted code and redirect to Lilium by:Jon
|
||||||
|
- feat: refs #4515 New throw buy_checkItem by:guillermo
|
||||||
|
- feat: refs #6650 Added saleGroupLog by:guillermo
|
||||||
|
- feat: refs #6650 new itemShelvingLog by:guillermo
|
||||||
|
- feat: refs #6760 refs #actualiza campo nickname by:jgallego
|
||||||
|
- feat: refs #7277 fdescribe by:jgallego
|
||||||
|
- feat: refs #7277 fit by:jgallego
|
||||||
|
- feat: refs #7277 refundInvoices by:jgallego
|
||||||
|
- feat: refs #7277 test with warehouse by:jgallego
|
||||||
|
- feat: refs #7277 traducciones by:jgallego
|
||||||
|
- feat: refs #7277 transfer addressFk by:jgallego
|
||||||
|
- feat: refs #7532 Requested changes by:guillermo
|
||||||
|
- feat: refs #7564 Added proc by:guillermo
|
||||||
|
- feat: refs #7564 Added ticket_setVolumeItemCost by:guillermo
|
||||||
|
- feat: refs #7564 Added volume column by:guillermo
|
||||||
|
- feat: refs #7564 Fix version by:guillermo
|
||||||
|
- feat: refs #7564 Requested changes by:guillermo
|
||||||
|
- feat: refs #7615 setDeleted by:robert
|
||||||
|
- feat: refs #7650 Added no transfer lines to inventory entry and fixtures by:guillermo
|
||||||
|
- feat: refs #7650 Fix tests by:guillermo
|
||||||
|
- feat: refs #7747 Delete buyUltimate and buyUltimateFromInterval by:ivanm
|
||||||
|
- feat: refs #7759 Changed defined only of vn objects by:guillermo
|
||||||
|
- feat: refs #7759 Changed definer root to vn-admin by:guillermo
|
||||||
|
- feat: refs #7759 Changed name by:guillermo
|
||||||
|
- feat: refs #7759 Deleted version 11163-maroonEucalyptus by:guillermo
|
||||||
|
- feat: refs #7759 Revoke routine grants vn by:guillermo
|
||||||
|
- feat: refs #7811 Added comment by:guillermo
|
||||||
|
- feat: refs #7811 Added new params in datasources.json by:guillermo
|
||||||
|
- feat: refs #7898 Add column "floor" in vn.parking by:ivanm
|
||||||
|
- feat: refs #7898 Modify default by:ivanm
|
||||||
|
- feat: refs #7905 Added new method getBuysCsv by:guillermo
|
||||||
|
- feat: refs #7905 Added param toCsv by:guillermo
|
||||||
|
- feat: refs #7938 remove unnecessary insert in clientLog by:alexm
|
||||||
|
- feat: refs #7953 pullinfo (7953-devToTest_2438) by:alexm
|
||||||
|
- feat(salix): #7671 define isDestiny field in model by:Javier Segarra
|
||||||
|
- feat(salix): refs #7896 update version and changelog (origin/7896_down_devToTest_2436) by:Javier Segarra
|
||||||
|
- feat(salix): refs #7905 #7905 use getBuys toCSV flattened by:Javier Segarra
|
||||||
|
- feat(ssalix): refs #7671 #7671 checkDates by:Javier Segarra
|
||||||
|
- feat(ssalix): refs #7671 #7671 checkDates to present by:Javier Segarra
|
||||||
|
- feat: ticket 215005 Changed acl show transferClient by:guillermo
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: refs #7671 improve showBadDates by:Javier Segarra
|
||||||
|
- perf(salix): refs #7671 #7671 imrpove and revert where changes by:Javier Segarra
|
||||||
|
- refactor: deleted e2e & added back descriptor and summary by:Jon
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- chore: refs #7323 fix test by:jorgep
|
||||||
|
- feat: refs #7650 Added no transfer lines to inventory entry and fixtures by:guillermo
|
||||||
|
- fix by:guillermo
|
||||||
|
- fixes: refs #7760 collection problems by:Carlos Andrés
|
||||||
|
- fix merge dev (7407-workerMedical) by:alexm
|
||||||
|
- fix: refs #6727 No delete log tables data in clean procedures by:guillermo
|
||||||
|
- fix: refs #6897 back and tests by:carlossa
|
||||||
|
- fix: refs #6897 back by:carlossa
|
||||||
|
- fix: refs #6897 fix filter by:carlossa
|
||||||
|
- fix: refs #6897 fix json by:carlossa
|
||||||
|
- fix: refs #6897 travel filter by:carlossa
|
||||||
|
- fix: refs #6897 error test by:jgallego
|
||||||
|
- fix: refs #7323 fetch from right source by:jorgep
|
||||||
|
- fix: refs #7564 Deleted query by:guillermo
|
||||||
|
- fix: refs #7759 Added user 'vn'@'localhost' & grants by:guillermo
|
||||||
|
- fix: refs #7760 collection problems by:Carlos Andrés
|
||||||
|
- fix: refs #7760 tmp.ticketIPT by:Carlos Andrés
|
||||||
|
- fix: refs #7905 added comments to flatten.js by:guillermo
|
||||||
|
- fix: refs ##7905 Handle error by:guillermo
|
||||||
|
- fix(salix): refs #7905 #7905 use right fn to flatten data by:Javier Segarra
|
||||||
|
- perf(salix): refs #7671 #7671 imrpove and revert where changes by:Javier Segarra
|
||||||
|
- refs #6898 fix supplier remove by:carlossa
|
||||||
|
- refs #7407 fix acls fixtures by:carlossa
|
||||||
|
- test: fix connections e2e (7547-accessToken-security) by:alexm
|
||||||
|
- test: refs #7277 fix test proposal by:Javier Segarra
|
||||||
|
- test(salix): refs #7671 #7671 improve and revert where changes by:Javier Segarra
|
||||||
|
|
||||||
|
# Version 24.36 - 2024-09-03
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #7524 WIP limit call by:jorgep
|
||||||
|
- chore: refs #7524 modify ormConfig table col (origin/7524-warmfix-modifyColumn) by:jorgep
|
||||||
|
- feat(update-user): refs #7848 add twoFactor by:alexm
|
||||||
|
- feat: #3199 Requested changes by:guillermo
|
||||||
|
- feat: refs #3199 Added more scopes ticket_recalcByScope by:guillermo
|
||||||
|
- feat: refs #3199 Added one more scope ticket_recalcByScope by:guillermo
|
||||||
|
- feat: refs #3199 Created ticket_recalcItemTaxCountryByScope by:guillermo
|
||||||
|
- feat: refs #3199 Requested changes by:guillermo
|
||||||
|
- feat: refs #7346 add multiple feature by:jgallego
|
||||||
|
- feat: refs #7346 backTest checks new implementation by:jgallego
|
||||||
|
- feat: refs #7346 mas intuitivo by:jgallego
|
||||||
|
- feat: refs #7514 Changes to put srt log (origin/7514-srtLog) by:guillermo
|
||||||
|
- feat: refs #7524 add default limit (origin/7524-limitSelect) by:jorgep
|
||||||
|
- feat: refs #7524 add mock limit on find query by:jorgep
|
||||||
|
- feat: refs #7524 wip remote hooks by:jorgep
|
||||||
|
- feat: refs #7562 Requested changes by:guillermo
|
||||||
|
- feat: refs #7567 Changed time to call event by:guillermo
|
||||||
|
- feat: refs #7567 Requested changes by:guillermo
|
||||||
|
- feat: refs #7710 pr revision by:jgallego
|
||||||
|
- feat: refs #7710 test fixed (origin/7710-cloneWithTicketPackaging, 7710-cloneWithTicketPackaging) by:jgallego
|
||||||
|
- feat: refs #7712 Fix by:guillermo
|
||||||
|
- feat: refs #7712 Unify by:guillermo
|
||||||
|
- feat: refs #7712 sizeLimit (origin/7712-sizeLimit) by:guillermo
|
||||||
|
- feat: refs #7758 Add code mandateType and accountDetailType by:ivanm
|
||||||
|
- feat: refs #7758 Modify code lowerCamelCase and UNIQUE by:ivanm
|
||||||
|
- feat: refs #7758 accountDetailType fix deploy error by:ivanm
|
||||||
|
- feat: refs #7784 Changes in entry-order-pdf by:guillermo
|
||||||
|
- feat: refs #7784 Requested changes by:guillermo
|
||||||
|
- feat: refs #7799 Added Fk in vn.item.itemPackingTypeFk by:guillermo
|
||||||
|
- feat: refs #7800 Added company Fk by:guillermo
|
||||||
|
- feat: refs #7842 Added editorFk in vn.host by:guillermo
|
||||||
|
- feat: refs #7860 Update new packagings (origin/7860-newPackaging) by:guillermo
|
||||||
|
- feat: refs #7862 roadmap new fields by:ivanm
|
||||||
|
- feat: refs #7882 Added quadMindsConfig table by:guillermo
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- refactor: refs #7567 Fix and improvement by:guillermo
|
||||||
|
- refactor: refs #7567 Minor change by:guillermo
|
||||||
|
- refactor: refs #7756 Fix tests by:guillermo
|
||||||
|
- refactor: refs #7798 Drop bi.Greuges_comercial_detail by:guillermo
|
||||||
|
- refactor: refs #7848 adapt to lilium by:alexm
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- feat: refs #7710 test fixed (origin/7710-cloneWithTicketPackaging, 7710-cloneWithTicketPackaging) by:jgallego
|
||||||
|
- feat: refs #7758 accountDetailType fix deploy error by:ivanm
|
||||||
|
- fix(salix): #7283 ItemFixedPrice duplicated (origin/7283_itemFixedPrice_duplicated) by:Javier Segarra
|
||||||
|
- fix: refs #7346 minor error (origin/7346, 7346) by:jgallego
|
||||||
|
- fix: refs #7355 remove and tests accounts (origin/7355-accountMigration2) by:carlossa
|
||||||
|
- fix: refs #7355 remove and tests accounts by:carlossa
|
||||||
|
- fix: refs #7524 default limit select by:jorgep
|
||||||
|
- fix: refs #7756 Foreign keys invoiceOut (origin/7756-fixRefFk) by:guillermo
|
||||||
|
- fix: refs #7756 id 0 by:guillermo
|
||||||
|
- fix: refs #7800 tpvMerchantEnable PRIMARY KEY (origin/7800-tpvMerchantEnable) by:guillermo
|
||||||
|
- fix: refs #7800 tpvMerchantEnable PRIMARY KEY by:guillermo
|
||||||
|
- fix: refs #7916 itemShelving_transfer (origin/test, test) by:guillermo
|
||||||
|
- fix: refs #pako Deleted duplicated version by:guillermo
|
||||||
|
|
||||||
|
# Version 24.34 - 2024-08-20
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- #6900 feat: clear empty by:jorgep
|
||||||
|
- #6900 feat: empty commit by:jorgep
|
||||||
|
- chore: refs #6900 beautify code by:jorgep
|
||||||
|
- chore: refs #6989 add config model by:jorgep
|
||||||
|
- feat workerActivity refs #6078 by:sergiodt
|
||||||
|
- feat: #6453 Refactor (origin/6453-orderConfirm) by:guillermo
|
||||||
|
- feat: #6453 Rollback always split by itemPackingType by:guillermo
|
||||||
|
- feat: deleted worker module code & redirect to Lilium by:Jon
|
||||||
|
- feat: refs #6453 Added new ticket search by:guillermo
|
||||||
|
- feat: refs #6453 Fixes by:guillermo
|
||||||
|
- feat: refs #6453 Minor changes by:guillermo
|
||||||
|
- feat: refs #6453 Requested changes by:guillermo
|
||||||
|
- feat: refs #6900 drop section by:jorgep
|
||||||
|
- feat: refs #7283 order by desc date by:jorgep
|
||||||
|
- feat: refs #7323 add locale by:jorgep
|
||||||
|
- feat: refs #7323 redirect to lilium by:jorgep
|
||||||
|
- feat: refs #7646 delete scannableCodeType by:robert
|
||||||
|
- feat: refs #7713 Created ACLLog by:guillermo
|
||||||
|
- feat: refs #7774 (origin/7774-ticket_cloneWeekly) by:robert
|
||||||
|
- feat: refs #7774 #7774 Changes ticket_cloneWeekly by:guillermo
|
||||||
|
- feat: refs #7774 ticket_cloneWeekly by:robert
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- refactor: refs #6453 Major changes by:guillermo
|
||||||
|
- refactor: refs #6453 Minor changes by:guillermo
|
||||||
|
- refactor: refs #6453 order_confirmWithUser by:guillermo
|
||||||
|
- refactor: refs #7646 #7646 Deleted scannable* variables productionConfig by:guillermo
|
||||||
|
- refactor: refs #7820 Deprecated silexACL by:guillermo
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- #6900 fix: #6900 rectificative filter by:jorgep
|
||||||
|
- #6900 fix: empty commit by:jorgep
|
||||||
|
- fix(orders_filter): add sourceApp accepts by:alexm
|
||||||
|
- fix: refs #6130 commit lint by:pablone
|
||||||
|
- fix: refs #6453 order_confirmWithUser by:guillermo
|
||||||
|
- fix: refs #7283 sql by:jorgep
|
||||||
|
- fix: refs #7713 ACL Log by:guillermo
|
||||||
|
- test: fix claim descriptor redirect to lilium by:alexm
|
||||||
|
- test: fix ticket redirect to lilium by:alexm
|
||||||
|
- test: fix ticket sale e2e by:alexm
|
||||||
|
|
||||||
|
# Version 24.32 - 2024-08-06
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #7197 add supplierActivityFk filter by:jorgep
|
||||||
|
- feat checkExpeditionPrintOut refs #7751 by:sergiodt
|
||||||
|
- feat(defaulter_filter): add department by:alexm
|
||||||
|
- feat: redirect to lilium page not found by:alexm
|
||||||
|
- feat: refactor buyUltimate refs #7736 by:Carlos Andrés
|
||||||
|
- feat: refs #6403 add delete by:pablone
|
||||||
|
- feat: refs #7126 Added manaClaim calc by:guillermo
|
||||||
|
- feat: refs #7126 Refactor and added columns in bs.waste table & proc by:guillermo
|
||||||
|
- feat: refs #7197 filter by correcting by:jorgep
|
||||||
|
- feat: refs #7297 add new columns by:pablone
|
||||||
|
- feat: refs #7356 new parameters in sql for Weekly tickets front by:Jon
|
||||||
|
- feat: refs #7401 redirect lilium by:pablone
|
||||||
|
- feat: refs #7511 Fix tests by:guillermo
|
||||||
|
- feat: refs #7511 Rename to multiConfig tables by:guillermo
|
||||||
|
- feat: refs #7589 Added display (item_valuateInventory) by:guillermo
|
||||||
|
- feat: refs #7589 Added vItemTypeFk & vItemCategoryFk (item_valuateInventory) by:guillermo
|
||||||
|
- feat: refs #7681 Changes by:guillermo
|
||||||
|
- feat: refs #7681 Optimization and refactor by:guillermo
|
||||||
|
- feat: refs #7683 drop temporary table by:robert
|
||||||
|
- feat: refs #7683 productionControl by:robert
|
||||||
|
- feat: refs #7728 Added throw due date by:guillermo
|
||||||
|
- feat: refs #7740 Ticket before update added restriction by:guillermo
|
||||||
|
- feat(salix): #7648 Add field for endpoint as buyLabel report by:Javier Segarra
|
||||||
|
- feat(salix): #7648 remove white line by:Javier Segarra
|
||||||
|
- feat: tabla config dias margen vctos. refs #7728 by:Carlos Andrés
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- eat: refactor buyUltimate refs #7736 by:Carlos Andrés
|
||||||
|
- feat: refactor buyUltimate refs #7736 by:Carlos Andrés
|
||||||
|
- feat: refs #7681 Optimization and refactor by:guillermo
|
||||||
|
- refactor: refs #7126 Requested changes by:guillermo
|
||||||
|
- refactor: refs #7511 Minor change by:guillermo
|
||||||
|
- refactor: refs #7640 Multipleinventory available by:guillermo
|
||||||
|
- refactor: refs #7681 Changes by:guillermo
|
||||||
|
- refactor: refs #7681 Requested changes by:guillermo
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- add prefix (hotFix_liliumRedirection) by:alexm
|
||||||
|
- fix(client_filter): add recovery by:alexm
|
||||||
|
- fix: defaulter filter correct sql (6943-fix_defaulter_filter) by:alexm
|
||||||
|
- fix(deletExpeditions): merge test → dev by:guillermo
|
||||||
|
- fix: refs #6403 fix mrw cancel shipment return type by:pablone
|
||||||
|
- fix: refs #7126 Added addressWaste type by:guillermo
|
||||||
|
- fix: refs #7126 Fix by:guillermo
|
||||||
|
- fix: refs #7126 Minor change by:guillermo
|
||||||
|
- fix: refs #7126 Primary key no unique data by:guillermo
|
||||||
|
- fix: refs #7126 Slow update by:guillermo
|
||||||
|
- fix: refs #7511 Minor change by:guillermo
|
||||||
|
- fix: refs #7546 Deleted insert util.binlogQueue by:guillermo
|
||||||
|
- fix: refs #7811 Variables pm2 by:guillermo
|
||||||
|
- fix: without path by:alexm
|
||||||
|
|
||||||
|
# Version 24.28 - 2024-07-09
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- feat boxPicking refs #7357 by:sergiodt
|
||||||
|
- feat boxPicking refs #7357 (origin/7357_dipole_review) by:sergiodt
|
||||||
|
- feat:concurrency issue refs #6861 by:Carlos Andrés
|
||||||
|
- feat expeditionPalletPrint refs #5210 by:sergiodt
|
||||||
|
- feat front-reservas refs #6861 (origin/6861-Reservas-front) by:sergiodt
|
||||||
|
- feat itemShelving_filterBuyer refs #7023 by:sergiodt
|
||||||
|
- feat itemShelvingLog refs #7168 by:sergiodt
|
||||||
|
- feat itemShelvingSale refs #6861 by:sergiodt
|
||||||
|
- feat: previas con reserva refs #6861 by:Carlos Andrés
|
||||||
|
- feat: previas con sitema de reservas refs #6861 by:Carlos Andrés
|
||||||
|
- feat: previas con sitema de reservas refs #6861 (origin/6861-Pasar-modo-trabajo-de-previa-a-reservas) by:Carlos Andrés
|
||||||
|
- feat refactor setParking REGEXP refs #7575 (origin/7575_setParking_regExp) by:sergiodt
|
||||||
|
- feat: refs #6238 add travelKgPercentage table and model (origin/6238-addPercentage) by:jorgep
|
||||||
|
- feat: refs #6286 check if is teamBoss (origin/6286-setRightWorkerTimeControlAcls) by:jorgep
|
||||||
|
- feat: refs #6701 Fix error by:guillermo
|
||||||
|
- feat: refs #6861 trigger by:sergiodt
|
||||||
|
- feat: refs #7027 mailError managed by:jgallego
|
||||||
|
- feat: refs #7168 Added vRecords param in proc by:guillermo
|
||||||
|
- feat: refs #7168 Minor change by:guillermo
|
||||||
|
- feat: refs #7216 logUnpaid (origin/7216-clientUnpaid) by:jgallego
|
||||||
|
- feat: refs #7216 triggers by:jgallego
|
||||||
|
- feat: refs #7296 by:robert
|
||||||
|
- feat: refs #7296 drop column expeditionTruckFk by:robert
|
||||||
|
- feat: refs #7490 Changes (origin/7490-duaInvoiceInBooking) by:guillermo
|
||||||
|
- feat: refs #7545 Deleted hasIncoterms client column (origin/7545-hasIncoterms) by:guillermo
|
||||||
|
- feat: refs #7555 remove account.password__ by:alexm
|
||||||
|
- feat: return sql check error by:alexm
|
||||||
|
- feat roadmap refs #7195 by:sergiodt
|
||||||
|
- #refs 5890 feat:add assignCollection by:sergiodt
|
||||||
|
- refs#5890 feat: delete trigger and modify getTickets by:sergiodt
|
||||||
|
- refs #5890 feat:itemShelving_add by:sergiodt
|
||||||
|
- refs #5890 feat:reserves by:sergiodt
|
||||||
|
- refs #5890 feat:trigger by:sergiodt
|
||||||
|
- refs #5890 feat: triggers by:sergiodt
|
||||||
|
- refs #6861 feat: getLock by:sergiodt
|
||||||
|
- refs #6861 feat: obsrevation by:sergiodt
|
||||||
|
- refs #6861 feat: previas a reservas by:sergiodt
|
||||||
|
- refs #6861 feat:reserve previos by:sergiodt
|
||||||
|
- refs #6861 feat: reservePrevious by:sergiodt
|
||||||
|
- refs #6861 feat:reserveWithReservation by:sergiodt
|
||||||
|
- refs #6861 feat:sectoCollection reserve by:sergiodt
|
||||||
|
- refs #6861 feat: skipTest by:sergiodt
|
||||||
|
- refs #6861 feat: trigger by:sergiodt
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- feat refactor setParking REGEXP refs #7575 (origin/7575_setParking_regExp) by:sergiodt
|
||||||
|
- refactor: refs #5447 changed models by:Jon
|
||||||
|
- refactor: refs #6238 drop useless round by:jorgep
|
||||||
|
- refactor: refs #6286 replace name by:jorgep
|
||||||
|
- refactor: refs #6701 Refactor claim_ratio_routine by:guillermo
|
||||||
|
- refactor: refs #7490 Added final update by:guillermo
|
||||||
|
- refactor: refs #7490 Deleted update duaInvoiceInBooking by:guillermo
|
||||||
|
- refactor: refs #7490 Minor changes by:guillermo
|
||||||
|
- refactor: refs #7519 Minor change by:guillermo
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- acls, fixtures, models by:carlossa
|
||||||
|
- fix: refs #6238 delete unused SQL script by:jorgep
|
||||||
|
- fix: refs #6238 insert ignore by:jorgep
|
||||||
|
- fix: refs #6238 use scheme by:jorgep
|
||||||
|
- fix: refs #6286 replace id for reason by:jorgep
|
||||||
|
- fix: refs #6286 update WorkerTimeControl permissions by:jorgep
|
||||||
|
- fix(WorkerIncome): refs #7409 fix models by:alexm
|
||||||
|
- refs #5890 fix: dev by:sergiodt
|
||||||
|
- refs #6897 fix entry Salix by:carlossa
|
||||||
|
- refs #6897 fix es.yml by:carlossa
|
||||||
|
- refs #6897 fix redirection by:carlossa
|
||||||
|
- refs #6897 fix remove by:carlossa
|
||||||
|
- refs #7406 fix back by:carlossa
|
||||||
|
- refs #7406 fix pr by:carlossa
|
||||||
|
- refs #7409 fix acls by:carlossa
|
||||||
|
- refs #7409 fix back (origin/7409-workerIncome) by:carlossa
|
||||||
|
- refs #7409 fix pr by:carlossa
|
||||||
|
|
||||||
|
# Version 24.24 - 2024-06-11
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- 6281 feat:buyFk in itemShekving by:sergiodt
|
||||||
|
- 6281 feat:buyFk in itemShelving by:sergiodt
|
||||||
|
- feat: #6408 tests by:jgallego
|
||||||
|
- feat: packaging refs #4021 (origin/4021_packaging) by:sergiodt
|
||||||
|
- feat: refs #6021 add new field by:pablone
|
||||||
|
- feat: refs #6281 change fixtures by:robert
|
||||||
|
- feat: refs # 6408 test ok (origin/6408-rocketChat) by:jgallego
|
||||||
|
- feat: refs #6477 productionConfig add column by:robert
|
||||||
|
- feat: refs #6600 add column (origin/6600-createItemPhotoComment) by:jorgep
|
||||||
|
- feat: refs #6600 Add photoMotivation column to item table and create itemPhotoComment table by:jorgep
|
||||||
|
- feat: refs #6889 add back tests by:jorgep
|
||||||
|
- feat: refs #6889 fixtures & models by:jorgep
|
||||||
|
- feat : refs #6889 wip: check if is productionReviewer or owner by:jorgep
|
||||||
|
- feat: refs #6942 set false isBooed & ledger by:jorgep
|
||||||
|
- feat: refs #6942 toUnbook by:jorgep
|
||||||
|
- feat: refs #6942 xdiario fixtures by:jorgep
|
||||||
|
- feat: refs #7398 Change by:guillermo
|
||||||
|
- feat: refs #7438 Added volume to item_valuateInventory by:guillermo
|
||||||
|
- feat: refs #7438 Requested changes and little changes by:guillermo
|
||||||
|
- refs #6281 feat:buyFk in itemShelving by:sergiodt
|
||||||
|
- feat: refs #6449 item ID is displayed in the sale line by:jorgep
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- refactor: refs #6600 add space by:jorgep
|
||||||
|
- refactor: refs #6889 improve file loading logic by:jorgep
|
||||||
|
- refactor: refs #6889 sale tests e2e by:jorgep
|
||||||
|
- refactor: refs #6889 script sql (origin/6889-dropAddSaleByCode) by:jorgep
|
||||||
|
- refactor: refs #6889 use addSale by:jorgep
|
||||||
|
- refactor: refs #6942 toUnbook & drop buyer acls by:jorgep
|
||||||
|
- refactor: refs #7398 Refactor and change ekt_scan (origin/7398-ektScan) by:guillermo
|
||||||
|
- refactor: refs #7486 Optimized procs by:guillermo
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- feat: refs #6281 change fixtures by:robert
|
||||||
|
- feat: refs #6889 fixtures & models by:jorgep
|
||||||
|
- feat: refs #6942 xdiario fixtures by:jorgep
|
||||||
|
- fix: checking process.env.NODE_ENV by:alexm
|
||||||
|
- fix: en translations by:alexm
|
||||||
|
- fix: move to boot (origin/7421-fix_checking_NODE_ENV, 7421-fix_checking_NODE_ENV) by:alexm
|
||||||
|
- fix: refs #6095 filter by refFk null by:pablone
|
||||||
|
- fix: refs #6600 rollback by:jorgep
|
||||||
|
- fix: refs #6889 allocate 'productionReviewer' role to revision dep. workers & check if is owner or reviewer by:jorgep
|
||||||
|
- fix: refs #6889 check if has collection or sectorCollection by:jorgep
|
||||||
|
- fix: refs #6889 e2e tests by:jorgep
|
||||||
|
- fix: refs #6889 fix back tests by:jorgep
|
||||||
|
- fix: refs #6889 modify fixtures by:jorgep
|
||||||
|
- fix: refs #6889 rollback by:jorgep
|
||||||
|
- fix: refs #6942 acls & back by:jorgep
|
||||||
|
- fix: refs #6942 add deleteById acl by:jorgep
|
||||||
|
- fix: refs #6942 add test & change column name by:jorgep
|
||||||
|
- fix: refs #6942 create invoiceIn acl by:jorgep
|
||||||
|
- fix: refs #6942 delete by:jorgep
|
||||||
|
- fix: refs #6942 drop quotes by:jorgep
|
||||||
|
- fix : refs #6942 remove grafana update priv by:jorgep
|
||||||
|
- fix: refs #6942 revoke update isBooked by:jorgep
|
||||||
|
- fix: refs #6942 toBook/toUnbook by:jorgep
|
||||||
|
- fix: refs #7442 Fix kubernetes deploy by:Juan Ferrer Toribio
|
||||||
|
- fix(salix): refs #7272 #7272 Add aclService in routes.js by:Javier Segarra
|
||||||
|
- fix(salix): refs #7272 #7272 Back validateToken endpoint by:Javier Segarra
|
||||||
|
- fix(salix): refs #7272 #7272 Bug when acl not loaded by:Javier Segarra
|
||||||
|
- fix(salix): refs #7272 #7272 Call validateToken by:Javier Segarra
|
||||||
|
- fix(salix): refs #7272 #7272 Errors when Token not exists by:Javier Segarra
|
||||||
|
- fix(salix): refs #7272 #7272 Front retry calls by:Javier Segarra
|
||||||
|
- fix(salix): refs #7272 #7272 i18n Error by:Javier Segarra
|
||||||
|
- fix(salix): refs #7272 #7272 Remove aclService from auth.js by:Javier Segarra
|
||||||
|
- fix: simplify by:alexm
|
||||||
|
- fix traduction & e2e by:carlossa
|
||||||
|
- refs #6820 fix back by:carlossa
|
||||||
|
- refs #6820 fix pr by:carlossa
|
||||||
|
- refs #6832 fix: ToItem (origin/6832_refactorBackToItem) by:Sergio De la torre
|
||||||
|
- refs #7292 fix tback by:carlossa
|
||||||
|
- refs #7296 fix pr errors, trad by:carlossa
|
||||||
|
- test(salix): refs #7272 #7272 fix renew-token.spec by:Javier Segarra
|
||||||
|
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ node {
|
||||||
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
|
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
|
||||||
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
|
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
|
||||||
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
|
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
|
||||||
|
|
||||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||||
|
@ -59,7 +60,6 @@ pipeline {
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
PROJECT_NAME = 'salix'
|
PROJECT_NAME = 'salix'
|
||||||
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
|
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Install') {
|
stage('Install') {
|
||||||
|
@ -103,7 +103,7 @@ pipeline {
|
||||||
NODE_ENV = ''
|
NODE_ENV = ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'node back/tests.js --ci --junit --network jenkins'
|
sh 'node back/tests.js --junit'
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
@ -121,7 +121,7 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def packageJson = readJSON file: 'package.json'
|
def packageJson = readJSON file: 'package.json'
|
||||||
env.VERSION = packageJson.version
|
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||||
}
|
}
|
||||||
sh 'docker-compose build back'
|
sh 'docker-compose build back'
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def packageJson = readJSON file: 'package.json'
|
def packageJson = readJSON file: 'package.json'
|
||||||
env.VERSION = packageJson.version
|
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||||
}
|
}
|
||||||
sh 'gulp build'
|
sh 'gulp build'
|
||||||
sh 'docker-compose build front'
|
sh 'docker-compose build front'
|
||||||
|
@ -179,7 +179,7 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def packageJson = readJSON file: 'package.json'
|
def packageJson = readJSON file: 'package.json'
|
||||||
env.VERSION = packageJson.version
|
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||||
}
|
}
|
||||||
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
|
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
|
||||||
sh 'docker-compose push'
|
sh 'docker-compose push'
|
||||||
|
@ -203,19 +203,23 @@ pipeline {
|
||||||
sh 'npx myt push $NODE_ENV --force --commit'
|
sh 'npx myt push $NODE_ENV --force --commit'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docker') {
|
stage('Kubernetes') {
|
||||||
when {
|
when {
|
||||||
expression { FROM_GIT }
|
expression { FROM_GIT }
|
||||||
}
|
}
|
||||||
environment {
|
|
||||||
DOCKER_HOST = "${env.SWARM_HOST}"
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def packageJson = readJSON file: 'package.json'
|
def packageJson = readJSON file: 'package.json'
|
||||||
env.VERSION = packageJson.version
|
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||||
|
}
|
||||||
|
withKubeConfig([
|
||||||
|
serverUrl: "$KUBERNETES_API",
|
||||||
|
credentialsId: 'kubernetes',
|
||||||
|
namespace: 'salix'
|
||||||
|
]) {
|
||||||
|
sh 'kubectl set image deployment/salix-back-$BRANCH_NAME salix-back-$BRANCH_NAME=$REGISTRY/salix-back:$VERSION'
|
||||||
|
sh 'kubectl set image deployment/salix-front-$BRANCH_NAME salix-front-$BRANCH_NAME=$REGISTRY/salix-front:$VERSION'
|
||||||
}
|
}
|
||||||
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.STACK_NAME}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,16 @@ Required applications.
|
||||||
* Node.js
|
* Node.js
|
||||||
* Docker
|
* Docker
|
||||||
* Git
|
* Git
|
||||||
|
* MYT
|
||||||
|
|
||||||
You will need to install globally the following items.
|
You will need to install globally the following items.
|
||||||
```
|
```
|
||||||
$ sudo npm install -g jest gulp-cli
|
$ sudo npm install -g jest gulp-cli
|
||||||
```
|
```
|
||||||
|
After installing MYT you will need the following item.
|
||||||
|
```
|
||||||
|
$ apt install libkrb5-dev libssl-dev
|
||||||
|
```
|
||||||
|
|
||||||
## Installing dependencies and launching
|
## Installing dependencies and launching
|
||||||
|
|
||||||
|
@ -23,7 +28,7 @@ Pull from repository.
|
||||||
|
|
||||||
Run this commands on project root directory to install Node dependencies.
|
Run this commands on project root directory to install Node dependencies.
|
||||||
```
|
```
|
||||||
$ npm install
|
$ pnpm install
|
||||||
$ gulp install
|
$ gulp install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,14 @@ module.exports = Self => {
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
const [, , [{collectionFk}]] =
|
const randStr = Math.random().toString(36).substring(3);
|
||||||
await Self.rawSql('CALL vn.collection_assign(?, @vCollectionFk); SELECT @vCollectionFk collectionFk',
|
const result = await Self.rawSql(`
|
||||||
[userId], myOptions);
|
CALL vn.collection_assign(?, @vCollectionFk);
|
||||||
|
SELECT @vCollectionFk ?
|
||||||
|
`, [userId, randStr], myOptions);
|
||||||
|
|
||||||
|
// Por si entra en SELECT FOR UPDATE una o varias veces
|
||||||
|
const collectionFk = result.find(item => item[0]?.[randStr] !== undefined)?.[0]?.[randStr];
|
||||||
|
|
||||||
if (!collectionFk) throw new UserError('There are not picking tickets');
|
if (!collectionFk) throw new UserError('There are not picking tickets');
|
||||||
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
|
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('assignCollection', {
|
||||||
|
description: 'Assign a collection',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
http: {
|
||||||
|
path: `/assignCollection`,
|
||||||
|
verb: 'POST'
|
||||||
|
},
|
||||||
|
returns: {
|
||||||
|
type: ['object'],
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.assignCollection = async(ctx, options) => {
|
||||||
|
const userId = ctx.req.accessToken.userId;
|
||||||
|
const myOptions = {userId};
|
||||||
|
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
const randStr = Math.random().toString(36).substring(3);
|
||||||
|
const result = await Self.rawSql(`
|
||||||
|
CALL vn.collection_getAssigned(?, @vCollectionFk);
|
||||||
|
SELECT @vCollectionFk ?
|
||||||
|
`, [userId, randStr], myOptions);
|
||||||
|
|
||||||
|
const collectionFk = result.find(item => item[0]?.[randStr] !== undefined)?.[0]?.[randStr];
|
||||||
|
|
||||||
|
if (!collectionFk) throw new UserError('There are not picking tickets');
|
||||||
|
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
|
||||||
|
|
||||||
|
return collectionFk;
|
||||||
|
};
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethodCtx('getSales', {
|
Self.remoteMethodCtx('getSales', {
|
||||||
description: 'Get sales from ticket or collection',
|
description: 'Get sales from ticket, collection or sectorCollection',
|
||||||
accessType: 'READ',
|
accessType: 'READ',
|
||||||
accepts: [
|
accepts: [
|
||||||
{
|
{
|
||||||
|
@ -60,15 +60,17 @@ module.exports = Self => {
|
||||||
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
|
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
|
||||||
|
|
||||||
for (let ticket of tickets) {
|
for (let ticket of tickets) {
|
||||||
let observations = ticket.observaciones.split(' ');
|
if (ticket.observaciones) {
|
||||||
|
let observations = ticket.observaciones.split(' ');
|
||||||
|
|
||||||
for (let observation of observations) {
|
for (let observation of observations) {
|
||||||
const salesPerson = ticket.salesPersonFk;
|
const salesPerson = ticket.salesPersonFk;
|
||||||
if (observation.startsWith('#') || observation.startsWith('@')) {
|
if (observation.startsWith('#') || observation.startsWith('@')) {
|
||||||
await models.Chat.send(ctx,
|
await models.Chat.send(ctx,
|
||||||
observation,
|
observation,
|
||||||
$t('ticketCommercial', {ticket: ticket.ticketFk, salesPerson})
|
$t('ticketCommercial', {ticket: ticket.ticketFk, salesPerson})
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [id], myOptions);
|
const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [id], myOptions);
|
||||||
|
|
||||||
const sales = await Self.rawSql(`
|
const sales = await Self.rawSql(`
|
||||||
SELECT s.ticketFk,
|
SELECT s.ticketFk,
|
||||||
sgd.saleGroupFk,
|
sgd.saleGroupFk,
|
||||||
|
@ -56,19 +57,20 @@ module.exports = Self => {
|
||||||
ROW_NUMBER () OVER (PARTITION BY s.id ORDER BY pickingOrder) currentItemShelving,
|
ROW_NUMBER () OVER (PARTITION BY s.id ORDER BY pickingOrder) currentItemShelving,
|
||||||
COUNT(*) OVER (PARTITION BY s.id ORDER BY s.id) totalItemShelving,
|
COUNT(*) OVER (PARTITION BY s.id ORDER BY s.id) totalItemShelving,
|
||||||
sh.code,
|
sh.code,
|
||||||
IFNULL(p2.code, p.code) parkingCode,
|
p2.code parkingCode,
|
||||||
IFNULL(p2.pickingOrder, p.pickingOrder) pickingOrder,
|
p2.pickingOrder pickingOrder,
|
||||||
|
p.code parkingCodePrevia,
|
||||||
|
p.pickingOrder pickingOrderPrevia,
|
||||||
iss.id itemShelvingSaleFk,
|
iss.id itemShelvingSaleFk,
|
||||||
iss.isPicked
|
iss.isPicked
|
||||||
FROM ticketCollection tc
|
FROM ticketCollection tc
|
||||||
LEFT JOIN collection c ON c.id = tc.collectionFk
|
LEFT JOIN collection c ON c.id = tc.collectionFk
|
||||||
JOIN ticket t ON t.id = tc.ticketFk
|
JOIN sale s ON s.ticketFk = tc.ticketFk
|
||||||
JOIN sale s ON s.ticketFk = t.id
|
|
||||||
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
|
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||||
LEFT JOIN saleGroup sg ON sg.id = sgd.saleGroupFk
|
LEFT JOIN saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||||
LEFT JOIN parking p2 ON p2.id = sg.parkingFk
|
LEFT JOIN parking p2 ON p2.id = sg.parkingFk
|
||||||
JOIN item i ON i.id = s.itemFk
|
JOIN item i ON i.id = s.itemFk
|
||||||
LEFT JOIN itemShelvingSale iss ON iss.saleFk = s.id
|
JOIN itemShelvingSale iss ON iss.saleFk = s.id
|
||||||
LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||||
LEFT JOIN shelving sh ON sh.code = ish.shelvingFk
|
LEFT JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||||
LEFT JOIN parking p ON p.id = sh.parkingFk
|
LEFT JOIN parking p ON p.id = sh.parkingFk
|
||||||
|
@ -76,17 +78,57 @@ module.exports = Self => {
|
||||||
LEFT JOIN origin o ON o.id = i.originFk
|
LEFT JOIN origin o ON o.id = i.originFk
|
||||||
WHERE tc.collectionFk = ?
|
WHERE tc.collectionFk = ?
|
||||||
GROUP BY s.id, ish.id, p.code, p2.code
|
GROUP BY s.id, ish.id, p.code, p2.code
|
||||||
ORDER BY pickingOrder;`, [id], myOptions);
|
UNION ALL
|
||||||
|
SELECT s.ticketFk,
|
||||||
|
sgd.saleGroupFk,
|
||||||
|
s.id saleFk,
|
||||||
|
s.itemFk,
|
||||||
|
i.longName,
|
||||||
|
i.size,
|
||||||
|
ic.color,
|
||||||
|
o.code origin,
|
||||||
|
ish.packing,
|
||||||
|
ish.grouping,
|
||||||
|
s.isAdded,
|
||||||
|
s.originalQuantity,
|
||||||
|
s.quantity,
|
||||||
|
iss.quantity,
|
||||||
|
SUM(iss.quantity) OVER (PARTITION BY s.id ORDER BY ish.id),
|
||||||
|
ROW_NUMBER () OVER (PARTITION BY s.id ORDER BY p.pickingOrder),
|
||||||
|
COUNT(*) OVER (PARTITION BY s.id ORDER BY s.id) ,
|
||||||
|
sh.code,
|
||||||
|
p2.code,
|
||||||
|
p2.pickingOrder,
|
||||||
|
p.code,
|
||||||
|
p.pickingOrder,
|
||||||
|
iss.id itemShelvingSaleFk,
|
||||||
|
iss.isPicked
|
||||||
|
FROM sectorCollection sc
|
||||||
|
JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id
|
||||||
|
JOIN saleGroup sg ON sg.id = ss.saleGroupFk
|
||||||
|
LEFT JOIN saleGroupDetail sgd ON sgd.saleGroupFk = sg.id
|
||||||
|
JOIN sale s ON s.id = sgd.saleFk
|
||||||
|
LEFT JOIN parking p2 ON p2.id = sg.parkingFk
|
||||||
|
JOIN item i ON i.id = s.itemFk
|
||||||
|
JOIN itemShelvingSale iss ON iss.saleFk = s.id
|
||||||
|
LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||||
|
LEFT JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||||
|
LEFT JOIN parking p ON p.id = sh.parkingFk
|
||||||
|
LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk
|
||||||
|
LEFT JOIN origin o ON o.id = i.originFk
|
||||||
|
WHERE sc.id = ?
|
||||||
|
AND sgd.saleGroupFk
|
||||||
|
GROUP BY s.id, ish.id, p.code, p2.code`, [id, id], myOptions);
|
||||||
if (print)
|
if (print)
|
||||||
await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [id, null], myOptions);
|
await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [id, null], myOptions);
|
||||||
|
|
||||||
const collection = {collectionFk: id, tickets: []};
|
const collection = {collectionFk: id, tickets: []};
|
||||||
|
|
||||||
if (tickets && tickets.length) {
|
if (tickets && tickets.length) {
|
||||||
for (const ticket of tickets) {
|
for (const ticket of tickets) {
|
||||||
const ticketId = ticket.ticketFk;
|
const ticketId = ticket.ticketFk;
|
||||||
if (ticket.observaciones != '') {
|
if (ticket.observation) {
|
||||||
for (observation of ticket.observaciones.split(' ')) {
|
for (observation of ticket.observation?.split(' ')) {
|
||||||
if (['#', '@'].includes(observation.charAt(0))) {
|
if (['#', '@'].includes(observation.charAt(0))) {
|
||||||
promises.push(Self.app.models.Chat.send(ctx, observation,
|
promises.push(Self.app.models.Chat.send(ctx, observation,
|
||||||
$t('The ticket is in preparation', {
|
$t('The ticket is in preparation', {
|
||||||
|
@ -100,11 +142,11 @@ module.exports = Self => {
|
||||||
if (sales && sales.length) {
|
if (sales && sales.length) {
|
||||||
const barcodes = await Self.rawSql(`
|
const barcodes = await Self.rawSql(`
|
||||||
SELECT s.id saleFk, b.code, c.id
|
SELECT s.id saleFk, b.code, c.id
|
||||||
FROM vn.sale s
|
FROM sale s
|
||||||
LEFT JOIN vn.itemBarcode b ON b.itemFk = s.itemFk
|
LEFT JOIN itemBarcode b ON b.itemFk = s.itemFk
|
||||||
LEFT JOIN vn.buy c ON c.itemFk = s.itemFk
|
LEFT JOIN buy c ON c.itemFk = s.itemFk
|
||||||
LEFT JOIN vn.entry e ON e.id = c.entryFk
|
LEFT JOIN entry e ON e.id = c.entryFk
|
||||||
LEFT JOIN vn.travel tr ON tr.id = e.travelFk
|
LEFT JOIN travel tr ON tr.id = e.travelFk
|
||||||
WHERE s.ticketFk = ?
|
WHERE s.ticketFk = ?
|
||||||
AND tr.landed >= util.VN_CURDATE() - INTERVAL 1 YEAR`,
|
AND tr.landed >= util.VN_CURDATE() - INTERVAL 1 YEAR`,
|
||||||
[ticketId], myOptions);
|
[ticketId], myOptions);
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
const LoopBackContext = require('loopback-context');
|
||||||
|
|
||||||
|
describe('ticket assignCollection()', () => {
|
||||||
|
let ctx;
|
||||||
|
let options;
|
||||||
|
let tx;
|
||||||
|
beforeEach(async() => {
|
||||||
|
ctx = {
|
||||||
|
req: {
|
||||||
|
accessToken: {userId: 1106},
|
||||||
|
headers: {origin: 'http://localhost'},
|
||||||
|
__: value => value
|
||||||
|
},
|
||||||
|
args: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({active: ctx.req});
|
||||||
|
|
||||||
|
options = {transaction: tx};
|
||||||
|
tx = await models.Sale.beginTransaction({});
|
||||||
|
options.transaction = tx;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async() => {
|
||||||
|
if (tx) await tx.rollback();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error when there is not picking tickets', async() => {
|
||||||
|
try {
|
||||||
|
await models.Collection.assignCollection(ctx, options);
|
||||||
|
} catch (e) {
|
||||||
|
expect(e.message).toEqual('There are not picking tickets');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -4,15 +4,7 @@ describe('collection getSales()', () => {
|
||||||
const collectionOrTicketFk = 999999;
|
const collectionOrTicketFk = 999999;
|
||||||
const print = true;
|
const print = true;
|
||||||
const source = 'CHECKER';
|
const source = 'CHECKER';
|
||||||
|
const ctx = beforeAll.getCtx();
|
||||||
beforeAll(() => {
|
|
||||||
ctx = {
|
|
||||||
req: {
|
|
||||||
accessToken: {userId: 9},
|
|
||||||
headers: {origin: 'http://localhost'},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return a collection with tickets, placements and barcodes settled correctly', async() => {
|
it('should return a collection with tickets, placements and barcodes settled correctly', async() => {
|
||||||
const tx = await models.Collection.beginTransaction({});
|
const tx = await models.Collection.beginTransaction({});
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
describe('collection getTickets()', () => {
|
describe('collection getTickets()', () => {
|
||||||
let ctx;
|
const ctx = beforeAll.getCtx();
|
||||||
beforeAll(async() => {
|
|
||||||
ctx = {
|
|
||||||
req: {
|
|
||||||
accessToken: {userId: 9},
|
|
||||||
headers: {origin: 'http://localhost'}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should get tickets, sales and barcodes from collection', async() => {
|
it('should get tickets, sales and barcodes from collection', async() => {
|
||||||
const tx = await models.Collection.beginTransaction({});
|
const tx = await models.Collection.beginTransaction({});
|
||||||
|
@ -26,8 +18,8 @@ describe('collection getTickets()', () => {
|
||||||
expect(collectionTickets.tickets[1].ticketFk).toEqual(2);
|
expect(collectionTickets.tickets[1].ticketFk).toEqual(2);
|
||||||
expect(collectionTickets.tickets[2].ticketFk).toEqual(23);
|
expect(collectionTickets.tickets[2].ticketFk).toEqual(23);
|
||||||
expect(collectionTickets.tickets[0].sales[0].ticketFk).toEqual(1);
|
expect(collectionTickets.tickets[0].sales[0].ticketFk).toEqual(1);
|
||||||
expect(collectionTickets.tickets[0].sales[1].ticketFk).toEqual(1);
|
expect(collectionTickets.tickets[1].sales.length).toEqual(0);
|
||||||
expect(collectionTickets.tickets[0].sales[2].ticketFk).toEqual(1);
|
expect(collectionTickets.tickets[2].sales.length).toEqual(0);
|
||||||
expect(collectionTickets.tickets[0].sales[0].Barcodes.length).toBeTruthy();
|
expect(collectionTickets.tickets[0].sales[0].Barcodes.length).toBeTruthy();
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -1,20 +1,7 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
const LoopBackContext = require('loopback-context');
|
|
||||||
|
|
||||||
describe('setSaleQuantity()', () => {
|
describe('setSaleQuantity()', () => {
|
||||||
beforeAll(async() => {
|
beforeAll.mockLoopBackContext();
|
||||||
const activeCtx = {
|
|
||||||
accessToken: {userId: 9},
|
|
||||||
http: {
|
|
||||||
req: {
|
|
||||||
headers: {origin: 'http://localhost'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
|
||||||
active: activeCtx
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should change quantity sale', async() => {
|
it('should change quantity sale', async() => {
|
||||||
const tx = await models.Ticket.beginTransaction({});
|
const tx = await models.Ticket.beginTransaction({});
|
||||||
|
|
|
@ -38,7 +38,7 @@ module.exports = Self => {
|
||||||
{
|
{
|
||||||
arg: 'hasFile',
|
arg: 'hasFile',
|
||||||
type: 'Boolean',
|
type: 'Boolean',
|
||||||
description: 'True if has an attached file'
|
description: 'True if has the original in paper'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
arg: 'hasFileAttached',
|
arg: 'hasFileAttached',
|
||||||
|
|
|
@ -24,7 +24,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx, userId: ctx.req.accessToken.userId};
|
const options = {transaction: tx, userId: ctx.req.accessToken.userId};
|
||||||
const files = await Self.rawSql('SELECT name, checksum, keyValue FROM edi.fileConfig', null, options);
|
const files = await Self.rawSql('SELECT name, checksum, keyValue FROM edi.fileMultiConfig', null, options);
|
||||||
|
|
||||||
const updatableFiles = [];
|
const updatableFiles = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
|
@ -54,7 +54,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
const tables = await Self.rawSql(`
|
const tables = await Self.rawSql(`
|
||||||
SELECT fileName, toTable, file
|
SELECT fileName, toTable, file
|
||||||
FROM edi.tableConfig
|
FROM edi.tableMultiConfig
|
||||||
WHERE file IN (?)`, [fileNames], options);
|
WHERE file IN (?)`, [fileNames], options);
|
||||||
|
|
||||||
for (const table of tables) {
|
for (const table of tables) {
|
||||||
|
@ -85,9 +85,9 @@ module.exports = Self => {
|
||||||
for (const file of updatableFiles) {
|
for (const file of updatableFiles) {
|
||||||
console.log(`Updating file ${file.name} checksum...`);
|
console.log(`Updating file ${file.name} checksum...`);
|
||||||
await Self.rawSql(`
|
await Self.rawSql(`
|
||||||
UPDATE edi.fileConfig
|
UPDATE edi.fileMultiConfig
|
||||||
SET checksum = ?
|
SET checksum = ?
|
||||||
WHERE name = ?`,
|
WHERE name = ?`,
|
||||||
[file.checksum, file.name], options);
|
[file.checksum, file.name], options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
await Self.rawSql(sqlTemplate, [filePath], options);
|
await Self.rawSql(sqlTemplate, [filePath], options);
|
||||||
await Self.rawSql(`
|
await Self.rawSql(`
|
||||||
UPDATE edi.tableConfig
|
UPDATE edi.tableMultiConfig
|
||||||
SET updated = ?
|
SET updated = ?
|
||||||
WHERE fileName = ?
|
WHERE fileName = ?
|
||||||
`, [Date.vnNew(), baseName], options);
|
`, [Date.vnNew(), baseName], options);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<soap:Header>
|
<soap:Header>
|
||||||
<mrw:AuthInfo>
|
<mrw:AuthInfo>
|
||||||
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
|
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
|
||||||
<mrw:CodigoAbonado><%= mrw.subscriberCode %></mrw:CodigoAbonado>
|
<mrw:CodigoAbonado><%= clientType %></mrw:CodigoAbonado>
|
||||||
<mrw:CodigoDepartamento/>
|
<mrw:CodigoDepartamento/>
|
||||||
<mrw:UserName><%= mrw.user %></mrw:UserName>
|
<mrw:UserName><%= mrw.user %></mrw:UserName>
|
||||||
<mrw:Password><%= mrw.password %></mrw:Password>
|
<mrw:Password><%= mrw.password %></mrw:Password>
|
||||||
|
|
|
@ -13,7 +13,7 @@ module.exports = Self => {
|
||||||
required: true
|
required: true
|
||||||
}],
|
}],
|
||||||
returns: {
|
returns: {
|
||||||
type: ['object'],
|
type: 'boolean',
|
||||||
root: true
|
root: true
|
||||||
},
|
},
|
||||||
http: {
|
http: {
|
||||||
|
@ -27,9 +27,9 @@ module.exports = Self => {
|
||||||
|
|
||||||
const mrw = await models.MrwConfig.findOne();
|
const mrw = await models.MrwConfig.findOne();
|
||||||
const {externalId} = await models.Expedition.findById(expeditionFk);
|
const {externalId} = await models.Expedition.findById(expeditionFk);
|
||||||
|
const clientType = await models.MrwConfig.getClientType(expeditionFk);
|
||||||
const template = fs.readFileSync(__dirname + '/cancelShipment.ejs', 'utf-8');
|
const template = fs.readFileSync(__dirname + '/cancelShipment.ejs', 'utf-8');
|
||||||
const renderedXml = ejs.render(template, {mrw, externalId});
|
const renderedXml = ejs.render(template, {mrw, externalId, clientType});
|
||||||
const response = await axios.post(mrw.url, renderedXml, {
|
const response = await axios.post(mrw.url, renderedXml, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/soap+xml; charset=utf-8'
|
'Content-Type': 'application/soap+xml; charset=utf-8'
|
||||||
|
@ -39,6 +39,7 @@ module.exports = Self => {
|
||||||
const xmlString = response.data;
|
const xmlString = response.data;
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
||||||
return xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
|
const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
|
||||||
|
return result.toLowerCase().includes('se ha cancelado correctamente');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<soap:Header>
|
<soap:Header>
|
||||||
<mrw:AuthInfo>
|
<mrw:AuthInfo>
|
||||||
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
|
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
|
||||||
<mrw:CodigoAbonado><%= mrw.subscriberCode %></mrw:CodigoAbonado>
|
<mrw:CodigoAbonado><%= clientType %></mrw:CodigoAbonado>
|
||||||
<mrw:CodigoDepartamento/>
|
<mrw:CodigoDepartamento/>
|
||||||
<mrw:UserName><%= mrw.user %></mrw:UserName>
|
<mrw:UserName><%= mrw.user %></mrw:UserName>
|
||||||
<mrw:Password><%= mrw.password %></mrw:Password>
|
<mrw:Password><%= mrw.password %></mrw:Password>
|
||||||
|
@ -25,17 +25,25 @@
|
||||||
</mrw:Direccion>
|
</mrw:Direccion>
|
||||||
<mrw:Nif><%= expeditionData.fi %></mrw:Nif>
|
<mrw:Nif><%= expeditionData.fi %></mrw:Nif>
|
||||||
<mrw:Nombre><%= expeditionData.clientName %></mrw:Nombre>
|
<mrw:Nombre><%= expeditionData.clientName %></mrw:Nombre>
|
||||||
<mrw:Telefono><%= expeditionData.phone %></mrw:Telefono>
|
<mrw:Telefono><%= expeditionData.mobile %></mrw:Telefono>
|
||||||
|
<mrw:Observaciones><%= expeditionData.deliveryObservation %></mrw:Observaciones>
|
||||||
</mrw:DatosEntrega>
|
</mrw:DatosEntrega>
|
||||||
<mrw:DatosServicio>
|
<mrw:DatosServicio>
|
||||||
<mrw:Fecha><%= expeditionData.created %></mrw:Fecha>
|
<mrw:Fecha><%= expeditionData.created %></mrw:Fecha>
|
||||||
<mrw:Referencia><%= expeditionData.expeditionDataId %></mrw:Referencia>
|
<mrw:Referencia><%= expeditionData.reference %></mrw:Referencia>
|
||||||
<mrw:CodigoServicio><%= expeditionData.serviceType %></mrw:CodigoServicio>
|
<mrw:CodigoServicio><%= expeditionData.serviceType %></mrw:CodigoServicio>
|
||||||
<mrw:NumeroBultos>1</mrw:NumeroBultos>
|
<mrw:NumeroBultos>1</mrw:NumeroBultos>
|
||||||
<mrw:EntregaSabado><%= expeditionData.weekDays %></mrw:EntregaSabado>
|
<mrw:EntregaSabado><%= expeditionData.weekDays %></mrw:EntregaSabado>
|
||||||
<mrw:Peso><%= expeditionData.kg %></mrw:Peso>
|
|
||||||
<mrw:Reembolso/>
|
<mrw:Reembolso/>
|
||||||
<mrw:ImporteReembolso/>
|
<mrw:ImporteReembolso/>
|
||||||
|
<mrw:Bultos>
|
||||||
|
<mrw:BultoRequest>
|
||||||
|
<mrw:Alto><%= mrw.defaultHeight %></mrw:Alto>
|
||||||
|
<mrw:Largo><%= mrw.defaultLength %></mrw:Largo>
|
||||||
|
<mrw:Ancho><%= mrw.defaultWidth %></mrw:Ancho>
|
||||||
|
<mrw:Peso><%= mrw.defaultWeight %></mrw:Peso>
|
||||||
|
</mrw:BultoRequest>
|
||||||
|
</mrw:Bultos>
|
||||||
</mrw:DatosServicio>
|
</mrw:DatosServicio>
|
||||||
</mrw:request>
|
</mrw:request>
|
||||||
</mrw:TransmEnvio>
|
</mrw:TransmEnvio>
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
const axios = require('axios');
|
|
||||||
const {DOMParser} = require('xmldom');
|
|
||||||
const fs = require('fs');
|
|
||||||
const ejs = require('ejs');
|
|
||||||
const UserError = require('vn-loopback/util/user-error');
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
|
@ -23,29 +19,27 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.createShipment = async(expeditionFk, options) => {
|
Self.createShipment = async expeditionFk => {
|
||||||
const myOptions = {};
|
|
||||||
let tx;
|
|
||||||
|
|
||||||
if (typeof options == 'object')
|
|
||||||
Object.assign(myOptions, options);
|
|
||||||
|
|
||||||
if (!myOptions.transaction) {
|
|
||||||
tx = await Self.beginTransaction({});
|
|
||||||
myOptions.transaction = tx;
|
|
||||||
}
|
|
||||||
|
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const mrw = await models.MrwConfig.findOne(null, myOptions);
|
const mrw = await Self.getConfig();
|
||||||
|
const clientType = await models.MrwConfig.getClientType(expeditionFk);
|
||||||
|
|
||||||
if (!mrw)
|
const today = Date.vnNew();
|
||||||
throw new UserError(`Some mrwConfig parameters are not set`);
|
const [hours, minutes] = mrw?.expeditionDeadLine ? mrw.expeditionDeadLine.split(':').map(Number) : [0, 0];
|
||||||
|
|
||||||
|
const deadLine = Date.vnNew();
|
||||||
|
deadLine.setHours(hours, minutes, 0);
|
||||||
|
|
||||||
|
if (today > deadLine && (!mrw.notified || mrw.notified.setHours(0, 0, 0, 0) !== today.setHours(0, 0, 0, 0))) {
|
||||||
|
await models.NotificationQueue.create({notificationFk: 'mrw-deadline'});
|
||||||
|
await mrw.updateAttributes({notified: Date.vnNow()});
|
||||||
|
}
|
||||||
|
|
||||||
const query =
|
const query =
|
||||||
`SELECT
|
`SELECT
|
||||||
CASE co.code
|
CASE co.code
|
||||||
WHEN 'ES' THEN a.postalCode
|
WHEN 'ES' THEN a.postalCode
|
||||||
WHEN 'PT' THEN LEFT(a.postalCode, 4)
|
WHEN 'PT' THEN LEFT(a.postalCode, mc.portugalPostCodeTrim)
|
||||||
WHEN 'AD' THEN REPLACE(a.postalCode, 'AD', '00')
|
WHEN 'AD' THEN REPLACE(a.postalCode, 'AD', '00')
|
||||||
END postalCode,
|
END postalCode,
|
||||||
a.city,
|
a.city,
|
||||||
|
@ -53,62 +47,45 @@ module.exports = Self => {
|
||||||
co.code countryCode,
|
co.code countryCode,
|
||||||
c.fi,
|
c.fi,
|
||||||
c.name clientName,
|
c.name clientName,
|
||||||
c.phone,
|
IFNULL(a.mobile, c.mobile) mobile,
|
||||||
DATE_FORMAT(t.shipped, '%d/%m/%Y') created,
|
DATE_FORMAT(t.shipped, '%d/%m/%Y') created,
|
||||||
t.shipped,
|
t.shipped,
|
||||||
e.id expeditionId,
|
CONCAT( e.ticketFk, LPAD(e.counter, mc.counterWidth, '0')) reference,
|
||||||
LPAD(IF(mw.params IS NULL, ms.serviceType, mw.serviceType), 4 ,'0') serviceType,
|
LPAD(IF(mw.serviceType IS NULL, ms.serviceType, mw.serviceType), mc.serviceTypeWidth, '0') serviceType,
|
||||||
IF(mw.weekdays, 'S', 'N') weekDays
|
IF(mw.weekdays, 'S', 'N') weekDays,
|
||||||
|
ta.description deliveryObservation
|
||||||
FROM expedition e
|
FROM expedition e
|
||||||
JOIN ticket t ON e.ticketFk = t.id
|
JOIN ticket t ON e.ticketFk = t.id
|
||||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||||
JOIN mrwService ms ON ms.agencyModeCodeFk = am.code
|
JOIN mrwService ms ON ms.agencyModeCodeFk = am.code
|
||||||
LEFT JOIN mrwServiceWeekday mw ON mw.weekdays = DATE_FORMAT(t.shipped, '%a')
|
LEFT JOIN mrwServiceWeekday mw ON mw.agencyModeCodeFk = am.code
|
||||||
|
AND mw.weekDays & (1 << WEEKDAY(t.landed))
|
||||||
JOIN client c ON t.clientFk = c.id
|
JOIN client c ON t.clientFk = c.id
|
||||||
JOIN address a ON t.addressFk = a.id
|
JOIN address a ON t.addressFk = a.id
|
||||||
|
LEFT JOIN ticketObservation ta ON ta.ticketFk = t.id
|
||||||
|
AND ta.observationTypeFk IN (SELECT id FROM observationType ot WHERE ot.code = 'agency')
|
||||||
JOIN province p ON a.provinceFk = p.id
|
JOIN province p ON a.provinceFk = p.id
|
||||||
JOIN country co ON co.id = p.countryFk
|
JOIN country co ON co.id = p.countryFk
|
||||||
|
JOIN mrwConfig mc
|
||||||
WHERE e.id = ?
|
WHERE e.id = ?
|
||||||
LIMIT 1`;
|
LIMIT 1`;
|
||||||
|
|
||||||
const [expeditionData] = await Self.rawSql(query, [expeditionFk], myOptions);
|
const [expeditionData] = await Self.rawSql(query, [expeditionFk]);
|
||||||
|
|
||||||
if (!expeditionData)
|
if (expeditionData?.shipped.setHours(0, 0, 0, 0) < today.setHours(0, 0, 0, 0))
|
||||||
throw new UserError(`This expedition is not a MRW shipment`);
|
|
||||||
|
|
||||||
const today = Date.vnNew();
|
|
||||||
today.setHours(0, 0, 0, 0);
|
|
||||||
if (expeditionData?.shipped.setHours(0, 0, 0, 0) < today)
|
|
||||||
throw new UserError(`This ticket has a shipped date earlier than today`);
|
throw new UserError(`This ticket has a shipped date earlier than today`);
|
||||||
|
|
||||||
const shipmentResponse = await sendXmlDoc('createShipment', {mrw, expeditionData}, 'application/soap+xml');
|
const shipmentResponse = await Self.sendXmlDoc(
|
||||||
const shipmentId = getTextByTag(shipmentResponse, 'NumeroEnvio');
|
__dirname + `/createShipment.ejs`,
|
||||||
|
{mrw, expeditionData, clientType},
|
||||||
|
'application/soap+xml'
|
||||||
|
);
|
||||||
|
const shipmentId = Self.getTextByTag(shipmentResponse, 'NumeroEnvio');
|
||||||
|
|
||||||
if (!shipmentId)
|
if (!shipmentId) throw new UserError(Self.getTextByTag(shipmentResponse, 'Mensaje'));
|
||||||
throw new UserError(getTextByTag(shipmentResponse, 'Mensaje'));
|
|
||||||
|
|
||||||
const getLabelResponse = await sendXmlDoc('getLabel', {mrw, shipmentId}, 'text/xml');
|
const file = await models.MrwConfig.getLabel(shipmentId, clientType);
|
||||||
const file = getTextByTag(getLabelResponse, 'EtiquetaFile');
|
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
|
||||||
|
|
||||||
return {shipmentId, file};
|
return {shipmentId, file};
|
||||||
};
|
};
|
||||||
|
|
||||||
function getTextByTag(xmlDoc, tag) {
|
|
||||||
return xmlDoc?.getElementsByTagName(tag)[0]?.textContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function sendXmlDoc(xmlDock, params, contentType) {
|
|
||||||
const parser = new DOMParser();
|
|
||||||
|
|
||||||
const xmlTemplate = fs.readFileSync(__dirname + `/${xmlDock}.ejs`, 'utf-8');
|
|
||||||
const renderedTemplate = ejs.render(xmlTemplate, params);
|
|
||||||
const data = await axios.post(params.mrw.url, renderedTemplate, {
|
|
||||||
headers: {
|
|
||||||
'Content-Type': `${contentType}; charset=utf-8`
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return parser.parseFromString(data.data, 'text/xml');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<soapenv:Header>
|
<soapenv:Header>
|
||||||
<mrw:AuthInfo>
|
<mrw:AuthInfo>
|
||||||
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
|
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
|
||||||
<mrw:CodigoAbonado><%= mrw.subscriberCode %></mrw:CodigoAbonado>
|
<mrw:CodigoAbonado><%= clientType %></mrw:CodigoAbonado>
|
||||||
<mrw:CodigoDepartamento/>
|
<mrw:CodigoDepartamento/>
|
||||||
<mrw:UserName><%= mrw.user %></mrw:UserName>
|
<mrw:UserName><%= mrw.user %></mrw:UserName>
|
||||||
<mrw:Password><%= mrw.password %></mrw:Password>
|
<mrw:Password><%= mrw.password %></mrw:Password>
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('getLabel', {
|
||||||
|
description: 'Return a base64Binary label from de MRW WebService',
|
||||||
|
accessType: 'READ',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'shipmentId',
|
||||||
|
type: 'string',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'clientType',
|
||||||
|
type: 'string',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
returns: {
|
||||||
|
type: 'string',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/getLabel`,
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.getLabel = async(shipmentId, clientType) => {
|
||||||
|
const mrw = await Self.getConfig();
|
||||||
|
|
||||||
|
const getLabelResponse = await Self.sendXmlDoc(
|
||||||
|
__dirname + `/getLabel.ejs`,
|
||||||
|
{mrw, shipmentId, clientType},
|
||||||
|
'text/xml'
|
||||||
|
);
|
||||||
|
|
||||||
|
return Self.getTextByTag(getLabelResponse, 'EtiquetaFile');
|
||||||
|
};
|
||||||
|
};
|
|
@ -2,6 +2,7 @@ const models = require('vn-loopback/server/server').models;
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const filter = {notificationFk: 'mrw-deadline'};
|
||||||
const mockBase64Binary = 'base64BinaryString';
|
const mockBase64Binary = 'base64BinaryString';
|
||||||
const ticket1 = {
|
const ticket1 = {
|
||||||
'id': '44',
|
'id': '44',
|
||||||
|
@ -11,9 +12,8 @@ const ticket1 = {
|
||||||
'addressFk': 1,
|
'addressFk': 1,
|
||||||
'agencyModeFk': 999
|
'agencyModeFk': 999
|
||||||
};
|
};
|
||||||
|
let expedition;
|
||||||
const expedition1 = {
|
const expedition1 = {
|
||||||
'id': 17,
|
|
||||||
'agencyModeFk': 999,
|
'agencyModeFk': 999,
|
||||||
'ticketFk': 44,
|
'ticketFk': 44,
|
||||||
'freightItemFk': 71,
|
'freightItemFk': 71,
|
||||||
|
@ -28,25 +28,49 @@ const expedition1 = {
|
||||||
'editorFk': 100
|
'editorFk': 100
|
||||||
};
|
};
|
||||||
|
|
||||||
let tx;
|
|
||||||
let options;
|
|
||||||
|
|
||||||
describe('MRWConfig createShipment()', () => {
|
describe('MRWConfig createShipment()', () => {
|
||||||
beforeEach(async() => {
|
beforeAll(async() => {
|
||||||
options = tx = undefined;
|
|
||||||
tx = await models.MrwConfig.beginTransaction({});
|
|
||||||
options = {transaction: tx};
|
|
||||||
|
|
||||||
await models.Agency.create(
|
await models.Agency.create(
|
||||||
{'id': 999, 'name': 'mrw'},
|
{'id': 999, 'name': 'mrw'}
|
||||||
options
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await models.AgencyMode.create(
|
await models.AgencyMode.create(
|
||||||
{'id': 999, 'name': 'mrw', 'agencyFk': 999, 'code': 'mrw'},
|
{'id': 999, 'name': 'mrw', 'agencyFk': 999, 'code': 'mrw'}
|
||||||
options
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await models.MrwService.create(
|
||||||
|
{'agencyModeCodeFk': 'mrw', 'clientType': '000001', 'serviceType': 105, 'kg': 10}
|
||||||
|
);
|
||||||
|
|
||||||
|
await createMrwConfig();
|
||||||
|
|
||||||
|
await models.Ticket.create(ticket1);
|
||||||
|
expedition = await models.Expedition.create(expedition1);
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async() => {
|
||||||
|
await cleanFixtures();
|
||||||
|
await models.Ticket.destroyAll(ticket1);
|
||||||
|
await models.Expedition.destroyAll(ticket1);
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async() => {
|
||||||
|
const mockPostResponses = [
|
||||||
|
{data: fs.readFileSync(__dirname + '/mockGetLabel.xml', 'utf-8')},
|
||||||
|
{data: fs.readFileSync(__dirname + '/mockCreateShipment.xml', 'utf-8')}
|
||||||
|
];
|
||||||
|
|
||||||
|
spyOn(axios, 'post').and.callFake(() => Promise.resolve(mockPostResponses.pop()));
|
||||||
|
await cleanFixtures();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function cleanFixtures() {
|
||||||
|
await models.NotificationQueue.destroyAll(filter);
|
||||||
|
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: null, notified: null});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function createMrwConfig() {
|
||||||
await models.MrwConfig.create(
|
await models.MrwConfig.create(
|
||||||
{
|
{
|
||||||
'id': 1,
|
'id': 1,
|
||||||
|
@ -54,68 +78,82 @@ describe('MRWConfig createShipment()', () => {
|
||||||
'user': 'user',
|
'user': 'user',
|
||||||
'password': 'password',
|
'password': 'password',
|
||||||
'franchiseCode': 'franchiseCode',
|
'franchiseCode': 'franchiseCode',
|
||||||
'subscriberCode': 'subscriberCode'
|
'subscriberCode': 'subscriberCode',
|
||||||
}, options
|
'clientTypeWidth': 6
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
await models.Application.rawSql(
|
async function getLastNotification() {
|
||||||
`INSERT INTO vn.mrwService
|
return models.NotificationQueue.findOne({
|
||||||
SET agencyModeCodeFk = 'mrw',
|
order: 'id DESC',
|
||||||
clientType = 1,
|
where: filter
|
||||||
serviceType = 1,
|
});
|
||||||
kg = 1`, null, options
|
}
|
||||||
);
|
|
||||||
await models.Ticket.create(ticket1, options);
|
|
||||||
await models.Expedition.create(expedition1, options);
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(async() => {
|
|
||||||
await tx.rollback();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create a shipment and return a base64Binary label', async() => {
|
it('should create a shipment and return a base64Binary label', async() => {
|
||||||
const mockPostResponses = [
|
const {file} = await models.MrwConfig.createShipment(expedition.id);
|
||||||
{data: fs.readFileSync(__dirname + '/mockGetLabel.xml', 'utf-8')},
|
|
||||||
{data: fs.readFileSync(__dirname + '/mockCreateShipment.xml', 'utf-8')}
|
|
||||||
];
|
|
||||||
|
|
||||||
spyOn(axios, 'post').and.callFake(() => Promise.resolve(mockPostResponses.pop()));
|
|
||||||
|
|
||||||
const {file} = await models.MrwConfig.createShipment(expedition1.id, options);
|
|
||||||
|
|
||||||
expect(file).toEqual(mockBase64Binary);
|
expect(file).toEqual(mockBase64Binary);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fail if mrwConfig has no data', async() => {
|
it('should fail if mrwConfig has no data', async() => {
|
||||||
let error;
|
let error;
|
||||||
await models.MrwConfig.createShipment(expedition1.id).catch(e => {
|
await models.MrwConfig.destroyAll();
|
||||||
|
await models.MrwConfig.createShipment(expedition.id).catch(e => {
|
||||||
error = e;
|
error = e;
|
||||||
}).finally(async() => {
|
}).finally(async() => {
|
||||||
expect(error.message).toEqual(`Some mrwConfig parameters are not set`);
|
expect(error.message).toEqual(`MRW service is not configured`);
|
||||||
});
|
});
|
||||||
|
await createMrwConfig();
|
||||||
|
|
||||||
expect(error).toBeDefined();
|
expect(error).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fail if expeditionFk is not a MrwExpedition', async() => {
|
it('should fail if expeditionFk is not a MrwExpedition', async() => {
|
||||||
let error;
|
let error;
|
||||||
await models.MrwConfig.createShipment(undefined, options).catch(e => {
|
await models.MrwConfig.createShipment(15).catch(e => {
|
||||||
error = e;
|
error = e;
|
||||||
}).finally(async() => {
|
}).finally(async() => {
|
||||||
expect(error.message).toEqual(`This expedition is not a MRW shipment`);
|
expect(error.message).toEqual(`ClientType not available`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it(' should fail if the creation date of this ticket is before the current date it', async() => {
|
it('should fail if the creation date of this ticket is before the current date', async() => {
|
||||||
let error;
|
let error;
|
||||||
const yesterday = Date.vnNew();
|
const yesterday = Date.vnNew();
|
||||||
|
|
||||||
yesterday.setDate(yesterday.getDate() - 1);
|
yesterday.setDate(yesterday.getDate() - 1);
|
||||||
await models.Ticket.updateAll({id: ticket1.id}, {shipped: yesterday}, options);
|
|
||||||
await models.MrwConfig.createShipment(expedition1.id, options).catch(e => {
|
await models.Ticket.updateAll({id: ticket1.id}, {shipped: yesterday});
|
||||||
|
await models.MrwConfig.createShipment(expedition.id).catch(e => {
|
||||||
error = e;
|
error = e;
|
||||||
}).finally(async() => {
|
}).finally(async() => {
|
||||||
expect(error.message).toEqual(`This ticket has a shipped date earlier than today`);
|
expect(error.message).toEqual(`This ticket has a shipped date earlier than today`);
|
||||||
});
|
});
|
||||||
|
await models.Ticket.updateAll({id: ticket1.id}, {shipped: Date.vnNew()});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should send mail if you are past the dead line and is not notified today', async() => {
|
||||||
|
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: '10:00:00', notified: null});
|
||||||
|
await models.MrwConfig.createShipment(expedition.id);
|
||||||
|
const notification = await getLastNotification();
|
||||||
|
|
||||||
|
expect(notification.notificationFk).toEqual(filter.notificationFk);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should send mail if you are past the dead line and it is notified from another day', async() => {
|
||||||
|
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: '10:00:00', notified: new Date()});
|
||||||
|
await models.MrwConfig.createShipment(expedition.id);
|
||||||
|
const notification = await getLastNotification();
|
||||||
|
|
||||||
|
expect(notification.notificationFk).toEqual(filter.notificationFk);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not send mail if you are past the dead line and it is notified', async() => {
|
||||||
|
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: '10:00:00', notified: Date.vnNew()});
|
||||||
|
await models.MrwConfig.createShipment(expedition.id);
|
||||||
|
const notification = await getLastNotification();
|
||||||
|
|
||||||
|
expect(notification).toEqual(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,13 +11,6 @@ module.exports = Self => {
|
||||||
arg: 'filter',
|
arg: 'filter',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string',
|
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string',
|
||||||
http: {source: 'query'}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
arg: 'search',
|
|
||||||
type: 'string',
|
|
||||||
description: 'Value to filter',
|
|
||||||
http: {source: 'query'}
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -29,13 +22,11 @@ module.exports = Self => {
|
||||||
verb: 'GET',
|
verb: 'GET',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Self.filter = async(ctx, filter, options) => {
|
Self.filter = async(filter = {}, options) => {
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
filter = ctx?.filter ?? {};
|
|
||||||
|
|
||||||
const conn = Self.dataSource.connector;
|
const conn = Self.dataSource.connector;
|
||||||
const where = buildFilter(filter?.where, (param, value) => {
|
const where = buildFilter(filter?.where, (param, value) => {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
@ -50,31 +41,33 @@ module.exports = Self => {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}) ?? {};
|
}) ?? {};
|
||||||
delete ctx.filter.where;
|
delete filter.where;
|
||||||
|
|
||||||
const stmts = [];
|
const stmts = [];
|
||||||
let stmt;
|
let stmt;
|
||||||
stmt = new ParameterizedSQL(`
|
stmt = new ParameterizedSQL(`
|
||||||
SELECT
|
SELECT
|
||||||
pc.townFk,
|
pc.townFk,
|
||||||
t.provinceFk,
|
t.provinceFk,
|
||||||
p.countryFk,
|
p.countryFk,
|
||||||
pc.code,
|
pc.code,
|
||||||
t.name as town,
|
t.name as town,
|
||||||
p.name as province,
|
p.name as province,
|
||||||
c.name country
|
c.name country
|
||||||
FROM
|
FROM
|
||||||
postCode pc
|
postCode pc
|
||||||
JOIN town t on t.id = pc.townFk
|
JOIN town t on t.id = pc.townFk
|
||||||
JOIN province p on p.id = t.provinceFk
|
JOIN province p on p.id = t.provinceFk
|
||||||
JOIN country c on c.id = p.countryFk
|
JOIN country c on c.id = p.countryFk
|
||||||
`);
|
`);
|
||||||
|
|
||||||
stmt.merge(conn.makeSuffix({where, ...ctx}));
|
stmt.merge(conn.makeSuffix({where}));
|
||||||
|
stmt.merge(conn.makeLimit(filter));
|
||||||
const itemsIndex = stmts.push(stmt) - 1;
|
const itemsIndex = stmts.push(stmt) - 1;
|
||||||
|
|
||||||
const sql = ParameterizedSQL.join(stmts, ';');
|
const sql = ParameterizedSQL.join(stmts, ';');
|
||||||
const result = await conn.executeStmt(sql, myOptions);
|
const result = await conn.executeStmt(sql, myOptions);
|
||||||
|
|
||||||
return itemsIndex === 0 ? result : result[itemsIndex];
|
return itemsIndex === 0 ? result : result[itemsIndex];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,12 +6,9 @@ describe('Postcode filter()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ctx = {
|
const results = await models.Postcode.filter({
|
||||||
filter: {
|
|
||||||
},
|
|
||||||
limit: 1
|
limit: 1
|
||||||
};
|
}, options);
|
||||||
const results = await models.Postcode.filter(ctx, options);
|
|
||||||
|
|
||||||
expect(results.length).toEqual(1);
|
expect(results.length).toEqual(1);
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -26,16 +23,13 @@ describe('Postcode filter()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ctx = {
|
const results = await models.Postcode.filter({
|
||||||
filter: {
|
where: {
|
||||||
where: {
|
search: 46,
|
||||||
search: 46,
|
}
|
||||||
}
|
}, options);
|
||||||
},
|
|
||||||
};
|
|
||||||
const results = await models.Postcode.filter(ctx, options);
|
|
||||||
|
|
||||||
expect(results.length).toEqual(4);
|
expect(results.length).toEqual(5);
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -48,14 +42,9 @@ describe('Postcode filter()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ctx = {
|
const results = await models.Postcode.filter({where: {
|
||||||
filter: {
|
search: 'Alz',
|
||||||
where: {
|
}}, options);
|
||||||
search: 'Alz',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const results = await models.Postcode.filter(ctx, options);
|
|
||||||
|
|
||||||
expect(results.length).toEqual(1);
|
expect(results.length).toEqual(1);
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -70,16 +59,11 @@ describe('Postcode filter()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ctx = {
|
const results = await models.Postcode.filter({where: {
|
||||||
filter: {
|
search: 'one',
|
||||||
where: {
|
}}, options);
|
||||||
search: 'one',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const results = await models.Postcode.filter(ctx, options);
|
|
||||||
|
|
||||||
expect(results.length).toEqual(4);
|
expect(results.length).toEqual(5);
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -92,14 +76,11 @@ describe('Postcode filter()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ctx = {
|
const results = await models.Postcode.filter({
|
||||||
filter: {
|
where: {
|
||||||
where: {
|
search: 'Ec',
|
||||||
search: 'Ec',
|
}
|
||||||
}
|
}, options);
|
||||||
},
|
|
||||||
};
|
|
||||||
const results = await models.Postcode.filter(ctx, options);
|
|
||||||
|
|
||||||
expect(results.length).toEqual(1);
|
expect(results.length).toEqual(1);
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
const axios = require('axios');
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
const moment = require('moment');
|
||||||
|
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('sendOrders', {
|
||||||
|
description: 'Sends a set of orders',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'tickets',
|
||||||
|
type: ['number'],
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
returns: {
|
||||||
|
type: 'string',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/sendOrders`,
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Self.sendOrders = async tickets => {
|
||||||
|
const config = await Self.app.models.QuadmindsApiConfig.findOne();
|
||||||
|
if (!config) throw new UserError('Config params not set');
|
||||||
|
|
||||||
|
if (tickets.length > config.maxObjects)
|
||||||
|
throw new UserError(`Quadminds does not support more than ${config.maxObjects} tickets`);
|
||||||
|
|
||||||
|
let poisData = [];
|
||||||
|
let isOk;
|
||||||
|
for (let offset = 0; !isOk; offset = offset + config.limit) {
|
||||||
|
const pois = await axios.get(`${config.url}pois/search?limit=${config.limit}&offset=${offset}`, {
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'X-Saas-Apikey': config.key
|
||||||
|
}
|
||||||
|
});
|
||||||
|
pois.data.data.length ? poisData.push(...pois.data.data) : isOk = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const poiMap = new Map(poisData.map(poi => [poi.code, poi._id]));
|
||||||
|
|
||||||
|
let orders = await Self.rawSql(`
|
||||||
|
SELECT a.id poiCode,
|
||||||
|
t.id code,
|
||||||
|
t.shipped date,
|
||||||
|
'PEDIDO' operation,
|
||||||
|
t.totalWithVat totalAmount,
|
||||||
|
t.totalWithoutVat totalAmountWithoutTaxes,
|
||||||
|
SUM(sv.volume) volume
|
||||||
|
FROM ticket t
|
||||||
|
JOIN address a ON a.id = t.addressFk
|
||||||
|
JOIN saleVolume sv ON sv.ticketFk = t.id
|
||||||
|
WHERE t.id IN (?)
|
||||||
|
GROUP BY t.id
|
||||||
|
`, [tickets]);
|
||||||
|
|
||||||
|
// Transformo code en string ya que lo obtenermos como integer
|
||||||
|
orders = orders.map(order => {
|
||||||
|
return {
|
||||||
|
...order,
|
||||||
|
poiId: poiMap.get(order.poiCode.toString()) || undefined,
|
||||||
|
code: order.code.toString(),
|
||||||
|
date: moment(order.date).format('YYYY-MM-DD'),
|
||||||
|
totalAmount: order.totalAmount || undefined,
|
||||||
|
totalAmountWithoutTaxes: order.totalAmountWithoutTaxes || undefined,
|
||||||
|
timeWindow: [{
|
||||||
|
from: config.orderTimeFrom,
|
||||||
|
to: config.orderTimeTo
|
||||||
|
}],
|
||||||
|
orderMeasures: [{
|
||||||
|
constraintId: 3, // Volumen
|
||||||
|
value: order.volume
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
await axios.post(`${config.url}orders`, orders, {
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-Saas-Apikey': config.key
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,87 @@
|
||||||
|
const axios = require('axios');
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('sendPois', {
|
||||||
|
description: 'Sends a set of pois',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'tickets',
|
||||||
|
type: ['number'],
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
returns: {
|
||||||
|
type: 'string',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/sendPois`,
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Self.sendPois = async tickets => {
|
||||||
|
const config = await Self.app.models.QuadmindsApiConfig.findOne();
|
||||||
|
if (!config) throw new UserError('Config params not set');
|
||||||
|
|
||||||
|
if (tickets.length > config.maxObjects)
|
||||||
|
throw new UserError(`Quadminds does not support more than ${config.maxObjects} tickets`);
|
||||||
|
|
||||||
|
let pois = await Self.rawSql(`
|
||||||
|
WITH deliveryNotes AS (
|
||||||
|
SELECT t.id, t.routeFk, tn.description
|
||||||
|
FROM ticket t
|
||||||
|
JOIN ticketObservation tn ON tn.ticketFk = t.id
|
||||||
|
JOIN observationType ot ON ot.id = tn.observationTypeFk
|
||||||
|
WHERE ot.code = 'delivery'
|
||||||
|
)
|
||||||
|
SELECT a.id code,
|
||||||
|
c.socialName name,
|
||||||
|
IF(ABS(a.latitude - ROUND(a.latitude)) < 0.000001, NULL, a.latitude) latitude,
|
||||||
|
IF(ABS(a.longitude - ROUND(a.longitude)) < 0.000001, NULL, a.longitude) longitude,
|
||||||
|
a.street,
|
||||||
|
a.city locality,
|
||||||
|
p.name state,
|
||||||
|
co.name country,
|
||||||
|
CONCAT_WS(', ', IFNULL(a.street, ''), IFNULL(a.city, ''), IFNULL(p.name, '')) longAddress,
|
||||||
|
CONCAT(IFNULL(a.mobile, c.mobile)) phoneNumber,
|
||||||
|
dn.description poiDeliveryComments,
|
||||||
|
c.email email
|
||||||
|
FROM ticket t
|
||||||
|
JOIN address a ON a.id = t.addressFk
|
||||||
|
JOIN province p ON p.id = a.provinceFk
|
||||||
|
JOIN country co ON co.id = p.countryFk
|
||||||
|
JOIN client c ON c.id = t.clientFk
|
||||||
|
LEFT JOIN deliveryNotes dn ON dn.id = t.id
|
||||||
|
WHERE t.id IN (?)
|
||||||
|
GROUP BY t.id
|
||||||
|
`, [tickets]);
|
||||||
|
|
||||||
|
// Transformo code en string ya que lo obtenermos como integer
|
||||||
|
pois = pois.map(poi => {
|
||||||
|
return {
|
||||||
|
...poi,
|
||||||
|
code: poi.code.toString(),
|
||||||
|
latitude: poi.latitude || undefined,
|
||||||
|
longitude: poi.longitude || undefined,
|
||||||
|
address: {
|
||||||
|
street: poi.street || undefined,
|
||||||
|
locality: poi.locality || undefined,
|
||||||
|
state: poi.state || undefined,
|
||||||
|
country: poi.country || undefined
|
||||||
|
},
|
||||||
|
poiDeliveryComments: poi.poiDeliveryComments || undefined,
|
||||||
|
phoneNumber: poi.phoneNumber || undefined,
|
||||||
|
email: poi.email || undefined
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
await axios.post(`${config.url}pois`, pois, {
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-Saas-Apikey': config.key
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
|
@ -1,22 +1,7 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
const LoopBackContext = require('loopback-context');
|
|
||||||
|
|
||||||
describe('getStarredModules()', () => {
|
describe('getStarredModules()', () => {
|
||||||
const activeCtx = {
|
const ctx = beforeAll.getCtx();
|
||||||
accessToken: {userId: 9},
|
|
||||||
http: {
|
|
||||||
req: {
|
|
||||||
headers: {origin: 'http://localhost'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const ctx = {req: activeCtx};
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
|
||||||
active: activeCtx
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should return the starred modules for a given user`, async() => {
|
it(`should return the starred modules for a given user`, async() => {
|
||||||
const newStarred = await models.StarredModule.create({workerFk: 9, moduleFk: 'customer', position: 1});
|
const newStarred = await models.StarredModule.create({workerFk: 9, moduleFk: 'customer', position: 1});
|
||||||
|
|
|
@ -1,24 +1,8 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
const LoopBackContext = require('loopback-context');
|
|
||||||
|
|
||||||
describe('setPosition()', () => {
|
describe('setPosition()', () => {
|
||||||
const activeCtx = {
|
const ctx = beforeAll.getCtx();
|
||||||
accessToken: {userId: 9},
|
beforeAll.mockLoopBackContext();
|
||||||
http: {
|
|
||||||
req: {
|
|
||||||
headers: {origin: 'http://localhost'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const ctx = {
|
|
||||||
req: activeCtx
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
|
||||||
active: activeCtx
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should increase the orders module position by replacing it with clients and vice versa', async() => {
|
it('should increase the orders module position by replacing it with clients and vice versa', async() => {
|
||||||
const tx = await models.StarredModule.beginTransaction({});
|
const tx = await models.StarredModule.beginTransaction({});
|
||||||
|
|
|
@ -1,24 +1,7 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
const LoopBackContext = require('loopback-context');
|
|
||||||
|
|
||||||
describe('toggleStarredModule()', () => {
|
describe('toggleStarredModule()', () => {
|
||||||
const activeCtx = {
|
const ctx = beforeAll.getCtx();
|
||||||
accessToken: {userId: 9},
|
|
||||||
http: {
|
|
||||||
req: {
|
|
||||||
headers: {origin: 'http://localhost'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const ctx = {
|
|
||||||
req: activeCtx
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
|
||||||
active: activeCtx
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create a new starred module and then remove it by calling the method again with same args', async() => {
|
it('should create a new starred module and then remove it by calling the method again with same args', async() => {
|
||||||
const starredModule = await models.StarredModule.toggleStarredModule(ctx, 'order');
|
const starredModule = await models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||||
|
@ -26,7 +9,7 @@ describe('toggleStarredModule()', () => {
|
||||||
|
|
||||||
expect(starredModules.length).toEqual(1);
|
expect(starredModules.length).toEqual(1);
|
||||||
expect(starredModule.moduleFk).toEqual('order');
|
expect(starredModule.moduleFk).toEqual('order');
|
||||||
expect(starredModule.workerFk).toEqual(activeCtx.accessToken.userId);
|
expect(starredModule.workerFk).toEqual(ctx.req.accessToken.userId);
|
||||||
expect(starredModule.position).toEqual(starredModules.length);
|
expect(starredModule.position).toEqual(starredModules.length);
|
||||||
|
|
||||||
await models.StarredModule.toggleStarredModule(ctx, 'order');
|
await models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||||
|
|
|
@ -22,7 +22,7 @@ module.exports = Self => {
|
||||||
const url = await Self.app.models.Url.findOne({
|
const url = await Self.app.models.Url.findOne({
|
||||||
where: {
|
where: {
|
||||||
appName,
|
appName,
|
||||||
environment: process.env.NODE_ENV || 'development'
|
environment: process.env.NODE_ENV || 'dev'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return url?.url;
|
return url?.url;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
describe('userConfig getUserConfig()', () => {
|
describe('userConfig getUserConfig()', () => {
|
||||||
|
const ctx = beforeAll.getCtx();
|
||||||
it(`should return the configuration data of a given user`, async() => {
|
it(`should return the configuration data of a given user`, async() => {
|
||||||
const tx = await models.Item.beginTransaction({});
|
const tx = await models.Item.beginTransaction({});
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ctx = {req: {accessToken: {userId: 9}}};
|
|
||||||
const result = await models.UserConfig.getUserConfig(ctx, options);
|
const result = await models.UserConfig.getUserConfig(ctx, options);
|
||||||
|
|
||||||
expect(result.warehouseFk).toEqual(1);
|
expect(result.warehouseFk).toEqual(1);
|
||||||
|
|
|
@ -20,7 +20,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.renderer = async (expeditionFk) => {
|
Self.renderer = async expeditionFk => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
|
|
||||||
const viaexpressConfig = await models.ViaexpressConfig.findOne({
|
const viaexpressConfig = await models.ViaexpressConfig.findOne({
|
||||||
|
@ -109,7 +109,7 @@ module.exports = Self => {
|
||||||
const ticket = expedition.ticket();
|
const ticket = expedition.ticket();
|
||||||
const sender = ticket.company().client();
|
const sender = ticket.company().client();
|
||||||
const shipped = ticket.shipped.toISOString();
|
const shipped = ticket.shipped.toISOString();
|
||||||
const isInterdia = (ticket.agencyModeFk === viaexpressConfig.agencyModeFk)
|
const isInterdia = (ticket.agencyModeFk === viaexpressConfig.agencyModeFk);
|
||||||
const data = {
|
const data = {
|
||||||
viaexpressConfig,
|
viaexpressConfig,
|
||||||
sender,
|
sender,
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('killSession', {
|
||||||
|
description: 'Kill session',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'userId',
|
||||||
|
type: 'integer',
|
||||||
|
description: 'The user id',
|
||||||
|
required: true,
|
||||||
|
}, {
|
||||||
|
arg: 'created',
|
||||||
|
type: 'date',
|
||||||
|
description: 'The created time',
|
||||||
|
required: true,
|
||||||
|
}],
|
||||||
|
accessType: 'WRITE',
|
||||||
|
http: {
|
||||||
|
path: `/killSession`,
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.killSession = async function(ctx, userId, created) {
|
||||||
|
await Self.app.models.VnUser.userSecurity(ctx, ctx.req.accessToken.userId);
|
||||||
|
const tokens = await Self.app.models.AccessToken.find({where: {userId, created}});
|
||||||
|
if (!tokens?.length) return;
|
||||||
|
for (const token of tokens)
|
||||||
|
await Self.app.models.AccessToken.deleteById(token.id);
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,72 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('acls', {
|
||||||
|
description: 'Get all of the current user acls',
|
||||||
|
returns: {
|
||||||
|
type: 'Object',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: '/acls',
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const staticAcls = new Map();
|
||||||
|
const app = require('vn-loopback/server/server');
|
||||||
|
app.on('started', function() {
|
||||||
|
for (const model of app.models()) {
|
||||||
|
for (const acl of model.settings.acls) {
|
||||||
|
if (acl.principalType == 'ROLE' && acl.permission == 'ALLOW') {
|
||||||
|
const staticAcl = {
|
||||||
|
model: model.name,
|
||||||
|
property: '*',
|
||||||
|
accessType: acl.accessType,
|
||||||
|
permission: acl.permission,
|
||||||
|
principalType: acl.principalType,
|
||||||
|
principalId: acl.principalId,
|
||||||
|
};
|
||||||
|
if (staticAcls.has(acl.principalId))
|
||||||
|
staticAcls.get(acl.principalId).push(staticAcl);
|
||||||
|
else
|
||||||
|
staticAcls.set(acl.principalId, [staticAcl]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.acls = async function(ctx) {
|
||||||
|
const models = Self.app.models;
|
||||||
|
const acls = [];
|
||||||
|
const userId = ctx.req.accessToken.userId;
|
||||||
|
if (userId) {
|
||||||
|
const roleMapping = await models.RoleMapping.find({
|
||||||
|
where: {
|
||||||
|
principalId: userId
|
||||||
|
},
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'role',
|
||||||
|
scope: {
|
||||||
|
fields: [
|
||||||
|
'name'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
const dynamicAcls = await models.ACL.find({
|
||||||
|
where: {
|
||||||
|
principalId: {
|
||||||
|
inq: roleMapping.map(rm => rm.role().name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dynamicAcls.forEach(acl => acls.push(acl));
|
||||||
|
staticAcls.get('$authenticated').forEach(acl => acls.push(acl));
|
||||||
|
} else
|
||||||
|
staticAcls.get('$unauthenticated').forEach(acl => acls.push(acl));
|
||||||
|
|
||||||
|
staticAcls.get('$everyone').forEach(acl => acls.push(acl));
|
||||||
|
return acls;
|
||||||
|
};
|
||||||
|
};
|
|
@ -16,41 +16,51 @@ module.exports = Self => {
|
||||||
accessScopes: ['DEFAULT', 'read:multimedia']});
|
accessScopes: ['DEFAULT', 'read:multimedia']});
|
||||||
|
|
||||||
Self.renewToken = async function(ctx) {
|
Self.renewToken = async function(ctx) {
|
||||||
const {accessToken: token} = ctx.req;
|
|
||||||
|
|
||||||
// Check if current token is valid
|
|
||||||
|
|
||||||
const {renewPeriod, courtesyTime} = await models.AccessTokenConfig.findOne({
|
|
||||||
fields: ['renewPeriod', 'courtesyTime']
|
|
||||||
});
|
|
||||||
const now = Date.now();
|
|
||||||
const differenceMilliseconds = now - token.created;
|
|
||||||
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
|
||||||
const isNotExceeded = differenceSeconds < renewPeriod - courtesyTime;
|
|
||||||
if (isNotExceeded)
|
|
||||||
return token;
|
|
||||||
|
|
||||||
// Schedule to remove current token
|
|
||||||
setTimeout(async() => {
|
|
||||||
try {
|
|
||||||
const exists = await models.AccessToken.findById(token.id);
|
|
||||||
exists && await Self.logout(token.id);
|
|
||||||
} catch (err) {
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
}, courtesyTime * 1000);
|
|
||||||
|
|
||||||
// Get scopes
|
|
||||||
|
|
||||||
let createTokenOptions = {};
|
let createTokenOptions = {};
|
||||||
const {scopes} = token;
|
let token; let isNotExceeded;
|
||||||
if (scopes)
|
try {
|
||||||
createTokenOptions = {scopes: [scopes[0]]};
|
token = ctx.req.accessToken;
|
||||||
// Create new accessToken
|
|
||||||
const user = await Self.findById(token.userId);
|
|
||||||
const accessToken = await user.accessTokens.create(createTokenOptions);
|
|
||||||
|
|
||||||
return {id: accessToken.id, ttl: accessToken.ttl};
|
const {courtesyTime} = await models.AccessTokenConfig.findOne({
|
||||||
|
fields: ['courtesyTime']
|
||||||
|
});
|
||||||
|
isNotExceeded = await Self.validateToken(ctx);
|
||||||
|
if (isNotExceeded)
|
||||||
|
return token;
|
||||||
|
|
||||||
|
// Schedule to remove current token
|
||||||
|
setTimeout(async() => {
|
||||||
|
try {
|
||||||
|
await Self.logout(token.id);
|
||||||
|
} catch (error) {
|
||||||
|
// FIXME: Crash if do throw new Error(error)
|
||||||
|
}
|
||||||
|
}, courtesyTime * 1000);
|
||||||
|
|
||||||
|
// Get scopes
|
||||||
|
const {scopes} = token;
|
||||||
|
if (scopes)
|
||||||
|
createTokenOptions = {scopes: [scopes[0]]};
|
||||||
|
// Create new accessToken
|
||||||
|
const user = await Self.findById(token.userId);
|
||||||
|
const accessToken = await user.accessTokens.create(createTokenOptions);
|
||||||
|
|
||||||
|
return {id: accessToken.id, ttl: accessToken.ttl};
|
||||||
|
} catch (error) {
|
||||||
|
const body = {
|
||||||
|
error: error.message,
|
||||||
|
userId: token?.userId ?? null,
|
||||||
|
token: token?.id,
|
||||||
|
scopes: token?.scopes,
|
||||||
|
createTokenOptions,
|
||||||
|
isNotExceeded
|
||||||
|
};
|
||||||
|
await handleError(JSON.stringify(body));
|
||||||
|
throw new Error(error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async function handleError(body) {
|
||||||
|
await models.Application.rawSql('CALL util.debugAdd(?,?);', ['renewToken', body]);
|
||||||
|
}
|
||||||
|
|
|
@ -67,7 +67,9 @@ module.exports = Self => {
|
||||||
if (vnUser.twoFactor === 'email') {
|
if (vnUser.twoFactor === 'email') {
|
||||||
const $ = Self.app.models;
|
const $ = Self.app.models;
|
||||||
|
|
||||||
const code = String(Math.floor(Math.random() * 999999));
|
const min = 100000;
|
||||||
|
const max = 999999;
|
||||||
|
const code = String(Math.floor(Math.random() * (max - min + 1)) + min);
|
||||||
const maxTTL = ((60 * 1000) * 5); // 5 min
|
const maxTTL = ((60 * 1000) * 5); // 5 min
|
||||||
await $.AuthCode.upsertWithWhere({userFk: vnUser.id}, {
|
await $.AuthCode.upsertWithWhere({userFk: vnUser.id}, {
|
||||||
userFk: vnUser.id,
|
userFk: vnUser.id,
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
const id = {administrative: 5, employee: 1, productionBoss: 50};
|
||||||
|
|
||||||
|
describe('VnUser acls()', () => {
|
||||||
|
it('should get its owns acls', async() => {
|
||||||
|
expect(await hasAcl('administrative', id.administrative)).toBeTruthy();
|
||||||
|
expect(await hasAcl('productionBoss', id.productionBoss)).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not get administrative acls', async() => {
|
||||||
|
expect(await hasAcl('administrative', id.employee)).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should get the $authenticated acls', async() => {
|
||||||
|
expect(await hasAcl('$authenticated', id.employee)).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should get the $everyone acls', async() => {
|
||||||
|
expect(await hasAcl('$everyone', id.employee)).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const hasAcl = async(role, userId) => {
|
||||||
|
const ctx = {req: {accessToken: {userId}, headers: {origin: 'http://localhost'}}};
|
||||||
|
const acls = await models.VnUser.acls(ctx);
|
||||||
|
return Object.values(acls).some(acl => acl.principalId === role);
|
||||||
|
};
|
|
@ -61,4 +61,21 @@ describe('Renew Token', () => {
|
||||||
expect(error).toBeUndefined();
|
expect(error).toBeUndefined();
|
||||||
expect(response.id).toEqual(ctx.req.accessToken.id);
|
expect(response.id).toEqual(ctx.req.accessToken.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('throw error', async() => {
|
||||||
|
let error;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await models.VnUser.renewToken({req: {token: null}});
|
||||||
|
} catch (e) {
|
||||||
|
error = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(error).toBeDefined();
|
||||||
|
|
||||||
|
const query = 'SELECT * FROM util.debug WHERE variable = "renewToken"';
|
||||||
|
const debugLog = await models.Application.rawSql(query);
|
||||||
|
|
||||||
|
expect(debugLog.length).toEqual(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,6 +24,10 @@ module.exports = Self => {
|
||||||
arg: 'lang',
|
arg: 'lang',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'The user lang'
|
description: 'The user lang'
|
||||||
|
}, {
|
||||||
|
arg: 'twoFactor',
|
||||||
|
type: 'any',
|
||||||
|
description: 'The user twoFactor'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
http: {
|
http: {
|
||||||
|
@ -32,8 +36,8 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.updateUser = async(ctx, id, name, nickname, email, lang) => {
|
Self.updateUser = async(ctx, id, name, nickname, email, lang, twoFactor) => {
|
||||||
await Self.userSecurity(ctx, id);
|
await Self.userSecurity(ctx, id);
|
||||||
await Self.upsertWithWhere({id}, {name, nickname, email, lang});
|
await Self.upsertWithWhere({id}, {name, nickname, email, lang, twoFactor});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,7 +58,7 @@ module.exports = Self => {
|
||||||
fields: ['name', 'twoFactor']
|
fields: ['name', 'twoFactor']
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
if (user.name !== username)
|
if (user.name.toLowerCase() !== username.toLowerCase())
|
||||||
throw new UserError('Authentication failed');
|
throw new UserError('Authentication failed');
|
||||||
|
|
||||||
await authCode.destroy(myOptions);
|
await authCode.destroy(myOptions);
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('validateToken', {
|
||||||
|
description: 'Validates the current logged user token',
|
||||||
|
accepts: [],
|
||||||
|
accessType: 'READ',
|
||||||
|
returns: {
|
||||||
|
type: 'Boolean',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/validateToken`,
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.validateToken = async function(ctx) {
|
||||||
|
const {accessToken: token} = ctx.req;
|
||||||
|
|
||||||
|
// Check if current token is valid
|
||||||
|
const {renewPeriod, courtesyTime} = await models.AccessTokenConfig.findOne({
|
||||||
|
fields: ['renewPeriod', 'courtesyTime']
|
||||||
|
});
|
||||||
|
const now = Date.now();
|
||||||
|
const differenceMilliseconds = now - token.created;
|
||||||
|
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
||||||
|
const isNotExceeded = differenceSeconds < renewPeriod - courtesyTime;
|
||||||
|
return isNotExceeded;
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,50 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('add', {
|
||||||
|
description: 'Add activity if the activity is different or is the same but have exceed time for break',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [
|
||||||
|
{
|
||||||
|
arg: 'code',
|
||||||
|
type: 'string',
|
||||||
|
description: 'Code for activity'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'model',
|
||||||
|
type: 'string',
|
||||||
|
description: 'Origin model from insert'
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
http: {
|
||||||
|
path: `/add`,
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.add = async(ctx, code, model, options) => {
|
||||||
|
const userId = ctx.req.accessToken.userId;
|
||||||
|
const myOptions = {};
|
||||||
|
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
return await Self.rawSql(`
|
||||||
|
INSERT INTO workerActivity (workerFk, workerActivityTypeFk, model)
|
||||||
|
SELECT ?, ?, ?
|
||||||
|
FROM workerTimeControlParams wtcp
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT wa.workerFk,
|
||||||
|
wa.created,
|
||||||
|
wat.code
|
||||||
|
FROM workerActivity wa
|
||||||
|
LEFT JOIN workerActivityType wat ON wat.code = wa.workerActivityTypeFk
|
||||||
|
WHERE wa.workerFk = ?
|
||||||
|
ORDER BY wa.created DESC
|
||||||
|
LIMIT 1
|
||||||
|
) sub ON TRUE
|
||||||
|
WHERE sub.workerFk IS NULL
|
||||||
|
OR sub.code <> ?
|
||||||
|
OR TIMESTAMPDIFF(SECOND, sub.created, util.VN_NOW()) > wtcp.dayBreak;`
|
||||||
|
, [userId, code, model, userId, code], myOptions);
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,30 @@
|
||||||
|
const {models} = require('vn-loopback');
|
||||||
|
|
||||||
|
describe('workerActivity insert()', () => {
|
||||||
|
const ctx = beforeAll.getCtx(1106);
|
||||||
|
|
||||||
|
it('should insert in workerActivity', async() => {
|
||||||
|
const tx = await models.WorkerActivity.beginTransaction({});
|
||||||
|
let count = 0;
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
try {
|
||||||
|
await models.WorkerActivityType.create(
|
||||||
|
{'code': 'STOP', 'description': 'STOP'}, options
|
||||||
|
);
|
||||||
|
|
||||||
|
await models.WorkerActivity.add(ctx, 'STOP', 'APP', options);
|
||||||
|
|
||||||
|
count = await models.WorkerActivity.count(
|
||||||
|
{'workerFK': 1106}, options
|
||||||
|
);
|
||||||
|
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(count).toEqual(1);
|
||||||
|
});
|
||||||
|
});
|
|
@ -28,6 +28,9 @@
|
||||||
"Company": {
|
"Company": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"Config": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"Continent": {
|
"Continent": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
@ -64,6 +67,9 @@
|
||||||
"EmailUser": {
|
"EmailUser": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"Expedition_PrintOut": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"Image": {
|
"Image": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
@ -112,9 +118,15 @@
|
||||||
"NotificationSubscription": {
|
"NotificationSubscription": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"OrmConfig": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"Province": {
|
"Province": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"QuadmindsApiConfig": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"Autonomy": {
|
"Autonomy": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
@ -163,9 +175,15 @@
|
||||||
"PrintConfig": {
|
"PrintConfig": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"QueueMember": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"ViaexpressConfig": {
|
"ViaexpressConfig": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"VnToken": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"VnUser": {
|
"VnUser": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
@ -189,5 +207,8 @@
|
||||||
},
|
},
|
||||||
"RouteConfig": {
|
"RouteConfig": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"MrwService": {
|
||||||
|
"dataSource": "vn"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,6 +3,7 @@ module.exports = Self => {
|
||||||
require('../methods/collection/setSaleQuantity')(Self);
|
require('../methods/collection/setSaleQuantity')(Self);
|
||||||
require('../methods/collection/previousLabel')(Self);
|
require('../methods/collection/previousLabel')(Self);
|
||||||
require('../methods/collection/getTickets')(Self);
|
require('../methods/collection/getTickets')(Self);
|
||||||
|
require('../methods/collection/assignCollection')(Self);
|
||||||
require('../methods/collection/assign')(Self);
|
require('../methods/collection/assign')(Self);
|
||||||
require('../methods/collection/getSales')(Self);
|
require('../methods/collection/getSales')(Self);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
{
|
{
|
||||||
"name": "Collection",
|
"name": "Collection",
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"id": true,
|
||||||
|
"type": "number",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"workerFk": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "collection"
|
"table": "collection"
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"name": "Config",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "config"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"inventoried": {
|
||||||
|
"type": "date"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"acls": [
|
||||||
|
{
|
||||||
|
"accessType": "READ",
|
||||||
|
"principalType": "ROLE",
|
||||||
|
"principalId": "$authenticated",
|
||||||
|
"permission": "ALLOW"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -25,6 +25,9 @@
|
||||||
},
|
},
|
||||||
"isSocialNameUnique": {
|
"isSocialNameUnique": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"continentFk": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
@ -32,6 +35,11 @@
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Currency",
|
"model": "Currency",
|
||||||
"foreignKey": "currencyFk"
|
"foreignKey": "currencyFk"
|
||||||
|
},
|
||||||
|
"continent": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Continent",
|
||||||
|
"foreignKey": "continentFk"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"acls": [
|
"acls": [
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "salix.defaultViewConfig"
|
"table": "salix.defaultViewMultiConfig"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"name": "Expedition_PrintOut",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "dipole.expedition_PrintOut"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"expeditionFk": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true,
|
||||||
|
"description": "id expeditionFk"
|
||||||
|
},
|
||||||
|
"itemFk": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"isChecked": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,60 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
require('../methods/mrw-config/createShipment')(Self);
|
require('../methods/mrw-config/createShipment')(Self);
|
||||||
|
require('../methods/mrw-config/getLabel')(Self);
|
||||||
require('../methods/mrw-config/cancelShipment')(Self);
|
require('../methods/mrw-config/cancelShipment')(Self);
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const ejs = require('ejs');
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
const {DOMParser} = require('xmldom');
|
||||||
|
const axios = require('axios');
|
||||||
|
|
||||||
|
Self.getConfig = async function() {
|
||||||
|
const mrw = await Self.app.models.MrwConfig.findOne(null);
|
||||||
|
if (!mrw) throw new UserError(`MRW service is not configured`);
|
||||||
|
return mrw;
|
||||||
|
};
|
||||||
|
|
||||||
|
Self.getTextByTag = function(xmlDoc, tag) {
|
||||||
|
return xmlDoc?.getElementsByTagName(tag)[0]?.textContent;
|
||||||
|
};
|
||||||
|
|
||||||
|
Self.sendXmlDoc = async function(path, params, contentType) {
|
||||||
|
const parser = new DOMParser();
|
||||||
|
|
||||||
|
const xmlTemplate = fs.readFileSync(path, 'utf-8');
|
||||||
|
const renderedTemplate = ejs.render(xmlTemplate, params);
|
||||||
|
const data = await axios.post(params.mrw.url, renderedTemplate, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': `${contentType}; charset=utf-8`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return parser.parseFromString(data.data, 'text/xml');
|
||||||
|
};
|
||||||
|
|
||||||
|
Self.getClientType = async function(expeditionFk) {
|
||||||
|
if (!expeditionFk) throw new UserError(`No expeditionFk defined`);
|
||||||
|
|
||||||
|
const {clientTypeWidth} = await Self.getConfig();
|
||||||
|
const result = await Self.app.models.Expedition.findById(expeditionFk,
|
||||||
|
{include: [{
|
||||||
|
relation: 'ticket',
|
||||||
|
scope: {
|
||||||
|
include: {
|
||||||
|
relation: 'agencyMode',
|
||||||
|
scope: {
|
||||||
|
include: {
|
||||||
|
relation: 'mrwService',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]}
|
||||||
|
);
|
||||||
|
const clientType = result?.ticket()?.agencyMode()?.mrwService()?.clientType;
|
||||||
|
if (!clientType || !clientTypeWidth) throw new UserError(`ClientType not available`);
|
||||||
|
|
||||||
|
return clientType.toString().padStart(clientTypeWidth, '0');
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,27 @@
|
||||||
},
|
},
|
||||||
"subscriberCode": {
|
"subscriberCode": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"defaultHeight": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"defaultLength": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"defaultWidth": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"defaultWeight": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"expeditionDeadLine": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"notified":{
|
||||||
|
"type": "date"
|
||||||
|
},
|
||||||
|
"clientTypeWidth": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"name": "MrwService",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "mrwService"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"agencyModeCodeFk": {
|
||||||
|
"id": true,
|
||||||
|
"type": "string",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"clientType": {
|
||||||
|
"type": "number",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"serviceType": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"kg": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"agency": {
|
||||||
|
"type": "hasOne",
|
||||||
|
"model": "AgencyMode",
|
||||||
|
"foreignKey": "code"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"name": "OrmConfig",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "ormConfig"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true
|
||||||
|
},
|
||||||
|
"selectLimit": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"acls": [
|
||||||
|
{
|
||||||
|
"accessType": "*",
|
||||||
|
"principalType": "ROLE",
|
||||||
|
"principalId": "$authenticated",
|
||||||
|
"permission": "ALLOW"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -9,7 +9,8 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"code": {
|
"code": {
|
||||||
"id": true,
|
"id": true,
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"required": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
@ -47,4 +48,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,17 +3,23 @@
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "productionConfig"
|
"table": "productionConfig"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"required": true,
|
"required": true,
|
||||||
"id": true
|
"id": true
|
||||||
},
|
},
|
||||||
|
"sectorFromCode": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"sectorToCode": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"backupPrinterNotificationDelay": {
|
"backupPrinterNotificationDelay": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
require('../methods/quadminds-api-config/sendPois')(Self);
|
||||||
|
require('../methods/quadminds-api-config/sendOrders')(Self);
|
||||||
|
};
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"name": "QuadmindsApiConfig",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "quadmindsApiConfig"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true,
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"key": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"maxObjects": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"limit": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"orderTimeFrom": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"orderTimeTo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"name": "QueueMember",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "pbx.queueMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true
|
||||||
|
},
|
||||||
|
"queue": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"extension": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"queueRelation": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Queue",
|
||||||
|
"foreignKey": "queue",
|
||||||
|
"primaryKey": "name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"acls": [
|
||||||
|
{
|
||||||
|
"property": "*",
|
||||||
|
"accessType": "READ",
|
||||||
|
"principalType": "ROLE",
|
||||||
|
"principalId": "employee",
|
||||||
|
"permission": "ALLOW"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,12 +1,13 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
describe('loopback model MailAliasAccount', () => {
|
describe('loopback model MailAliasAccount', () => {
|
||||||
|
const ctx = beforeAll.getCtx();
|
||||||
it('should add a mail Alias', async() => {
|
it('should add a mail Alias', async() => {
|
||||||
const tx = await models.MailAliasAccount.beginTransaction({});
|
const tx = await models.MailAliasAccount.beginTransaction({});
|
||||||
let error;
|
let error;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx, accessToken: {userId: 9}};
|
const options = {transaction: tx, ctx};
|
||||||
await models.MailAliasAccount.create({mailAlias: 2, account: 5}, options);
|
await models.MailAliasAccount.create({mailAlias: 2, account: 5}, options);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -23,7 +24,7 @@ describe('loopback model MailAliasAccount', () => {
|
||||||
let error;
|
let error;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx, accessToken: {userId: 9}};
|
const options = {transaction: tx, ctx};
|
||||||
await models.MailAliasAccount.create({mailAlias: 3, account: 5}, options);
|
await models.MailAliasAccount.create({mailAlias: 3, account: 5}, options);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"required": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
@ -54,4 +55,4 @@
|
||||||
"fields": ["id", "name", "provinceFk"]
|
"fields": ["id", "name", "provinceFk"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "userConfig"
|
"table": "userMultiConfig"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
const vnModel = require('vn-loopback/common/models/vn-model');
|
||||||
|
module.exports = function(Self) {
|
||||||
|
vnModel(Self);
|
||||||
|
require('../methods/vn-token/killSession')(Self);
|
||||||
|
};
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"name": "VnToken",
|
||||||
|
"base": "AccessToken",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "salix.AccessToken"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"created": {
|
||||||
|
"type": "date"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"user": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "VnUser",
|
||||||
|
"foreignKey": "userId"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hidden": ["id"]
|
||||||
|
}
|
|
@ -15,6 +15,8 @@ module.exports = function(Self) {
|
||||||
require('../methods/vn-user/renew-token')(Self);
|
require('../methods/vn-user/renew-token')(Self);
|
||||||
require('../methods/vn-user/share-token')(Self);
|
require('../methods/vn-user/share-token')(Self);
|
||||||
require('../methods/vn-user/update-user')(Self);
|
require('../methods/vn-user/update-user')(Self);
|
||||||
|
require('../methods/vn-user/validate-token')(Self);
|
||||||
|
require('../methods/vn-user/acls')(Self);
|
||||||
|
|
||||||
Self.definition.settings.acls = Self.definition.settings.acls.filter(acl => acl.property !== 'create');
|
Self.definition.settings.acls = Self.definition.settings.acls.filter(acl => acl.property !== 'create');
|
||||||
|
|
||||||
|
@ -99,9 +101,10 @@ module.exports = function(Self) {
|
||||||
const headers = httpRequest.headers;
|
const headers = httpRequest.headers;
|
||||||
const origin = headers.origin;
|
const origin = headers.origin;
|
||||||
|
|
||||||
const defaultHash = '/reset-password?access_token=$token$';
|
const defaultHash = '!/reset-password?access_token=$token$';
|
||||||
const recoverHashes = {
|
const recoverHashes = {
|
||||||
hedera: 'verificationToken=$token$'
|
hedera: '!verificationToken=$token$',
|
||||||
|
lilium: '/resetPassword?access_token=$token$'
|
||||||
};
|
};
|
||||||
|
|
||||||
const app = info.options?.app;
|
const app = info.options?.app;
|
||||||
|
@ -113,7 +116,7 @@ module.exports = function(Self) {
|
||||||
const params = {
|
const params = {
|
||||||
recipient: info.email,
|
recipient: info.email,
|
||||||
lang: user.lang,
|
lang: user.lang,
|
||||||
url: origin + '/#!' + recoverHash
|
url: origin + '/#' + recoverHash
|
||||||
};
|
};
|
||||||
|
|
||||||
const options = Object.assign({}, info.options);
|
const options = Object.assign({}, info.options);
|
||||||
|
|
|
@ -113,6 +113,13 @@
|
||||||
"principalId": "$everyone",
|
"principalId": "$everyone",
|
||||||
"permission": "ALLOW"
|
"permission": "ALLOW"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"property": "validateToken",
|
||||||
|
"accessType": "EXECUTE",
|
||||||
|
"principalType": "ROLE",
|
||||||
|
"principalId": "$authenticated",
|
||||||
|
"permission": "ALLOW"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"property": "privileges",
|
"property": "privileges",
|
||||||
"accessType": "*",
|
"accessType": "*",
|
||||||
|
@ -133,6 +140,13 @@
|
||||||
"principalType": "ROLE",
|
"principalType": "ROLE",
|
||||||
"principalId": "$authenticated",
|
"principalId": "$authenticated",
|
||||||
"permission": "ALLOW"
|
"permission": "ALLOW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"property": "acls",
|
||||||
|
"accessType": "*",
|
||||||
|
"principalType": "ROLE",
|
||||||
|
"principalId": "$everyone",
|
||||||
|
"permission": "ALLOW"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scopes": {
|
"scopes": {
|
||||||
|
@ -151,7 +165,8 @@
|
||||||
"hasGrant",
|
"hasGrant",
|
||||||
"realm",
|
"realm",
|
||||||
"email",
|
"email",
|
||||||
"emailVerified"
|
"emailVerified",
|
||||||
|
"twoFactor"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,21 +9,39 @@
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"id": true,
|
"id": true,
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"forceId": false
|
"forceId": false
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"code": {
|
"code": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"isInventory": {
|
"isInventory": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"isManaged":{
|
"isManaged": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"isDestiny": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"countryFk": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"country": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Country",
|
||||||
|
"foreignKey": "countryFk"
|
||||||
|
},
|
||||||
|
"address": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Address",
|
||||||
|
"foreignKey": "addressFk"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"acls": [
|
"acls": [
|
||||||
|
@ -34,5 +52,11 @@
|
||||||
"permission": "ALLOW"
|
"permission": "ALLOW"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scope" : {"where": {"isForTicket": {"neq": 0}}}
|
"scope": {
|
||||||
|
"where": {
|
||||||
|
"isForTicket": {
|
||||||
|
"neq": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
require('../methods/workerActivity/add')(Self);
|
||||||
|
};
|
|
@ -22,18 +22,18 @@
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"workerFk": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Worker",
|
||||||
|
"foreignKey": "workerFk"
|
||||||
},
|
},
|
||||||
"relations": {
|
"workerActivityTypeFk": {
|
||||||
"workerFk": {
|
"type": "belongsTo",
|
||||||
"type": "belongsTo",
|
"model": "WorkerActivityType",
|
||||||
"model": "Worker",
|
"foreignKey": "workerActivityTypeFk"
|
||||||
"foreignKey": "workerFk"
|
|
||||||
},
|
|
||||||
"workerActivityTypeFk": {
|
|
||||||
"type": "belongsTo",
|
|
||||||
"model": "WorkerActivityType",
|
|
||||||
"foreignKey": "workerActivityTypeFk"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -22,4 +22,4 @@
|
||||||
"modules/worker/front/**/*",
|
"modules/worker/front/**/*",
|
||||||
"modules/zone/front/**/*"
|
"modules/zone/front/**/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,6 @@ apps:
|
||||||
- script: ./loopback/server/server.js
|
- script: ./loopback/server/server.js
|
||||||
name: salix-back
|
name: salix-back
|
||||||
instances: 1
|
instances: 1
|
||||||
max_restarts: 3
|
max_restarts: 0
|
||||||
restart_delay: 15000
|
autorestart: false
|
||||||
node_args: --tls-min-v1.0 --openssl-legacy-provider
|
node_args: --tls-min-v1.0 --openssl-legacy-provider
|
||||||
|
|
|
@ -10,13 +10,13 @@ async function init() {
|
||||||
host: process.env.DB_HOST,
|
host: process.env.DB_HOST,
|
||||||
port: process.env.DB_PORT
|
port: process.env.DB_PORT
|
||||||
});
|
});
|
||||||
|
|
||||||
const bootOptions = {dataSources};
|
const bootOptions = {dataSources};
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
app.boot(bootOptions,
|
app.boot(bootOptions,
|
||||||
err => err ? reject(err) : resolve());
|
err => err ? reject(err) : resolve());
|
||||||
});
|
});
|
||||||
// FIXME: Workaround to wait for loopback to be ready
|
// FIXME: Workaround to wait for loopback to be ready
|
||||||
|
app.emit('started');
|
||||||
await app.models.Application.status();
|
await app.models.Application.status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,3 +32,4 @@ module.exports = {
|
||||||
|
|
||||||
if (require.main === module)
|
if (require.main === module)
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ async function test() {
|
||||||
'loopback/**/*[sS]pec.js',
|
'loopback/**/*[sS]pec.js',
|
||||||
'modules/*/back/**/*.[sS]pec.js'
|
'modules/*/back/**/*.[sS]pec.js'
|
||||||
],
|
],
|
||||||
helpers: []
|
helpers: [`back/vn-jasmine.js`],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (PARALLEL) {
|
if (PARALLEL) {
|
||||||
|
@ -114,7 +114,6 @@ async function test() {
|
||||||
if (opts.ci)
|
if (opts.ci)
|
||||||
runner.jasmine.DEFAULT_TIMEOUT_INTERVAL = SPEC_TIMEOUT;
|
runner.jasmine.DEFAULT_TIMEOUT_INTERVAL = SPEC_TIMEOUT;
|
||||||
|
|
||||||
// runner.loadConfigFile('back/jasmine.json');
|
|
||||||
runner.loadConfig(config);
|
runner.loadConfig(config);
|
||||||
process.env.SPEC_IS_RUNNING = true;
|
process.env.SPEC_IS_RUNNING = true;
|
||||||
await runner.execute();
|
await runner.execute();
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
const LoopBackContext = require('loopback-context');
|
||||||
|
const getAccessToken = (userId = 9) => {
|
||||||
|
return {accessToken: {userId}};
|
||||||
|
};
|
||||||
|
const DEFAULT_HEADERS = {headers: {origin: 'http://localhost'}};
|
||||||
|
const default_before_all = userId => {
|
||||||
|
return {
|
||||||
|
req: {
|
||||||
|
...getAccessToken(userId),
|
||||||
|
...DEFAULT_HEADERS,
|
||||||
|
...{__: value => value}
|
||||||
|
|
||||||
|
},
|
||||||
|
args: {}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const default_loopback_ctx = userId => {
|
||||||
|
return {
|
||||||
|
...getAccessToken(userId),
|
||||||
|
...default_before_all(userId),
|
||||||
|
http: {
|
||||||
|
...default_before_all(userId)
|
||||||
|
},
|
||||||
|
args: {}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
function vnBeforeAll() {
|
||||||
|
Object.assign(beforeAll, {getCtx: default_before_all, mockLoopBackContext});
|
||||||
|
}
|
||||||
|
|
||||||
|
const mockLoopBackContext = userId => {
|
||||||
|
const activeCtx = default_loopback_ctx(userId);
|
||||||
|
beforeAll(() => {
|
||||||
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||||
|
active: activeCtx
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return activeCtx;
|
||||||
|
};
|
||||||
|
module.exports = {
|
||||||
|
mockLoopBackContext
|
||||||
|
};
|
||||||
|
|
||||||
|
(function init() {
|
||||||
|
vnBeforeAll();
|
||||||
|
})();
|
|
@ -9,7 +9,7 @@
|
||||||
},
|
},
|
||||||
"vn": {
|
"vn": {
|
||||||
"view": {
|
"view": {
|
||||||
"expeditionPallet_Print": "06613719475fcdba8309607c38cc78efc2e348cca7bc96b48dc3ae3c12426f54"
|
"expeditionPallet_Print": "99f75145ac2e7b612a6d71e74b6e55f194a465780fd9875a15eb01e6596b447e"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1 +1,14 @@
|
||||||
-- Executed before dump
|
-- Executed before dump
|
||||||
|
|
||||||
|
CREATE USER 'vn'@'localhost';
|
||||||
|
|
||||||
|
GRANT SELECT,
|
||||||
|
INSERT,
|
||||||
|
UPDATE,
|
||||||
|
DELETE,
|
||||||
|
DROP,
|
||||||
|
CREATE TEMPORARY TABLES,
|
||||||
|
EXECUTE,
|
||||||
|
EVENT,
|
||||||
|
TRIGGER
|
||||||
|
ON *.* TO 'vn'@'localhost';
|
||||||
|
|
|
@ -10,9 +10,6 @@ SET foreign_key_checks = 0;
|
||||||
INSERT INTO util.config (id, environment, mockTime, mockUtcTime, mockEnabled)
|
INSERT INTO util.config (id, environment, mockTime, mockUtcTime, mockEnabled)
|
||||||
VALUES (1, 'local', '2001-01-01 12:00:00', '2001-01-01 11:00:00', TRUE);
|
VALUES (1, 'local', '2001-01-01 12:00:00', '2001-01-01 11:00:00', TRUE);
|
||||||
|
|
||||||
INSERT INTO util.binlogQueue (code,logName, `position`)
|
|
||||||
VALUES ('mylogger', 'bin.000001', 4);
|
|
||||||
|
|
||||||
/* #5483
|
/* #5483
|
||||||
INSERT INTO vn.entryConfig (defaultEntry, mailToNotify, inventorySupplierFk, maxLockTime, defaultSupplierFk)
|
INSERT INTO vn.entryConfig (defaultEntry, mailToNotify, inventorySupplierFk, maxLockTime, defaultSupplierFk)
|
||||||
VALUES(1, NULL, 1, 300, 1);
|
VALUES(1, NULL, 1, 300, 1);
|
||||||
|
@ -129,7 +126,7 @@ INSERT INTO vn.itemShelving (id,itemFk,visible,shelvingFk,`grouping`,packing,pac
|
||||||
INSERT INTO vn.beach (code,warehouseFk) VALUES
|
INSERT INTO vn.beach (code,warehouseFk) VALUES
|
||||||
('TEST',1);
|
('TEST',1);
|
||||||
|
|
||||||
INSERT INTO vn.routesMonitor (routeFk,name,beachFk,m3,expeditionTruckFk) VALUES
|
INSERT INTO vn.routesMonitor (routeFk,name,beachFk,m3,roadmapStopFk) VALUES
|
||||||
(1,'TEST','TEST',1.0,1);
|
(1,'TEST','TEST',1.0,1);
|
||||||
/* #5483
|
/* #5483
|
||||||
INSERT INTO vn.ticket (clientFk, warehouseFk, shipped, nickname, refFk, addressFk, workerFk, observations, isSigned, isLabeled, isPrinted, packages, location, `hour`, created, isBlocked, solution, routeFk, priority, hasPriority, companyFk, agencyModeFk, landed, isBoxed, isDeleted, zoneFk, zonePrice, zoneBonus, totalWithVat, totalWithoutVat, weight)
|
INSERT INTO vn.ticket (clientFk, warehouseFk, shipped, nickname, refFk, addressFk, workerFk, observations, isSigned, isLabeled, isPrinted, packages, location, `hour`, created, isBlocked, solution, routeFk, priority, hasPriority, companyFk, agencyModeFk, landed, isBoxed, isDeleted, zoneFk, zonePrice, zoneBonus, totalWithVat, totalWithoutVat, weight)
|
||||||
|
@ -314,5 +311,4 @@ INSERT INTO mysql.roles_mapping (`User`, `Host`, `Role`, `Admin_option`)
|
||||||
SELECT SUBSTR(`User`, @prefixLen + 1), `Host`, `Role`, `Admin_option`
|
SELECT SUBSTR(`User`, @prefixLen + 1), `Host`, `Role`, `Admin_option`
|
||||||
FROM mysql.roles_mapping
|
FROM mysql.roles_mapping
|
||||||
WHERE `User` LIKE @prefixedLike AND `Host` = @genRoleHost;
|
WHERE `User` LIKE @prefixedLike AND `Host` = @genRoleHost;
|
||||||
|
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
|
|
|
@ -108,6 +108,7 @@ INSERT INTO `vn`.`worker`(`id`,`code`, `firstName`, `lastName`, `bossFk`)
|
||||||
UPDATE `vn`.`worker` SET bossFk = NULL WHERE id = 20;
|
UPDATE `vn`.`worker` SET bossFk = NULL WHERE id = 20;
|
||||||
UPDATE `vn`.`worker` SET bossFk = 20 WHERE id = 1 OR id = 9;
|
UPDATE `vn`.`worker` SET bossFk = 20 WHERE id = 1 OR id = 9;
|
||||||
UPDATE `vn`.`worker` SET bossFk = 19 WHERE id = 18;
|
UPDATE `vn`.`worker` SET bossFk = 19 WHERE id = 18;
|
||||||
|
UPDATE `vn`.`worker` SET bossFk = 50 WHERE id = 49;
|
||||||
|
|
||||||
DELETE FROM `vn`.`worker` WHERE firstName ='customer';
|
DELETE FROM `vn`.`worker` WHERE firstName ='customer';
|
||||||
|
|
||||||
|
@ -115,10 +116,13 @@ INSERT INTO `hedera`.`tpvConfig`(`id`, `currency`, `terminal`, `transactionType`
|
||||||
VALUES
|
VALUES
|
||||||
(1, 978, 1, 0, 2000, 9, 0);
|
(1, 978, 1, 0, 2000, 9, 0);
|
||||||
|
|
||||||
|
INSERT INTO hedera.orderConfig (`id`, `employeeFk`, `defaultAgencyFk`, `guestMethod`, `guestAgencyFk`, `reserveTime`, `defaultCompanyFk`)
|
||||||
|
VALUES (1, 1, 2, 'PICKUP', 1, '00:20:00', 442);
|
||||||
|
|
||||||
INSERT INTO `account`.`user`(`id`,`name`,`nickname`, `password`,`role`,`active`,`email`,`lang`, `image`)
|
INSERT INTO `account`.`user`(`id`,`name`,`nickname`, `password`,`role`,`active`,`email`,`lang`, `image`)
|
||||||
VALUES
|
VALUES
|
||||||
(1101, 'brucewayne', 'Bruce Wayne', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'BruceWayne@mydomain.com', 'es','1101'),
|
(1101, 'brucewayne', 'Bruce Wayne', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'BruceWayne@mydomain.com', 'es','1101'),
|
||||||
(1102, 'petterparker', 'Petter Parker', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'PetterParker@mydomain.com', 'en','1102'),
|
(1102, 'petterparker', 'Petter Parker', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 131, 1, 'PetterParker@mydomain.com', 'en','1102'),
|
||||||
(1103, 'clarkkent', 'Clark Kent', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'ClarkKent@mydomain.com', 'fr','1103'),
|
(1103, 'clarkkent', 'Clark Kent', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'ClarkKent@mydomain.com', 'fr','1103'),
|
||||||
(1104, 'tonystark', 'Tony Stark', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'TonyStark@mydomain.com', 'es','1104'),
|
(1104, 'tonystark', 'Tony Stark', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'TonyStark@mydomain.com', 'es','1104'),
|
||||||
(1105, 'maxeisenhardt', 'Max Eisenhardt', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt','1105'),
|
(1105, 'maxeisenhardt', 'Max Eisenhardt', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt','1105'),
|
||||||
|
@ -181,6 +185,7 @@ INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory
|
||||||
(3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0),
|
(3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0),
|
||||||
(4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1),
|
(4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1),
|
||||||
(5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
|
(5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
|
||||||
|
(6, 'Warehouse six', 'vnh', 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
|
||||||
(13, 'Inventory', 'inv', 1, 1, 1, 0, 0, 0, 1, 0, 0, 0),
|
(13, 'Inventory', 'inv', 1, 1, 1, 0, 0, 0, 1, 0, 0, 0),
|
||||||
(60, 'Algemesi', NULL, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0);
|
(60, 'Algemesi', NULL, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0);
|
||||||
|
|
||||||
|
@ -301,6 +306,17 @@ UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 1 WHERE `id` = 8;
|
||||||
UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 4 WHERE `id` = 23;
|
UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 4 WHERE `id` = 23;
|
||||||
UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 1 WHERE `id` = 10;
|
UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 1 WHERE `id` = 10;
|
||||||
|
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'inhouse pickup' WHERE `id` = 1;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Super-Man delivery' WHERE `id` = 2;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Teleportation device' WHERE `id` = 3;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Entanglement' WHERE `id` = 4;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Quantum break device' WHERE `id` = 5;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Walking' WHERE `id` = 6;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Gotham247' WHERE `id` = 7;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Gotham247Expensive' WHERE `id` = 8;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Other agency' WHERE `id` = 10;
|
||||||
|
UPDATE `vn`.`agencyMode` SET `description` = 'Refund' WHERE `id` = 23;
|
||||||
|
|
||||||
UPDATE `vn`.`agencyMode` SET `web` = 1, `reportMail` = 'no-reply@gothamcity.com';
|
UPDATE `vn`.`agencyMode` SET `web` = 1, `reportMail` = 'no-reply@gothamcity.com';
|
||||||
|
|
||||||
UPDATE `vn`.`agencyMode` SET `code` = 'refund' WHERE `id` = 23;
|
UPDATE `vn`.`agencyMode` SET `code` = 'refund' WHERE `id` = 23;
|
||||||
|
@ -320,21 +336,21 @@ INSERT INTO `vn`.`payDem`(`id`, `payDem`)
|
||||||
(2, 20),
|
(2, 20),
|
||||||
(7, 0);
|
(7, 0);
|
||||||
|
|
||||||
INSERT INTO `vn`.`autonomy`(`id`, `name`, `countryFk`)
|
INSERT INTO `vn`.`autonomy`(`id`, `name`, `countryFk`, `hasDailyInvoice`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Autonomy one', 1),
|
(1, 'Autonomy one', 1, 1),
|
||||||
(2, 'Autonomy two', 1),
|
(2, 'Autonomy two', 1, 0),
|
||||||
(3, 'Autonomy three', 2),
|
(3, 'Autonomy three', 2, 0),
|
||||||
(4, 'Autonomy four', 13);
|
(4, 'Autonomy four', 13, 0);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`province`(`id`, `name`, `countryFk`, `autonomyFk`, `warehouseFk`)
|
INSERT INTO `vn`.`province`(`id`, `name`, `countryFk`, `autonomyFk`, `warehouseFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Province one', 1, 1, NULL),
|
(1, 'Province one', 1, 1, NULL),
|
||||||
(2, 'Province two', 1, 1, NULL),
|
(2, 'Province two', 1, 1, NULL),
|
||||||
(3, 'Province three', 30, 2, NULL),
|
(3, 'Province three', 30, 2, NULL),
|
||||||
(4, 'Province four', 2, 3, NULL),
|
(4, 'Province four', 2, 3, NULL),
|
||||||
(5, 'Province five', 13, 4, NULL);
|
(5, 'Province five', 13, 4, NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`town`(`id`, `name`, `provinceFk`)
|
INSERT INTO `vn`.`town`(`id`, `name`, `provinceFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -350,6 +366,7 @@ INSERT INTO `vn`.`postCode`(`code`, `townFk`, `geoFk`)
|
||||||
('46460', 2, 6),
|
('46460', 2, 6),
|
||||||
('46680', 3, 6),
|
('46680', 3, 6),
|
||||||
('46600', 4, 7),
|
('46600', 4, 7),
|
||||||
|
('46600',1, 6),
|
||||||
('EC170150', 5, 8);
|
('EC170150', 5, 8);
|
||||||
|
|
||||||
INSERT INTO `vn`.`clientType`(`code`, `type`)
|
INSERT INTO `vn`.`clientType`(`code`, `type`)
|
||||||
|
@ -382,7 +399,7 @@ INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city
|
||||||
(1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 19, 0, 'florist','normal'),
|
(1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 19, 0, 'florist','normal'),
|
||||||
(1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 5, 1, 300, 13, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 19, 0, 'florist','normal'),
|
(1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 5, 1, 300, 13, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 19, 0, 'florist','normal'),
|
||||||
(1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 9, 0, 'florist','normal'),
|
(1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 9, 0, 'florist','normal'),
|
||||||
(1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, NULL, 0, 'florist','normal'),
|
(1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, NULL, 1, 'florist','normal'),
|
||||||
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'),
|
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'),
|
||||||
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses');
|
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses');
|
||||||
|
|
||||||
|
@ -398,7 +415,7 @@ INSERT INTO `vn`.`clientManaCache`(`clientFk`, `mana`, `dated`)
|
||||||
(1103, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
(1103, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||||
(1104, -30, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH));
|
(1104, -30, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH));
|
||||||
|
|
||||||
INSERT INTO `vn`.`mandateType`(`id`, `name`)
|
INSERT INTO `vn`.`mandateType`(`id`, `code`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'B2B'),
|
(1, 'B2B'),
|
||||||
(2, 'CORE'),
|
(2, 'CORE'),
|
||||||
|
@ -528,7 +545,9 @@ INSERT INTO `vn`.`observationType`(`id`,`description`, `code`)
|
||||||
(5, 'Administrative', 'administrative'),
|
(5, 'Administrative', 'administrative'),
|
||||||
(6, 'Weight', 'weight'),
|
(6, 'Weight', 'weight'),
|
||||||
(7, 'InvoiceOut', 'invoiceOut'),
|
(7, 'InvoiceOut', 'invoiceOut'),
|
||||||
(8, 'DropOff', 'dropOff');
|
(8, 'DropOff', 'dropOff'),
|
||||||
|
(9, 'Sustitución', 'substitution'),
|
||||||
|
(10, 'Finance', 'finance');
|
||||||
|
|
||||||
INSERT INTO `vn`.`addressObservation`(`id`,`addressFk`,`observationTypeFk`,`description`)
|
INSERT INTO `vn`.`addressObservation`(`id`,`addressFk`,`observationTypeFk`,`description`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -567,6 +586,7 @@ INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'PLANTS SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'GOTHAM', 1, 46000, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
(1, 'PLANTS SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'GOTHAM', 1, 46000, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
||||||
(2, 'FARMER KING', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 46000, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
(2, 'FARMER KING', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 46000, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
||||||
|
(4, 'INVENTARIO', 'INVENTARIO', 4000000004, NULL, NULL, 0, util.VN_CURDATE(), 1, NULL, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL, NULL),
|
||||||
(69, 'PACKAGING', 'Packaging nick', 4100000069, 1, '94935005K', 0, util.VN_CURDATE(), 1, 'supplier address 5', 'ASGARD', 3, 46600, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
(69, 'PACKAGING', 'Packaging nick', 4100000069, 1, '94935005K', 0, util.VN_CURDATE(), 1, 'supplier address 5', 'ASGARD', 3, 46600, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
||||||
(442, 'VERDNATURA LEVANTE SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 46000, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
|
(442, 'VERDNATURA LEVANTE SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 46000, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
|
||||||
(567, 'HOLLAND', 'Holland nick', 4000020567, 1, '14364089Z', 0, util.VN_CURDATE(), 1, 'supplier address 6', 'ASGARD', 3, 46600, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
(567, 'HOLLAND', 'Holland nick', 4000020567, 1, '14364089Z', 0, util.VN_CURDATE(), 1, 'supplier address 6', 'ASGARD', 3, 46600, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
||||||
|
@ -617,7 +637,7 @@ INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaF
|
||||||
('A', 'Global nacional', 1, 'NATIONAL', 0, 'global'),
|
('A', 'Global nacional', 1, 'NATIONAL', 0, 'global'),
|
||||||
('T', 'Española rapida', 1, 'NATIONAL', 0, 'quick'),
|
('T', 'Española rapida', 1, 'NATIONAL', 0, 'quick'),
|
||||||
('V', 'Intracomunitaria global', 0, 'CEE', 1, 'global'),
|
('V', 'Intracomunitaria global', 0, 'CEE', 1, 'global'),
|
||||||
('M', 'Múltiple nacional', 1, 'NATIONAL', 0, 'quick'),
|
('M', 'Múltiple nacional', 1, 'NATIONAL', 0, 'multiple'),
|
||||||
('R', 'Rectificativa', 1, 'NATIONAL', 0, NULL),
|
('R', 'Rectificativa', 1, 'NATIONAL', 0, NULL),
|
||||||
('E', 'Exportación rápida', 0, 'WORLD', 0, 'quick');
|
('E', 'Exportación rápida', 0, 'WORLD', 0, 'quick');
|
||||||
|
|
||||||
|
@ -728,41 +748,46 @@ INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agen
|
||||||
(6, NULL, 57, util.VN_CURDATE(), 5, 7, 'sixth route', 1.7, 60, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 3),
|
(6, NULL, 57, util.VN_CURDATE(), 5, 7, 'sixth route', 1.7, 60, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 3),
|
||||||
(7, NULL, 57, util.VN_CURDATE(), 6, 8, 'seventh route', 0, 70, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 5);
|
(7, NULL, 57, util.VN_CURDATE(), 6, 8, 'seventh route', 0, 70, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 5);
|
||||||
|
|
||||||
INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`, `cmrFk`)
|
INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`, `cmrFk`, `problem`, `risk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1),
|
(1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 'hasHighRisk', 901.4),
|
||||||
(2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 1, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2),
|
(2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 1, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2, 'hasHighRisk', 901.4),
|
||||||
(3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 3),
|
(3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 3, NULL, NULL),
|
||||||
(4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, NULL),
|
(4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, NULL, NULL, NULL),
|
||||||
(5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, NULL),
|
(5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, NULL, NULL, NULL),
|
||||||
(6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, NULL),
|
(6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, NULL, 'hasHighRisk', 901.4),
|
||||||
(7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
|
||||||
(8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
|
||||||
(9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, 'isTooLittle', NULL),
|
||||||
(11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasTicketRequest', NULL),
|
||||||
(12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'isFreezed', NULL),
|
||||||
(16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, 388.7),
|
||||||
(17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, 388.7),
|
||||||
(18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL, NULL),
|
(18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL, NULL, 'isFreezed', NULL),
|
||||||
(19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL, NULL, 'isTaxDataChecked', NULL),
|
||||||
(20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
|
(20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL, 'isTaxDataChecked', NULL),
|
||||||
(21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
|
(21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL, 'isTaxDataChecked', NULL),
|
||||||
(22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
|
(22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL, 'isTaxDataChecked', NULL),
|
||||||
(23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasTicketRequest, hasHighRisk', 901.4),
|
||||||
(24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
|
||||||
(25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
|
||||||
(26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
|
||||||
(27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, 901.4),
|
||||||
(28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
(32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
|
||||||
(33, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL);
|
(33, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, 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),
|
||||||
|
(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);
|
||||||
|
|
||||||
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
|
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 11, 1, 'ready'),
|
(1, 11, 1, 'ready'),
|
||||||
|
@ -799,16 +824,19 @@ INSERT INTO `vn`.`ticketTracking`(`ticketFk`, `stateFk`, `userFk`, `created`)
|
||||||
(12, 3, 19, util.VN_NOW()),
|
(12, 3, 19, util.VN_NOW()),
|
||||||
(13, 3, 19, util.VN_NOW()),
|
(13, 3, 19, util.VN_NOW()),
|
||||||
(14, 3, 19, util.VN_NOW()),
|
(14, 3, 19, util.VN_NOW()),
|
||||||
(15, 2, 19, util.VN_NOW()),
|
(15, 10, 19, util.VN_NOW()),
|
||||||
(16, 3, 19, util.VN_NOW()),
|
(16, 3, 19, util.VN_NOW()),
|
||||||
(17, 2, 19, util.VN_NOW()),
|
(17, 2, 19, util.VN_NOW()),
|
||||||
(18, 2, 19, util.VN_NOW()),
|
(37, 10, 19, util.VN_NOW()),
|
||||||
(19, 2, 19, util.VN_NOW()),
|
(19, 2, 19, util.VN_NOW()),
|
||||||
(20, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
(20, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
||||||
(21, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
(21, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
||||||
(22, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
(22, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
||||||
(23, 16, 21, util.VN_NOW()),
|
(23, 16, 21, util.VN_NOW()),
|
||||||
(24, 16, 21, util.VN_NOW());
|
(24, 16, 21, util.VN_NOW()),
|
||||||
|
(34, 14, 49, util.VN_NOW()),
|
||||||
|
(35, 14, 18, util.VN_NOW()),
|
||||||
|
(36, 14, 18, util.VN_NOW());
|
||||||
|
|
||||||
INSERT INTO `vn`.`deliveryPoint` (`id`, `name`, `ubication`)
|
INSERT INTO `vn`.`deliveryPoint` (`id`, `name`, `ubication`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -831,9 +859,9 @@ INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`,
|
||||||
INSERT INTO `vn`.`greugeType`(`id`, `name`, `code`)
|
INSERT INTO `vn`.`greugeType`(`id`, `name`, `code`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Diff', 'diff'),
|
(1, 'Diff', 'diff'),
|
||||||
(2, 'Recover', 'recover'),
|
(2, 'Recovery', 'recovery'),
|
||||||
(3, 'Mana', 'mana'),
|
(3, 'Mana', 'mana'),
|
||||||
(4, 'Reclaim', 'reclaim'),
|
(4, 'Claim', 'claim'),
|
||||||
(5, 'Heritage', 'heritage'),
|
(5, 'Heritage', 'heritage'),
|
||||||
(6, 'Miscellaneous', 'miscellaneous'),
|
(6, 'Miscellaneous', 'miscellaneous'),
|
||||||
(7, 'Freight Pickup', 'freightPickUp');
|
(7, 'Freight Pickup', 'freightPickUp');
|
||||||
|
@ -970,6 +998,14 @@ INSERT INTO `vn`.`priceFixed`(`id`, `itemFk`, `rate0`, `rate1`, `rate2`, `rate3`
|
||||||
(2, 3, 10, 10, 10, 10, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 0, 1, util.VN_CURDATE()),
|
(2, 3, 10, 10, 10, 10, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 0, 1, util.VN_CURDATE()),
|
||||||
(3, 13, 8.5, 10, 7.5, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 1, 2, util.VN_CURDATE());
|
(3, 13, 8.5, 10, 7.5, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 1, 2, util.VN_CURDATE());
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`itemMinimumQuantity`(`itemFk`, `quantity`, `started`, `ended`, `warehouseFk`)
|
||||||
|
VALUES
|
||||||
|
(1, 5, util.VN_CURDATE() - INTERVAL 2 MONTH, util.VN_CURDATE() + INTERVAL 1 MONTH, 1),
|
||||||
|
(2, 10, util.VN_CURDATE() - INTERVAL 2 DAY, util.VN_CURDATE() - INTERVAL 1 DAY, 2),
|
||||||
|
(3, 15, util.VN_CURDATE() + INTERVAL 3 DAY, util.VN_CURDATE() + INTERVAL 2 WEEK, 3),
|
||||||
|
(2, 10, util.VN_CURDATE() + INTERVAL 2 MONTH, NULL, 5),
|
||||||
|
(4, 8, util.VN_CURDATE() - INTERVAL 3 MONTH, NULL, NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`expeditionBoxVol`(`boxFk`, `m3`, `ratio`)
|
INSERT INTO `vn`.`expeditionBoxVol`(`boxFk`, `m3`, `ratio`)
|
||||||
VALUES
|
VALUES
|
||||||
(71,0.141,1);
|
(71,0.141,1);
|
||||||
|
@ -998,19 +1034,20 @@ INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`)
|
||||||
|
|
||||||
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
|
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, 'UR9000006041', 94, 1, 'pc1'),
|
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, 'UR9000006041', 94, 1, 'pc1'),
|
||||||
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 18, 'UR9000006041', 94, 1, NULL),
|
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 18, 'UR9000006041', 94, 1, NULL),
|
||||||
(3, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 18, 'UR9000006041', 94, 2, NULL),
|
(3, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 18, 'UR9000006041', 94, 2, NULL),
|
||||||
(4, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 18, 'UR9000006041', 94, 2, NULL),
|
(4, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 18, 'UR9000006041', 94, 2, NULL),
|
||||||
(5, 1, 2, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, NULL, 94, 3, NULL),
|
(5, 1, 2, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, NULL, 94, 3, NULL),
|
||||||
(6, 7, 3, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 18, NULL, 94, 3, NULL),
|
(6, 7, 3, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 18, NULL, 94, 3, NULL),
|
||||||
(7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 1, 18, NULL, 94, NULL,NULL),
|
(7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 1, 18, NULL, 94, NULL,NULL),
|
||||||
(8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 1, 18, NULL, 94, 1, NULL),
|
(8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 1, 18, NULL, 94, 1, NULL),
|
||||||
(9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, NULL, 94, 2, NULL),
|
(9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, NULL, 94, 2, NULL),
|
||||||
(10, 7, 7, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL),
|
(10, 7, 7, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL),
|
||||||
(11, 7, 8, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL),
|
(11, 7, 8, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL),
|
||||||
(12, 7, 9, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL),
|
(12, 7, 9, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL),
|
||||||
(13, 1, 10,71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL);
|
(13, 1, 10, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL),
|
||||||
|
(14, 1, 37, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`expeditionState`(`id`, `created`, `expeditionFk`, `typeFk`, `userFk`)
|
INSERT INTO `vn`.`expeditionState`(`id`, `created`, `expeditionFk`, `typeFk`, `userFk`)
|
||||||
|
@ -1028,47 +1065,50 @@ INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`,
|
||||||
(2, 2, 2, 1, util.VN_CURDATE(), NULL),
|
(2, 2, 2, 1, util.VN_CURDATE(), NULL),
|
||||||
(3, 3, 2, 4, util.VN_CURDATE(), NULL);
|
(3, 3, 2, 4, util.VN_CURDATE(), NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`)
|
INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`, `problem`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, 'Ranged weapon longbow 200cm', 5, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
(1, 1, 1, 'Ranged weapon longbow 200cm', 5, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
|
||||||
(2, 2, 1, 'Melee weapon combat fist 15cm', 10, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
(2, 2, 1, 'Melee weapon combat fist 15cm', 10, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
|
||||||
(3, 1, 1, 'Ranged weapon longbow 200cm', 2, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
(3, 1, 1, 'Ranged weapon longbow 200cm', 2, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
|
||||||
(4, 4, 1, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
(4, 4, 1, 'Melee weapon heavy shield 100cm', 20, 1.69, 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)),
|
(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)),
|
(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()),
|
(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()),
|
(8, 4, 11, 'Melee weapon heavy shield 100cm', 10, 1.79, 0, 0, 0, util.VN_CURDATE(), NULL),
|
||||||
(9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
(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()),
|
(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()),
|
(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()),
|
(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()),
|
(13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE(), NULL),
|
||||||
(14, 1, 8, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
(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()),
|
(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()),
|
(16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
|
||||||
(17, 2, 22, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
(17, 2, 22, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 'hasComponentLack'),
|
||||||
(18, 4, 22, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
(18, 4, 22, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 'hasComponentLack'),
|
||||||
(19, 1, 4, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)),
|
(19, 1, 4, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 'hasComponentLack'),
|
||||||
(20, 1, 5, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)),
|
(20, 1, 5, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 'hasComponentLack'),
|
||||||
(21, 1, 6, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
(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()),
|
(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()),
|
(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()),
|
(24, 1, 10, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
|
||||||
(25, 4, 12, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
(25, 4, 12, '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()),
|
(26, 4, 13, '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()),
|
(27, 4, 14, '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()),
|
(28, 4, 15, '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()),
|
(29, 4, 17, '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()),
|
(30, 4, 18, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
|
||||||
(31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE()),
|
(31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE(), NULL),
|
||||||
(32, 1, 24, 'Ranged weapon longbow 200cm', -1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
(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()),
|
(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()),
|
(34, 4, 28, '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()),
|
(35, 4, 29, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
|
||||||
(37, 4, 31, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
(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()),
|
(36, 4, 30, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
|
||||||
(38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
(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());
|
(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'),
|
||||||
|
(41, 2, 35, 'Melee weapon combat fist 15cm', 8.00, 3.01, 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');
|
||||||
|
|
||||||
INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1205,11 +1245,11 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
||||||
(32, 36, -92.324),
|
(32, 36, -92.324),
|
||||||
(32, 39, 0.994);
|
(32, 39, 0.994);
|
||||||
|
|
||||||
INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `visible`, `grouping`, `packing`, `userFk`)
|
INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `visible`, `grouping`, `packing`,`buyFk`, `userFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(2, 'GVC', 1, 1, 1, 1106),
|
(2, 'GVC', 1, 1, 1, 2,1106),
|
||||||
(4, 'HEJ', 1, 1, 1, 1106),
|
(4, 'HEJ', 1, 1, 1, NULL,1106),
|
||||||
(1, 'UXN', 2, 12, 12, 1106);
|
(1, 'UXN', 2, 12, 12, NULL,1106);
|
||||||
|
|
||||||
INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `created`, `userFk`)
|
INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `created`, `userFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1247,14 +1287,20 @@ INSERT INTO `vn`.`operator` (`workerFk`, `numberOfWagons`, `trainFk`, `itemPacki
|
||||||
INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`)
|
INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1106, 5, DATE_ADD(util.VN_CURDATE(),INTERVAL +1 DAY), 1),
|
(1, 1106, 5, DATE_ADD(util.VN_CURDATE(),INTERVAL +1 DAY), 1),
|
||||||
(2, 1106, 14, util.VN_CURDATE(), 1);
|
(2, 1106, 14, util.VN_CURDATE(), 1),
|
||||||
|
(4, 49, 5, util.VN_CURDATE(), 1),
|
||||||
|
(5, 18, 5, util.VN_CURDATE(), 1),
|
||||||
|
(6, 18, 5, util.VN_CURDATE(), 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`ticketCollection`(`ticketFk`, `collectionFk`, `level`)
|
INSERT INTO `vn`.`ticketCollection`(`ticketFk`, `collectionFk`, `level`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1),
|
(1, 1, 1),
|
||||||
(2, 1, NULL),
|
(2, 1, NULL),
|
||||||
(3, 2, NULL),
|
(3, 2, NULL),
|
||||||
(23, 1, NULL);
|
(23, 1, NULL),
|
||||||
|
(34, 4, 1),
|
||||||
|
(35, 5, 1),
|
||||||
|
(8, 6, 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`genus`(`id`, `name`)
|
INSERT INTO `vn`.`genus`(`id`, `name`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1436,7 +1482,8 @@ INSERT INTO `vn`.`ticketWeekly`(`ticketFk`, `weekDay`)
|
||||||
(2, 1),
|
(2, 1),
|
||||||
(3, 2),
|
(3, 2),
|
||||||
(5, 6),
|
(5, 6),
|
||||||
(15, 6);
|
(15, 6),
|
||||||
|
(17, 6);
|
||||||
|
|
||||||
INSERT INTO `vn`.`awb` (id, code, package, weight, created, amount, transitoryFk, taxFk)
|
INSERT INTO `vn`.`awb` (id, code, package, weight, created, amount, transitoryFk, taxFk)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1452,15 +1499,17 @@ INSERT INTO `vn`.`awb` (id, code, package, weight, created, amount, transitoryFk
|
||||||
(10, '07546500856', 185, 2364, util.VN_CURDATE(), 5321, 442, 1);
|
(10, '07546500856', 185, 2364, util.VN_CURDATE(), 5321, 442, 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseOutFk`, `agencyModeFk`, `m3`, `kg`,`ref`, `totalEntries`, `cargoSupplierFk`, `awbFK`)
|
INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseOutFk`, `agencyModeFk`, `m3`, `kg`,`ref`, `totalEntries`, `cargoSupplierFk`, `awbFK`)
|
||||||
VALUES
|
VALUES (1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1, 1),
|
||||||
(1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1, 1),
|
(2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150.00, 2000, 'second travel', 2, 2, 2),
|
||||||
(2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150, 2000, 'second travel', 2, 2, 2),
|
(3, util.VN_CURDATE(), util.VN_CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1, 3),
|
||||||
(3, util.VN_CURDATE(), util.VN_CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1, 3),
|
(4, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2, 4),
|
||||||
(4, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2, 4),
|
(5, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1, 5),
|
||||||
(5, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1, 5),
|
(6, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2, 6),
|
||||||
(6, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2, 6),
|
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1, 7),
|
||||||
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1, 7),
|
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2, 10),
|
||||||
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2, 10);
|
(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),
|
||||||
|
(11, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE(), 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4),
|
||||||
|
(12, util.VN_CURDATE() , util.VN_CURDATE() + INTERVAL 1 DAY, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4);
|
||||||
|
|
||||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `isRaid`, `evaNotes`)
|
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `isRaid`, `evaNotes`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1471,27 +1520,33 @@ INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed
|
||||||
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 0, 'observation five'),
|
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 0, 'observation five'),
|
||||||
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 0, 'observation six'),
|
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 0, 'observation six'),
|
||||||
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 0, 'observation seven'),
|
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 0, 'observation seven'),
|
||||||
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, 1, '');
|
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, 1, ''),
|
||||||
|
(9, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 9', 1, 1, ''),
|
||||||
|
(10, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 10', 1, 1, ''),
|
||||||
|
(99, 69, '2000-12-01 00:00:00.000', 11, 0, 442, 'IN2009', 'Movement 99', 0, 0, '');
|
||||||
|
|
||||||
INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`)
|
INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `defaultSupplierFk`)
|
||||||
|
VALUES (2, 4, 1);
|
||||||
|
|
||||||
|
INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWasteQuantity`, `saleExternalWaste`, `saleFaultWaste`, `saleContainerWaste`, `saleBreakWaste`, `saleOtherWaste`)
|
||||||
VALUES
|
VALUES
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation', 1, 1, '1062', '51', '4.8'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 1, 1, '1062', '51', '56.20', '56.20', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Colombia', 2, 1, '35074', '687', '2.0'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 2, 1, '35074', '687', '53.12', '89.69', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Mini', 3, 1, '1777', '13', '0.7'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 3, 1, '1777', '13', '12.02', '53.12', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Short', 4, 1, '3182', '59', '0.6'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 4, 1, '3182', '59', '51', '56.20', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Crisantemo', 5, 1, '1747', '13', '0.7'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 5, 1, '1747', '13', '53.12', '53.12', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Lilium Oriental', 6, 1, '7182', '59', '0.6'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 6, 1, '7182', '59', '51', '53.12', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Alstroemeria', 7, 1, '1777', '13', '0.7'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 7, 1, '1777', '13', '89.69', '89.69', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Cymbidium', 1, 1, '4181', '59', '0.6'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 8, 1, '4181', '59', '53.12', '53.12', '56.20', '56.20', '56.20'),
|
||||||
('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Cymbidium', 2, 1, '7268', '59', '0.6'),
|
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 9, 1, '7268', '59', '12.02', '56.20', '56.20', '56.20', '56.20'),
|
||||||
('DavidCharlesHaller', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Containers', 2, 1, '-74', '0', '0.0'),
|
('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 2, 1, '-74', '0', '51', '89.69', '56.20', '56.20', '56.20'),
|
||||||
('DavidCharlesHaller', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Packagings', 3, 1, '-7', '0', '0.0'),
|
('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 3, 1, '-7', '0', '12.02', '53.12', '56.20', '56.20', '56.20'),
|
||||||
('DavidCharlesHaller', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Freight', 4, 1, '1100', '0', '0.0'),
|
('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 4, 1, '1100', '0', '51', '56.20', '56.20', '56.20', '56.20'),
|
||||||
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Funeral Accessories', 5, 1, '848', '-187', '-22.1'),
|
('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 5, 1, '848', '-187', '12.02', '89.69', '56.20', '56.20', '56.20'),
|
||||||
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Miscellaneous Accessories', 6, 1, '186', '0', '0.0'),
|
('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'),
|
||||||
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Adhesives', 7, 1, '277', '0', '0.0');
|
('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 vn.buy(id,entryFk,itemFk,buyingValue,quantity,packagingFk,stickers,freightValue,packageValue,comissionValue,packing,grouping,groupingMode,location,price1,price2,price3,printedStickers,isChecked,isIgnored,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, 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, 1, util.VN_CURDATE() - INTERVAL 1 MONTH),
|
||||||
|
@ -1507,7 +1562,8 @@ INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packagi
|
||||||
(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, 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, 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, 4, util.VN_CURDATE()),
|
||||||
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE());
|
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 'grouping', NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
|
(16, 99,1,50.0000, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 'packing', NULL, 0.00, 99.60, 99.40, 0, 1, 0, 1.00, '2024-07-30 08:13:51.000');
|
||||||
|
|
||||||
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
|
||||||
|
@ -1868,9 +1924,9 @@ INSERT INTO `vn`.`claimEnd`(`id`, `saleFk`, `claimFk`, `workerFk`, `claimDestina
|
||||||
(1, 31, 4, 21, 2),
|
(1, 31, 4, 21, 2),
|
||||||
(2, 32, 3, 21, 3);
|
(2, 32, 3, 21, 3);
|
||||||
|
|
||||||
INSERT INTO `vn`.`claimConfig`(`id`, `maxResponsibility`)
|
INSERT INTO `vn`.`claimConfig`(`id`, `maxResponsibility`, `monthsToRefund`, `minShipped`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 50);
|
(1, 5, 4, '2016-10-01');
|
||||||
|
|
||||||
INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`)
|
INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1925,7 +1981,7 @@ INSERT INTO `vn`.`orderTicket`(`orderFk`, `ticketFk`)
|
||||||
(21, 21),
|
(21, 21),
|
||||||
(22, 22);
|
(22, 22);
|
||||||
|
|
||||||
INSERT INTO `vn`.`userConfig` (`userFk`, `warehouseFk`, `companyFk`)
|
INSERT INTO `vn`.`userMultiConfig` (`userFk`, `warehouseFk`, `companyFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 69),
|
(1, 1, 69),
|
||||||
(5, 1, 442),
|
(5, 1, 442),
|
||||||
|
@ -2388,30 +2444,32 @@ INSERT INTO `vn`.`workerTimeControl`(`userFk`, `timed`, `manual`, `direction`, `
|
||||||
(1107, CONCAT(util.VN_CURDATE(), ' 10:20'), TRUE, 'middle', 1),
|
(1107, CONCAT(util.VN_CURDATE(), ' 10:20'), TRUE, 'middle', 1),
|
||||||
(1107, CONCAT(util.VN_CURDATE(), ' 14:50'), TRUE, 'out', 1);
|
(1107, CONCAT(util.VN_CURDATE(), ' 14:50'), TRUE, 'out', 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`dmsType`(`id`, `name`, `readRoleFk`, `writeRoleFk`, `code`)
|
INSERT INTO `vn`.`dmsType`
|
||||||
|
(`id`, `name`, `readRoleFk`, `writeRoleFk`, `code`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Facturas Recibidas', NULL, NULL, 'invoiceIn'),
|
(1, 'Facturas Recibidas', NULL, NULL, 'invoiceIn'),
|
||||||
(2, 'Doc oficial', NULL, NULL, 'officialDoc'),
|
(2, 'Doc oficial', NULL, NULL, 'officialDoc'),
|
||||||
(3, 'Laboral', 37, 37, 'hhrrData'),
|
(3, 'Laboral', 37, 37, 'hhrrData'),
|
||||||
(4, 'Albaranes recibidos', NULL, NULL, 'deliveryNote'),
|
(4, 'Albaranes recibidos', NULL, NULL, 'deliveryNote'),
|
||||||
(5, 'Otros', 1, 1, 'miscellaneous'),
|
(5, 'Otros', 1, 1, 'miscellaneous'),
|
||||||
(6, 'Pruebas', NULL, NULL, 'tests'),
|
(6, 'Pruebas', NULL, NULL, 'tests'),
|
||||||
(7, 'IAE Clientes', 1, 1, 'economicActivitiesTax'),
|
(7, 'IAE Clientes', 1, 1, 'economicActivitiesTax'),
|
||||||
(8, 'Fiscal', NULL, NULL, 'fiscal'),
|
(8, 'Fiscal', NULL, NULL, 'fiscal'),
|
||||||
(9, 'Vehiculos', NULL, NULL, 'vehicles'),
|
(9, 'Vehiculos', NULL, NULL, 'vehicles'),
|
||||||
(10, 'Plantillas', NULL, NULL, 'templates'),
|
(10, 'Plantillas', NULL, NULL, 'templates'),
|
||||||
(11, 'Contratos', NULL, NULL, 'contracts'),
|
(11, 'Contratos', NULL, NULL, 'contracts'),
|
||||||
(12, 'ley de pagos', 1, 1, 'paymentsLaw'),
|
(12, 'ley de pagos', 1, 1, 'paymentsLaw'),
|
||||||
(13, 'Basura', 1, 1, 'trash'),
|
(13, 'Basura', 1, 1, 'trash'),
|
||||||
(14, 'Ticket', 1, 1, 'ticket'),
|
(14, 'Ticket', 1, 1, 'ticket'),
|
||||||
(15, 'Presupuestos', NULL, NULL, 'budgets'),
|
(15, 'Presupuestos', NULL, NULL, 'budgets'),
|
||||||
(16, 'Logistica', NULL, NULL, 'logistics'),
|
(16, 'Logistica', NULL, NULL, 'logistics'),
|
||||||
(17, 'cmr', 1, 1, 'cmr'),
|
(17, 'cmr', 1, 1, 'cmr'),
|
||||||
(18, 'dua', NULL, NULL, 'dua'),
|
(18, 'dua', NULL, NULL, 'dua'),
|
||||||
(19, 'inmovilizado', NULL, NULL, 'fixedAssets'),
|
(19, 'inmovilizado', NULL, NULL, 'fixedAssets'),
|
||||||
(20, 'Reclamación', 1, 1, 'claim'),
|
(20, 'Reclamación', 1, 1, 'claim'),
|
||||||
(21, 'Entrada', 1, 1, 'entry'),
|
(21, 'Entrada', 1, 1, 'entry'),
|
||||||
(22, 'Proveedor', 1, 1, 'supplier');
|
(22, 'Proveedor', 1, 1, 'supplier'),
|
||||||
|
(23, 'Termografos', 35, 35, 'thermograph');
|
||||||
|
|
||||||
INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`)
|
INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -2419,7 +2477,7 @@ INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `wa
|
||||||
(2, 5, '2.txt', 'text/plain', 5, 1, 442, 1, TRUE, 'Client:104', 'Client:104 dms for the client', util.VN_CURDATE()),
|
(2, 5, '2.txt', 'text/plain', 5, 1, 442, 1, TRUE, 'Client:104', 'Client:104 dms for the client', util.VN_CURDATE()),
|
||||||
(3, 5, '3.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Client: 104', 'Client:104 readme', util.VN_CURDATE()),
|
(3, 5, '3.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Client: 104', 'Client:104 readme', util.VN_CURDATE()),
|
||||||
(4, 3, '4.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Worker: 106', 'Worker:106 readme', util.VN_CURDATE()),
|
(4, 3, '4.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Worker: 106', 'Worker:106 readme', util.VN_CURDATE()),
|
||||||
(5, 5, '5.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'travel: 1', 'dmsForThermograph', util.VN_CURDATE()),
|
(5, 23, '5.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'travel: 1', 'dmsForThermograph', util.VN_CURDATE()),
|
||||||
(6, 5, '6.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'NotExists', 'DoesNotExists', util.VN_CURDATE()),
|
(6, 5, '6.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'NotExists', 'DoesNotExists', util.VN_CURDATE()),
|
||||||
(7, 20, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
|
(7, 20, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
|
||||||
(8, 20, '8.mp4', 'video/mp4', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
|
(8, 20, '8.mp4', 'video/mp4', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
|
||||||
|
@ -2440,7 +2498,7 @@ INSERT INTO `vn`.`clientDms`(`clientFk`, `dmsFk`)
|
||||||
(1104, 2),
|
(1104, 2),
|
||||||
(1104, 3);
|
(1104, 3);
|
||||||
|
|
||||||
INSERT INTO `vn`.`workerDocument`(`id`, `worker`, `document`,`isReadableByWorker`)
|
INSERT INTO `vn`.`workerDms`(`id`, `workerFk`, `dmsFk`,`isReadableByWorker`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1106, 4, TRUE),
|
(1, 1106, 4, TRUE),
|
||||||
(2, 1107, 3, FALSE);
|
(2, 1107, 3, FALSE);
|
||||||
|
@ -2469,14 +2527,15 @@ INSERT INTO `vn`.`thermograph`(`id`, `model`)
|
||||||
('138350-0', 'DISPOSABLE');
|
('138350-0', 'DISPOSABLE');
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`travelThermograph`(`thermographFk`, `created`, `warehouseFk`, `travelFk`, `temperatureFk`, `result`, `dmsFk`)
|
INSERT INTO `vn`.`travelThermograph`
|
||||||
|
(`thermographFk`, `created`, `warehouseFk`, `travelFk`, `temperatureFk`, `minTemperature`, `maxTemperature`, `result`, `dmsFk`)
|
||||||
VALUES
|
VALUES
|
||||||
('TMM190901395', util.VN_CURDATE(), 1, 1, 'WARM', 'Ok', NULL),
|
('TMM190901395', util.VN_CURDATE(), 1, 1, 'WARM', NULL, NULL, 'Ok', NULL),
|
||||||
('TL.BBA85422', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2, 'COOL', 'Ok', NULL),
|
('TL.BBA85422', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2, 'COOL', NULL, NULL, 'Ok', NULL),
|
||||||
('TL.BBA85422', util.VN_CURDATE(), 2, 1, 'COOL', 'can not read the temperature', NULL),
|
('TL.BBA85422', util.VN_CURDATE(), 2, 1, 'COOL', NULL, NULL, 'can not read the temperature', NULL),
|
||||||
('TZ1905012010', util.VN_CURDATE(), 1, 1, 'WARM', 'Temperature in range', 5),
|
('TZ1905012010', util.VN_CURDATE(), 1, 1, 'WARM', NULL, NULL, 'Temperature in range', 5),
|
||||||
('138350-0', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 'WARM', NULL, 5),
|
('138350-0', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 'WARM', 2, 12, NULL, 5),
|
||||||
('138350-0', util.VN_CURDATE(), 1, NULL, 'COOL', NULL, NULL);
|
('138350-0', util.VN_CURDATE(), 1, NULL, 'COOL', NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
REPLACE INTO `vn`.`incoterms`(`code`, `name`)
|
REPLACE INTO `vn`.`incoterms`(`code`, `name`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -2525,18 +2584,18 @@ INSERT INTO `vn`.`rate`(`dated`, `warehouseFk`, `rate0`, `rate1`, `rate2`, `rate
|
||||||
(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR), 1, 10, 15, 20, 25),
|
(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR), 1, 10, 15, 20, 25),
|
||||||
(util.VN_CURDATE(), 1, 12, 17, 22, 27);
|
(util.VN_CURDATE(), 1, 12, 17, 22, 27);
|
||||||
|
|
||||||
INSERT INTO `vn`.`dua` (id, code, awbFk__, issued, operated, booked, bookEntried, gestdocFk, customsValue, companyFk)
|
INSERT INTO `vn`.`dua` (id, code, issued, operated, booked, bookEntried, gestdocFk, customsValue, companyFk)
|
||||||
VALUES
|
VALUES
|
||||||
(1, '19ES0028013A481523', 1, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 1, 11276.95, 442),
|
(1, '19ES0028013A481523', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 1, 11276.95, 442),
|
||||||
(2, '21ES00280136115760', 2, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 1376.20, 442),
|
(2, '21ES00280136115760', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 1376.20, 442),
|
||||||
(3, '19ES00280131956004', 3, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 3, 14268.50, 442),
|
(3, '19ES00280131956004', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 3, 14268.50, 442),
|
||||||
(4, '19ES00280131955995', 4, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 1, 8242.50, 442),
|
(4, '19ES00280131955995', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 1, 8242.50, 442),
|
||||||
(5, '19ES00280132022070', 5, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 10012.49, 442),
|
(5, '19ES00280132022070', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 10012.49, 442),
|
||||||
(6, '19ES00280132032308', 6, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 19914.25, 442),
|
(6, '19ES00280132032308', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 19914.25, 442),
|
||||||
(7, '19ES00280132025489', 7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 1934.06, 442),
|
(7, '19ES00280132025489', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 1934.06, 442),
|
||||||
(8, '19ES00280132025490', 8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 3618.52, 442),
|
(8, '19ES00280132025490', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 3618.52, 442),
|
||||||
(9, '19ES00280132025491', 9, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 7126.23, 442),
|
(9, '19ES00280132025491', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 7126.23, 442),
|
||||||
(10, '19ES00280132025492', 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 4631.45, 442);
|
(10, '19ES00280132025492', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 4631.45, 442);
|
||||||
|
|
||||||
INSERT INTO `vn`.`duaEntry` (`duaFk`, `entryFk`, `value`, `customsValue`, `euroValue`)
|
INSERT INTO `vn`.`duaEntry` (`duaFk`, `entryFk`, `value`, `customsValue`, `euroValue`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -2549,18 +2608,18 @@ INSERT INTO `vn`.`duaEntry` (`duaFk`, `entryFk`, `value`, `customsValue`, `euroV
|
||||||
(7, 7, 1.00, 1.00, 1.00),
|
(7, 7, 1.00, 1.00, 1.00),
|
||||||
(8, 8, 1.00, 1.00, 1.00);
|
(8, 8, 1.00, 1.00, 1.00);
|
||||||
|
|
||||||
REPLACE INTO `vn`.`invoiceIn`(`id`, `serialNumber`,`serial`, `supplierFk`, `issued`, `created`, `supplierRef`, `isBooked`, `companyFk`, `docFk`)
|
REPLACE INTO `vn`.`invoiceIn`(`id`, `serialNumber`,`serial`, `supplierFk`, `issued`, `created`, `supplierRef`, `isBooked`, `companyFk`, `docFk`, `bookEntried`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1001, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1234, 0, 442, 1),
|
(1, 1001, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1234, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(2, 1002, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1235, 0, 442, 1),
|
(2, 1002, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1235, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(3, 1003, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1236, 0, 442, 1),
|
(3, 1003, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1236, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(4, 1004, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1237, 0, 442, 1),
|
(4, 1004, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1237, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(5, 1005, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1238, 0, 442, 1),
|
(5, 1005, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1238, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(6, 1006, 'R', 2, util.VN_CURDATE(), util.VN_CURDATE(), 1239, 0, 442, 1),
|
(6, 1006, 'R', 2, util.VN_CURDATE(), util.VN_CURDATE(), 1239, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(7, 1007, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1240, 0, 442, 1),
|
(7, 1007, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1240, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(8, 1008, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1241, 0, 442, 1),
|
(8, 1008, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1241, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(9, 1009, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1242, 0, 442, 1),
|
(9, 1009, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1242, 0, 442, 1,util.VN_CURDATE()),
|
||||||
(10, 1010, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1243, 0, 442, 1);
|
(10, 1010, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1243, 0, 442, 1,util.VN_CURDATE());
|
||||||
|
|
||||||
INSERT INTO `vn`.`invoiceInConfig` (`id`, `retentionRate`, `retentionName`, `sageFarmerWithholdingFk`, `daysAgo`)
|
INSERT INTO `vn`.`invoiceInConfig` (`id`, `retentionRate`, `retentionName`, `sageFarmerWithholdingFk`, `daysAgo`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -2670,13 +2729,20 @@ INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`)
|
||||||
(3, 6, 5),
|
(3, 6, 5),
|
||||||
(4, 7, 1);
|
(4, 7, 1);
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`roadmapAddress` (`addressFk`)
|
||||||
|
VALUES
|
||||||
|
(1),
|
||||||
|
(2),
|
||||||
|
(3),
|
||||||
|
(4);
|
||||||
|
|
||||||
INSERT INTO `vn`.`roadmap` (`id`, `name`, `tractorPlate`, `trailerPlate`, `phone`, `supplierFk`, `etd`, `observations`, `userFk`, `price`, `driverName`)
|
INSERT INTO `vn`.`roadmap` (`id`, `name`, `tractorPlate`, `trailerPlate`, `phone`, `supplierFk`, `etd`, `observations`, `userFk`, `price`, `driverName`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'val-algemesi', 'RE-001', 'PO-001', '111111111', 1, util.VN_NOW(), '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', 'RE-002', 'PO-002', '111111111', 1, util.VN_NOW(), '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', 'RE-003', 'PO-003', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 2 DAY), 'observations...', 2, 25, 'Driverman');
|
(3, 'alz-algemesi', '3456-DFG', '7654-BCD', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 2 DAY), 'observations...', 2, 25, 'Driverman');
|
||||||
|
|
||||||
INSERT INTO `vn`.`expeditionTruck` (`id`, `roadmapFk`, `warehouseFk`, `eta`, `description`, `userFk`)
|
INSERT INTO `vn`.`roadmapStop` (`id`, `roadmapFk`, `addressFk`, `eta`, `description`, `userFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY), 'Best truck in fleet', 1),
|
(1, 1, 1, DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY), 'Best truck in fleet', 1),
|
||||||
(2, 1, 2, DATE_ADD(util.VN_NOW(), INTERVAL '1 2' DAY_HOUR), 'Second truck in fleet', 1),
|
(2, 1, 2, DATE_ADD(util.VN_NOW(), INTERVAL '1 2' DAY_HOUR), 'Second truck in fleet', 1),
|
||||||
|
@ -2844,7 +2910,8 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
||||||
(5, 'modified-entry', 'An entry has been modified'),
|
(5, 'modified-entry', 'An entry has been modified'),
|
||||||
(6, 'book-entry-deleted', 'accounting entries deleted'),
|
(6, 'book-entry-deleted', 'accounting entries deleted'),
|
||||||
(7, 'zone-included','An email to notify zoneCollisions'),
|
(7, 'zone-included','An email to notify zoneCollisions'),
|
||||||
(8, 'backup-printer-selected','A backup printer has been selected');
|
(8, 'backup-printer-selected','A backup printer has been selected'),
|
||||||
|
(9, 'mrw-deadline','The MRW deadline has passed');
|
||||||
|
|
||||||
TRUNCATE `util`.`notificationAcl`;
|
TRUNCATE `util`.`notificationAcl`;
|
||||||
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
||||||
|
@ -2857,7 +2924,8 @@ INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
||||||
(5, 9),
|
(5, 9),
|
||||||
(6, 9),
|
(6, 9),
|
||||||
(7, 9),
|
(7, 9),
|
||||||
(8, 66);
|
(8, 66),
|
||||||
|
(9, 56);
|
||||||
|
|
||||||
TRUNCATE `util`.`notificationQueue`;
|
TRUNCATE `util`.`notificationQueue`;
|
||||||
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
|
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
|
||||||
|
@ -3000,9 +3068,6 @@ INSERT INTO `vn`.`workerTimeControlMail` (`id`, `workerFk`, `year`, `week`, `sta
|
||||||
(3, 9, 2000, 51, 'CONFIRMED', util.VN_NOW(), 1, NULL),
|
(3, 9, 2000, 51, 'CONFIRMED', util.VN_NOW(), 1, NULL),
|
||||||
(4, 9, 2001, 1, 'SENDED', util.VN_NOW(), 1, NULL);
|
(4, 9, 2001, 1, 'SENDED', util.VN_NOW(), 1, NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`wagonConfig` (`id`, `width`, `height`, `maxWagonHeight`, `minHeightBetweenTrays`, `maxTrays`)
|
|
||||||
VALUES
|
|
||||||
(1, 1350, 1900, 200, 50, 6);
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`wagonTypeColor` (`id`, `name`, `rgb`)
|
INSERT INTO `vn`.`wagonTypeColor` (`id`, `name`, `rgb`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -3011,15 +3076,19 @@ INSERT INTO `vn`.`wagonTypeColor` (`id`, `name`, `rgb`)
|
||||||
(3, 'green', '#00ff00'),
|
(3, 'green', '#00ff00'),
|
||||||
(4, 'blue', '#0000ff');
|
(4, 'blue', '#0000ff');
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`wagonConfig` (`id`, `width`, `height`, `maxWagonHeight`, `minHeightBetweenTrays`, `maxTrays`, `defaultTrayColorFk`)
|
||||||
|
VALUES
|
||||||
|
(1, 1350, 1900, 200, 50, 6, 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`wagonType` (`id`, `name`, `divisible`)
|
INSERT INTO `vn`.`wagonType` (`id`, `name`, `divisible`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Wagon Type #1', 1);
|
(1, 'Wagon Type #1', 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`wagonTypeTray` (`id`, `typeFk`, `height`, `colorFk`)
|
INSERT INTO `vn`.`wagonTypeTray` (`id`, `wagonTypeFk`, `height`, `wagonTypeColorFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 100, 1),
|
(1, 1, 0, 1),
|
||||||
(2, 1, 50, 2),
|
(2, 1, 50, 2),
|
||||||
(3, 1, 0, 3);
|
(3, 1, 100, 3);
|
||||||
|
|
||||||
INSERT INTO `salix`.`accessTokenConfig` (`id`, `renewPeriod`, `courtesyTime`, `renewInterval`)
|
INSERT INTO `salix`.`accessTokenConfig` (`id`, `renewPeriod`, `courtesyTime`, `renewInterval`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -3102,6 +3171,18 @@ INSERT INTO `vn`.`entryDms`(`entryFk`, `dmsFk`, `editorFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 9, 9);
|
(1, 9, 9);
|
||||||
|
|
||||||
|
INSERT INTO vn.entryType (code,description,isInformal)
|
||||||
|
VALUES ('devaluation','Devaluation',0),
|
||||||
|
('internal','Internal',1),
|
||||||
|
('inventory','Inventory',1),
|
||||||
|
('life','Life',1),
|
||||||
|
('packaging','Packaging',0),
|
||||||
|
('payment','Refund',0),
|
||||||
|
('product','Product',0),
|
||||||
|
('regularization','Regularization',1),
|
||||||
|
('return','Return',0),
|
||||||
|
('transport','Delivery',0);
|
||||||
|
|
||||||
INSERT INTO `vn`.`cmr` (id,truckPlate,observations,senderInstruccions,paymentInstruccions,specialAgreements,companyFk,addressToFk,addressFromFk,supplierFk,packagesList,merchandiseDetail,state)
|
INSERT INTO `vn`.`cmr` (id,truckPlate,observations,senderInstruccions,paymentInstruccions,specialAgreements,companyFk,addressToFk,addressFromFk,supplierFk,packagesList,merchandiseDetail,state)
|
||||||
VALUES (1,'123456A','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',442,1,2,1,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
VALUES (1,'123456A','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',442,1,2,1,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
||||||
(2,'123456N','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',69,3,4,2,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
(2,'123456N','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',69,3,4,2,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
||||||
|
@ -3111,7 +3192,7 @@ UPDATE vn.department
|
||||||
SET workerFk = null;
|
SET workerFk = null;
|
||||||
|
|
||||||
INSERT INTO vn.packaging
|
INSERT INTO vn.packaging
|
||||||
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0);
|
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0,0,1);
|
||||||
|
|
||||||
|
|
||||||
INSERT IGNORE INTO vn.intrastat
|
INSERT IGNORE INTO vn.intrastat
|
||||||
|
@ -3194,7 +3275,6 @@ INSERT IGNORE INTO vn.itemType
|
||||||
workerFk = 103,
|
workerFk = 103,
|
||||||
isInventory = TRUE,
|
isInventory = TRUE,
|
||||||
life = 10,
|
life = 10,
|
||||||
density = 250,
|
|
||||||
itemPackingTypeFk = NULL,
|
itemPackingTypeFk = NULL,
|
||||||
temperatureFk = 'warm';
|
temperatureFk = 'warm';
|
||||||
|
|
||||||
|
@ -3705,7 +3785,8 @@ INSERT IGNORE INTO vn.saleGroup
|
||||||
SET id = 4,
|
SET id = 4,
|
||||||
userFk = 1,
|
userFk = 1,
|
||||||
parkingFk = 9,
|
parkingFk = 9,
|
||||||
sectorFk = 9992;
|
sectorFk = 9992,
|
||||||
|
ticketFk = 36;
|
||||||
|
|
||||||
INSERT IGNORE INTO vn.sectorCollectionSaleGroup
|
INSERT IGNORE INTO vn.sectorCollectionSaleGroup
|
||||||
SET id = 9999,
|
SET id = 9999,
|
||||||
|
@ -3788,7 +3869,145 @@ INSERT INTO vn.workerTeam(id, team, workerFk)
|
||||||
VALUES
|
VALUES
|
||||||
(8, 1, 19);
|
(8, 1, 19);
|
||||||
|
|
||||||
INSERT INTO vn.workCenter (id, name, payrollCenterFk, counter, warehouseFk, street, geoFk, deliveryManAdjustment)
|
INSERT INTO vn.workCenter (id, name, payrollCenterFk, counter, warehouseFk, street, geoFk, deliveryManAdjustment)
|
||||||
VALUES(100, 'workCenterOne', 1, NULL, 1, 'gotham', NULL, NULL);
|
VALUES(100, 'workCenterOne', 1, NULL, 1, 'gotham', NULL, NULL);
|
||||||
|
|
||||||
UPDATE vn.locker SET workerFk = 1110 WHERE id = 147;
|
INSERT INTO `vn`.`locker` (code, gender, workerFk) VALUES
|
||||||
|
('1M', 'M', 1),
|
||||||
|
('2M', 'M', 9),
|
||||||
|
('3M', 'M', NULL),
|
||||||
|
('4M', 'M', NULL),
|
||||||
|
('1F', 'F', 1110),
|
||||||
|
('2F', 'F', NULL),
|
||||||
|
('3F', 'F', NULL),
|
||||||
|
('4F', 'F', NULL);
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`ledgerCompany` SET
|
||||||
|
fiscalYear = YEAR(util.VN_CURDATE()),
|
||||||
|
bookEntry = 2;
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`ledgerConfig` SET
|
||||||
|
maxTolerance = 0.01;
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO vn.trainingCourse (workerFk,trainingCourseTypeFk,centerFk,started,ended,hasDiscount,hasDiploma)
|
||||||
|
VALUES
|
||||||
|
(9,2,1,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',0,1),
|
||||||
|
(9,1,2,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',1,0),
|
||||||
|
(9,2,2,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',1,1);
|
||||||
|
|
||||||
|
INSERT INTO vn.sectorCollection
|
||||||
|
SET id = 2,
|
||||||
|
userFk = 18,
|
||||||
|
sectorFk = 1;
|
||||||
|
|
||||||
|
INSERT INTO vn.sectorCollectionSaleGroup
|
||||||
|
SET id = 8,
|
||||||
|
sectorCollectionFk = 2,
|
||||||
|
saleGroupFk = 4;
|
||||||
|
|
||||||
|
INSERT INTO vn.saleGroup (userFk, parkingFk, sectorFk, ticketFk)
|
||||||
|
VALUES
|
||||||
|
(1, 1, 1, 37);
|
||||||
|
|
||||||
|
INSERT INTO vn.sectorCollection
|
||||||
|
SET id = 3,
|
||||||
|
userFk = 18,
|
||||||
|
sectorFk = 1;
|
||||||
|
|
||||||
|
INSERT INTO vn.sectorCollectionSaleGroup
|
||||||
|
SET id = 9,
|
||||||
|
sectorCollectionFk = 3,
|
||||||
|
saleGroupFk = 6;
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`calendarHolidays` (calendarHolidaysTypeFk, dated, calendarHolidaysNameFk, workCenterFk)
|
||||||
|
VALUES
|
||||||
|
(1, '2001-05-08', 1, 1),
|
||||||
|
(1, '2001-05-09', 1, 1),
|
||||||
|
(1, '2001-05-10', 1, 1),
|
||||||
|
(1, '2001-05-11', 1, 1),
|
||||||
|
(1, '2001-05-14', 1, 5),
|
||||||
|
(1, '2001-05-15', 1, 5),
|
||||||
|
(1, '2001-05-16', 1, 5),
|
||||||
|
(1, '2001-05-17', 1, 5),
|
||||||
|
(1, '2001-05-18', 1, 5);
|
||||||
|
|
||||||
|
INSERT INTO vn.medicalReview
|
||||||
|
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
|
||||||
|
VALUES(1, 1106, 1, '2000-01-01', '08:10', 1, 200.0, NULL, '');
|
||||||
|
INSERT INTO vn.medicalReview
|
||||||
|
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
|
||||||
|
VALUES(2, 1106, 2, '2001-01-01', '09:10', 0, 10.0, NULL, NULL);
|
||||||
|
INSERT INTO vn.medicalReview
|
||||||
|
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
|
||||||
|
VALUES(3, 9, 2, '2000-01-01', '8:00', 1, 150.0, NULL, NULL);
|
||||||
|
|
||||||
|
INSERT INTO vn.stockBought (workerFk, bought, reserve, dated)
|
||||||
|
VALUES(35, 1.00, 1.00, '2001-01-01');
|
||||||
|
INSERT INTO vn.auctionConfig (id,conversionCoefficient,warehouseFk)
|
||||||
|
VALUES (1,0.6,6);
|
||||||
|
|
||||||
|
INSERT INTO vn.payrollComponent
|
||||||
|
(id, name, isSalaryAgreed, isVariable, isException)
|
||||||
|
VALUES
|
||||||
|
(1, 'Salario1', 1, 0, 0),
|
||||||
|
(2, 'Salario2', 1, 1, 0),
|
||||||
|
(3, 'Salario3', 1, 0, 1);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO vn.workerIncome
|
||||||
|
(debit, credit, incomeTypeFk, paymentDate, workerFk, concept)
|
||||||
|
VALUES
|
||||||
|
(1000.00, 900.00, 2, '2000-01-01', 1106, NULL),
|
||||||
|
(1001.00, 800.00, 2, '2000-01-01', 1106, NULL);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO dipole.printer (id, description)
|
||||||
|
VALUES(1, '');
|
||||||
|
|
||||||
|
INSERT INTO dipole.expedition_PrintOut (expeditionFk, ticketFk, addressFk, street, postalCode, city, shopName, isPrinted, created, printerFk, routeFk, parkingCode,
|
||||||
|
truckName, clientFk, phone, province, agency, m3, workerCode, itemFk, quantity, longName, shelvingFk, comments)
|
||||||
|
VALUES(1, 1, 0, ' ', ' ', ' ', ' ', 0, '2001-01-01 00:00:00', 1, 0, ' ', ' ', 0, NULL, '', NULL, 0.000, NULL, 10, NULL, NULL, 'NCC', NULL);
|
||||||
|
|
||||||
|
INSERT INTO vn.accountDetail
|
||||||
|
(id, value, accountDetailTypeFk, supplierAccountFk)
|
||||||
|
VALUES
|
||||||
|
(21, 'ES12345B12345678', 3, 241),
|
||||||
|
(35, 'ES12346B12345679', 3, 241);
|
||||||
|
|
||||||
|
INSERT INTO vn.accountDetailType
|
||||||
|
(id, description, code)
|
||||||
|
VALUES
|
||||||
|
(1, 'IBAN', 'iban'),
|
||||||
|
(2, 'SWIFT', 'swift'),
|
||||||
|
(3, 'Referencia Remesas', 'remRef'),
|
||||||
|
(4, 'Referencia Transferencias', 'trnRef'),
|
||||||
|
(5, 'Referencia Nominas', 'payRef'),
|
||||||
|
(6, 'ABA', 'aba');
|
||||||
|
|
||||||
|
INSERT IGNORE INTO ormConfig
|
||||||
|
SET id =1,
|
||||||
|
selectLimit = 1000;
|
||||||
|
|
||||||
|
INSERT INTO pbx.queueMultiConfig
|
||||||
|
SET id = 'ring',
|
||||||
|
strategy = 20,
|
||||||
|
timeout = 2,
|
||||||
|
retry = 0,
|
||||||
|
weight = 0,
|
||||||
|
maxLen = 0,
|
||||||
|
ringInUse = 0;
|
||||||
|
|
||||||
|
INSERT INTO pbx.queue (description, name, config)
|
||||||
|
VALUES ('X-men', '1000', 1),
|
||||||
|
('Avengers', '2000', 1);
|
||||||
|
|
||||||
|
INSERT IGNORE INTO pbx.queueMember
|
||||||
|
SET queue = '1000',
|
||||||
|
extension = '1010';
|
||||||
|
|
||||||
|
UPDATE vn.department SET pbxQueue = '1000' WHERE name = "CAMARA";
|
||||||
|
UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_afterDelete`
|
||||||
|
AFTER DELETE ON `mailAliasAccount`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO userLog
|
||||||
|
SET `action` = 'delete',
|
||||||
|
`changedModel` = 'MailAliasAccount',
|
||||||
|
`changedModelId` = OLD.id,
|
||||||
|
`userFk` = account.myUser_getId();
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeInsert`
|
||||||
|
BEFORE INSERT ON `mailAliasAccount`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `mailAliasAccount`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -1,166 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`claim_ratio_routine`()
|
|
||||||
BEGIN
|
|
||||||
DECLARE vMonthToRefund INT DEFAULT 4;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PAK 2015-11-20
|
|
||||||
* Se trata de añadir a la tabla Greuges todos los
|
|
||||||
* cargos que luego vamos a utilizar para calcular el recobro
|
|
||||||
*/
|
|
||||||
|
|
||||||
-- Reclamaciones demasiado sensibles
|
|
||||||
|
|
||||||
INSERT INTO vn.greuge(shipped, clientFk, description,
|
|
||||||
amount, greugeTypeFk, ticketFk)
|
|
||||||
SELECT c.ticketCreated
|
|
||||||
, c.clientFk
|
|
||||||
, concat('Claim ', c.id,' : ', s.concept)
|
|
||||||
,round( -1 * ((c.responsibility -1)/4) * s.quantity *
|
|
||||||
s.price * (100 - s.discount) / 100, 2)
|
|
||||||
, 4
|
|
||||||
, s.ticketFk
|
|
||||||
FROM vn.sale s
|
|
||||||
JOIN vn.claimEnd ce ON ce.saleFk = s.id
|
|
||||||
JOIN vn.claim c ON c.id = ce.claimFk
|
|
||||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
|
||||||
AND NOT ce.isGreuge
|
|
||||||
AND c.claimStateFk = 3;
|
|
||||||
|
|
||||||
-- Reclamaciones que pasan a Maná
|
|
||||||
|
|
||||||
INSERT INTO vn.greuge(shipped, clientFk, description,
|
|
||||||
amount, greugeTypeFk, ticketFk)
|
|
||||||
SELECT c.ticketCreated
|
|
||||||
, c.clientFk
|
|
||||||
, concat('Claim_mana ',c.id,' : ', s.concept)
|
|
||||||
,round( ((c.responsibility -1)/4) * s.quantity * s.price * (100 - s.discount) / 100, 2)
|
|
||||||
,3
|
|
||||||
,s.ticketFk
|
|
||||||
FROM vn.sale s
|
|
||||||
JOIN vn.claimEnd ce ON ce.saleFk = s.id
|
|
||||||
JOIN vn.claim c ON c.id = ce.claimFk
|
|
||||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
|
||||||
AND NOT ce.isGreuge
|
|
||||||
AND c.claimStateFk = 3
|
|
||||||
AND c.isChargedToMana;
|
|
||||||
|
|
||||||
-- Marcamos para no repetir
|
|
||||||
UPDATE vn.claimEnd ce
|
|
||||||
JOIN vn.claim c ON c.id = ce.claimFk
|
|
||||||
SET c.isChargedToMana = TRUE
|
|
||||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
|
||||||
AND NOT ce.isGreuge
|
|
||||||
AND c.claimStateFk = 3;
|
|
||||||
|
|
||||||
-- Recobros
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list;
|
|
||||||
CREATE TEMPORARY TABLE tmp.ticket_list
|
|
||||||
(PRIMARY KEY (Id_Ticket))
|
|
||||||
SELECT DISTINCT t.id Id_Ticket
|
|
||||||
FROM vn.saleComponent sc
|
|
||||||
JOIN vn.sale s ON sc.saleFk = s.id
|
|
||||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
|
||||||
JOIN vn.ticketLastState ts ON ts.ticketFk = t.id
|
|
||||||
JOIN vn.ticketTracking tt ON tt.id = ts.ticketTrackingFk
|
|
||||||
JOIN vn.state st ON st.id = tt.stateFk
|
|
||||||
WHERE sc.componentFk = 17
|
|
||||||
AND sc.isGreuge = 0
|
|
||||||
AND t.shipped >= '2016-10-01'
|
|
||||||
AND t.shipped < util.VN_CURDATE()
|
|
||||||
AND st.alertLevel >= 3;
|
|
||||||
|
|
||||||
DELETE g.*
|
|
||||||
FROM vn.greuge g
|
|
||||||
JOIN tmp.ticket_list t ON g.ticketFk = t.Id_Ticket
|
|
||||||
WHERE g.greugeTypeFk = 2;
|
|
||||||
|
|
||||||
INSERT INTO vn.greuge(clientFk, description, amount,shipped,
|
|
||||||
greugeTypeFk, ticketFk)
|
|
||||||
SELECT t.clientFk
|
|
||||||
,concat('recobro ', s.ticketFk), - round(SUM(sc.value*s.quantity),2)
|
|
||||||
AS dif,
|
|
||||||
date(t.shipped)
|
|
||||||
, 2
|
|
||||||
,tt.Id_Ticket
|
|
||||||
FROM vn.sale s
|
|
||||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
|
||||||
JOIN tmp.ticket_list tt ON tt.Id_Ticket = t.id
|
|
||||||
JOIN vn.saleComponent sc
|
|
||||||
ON sc.saleFk = s.id AND sc.componentFk = 17
|
|
||||||
GROUP BY t.id
|
|
||||||
HAVING ABS(dif) > 1;
|
|
||||||
|
|
||||||
UPDATE vn.saleComponent sc
|
|
||||||
JOIN vn.sale s ON s.id = sc.saleFk
|
|
||||||
JOIN tmp.ticket_list tt ON tt.Id_Ticket = s.ticketFk
|
|
||||||
SET sc.isGreuge = 1
|
|
||||||
WHERE sc.componentFk = 17;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Recalculamos la ratio de las reclamaciones, que luego
|
|
||||||
* se va a utilizar en el recobro
|
|
||||||
*/
|
|
||||||
|
|
||||||
REPLACE bi.claims_ratio(Id_Cliente, Consumo, Reclamaciones, Ratio, recobro)
|
|
||||||
SELECT id, 0,0,0,0
|
|
||||||
FROM vn.client;
|
|
||||||
|
|
||||||
REPLACE bi.claims_ratio(Id_Cliente, Consumo, Reclamaciones, Ratio, recobro)
|
|
||||||
SELECT fm.Id_Cliente, 12 * fm.Consumo, Reclamaciones,
|
|
||||||
round(Reclamaciones / (12*fm.Consumo),4), 0
|
|
||||||
FROM bi.facturacion_media_anual fm
|
|
||||||
LEFT JOIN(
|
|
||||||
SELECT c.clientFk, round(sum(-1 * ((c.responsibility -1)/4) *
|
|
||||||
s.quantity * s.price * (100 - s.discount) / 100))
|
|
||||||
AS Reclamaciones
|
|
||||||
FROM vn.sale s
|
|
||||||
JOIN vn.claimEnd ce ON ce.saleFk = s.id
|
|
||||||
JOIN vn.claim c ON c.id = ce.claimFk
|
|
||||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
|
||||||
AND c.claimStateFk = 3
|
|
||||||
AND c.ticketCreated >= TIMESTAMPADD(YEAR, -1, util.VN_CURDATE())
|
|
||||||
GROUP BY c.clientFk
|
|
||||||
) claims ON claims.clientFk = fm.Id_Cliente;
|
|
||||||
|
|
||||||
|
|
||||||
-- Calculamos el porcentaje del recobro para añadirlo al precio de venta
|
|
||||||
UPDATE bi.claims_ratio cr
|
|
||||||
JOIN (
|
|
||||||
SELECT clientFk Id_Cliente, IFNULL(SUM(amount), 0) AS Greuge
|
|
||||||
FROM vn.greuge
|
|
||||||
WHERE shipped <= util.VN_CURDATE()
|
|
||||||
GROUP BY clientFk
|
|
||||||
) g ON g.Id_Cliente = cr.Id_Cliente
|
|
||||||
SET recobro = GREATEST(0,round(IFNULL(Greuge, 0) /
|
|
||||||
(IFNULL(Consumo, 0) * vMonthToRefund / 12 ) ,3));
|
|
||||||
|
|
||||||
-- Protección neonatos
|
|
||||||
UPDATE bi.claims_ratio cr
|
|
||||||
JOIN vn.firstTicketShipped fts ON fts.clientFk = cr.Id_Cliente
|
|
||||||
SET recobro = 0, Ratio = 0
|
|
||||||
WHERE fts.shipped > TIMESTAMPADD(MONTH,-1,util.VN_CURDATE());
|
|
||||||
|
|
||||||
-- CLIENTE 7983, JULIAN SUAU
|
|
||||||
UPDATE bi.claims_ratio SET recobro = LEAST(0.05, recobro) WHERE Id_Cliente = 7983;
|
|
||||||
|
|
||||||
-- CLIENTE 4358
|
|
||||||
UPDATE bi.claims_ratio SET recobro = GREATEST(0.05, recobro) WHERE Id_Cliente = 4358;
|
|
||||||
|
|
||||||
-- CLIENTE 5523, VERDECORA
|
|
||||||
UPDATE bi.claims_ratio SET recobro = GREATEST(0.12, recobro) WHERE Id_Cliente = 5523;
|
|
||||||
|
|
||||||
-- CLIENTE 15979, SERVEIS VETERINARIS
|
|
||||||
UPDATE bi.claims_ratio SET recobro = GREATEST(0.05, recobro) WHERE Id_Cliente = 15979;
|
|
||||||
|
|
||||||
-- CLIENTE 5189 i 8942, son de CSR i son el mateix client
|
|
||||||
UPDATE bi.claims_ratio cr
|
|
||||||
JOIN (SELECT sum(Consumo * recobro)/sum(Consumo) as recobro
|
|
||||||
FROM bi.claims_ratio
|
|
||||||
WHERE Id_Cliente IN ( 5189,8942)
|
|
||||||
) sub
|
|
||||||
SET cr.recobro = sub.recobro
|
|
||||||
WHERE Id_Cliente IN ( 5189,8942);
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,5 +1,5 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`clean`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`clean`()
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE vDateShort DATETIME;
|
DECLARE vDateShort DATETIME;
|
||||||
DECLARE vDateLong DATETIME;
|
DECLARE vDateLong DATETIME;
|
||||||
|
@ -15,5 +15,5 @@ BEGIN
|
||||||
|
|
||||||
DELETE FROM bi.defaulters WHERE `date` < vDateLong;
|
DELETE FROM bi.defaulters WHERE `date` < vDateLong;
|
||||||
DELETE FROM bi.defaulting WHERE `date` < vDateLong;
|
DELETE FROM bi.defaulting WHERE `date` < vDateLong;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`facturacion_media_anual_update`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`facturacion_media_anual_update`()
|
||||||
BEGIN
|
BEGIN
|
||||||
TRUNCATE TABLE bs.clientAnnualConsumption;
|
TRUNCATE TABLE bs.clientAnnualConsumption;
|
||||||
|
|
||||||
|
@ -12,5 +12,5 @@ BEGIN
|
||||||
GROUP BY clientFk, year, month
|
GROUP BY clientFk, year, month
|
||||||
) vol
|
) vol
|
||||||
GROUP BY clientFk;
|
GROUP BY clientFk;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -59,7 +59,7 @@ BEGIN
|
||||||
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
||||||
JOIN vn.component c ON c.id = sc.componentFk
|
JOIN vn.component c ON c.id = sc.componentFk
|
||||||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||||
WHERE ct.code = 'FREIGHT'
|
WHERE ct.code = 'freight'
|
||||||
AND r.created BETWEEN vDatedFrom AND vDatedTo
|
AND r.created BETWEEN vDatedFrom AND vDatedTo
|
||||||
GROUP BY r.id
|
GROUP BY r.id
|
||||||
) sub ON sub.routeFk = r.Id_Ruta
|
) sub ON sub.routeFk = r.Id_Ruta
|
||||||
|
|
|
@ -2,7 +2,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
SQL SECURITY DEFINER
|
SQL SECURITY DEFINER
|
||||||
VIEW `bi`.`tarifa_componentes_series`
|
VIEW `bi`.`tarifa_componentes_series`
|
||||||
AS SELECT `ct`.`id` AS `tarifa_componentes_series_id`,
|
AS SELECT `ct`.`id` AS `tarifa_componentes_series_id`,
|
||||||
`ct`.`type` AS `Serie`,
|
`ct`.`name` AS `Serie`,
|
||||||
`ct`.`isBase` AS `base`,
|
`ct`.`isBase` AS `base`,
|
||||||
`ct`.`isMargin` AS `margen`
|
`ct`.`isMargin` AS `margen`
|
||||||
FROM `vn`.`componentType` `ct`
|
FROM `vn`.`componentType` `ct`
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`carteras_add`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`carteras_add`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Inserta en la tabla @bs.carteras las ventas desde el año pasado
|
* Inserta en la tabla @bs.carteras las ventas desde el año pasado
|
||||||
|
@ -23,5 +23,5 @@ BEGIN
|
||||||
GROUP BY w.code, t.`year`, t.`month`;
|
GROUP BY w.code, t.`year`, t.`month`;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.time;
|
DROP TEMPORARY TABLE tmp.time;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`nightTask_launchAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`nightTask_launchAll`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Runs all nightly tasks.
|
* Runs all nightly tasks.
|
||||||
|
@ -76,5 +76,5 @@ BEGIN
|
||||||
END IF;
|
END IF;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
CLOSE vQueue;
|
CLOSE vQueue;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`salesByItemTypeDay_addLauncher`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`salesByItemTypeDay_addLauncher`()
|
||||||
BEGIN
|
BEGIN
|
||||||
CALL bs.salesByItemTypeDay_add(util.VN_CURDATE() - INTERVAL 30 DAY, util.VN_CURDATE());
|
CALL bs.salesByItemTypeDay_add(util.VN_CURDATE() - INTERVAL 30 DAY, util.VN_CURDATE());
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,31 +1,75 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`waste_addSales`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`waste_addSales`(
|
||||||
|
vDateFrom DATE,
|
||||||
|
vDateTo DATE
|
||||||
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE vWeek INT;
|
/**
|
||||||
DECLARE vYear INT;
|
* Recalcula las mermas de un periodo.
|
||||||
|
*
|
||||||
|
* @param vDateFrom Fecha desde
|
||||||
|
* @param vDateTo Fecha hasta
|
||||||
|
*/
|
||||||
|
IF vDateFrom IS NULL THEN
|
||||||
|
SET vDateFrom = util.VN_CURDATE() - INTERVAL WEEKDAY(util.VN_CURDATE()) DAY;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF vDateTo IS NULL THEN
|
||||||
|
SET vDateTo = vDateFrom + INTERVAL 6 DAY;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
CALL cache.last_buy_refresh(FALSE);
|
||||||
|
|
||||||
SELECT week, year
|
|
||||||
INTO vWeek, vYear
|
|
||||||
FROM vn.time
|
|
||||||
WHERE dated = util.VN_CURDATE();
|
|
||||||
|
|
||||||
REPLACE bs.waste
|
REPLACE bs.waste
|
||||||
SELECT *, 100 * mermas / total as porcentaje
|
SELECT YEAR(t.shipped),
|
||||||
FROM (
|
WEEK(t.shipped, 4),
|
||||||
SELECT buyer,
|
it.workerFk,
|
||||||
year,
|
it.id,
|
||||||
week,
|
s.itemFk,
|
||||||
family,
|
SUM((b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity),
|
||||||
itemFk,
|
SUM(IF(aw.`type`, s.quantity, 0)),
|
||||||
itemTypeFk,
|
SUM(IF(
|
||||||
floor(sum(value)) as total,
|
aw.`type` = 'external',
|
||||||
floor(sum(IF(typeFk = 'loses', value, 0))) as mermas
|
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
|
||||||
FROM vn.saleValue
|
0
|
||||||
where year = vYear and week = vWeek
|
)
|
||||||
|
),
|
||||||
GROUP BY family, itemFk
|
SUM(IF(
|
||||||
|
aw.`type` = 'fault',
|
||||||
) sub
|
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
|
||||||
ORDER BY mermas DESC;
|
0
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SUM(IF(
|
||||||
|
aw.`type` = 'container',
|
||||||
|
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SUM(IF(
|
||||||
|
aw.`type` = 'break',
|
||||||
|
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SUM(IF(
|
||||||
|
aw.`type` = 'other',
|
||||||
|
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
FROM vn.sale s
|
||||||
|
JOIN vn.item i ON i.id = s.itemFk
|
||||||
|
JOIN vn.itemType it ON it.id = i.typeFk
|
||||||
|
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||||
|
JOIN vn.address a FORCE INDEX (PRIMARY) ON a.id = t.addressFk
|
||||||
|
LEFT JOIN vn.addressWaste aw ON aw.addressFk = a.id
|
||||||
|
JOIN vn.warehouse w ON w.id = t.warehouseFk
|
||||||
|
JOIN cache.last_buy lb ON lb.item_id = i.id
|
||||||
|
AND lb.warehouse_id = w.id
|
||||||
|
JOIN vn.buy b ON b.id = lb.buy_id
|
||||||
|
WHERE t.shipped BETWEEN vDateFrom AND vDateTo
|
||||||
|
AND w.isManaged
|
||||||
|
GROUP BY YEAR(t.shipped), WEEK(t.shipped, 4), i.id;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`waste_addSalesLauncher`()
|
||||||
|
BEGIN
|
||||||
|
CALL waste_addSales(NULL, NULL);
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -117,7 +117,7 @@ proc: BEGIN
|
||||||
)sub
|
)sub
|
||||||
GROUP BY sub.itemFk;
|
GROUP BY sub.itemFk;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.itemCalc, tItemRange;
|
DROP TEMPORARY TABLE tmp.itemCalc, tItemRange, tmp.itemList;
|
||||||
CALL cache_calc_end (vCalc);
|
CALL cache_calc_end (vCalc);
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`available_refresh`(OUT `vCalc` INT, IN `vRefresh` INT, IN `vWarehouse` INT, IN `vDated` DATE)
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`available_refresh`(
|
||||||
|
OUT `vCalc` INT,
|
||||||
|
`vRefresh` INT,
|
||||||
|
`vWarehouse` INT,
|
||||||
|
`vDated` DATE
|
||||||
|
)
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
DECLARE vStartDate DATE;
|
DECLARE vStartDate DATE;
|
||||||
DECLARE vReserveDate DATETIME;
|
DECLARE vReserveDate DATETIME;
|
||||||
|
@ -121,7 +126,7 @@ proc: BEGIN
|
||||||
)sub
|
)sub
|
||||||
GROUP BY sub.itemFk;
|
GROUP BY sub.itemFk;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.itemCalc, itemRange;
|
DROP TEMPORARY TABLE tmp.itemCalc, itemRange, tmp.itemList;
|
||||||
CALL cache_calc_end (vCalc);
|
CALL cache_calc_end (vCalc);
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`available_updateItem`(
|
||||||
|
`vItem` INT,
|
||||||
|
`vWarehouse` INT,
|
||||||
|
`vDated` DATE,
|
||||||
|
`vQuantity` INT
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Immediately deduct/add an amount from the available cache (if exists).
|
||||||
|
*
|
||||||
|
* @param vItem The item id
|
||||||
|
* @param vWarehouse The warehouse id
|
||||||
|
* @param vDated Available cache date
|
||||||
|
* @param vQuantity The amount to be deducted from the cache
|
||||||
|
*/
|
||||||
|
DECLARE vCalc INT;
|
||||||
|
|
||||||
|
SELECT id INTO vCalc
|
||||||
|
FROM cache_calc
|
||||||
|
WHERE cacheName = 'available'
|
||||||
|
AND params = CONCAT_WS('/', vWarehouse, vDated);
|
||||||
|
|
||||||
|
IF vCalc IS NOT NULL THEN
|
||||||
|
UPDATE available
|
||||||
|
SET available = available - vQuantity
|
||||||
|
WHERE calc_id = vCalc
|
||||||
|
AND item_id = vItem;
|
||||||
|
END IF;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -1,5 +1,5 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`cache_calc_end`(IN `v_calc` INT)
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`cache_calc_end`(IN `v_calc` INT)
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE v_cache_name VARCHAR(255);
|
DECLARE v_cache_name VARCHAR(255);
|
||||||
DECLARE v_params VARCHAR(255);
|
DECLARE v_params VARCHAR(255);
|
||||||
|
@ -21,5 +21,5 @@ BEGIN
|
||||||
IF v_cache_name IS NOT NULL THEN
|
IF v_cache_name IS NOT NULL THEN
|
||||||
DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, '')));
|
DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, '')));
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`cache_calc_start`(OUT `v_calc` INT, INOUT `v_refresh` INT, IN `v_cache_name` VARCHAR(50), IN `v_params` VARCHAR(100))
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`cache_calc_start`(OUT `v_calc` INT, INOUT `v_refresh` INT, IN `v_cache_name` VARCHAR(50), IN `v_params` VARCHAR(100))
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
DECLARE v_valid BOOL;
|
DECLARE v_valid BOOL;
|
||||||
DECLARE v_lock_id VARCHAR(100);
|
DECLARE v_lock_id VARCHAR(100);
|
||||||
|
@ -83,5 +83,5 @@ proc: BEGIN
|
||||||
-- Si se debe recalcular mantiene el bloqueo y devuelve su identificador.
|
-- Si se debe recalcular mantiene el bloqueo y devuelve su identificador.
|
||||||
|
|
||||||
SET v_refresh = TRUE;
|
SET v_refresh = TRUE;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -4,7 +4,7 @@ proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Crea o actualiza la cache con la última compra y fecha de cada
|
* Crea o actualiza la cache con la última compra y fecha de cada
|
||||||
* artículo hasta ayer. Para obtener la última compra hasta una fecha
|
* artículo hasta ayer. Para obtener la última compra hasta una fecha
|
||||||
* determinada utilizar el procedimiento vn.buyUltimate().
|
* determinada utilizar el procedimiento vn.buy_getUltimate().
|
||||||
*
|
*
|
||||||
* @param vRefresh %TRUE para forzar el recálculo de la cache
|
* @param vRefresh %TRUE para forzar el recálculo de la cache
|
||||||
*/
|
*/
|
||||||
|
@ -30,7 +30,7 @@ proc: BEGIN
|
||||||
SELECT inventoried INTO started FROM vn.config LIMIT 1;
|
SELECT inventoried INTO started FROM vn.config LIMIT 1;
|
||||||
SET ended = util.VN_CURDATE(); -- TIMESTAMPADD(DAY, -1, util.VN_CURDATE());
|
SET ended = util.VN_CURDATE(); -- TIMESTAMPADD(DAY, -1, util.VN_CURDATE());
|
||||||
|
|
||||||
CALL vn.buyUltimateFromInterval(NULL, started, ended);
|
CALL vn.buy_getUltimateFromInterval(NULL, NULL, started, ended);
|
||||||
|
|
||||||
DELETE FROM last_buy;
|
DELETE FROM last_buy;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`visible_refresh`(OUT v_calc INT, v_refresh BOOL, v_warehouse INT)
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`visible_refresh`(OUT v_calc INT, v_refresh BOOL, v_warehouse INT)
|
||||||
proc: BEGIN
|
proc:BEGIN
|
||||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||||
BEGIN
|
BEGIN
|
||||||
CALL cache_calc_unlock (v_calc);
|
CALL cache_calc_unlock (v_calc);
|
||||||
RESIGNAL;
|
RESIGNAL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
CALL cache_calc_start (v_calc, v_refresh, 'visible', v_warehouse);
|
CALL cache_calc_start (v_calc, v_refresh, 'visible', v_warehouse);
|
||||||
|
|
||||||
IF !v_refresh THEN
|
IF !v_refresh THEN
|
||||||
LEAVE proc;
|
LEAVE proc;
|
||||||
|
@ -15,22 +15,26 @@ proc: BEGIN
|
||||||
|
|
||||||
-- Calculamos el stock hasta ayer
|
-- Calculamos el stock hasta ayer
|
||||||
|
|
||||||
CALL `cache`.stock_refresh(false);
|
CALL cache.stock_refresh(false);
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.itemVisible
|
CREATE OR REPLACE TEMPORARY TABLE tmp.itemVisible
|
||||||
(PRIMARY KEY (item_id))
|
(PRIMARY KEY (item_id))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT item_id, amount stock, amount visible FROM `cache`.stock
|
SELECT s.item_id, SUM(s.amount) stock, SUM(s.amount) visible
|
||||||
WHERE warehouse_id = v_warehouse;
|
FROM stock s
|
||||||
|
JOIN vn.warehouse w ON w.id = s.warehouse_id
|
||||||
|
WHERE (v_warehouse IS NULL OR s.warehouse_id = v_warehouse)
|
||||||
|
AND w.isComparative
|
||||||
|
GROUP BY s.item_id;
|
||||||
|
|
||||||
-- Calculamos los movimientos confirmados de hoy
|
-- Calculamos los movimientos confirmados de hoy
|
||||||
CALL vn.item_GetVisible(v_warehouse, NULL);
|
CALL vn.item_calcVisible(NULL, v_warehouse);
|
||||||
DELETE FROM visible WHERE calc_id = v_calc;
|
DELETE FROM visible WHERE calc_id = v_calc;
|
||||||
|
|
||||||
INSERT INTO visible (calc_id, item_id,visible)
|
INSERT INTO visible (calc_id, item_id,visible)
|
||||||
SELECT v_calc, item_id, visible FROM tmp.itemVisible;
|
SELECT v_calc, item_id, visible FROM tmp.itemVisible;
|
||||||
|
|
||||||
CALL cache_calc_end (v_calc);
|
CALL cache_calc_end (v_calc);
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.itemVisible;
|
DROP TEMPORARY TABLE tmp.itemVisible;
|
||||||
END$$
|
END$$
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue