diff --git a/back/methods/vn-user/renew-token.js b/back/methods/vn-user/renew-token.js index ae2d36e3e..688e9a770 100644 --- a/back/methods/vn-user/renew-token.js +++ b/back/methods/vn-user/renew-token.js @@ -29,18 +29,8 @@ module.exports = Self => { return token; // Schedule to remove current token - setTimeout(async() => { - let exists; - try { - exists = await models.AccessToken.findById(token.id); - exists && await Self.logout(token.id); - } catch (error) { - // eslint-disable-next-line no-console - console.error(error); - const body = {error: error.message, now: Date.now(), userId: token?.userId ?? null, exists}; - await handleError(body); - throw new Error(error); - } + setTimeout(() => { + Self.logout(token.id); }, courtesyTime * 1000); // Get scopes @@ -53,14 +43,20 @@ module.exports = Self => { return {id: accessToken.id, ttl: accessToken.ttl}; } catch (error) { - const body = {error: error.message, now: Date.now(), userId: token?.userId ?? null, createTokenOptions, isNotExceeded}; - await handleError(body); + 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, tag = 'renewToken') { - body = JSON.stringify(body); - await models.Application.rawSql('CALL util.debugAdd(?,?);', [tag, body]); +async function handleError(body) { + await models.Application.rawSql('CALL util.debugAdd(?,?);', ['renewToken', body]); } diff --git a/db/dump/.dump/data.sql b/db/dump/.dump/data.sql index f6bc84db7..37e7835fc 100644 --- a/db/dump/.dump/data.sql +++ b/db/dump/.dump/data.sql @@ -3,7 +3,7 @@ USE `util`; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -INSERT INTO `version` VALUES ('vn-database','11161','36dee872d62ba2421c05503f374f6b208c40ecfa','2024-08-06 07:53:56','11180'); +INSERT INTO `version` VALUES ('vn-database','11180','2a5588f013dbb6370e15754e03a6d9f1d74188e2','2024-08-20 08:34:44','11191'); INSERT INTO `versionLog` VALUES ('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL); @@ -910,9 +910,15 @@ INSERT INTO `versionLog` VALUES ('vn-database','11159','00-firstScript.sql','jen INSERT INTO `versionLog` VALUES ('vn-database','11160','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-07-18 13:46:16',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','11161','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-08-06 07:53:54',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','11164','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-07-23 11:03:16',NULL,NULL); +INSERT INTO `versionLog` VALUES ('vn-database','11165','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-08-20 08:34:43',NULL,NULL); +INSERT INTO `versionLog` VALUES ('vn-database','11166','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-08-20 08:34:43',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','11168','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-25 08:58:34',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','11169','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-25 12:38:13',NULL,NULL); +INSERT INTO `versionLog` VALUES ('vn-database','11170','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-08-09 07:12:38',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','11177','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-07-30 12:42:28',NULL,NULL); +INSERT INTO `versionLog` VALUES ('vn-database','11179','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-08-20 08:34:43',NULL,NULL); +INSERT INTO `versionLog` VALUES ('vn-database','11180','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-08-20 08:34:43',NULL,NULL); +INSERT INTO `versionLog` VALUES ('vn-database','11182','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-08-09 08:19:36',NULL,NULL); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1283,6 +1289,7 @@ INSERT INTO `roleInherit` VALUES (371,36,35,NULL); INSERT INTO `roleInherit` VALUES (372,126,13,19295); INSERT INTO `roleInherit` VALUES (373,131,2,19295); INSERT INTO `roleInherit` VALUES (375,120,131,1437); +INSERT INTO `roleInherit` VALUES (376,124,21,19336); INSERT INTO `userPassword` VALUES (1,7,1,0,2,1); @@ -1299,770 +1306,770 @@ USE `salix`; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (5,'AgencyService','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (9,'ClientObservation','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (13,'Employee','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (14,'PayMethod','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (16,'FakeProduction','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (20,'TicketState','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (24,'Delivery','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (25,'Zone','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (26,'ClientCredit','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (30,'GreugeType','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (31,'Mandate','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (32,'MandateType','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (33,'Company','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (34,'Greuge','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (35,'AddressObservation','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (36,'ObservationType','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (37,'Greuge','*','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (38,'AgencyMode','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'); -INSERT INTO `ACL` VALUES (44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'); -INSERT INTO `ACL` VALUES (51,'ItemTag','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (53,'Item','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (54,'Item','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (55,'Recovery','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (58,'CreditClassification','*','*','ALLOW','ROLE','insurance'); -INSERT INTO `ACL` VALUES (60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'); -INSERT INTO `ACL` VALUES (61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (63,'TicketObservation','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (65,'Sale','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (66,'TicketTracking','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (68,'TicketPackaging','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (69,'Packaging','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'); -INSERT INTO `ACL` VALUES (72,'SaleComponent','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (73,'Expedition','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (75,'Expedition','*','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (77,'WorkerMana','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (79,'Ticket','state','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (80,'Sale','deleteSales','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (83,'Sale','updatePrice','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (85,'SaleTracking','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (86,'Order','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (87,'OrderRow','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (88,'ClientContact','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (90,'Sale','reserve','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (102,'Claim','createFromSales','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'); -INSERT INTO `ACL` VALUES (105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'); -INSERT INTO `ACL` VALUES (106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'); -INSERT INTO `ACL` VALUES (108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'); -INSERT INTO `ACL` VALUES (109,'UserConfig','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (110,'Accounting','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (111,'ClientLog','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (112,'Defaulter','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (114,'Receipt','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (116,'BankEntity','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (117,'ClientSample','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (119,'Travel','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (120,'Travel','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (121,'Item','regularize','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (122,'TicketRequest','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (127,'TicketLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (129,'TicketService','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (130,'Expedition','*','WRITE','ALLOW','ROLE','packager'); -INSERT INTO `ACL` VALUES (131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'); -INSERT INTO `ACL` VALUES (135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (141,'Zone','*','*','ALLOW','ROLE','logisticBoss'); -INSERT INTO `ACL` VALUES (142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (144,'Stowaway','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (147,'UserConfigView','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (148,'UserConfigView','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (149,'Sip','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (150,'Sip','*','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (151,'Department','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (152,'Department','*','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (154,'Route','*','WRITE','ALLOW','ROLE','delivery'); -INSERT INTO `ACL` VALUES (155,'Calendar','*','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (157,'Calendar','absences','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'); -INSERT INTO `ACL` VALUES (160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (161,'TicketConfig','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (165,'TicketDms','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (172,'Sms','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (173,'Sms','send','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (176,'Device','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (177,'Device','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (179,'ItemLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (180,'RouteLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (186,'ClientDms','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (191,'Agency','getLanded','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (192,'Agency','getShipped','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (197,'Dms','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (199,'ClaimDms','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (203,'UserPhone','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (205,'WorkerDms','*','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (206,'Chat','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (207,'Chat','sendMessage','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (211,'TravelLog','*','READ','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (212,'Thermograph','*','*','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (214,'Entry','*','*','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (218,'Intrastat','*','*','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','guest'); -INSERT INTO `ACL` VALUES (226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (227,'Address','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (231,'ClientContact','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (232,'ClientSample','*','READ','ALLOW','ROLE','trainee'); -INSERT INTO `ACL` VALUES (233,'EntryLog','*','READ','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (234,'WorkerLog','find','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (235,'CustomsAgent','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (236,'Buy','*','*','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (237,'WorkerDms','filter','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (238,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (239,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (248,'RoleMapping','*','READ','ALLOW','ROLE','account'); -INSERT INTO `ACL` VALUES (249,'UserPassword','*','READ','ALLOW','ROLE','account'); -INSERT INTO `ACL` VALUES (250,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (251,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (252,'Supplier','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (254,'SupplierLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (256,'Image','*','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (257,'FixedPrice','*','*','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (258,'PayDem','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (262,'Entry','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (263,'InvoiceIn','*','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (264,'StarredModule','*','*','ALLOW','ROLE','$authenticated'); -INSERT INTO `ACL` VALUES (265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'); -INSERT INTO `ACL` VALUES (266,'ZoneLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'); -INSERT INTO `ACL` VALUES (268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'); -INSERT INTO `ACL` VALUES (269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (270,'SupplierAddress','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (271,'SalesMonitor','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'); -INSERT INTO `ACL` VALUES (279,'MailAlias','*','READ','ALLOW','ROLE','marketing'); -INSERT INTO `ACL` VALUES (283,'EntryObservation','*','*','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'); -INSERT INTO `ACL` VALUES (285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'); -INSERT INTO `ACL` VALUES (286,'ACL','*','*','ALLOW','ROLE','developer'); -INSERT INTO `ACL` VALUES (287,'AccessToken','*','*','ALLOW','ROLE','developer'); -INSERT INTO `ACL` VALUES (293,'RoleInherit','*','*','ALLOW','ROLE','it'); -INSERT INTO `ACL` VALUES (294,'RoleRole','*','*','ALLOW','ROLE','it'); -INSERT INTO `ACL` VALUES (295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'); -INSERT INTO `ACL` VALUES (296,'Collection','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (297,'Sale','clone','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (305,'EducationLevel','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (311,'Expense','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (312,'Expense','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (318,'MdbVersion','*','*','ALLOW','ROLE','developer'); -INSERT INTO `ACL` VALUES (319,'ItemType','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (327,'Sale','clone','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (328,'Sale','clone','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (337,'Parking','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (338,'Shelving','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (339,'OsTicket','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (340,'OsTicketConfig','*','*','ALLOW','ROLE','it'); -INSERT INTO `ACL` VALUES (341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'); -INSERT INTO `ACL` VALUES (368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'); -INSERT INTO `ACL` VALUES (371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'); -INSERT INTO `ACL` VALUES (379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'); -INSERT INTO `ACL` VALUES (380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (382,'Item','labelPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (383,'Sector','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (384,'Sector','*','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','$owner'); -INSERT INTO `ACL` VALUES (388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (391,'Notification','*','WRITE','ALLOW','ROLE','system'); -INSERT INTO `ACL` VALUES (392,'Boxing','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (393,'Url','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (394,'Url','*','WRITE','ALLOW','ROLE','it'); -INSERT INTO `ACL` VALUES (395,'ItemShelving','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (398,'NotificationQueue','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'); -INSERT INTO `ACL` VALUES (408,'ZipConfig','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (409,'Item','*','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'); -INSERT INTO `ACL` VALUES (416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (418,'EntryLog','*','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'); -INSERT INTO `ACL` VALUES (421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'); -INSERT INTO `ACL` VALUES (427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'); -INSERT INTO `ACL` VALUES (428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'); -INSERT INTO `ACL` VALUES (429,'ItemConfig','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (433,'Worker','createAbsence','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (436,'Worker','new','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'); -INSERT INTO `ACL` VALUES (442,'MdbApp','*','*','ALLOW','ROLE','developer'); -INSERT INTO `ACL` VALUES (443,'ItemConfig','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (444,'DeviceProduction','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (456,'Zone','*','*','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (458,'Operator','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (459,'Operator','*','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (464,'WorkerObservation','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (465,'ClientInforma','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'); -INSERT INTO `ACL` VALUES (467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (468,'Client','setRating','WRITE','ALLOW','ROLE','financial'); -INSERT INTO `ACL` VALUES (470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (473,'Client','consumption','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (474,'Client','createAddress','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (475,'Client','createWithUser','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (478,'Client','getCard','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (479,'Client','getDebt','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (480,'Client','getMana','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (481,'Client','transactions','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (483,'Client','isValidClient','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (485,'Client','sendSms','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (486,'Client','setPassword','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (487,'Client','summary','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (488,'Client','updateAddress','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (491,'Client','uploadFile','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (514,'Client','filter','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (516,'Client','upsert','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (518,'Client','replaceById','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (519,'Client','updateAttributes','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (520,'Client','updateAttributes','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (521,'Client','deleteById','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (523,'Client','updateAll','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (527,'VnUser','acl','READ','ALLOW','ROLE','guest'); -INSERT INTO `ACL` VALUES (528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'); -INSERT INTO `ACL` VALUES (530,'Account','exists','READ','ALLOW','ROLE','account'); -INSERT INTO `ACL` VALUES (531,'Account','exists','READ','ALLOW','ROLE','account'); -INSERT INTO `ACL` VALUES (532,'UserLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (533,'RoleLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (534,'WagonType','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (540,'Wagon','*','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'); -INSERT INTO `ACL` VALUES (544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (545,'Agency','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'); -INSERT INTO `ACL` VALUES (547,'WorkerLog','models','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (556,'State','editableStates','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (558,'State','seeEditableStates','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (560,'State','isAllEditable','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'); -INSERT INTO `ACL` VALUES (564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'); -INSERT INTO `ACL` VALUES (569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'); -INSERT INTO `ACL` VALUES (570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'); -INSERT INTO `ACL` VALUES (572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'); -INSERT INTO `ACL` VALUES (573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (574,'Claim','editPickup','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (585,'Claim','logs','READ','ALLOW','ROLE','claimManager'); -INSERT INTO `ACL` VALUES (586,'Ticket','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (587,'Ticket','findById','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (588,'Ticket','findOne','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (591,'Ticket','summary','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (594,'Ticket','new','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (598,'Ticket','getSales','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (600,'Ticket','filter','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'); -INSERT INTO `ACL` VALUES (610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (611,'State','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (612,'State','findById','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (613,'State','findOne','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (614,'Worker','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (615,'Worker','findById','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (616,'Worker','findOne','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (617,'Worker','filter','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (619,'Worker','active','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (622,'Worker','contracts','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (623,'Worker','holidays','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (624,'Worker','activeContract','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'); -INSERT INTO `ACL` VALUES (630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'); -INSERT INTO `ACL` VALUES (635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'); -INSERT INTO `ACL` VALUES (639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'); -INSERT INTO `ACL` VALUES (654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'); -INSERT INTO `ACL` VALUES (655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'); -INSERT INTO `ACL` VALUES (659,'Account','*','*','ALLOW','ROLE','developerBoss'); -INSERT INTO `ACL` VALUES (664,'MailForward','*','*','ALLOW','ROLE','itManagement'); -INSERT INTO `ACL` VALUES (667,'VnUser','*','*','ALLOW','ROLE','itManagement'); -INSERT INTO `ACL` VALUES (668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (669,'VnUser','preview','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (670,'VnUser','create','*','ALLOW','ROLE','itManagement'); -INSERT INTO `ACL` VALUES (672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'); -INSERT INTO `ACL` VALUES (676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','developerBoss'); -INSERT INTO `ACL` VALUES (684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'); -INSERT INTO `ACL` VALUES (685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'); -INSERT INTO `ACL` VALUES (686,'MailForward','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (687,'ClientSms','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (703,'Worker','search','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (704,'ExpeditionState','addExpeditionState','WRITE','ALLOW','ROLE','delivery'); -INSERT INTO `ACL` VALUES (705,'SaleGroupDetail','deleteById','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (706,'Ticket','setDeleted','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (707,'DeviceLog','create','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (708,'Collection','getTickets','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (709,'Client','findOne','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (710,'Client','findById','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (711,'Client','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (712,'Client','exists','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (713,'Client','__get__addresses','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (714,'ExpeditionMistakeType','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (715,'WorkerMistakeType','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (716,'ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (717,'WorkerMistake','*','WRITE','ALLOW','ROLE','coolerAssist'); -INSERT INTO `ACL` VALUES (718,'MistakesTypes','*','WRITE','ALLOW','ROLE','coolerAssist'); -INSERT INTO `ACL` VALUES (719,'MistakeType','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (720,'MachineWorker','*','READ','ALLOW','ROLE','coolerAssist'); -INSERT INTO `ACL` VALUES (721,'Printer','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (722,'SaleMistake','*','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (723,'Item','setVisibleDiscard','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (724,'Address','getAddress','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (725,'Account','findOne','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (726,'Account','findById','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (727,'Account','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (728,'Account','exists','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (729,'Sale','clone','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (730,'Ticket','setDeleted','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (732,'Sale','isInPreparing','*','ALLOW','ROLE','reviewer'); -INSERT INTO `ACL` VALUES (733,'Train','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (734,'WorkerDepartment','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (735,'VnUser','higherPrivileges','*','ALLOW','ROLE','itManagement'); -INSERT INTO `ACL` VALUES (736,'VnUser','mediumPrivileges','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (737,'VnUser','updateUser','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (738,'TicketCollection','*','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (739,'Worker','setPassword','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (740,'Url','getByUser','READ','ALLOW','ROLE','$everyone'); -INSERT INTO `ACL` VALUES (741,'Claim','__get__lines','READ','ALLOW','ROLE','claimViewer'); -INSERT INTO `ACL` VALUES (742,'AddressShortage','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (743,'Claim','filter','READ','ALLOW','ROLE','claimViewer'); -INSERT INTO `ACL` VALUES (744,'Claim','find','READ','ALLOW','ROLE','claimViewer'); -INSERT INTO `ACL` VALUES (745,'Claim','findById','READ','ALLOW','ROLE','claimViewer'); -INSERT INTO `ACL` VALUES (746,'Claim','getSummary','READ','ALLOW','ROLE','claimViewer'); -INSERT INTO `ACL` VALUES (747,'CplusRectificationType','*','READ','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (748,'SiiTypeInvoiceOut','*','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (749,'InvoiceCorrectionType','*','READ','ALLOW','ROLE','salesPerson'); -INSERT INTO `ACL` VALUES (750,'InvoiceOut','transferInvoice','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (751,'Application','executeProc','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (752,'Application','executeFunc','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (753,'NotificationSubscription','getList','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (754,'Route','find','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (755,'Route','findById','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (756,'Route','findOne','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (757,'Route','getRoutesByWorker','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (758,'Route','canViewAllRoute','READ','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (759,'Route','cmr','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (760,'Route','downloadCmrsZip','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (761,'Route','downloadZip','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (762,'Route','filter','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (763,'Route','getByWorker','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (764,'Route','getDeliveryPoint','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (765,'Route','cmrs','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (766,'Route','getSuggestedTickets','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (767,'Route','getTickets','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (768,'Route','guessPriority','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (769,'Route','insertTicket','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (770,'Route','getDeliveryPoint','READ','ALLOW','ROLE','deliveryBoss'); -INSERT INTO `ACL` VALUES (771,'Route','summary','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (772,'Route','getExpeditionSummary','READ','ALLOW','ROLE','delivery'); -INSERT INTO `ACL` VALUES (773,'WorkerTimeControl','login','READ','ALLOW','ROLE','timeControl'); -INSERT INTO `ACL` VALUES (774,'WorkerTimeControl','getClockIn','READ','ALLOW','ROLE','timeControl'); -INSERT INTO `ACL` VALUES (775,'WorkerTimeControl','clockIn','WRITE','ALLOW','ROLE','timeControl'); -INSERT INTO `ACL` VALUES (776,'WorkerTimeControl','addTimeEntry','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (777,'WorkerTimeControl','deleteTimeEntry','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (778,'WorkerTimeControl','updateTimeEntry','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (779,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','developer'); -INSERT INTO `ACL` VALUES (780,'WorkerTimeControl','updateMailState','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (781,'WorkerTimeControl','weeklyHourRecordEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (782,'WorkerTimeControl','getMailStates','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (783,'WorkerTimeControl','resendWeeklyHourEmail','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (784,'VnRole','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (785,'VnRole','*','WRITE','ALLOW','ROLE','it'); -INSERT INTO `ACL` VALUES (786,'State','isAllEditable','READ','ALLOW','ROLE','delivery'); -INSERT INTO `ACL` VALUES (787,'Ticket','makePdfList','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (788,'Ticket','invoiceTicketsAndPdf','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (789,'InvoiceIn','*','READ','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (790,'InvoiceIn','getSerial','READ','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (791,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (792,'InvoiceInCorrection','*','*','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (793,'Supplier','updateAllFiscalData','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (794,'Supplier','updateFiscalData','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (795,'Ticket','myLastModified','*','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (796,'MrwConfig','cancelShipment','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (797,'MrwConfig','createShipment','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (798,'MailAliasAccount','*','*','ALLOW','ROLE','itManagement'); -INSERT INTO `ACL` VALUES (799,'Ticket','saveCmr','*','ALLOW','ROLE','developer'); -INSERT INTO `ACL` VALUES (800,'EntryDms','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (801,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (802,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (804,'DeviceProduction','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (805,'Collection','assign','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (806,'ExpeditionPallet','getPallet','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (807,'MachineWorker','updateInTime','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (808,'MobileAppVersionControl','getVersion','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (809,'SaleTracking','delete','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (810,'SaleTracking','updateTracking','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (811,'SaleTracking','setPicked','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (813,'Sale','getFromSectorCollection','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (814,'ItemBarcode','delete','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (815,'WorkerActivityType','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (816,'WorkerActivity','*','*','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (817,'ParkingLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (818,'ExpeditionPallet','*','*','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (819,'Ticket','addSaleByCode','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (820,'TicketCollection','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (821,'Ticket','clone','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (822,'SupplierDms','*','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (823,'MailAlias','*','*','ALLOW','ROLE','developerBoss'); -INSERT INTO `ACL` VALUES (824,'ItemShelving','hasItemOlder','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (825,'Application','getEnumValues','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (826,'Ticket','editZone','WRITE','ALLOW','ROLE','salesAssistant'); -INSERT INTO `ACL` VALUES (827,'TicketWeekly','deleteById','WRITE','ALLOW','ROLE','buyerBoss'); -INSERT INTO `ACL` VALUES (828,'TicketWeekly','upsert','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (830,'InvoiceIn','*','READ','ALLOW','ROLE','deliveryBoss'); -INSERT INTO `ACL` VALUES (831,'InvoiceIn','exchangeRateUpdate','*','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (832,'AgencyLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (833,'AgencyWorkCenter','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (835,'Agency','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (836,'Agency','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (837,'AgencyWorkCenter','*','WRITE','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (838,'Worker','getAvailablePda','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (839,'Locker','__get__codes','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (840,'Locker','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (841,'Locker','*','*','ALLOW','ROLE','productionBoss'); -INSERT INTO `ACL` VALUES (842,'Worker','__get__locker','READ','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (843,'Worker','__get__locker','READ','ALLOW','ROLE','productionBoss'); -INSERT INTO `ACL` VALUES (846,'Ticket','refund','WRITE','ALLOW','ROLE','logistic'); -INSERT INTO `ACL` VALUES (847,'RouteConfig','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (848,'InvoiceIn','updateInvoiceIn','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (849,'InvoiceIn','clone','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (850,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (851,'InvoiceIn','exchangeRateUpdate','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (852,'InvoiceIn','invoiceInEmail','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (853,'InvoiceIn','toBook','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (854,'InvoiceIn','toUnbook','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (855,'InvoiceIn','deleteById','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (856,'InvoiceIn','updateInvoiceIn','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (857,'InvoiceIn','clone','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (858,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (859,'InvoiceIn','exchangeRateUpdate','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (860,'InvoiceIn','invoiceInEmail','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (861,'InvoiceIn','toBook','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (862,'InvoiceIn','deleteById','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (863,'InvoiceIn','create','WRITE','ALLOW','ROLE','administrative'); -INSERT INTO `ACL` VALUES (864,'InvoiceIn','create','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (865,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (866,'InvoiceOut','download','READ','ALLOW','ROLE','$owner'); -INSERT INTO `ACL` VALUES (867,'InvoiceIn','*','READ','ALLOW','ROLE','maintenanceBoss'); -INSERT INTO `ACL` VALUES (868,'InvoiceIn','*','READ','ALLOW','ROLE','maintenanceBos'); -INSERT INTO `ACL` VALUES (869,'Ticket','editZone','WRITE','ALLOW','ROLE','buyer'); -INSERT INTO `ACL` VALUES (870,'Entry','find','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (871,'RoadmapAddress','*','WRITE','ALLOW','ROLE','palletizerBoss'); -INSERT INTO `ACL` VALUES (872,'RoadmapAddress','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (873,'Roadmap','*','WRITE','ALLOW','ROLE','palletizerBoss'); -INSERT INTO `ACL` VALUES (874,'Roadmap','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (875,'RoadmapStop','*','WRITE','ALLOW','ROLE','palletizerBoss'); -INSERT INTO `ACL` VALUES (876,'RoadmapStop','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (877,'TravelKgPercentage','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (878,'MrwConfig','getLabel','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (879,'AgencyMode','*','*','ALLOW','ROLE','deliveryAssistant'); -INSERT INTO `ACL` VALUES (880,'Collection','assignCollection','WRITE','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (881,'TrainingCourse','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (882,'TrainingCourseType','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (883,'TrainingCenter','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (884,'Worker','__get__trainingCourse','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (885,'WorkerTimeControl','addTimeEntry','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (886,'WorkerTimeControl','deleteTimeEntry','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (887,'WorkerTimeControl','updateTimeEntry','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (888,'WorkerTimeControl','weeklyHourRecordEmail','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (889,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (890,'WorkerTimeControl','updateMailState','WRITE','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (891,'TravelKgPercentage','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (892,'WorkerIncome','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (893,'PayrollComponent','*','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (894,'Worker','__get__incomes','*','ALLOW','ROLE','hr'); -INSERT INTO `ACL` VALUES (895,'ItemShelvingLog','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (897,'WorkerLog','*','READ','ALLOW','ROLE','employee'); -INSERT INTO `ACL` VALUES (901,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','system'); -INSERT INTO `ACL` VALUES (902,'Entry','filter','READ','ALLOW','ROLE','supplier'); -INSERT INTO `ACL` VALUES (903,'Entry','getBuys','READ','ALLOW','ROLE','supplier'); -INSERT INTO `ACL` VALUES (904,'Entry','buyLabel','READ','ALLOW','ROLE','supplier'); -INSERT INTO `ACL` VALUES (905,'AddressWaste','*','READ','ALLOW','ROLE','production'); -INSERT INTO `ACL` VALUES (906,'Entry','print','READ','ALLOW','ROLE','supplier'); -INSERT INTO `ACL` VALUES (907,'Expedition_PrintOut','*','*','ALLOW','ROLE','production'); +INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (5,'AgencyService','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (9,'ClientObservation','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (11,'ContactChannel','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (13,'Employee','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (14,'PayMethod','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (16,'FakeProduction','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (17,'Warehouse','* ','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (20,'TicketState','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (24,'Delivery','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (25,'Zone','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (26,'ClientCredit','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (30,'GreugeType','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (31,'Mandate','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (32,'MandateType','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (33,'Company','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (34,'Greuge','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (35,'AddressObservation','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (36,'ObservationType','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (37,'Greuge','*','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (38,'AgencyMode','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (41,'ItemBotanical','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher',NULL); +INSERT INTO `ACL` VALUES (44,'ItemPlacement','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (45,'ItemBarcode','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher',NULL); +INSERT INTO `ACL` VALUES (51,'ItemTag','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (53,'Item','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (54,'Item','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (55,'Recovery','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (56,'Recovery','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (58,'CreditClassification','*','*','ALLOW','ROLE','insurance',NULL); +INSERT INTO `ACL` VALUES (60,'CreditInsurance','*','*','ALLOW','ROLE','insurance',NULL); +INSERT INTO `ACL` VALUES (61,'InvoiceOut','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (63,'TicketObservation','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (65,'Sale','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (66,'TicketTracking','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (68,'TicketPackaging','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (69,'Packaging','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (70,'Packaging','*','WRITE','ALLOW','ROLE','logistic',NULL); +INSERT INTO `ACL` VALUES (72,'SaleComponent','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (73,'Expedition','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (75,'Expedition','*','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (77,'WorkerMana','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (78,'TicketTracking','*','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (79,'Ticket','state','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (80,'Sale','deleteSales','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (81,'Sale','moveToTicket','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (82,'Sale','updateQuantity','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (83,'Sale','updatePrice','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (84,'Sale','updateDiscount','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (85,'SaleTracking','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (86,'Order','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (87,'OrderRow','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (88,'ClientContact','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (90,'Sale','reserve','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (91,'TicketWeekly','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (94,'Agency','landsThatDay','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (96,'ClaimEnd','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (98,'ClaimBeginning','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (102,'Claim','createFromSales','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss',NULL); +INSERT INTO `ACL` VALUES (105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss',NULL); +INSERT INTO `ACL` VALUES (106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss',NULL); +INSERT INTO `ACL` VALUES (108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss',NULL); +INSERT INTO `ACL` VALUES (109,'UserConfig','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (110,'Accounting','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (111,'ClientLog','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (112,'Defaulter','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (113,'ClientRisk','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (114,'Receipt','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (115,'Receipt','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (116,'BankEntity','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (117,'ClientSample','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (119,'Travel','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (120,'Travel','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (121,'Item','regularize','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (122,'TicketRequest','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (127,'TicketLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (129,'TicketService','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (130,'Expedition','*','WRITE','ALLOW','ROLE','packager',NULL); +INSERT INTO `ACL` VALUES (131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (132,'CreditClassification','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss',NULL); +INSERT INTO `ACL` VALUES (135,'ZoneGeo','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (138,'LabourHoliday','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (141,'Zone','*','*','ALLOW','ROLE','logisticBoss',NULL); +INSERT INTO `ACL` VALUES (142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (144,'Stowaway','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (147,'UserConfigView','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (148,'UserConfigView','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (149,'Sip','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (150,'Sip','*','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (151,'Department','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (152,'Department','*','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (154,'Route','*','WRITE','ALLOW','ROLE','delivery',NULL); +INSERT INTO `ACL` VALUES (155,'Calendar','*','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (156,'WorkerLabour','*','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (157,'Calendar','absences','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory',NULL); +INSERT INTO `ACL` VALUES (160,'TicketServiceType','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (161,'TicketConfig','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (165,'TicketDms','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (172,'Sms','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (173,'Sms','send','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (176,'Device','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (177,'Device','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (179,'ItemLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (180,'RouteLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (183,'Dms','downloadFile','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (186,'ClientDms','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (191,'Agency','getLanded','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (192,'Agency','getShipped','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (197,'Dms','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (199,'ClaimDms','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (203,'UserPhone','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (205,'WorkerDms','*','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (206,'Chat','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (207,'Chat','sendMessage','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (211,'TravelLog','*','READ','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (212,'Thermograph','*','*','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (214,'Entry','*','*','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (216,'TravelThermograph','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (218,'Intrastat','*','*','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','guest',NULL); +INSERT INTO `ACL` VALUES (226,'ClientObservation','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (227,'Address','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (228,'AddressObservation','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (230,'ClientCredit','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (231,'ClientContact','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (232,'ClientSample','*','READ','ALLOW','ROLE','trainee',NULL); +INSERT INTO `ACL` VALUES (233,'EntryLog','*','READ','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (234,'WorkerLog','find','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (235,'CustomsAgent','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (236,'Buy','*','*','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (237,'WorkerDms','filter','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (238,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (239,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (248,'RoleMapping','*','READ','ALLOW','ROLE','account',NULL); +INSERT INTO `ACL` VALUES (249,'UserPassword','*','READ','ALLOW','ROLE','account',NULL); +INSERT INTO `ACL` VALUES (250,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (251,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (252,'Supplier','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (253,'Supplier','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (254,'SupplierLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (256,'Image','*','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (257,'FixedPrice','*','*','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (258,'PayDem','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (261,'SupplierAccount','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (262,'Entry','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (263,'InvoiceIn','*','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (264,'StarredModule','*','*','ALLOW','ROLE','$authenticated',NULL); +INSERT INTO `ACL` VALUES (265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss',NULL); +INSERT INTO `ACL` VALUES (266,'ZoneLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss',NULL); +INSERT INTO `ACL` VALUES (268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss',NULL); +INSERT INTO `ACL` VALUES (269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (270,'SupplierAddress','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (271,'SalesMonitor','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant',NULL); +INSERT INTO `ACL` VALUES (279,'MailAlias','*','READ','ALLOW','ROLE','marketing',NULL); +INSERT INTO `ACL` VALUES (283,'EntryObservation','*','*','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin',NULL); +INSERT INTO `ACL` VALUES (285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin',NULL); +INSERT INTO `ACL` VALUES (286,'ACL','*','*','ALLOW','ROLE','developer',NULL); +INSERT INTO `ACL` VALUES (287,'AccessToken','*','*','ALLOW','ROLE','developer',NULL); +INSERT INTO `ACL` VALUES (293,'RoleInherit','*','*','ALLOW','ROLE','it',NULL); +INSERT INTO `ACL` VALUES (294,'RoleRole','*','*','ALLOW','ROLE','it',NULL); +INSERT INTO `ACL` VALUES (295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin',NULL); +INSERT INTO `ACL` VALUES (296,'Collection','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (297,'Sale','clone','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (302,'AgencyTerm','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (304,'Edi','updateData','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (305,'EducationLevel','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (310,'ExpeditionState','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (311,'Expense','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (312,'Expense','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (314,'SupplierActivity','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (318,'MdbVersion','*','*','ALLOW','ROLE','developer',NULL); +INSERT INTO `ACL` VALUES (319,'ItemType','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (320,'ItemType','*','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (327,'Sale','clone','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (328,'Sale','clone','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (334,'ShelvingLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (337,'Parking','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (338,'Shelving','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (339,'OsTicket','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (340,'OsTicketConfig','*','*','ALLOW','ROLE','it',NULL); +INSERT INTO `ACL` VALUES (341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system',NULL); +INSERT INTO `ACL` VALUES (368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system',NULL); +INSERT INTO `ACL` VALUES (371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system',NULL); +INSERT INTO `ACL` VALUES (379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system',NULL); +INSERT INTO `ACL` VALUES (380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (382,'Item','labelPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (383,'Sector','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (384,'Sector','*','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','$owner',NULL); +INSERT INTO `ACL` VALUES (388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (391,'Notification','*','WRITE','ALLOW','ROLE','system',NULL); +INSERT INTO `ACL` VALUES (392,'Boxing','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (393,'Url','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (394,'Url','*','WRITE','ALLOW','ROLE','it',NULL); +INSERT INTO `ACL` VALUES (395,'ItemShelving','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (396,'ItemShelving','*','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (398,'NotificationQueue','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (401,'Sale','editTracked','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (406,'Ticket','merge','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic',NULL); +INSERT INTO `ACL` VALUES (408,'ZipConfig','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (409,'Item','*','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone',NULL); +INSERT INTO `ACL` VALUES (416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (418,'EntryLog','*','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone',NULL); +INSERT INTO `ACL` VALUES (421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (422,'Docuware','checkFile','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (423,'Docuware','download','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone',NULL); +INSERT INTO `ACL` VALUES (427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated',NULL); +INSERT INTO `ACL` VALUES (428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated',NULL); +INSERT INTO `ACL` VALUES (429,'ItemConfig','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (433,'Worker','createAbsence','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (436,'Worker','new','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (439,'NotificationSubscription','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (440,'NotificationAcl','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (441,'MdbApp','*','READ','ALLOW','ROLE','$everyone',NULL); +INSERT INTO `ACL` VALUES (442,'MdbApp','*','*','ALLOW','ROLE','developer',NULL); +INSERT INTO `ACL` VALUES (443,'ItemConfig','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (444,'DeviceProduction','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (446,'DeviceProductionState','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (453,'Worker','allocatePDA','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (456,'Zone','*','*','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (458,'Operator','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (459,'Operator','*','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (464,'WorkerObservation','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (465,'ClientInforma','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial',NULL); +INSERT INTO `ACL` VALUES (467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (468,'Client','setRating','WRITE','ALLOW','ROLE','financial',NULL); +INSERT INTO `ACL` VALUES (470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (472,'Client','canCreateTicket','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (473,'Client','consumption','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (474,'Client','createAddress','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (475,'Client','createWithUser','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (476,'Client','extendedListFilter','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (478,'Client','getCard','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (479,'Client','getDebt','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (480,'Client','getMana','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (481,'Client','transactions','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (483,'Client','isValidClient','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (485,'Client','sendSms','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (486,'Client','setPassword','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (487,'Client','summary','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (488,'Client','updateAddress','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (489,'Client','updateFiscalData','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (491,'Client','uploadFile','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (514,'Client','filter','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (516,'Client','upsert','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (518,'Client','replaceById','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (519,'Client','updateAttributes','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (520,'Client','updateAttributes','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (521,'Client','deleteById','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (523,'Client','updateAll','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (527,'VnUser','acl','READ','ALLOW','ROLE','guest',NULL); +INSERT INTO `ACL` VALUES (528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account',NULL); +INSERT INTO `ACL` VALUES (530,'Account','exists','READ','ALLOW','ROLE','account',NULL); +INSERT INTO `ACL` VALUES (531,'Account','exists','READ','ALLOW','ROLE','account',NULL); +INSERT INTO `ACL` VALUES (532,'UserLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (533,'RoleLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (534,'WagonType','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (540,'Wagon','*','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi',NULL); +INSERT INTO `ACL` VALUES (544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (545,'Agency','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist',NULL); +INSERT INTO `ACL` VALUES (547,'WorkerLog','models','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (556,'State','editableStates','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (558,'State','seeEditableStates','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (560,'State','isAllEditable','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (561,'State','isAllEditable','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss',NULL); +INSERT INTO `ACL` VALUES (564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss',NULL); +INSERT INTO `ACL` VALUES (569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss',NULL); +INSERT INTO `ACL` VALUES (570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial',NULL); +INSERT INTO `ACL` VALUES (572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss',NULL); +INSERT INTO `ACL` VALUES (573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (574,'Claim','editPickup','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (585,'Claim','logs','READ','ALLOW','ROLE','claimManager',NULL); +INSERT INTO `ACL` VALUES (586,'Ticket','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (587,'Ticket','findById','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (588,'Ticket','findOne','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (589,'Ticket','getVolume','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (591,'Ticket','summary','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (594,'Ticket','new','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (595,'Ticket','isEditable','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (597,'Ticket','restore','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (598,'Ticket','getSales','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (600,'Ticket','filter','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (606,'Ticket','isLocked','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (607,'Ticket','freightCost','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery',NULL); +INSERT INTO `ACL` VALUES (610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (611,'State','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (612,'State','findById','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (613,'State','findOne','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (614,'Worker','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (615,'Worker','findById','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (616,'Worker','findOne','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (617,'Worker','filter','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (619,'Worker','active','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (622,'Worker','contracts','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (623,'Worker','holidays','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (624,'Worker','activeContract','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss',NULL); +INSERT INTO `ACL` VALUES (630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss',NULL); +INSERT INTO `ACL` VALUES (635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss',NULL); +INSERT INTO `ACL` VALUES (639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant',NULL); +INSERT INTO `ACL` VALUES (654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant',NULL); +INSERT INTO `ACL` VALUES (655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system',NULL); +INSERT INTO `ACL` VALUES (659,'Account','*','*','ALLOW','ROLE','developerBoss',NULL); +INSERT INTO `ACL` VALUES (664,'MailForward','*','*','ALLOW','ROLE','itManagement',NULL); +INSERT INTO `ACL` VALUES (667,'VnUser','*','*','ALLOW','ROLE','itManagement',NULL); +INSERT INTO `ACL` VALUES (668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (669,'VnUser','preview','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (670,'VnUser','create','*','ALLOW','ROLE','itManagement',NULL); +INSERT INTO `ACL` VALUES (672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing',NULL); +INSERT INTO `ACL` VALUES (676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','developerBoss',NULL); +INSERT INTO `ACL` VALUES (684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement',NULL); +INSERT INTO `ACL` VALUES (685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement',NULL); +INSERT INTO `ACL` VALUES (686,'MailForward','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (687,'ClientSms','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (688,'ClientSms','create','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (703,'Worker','search','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (704,'ExpeditionState','addExpeditionState','WRITE','ALLOW','ROLE','delivery',NULL); +INSERT INTO `ACL` VALUES (705,'SaleGroupDetail','deleteById','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (706,'Ticket','setDeleted','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (707,'DeviceLog','create','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (708,'Collection','getTickets','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (709,'Client','findOne','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (710,'Client','findById','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (711,'Client','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (712,'Client','exists','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (713,'Client','__get__addresses','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (714,'ExpeditionMistakeType','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (715,'WorkerMistakeType','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (716,'ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (717,'WorkerMistake','*','WRITE','ALLOW','ROLE','coolerAssist',NULL); +INSERT INTO `ACL` VALUES (718,'MistakesTypes','*','WRITE','ALLOW','ROLE','coolerAssist',NULL); +INSERT INTO `ACL` VALUES (719,'MistakeType','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (720,'MachineWorker','*','READ','ALLOW','ROLE','coolerAssist',NULL); +INSERT INTO `ACL` VALUES (721,'Printer','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (722,'SaleMistake','*','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (723,'Item','setVisibleDiscard','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (724,'Address','getAddress','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (725,'Account','findOne','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (726,'Account','findById','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (727,'Account','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (728,'Account','exists','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (729,'Sale','clone','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (730,'Ticket','setDeleted','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (732,'Sale','isInPreparing','*','ALLOW','ROLE','reviewer',NULL); +INSERT INTO `ACL` VALUES (733,'Train','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (734,'WorkerDepartment','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (735,'VnUser','higherPrivileges','*','ALLOW','ROLE','itManagement',NULL); +INSERT INTO `ACL` VALUES (736,'VnUser','mediumPrivileges','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (737,'VnUser','updateUser','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (738,'TicketCollection','*','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (739,'Worker','setPassword','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (740,'Url','getByUser','READ','ALLOW','ROLE','$everyone',NULL); +INSERT INTO `ACL` VALUES (741,'Claim','__get__lines','READ','ALLOW','ROLE','claimViewer',NULL); +INSERT INTO `ACL` VALUES (742,'AddressShortage','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (743,'Claim','filter','READ','ALLOW','ROLE','claimViewer',NULL); +INSERT INTO `ACL` VALUES (744,'Claim','find','READ','ALLOW','ROLE','claimViewer',NULL); +INSERT INTO `ACL` VALUES (745,'Claim','findById','READ','ALLOW','ROLE','claimViewer',NULL); +INSERT INTO `ACL` VALUES (746,'Claim','getSummary','READ','ALLOW','ROLE','claimViewer',NULL); +INSERT INTO `ACL` VALUES (747,'CplusRectificationType','*','READ','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (748,'SiiTypeInvoiceOut','*','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (749,'InvoiceCorrectionType','*','READ','ALLOW','ROLE','salesPerson',NULL); +INSERT INTO `ACL` VALUES (750,'InvoiceOut','transferInvoice','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (751,'Application','executeProc','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (752,'Application','executeFunc','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (753,'NotificationSubscription','getList','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (754,'Route','find','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (755,'Route','findById','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (756,'Route','findOne','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (757,'Route','getRoutesByWorker','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (758,'Route','canViewAllRoute','READ','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (759,'Route','cmr','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (760,'Route','downloadCmrsZip','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (761,'Route','downloadZip','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (762,'Route','filter','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (763,'Route','getByWorker','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (764,'Route','getDeliveryPoint','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (765,'Route','cmrs','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (766,'Route','getSuggestedTickets','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (767,'Route','getTickets','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (768,'Route','guessPriority','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (769,'Route','insertTicket','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (770,'Route','getDeliveryPoint','READ','ALLOW','ROLE','deliveryBoss',NULL); +INSERT INTO `ACL` VALUES (771,'Route','summary','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (772,'Route','getExpeditionSummary','READ','ALLOW','ROLE','delivery',NULL); +INSERT INTO `ACL` VALUES (773,'WorkerTimeControl','login','READ','ALLOW','ROLE','timeControl',NULL); +INSERT INTO `ACL` VALUES (774,'WorkerTimeControl','getClockIn','READ','ALLOW','ROLE','timeControl',NULL); +INSERT INTO `ACL` VALUES (775,'WorkerTimeControl','clockIn','WRITE','ALLOW','ROLE','timeControl',NULL); +INSERT INTO `ACL` VALUES (776,'WorkerTimeControl','addTimeEntry','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (777,'WorkerTimeControl','deleteTimeEntry','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (778,'WorkerTimeControl','updateTimeEntry','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (779,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','developer',NULL); +INSERT INTO `ACL` VALUES (780,'WorkerTimeControl','updateMailState','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (781,'WorkerTimeControl','weeklyHourRecordEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (782,'WorkerTimeControl','getMailStates','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (783,'WorkerTimeControl','resendWeeklyHourEmail','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (784,'VnRole','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (785,'VnRole','*','WRITE','ALLOW','ROLE','it',NULL); +INSERT INTO `ACL` VALUES (786,'State','isAllEditable','READ','ALLOW','ROLE','delivery',NULL); +INSERT INTO `ACL` VALUES (787,'Ticket','makePdfList','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (788,'Ticket','invoiceTicketsAndPdf','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (789,'InvoiceIn','*','READ','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (790,'InvoiceIn','getSerial','READ','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (791,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (792,'InvoiceInCorrection','*','*','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (793,'Supplier','updateAllFiscalData','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (794,'Supplier','updateFiscalData','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (795,'Ticket','myLastModified','*','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (796,'MrwConfig','cancelShipment','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (797,'MrwConfig','createShipment','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (798,'MailAliasAccount','*','*','ALLOW','ROLE','itManagement',NULL); +INSERT INTO `ACL` VALUES (799,'Ticket','saveCmr','*','ALLOW','ROLE','developer',NULL); +INSERT INTO `ACL` VALUES (800,'EntryDms','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (801,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (802,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (804,'DeviceProduction','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (805,'Collection','assign','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (806,'ExpeditionPallet','getPallet','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (807,'MachineWorker','updateInTime','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (808,'MobileAppVersionControl','getVersion','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (809,'SaleTracking','delete','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (810,'SaleTracking','updateTracking','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (811,'SaleTracking','setPicked','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (813,'Sale','getFromSectorCollection','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (814,'ItemBarcode','delete','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (815,'WorkerActivityType','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (816,'WorkerActivity','*','*','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (817,'ParkingLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (818,'ExpeditionPallet','*','*','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (819,'Ticket','addSaleByCode','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (820,'TicketCollection','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (821,'Ticket','clone','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (822,'SupplierDms','*','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (823,'MailAlias','*','*','ALLOW','ROLE','developerBoss',NULL); +INSERT INTO `ACL` VALUES (824,'ItemShelving','hasItemOlder','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (825,'Application','getEnumValues','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (826,'Ticket','editZone','WRITE','ALLOW','ROLE','salesAssistant',NULL); +INSERT INTO `ACL` VALUES (827,'TicketWeekly','deleteById','WRITE','ALLOW','ROLE','buyerBoss',NULL); +INSERT INTO `ACL` VALUES (828,'TicketWeekly','upsert','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (830,'InvoiceIn','*','READ','ALLOW','ROLE','deliveryBoss',NULL); +INSERT INTO `ACL` VALUES (831,'InvoiceIn','exchangeRateUpdate','*','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (832,'AgencyLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (833,'AgencyWorkCenter','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (835,'Agency','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (836,'Agency','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (837,'AgencyWorkCenter','*','WRITE','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (838,'Worker','getAvailablePda','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (839,'Locker','__get__codes','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (840,'Locker','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (841,'Locker','*','*','ALLOW','ROLE','productionBoss',NULL); +INSERT INTO `ACL` VALUES (842,'Worker','__get__locker','READ','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (843,'Worker','__get__locker','READ','ALLOW','ROLE','productionBoss',NULL); +INSERT INTO `ACL` VALUES (846,'Ticket','refund','WRITE','ALLOW','ROLE','logistic',NULL); +INSERT INTO `ACL` VALUES (847,'RouteConfig','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (848,'InvoiceIn','updateInvoiceIn','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (849,'InvoiceIn','clone','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (850,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (851,'InvoiceIn','exchangeRateUpdate','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (852,'InvoiceIn','invoiceInEmail','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (853,'InvoiceIn','toBook','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (854,'InvoiceIn','toUnbook','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (855,'InvoiceIn','deleteById','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (856,'InvoiceIn','updateInvoiceIn','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (857,'InvoiceIn','clone','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (858,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (859,'InvoiceIn','exchangeRateUpdate','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (860,'InvoiceIn','invoiceInEmail','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (861,'InvoiceIn','toBook','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (862,'InvoiceIn','deleteById','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (863,'InvoiceIn','create','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (864,'InvoiceIn','create','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (865,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (866,'InvoiceOut','download','READ','ALLOW','ROLE','$owner',NULL); +INSERT INTO `ACL` VALUES (867,'InvoiceIn','*','READ','ALLOW','ROLE','maintenanceBoss',NULL); +INSERT INTO `ACL` VALUES (868,'InvoiceIn','*','READ','ALLOW','ROLE','maintenanceBos',NULL); +INSERT INTO `ACL` VALUES (869,'Ticket','editZone','WRITE','ALLOW','ROLE','buyer',NULL); +INSERT INTO `ACL` VALUES (870,'Entry','find','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (871,'RoadmapAddress','*','WRITE','ALLOW','ROLE','palletizerBoss',NULL); +INSERT INTO `ACL` VALUES (872,'RoadmapAddress','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (873,'Roadmap','*','WRITE','ALLOW','ROLE','palletizerBoss',NULL); +INSERT INTO `ACL` VALUES (874,'Roadmap','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (875,'RoadmapStop','*','WRITE','ALLOW','ROLE','palletizerBoss',NULL); +INSERT INTO `ACL` VALUES (876,'RoadmapStop','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (877,'TravelKgPercentage','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (878,'MrwConfig','getLabel','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (879,'AgencyMode','*','*','ALLOW','ROLE','deliveryAssistant',NULL); +INSERT INTO `ACL` VALUES (880,'Collection','assignCollection','WRITE','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (881,'TrainingCourse','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (882,'TrainingCourseType','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (883,'TrainingCenter','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (884,'Worker','__get__trainingCourse','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (885,'WorkerTimeControl','addTimeEntry','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (886,'WorkerTimeControl','deleteTimeEntry','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (887,'WorkerTimeControl','updateTimeEntry','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (888,'WorkerTimeControl','weeklyHourRecordEmail','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (889,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (890,'WorkerTimeControl','updateMailState','WRITE','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (891,'TravelKgPercentage','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (892,'WorkerIncome','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (893,'PayrollComponent','*','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (894,'Worker','__get__incomes','*','ALLOW','ROLE','hr',NULL); +INSERT INTO `ACL` VALUES (895,'ItemShelvingLog','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (897,'WorkerLog','*','READ','ALLOW','ROLE','employee',NULL); +INSERT INTO `ACL` VALUES (901,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','system',NULL); +INSERT INTO `ACL` VALUES (902,'Entry','filter','READ','ALLOW','ROLE','supplier',NULL); +INSERT INTO `ACL` VALUES (903,'Entry','getBuys','READ','ALLOW','ROLE','supplier',NULL); +INSERT INTO `ACL` VALUES (904,'Entry','buyLabel','READ','ALLOW','ROLE','supplier',NULL); +INSERT INTO `ACL` VALUES (905,'AddressWaste','*','READ','ALLOW','ROLE','production',NULL); +INSERT INTO `ACL` VALUES (906,'Entry','print','READ','ALLOW','ROLE','supplier',NULL); +INSERT INTO `ACL` VALUES (907,'Expedition_PrintOut','*','*','ALLOW','ROLE','production',NULL); INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee'); INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee'); @@ -2395,7 +2402,7 @@ INSERT INTO `department` VALUES (37,'PROD','PRODUCCION',14,37,NULL,72,1,1,1,11,1 INSERT INTO `department` VALUES (38,'picking','SACADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (39,'packing','ENCAJADO',19,20,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',38,39,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL); -INSERT INTO `department` VALUES (43,'VT','VENTAS',40,71,NULL,0,0,0,1,15,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL); +INSERT INTO `department` VALUES (43,'VT','VENTAS',40,71,NULL,0,0,0,1,15,1,'/1/',NULL,0,NULL,1,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (44,'management','GERENCIA',72,73,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',74,75,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (46,'delivery','REPARTO',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL); @@ -2408,35 +2415,35 @@ INSERT INTO `department` VALUES (55,NULL,'TALLER NATURAL',21,22,14548,72,0,0,2,0 INSERT INTO `department` VALUES (56,NULL,'TALLER ARTIFICIAL',23,24,8470,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1927,NULL,NULL,NULL); INSERT INTO `department` VALUES (58,'CMP','CAMPOS',86,89,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',90,91,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL); -INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',43,44,NULL,72,0,0,2,0,43,'/1/43/',NULL,1,NULL,1,1,0,0,NULL,NULL,NULL,NULL); +INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',43,44,NULL,72,0,0,2,0,43,'/1/43/',NULL,0,NULL,1,1,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (61,NULL,'VNH',92,95,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (66,NULL,'VERDNAMADRID',96,97,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (68,NULL,'COMPLEMENTOS',25,26,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (69,NULL,'VERDNABARNA',98,99,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); -INSERT INTO `department` VALUES (80,'spainTeam5','EQUIPO ESPAÑA 5',45,46,4250,0,0,0,2,0,43,'/1/43/','es5_equipo',1,'es5@verdnatura.es',0,0,0,0,NULL,NULL,'5300',NULL); +INSERT INTO `department` VALUES (80,'spainTeam5','EQUIPO ESPAÑA 5',45,46,4250,0,0,0,2,0,43,'/1/43/','es5_equipo',0,'es5@verdnatura.es',0,0,0,0,NULL,NULL,'5300',NULL); INSERT INTO `department` VALUES (86,NULL,'LIMPIEZA',100,101,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (89,NULL,'COORDINACION',102,103,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (90,NULL,'TRAILER',93,94,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (91,'artificial','ARTIFICIAL',27,28,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (92,NULL,'EQUIPO SILVERIO',47,48,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL); -INSERT INTO `department` VALUES (94,'spainTeam2','EQUIPO ESPAÑA 2',49,50,3797,0,0,0,2,0,43,'/1/43/','es2_equipo',1,'es2@verdnatura.es',0,0,0,0,NULL,NULL,'5100',NULL); -INSERT INTO `department` VALUES (95,'spainTeam1','EQUIPO ESPAÑA 1',51,52,24065,0,0,0,2,0,43,'/1/43/','es1_equipo',1,'es1@verdnatura.es',0,0,0,0,NULL,NULL,'5000',NULL); +INSERT INTO `department` VALUES (94,'spainTeam2','EQUIPO ESPAÑA 2',49,50,3797,0,0,0,2,0,43,'/1/43/','es2_equipo',0,'es2@verdnatura.es',0,0,0,0,NULL,NULL,'5100',NULL); +INSERT INTO `department` VALUES (95,'spainTeam1','EQUIPO ESPAÑA 1',51,52,24065,0,0,0,2,0,43,'/1/43/','es1_equipo',0,'es1@verdnatura.es',0,0,0,0,NULL,NULL,'5000',NULL); INSERT INTO `department` VALUES (96,NULL,'EQUIPO C LOPEZ',53,54,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (115,NULL,'EQUIPO CLAUDI',55,56,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (123,NULL,'EQUIPO ELENA BASCUÑANA',57,58,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',104,105,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL,NULL,NULL,NULL); -INSERT INTO `department` VALUES (125,'spainTeam3','EQUIPO ESPAÑA 3',59,60,1118,0,0,0,2,0,43,'/1/43/','es3_equipo',1,'es3@verdnatura.es',0,0,0,0,NULL,NULL,'5200',NULL); +INSERT INTO `department` VALUES (125,'spainTeam3','EQUIPO ESPAÑA 3',59,60,1118,0,0,0,2,0,43,'/1/43/','es3_equipo',0,'es3@verdnatura.es',0,0,0,0,NULL,NULL,'5200',NULL); INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',31,32,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (130,NULL,'REVISION',33,34,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',87,88,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',61,62,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL); -INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',63,64,1731,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'gestionfrancia@verdnatura.es',0,0,0,0,NULL,NULL,'3300',NULL); -INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',65,66,6264,0,0,0,2,0,43,'/1/43/','pt_equipo',1,'portugal@verdnatura.es',0,0,0,0,NULL,NULL,'3500',NULL); +INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',63,64,1731,72,0,0,2,0,43,'/1/43/','fr_equipo',0,'gestionfrancia@verdnatura.es',0,0,0,0,NULL,NULL,'3300',NULL); +INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',65,66,6264,0,0,0,2,0,43,'/1/43/','pt_equipo',0,'portugal@verdnatura.es',0,0,0,0,NULL,NULL,'3500',NULL); INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',106,107,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',108,109,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (137,'sorter','SORTER',110,111,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); -INSERT INTO `department` VALUES (139,'spainTeam4','EQUIPO ESPAÑA 4',67,68,3803,0,0,0,2,0,43,'/1/43/','es4_equipo',1,'es4@verdnatura.es',0,0,0,0,NULL,NULL,'5400',NULL); +INSERT INTO `department` VALUES (139,'spainTeam4','EQUIPO ESPAÑA 4',67,68,3803,0,0,0,2,0,43,'/1/43/','es4_equipo',0,'es4@verdnatura.es',0,0,0,0,NULL,NULL,'5400',NULL); INSERT INTO `department` VALUES (140,'hollandTeam','EQUIPO HOLANDA',69,70,NULL,0,0,0,2,0,43,'/1/43/','nl_equipo',1,NULL,0,0,0,0,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (141,NULL,'PREVIA',35,36,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL); INSERT INTO `department` VALUES (146,NULL,'VERDNACOLOMBIA',3,4,NULL,72,0,0,2,0,22,'/1/22/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL); @@ -2531,172 +2538,6 @@ INSERT INTO `siiTypeInvoiceOut` VALUES (7,'R3','Factura rectificativa (Art. 80.4 INSERT INTO `siiTypeInvoiceOut` VALUES (8,'R4','Factura rectificativa (Resto)'); INSERT INTO `siiTypeInvoiceOut` VALUES (9,'R5','Factura rectificativa en facturas simplificadas'); -INSERT INTO `silexACL` VALUES (1,'workerTimeControl','clockIn','$everyone'); -INSERT INTO `silexACL` VALUES (2,'workerTimeControl','getClockIn','$everyone'); -INSERT INTO `silexACL` VALUES (3,'workerTimeControl','login','$everyone'); -INSERT INTO `silexACL` VALUES (4,'security','device_checkLogin','employee'); -INSERT INTO `silexACL` VALUES (5,'security','getVersion','employee'); -INSERT INTO `silexACL` VALUES (6,'security','login','employee'); -INSERT INTO `silexACL` VALUES (7,'delivery','addNote','employee'); -INSERT INTO `silexACL` VALUES (8,'delivery','expeditionState_add','employee'); -INSERT INTO `silexACL` VALUES (9,'delivery','expeditionState_addByExpedition','employee'); -INSERT INTO `silexACL` VALUES (10,'delivery','expeditionState_addByExpeditionMulti','employee'); -INSERT INTO `silexACL` VALUES (11,'delivery','expeditionState_addByRoute','employee'); -INSERT INTO `silexACL` VALUES (12,'delivery','expedition_getLog','employee'); -INSERT INTO `silexACL` VALUES (13,'delivery','getExpeditionFromRoute','employee'); -INSERT INTO `silexACL` VALUES (14,'delivery','getInfo','employee'); -INSERT INTO `silexACL` VALUES (15,'delivery','getInfoCompany','employee'); -INSERT INTO `silexACL` VALUES (16,'delivery','getInfoFreelance','employee'); -INSERT INTO `silexACL` VALUES (17,'delivery','getWorkers','employee'); -INSERT INTO `silexACL` VALUES (18,'delivery','get_routes','employee'); -INSERT INTO `silexACL` VALUES (19,'delivery','get_tickets','employee'); -INSERT INTO `silexACL` VALUES (20,'delivery','get_version','employee'); -INSERT INTO `silexACL` VALUES (21,'delivery','saveLoadersWorkers','employee'); -INSERT INTO `silexACL` VALUES (22,'delivery','save_sign','employee'); -INSERT INTO `silexACL` VALUES (23,'delivery','setRouteOk','employee'); -INSERT INTO `silexACL` VALUES (24,'delivery','updateExpeditionChecked','employee'); -INSERT INTO `silexACL` VALUES (25,'delivery','update_routes','employee'); -INSERT INTO `silexACL` VALUES (26,'almacennew','barcodes_edit','employee'); -INSERT INTO `silexACL` VALUES (27,'almacennew','barcodeToItem','employee'); -INSERT INTO `silexACL` VALUES (28,'almacennew','buffer_setTypeByName','employee'); -INSERT INTO `silexACL` VALUES (29,'almacennew','buy_updateGrouping','employee'); -INSERT INTO `silexACL` VALUES (30,'almacennew','buy_updatePacking','employee'); -INSERT INTO `silexACL` VALUES (31,'almacennew','checkRouteExpeditionScanPut','employee'); -INSERT INTO `silexACL` VALUES (32,'almacennew','clearShelvingList','employee'); -INSERT INTO `silexACL` VALUES (33,'almacennew','collectionAddItem','employee'); -INSERT INTO `silexACL` VALUES (34,'almacennew','collectionGet','employee'); -INSERT INTO `silexACL` VALUES (35,'almacennew','collectionIncreaseQuantity','employee'); -INSERT INTO `silexACL` VALUES (36,'almacennew','collectionMissingTrash','employee'); -INSERT INTO `silexACL` VALUES (37,'almacennew','collectionNew','employee'); -INSERT INTO `silexACL` VALUES (38,'almacennew','collectionStickerPrint','employee'); -INSERT INTO `silexACL` VALUES (39,'almacennew','collection_getTickets','employee'); -INSERT INTO `silexACL` VALUES (40,'almacennew','collection_printSticker','employee'); -INSERT INTO `silexACL` VALUES (41,'almacennew','department_getHasMistake','employee'); -INSERT INTO `silexACL` VALUES (42,'almacennew','deviceLog_add','employee'); -INSERT INTO `silexACL` VALUES (43,'almacennew','deviceProductionUser_getWorker','employee'); -INSERT INTO `silexACL` VALUES (44,'almacennew','deviceProduction_getnameDevice','employee'); -INSERT INTO `silexACL` VALUES (45,'almacennew','expeditionLoading_add','employee'); -INSERT INTO `silexACL` VALUES (46,'almacennew','expeditionPalletDel','employee'); -INSERT INTO `silexACL` VALUES (47,'almacennew','expeditionPalletList','employee'); -INSERT INTO `silexACL` VALUES (48,'almacennew','expeditionPalletPrintSet','employee'); -INSERT INTO `silexACL` VALUES (49,'almacennew','expeditionPalletView','employee'); -INSERT INTO `silexACL` VALUES (50,'almacennew','expeditionScanAdd','employee'); -INSERT INTO `silexACL` VALUES (51,'almacennew','expeditionScanDel','employee'); -INSERT INTO `silexACL` VALUES (52,'almacennew','expeditionScanList','employee'); -INSERT INTO `silexACL` VALUES (53,'almacennew','expeditionScanPut','employee'); -INSERT INTO `silexACL` VALUES (54,'almacennew','expeditionState_addByPallet','employee'); -INSERT INTO `silexACL` VALUES (55,'almacennew','expeditionTruckAdd','employee'); -INSERT INTO `silexACL` VALUES (56,'almacennew','expeditionTruckList','employee'); -INSERT INTO `silexACL` VALUES (57,'almacennew','expedition_getState','employee'); -INSERT INTO `silexACL` VALUES (58,'almacennew','expedition_scan','employee'); -INSERT INTO `silexACL` VALUES (59,'almacennew','faultsReview','employee'); -INSERT INTO `silexACL` VALUES (60,'almacennew','faultsReview_isChecked','employee'); -INSERT INTO `silexACL` VALUES (61,'almacennew','getItemUbication','employee'); -INSERT INTO `silexACL` VALUES (62,'almacennew','get_ItemPackingType','employee'); -INSERT INTO `silexACL` VALUES (63,'almacennew','itemDiary','employee'); -INSERT INTO `silexACL` VALUES (64,'almacennew','itemPlacementSupplyAiming','employee'); -INSERT INTO `silexACL` VALUES (65,'almacennew','itemPlacementSupplyCloseOrder','employee'); -INSERT INTO `silexACL` VALUES (66,'almacennew','itemPlacementSupplyGetOrder','employee'); -INSERT INTO `silexACL` VALUES (68,'almacennew','itemShelvingBuyerGet','employee'); -INSERT INTO `silexACL` VALUES (69,'almacennew','itemShelvingBuyerTask','employee'); -INSERT INTO `silexACL` VALUES (70,'almacennew','itemShelvingDelete','employee'); -INSERT INTO `silexACL` VALUES (71,'almacennew','itemShelvingList','employee'); -INSERT INTO `silexACL` VALUES (72,'almacennew','itemShelvingLog_get','employee'); -INSERT INTO `silexACL` VALUES (73,'almacennew','itemShelvingMake','employee'); -INSERT INTO `silexACL` VALUES (74,'almacennew','itemShelvingMakeEdit','employee'); -INSERT INTO `silexACL` VALUES (75,'almacennew','itemShelvingMake_multi','employee'); -INSERT INTO `silexACL` VALUES (76,'almacennew','itemShelvingPlacementSupplyAdd','employee'); -INSERT INTO `silexACL` VALUES (77,'almacennew','itemShelvingSaleSupplyAdd','employee'); -INSERT INTO `silexACL` VALUES (78,'almacennew','itemShelvingStarsUpdate','employee'); -INSERT INTO `silexACL` VALUES (79,'almacennew','itemShelvingTransfer','employee'); -INSERT INTO `silexACL` VALUES (80,'almacennew','itemShelving_addByClaim','employee'); -INSERT INTO `silexACL` VALUES (81,'almacennew','itemShelving_filterBuyer','employee'); -INSERT INTO `silexACL` VALUES (82,'almacennew','itemShelving_getSaleDate','employee'); -INSERT INTO `silexACL` VALUES (83,'almacennew','itemTrash','employee'); -INSERT INTO `silexACL` VALUES (84,'almacennew','item_card','employee'); -INSERT INTO `silexACL` VALUES (85,'almacennew','item_getSimilar','employee'); -INSERT INTO `silexACL` VALUES (86,'almacennew','item_placement_save','employee'); -INSERT INTO `silexACL` VALUES (87,'almacennew','item_saveReference','employee'); -INSERT INTO `silexACL` VALUES (88,'almacennew','item_updatePackingShelve','employee'); -INSERT INTO `silexACL` VALUES (89,'almacennew','machineWorker_add','employee'); -INSERT INTO `silexACL` VALUES (90,'almacennew','machineWorker_getHistorical','employee'); -INSERT INTO `silexACL` VALUES (91,'almacennew','machineWorker_update','employee'); -INSERT INTO `silexACL` VALUES (92,'almacennew','machineWorker_Worker','employee'); -INSERT INTO `silexACL` VALUES (93,'almacennew','machine_checkPlate','employee'); -INSERT INTO `silexACL` VALUES (94,'almacennew','machine_getWorkerPlate','employee'); -INSERT INTO `silexACL` VALUES (95,'almacennew','mistakeType','employee'); -INSERT INTO `silexACL` VALUES (96,'almacennew','printer_get','employee'); -INSERT INTO `silexACL` VALUES (97,'almacennew','qr_getCall','developer'); -INSERT INTO `silexACL` VALUES (98,'almacennew','saleMistakeAdd','employee'); -INSERT INTO `silexACL` VALUES (99,'almacennew','saleMove','employee'); -INSERT INTO `silexACL` VALUES (100,'almacennew','saleParking_add','employee'); -INSERT INTO `silexACL` VALUES (101,'almacennew','saleTrackingDel','employee'); -INSERT INTO `silexACL` VALUES (102,'almacennew','saleTrackingReplace','employee'); -INSERT INTO `silexACL` VALUES (103,'almacennew','saleTracking_add','employee'); -INSERT INTO `silexACL` VALUES (104,'almacennew','saleTracking_addPrevOK','employee'); -INSERT INTO `silexACL` VALUES (105,'almacennew','saleTracking_updateIsChecked','employee'); -INSERT INTO `silexACL` VALUES (106,'almacennew','sectorCollectionSaleGroup_add','employee'); -INSERT INTO `silexACL` VALUES (107,'almacennew','sectorCollection_get','employee'); -INSERT INTO `silexACL` VALUES (108,'almacennew','sectorCollection_getSale','employee'); -INSERT INTO `silexACL` VALUES (109,'almacennew','sectorCollection_new','employee'); -INSERT INTO `silexACL` VALUES (110,'almacennew','sector_get','employee'); -INSERT INTO `silexACL` VALUES (111,'almacennew','shelvingChange','employee'); -INSERT INTO `silexACL` VALUES (112,'almacennew','shelvingLog_get','employee'); -INSERT INTO `silexACL` VALUES (113,'almacennew','shelvingPark','employee'); -INSERT INTO `silexACL` VALUES (114,'almacennew','shelvingParking_get','employee'); -INSERT INTO `silexACL` VALUES (115,'almacennew','shelvingPriorityUpdate','employee'); -INSERT INTO `silexACL` VALUES (116,'almacennew','sip_getExtension','employee'); -INSERT INTO `silexACL` VALUES (117,'almacennew','ticketCollection_setUsedShelves','employee'); -INSERT INTO `silexACL` VALUES (118,'almacennew','ticketOrCollection_checkFullyControlled','employee'); -INSERT INTO `silexACL` VALUES (119,'almacennew','ticketToPrePrepare','employee'); -INSERT INTO `silexACL` VALUES (120,'almacennew','ticket_checkFullyControlled','employee'); -INSERT INTO `silexACL` VALUES (121,'almacennew','ticket_setState','employee'); -INSERT INTO `silexACL` VALUES (122,'almacennew','update_ItemPackingType','employee'); -INSERT INTO `silexACL` VALUES (123,'almacennew','workerMachinery_isRegistered','employee'); -INSERT INTO `silexACL` VALUES (124,'almacennew','workerMistakeType_get','employee'); -INSERT INTO `silexACL` VALUES (125,'almacennew','workerMistake_Add','coolerBoss'); -INSERT INTO `silexACL` VALUES (126,'almacennew','workerShelving_add','employee'); -INSERT INTO `silexACL` VALUES (127,'almacennew','workerShelving_delete','employee'); -INSERT INTO `silexACL` VALUES (128,'almacennew','worker_getFromHasMistake','employee'); -INSERT INTO `silexACL` VALUES (129,'almacennew','worker_getId','employee'); -INSERT INTO `silexACL` VALUES (130,'almacennew','worker_getPrinter','employee'); -INSERT INTO `silexACL` VALUES (131,'almacennew','worker_getSector','employee'); -INSERT INTO `silexACL` VALUES (132,'almacennew','worker_updatePrinter','employee'); -INSERT INTO `silexACL` VALUES (133,'almacennew','worker_updateSector','employee'); -INSERT INTO `silexACL` VALUES (134,'almacennew','itemShelving_updateFromSale','employee'); -INSERT INTO `silexACL` VALUES (135,'almacennew','collection_getUncheckedTicket','employee'); -INSERT INTO `silexACL` VALUES (136,'almacennew','itemShelving_return','employee'); -INSERT INTO `silexACL` VALUES (137,'almacennew','itemShelving_merge','employee'); -INSERT INTO `silexACL` VALUES (139,'delivery','get_expeditionsSummary','employee'); -INSERT INTO `silexACL` VALUES (140,'almacennew','cmrExpeditionPallet_add','employee'); -INSERT INTO `silexACL` VALUES (141,'delivery','route_getExpeditionSummary','employee'); -INSERT INTO `silexACL` VALUES (142,'almacennew','item_saveStems','employee'); -INSERT INTO `silexACL` VALUES (143,'almacennew','debug_add','employee'); -INSERT INTO `silexACL` VALUES (144,'almacennew','operator_getNumberOfWagons','employee'); -INSERT INTO `silexACL` VALUES (145,'almacennew','operator_add','employee'); -INSERT INTO `silexACL` VALUES (146,'almacennew','expeditionPallet_get','employee'); -INSERT INTO `silexACL` VALUES (147,'almacennew','worker_isF11Allowed','employee'); -INSERT INTO `silexACL` VALUES (148,'almacennew','train_get','employee'); -INSERT INTO `silexACL` VALUES (149,'almacennew','saleTracking_mark','employee'); -INSERT INTO `silexACL` VALUES (150,'almacennew','operator_updateItemPackingType','employee'); -INSERT INTO `silexACL` VALUES (151,'almacennew','operator_updateTrain','employee'); -INSERT INTO `silexACL` VALUES (152,'almacennew','operator_getTrain','employee'); -INSERT INTO `silexACL` VALUES (153,'almacennew','operator_getItemPackingType','employee'); -INSERT INTO `silexACL` VALUES (154,'almacennew','collection_assign','employee'); -INSERT INTO `silexACL` VALUES (155,'almacennew','itemPacking_get','employee'); -INSERT INTO `silexACL` VALUES (156,'almacennew','shelvingLog_add','employee'); -INSERT INTO `silexACL` VALUES (157,'almacennew','collection_get','employee'); -INSERT INTO `silexACL` VALUES (158,'delivery','get_routesFromExpedition','employee'); -INSERT INTO `silexACL` VALUES (160,'almacennew','expeditionMistakeType_get','employee'); -INSERT INTO `silexACL` VALUES (161,'almacennew','expeditionMistake_add','employee'); -INSERT INTO `silexACL` VALUES (162,'almacennew','itemShelving_addList','employee'); -INSERT INTO `silexACL` VALUES (163,'almacennew','cmrPallet_add','employee'); -INSERT INTO `silexACL` VALUES (164,'almacennew','ticket_isOutClosureZone','employee'); -INSERT INTO `silexACL` VALUES (165,'almacennew','itemShelving_selfConsumption','employee'); -INSERT INTO `silexACL` VALUES (166,'almacennew','ticket_printLabelPrevious','employee'); -INSERT INTO `silexACL` VALUES (167,'almacennew','travel_updatePacking','employee'); -INSERT INTO `silexACL` VALUES (168,'app','status','$everyone'); - INSERT INTO `state` VALUES (1,'Arreglar',2,0,'FIXING',NULL,1,0,0,0,0,0,0,4,1,'alert'); INSERT INTO `state` VALUES (2,'Libre',2,0,'FREE',NULL,2,0,0,0,0,0,0,4,1,'notice'); INSERT INTO `state` VALUES (3,'OK',3,0,'OK',3,28,1,0,0,0,1,1,3,0,'success'); diff --git a/db/dump/.dump/privileges.sql b/db/dump/.dump/privileges.sql index 7776e6d5a..1af4b446a 100644 --- a/db/dump/.dump/privileges.sql +++ b/db/dump/.dump/privileges.sql @@ -1455,6 +1455,11 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','accountingType','gu INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','bankPolicyDetail','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','bankPolicyReview','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','bankPolicy','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select',''); +INSERT IGNORE INTO `tables_priv` VALUES ('','edi','hedera-web','imapMultiConfig','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select',''); +INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','salesAssistant','orderConfig','root@localhost','0000-00-00 00:00:00','Select',''); +INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemEntryOut','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select',''); +INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemEntryIn','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select',''); +INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemShelvingSale','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select',''); /*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */; /*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */; @@ -2160,9 +2165,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_recalcPricesByAwb' INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_recalcPricesByEntry','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','util','hr','accountNumberToIban','FUNCTION','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','util','financial','accountNumberToIban','FUNCTION','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); -INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','supplier_statement','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); -INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','supplier_statement','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); -INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hrBoss','supplier_statement','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); +INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','supplier_statementWithEntries','PROCEDURE','guillermo@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','adminBoss','XDiario_check','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','travel_getDetailFromContinent','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','entry_getTransfer','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); @@ -2193,6 +2196,8 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemShelvingSale_ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','sectorCollection_getMyPartial','PROCEDURE','carlosap@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','grafana-write','item_ValuateInventory','PROCEDURE','guillermo@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','guest','ticketCalculatePurge','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); +INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_getUltimate','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); +INSERT IGNORE INTO `procs_priv` VALUES ('','vn','cooler','buy_getUltimate','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); /*!40000 ALTER TABLE `procs_priv` ENABLE KEYS */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2237,7 +2242,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','grafana-write','{\"access\":0,\"ve INSERT IGNORE INTO `global_priv` VALUES ('','greenhouseBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','guest','{\"access\": 0, \"max_questions\": 40000, \"max_updates\": 1000, \"max_connections\": 150000, \"max_user_connections\": 200, \"max_statement_time\": 0.000000, \"is_role\": true, \"version_id\": 101106}'); INSERT IGNORE INTO `global_priv` VALUES ('','handmadeBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}'); -INSERT IGNORE INTO `global_priv` VALUES ('','hedera-web','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); +INSERT IGNORE INTO `global_priv` VALUES ('','hedera-web','{\"access\":0,\"version_id\":101106,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','hr','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}'); INSERT IGNORE INTO `global_priv` VALUES ('','hrBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','invoicing','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); diff --git a/db/dump/.dump/structure.sql b/db/dump/.dump/structure.sql index 4790e156c..1f04c8e78 100644 --- a/db/dump/.dump/structure.sql +++ b/db/dump/.dump/structure.sql @@ -4504,8 +4504,8 @@ CREATE TABLE `waste` ( `buyerFk` int(10) unsigned NOT NULL, `itemTypeFk` smallint(5) unsigned NOT NULL, `itemFk` int(11) NOT NULL DEFAULT 0, - `saleQuantity` decimal(10,2) DEFAULT NULL, - `saleTotal` decimal(10,2) DEFAULT NULL, + `saleTotal` decimal(10,2) DEFAULT NULL COMMENT 'Coste', + `saleWasteQuantity` decimal(10,2) DEFAULT NULL, `saleInternalWaste` decimal(10,2) DEFAULT NULL, `saleExternalWaste` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`year`,`week`,`buyerFk`,`itemTypeFk`,`itemFk`), @@ -6527,7 +6527,7 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `waste_addSales`() BEGIN - DECLARE vDateFrom DATE DEFAULT util.VN_CURDATE() - INTERVAL WEEKDAY(CURDATE()) DAY; + DECLARE vDateFrom DATE DEFAULT util.VN_CURDATE() - INTERVAL WEEKDAY(util.VN_CURDATE()) DAY; DECLARE vDateTo DATE DEFAULT vDateFrom + INTERVAL 6 DAY; CALL cache.last_buy_refresh(FALSE); @@ -6538,25 +6538,22 @@ BEGIN it.workerFk, it.id, s.itemFk, - SUM(s.quantity), - SUM((b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity) `value`, - SUM ( + SUM((b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity), + SUM(IF(aw.`type`, s.quantity, 0)), + SUM( IF( aw.`type` = 'internal', (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, 0 ) - ) internalWaste, - SUM ( + ), + SUM( IF( aw.`type` = 'external', (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, - IF(c.code = 'manaClaim', - sc.value * s.quantity, - 0 - ) + 0 ) - ) externalWaste + ) FROM vn.sale s JOIN vn.item i ON i.id = s.itemFk JOIN vn.itemType it ON it.id = i.typeFk @@ -6567,11 +6564,9 @@ BEGIN 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 - LEFT JOIN vn.saleComponent sc ON sc.saleFk = s.id - LEFT JOIN vn.component c ON c.id = sc.componentFk WHERE t.shipped BETWEEN vDateFrom AND vDateTo AND w.isManaged - GROUP BY it.id, i.id; + GROUP BY i.id; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -14378,61 +14373,64 @@ DELIMITER ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `order_confirmWithUser`(vSelf INT, vUserId INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `order_confirmWithUser`( + vSelf INT, + vUserFk INT +) BEGIN /** - * Confirms an order, creating each of its tickets on the corresponding - * date, store and user. + * Confirms an order, creating each of its tickets + * on the corresponding date, store and user. * * @param vSelf The order identifier * @param vUser The user identifier */ - DECLARE vOk BOOL; - DECLARE vDone BOOL DEFAULT FALSE; - DECLARE vWarehouse INT; + DECLARE vHasRows BOOL; + DECLARE vDone BOOL; + DECLARE vWarehouseFk INT; DECLARE vShipment DATE; - DECLARE vTicket INT; + DECLARE vShipmentDayEnd DATETIME; + DECLARE vTicketFk INT; DECLARE vNotes VARCHAR(255); - DECLARE vItem INT; + DECLARE vItemFk INT; DECLARE vConcept VARCHAR(30); DECLARE vAmount INT; + DECLARE vAvailable INT; DECLARE vPrice DECIMAL(10,2); - DECLARE vSale INT; - DECLARE vRate INT; - DECLARE vRowId INT; + DECLARE vSaleFk INT; + DECLARE vRowFk INT; DECLARE vPriceFixed DECIMAL(10,2); - DECLARE vDelivery DATE; - DECLARE vAddress INT; - DECLARE vIsConfirmed BOOL; - DECLARE vClientId INT; - DECLARE vCompanyId INT; - DECLARE vAgencyModeId INT; - DECLARE TICKET_FREE INT DEFAULT 2; - DECLARE vCalc INT; - DECLARE vIsLogifloraItem BOOL; - DECLARE vOldQuantity INT; - DECLARE vNewQuantity INT; + DECLARE vLanded DATE; + DECLARE vAddressFk INT; + DECLARE vClientFk INT; + DECLARE vCompanyFk INT; + DECLARE vAgencyModeFk INT; + DECLARE vCalcFk INT; DECLARE vIsTaxDataChecked BOOL; - DECLARE cDates CURSOR FOR - SELECT zgs.shipped, r.warehouse_id + DECLARE vDates CURSOR FOR + SELECT zgs.shipped, r.warehouseFk FROM `order` o - JOIN order_row r ON r.order_id = o.id - LEFT JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = r.warehouse_id - WHERE o.id = vSelf AND r.amount != 0 - GROUP BY r.warehouse_id; + JOIN orderRow r ON r.orderFk = o.id + LEFT JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = r.warehouseFk + WHERE o.id = vSelf + AND r.amount + GROUP BY r.warehouseFk; - DECLARE cRows CURSOR FOR - SELECT r.id, r.item_id, i.name, r.amount, r.price, r.rate, i.isFloramondo - FROM order_row r - JOIN vn.item i ON i.id = r.item_id - WHERE r.amount != 0 - AND r.warehouse_id = vWarehouse - AND r.order_id = vSelf + DECLARE vRows CURSOR FOR + SELECT r.id, + r.itemFk, + i.name, + r.amount, + r.price + FROM orderRow r + JOIN vn.item i ON i.id = r.itemFk + WHERE r.amount + AND r.warehouseFk = vWarehouseFk + AND r.orderFk = vSelf ORDER BY r.rate DESC; - DECLARE CONTINUE HANDLER FOR NOT FOUND - SET vDone = TRUE; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN @@ -14441,26 +14439,36 @@ BEGIN END; -- Carga los datos del pedido - SELECT o.date_send, o.address_id, o.note, a.clientFk, - o.company_id, o.agency_id, c.isTaxDataChecked - INTO vDelivery, vAddress, vNotes, vClientId, - vCompanyId, vAgencyModeId, vIsTaxDataChecked - FROM hedera.`order` o + SELECT o.date_send, + o.address_id, + o.note, + a.clientFk, + o.company_id, + o.agency_id, + c.isTaxDataChecked + INTO vLanded, + vAddressFk, + vNotes, + vClientFk, + vCompanyFk, + vAgencyModeFk, + vIsTaxDataChecked + FROM `order` o JOIN vn.address a ON a.id = o.address_id JOIN vn.client c ON c.id = a.clientFk WHERE o.id = vSelf; -- Verifica si el cliente tiene los datos comprobados IF NOT vIsTaxDataChecked THEN - CALL util.throw ('clientNotVerified'); + CALL util.throw('clientNotVerified'); END IF; -- Carga las fechas de salida de cada almacen - CALL vn.zone_getShipped (vDelivery, vAddress, vAgencyModeId, FALSE); + CALL vn.zone_getShipped(vLanded, vAddressFk, vAgencyModeFk, FALSE); -- Trabajador que realiza la accion - IF vUserId IS NULL THEN - SELECT employeeFk INTO vUserId FROM orderConfig; + IF vUserFk IS NULL THEN + SELECT employeeFk INTO vUserFk FROM orderConfig; END IF; START TRANSACTION; @@ -14468,207 +14476,188 @@ BEGIN CALL order_checkEditable(vSelf); -- Check order is not empty + SELECT COUNT(*) > 0 INTO vHasRows + FROM orderRow + WHERE orderFk = vSelf + AND amount > 0; - SELECT COUNT(*) > 0 INTO vOk - FROM order_row WHERE order_id = vSelf AND amount > 0; - - IF NOT vOk THEN - CALL util.throw ('ORDER_EMPTY'); + IF NOT vHasRows THEN + CALL util.throw('ORDER_EMPTY'); END IF; -- Crea los tickets del pedido - - OPEN cDates; - - lDates: - LOOP - SET vTicket = NULL; + OPEN vDates; + lDates: LOOP + SET vTicketFk = NULL; SET vDone = FALSE; - FETCH cDates INTO vShipment, vWarehouse; + FETCH vDates INTO vShipment, vWarehouseFk; IF vDone THEN LEAVE lDates; END IF; - -- Busca un ticket existente que coincida con los parametros - WITH tPrevia AS - (SELECT DISTINCT s.ticketFk + SET vShipmentDayEnd = util.dayEnd(vShipment); + + -- Busca un ticket libre disponible + WITH tPrevia AS ( + SELECT DISTINCT s.ticketFk FROM vn.sale s JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id JOIN vn.ticket t ON t.id = s.ticketFk - WHERE t.shipped BETWEEN vShipment AND util.dayend(vShipment) - ) - SELECT t.id INTO vTicket + WHERE t.shipped BETWEEN vShipment AND vShipmentDayEnd + ) + SELECT t.id INTO vTicketFk FROM vn.ticket t JOIN vn.alertLevel al ON al.code = 'FREE' LEFT JOIN tPrevia tp ON tp.ticketFk = t.id - LEFT JOIN vn.ticketState tls on tls.ticketFk = t.id - JOIN hedera.`order` o - ON o.address_id = t.addressFk - AND vWarehouse = t.warehouseFk - AND o.date_send = t.landed - AND DATE(t.shipped) = vShipment + LEFT JOIN vn.ticketState tls ON tls.ticketFk = t.id + JOIN hedera.`order` o ON o.address_id = t.addressFk + AND t.shipped BETWEEN vShipment AND vShipmentDayEnd + AND t.warehouseFk = vWarehouseFk + AND o.date_send = t.landed WHERE o.id = vSelf AND t.refFk IS NULL AND tp.ticketFk IS NULL AND (tls.alertLevel IS NULL OR tls.alertLevel = al.id) LIMIT 1; + -- Comprobamos si hay un ticket de previa disponible + IF vTicketFk IS NULL THEN + WITH tItemPackingTypeOrder AS ( + SELECT GROUP_CONCAT( + DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk + ) distinctItemPackingTypes, + o.address_id + FROM vn.item i + JOIN hedera.orderRow oro ON oro.itemFk = i.id + JOIN hedera.`order` o ON o.id = oro.orderFk + WHERE oro.orderFk = vSelf + ), + tItemPackingTypeTicket AS ( + SELECT t.id, + GROUP_CONCAT( + DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk + ) distinctItemPackingTypes + FROM vn.ticket t + JOIN vn.ticketState tls ON tls.ticketFk = t.id + JOIN vn.alertLevel al ON al.id = tls.alertLevel + JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.item i ON i.id = s.itemFk + JOIN tItemPackingTypeOrder ipto + WHERE t.shipped BETWEEN vShipment AND vShipmentDayEnd + AND t.refFk IS NULL + AND t.warehouseFk = vWarehouseFk + AND t.addressFk = ipto.address_id + AND al.code = 'ON_PREVIOUS' + GROUP BY t.id + ) + SELECT iptt.id INTO vTicketFk + FROM tItemPackingTypeTicket iptt + JOIN tItemPackingTypeOrder ipto + WHERE INSTR(iptt.distinctItemPackingTypes, ipto.distinctItemPackingTypes) + LIMIT 1; + END IF; + -- Crea el ticket en el caso de no existir uno adecuado - IF vTicket IS NULL - THEN - + IF vTicketFk IS NULL THEN SET vShipment = IFNULL(vShipment, util.VN_CURDATE()); - CALL vn.ticket_add( - vClientId, + vClientFk, vShipment, - vWarehouse, - vCompanyId, - vAddress, - vAgencyModeId, + vWarehouseFk, + vCompanyFk, + vAddressFk, + vAgencyModeFk, NULL, - vDelivery, - vUserId, + vLanded, + vUserFk, TRUE, - vTicket + vTicketFk ); ELSE INSERT INTO vn.ticketTracking - SET ticketFk = vTicket, - userFk = vUserId, - stateFk = TICKET_FREE; + SET ticketFk = vTicketFk, + userFk = vUserFk, + stateFk = (SELECT id FROM vn.state WHERE code = 'FREE'); END IF; INSERT IGNORE INTO vn.orderTicket SET orderFk = vSelf, - ticketFk = vTicket; + ticketFk = vTicketFk; -- Añade las notas - - IF vNotes IS NOT NULL AND vNotes != '' - THEN - INSERT INTO vn.ticketObservation SET - ticketFk = vTicket, - observationTypeFk = 4 /* salesperson */ , + IF vNotes IS NOT NULL AND vNotes <> '' THEN + INSERT INTO vn.ticketObservation + SET ticketFk = vTicketFk, + observationTypeFk = (SELECT id FROM vn.observationType WHERE code = 'salesPerson'), `description` = vNotes ON DUPLICATE KEY UPDATE `description` = CONCAT(VALUES(`description`),'. ', `description`); END IF; -- Añade los movimientos y sus componentes - - OPEN cRows; - + OPEN vRows; lRows: LOOP + SET vSaleFk = NULL; SET vDone = FALSE; - FETCH cRows INTO vRowId, vItem, vConcept, vAmount, vPrice, vRate, vIsLogifloraItem; + FETCH vRows INTO vRowFk, vItemFk, vConcept, vAmount, vPrice; IF vDone THEN LEAVE lRows; END IF; - SET vSale = NULL; - - SELECT s.id, s.quantity INTO vSale, vOldQuantity + SELECT s.id INTO vSaleFk FROM vn.sale s - WHERE ticketFk = vTicket + WHERE ticketFk = vTicketFk AND price = vPrice - AND itemFk = vItem + AND itemFk = vItemFk AND discount = 0 LIMIT 1; - IF vSale THEN + IF vSaleFk THEN UPDATE vn.sale SET quantity = quantity + vAmount, originalQuantity = quantity - WHERE id = vSale; - - SELECT s.quantity INTO vNewQuantity - FROM vn.sale s - WHERE id = vSale; + WHERE id = vSaleFk; ELSE -- Obtiene el coste SELECT SUM(rc.`price`) valueSum INTO vPriceFixed FROM orderRowComponent rc JOIN vn.component c ON c.id = rc.componentFk - JOIN vn.componentType ct ON ct.id = c.typeFk AND ct.isBase - WHERE rc.rowFk = vRowId; + JOIN vn.componentType ct ON ct.id = c.typeFk + AND ct.isBase + WHERE rc.rowFk = vRowFk; INSERT INTO vn.sale - SET itemFk = vItem, - ticketFk = vTicket, + SET itemFk = vItemFk, + ticketFk = vTicketFk, concept = vConcept, quantity = vAmount, price = vPrice, priceFixed = vPriceFixed, isPriceFixed = TRUE; - SET vSale = LAST_INSERT_ID(); + SET vSaleFk = LAST_INSERT_ID(); - INSERT INTO vn.saleComponent - (saleFk, componentFk, `value`) - SELECT vSale, rc.componentFk, rc.price + INSERT INTO vn.saleComponent (saleFk, componentFk, `value`) + SELECT vSaleFk, rc.componentFk, rc.price FROM orderRowComponent rc JOIN vn.component c ON c.id = rc.componentFk - WHERE rc.rowFk = vRowId - GROUP BY vSale, rc.componentFk; + WHERE rc.rowFk = vRowFk + GROUP BY vSaleFk, rc.componentFk; END IF; - UPDATE order_row SET Id_Movimiento = vSale - WHERE id = vRowId; - - -- Inserta en putOrder si la compra es de Floramondo - IF vIsLogifloraItem THEN - CALL cache.availableNoRaids_refresh(vCalc,FALSE,vWarehouse,vShipment); - - SET @available := 0; - - SELECT GREATEST(0,available) INTO @available - FROM cache.availableNoRaids - WHERE calc_id = vCalc - AND item_id = vItem; - - UPDATE cache.availableNoRaids - SET available = GREATEST(0,available - vAmount) - WHERE item_id = vItem - AND calc_id = vCalc; - - INSERT INTO edi.putOrder ( - deliveryInformationID, - supplyResponseId, - quantity , - EndUserPartyId, - EndUserPartyGLN, - FHAdminNumber, - saleFk - ) - SELECT di.ID, - i.supplyResponseFk, - CEIL((vAmount - @available)/ sr.NumberOfItemsPerCask), - o.address_id , - vClientId, - IFNULL(ca.fhAdminNumber, fhc.defaultAdminNumber), - vSale - FROM edi.deliveryInformation di - JOIN vn.item i ON i.supplyResponseFk = di.supplyResponseID - JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk - LEFT JOIN edi.clientFHAdminNumber ca ON ca.clientFk = vClientId - JOIN edi.floraHollandConfig fhc - JOIN hedera.`order` o ON o.id = vSelf - WHERE i.id = vItem - AND di.LatestOrderDateTime > util.VN_NOW() - AND vAmount > @available - LIMIT 1; - END IF; + UPDATE orderRow + SET saleFk = vSaleFk + WHERE id = vRowFk; END LOOP; - - CLOSE cRows; + CLOSE vRows; END LOOP; + CLOSE vDates; - CLOSE cDates; - - UPDATE `order` SET confirmed = TRUE, confirm_date = util.VN_NOW() + UPDATE `order` + SET confirmed = TRUE, + confirm_date = util.VN_NOW() WHERE id = vSelf; COMMIT; @@ -18986,6 +18975,7 @@ CREATE TABLE `ACL` ( `permission` set('DENY','ALLOW') DEFAULT 'ALLOW', `principalType` set('ROLE','USER') DEFAULT 'ROLE', `principalId` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `editorFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `model_ix` (`model`(255)) COMMENT 'ernesto 3.8.2020. Mysql pide indices', KEY `property_ix` (`property`(255)), @@ -18993,6 +18983,34 @@ CREATE TABLE `ACL` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `ACLLog` +-- + +DROP TABLE IF EXISTS `ACLLog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACLLog` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `originFk` int(11) DEFAULT NULL, + `userFk` int(10) unsigned DEFAULT NULL, + `action` set('insert','update','delete','select') NOT NULL, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` enum('Acl') NOT NULL DEFAULT 'Acl', + `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)), + `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)), + `changedModelId` int(11) NOT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, + `summaryId` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `logRateuserFk` (`userFk`), + KEY `ACLLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`), + KEY `ACLLog_originFk` (`originFk`,`creationDate`), + CONSTRAINT `aclUserFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `AccessToken` -- @@ -32114,6 +32132,7 @@ CREATE TABLE `invoiceInConfig` ( `daysAgo` int(10) unsigned DEFAULT 45 COMMENT 'Días en el pasado para mostrar facturas en invoiceIn series en salix', `taxRowLimit` int(11) DEFAULT 4 COMMENT 'Número máximo de líneas de IVA que puede tener una factura', `dueDateMarginDays` int(10) unsigned DEFAULT 2, + `balanceStartingDate` date NOT NULL DEFAULT '2015-01-01', PRIMARY KEY (`id`), KEY `invoiceInConfig_sageWithholdingFk` (`sageFarmerWithholdingFk`), CONSTRAINT `invoiceInConfig_sageWithholdingFk` FOREIGN KEY (`sageFarmerWithholdingFk`) REFERENCES `sage`.`TiposRetencion` (`CodigoRetencion`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -34775,7 +34794,6 @@ CREATE TABLE `packingSite` ( `scannerFk` int(11) DEFAULT NULL, `screenFk` int(11) DEFAULT NULL, `editorFk` int(10) unsigned DEFAULT NULL, - `hasNewLabelMrwMethod` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `packingSite_UN` (`code`), UNIQUE KEY `printerRfidFk` (`printerRfidFk`), @@ -35734,13 +35752,12 @@ CREATE TABLE `productionConfig` ( `collection_new_lockname` varchar(100) NOT NULL DEFAULT 'collection_new' COMMENT 'Lockname value for proc vn.collection_new', `collection_assign_lockname` varchar(100) DEFAULT 'collection_assign' COMMENT 'Lockname value for proc vn.collection_new', `defaultSectorFk` int(10) unsigned NOT NULL DEFAULT 37 COMMENT 'Default sector', - `scannableCodeType` enum('qr','barcode') NOT NULL DEFAULT 'barcode', - `scannablePreviusCodeType` enum('qr','barcode') NOT NULL DEFAULT 'barcode', `itemOlderReviewHours` int(11) NOT NULL DEFAULT 0 COMMENT 'Horas que se tienen en cuenta para comprobar si un ítem es más viejo.', `sectorFromCode` varchar(15) DEFAULT NULL COMMENT 'Sector origen que se revisa ítems más nuevos al parkinear', `sectorToCode` varchar(15) DEFAULT NULL COMMENT 'Sector destino que se revisa ítems más nuevos al parkinear', `orderMode` enum('Location','Age') NOT NULL DEFAULT 'Location', `editorFk` int(10) unsigned DEFAULT NULL, + `hasNewLabelMrwMethod` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'column to activate the new mrw integration', PRIMARY KEY (`id`), KEY `productionConfig_FK` (`shortageAddressFk`), KEY `productionConfig_FK_1` (`clientSelfConsumptionFk`), @@ -37197,6 +37214,23 @@ CREATE TABLE `saleTracking` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `saleUnit` +-- + +DROP TABLE IF EXISTS `saleUnit`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `saleUnit` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) DEFAULT NULL, + `isVisible` tinyint(1) NOT NULL DEFAULT 1, + `created` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `name_UNIQUE` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Temporary table structure for view `saleValue` -- @@ -37797,20 +37831,20 @@ CREATE TABLE `siiTypeInvoiceOut` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `silexACL` +-- Table structure for table `silexACL__` -- -DROP TABLE IF EXISTS `silexACL`; +DROP TABLE IF EXISTS `silexACL__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `silexACL` ( +CREATE TABLE `silexACL__` ( `id` int(11) NOT NULL AUTO_INCREMENT, `module` varchar(50) NOT NULL, `method` varchar(50) NOT NULL, `role` varchar(20) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `module_UNIQUE` (`module`,`method`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='@deprecated 2024-08-05 refs #7820'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38812,9 +38846,9 @@ CREATE TABLE `ticket` ( `weight` decimal(10,2) DEFAULT NULL COMMENT 'En caso de informar, se utilizará su valor para calcular el peso de la factura', `clonedFrom` int(11) DEFAULT NULL, `cmrFk` int(11) DEFAULT NULL, - `editorFk` int(10) unsigned DEFAULT NULL, `problem` set('hasTicketRequest','isFreezed','hasRisk','hasHighRisk','isTaxDataChecked','isTooLittle') NOT NULL DEFAULT '', `risk` decimal(10,2) DEFAULT NULL COMMENT 'cache calculada con el riesgo del cliente', + `editorFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `Id_Cliente` (`clientFk`), KEY `Id_Consigna` (`addressFk`), @@ -47091,8 +47125,8 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `address_updateCoordinates`( vTicketFk INT, - vLongitude INT, - vLatitude INT) + vLongitude DECIMAL(11,7), + vLatitude DECIMAL(11,7)) BEGIN /** * Actualiza las coordenadas de una dirección. @@ -51549,6 +51583,7 @@ BEGIN AND a.id IS NULL AND u.active AND c.created < util.VN_CURDATE() - INTERVAL vMonths MONTH + AND NOT u.role = (SELECT id FROM `role` WHERE name = 'supplier') AND u.id NOT IN ( SELECT DISTINCT c.id FROM client c @@ -54343,7 +54378,7 @@ BEGIN JOIN duaEntry de ON de.entryFk = e.id JOIN invoiceInConfig iic WHERE de.duaFk = vDuaFk - AND iidd.dueDated <= util.VN_CURDATE() + INTERVAL iic.dueDateMarginDays DAY; + AND iidd.dueDated < util.VN_CURDATE() + INTERVAL iic.dueDateMarginDays DAY; IF vIncorrectInvoiceInDueDay THEN CALL util.throw(CONCAT('Incorrect due date, invoice: ', vIncorrectInvoiceInDueDay)); @@ -55844,7 +55879,7 @@ BEGIN DECLARE cur CURSOR FOR SELECT bb.id buyFk, - FLOOR(ish.visible / ish.packing) ishStickers, + LEAST(bb.stickers, FLOOR(ish.visible / ish.packing)) ishStickers, bb.stickers buyStickers FROM itemShelving ish JOIN (SELECT b.id, b.itemFk, b.stickers @@ -55852,7 +55887,6 @@ BEGIN WHERE b.entryFk = vFromEntryFk ORDER BY b.stickers DESC LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk - AND bb.stickers >= FLOOR(ish.visible / ish.packing) WHERE ish.shelvingFk = vShelvingFk COLLATE utf8_general_ci AND NOT ish.isSplit GROUP BY ish.id; @@ -56480,14 +56514,21 @@ DELIMITER ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionScan_Put`(vPalletFk INT, vExpeditionFk INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionScan_Put`( + vPalletFk INT, + vExpeditionFk INT +) BEGIN - - REPLACE vn.expeditionScan(expeditionFk, palletFk) - VALUES(vExpeditionFk, vPalletFk); - - SELECT LAST_INSERT_ID() INTO vPalletFk; - + IF NOT (SELECT TRUE FROM expedition WHERE id = vExpeditionFk LIMIT 1) THEN + CALL util.throw('Expedition not exists'); + END IF; + + IF NOT (SELECT TRUE FROM expeditionPallet WHERE id = vPalletFk LIMIT 1) THEN + CALL util.throw('Pallet not exists'); + END IF; + + REPLACE expeditionScan(expeditionFk, palletFk) + VALUES(vExpeditionFk, vPalletFk); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -60923,7 +60964,7 @@ BEGIN DECLARE vSaleFk INT; DECLARE vSectorFk INT; DECLARE vSales CURSOR FOR - SELECT s.id + SELECT DISTINCT s.id FROM sectorCollectionSaleGroup sc JOIN saleGroupDetail sg ON sg.saleGroupFk = sc.saleGroupFk JOIN sale s ON sg.saleFk = s.id @@ -63909,7 +63950,7 @@ BEGIN SELECT * FROM sales UNION ALL SELECT * FROM orders - ORDER BY shipped, + ORDER BY shipped DESC, (inventorySupplierFk = entityId) DESC, alertLevel DESC, isTicket, @@ -63960,7 +64001,7 @@ BEGIN NULL reference, NULL entityType, NULL entityId, - 'Inventario calculado', + 'Inventario calculado' entityName, @a invalue, NULL `out`, @a balance, @@ -72035,7 +72076,7 @@ DELIMITER ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `supplier_statement` */; +/*!50003 DROP PROCEDURE IF EXISTS `supplier_statementWithEntries` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -72043,28 +72084,35 @@ DELIMITER ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `supplier_statement`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `supplier_statementWithEntries`( vSupplierFk INT, vCurrencyFk INT, vCompanyFk INT, vOrderBy VARCHAR(15), - vIsConciliated BOOL + vIsConciliated BOOL, + vHasEntries BOOL ) BEGIN /** - * Crea un estado de cuenta de proveedores calculando - * los saldos en euros y en la moneda especificada. - * - * @param vSupplierFk Id del proveedor - * @param vCurrencyFk Id de la moneda - * @param vCompanyFk Id de la empresa - * @param vOrderBy Criterio de ordenación - * @param vIsConciliated Indica si está conciliado o no - * @return tmp.supplierStatement - */ +* Creates a supplier statement, calculating balances in euros and the specified currency. +* +* @param vSupplierFk Supplier ID +* @param vCurrencyFk Currency ID +* @param vCompanyFk Company ID +* @param vOrderBy Order by criteria +* @param vIsConciliated Indicates whether it is reconciled or not +* @param vHasEntries Indicates if future entries must be shown +* @return tmp.supplierStatement +*/ + DECLARE vBalanceStartingDate DATETIME; + SET @euroBalance:= 0; SET @currencyBalance:= 0; + SELECT balanceStartingDate + INTO vBalanceStartingDate + FROM invoiceInConfig; + CREATE OR REPLACE TEMPORARY TABLE tmp.supplierStatement ENGINE = MEMORY SELECT *, @@ -72077,107 +72125,127 @@ BEGIN IFNULL(invoiceCurrency, 0), 2 ) currencyBalance FROM ( - SELECT * FROM - ( - SELECT NULL bankFk, - ii.companyFk, - ii.serial, - ii.id, - CASE - WHEN vOrderBy = 'issued' THEN ii.issued - WHEN vOrderBy = 'bookEntried' THEN ii.bookEntried - WHEN vOrderBy = 'booked' THEN ii.booked - WHEN vOrderBy = 'dueDate' THEN iid.dueDated - END dated, - CONCAT('S/Fra ', ii.supplierRef) sref, - IF(ii.currencyFk > 1, - ROUND(SUM(iid.foreignValue) / SUM(iid.amount), 3), - NULL - ) changeValue, - CAST(SUM(iid.amount) AS DECIMAL(10,2)) invoiceEuros, - CAST(SUM(iid.foreignValue) AS DECIMAL(10,2)) invoiceCurrency, - NULL paymentEuros, - NULL paymentCurrency, - ii.currencyFk, - ii.isBooked, - c.code, - 'invoiceIn' statementType - FROM invoiceIn ii - JOIN invoiceInDueDay iid ON iid.invoiceInFk = ii.id - JOIN currency c ON c.id = ii.currencyFk - WHERE ii.issued > '2014-12-31' - AND ii.supplierFk = vSupplierFk - AND vCurrencyFk IN (ii.currencyFk, 0) - AND vCompanyFk IN (ii.companyFk, 0) - AND (vIsConciliated = ii.isBooked OR NOT vIsConciliated) - GROUP BY iid.id - UNION ALL - SELECT p.bankFk, - p.companyFk, - NULL, - p.id, - CASE - WHEN vOrderBy = 'issued' THEN p.received - WHEN vOrderBy = 'bookEntried' THEN p.received - WHEN vOrderBy = 'booked' THEN p.received - WHEN vOrderBy = 'dueDate' THEN p.dueDated - END, - CONCAT(IFNULL(pm.name, ''), - IF(pn.concept <> '', - CONCAT(' : ', pn.concept), - '') - ), - IF(p.currencyFk > 1, p.divisa / p.amount, NULL), - NULL, - NULL, - p.amount, - p.divisa, - p.currencyFk, - p.isConciliated, - c.code, - 'payment' - FROM payment p - LEFT JOIN currency c ON c.id = p.currencyFk - LEFT JOIN accounting a ON a.id = p.bankFk - LEFT JOIN payMethod pm ON pm.id = p.payMethodFk - LEFT JOIN promissoryNote pn ON pn.paymentFk = p.id - WHERE p.received > '2014-12-31' - AND p.supplierFk = vSupplierFk - AND vCurrencyFk IN (p.currencyFk, 0) - AND vCompanyFk IN (p.companyFk, 0) - AND (vIsConciliated = p.isConciliated OR NOT vIsConciliated) - UNION ALL - SELECT NULL, - companyFk, - NULL, - se.id, - CASE - WHEN vOrderBy = 'issued' THEN se.dated - WHEN vOrderBy = 'bookEntried' THEN se.dated - WHEN vOrderBy = 'booked' THEN se.dated - WHEN vOrderBy = 'dueDate' THEN se.dueDated - END, - se.description, - 1, - amount, - NULL, - NULL, - NULL, - currencyFk, - isConciliated, - c.`code`, - 'expense' - FROM supplierExpense se - JOIN currency c ON c.id = se.currencyFk - WHERE se.supplierFk = vSupplierFk - AND vCurrencyFk IN (se.currencyFk,0) - AND vCompanyFk IN (se.companyFk,0) - AND (vIsConciliated = se.isConciliated OR NOT vIsConciliated) - ) sub - ORDER BY (dated IS NULL AND NOT isBooked), - dated, - IF(vOrderBy = 'dueDate', id, NULL) - LIMIT 10000000000000000000 + SELECT NULL bankFk, + ii.companyFk, + ii.serial, + ii.id, + CASE + WHEN vOrderBy = 'issued' THEN ii.issued + WHEN vOrderBy = 'bookEntried' THEN ii.bookEntried + WHEN vOrderBy = 'booked' THEN ii.booked + WHEN vOrderBy = 'dueDate' THEN iid.dueDated + END dated, + CONCAT('S/Fra ', ii.supplierRef) sref, + IF(ii.currencyFk > 1, + ROUND(SUM(iid.foreignValue) / SUM(iid.amount), 3), + NULL + ) changeValue, + CAST(SUM(iid.amount) AS DECIMAL(10,2)) invoiceEuros, + CAST(SUM(iid.foreignValue) AS DECIMAL(10,2)) invoiceCurrency, + NULL paymentEuros, + NULL paymentCurrency, + ii.currencyFk, + ii.isBooked, + c.code, + 'invoiceIn' statementType + FROM invoiceIn ii + JOIN invoiceInDueDay iid ON iid.invoiceInFk = ii.id + JOIN currency c ON c.id = ii.currencyFk + WHERE ii.issued >= vBalanceStartingDate + AND ii.supplierFk = vSupplierFk + AND vCurrencyFk IN (ii.currencyFk, 0) + AND vCompanyFk IN (ii.companyFk, 0) + AND (vIsConciliated = ii.isBooked OR NOT vIsConciliated) + GROUP BY iid.id + UNION ALL + SELECT p.bankFk, + p.companyFk, + NULL, + p.id, + CASE + WHEN vOrderBy = 'issued' THEN p.received + WHEN vOrderBy = 'bookEntried' THEN p.received + WHEN vOrderBy = 'booked' THEN p.received + WHEN vOrderBy = 'dueDate' THEN p.dueDated + END, + CONCAT(IFNULL(pm.name, ''), + IF(pn.concept <> '', + CONCAT(' : ', pn.concept), + '') + ), + IF(p.currencyFk > 1, p.divisa / p.amount, NULL), + NULL, + NULL, + p.amount, + p.divisa, + p.currencyFk, + p.isConciliated, + c.code, + 'payment' + FROM payment p + LEFT JOIN currency c ON c.id = p.currencyFk + LEFT JOIN accounting a ON a.id = p.bankFk + LEFT JOIN payMethod pm ON pm.id = p.payMethodFk + LEFT JOIN promissoryNote pn ON pn.paymentFk = p.id + WHERE p.received >= vBalanceStartingDate + AND p.supplierFk = vSupplierFk + AND vCurrencyFk IN (p.currencyFk, 0) + AND vCompanyFk IN (p.companyFk, 0) + AND (vIsConciliated = p.isConciliated OR NOT vIsConciliated) + UNION ALL + SELECT NULL, + companyFk, + NULL, + se.id, + CASE + WHEN vOrderBy = 'issued' THEN se.dated + WHEN vOrderBy = 'bookEntried' THEN se.dated + WHEN vOrderBy = 'booked' THEN se.dated + WHEN vOrderBy = 'dueDate' THEN se.dueDated + END, + se.description, + 1, + amount, + NULL, + NULL, + NULL, + currencyFk, + isConciliated, + c.`code`, + 'expense' + FROM supplierExpense se + JOIN currency c ON c.id = se.currencyFk + WHERE se.supplierFk = vSupplierFk + AND vCurrencyFk IN (se.currencyFk,0) + AND vCompanyFk IN (se.companyFk,0) + AND (vIsConciliated = se.isConciliated OR NOT vIsConciliated) + UNION ALL + SELECT NULL bankFk, + e.companyFk, + 'E' serial, + e.invoiceNumber id, + tr.landed dated, + CONCAT('Ent. ',e.id) sref, + 1 / ((e.commission/100)+1) changeValue, + e.invoiceAmount * (1 + (e.commission/100)), + e.invoiceAmount, + NULL, + NULL, + e.currencyFk, + FALSE isBooked, + c.code, + 'order' + FROM entry e + JOIN travel tr ON tr.id = e.travelFk + JOIN currency c ON c.id = e.currencyFk + WHERE e.supplierFk = vSupplierFk + AND tr.landed >= CURDATE() + AND e.invoiceInFk IS NULL + AND vHasEntries + ORDER BY (dated IS NULL AND NOT isBooked), + dated, + IF(vOrderBy = 'dueDate', id, NULL) + LIMIT 10000000000000000000 ) t; END ;; DELIMITER ; @@ -74119,7 +74187,6 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_cloneWeekly`( vDateTo DATE ) BEGIN - DECLARE vIsDone BOOL; DECLARE vLanding DATE; DECLARE vShipment DATE; DECLARE vWarehouseFk INT; @@ -74130,36 +74197,37 @@ BEGIN DECLARE vAgencyModeFk INT; DECLARE vNewTicket INT; DECLARE vYear INT; - DECLARE vSalesPersonFK INT; - DECLARE vItemPicker INT; + DECLARE vObservationSalesPersonFk INT + DEFAULT (SELECT id FROM observationType WHERE code = 'salesPerson'); + DECLARE vObservationItemPickerFk INT + DEFAULT (SELECT id FROM observationType WHERE code = 'itemPicker'); + DECLARE vEmail VARCHAR(255); + DECLARE vIsDuplicateMail BOOL; + DECLARE vSubject VARCHAR(100); + DECLARE vMessage TEXT; + DECLARE vDone BOOL; - DECLARE rsTicket CURSOR FOR - SELECT tt.ticketFk, - t.clientFk, - t.warehouseFk, - t.companyFk, - t.addressFk, - tt.agencyModeFk, - ti.dated - FROM ticketWeekly tt - JOIN ticket t ON tt.ticketFk = t.id - JOIN tmp.time ti - WHERE WEEKDAY(ti.dated) = tt.weekDay; + DECLARE vTickets CURSOR FOR + SELECT tt.ticketFk, + t.clientFk, + t.warehouseFk, + t.companyFk, + t.addressFk, + tt.agencyModeFk, + ti.dated + FROM ticketWeekly tt + JOIN ticket t ON tt.ticketFk = t.id + JOIN tmp.time ti + WHERE WEEKDAY(ti.dated) = tt.weekDay; - DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE; - - CALL `util`.`time_generate`(vDateFrom,vDateTo); - - OPEN rsTicket; - myLoop: LOOP - BEGIN - DECLARE vSalesPersonEmail VARCHAR(150); - DECLARE vIsDuplicateMail BOOL; - DECLARE vSubject VARCHAR(150); - DECLARE vMessage TEXT; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - SET vIsDone = FALSE; - FETCH rsTicket INTO + CALL `util`.`time_generate`(vDateFrom, vDateTo); + + OPEN vTickets; + l: LOOP + SET vDone = FALSE; + FETCH vTickets INTO vTicketFk, vClientFk, vWarehouseFk, @@ -74168,11 +74236,11 @@ BEGIN vAgencyModeFk, vShipment; - IF vIsDone THEN - LEAVE myLoop; + IF vDone THEN + LEAVE l; END IF; - -- busca si el ticket ya ha sido clonado + -- Busca si el ticket ya ha sido clonado IF EXISTS (SELECT TRUE FROM ticket tOrig JOIN sale saleOrig ON tOrig.id = saleOrig.ticketFk JOIN saleCloned sc ON sc.saleOriginalFk = saleOrig.id @@ -74182,7 +74250,7 @@ BEGIN AND tClon.isDeleted = FALSE AND DATE(tClon.shipped) = vShipment) THEN - ITERATE myLoop; + ITERATE l; END IF; IF vAgencyModeFk IS NULL THEN @@ -74222,15 +74290,15 @@ BEGIN priceFixed, isPriceFixed) SELECT vNewTicket, - saleOrig.itemFk, - saleOrig.concept, - saleOrig.quantity, - saleOrig.price, - saleOrig.discount, - saleOrig.priceFixed, - saleOrig.isPriceFixed - FROM sale saleOrig - WHERE saleOrig.ticketFk = vTicketFk; + itemFk, + concept, + quantity, + price, + discount, + priceFixed, + isPriceFixed + FROM sale + WHERE ticketFk = vTicketFk; INSERT IGNORE INTO saleCloned(saleOriginalFk, saleClonedFk) SELECT saleOriginal.id, saleClon.id @@ -74267,15 +74335,7 @@ BEGIN attenderFk, vNewTicket FROM ticketRequest - WHERE ticketFk =vTicketFk; - - SELECT id INTO vSalesPersonFK - FROM observationType - WHERE code = 'salesPerson'; - - SELECT id INTO vItemPicker - FROM observationType - WHERE code = 'itemPicker'; + WHERE ticketFk = vTicketFk; INSERT INTO ticketObservation( ticketFk, @@ -74283,7 +74343,7 @@ BEGIN description) VALUES( vNewTicket, - vSalesPersonFK, + vObservationSalesPersonFk, CONCAT('turno desde ticket: ',vTicketFk)) ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' '); @@ -74293,16 +74353,17 @@ BEGIN description) VALUES( vNewTicket, - vItemPicker, + vObservationItemPickerFk, 'ATENCION: Contiene lineas de TURNO') ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' '); - IF (vLanding IS NULL) THEN - - SELECT e.email INTO vSalesPersonEmail + IF vLanding IS NULL THEN + SELECT IFNULL(d.notificationEmail, e.email) INTO vEmail FROM client c JOIN account.emailUser e ON e.userFk = c.salesPersonFk + LEFT JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk + LEFT JOIN department d ON d.id = wd.departmentFk WHERE c.id = vClientFk; SET vSubject = CONCAT('Turnos - No se ha podido clonar correctamente el ticket ', @@ -74314,21 +74375,22 @@ BEGIN SELECT COUNT(*) INTO vIsDuplicateMail FROM mail - WHERE receiver = vSalesPersonEmail + WHERE receiver = vEmail AND subject = vSubject; IF NOT vIsDuplicateMail THEN - CALL mail_insert(vSalesPersonEmail, NULL, vSubject, vMessage); + CALL mail_insert(vEmail, NULL, vSubject, vMessage); END IF; CALL ticket_setState(vNewTicket, 'FIXING'); ELSE CALL ticketCalculateClon(vNewTicket, vTicketFk); END IF; - - END; END LOOP; - CLOSE rsTicket; - DROP TEMPORARY TABLE IF EXISTS tmp.time, tmp.zoneGetLanded; + CLOSE vTickets; + + DROP TEMPORARY TABLE IF EXISTS + tmp.time, + tmp.zoneGetLanded; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -81972,55 +82034,57 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getAddresses`( vSelf INT, - vLanded DATE + vShipped DATE, + vDepartmentFk INT ) BEGIN /** * Devuelve un listado de todos los clientes activos * con consignatarios a los que se les puede - * vender producto para esa zona y no tiene un ticket - * para ese día. + * vender producto para esa zona. * * @param vSelf Id de zona - * @param vDated Fecha de entrega + * @param vShipped Fecha de envio + * @param vDepartmentFk Id de departamento * @return Un select */ CALL zone_getPostalCode(vSelf); - WITH notHasTicket AS ( - SELECT id - FROM vn.client - WHERE id NOT IN ( - SELECT clientFk - FROM vn.ticket - WHERE landed BETWEEN vLanded AND util.dayEnd(vLanded) - ) + WITH clientWithTicket AS ( + SELECT clientFk + FROM vn.ticket + WHERE shipped BETWEEN vShipped AND util.dayEnd(vShipped) ) - SELECT c.id clientFk, - c.name, - c.phone, - bt.description, - c.salesPersonFk, - u.name username, - aai.invoiced, - cnb.lastShipped - FROM vn.client c - JOIN notHasTicket ON notHasTicket.id = c.id - LEFT JOIN account.`user` u ON u.id = c.salesPersonFk - JOIN vn.`address` a ON a.clientFk = c.id - JOIN vn.postCode pc ON pc.code = a.postalCode - JOIN vn.town t ON t.id = pc.townFk AND t.provinceFk = a.provinceFk - JOIN vn.zoneGeo zg ON zg.name = a.postalCode - JOIN tmp.zoneNodes zn ON zn.geoFk = pc.geoFk - LEFT JOIN bs.clientNewBorn cnb ON cnb.clientFk = c.id - LEFT JOIN vn.annualAverageInvoiced aai ON aai.clientFk = c.id - JOIN vn.clientType ct ON ct.code = c.typeFk - JOIN vn.businessType bt ON bt.code = c.businessTypeFk - WHERE a.isActive - AND c.isActive - AND ct.code = 'normal' - AND bt.code <> 'worker' - GROUP BY c.id; + SELECT c.id, + c.name, + c.phone, + bt.description, + c.salesPersonFk, + u.name username, + aai.invoiced, + cnb.lastShipped, + cwt.clientFk + FROM vn.client c + JOIN vn.worker w ON w.id = c.salesPersonFk + JOIN vn.workerDepartment wd ON wd.workerFk = w.id + JOIN vn.department d ON d.id = wd.departmentFk + LEFT JOIN clientWithTicket cwt ON cwt.clientFk = c.id + LEFT JOIN account.`user` u ON u.id = c.salesPersonFk + JOIN vn.`address` a ON a.clientFk = c.id + JOIN vn.postCode pc ON pc.code = a.postalCode + JOIN vn.town t ON t.id = pc.townFk AND t.provinceFk = a.provinceFk + JOIN vn.zoneGeo zg ON zg.name = a.postalCode + JOIN tmp.zoneNodes zn ON zn.geoFk = pc.geoFk + LEFT JOIN bs.clientNewBorn cnb ON cnb.clientFk = c.id + LEFT JOIN vn.annualAverageInvoiced aai ON aai.clientFk = c.id + JOIN vn.clientType ct ON ct.code = c.typeFk + JOIN vn.businessType bt ON bt.code = c.businessTypeFk + WHERE a.isActive + AND c.isActive + AND ct.code = 'normal' + AND bt.code <> 'worker' + AND (d.id = vDepartmentFk OR NOT vDepartmentFk) + GROUP BY c.id; DROP TEMPORARY TABLE tmp.zoneNodes; END ;; @@ -91355,4 +91419,4 @@ USE `vn2008`; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-08-06 6:02:57 +-- Dump completed on 2024-08-20 7:45:07 diff --git a/db/dump/.dump/triggers.sql b/db/dump/.dump/triggers.sql index 014bce729..a968277b9 100644 --- a/db/dump/.dump/triggers.sql +++ b/db/dump/.dump/triggers.sql @@ -1423,6 +1423,70 @@ DELIMITER ; -- USE `salix`; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `salix`.`ACL_beforeInsert` + BEFORE INSERT ON `ACL` + FOR EACH ROW +BEGIN + SET NEW.editorFk = account.myUser_getId(); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `salix`.`ACL_beforeUpdate` + BEFORE UPDATE ON `ACL` + FOR EACH ROW +BEGIN + SET NEW.editorFk = account.myUser_getId(); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `salix`.`ACL_afterDelete` + AFTER DELETE ON `ACL` + FOR EACH ROW +BEGIN + INSERT INTO ACLLog + SET `action` = 'delete', + `changedModel` = 'Acl', + `changedModelId` = OLD.id, + `userFk` = account.myUser_getId(); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; -- -- Current Database: `srt` @@ -9220,7 +9284,13 @@ BEGIN SET NEW.editorFk = account.myUser_getId(); IF NOT (NEW.routeFk <=> OLD.routeFk) THEN - IF NEW.isSigned THEN + IF NEW.isSigned AND NOT ( + SELECT (COUNT(s.id) = COUNT(cb.saleFk) + AND SUM(s.quantity) = SUM(cb.quantity)) + FROM sale s + LEFT JOIN claimBeginning cb ON cb.saleFk = s.id + WHERE s.ticketFk = NEW.id + ) THEN CALL util.throw('A signed ticket cannot be rerouted'); END IF; INSERT IGNORE INTO routeRecalc(routeFk) @@ -11142,4 +11212,4 @@ USE `vn2008`; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-08-06 6:03:19 +-- Dump completed on 2024-08-20 7:45:23 diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 6563292dd..4533b67af 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -412,7 +412,7 @@ INSERT INTO `vn`.`clientManaCache`(`clientFk`, `mana`, `dated`) (1103, 0, 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 (1, 'B2B'), (2, 'CORE'), @@ -632,7 +632,7 @@ INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaF ('A', 'Global nacional', 1, 'NATIONAL', 0, 'global'), ('T', 'Española rapida', 1, 'NATIONAL', 0, 'quick'), ('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), ('E', 'Exportación rápida', 0, 'WORLD', 0, 'quick'); @@ -3945,11 +3945,11 @@ VALUES (35, 'ES12346B12345679', 3, 241); INSERT INTO vn.accountDetailType -(id, description) +(id, description, code) VALUES - (1, 'IBAN'), - (2, 'SWIFT'), - (3, 'Referencia Remesas'), - (4, 'Referencia Transferencias'), - (5, 'Referencia Nominas'), - (6, 'ABA'); + (1, 'IBAN', 'iban'), + (2, 'SWIFT', 'swift'), + (3, 'Referencia Remesas', 'remRef'), + (4, 'Referencia Transferencias', 'trnRef'), + (5, 'Referencia Nominas', 'payRef'), + (6, 'ABA', 'aba'); diff --git a/db/routines/srt/events/moving_clean.sql b/db/routines/srt/events/moving_clean.sql index a6f7792a2..18644a9f8 100644 --- a/db/routines/srt/events/moving_clean.sql +++ b/db/routines/srt/events/moving_clean.sql @@ -1,13 +1,9 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `srt`.`moving_clean` - ON SCHEDULE EVERY 5 MINUTE + ON SCHEDULE EVERY 15 MINUTE STARTS '2022-01-21 00:00:00.000' ON COMPLETION PRESERVE ENABLE COMMENT 'Llama a srt.moving_clean para que elimine y notifique de registr' -DO BEGIN - - CALL srt.moving_clean(); - -END$$ +DO CALL srt.moving_clean()$$ DELIMITER ; diff --git a/db/routines/srt/procedures/moving_clean.sql b/db/routines/srt/procedures/moving_clean.sql index b8fae7ff4..a5bbc7e70 100644 --- a/db/routines/srt/procedures/moving_clean.sql +++ b/db/routines/srt/procedures/moving_clean.sql @@ -3,61 +3,69 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `srt`.`moving_clean`() BEGIN /** * Elimina movimientos por inactividad - * */ DECLARE vExpeditionFk INT; - DECLARE vBufferToFk INT; DECLARE vBufferFromFk INT; - DECLARE done BOOL DEFAULT FALSE; - - DECLARE cur CURSOR FOR - SELECT m.expeditionFk, m.bufferToFk, m.bufferFromFk - FROM srt.moving m - JOIN srt.config c - JOIN (SELECT bufferFk, SUM(isActive) hasBox - FROM srt.photocell - GROUP BY bufferFk) sub ON sub.bufferFk = m.bufferFromFk - WHERE m.created < TIMESTAMPADD(MINUTE, - c.movingMaxLife , util.VN_NOW()) + DECLARE vStateOutFk INT + DEFAULT (SELECT id FROM expeditionState WHERE `description` = 'OUT'); + DECLARE vDone BOOL; + DECLARE vSorter CURSOR FOR + SELECT m.expeditionFk, m.bufferFromFk + FROM moving m + JOIN ( + SELECT bufferFk, SUM(isActive) hasBox + FROM photocell + GROUP BY bufferFk + ) sub ON sub.bufferFk = m.bufferFromFk + WHERE m.created < (util.VN_NOW() - INTERVAL (SELECT movingMaxLife FROM config) MINUTE) AND NOT sub.hasBox; - DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - OPEN cur; + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; - bucle: LOOP + OPEN vSorter; + l: LOOP + SET vDone = FALSE; + FETCH vSorter INTO vExpeditionFk, vBufferFromFk; - FETCH cur INTO vExpeditionFk, vBufferToFk, vBufferFromFk; - - IF done THEN - LEAVE bucle; + IF vDone THEN + LEAVE l; END IF; - DELETE FROM srt.moving + START TRANSACTION; + + SELECT id + FROM moving + WHERE expeditionFk = vExpeditionFk + FOR UPDATE; + + DELETE FROM moving WHERE expeditionFk = vExpeditionFk; - UPDATE srt.expedition e - JOIN srt.expeditionState es ON es.description = 'OUT' - SET - bufferFk = NULL, + SELECT id + FROM expedition + WHERE id = vExpeditionFk + OR (bufferFk = vBufferFromFk AND `position` > 0) + FOR UPDATE; + + UPDATE expedition + SET bufferFk = NULL, `position` = NULL, - stateFk = es.id - WHERE e.id = vExpeditionFk; + stateFk = vStateOutFk + WHERE id = vExpeditionFk; - UPDATE srt.expedition e - SET e.`position` = e.`position` - 1 - WHERE e.bufferFk = vBufferFromFk - AND e.`position` > 0; - - CALL vn.mail_insert( - 'pako@verdnatura.es, carles@verdnatura.es', - NULL, - CONCAT('Moving_clean. Expedition: ', vExpeditionFk, ' estaba parada'), - CONCAT('Expedition: ', vExpeditionFk,' vBufferToFk: ', vBufferToFk) - ); - - END LOOP bucle; - - CLOSE cur; + UPDATE expedition + SET `position` = `position` - 1 + WHERE bufferFk = vBufferFromFk + AND `position` > 0; + COMMIT; + END LOOP l; + CLOSE vSorter; END$$ DELIMITER ; diff --git a/db/routines/srt/triggers/buffer_afterDelete.sql b/db/routines/srt/triggers/buffer_afterDelete.sql new file mode 100644 index 000000000..d554e6364 --- /dev/null +++ b/db/routines/srt/triggers/buffer_afterDelete.sql @@ -0,0 +1,12 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `srt`.`buffer_afterDelete` + AFTER DELETE ON `buffer` + FOR EACH ROW +BEGIN + INSERT INTO buffer + SET `action` = 'delete', + `changedModel` = 'Buffer', + `changedModelId` = OLD.id, + `userFk` = account.myUser_getId(); +END$$ +DELIMITER ; diff --git a/db/routines/srt/triggers/buffer_beforeInsert.sql b/db/routines/srt/triggers/buffer_beforeInsert.sql new file mode 100644 index 000000000..6b1e05362 --- /dev/null +++ b/db/routines/srt/triggers/buffer_beforeInsert.sql @@ -0,0 +1,8 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `srt`.`buffer_beforeInsert` + BEFORE INSERT ON `buffer` + FOR EACH ROW +BEGIN + SET NEW.editorFk = account.myUser_getId(); +END$$ +DELIMITER ; diff --git a/db/routines/srt/triggers/buffer_beforeUpdate.sql b/db/routines/srt/triggers/buffer_beforeUpdate.sql new file mode 100644 index 000000000..86418a551 --- /dev/null +++ b/db/routines/srt/triggers/buffer_beforeUpdate.sql @@ -0,0 +1,8 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `srt`.`buffer_beforeUpdate` + BEFORE UPDATE ON `buffer` + FOR EACH ROW +BEGIN + SET NEW.editorFk = account.myUser_getId(); +END$$ +DELIMITER ; diff --git a/db/routines/srt/triggers/config_afterDelete.sql b/db/routines/srt/triggers/config_afterDelete.sql new file mode 100644 index 000000000..1e4af9104 --- /dev/null +++ b/db/routines/srt/triggers/config_afterDelete.sql @@ -0,0 +1,12 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `srt`.`config_afterDelete` + AFTER DELETE ON `config` + FOR EACH ROW +BEGIN + INSERT INTO config + SET `action` = 'delete', + `changedModel` = 'Config', + `changedModelId` = OLD.id, + `userFk` = account.myUser_getId(); +END$$ +DELIMITER ; diff --git a/db/routines/srt/triggers/config_beforeInsert.sql b/db/routines/srt/triggers/config_beforeInsert.sql new file mode 100644 index 000000000..7d8389646 --- /dev/null +++ b/db/routines/srt/triggers/config_beforeInsert.sql @@ -0,0 +1,8 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `srt`.`config_beforeInsert` + BEFORE INSERT ON `config` + FOR EACH ROW +BEGIN + SET NEW.editorFk = account.myUser_getId(); +END$$ +DELIMITER ; diff --git a/db/routines/srt/triggers/config_beforeUpdate.sql b/db/routines/srt/triggers/config_beforeUpdate.sql new file mode 100644 index 000000000..0002fb4d6 --- /dev/null +++ b/db/routines/srt/triggers/config_beforeUpdate.sql @@ -0,0 +1,8 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `srt`.`config_beforeUpdate` + BEFORE UPDATE ON `config` + FOR EACH ROW +BEGIN + SET NEW.editorFk = account.myUser_getId(); +END$$ +DELIMITER ; diff --git a/db/routines/vn/functions/invoiceSerial.sql b/db/routines/vn/functions/invoiceSerial.sql index 66448ac9c..9df887cf5 100644 --- a/db/routines/vn/functions/invoiceSerial.sql +++ b/db/routines/vn/functions/invoiceSerial.sql @@ -1,26 +1,32 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`invoiceSerial`(vClientFk INT, vCompanyFk INT, vType CHAR(1)) - RETURNS char(1) CHARSET utf8mb3 COLLATE utf8mb3_general_ci +CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`invoiceSerial`(vClientFk INT, vCompanyFk INT, vType CHAR(15)) + RETURNS char(2) CHARSET utf8mb3 COLLATE utf8mb3_general_ci DETERMINISTIC BEGIN /** - * Obtiene la serie de de una factura + * Obtiene la serie de una factura * dependiendo del area del cliente. - * + * * @param vClientFk Id del cliente * @param vCompanyFk Id de la empresa - * @param vType Tipo de factura ["R", "M", "G"] - * @return Serie de la factura + * @param vType Tipo de factura ['global','multiple','quick'] + * @return vSerie de la factura */ - DECLARE vTaxArea VARCHAR(25); - DECLARE vSerie CHAR(1); + DECLARE vTaxArea VARCHAR(25) COLLATE utf8mb3_general_ci; + DECLARE vSerie CHAR(2); IF (SELECT hasInvoiceSimplified FROM client WHERE id = vClientFk) THEN RETURN 'S'; END IF; - SELECT clientTaxArea(vClientFk, vCompanyFk) INTO vTaxArea; - SELECT invoiceSerialArea(vType,vTaxArea) INTO vSerie; + SELECT addressTaxArea(defaultAddressFk, vCompanyFk) INTO vTaxArea + FROM client + WHERE id = vClientFk; + + SELECT code INTO vSerie + FROM invoiceOutSerial + WHERE `type` = vType AND taxAreaFk = vTaxArea; + RETURN vSerie; END$$ DELIMITER ; diff --git a/db/routines/vn/functions/invoiceSerialArea.sql b/db/routines/vn/functions/invoiceSerialArea.sql deleted file mode 100644 index 02edd83f2..000000000 --- a/db/routines/vn/functions/invoiceSerialArea.sql +++ /dev/null @@ -1,34 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`invoiceSerialArea`(vType CHAR(1), vTaxArea VARCHAR(25)) - RETURNS char(1) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci - DETERMINISTIC -BEGIN - DECLARE vSerie CHAR(1); - - IF vType = 'R' THEN - SELECT - CASE vTaxArea - WHEN 'CEE' THEN 'H' - WHEN 'WORLD' THEN 'E' - ELSE 'T' - END INTO vSerie; - -- Factura multiple - ELSEIF vType = 'M' THEN - SELECT - CASE vTaxArea - WHEN 'CEE' THEN 'H' - WHEN 'WORLD' THEN 'E' - ELSE 'M' - END INTO vSerie; - -- Factura global - ELSEIF vType = 'G' THEN - SELECT - CASE vTaxArea - WHEN 'CEE' THEN 'V' - WHEN 'WORLD' THEN 'X' - ELSE 'A' - END INTO vSerie; - END IF; - RETURN vSerie; -END$$ -DELIMITER ; diff --git a/db/routines/vn/procedures/invoiceOut_new.sql b/db/routines/vn/procedures/invoiceOut_new.sql index c9b94027e..43d0a09a1 100644 --- a/db/routines/vn/procedures/invoiceOut_new.sql +++ b/db/routines/vn/procedures/invoiceOut_new.sql @@ -97,7 +97,7 @@ BEGIN AND (vCorrectingSerial = vSerial OR NOT hasAnyNegativeBase()) THEN - -- el trigger añade el siguiente Id_Factura correspondiente a la vSerial + -- el trigger añade el siguiente ref correspondiente a la vSerial INSERT INTO invoiceOut( ref, serial, diff --git a/db/routines/vn/procedures/item_getBalance.sql b/db/routines/vn/procedures/item_getBalance.sql index 46e4bafcc..3a594c81c 100644 --- a/db/routines/vn/procedures/item_getBalance.sql +++ b/db/routines/vn/procedures/item_getBalance.sql @@ -189,7 +189,7 @@ BEGIN SELECT * FROM sales UNION ALL SELECT * FROM orders - ORDER BY shipped DESC, + ORDER BY shipped, (inventorySupplierFk = entityId) DESC, alertLevel DESC, isTicket, diff --git a/db/routines/vn/procedures/ticket_close.sql b/db/routines/vn/procedures/ticket_close.sql index 7f52e81a7..97da5057c 100644 --- a/db/routines/vn/procedures/ticket_close.sql +++ b/db/routines/vn/procedures/ticket_close.sql @@ -2,7 +2,7 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_close`() BEGIN /** - * Realiza el cierre de todos los + * Realiza el cierre de todos los * tickets de la tabla tmp.ticket_close. * * @table tmp.ticket_close(ticketFk) Identificadores de los tickets a cerrar @@ -20,7 +20,7 @@ BEGIN DECLARE cur CURSOR FOR SELECT ticketFk FROM tmp.ticket_close; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN RESIGNAL; @@ -30,7 +30,7 @@ BEGIN proc: LOOP SET vDone = FALSE; - + FETCH cur INTO vCurTicketFk; IF vDone THEN @@ -47,12 +47,12 @@ BEGIN c.hasToInvoice INTO vClientFk, vIsTaxDataChecked, - vCompanyFk, + vCompanyFk, vShipped, vHasDailyInvoice, vWithPackage, vHasToInvoice - FROM ticket t + FROM ticket t JOIN `client` c ON c.id = t.clientFk JOIN province p ON p.id = c.provinceFk LEFT JOIN autonomy a ON a.id = p.autonomyFk @@ -62,7 +62,7 @@ BEGIN INSERT INTO ticketPackaging (ticketFk, packagingFk, quantity) (SELECT vCurTicketFk, p.id, COUNT(*) - FROM expedition e + FROM expedition e JOIN packaging p ON p.id = e.packagingFk JOIN ticket t ON t.id = e.ticketFk LEFT JOIN agencyMode am ON am.id = t.agencyModeFk @@ -73,15 +73,15 @@ BEGIN GROUP BY p.itemFk); -- No retornables o no catalogados - INSERT INTO sale (itemFk, ticketFk, concept, quantity, price, isPriceFixed) + INSERT INTO sale (itemFk, ticketFk, concept, quantity, price, isPriceFixed) (SELECT e.freightItemFk, vCurTicketFk, i.name, COUNT(*) AS amount, getSpecialPrice(e.freightItemFk, vClientFk), 1 - FROM expedition e + FROM expedition e JOIN item i ON i.id = e.freightItemFk LEFT JOIN packaging p ON p.itemFk = i.id WHERE e.ticketFk = vCurTicketFk AND IFNULL(p.isPackageReturnable, 0) = 0 AND getSpecialPrice(e.freightItemFk, vClientFk) > 0 GROUP BY e.freightItemFk); - + IF(vHasDailyInvoice) AND vHasToInvoice THEN -- Facturacion rapida @@ -89,10 +89,10 @@ BEGIN -- Facturar si está contabilizado IF vIsTaxDataChecked THEN CALL invoiceOut_newFromClient( - vClientFk, - (SELECT invoiceSerial(vClientFk, vCompanyFk, 'M')), - vShipped, - vCompanyFk, + vClientFk, + (SELECT invoiceSerial(vClientFk, vCompanyFk, 'multiple')), + vShipped, + vCompanyFk, NULL, NULL, vNewInvoiceId); diff --git a/db/routines/vn/procedures/ticket_recalcByScope.sql b/db/routines/vn/procedures/ticket_recalcByScope.sql index 41105fe23..ede755187 100644 --- a/db/routines/vn/procedures/ticket_recalcByScope.sql +++ b/db/routines/vn/procedures/ticket_recalcByScope.sql @@ -14,16 +14,28 @@ BEGIN DECLARE vTicketFk INT; DECLARE cTickets CURSOR FOR - SELECT id FROM ticket - WHERE refFk IS NULL - AND ((vScope = 'client' AND clientFk = vId) - OR (vScope = 'address' AND addressFk = vId)); + SELECT DISTINCT t.id + FROM ticket t + LEFT JOIN tItems ti ON ti.id = t.id + WHERE t.refFk IS NULL + AND ((vScope = 'client' AND t.clientFk = vId) + OR (vScope = 'address' AND t.addressFk = vId) + OR (vScope = 'item' AND ti.id) + ); - DECLARE CONTINUE HANDLER FOR NOT FOUND - SET vDone = TRUE; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; + + CREATE OR REPLACE TEMPORARY TABLE tItems + (PRIMARY KEY (id)) + ENGINE = MEMORY + SELECT DISTINCT t.id + FROM ticket t + JOIN sale s ON s.ticketFk = t.id + JOIN itemTaxCountry itc ON itc.itemFk = s.itemFk + WHERE t.refFk IS NULL + AND (vScope = 'item' AND itc.itemFk = vId); OPEN cTickets; - myLoop: LOOP SET vDone = FALSE; FETCH cTickets INTO vTicketFk; @@ -34,7 +46,8 @@ BEGIN CALL ticket_recalc(vTicketFk, NULL); END LOOP; - CLOSE cTickets; + + DROP TEMPORARY TABLE tItems; END$$ DELIMITER ; diff --git a/db/routines/vn/triggers/roadmap_beforeInsert.sql b/db/routines/vn/triggers/roadmap_beforeInsert.sql new file mode 100644 index 000000000..df07d5540 --- /dev/null +++ b/db/routines/vn/triggers/roadmap_beforeInsert.sql @@ -0,0 +1,12 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`roadmap_beforeInsert` + BEFORE INSERT ON `roadmap` + FOR EACH ROW +BEGIN + IF NEW.driver1Fk IS NOT NULL THEN + SET NEW.driverName = (SELECT firstName FROM worker WHERE id = NEW.driver1Fk); + ELSE + SET NEW.driverName = NULL; + END IF; +END$$ +DELIMITER ; \ No newline at end of file diff --git a/db/routines/vn/triggers/roadmap_beforeUpdate.sql b/db/routines/vn/triggers/roadmap_beforeUpdate.sql new file mode 100644 index 000000000..4905a0442 --- /dev/null +++ b/db/routines/vn/triggers/roadmap_beforeUpdate.sql @@ -0,0 +1,12 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`roadmap_beforeUpdate` + BEFORE UPDATE ON `roadmap` + FOR EACH ROW +BEGIN + IF NEW.driver1Fk IS NOT NULL THEN + SET NEW.driverName = (SELECT firstName FROM worker WHERE id = NEW.driver1Fk); + ELSE + SET NEW.driverName = NULL; + END IF; +END$$ +DELIMITER ; \ No newline at end of file diff --git a/db/routines/vn2008/views/mandato_tipo.sql b/db/routines/vn2008/views/mandato_tipo.sql index a1b5b0a9f..bc3f74632 100644 --- a/db/routines/vn2008/views/mandato_tipo.sql +++ b/db/routines/vn2008/views/mandato_tipo.sql @@ -2,5 +2,5 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vn2008`.`mandato_tipo` AS SELECT `m`.`id` AS `idmandato_tipo`, - `m`.`name` AS `Nombre` + `m`.`code` AS `Nombre` FROM `vn`.`mandateType` `m` diff --git a/db/versions/11141-azureRoebelini/00-firstScript.sql b/db/versions/11141-azureRoebelini/00-firstScript.sql new file mode 100644 index 000000000..fd6d79cfb --- /dev/null +++ b/db/versions/11141-azureRoebelini/00-firstScript.sql @@ -0,0 +1 @@ +ALTER TABLE srt.moving DROP INDEX moving_fk1_idx; diff --git a/db/versions/11142-aquaGerbera/00-invoiceOutSerialColumn.sql b/db/versions/11142-aquaGerbera/00-invoiceOutSerialColumn.sql new file mode 100644 index 000000000..09ac00401 --- /dev/null +++ b/db/versions/11142-aquaGerbera/00-invoiceOutSerialColumn.sql @@ -0,0 +1,4 @@ +ALTER TABLE vn.invoiceOutSerial + MODIFY COLUMN `type` enum('global','quick','multiple') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL; + +CREATE UNIQUE INDEX invoiceOutSerial_taxAreaFk_IDX USING BTREE ON vn.invoiceOutSerial (taxAreaFk,`type`); diff --git a/db/versions/11142-aquaGerbera/01-invoiceOutSerialUpdate.sql b/db/versions/11142-aquaGerbera/01-invoiceOutSerialUpdate.sql new file mode 100644 index 000000000..fad33b5dc --- /dev/null +++ b/db/versions/11142-aquaGerbera/01-invoiceOutSerialUpdate.sql @@ -0,0 +1,3 @@ +UPDATE vn.invoiceOutSerial + SET `type`='multiple' + WHERE `description` LIKE '%Múltiple%'; diff --git a/db/versions/11191-chocolateBirch/00-firstScript.sql b/db/versions/11191-chocolateBirch/00-firstScript.sql new file mode 100644 index 000000000..4c9924a42 --- /dev/null +++ b/db/versions/11191-chocolateBirch/00-firstScript.sql @@ -0,0 +1,3 @@ +ALTER TABLE vn.mandateType + CHANGE name code VARCHAR(45) NOT NULL, + ADD UNIQUE (code); \ No newline at end of file diff --git a/db/versions/11191-chocolateBirch/01-firstScript.sql b/db/versions/11191-chocolateBirch/01-firstScript.sql new file mode 100644 index 000000000..c69e92d51 --- /dev/null +++ b/db/versions/11191-chocolateBirch/01-firstScript.sql @@ -0,0 +1,3 @@ +ALTER TABLE vn.accountDetailType + ADD COLUMN code VARCHAR(45), + ADD UNIQUE (code); \ No newline at end of file diff --git a/db/versions/11191-chocolateBirch/02-firstScript.sql b/db/versions/11191-chocolateBirch/02-firstScript.sql new file mode 100644 index 000000000..733cffd63 --- /dev/null +++ b/db/versions/11191-chocolateBirch/02-firstScript.sql @@ -0,0 +1,9 @@ +UPDATE vn.accountDetailType + SET code = CASE description + WHEN 'IBAN' THEN 'iban' + WHEN 'SWIFT' THEN 'swift' + WHEN 'Referencia Remesas' THEN 'remRef' + WHEN 'Referencia Transferencias' THEN 'trnRef' + WHEN 'Referencia Nominas' THEN 'payRef' + WHEN 'ABA' THEN 'aba' + END; \ No newline at end of file diff --git a/db/versions/11192-maroonSalal/00-firstScript.sql b/db/versions/11192-maroonSalal/00-firstScript.sql new file mode 100644 index 000000000..ac35a3db3 --- /dev/null +++ b/db/versions/11192-maroonSalal/00-firstScript.sql @@ -0,0 +1,3 @@ +ALTER TABLE hedera.tpvMerchantEnable + MODIFY COLUMN companyFk int(10) unsigned NOT NULL, + ADD CONSTRAINT tpvMerchantEnable_company_FK FOREIGN KEY (companyFk) REFERENCES vn.company(id) ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/db/versions/11193-bronzeAspidistra/00-firstScript.sql b/db/versions/11193-bronzeAspidistra/00-firstScript.sql new file mode 100644 index 000000000..cc837d007 --- /dev/null +++ b/db/versions/11193-bronzeAspidistra/00-firstScript.sql @@ -0,0 +1,19 @@ +CREATE OR REPLACE TABLE `srt`.`bufferLog` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `originFk` int(11) DEFAULT NULL, + `userFk` int(10) unsigned DEFAULT NULL, + `action` set('insert','update','delete','select') NOT NULL, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` enum('Buffer', 'Config') NOT NULL DEFAULT 'Buffer', + `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)), + `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)), + `changedModelId` int(11) NOT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, + `summaryId` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `logBufferUserFk` (`userFk`), + KEY `bufferLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`), + KEY `bufferLog_originFk` (`originFk`,`creationDate`), + CONSTRAINT `bufferUserFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; diff --git a/db/versions/11193-bronzeAspidistra/01-firstScript.sql b/db/versions/11193-bronzeAspidistra/01-firstScript.sql new file mode 100644 index 000000000..748056f3a --- /dev/null +++ b/db/versions/11193-bronzeAspidistra/01-firstScript.sql @@ -0,0 +1 @@ +ALTER TABLE srt.buffer ADD editorFk int(10) unsigned DEFAULT NULL NULL; diff --git a/db/versions/11193-bronzeAspidistra/02-firstScript.sql b/db/versions/11193-bronzeAspidistra/02-firstScript.sql new file mode 100644 index 000000000..36aa938d5 --- /dev/null +++ b/db/versions/11193-bronzeAspidistra/02-firstScript.sql @@ -0,0 +1 @@ +ALTER TABLE srt.config ADD editorFk int(10) unsigned DEFAULT NULL NULL; diff --git a/db/versions/11194-orangeOrchid/00-firstScript.sql b/db/versions/11194-orangeOrchid/00-firstScript.sql new file mode 100644 index 000000000..59a616edf --- /dev/null +++ b/db/versions/11194-orangeOrchid/00-firstScript.sql @@ -0,0 +1,9 @@ +CREATE TABLE vn.quadMindsApiConfig ( + id int(10) unsigned NULL PRIMARY KEY, + `url` varchar(255) DEFAULT NULL NULL, + `key` varchar(255) DEFAULT NULL NULL, + CONSTRAINT quadMindsConfig_check CHECK (id = 1) +) +ENGINE=InnoDB +DEFAULT CHARSET=utf8mb3 +COLLATE=utf8mb3_unicode_ci; diff --git a/db/versions/11195-salmonPalmetto/00-firstScript.sql b/db/versions/11195-salmonPalmetto/00-firstScript.sql new file mode 100644 index 000000000..980b66c8d --- /dev/null +++ b/db/versions/11195-salmonPalmetto/00-firstScript.sql @@ -0,0 +1,6 @@ +ALTER TABLE vn.roadmap + ADD COLUMN m3 INT UNSIGNED NULL, + ADD COLUMN driver2Fk INT UNSIGNED NULL, + ADD COLUMN driver1Fk INT UNSIGNED NULL, + ADD CONSTRAINT roadmap_worker_FK FOREIGN KEY (driver1Fk) REFERENCES vn.worker(id) ON DELETE RESTRICT ON UPDATE CASCADE, + ADD CONSTRAINT roadmap_worker_FK_2 FOREIGN KEY (driver2Fk) REFERENCES vn.worker(id) ON DELETE RESTRICT ON UPDATE CASCADE; \ No newline at end of file diff --git a/db/versions/11197-aquaSalal/00-firstScript.sql b/db/versions/11197-aquaSalal/00-firstScript.sql new file mode 100644 index 000000000..f07368d3e --- /dev/null +++ b/db/versions/11197-aquaSalal/00-firstScript.sql @@ -0,0 +1,24 @@ +DELETE FROM `salix`.`ACL` + WHERE `model` = 'Ticket' + AND `property` = 'refund' + AND `accessType` = 'WRITE' + AND `permission` = 'ALLOW' + AND `principalType` = 'ROLE' + AND `principalId` = 'salesAssistant'; + +UPDATE `salix`.`ACL` + SET `property` = 'cloneAll' + WHERE `model` = 'Ticket' + AND `property` = 'refund' + AND `accessType` = 'WRITE' + AND `permission` = 'ALLOW' + AND `principalType` = 'ROLE' + AND `principalId` IN ('invoicing', 'claimManager', 'logistic'); + +DELETE FROM `salix`.`ACL` + WHERE `model` = 'Ticket' + AND `property` = 'clone' + AND `accessType` = 'WRITE' + AND `permission` = 'ALLOW' + AND `principalType` = 'ROLE' + AND `principalId` = 'administrative'; diff --git a/modules/claim/back/methods/claim/updateClaim.js b/modules/claim/back/methods/claim/updateClaim.js index 326192385..10d304496 100644 --- a/modules/claim/back/methods/claim/updateClaim.js +++ b/modules/claim/back/methods/claim/updateClaim.js @@ -108,7 +108,7 @@ module.exports = Self => { async function notifyStateChange(ctx, workerId, claim, newState) { const models = Self.app.models; - const url = await models.Url.getUrl(); + const url = await models.Url.getUrl('lilium'); const $t = ctx.req.__; const message = $t(`Claim state has changed to`, { @@ -122,7 +122,7 @@ module.exports = Self => { async function notifyPickUp(ctx, workerId, claim) { const models = Self.app.models; - const url = await models.Url.getUrl(); + const url = await models.Url.getUrl('lilium'); const $t = ctx.req.__; // $translate const message = $t('Claim will be picked', { diff --git a/modules/client/back/models/client-sample.js b/modules/client/back/models/client-sample.js index 5e4393042..b8ab6cff4 100644 --- a/modules/client/back/models/client-sample.js +++ b/modules/client/back/models/client-sample.js @@ -27,7 +27,7 @@ module.exports = Self => { // Renew mandate if (mandate) { const mandateType = await models.MandateType.findOne({ - where: {name: mandate.type} + where: {code: mandate.type} }); const oldMandate = await models.Mandate.findOne({ diff --git a/modules/client/back/models/mandate-type.json b/modules/client/back/models/mandate-type.json index ec189f089..b481e7c72 100644 --- a/modules/client/back/models/mandate-type.json +++ b/modules/client/back/models/mandate-type.json @@ -12,7 +12,7 @@ "type": "number", "description": "Identifier" }, - "name": { + "code": { "type": "string" } } diff --git a/modules/client/front/mandate/index.html b/modules/client/front/mandate/index.html index e2f2cd27b..1ee18737f 100644 --- a/modules/client/front/mandate/index.html +++ b/modules/client/front/mandate/index.html @@ -26,7 +26,7 @@ {{::mandate.id}} {{::mandate.company.code}} - {{::mandate.mandateType.name}} + {{::mandate.mandateType.code}} {{::mandate.created | date:'dd/MM/yyyy HH:mm' | dashIfEmpty}} {{::mandate.finished | date:'dd/MM/yyyy HH:mm' | dashIfEmpty}} diff --git a/modules/client/front/mandate/index.js b/modules/client/front/mandate/index.js index 114e2b570..605ae08cc 100644 --- a/modules/client/front/mandate/index.js +++ b/modules/client/front/mandate/index.js @@ -9,7 +9,7 @@ class Controller extends Section { { relation: 'mandateType', scope: { - fields: ['id', 'name'] + fields: ['id', 'code'] } }, { relation: 'company', diff --git a/modules/invoiceIn/back/methods/invoice-in/getSerial.js b/modules/invoiceIn/back/methods/invoice-in/getSerial.js index dcc1fbc3c..29c7cae2f 100644 --- a/modules/invoiceIn/back/methods/invoice-in/getSerial.js +++ b/modules/invoiceIn/back/methods/invoice-in/getSerial.js @@ -46,7 +46,7 @@ module.exports = Self => { } }); - filter = mergeFilters(args.filter, {where}); + const filter = mergeFilters(args.filter, {where}); const stmt = new ParameterizedSQL( `SELECT i.serial, SUM(IF(i.isBooked, 0,1)) pending, COUNT(*) total diff --git a/modules/invoiceOut/back/methods/invoiceOut/clientsToInvoice.js b/modules/invoiceOut/back/methods/invoiceOut/clientsToInvoice.js index 63b00fe38..5526d214a 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/clientsToInvoice.js +++ b/modules/invoiceOut/back/methods/invoiceOut/clientsToInvoice.js @@ -75,7 +75,7 @@ module.exports = Self => { AND c.isTaxDataChecked AND c.isActive AND NOT t.isDeleted - GROUP BY c.id, IF(c.hasToInvoiceByAddress, a.id, TRUE) + GROUP BY IF(c.hasToInvoiceByAddress, a.id, c.id) HAVING SUM(t.totalWithVat) > 0;`; const addresses = await Self.rawSql(query, [ diff --git a/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js b/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js index 530b02353..2c44cef34 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js +++ b/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js @@ -28,6 +28,11 @@ module.exports = Self => { type: 'number', description: 'The company id to invoice', required: true + }, { + arg: 'serialType', + type: 'string', + description: 'Invoice serial number type (see vn.invoiceOutSerial.type enum)', + required: true } ], returns: { @@ -39,12 +44,10 @@ module.exports = Self => { verb: 'POST' } }); - Self.invoiceClient = async(ctx, options) => { const args = ctx.args; const models = Self.app.models; - options = typeof options == 'object' - ? Object.assign({}, options) : {}; + options = typeof options === 'object' ? {...options} : {}; options.userId = ctx.req.accessToken.userId; let tx; @@ -74,10 +77,9 @@ module.exports = Self => { ], options); } - const invoiceType = 'G'; const invoiceId = await models.Ticket.makeInvoice( ctx, - invoiceType, + args.serialType, args.companyFk, args.invoiceDate, null, diff --git a/modules/invoiceOut/back/methods/invoiceOut/refund.js b/modules/invoiceOut/back/methods/invoiceOut/refund.js index 1b7ccc1e4..4f43a7a84 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/refund.js +++ b/modules/invoiceOut/back/methods/invoiceOut/refund.js @@ -43,7 +43,7 @@ module.exports = Self => { const tickets = await models.Ticket.find(filter, myOptions); const ticketsIds = tickets.map(ticket => ticket.id); - const refundedTickets = await models.Ticket.refund(ctx, ticketsIds, withWarehouse, myOptions); + const refundedTickets = await models.Ticket.cloneAll(ctx, ticketsIds, withWarehouse, true, myOptions); if (tx) await tx.commit(); diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/clientsToInvoice.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/clientsToInvoice.spec.js new file mode 100644 index 000000000..470690c5a --- /dev/null +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/clientsToInvoice.spec.js @@ -0,0 +1,75 @@ +const models = require('vn-loopback/server/server').models; + +describe('InvoiceOut clientsToInvoice()', () => { + const userId = 1; + const clientId = 1101; + const companyFk = 442; + const maxShipped = new Date(); + maxShipped.setMonth(11); + maxShipped.setDate(31); + maxShipped.setHours(23, 59, 59, 999); + const invoiceDate = new Date(); + const activeCtx = { + getLocale: () => { + return 'en'; + }, + accessToken: {userId: userId}, + __: value => { + return value; + }, + headers: {origin: 'http://localhost'} + }; + const ctx = {req: activeCtx}; + + it('should return a list of clients to invoice', async() => { + spyOn(models.InvoiceOut, 'rawSql').and.callFake(query => { + if (query.includes('ticketPackaging_add')) + return Promise.resolve(true); + else if (query.includes('SELECT c.id clientId')) { + return Promise.resolve([ + { + clientId: clientId, + clientName: 'Test Client', + id: 1, + nickname: 'Address 1' + } + ]); + } + }); + + const tx = await models.InvoiceOut.beginTransaction({}); + const options = {transaction: tx}; + + try { + const addresses = await models.InvoiceOut.clientsToInvoice( + ctx, clientId, invoiceDate, maxShipped, companyFk, options); + + expect(addresses.length).toBeGreaterThan(0); + expect(addresses[0].clientId).toBe(clientId); + expect(addresses[0].clientName).toBe('Test Client'); + expect(addresses[0].id).toBe(1); + expect(addresses[0].nickname).toBe('Address 1'); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + }); + + it('should handle errors and rollback transaction', async() => { + spyOn(models.InvoiceOut, 'rawSql').and.callFake(() => { + return Promise.reject(new Error('Test Error')); + }); + + const tx = await models.InvoiceOut.beginTransaction({}); + const options = {transaction: tx}; + + try { + await models.InvoiceOut.clientsToInvoice(ctx, clientId, invoiceDate, maxShipped, companyFk, options); + } catch (e) { + expect(e.message).toBe('Test Error'); + await tx.rollback(); + } + }); +}); diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js index 0faa8fe1a..c731912ec 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js @@ -1,16 +1,16 @@ const models = require('vn-loopback/server/server').models; +const LoopBackContext = require('loopback-context'); describe('InvoiceOut invoiceClient()', () => { const userId = 1; const clientId = 1101; - const addressId = 121; + const addressFk = 121; const companyFk = 442; const minShipped = Date.vnNew(); minShipped.setFullYear(minShipped.getFullYear() - 1); minShipped.setMonth(1); minShipped.setDate(1); minShipped.setHours(0, 0, 0, 0); - const invoiceSerial = 'A'; const activeCtx = { getLocale: () => { return 'en'; @@ -23,9 +23,14 @@ describe('InvoiceOut invoiceClient()', () => { }; const ctx = {req: activeCtx}; + beforeAll(() => { + spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({ + active: activeCtx + }); + }); - it('should make a global invoicing', async() => { - spyOn(models.InvoiceOut, 'makePdf').and.returnValue(new Promise(resolve => resolve(true))); + it('should make a global invoicing by address and verify billing status', async() => { + spyOn(models.InvoiceOut, 'makePdf').and.returnValue(Promise.resolve(true)); spyOn(models.InvoiceOut, 'invoiceEmail'); const tx = await models.InvoiceOut.beginTransaction({}); @@ -34,20 +39,96 @@ describe('InvoiceOut invoiceClient()', () => { try { ctx.args = { clientId: clientId, - addressId: addressId, + addressId: addressFk, invoiceDate: Date.vnNew(), maxShipped: Date.vnNew(), companyFk: companyFk, - minShipped: minShipped + serialType: 'global' }; + const invoiceOutId = await models.InvoiceOut.invoiceClient(ctx, options); + const invoiceOut = await models.InvoiceOut.findById(invoiceOutId, null, options); - const [firstTicket] = await models.Ticket.find({ + + expect(invoiceOutId).toBeGreaterThan(0); + + const allClientTickets = await models.Ticket.find({ + where: { + clientFk: clientId, + or: [ + {refFk: null}, + {refFk: invoiceOut.ref} + ] + } + }, options); + + const billedTickets = await models.Ticket.find({ where: {refFk: invoiceOut.ref} }, options); + const allBilledTicketsHaveCorrectAddress = billedTickets.every(ticket => ticket.addressFk === addressFk); + + expect(allBilledTicketsHaveCorrectAddress).toBe(true); + + const addressTickets = allClientTickets.filter(ticket => ticket.addressFk === addressFk); + + const allAddressTicketsBilled = addressTickets.every(ticket => ticket.refFk === invoiceOut.ref); + + expect(allAddressTicketsBilled).toBe(true); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + }); + + it('should invoice all tickets regardless of address when hasToInvoiceByAddress is false', async() => { + spyOn(models.InvoiceOut, 'makePdf').and.returnValue(Promise.resolve(true)); + spyOn(models.InvoiceOut, 'invoiceEmail'); + + const tx = await models.InvoiceOut.beginTransaction({}); + const options = {transaction: tx}; + + try { + const client = await models.Client.findById(clientId, null, options); + await client.updateAttribute('hasToInvoiceByAddress', false, options); + + ctx.args = { + clientId: clientId, + invoiceDate: Date.vnNew(), + maxShipped: Date.vnNew(), + companyFk: companyFk, + serialType: 'global' + }; + + const invoiceOutId = await models.InvoiceOut.invoiceClient(ctx, options); + + const invoiceOut = await models.InvoiceOut.findById(invoiceOutId, null, options); + expect(invoiceOutId).toBeGreaterThan(0); - expect(firstTicket.refFk).toContain(invoiceSerial); + + const allClientTickets = await models.Ticket.find({ + where: { + clientFk: clientId, + or: [ + {refFk: null}, + {refFk: invoiceOut.ref} + ] + } + }, options); + + const billedTickets = await models.Ticket.find({ + where: {refFk: invoiceOut.ref} + }, options); + + const allTicketsBilled = allClientTickets.every(ticket => ticket.refFk === invoiceOut.ref); + + expect(allTicketsBilled).toBe(true); + + const billedAddresses = new Set(billedTickets.map(ticket => ticket.addressFk)); + + expect(billedAddresses.size).toBeGreaterThan(1); await tx.rollback(); } catch (e) { diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js index 0c86e5810..c31f381d9 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js +++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js @@ -82,20 +82,12 @@ module.exports = Self => { myOptions.transaction = tx; } try { - const filterRef = {where: {refFk: refFk}}; - const tickets = await models.Ticket.find(filterRef, myOptions); + const tickets = await models.Ticket.find({where: {refFk}}, myOptions); const ticketsIds = tickets.map(ticket => ticket.id); - const refundTickets = await models.Ticket.refund(ctx, ticketsIds, null, myOptions); + const refundTickets = await models.Ticket.cloneAll(ctx, ticketsIds, false, true, myOptions); - const filterTicket = {where: {ticketFk: {inq: ticketsIds}}}; + const clonedTickets = await models.Ticket.cloneAll(ctx, ticketsIds, false, false, myOptions); - const services = await models.TicketService.find(filterTicket, myOptions); - const servicesIds = services.map(service => service.id); - - const sales = await models.Sale.find(filterTicket, myOptions); - const salesIds = sales.map(sale => sale.id); - - const clonedTickets = await models.Sale.clone(ctx, salesIds, servicesIds, null, false, myOptions); const clonedTicketIds = []; for (const clonedTicket of clonedTickets) { diff --git a/modules/invoiceOut/back/models/invoice-out-serial.json b/modules/invoiceOut/back/models/invoice-out-serial.json index 912269fd7..30e1f1b39 100644 --- a/modules/invoiceOut/back/models/invoice-out-serial.json +++ b/modules/invoiceOut/back/models/invoice-out-serial.json @@ -20,6 +20,9 @@ }, "isCEE": { "type": "boolean" + }, + "type": { + "type": "string" } }, "relations": { @@ -35,4 +38,4 @@ "principalId": "$everyone", "permission": "ALLOW" }] -} \ No newline at end of file +} diff --git a/modules/invoiceOut/front/descriptor-menu/index.html b/modules/invoiceOut/front/descriptor-menu/index.html index da04c8e72..335ab87cc 100644 --- a/modules/invoiceOut/front/descriptor-menu/index.html +++ b/modules/invoiceOut/front/descriptor-menu/index.html @@ -88,28 +88,7 @@ translate> Show CITES letter - - Refund... - - - - with warehouse - - - without warehouse - - - - + { - const tickets = res.data; - const refundTickets = tickets.map(ticket => ticket.id); - - this.vnApp.showSuccess(this.$t('The following refund tickets have been created', { - ticketId: refundTickets.join(',') - })); - if (refundTickets.length == 1) - this.$state.go('ticket.card.sale', {id: refundTickets[0]}); - }); - } - transferInvoice() { const params = { id: this.invoiceOut.id, diff --git a/modules/invoiceOut/front/descriptor-menu/index.spec.js b/modules/invoiceOut/front/descriptor-menu/index.spec.js index d2ccfa117..a22ca7c2a 100644 --- a/modules/invoiceOut/front/descriptor-menu/index.spec.js +++ b/modules/invoiceOut/front/descriptor-menu/index.spec.js @@ -105,17 +105,4 @@ describe('vnInvoiceOutDescriptorMenu', () => { expect(controller.vnApp.showMessage).toHaveBeenCalled(); }); }); - - describe('refundInvoiceOut()', () => { - it('should make a query and show a success message', () => { - jest.spyOn(controller.vnApp, 'showSuccess'); - const params = {ref: controller.invoiceOut.ref}; - - $httpBackend.expectPOST(`InvoiceOuts/refund`, params).respond([{id: 1}, {id: 2}]); - controller.refundInvoiceOut(); - $httpBackend.flush(); - - expect(controller.vnApp.showSuccess).toHaveBeenCalled(); - }); - }); }); diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js index 9185a6e75..24346f3ba 100644 --- a/modules/ticket/back/methods/sale/clone.js +++ b/modules/ticket/back/methods/sale/clone.js @@ -1,40 +1,25 @@ module.exports = Self => { Self.remoteMethodCtx('clone', { - description: 'Clone sales and services provided', + description: 'Clone sales, services, and ticket packaging provided', accessType: 'WRITE', accepts: [ - { - arg: 'salesIds', - type: ['number'], - }, { - arg: 'servicesIds', - type: ['number'] - }, { - arg: 'withWarehouse', - type: 'boolean', - required: true - }, { - arg: 'negative', - type: 'boolean' - } + {arg: 'salesIds', type: ['number']}, + {arg: 'servicesIds', type: ['number']}, + {arg: 'ticketPackagingIds', type: ['number']}, + {arg: 'withWarehouse', type: 'boolean', required: true}, + {arg: 'negative', type: 'boolean'} ], - returns: { - type: ['object'], - root: true - }, - http: { - path: `/clone`, - verb: 'POST' - } + returns: {type: ['object'], root: true}, + http: {path: `/clone`, verb: 'POST'} }); - Self.clone = async(ctx, salesIds, servicesIds, withWarehouse, negative, options) => { + + Self.clone = async(ctx, salesIds, servicesIds, ticketPackagingIds, withWarehouse, negative, options) => { const models = Self.app.models; const myOptions = {}; let tx; const newTickets = []; - if (typeof options == 'object') - Object.assign(myOptions, options); + if (typeof options === 'object') Object.assign(myOptions, options); if (!myOptions.transaction) { tx = await Self.beginTransaction({}); @@ -44,8 +29,9 @@ module.exports = Self => { try { let sales; let services; + let ticketPackaging; - if (salesIds && salesIds.length) { + if (salesIds?.length) { sales = await models.Sale.find({ where: {id: {inq: salesIds}}, include: { @@ -57,12 +43,18 @@ module.exports = Self => { }, myOptions); } - if (servicesIds && servicesIds.length) { + if (servicesIds?.length) { services = await models.TicketService.find({ where: {id: {inq: servicesIds}} }, myOptions); } + if (ticketPackagingIds?.length) { + ticketPackaging = await models.TicketPackaging.find({ + where: {id: {inq: ticketPackagingIds}} + }, myOptions); + } + let ticketsIds = sales ? [...new Set(sales.map(sale => sale.ticketFk))] : [...new Set(services.map(service => service.ticketFk))]; @@ -74,12 +66,12 @@ module.exports = Self => { ctx, ticketId, withWarehouse, - negative, myOptions ); newTickets.push(newTicket); mappedTickets.set(ticketId, newTicket.id); } + if (sales) { for (const sale of sales) { const newTicketId = mappedTickets.get(sale.ticketFk); @@ -107,7 +99,7 @@ module.exports = Self => { await models.TicketService.create({ description: service.description, - quantity: negative ? - service.quantity : service.quantity, + quantity: negative ? -service.quantity : service.quantity, price: service.price, taxClassFk: service.taxClassFk, ticketFk: newTicketId, @@ -116,6 +108,18 @@ module.exports = Self => { } } + if (ticketPackaging) { + for (const packaging of ticketPackaging) { + const newTicketId = mappedTickets.get(packaging.ticketFk); + + await models.TicketPackaging.create({ + ticketFk: newTicketId, + packagingFk: packaging.packagingFk, + quantity: negative ? -packaging.quantity : packaging.quantity + }, myOptions); + } + } + if (tx) await tx.commit(); return newTickets; @@ -124,13 +128,7 @@ module.exports = Self => { throw e; } - async function createTicket( - ctx, - ticketId, - withWarehouse, - negative, - myOptions - ) { + async function createTicket(ctx, ticketId, withWarehouse, myOptions) { const models = Self.app.models; const now = Date.vnNew(); diff --git a/modules/ticket/back/methods/sale/specs/clone.spec.js b/modules/ticket/back/methods/sale/specs/clone.spec.js index 5b0dc84a7..1738cc08c 100644 --- a/modules/ticket/back/methods/sale/specs/clone.spec.js +++ b/modules/ticket/back/methods/sale/specs/clone.spec.js @@ -20,7 +20,7 @@ describe('Ticket cloning - clone function', () => { const servicesIds = []; const withWarehouse = true; const negative = false; - const newTickets = await models.Sale.clone(ctx, salesIds, servicesIds, withWarehouse, negative, options); + const newTickets = await models.Sale.clone(ctx, salesIds, servicesIds, null, withWarehouse, negative, options); expect(newTickets).toBeDefined(); expect(newTickets.length).toBeGreaterThan(0); @@ -30,7 +30,7 @@ describe('Ticket cloning - clone function', () => { const negative = true; const salesIds = [7, 8]; const servicesIds = []; - const newTickets = await models.Sale.clone(ctx, salesIds, servicesIds, false, negative, options); + const newTickets = await models.Sale.clone(ctx, salesIds, servicesIds, null, false, negative, options); for (const ticket of newTickets) { const sales = await models.Sale.find({where: {ticketFk: ticket.id}}, options); @@ -43,7 +43,7 @@ describe('Ticket cloning - clone function', () => { it('should create new components and services for cloned tickets', async() => { const servicesIds = [2]; const salesIds = [5]; - const newTickets = await models.Sale.clone(ctx, salesIds, servicesIds, false, false, options); + const newTickets = await models.Sale.clone(ctx, salesIds, servicesIds, null, false, false, options); for (const ticket of newTickets) { const sale = await models.Sale.findOne({where: {ticketFk: ticket.id}}, options); @@ -58,7 +58,7 @@ describe('Ticket cloning - clone function', () => { it('should create a ticket without sales', async() => { const servicesIds = [4]; - const tickets = await models.Sale.clone(ctx, null, servicesIds, false, false, options); + const tickets = await models.Sale.clone(ctx, null, servicesIds, null, false, false, options); const refundedTicket = await getTicketRefund(tickets[0].id, options); expect(refundedTicket).toBeDefined(); diff --git a/modules/ticket/back/methods/ticket/clone.js b/modules/ticket/back/methods/ticket/clone.js deleted file mode 100644 index 93bc2a94e..000000000 --- a/modules/ticket/back/methods/ticket/clone.js +++ /dev/null @@ -1,54 +0,0 @@ -module.exports = Self => { - Self.remoteMethodCtx('clone', { - description: 'clone a ticket and return the new ticket id', - accessType: 'WRITE', - accepts: [{ - arg: 'id', - type: 'number', - required: true, - description: 'The ticket id', - http: {source: 'path'} - }, { - arg: 'shipped', - type: 'date', - }, { - arg: 'withWarehouse', - type: 'boolean', - } - ], - returns: { - type: 'number', - root: true - }, - http: { - path: `/:id/clone`, - verb: 'POST' - } - }); - - Self.clone = async(ctx, id, shipped, withWarehouse, options) => { - const myOptions = {userId: ctx.req.accessToken.userId}; - let tx; - - if (typeof options == 'object') - Object.assign(myOptions, options); - - if (!myOptions.transaction) { - tx = await Self.beginTransaction({}); - myOptions.transaction = tx; - } - - try { - const [, [{clonedTicketId}]] = await Self.rawSql(` - CALL vn.ticket_cloneAll(?, ?, ?, @clonedTicketId); - SELECT @clonedTicketId clonedTicketId;`, - [id, shipped, withWarehouse], myOptions); - - if (tx) await tx.commit(); - return clonedTicketId; - } catch (e) { - if (tx) await tx.rollback(); - throw e; - } - }; -}; diff --git a/modules/ticket/back/methods/ticket/cloneAll.js b/modules/ticket/back/methods/ticket/cloneAll.js new file mode 100644 index 000000000..cf99a7edc --- /dev/null +++ b/modules/ticket/back/methods/ticket/cloneAll.js @@ -0,0 +1,77 @@ +module.exports = Self => { + Self.remoteMethodCtx('cloneAll', { + description: 'Clone tickets, sales, services and packages', + accessType: 'WRITE', + accepts: [ + { + arg: 'ticketsIds', + type: ['number'], + required: true, + description: 'IDs of the tickets to clone' + }, + { + arg: 'withWarehouse', + type: 'boolean', + required: true, + description: 'true: keep original warehouse; false: set to null' + }, + { + arg: 'negative', + type: 'boolean', + required: true, + description: 'true: invert quantities; false: keep as is.' + } + ], + returns: { + type: ['object'], + root: true, + description: 'The cloned tickets with associated data' + }, + http: { + path: `/cloneAll`, + verb: 'POST' + } + }); + + Self.cloneAll = async(ctx, ticketsIds, withWarehouse, negative, options) => { + const models = Self.app.models; + const myOptions = typeof options == 'object' ? {...options} : {}; + let tx; + + if (!myOptions.transaction) { + tx = await Self.beginTransaction({}); + myOptions.transaction = tx; + } + + try { + const filter = {where: {ticketFk: {inq: ticketsIds}}}; + + const [sales, services, ticketPackaging] = await Promise.all([ + models.Sale.find(filter, myOptions), + models.TicketService.find(filter, myOptions), + models.TicketPackaging.find(filter, myOptions) + ]); + + const salesIds = sales.map(({id}) => id); + const servicesIds = services.map(({id}) => id); + const ticketPackagingIds = ticketPackaging.map(({id}) => id); + + const clonedTickets = await models.Sale.clone( + ctx, + salesIds, + servicesIds, + ticketPackagingIds, + withWarehouse, + negative, + myOptions + ); + + if (tx) await tx.commit(); + + return clonedTickets; + } catch (e) { + if (tx) await tx.rollback(); + throw e; + } + }; +}; diff --git a/modules/ticket/back/methods/ticket/closeAll.js b/modules/ticket/back/methods/ticket/closeAll.js index 9d0aa8c13..143c0a3f0 100644 --- a/modules/ticket/back/methods/ticket/closeAll.js +++ b/modules/ticket/back/methods/ticket/closeAll.js @@ -93,8 +93,8 @@ module.exports = Self => { SUM(t.isDeleted) hasErrorDeleted, SUM(itc.id IS NULL) hasErrorItemTaxCountry, SUM(a.id IS NULL) hasErrorAddress, - SUM(ios.code IS NOT NULL - AND(ad.customsAgentFk IS NULL + SUM(ios.code IS NOT NULL + AND(ad.customsAgentFk IS NULL OR ad.incotermsFk IS NULL)) hasErrorInfoTaxAreaWorld, t.clientFk clientFk FROM ticket t @@ -113,24 +113,24 @@ module.exports = Self => { LEFT JOIN account.emailUser eu ON eu.userFk = c.salesPersonFk LEFT JOIN itemTaxCountry itc ON itc.itemFk = i.id AND itc.countryFk = su.countryFk - LEFT JOIN vn.invoiceOutSerial ios ON ios.taxAreaFk = 'WORLD' - AND ios.code = invoiceSerial(t.clientFk, t.companyFk, 'M') + LEFT JOIN vn.invoiceOutSerial ios ON ios.taxAreaFk = 'WORLD' + AND ios.code = invoiceSerial(t.clientFk, t.companyFk, 'multiple') WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code <> 'delivered')) AND DATE(t.shipped) BETWEEN ? - INTERVAL 2 DAY AND util.dayEnd(?) AND t.refFk IS NULL AND IFNULL(a.hasDailyInvoice, co.hasDailyInvoice) - GROUP BY ticketFk - HAVING hasErrorToInvoice - OR hasErrorTaxDataChecked - OR hasErrorDeleted - OR hasErrorItemTaxCountry - OR hasErrorAddress + GROUP BY ticketFk + HAVING hasErrorToInvoice + OR hasErrorTaxDataChecked + OR hasErrorDeleted + OR hasErrorItemTaxCountry + OR hasErrorAddress OR hasErrorInfoTaxAreaWorld )sub )sub2 ) SELECT IF(errors = '{"tickets": null}', 'No errors', - util.notification_send('invoice-ticket-closure', errors, NULL)) + util.notification_send('invoice-ticket-closure', errors, NULL)) FROM ticketNotInvoiceable`, [toDate, toDate]); await closure(ctx, Self, tickets); diff --git a/modules/ticket/back/methods/ticket/invoiceTickets.js b/modules/ticket/back/methods/ticket/invoiceTickets.js index 53400e724..3c725c4a7 100644 --- a/modules/ticket/back/methods/ticket/invoiceTickets.js +++ b/modules/ticket/back/methods/ticket/invoiceTickets.js @@ -95,7 +95,7 @@ module.exports = function(Self) { FROM vn.ticket WHERE id IN (?) `, [ticketsIds], myOptions); - return models.Ticket.makeInvoice(ctx, 'R', companyId, Date.vnNew(), invoiceCorrection, myOptions); + return models.Ticket.makeInvoice(ctx, 'quick', companyId, Date.vnNew(), invoiceCorrection, myOptions); } }; diff --git a/modules/ticket/back/methods/ticket/refund.js b/modules/ticket/back/methods/ticket/refund.js deleted file mode 100644 index 7365f34df..000000000 --- a/modules/ticket/back/methods/ticket/refund.js +++ /dev/null @@ -1,58 +0,0 @@ -module.exports = Self => { - Self.remoteMethodCtx('refund', { - description: 'Create refund tickets with all their sales and services', - accessType: 'WRITE', - accepts: [ - { - arg: 'ticketsIds', - type: ['number'], - required: true - }, - { - arg: 'withWarehouse', - type: 'boolean', - required: true - } - ], - returns: { - type: ['object'], - root: true - }, - http: { - path: `/refund`, - verb: 'POST' - } - }); - - Self.refund = async(ctx, ticketsIds, withWarehouse, options) => { - const models = Self.app.models; - const myOptions = {}; - let tx; - - if (typeof options == 'object') - Object.assign(myOptions, options); - - if (!myOptions.transaction) { - tx = await Self.beginTransaction({}); - myOptions.transaction = tx; - } - - try { - const filter = {where: {ticketFk: {inq: ticketsIds}}}; - const sales = await models.Sale.find(filter, myOptions); - const salesIds = sales.map(sale => sale.id); - - const services = await models.TicketService.find(filter, myOptions); - const servicesIds = services.map(service => service.id); - - const refundedTickets = await models.Sale.clone(ctx, salesIds, servicesIds, withWarehouse, true, myOptions); - - if (tx) await tx.commit(); - - return refundedTickets; - } catch (e) { - if (tx) await tx.rollback(); - throw e; - } - }; -}; diff --git a/modules/ticket/back/methods/ticket/specs/clone.spec.js b/modules/ticket/back/methods/ticket/specs/clone.spec.js deleted file mode 100644 index ccc0dcdf3..000000000 --- a/modules/ticket/back/methods/ticket/specs/clone.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -const models = require('vn-loopback/server/server').models; - -describe('Ticket cloning - clone function', () => { - const ctx = beforeAll.getCtx(); - let options; - let tx; - const ticketId = 1; - const shipped = Date.vnNew(); - - beforeEach(async() => { - options = {transaction: tx}; - tx = await models.Ticket.beginTransaction({}); - options.transaction = tx; - }); - - afterEach(async() => { - await tx.rollback(); - }); - - it('should clone a new ticket without warehouse', async() => { - const originalTicket = await models.Ticket.findById(ticketId, null, options); - - const newTicketId = await models.Ticket.clone(ctx, ticketId, shipped, false, options); - const newTicket = await models.Ticket.findById(newTicketId, null, options); - - expect(newTicket.clientFk).toEqual(originalTicket.clientFk); - expect(newTicket.companyFk).toEqual(originalTicket.companyFk); - expect(newTicket.addressFk).toEqual(originalTicket.addressFk); - expect(newTicket.warehouseFk).toBeFalsy(); - }); - - it('should clone a new ticket with warehouse', async() => { - const originalTicket = await models.Ticket.findById(ticketId, null, options); - - const newTicketId = await models.Ticket.clone(ctx, ticketId, shipped, true, options); - const newTicket = await models.Ticket.findById(newTicketId, null, options); - - expect(newTicket.clientFk).toEqual(originalTicket.clientFk); - expect(newTicket.companyFk).toEqual(originalTicket.companyFk); - expect(newTicket.addressFk).toEqual(originalTicket.addressFk); - expect(newTicket.warehouseFk).toEqual(originalTicket.warehouseFk); - }); -}); diff --git a/modules/ticket/back/methods/ticket/specs/cloneAll.spec.js b/modules/ticket/back/methods/ticket/specs/cloneAll.spec.js new file mode 100644 index 000000000..4788df2c2 --- /dev/null +++ b/modules/ticket/back/methods/ticket/specs/cloneAll.spec.js @@ -0,0 +1,53 @@ +const models = require('vn-loopback/server/server').models; +const LoopBackContext = require('loopback-context'); + +describe('Ticket cloning - cloneAll function', () => { + const activeCtx = { + accessToken: {userId: 1}, + http: { + req: { + headers: {origin: 'http://localhost'} + } + } + }; + const ctx = {req: activeCtx}; + let options; + let tx; + const ticketIds = [1, 2]; + const withWarehouse = true; + const negative = false; + + beforeEach(async() => { + spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({active: ctx.req}); + tx = await models.Ticket.beginTransaction({}); + options = {transaction: tx}; + }); + + afterEach(async() => { + if (tx) + await tx.rollback(); + }); + + it('should clone all provided tickets with their associated sales, services, and packages', async() => { + const originalTickets = await models.Ticket.find({where: {id: {inq: ticketIds}}}, options); + const originalSales = await models.Sale.find({where: {ticketFk: {inq: ticketIds}}}, options); + const originalServices = await models.TicketService.find({where: {ticketFk: {inq: ticketIds}}}, options); + const originalTicketPackaging = + await models.TicketPackaging.find({where: {ticketFk: {inq: ticketIds}}}, options); + + // Pass the ctx correctly to the cloneAll function + const clonedTickets = await models.Ticket.cloneAll(ctx, ticketIds, withWarehouse, negative, options); + + expect(clonedTickets.length).toEqual(originalTickets.length); + + const clonedSales = await models.Sale.find({where: {ticketFk: {inq: clonedTickets.map(t => t.id)}}}, options); + const clonedServices = + await models.TicketService.find({where: {ticketFk: {inq: clonedTickets.map(t => t.id)}}}, options); + const clonedTicketPackaging = + await models.TicketPackaging.find({where: {ticketFk: {inq: clonedTickets.map(t => t.id)}}}, options); + + expect(clonedSales.length).toEqual(originalSales.length); + expect(clonedServices.length).toEqual(originalServices.length); + expect(clonedTicketPackaging.length).toEqual(originalTicketPackaging.length); + }); +}); diff --git a/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js b/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js index fea8b2096..88812dc92 100644 --- a/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js +++ b/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js @@ -3,7 +3,7 @@ const LoopBackContext = require('loopback-context'); describe('ticket makeInvoice()', () => { const userId = 19; - const invoiceType = 'R'; + const invoiceType = 'quick'; const companyFk = 442; const invoiceDate = Date.vnNew(); const activeCtx = { diff --git a/modules/ticket/back/models/ticket-methods.js b/modules/ticket/back/models/ticket-methods.js index 5582dde5c..462862cb3 100644 --- a/modules/ticket/back/models/ticket-methods.js +++ b/modules/ticket/back/models/ticket-methods.js @@ -26,7 +26,7 @@ module.exports = function(Self) { require('../methods/ticket/isLocked')(Self); require('../methods/ticket/freightCost')(Self); require('../methods/ticket/getComponentsSum')(Self); - require('../methods/ticket/refund')(Self); + require('../methods/ticket/cloneAll')(Self); require('../methods/ticket/deliveryNotePdf')(Self); require('../methods/ticket/deliveryNoteEmail')(Self); require('../methods/ticket/deliveryNoteCsv')(Self); @@ -46,5 +46,4 @@ module.exports = function(Self) { require('../methods/ticket/invoiceTicketsAndPdf')(Self); require('../methods/ticket/docuwareDownload')(Self); require('../methods/ticket/myLastModified')(Self); - require('../methods/ticket/clone')(Self); }; diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 32f245454..93948def2 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -287,15 +287,24 @@ class Controller extends Section { } refund(withWarehouse) { - const params = {ticketsIds: [this.id], withWarehouse: withWarehouse}; - const query = 'Tickets/refund'; + const params = { + ticketsIds: [this.id], + withWarehouse: withWarehouse, + negative: true // Asumimos que queremos cantidades negativas para reembolsos + }; + const query = 'Tickets/cloneAll'; return this.$http.post(query, params) .then(res => { const [refundTicket] = res.data; - this.vnApp.showSuccess(this.$t('The following refund ticket have been created', { + this.vnApp.showSuccess(this.$t('The following refund ticket has been created', { ticketId: refundTicket.id })); this.$state.go('ticket.card.sale', {id: refundTicket.id}); + }) + .catch(error => { + this.vnApp.showError(this.$t('Error creating refund ticket', { + error: error.data?.error?.message || 'Unknown error' + })); }); } diff --git a/modules/ticket/front/descriptor-menu/index.spec.js b/modules/ticket/front/descriptor-menu/index.spec.js index 94a991db8..cffbad62e 100644 --- a/modules/ticket/front/descriptor-menu/index.spec.js +++ b/modules/ticket/front/descriptor-menu/index.spec.js @@ -217,24 +217,6 @@ describe('Ticket Component vnTicketDescriptorMenu', () => { }); }); - describe('refund()', () => { - it('should make a query and go to ticket.card.sale', () => { - controller.$state.go = jest.fn(); - - controller._id = ticket.id; - - const params = { - ticketsIds: [16] - }; - const response = {id: 99}; - $httpBackend.expectPOST('Tickets/refund', params).respond([response]); - controller.refund(); - $httpBackend.flush(); - - expect(controller.$state.go).toHaveBeenCalledWith('ticket.card.sale', response); - }); - }); - describe('sendChangesSms()', () => { it('should make a query and open the sms dialog', () => { controller.$.sms = {open: () => {}}; diff --git a/print/templates/reports/buy-label/sql/buy.sql b/print/templates/reports/buy-label/sql/buy.sql index 72765baa9..26efeb06e 100644 --- a/print/templates/reports/buy-label/sql/buy.sql +++ b/print/templates/reports/buy-label/sql/buy.sql @@ -22,7 +22,7 @@ labels AS ( b.id, b.itemFk, p.name producer, - IF(i2.id, i2.comment, i.comment) comment + IFNULL(i2.comment, i.comment) comment FROM buy b JOIN item i ON i.id = b.itemFk LEFT JOIN producer p ON p.id = i.producerFk diff --git a/print/templates/reports/entry-order/assets/css/style.css b/print/templates/reports/entry-order/assets/css/style.css index cabdadf9f..767b1185a 100644 --- a/print/templates/reports/entry-order/assets/css/style.css +++ b/print/templates/reports/entry-order/assets/css/style.css @@ -1,14 +1,20 @@ - - h3 { font-weight: 100; color: #555 } - .report-info { font-size: 20px } - .description strong { text-transform: uppercase; +} +.nowrap { + white-space: nowrap; +} +.padding { + padding: 16px; +} +.tags { + font-size: 10px; + margin: 0; } \ No newline at end of file diff --git a/print/templates/reports/entry-order/entry-order.html b/print/templates/reports/entry-order/entry-order.html index ddf0e9b5d..e5d3bfb6d 100644 --- a/print/templates/reports/entry-order/entry-order.html +++ b/print/templates/reports/entry-order/entry-order.html @@ -4,23 +4,23 @@
-
+

{{$t('title')}}

+
-

{{$t('title')}}

- + - + - - + +
{{$t('entryId')}}{{$t('entryId')}} {{entry.id}}
{{$t('date')}}{{$t('date')}} {{formatDate(entry.landed,'%d-%m-%Y')}}
{{$t('ref')}}{{entry.invoiceNumber}}{{$t('ref')}}{{entry.invoiceNumber | dashIfEmpty}}
@@ -38,42 +38,56 @@
- +
+ - + + + + + - + + - + + + + + - - - - - - + + + + + + + + + + + +
{{$t('boxes')}} {{$t('packing')}}{{$t('concept')}}{{$t('concept')}}{{$t('reference')}}{{$t('tags')}} {{$t('quantity')}} {{$t('price')}} {{$t('amount')}}
{{buy.box}}{{buy.stickers}}x {{buy.packing}}{{buy.itemName}}{{buy.name}}{{buy.comment}} + {{buy.tag5}} → {{buy.value5}} + {{buy.tag6}} → {{buy.value6}} + {{buy.tag7}} → {{buy.value7}} + {{buy.quantity | number($i18n.locale)}}x {{buy.buyingValue | currency('EUR', $i18n.locale)}}= {{buy.buyingValue * buy.quantity | currency('EUR', $i18n.locale)}}
- {{buy.tag5}} {{buy.value5}} - {{buy.tag6}} {{buy.value6}} - {{buy.tag7}} {{buy.value7}} -
- {{$t('total')}} - {{getTotal() | currency('EUR', $i18n.locale)}}
{{getTotalBy('stickers')}}{{getTotalBy('quantity') | number($i18n.locale)}}{{getTotalBy('amount') | currency('EUR', $i18n.locale)}}
diff --git a/print/templates/reports/entry-order/entry-order.js b/print/templates/reports/entry-order/entry-order.js index d31ad1a36..56356e068 100755 --- a/print/templates/reports/entry-order/entry-order.js +++ b/print/templates/reports/entry-order/entry-order.js @@ -13,13 +13,17 @@ module.exports = { return {totalBalance: 0.00}; }, methods: { - getTotal() { - let total = 0.00; - this.buys.forEach(buy => { - total += buy.quantity * buy.buyingValue; - }); - - return total; + getTotalBy(property) { + return this.buys.reduce((total, buy) => { + switch (property) { + case 'amount': + return total + buy.quantity * buy.buyingValue; + case 'quantity': + return total + buy.quantity; + case 'stickers': + return total + buy.stickers; + } + }, 0); } }, props: { diff --git a/print/templates/reports/entry-order/locale/es.yml b/print/templates/reports/entry-order/locale/es.yml index 5c633aeaa..5a6716ba1 100644 --- a/print/templates/reports/entry-order/locale/es.yml +++ b/print/templates/reports/entry-order/locale/es.yml @@ -2,7 +2,7 @@ reportName: pedido-de-entrada title: Pedido supplierName: Proveedor supplierStreet: Dirección -entryId: Referencia interna +entryId: Nº Entrada date: Fecha ref: Nº Factura boxes: Cajas @@ -14,4 +14,6 @@ concept: Descripción total: Total entry: Entrada {0} supplierData: Datos del proveedor -notes: Notas \ No newline at end of file +notes: Notas +reference: Referencia +tags: Tags \ No newline at end of file diff --git a/print/templates/reports/entry-order/sql/buys.sql b/print/templates/reports/entry-order/sql/buys.sql index 5bf9f2dfe..92c055483 100644 --- a/print/templates/reports/entry-order/sql/buys.sql +++ b/print/templates/reports/entry-order/sql/buys.sql @@ -1,16 +1,17 @@ -SELECT - b.itemFk, - b.quantity, - b.buyingValue, - b.stickers box, - b.packing, - i.name itemName, - i.tag5, - i.value5, - i.tag6, - i.value6, - i.tag7, - i.value7 -FROM buy b - JOIN item i ON i.id = b.itemFk -WHERE b.entryFk = ? \ No newline at end of file +SELECT b.itemFk, + b.quantity, + b.buyingValue, + b.stickers, + b.packing, + i.name, + IFNULL(i2.comment, i.comment) comment, + i.tag5, + i.value5, + i.tag6, + i.value6, + i.tag7, + i.value7 + FROM buy b + JOIN item i ON i.id = b.itemFk + LEFT JOIN item i2 ON i2.id = b.itemOriginalFk + WHERE b.entryFk = ? diff --git a/print/templates/reports/entry-order/sql/entry.sql b/print/templates/reports/entry-order/sql/entry.sql index c30eebca8..2ab599123 100644 --- a/print/templates/reports/entry-order/sql/entry.sql +++ b/print/templates/reports/entry-order/sql/entry.sql @@ -1,9 +1,8 @@ -SELECT - e.id, - e.invoiceNumber, - c.code companyCode, - t.landed -FROM entry e - JOIN travel t ON t.id = e.travelFk - JOIN company c ON c.id = e.companyFk -WHERE e.id = ? +SELECT e.id, + e.invoiceNumber, + c.code companyCode, + t.landed + FROM entry e + JOIN travel t ON t.id = e.travelFk + JOIN company c ON c.id = e.companyFk + WHERE e.id = ? diff --git a/print/templates/reports/entry-order/sql/supplier.sql b/print/templates/reports/entry-order/sql/supplier.sql index 81ed7e883..214f7913f 100644 --- a/print/templates/reports/entry-order/sql/supplier.sql +++ b/print/templates/reports/entry-order/sql/supplier.sql @@ -1,11 +1,10 @@ -SELECT - s.name, - s.street, - s.nif, - s.postCode, - s.city, - p.name province -FROM supplier s - JOIN entry e ON e.supplierFk = s.id - LEFT JOIN province p ON p.id = s.provinceFk -WHERE e.id = ? +SELECT s.name, + s.street, + s.nif, + s.postCode, + s.city, + p.name province + FROM supplier s + JOIN entry e ON e.supplierFk = s.id + LEFT JOIN province p ON p.id = s.provinceFk + WHERE e.id = ?