diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6db79a40a7..1e75b69867 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,108 @@
+# Version 24.36 - 2024-08-27
+
+### Added 🆕
+
+- chore: refs #7524 WIP limit call by:jorgep
+- feat(update-user): refs #7848 add twoFactor by:alexm
+- feat: #3199 Requested changes by:guillermo
+- feat: refs #3199 Added more scopes ticket_recalcByScope by:guillermo
+- feat: refs #3199 Added one more scope ticket_recalcByScope by:guillermo
+- feat: refs #3199 Created ticket_recalcItemTaxCountryByScope by:guillermo
+- feat: refs #3199 Requested changes by:guillermo
+- feat: refs #7346 add multiple feature by:jgallego
+- feat: refs #7346 backTest checks new implementation by:jgallego
+- feat: refs #7346 mas intuitivo by:jgallego
+- feat: refs #7514 Changes to put srt log (origin/7514-srtLog) by:guillermo
+- feat: refs #7524 add default limit (origin/7524-limitSelect) by:jorgep
+- feat: refs #7524 add mock limit on find query by:jorgep
+- feat: refs #7524 wip remote hooks by:jorgep
+- feat: refs #7567 Changed time to call event by:guillermo
+- feat: refs #7567 Requested changes by:guillermo
+- feat: refs #7710 pr revision by:jgallego
+- feat: refs #7710 test fixed (origin/7710-cloneWithTicketPackaging, 7710-cloneWithTicketPackaging) by:jgallego
+- feat: refs #7712 Fix by:guillermo
+- feat: refs #7712 Unify by:guillermo
+- feat: refs #7712 sizeLimit (origin/7712-sizeLimit) by:guillermo
+- feat: refs #7758 Add code mandateType and accountDetailType by:ivanm
+- feat: refs #7758 Modify code lowerCamelCase and UNIQUE by:ivanm
+- feat: refs #7758 accountDetailType fix deploy error by:ivanm
+- feat: refs #7784 Changes in entry-order-pdf by:guillermo
+- feat: refs #7784 Requested changes by:guillermo
+- feat: refs #7799 Added Fk in vn.item.itemPackingTypeFk by:guillermo
+- feat: refs #7800 Added company Fk by:guillermo
+- feat: refs #7842 Added editorFk in vn.host by:guillermo
+- feat: refs #7862 roadmap new fields by:ivanm
+- feat: refs #7882 Added quadMindsConfig table by:guillermo
+
+### Changed 📦
+
+- refactor: refs #7567 Fix and improvement by:guillermo
+- refactor: refs #7567 Minor change by:guillermo
+- refactor: refs #7756 Fix tests by:guillermo
+- refactor: refs #7798 Drop bi.Greuges_comercial_detail by:guillermo
+- refactor: refs #7848 adapt to lilium by:alexm
+
+### Fixed 🛠️
+
+- feat: refs #7710 test fixed (origin/7710-cloneWithTicketPackaging, 7710-cloneWithTicketPackaging) by:jgallego
+- feat: refs #7758 accountDetailType fix deploy error by:ivanm
+- fix(salix): #7283 ItemFixedPrice duplicated (origin/7283_itemFixedPrice_duplicated) by:Javier Segarra
+- fix: refs #7346 minor error (origin/7346, 7346) by:jgallego
+- fix: refs #7355 remove and tests accounts (origin/7355-accountMigration2) by:carlossa
+- fix: refs #7355 remove and tests accounts by:carlossa
+- fix: refs #7524 default limit select by:jorgep
+- fix: refs #7756 Foreign keys invoiceOut (origin/7756-fixRefFk) by:guillermo
+- fix: refs #7756 id 0 by:guillermo
+- fix: refs #7800 tpvMerchantEnable PRIMARY KEY (origin/7800-tpvMerchantEnable) by:guillermo
+- fix: refs #7800 tpvMerchantEnable PRIMARY KEY by:guillermo
+
+# Version 24.34 - 2024-08-20
+
+### Added 🆕
+
+- #6900 feat: clear empty by:jorgep
+- #6900 feat: empty commit by:jorgep
+- chore: refs #6900 beautify code by:jorgep
+- chore: refs #6989 add config model by:jorgep
+- feat workerActivity refs #6078 by:sergiodt
+- feat: #6453 Refactor (origin/6453-orderConfirm) by:guillermo
+- feat: #6453 Rollback always split by itemPackingType by:guillermo
+- feat: deleted worker module code & redirect to Lilium by:Jon
+- feat: refs #6453 Added new ticket search by:guillermo
+- feat: refs #6453 Fixes by:guillermo
+- feat: refs #6453 Minor changes by:guillermo
+- feat: refs #6453 Requested changes by:guillermo
+- feat: refs #6900 drop section by:jorgep
+- feat: refs #7283 order by desc date by:jorgep
+- feat: refs #7323 add locale by:jorgep
+- feat: refs #7323 redirect to lilium by:jorgep
+- feat: refs #7646 delete scannableCodeType by:robert
+- feat: refs #7713 Created ACLLog by:guillermo
+- feat: refs #7774 (origin/7774-ticket_cloneWeekly) by:robert
+- feat: refs #7774 #7774 Changes ticket_cloneWeekly by:guillermo
+- feat: refs #7774 ticket_cloneWeekly by:robert
+
+### Changed 📦
+
+- refactor: refs #6453 Major changes by:guillermo
+- refactor: refs #6453 Minor changes by:guillermo
+- refactor: refs #6453 order_confirmWithUser by:guillermo
+- refactor: refs #7646 #7646 Deleted scannable* variables productionConfig by:guillermo
+- refactor: refs #7820 Deprecated silexACL by:guillermo
+
+### Fixed 🛠️
+
+- #6900 fix: #6900 rectificative filter by:jorgep
+- #6900 fix: empty commit by:jorgep
+- fix(orders_filter): add sourceApp accepts by:alexm
+- fix: refs #6130 commit lint by:pablone
+- fix: refs #6453 order_confirmWithUser by:guillermo
+- fix: refs #7283 sql by:jorgep
+- fix: refs #7713 ACL Log by:guillermo
+- test: fix claim descriptor redirect to lilium by:alexm
+- test: fix ticket redirect to lilium by:alexm
+- test: fix ticket sale e2e by:alexm
+
# Version 24.32 - 2024-08-06
### Added 🆕
diff --git a/back/methods/vn-user/renew-token.js b/back/methods/vn-user/renew-token.js
index ae2d36e3e7..100e913ee2 100644
--- a/back/methods/vn-user/renew-token.js
+++ b/back/methods/vn-user/renew-token.js
@@ -30,16 +30,10 @@ module.exports = Self => {
// Schedule to remove current token
setTimeout(async() => {
- let exists;
try {
- exists = await models.AccessToken.findById(token.id);
- exists && await Self.logout(token.id);
+ 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);
+ // FIXME: Crash if do throw new Error(error)
}
}, courtesyTime * 1000);
@@ -53,14 +47,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/back/methods/vn-user/update-user.js b/back/methods/vn-user/update-user.js
index ddaae8548e..202b01c654 100644
--- a/back/methods/vn-user/update-user.js
+++ b/back/methods/vn-user/update-user.js
@@ -24,6 +24,10 @@ module.exports = Self => {
arg: 'lang',
type: 'string',
description: 'The user lang'
+ }, {
+ arg: 'twoFactor',
+ type: 'string',
+ description: 'The user twoFactor'
}
],
http: {
@@ -32,8 +36,8 @@ module.exports = Self => {
}
});
- Self.updateUser = async(ctx, id, name, nickname, email, lang) => {
+ Self.updateUser = async(ctx, id, name, nickname, email, lang, twoFactor) => {
await Self.userSecurity(ctx, id);
- await Self.upsertWithWhere({id}, {name, nickname, email, lang});
+ await Self.upsertWithWhere({id}, {name, nickname, email, lang, twoFactor});
};
};
diff --git a/back/model-config.json b/back/model-config.json
index 13c06ef54d..cb9ee4fdb8 100644
--- a/back/model-config.json
+++ b/back/model-config.json
@@ -118,6 +118,9 @@
"NotificationSubscription": {
"dataSource": "vn"
},
+ "OrmConfig": {
+ "dataSource": "vn"
+ },
"Province": {
"dataSource": "vn"
},
diff --git a/back/models/ormConfig.json b/back/models/ormConfig.json
new file mode 100644
index 0000000000..ef4c2b181f
--- /dev/null
+++ b/back/models/ormConfig.json
@@ -0,0 +1,26 @@
+{
+ "name": "OrmConfig",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "ormConfig"
+ }
+ },
+ "properties": {
+ "id": {
+ "type": "number",
+ "id": true
+ },
+ "selectLimit": {
+ "type": "number"
+ }
+ },
+ "acls": [
+ {
+ "accessType": "*",
+ "principalType": "ROLE",
+ "principalId": "$authenticated",
+ "permission": "ALLOW"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/back/models/vn-user.js b/back/models/vn-user.js
index 6ec5642a29..531561e04f 100644
--- a/back/models/vn-user.js
+++ b/back/models/vn-user.js
@@ -101,9 +101,10 @@ module.exports = function(Self) {
const headers = httpRequest.headers;
const origin = headers.origin;
- const defaultHash = '/reset-password?access_token=$token$';
+ const defaultHash = '!/reset-password?access_token=$token$';
const recoverHashes = {
- hedera: 'verificationToken=$token$'
+ hedera: '!verificationToken=$token$',
+ lilium: '/resetPassword?access_token=$token$'
};
const app = info.options?.app;
@@ -115,7 +116,7 @@ module.exports = function(Self) {
const params = {
recipient: info.email,
lang: user.lang,
- url: origin + '/#!' + recoverHash
+ url: origin + '/#' + recoverHash
};
const options = Object.assign({}, info.options);
diff --git a/back/process.yml b/back/process.yml
index 08fee7a933..94072b57d9 100644
--- a/back/process.yml
+++ b/back/process.yml
@@ -3,4 +3,5 @@ apps:
name: salix-back
instances: 1
max_restarts: 0
+ autorestart: false
node_args: --tls-min-v1.0 --openssl-legacy-provider
diff --git a/db/dump/.dump/data.sql b/db/dump/.dump/data.sql
index f6bc84db78..37e7835fc2 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 7776e6d5ae..1af4b446a8 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 4790e156c6..1f04c8e781 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 014bce7291..a968277b91 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 6563292dd7..703c674436 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'),
@@ -582,6 +582,7 @@ INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`
VALUES
(1, 'PLANTS SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'GOTHAM', 1, 46000, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(2, 'FARMER KING', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 46000, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
+ (4, 'INVENTARIO', 'INVENTARIO', 4000000004, NULL, NULL, 0, util.VN_CURDATE(), 1, NULL, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL, NULL),
(69, 'PACKAGING', 'Packaging nick', 4100000069, 1, '94935005K', 0, util.VN_CURDATE(), 1, 'supplier address 5', 'ASGARD', 3, 46600, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(442, 'VERDNATURA LEVANTE SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 46000, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
(567, 'HOLLAND', 'Holland nick', 4000020567, 1, '14364089Z', 0, util.VN_CURDATE(), 1, 'supplier address 6', 'ASGARD', 3, 46600, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
@@ -632,7 +633,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');
@@ -743,45 +744,45 @@ INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agen
(6, NULL, 57, util.VN_CURDATE(), 5, 7, 'sixth route', 1.7, 60, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 3),
(7, NULL, 57, util.VN_CURDATE(), 6, 8, 'seventh route', 0, 70, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 5);
-INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`, `cmrFk`)
+INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`, `cmrFk`, `problem`, `risk`)
VALUES
- (1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1),
- (2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 1, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2),
- (3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 3),
- (4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, NULL),
- (5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, NULL),
- (6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, NULL),
- (7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL, NULL),
- (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
- (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
- (22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
- (23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (33, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
- (34, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1103, 'BEJAR', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL),
- (35, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Somewhere in Philippines', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL),
- (36, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Ant-Man Adventure', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL),
- (37, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1110, 'Deadpool swords', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL);
+ (1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 'hasHighRisk', 901.4),
+ (2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 1, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2, 'hasHighRisk', 901.4),
+ (3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 3, NULL, NULL),
+ (4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, NULL, NULL, NULL),
+ (5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, NULL, NULL, NULL),
+ (6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, NULL, 'hasHighRisk', 901.4),
+ (7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
+ (8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
+ (9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, 'isTooLittle', NULL),
+ (11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasTicketRequest', NULL),
+ (12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, 'isFreezed', NULL),
+ (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, 388.7),
+ (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, 388.7),
+ (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL, NULL, 'isFreezed', NULL),
+ (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL, NULL, 'isTaxDataChecked', NULL),
+ (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL, 'isTaxDataChecked', NULL),
+ (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL, 'isTaxDataChecked', NULL),
+ (22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL, 'isTaxDataChecked', NULL),
+ (23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasTicketRequest, hasHighRisk', 901.4),
+ (24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
+ (25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
+ (26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, 'hasHighRisk', 901.4),
+ (27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, 901.4),
+ (28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (33, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (34, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1103, 'BEJAR', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (35, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Somewhere in Philippines', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (36, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Ant-Man Adventure', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL),
+ (37, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1110, 'Deadpool swords', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL, NULL, NULL);
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
VALUES
@@ -1059,50 +1060,50 @@ INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`,
(2, 2, 2, 1, util.VN_CURDATE(), NULL),
(3, 3, 2, 4, util.VN_CURDATE(), NULL);
-INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`)
+INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`, `problem`)
VALUES
- (1, 1, 1, 'Ranged weapon longbow 200cm', 5, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (2, 2, 1, 'Melee weapon combat fist 15cm', 10, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (3, 1, 1, 'Ranged weapon longbow 200cm', 2, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (4, 4, 1, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (5, 1, 2, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (6, 1, 3, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
- (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.74, 0, 0, 0, util.VN_CURDATE()),
- (8, 4, 11, 'Melee weapon heavy shield 100cm', 10, 1.79, 0, 0, 0, util.VN_CURDATE()),
- (9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
- (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE()),
- (11, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
- (12, 4, 16, 'Melee weapon heavy shield 100cm', 20, 1.71, 0, 0, 0, util.VN_CURDATE()),
- (13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE()),
- (14, 1, 8, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE()),
- (15, 1, 19, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
- (16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, util.VN_CURDATE()),
- (17, 2, 22, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
- (18, 4, 22, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
- (19, 1, 4, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)),
- (20, 1, 5, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)),
- (21, 1, 6, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (22, 1, 7, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
- (23, 1, 9, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
- (24, 1, 10, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
- (25, 4, 12, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (26, 4, 13, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (27, 4, 14, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (28, 4, 15, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (29, 4, 17, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (30, 4, 18, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE()),
- (32, 1, 24, 'Ranged weapon longbow 200cm', -1, 8.07, 0, 0, 0, util.VN_CURDATE()),
- (33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE()),
- (34, 4, 28, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (35, 4, 29, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (37, 4, 31, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (36, 4, 30, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
- (38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
- (39, 1, 32, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE()),
- (40, 2, 34, 'Melee weapon combat fist 15cm', 10.00, 3.91, 0, 0, 0, util.VN_CURDATE()),
- (41, 2, 35, 'Melee weapon combat fist 15cm', 8.00, 3.01, 0, 0, 0, util.VN_CURDATE()),
- (42, 2, 36, 'Melee weapon combat fist 15cm', 6.00, 2.50, 0, 0, 0, util.VN_CURDATE());
+ (1, 1, 1, 'Ranged weapon longbow 200cm', 5, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
+ (2, 2, 1, 'Melee weapon combat fist 15cm', 10, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
+ (3, 1, 1, 'Ranged weapon longbow 200cm', 2, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
+ (4, 4, 1, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
+ (5, 1, 2, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
+ (6, 1, 3, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 'hasComponentLack'),
+ (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.74, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (8, 4, 11, 'Melee weapon heavy shield 100cm', 10, 1.79, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (11, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (12, 4, 16, 'Melee weapon heavy shield 100cm', 20, 1.71, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (14, 1, 8, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (15, 1, 19, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (17, 2, 22, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 'hasComponentLack'),
+ (18, 4, 22, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 'hasComponentLack'),
+ (19, 1, 4, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 'hasComponentLack'),
+ (20, 1, 5, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 'hasComponentLack'),
+ (21, 1, 6, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 'hasComponentLack'),
+ (22, 1, 7, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (23, 1, 9, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (24, 1, 10, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (25, 4, 12, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (26, 4, 13, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (27, 4, 14, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (28, 4, 15, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (29, 4, 17, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (30, 4, 18, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (32, 1, 24, 'Ranged weapon longbow 200cm', -1, 8.07, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (34, 4, 28, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (35, 4, 29, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (37, 4, 31, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), NULL),
+ (36, 4, 30, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 'hasComponentLack'),
+ (39, 1, 32, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (40, 2, 34, 'Melee weapon combat fist 15cm', 10.00, 3.91, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (41, 2, 35, 'Melee weapon combat fist 15cm', 8.00, 3.01, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack'),
+ (42, 2, 36, 'Melee weapon combat fist 15cm', 6.00, 2.50, 0, 0, 0, util.VN_CURDATE(), 'hasComponentLack');
INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
VALUES
@@ -1516,6 +1517,9 @@ INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed
(9, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 9', 1, 1, ''),
(10, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 9', 1, 1, '');
+INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `defaultSupplierFk`)
+ VALUES (2, 4, 1);
+
INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWasteQuantity`, `saleInternalWaste`, `saleExternalWaste`)
VALUES
('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 1, 1, '1062', '51', '56.20', '56.20'),
@@ -3945,11 +3949,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/bs/procedures/waste_addSales.sql b/db/routines/bs/procedures/waste_addSales.sql
index b855e8b0dd..20eee5d494 100644
--- a/db/routines/bs/procedures/waste_addSales.sql
+++ b/db/routines/bs/procedures/waste_addSales.sql
@@ -25,10 +25,7 @@ BEGIN
IF(
aw.`type` = 'external',
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
- IF(c.code = 'manaClaim',
- sc.value * s.quantity,
- 0
- )
+ 0
)
)
FROM vn.sale s
@@ -41,10 +38,8 @@ 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 ;
diff --git a/db/routines/salix/triggers/ACL_afterDelete.sql b/db/routines/salix/triggers/ACL_afterDelete.sql
index 18689dfb03..b7e6071fc2 100644
--- a/db/routines/salix/triggers/ACL_afterDelete.sql
+++ b/db/routines/salix/triggers/ACL_afterDelete.sql
@@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `salix`.`ACL_afterDelete`
AFTER DELETE ON `ACL`
FOR EACH ROW
BEGIN
- INSERT INTO ACL
+ INSERT INTO ACLLog
SET `action` = 'delete',
`changedModel` = 'Acl',
`changedModelId` = OLD.id,
diff --git a/db/routines/srt/events/moving_clean.sql b/db/routines/srt/events/moving_clean.sql
index a6f7792a26..18644a9f8a 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 b8fae7ff43..a5bbc7e70f 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 0000000000..d554e63647
--- /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 0000000000..6b1e05362c
--- /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 0000000000..86418a5510
--- /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 0000000000..1e4af91047
--- /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 0000000000..7d83896463
--- /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 0000000000..0002fb4d63
--- /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 66448ac9c9..9df887cf57 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 02edd83f2e..0000000000
--- 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/functions/ticket_isTooLittle.sql b/db/routines/vn/functions/ticket_isTooLittle.sql
index bcbf090358..2752b3f350 100644
--- a/db/routines/vn/functions/ticket_isTooLittle.sql
+++ b/db/routines/vn/functions/ticket_isTooLittle.sql
@@ -2,7 +2,7 @@ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`ticket_isTooLittle`(
vSelf INT
)
- RETURNS tinyint(1)
+ RETURNS BOOL
READS SQL DATA
BEGIN
/**
@@ -11,14 +11,21 @@ BEGIN
* @param vSelf Id ticket
* @return BOOL
*/
- DECLARE vIsTooLittle TINYINT(1);
-
+ DECLARE vIsTooLittle BOOL;
+
+ WITH ticketData AS (
+ SELECT addressFk, DATE(shipped) dated
+ FROM vn.ticket
+ WHERE id = vSelf
+ )
SELECT (SUM(IFNULL(sv.litros, 0)) < vc.minTicketVolume
- AND IFNULL(t.totalWithoutVat, 0) < vc.minTicketValue) INTO vIsTooLittle
- FROM ticket t
- LEFT JOIN saleVolume sv ON sv.ticketFk = t.id
- JOIN volumeConfig vc
- WHERE t.id = vSelf;
+ AND SUM(IFNULL(t.totalWithoutVat, 0)) < vc.minTicketValue) INTO vIsTooLittle
+ FROM ticketData td
+ JOIN vn.ticket t ON t.addressFk = td.addressFk
+ LEFT JOIN vn.saleVolume sv ON sv.ticketFk = t.id
+ JOIN vn.volumeConfig vc
+ WHERE t.shipped BETWEEN td.dated AND util.dayEnd(td.dated)
+ AND ticket_isProblemCalcNeeded(t.id);
RETURN vIsTooLittle;
END$$
diff --git a/db/routines/vn/procedures/clean.sql b/db/routines/vn/procedures/clean.sql
index f479d5b3e8..9a90b4e85c 100644
--- a/db/routines/vn/procedures/clean.sql
+++ b/db/routines/vn/procedures/clean.sql
@@ -19,14 +19,12 @@ BEGIN
DELETE FROM workerActivity WHERE created < v2Years;
DELETE FROM ticketParking WHERE created < v2Months;
DELETE FROM routesMonitor WHERE dated < v2Months;
- DELETE FROM workerTimeControlLog WHERE created < v2Months;
DELETE FROM `message` WHERE sendDate < v2Months;
DELETE FROM messageInbox WHERE sendDate < v2Months;
DELETE FROM messageInbox WHERE sendDate < v2Months;
DELETE FROM workerTimeControl WHERE timed < v4Years;
DELETE FROM itemShelving WHERE created < util.VN_CURDATE() AND visible = 0;
DELETE FROM ticketDown WHERE created < util.yesterday();
- DELETE FROM entryLog WHERE creationDate < v2Months;
DELETE IGNORE FROM expedition WHERE created < v26Months;
DELETE cs
FROM sms s
@@ -61,11 +59,8 @@ BEGIN
DELETE b FROM buy b
JOIN entryConfig e ON e.defaultEntry = b.entryFk
WHERE b.created < v2Months;
- DELETE FROM itemShelvingLog WHERE created < v2Months;
DELETE FROM stockBuyed WHERE creationDate < v2Months;
- DELETE FROM itemCleanLog WHERE created < util.VN_NOW() - INTERVAL 1 YEAR;
DELETE FROM printQueue WHERE statusCode = 'printed' AND created < v2Months;
- DELETE FROM ticketLog WHERE creationDate <= v5Years;
-- Equipos duplicados
DELETE w.*
FROM workerTeam w
@@ -174,7 +169,6 @@ BEGIN
-- Borra los registros de collection y ticketcollection
DELETE FROM collection WHERE created < v2Months;
- DELETE FROM travelLog WHERE creationDate < v3Months;
CALL shelving_clean();
diff --git a/db/routines/vn/procedures/client_userDisable.sql b/db/routines/vn/procedures/client_userDisable.sql
index f2ba65c1cd..779ffd6881 100644
--- a/db/routines/vn/procedures/client_userDisable.sql
+++ b/db/routines/vn/procedures/client_userDisable.sql
@@ -21,6 +21,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
diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql
index f9032a91de..8e48718b56 100644
--- a/db/routines/vn/procedures/collection_assign.sql
+++ b/db/routines/vn/procedures/collection_assign.sql
@@ -13,39 +13,42 @@ BEGIN
* @param vCollectionFk Id de colección
*/
DECLARE vHasTooMuchCollections BOOL;
- DECLARE vItemPackingTypeFk VARCHAR(1);
- DECLARE vWarehouseFk INT;
- DECLARE vLockName VARCHAR(215);
- DECLARE vLockTime INT DEFAULT 30;
- DECLARE vErrorNumber INT;
- DECLARE vErrorMsg TEXT;
+ DECLARE vDone BOOL DEFAULT FALSE;
+ DECLARE vCollectionWorker INT;
+ DECLARE vMaxNotAssignedCollectionLifeTime TIME;
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- GET DIAGNOSTICS CONDITION 1
- vErrorNumber = MYSQL_ERRNO,
- vErrorMsg = MESSAGE_TEXT;
-
- CALL util.debugAdd('collection_assign', JSON_OBJECT(
- 'errorNumber', vErrorNumber,
- 'errorMsg', vErrorMsg,
- 'lockName', vLockName,
- 'userFk', vUserFk
- )); -- Tmp
-
- IF vLockName IS NOT NULL THEN
- DO RELEASE_LOCK(vLockName);
- END IF;
- RESIGNAL;
- END;
+ DECLARE vCollections CURSOR FOR
+ WITH collections AS (
+ SELECT tc.collectionFk,
+ SUM(sv.volume) volume,
+ c.saleTotalCount,
+ c.itemPackingTypeFk,
+ c.trainFk,
+ c.warehouseFk,
+ c.wagons
+ FROM vn.ticketCollection tc
+ JOIN vn.collection c ON c.id = tc.collectionFk
+ JOIN vn.saleVolume sv ON sv.ticketFk = tc.ticketFk
+ WHERE c.workerFk IS NULL
+ AND sv.shipped >= util.VN_CURDATE()
+ GROUP BY tc.collectionFk
+ ) SELECT c.collectionFk
+ FROM collections c
+ JOIN vn.operator o
+ WHERE o.workerFk = vUserFk
+ AND (c.saleTotalCount <= o.linesLimit OR o.linesLimit IS NULL)
+ AND (c.itemPackingTypeFk = o.itemPackingTypeFk OR o.itemPackingTypeFk IS NULL)
+ AND o.numberOfWagons = c.wagons
+ AND o.trainFk = c.trainFk
+ AND o.warehouseFk = c.warehouseFk;
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-- Si hay colecciones sin terminar, sale del proceso
+
CALL collection_get(vUserFk);
- SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0,
- collection_assign_lockname
- INTO vHasTooMuchCollections,
- vLockName
+ SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0, pc.maxNotAssignedCollectionLifeTime
+ INTO vHasTooMuchCollections, vMaxNotAssignedCollectionLifeTime
FROM productionConfig pc
LEFT JOIN tmp.collection ON TRUE;
@@ -55,69 +58,69 @@ BEGIN
CALL util.throw('Hay colecciones pendientes');
END IF;
- SELECT warehouseFk, itemPackingTypeFk
- INTO vWarehouseFk, vItemPackingTypeFk
- FROM operator
- WHERE workerFk = vUserFk;
-
- SET vLockName = CONCAT_WS('/',
- vLockName,
- vWarehouseFk,
- vItemPackingTypeFk
- );
-
- IF NOT GET_LOCK(vLockName, vLockTime) THEN
- CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
- END IF;
-
-- Se eliminan las colecciones sin asignar que estan obsoletas
- INSERT INTO ticketTracking(stateFk, ticketFk)
- SELECT s.id, tc.ticketFk
- FROM `collection` c
- JOIN ticketCollection tc ON tc.collectionFk = c.id
- JOIN `state` s ON s.code = 'PRINTED_AUTO'
- JOIN productionConfig pc
- WHERE c.workerFk IS NULL
- AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime;
- DELETE c.*
- FROM `collection` c
- JOIN productionConfig pc
- WHERE c.workerFk IS NULL
- AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime;
+ INSERT INTO ticketTracking(stateFk, ticketFk)
+ SELECT s.id, tc.ticketFk
+ FROM `collection` c
+ JOIN ticketCollection tc ON tc.collectionFk = c.id
+ JOIN `state` s ON s.code = 'PRINTED_AUTO'
+ WHERE c.workerFk IS NULL
+ AND TIMEDIFF(util.VN_NOW(), c.created) > vMaxNotAssignedCollectionLifeTime;
+
+ DELETE FROM `collection`
+ WHERE workerFk IS NULL
+ AND TIMEDIFF(util.VN_NOW(), created) > vMaxNotAssignedCollectionLifeTime;
-- Se añade registro al semillero
- INSERT INTO collectionHotbed(userFk)
- VALUES(vUserFk);
+
+ INSERT INTO collectionHotbed(userFk) VALUES(vUserFk);
-- Comprueba si hay colecciones disponibles que se ajustan a su configuracion
- SELECT MIN(c.id) INTO vCollectionFk
- FROM `collection` c
- JOIN operator o
- ON (o.itemPackingTypeFk = c.itemPackingTypeFk OR c.itemPackingTypeFk IS NULL)
- AND o.numberOfWagons = c.wagons
- AND o.trainFk = c.trainFk
- AND o.warehouseFk = c.warehouseFk
- AND c.workerFk IS NULL
- AND (c.saleTotalCount <= o.linesLimit OR o.linesLimit IS NULL)
- JOIN (
- SELECT tc.collectionFk, SUM(sv.volume) volume
- FROM ticketCollection tc
- JOIN saleVolume sv ON sv.ticketFk = tc.ticketFk
- WHERE sv.shipped >= util.VN_CURDATE()
- GROUP BY tc.collectionFk
- ) sub ON sub.collectionFk = c.id
- AND (volume <= o.volumeLimit OR o.volumeLimit IS NULL)
- WHERE o.workerFk = vUserFk;
+
+ OPEN vCollections;
+ l: LOOP
+ SET vDone = FALSE;
+ FETCH vCollections INTO vCollectionFk;
+
+ IF vDone THEN
+ LEAVE l;
+ END IF;
+
+ BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK;
+ SET vCollectionFk = NULL;
+ RESIGNAL;
+ END;
+
+ START TRANSACTION;
+
+ SELECT workerFk INTO vCollectionWorker
+ FROM `collection`
+ WHERE id = vCollectionFk FOR UPDATE;
+
+ IF vCollectionWorker IS NULL THEN
+ UPDATE `collection`
+ SET workerFk = vUserFk
+ WHERE id = vCollectionFk;
+
+ COMMIT;
+ LEAVE l;
+ END IF;
+
+ ROLLBACK;
+ END;
+ END LOOP;
+ CLOSE vCollections;
IF vCollectionFk IS NULL THEN
CALL collection_new(vUserFk, vCollectionFk);
+
+ UPDATE `collection`
+ SET workerFk = vUserFk
+ WHERE id = vCollectionFk;
END IF;
-
- UPDATE `collection`
- SET workerFk = vUserFk
- WHERE id = vCollectionFk;
-
- DO RELEASE_LOCK(vLockName);
END$$
-DELIMITER ;
+DELIMITER ;
\ No newline at end of file
diff --git a/db/routines/vn/procedures/collection_mergeSales.sql b/db/routines/vn/procedures/collection_mergeSales.sql
new file mode 100644
index 0000000000..26444d6f91
--- /dev/null
+++ b/db/routines/vn/procedures/collection_mergeSales.sql
@@ -0,0 +1,29 @@
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_mergeSales`(vCollectionFk INT)
+BEGIN
+ DECLARE vDone BOOL;
+ DECLARE vTicketFk INT;
+
+ DECLARE vTickets CURSOR FOR
+ SELECT ticketFk
+ FROM ticketCollection
+ WHERE collectionFk = vCollectionFk;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND
+ SET vDone = TRUE;
+
+ OPEN vTickets;
+ l: LOOP
+ SET vDone = FALSE;
+
+ FETCH vTickets INTO vTicketFk;
+
+ IF vDone THEN
+ LEAVE l;
+ END IF;
+
+ CALL ticket_mergeSales(vTicketFk);
+ END LOOP;
+ CLOSE vTickets;
+END$$
+DELIMITER ;
diff --git a/db/routines/vn/procedures/collection_new.sql b/db/routines/vn/procedures/collection_new.sql
index 0bd6e1b25b..18b51c4d37 100644
--- a/db/routines/vn/procedures/collection_new.sql
+++ b/db/routines/vn/procedures/collection_new.sql
@@ -1,5 +1,8 @@
DELIMITER $$
-CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_new`(vUserFk INT, OUT vCollectionFk INT)
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_new`(
+ vUserFk INT,
+ OUT vCollectionFk INT
+)
BEGIN
/**
* Genera colecciones de tickets sin asignar trabajador.
@@ -9,32 +12,32 @@ BEGIN
DECLARE vWarehouseFk INT;
DECLARE vWagons INT;
DECLARE vTrainFk INT;
- DECLARE vLinesLimit INT DEFAULT NULL;
+ DECLARE vLinesLimit INT;
DECLARE vTicketLines INT;
- DECLARE vVolumeLimit DECIMAL DEFAULT NULL;
+ DECLARE vVolumeLimit DECIMAL;
+ DECLARE vSizeLimit INT;
DECLARE vTicketVolume DECIMAL;
DECLARE vMaxTickets INT;
- DECLARE vStateFk VARCHAR(45);
+ DECLARE vStateCode VARCHAR(45);
DECLARE vFirstTicketFk INT;
- DECLARE vHour INT;
- DECLARE vMinute INT;
DECLARE vWorkerCode VARCHAR(3);
- DECLARE vWagonCounter INT DEFAULT 0;
+ DECLARE vWagonCounter INT DEFAULT 1;
DECLARE vTicketFk INT;
DECLARE vItemPackingTypeFk VARCHAR(1);
- DECLARE vHasAssignedTickets BOOLEAN;
+ DECLARE vHasAssignedTickets BOOL;
DECLARE vHasUniqueCollectionTime BOOL;
- DECLARE vDone INT DEFAULT FALSE;
- DECLARE vLockName VARCHAR(215);
- DECLARE vLockTime INT DEFAULT 30;
+ DECLARE vHeight INT;
+ DECLARE vVolume INT;
+ DECLARE vLiters INT;
+ DECLARE vLines INT;
+ DECLARE vTotalLines INT DEFAULT 0;
+ DECLARE vTotalVolume INT DEFAULT 0;
DECLARE vFreeWagonFk INT;
- DECLARE vErrorNumber INT;
- DECLARE vErrorMsg TEXT;
+ DECLARE vDone INT DEFAULT FALSE;
- DECLARE c1 CURSOR FOR
+ DECLARE vTickets CURSOR FOR
SELECT ticketFk, `lines`, m3
FROM tmp.productionBuffer
- WHERE ticketFk <> vFirstTicketFk
ORDER BY HH,
mm,
productionOrder DESC,
@@ -47,26 +50,6 @@ BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- GET DIAGNOSTICS CONDITION 1
- vErrorNumber = MYSQL_ERRNO,
- vErrorMsg = MESSAGE_TEXT;
-
- CALL util.debugAdd('collection_new', JSON_OBJECT(
- 'errorNumber', vErrorNumber,
- 'errorMsg', vErrorMsg,
- 'lockName', vLockName,
- 'userFk', vUserFk,
- 'ticketFk', vTicketFk
- )); -- Tmp
-
- IF vLockName IS NOT NULL THEN
- DO RELEASE_LOCK(vLockName);
- END IF;
- RESIGNAL;
- END;
-
SELECT pc.ticketTrolleyMax * o.numberOfWagons,
pc.hasUniqueCollectionTime,
w.code,
@@ -77,34 +60,26 @@ BEGIN
o.trainFk,
o.linesLimit,
o.volumeLimit,
- pc.collection_new_lockname
+ o.sizeLimit
INTO vMaxTickets,
- vHasUniqueCollectionTime,
- vWorkerCode,
- vWarehouseFk,
- vItemPackingTypeFk,
- vStateFk,
- vWagons,
- vTrainFk,
- vLinesLimit,
- vVolumeLimit,
- vLockName
- FROM productionConfig pc
- JOIN worker w ON w.id = vUserFk
+ vHasUniqueCollectionTime,
+ vWorkerCode,
+ vWarehouseFk,
+ vItemPackingTypeFk,
+ vStateCode,
+ vWagons,
+ vTrainFk,
+ vLinesLimit,
+ vVolumeLimit,
+ vSizeLimit
+ FROM worker w
+ JOIN operator o ON o.workerFk = w.id
JOIN state st ON st.`code` = 'ON_PREPARATION'
- JOIN operator o ON o.workerFk = vUserFk;
-
- SET vLockName = CONCAT_WS('/',
- vLockName,
- vWarehouseFk,
- vItemPackingTypeFk
- );
-
- IF NOT GET_LOCK(vLockName, vLockTime) THEN
- CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
- END IF;
+ JOIN productionConfig pc
+ WHERE w.id = vUserFk;
-- Se prepara el tren, con tantos vagones como sea necesario.
+
CREATE OR REPLACE TEMPORARY TABLE tTrain
(wagon INT,
shelve INT,
@@ -115,63 +90,70 @@ BEGIN
PRIMARY KEY(wagon, shelve))
ENGINE = MEMORY;
- WHILE vWagons > vWagonCounter DO
- SET vWagonCounter = vWagonCounter + 1;
-
- INSERT INTO tTrain(wagon, shelve, liters, `lines`, height)
- SELECT vWagonCounter, cv.`level` , cv.liters , cv.`lines` , cv.height
- FROM collectionVolumetry cv
- WHERE cv.trainFk = vTrainFk
+ INSERT INTO tTrain (wagon, shelve, liters, `lines`, height)
+ WITH RECURSIVE wagonSequence AS (
+ SELECT vWagonCounter wagon
+ UNION ALL
+ SELECT wagon + 1 wagon
+ FROM wagonSequence
+ WHERE wagon < vWagonCounter + vWagons -1
+ )
+ SELECT ws.wagon, cv.`level`, cv.liters, cv.`lines`, cv.height
+ FROM wagonSequence ws
+ JOIN vn.collectionVolumetry cv ON cv.trainFk = vTrainFk
AND cv.itemPackingTypeFk = vItemPackingTypeFk;
- END WHILE;
-- Esto desaparecerá cuando tengamos la table cache.ticket
+
CALL productionControl(vWarehouseFk, 0);
ALTER TABLE tmp.productionBuffer
ADD COLUMN liters INT,
ADD COLUMN height INT;
- -- Se obtiene nº de colección.
- INSERT INTO collection
- SET itemPackingTypeFk = vItemPackingTypeFk,
- trainFk = vTrainFk,
- wagons = vWagons,
- warehouseFk = vWarehouseFk;
-
- SELECT LAST_INSERT_ID() INTO vCollectionFk;
-
-- Los tickets de recogida en Algemesí sólo se sacan si están asignados.
-- Los pedidos con riesgo no se sacan aunque se asignen.
- DELETE pb.*
+
+ DELETE pb
FROM tmp.productionBuffer pb
JOIN state s ON s.id = pb.state
WHERE (pb.agency = 'REC_ALGEMESI'
AND s.code <> 'PICKER_DESIGNED')
OR pb.problem LIKE '%RIESGO%';
- -- Comprobamos si hay tickets asignados. En ese caso, nos centramos
- -- exclusivamente en esos tickets y los sacamos independientemente
- -- de problemas o tamaños
- SELECT COUNT(*) INTO vHasAssignedTickets
- FROM tmp.productionBuffer pb
- JOIN state s ON s.id = pb.state
- WHERE s.code = 'PICKER_DESIGNED'
- AND pb.workerCode = vWorkerCode;
+ -- Si hay tickets asignados, nos centramos exclusivamente en esos tickets
+ -- y los sacamos independientemente de problemas o tamaños
+
+ SELECT EXISTS (
+ SELECT TRUE
+ FROM tmp.productionBuffer pb
+ JOIN state s ON s.id = pb.state
+ WHERE s.code = 'PICKER_DESIGNED'
+ AND pb.workerCode = vWorkerCode
+ ) INTO vHasAssignedTickets;
-- Se dejan en la tabla tmp.productionBuffer sólo aquellos tickets adecuados
+
IF vHasAssignedTickets THEN
- DELETE pb.*
+ DELETE pb
FROM tmp.productionBuffer pb
JOIN state s ON s.id = pb.state
WHERE s.code <> 'PICKER_DESIGNED'
OR pb.workerCode <> vWorkerCode;
ELSE
- DELETE pb.*
+ DELETE pb
FROM tmp.productionBuffer pb
JOIN state s ON s.id = pb.state
JOIN agencyMode am ON am.id = pb.agencyModeFk
JOIN agency a ON a.id = am.agencyFk
+ LEFT JOIN (
+ SELECT pb.ticketFk, MAX(i.`size`) maxSize
+ FROM tmp.productionBuffer pb
+ JOIN ticket t ON t.id = pb.ticketfk
+ JOIN sale s ON s.ticketFk = t.id
+ JOIN item i ON i.id = s.itemFk
+ GROUP BY pb.ticketFk
+ ) sub ON sub.ticketFk = pb.ticketFk
JOIN productionConfig pc
WHERE pb.shipped <> util.VN_CURDATE()
OR (pb.ubicacion IS NULL AND a.isOwn)
@@ -182,71 +164,65 @@ BEGIN
OR (NOT pb.H AND pb.V > 0 AND vItemPackingTypeFk = 'H')
OR (NOT pb.V AND vItemPackingTypeFk = 'V')
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
- OR LENGTH(pb.problem) > 0
- OR (pb.lines >= vLinesLimit AND vLinesLimit IS NOT NULL)
- OR (pb.m3 >= vVolumeLimit AND vVolumeLimit IS NOT NULL);
+ OR LENGTH(pb.problem)
+ OR pb.lines > vLinesLimit
+ OR pb.m3 > vVolumeLimit
+ OR sub.maxSize > vSizeLimit;
END IF;
- -- Es importante que el primer ticket se coja en todos los casos
- SELECT ticketFk,
- HH,
- mm,
- `lines`,
- m3
- INTO vFirstTicketFk,
- vHour,
- vMinute,
- vTicketLines,
- vTicketVolume
- FROM tmp.productionBuffer
- ORDER BY HH,
- mm,
- productionOrder DESC,
- m3 DESC,
- agency,
- zona,
- routeFk,
- ticketFk
- LIMIT 1;
-
-- Hay que excluir aquellos que no tengan la misma hora de preparacion, si procede
IF vHasUniqueCollectionTime THEN
- DELETE FROM tmp.productionBuffer
- WHERE HH <> vHour
- OR mm <> vMinute;
+
+ SELECT ticketFk INTO vFirstTicketFk
+ FROM tmp.productionBuffer
+ ORDER BY HH,
+ mm,
+ productionOrder DESC,
+ m3 DESC,
+ agency,
+ zona,
+ routeFk,
+ ticketFk
+ LIMIT 1;
+
+ DELETE pb
+ FROM tmp.productionBuffer pb
+ JOIN tmp.productionBuffer pb2 ON pb2.ticketFk = vFirstTicketFk
+ AND (pb.HH <> pb2.HH OR pb.mm <> pb2.mm);
+
END IF;
- SET vTicketFk = vFirstTicketFk;
- SET @lines = 0;
- SET @volume = 0;
-
- OPEN c1;
- read_loop: LOOP
+ OPEN vTickets;
+ l: LOOP
SET vDone = FALSE;
+ FETCH vTickets INTO vTicketFk, vTicketLines, vTicketVolume;
+
+ IF vDone THEN
+ LEAVE l;
+ END IF;
-- Buscamos un ticket que cumpla con los requisitos en el listado
- IF ((vTicketLines + @lines) <= vLinesLimit OR vLinesLimit IS NULL)
- AND ((vTicketVolume + @volume) <= vVolumeLimit OR vVolumeLimit IS NULL) THEN
+
+ IF (vLinesLimit IS NULL OR (vTotalLines + vTicketLines) <= vLinesLimit)
+ AND (vVolumeLimit IS NULL OR (vTotalVolume + vTicketVolume) <= vVolumeLimit) THEN
CALL ticket_splitItemPackingType(vTicketFk, vItemPackingTypeFk);
DROP TEMPORARY TABLE tmp.ticketIPT;
+ SELECT COUNT(*), SUM(litros), MAX(i.`size`), SUM(sv.volume)
+ INTO vLines, vLiters, vHeight, vVolume
+ FROM saleVolume sv
+ JOIN sale s ON s.id = sv.saleFk
+ JOIN item i ON i.id = s.itemFk
+ WHERE sv.ticketFk = vTicketFk;
+
+ SET vTotalVolume = vTotalVolume + vVolume,
+ vTotalLines = vTotalLines + vLines;
+
UPDATE tmp.productionBuffer pb
- JOIN (
- SELECT SUM(litros) liters,
- @lines:= COUNT(*) + @lines,
- COUNT(*) `lines`,
- MAX(i.`size`) height,
- @volume := SUM(sv.volume) + @volume,
- SUM(sv.volume) volume
- FROM saleVolume sv
- JOIN sale s ON s.id = sv.saleFk
- JOIN item i ON i.id = s.itemFk
- WHERE sv.ticketFk = vTicketFk
- ) sub
- SET pb.liters = sub.liters,
- pb.`lines` = sub.`lines`,
- pb.height = sub.height
+ SET pb.liters = vLiters,
+ pb.`lines` = vLines,
+ pb.height = vHeight
WHERE pb.ticketFk = vTicketFk;
UPDATE tTrain tt
@@ -263,17 +239,13 @@ BEGIN
tt.height
LIMIT 1;
- -- Si no le encuentra una balda adecuada, intentamos darle un carro entero si queda alguno libre
+ -- Si no le encuentra una balda, intentamos darle un carro entero libre
+
IF NOT (SELECT COUNT(*) FROM tTrain WHERE ticketFk) THEN
- SELECT tt.wagon
- INTO vFreeWagonFk
- FROM tTrain tt
- LEFT JOIN (
- SELECT DISTINCT wagon
- FROM tTrain
- WHERE ticketFk IS NOT NULL
- ) nn ON nn.wagon = tt.wagon
- WHERE nn.wagon IS NULL
+ SELECT wagon INTO vFreeWagonFk
+ FROM tTrain
+ GROUP BY wagon
+ HAVING SUM(IFNULL(ticketFk, 0)) = 0
ORDER BY wagon
LIMIT 1;
@@ -282,38 +254,35 @@ BEGIN
SET ticketFk = vFirstTicketFk
WHERE wagon = vFreeWagonFk;
- -- Se anulan el resto de carros libres para que sólo uno lleve un pedido excesivo
- DELETE tt.*
- FROM tTrain tt
- LEFT JOIN (
- SELECT DISTINCT wagon
- FROM tTrain
- WHERE ticketFk IS NOT NULL
- ) nn ON nn.wagon = tt.wagon
- WHERE nn.wagon IS NULL;
- END IF;
- END IF;
+ -- Se anulan el resto de carros libres,
+ -- máximo un carro con pedido excesivo
- FETCH c1 INTO vTicketFk, vTicketLines, vTicketVolume;
- IF vDone OR NOT (SELECT COUNT(*) FROM tTrain WHERE ticketFk IS NULL) THEN
- LEAVE read_loop;
- END IF;
- ELSE
- FETCH c1 INTO vTicketFk, vTicketLines, vTicketVolume;
- IF vDone THEN
- LEAVE read_loop;
- END IF;
+ DELETE tt
+ FROM tTrain tt
+ JOIN (SELECT wagon
+ FROM tTrain
+ GROUP BY wagon
+ HAVING SUM(IFNULL(ticketFk, 0)) = 0
+ ) sub ON sub.wagon = tt.wagon;
+ END IF;
+ END IF;
END IF;
END LOOP;
- CLOSE c1;
+ CLOSE vTickets;
IF (SELECT COUNT(*) FROM tTrain WHERE ticketFk) THEN
- UPDATE collection c
- JOIN state st ON st.code = 'ON_PREPARATION'
- SET c.stateFk = st.id
- WHERE c.id = vCollectionFk;
+ -- Se obtiene nº de colección
+
+ INSERT INTO collection
+ SET itemPackingTypeFk = vItemPackingTypeFk,
+ trainFk = vTrainFk,
+ wagons = vWagons,
+ warehouseFk = vWarehouseFk;
+
+ SELECT LAST_INSERT_ID() INTO vCollectionFk;
-- Asigna las bandejas
+
INSERT IGNORE INTO ticketCollection(ticketFk, collectionFk, `level`, wagon, liters)
SELECT tt.ticketFk, vCollectionFk, tt.shelve, tt.wagon, tt.liters
FROM tTrain tt
@@ -321,37 +290,34 @@ BEGIN
ORDER BY tt.wagon, tt.shelve;
-- Actualiza el estado de los tickets
- CALL collection_setState(vCollectionFk, vStateFk);
+
+ CALL collection_setState(vCollectionFk, vStateCode);
-- Aviso para la preparacion previa
+
INSERT INTO ticketDown(ticketFk, collectionFk)
SELECT tc.ticketFk, tc.collectionFk
FROM ticketCollection tc
WHERE tc.collectionFk = vCollectionFk;
- CALL sales_mergeByCollection(vCollectionFk);
+ CALL collection_mergeSales(vCollectionFk);
UPDATE `collection` c
- JOIN (
+ JOIN(
SELECT COUNT(*) saleTotalCount,
SUM(s.isPicked <> 0) salePickedCount
FROM ticketCollection tc
JOIN sale s ON s.ticketFk = tc.ticketFk
- WHERE tc.collectionFk = vCollectionFk
- AND s.quantity > 0
- ) sub
+ WHERE tc.collectionFk = vCollectionFk
+ AND s.quantity > 0
+ )sub
SET c.saleTotalCount = sub.saleTotalCount,
c.salePickedCount = sub.salePickedCount
WHERE c.id = vCollectionFk;
-
ELSE
- DELETE FROM `collection`
- WHERE id = vCollectionFk;
- SET vCollectionFk = NULL;
+ SET vCollectionFk = NULL;
END IF;
- DO RELEASE_LOCK(vLockName);
-
DROP TEMPORARY TABLE
tTrain,
tmp.productionBuffer;
diff --git a/db/routines/vn/procedures/invoiceOut_new.sql b/db/routines/vn/procedures/invoiceOut_new.sql
index c9b94027eb..43d0a09a11 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/itemShelvingSale_addBySectorCollection.sql b/db/routines/vn/procedures/itemShelvingSale_addBySectorCollection.sql
index c359c7c8d3..26e661d9a9 100644
--- a/db/routines/vn/procedures/itemShelvingSale_addBySectorCollection.sql
+++ b/db/routines/vn/procedures/itemShelvingSale_addBySectorCollection.sql
@@ -12,7 +12,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
diff --git a/db/routines/vn/procedures/itemShelving_transfer.sql b/db/routines/vn/procedures/itemShelving_transfer.sql
index 47a9a7cf0e..94d2308a18 100644
--- a/db/routines/vn/procedures/itemShelving_transfer.sql
+++ b/db/routines/vn/procedures/itemShelving_transfer.sql
@@ -5,28 +5,26 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_transf
)
BEGIN
/**
- * Transfiere producto de una ubicación a otra, fusionando si coincide el
- * packing y la fecha.
+ * Transfiere producto de una ubicación a otra
+ * fusionando si coincide el packing y la fecha.
*
* @param vItemShelvingFk Identificador de itemShelving
* @param vShelvingFk Identificador de shelving
*/
- DECLARE vNewItemShelvingFk INT DEFAULT 0;
+ DECLARE vNewItemShelvingFk INT;
- SELECT MAX(ish.id)
- INTO vNewItemShelvingFk
+ SELECT MAX(ish.id) INTO vNewItemShelvingFk
FROM itemShelving ish
JOIN (
- SELECT
- itemFk,
- packing,
- created,
- buyFk
+ SELECT itemFk,
+ packing,
+ created,
+ buyFk
FROM itemShelving
WHERE id = vItemShelvingFk
) ish2 ON ish2.itemFk = ish.itemFk
AND ish2.packing = ish.packing
- AND date(ish2.created) = date(ish.created)
+ AND DATE(ish2.created) = DATE(ish.created)
AND ish2.buyFk = ish.buyFk
WHERE ish.shelvingFk = vShelvingFk COLLATE utf8_unicode_ci;
@@ -39,10 +37,16 @@ BEGIN
DELETE FROM itemShelving
WHERE id = vItemShelvingFk;
ELSE
- UPDATE itemShelving
- SET shelvingFk = vShelvingFk
- WHERE id = vItemShelvingFk;
+ IF (SELECT EXISTS(SELECT id FROM shelving
+ WHERE code = vShelvingFk COLLATE utf8_unicode_ci)) THEN
+
+ UPDATE itemShelving
+ SET shelvingFk = vShelvingFk
+ WHERE id = vItemShelvingFk;
+ ELSE
+ CALL util.throw('The shelving not exists');
+ END IF;
END IF;
- SELECT true;
+ SELECT TRUE;
END$$
-DELIMITER ;
\ No newline at end of file
+DELIMITER ;
diff --git a/db/routines/vn/procedures/productionControl.sql b/db/routines/vn/procedures/productionControl.sql
index af6d929d7d..84717a19aa 100644
--- a/db/routines/vn/procedures/productionControl.sql
+++ b/db/routines/vn/procedures/productionControl.sql
@@ -15,11 +15,6 @@ proc: BEGIN
DECLARE vEndingDate DATETIME;
DECLARE vIsTodayRelative BOOLEAN;
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- RESIGNAL;
- END;
-
SELECT util.dayEnd(util.VN_CURDATE()) + INTERVAL LEAST(vScopeDays, maxProductionScopeDays) DAY
INTO vEndingDate
FROM productionConfig;
@@ -273,7 +268,6 @@ proc: BEGIN
DROP TEMPORARY TABLE
tmp.productionTicket,
tmp.ticket,
- tmp.risk,
tmp.ticket_problems,
tmp.ticketWithPrevia,
tItemShelvingStock,
diff --git a/db/routines/vn/procedures/sale_getProblems.sql b/db/routines/vn/procedures/sale_getProblems.sql
index c881bcf927..6f65a37220 100644
--- a/db/routines/vn/procedures/sale_getProblems.sql
+++ b/db/routines/vn/procedures/sale_getProblems.sql
@@ -1,152 +1,89 @@
DELIMITER $$
-CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getProblems`(IN vIsTodayRelative tinyint(1))
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getProblems`(
+ vIsTodayRelative tinyint(1)
+)
BEGIN
/**
* Calcula los problemas de cada venta para un conjunto de tickets.
*
* @param vIsTodayRelative Indica si se calcula el disponible como si todo saliera hoy
- * @table tmp.sale_getProblems(ticketFk, clientFk, warehouseFk, shipped) Identificadores de los tickets a calcular
+ * @table tmp.sale_getProblems(ticketFk, clientFk, warehouseFk, shipped) Tickets a calcular
* @return tmp.sale_problems
*/
- DECLARE vWarehouseFk INT;
+ DECLARE vWarehouseFk INT;
DECLARE vDate DATE;
- DECLARE vAvailableCache INT;
+ DECLARE vAvailableCache INT;
DECLARE vVisibleCache INT;
DECLARE vDone BOOL;
- DECLARE vRequiredComponent INT;
-
- DECLARE vCursor CURSOR FOR
- SELECT DISTINCT tt.warehouseFk, IF(vIsTodayRelative, util.VN_CURDATE(), DATE(tt.shipped))
- FROM tmp.sale_getProblems tt
- WHERE DATE(tt.shipped) BETWEEN util.VN_CURDATE()
- AND util.VN_CURDATE() + INTERVAL IF(vIsTodayRelative, 9.9, 1.9) DAY;
+ DECLARE vCursor CURSOR FOR
+ SELECT DISTINCT warehouseFk, IF(vIsTodayRelative, util.VN_CURDATE(), DATE(shipped))
+ FROM tmp.sale_getProblems
+ WHERE shipped BETWEEN util.VN_CURDATE()
+ AND util.dayEnd(util.VN_CURDATE() + INTERVAL IF(vIsTodayRelative, 9.9, 1.9) DAY);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DELETE tt.*
FROM tmp.sale_getProblems tt
JOIN ticketObservation tto ON tto.ticketFk = tt.ticketFk
- JOIN observationType ot ON ot.id = tto.observationTypeFk
- WHERE ot.code = 'administrative'
+ JOIN observationType ot ON ot.id = tto.observationTypeFk
+ WHERE ot.code = 'administrative'
AND tto.description = 'Miriam';
- CREATE OR REPLACE TEMPORARY TABLE tmp.sale_problems (
- ticketFk INT(11),
- saleFk INT(11),
- isFreezed INTEGER(1) DEFAULT 0,
- risk DECIMAL(10,1) DEFAULT 0,
- hasHighRisk TINYINT(1) DEFAULT 0,
- hasTicketRequest INTEGER(1) DEFAULT 0,
- itemShortage VARCHAR(255),
- isTaxDataChecked INTEGER(1) DEFAULT 1,
- itemDelay VARCHAR(255),
- itemLost VARCHAR(255),
- hasComponentLack INTEGER(1),
- hasRounding VARCHAR(255),
- isTooLittle BOOL DEFAULT FALSE,
- isVip BOOL DEFAULT FALSE,
- PRIMARY KEY (ticketFk, saleFk)
- ) ENGINE = MEMORY;
+ CREATE OR REPLACE TEMPORARY TABLE tmp.sale_problems (
+ ticketFk INT(11),
+ saleFk INT(11),
+ isFreezed INTEGER(1) DEFAULT 0,
+ risk DECIMAL(10,1) DEFAULT 0,
+ hasHighRisk TINYINT(1) DEFAULT 0,
+ hasTicketRequest INTEGER(1) DEFAULT 0,
+ itemShortage VARCHAR(255),
+ isTaxDataChecked INTEGER(1) DEFAULT 1,
+ itemDelay VARCHAR(255),
+ itemLost VARCHAR(255),
+ hasComponentLack INTEGER(1),
+ hasRounding VARCHAR(255),
+ isTooLittle BOOL DEFAULT FALSE,
+ isVip BOOL DEFAULT FALSE,
+ PRIMARY KEY (ticketFk, saleFk)
+ ) ENGINE = MEMORY;
- CREATE OR REPLACE TEMPORARY TABLE tmp.ticket_list
- (PRIMARY KEY (ticketFk))
- ENGINE = MEMORY
- SELECT ticketFk, clientFk
- FROM tmp.sale_getProblems;
+ INSERT INTO tmp.sale_problems(ticketFk,
+ saleFk,
+ isFreezed,
+ risk,
+ hasHighRisk,
+ hasTicketRequest,
+ isTaxDataChecked,
+ hasComponentLack,
+ hasRounding,
+ isTooLittle)
+ SELECT sgp.ticketFk,
+ s.id,
+ IF(FIND_IN_SET('isFreezed', t.problem), TRUE, FALSE) isFreezed,
+ t.risk,
+ IF(FIND_IN_SET('hasHighRisk', t.problem), TRUE, FALSE) hasHighRisk,
+ IF(FIND_IN_SET('hasTicketRequest', t.problem), TRUE, FALSE) hasTicketRequest,
+ IF(FIND_IN_SET('isTaxDataChecked', t.problem), FALSE, TRUE) isTaxDataChecked,
+ IF(FIND_IN_SET('hasComponentLack', s.problem), TRUE, FALSE) hasComponentLack,
+ IF(FIND_IN_SET('hasRounding', s.problem),
+ LEFT(GROUP_CONCAT('RE: ', i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250),
+ NULL
+ ) hasRounding,
+ IF(FIND_IN_SET('isTooLittle', t.problem), TRUE, FALSE) isTooLittle
+ FROM tmp.sale_getProblems sgp
+ JOIN ticket t ON t.id = sgp.ticketFk
+ LEFT JOIN sale s ON s.ticketFk = t.id
+ LEFT JOIN item i ON i.id = s.itemFk
+ WHERE s.problem <> '' OR t.problem <> '' OR t.risk
+ GROUP BY t.id, s.id;
- SELECT COUNT(*) INTO vRequiredComponent
- FROM component
- WHERE isRequired;
-
- -- Too Little
- INSERT INTO tmp.sale_problems(ticketFk, isTooLittle)
- SELECT tp.ticketFk, TRUE
- FROM tmp.sale_getProblems tp
- JOIN ticket t ON t.id = tp.ticketFk
- JOIN (
- SELECT t.addressFk,
- SUM(ROUND(`ic`.`cm3delivery` * `s`.`quantity` / 1000, 0)) litros,
- t.totalWithoutVat
- FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
- JOIN sale s ON s.ticketFk = t.id
- AND s.quantity > 0
- JOIN itemCost ic ON ic.itemFk = s.itemFk
- AND ic.warehouseFk = t.warehouseFk
- JOIN zoneClosure zc ON zc.zoneFk = t.zoneFk
- AND zc.dated = util.VN_CURDATE()
- JOIN agencyMode am ON am.id = t.agencyModeFk
- JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
- WHERE util.VN_NOW() < (util.VN_CURDATE() + INTERVAL HOUR(zc.`hour`) HOUR) + INTERVAL MINUTE(zc.`hour`) MINUTE
- AND dm.code IN ('AGENCY','DELIVERY','PICKUP')
- AND t.shipped BETWEEN util.VN_CURDATE() AND util.midnight()
- GROUP BY t.addressFk
- ) sub ON sub.addressFk = t.addressFk
- JOIN volumeConfig vc
- WHERE sub.litros < vc.minTicketVolume
- AND sub.totalWithoutVat < vc.minTicketValue;
-
- -- VIP
INSERT INTO tmp.sale_problems(ticketFk, isVip)
- SELECT DISTINCT tl.ticketFk, TRUE
- FROM tmp.ticket_list tl
- JOIN client c ON c.id = tl.clientFk
+ SELECT sgp.ticketFk, TRUE
+ FROM tmp.sale_getProblems sgp
+ JOIN client c ON c.id = sgp.clientFk
WHERE c.businessTypeFk = 'VIP'
- ON DUPLICATE KEY UPDATE isVip = TRUE;
-
- -- Faltan componentes
- INSERT INTO tmp.sale_problems(ticketFk, hasComponentLack, saleFk)
- SELECT t.id, COUNT(c.id) < vRequiredComponent hasComponentLack, s.id
- FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
- JOIN sale s ON s.ticketFk = t.id
- JOIN agencyMode am ON am.id = t.agencyModeFk
- JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
- LEFT JOIN component c ON c.id = sc.componentFk
- AND c.isRequired
- WHERE dm.code IN ('AGENCY','DELIVERY','PICKUP')
- AND s.quantity > 0
- GROUP BY s.id
- HAVING hasComponentLack;
-
- -- Cliente congelado
- INSERT INTO tmp.sale_problems(ticketFk, isFreezed)
- SELECT DISTINCT tl.ticketFk, TRUE
- FROM tmp.ticket_list tl
- JOIN client c ON c.id = tl.clientFk
- WHERE c.isFreezed
- ON DUPLICATE KEY UPDATE isFreezed = c.isFreezed;
-
- -- Credit exceeded
- CREATE OR REPLACE TEMPORARY TABLE tmp.clientGetDebt
- (PRIMARY KEY (clientFk))
- ENGINE = MEMORY
- SELECT DISTINCT clientFk
- FROM tmp.ticket_list;
-
- CALL client_getDebt(util.VN_CURDATE());
-
- INSERT INTO tmp.sale_problems(ticketFk, risk, hasHighRisk)
- SELECT DISTINCT tl.ticketFk, r.risk, ((r.risk - cc.riskTolerance) > c.credit + 10)
- FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
- JOIN agencyMode a ON t.agencyModeFk = a.id
- JOIN tmp.risk r ON r.clientFk = t.clientFk
- JOIN client c ON c.id = t.clientFk
- JOIN clientConfig cc
- WHERE r.risk > c.credit + 10
- AND NOT a.isRiskFree
- ON DUPLICATE KEY UPDATE
- risk = r.risk, hasHighRisk = ((r.risk - cc.riskTolerance) > c.credit + 10);
-
- -- Antiguo COD 100, son peticiones de compra sin terminar
- INSERT INTO tmp.sale_problems(ticketFk, hasTicketRequest)
- SELECT DISTINCT tl.ticketFk, TRUE
- FROM tmp.ticket_list tl
- JOIN ticketRequest tr ON tr.ticketFk = tl.ticketFk
- WHERE tr.isOK IS NULL
- ON DUPLICATE KEY UPDATE hasTicketRequest = TRUE;
+ ON DUPLICATE KEY UPDATE isVIP = TRUE;
CREATE OR REPLACE TEMPORARY TABLE tItemShelvingStock_byWarehouse
(INDEX (itemFk, warehouseFk))
@@ -158,10 +95,9 @@ BEGIN
JOIN shelving sh ON sh.code = ish.shelvingFk
JOIN parking p ON p.id = sh.parkingFk
JOIN sector s ON s.id = p.sectorFk
- GROUP BY ish.itemFk,
- s.warehouseFk;
+ GROUP BY ish.itemFk, s.warehouseFk;
- -- Disponible, Faltas, Inventario y Retrasos
+ -- Disponible, faltas, inventario y retrasos
OPEN vCursor;
l: LOOP
SET vDone = FALSE;
@@ -180,14 +116,14 @@ BEGIN
INSERT INTO tmp.sale_problems(ticketFk, itemShortage, saleFk)
SELECT ticketFk, problem, saleFk
FROM (
- SELECT tl.ticketFk,
- LEFT(CONCAT('F: ',GROUP_CONCAT(i.id, ' ', i.longName, ' ')),250) problem,
- s.id AS saleFk
- FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
+ SELECT sgp.ticketFk,
+ LEFT(CONCAT('F: ', GROUP_CONCAT(i.id, ' ', i.longName, ' ')), 250) problem,
+ s.id saleFk
+ FROM tmp.sale_getProblems sgp
+ JOIN ticket t ON t.id = sgp.ticketFk
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk
- JOIN itemType it on it.id = i.typeFk
+ JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN cache.visible v ON v.item_id = i.id
AND v.calc_id = vVisibleCache
@@ -195,8 +131,8 @@ BEGIN
AND av.calc_id = vAvailableCache
LEFT JOIN tItemShelvingStock_byWarehouse issw ON issw.itemFk = i.id
AND issw.warehouseFk = t.warehouseFk
- WHERE IFNULL(v.visible,0) < s.quantity
- AND IFNULL(av.available ,0) < s.quantity
+ WHERE IFNULL(v.visible, 0) < s.quantity
+ AND IFNULL(av.available, 0) < s.quantity
AND IFNULL(issw.visible, 0) < s.quantity
AND NOT s.isPicked
AND NOT s.reserved
@@ -205,27 +141,27 @@ BEGIN
AND NOT i.generic
AND util.VN_CURDATE() = vDate
AND t.warehouseFk = vWarehouseFk
- GROUP BY tl.ticketFk) sub
+ GROUP BY sgp.ticketFk) sub
ON DUPLICATE KEY UPDATE itemShortage = sub.problem, saleFk = sub.saleFk;
-- Inventario: Visible suficiente, pero ubicado menor a la cantidad vendida
INSERT INTO tmp.sale_problems(ticketFk, itemLost, saleFk)
SELECT ticketFk, problem, saleFk
FROM (
- SELECT tl.ticketFk,
+ SELECT sgp.ticketFk,
LEFT(GROUP_CONCAT('I: ', i.id, ' ', i.longName, ' '), 250) problem,
s.id saleFk
- FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
+ FROM tmp.sale_getProblems sgp
+ JOIN ticket t ON t.id = sgp.ticketFk
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk
- JOIN itemType it on it.id = i.typeFk
+ JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN cache.visible v ON v.item_id = s.itemFk
AND v.calc_id = vVisibleCache
LEFT JOIN tItemShelvingStock_byWarehouse issw ON issw.itemFk = i.id
AND issw.warehouseFk = t.warehouseFk
- WHERE IFNULL(v.visible,0) >= s.quantity
+ WHERE IFNULL(v.visible, 0) >= s.quantity
AND IFNULL(issw.visible, 0) < s.quantity
AND s.quantity > 0
AND NOT s.isPicked
@@ -235,22 +171,22 @@ BEGIN
AND NOT i.generic
AND util.VN_CURDATE() = vDate
AND t.warehouseFk = vWarehouseFk
- GROUP BY tl.ticketFk
+ GROUP BY sgp.ticketFk
) sub
- ON DUPLICATE KEY UPDATE itemDelay = sub.problem, saleFk = sub.saleFk;
+ ON DUPLICATE KEY UPDATE itemLost = sub.problem, saleFk = sub.saleFk;
-- Retraso: Disponible suficiente, pero no visible ni ubicado
INSERT INTO tmp.sale_problems(ticketFk, itemDelay, saleFk)
SELECT ticketFk, problem, saleFk
FROM (
- SELECT tl.ticketFk,
+ SELECT sgp.ticketFk,
LEFT(GROUP_CONCAT('R: ', i.id, ' ', i.longName, ' '), 250) problem,
s.id saleFk
- FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
+ FROM tmp.sale_getProblems sgp
+ JOIN ticket t ON t.id = sgp.ticketFk
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk
- JOIN itemType it on it.id = i.typeFk
+ JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN cache.visible v ON v.item_id = s.itemFk
AND v.calc_id = vVisibleCache
@@ -269,42 +205,27 @@ BEGIN
AND NOT i.generic
AND util.VN_CURDATE() = vDate
AND t.warehouseFk = vWarehouseFk
- GROUP BY tl.ticketFk
+ GROUP BY sgp.ticketFk
) sub
ON DUPLICATE KEY UPDATE itemDelay = sub.problem, saleFk = sub.saleFk;
-
- -- Redondeo: Cantidad pedida incorrecta en al grouping de la última compra
- CALL buy_getUltimate(NULL, vWarehouseFk, vDate);
- INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
- SELECT ticketFk, problem ,saleFk
- FROM (
- SELECT tl.ticketFk,
- s.id saleFk,
- LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
- FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
- AND t.warehouseFk = vWarehouseFk
- JOIN sale s ON s.ticketFk = tl.ticketFk
- JOIN item i ON i.id = s.itemFk
- JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
- JOIN buy b ON b.id = bu.buyFk
- WHERE MOD(s.quantity, b.`grouping`)
- GROUP BY tl.ticketFk
- )sub
- ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
END LOOP;
CLOSE vCursor;
-
- INSERT INTO tmp.sale_problems(ticketFk, isTaxDataChecked)
- SELECT DISTINCT tl.ticketFk, FALSE
- FROM tmp.ticket_list tl
- JOIN client c ON c.id = tl.clientFk
- WHERE NOT c.isTaxDataChecked
- ON DUPLICATE KEY UPDATE isTaxDataChecked = FALSE;
- DROP TEMPORARY TABLE
- tmp.clientGetDebt,
- tmp.ticket_list,
- tItemShelvingStock_byWarehouse;
+ INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
+ SELECT ticketFk, problem, saleFk
+ FROM (
+ SELECT sgp.ticketFk,
+ s.id saleFk,
+ LEFT(GROUP_CONCAT('RE: ', i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
+ FROM tmp.sale_getProblems sgp
+ JOIN ticket t ON t.id = sgp.ticketFk
+ JOIN sale s ON s.ticketFk = sgp.ticketFk
+ JOIN item i ON i.id = s.itemFk
+ WHERE FIND_IN_SET('hasRounding', s.problem)
+ GROUP BY sgp.ticketFk
+ ) sub
+ ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
+
+ DROP TEMPORARY TABLE tItemShelvingStock_byWarehouse;
END$$
DELIMITER ;
diff --git a/db/routines/vn/procedures/sale_getProblemsByTicket.sql b/db/routines/vn/procedures/sale_getProblemsByTicket.sql
index b4aaad7de8..f7a0667055 100644
--- a/db/routines/vn/procedures/sale_getProblemsByTicket.sql
+++ b/db/routines/vn/procedures/sale_getProblemsByTicket.sql
@@ -7,8 +7,7 @@ BEGIN
*
* @return Problems result
*/
- DROP TEMPORARY TABLE IF EXISTS tmp.sale_getProblems;
- CREATE TEMPORARY TABLE tmp.sale_getProblems
+ CREATE OR REPLACE TEMPORARY TABLE tmp.sale_getProblems
(INDEX (ticketFk))
ENGINE = MEMORY
SELECT t.id ticketFk, t.clientFk, t.warehouseFk, t.shipped
diff --git a/db/routines/vn/procedures/sales_merge.sql b/db/routines/vn/procedures/sales_merge.sql
deleted file mode 100644
index 3dd01f9bcf..0000000000
--- a/db/routines/vn/procedures/sales_merge.sql
+++ /dev/null
@@ -1,41 +0,0 @@
-DELIMITER $$
-CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sales_merge`(vTicketFk INT)
-BEGIN
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- ROLLBACK;
- RESIGNAL;
- END;
-
- CREATE OR REPLACE TEMPORARY TABLE tSalesToPreserve
- (PRIMARY KEY (id))
- ENGINE = MEMORY
- SELECT s.id, s.itemFk, SUM(s.quantity) newQuantity
- FROM sale s
- JOIN item i ON i.id = s.itemFk
- JOIN itemType it ON it.id = i.typeFk
- WHERE s.ticketFk = vTicketFk
- AND it.isMergeable
- GROUP BY s.itemFk, s.price, s.discount;
-
- START TRANSACTION;
-
- UPDATE sale s
- JOIN tSalesToPreserve stp ON stp.id = s.id
- SET s.quantity = newQuantity
- WHERE s.ticketFk = vTicketFk;
-
- DELETE s.*
- FROM sale s
- LEFT JOIN tSalesToPreserve stp ON stp.id = s.id
- JOIN item i ON i.id = s.itemFk
- JOIN itemType it ON it.id = i.typeFk
- WHERE s.ticketFk = vTicketFk
- AND stp.id IS NULL
- AND it.isMergeable;
-
- COMMIT;
-
- DROP TEMPORARY TABLE tSalesToPreserve;
-END$$
-DELIMITER ;
diff --git a/db/routines/vn/procedures/sales_mergeByCollection.sql b/db/routines/vn/procedures/sales_mergeByCollection.sql
index 4c0693753b..04f8b5bc73 100644
--- a/db/routines/vn/procedures/sales_mergeByCollection.sql
+++ b/db/routines/vn/procedures/sales_mergeByCollection.sql
@@ -26,7 +26,7 @@ BEGIN
LEAVE myLoop;
END IF;
- CALL vn.sales_merge(vTicketFk);
+ CALL ticket_mergeSales(vTicketFk);
END LOOP;
diff --git a/db/routines/vn/procedures/ticket_cloneWeekly.sql b/db/routines/vn/procedures/ticket_cloneWeekly.sql
index fd45dc9fa6..e13e7e677d 100644
--- a/db/routines/vn/procedures/ticket_cloneWeekly.sql
+++ b/db/routines/vn/procedures/ticket_cloneWeekly.sql
@@ -4,7 +4,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_cloneWeekly`
vDateTo DATE
)
BEGIN
- DECLARE vIsDone BOOL;
DECLARE vLanding DATE;
DECLARE vShipment DATE;
DECLARE vWarehouseFk INT;
@@ -15,36 +14,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,
@@ -53,11 +53,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
@@ -67,7 +67,7 @@ BEGIN
AND tClon.isDeleted = FALSE
AND DATE(tClon.shipped) = vShipment)
THEN
- ITERATE myLoop;
+ ITERATE l;
END IF;
IF vAgencyModeFk IS NULL THEN
@@ -107,15 +107,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
@@ -152,15 +152,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,
@@ -168,7 +160,7 @@ BEGIN
description)
VALUES(
vNewTicket,
- vSalesPersonFK,
+ vObservationSalesPersonFk,
CONCAT('turno desde ticket: ',vTicketFk))
ON DUPLICATE KEY UPDATE description =
CONCAT(ticketObservation.description,VALUES(description),' ');
@@ -178,16 +170,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 ',
@@ -199,20 +192,21 @@ 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 ;
diff --git a/db/routines/vn/procedures/ticket_close.sql b/db/routines/vn/procedures/ticket_close.sql
index 7f52e81a7f..97da5057c9 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_getProblems.sql b/db/routines/vn/procedures/ticket_getProblems.sql
index 521e4cf2f5..e9becab2a0 100644
--- a/db/routines/vn/procedures/ticket_getProblems.sql
+++ b/db/routines/vn/procedures/ticket_getProblems.sql
@@ -1,5 +1,7 @@
DELIMITER $$
-CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getProblems`(IN vIsTodayRelative tinyint(1))
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getProblems`(
+ vIsTodayRelative tinyint(1)
+)
BEGIN
/**
* Calcula los problemas para un conjunto de tickets.
diff --git a/db/routines/vn/procedures/ticket_mergeSales.sql b/db/routines/vn/procedures/ticket_mergeSales.sql
new file mode 100644
index 0000000000..2dc3a39daa
--- /dev/null
+++ b/db/routines/vn/procedures/ticket_mergeSales.sql
@@ -0,0 +1,49 @@
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_mergeSales`(
+ vSelf INT
+)
+BEGIN
+ DECLARE vHasSalesToMerge BOOL;
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK;
+ RESIGNAL;
+ END;
+
+ START TRANSACTION;
+
+ SELECT id INTO vSelf
+ FROM ticket
+ WHERE id = vSelf FOR UPDATE;
+
+ CREATE OR REPLACE TEMPORARY TABLE tSalesToPreserve
+ (PRIMARY KEY (id))
+ ENGINE = MEMORY
+ SELECT s.id, s.itemFk, SUM(s.quantity) newQuantity
+ FROM sale s
+ JOIN item i ON i.id = s.itemFk
+ JOIN itemType it ON it.id = i.typeFk
+ WHERE s.ticketFk = vSelf
+ AND it.isMergeable
+ GROUP BY s.itemFk, s.price, s.discount
+ HAVING COUNT(*) > 1;
+
+ SELECT COUNT(*) INTO vHasSalesToMerge
+ FROM tSalesToPreserve;
+
+ IF vHasSalesToMerge THEN
+ UPDATE sale s
+ JOIN tSalesToPreserve stp ON stp.id = s.id
+ SET s.quantity = newQuantity;
+
+ DELETE s
+ FROM sale s
+ JOIN tSalesToPreserve stp ON stp.itemFk = s.itemFk
+ WHERE s.ticketFk = vSelf
+ AND s.id <> stp.id;
+ END IF;
+
+ COMMIT;
+ DROP TEMPORARY TABLE tSalesToPreserve;
+END$$
+DELIMITER ;
diff --git a/db/routines/vn/procedures/ticket_recalcByScope.sql b/db/routines/vn/procedures/ticket_recalcByScope.sql
index 41105fe234..ede755187c 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/procedures/ticket_setProblemTooLittle.sql b/db/routines/vn/procedures/ticket_setProblemTooLittle.sql
index 48cc478098..03677a05cb 100644
--- a/db/routines/vn/procedures/ticket_setProblemTooLittle.sql
+++ b/db/routines/vn/procedures/ticket_setProblemTooLittle.sql
@@ -8,17 +8,27 @@ BEGIN
*
* @param vSelf Id del ticket
*/
-
+ DECLARE vTicketIsTooLittle BOOL;
+
+ SELECT ticket_isTooLittle(vSelf) INTO vTicketIsTooLittle;
+
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
(INDEX(ticketFk, isProblemCalcNeeded))
ENGINE = MEMORY
- SELECT vSelf ticketFk,
- ticket_isTooLittle(vSelf) hasProblem,
- ticket_isProblemCalcNeeded(vSelf) isProblemCalcNeeded;
-
+ WITH ticketData AS (
+ SELECT addressFk, DATE(shipped) dated
+ FROM vn.ticket
+ WHERE id = vSelf
+ )
+ SELECT t.id ticketFk,
+ vTicketIsTooLittle hasProblem,
+ ticket_isProblemCalcNeeded(t.id) isProblemCalcNeeded
+ FROM vn.ticket t
+ JOIN ticketData td ON td.addressFk = t.addressFk
+ WHERE t.shipped BETWEEN td.dated AND util.dayEnd(td.dated);
+
CALL ticket_setProblem('isTooLittle');
DROP TEMPORARY TABLE tmp.ticket;
-
END$$
DELIMITER ;
\ No newline at end of file
diff --git a/db/routines/vn/procedures/ticket_setVolume.sql b/db/routines/vn/procedures/ticket_setVolume.sql
new file mode 100644
index 0000000000..060a6fa570
--- /dev/null
+++ b/db/routines/vn/procedures/ticket_setVolume.sql
@@ -0,0 +1,24 @@
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setVolume`(
+ vSelf INT
+)
+BEGIN
+/**
+ * Update the volume ticket
+ *
+ * @param vSelf Ticket id
+ */
+ DECLARE vVolume DECIMAL(10,6);
+
+ SELECT SUM(s.quantity * ic.cm3delivery / 1000000) INTO vVolume
+ FROM sale s
+ JOIN ticket t ON t.id = s.ticketFk
+ JOIN itemCost ic ON ic.itemFk = s.itemFk
+ AND ic.warehouseFk = t.warehouseFk
+ WHERE t.id = vSelf;
+
+ UPDATE ticket
+ SET volume = vVolume
+ WHERE id = vSelf;
+END$$
+DELIMITER ;
diff --git a/db/routines/vn/procedures/ticket_setVolumeItemCost.sql b/db/routines/vn/procedures/ticket_setVolumeItemCost.sql
new file mode 100644
index 0000000000..f266cd7699
--- /dev/null
+++ b/db/routines/vn/procedures/ticket_setVolumeItemCost.sql
@@ -0,0 +1,29 @@
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setVolumeItemCost`(
+ vItemFk INT
+)
+BEGIN
+/**
+ * Update the volume tickets of item
+ *
+ * @param vSelf Ticket id
+ */
+ CREATE OR REPLACE TEMPORARY TABLE tTicket
+ (PRIMARY KEY (id))
+ ENGINE = MEMORY
+ SELECT t.id, SUM(s.quantity * ic.cm3delivery / 1000000) volume
+ FROM sale s
+ JOIN ticket t ON t.id = s.ticketFk
+ JOIN itemCost ic ON ic.itemFk = s.itemFk
+ AND ic.warehouseFk = t.warehouseFk
+ WHERE s.itemFk = vItemFk
+ AND t.shipped >= util.VN_CURDATE()
+ GROUP BY t.id;
+
+ UPDATE ticket t
+ JOIN tTicket tt ON tt.id = t.id
+ SET t.volume = tt.volume;
+
+ DROP TEMPORARY TABLE tTicket;
+END$$
+DELIMITER ;
diff --git a/db/routines/vn/procedures/ticket_splitItemPackingType.sql b/db/routines/vn/procedures/ticket_splitItemPackingType.sql
index 5ae9fb9bc5..86e6217062 100644
--- a/db/routines/vn/procedures/ticket_splitItemPackingType.sql
+++ b/db/routines/vn/procedures/ticket_splitItemPackingType.sql
@@ -5,139 +5,73 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_splitItemPac
)
BEGIN
/**
- * Clona y reparte las ventas de un ticket en funcion del tipo de empaquetado.
- * Respeta el id inicial para el tipo propuesto.
+ * Clona y reparte las líneas de ventas de un ticket en funcion del tipo de empaquetado.
+ * Respeta el id de ticket inicial para el tipo de empaquetado propuesto.
*
* @param vSelf Id ticket
- * @param vOriginalItemPackingTypeFk Tipo para el que se reserva el número de ticket original
- * @return table tmp.ticketIPT(ticketFk, itemPackingTypeFk)
+ * @param vOriginalItemPackingTypeFk Tipo empaquetado al que se mantiene el ticket original
*/
- DECLARE vItemPackingTypeFk VARCHAR(1) DEFAULT 'H';
- DECLARE vNewTicketFk INT;
- DECLARE vPackingTypesToSplit INT;
DECLARE vDone INT DEFAULT FALSE;
- DECLARE vErrorNumber INT;
- DECLARE vErrorMsg TEXT;
+ DECLARE vHasItemPackingType BOOL;
+ DECLARE vItemPackingTypeFk INT;
+ DECLARE vNewTicketFk INT;
- DECLARE vSaleGroup CURSOR FOR
- SELECT itemPackingTypeFk
- FROM tSaleGroup
- WHERE itemPackingTypeFk IS NOT NULL
- ORDER BY (itemPackingTypeFk = vOriginalItemPackingTypeFk) DESC;
+ DECLARE vItemPackingTypes CURSOR FOR
+ SELECT DISTINCT itemPackingTypeFk
+ FROM tSalesToMove;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- GET DIAGNOSTICS CONDITION 1
- vErrorNumber = MYSQL_ERRNO,
- vErrorMsg = MESSAGE_TEXT;
+ SELECT COUNT(*) INTO vHasItemPackingType
+ FROM ticket t
+ JOIN sale s ON s.ticketFk = t.id
+ JOIN item i ON i.id = s.itemFk
+ WHERE t.id = vSelf
+ AND i.itemPackingTypeFk = vOriginalItemPackingTypeFk;
- CALL util.debugAdd('ticket_splitItemPackingType', JSON_OBJECT(
- 'errorNumber', vErrorNumber,
- 'errorMsg', vErrorMsg,
- 'ticketFk', vSelf
- )); -- Tmp
- ROLLBACK;
- RESIGNAL;
- END;
+ IF NOT vHasItemPackingType THEN
+ CALL util.throw('The ticket has not sales with the itemPackingType');
+ END IF;
- START TRANSACTION;
-
- SELECT id
- FROM sale
- WHERE ticketFk = vSelf
- AND NOT quantity
- FOR UPDATE;
-
- DELETE FROM sale
- WHERE NOT quantity
- AND ticketFk = vSelf;
-
- CREATE OR REPLACE TEMPORARY TABLE tSale
- (PRIMARY KEY (id))
- ENGINE = MEMORY
- SELECT s.id, i.itemPackingTypeFk, IFNULL(sv.litros, 0) litros
- FROM sale s
- JOIN item i ON i.id = s.itemFk
- LEFT JOIN saleVolume sv ON sv.saleFk = s.id
- WHERE s.ticketFk = vSelf;
-
- CREATE OR REPLACE TEMPORARY TABLE tSaleGroup
- ENGINE = MEMORY
- SELECT itemPackingTypeFk, SUM(litros) totalLitros
- FROM tSale
- GROUP BY itemPackingTypeFk;
-
- SELECT COUNT(*) INTO vPackingTypesToSplit
- FROM tSaleGroup
- WHERE itemPackingTypeFk IS NOT NULL;
-
- CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT(
+ CREATE OR REPLACE TEMPORARY TABLE tSalesToMove (
ticketFk INT,
- itemPackingTypeFk VARCHAR(1)
- ) ENGINE = MEMORY;
+ saleFk INT,
+ itemPackingTypeFk INT
+ ) ENGINE=MEMORY;
- CASE vPackingTypesToSplit
- WHEN 0 THEN
- INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
- VALUES(vSelf, vItemPackingTypeFk);
- WHEN 1 THEN
- INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
- SELECT vSelf, itemPackingTypeFk
- FROM tSaleGroup
- WHERE itemPackingTypeFk IS NOT NULL;
- ELSE
- OPEN vSaleGroup;
- FETCH vSaleGroup INTO vItemPackingTypeFk;
+ INSERT INTO tSalesToMove (saleFk, itemPackingTypeFk)
+ SELECT s.id, i.itemPackingTypeFk
+ FROM ticket t
+ JOIN sale s ON s.ticketFk = t.id
+ JOIN item i ON i.id = s.itemFk
+ WHERE t.id = vSelf
+ AND i.itemPackingTypeFk <> vOriginalItemPackingTypeFk;
- INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
- VALUES(vSelf, vItemPackingTypeFk);
+ OPEN vItemPackingTypes;
- l: LOOP
- SET vDone = FALSE;
- FETCH vSaleGroup INTO vItemPackingTypeFk;
+ l: LOOP
+ SET vDone = FALSE;
+ FETCH vItemPackingTypes INTO vItemPackingTypeFk;
- IF vDone THEN
- LEAVE l;
- END IF;
+ IF vDone THEN
+ LEAVE l;
+ END IF;
- CALL ticket_Clone(vSelf, vNewTicketFk);
+ CALL ticket_Clone(vSelf, vNewTicketFk);
- INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
- VALUES(vNewTicketFk, vItemPackingTypeFk);
- END LOOP;
+ UPDATE tSalesToMove
+ SET ticketFk = vNewTicketFk
+ WHERE itemPackingTypeFk = vItemPackingTypeFk;
- CLOSE vSaleGroup;
+ END LOOP;
- SELECT s.id
- FROM sale s
- JOIN tSale ts ON ts.id = s.id
- JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
- FOR UPDATE;
+ CLOSE vItemPackingTypes;
- UPDATE sale s
- JOIN tSale ts ON ts.id = s.id
- JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
- SET s.ticketFk = t.ticketFk;
+ UPDATE sale s
+ JOIN tSalesToMove stm ON stm.saleFk = s.id
+ SET s.ticketFk = stm.ticketFk
+ WHERE stm.ticketFk;
- SELECT itemPackingTypeFk INTO vItemPackingTypeFk
- FROM tSaleGroup sg
- WHERE sg.itemPackingTypeFk IS NOT NULL
- ORDER BY sg.itemPackingTypeFk
- LIMIT 1;
-
- UPDATE sale s
- JOIN tSale ts ON ts.id = s.id
- JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = vItemPackingTypeFk
- SET s.ticketFk = t.ticketFk
- WHERE ts.itemPackingTypeFk IS NULL;
- END CASE;
-
- COMMIT;
-
- DROP TEMPORARY TABLE
- tSale,
- tSaleGroup;
+ DROP TEMPORARY TABLE tSalesToMove;
END$$
-DELIMITER ;
+DELIMITER ;
\ No newline at end of file
diff --git a/db/routines/vn/triggers/buy_beforeUpdate.sql b/db/routines/vn/triggers/buy_beforeUpdate.sql
index 1e2faecdc3..366681f996 100644
--- a/db/routines/vn/triggers/buy_beforeUpdate.sql
+++ b/db/routines/vn/triggers/buy_beforeUpdate.sql
@@ -69,6 +69,10 @@ trig:BEGIN
IF NOT NEW.printedStickers <=> OLD.printedStickers THEN
CALL util.throw("Stickers cannot be modified if they are inventory");
END IF;
+
+ IF OLD.entryFk <> NEW.entryFk THEN
+ CALL util.throw("Cannot transfer lines to inventory entry");
+ END IF;
END IF;
IF NEW.quantity < 0 THEN
diff --git a/db/routines/vn/triggers/host_beforeInsert.sql b/db/routines/vn/triggers/host_beforeInsert.sql
new file mode 100644
index 0000000000..c2cb823343
--- /dev/null
+++ b/db/routines/vn/triggers/host_beforeInsert.sql
@@ -0,0 +1,8 @@
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`host_beforeInsert`
+ BEFORE INSERT ON `host`
+ FOR EACH ROW
+BEGIN
+ SET NEW.editorFk = account.myUser_getId();
+END$$
+DELIMITER ;
diff --git a/db/routines/vn/triggers/host_beforeUpdate.sql b/db/routines/vn/triggers/host_beforeUpdate.sql
index 0b0962e860..dc5a18f3c3 100644
--- a/db/routines/vn/triggers/host_beforeUpdate.sql
+++ b/db/routines/vn/triggers/host_beforeUpdate.sql
@@ -4,5 +4,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`host_beforeUpdate`
FOR EACH ROW
BEGIN
SET new.updated = util.VN_NOW();
+ SET NEW.editorFk = account.myUser_getId();
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 0000000000..df07d55409
--- /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 0000000000..4905a0442c
--- /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 a1b5b0a9fe..bc3f746328 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/11124-greenBamboo/00-firstScript.sql b/db/versions/11124-greenBamboo/00-firstScript.sql
new file mode 100644
index 0000000000..6f47cbc21d
--- /dev/null
+++ b/db/versions/11124-greenBamboo/00-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.ticket ADD volume decimal(10,6) DEFAULT NULL NULL COMMENT 'Unidad en m3';
diff --git a/db/versions/11124-greenBamboo/01-firstScript.sql b/db/versions/11124-greenBamboo/01-firstScript.sql
new file mode 100644
index 0000000000..9cacbd5ff4
--- /dev/null
+++ b/db/versions/11124-greenBamboo/01-firstScript.sql
@@ -0,0 +1,16 @@
+-- Calculamos todos los volumenes de todos los tickets una sola vez
+CREATE OR REPLACE TEMPORARY TABLE tmp.tTicketVolume
+ (PRIMARY KEY (id))
+ ENGINE = MEMORY
+ SELECT t.id, SUM(s.quantity * ic.cm3delivery / 1000000) volume
+ FROM vn.sale s
+ JOIN vn.ticket t ON t.id = s.ticketFk
+ JOIN vn.itemCost ic ON ic.itemFk = s.itemFk
+ AND ic.warehouseFk = t.warehouseFk
+ GROUP BY t.id;
+
+UPDATE vn.ticket t
+ JOIN tmp.tTicketVolume tv ON tv.id = t.id
+ SET t.volume = tv.volume;
+
+DROP TEMPORARY TABLE tmp.tTicketVolume;
diff --git a/db/versions/11141-azureRoebelini/00-firstScript.sql b/db/versions/11141-azureRoebelini/00-firstScript.sql
new file mode 100644
index 0000000000..fd6d79cfb3
--- /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 0000000000..09ac004014
--- /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 0000000000..fad33b5dc6
--- /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/11165-grayAralia/00-firstScript.sql b/db/versions/11165-grayAralia/00-firstScript.sql
new file mode 100644
index 0000000000..652b2343aa
--- /dev/null
+++ b/db/versions/11165-grayAralia/00-firstScript.sql
@@ -0,0 +1,3 @@
+ALTER TABLE vn.productionConfig
+ DROP COLUMN scannableCodeType,
+ DROP COLUMN scannablePreviusCodeType;
diff --git a/db/versions/11171-maroonMoss/00-firstScript.sql b/db/versions/11171-maroonMoss/00-firstScript.sql
new file mode 100644
index 0000000000..0632239ac9
--- /dev/null
+++ b/db/versions/11171-maroonMoss/00-firstScript.sql
@@ -0,0 +1,3 @@
+ALTER TABLE vn.operator
+ ADD COLUMN sizeLimit int(10) unsigned DEFAULT 90 NULL COMMENT 'Límite de altura en una colección para la asignación de pedidos' AFTER volumeLimit,
+ MODIFY COLUMN linesLimit int(10) unsigned DEFAULT 20 NULL COMMENT 'Límite de lineas en una colección para la asignación de pedidos';
diff --git a/db/versions/11172-blueFern/00-firstScript.sql b/db/versions/11172-blueFern/00-firstScript.sql
new file mode 100644
index 0000000000..04e0813d56
--- /dev/null
+++ b/db/versions/11172-blueFern/00-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.ticket DROP FOREIGN KEY ticket_FK;
\ No newline at end of file
diff --git a/db/versions/11172-blueFern/01-firstScript.sql b/db/versions/11172-blueFern/01-firstScript.sql
new file mode 100644
index 0000000000..64255f9de4
--- /dev/null
+++ b/db/versions/11172-blueFern/01-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceOut DROP KEY Id_Factura;
diff --git a/db/versions/11172-blueFern/02-firstScript.sql b/db/versions/11172-blueFern/02-firstScript.sql
new file mode 100644
index 0000000000..e76b7f7d68
--- /dev/null
+++ b/db/versions/11172-blueFern/02-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceOut MODIFY COLUMN id int(10) unsigned NOT NULL;
\ No newline at end of file
diff --git a/db/versions/11172-blueFern/03-firstScript.sql b/db/versions/11172-blueFern/03-firstScript.sql
new file mode 100644
index 0000000000..e6def98a4a
--- /dev/null
+++ b/db/versions/11172-blueFern/03-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceCorrection DROP FOREIGN KEY corrected_fk;
diff --git a/db/versions/11172-blueFern/04-firstScript.sql b/db/versions/11172-blueFern/04-firstScript.sql
new file mode 100644
index 0000000000..a19bc336e8
--- /dev/null
+++ b/db/versions/11172-blueFern/04-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceCorrection DROP FOREIGN KEY correcting_fk;
diff --git a/db/versions/11172-blueFern/05-firstScript.sql b/db/versions/11172-blueFern/05-firstScript.sql
new file mode 100644
index 0000000000..9f5ec2871c
--- /dev/null
+++ b/db/versions/11172-blueFern/05-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceOutExpense DROP FOREIGN KEY invoiceOutExpence_FK_1;
diff --git a/db/versions/11172-blueFern/06-firstScript.sql b/db/versions/11172-blueFern/06-firstScript.sql
new file mode 100644
index 0000000000..2c16e9b775
--- /dev/null
+++ b/db/versions/11172-blueFern/06-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceOutTax DROP FOREIGN KEY invoiceOutFk;
diff --git a/db/versions/11172-blueFern/07-firstScript.sql b/db/versions/11172-blueFern/07-firstScript.sql
new file mode 100644
index 0000000000..bec72a1318
--- /dev/null
+++ b/db/versions/11172-blueFern/07-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceOut DROP PRIMARY KEY;
diff --git a/db/versions/11172-blueFern/08-firstScript.sql b/db/versions/11172-blueFern/08-firstScript.sql
new file mode 100644
index 0000000000..316db2e327
--- /dev/null
+++ b/db/versions/11172-blueFern/08-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceOut ADD CONSTRAINT invoiceOut_pk PRIMARY KEY (id);
diff --git a/db/versions/11172-blueFern/09-firstScript.sql b/db/versions/11172-blueFern/09-firstScript.sql
new file mode 100644
index 0000000000..553d7857e7
--- /dev/null
+++ b/db/versions/11172-blueFern/09-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.invoiceOut ADD CONSTRAINT invoiceOut_unique UNIQUE KEY (`ref`);
diff --git a/db/versions/11172-blueFern/10-firstScript.sql b/db/versions/11172-blueFern/10-firstScript.sql
new file mode 100644
index 0000000000..47ddaff148
--- /dev/null
+++ b/db/versions/11172-blueFern/10-firstScript.sql
@@ -0,0 +1,5 @@
+UPDATE vn.invoiceOut
+ SET id = (SELECT MAX(id) + 1 FROM vn.invoiceOut)
+ WHERE id = 0;
+
+ALTER TABLE vn.invoiceOut MODIFY COLUMN id int(10) unsigned auto_increment NOT NULL;
diff --git a/db/versions/11172-blueFern/11-firstScript.sql b/db/versions/11172-blueFern/11-firstScript.sql
new file mode 100644
index 0000000000..e1847a8771
--- /dev/null
+++ b/db/versions/11172-blueFern/11-firstScript.sql
@@ -0,0 +1,2 @@
+ALTER TABLE vn.ticket ADD CONSTRAINT ticket_invoiceOut_FK
+ FOREIGN KEY (refFk) REFERENCES vn.invoiceOut(`ref`) ON DELETE RESTRICT ON UPDATE CASCADE;
diff --git a/db/versions/11172-blueFern/12-firstScript.sql b/db/versions/11172-blueFern/12-firstScript.sql
new file mode 100644
index 0000000000..720b7962ee
--- /dev/null
+++ b/db/versions/11172-blueFern/12-firstScript.sql
@@ -0,0 +1,2 @@
+ALTER TABLE vn.invoiceCorrection ADD CONSTRAINT invoiceCorrection_invoiceOut_FK
+ FOREIGN KEY (correctingFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/db/versions/11172-blueFern/13-firstScript.sql b/db/versions/11172-blueFern/13-firstScript.sql
new file mode 100644
index 0000000000..35099bd5d7
--- /dev/null
+++ b/db/versions/11172-blueFern/13-firstScript.sql
@@ -0,0 +1,2 @@
+ALTER TABLE vn.invoiceCorrection ADD CONSTRAINT invoiceCorrection_invoiceOut_FK_1
+ FOREIGN KEY (correctedFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;
\ No newline at end of file
diff --git a/db/versions/11172-blueFern/14-firstScript.sql b/db/versions/11172-blueFern/14-firstScript.sql
new file mode 100644
index 0000000000..f1aa0a2164
--- /dev/null
+++ b/db/versions/11172-blueFern/14-firstScript.sql
@@ -0,0 +1,2 @@
+ALTER TABLE vn.invoiceOutExpense ADD CONSTRAINT invoiceOutExpense_invoiceOut_FK
+ FOREIGN KEY (invoiceOutFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/db/versions/11172-blueFern/15-firstScript.sql b/db/versions/11172-blueFern/15-firstScript.sql
new file mode 100644
index 0000000000..ba570e20cd
--- /dev/null
+++ b/db/versions/11172-blueFern/15-firstScript.sql
@@ -0,0 +1,2 @@
+ALTER TABLE vn.invoiceOutTax ADD CONSTRAINT invoiceOutTax_invoiceOut_FK
+ FOREIGN KEY (invoiceOutFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/db/versions/11175-pinkChico/00-firstScript.sql b/db/versions/11175-pinkChico/00-firstScript.sql
new file mode 100644
index 0000000000..349f4c7f73
--- /dev/null
+++ b/db/versions/11175-pinkChico/00-firstScript.sql
@@ -0,0 +1,8 @@
+USE vn;
+
+CREATE TABLE IF NOT EXISTS ormConfig (
+ id int(5) NOT NULL AUTO_INCREMENT primary key,
+ selectLimit int(5) NOT NULL
+);
+
+INSERT IGNORE INTO ormConfig SET selectLimit = 1000;
\ No newline at end of file
diff --git a/db/versions/11185-maroonArborvitae/00-firstScript.sql b/db/versions/11185-maroonArborvitae/00-firstScript.sql
new file mode 100644
index 0000000000..b07126e713
--- /dev/null
+++ b/db/versions/11185-maroonArborvitae/00-firstScript.sql
@@ -0,0 +1 @@
+DROP TABLE bi.Greuges_comercial_detail;
\ No newline at end of file
diff --git a/db/versions/11187-yellowErica/00-firstScript.sql b/db/versions/11187-yellowErica/00-firstScript.sql
new file mode 100644
index 0000000000..fb75b1f2fa
--- /dev/null
+++ b/db/versions/11187-yellowErica/00-firstScript.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.host ADD editorFk int(10) unsigned DEFAULT NULL NULL;
diff --git a/db/versions/11189-purplePaniculata/00-firstScript.sql b/db/versions/11189-purplePaniculata/00-firstScript.sql
new file mode 100644
index 0000000000..3319bd154f
--- /dev/null
+++ b/db/versions/11189-purplePaniculata/00-firstScript.sql
@@ -0,0 +1,3 @@
+ALTER TABLE vn.item
+ ADD CONSTRAINT item_itemPackingType_FK FOREIGN KEY (itemPackingTypeFk)
+ REFERENCES vn.itemPackingType(code) ON DELETE RESTRICT ON UPDATE CASCADE;
diff --git a/db/versions/11190-blueLaurel/00-firstScript.sql b/db/versions/11190-blueLaurel/00-firstScript.sql
new file mode 100644
index 0000000000..75e3f8e595
--- /dev/null
+++ b/db/versions/11190-blueLaurel/00-firstScript.sql
@@ -0,0 +1,9 @@
+ALTER TABLE hedera.tpvMerchantEnable
+ DROP FOREIGN KEY tpvMerchantEnable_ibfk_1,
+ DROP PRIMARY KEY,
+ ADD CONSTRAINT tpvMerchantEnable_pk PRIMARY KEY (merchantFk),
+ ADD CONSTRAINT tpvMerchantEnable_tpvMerchant_FK
+ FOREIGN KEY (merchantFk)
+ REFERENCES hedera.tpvMerchant(id)
+ ON DELETE RESTRICT
+ ON UPDATE CASCADE;
diff --git a/db/versions/11191-chocolateBirch/00-firstScript.sql b/db/versions/11191-chocolateBirch/00-firstScript.sql
new file mode 100644
index 0000000000..4c9924a422
--- /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 0000000000..c69e92d51a
--- /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 0000000000..733cffd639
--- /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 0000000000..ac35a3db37
--- /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 0000000000..cc837d0070
--- /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 0000000000..748056f3a1
--- /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 0000000000..36aa938d57
--- /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 0000000000..59a616edf1
--- /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 0000000000..980b66c8d5
--- /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 0000000000..f07368d3e1
--- /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/db/versions/11201-limeChrysanthemum/00-firstScript.sql b/db/versions/11201-limeChrysanthemum/00-firstScript.sql
new file mode 100644
index 0000000000..943368b06f
--- /dev/null
+++ b/db/versions/11201-limeChrysanthemum/00-firstScript.sql
@@ -0,0 +1,4 @@
+-- Place your SQL code here
+ALTER TABLE vn.saleGroup ADD stateFk TINYINT(3) UNSIGNED;
+
+ALTER TABLE vn.saleGroup ADD CONSTRAINT saleGroup_state_FK FOREIGN KEY (stateFk) REFERENCES vn.state(id) ON DELETE RESTRICT ON UPDATE CASCADE;
diff --git a/db/versions/11204-navyMonstera/00-firstScript.sql b/db/versions/11204-navyMonstera/00-firstScript.sql
new file mode 100644
index 0000000000..492e3d607d
--- /dev/null
+++ b/db/versions/11204-navyMonstera/00-firstScript.sql
@@ -0,0 +1,5 @@
+ALTER TABLE vn.ormConfig
+MODIFY COLUMN id INT NOT NULL,
+DROP PRIMARY KEY,
+ADD CONSTRAINT ormConfig_check CHECK (id = 1),
+ADD PRIMARY KEY (id);
\ No newline at end of file
diff --git a/db/versions/11208-limeRoebelini/00-firstScript.vn.sql b/db/versions/11208-limeRoebelini/00-firstScript.vn.sql
new file mode 100644
index 0000000000..22b3dc9245
--- /dev/null
+++ b/db/versions/11208-limeRoebelini/00-firstScript.vn.sql
@@ -0,0 +1,7 @@
+UPDATE vn.packaging SET id='25E' WHERE id='cactus200';
+UPDATE vn.packaging SET id='35E' WHERE id='kalan330';
+UPDATE vn.packaging SET id='45E' WHERE id='kalan400';
+UPDATE vn.packaging SET id='60E' WHERE id='kalan577';
+UPDATE vn.packaging SET id='60A' WHERE id='guzma650';
+UPDATE vn.packaging SET id='120A' WHERE id='guzma1200';
+UPDATE vn.packaging SET id='140A' WHERE id='guzma1400';
diff --git a/db/versions/11209-pinkOrchid/00-firstScript.sql b/db/versions/11209-pinkOrchid/00-firstScript.sql
new file mode 100644
index 0000000000..92a7a7569a
--- /dev/null
+++ b/db/versions/11209-pinkOrchid/00-firstScript.sql
@@ -0,0 +1,6 @@
+ALTER TABLE vn.operator
+ MODIFY COLUMN sizeLimit int(10) unsigned DEFAULT NULL NULL COMMENT 'Límite de altura en una colección para la asignación de pedidos';
+
+UPDATE vn.operator
+ SET sizeLimit = 90
+ WHERE itemPackingTypeFk = 'V';
diff --git a/e2e/paths/09-invoice-in/01_summary.spec.js b/e2e/paths/09-invoice-in/01_summary.spec.js
deleted file mode 100644
index d5932efd00..0000000000
--- a/e2e/paths/09-invoice-in/01_summary.spec.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('InvoiceIn summary path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('administrative', 'invoiceIn');
- await page.accessToSearchResult('1');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should reach the summary section', async() => {
- await page.waitForState('invoiceIn.card.summary');
- });
-
- it('should contain some basic data from the invoice', async() => {
- const result = await page.waitToGetProperty(selectors.invoiceInSummary.supplierRef, 'innerText');
-
- expect(result).toEqual('1234');
- });
-});
diff --git a/e2e/paths/09-invoice-in/02_descriptor.spec.js b/e2e/paths/09-invoice-in/02_descriptor.spec.js
deleted file mode 100644
index 02bbce7ac1..0000000000
--- a/e2e/paths/09-invoice-in/02_descriptor.spec.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('InvoiceIn descriptor path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('administrative', 'invoiceIn');
- await page.accessToSearchResult('10');
- await page.accessToSection('invoiceIn.card.basicData');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should clone the invoiceIn using the descriptor more menu', async() => {
- await page.waitToClick(selectors.invoiceInDescriptor.moreMenu);
- await page.waitToClick(selectors.invoiceInDescriptor.moreMenuCloneInvoiceIn);
- await page.waitToClick(selectors.invoiceInDescriptor.acceptButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('InvoiceIn cloned');
- });
-
- it('should have been redirected to the created invoiceIn summary', async() => {
- await page.waitForState('invoiceIn.card.summary');
- });
-
- it('should delete the cloned invoiceIn using the descriptor more menu', async() => {
- await page.waitToClick(selectors.invoiceInDescriptor.moreMenu);
- await page.waitToClick(selectors.invoiceInDescriptor.moreMenuDeleteInvoiceIn);
- await page.waitToClick(selectors.invoiceInDescriptor.acceptButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('InvoiceIn deleted');
- });
-
- it('should have been relocated to the invoiceOut index', async() => {
- await page.waitForState('invoiceIn.index');
- });
-
- it(`should search for the deleted invouceOut to find no results`, async() => {
- await page.doSearch('10');
- const nResults = await page.countElement(selectors.invoiceOutIndex.searchResult);
-
- expect(nResults).toEqual(0);
- });
-});
diff --git a/e2e/paths/09-invoice-in/03_basic_data.spec.js b/e2e/paths/09-invoice-in/03_basic_data.spec.js
deleted file mode 100644
index 50fe188305..0000000000
--- a/e2e/paths/09-invoice-in/03_basic_data.spec.js
+++ /dev/null
@@ -1,196 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('InvoiceIn basic data path', () => {
- let browser;
- let page;
- let newDms;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('administrative', 'invoiceIn');
- await page.accessToSearchResult('1');
- await page.accessToSection('invoiceIn.card.basicData');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it(`should edit the invoiceIn basic data`, async() => {
- const now = Date.vnNew();
- await page.pickDate(selectors.invoiceInBasicData.issued, now);
- await page.pickDate(selectors.invoiceInBasicData.operated, now);
- await page.autocompleteSearch(selectors.invoiceInBasicData.supplier, 'Verdnatura');
- await page.clearInput(selectors.invoiceInBasicData.supplierRef);
- await page.write(selectors.invoiceInBasicData.supplierRef, '9999');
- await page.clearInput(selectors.invoiceInBasicData.dms);
- await page.write(selectors.invoiceInBasicData.dms, '2');
- await page.pickDate(selectors.invoiceInBasicData.bookEntried, now);
- await page.pickDate(selectors.invoiceInBasicData.booked, now);
- await page.autocompleteSearch(selectors.invoiceInBasicData.currency, 'USD');
- await page.autocompleteSearch(selectors.invoiceInBasicData.company, 'ORN');
- await page.waitToClick(selectors.invoiceInBasicData.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it(`should confirm the invoiceIn supplier was edited`, async() => {
- await page.reloadSection('invoiceIn.card.basicData');
- const result = await page.waitToGetProperty(selectors.invoiceInBasicData.supplier, 'value');
-
- expect(result).toContain('Verdnatura');
- });
-
- it(`should confirm the invoiceIn supplierRef was edited`, async() => {
- const result = await page
- .waitToGetProperty(selectors.invoiceInBasicData.supplierRef, 'value');
-
- expect(result).toEqual('9999');
- });
-
- it(`should confirm the invoiceIn currency was edited`, async() => {
- const result = await page
- .waitToGetProperty(selectors.invoiceInBasicData.currency, 'value');
-
- expect(result).toEqual('USD');
- });
-
- it(`should confirm the invoiceIn company was edited`, async() => {
- const result = await page
- .waitToGetProperty(selectors.invoiceInBasicData.company, 'value');
-
- expect(result).toEqual('ORN');
- });
-
- it(`should confirm the invoiceIn dms was edited`, async() => {
- const result = await page
- .waitToGetProperty(selectors.invoiceInBasicData.dms, 'value');
-
- expect(result).toEqual('2');
- });
-
- it(`should create a new invoiceIn dms and save the changes`, async() => {
- await page.clearInput(selectors.invoiceInBasicData.dms);
- await page.waitToClick(selectors.invoiceInBasicData.create);
-
- await page.clearInput(selectors.invoiceInBasicData.reference);
- await page.write(selectors.invoiceInBasicData.reference, 'New Dms');
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- let message = await page.waitForSnackbar();
-
- await page.clearInput(selectors.invoiceInBasicData.companyId);
- await page.autocompleteSearch(selectors.invoiceInBasicData.companyId, 'VNL');
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- message = await page.waitForSnackbar();
-
- await page.clearInput(selectors.invoiceInBasicData.warehouseId);
- await page.autocompleteSearch(selectors.invoiceInBasicData.warehouseId, 'Warehouse One');
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- message = await page.waitForSnackbar();
-
- await page.clearInput(selectors.invoiceInBasicData.dmsTypeId);
- await page.autocompleteSearch(selectors.invoiceInBasicData.dmsTypeId, 'Ticket');
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- message = await page.waitForSnackbar();
-
- await page.waitToClick(selectors.invoiceInBasicData.description);
- await page.write(selectors.invoiceInBasicData.description, 'Dms without edition.');
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- message = await page.waitForSnackbar();
-
- expect(message.text).toContain('The files can\'t be empty');
-
- let currentDir = process.cwd();
- let filePath = `${currentDir}/e2e/assets/thermograph.jpeg`;
-
- const [fileChooser] = await Promise.all([
- page.waitForFileChooser(),
- page.waitToClick(selectors.invoiceInBasicData.inputFile)
- ]);
- await fileChooser.accept([filePath]);
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
-
- newDms = await page
- .waitToGetProperty(selectors.invoiceInBasicData.dms, 'value');
- });
-
- it(`should confirm the invoiceIn was edited with the new dms`, async() => {
- await page.reloadSection('invoiceIn.card.basicData');
- const result = await page
- .waitToGetProperty(selectors.invoiceInBasicData.dms, 'value');
-
- expect(result).toEqual(newDms);
- });
-
- it(`should edit the invoiceIn`, async() => {
- await page.waitToClick(selectors.invoiceInBasicData.edit);
-
- await page.clearInput(selectors.invoiceInBasicData.reference);
- await page.write(selectors.invoiceInBasicData.reference, 'Dms Edited');
- await page.clearInput(selectors.invoiceInBasicData.companyId);
- await page.autocompleteSearch(selectors.invoiceInBasicData.companyId, 'CCs');
- await page.clearInput(selectors.invoiceInBasicData.warehouseId);
- await page.autocompleteSearch(selectors.invoiceInBasicData.warehouseId, 'Algemesi');
- await page.clearInput(selectors.invoiceInBasicData.dmsTypeId);
- await page.autocompleteSearch(selectors.invoiceInBasicData.dmsTypeId, 'Basura');
- await page.waitToClick(selectors.invoiceInBasicData.description);
- await page.write(selectors.invoiceInBasicData.description, ' Nevermind, now is edited.');
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- let message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it(`should confirm the new dms has been edited`, async() => {
- await page.reloadSection('invoiceIn.card.basicData');
- await page.waitToClick(selectors.invoiceInBasicData.edit);
-
- const reference = await page
- .waitToGetProperty(selectors.invoiceInBasicData.reference, 'value');
- const companyId = await page
- .waitToGetProperty(selectors.invoiceInBasicData.companyId, 'value');
- const warehouseId = await page
- .waitToGetProperty(selectors.invoiceInBasicData.warehouseId, 'value');
- const dmsTypeId = await page
- .waitToGetProperty(selectors.invoiceInBasicData.dmsTypeId, 'value');
- const description = await page
- .waitToGetProperty(selectors.invoiceInBasicData.description, 'value');
-
- expect(reference).toEqual('Dms Edited');
- expect(companyId).toEqual('CCs');
- expect(warehouseId).toEqual('Algemesi');
- expect(dmsTypeId).toEqual('Basura');
- expect(description).toEqual('Dms without edition. Nevermind, now is edited.');
-
- await page.waitToClick(selectors.invoiceInBasicData.confirm);
- });
-
- it(`should disable edit and download if dms doesn't exists, and set back the original dms`, async() => {
- await page.clearInput(selectors.invoiceInBasicData.dms);
- await page.write(selectors.invoiceInBasicData.dms, '9999');
-
- await page.waitForSelector(`${selectors.invoiceInBasicData.download}.disabled`);
- await page.waitForSelector(`${selectors.invoiceInBasicData.edit}.disabled`);
-
- await page.clearInput(selectors.invoiceInBasicData.dms);
- await page.write(selectors.invoiceInBasicData.dms, '1');
-
- await page.waitToClick(selectors.invoiceInBasicData.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-});
diff --git a/e2e/paths/09-invoice-in/04_tax.spec.js b/e2e/paths/09-invoice-in/04_tax.spec.js
deleted file mode 100644
index d51c390483..0000000000
--- a/e2e/paths/09-invoice-in/04_tax.spec.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('InvoiceIn tax path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('developer', 'invoiceIn');
- await page.accessToSearchResult('2');
- await page.accessToSection('invoiceIn.card.tax');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should add a new tax and check it', async() => {
- await page.waitToClick(selectors.invoiceInTax.addTaxButton);
- await page.autocompleteSearch(selectors.invoiceInTax.thirdExpense, '6210000567');
- await page.write(selectors.invoiceInTax.thirdTaxableBase, '100');
- await page.autocompleteSearch(selectors.invoiceInTax.thirdTaxType, 'H.P. IVA');
- await page.autocompleteSearch(selectors.invoiceInTax.thirdTransactionType, 'Operaciones exentas');
- await page.waitToClick(selectors.invoiceInTax.saveButton);
- const message = await page.waitForSnackbar();
-
- await page.waitToClick(selectors.invoiceInDescriptor.summaryIcon);
- await page.waitForState('invoiceIn.card.summary');
- const total = await page.waitToGetProperty(selectors.invoiceInSummary.totalTaxableBase, 'innerText');
-
- await page.accessToSection('invoiceIn.card.tax');
-
- const thirdExpense = await page.waitToGetProperty(selectors.invoiceInTax.thirdExpense, 'value');
- const thirdTaxableBase = await page.waitToGetProperty(selectors.invoiceInTax.thirdTaxableBase, 'value');
- const thirdTaxType = await page.waitToGetProperty(selectors.invoiceInTax.thirdTaxType, 'value');
- const thirdTransactionType = await page.waitToGetProperty(selectors.invoiceInTax.thirdTransactionType, 'value');
- const thirdRate = await page.waitToGetProperty(selectors.invoiceInTax.thirdRate, 'value');
-
- expect(message.text).toContain('Data saved!');
-
- expect(total).toEqual('Taxable base €1,323.16');
-
- expect(thirdExpense).toEqual('6210000567');
- expect(thirdTaxableBase).toEqual('100');
- expect(thirdTaxType).toEqual('H.P. IVA 4% CEE');
- expect(thirdTransactionType).toEqual('Operaciones exentas');
- expect(thirdRate).toEqual('€4.00');
- });
-
- it('should delete the added line', async() => {
- await page.waitToClick(selectors.invoiceInTax.thirdDeleteButton);
- await page.waitToClick(selectors.invoiceInTax.saveButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-});
diff --git a/e2e/paths/09-invoice-in/05_serial.spec.js b/e2e/paths/09-invoice-in/05_serial.spec.js
deleted file mode 100644
index 8be5660da5..0000000000
--- a/e2e/paths/09-invoice-in/05_serial.spec.js
+++ /dev/null
@@ -1,48 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('InvoiceIn serial path', () => {
- let browser;
- let page;
- let httpRequest;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('administrative', 'invoiceIn');
- await page.accessToSection('invoiceIn.serial');
- page.on('request', req => {
- if (req.url().includes(`InvoiceIns/getSerial`))
- httpRequest = req.url();
- });
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should check that passes the correct params to back', async() => {
- await page.overwrite(selectors.invoiceInSerial.daysAgo, '30');
- await page.keyboard.press('Enter');
-
- expect(httpRequest).toContain('daysAgo=30');
-
- await page.overwrite(selectors.invoiceInSerial.serial, 'R');
- await page.keyboard.press('Enter');
-
- expect(httpRequest).toContain('serial=R');
- await page.click(selectors.invoiceInSerial.chip);
- });
-
- it('should go to index and check if the search-panel has the correct params', async() => {
- await page.waitToClick(selectors.invoiceInSerial.goToIndex);
- const params = await page.$$(selectors.invoiceInIndex.topbarSearchParams);
- const serial = await params[0].getProperty('title');
- const isBooked = await params[1].getProperty('title');
- const from = await params[2].getProperty('title');
-
- expect(await serial.jsonValue()).toContain('serial');
- expect(await isBooked.jsonValue()).toContain('not isBooked');
- expect(await from.jsonValue()).toContain('from');
- });
-});
diff --git a/e2e/paths/14-account/01_create_and_basic_data.spec.js b/e2e/paths/14-account/01_create_and_basic_data.spec.js
deleted file mode 100644
index e2c069d800..0000000000
--- a/e2e/paths/14-account/01_create_and_basic_data.spec.js
+++ /dev/null
@@ -1,164 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account create and basic data path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('itManagement', 'account');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should open the new account form by clicking the add button', async() => {
- await page.waitToClick(selectors.accountIndex.addAccount);
- await page.waitForState('account.create');
- });
-
- it('should fill the form and then save it by clicking the create button', async() => {
- await page.write(selectors.accountIndex.newName, 'remy');
- await page.write(selectors.accountIndex.newNickname, 'Gambit');
- await page.write(selectors.accountIndex.newEmail, 'RemyEtienneLeBeau@verdnatura.es');
- await page.autocompleteSearch(selectors.accountIndex.newRole, 'Trainee');
- await page.write(selectors.accountIndex.newPassword, 'cestlavie');
- await page.waitToClick(selectors.accountIndex.createAccountButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should redirect the user to the created account basic data section', async() => {
- await page.waitForState('account.card.basicData');
- });
-
- it('should check the name is as expected', async() => {
- const result = await page.waitToGetProperty(selectors.accountBasicData.name, 'value');
-
- expect(result).toEqual('remy');
- });
-
- it('should check the nickname is as expected', async() => {
- const result = await page.waitToGetProperty(selectors.accountBasicData.nickname, 'value');
-
- expect(result).toEqual('Gambit');
- });
-
- it('should check the email is as expected', async() => {
- const result = await page.waitToGetProperty(selectors.accountBasicData.email, 'value');
-
- expect(result).toEqual('RemyEtienneLeBeau@verdnatura.es');
- });
-
- it('should navigate to the roles section to check the roles are correct', async() => {
- await page.accessToSection('account.card.roles');
- const rolesCount = await page.countElement(selectors.accountRoles.anyResult);
-
- expect(rolesCount).toEqual(3);
- });
-
- describe('Descriptor option', () => {
- describe('activate account', () => {
- it(`should check the active account icon isn't present in the descriptor`, async() => {
- await page.waitForNumberOfElements(selectors.accountDescriptor.activeAccountIcon, 0);
- });
-
- it('should activate the account using the descriptor menu', async() => {
- await page.waitToClick(selectors.accountDescriptor.menuButton);
- await page.waitToClick(selectors.accountDescriptor.activateAccount);
- await page.waitToClick(selectors.accountDescriptor.acceptButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Account enabled!');
- });
-
- it('should check the active account icon is now present in the descriptor', async() => {
- await page.waitForSelector(selectors.accountDescriptor.activeAccountIcon, {visible: false});
- });
- });
-
- describe('deactivate user', () => {
- it(`should check the inactive user icon isn't present in the descriptor just yet`, async() => {
- await page.waitForNumberOfElements(selectors.accountDescriptor.activeUserIcon, 0);
- });
-
- it('should deactivate the user using the descriptor menu', async() => {
- await page.waitToClick(selectors.accountDescriptor.menuButton);
- await page.waitToClick(selectors.accountDescriptor.deactivateUser);
- await page.waitToClick(selectors.accountDescriptor.acceptButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('User deactivated!');
- });
-
- it('should check the inactive user icon is now present', async() => {
- await page.waitForNumberOfElements(selectors.accountDescriptor.activeUserIcon, 1);
- });
- });
-
- describe('activate user', () => {
- it('should activate the user using the descriptor menu', async() => {
- await page.waitToClick(selectors.accountDescriptor.menuButton);
- await page.waitToClick(selectors.accountDescriptor.activateUser);
- await page.waitToClick(selectors.accountDescriptor.acceptButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('User activated!');
- });
-
- it('should check the inactive user icon is not present anymore', async() => {
- await page.waitForNumberOfElements(selectors.accountDescriptor.activeUserIcon, 0);
- });
- });
-
- describe('mail forwarding', () => {
- it('should activate the mail forwarding and set the recipent email', async() => {
- await page.accessToSection('account.card.mailForwarding');
- await page.waitToClick(selectors.accountMailForwarding.mailForwardingCheckbox);
- await page.write(selectors.accountMailForwarding.email, 'someEmail@someDomain.es');
- await page.waitToClick(selectors.accountMailForwarding.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
- });
-
- describe('Set password', () => {
- it('should set the password using the descriptor menu', async() => {
- const newPassword = 'quantum.12345';
-
- await page.waitToClick(selectors.accountDescriptor.menuButton);
- await page.waitToClick(selectors.accountDescriptor.setPassword);
- await page.write(selectors.accountDescriptor.newPassword, newPassword);
- await page.write(selectors.accountDescriptor.repeatPassword, newPassword);
- await page.waitToClick(selectors.accountDescriptor.acceptButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Password changed succesfully!');
- });
-
- // cant log into created account for unknown reasons
- // it('should login into the created account with the new password', async() => {
- // await page.loginAndModule('Remy', 'quantum.crypt0graphy');
- // });
- });
-
- describe('delete account', () => {
- // it('should navigate to the account basic data section', async() => {
- // });
-
- it('should delete the account using the descriptor menu', async() => {
- await page.waitToClick(selectors.accountDescriptor.menuButton);
- await page.waitToClick(selectors.accountDescriptor.deleteAccount);
- await page.waitToClick(selectors.accountDescriptor.acceptButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('User removed');
- });
- });
- });
-});
diff --git a/e2e/paths/14-account/02_alias_create_and_basic_data.spec.js b/e2e/paths/14-account/02_alias_create_and_basic_data.spec.js
deleted file mode 100644
index 840fb8afee..0000000000
--- a/e2e/paths/14-account/02_alias_create_and_basic_data.spec.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account Alias create and basic data path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('itManagement', 'account');
- await page.accessToSection('account.alias');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should open the new account alias form by clicking the add button', async() => {
- await page.waitToClick(selectors.accountAliasIndex.addAlias);
- await page.waitForState('account.alias.create');
- });
-
- it('should fill the form and then save it by clicking the create alias button', async() => {
- await page.write(selectors.accountAliasIndex.newName, 'Boring alias');
- await page.write(selectors.accountAliasIndex.newDescription, 'Boring description');
- await page.waitToClick(selectors.accountAliasIndex.createAliasButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should redirect the user to the created account alias basic data section', async() => {
- await page.waitForState('account.alias.card.basicData');
- });
-
- it('should edit the alias basic data', async() => {
- await page.overwrite(selectors.accountAliasBasicData.name, 'Psykers');
- await page.overwrite(selectors.accountAliasBasicData.description, 'Email group for psykers');
- await page.waitToClick(selectors.accountAliasBasicData.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should reload the basicData section and check the name was edited successfully', async() => {
- await page.reloadSection('account.alias.card.basicData');
- const result = await page.waitToGetProperty(selectors.accountAliasBasicData.name, 'value');
-
- expect(result).toEqual('Psykers');
- });
-
- it('should check the alias description was edited successfully', async() => {
- const result = await page.waitToGetProperty(selectors.accountAliasBasicData.description, 'value');
-
- expect(result).toContain('psykers');
- });
-
- it('should search IT alias then access the user section to check the role listed is the expected one', async() => {
- await page.accessToSearchResult('IT');
- await page.accessToSection('account.alias.card.users');
- const rolesCount = await page.countElement(selectors.accountAliasUsers.anyResult);
-
- expect(rolesCount).toEqual(1);
- });
-});
diff --git a/e2e/paths/14-account/03_role_create_and_basic_data.spec.js b/e2e/paths/14-account/03_role_create_and_basic_data.spec.js
deleted file mode 100644
index 6acf823188..0000000000
--- a/e2e/paths/14-account/03_role_create_and_basic_data.spec.js
+++ /dev/null
@@ -1,86 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account Role create and basic data path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('it', 'account');
- await page.accessToSection('account.role');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should open the new account role form by clicking the add button', async() => {
- await page.waitToClick(selectors.accountRoleIndex.addRole);
- await page.waitForState('account.role.create');
- });
-
- it('should fill the form and then save it by clicking the create role button', async() => {
- await page.write(selectors.accountRoleIndex.newName, 'boringRole');
- await page.write(selectors.accountRoleIndex.newDescription, 'Boring description');
- await page.waitToClick(selectors.accountRoleIndex.createRoleButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should redirect the user to the created role basic data section', async() => {
- await page.waitForState('account.role.card.basicData');
- });
-
- it('should edit the role basic data', async() => {
- await page.overwrite(selectors.accountRoleBasicData.name, 'psyker');
- await page.overwrite(selectors.accountRoleBasicData.description, 'A role just for psykers');
- await page.waitToClick(selectors.accountRoleBasicData.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should reload the role basicData section and check the name was edited successfully', async() => {
- await page.reloadSection('account.role.card.basicData');
- const result = await page.waitToGetProperty(selectors.accountRoleBasicData.name, 'value');
-
- expect(result).toEqual('psyker');
- });
-
- it('should check the role description was edited successfully', async() => {
- const result = await page.waitToGetProperty(selectors.accountRoleBasicData.description, 'value');
-
- expect(result).toContain('psykers');
- });
-
- it('should navigate to the subroles section', async() => {
- await page.accessToSection('account.role.card.subroles');
- });
-
- it('should asign a subrole', async() => {
- await page.waitToClick(selectors.accountSubroles.addSubrole);
- await page.autocompleteSearch(selectors.accountSubroles.role, 'teamManager');
- await page.waitToClick(selectors.accountSubroles.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Role added!');
- });
-
- it('should reload the subroles section and check a role was added', async() => {
- await page.reloadSection('account.role.card.subroles');
- const subrolesCount = await page.countElement(selectors.accountSubroles.anyResult);
-
- expect(subrolesCount).toEqual(1);
- });
-
- it('should access the employee roles inheritance then check the roles listed are the expected ones', async() => {
- await page.accessToSearchResult('employee');
- await page.accessToSection('account.role.card.inherited');
- const rolesCount = await page.countElement(selectors.accountRoleInheritance.anyResult);
-
- expect(rolesCount).toEqual(7);
- });
-});
diff --git a/e2e/paths/14-account/04_acl.spec.js b/e2e/paths/14-account/04_acl.spec.js
deleted file mode 100644
index ce2a63b14f..0000000000
--- a/e2e/paths/14-account/04_acl.spec.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account ACL path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('developer', 'account');
- await page.accessToSection('account.acl');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should go to create new acl', async() => {
- await page.waitToClick(selectors.accountAcl.addAcl);
- await page.waitForState('account.acl.create');
- });
-
- it('should create new acl', async() => {
- await page.autocompleteSearch(selectors.accountAcl.role, 'sysadmin');
- await page.autocompleteSearch(selectors.accountAcl.model, 'Account');
- await page.autocompleteSearch(selectors.accountAcl.accessType, '*');
- await page.autocompleteSearch(selectors.accountAcl.permission, 'ALLOW');
- await page.waitToClick(selectors.accountAcl.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should navigate to edit', async() => {
- await page.doSearch();
- await page.waitToClick(selectors.accountAcl.thirdAcl);
- await page.waitForState('account.acl.edit');
- });
-
- it('should edit the third acl', async() => {
- await page.autocompleteSearch(selectors.accountAcl.model, 'Supplier');
- await page.autocompleteSearch(selectors.accountAcl.accessType, 'READ');
- await page.waitToClick(selectors.accountAcl.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should delete the third result', async() => {
- const result = await page.waitToGetProperty(selectors.accountAcl.thirdAcl, 'innerText');
- await page.waitToClick(selectors.accountAcl.deleteThirdAcl);
- await page.waitToClick(selectors.globalItems.acceptButton);
- const message = await page.waitForSnackbar();
- const newResult = await page.waitToGetProperty(selectors.accountAcl.thirdAcl, 'innerText');
-
- expect(message.text).toContain('ACL removed');
- expect(result).not.toEqual(newResult);
- });
-});
diff --git a/e2e/paths/14-account/05_connections.spec.js b/e2e/paths/14-account/05_connections.spec.js
deleted file mode 100644
index 49d5f612d2..0000000000
--- a/e2e/paths/14-account/05_connections.spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account Connections path', () => {
- let browser;
- let page;
- const account = 'sysadmin';
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule(account, 'account');
- await page.accessToSection('account.connections');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should check this is the last connection', async() => {
- const firstResult = await page.waitToGetProperty(selectors.accountConnections.firstConnection, 'innerText');
-
- expect(firstResult).toContain(account);
- });
-});
diff --git a/e2e/paths/14-account/06_accounts.spec.js b/e2e/paths/14-account/06_accounts.spec.js
deleted file mode 100644
index 8bd6ea7d5f..0000000000
--- a/e2e/paths/14-account/06_accounts.spec.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account Accounts path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('sysadmin', 'account');
- await page.accessToSection('account.accounts');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should sync roles', async() => {
- await page.waitToClick(selectors.accountAccounts.syncRoles);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Roles synchronized!');
- });
-
- it('should relogin', async() => {
- await page.loginAndModule('sysadmin', 'account');
- await page.accessToSection('account.accounts');
- });
-
- it('should sync all', async() => {
- await page.waitToClick(selectors.accountAccounts.syncAll);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Synchronizing in the background');
- });
-});
diff --git a/e2e/paths/14-account/07_ldap.spec.js b/e2e/paths/14-account/07_ldap.spec.js
deleted file mode 100644
index eb22f695c1..0000000000
--- a/e2e/paths/14-account/07_ldap.spec.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account LDAP path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('sysadmin', 'account');
- await page.accessToSection('account.ldap');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should set data and save', async() => {
- await page.waitToClick(selectors.accountLdap.checkEnable);
- await page.write(selectors.accountLdap.server, '1234');
- await page.write(selectors.accountLdap.rdn, '1234');
- await page.write(selectors.accountLdap.password, 'nightmare');
- await page.write(selectors.accountLdap.userDn, 'sysadmin');
- await page.write(selectors.accountLdap.groupDn, '1234');
- await page.waitToClick(selectors.accountLdap.save);
-
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should reset data', async() => {
- await page.waitToClick(selectors.accountLdap.checkEnable);
- await page.waitToClick(selectors.accountLdap.save);
-
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-});
diff --git a/e2e/paths/14-account/08_samba.spec.js b/e2e/paths/14-account/08_samba.spec.js
deleted file mode 100644
index a92344acb8..0000000000
--- a/e2e/paths/14-account/08_samba.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account Samba path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('sysadmin', 'account');
- await page.accessToSection('account.samba');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should set data and save', async() => {
- await page.waitToClick(selectors.accountSamba.checkEnable);
- await page.write(selectors.accountSamba.adDomain, '1234');
- await page.write(selectors.accountSamba.adController, '1234');
- await page.write(selectors.accountSamba.adUser, 'sysadmin');
- await page.write(selectors.accountSamba.adPassword, 'nightmare');
- await page.write(selectors.accountSamba.userDn, 'testDn');
- await page.waitToClick(selectors.accountSamba.verifyCert);
- await page.waitToClick(selectors.accountSamba.save);
-
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should reset data', async() => {
- await page.waitToClick(selectors.accountSamba.checkEnable);
- await page.waitToClick(selectors.accountSamba.save);
-
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-});
diff --git a/e2e/paths/14-account/09_privileges.spec.js b/e2e/paths/14-account/09_privileges.spec.js
deleted file mode 100644
index e4b8fb24c4..0000000000
--- a/e2e/paths/14-account/09_privileges.spec.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Account privileges path', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('developer', 'account');
- await page.accessToSearchResult('1101');
- await page.accessToSection('account.card.privileges');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- describe('as developer', () => {
- it('should throw error when give privileges', async() => {
- await page.waitToClick(selectors.accountPrivileges.checkHasGrant);
- await page.waitToClick(selectors.accountPrivileges.save);
-
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain(`You don't have grant privilege`);
- });
-
- it('should throw error when change role', async() => {
- await page.autocompleteSearch(selectors.accountPrivileges.role, 'employee');
- await page.waitToClick(selectors.accountPrivileges.save);
-
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain(`You don't have grant privilege`);
- });
- });
-
- describe('as sysadmin', () => {
- beforeAll(async() => {
- await page.loginAndModule('sysadmin', 'account');
- await page.accessToSearchResult('9');
- await page.accessToSection('account.card.privileges');
- });
-
- it('should give privileges', async() => {
- await page.waitToClick(selectors.accountPrivileges.checkHasGrant);
- await page.waitToClick(selectors.accountPrivileges.save);
- const message = await page.waitForSnackbar();
-
- await page.reloadSection('account.card.privileges');
- const result = await page.checkboxState(selectors.accountPrivileges.checkHasGrant);
-
- expect(message.text).toContain(`Data saved!`);
- expect(result).toBe('checked');
- });
-
- it('should throw error when change role and not own role', async() => {
- await page.autocompleteSearch(selectors.accountPrivileges.role, 'itBoss');
- await page.waitToClick(selectors.accountPrivileges.save);
-
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain(`You don't own the role and you can't assign it to another user`);
- });
-
- it('should change role to employee', async() => {
- await page.autocompleteSearch(selectors.accountPrivileges.role, 'employee');
- await page.waitToClick(selectors.accountPrivileges.save);
- const message = await page.waitForSnackbar();
-
- await page.reloadSection('account.card.privileges');
- const result = await page.waitToGetProperty(selectors.accountPrivileges.role, 'value');
-
- expect(message.text).toContain(`Data saved!`);
- expect(result).toContain('employee');
- });
-
- it('should return role to developer', async() => {
- await page.autocompleteSearch(selectors.accountPrivileges.role, 'developer');
- await page.waitToClick(selectors.accountPrivileges.save);
- const message = await page.waitForSnackbar();
-
- await page.reloadSection('account.card.privileges');
- const result = await page.waitToGetProperty(selectors.accountPrivileges.role, 'value');
-
- expect(message.text).toContain(`Data saved!`);
- expect(result).toContain('developer');
- });
- });
-
- describe('as developer again', () => {
- it('should remove privileges', async() => {
- await page.accessToSearchResult('9');
- await page.accessToSection('account.card.privileges');
-
- await page.waitToClick(selectors.accountPrivileges.checkHasGrant);
- await page.waitToClick(selectors.accountPrivileges.save);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain(`Data saved!`);
- });
-
- it('should logIn in developer', async() => {
- await page.reloadSection('account.card.privileges');
- const result = await page.checkboxState(selectors.accountPrivileges.checkHasGrant);
-
- expect(result).toBe('unchecked');
- });
- });
-});
diff --git a/front/core/services/app.js b/front/core/services/app.js
index 8cee66ef09..cec7bea7f1 100644
--- a/front/core/services/app.js
+++ b/front/core/services/app.js
@@ -56,6 +56,8 @@ export default class App {
}
getUrl(route, appName = 'lilium') {
+ const index = window.location.hash.indexOf(route.toLowerCase());
+ const newRoute = index < 0 ? route : window.location.hash.substring(index);
const env = process.env.NODE_ENV;
const filter = {
where: {and: [
@@ -67,7 +69,7 @@ export default class App {
return this.logger.$http.get('Urls/findOne', {filter})
.then(res => {
if (res && res.data)
- return res.data.url + route;
+ return res.data.url + newRoute;
})
.catch(() => {
this.showError('Direction not found');
diff --git a/front/salix/components/user-popover/index.html b/front/salix/components/user-popover/index.html
index 06a4af1e0c..cedb3383ba 100644
--- a/front/salix/components/user-popover/index.html
+++ b/front/salix/components/user-popover/index.html
@@ -38,7 +38,7 @@
My account
diff --git a/front/salix/components/user-popover/index.js b/front/salix/components/user-popover/index.js
index 1d88137fff..72cb734e96 100644
--- a/front/salix/components/user-popover/index.js
+++ b/front/salix/components/user-popover/index.js
@@ -82,6 +82,9 @@ class Controller {
? {id: $search}
: {bank: {like: '%' + $search + '%'}};
}
+ async redirect(id) {
+ window.location.href = await this.vnConfig.vnApp.getUrl(`worker/${id}`);
+ }
}
Controller.$inject = ['$scope', '$translate', 'vnConfig', 'vnAuth', 'vnToken'];
diff --git a/loopback/common/models/vn-model.js b/loopback/common/models/vn-model.js
index 22b535f629..a11bed11de 100644
--- a/loopback/common/models/vn-model.js
+++ b/loopback/common/models/vn-model.js
@@ -13,7 +13,6 @@ module.exports = function(Self) {
Object.assign(Self, {
setup() {
Self.super_.setup.call(this);
-
/**
* Setting a global transaction timeout to find out if the service
* is blocked because the connection pool is empty.
@@ -28,6 +27,26 @@ module.exports = function(Self) {
};
});
+ this.beforeRemote('**', async ctx => {
+ if (!this.hasFilter(ctx)) return;
+
+ const defaultLimit = this.app.orm.selectLimit;
+ const filter = ctx.args.filter || {limit: defaultLimit};
+
+ if (filter.limit > defaultLimit) {
+ filter.limit = defaultLimit;
+ ctx.args.filter = filter;
+ }
+ });
+
+ this.afterRemote('**', async ctx => {
+ if (!this.hasFilter(ctx)) return;
+
+ const {result} = ctx;
+ const length = Array.isArray(result) ? result.length : result ? 1 : 0;
+ if (length >= this.app.orm.selectLimit) throw new UserError('Too many records');
+ });
+
// Register field ACL validation
/*
this.beforeRemote('prototype.patchAttributes', ctx => this.checkUpdateAcls(ctx));
@@ -327,6 +346,12 @@ module.exports = function(Self) {
checkInsertAcls(ctx) {
return this.checkAcls(ctx, 'insert');
+ },
+
+ hasFilter(ctx) {
+ return ctx.req.method.toUpperCase() === 'GET' &&
+ ctx.method.accepts.some(x => x.arg === 'filter' && x.type.toLowerCase() === 'object');
}
+
});
};
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index e1f7fd6557..377691ae61 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -369,5 +369,6 @@
"Cannot send mail": "Não é possível enviar o email",
"CONSTRAINT `supplierAccountTooShort` failed for `vn`.`supplier`": "La cuenta debe tener exactamente 10 dígitos",
"The sale not exists in the item shelving": "La venta no existe en la estantería del artículo",
- "The entry not have stickers": "La entrada no tiene etiquetas"
+ "The entry not have stickers": "La entrada no tiene etiquetas",
+ "Too many records": "Demasiados registros"
}
\ No newline at end of file
diff --git a/loopback/server/boot/orm.js b/loopback/server/boot/orm.js
new file mode 100644
index 0000000000..8bbd969e1f
--- /dev/null
+++ b/loopback/server/boot/orm.js
@@ -0,0 +1,6 @@
+module.exports = async function(app) {
+ if (!app.orm) {
+ const ormConfig = await app.models.OrmConfig.findOne();
+ app.orm = ormConfig;
+ }
+};
diff --git a/loopback/server/connectors/vn-mysql.js b/loopback/server/connectors/vn-mysql.js
index 5edef43952..2012caf37d 100644
--- a/loopback/server/connectors/vn-mysql.js
+++ b/loopback/server/connectors/vn-mysql.js
@@ -342,6 +342,9 @@ exports.initialize = function initialize(dataSource, callback) {
}
};
+// Code extracted from original Loopback MySQL connector
+// since it cannot be reused, please try not to alter it.
+// https://github.com/loopbackio/loopback-connector-mysql/blob/v6.2.0/lib/mysql.js
MySQL.prototype.connect = function(callback) {
const self = this;
const options = generateOptions(this.settings);
diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json
index 341d5d578d..f1643e5227 100644
--- a/loopback/server/datasources.json
+++ b/loopback/server/datasources.json
@@ -11,12 +11,16 @@
"port": "3306",
"username": "root",
"password": "root",
+ "connectionLimit": 100,
+ "queueLimit": 100,
"multipleStatements": true,
"legacyUtcDateProcessing": false,
"timezone": "local",
"connectTimeout": 40000,
"acquireTimeout": 90000,
- "waitForConnections": true
+ "waitForConnections": true,
+ "maxIdleTime": 60000,
+ "idleTimeout": 60000
},
"osticket": {
"connector": "memory",
diff --git a/modules/account/front/accounts/index.html b/modules/account/front/accounts/index.html
deleted file mode 100644
index 6847e68d11..0000000000
--- a/modules/account/front/accounts/index.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
diff --git a/modules/account/front/accounts/index.js b/modules/account/front/accounts/index.js
deleted file mode 100644
index ab19126a1b..0000000000
--- a/modules/account/front/accounts/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- onSynchronizeAll() {
- this.vnApp.showSuccess(this.$t('Synchronizing in the background'));
- this.$http.patch(`Accounts/syncAll`);
- }
-
- onSynchronizeRoles() {
- this.$http.patch(`RoleInherits/sync`)
- .then(() => this.vnApp.showSuccess(this.$t('Roles synchronized!')));
- }
-}
-
-ngModule.component('vnAccountAccounts', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/accounts/locale/es.yml b/modules/account/front/accounts/locale/es.yml
deleted file mode 100644
index 614ade3eb0..0000000000
--- a/modules/account/front/accounts/locale/es.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-Accounts: Cuentas
-Homedir base: Directorio base para carpetas de usuario
-Shell: Intérprete de línea de comandos
-User and role base id: Id base usuarios y roles
-Synchronize all: Sincronizar todo
-Synchronize roles: Sincronizar roles
-If password is not specified, just user attributes are synchronized: >-
- Si la contraseña no se especifica solo se sincronizarán lo atributos del usuario
-Synchronizing in the background: Sincronizando en segundo plano
-Users synchronized!: ¡Usuarios sincronizados!
-Username: Nombre de usuario
-Synchronize: Sincronizar
-Please enter the username: Por favor introduce el nombre de usuario
-Roles synchronized!: ¡Roles sincronizados!
diff --git a/modules/account/front/acl/create/index.html b/modules/account/front/acl/create/index.html
deleted file mode 100644
index 14332f737a..0000000000
--- a/modules/account/front/acl/create/index.html
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
diff --git a/modules/account/front/acl/create/index.js b/modules/account/front/acl/create/index.js
deleted file mode 100644
index fea71991f1..0000000000
--- a/modules/account/front/acl/create/index.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- constructor(...args) {
- super(...args);
- this.accessTypes = [
- {name: '*'},
- {name: 'READ'},
- {name: 'WRITE'}
- ];
- this.permissions = [
- {name: 'ALLOW'},
- {name: 'DENY'}
- ];
-
- this.models = [];
- for (let model in window.validations)
- this.models.push({name: model});
-
- this.acl = {
- property: '*',
- principalType: 'ROLE',
- accessType: 'READ',
- permission: 'ALLOW'
- };
- }
-}
-
-ngModule.component('vnAclCreate', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/acl/index.js b/modules/account/front/acl/index.js
deleted file mode 100644
index 8393859a5a..0000000000
--- a/modules/account/front/acl/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import './main';
-import './index/';
-import './create';
-import './search-panel';
diff --git a/modules/account/front/acl/index/index.html b/modules/account/front/acl/index/index.html
deleted file mode 100644
index af06ec481d..0000000000
--- a/modules/account/front/acl/index/index.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
- {{::row.model}}.{{::row.property}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/acl/index/index.js b/modules/account/front/acl/index/index.js
deleted file mode 100644
index a2aec534af..0000000000
--- a/modules/account/front/acl/index/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- onDelete(row) {
- return this.$http.delete(`ACLs/${row.id}`)
- .then(() => this.$.model.refresh())
- .then(() => this.vnApp.showSuccess(this.$t('ACL removed')));
- }
-}
-
-ngModule.component('vnAclIndex', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/acl/index/locale/es.yml b/modules/account/front/acl/index/locale/es.yml
deleted file mode 100644
index 8024f804c3..0000000000
--- a/modules/account/front/acl/index/locale/es.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-New ACL: Nuevo ACL
-Edit ACL: Editar ACL
-ACL will be removed: El ACL será eliminado
-ACL removed: ACL eliminado
diff --git a/modules/account/front/acl/locale/es.yml b/modules/account/front/acl/locale/es.yml
deleted file mode 100644
index ff6a1b41c3..0000000000
--- a/modules/account/front/acl/locale/es.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-Model: Modelo
-Property: Propiedad
-Access type: Tipo de acceso
-Permission: Permiso
\ No newline at end of file
diff --git a/modules/account/front/acl/main/index.html b/modules/account/front/acl/main/index.html
deleted file mode 100644
index 7767768d94..0000000000
--- a/modules/account/front/acl/main/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/acl/main/index.js b/modules/account/front/acl/main/index.js
deleted file mode 100644
index a91a71cb7c..0000000000
--- a/modules/account/front/acl/main/index.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import ngModule from '../../module';
-import ModuleMain from 'salix/components/module-main';
-
-export default class ACL extends ModuleMain {
- exprBuilder(param, value) {
- switch (param) {
- case 'search':
- return {model: {like: `%${value}%`}};
- default:
- return {[param]: value};
- }
- }
-}
-
-ngModule.vnComponent('vnAclComponent', {
- controller: ACL,
- template: require('./index.html')
-});
diff --git a/modules/account/front/acl/search-panel/index.html b/modules/account/front/acl/search-panel/index.html
deleted file mode 100644
index a3efab440d..0000000000
--- a/modules/account/front/acl/search-panel/index.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
diff --git a/modules/account/front/acl/search-panel/index.js b/modules/account/front/acl/search-panel/index.js
deleted file mode 100644
index 4f571059ef..0000000000
--- a/modules/account/front/acl/search-panel/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import ngModule from '../../module';
-import SearchPanel from 'core/components/searchbar/search-panel';
-
-export default class Controller extends SearchPanel {
- constructor(...args) {
- super(...args);
- this.accessTypes = [
- {name: '*'},
- {name: 'READ'},
- {name: 'WRITE'}
- ];
- this.permissions = [
- {name: 'ALLOW'},
- {name: 'DENY'}
- ];
-
- this.models = [];
- for (let model in window.validations)
- this.models.push({name: model});
- }
-}
-
-ngModule.component('vnAclSearchPanel', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/alias/basic-data/index.html b/modules/account/front/alias/basic-data/index.html
deleted file mode 100644
index 523c9297a1..0000000000
--- a/modules/account/front/alias/basic-data/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/alias/basic-data/index.js b/modules/account/front/alias/basic-data/index.js
deleted file mode 100644
index b7c2db0892..0000000000
--- a/modules/account/front/alias/basic-data/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {}
-
-ngModule.component('vnAliasBasicData', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- alias: '<'
- }
-});
diff --git a/modules/account/front/alias/card/index.html b/modules/account/front/alias/card/index.html
deleted file mode 100644
index 712147a249..0000000000
--- a/modules/account/front/alias/card/index.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/modules/account/front/alias/card/index.js b/modules/account/front/alias/card/index.js
deleted file mode 100644
index fd1a18f6ab..0000000000
--- a/modules/account/front/alias/card/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import ngModule from '../../module';
-import ModuleCard from 'salix/components/module-card';
-
-class Controller extends ModuleCard {
- reload() {
- this.$http.get(`MailAliases/${this.$params.id}`)
- .then(res => this.alias = res.data);
- }
-}
-
-ngModule.vnComponent('vnAliasCard', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/alias/create/index.html b/modules/account/front/alias/create/index.html
deleted file mode 100644
index 4dad1b8705..0000000000
--- a/modules/account/front/alias/create/index.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
diff --git a/modules/account/front/alias/create/index.js b/modules/account/front/alias/create/index.js
deleted file mode 100644
index c058c3adf4..0000000000
--- a/modules/account/front/alias/create/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- onSubmit() {
- return this.$.watcher.submit().then(res =>
- this.$state.go('account.alias.card.basicData', {id: res.data.id})
- );
- }
-}
-
-ngModule.component('vnAliasCreate', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/alias/descriptor/index.html b/modules/account/front/alias/descriptor/index.html
deleted file mode 100644
index 71b98c6a32..0000000000
--- a/modules/account/front/alias/descriptor/index.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- Delete
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/alias/descriptor/index.js b/modules/account/front/alias/descriptor/index.js
deleted file mode 100644
index a21baae5a2..0000000000
--- a/modules/account/front/alias/descriptor/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import ngModule from '../../module';
-import Descriptor from 'salix/components/descriptor';
-
-class Controller extends Descriptor {
- get alias() {
- return this.entity;
- }
-
- set alias(value) {
- this.entity = value;
- }
-
- onDelete() {
- return this.$http.delete(`MailAliases/${this.id}`)
- .then(() => this.$state.go('account.alias'))
- .then(() => this.vnApp.showSuccess(this.$t('Alias removed')));
- }
-}
-
-ngModule.component('vnAliasDescriptor', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- alias: '<'
- }
-});
diff --git a/modules/account/front/alias/descriptor/locale/es.yml b/modules/account/front/alias/descriptor/locale/es.yml
deleted file mode 100644
index 9c6fa0e733..0000000000
--- a/modules/account/front/alias/descriptor/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-Alias will be removed: El alias será eliminado
-Alias removed: Alias eliminado
\ No newline at end of file
diff --git a/modules/account/front/alias/index.js b/modules/account/front/alias/index.js
deleted file mode 100644
index 8eed3a3d3d..0000000000
--- a/modules/account/front/alias/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import './main';
-import './index/';
-import './create';
-import './summary';
-import './card';
-import './descriptor';
-import './create';
-import './basic-data';
-import './users';
diff --git a/modules/account/front/alias/index/index.html b/modules/account/front/alias/index/index.html
deleted file mode 100644
index 7343cb9bdf..0000000000
--- a/modules/account/front/alias/index/index.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
- {{::alias.alias}}
- {{::alias.description}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/alias/index/index.js b/modules/account/front/alias/index/index.js
deleted file mode 100644
index 44e146fb4a..0000000000
--- a/modules/account/front/alias/index/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- preview(alias) {
- this.selectedAlias = alias;
- this.$.summary.show();
- }
-}
-
-ngModule.component('vnAliasIndex', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/alias/index/locale/es.yml b/modules/account/front/alias/index/locale/es.yml
deleted file mode 100644
index 4df41c0bee..0000000000
--- a/modules/account/front/alias/index/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-New alias: Nuevo alias
-View alias: Ver alias
\ No newline at end of file
diff --git a/modules/account/front/alias/locale/es.yml b/modules/account/front/alias/locale/es.yml
deleted file mode 100644
index ecc856fcf6..0000000000
--- a/modules/account/front/alias/locale/es.yml
+++ /dev/null
@@ -1 +0,0 @@
-Public: Público
\ No newline at end of file
diff --git a/modules/account/front/alias/main/index.html b/modules/account/front/alias/main/index.html
deleted file mode 100644
index 43f6e2f510..0000000000
--- a/modules/account/front/alias/main/index.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/alias/main/index.js b/modules/account/front/alias/main/index.js
deleted file mode 100644
index 21eed3d853..0000000000
--- a/modules/account/front/alias/main/index.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import ngModule from '../../module';
-import ModuleMain from 'salix/components/module-main';
-
-export default class Alias extends ModuleMain {
- exprBuilder(param, value) {
- switch (param) {
- case 'search':
- return /^\d+$/.test(value)
- ? {id: value}
- : {alias: {like: `%${value}%`}};
- }
- }
-}
-
-ngModule.vnComponent('vnAlias', {
- controller: Alias,
- template: require('./index.html')
-});
diff --git a/modules/account/front/alias/summary/index.html b/modules/account/front/alias/summary/index.html
deleted file mode 100644
index 52ee2813d1..0000000000
--- a/modules/account/front/alias/summary/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
- {{summary.alias}}
-
-
- Basic data
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/alias/summary/index.js b/modules/account/front/alias/summary/index.js
deleted file mode 100644
index 21bc8d9ba7..0000000000
--- a/modules/account/front/alias/summary/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import ngModule from '../../module';
-import Component from 'core/lib/component';
-
-class Controller extends Component {
- set alias(value) {
- this._alias = value;
- this.$.summary = null;
- if (!value) return;
-
- this.$http.get(`MailAliases/${value.id}`)
- .then(res => this.$.summary = res.data);
- }
-
- get alias() {
- return this._alias;
- }
-}
-
-ngModule.component('vnAliasSummary', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- alias: '<'
- }
-});
diff --git a/modules/account/front/alias/users/index.html b/modules/account/front/alias/users/index.html
deleted file mode 100644
index 048a702eaa..0000000000
--- a/modules/account/front/alias/users/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
- {{::row.user.name}}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/account/front/alias/users/index.js b/modules/account/front/alias/users/index.js
deleted file mode 100644
index b2446d71bd..0000000000
--- a/modules/account/front/alias/users/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- $onInit() {
- let filter = {
- include: {
- relation: 'user',
- scope: {
- fields: ['id', 'name']
- }
- }
- };
- this.$http.get(`MailAliases/${this.$params.id}/accounts`, {filter})
- .then(res => this.$.data = res.data);
- }
-
- onRemove(row) {
- return this.$http.delete(`MailAliases/${this.$params.id}/accounts/${row.id}`)
- .then(() => {
- let index = this.$.data.indexOf(row);
- if (index !== -1) this.$.data.splice(index, 1);
- this.vnApp.showSuccess(this.$t('User removed'));
- });
- }
-}
-
-ngModule.component('vnAliasUsers', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/alias/users/index.spec.js b/modules/account/front/alias/users/index.spec.js
deleted file mode 100644
index d618f1de12..0000000000
--- a/modules/account/front/alias/users/index.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import './index';
-
-describe('component vnAliasUsers', () => {
- let controller;
- let $httpBackend;
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- controller = $componentController('vnAliasUsers', {$element: null});
- controller.$params.id = 1;
- }));
-
- describe('$onInit()', () => {
- it('should delete entity and go to index', () => {
- $httpBackend.expectGET('MailAliases/1/accounts').respond('foo');
- controller.$onInit();
- $httpBackend.flush();
-
- expect(controller.$.data).toBe('foo');
- });
- });
-
- describe('onRemove()', () => {
- it('should call backend method to change role', () => {
- jest.spyOn(controller.vnApp, 'showSuccess');
-
- controller.$.data = [
- {id: 1, alias: 'foo'},
- {id: 2, alias: 'bar'}
- ];
-
- $httpBackend.expectDELETE('MailAliases/1/accounts/1').respond();
- controller.onRemove(controller.$.data[0]);
- $httpBackend.flush();
-
- expect(controller.$.data).toEqual([{id: 2, alias: 'bar'}]);
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-});
diff --git a/modules/account/front/alias/users/locale/es.yml b/modules/account/front/alias/users/locale/es.yml
deleted file mode 100644
index dc24eb318b..0000000000
--- a/modules/account/front/alias/users/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-User will be removed from alias: El usuario será borrado del alias
-User removed: Usuario borrado
\ No newline at end of file
diff --git a/modules/account/front/aliases/index.html b/modules/account/front/aliases/index.html
deleted file mode 100644
index 4a73ec873a..0000000000
--- a/modules/account/front/aliases/index.html
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
- {{::row.alias.alias}}
-
-
- {{::row.alias.description}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Account not enabled
-
diff --git a/modules/account/front/aliases/index.js b/modules/account/front/aliases/index.js
deleted file mode 100644
index 0fc806a719..0000000000
--- a/modules/account/front/aliases/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- $onInit() {
- this.refresh();
- }
-
- refresh() {
- let filter = {
- where: {account: this.$params.id},
- include: {
- relation: 'alias',
- scope: {
- fields: ['id', 'alias', 'description']
- }
- }
- };
- return this.$http.get(`MailAliasAccounts`, {filter})
- .then(res => this.$.data = res.data);
- }
-
- onAddClick() {
- this.addData = {account: this.$params.id};
- this.$.dialog.show();
- }
-
- onAddSave() {
- return this.$http.post(`MailAliasAccounts`, this.addData)
- .then(() => this.refresh())
- .then(() => this.vnApp.showSuccess(
- this.$t('Subscribed to alias!'))
- );
- }
-
- onRemove(row) {
- return this.$http.delete(`MailAliasAccounts/${row.id}`)
- .then(() => {
- this.$.data.splice(this.$.data.indexOf(row), 1);
- this.vnApp.showSuccess(this.$t('Unsubscribed from alias!'));
- });
- }
-}
-
-ngModule.component('vnUserAliases', {
- template: require('./index.html'),
- controller: Controller,
- require: {
- card: '^vnUserCard'
- }
-});
diff --git a/modules/account/front/aliases/index.spec.js b/modules/account/front/aliases/index.spec.js
deleted file mode 100644
index 466f1e1e94..0000000000
--- a/modules/account/front/aliases/index.spec.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import './index';
-
-describe('component vnUserAliases', () => {
- let controller;
- let $httpBackend;
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- controller = $componentController('vnUserAliases', {$element: null});
- jest.spyOn(controller.vnApp, 'showSuccess');
- }));
-
- describe('refresh()', () => {
- it('should refresh the controller data', () => {
- $httpBackend.expectGET('MailAliasAccounts').respond('foo');
- controller.refresh();
- $httpBackend.flush();
-
- expect(controller.$.data).toBe('foo');
- });
- });
-
- describe('onAddSave()', () => {
- it('should add the new row', () => {
- controller.addData = {account: 1};
-
- $httpBackend.expectPOST('MailAliasAccounts').respond();
- $httpBackend.expectGET('MailAliasAccounts').respond('foo');
- controller.onAddSave();
- $httpBackend.flush();
-
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-
- describe('onRemove()', () => {
- it('shoud remove the passed row remote and locally', () => {
- controller.$.data = [
- {id: 1, alias: 'foo'},
- {id: 2, alias: 'bar'}
- ];
-
- $httpBackend.expectDELETE('MailAliasAccounts/1').respond();
- controller.onRemove(controller.$.data[0]);
- $httpBackend.flush();
-
- expect(controller.$.data).toEqual([{id: 2, alias: 'bar'}]);
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-});
diff --git a/modules/account/front/aliases/locale/es.yml b/modules/account/front/aliases/locale/es.yml
deleted file mode 100644
index 4d1ad76a74..0000000000
--- a/modules/account/front/aliases/locale/es.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-Unsubscribe: Desuscribir
-Subscribed to alias!: ¡Suscrito al alias!
-Unsubscribed from alias!: ¡Desuscrito del alias!
\ No newline at end of file
diff --git a/modules/account/front/basic-data/index.html b/modules/account/front/basic-data/index.html
deleted file mode 100644
index 9fd3506fe1..0000000000
--- a/modules/account/front/basic-data/index.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
diff --git a/modules/account/front/basic-data/index.js b/modules/account/front/basic-data/index.js
deleted file mode 100644
index f6b266bbc0..0000000000
--- a/modules/account/front/basic-data/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- $onInit() {
- if (this.$params.emailConfirmed)
- this.vnApp.showSuccess(this.$t('Email verified successfully!'));
- }
-
- onSubmit() {
- this.$.watcher.submit()
- .then(() => this.card.reload());
- }
-}
-
-ngModule.component('vnUserBasicData', {
- template: require('./index.html'),
- controller: Controller,
- require: {
- card: '^vnUserCard'
- },
- bindings: {
- user: '<'
- }
-});
diff --git a/modules/account/front/basic-data/locale/es.yml b/modules/account/front/basic-data/locale/es.yml
deleted file mode 100644
index 2ca7bf6987..0000000000
--- a/modules/account/front/basic-data/locale/es.yml
+++ /dev/null
@@ -1 +0,0 @@
-Email verified successfully!: Correo verificado correctamente!
diff --git a/modules/account/front/card/index.html b/modules/account/front/card/index.html
deleted file mode 100644
index cba6b93c65..0000000000
--- a/modules/account/front/card/index.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/modules/account/front/card/index.js b/modules/account/front/card/index.js
deleted file mode 100644
index 2c8cc76379..0000000000
--- a/modules/account/front/card/index.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import ngModule from '../module';
-import ModuleCard from 'salix/components/module-card';
-import './style.scss';
-
-class Controller extends ModuleCard {
- reload() {
- const filter = {
- where: {id: this.$params.id},
- include: {
- relation: 'role',
- scope: {
- fields: ['id', 'name']
- }
- }
- };
-
- return Promise.all([
- this.$http.get(`VnUsers/preview`, {filter})
- .then(res => {
- const [user] = res.data;
- this.user = user;
- }),
- this.$http.get(`Accounts/${this.$params.id}/exists`)
- .then(res => this.hasAccount = res.data.exists)
- ]);
- }
-}
-
-ngModule.vnComponent('vnUserCard', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/card/index.spec.js b/modules/account/front/card/index.spec.js
deleted file mode 100644
index 712d3c1d85..0000000000
--- a/modules/account/front/card/index.spec.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import './index';
-
-describe('component vnUserCard', () => {
- let controller;
- let $httpBackend;
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- controller = $componentController('vnUserCard', {$element: null});
- }));
-
- describe('reload()', () => {
- it('should reload the controller data', () => {
- controller.$params.id = 1;
-
- $httpBackend.expectGET('VnUsers/preview').respond('foo');
- $httpBackend.expectGET('Accounts/1/exists').respond({exists: true});
- controller.reload();
- $httpBackend.flush();
-
- expect(controller.user).toBe('f');
- expect(controller.hasAccount).toBeTruthy();
- });
- });
-});
diff --git a/modules/account/front/card/style.scss b/modules/account/front/card/style.scss
deleted file mode 100644
index 4d9d108a09..0000000000
--- a/modules/account/front/card/style.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-@import "variables";
-
-.bg-title {
- display: block;
- text-align: center;
- padding: 24px;
- box-sizing: border-box;
- color: $color-font-secondary;
- font-size: 1.375rem;
-}
diff --git a/modules/account/front/connections/index.html b/modules/account/front/connections/index.html
deleted file mode 100644
index d634b7a9fc..0000000000
--- a/modules/account/front/connections/index.html
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
- {{::row.user.username}}
- {{::row.created | date:'dd/MM HH:mm'}}
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/connections/index.js b/modules/account/front/connections/index.js
deleted file mode 100644
index c4ddd56153..0000000000
--- a/modules/account/front/connections/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- constructor(...args) {
- super(...args);
- this.filter = {
- fields: ['id', 'created', 'userId'],
- include: {
- relation: 'user',
- scope: {
- fields: ['username']
- }
- },
- order: 'created DESC'
- };
- }
-
- onDisconnect(row) {
- return this.$http.delete(`AccessTokens/${row.id}`)
- .then(() => this.$.model.refresh())
- .then(() => this.vnApp.showSuccess(this.$t('Session killed')));
- }
-}
-
-ngModule.component('vnConnections', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/connections/locale/es.yml b/modules/account/front/connections/locale/es.yml
deleted file mode 100644
index 41ef18b454..0000000000
--- a/modules/account/front/connections/locale/es.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-Go to user: Ir al usuario
-Refresh: Actualizar
-Session will be killed: Se va a matar la sesión
-Kill session: Matar sesión
-Session killed: Sesión matada
\ No newline at end of file
diff --git a/modules/account/front/create/index.html b/modules/account/front/create/index.html
deleted file mode 100644
index 70a5188857..0000000000
--- a/modules/account/front/create/index.html
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
diff --git a/modules/account/front/create/index.js b/modules/account/front/create/index.js
deleted file mode 100644
index 01ba7905b2..0000000000
--- a/modules/account/front/create/index.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- constructor($element, $) {
- super($element, $);
- this.user = {active: true};
- }
-
- onSubmit() {
- return this.$.watcher.submit().then(res => {
- this.$state.go('account.card.basicData', {id: res.data.id});
- });
- }
-}
-
-ngModule.component('vnUserCreate', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/descriptor/__snapshots__/index.spec.js.snap b/modules/account/front/descriptor/__snapshots__/index.spec.js.snap
deleted file mode 100644
index de5f8e8c27..0000000000
--- a/modules/account/front/descriptor/__snapshots__/index.spec.js.snap
+++ /dev/null
@@ -1,5 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`component vnUserDescriptor onPassChange() should throw an error when password is empty 1`] = `"You must enter a new password"`;
-
-exports[`component vnUserDescriptor onPassChange() should throw an error when repeat password not matches new password 1`] = `"Passwords don't match"`;
diff --git a/modules/account/front/descriptor/index.spec.js b/modules/account/front/descriptor/index.spec.js
deleted file mode 100644
index 46c7e376c8..0000000000
--- a/modules/account/front/descriptor/index.spec.js
+++ /dev/null
@@ -1,97 +0,0 @@
-import './index';
-
-describe('component vnUserDescriptor', () => {
- let controller;
- let $httpBackend;
-
- let user = {id: 1, name: 'foo'};
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- $httpBackend.whenGET('Accounts/1/exists').respond({exists: true});
-
- controller = $componentController('vnUserDescriptor', {$element: null}, {user});
- jest.spyOn(controller, 'emit');
- jest.spyOn(controller.vnApp, 'showSuccess');
- }));
-
- describe('onDelete()', () => {
- it('should delete entity and go to index', () => {
- controller.$state.go = jest.fn();
-
- $httpBackend.expectDELETE('VnUsers/1').respond();
- controller.onDelete();
- $httpBackend.flush();
-
- expect(controller.$state.go).toHaveBeenCalledWith('account.index');
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-
- describe('onPassChange()', () => {
- it('should throw an error when password is empty', () => {
- expect(() => {
- controller.onPassChange();
- }).toThrowErrorMatchingSnapshot();
- });
-
- it('should throw an error when repeat password not matches new password', () => {
- controller.newPassword = 'foo';
- controller.repeatPassword = 'bar';
-
- expect(() => {
- controller.onPassChange();
- }).toThrowErrorMatchingSnapshot();
- });
-
- it('should make a request when password checks passes', () => {
- controller.newPassword = 'foo';
- controller.repeatPassword = 'foo';
-
- $httpBackend.expectPATCH('Accounts/1/setPassword').respond();
- controller.onPassChange();
- $httpBackend.flush();
-
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- expect(controller.emit).toHaveBeenCalledWith('change');
- });
- });
-
- describe('onEnableAccount()', () => {
- it('should make request to enable account', () => {
- $httpBackend.expectPOST('Accounts', {id: 1}).respond();
- controller.onEnableAccount();
- $httpBackend.flush();
-
- expect(controller.hasAccount).toBeTruthy();
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- expect(controller.emit).toHaveBeenCalledWith('change');
- });
- });
-
- describe('onDisableAccount()', () => {
- it('should make request to disable account', () => {
- $httpBackend.expectDELETE('Accounts/1').respond();
- controller.onDisableAccount();
- $httpBackend.flush();
-
- expect(controller.hasAccount).toBeFalsy();
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- expect(controller.emit).toHaveBeenCalledWith('change');
- });
- });
-
- describe('onSetActive()', () => {
- it('should make request to activate/deactivate the user', () => {
- $httpBackend.expectPATCH('VnUsers/1', {active: true}).respond();
- controller.onSetActive(true);
- $httpBackend.flush();
-
- expect(controller.user.active).toBeTruthy();
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- expect(controller.emit).toHaveBeenCalledWith('change');
- });
- });
-});
diff --git a/modules/account/front/index.js b/modules/account/front/index.js
index 4d6aedcaeb..0f22088628 100644
--- a/modules/account/front/index.js
+++ b/modules/account/front/index.js
@@ -1,24 +1,6 @@
export * from './module';
import './main';
-import './index/';
-import './role';
-import './alias';
-import './connections';
-import './acl';
-import './summary';
-import './card';
import './descriptor';
import './descriptor-popover';
-import './search-panel';
-import './create';
-import './basic-data';
-import './mail-forwarding';
-import './aliases';
-import './roles';
-import './ldap';
-import './samba';
-import './accounts';
-import './privileges';
-import './user-log';
-import './role-log';
+import './summary';
diff --git a/modules/account/front/index/index.html b/modules/account/front/index/index.html
deleted file mode 100644
index 7502c8b3dc..0000000000
--- a/modules/account/front/index/index.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/account/front/index/index.js b/modules/account/front/index/index.js
deleted file mode 100644
index 9324ca740b..0000000000
--- a/modules/account/front/index/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- preview(user) {
- this.selectedUser = user;
- this.$.summary.show();
- }
-}
-
-ngModule.component('vnUserIndex', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/index/locale/es.yml b/modules/account/front/index/locale/es.yml
deleted file mode 100644
index 074fb054ed..0000000000
--- a/modules/account/front/index/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-New user: Nuevo usuario
-View user: Ver usuario
\ No newline at end of file
diff --git a/modules/account/front/ldap/index.html b/modules/account/front/ldap/index.html
deleted file mode 100644
index 23356452a7..0000000000
--- a/modules/account/front/ldap/index.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
diff --git a/modules/account/front/ldap/index.js b/modules/account/front/ldap/index.js
deleted file mode 100644
index 40e1e8db16..0000000000
--- a/modules/account/front/ldap/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- onTestConection() {
- this.$http.get(`LdapConfigs/test`)
- .then(() => this.vnApp.showSuccess(this.$t('LDAP connection established!')));
- }
-}
-
-ngModule.component('vnAccountLdap', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/ldap/locale/es.yml b/modules/account/front/ldap/locale/es.yml
deleted file mode 100644
index 0353d6b72e..0000000000
--- a/modules/account/front/ldap/locale/es.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-Enable synchronization: Habilitar sincronización
-Server: Servidor
-RDN: RDN
-User DN: DN usuarios
-Filter: Filtro
-Group DN: DN grupos
-Test connection: Probar conexión
-LDAP connection established!: ¡Conexión con LDAP establecida!
diff --git a/modules/account/front/mail-forwarding/index.html b/modules/account/front/mail-forwarding/index.html
deleted file mode 100644
index df5cd80bf1..0000000000
--- a/modules/account/front/mail-forwarding/index.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
- Account not enabled
-
diff --git a/modules/account/front/mail-forwarding/index.js b/modules/account/front/mail-forwarding/index.js
deleted file mode 100644
index 5118e8eaba..0000000000
--- a/modules/account/front/mail-forwarding/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {}
-
-ngModule.component('vnUserMailForwarding', {
- template: require('./index.html'),
- controller: Controller,
- require: {
- card: '^vnUserCard'
- },
-});
diff --git a/modules/account/front/mail-forwarding/locale/es.yml b/modules/account/front/mail-forwarding/locale/es.yml
deleted file mode 100644
index 688ace6b5a..0000000000
--- a/modules/account/front/mail-forwarding/locale/es.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-Mail forwarding: Reenvío de correo
-Forward email: Dirección de reenvío
-Enable mail forwarding: Habilitar redirección de correo
-All emails will be forwarded to the specified address.: >
- Todos los correos serán reenviados a la dirección especificada, no se
- mantendrá copia de los mismos en el buzón del usuario.
-You don't have enough privileges: No tienes suficientes permisos
diff --git a/modules/account/front/main/index.html b/modules/account/front/main/index.html
index 36b493ec4d..e69de29bb2 100644
--- a/modules/account/front/main/index.html
+++ b/modules/account/front/main/index.html
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/account/front/main/index.js b/modules/account/front/main/index.js
index a43ffb76b3..335d71b42b 100644
--- a/modules/account/front/main/index.js
+++ b/modules/account/front/main/index.js
@@ -4,32 +4,10 @@ import ModuleMain from 'salix/components/module-main';
export default class User extends ModuleMain {
constructor($element, $) {
super($element, $);
- this.filter = {
- fields: ['id', 'nickname', 'name', 'role'],
- include: {
- relation: 'role',
- scope: {
- fields: ['id', 'name']
- }
- }
- };
}
-
- exprBuilder(param, value) {
- switch (param) {
- case 'search':
- return /^\d+$/.test(value)
- ? {id: value}
- : {or: [
- {name: {like: `%${value}%`}},
- {nickname: {like: `%${value}%`}}
- ]};
- case 'name':
- case 'nickname':
- return {[param]: {like: `%${value}%`}};
- case 'roleFk':
- return {[param]: value};
- }
+ async $onInit() {
+ this.$state.go('home');
+ window.location.href = await this.vnApp.getUrl(`account/`);
}
}
diff --git a/modules/account/front/main/index.spec.js b/modules/account/front/main/index.spec.js
deleted file mode 100644
index c232aa8493..0000000000
--- a/modules/account/front/main/index.spec.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import './index';
-
-describe('component vnUser', () => {
- let controller;
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject($componentController => {
- controller = $componentController('vnUser', {$element: null});
- }));
-
- describe('exprBuilder()', () => {
- it('should search by id when only digits string is passed', () => {
- let expr = controller.exprBuilder('search', '1');
-
- expect(expr).toEqual({id: '1'});
- });
-
- it('should search by name when non-only digits string is passed', () => {
- let expr = controller.exprBuilder('search', '1foo');
-
- expect(expr).toEqual({or: [
- {name: {like: '%1foo%'}},
- {nickname: {like: '%1foo%'}}
- ]});
- });
- });
-});
diff --git a/modules/account/front/privileges/index.html b/modules/account/front/privileges/index.html
deleted file mode 100644
index 343c179e31..0000000000
--- a/modules/account/front/privileges/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
diff --git a/modules/account/front/privileges/index.js b/modules/account/front/privileges/index.js
deleted file mode 100644
index f69428666b..0000000000
--- a/modules/account/front/privileges/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- get user() {
- return this._user;
- }
-
- set user(value) {
- this._user = value;
- if (!value) return;
- }
-}
-
-ngModule.component('vnUserPrivileges', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- user: '<'
- }
-});
diff --git a/modules/account/front/privileges/locale/es.yml b/modules/account/front/privileges/locale/es.yml
deleted file mode 100644
index d66a7a6cf5..0000000000
--- a/modules/account/front/privileges/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-Privileges: Privilegios
-Has grant: Puede delegar privilegios
diff --git a/modules/account/front/role-log/index.html b/modules/account/front/role-log/index.html
deleted file mode 100644
index 9e2b151b54..0000000000
--- a/modules/account/front/role-log/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/modules/account/front/role-log/index.js b/modules/account/front/role-log/index.js
deleted file mode 100644
index 02448ccaa5..0000000000
--- a/modules/account/front/role-log/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-ngModule.vnComponent('vnRoleLog', {
- template: require('./index.html'),
- controller: Section,
-});
diff --git a/modules/account/front/role/basic-data/index.html b/modules/account/front/role/basic-data/index.html
deleted file mode 100644
index 846f8b455e..0000000000
--- a/modules/account/front/role/basic-data/index.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
diff --git a/modules/account/front/role/basic-data/index.js b/modules/account/front/role/basic-data/index.js
deleted file mode 100644
index 4e26906eea..0000000000
--- a/modules/account/front/role/basic-data/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {}
-
-ngModule.component('vnRoleBasicData', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- role: '<'
- }
-});
diff --git a/modules/account/front/role/card/index.html b/modules/account/front/role/card/index.html
deleted file mode 100644
index 2f51f88b5c..0000000000
--- a/modules/account/front/role/card/index.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/modules/account/front/role/card/index.js b/modules/account/front/role/card/index.js
deleted file mode 100644
index 3c7c758efc..0000000000
--- a/modules/account/front/role/card/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import ngModule from '../../module';
-import ModuleCard from 'salix/components/module-card';
-
-class Controller extends ModuleCard {
- reload() {
- this.$http.get(`VnRoles/${this.$params.id}`)
- .then(res => this.role = res.data);
- }
-}
-
-ngModule.vnComponent('vnRoleCard', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/role/card/index.spec.js b/modules/account/front/role/card/index.spec.js
deleted file mode 100644
index 569fe487d2..0000000000
--- a/modules/account/front/role/card/index.spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import './index';
-
-describe('component vnRoleCard', () => {
- let controller;
- let $httpBackend;
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- controller = $componentController('vnRoleCard', {$element: null});
- }));
-
- describe('reload()', () => {
- it('should reload the controller data', () => {
- controller.$params.id = 1;
-
- $httpBackend.expectGET('VnRoles/1').respond('foo');
- controller.reload();
- $httpBackend.flush();
-
- expect(controller.role).toBe('foo');
- });
- });
-});
diff --git a/modules/account/front/role/create/index.html b/modules/account/front/role/create/index.html
deleted file mode 100644
index 77d6fc2c1f..0000000000
--- a/modules/account/front/role/create/index.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
diff --git a/modules/account/front/role/create/index.js b/modules/account/front/role/create/index.js
deleted file mode 100644
index 3f7fcc9cf5..0000000000
--- a/modules/account/front/role/create/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- onSubmit() {
- return this.$.watcher.submit().then(res =>
- this.$state.go('account.role.card.basicData', {id: res.data.id})
- );
- }
-}
-
-ngModule.component('vnRoleCreate', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/role/descriptor/index.html b/modules/account/front/role/descriptor/index.html
deleted file mode 100644
index d8bf4857a0..0000000000
--- a/modules/account/front/role/descriptor/index.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- Delete
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/account/front/role/descriptor/index.js b/modules/account/front/role/descriptor/index.js
deleted file mode 100644
index 17b585cb79..0000000000
--- a/modules/account/front/role/descriptor/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import ngModule from '../../module';
-import Descriptor from 'salix/components/descriptor';
-
-class Controller extends Descriptor {
- get role() {
- return this.entity;
- }
-
- set role(value) {
- this.entity = value;
- }
-
- onDelete() {
- return this.$http.delete(`VnRoles/${this.id}`)
- .then(() => this.$state.go('account.role'))
- .then(() => this.vnApp.showSuccess(this.$t('Role removed')));
- }
-}
-
-ngModule.component('vnRoleDescriptor', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- role: '<'
- }
-});
diff --git a/modules/account/front/role/descriptor/index.spec.js b/modules/account/front/role/descriptor/index.spec.js
deleted file mode 100644
index f3b2e4763a..0000000000
--- a/modules/account/front/role/descriptor/index.spec.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import './index';
-
-describe('component vnRoleDescriptor', () => {
- let controller;
- let $httpBackend;
-
- let role = {id: 1, name: 'foo'};
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- controller = $componentController('vnRoleDescriptor', {$element: null}, {role});
- }));
-
- describe('onDelete()', () => {
- it('should delete entity and go to index', () => {
- controller.$state.go = jest.fn();
- jest.spyOn(controller.vnApp, 'showSuccess');
-
- $httpBackend.expectDELETE('VnRoles/1').respond();
- controller.onDelete();
- $httpBackend.flush();
-
- expect(controller.$state.go).toHaveBeenCalledWith('account.role');
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-});
diff --git a/modules/account/front/role/descriptor/locale/es.yml b/modules/account/front/role/descriptor/locale/es.yml
deleted file mode 100644
index 1ca512e4f9..0000000000
--- a/modules/account/front/role/descriptor/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-Role will be removed: El rol va a ser eliminado
-Role removed: Rol eliminado
\ No newline at end of file
diff --git a/modules/account/front/role/index.js b/modules/account/front/role/index.js
deleted file mode 100644
index 97a20d3bcf..0000000000
--- a/modules/account/front/role/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import './main';
-import './index/';
-import './summary';
-import './card';
-import './descriptor';
-import './search-panel';
-import './create';
-import './basic-data';
-import './subroles';
-import './inherited';
diff --git a/modules/account/front/role/index/index.html b/modules/account/front/role/index/index.html
deleted file mode 100644
index 4c4c6b0adf..0000000000
--- a/modules/account/front/role/index/index.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/role/index/index.js b/modules/account/front/role/index/index.js
deleted file mode 100644
index 40773b23b3..0000000000
--- a/modules/account/front/role/index/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- preview(role) {
- this.selectedRole = role;
- this.$.summary.show();
- }
-}
-
-ngModule.component('vnRoleIndex', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/role/index/locale/es.yml b/modules/account/front/role/index/locale/es.yml
deleted file mode 100644
index 70932e9833..0000000000
--- a/modules/account/front/role/index/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-New role: Nuevo rol
-View role: Ver rol
\ No newline at end of file
diff --git a/modules/account/front/role/inherited/index.html b/modules/account/front/role/inherited/index.html
deleted file mode 100644
index 83ecbbff48..0000000000
--- a/modules/account/front/role/inherited/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
- {{::row.inherits.name}}
-
-
- {{::row.inherits.description}}
-
-
-
-
-
-
diff --git a/modules/account/front/role/inherited/index.js b/modules/account/front/role/inherited/index.js
deleted file mode 100644
index 5927493eeb..0000000000
--- a/modules/account/front/role/inherited/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- $onInit() {
- let filter = {
- where: {role: this.$params.id},
- include: {
- relation: 'inherits',
- scope: {
- fields: ['id', 'name', 'description']
- }
- }
- };
- this.$http.get('RoleRoles', {filter})
- .then(res => this.$.data = res.data);
- }
-}
-
-ngModule.component('vnRoleInherited', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/role/inherited/index.spec.js b/modules/account/front/role/inherited/index.spec.js
deleted file mode 100644
index 16b0c53b26..0000000000
--- a/modules/account/front/role/inherited/index.spec.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import './index';
-
-describe('component vnRoleInherited', () => {
- let controller;
- let $httpBackend;
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- controller = $componentController('vnRoleInherited', {$element: null});
- }));
-
- describe('$onInit()', () => {
- it('should delete entity and go to index', () => {
- $httpBackend.expectGET('RoleRoles').respond('foo');
- controller.$onInit();
- $httpBackend.flush();
-
- expect(controller.$.data).toBe('foo');
- });
- });
-});
diff --git a/modules/account/front/role/locale/es.yml b/modules/account/front/role/locale/es.yml
deleted file mode 100644
index 159fc7f161..0000000000
--- a/modules/account/front/role/locale/es.yml
+++ /dev/null
@@ -1 +0,0 @@
-Subroles: Subroles
diff --git a/modules/account/front/role/main/index.html b/modules/account/front/role/main/index.html
deleted file mode 100644
index cfef28e57a..0000000000
--- a/modules/account/front/role/main/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/modules/account/front/role/main/index.js b/modules/account/front/role/main/index.js
deleted file mode 100644
index 77d15cf17d..0000000000
--- a/modules/account/front/role/main/index.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import ngModule from '../../module';
-import ModuleMain from 'salix/components/module-main';
-
-export default class Role extends ModuleMain {
- exprBuilder(param, value) {
- switch (param) {
- case 'search':
- return /^\d+$/.test(value)
- ? {id: value}
- : {or: [
- {name: {like: `%${value}%`}},
- {nickname: {like: `%${value}%`}}
- ]};
- case 'name':
- case 'description':
- return {[param]: {like: `%${value}%`}};
- }
- }
-}
-
-ngModule.vnComponent('vnRole', {
- controller: Role,
- template: require('./index.html')
-});
diff --git a/modules/account/front/role/search-panel/index.html b/modules/account/front/role/search-panel/index.html
deleted file mode 100644
index dfea9f01cd..0000000000
--- a/modules/account/front/role/search-panel/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/role/search-panel/index.js b/modules/account/front/role/search-panel/index.js
deleted file mode 100644
index 35da591ad4..0000000000
--- a/modules/account/front/role/search-panel/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import ngModule from '../../module';
-import SearchPanel from 'core/components/searchbar/search-panel';
-
-ngModule.component('vnRoleSearchPanel', {
- template: require('./index.html'),
- controller: SearchPanel
-});
diff --git a/modules/account/front/role/subroles/index.html b/modules/account/front/role/subroles/index.html
deleted file mode 100644
index eba1002b0e..0000000000
--- a/modules/account/front/role/subroles/index.html
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
- {{::row.inherits.name}}
-
-
- {{::row.inherits.description}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/account/front/role/subroles/index.js b/modules/account/front/role/subroles/index.js
deleted file mode 100644
index b7e1caaa4f..0000000000
--- a/modules/account/front/role/subroles/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import ngModule from '../../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- $onInit() {
- this.refresh();
- }
-
- get path() {
- return `RoleInherits`;
- }
-
- refresh() {
- let filter = {
- where: {role: this.$params.id},
- include: {
- relation: 'inherits',
- scope: {
- fields: ['id', 'name', 'description']
- }
- }
- };
- this.$http.get(this.path, {filter})
- .then(res => this.$.data = res.data);
- }
-
- onAddClick() {
- this.addData = {role: this.$params.id};
- this.$.dialog.show();
- }
-
- onAddSave() {
- return this.$http.post(this.path, this.addData)
- .then(() => this.refresh())
- .then(() => this.vnApp.showSuccess(this.$t('Role added! Changes will take a while to fully propagate.')));
- }
-
- onRemove(row) {
- return this.$http.delete(`${this.path}/${row.id}`)
- .then(() => {
- let index = this.$.data.indexOf(row);
- if (index !== -1) this.$.data.splice(index, 1);
- this.vnApp.showSuccess(this.$t('Role removed. Changes will take a while to fully propagate.'));
- });
- }
-}
-
-ngModule.component('vnRoleSubroles', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/role/subroles/index.spec.js b/modules/account/front/role/subroles/index.spec.js
deleted file mode 100644
index e7d9a4d0e2..0000000000
--- a/modules/account/front/role/subroles/index.spec.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import './index';
-
-describe('component vnRoleSubroles', () => {
- let controller;
- let $httpBackend;
-
- beforeEach(ngModule('account'));
-
- beforeEach(inject(($componentController, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- controller = $componentController('vnRoleSubroles', {$element: null});
- jest.spyOn(controller.vnApp, 'showSuccess');
- }));
-
- describe('refresh()', () => {
- it('should delete entity and go to index', () => {
- $httpBackend.expectGET('RoleInherits').respond('foo');
- controller.refresh();
- $httpBackend.flush();
-
- expect(controller.$.data).toBe('foo');
- });
- });
-
- describe('onAddSave()', () => {
- it('should add a subrole', () => {
- controller.addData = {role: 'foo'};
-
- $httpBackend.expectPOST('RoleInherits', {role: 'foo'}).respond();
- $httpBackend.expectGET('RoleInherits').respond();
- controller.onAddSave();
- $httpBackend.flush();
-
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-
- describe('onRemove()', () => {
- it('should remove a subrole', () => {
- controller.$.data = [
- {id: 1, name: 'foo'},
- {id: 2, name: 'bar'}
- ];
-
- $httpBackend.expectDELETE('RoleInherits/1').respond();
- controller.onRemove(controller.$.data[0]);
- $httpBackend.flush();
-
- expect(controller.$.data).toEqual([{id: 2, name: 'bar'}]);
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-});
diff --git a/modules/account/front/role/subroles/locale/es.yml b/modules/account/front/role/subroles/locale/es.yml
deleted file mode 100644
index 170882405e..0000000000
--- a/modules/account/front/role/subroles/locale/es.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-Role added! Changes will take a while to fully propagate.: >
- ¡Rol añadido! Los cambios tardaran un tiempo en propagarse completamente.
-Role removed. Changes will take a while to fully propagate.: >
- Rol eliminado. Los cambios tardaran un tiempo en propagarse completamente.
diff --git a/modules/account/front/role/summary/index.html b/modules/account/front/role/summary/index.html
deleted file mode 100644
index f7971190c3..0000000000
--- a/modules/account/front/role/summary/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
- {{summary.name}}
-
-
- Basic data
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/account/front/role/summary/index.js b/modules/account/front/role/summary/index.js
deleted file mode 100644
index 6c649a68f0..0000000000
--- a/modules/account/front/role/summary/index.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import ngModule from '../../module';
-import Component from 'core/lib/component';
-
-class Controller extends Component {
- set role(value) {
- this._role = value;
- this.$.summary = null;
- if (!value) return;
- this.$http.get(`VnRoles/${value.id}`)
- .then(res => this.$.summary = res.data);
- }
-
- get role() {
- return this._role;
- }
-}
-
-ngModule.component('vnRoleSummary', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- role: '<'
- }
-});
diff --git a/modules/account/front/roles/index.html b/modules/account/front/roles/index.html
deleted file mode 100644
index 8c85839298..0000000000
--- a/modules/account/front/roles/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
- {{::row.role.name}}
-
-
- {{::row.role.description}}
-
-
-
-
-
-
diff --git a/modules/account/front/roles/index.js b/modules/account/front/roles/index.js
deleted file mode 100644
index 0982dcf105..0000000000
--- a/modules/account/front/roles/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- $onInit() {
- let filter = {
- where: {
- prindicpalType: 'USER',
- principalId: this.$params.id
- },
- include: {
- relation: 'role',
- scope: {
- fields: ['id', 'name', 'description']
- }
- }
- };
- this.$http.get('RoleMappings', {filter})
- .then(res => this.$.data = res.data);
- }
-}
-
-ngModule.component('vnUserRoles', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/routes.json b/modules/account/front/routes.json
index d7845090b2..9eadf2af21 100644
--- a/modules/account/front/routes.json
+++ b/modules/account/front/routes.json
@@ -7,31 +7,6 @@
"menus": {
"main": [
{"state": "account.index", "icon": "face"},
- {"state": "account.role", "icon": "group"},
- {"state": "account.alias", "icon": "email"},
- {"state": "account.accounts", "icon": "accessibility"},
- {"state": "account.ldap", "icon": "account_tree"},
- {"state": "account.samba", "icon": "preview"},
- {"state": "account.acl", "icon": "check"},
- {"state": "account.connections", "icon": "share"}
- ],
- "card": [
- {"state": "account.card.basicData", "icon": "settings"},
- {"state": "account.card.roles", "icon": "group"},
- {"state": "account.card.mailForwarding", "icon": "forward"},
- {"state": "account.card.aliases", "icon": "email"},
- {"state": "account.card.privileges", "icon": "badge"},
- {"state": "account.card.log", "icon": "history"}
- ],
- "role": [
- {"state": "account.role.card.basicData", "icon": "settings"},
- {"state": "account.role.card.subroles", "icon": "groups"},
- {"state": "account.role.card.inherited", "icon": "account_tree"},
- {"state": "account.role.card.log", "icon": "history"}
- ],
- "alias": [
- {"state": "account.alias.card.basicData", "icon": "settings"},
- {"state": "account.alias.card.users", "icon": "groups"}
]
},
"keybindings": [
@@ -50,224 +25,6 @@
"state": "account.index",
"component": "vn-user-index",
"description": "Users"
- },
- {
- "url": "/create",
- "state": "account.create",
- "component": "vn-user-create",
- "description": "New user"
- },
- {
- "url": "/:id",
- "state": "account.card",
- "component": "vn-user-card",
- "abstract": true,
- "description": "Detail"
- },
- {
- "url": "/summary",
- "state": "account.card.summary",
- "component": "vn-user-summary",
- "description": "Summary",
- "params": {
- "user": "$ctrl.user"
- }
- },
- {
- "url": "/basic-data?emailConfirmed",
- "state": "account.card.basicData",
- "component": "vn-user-basic-data",
- "description": "Basic data",
- "params": {
- "user": "$ctrl.user"
- }
- },
- {
- "url" : "/log",
- "state": "account.card.log",
- "component": "vn-user-log",
- "description": "Log"
- },
- {
- "url" : "/log",
- "state": "account.role.card.log",
- "component": "vn-role-log",
- "description": "Log"
- },
- {
- "url": "/roles",
- "state": "account.card.roles",
- "component": "vn-user-roles",
- "description": "Inherited roles"
- },
- {
- "url": "/mail-forwarding",
- "state": "account.card.mailForwarding",
- "component": "vn-user-mail-forwarding",
- "description": "Mail forwarding"
- },
- {
- "url": "/aliases",
- "state": "account.card.aliases",
- "component": "vn-user-aliases",
- "description": "Mail aliases"
- },
- {
- "url": "/privileges",
- "state": "account.card.privileges",
- "component": "vn-user-privileges",
- "description": "Privileges",
- "params": {
- "user": "$ctrl.user"
- }
- },
- {
- "url": "/role?q",
- "state": "account.role",
- "component": "vn-role",
- "description": "Roles",
- "acl": ["it"]
- },
- {
- "url": "/create",
- "state": "account.role.create",
- "component": "vn-role-create",
- "description": "New role",
- "acl": ["it"]
- },
- {
- "url": "/:id",
- "state": "account.role.card",
- "component": "vn-role-card",
- "abstract": true,
- "description": "Detail"
- },
- {
- "url": "/summary",
- "state": "account.role.card.summary",
- "component": "vn-role-summary",
- "description": "Summary",
- "params": {
- "role": "$ctrl.role"
- },
- "acl": ["it"]
- },
- {
- "url": "/basic-data",
- "state": "account.role.card.basicData",
- "component": "vn-role-basic-data",
- "description": "Basic data",
- "params": {
- "role": "$ctrl.role"
- },
- "acl": ["it"]
- },
- {
- "url": "/subroles",
- "state": "account.role.card.subroles",
- "component": "vn-role-subroles",
- "description": "Subroles",
- "acl": ["it"]
- },
- {
- "url": "/inherited",
- "state": "account.role.card.inherited",
- "component": "vn-role-inherited",
- "description": "Inherited roles",
- "acl": ["it"]
- },
- {
- "url": "/alias?q",
- "state": "account.alias",
- "component": "vn-alias",
- "description": "Mail aliases"
- },
- {
- "url": "/create",
- "state": "account.alias.create",
- "component": "vn-alias-create",
- "description": "New alias"
- },
- {
- "url": "/:id",
- "state": "account.alias.card",
- "component": "vn-alias-card",
- "abstract": true,
- "description": "Detail"
- },
- {
- "url": "/summary",
- "state": "account.alias.card.summary",
- "component": "vn-alias-summary",
- "description": "Summary",
- "params": {
- "alias": "$ctrl.alias"
- }
- },
- {
- "url": "/basic-data",
- "state": "account.alias.card.basicData",
- "component": "vn-alias-basic-data",
- "description": "Basic data",
- "params": {
- "alias": "$ctrl.alias"
- }
- },
- {
- "url": "/users",
- "state": "account.alias.card.users",
- "component": "vn-alias-users",
- "description": "Users",
- "acl": ["it"]
- },
- {
- "url": "/accounts",
- "state": "account.accounts",
- "component": "vn-account-accounts",
- "description": "Accounts",
- "acl": ["sysadmin"]
- },
- {
- "url": "/ldap",
- "state": "account.ldap",
- "component": "vn-account-ldap",
- "description": "LDAP",
- "acl": ["sysadmin"]
- },
- {
- "url": "/samba",
- "state": "account.samba",
- "component": "vn-account-samba",
- "description": "Samba",
- "acl": ["sysadmin"]
- },
- {
- "url": "/acl?q",
- "state": "account.acl",
- "component": "vn-acl-component",
- "description": "ACLs",
- "acl": ["developer"]
- },
- {
- "url": "/create",
- "state": "account.acl.create",
- "component": "vn-acl-create",
- "description": "New ACL",
- "acl": ["developer"]
- },
- {
- "url": "/:id/edit",
- "state": "account.acl.edit",
- "component": "vn-acl-create",
- "description": "Edit ACL",
- "acl": ["developer"]
- },
- {
- "url": "/connections",
- "state": "account.connections",
- "component": "vn-connections",
- "description": "Connections",
- "acl": ["developer"]
}
]
}
diff --git a/modules/account/front/samba/index.html b/modules/account/front/samba/index.html
deleted file mode 100644
index 0186cac7c8..0000000000
--- a/modules/account/front/samba/index.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
diff --git a/modules/account/front/samba/index.js b/modules/account/front/samba/index.js
deleted file mode 100644
index 6a49698933..0000000000
--- a/modules/account/front/samba/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- onTestConection() {
- this.$http.get(`SambaConfigs/test`)
- .then(() => this.vnApp.showSuccess(this.$t('Samba connection established!')));
- }
-}
-
-ngModule.component('vnAccountSamba', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/account/front/samba/locale/es.yml b/modules/account/front/samba/locale/es.yml
deleted file mode 100644
index efa3b15979..0000000000
--- a/modules/account/front/samba/locale/es.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-Enable synchronization: Habilitar sincronización
-Domain controller: Controlador de dominio
-AD domain: Dominio AD
-AD user: Usuario AD
-AD password: Contraseña AD
-User DN (without domain part): DN usuarios (sin la parte del dominio)
-Verify certificate: Verificar certificado
-Test connection: Probar conexión
-Samba connection established!: ¡Conexión con Samba establecida!
diff --git a/modules/account/front/search-panel/index.html b/modules/account/front/search-panel/index.html
deleted file mode 100644
index a539d96576..0000000000
--- a/modules/account/front/search-panel/index.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
diff --git a/modules/account/front/search-panel/index.js b/modules/account/front/search-panel/index.js
deleted file mode 100644
index fff3bf7b9c..0000000000
--- a/modules/account/front/search-panel/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import ngModule from '../module';
-import SearchPanel from 'core/components/searchbar/search-panel';
-
-ngModule.component('vnUserSearchPanel', {
- template: require('./index.html'),
- controller: SearchPanel
-});
diff --git a/modules/account/front/summary/index.html b/modules/account/front/summary/index.html
index 41632aef69..f3c11f25f3 100644
--- a/modules/account/front/summary/index.html
+++ b/modules/account/front/summary/index.html
@@ -1,6 +1,6 @@
\ No newline at end of file
+
diff --git a/modules/account/front/user-log/index.html b/modules/account/front/user-log/index.html
deleted file mode 100644
index 5a77ed7b9f..0000000000
--- a/modules/account/front/user-log/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/modules/account/front/user-log/index.js b/modules/account/front/user-log/index.js
deleted file mode 100644
index 7cd0bb378d..0000000000
--- a/modules/account/front/user-log/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-ngModule.vnComponent('vnUserLog', {
- template: require('./index.html'),
- controller: Section,
-});
diff --git a/modules/claim/front/main/index.js b/modules/claim/front/main/index.js
index cbbbe0c7e7..c921d5a128 100644
--- a/modules/claim/front/main/index.js
+++ b/modules/claim/front/main/index.js
@@ -7,7 +7,7 @@ export default class Claim extends ModuleMain {
}
async $onInit() {
this.$state.go('home');
- window.location.href = await this.vnApp.getUrl(`Claim/`);
+ window.location.href = await this.vnApp.getUrl(`claim/`);
}
}
diff --git a/modules/client/back/methods/defaulter/filter.js b/modules/client/back/methods/defaulter/filter.js
index 40756b2369..9f19dee0ae 100644
--- a/modules/client/back/methods/defaulter/filter.js
+++ b/modules/client/back/methods/defaulter/filter.js
@@ -83,9 +83,14 @@ module.exports = Self => {
LEFT JOIN account.user u ON u.id = c.salesPersonFk
LEFT JOIN account.user uw ON uw.id = co.workerFk
LEFT JOIN (
- SELECT MAX(started), clientFk, finished
- FROM recovery
- GROUP BY clientFk
+ SELECT r1.started, r1.clientFk, r1.finished
+ FROM recovery r1
+ JOIN (
+ SELECT MAX(started) AS maxStarted, clientFk
+ FROM recovery
+ GROUP BY clientFk
+ ) r2 ON r1.clientFk = r2.clientFk
+ AND r1.started = r2.maxStarted
) r ON r.clientFk = c.id
LEFT JOIN workerDepartment wd ON wd.workerFk = u.id
JOIN department dp ON dp.id = wd.departmentFk
diff --git a/modules/client/back/models/client-sample.js b/modules/client/back/models/client-sample.js
index 5e43930422..b8ab6cff4f 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 ec189f089b..b481e7c72d 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 e2f2cd27b4..1ee18737f3 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 114e2b5702..605ae08cca 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/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js
index dcb1e31586..776544bc6a 100644
--- a/modules/entry/back/methods/entry/filter.js
+++ b/modules/entry/back/methods/entry/filter.js
@@ -109,6 +109,11 @@ module.exports = Self => {
arg: 'days',
type: 'number',
description: `N days interval`
+ },
+ {
+ arg: 'invoiceAmount',
+ type: 'number',
+ description: `The invoice amount`
}
],
returns: {
@@ -192,6 +197,7 @@ module.exports = Self => {
e.companyFk,
e.gestDocFk,
e.invoiceInFk,
+ e.invoiceAmount,
t.landed,
s.name supplierName,
s.nickname supplierAlias,
diff --git a/modules/entry/back/models/entry.json b/modules/entry/back/models/entry.json
index 833edf14d8..383585fce1 100644
--- a/modules/entry/back/models/entry.json
+++ b/modules/entry/back/models/entry.json
@@ -74,6 +74,9 @@
},
"observationEditorFk": {
"type": "number"
+ },
+ "invoiceAmount": {
+ "type": "number"
}
},
"relations": {
@@ -108,4 +111,4 @@
"foreignKey": "typeFk"
}
}
-}
\ No newline at end of file
+}
diff --git a/modules/invoiceIn/back/methods/invoice-in/filter.js b/modules/invoiceIn/back/methods/invoice-in/filter.js
index d72d7fc638..8a884e2112 100644
--- a/modules/invoiceIn/back/methods/invoice-in/filter.js
+++ b/modules/invoiceIn/back/methods/invoice-in/filter.js
@@ -119,6 +119,7 @@ module.exports = Self => {
}
let correctings;
+
let correcteds;
if (args.correctedFk) {
correctings = await models.InvoiceInCorrection.find({
@@ -154,6 +155,7 @@ module.exports = Self => {
case 'awbCode':
return {'sub.code': value};
case 'correctingFk':
+ if (!correcteds.length && !args.correctingFk) return;
return args.correctingFk
? {'ii.id': {inq: correcteds.map(x => x.correctingFk)}}
: {'ii.id': {nin: correcteds.map(x => x.correctingFk)}};
diff --git a/modules/invoiceIn/back/methods/invoice-in/getSerial.js b/modules/invoiceIn/back/methods/invoice-in/getSerial.js
index dcc1fbc3cf..29c7cae2f4 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/invoiceIn/front/basic-data/index.html b/modules/invoiceIn/front/basic-data/index.html
deleted file mode 100644
index fbb9b05a20..0000000000
--- a/modules/invoiceIn/front/basic-data/index.html
+++ /dev/null
@@ -1,315 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/invoiceIn/front/basic-data/index.js b/modules/invoiceIn/front/basic-data/index.js
deleted file mode 100644
index 246f1b16fd..0000000000
--- a/modules/invoiceIn/front/basic-data/index.js
+++ /dev/null
@@ -1,187 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-import UserError from 'core/lib/user-error';
-
-class Controller extends Section {
- constructor($element, $, vnFile) {
- super($element, $, vnFile);
- this.dms = {
- files: [],
- hasFile: false,
- hasFileAttached: false
- };
- this.vnFile = vnFile;
- this.getAllowedContentTypes();
- this._editDownloadDisabled = false;
- }
-
- get contentTypesInfo() {
- return this.$t('ContentTypesInfo', {
- allowedContentTypes: this.allowedContentTypes
- });
- }
-
- get editDownloadDisabled() {
- return this._editDownloadDisabled;
- }
-
- async checkFileExists(dmsId) {
- if (!dmsId) return;
- let filter = {
- fields: ['id']
- };
- await this.$http.get(`Dms/${dmsId}`, {filter})
- .then(() => this._editDownloadDisabled = false)
- .catch(() => this._editDownloadDisabled = true);
- }
-
- async getFile(dmsId) {
- const path = `Dms/${dmsId}`;
- await this.$http.get(path).then(res => {
- const dms = res.data && res.data;
- this.dms = {
- dmsId: dms.id,
- reference: dms.reference,
- warehouseId: dms.warehouseFk,
- companyId: dms.companyFk,
- dmsTypeId: dms.dmsTypeFk,
- description: dms.description,
- hasFile: dms.hasFile,
- hasFileAttached: false,
- files: []
- };
- });
- }
-
- getAllowedContentTypes() {
- this.$http.get('DmsContainers/allowedContentTypes').then(res => {
- if (res.data.length > 0) {
- const contentTypes = res.data.join(', ');
- this.allowedContentTypes = contentTypes;
- }
- });
- }
-
- openEditDialog(dmsId) {
- this.getFile(dmsId).then(() => this.$.dmsEditDialog.show());
- }
-
- openCreateDialog() {
- const params = {filter: {
- where: {code: 'invoiceIn'}
- }};
- this.$http.get('DmsTypes/findOne', {params}).then(res => {
- this.dms = {
- reference: this.invoiceIn.supplierRef,
- warehouseId: this.vnConfig.warehouseFk,
- companyId: this.vnConfig.companyFk,
- dmsTypeId: res.data.id,
- description: this.invoiceIn.supplier.name,
- hasFile: true,
- hasFileAttached: true,
- files: null
- };
- this.$.dmsCreateDialog.show();
- });
- }
-
- downloadFile(dmsId) {
- this.vnFile.download(`api/dms/${dmsId}/downloadFile`);
- }
-
- onFileChange(files) {
- let hasFileAttached = false;
- if (files.length > 0)
- hasFileAttached = true;
-
- this.$.$applyAsync(() => {
- this.dms.hasFileAttached = hasFileAttached;
- });
- }
-
- onEdit() {
- if (!this.dms.companyId)
- throw new UserError(`The company can't be empty`);
- if (!this.dms.warehouseId)
- throw new UserError(`The warehouse can't be empty`);
- if (!this.dms.dmsTypeId)
- throw new UserError(`The DMS Type can't be empty`);
- if (!this.dms.description)
- throw new UserError(`The description can't be empty`);
-
- const query = `dms/${this.dms.dmsId}/updateFile`;
- const options = {
- method: 'POST',
- url: query,
- params: this.dms,
- headers: {
- 'Content-Type': undefined
- },
- transformRequest: files => {
- const formData = new FormData();
-
- for (let i = 0; i < files.length; i++)
- formData.append(files[i].name, files[i]);
-
- return formData;
- },
- data: this.dms.files
- };
-
- this.$http(options).then(res => {
- if (res) {
- this.vnApp.showSuccess(this.$t('Data saved!'));
- if (res.data.length > 0) this.invoiceIn.dmsFk = res.data[0].id;
- }
- });
- }
-
- onCreate() {
- if (!this.dms.companyId)
- throw new UserError(`The company can't be empty`);
- if (!this.dms.warehouseId)
- throw new UserError(`The warehouse can't be empty`);
- if (!this.dms.dmsTypeId)
- throw new UserError(`The DMS Type can't be empty`);
- if (!this.dms.description)
- throw new UserError(`The description can't be empty`);
- if (!this.dms.files)
- throw new UserError(`The files can't be empty`);
-
- const query = `Dms/uploadFile`;
- const options = {
- method: 'POST',
- url: query,
- params: this.dms,
- headers: {
- 'Content-Type': undefined
- },
- transformRequest: files => {
- const formData = new FormData();
-
- for (let i = 0; i < files.length; i++)
- formData.append(files[i].name, files[i]);
-
- return formData;
- },
- data: this.dms.files
- };
-
- this.$http(options).then(res => {
- if (res) {
- this.vnApp.showSuccess(this.$t('Data saved!'));
- if (res.data.length > 0) this.invoiceIn.dmsFk = res.data[0].id;
- }
- });
- }
-}
-
-Controller.$inject = ['$element', '$scope', 'vnFile'];
-
-ngModule.vnComponent('vnInvoiceInBasicData', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- invoiceIn: '<'
- }
-});
diff --git a/modules/invoiceIn/front/basic-data/index.spec.js b/modules/invoiceIn/front/basic-data/index.spec.js
deleted file mode 100644
index 98710ac357..0000000000
--- a/modules/invoiceIn/front/basic-data/index.spec.js
+++ /dev/null
@@ -1,102 +0,0 @@
-import './index.js';
-import watcher from 'core/mocks/watcher';
-
-describe('InvoiceIn', () => {
- describe('Component vnInvoiceInBasicData', () => {
- let controller;
- let $scope;
- let $httpBackend;
- let $httpParamSerializer;
-
- beforeEach(ngModule('invoiceIn'));
-
- beforeEach(inject(($componentController, $rootScope, _$httpBackend_, _$httpParamSerializer_) => {
- $scope = $rootScope.$new();
- $httpBackend = _$httpBackend_;
- $httpParamSerializer = _$httpParamSerializer_;
- const $element = angular.element('');
- controller = $componentController('vnInvoiceInBasicData', {$element, $scope});
- controller.$.watcher = watcher;
- $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond({});
- }));
-
- describe('onFileChange()', () => {
- it('should set dms hasFileAttached property to true if has any files', () => {
- const files = [{id: 1, name: 'MyFile'}];
- controller.onFileChange(files);
-
- $scope.$apply();
-
- expect(controller.dms.hasFileAttached).toBeTruthy();
- });
- });
-
- describe('checkFileExists()', () => {
- it(`should return false if a file exists`, () => {
- const fileIdExists = 1;
- controller.checkFileExists(fileIdExists);
-
- expect(controller.editDownloadDisabled).toBe(false);
- });
- });
-
- describe('onEdit()', () => {
- it(`should perform a POST query to edit the dms properties`, () => {
- jest.spyOn(controller.vnApp, 'showSuccess');
-
- const dms = {
- dmsId: 1,
- reference: 'Ref1',
- warehouseId: 1,
- companyId: 442,
- dmsTypeId: 20,
- description: 'This is a description',
- files: []
- };
-
- controller.dms = dms;
- const serializedParams = $httpParamSerializer(controller.dms);
- const query = `dms/${controller.dms.dmsId}/updateFile?${serializedParams}`;
-
- $httpBackend.expectPOST(query).respond({});
- controller.onEdit();
- $httpBackend.flush();
-
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-
- describe('onCreate()', () => {
- it(`should perform a POST query to create a new dms`, () => {
- jest.spyOn(controller.vnApp, 'showSuccess');
-
- const dms = {
- reference: 'Ref1',
- warehouseId: 1,
- companyId: 442,
- dmsTypeId: 20,
- description: 'This is a description',
- files: [{
- lastModified: 1668673957761,
- lastModifiedDate: Date.vnNew(),
- name: 'file-example.png',
- size: 19653,
- type: 'image/png',
- webkitRelativePath: ''
- }]
- };
-
- controller.dms = dms;
- const serializedParams = $httpParamSerializer(controller.dms);
- const query = `Dms/uploadFile?${serializedParams}`;
-
- $httpBackend.expectPOST(query).respond({});
- controller.onCreate();
- $httpBackend.flush();
-
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
- });
-});
-
diff --git a/modules/invoiceIn/front/basic-data/locale/en.yml b/modules/invoiceIn/front/basic-data/locale/en.yml
deleted file mode 100644
index 19f4dc8c29..0000000000
--- a/modules/invoiceIn/front/basic-data/locale/en.yml
+++ /dev/null
@@ -1 +0,0 @@
-ContentTypesInfo: Allowed file types {{allowedContentTypes}}
diff --git a/modules/invoiceIn/front/basic-data/locale/es.yml b/modules/invoiceIn/front/basic-data/locale/es.yml
deleted file mode 100644
index e2e494fa50..0000000000
--- a/modules/invoiceIn/front/basic-data/locale/es.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-Upload file: Subir fichero
-Edit file: Editar fichero
-Upload: Subir
-Document: Documento
-ContentTypesInfo: "Tipos de archivo permitidos: {{allowedContentTypes}}"
-Generate identifier for original file: Generar identificador para archivo original
-File management: Gestión documental
-Hard copy: Copia
-This file will be deleted: Este fichero va a ser borrado
-Are you sure?: Estas seguro?
-File deleted: Fichero eliminado
-Remove file: Eliminar fichero
-Download file: Descargar fichero
-Edit document: Editar documento
-Create document: Crear documento
diff --git a/modules/invoiceIn/front/create/index.html b/modules/invoiceIn/front/create/index.html
deleted file mode 100644
index 16ecf26cf6..0000000000
--- a/modules/invoiceIn/front/create/index.html
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/modules/invoiceIn/front/create/index.js b/modules/invoiceIn/front/create/index.js
deleted file mode 100644
index 885d55359b..0000000000
--- a/modules/invoiceIn/front/create/index.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-class Controller extends Section {
- $onInit() {
- this.invoiceIn = {};
- if (this.$params && this.$params.supplierFk)
- this.invoiceIn.supplierFk = this.$params.supplierFk;
- this.invoiceIn.issued = Date.vnNew();
- }
-
- get companyFk() {
- return this.invoiceIn.companyFk || this.vnConfig.companyFk;
- }
-
- set companyFk(value) {
- this.invoiceIn.companyFk = value;
- }
-
- onSubmit() {
- this.$.watcher.submit().then(
- res => this.$state.go('invoiceIn.card.basicData', {id: res.data.id})
- );
- }
-}
-
-ngModule.vnComponent('vnInvoiceInCreate', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/invoiceIn/front/create/locale/es.yml b/modules/invoiceIn/front/create/locale/es.yml
deleted file mode 100644
index 35bfe3ca49..0000000000
--- a/modules/invoiceIn/front/create/locale/es.yml
+++ /dev/null
@@ -1 +0,0 @@
-a:a
\ No newline at end of file
diff --git a/modules/invoiceIn/front/dueDay/index.html b/modules/invoiceIn/front/dueDay/index.html
deleted file mode 100644
index abc91312d0..0000000000
--- a/modules/invoiceIn/front/dueDay/index.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/invoiceIn/front/dueDay/index.js b/modules/invoiceIn/front/dueDay/index.js
deleted file mode 100644
index ee9b13e5c3..0000000000
--- a/modules/invoiceIn/front/dueDay/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-class Controller extends Section {
- add() {
- this.$.model.insert({
- dueDated: Date.vnNew(),
- bankFk: this.vnConfig.local.bankFk
- });
- }
-
- onSubmit() {
- this.$.watcher.check();
- this.$.model.save().then(() => {
- this.$.watcher.notifySaved();
- this.$.watcher.updateOriginalData();
- this.card.reload();
- });
- }
-
- bankSearchFunc($search) {
- return /^\d+$/.test($search)
- ? {id: $search}
- : {bank: {like: '%' + $search + '%'}};
- }
-}
-
-ngModule.vnComponent('vnInvoiceInDueDay', {
- template: require('./index.html'),
- controller: Controller,
- require: {
- card: '^vnInvoiceInCard'
- },
- bindings: {
- invoiceIn: '<'
- }
-});
diff --git a/modules/invoiceIn/front/dueDay/index.spec.js b/modules/invoiceIn/front/dueDay/index.spec.js
deleted file mode 100644
index 7dddd3bb01..0000000000
--- a/modules/invoiceIn/front/dueDay/index.spec.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import './index.js';
-import watcher from 'core/mocks/watcher';
-import crudModel from 'core/mocks/crud-model';
-
-describe('InvoiceIn', () => {
- describe('Component due day', () => {
- let controller;
- let $scope;
- let vnApp;
-
- beforeEach(ngModule('invoiceIn'));
-
- beforeEach(inject(($componentController, $rootScope, _vnApp_) => {
- vnApp = _vnApp_;
- jest.spyOn(vnApp, 'showError');
- $scope = $rootScope.$new();
- $scope.model = crudModel;
- $scope.watcher = watcher;
-
- const $element = angular.element('');
- controller = $componentController('vnInvoiceInDueDay', {$element, $scope});
- controller.invoiceIn = {id: 1};
- }));
-
- describe('onSubmit()', () => {
- it('should make HTTP POST request to save due day values', () => {
- controller.card = {reload: () => {}};
- jest.spyOn($scope.watcher, 'check');
- jest.spyOn($scope.watcher, 'notifySaved');
- jest.spyOn($scope.watcher, 'updateOriginalData');
- jest.spyOn(controller.card, 'reload');
- jest.spyOn($scope.model, 'save');
-
- controller.onSubmit();
-
- expect($scope.model.save).toHaveBeenCalledWith();
- expect($scope.watcher.updateOriginalData).toHaveBeenCalledWith();
- expect($scope.watcher.check).toHaveBeenCalledWith();
- expect($scope.watcher.notifySaved).toHaveBeenCalledWith();
- expect(controller.card.reload).toHaveBeenCalledWith();
- });
- });
- });
-});
diff --git a/modules/invoiceIn/front/index.js b/modules/invoiceIn/front/index.js
index e257cfee38..8155e70897 100644
--- a/modules/invoiceIn/front/index.js
+++ b/modules/invoiceIn/front/index.js
@@ -1,17 +1,7 @@
export * from './module';
import './main';
-import './index/';
-import './search-panel';
import './card';
import './descriptor';
import './descriptor-popover';
import './summary';
-import './basic-data';
-import './tax';
-import './dueDay';
-import './intrastat';
-import './create';
-import './log';
-import './serial';
-import './serial-search-panel';
diff --git a/modules/invoiceIn/front/index/index.html b/modules/invoiceIn/front/index/index.html
deleted file mode 100644
index 008d615b15..0000000000
--- a/modules/invoiceIn/front/index/index.html
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
- ID
- Supplier
- Supplier ref.
- Serial number
- Serial
- File
- Issued
- Is booked
- AWB
- Amount
-
-
-
-
-
- {{::invoiceIn.id}}
-
-
- {{::invoiceIn.supplierName}}
-
-
- {{::invoiceIn.supplierRef | dashIfEmpty}}
- {{::invoiceIn.serialNumber}}
- {{::invoiceIn.serial}}
-
-
- {{::invoiceIn.file}}
-
-
- {{::invoiceIn.issued | date:'dd/MM/yyyy' | dashIfEmpty}}
-
-
-
-
- {{::invoiceIn.awbCode}}
- {{::invoiceIn.amount | currency:'EUR'}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/invoiceIn/front/index/index.js b/modules/invoiceIn/front/index/index.js
deleted file mode 100644
index 254e6d3bf9..0000000000
--- a/modules/invoiceIn/front/index/index.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- constructor($element, $, vnFile) {
- super($element, $, vnFile);
- this.vnFile = vnFile;
- }
-
- exprBuilder(param, value) {
- switch (param) {
- case 'issued':
- return {'ii.issued': {
- between: this.dateRange(value)}
- };
- case 'id':
- case 'supplierFk':
- case 'supplierRef':
- case 'serialNumber':
- case 'serial':
- case 'created':
- case 'isBooked':
- return {[`ii.${param}`]: value};
- case 'account':
- case 'fi':
- return {[`s.${param}`]: value};
- case 'awbCode':
- return {'awb.code': value};
- default:
- return {[param]: value};
- }
- }
-
- dateRange(value) {
- const minHour = new Date(value);
- minHour.setHours(0, 0, 0, 0);
- const maxHour = new Date(value);
- maxHour.setHours(23, 59, 59, 59);
-
- return [minHour, maxHour];
- }
-
- preview(invoiceIn) {
- this.selectedInvoiceIn = invoiceIn;
- this.$.summary.show();
- }
-
- downloadFile(dmsId) {
- this.vnFile.download(`api/dms/${dmsId}/downloadFile`);
- }
-}
-
-Controller.$inject = ['$element', '$scope', 'vnFile'];
-
-ngModule.vnComponent('vnInvoiceInIndex', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/invoiceIn/front/index/locale/es.yml b/modules/invoiceIn/front/index/locale/es.yml
deleted file mode 100644
index e1b3543160..0000000000
--- a/modules/invoiceIn/front/index/locale/es.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-Created: Fecha creación
-Issued: Fecha emisión
-Supplier ref.: Ref. proveedor
-Serial number: Num. serie
-Serial: Serie
-Is booked: Conciliada
\ No newline at end of file
diff --git a/modules/invoiceIn/front/intrastat/index.html b/modules/invoiceIn/front/intrastat/index.html
deleted file mode 100644
index b15fdf5431..0000000000
--- a/modules/invoiceIn/front/intrastat/index.html
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/invoiceIn/front/intrastat/index.js b/modules/invoiceIn/front/intrastat/index.js
deleted file mode 100644
index 6599295135..0000000000
--- a/modules/invoiceIn/front/intrastat/index.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-class Controller extends Section {
- set invoceInIntrastat(value) {
- this._invoceInIntrastat = value;
-
- if (value) this.calculateTotals();
- }
-
- get invoceInIntrastat() {
- return this._invoceInIntrastat;
- }
-
- calculateTotals() {
- this.amountTotal = 0.0;
- this.netTotal = 0.0;
- this.stemsTotal = 0.0;
- if (!this.invoceInIntrastat) return;
-
- this.invoceInIntrastat.forEach(intrastat => {
- this.amountTotal += intrastat.amount;
- this.netTotal += intrastat.net;
- this.stemsTotal += intrastat.stems;
- });
- }
-
- add() {
- this.$.model.insert({});
- }
-
- deleteIntrastat($index) {
- this.$.model.remove($index);
- this.$.model.save().then(() => {
- this.vnApp.showSuccess(this.$t('Data saved!'));
- this.calculateTotals();
- });
- }
-
- onSubmit() {
- this.$.watcher.check();
- this.$.model.save().then(() => {
- this.$.watcher.notifySaved();
- this.$.watcher.updateOriginalData();
- this.calculateTotals();
- this.card.reload();
- });
- }
-}
-
-ngModule.vnComponent('vnInvoiceInIntrastat', {
- template: require('./index.html'),
- controller: Controller,
- require: {
- card: '^vnInvoiceInCard'
- },
- bindings: {
- invoiceIn: '<'
- }
-});
diff --git a/modules/invoiceIn/front/intrastat/index.spec.js b/modules/invoiceIn/front/intrastat/index.spec.js
deleted file mode 100644
index d7d50ac5bf..0000000000
--- a/modules/invoiceIn/front/intrastat/index.spec.js
+++ /dev/null
@@ -1,85 +0,0 @@
-import './index.js';
-import watcher from 'core/mocks/watcher';
-import crudModel from 'core/mocks/crud-model';
-
-describe('InvoiceIn', () => {
- describe('Component intrastat', () => {
- let controller;
- let $scope;
- let vnApp;
-
- beforeEach(ngModule('invoiceIn'));
-
- beforeEach(inject(($componentController, $rootScope, _vnApp_) => {
- vnApp = _vnApp_;
- jest.spyOn(vnApp, 'showError');
- $scope = $rootScope.$new();
- $scope.model = crudModel;
- $scope.watcher = watcher;
-
- const $element = angular.element('');
- controller = $componentController('vnInvoiceInIntrastat', {$element, $scope});
- controller.invoiceIn = {id: 1};
- }));
-
- describe('calculateTotals()', () => {
- it('should set amountTotal, netTotal and stemsTotal to 0 if salesClaimed has no data', () => {
- controller.invoceInIntrastat = [];
- controller.calculateTotals();
-
- expect(controller.amountTotal).toEqual(0);
- expect(controller.netTotal).toEqual(0);
- expect(controller.stemsTotal).toEqual(0);
- });
-
- it('should set amountTotal, netTotal and stemsTotal', () => {
- controller.invoceInIntrastat = [
- {
- id: 1,
- invoiceInFk: 1,
- net: 30.5,
- intrastatFk: 5080000,
- amount: 10,
- stems: 162,
- countryFk: 5,
- statisticalValue: 0
- },
- {
- id: 2,
- invoiceInFk: 1,
- net: 10,
- intrastatFk: 6021010,
- amount: 20,
- stems: 205,
- countryFk: 5,
- statisticalValue: 0
- }
- ];
- controller.calculateTotals();
-
- expect(controller.amountTotal).toEqual(30);
- expect(controller.netTotal).toEqual(40.5);
- expect(controller.stemsTotal).toEqual(367);
- });
- });
-
- describe('onSubmit()', () => {
- it('should make HTTP POST request to save intrastat values', () => {
- controller.card = {reload: () => {}};
- jest.spyOn($scope.watcher, 'check');
- jest.spyOn($scope.watcher, 'notifySaved');
- jest.spyOn($scope.watcher, 'updateOriginalData');
- jest.spyOn(controller.card, 'reload');
- jest.spyOn($scope.model, 'save');
-
- controller.onSubmit();
-
- expect($scope.model.save).toHaveBeenCalledWith();
- expect($scope.watcher.updateOriginalData).toHaveBeenCalledWith();
- expect($scope.watcher.check).toHaveBeenCalledWith();
- expect($scope.watcher.notifySaved).toHaveBeenCalledWith();
- expect(controller.card.reload).toHaveBeenCalledWith();
- });
- });
- });
-});
diff --git a/modules/invoiceIn/front/log/index.html b/modules/invoiceIn/front/log/index.html
deleted file mode 100644
index 2cfc9dfb1c..0000000000
--- a/modules/invoiceIn/front/log/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/modules/invoiceIn/front/log/index.js b/modules/invoiceIn/front/log/index.js
deleted file mode 100644
index 7a018de0fe..0000000000
--- a/modules/invoiceIn/front/log/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-ngModule.vnComponent('vnInvoiceInLog', {
- template: require('./index.html'),
- controller: Section,
-});
diff --git a/modules/invoiceIn/front/main/index.html b/modules/invoiceIn/front/main/index.html
index 2dc87b2eef..e69de29bb2 100644
--- a/modules/invoiceIn/front/main/index.html
+++ b/modules/invoiceIn/front/main/index.html
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/invoiceIn/front/main/index.js b/modules/invoiceIn/front/main/index.js
index f7b767458e..c22b37924b 100644
--- a/modules/invoiceIn/front/main/index.js
+++ b/modules/invoiceIn/front/main/index.js
@@ -1,7 +1,16 @@
import ngModule from '../module';
import ModuleMain from 'salix/components/module-main';
-export default class InvoiceIn extends ModuleMain {}
+export default class InvoiceIn extends ModuleMain {
+ constructor($element, $) {
+ super($element, $);
+ }
+
+ async $onInit() {
+ this.$state.go('home');
+ window.location.href = await this.vnApp.getUrl(`invoice-in/`);
+ }
+}
ngModule.vnComponent('vnInvoiceIn', {
controller: InvoiceIn,
diff --git a/modules/invoiceIn/front/search-panel/index.html b/modules/invoiceIn/front/search-panel/index.html
deleted file mode 100644
index 609fa56d8b..0000000000
--- a/modules/invoiceIn/front/search-panel/index.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
diff --git a/modules/invoiceIn/front/search-panel/index.js b/modules/invoiceIn/front/search-panel/index.js
deleted file mode 100644
index a8e41b7ef9..0000000000
--- a/modules/invoiceIn/front/search-panel/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import ngModule from '../module';
-import SearchPanel from 'core/components/searchbar/search-panel';
-
-ngModule.vnComponent('vnInvoiceInSearchPanel', {
- template: require('./index.html'),
- controller: SearchPanel
-});
diff --git a/modules/invoiceIn/front/search-panel/locale/es.yml b/modules/invoiceIn/front/search-panel/locale/es.yml
deleted file mode 100644
index 57e2944ea6..0000000000
--- a/modules/invoiceIn/front/search-panel/locale/es.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-Supplier fiscal id: CIF proveedor
-Search invoices in by id or supplier fiscal name: Buscar facturas recibidas por id o por nombre fiscal del proveedor
\ No newline at end of file
diff --git a/modules/invoiceIn/front/serial-search-panel/index.html b/modules/invoiceIn/front/serial-search-panel/index.html
deleted file mode 100644
index 0dda548524..0000000000
--- a/modules/invoiceIn/front/serial-search-panel/index.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{$ctrl.$t('Serial')}}: {{$ctrl.filter.serial}}
-
-
-
diff --git a/modules/invoiceIn/front/serial-search-panel/index.js b/modules/invoiceIn/front/serial-search-panel/index.js
deleted file mode 100644
index b11911ee3b..0000000000
--- a/modules/invoiceIn/front/serial-search-panel/index.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import ngModule from '../module';
-import SearchPanel from 'core/components/searchbar/search-panel';
-import './style.scss';
-
-class Controller extends SearchPanel {
- constructor($element, $) {
- super($element, $);
- this.filter = {};
- const filter = {
- fields: ['daysAgo']
- };
- this.$http.get('InvoiceInConfigs', {filter}).then(res => {
- if (res.data) {
- this.invoiceInConfig = res.data[0];
- this.addFilters();
- }
- });
- }
-
- removeItemFilter(param) {
- this.filter[param] = null;
- this.addFilters();
- }
-
- onKeyPress($event) {
- if ($event.key === 'Enter')
- this.addFilters();
- }
-
- addFilters() {
- if (!this.filter.daysAgo)
- this.filter.daysAgo = this.invoiceInConfig.daysAgo;
-
- return this.model.addFilter({}, this.filter);
- }
-}
-
-ngModule.component('vnInvoiceInSerialSearchPanel', {
- template: require('./index.html'),
- controller: Controller,
- bindings: {
- model: '<'
- }
-});
diff --git a/modules/invoiceIn/front/serial-search-panel/index.spec.js b/modules/invoiceIn/front/serial-search-panel/index.spec.js
deleted file mode 100644
index b5228e126a..0000000000
--- a/modules/invoiceIn/front/serial-search-panel/index.spec.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import './index.js';
-
-describe('InvoiceIn', () => {
- describe('Component serial-search-panel', () => {
- let controller;
- let $scope;
-
- beforeEach(ngModule('invoiceIn'));
-
- beforeEach(inject(($componentController, $rootScope) => {
- $scope = $rootScope.$new();
- const $element = angular.element('');
- controller = $componentController('vnInvoiceInSerialSearchPanel', {$element, $scope});
- controller.model = {
- addFilter: jest.fn(),
- };
- controller.invoiceInConfig = {
- daysAgo: 45,
- };
- }));
-
- describe('addFilters()', () => {
- it('should add default daysAgo if it is not already set', () => {
- controller.filter = {
- serial: 'R',
- };
- controller.addFilters();
-
- expect(controller.filter.daysAgo).toEqual(controller.invoiceInConfig.daysAgo);
- });
-
- it('should not add default daysAgo if it is already set', () => {
- controller.filter = {
- daysAgo: 1,
- serial: 'R',
- };
- controller.addFilters();
-
- expect(controller.filter.daysAgo).toEqual(1);
- });
- });
- });
-});
diff --git a/modules/invoiceIn/front/serial-search-panel/style.scss b/modules/invoiceIn/front/serial-search-panel/style.scss
deleted file mode 100644
index 4abfcbfa2c..0000000000
--- a/modules/invoiceIn/front/serial-search-panel/style.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-@import "variables";
-
-vn-invoice-in-serial-search-panel vn-side-menu div {
- & > .input {
- padding-left: $spacing-md;
- padding-right: $spacing-md;
- border-color: $color-spacer;
- border-bottom: $border-thin;
- }
- & > .horizontal {
- grid-auto-flow: column;
- grid-column-gap: $spacing-sm;
- align-items: center;
- }
- & > .chips {
- display: flex;
- flex-wrap: wrap;
- padding: $spacing-md;
- overflow: hidden;
- max-width: 100%;
- border-color: $color-spacer;
- border-top: $border-thin;
- }
-}
diff --git a/modules/invoiceIn/front/serial/index.html b/modules/invoiceIn/front/serial/index.html
deleted file mode 100644
index 1649ec7d72..0000000000
--- a/modules/invoiceIn/front/serial/index.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- Serial
- Pending
- Total
-
-
-
-
-
- {{::invoiceIn.serial}}
- {{::invoiceIn.pending}}
- {{::invoiceIn.total}}
-
-
-
-
-
-
-
-
-
diff --git a/modules/invoiceIn/front/serial/index.js b/modules/invoiceIn/front/serial/index.js
deleted file mode 100644
index 193a574922..0000000000
--- a/modules/invoiceIn/front/serial/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
- constructor($element, $) {
- super($element, $);
- }
-
- goToIndex(daysAgo, serial) {
- const issued = Date.vnNew();
- issued.setDate(issued.getDate() - daysAgo);
- this.$state.go('invoiceIn.index',
- {q: `{"serial": "${serial}", "isBooked": false, "from": ${issued.getTime()}}`});
- }
-}
-
-Controller.$inject = ['$element', '$scope'];
-
-ngModule.vnComponent('vnInvoiceInSerial', {
- template: require('./index.html'),
- controller: Controller
-});
diff --git a/modules/invoiceIn/front/serial/locale/es.yml b/modules/invoiceIn/front/serial/locale/es.yml
deleted file mode 100644
index 92a49cc829..0000000000
--- a/modules/invoiceIn/front/serial/locale/es.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-Serial: Serie
-Pending: Pendientes
-Go to InvoiceIn: Ir al listado de facturas recibidas
diff --git a/modules/invoiceIn/front/tax/index.html b/modules/invoiceIn/front/tax/index.html
deleted file mode 100644
index e13f769ce0..0000000000
--- a/modules/invoiceIn/front/tax/index.html
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{$ctrl.$t('New expense')}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/invoiceIn/front/tax/index.js b/modules/invoiceIn/front/tax/index.js
deleted file mode 100644
index d05a77f29f..0000000000
--- a/modules/invoiceIn/front/tax/index.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-import UserError from 'core/lib/user-error';
-
-class Controller extends Section {
- constructor($element, $, vnWeekDays) {
- super($element, $);
- this.expense = {};
- }
- taxRate(invoiceInTax, taxRateSelection) {
- const taxTypeSage = taxRateSelection && taxRateSelection.rate;
- const taxableBase = invoiceInTax && invoiceInTax.taxableBase;
-
- if (taxTypeSage && taxableBase)
- return (taxTypeSage / 100) * taxableBase;
-
- return 0;
- }
-
- add() {
- this.$.model.insert({
- invoiceIn: this.$params.id
- });
- }
-
- onSubmit() {
- this.$.watcher.check();
- this.$.model.save().then(() => {
- this.$.watcher.notifySaved();
- this.$.watcher.updateOriginalData();
- this.card.reload();
- });
- }
-
- onResponse() {
- try {
- if (!this.expense.code)
- throw new Error(`The code can't be empty`);
- if (!this.expense.description)
- throw new UserError(`The description can't be empty`);
-
- const data = [{
- id: this.expense.code,
- isWithheld: this.expense.isWithheld,
- name: this.expense.description
- }];
-
- this.$http.post(`Expenses`, data) .then(() => {
- this.vnApp.showSuccess(this.$t('Expense saved!'));
- });
- } catch (e) {
- this.vnApp.showError(this.$t(e.message));
- }
- }
-}
-
-ngModule.vnComponent('vnInvoiceInTax', {
- template: require('./index.html'),
- controller: Controller,
- require: {
- card: '^vnInvoiceInCard'
- },
- bindings: {
- invoiceIn: '<'
- }
-});
diff --git a/modules/invoiceIn/front/tax/index.spec.js b/modules/invoiceIn/front/tax/index.spec.js
deleted file mode 100644
index 52114afe54..0000000000
--- a/modules/invoiceIn/front/tax/index.spec.js
+++ /dev/null
@@ -1,113 +0,0 @@
-import './index.js';
-import watcher from 'core/mocks/watcher';
-import crudModel from 'core/mocks/crud-model';
-
-describe('InvoiceIn', () => {
- describe('Component tax', () => {
- let controller;
- let $scope;
- let vnApp;
- let $httpBackend;
-
- beforeEach(ngModule('invoiceIn'));
-
- beforeEach(inject(($componentController, $rootScope, _vnApp_, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- vnApp = _vnApp_;
- jest.spyOn(vnApp, 'showError');
- $scope = $rootScope.$new();
- $scope.model = crudModel;
- $scope.watcher = watcher;
-
- const $element = angular.element('');
- controller = $componentController('vnInvoiceInTax', {$element, $scope});
- controller.$.model = crudModel;
- controller.invoiceIn = {id: 1};
- }));
-
- describe('taxRate()', () => {
- it('should set tax rate with the Sage tax type value', () => {
- const taxRateSelection = {
- rate: 21
- };
- const invoiceInTax = {
- taxableBase: 200
- };
-
- const taxRate = controller.taxRate(invoiceInTax, taxRateSelection);
-
- expect(taxRate).toEqual(42);
- });
- });
-
- describe('onSubmit()', () => {
- it('should make HTTP POST request to save tax values', () => {
- controller.card = {reload: () => {}};
- jest.spyOn($scope.watcher, 'check');
- jest.spyOn($scope.watcher, 'notifySaved');
- jest.spyOn($scope.watcher, 'updateOriginalData');
- jest.spyOn(controller.card, 'reload');
- jest.spyOn($scope.model, 'save');
-
- controller.onSubmit();
-
- expect($scope.model.save).toHaveBeenCalledWith();
- expect($scope.watcher.updateOriginalData).toHaveBeenCalledWith();
- expect($scope.watcher.check).toHaveBeenCalledWith();
- expect($scope.watcher.notifySaved).toHaveBeenCalledWith();
- expect(controller.card.reload).toHaveBeenCalledWith();
- });
- });
-
- describe('onResponse()', () => {
- it('should return success message', () => {
- controller.expense = {
- code: 7050000005,
- isWithheld: 0,
- description: 'Test'
- };
-
- const data = [{
- id: controller.expense.code,
- isWithheld: controller.expense.isWithheld,
- name: controller.expense.description
- }];
-
- jest.spyOn(controller.vnApp, 'showSuccess');
- $httpBackend.expect('POST', `Expenses`, data).respond();
-
- controller.onResponse();
- $httpBackend.flush();
-
- expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Expense saved!');
- });
-
- it('should return an error if code is empty', () => {
- controller.expense = {
- code: null,
- isWithheld: 0,
- description: 'Test'
- };
-
- jest.spyOn(controller.vnApp, 'showError');
- controller.onResponse();
-
- expect(controller.vnApp.showError).toHaveBeenCalledWith(`The code can't be empty`);
- });
-
- it('should return an error if description is empty', () => {
- controller.expense = {
- code: 7050000005,
- isWithheld: 0,
- description: null
- };
-
- jest.spyOn(controller.vnApp, 'showError');
- controller.onResponse();
-
- expect(controller.vnApp.showError).toHaveBeenCalledWith(`The description can't be empty`);
- });
- });
- });
-});
-
diff --git a/modules/invoiceIn/front/tax/locale/es.yml b/modules/invoiceIn/front/tax/locale/es.yml
deleted file mode 100644
index 3ff68ea402..0000000000
--- a/modules/invoiceIn/front/tax/locale/es.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-Create expense: Crear gasto
-New expense: Nuevo gasto
-It's a withholding: Es una retención
-The fields can't be empty: Los campos no pueden estar vacíos
-The code can't be empty: El código no puede estar vacío
-The description can't be empty: La descripción no puede estar vacía
-Expense saved!: Gasto guardado!
\ No newline at end of file
diff --git a/modules/invoiceOut/back/methods/invoiceOut/clientsToInvoice.js b/modules/invoiceOut/back/methods/invoiceOut/clientsToInvoice.js
index 63b00fe382..5526d214ad 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 530b02353c..2c44cef34f 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 1b7ccc1e42..4f43a7a84d 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 0000000000..470690c5a4
--- /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 0faa8fe1ab..c731912ec0 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 0c86e58101..c31f381d9d 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 912269fd79..30e1f1b394 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 da04c8e728..335ab87ccd 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 d2ccfa117e..a22ca7c2a2 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/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js
index 9c91886c1e..edc804dc4a 100644
--- a/modules/item/back/methods/fixed-price/filter.js
+++ b/modules/item/back/methods/fixed-price/filter.js
@@ -1,4 +1,3 @@
-
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
const buildFilter = require('vn-loopback/util/filter').buildFilter;
const mergeFilters = require('vn-loopback/util/filter').mergeFilters;
@@ -134,7 +133,7 @@ module.exports = Self => {
const stmts = [];
const stmt = new ParameterizedSQL(`
- SELECT fp.id,
+ SELECT DISTINCT fp.id,
fp.itemFk,
fp.warehouseFk,
fp.rate2,
diff --git a/modules/order/back/methods/order/filter.js b/modules/order/back/methods/order/filter.js
index 592ed11e60..758e8065c6 100644
--- a/modules/order/back/methods/order/filter.js
+++ b/modules/order/back/methods/order/filter.js
@@ -59,6 +59,10 @@ module.exports = Self => {
arg: 'showEmpty',
type: 'boolean',
description: 'Show empty orders'
+ }, {
+ arg: 'sourceApp',
+ type: 'string',
+ description: 'Application'
}
],
returns: {
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
index 9185a6e759..24346f3ba0 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 5b0dc84a78..1738cc08c1 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 93bc2a94ea..0000000000
--- 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 0000000000..cf99a7edc7
--- /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 9d0aa8c13b..143c0a3f0c 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/filter.js b/modules/ticket/back/methods/ticket/filter.js
index 0823b38b8d..3e8b732afd 100644
--- a/modules/ticket/back/methods/ticket/filter.js
+++ b/modules/ticket/back/methods/ticket/filter.js
@@ -224,16 +224,14 @@ module.exports = Self => {
const stmts = [];
let stmt;
- stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.filter');
- stmt = new ParameterizedSQL(
- `CREATE TEMPORARY TABLE tmp.filter
+ stmt = new ParameterizedSQL(`
+ CREATE OR REPLACE TEMPORARY TABLE tmp.filter
(INDEX (id))
ENGINE = MEMORY
- SELECT
- t.id,
+ SELECT t.id,
t.shipped,
- CAST(DATE(t.shipped) AS CHAR) AS shippedDate,
- HOUR(t.shipped) AS shippedHour,
+ CAST(DATE(t.shipped) AS CHAR) shippedDate,
+ HOUR(t.shipped) shippedHour,
t.nickname,
t.refFk,
t.routeFk,
@@ -241,26 +239,26 @@ module.exports = Self => {
t.clientFk,
t.totalWithoutVat,
t.totalWithVat,
- io.id AS invoiceOutId,
+ io.id invoiceOutId,
a.provinceFk,
- p.name AS province,
- w.name AS warehouse,
- am.name AS agencyMode,
- am.id AS agencyModeFk,
- st.name AS state,
+ p.name province,
+ w.name warehouse,
+ am.name agencyMode,
+ am.id agencyModeFk,
+ st.name state,
st.classColor,
- wk.lastName AS salesPerson,
- ts.stateFk AS stateFk,
- ts.alertLevel AS alertLevel,
- ts.code AS alertLevelCode,
- u.name AS userName,
+ wk.lastName salesPerson,
+ ts.stateFk stateFk,
+ ts.alertLevel alertLevel,
+ ts.code alertLevelCode,
+ u.name userName,
c.salesPersonFk,
- z.hour AS zoneLanding,
- HOUR(z.hour) AS zoneHour,
- MINUTE(z.hour) AS zoneMinute,
- z.name AS zoneName,
- z.id AS zoneFk,
- CAST(z.hour AS CHAR) AS hour
+ z.hour zoneLanding,
+ HOUR(z.hour) zoneHour,
+ MINUTE(z.hour) zoneMinute,
+ z.name zoneName,
+ z.id zoneFk,
+ CAST(z.hour AS CHAR) hour
FROM ticket t
LEFT JOIN invoiceOut io ON t.refFk = io.ref
LEFT JOIN zone z ON z.id = t.zoneFk
@@ -273,7 +271,8 @@ module.exports = Self => {
LEFT JOIN client c ON c.id = t.clientFk
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
LEFT JOIN account.user u ON u.id = wk.id
- LEFT JOIN route r ON r.id = t.routeFk`);
+ LEFT JOIN route r ON r.id = t.routeFk
+ `);
if (args.orderFk) {
stmt.merge({
@@ -293,25 +292,25 @@ module.exports = Self => {
stmt.merge(conn.makeWhere(filter.where));
stmts.push(stmt);
- stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.sale_getProblems');
-
stmt = new ParameterizedSQL(`
- CREATE TEMPORARY TABLE tmp.sale_getProblems
+ CREATE OR REPLACE TEMPORARY TABLE tmp.sale_getProblems
(INDEX (ticketFk))
ENGINE = MEMORY
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped
FROM tmp.filter f
LEFT JOIN alertLevel al ON al.id = f.alertLevel
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
- AND f.shipped >= ?`, [date]);
- stmts.push(stmt);
+ AND f.shipped >= ?
+ `, [date]);
+ stmts.push(stmt);
stmts.push('CALL ticket_getProblems(FALSE)');
stmt = new ParameterizedSQL(`
SELECT f.*, tp.*
- FROM tmp.filter f
- LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id`);
+ FROM tmp.filter f
+ LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id
+ `);
if (args.problems != undefined && (!args.from && !args.to))
throw new UserError('Choose a date range or days forward');
diff --git a/modules/ticket/back/methods/ticket/getTicketsFuture.js b/modules/ticket/back/methods/ticket/getTicketsFuture.js
index ab5071be46..0fd21ea74e 100644
--- a/modules/ticket/back/methods/ticket/getTicketsFuture.js
+++ b/modules/ticket/back/methods/ticket/getTicketsFuture.js
@@ -145,24 +145,24 @@ module.exports = Self => {
stmts.push(stmt);
- stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.sale_getProblems');
-
stmt = new ParameterizedSQL(`
- CREATE TEMPORARY TABLE tmp.sale_getProblems
- (INDEX (ticketFk))
- ENGINE = MEMORY
- SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped, f.lines, f.liters
- FROM tmp.filter f
- LEFT JOIN alertLevel al ON al.id = f.alertLevel
- WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)`);
- stmts.push(stmt);
+ CREATE OR REPLACE TEMPORARY TABLE tmp.sale_getProblems
+ (INDEX (ticketFk))
+ ENGINE = MEMORY
+ SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped, f.lines, f.liters
+ FROM tmp.filter f
+ LEFT JOIN alertLevel al ON al.id = f.alertLevel
+ WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
+ `);
+ stmts.push(stmt);
stmts.push('CALL ticket_getProblems(FALSE)');
stmt = new ParameterizedSQL(`
SELECT f.*, tp.*
FROM tmp.filter f
- LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id`);
+ LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id
+ `);
if (args.problems != undefined && (!args.originDated && !args.futureDated))
throw new UserError('Choose a date range or days forward');
diff --git a/modules/ticket/back/methods/ticket/invoiceTickets.js b/modules/ticket/back/methods/ticket/invoiceTickets.js
index 53400e724f..3c725c4a7b 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 7365f34df3..0000000000
--- 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 ccc0dcdf3d..0000000000
--- 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 0000000000..4788df2c26
--- /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/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js
index 1d050931b3..72249fe5db 100644
--- a/modules/ticket/back/methods/ticket/specs/filter.spec.js
+++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js
@@ -71,7 +71,7 @@ describe('ticket filter()', () => {
const filter = {};
const result = await models.Ticket.filter(ctx, filter, options);
- expect(result.length).toEqual(10);
+ expect(result.length).toEqual(11);
await tx.rollback();
} catch (e) {
diff --git a/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js b/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js
index fea8b20960..88812dc923 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/methods/ticket/specs/transferClient.spec.js b/modules/ticket/back/methods/ticket/specs/transferClient.spec.js
index 01fd8fcbeb..d3ac3c6aa6 100644
--- a/modules/ticket/back/methods/ticket/specs/transferClient.spec.js
+++ b/modules/ticket/back/methods/ticket/specs/transferClient.spec.js
@@ -8,6 +8,7 @@ describe('Ticket transferClient()', () => {
const ctx = beforeAll.getCtx();
let options;
let tx;
+
beforeEach(async() => {
options = {transaction: tx};
tx = await models.Ticket.beginTransaction({});
@@ -21,21 +22,23 @@ describe('Ticket transferClient()', () => {
it('should throw an error as the ticket is not editable', async() => {
try {
const ticketId = 4;
- const clientId = 1;
await models.Ticket.transferClient(ctx, ticketId, clientId, options);
} catch (e) {
- expect(e.message).toEqual(`This ticket is locked`);
+ expect(e.message).toEqual('This ticket is locked');
}
});
- it('should be assigned a different clientFk in the original ticket', async() => {
+ it('should be assigned a different clientFk and nickname in the original ticket', async() => {
await models.Ticket.transferClient(ctx, 2, clientId, options);
const afterTransfer = await models.Ticket.findById(2, null, options);
+ const client = await models.Client.findById(clientId, {fields: ['defaultAddressFk']}, options);
+ const address = await models.Address.findById(client.defaultAddressFk, {fields: ['nickname']}, options);
expect(afterTransfer.clientFk).toEqual(clientId);
+ expect(afterTransfer.nickname).toEqual(address.nickname);
});
- it('should be assigned a different clientFk in the original and refund ticket and claim', async() => {
+ it('should be assigned a different clientFk and nickname in the original and refund ticket and claim', async() => {
await models.Ticket.transferClient(ctx, originalTicketId, clientId, options);
const [originalTicket, refundTicket] = await models.Ticket.find({
@@ -46,8 +49,14 @@ describe('Ticket transferClient()', () => {
where: {ticketFk: originalTicketId}
}, options);
+ const client = await models.Client.findById(clientId, {fields: ['defaultAddressFk']}, options);
+ const address = await models.Address.findById(client.defaultAddressFk, {fields: ['nickname']}, options);
+
expect(originalTicket.clientFk).toEqual(clientId);
expect(refundTicket.clientFk).toEqual(clientId);
expect(claim.clientFk).toEqual(clientId);
+
+ expect(originalTicket.nickname).toEqual(address.nickname);
+ expect(refundTicket.nickname).toEqual(address.nickname);
});
});
diff --git a/modules/ticket/back/methods/ticket/transferClient.js b/modules/ticket/back/methods/ticket/transferClient.js
index d38c0e8a74..95bee008da 100644
--- a/modules/ticket/back/methods/ticket/transferClient.js
+++ b/modules/ticket/back/methods/ticket/transferClient.js
@@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethodCtx('transferClient', {
- description: 'Transfering ticket to another client',
+ description: 'Transferring ticket to another client',
accessType: 'WRITE',
accepts: [{
arg: 'id',
@@ -40,10 +40,13 @@ module.exports = Self => {
include: [{relation: 'refundTicket'}, {relation: 'originalTicket'}]
}, myOptions);
- const {defaultAddressFk: addressFk} = await models.Client.findById(clientFk,
+ const client = await models.Client.findById(clientFk,
{fields: ['id', 'defaultAddressFk']}, myOptions);
- const attributes = {clientFk, addressFk};
+ const address = await models.Address.findById(client.defaultAddressFk,
+ {fields: ['id', 'nickname']}, myOptions);
+
+ const attributes = {clientFk, addressFk: client.defaultAddressFk, nickname: address.nickname};
const tickets = [];
const ticketIds = [];
diff --git a/modules/ticket/back/models/ticket-methods.js b/modules/ticket/back/models/ticket-methods.js
index 5582dde5ce..462862cb36 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.html b/modules/ticket/front/descriptor-menu/index.html
index 3583b12023..82094d7b86 100644
--- a/modules/ticket/front/descriptor-menu/index.html
+++ b/modules/ticket/front/descriptor-menu/index.html
@@ -6,7 +6,7 @@
diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js
index 32f2454543..93948def2e 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 94a991db8d..cffbad62e0 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/modules/travel/back/methods/travel/filter.js b/modules/travel/back/methods/travel/filter.js
index 3fa1d65f9c..9f26423ce9 100644
--- a/modules/travel/back/methods/travel/filter.js
+++ b/modules/travel/back/methods/travel/filter.js
@@ -71,7 +71,15 @@ module.exports = Self => {
arg: 'continent',
type: 'string',
description: 'The continent code'
- },
+ }, {
+ arg: 'shipmentHour',
+ type: 'string',
+ description: 'The shipment hour'
+ }, {
+ arg: 'landingHour',
+ type: 'string',
+ description: 'The landing hour'
+ }
],
returns: {
type: ['Object'],
@@ -130,6 +138,8 @@ module.exports = Self => {
t.isReceived,
t.m3,
t.kg,
+ t.shipmentHour,
+ t.landingHour,
t.cargoSupplierFk,
t.totalEntries,
am.name agencyModeName,
diff --git a/modules/travel/back/models/travel.json b/modules/travel/back/models/travel.json
index 701894a766..0ebf683e75 100644
--- a/modules/travel/back/models/travel.json
+++ b/modules/travel/back/models/travel.json
@@ -44,6 +44,12 @@
},
"agencyModeFk": {
"type": "number"
+ },
+ "shipmentHour": {
+ "type": "string"
+ },
+ "landingHour": {
+ "type": "string"
}
},
"relations": {
@@ -64,3 +70,4 @@
}
}
}
+
diff --git a/modules/worker/back/locale/worker-time-control/en.yml b/modules/worker/back/locale/worker-time-control/en.yml
new file mode 100644
index 0000000000..f1de664747
--- /dev/null
+++ b/modules/worker/back/locale/worker-time-control/en.yml
@@ -0,0 +1,7 @@
+name: time control
+columns:
+ direction: direction
+ isSendMail: sent mail
+ logExclude: excluded log
+ manual: manual
+ timed: timed
diff --git a/modules/worker/back/locale/worker-time-control/es.yml b/modules/worker/back/locale/worker-time-control/es.yml
new file mode 100644
index 0000000000..1739c487ce
--- /dev/null
+++ b/modules/worker/back/locale/worker-time-control/es.yml
@@ -0,0 +1,7 @@
+name: control horario
+columns:
+ direction: dirección
+ isSendMail: correo enviado
+ logExclude: registro excluido
+ manual: manual
+ timed: fichada
\ No newline at end of file
diff --git a/package.json b/package.json
index 61a9cf46c7..bbb83c4b0e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "salix-back",
- "version": "24.34.0",
+ "version": "24.36.0",
"author": "Verdnatura Levante SL",
"description": "Salix backend",
"license": "GPL-3.0",
diff --git a/print/templates/reports/buy-label/sql/buy.sql b/print/templates/reports/buy-label/sql/buy.sql
index 72765baa97..26efeb06ef 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/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html
index 65709ead0b..1f57fc3d91 100644
--- a/print/templates/reports/collection-label/collection-label.html
+++ b/print/templates/reports/collection-label/collection-label.html
@@ -10,14 +10,10 @@
{{dashIfEmpty(labelData.shipped)}} |
-
+
![]() |
{{dashIfEmpty(labelData.workerCode)}} |
-
- |
- {{dashIfEmpty(labelData.workerCode)}} |
-
{{labelCount || labelData.labelCount || 0}} |
diff --git a/print/templates/reports/collection-label/collection-label.js b/print/templates/reports/collection-label/collection-label.js
index f2f697ae64..4aeaca854f 100644
--- a/print/templates/reports/collection-label/collection-label.js
+++ b/print/templates/reports/collection-label/collection-label.js
@@ -1,7 +1,5 @@
-const {DOMImplementation, XMLSerializer} = require('xmldom');
const vnReport = require('../../../core/mixins/vn-report.js');
const {toDataURL} = require('qrcode');
-const jsBarcode = require('jsbarcode');
module.exports = {
name: 'collection-label',
@@ -30,11 +28,8 @@ module.exports = {
const labels = await this.rawSqlFromDef('labelsData', [ticketIds]);
- const [{scannableCodeType}] = await this.rawSqlFromDef('barcodeType');
- if (scannableCodeType === 'qr') {
- for (const labelData of labels)
- labelData.qrData = await this.getQr(labelData?.ticketFk, labelData?.workerFk);
- }
+ for (const labelData of labels)
+ labelData.qrData = await this.getQr(labelData?.ticketFk, labelData?.workerFk);
this.labelsData = labels;
this.checkMainEntity(this.labelsData);
@@ -50,20 +45,6 @@ module.exports = {
});
return toDataURL(QRdata, {margin: 0});
},
- getBarcode(id) {
- const xmlSerializer = new XMLSerializer();
- const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null);
- const svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
-
- jsBarcode(svgNode, id, {
- xmlDocument: document,
- format: 'code128',
- displayValue: false,
- width: 3.8,
- height: 115,
- });
- return xmlSerializer.serializeToString(svgNode);
- },
getVertical(labelData) {
let value;
if (labelData.collectionFk) {
diff --git a/print/templates/reports/collection-label/sql/barcodeType.sql b/print/templates/reports/collection-label/sql/barcodeType.sql
deleted file mode 100644
index 0700c95a2f..0000000000
--- a/print/templates/reports/collection-label/sql/barcodeType.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-SELECT scannableCodeType
- FROM productionConfig
- LIMIT 1
\ No newline at end of file
diff --git a/print/templates/reports/entry-order/assets/css/style.css b/print/templates/reports/entry-order/assets/css/style.css
index cabdadf9f3..767b1185ab 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 ddf0e9b5da..e5d3bfb6de 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 d31ad1a36a..56356e0683 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 5c633aeaae..5a6716ba13 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 5bf9f2dfe8..92c055483c 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 c30eebca8c..2ab599123e 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 81ed7e8835..214f7913f4 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 = ?