From c2de5c5ff4fa4c07f9c6721b540832d566778b52 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 2 May 2023 07:28:59 +0200
Subject: [PATCH 001/427] refs #4797 added redirection section
---
db/dump/fixtures.sql | 7 +++++-
loopback/locale/es.json | 23 ++++++++++---------
modules/client/back/models/client.json | 2 +-
modules/worker/front/index.js | 1 +
modules/worker/front/notifications/index.html | 2 ++
modules/worker/front/notifications/index.js | 21 +++++++++++++++++
modules/worker/front/routes.json | 9 ++++++++
7 files changed, 52 insertions(+), 13 deletions(-)
create mode 100644 modules/worker/front/notifications/index.html
create mode 100644 modules/worker/front/notifications/index.js
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 15ccece35..6554adc33 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -2723,7 +2723,10 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`)
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
VALUES
- (1, 9);
+ (1, 9),
+ (1, 1),
+ (2, 1),
+ (4, 1);
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
VALUES
@@ -2735,6 +2738,8 @@ INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`)
VALUES
(1, 1109),
(1, 1110),
+ (2, 1110),
+ (4, 1110),
(2, 1109),
(1,9),
(1,3);
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 3ef3c4a22..628f7ace6 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -279,15 +279,16 @@
"Comment added to client": "Observación añadida al cliente {{clientFk}}",
"Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
"company": "Compañía",
- "country": "País",
- "clientId": "Id cliente",
- "clientSocialName": "Cliente",
- "amount": "Importe",
- "taxableBase": "Base",
- "ticketFk": "Id ticket",
- "isActive": "Activo",
- "hasToInvoice": "Facturar",
- "isTaxDataChecked": "Datos comprobados",
- "comercialId": "Id comercial",
- "comercialName": "Comercial"
+ "country": "País",
+ "clientId": "Id cliente",
+ "clientSocialName": "Cliente",
+ "amount": "Importe",
+ "taxableBase": "Base",
+ "ticketFk": "Id ticket",
+ "isActive": "Activo",
+ "hasToInvoice": "Facturar",
+ "isTaxDataChecked": "Datos comprobados",
+ "comercialId": "Id comercial",
+ "comercialName": "Comercial",
+ "You dont have permission to modify this user": "No tienes permiso para modificar este usuario"
}
diff --git a/modules/client/back/models/client.json b/modules/client/back/models/client.json
index 5f56a1ed2..73b6cccb4 100644
--- a/modules/client/back/models/client.json
+++ b/modules/client/back/models/client.json
@@ -158,7 +158,7 @@
},
"user": {
"type": "belongsTo",
- "model": "Account",
+ "model": "VnUser",
"foreignKey": "id"
},
"payMethod": {
diff --git a/modules/worker/front/index.js b/modules/worker/front/index.js
index 8fad2c0df..5c03dc8de 100644
--- a/modules/worker/front/index.js
+++ b/modules/worker/front/index.js
@@ -20,4 +20,5 @@ import './dms/create';
import './dms/edit';
import './note/index';
import './note/create';
+import './notifications';
diff --git a/modules/worker/front/notifications/index.html b/modules/worker/front/notifications/index.html
new file mode 100644
index 000000000..7fb3b870e
--- /dev/null
+++ b/modules/worker/front/notifications/index.html
@@ -0,0 +1,2 @@
+
+
diff --git a/modules/worker/front/notifications/index.js b/modules/worker/front/notifications/index.js
new file mode 100644
index 000000000..622892979
--- /dev/null
+++ b/modules/worker/front/notifications/index.js
@@ -0,0 +1,21 @@
+import ngModule from '../module';
+import Section from 'salix/components/section';
+
+class Controller extends Section {
+ constructor($element, $) {
+ super($element, $);
+ }
+
+ async $onInit() {
+ const url = await this.vnApp.getUrl(`worker/${this.$params.id}/notifications`);
+ window.open(url).focus();
+ }
+}
+
+ngModule.vnComponent('vnWorkerNotifications', {
+ template: require('./index.html'),
+ controller: Controller,
+ bindings: {
+ ticket: '<'
+ }
+});
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 25a0ffbcf..bce0172a2 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -15,6 +15,7 @@
{"state": "worker.card.timeControl", "icon": "access_time"},
{"state": "worker.card.calendar", "icon": "icon-calendar"},
{"state": "worker.card.pda", "icon": "phone_android"},
+ {"state": "worker.card.notifications", "icon": "notifications"},
{"state": "worker.card.pbx", "icon": "icon-pbx"},
{"state": "worker.card.dms.index", "icon": "cloud_upload"},
{
@@ -109,6 +110,14 @@
"params": {
"worker": "$ctrl.worker"
}
+ }, {
+ "url": "/notifications",
+ "state": "worker.card.notifications",
+ "component": "vn-worker-notifications",
+ "description": "Notifications",
+ "params": {
+ "worker": "$ctrl.worker"
+ }
}, {
"url": "/time-control?timestamp",
"state": "worker.card.timeControl",
From 70c46efe275e0e518c884d8e76eedf4174f02ec9 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 2 May 2023 09:51:04 +0200
Subject: [PATCH 002/427] refs #4797 fix back test
---
.../specs/notificationSubscription.spec.js | 23 ++++++++-----------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/back/models/specs/notificationSubscription.spec.js b/back/models/specs/notificationSubscription.spec.js
index c7f37abed..c5ef698fd 100644
--- a/back/models/specs/notificationSubscription.spec.js
+++ b/back/models/specs/notificationSubscription.spec.js
@@ -1,8 +1,9 @@
const models = require('vn-loopback/server/server').models;
describe('loopback model NotificationSubscription', () => {
- it('Should fail to delete a notification if the user is not editing itself or a subordinate', async() => {
+ it('should fail to delete a notification if the user is not editing itself or a subordinate', async() => {
const tx = await models.NotificationSubscription.beginTransaction({});
+ let error;
try {
const options = {transaction: tx};
@@ -11,29 +12,23 @@ describe('loopback model NotificationSubscription', () => {
const ctx = {req: {accessToken: {userId: user}}};
const notification = await models.NotificationSubscription.findById(notificationSubscriptionId);
- let error;
-
- try {
- await models.NotificationSubscription.deleteNotification(ctx, notification.id, options);
- } catch (e) {
- error = e;
- }
+ await models.NotificationSubscription.deleteNotification(ctx, notification.id, options);
expect(error.message).toContain('You dont have permission to modify this user');
await tx.rollback();
} catch (e) {
+ error = e;
await tx.rollback();
- throw e;
}
});
- it('Should delete a notification if the user is editing itself', async() => {
+ it('should delete a notification if the user is editing itself', async() => {
const tx = await models.NotificationSubscription.beginTransaction({});
try {
const options = {transaction: tx};
const user = 9;
- const notificationSubscriptionId = 4;
+ const notificationSubscriptionId = 6;
const ctx = {req: {accessToken: {userId: user}}};
const notification = await models.NotificationSubscription.findById(notificationSubscriptionId);
@@ -49,13 +44,13 @@ describe('loopback model NotificationSubscription', () => {
}
});
- it('Should delete a notification if the user is editing a subordinate', async() => {
+ it('should delete a notification if the user is editing a subordinate', async() => {
const tx = await models.NotificationSubscription.beginTransaction({});
try {
const options = {transaction: tx};
- const user = 9;
- const notificationSubscriptionId = 5;
+ const user = 19;
+ const notificationSubscriptionId = 4;
const ctx = {req: {accessToken: {userId: user}}};
const notification = await models.NotificationSubscription.findById(notificationSubscriptionId);
From 4c0ec6faf53a4118a46e97ddc1b59d7d71651341 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 2 May 2023 14:26:47 +0200
Subject: [PATCH 003/427] changedModel sms
---
e2e/paths/13-supplier/03_fiscal_data.spec.js | 2 +-
modules/client/back/methods/client/sendSms.js | 2 +-
modules/ticket/back/methods/ticket/sendSms.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/e2e/paths/13-supplier/03_fiscal_data.spec.js b/e2e/paths/13-supplier/03_fiscal_data.spec.js
index 31b3fafd2..170a8d05a 100644
--- a/e2e/paths/13-supplier/03_fiscal_data.spec.js
+++ b/e2e/paths/13-supplier/03_fiscal_data.spec.js
@@ -15,7 +15,7 @@ const $inputs = {
sageTaxType: 'vn-supplier-fiscal-data [ng-model="$ctrl.supplier.sageTaxTypeFk"]'
};
-fdescribe('Supplier fiscal data path', () => {
+describe('Supplier fiscal data path', () => {
let browser;
let page;
diff --git a/modules/client/back/methods/client/sendSms.js b/modules/client/back/methods/client/sendSms.js
index 9d6a12416..456d1d621 100644
--- a/modules/client/back/methods/client/sendSms.js
+++ b/modules/client/back/methods/client/sendSms.js
@@ -44,7 +44,7 @@ module.exports = Self => {
originFk: id,
userFk: userId,
action: 'insert',
- changedModel: 'sms',
+ changedModel: 'Sms',
newInstance: {
destinationFk: id,
destination: destination,
diff --git a/modules/ticket/back/methods/ticket/sendSms.js b/modules/ticket/back/methods/ticket/sendSms.js
index 2336ae859..3c361b783 100644
--- a/modules/ticket/back/methods/ticket/sendSms.js
+++ b/modules/ticket/back/methods/ticket/sendSms.js
@@ -58,7 +58,7 @@ module.exports = Self => {
originFk: id,
userFk: userId,
action: 'insert',
- changedModel: 'sms',
+ changedModel: 'Sms',
newInstance: {
destinationFk: id,
destination: destination,
From e7d16dc8baf1e26c8a02cd7f80082b49967a1f9d Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 9 May 2023 11:34:32 +0200
Subject: [PATCH 004/427] refs #4797 fix test, add getList
---
back/methods/notification/getList.js | 80 ++++++++++++
.../notification/specs/getList.spec.js | 38 ++++++
back/models/notificationSubscription.js | 76 ++++-------
.../specs/notificationSubscription.spec.js | 123 +++++++++++++-----
.../232001/00-notificationSubscription.sql | 3 +
loopback/locale/es.json | 3 +-
6 files changed, 240 insertions(+), 83 deletions(-)
create mode 100644 back/methods/notification/getList.js
create mode 100644 back/methods/notification/specs/getList.spec.js
create mode 100644 db/changes/232001/00-notificationSubscription.sql
diff --git a/back/methods/notification/getList.js b/back/methods/notification/getList.js
new file mode 100644
index 000000000..9f3367184
--- /dev/null
+++ b/back/methods/notification/getList.js
@@ -0,0 +1,80 @@
+module.exports = Self => {
+ Self.remoteMethod('getList', {
+ description: 'Get list of the available and active notification subscriptions',
+ accessType: 'READ',
+ accepts: [
+ {
+ arg: 'id',
+ type: 'number',
+ description: 'User to modify',
+ http: {source: 'path'}
+ }
+ ],
+ returns: {
+ type: 'object',
+ root: true
+ },
+ http: {
+ path: `/:id/getList`,
+ verb: 'GET'
+ }
+ });
+
+ Self.getList = async(id, options) => {
+ const notifications = [];
+ const models = Self.app.models;
+
+ const myOptions = {};
+
+ if (typeof options == 'object')
+ Object.assign(myOptions, options);
+
+ const activeNotifications = await models.NotificationSubscription.find({
+ include: {relation: 'notification'},
+ where: {userFk: id}
+ }, myOptions);
+
+ const roles = await models.RoleMapping.find({
+ fields: ['roleId'],
+ where: {principalId: id}
+ }, myOptions);
+
+ const availableNotifications = await models.NotificationAcl.find({
+ include: {relation: 'notification'},
+ where: {
+ roleFk: {
+ inq: roles.map(role => {
+ return role.roleId;
+ }),
+ },
+ }
+ }, myOptions);
+
+ activeNotifications.forEach(subscription => {
+ notifications.push({
+ id: subscription.id,
+ notificationFk: subscription.notificationFk,
+ name: subscription.notification().name,
+ description: subscription.notification().description,
+ active: true
+ });
+ });
+
+ availableNotifications.forEach(acl => {
+ const activeNotif = notifications.find(
+ notif => notif.notificationFk === acl.notificationFk
+ );
+ if (!activeNotif) {
+ notifications.push({
+ id: null,
+ notificationFk: acl.notificationFk,
+ name: acl.notification().name,
+ description: acl.notification().description,
+ active: false,
+ });
+ }
+ });
+
+ return notifications;
+ };
+};
diff --git a/back/methods/notification/specs/getList.spec.js b/back/methods/notification/specs/getList.spec.js
new file mode 100644
index 000000000..b220f2215
--- /dev/null
+++ b/back/methods/notification/specs/getList.spec.js
@@ -0,0 +1,38 @@
+const models = require('vn-loopback/server/server').models;
+
+describe('NotificationSubscription getList()', () => {
+ it('should return a list of available and active notifications of a user', async() => {
+ const userId = 1109;
+ const activeNotifications = await models.NotificationSubscription.find({
+ where: {userFk: userId}
+ });
+ const roles = await models.RoleMapping.find({
+ fields: ['roleId'],
+ where: {principalId: userId}
+ });
+ const availableNotifications = await models.NotificationAcl.find({
+ where: {
+ roleFk: {
+ inq: roles.map(role => {
+ return role.roleId;
+ }),
+ },
+ }
+ });
+
+ const result = await models.NotificationSubscription.getList(userId);
+
+ expect(result.filter(notification => notification.active == true).length)
+ .toEqual(activeNotifications.length);
+
+ expect(result.filter(notification => notification.active == false).length)
+ .toEqual(availableNotifications.length - activeNotifications.length);
+ });
+
+ it('should return empty from a non existent user', async() => {
+ const userId = 123456789;
+ const result = await models.NotificationSubscription.getList(userId);
+
+ expect(result.length).toEqual(0);
+ });
+});
diff --git a/back/models/notificationSubscription.js b/back/models/notificationSubscription.js
index f1b2811fa..a4d4a8bac 100644
--- a/back/models/notificationSubscription.js
+++ b/back/models/notificationSubscription.js
@@ -1,62 +1,40 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
+ require('../methods/notification/getList')(Self);
+
Self.observe('before save', async function(ctx) {
+ await checkModifyPermission(ctx);
+ });
+
+ Self.observe('before delete', async function(ctx) {
+ await checkModifyPermission(ctx);
+ });
+
+ async function checkModifyPermission(ctx) {
const models = Self.app.models;
+ const instance = ctx.instance;
const userId = ctx.options.accessToken.userId;
- const user = await ctx.instance.userFk;
- const modifiedUser = await getUserToModify(null, user, models);
- if (userId != modifiedUser.id && userId != modifiedUser.bossFk)
- throw new UserError('You dont have permission to modify this user');
- });
+ let notificationFk;
+ let workerId;
- Self.remoteMethod('deleteNotification', {
- description: 'Deletes a notification subscription',
- accepts: [
- {
- arg: 'ctx',
- type: 'object',
- http: {source: 'context'}
- },
- {
- arg: 'notificationId',
- type: 'number',
- required: true
- },
- ],
- returns: {
- type: 'object',
- root: true
- },
- http: {
- verb: 'POST',
- path: '/deleteNotification'
+ if (instance) {
+ notificationFk = instance.notificationFk;
+ workerId = instance.userFk;
+ } else {
+ const notificationSubscription = await models.NotificationSubscription.findById(ctx.where.id);
+ notificationFk = notificationSubscription.notificationFk;
+ workerId = notificationSubscription.userFk;
}
- });
- Self.deleteNotification = async function(ctx, notificationId) {
- const models = Self.app.models;
- const user = ctx.req.accessToken.userId;
- const modifiedUser = await getUserToModify(notificationId, null, models);
-
- if (user != modifiedUser.id && user != modifiedUser.bossFk)
- throw new UserError('You dont have permission to modify this user');
-
- await models.NotificationSubscription.destroyById(notificationId);
- };
-
- async function getUserToModify(notificationId, userFk, models) {
- let userToModify = userFk;
- if (notificationId) {
- const subscription = await models.NotificationSubscription.findById(notificationId);
- userToModify = subscription.userFk;
- }
- return await models.Worker.findOne({
- fields: ['id', 'bossFk'],
- where: {
- id: userToModify
- }
+ const worker = await models.Worker.findById(workerId, {fields: ['id', 'bossFk']});
+ const notificationsAvailables = await models.NotificationSubscription.getList(workerId);
+ const hasAcl = notificationsAvailables.some(function(available) {
+ return available.notificationFk === notificationFk;
});
+
+ if (!hasAcl || (userId != worker.id && userId != worker.bossFk))
+ throw new UserError('The notification subscription of this worker cant be modified');
}
};
diff --git a/back/models/specs/notificationSubscription.spec.js b/back/models/specs/notificationSubscription.spec.js
index c5ef698fd..c2adcbc59 100644
--- a/back/models/specs/notificationSubscription.spec.js
+++ b/back/models/specs/notificationSubscription.spec.js
@@ -1,69 +1,126 @@
const models = require('vn-loopback/server/server').models;
describe('loopback model NotificationSubscription', () => {
- it('should fail to delete a notification if the user is not editing itself or a subordinate', async() => {
+ it('should fail to add a notification subscription if the worker doesnt have ACLs', async() => {
const tx = await models.NotificationSubscription.beginTransaction({});
let error;
try {
- const options = {transaction: tx};
- const user = 9;
- const notificationSubscriptionId = 2;
- const ctx = {req: {accessToken: {userId: user}}};
- const notification = await models.NotificationSubscription.findById(notificationSubscriptionId);
+ const options = {transaction: tx, accessToken: {userId: 9}};
+ await models.NotificationSubscription.create({notificationFk: 1, userFk: 62}, options);
- await models.NotificationSubscription.deleteNotification(ctx, notification.id, options);
-
- expect(error.message).toContain('You dont have permission to modify this user');
await tx.rollback();
} catch (e) {
+ await tx.rollback();
error = e;
- await tx.rollback();
}
+
+ expect(error.message).toEqual('The notification subscription of this worker cant be modified');
});
- it('should delete a notification if the user is editing itself', async() => {
+ it('should fail to add a notification subscription if the user isnt editing itself or subordinate', async() => {
const tx = await models.NotificationSubscription.beginTransaction({});
+ let error;
try {
- const options = {transaction: tx};
- const user = 9;
+ const options = {transaction: tx, accessToken: {userId: 1}};
+ await models.NotificationSubscription.create({notificationFk: 1, userFk: 9}, options);
+
+ await tx.rollback();
+ } catch (e) {
+ await tx.rollback();
+ error = e;
+ }
+
+ expect(error.message).toEqual('The notification subscription of this worker cant be modified');
+ });
+
+ it('should fail to delete a notification subscription if the user isnt editing itself or subordinate', async() => {
+ const tx = await models.NotificationSubscription.beginTransaction({});
+ let error;
+
+ try {
+ const options = {transaction: tx, accessToken: {userId: 9}};
+ const notificationSubscriptionId = 2;
+ await models.NotificationSubscription.destroyAll({id: notificationSubscriptionId}, options);
+
+ await tx.rollback();
+ } catch (e) {
+ await tx.rollback();
+ error = e;
+ }
+
+ expect(error.message).toEqual('The notification subscription of this worker cant be modified');
+ });
+
+ it('should add a notification subscription if the user is editing itself', async() => {
+ const tx = await models.NotificationSubscription.beginTransaction({});
+ let error;
+
+ try {
+ const options = {transaction: tx, accessToken: {userId: 9}};
+ await models.NotificationSubscription.create({notificationFk: 2, userFk: 9}, options);
+
+ await tx.rollback();
+ } catch (e) {
+ await tx.rollback();
+ error = e;
+ }
+
+ expect(error).toBeUndefined();
+ });
+
+ it('should delete a notification subscription if the user is editing itself', async() => {
+ const tx = await models.NotificationSubscription.beginTransaction({});
+ let error;
+
+ try {
+ const options = {transaction: tx, accessToken: {userId: 9}};
const notificationSubscriptionId = 6;
- const ctx = {req: {accessToken: {userId: user}}};
- const notification = await models.NotificationSubscription.findById(notificationSubscriptionId);
+ await models.NotificationSubscription.destroyAll({id: notificationSubscriptionId}, options);
- await models.NotificationSubscription.deleteNotification(ctx, notification.id, options);
-
- const deletedNotification = await models.NotificationSubscription.findById(notificationSubscriptionId);
-
- expect(deletedNotification).toBeNull();
await tx.rollback();
} catch (e) {
await tx.rollback();
- throw e;
+ error = e;
}
+
+ expect(error).toBeUndefined();
});
- it('should delete a notification if the user is editing a subordinate', async() => {
+ it('should add a notification subscription if the user is editing a subordinate', async() => {
const tx = await models.NotificationSubscription.beginTransaction({});
+ let error;
try {
- const options = {transaction: tx};
- const user = 19;
- const notificationSubscriptionId = 4;
- const ctx = {req: {accessToken: {userId: user}}};
- const notification = await models.NotificationSubscription.findById(notificationSubscriptionId);
+ const options = {transaction: tx, accessToken: {userId: 9}};
+ await models.NotificationSubscription.create({notificationFk: 1, userFk: 5}, options);
- await models.NotificationSubscription.deleteNotification(ctx, notification.id, options);
-
- const deletedNotification = await models.NotificationSubscription.findById(notificationSubscriptionId);
-
- expect(deletedNotification).toBeNull();
await tx.rollback();
} catch (e) {
await tx.rollback();
- throw e;
+ error = e;
}
+
+ expect(error).toBeUndefined();
+ });
+
+ it('should delete a notification subscription if the user is editing a subordinate', async() => {
+ const tx = await models.NotificationSubscription.beginTransaction({});
+ let error;
+
+ try {
+ const options = {transaction: tx, accessToken: {userId: 19}};
+ const notificationSubscriptionId = 4;
+ await models.NotificationSubscription.destroyAll({id: notificationSubscriptionId}, options);
+
+ await tx.rollback();
+ } catch (e) {
+ await tx.rollback();
+ error = e;
+ }
+
+ expect(error).toBeUndefined();
});
});
diff --git a/db/changes/232001/00-notificationSubscription.sql b/db/changes/232001/00-notificationSubscription.sql
new file mode 100644
index 000000000..ef081437d
--- /dev/null
+++ b/db/changes/232001/00-notificationSubscription.sql
@@ -0,0 +1,3 @@
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('NotificationSubscription', 'getList', 'READ', 'ALLOW', 'ROLE', 'employee');
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 527fa1108..a9659329f 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -290,5 +290,6 @@
"isTaxDataChecked": "Datos comprobados",
"comercialId": "Id comercial",
"comercialName": "Comercial",
- "Invalid NIF for VIES": "Invalid NIF for VIES"
+ "Invalid NIF for VIES": "Invalid NIF for VIES",
+ "The notification subscription of this worker cant be modified": "La subscripción a la notificación de este trabajador no puede ser modificada"
}
From 5171e63188bbd3dbc5f1b3ab1bf5fa354d9572cd Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 9 May 2023 14:20:20 +0200
Subject: [PATCH 005/427] refs #4797 minor fixes
---
back/methods/notification/getList.js | 8 ++++----
back/methods/notification/specs/getList.spec.js | 7 -------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/back/methods/notification/getList.js b/back/methods/notification/getList.js
index 9f3367184..f8a163126 100644
--- a/back/methods/notification/getList.js
+++ b/back/methods/notification/getList.js
@@ -50,7 +50,7 @@ module.exports = Self => {
}
}, myOptions);
- activeNotifications.forEach(subscription => {
+ for (subscription of activeNotifications) {
notifications.push({
id: subscription.id,
notificationFk: subscription.notificationFk,
@@ -58,9 +58,9 @@ module.exports = Self => {
description: subscription.notification().description,
active: true
});
- });
+ }
- availableNotifications.forEach(acl => {
+ for (acl of availableNotifications) {
const activeNotif = notifications.find(
notif => notif.notificationFk === acl.notificationFk
);
@@ -73,7 +73,7 @@ module.exports = Self => {
active: false,
});
}
- });
+ }
return notifications;
};
diff --git a/back/methods/notification/specs/getList.spec.js b/back/methods/notification/specs/getList.spec.js
index b220f2215..7c986eba2 100644
--- a/back/methods/notification/specs/getList.spec.js
+++ b/back/methods/notification/specs/getList.spec.js
@@ -28,11 +28,4 @@ describe('NotificationSubscription getList()', () => {
expect(result.filter(notification => notification.active == false).length)
.toEqual(availableNotifications.length - activeNotifications.length);
});
-
- it('should return empty from a non existent user', async() => {
- const userId = 123456789;
- const result = await models.NotificationSubscription.getList(userId);
-
- expect(result.length).toEqual(0);
- });
});
From f9e7963e74c1c2701e89c8ba9e47663f97381b64 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Wed, 10 May 2023 14:10:00 +0200
Subject: [PATCH 006/427] refs #4797 minor fixes
---
back/methods/notification/getList.js | 48 +++++++++----------------
back/models/notificationSubscription.js | 4 +--
2 files changed, 18 insertions(+), 34 deletions(-)
diff --git a/back/methods/notification/getList.js b/back/methods/notification/getList.js
index f8a163126..cb0f1a4f9 100644
--- a/back/methods/notification/getList.js
+++ b/back/methods/notification/getList.js
@@ -21,7 +21,7 @@ module.exports = Self => {
});
Self.getList = async(id, options) => {
- const notifications = [];
+ const notifications = new Map();
const models = Self.app.models;
const myOptions = {};
@@ -29,11 +29,6 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
- const activeNotifications = await models.NotificationSubscription.find({
- include: {relation: 'notification'},
- where: {userFk: id}
- }, myOptions);
-
const roles = await models.RoleMapping.find({
fields: ['roleId'],
where: {principalId: id}
@@ -43,38 +38,29 @@ module.exports = Self => {
include: {relation: 'notification'},
where: {
roleFk: {
- inq: roles.map(role => {
- return role.roleId;
- }),
+ inq: roles.map(role => role.roleId),
},
}
}, myOptions);
- for (subscription of activeNotifications) {
- notifications.push({
- id: subscription.id,
- notificationFk: subscription.notificationFk,
- name: subscription.notification().name,
- description: subscription.notification().description,
- active: true
+ for (acl of availableNotifications) {
+ notifications.set(acl.notificationFk, {
+ id: null,
+ notificationFk: acl.notificationFk,
+ name: acl.notification().name,
+ description: acl.notification().description,
+ active: false,
});
}
- for (acl of availableNotifications) {
- const activeNotif = notifications.find(
- notif => notif.notificationFk === acl.notificationFk
- );
- if (!activeNotif) {
- notifications.push({
- id: null,
- notificationFk: acl.notificationFk,
- name: acl.notification().name,
- description: acl.notification().description,
- active: false,
- });
- }
- }
+ const activeNotifications = await models.NotificationSubscription.find({
+ include: {relation: 'notification'},
+ where: {userFk: id}
+ }, myOptions);
- return notifications;
+ for (subscription of activeNotifications)
+ notifications.get(subscription.notificationFk).active = true;
+
+ return [...notifications.values()];
};
};
diff --git a/back/models/notificationSubscription.js b/back/models/notificationSubscription.js
index a4d4a8bac..f750a0528 100644
--- a/back/models/notificationSubscription.js
+++ b/back/models/notificationSubscription.js
@@ -30,9 +30,7 @@ module.exports = Self => {
const worker = await models.Worker.findById(workerId, {fields: ['id', 'bossFk']});
const notificationsAvailables = await models.NotificationSubscription.getList(workerId);
- const hasAcl = notificationsAvailables.some(function(available) {
- return available.notificationFk === notificationFk;
- });
+ const hasAcl = notificationsAvailables.some(available => available.notificationFk === notificationFk);
if (!hasAcl || (userId != worker.id && userId != worker.bossFk))
throw new UserError('The notification subscription of this worker cant be modified');
From 9cb756544e69ec3561d153604145067d5e01d752 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Wed, 10 May 2023 14:13:38 +0200
Subject: [PATCH 007/427] refs #4797 added id to notification in
activeNotifications
---
back/methods/notification/getList.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/back/methods/notification/getList.js b/back/methods/notification/getList.js
index cb0f1a4f9..fe5aa23a5 100644
--- a/back/methods/notification/getList.js
+++ b/back/methods/notification/getList.js
@@ -58,8 +58,13 @@ module.exports = Self => {
where: {userFk: id}
}, myOptions);
- for (subscription of activeNotifications)
- notifications.get(subscription.notificationFk).active = true;
+ for (subscription of activeNotifications) {
+ const notification = notifications.get(subscription.notificationFk);
+ if (notification) {
+ notification.active = true;
+ notification.id = subscription.id;
+ }
+ }
return [...notifications.values()];
};
From 33ef9bdf61ea9f42a3ef5053ab81a5fe5a95be61 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Thu, 11 May 2023 07:18:58 +0200
Subject: [PATCH 008/427] refs #4797 refactor
---
back/methods/notification/getList.js | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/back/methods/notification/getList.js b/back/methods/notification/getList.js
index fe5aa23a5..35a0498c0 100644
--- a/back/methods/notification/getList.js
+++ b/back/methods/notification/getList.js
@@ -43,6 +43,11 @@ module.exports = Self => {
}
}, myOptions);
+ const activeNotifications = await models.NotificationSubscription.find({
+ include: {relation: 'notification'},
+ where: {userFk: id}
+ }, myOptions);
+
for (acl of availableNotifications) {
notifications.set(acl.notificationFk, {
id: null,
@@ -53,17 +58,14 @@ module.exports = Self => {
});
}
- const activeNotifications = await models.NotificationSubscription.find({
- include: {relation: 'notification'},
- where: {userFk: id}
- }, myOptions);
-
for (subscription of activeNotifications) {
- const notification = notifications.get(subscription.notificationFk);
- if (notification) {
- notification.active = true;
- notification.id = subscription.id;
- }
+ notifications.set(subscription.notificationFk, {
+ id: subscription.id,
+ notificationFk: subscription.notificationFk,
+ name: subscription.notification().name,
+ description: subscription.notification().description,
+ active: true,
+ });
}
return [...notifications.values()];
From 2c254cbc089ab55d2d0c2f3a91edc5704dd7487b Mon Sep 17 00:00:00 2001
From: alexandre
Date: Mon, 15 May 2023 14:34:32 +0200
Subject: [PATCH 009/427] refs #4797 added fields
---
back/methods/notification/getList.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/back/methods/notification/getList.js b/back/methods/notification/getList.js
index 35a0498c0..780b8eb74 100644
--- a/back/methods/notification/getList.js
+++ b/back/methods/notification/getList.js
@@ -35,6 +35,7 @@ module.exports = Self => {
}, myOptions);
const availableNotifications = await models.NotificationAcl.find({
+ fields: ['notificationFk', 'roleFk'],
include: {relation: 'notification'},
where: {
roleFk: {
@@ -44,6 +45,7 @@ module.exports = Self => {
}, myOptions);
const activeNotifications = await models.NotificationSubscription.find({
+ fields: ['id', 'notificationFk'],
include: {relation: 'notification'},
where: {userFk: id}
}, myOptions);
From 8db7a5b16a812c4b74adfb77782bcbb8e42b5c7d Mon Sep 17 00:00:00 2001
From: alexandre
Date: Thu, 18 May 2023 14:53:09 +0200
Subject: [PATCH 010/427] refs #4797 moved sql
---
db/changes/232201/.gitkeep | 0
db/changes/{232001 => 232201}/00-notificationSubscription.sql | 0
2 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 db/changes/232201/.gitkeep
rename db/changes/{232001 => 232201}/00-notificationSubscription.sql (100%)
diff --git a/db/changes/232201/.gitkeep b/db/changes/232201/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/db/changes/232001/00-notificationSubscription.sql b/db/changes/232201/00-notificationSubscription.sql
similarity index 100%
rename from db/changes/232001/00-notificationSubscription.sql
rename to db/changes/232201/00-notificationSubscription.sql
From 6e4d7e8b01682e3327c82213d4b44a0cb12b30ec Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 6 Jun 2023 10:31:08 +0200
Subject: [PATCH 011/427] refs #5749 added id
---
db/changes/232401/00-zoneIncluded.sql | 27 +++++++++++++++++++
.../back/methods/zone/toggleIsIncluded.js | 15 +++++++----
modules/zone/back/models/zone-included.json | 4 +--
3 files changed, 39 insertions(+), 7 deletions(-)
create mode 100644 db/changes/232401/00-zoneIncluded.sql
diff --git a/db/changes/232401/00-zoneIncluded.sql b/db/changes/232401/00-zoneIncluded.sql
new file mode 100644
index 000000000..592350629
--- /dev/null
+++ b/db/changes/232401/00-zoneIncluded.sql
@@ -0,0 +1,27 @@
+ALTER TABLE `vn`.`zoneIncluded`
+ ADD COLUMN `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
+ DROP PRIMARY KEY,
+ DROP FOREIGN KEY `zoneFk2`,
+ DROP FOREIGN KEY `zoneGeoFk2`,
+ DROP KEY `geoFk_idx`,
+ ADD PRIMARY KEY (`id`),
+ ADD CONSTRAINT `zoneIncluded_FK_1` FOREIGN KEY (zoneFk) REFERENCES `vn`.`zone`(id) ON DELETE CASCADE ON UPDATE CASCADE,
+ ADD CONSTRAINT `zoneIncluded_FK_2` FOREIGN KEY (geoFk) REFERENCES `vn`.`zoneGeo`(id) ON DELETE CASCADE ON UPDATE CASCADE,
+ ADD CONSTRAINT `unique_zone_geo` UNIQUE (`zoneFk`, `geoFk`);
+
+DROP TRIGGER IF EXISTS `vn`.`zoneIncluded_afterDelete`;
+USE `vn`;
+
+DELIMITER $$
+$$
+CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`zoneIncluded_afterDelete`
+ AFTER DELETE ON `zoneIncluded`
+ FOR EACH ROW
+BEGIN
+ INSERT INTO zoneLog
+ SET `action` = 'delete',
+ `changedModel` = 'ZoneIncluded',
+ `changedModelId` = OLD.id,
+ `userFk` = account.myUser_getId();
+END$$
+DELIMITER ;
diff --git a/modules/zone/back/methods/zone/toggleIsIncluded.js b/modules/zone/back/methods/zone/toggleIsIncluded.js
index bf8c86f46..06532e5c0 100644
--- a/modules/zone/back/methods/zone/toggleIsIncluded.js
+++ b/modules/zone/back/methods/zone/toggleIsIncluded.js
@@ -37,11 +37,16 @@ module.exports = Self => {
if (isIncluded === undefined)
return models.ZoneIncluded.destroyAll({zoneFk: id, geoFk: geoId}, myOptions);
else {
- return models.ZoneIncluded.upsert({
- zoneFk: id,
- geoFk: geoId,
- isIncluded: isIncluded
- }, myOptions);
+ const zoneIncluded = await models.ZoneIncluded.findOne({where: {zoneFk: id, geoFk: geoId}}, myOptions);
+ if (zoneIncluded)
+ return zoneIncluded.updateAttribute('isIncluded', isIncluded, myOptions);
+ else {
+ return models.ZoneIncluded.create({
+ zoneFk: id,
+ geoFk: geoId,
+ isIncluded: isIncluded
+ }, myOptions);
+ }
}
};
};
diff --git a/modules/zone/back/models/zone-included.json b/modules/zone/back/models/zone-included.json
index 61633a3c7..deba73f34 100644
--- a/modules/zone/back/models/zone-included.json
+++ b/modules/zone/back/models/zone-included.json
@@ -7,8 +7,8 @@
}
},
"properties": {
- "zoneFk": {
- "id": true,
+ "id": {
+ "id": true,
"type": "number"
},
"isIncluded": {
From be973138566e555c3e5f54f0ed78cdfa7257d302 Mon Sep 17 00:00:00 2001
From: jgallego
Date: Wed, 7 Jun 2023 15:40:25 +0200
Subject: [PATCH 012/427] refs #4059
---
db/changes/232001/00-aclClient.sql | 40 +++++++++++++++++++++++++++++
db/changes/232001/01-aclAccount.sql | 13 ++++++++++
2 files changed, 53 insertions(+)
create mode 100644 db/changes/232001/00-aclClient.sql
create mode 100644 db/changes/232001/01-aclAccount.sql
diff --git a/db/changes/232001/00-aclClient.sql b/db/changes/232001/00-aclClient.sql
new file mode 100644
index 000000000..dec6f6136
--- /dev/null
+++ b/db/changes/232001/00-aclClient.sql
@@ -0,0 +1,40 @@
+-- No encuentro este back
+DELETE FROM salix.ACL WHERE property = 'activeWorkersWithRole';
+DELETE FROM salix.ACL WHERE model = 'Client' AND property = '*';
+
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Client','findOne','READ','ALLOW','ROLE','employee');
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Client','findById','READ','ALLOW','ROLE','employee');
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Client','find','READ','ALLOW','ROLE','employee');
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Client','exists','READ','ALLOW','ROLE','employee');
+
+DELETE FROM salix.ACL WHERE model = 'Client' AND accessType = '*' AND property IN (
+ 'campaignMetricsEmail',
+ 'campaignMetricsPdf',
+ 'clientDebtStatementEmail',
+ 'clientDebtStatementHtml',
+ 'clientDebtStatementPdf',
+ 'clientWelcomeEmail',
+ 'clientWelcomeHtml',
+ 'consumptionSendQueued',
+ 'creditRequestEmail',
+ 'creditRequestHtml',
+ 'creditRequestPdf',
+ 'getClientOrSupplierReference',
+ 'incotermsAuthorizationEmail',
+ 'incotermsAuthorizationHtml',
+ 'incotermsAuthorizationPdf',
+ 'letterDebtorNdEmail',
+ 'letterDebtorNdHtml',
+ 'letterDebtorPdf',
+ 'letterDebtorStEmail',
+ 'letterDebtorStHtml',
+ 'printerSetupEmail',
+ 'printerSetupHtml',
+ 'sepaCoreEmail',
+ 'setPassword',
+ 'updateUser',
+ 'uploadFile');
\ No newline at end of file
diff --git a/db/changes/232001/01-aclAccount.sql b/db/changes/232001/01-aclAccount.sql
new file mode 100644
index 000000000..f618ca842
--- /dev/null
+++ b/db/changes/232001/01-aclAccount.sql
@@ -0,0 +1,13 @@
+DELETE FROM salix.ACL WHERE model = 'Account' AND property = '*';
+
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Account','findOne','READ','ALLOW','ROLE','employee');
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Account','findById','READ','ALLOW','ROLE','employee');
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Account','find','READ','ALLOW','ROLE','employee');
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Account','exists','READ','ALLOW','ROLE','employee');
+
+DELETE FROM salix.ACL WHERE id=529;
+-- 529 VnUser changePassword WRITE ALLOW ROLE account
\ No newline at end of file
From c9c9b64884c5bb05d240378a954052c48cf49119 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 12 Jun 2023 14:57:41 +0200
Subject: [PATCH 013/427] refs #5660 deliveryAssit
---
modules/supplier/front/address/create/index.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/supplier/front/address/create/index.html b/modules/supplier/front/address/create/index.html
index 4d66b70f0..e561501c0 100644
--- a/modules/supplier/front/address/create/index.html
+++ b/modules/supplier/front/address/create/index.html
@@ -42,7 +42,7 @@
show-field="code"
rule>
- {{code}} - {{town.name}} ({{town.province.name}},
+ {{code}} - {{town.name}} ({{town.province.name}},
{{town.province.country.country}})
@@ -50,12 +50,12 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
-
-
\ No newline at end of file
+
From 908799adeeebc1ce77d4e6bd7bf87b5868f90d17 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 12 Jun 2023 14:58:28 +0200
Subject: [PATCH 014/427] refs #5660 deliveryAssit
---
db/changes/232601/00-deliveryAssistantACL.sql | 7 +++++
.../00-useSpecificsAcls.sql | 4 +--
.../01-deliveryAssistantInheritRole.sql | 23 ++++++++++++++++
db/dump/dumpedFixtures.sql | 4 +--
e2e/paths/02-client/01_create_client.spec.js | 2 +-
e2e/paths/03-worker/06_create.spec.js | 2 +-
e2e/paths/11-zone/01_basic-data.spec.js | 3 ++-
e2e/paths/11-zone/02_descriptor.spec.js | 2 +-
.../client/front/address/create/index.html | 12 ++++-----
modules/client/front/address/edit/index.html | 18 ++++++-------
modules/client/front/create/index.html | 12 ++++-----
modules/client/front/fiscal-data/index.html | 2 +-
modules/client/front/postcode/index.html | 6 ++---
modules/route/front/descriptor/index.html | 16 ++++++------
modules/route/front/tickets/index.html | 8 +++---
.../supplier/front/address/edit/index.html | 12 ++++-----
modules/supplier/front/fiscal-data/index.html | 2 +-
modules/worker/front/create/index.html | 2 +-
modules/zone/front/basic-data/index.html | 26 +++++++++----------
modules/zone/front/index/index.html | 6 ++---
modules/zone/front/location/index.html | 6 ++---
21 files changed, 103 insertions(+), 72 deletions(-)
create mode 100644 db/changes/232601/00-deliveryAssistantACL.sql
rename db/changes/{232401 => 232601}/00-useSpecificsAcls.sql (99%)
create mode 100644 db/changes/232601/01-deliveryAssistantInheritRole.sql
diff --git a/db/changes/232601/00-deliveryAssistantACL.sql b/db/changes/232601/00-deliveryAssistantACL.sql
new file mode 100644
index 000000000..6c829867a
--- /dev/null
+++ b/db/changes/232601/00-deliveryAssistantACL.sql
@@ -0,0 +1,7 @@
+-- Auto-generated SQL script #202306121356
+UPDATE `account`.`role`
+ SET `description` = 'Asistente de envios'
+ WHERE `name` = 'deliveryAssist';
+
+
+
diff --git a/db/changes/232401/00-useSpecificsAcls.sql b/db/changes/232601/00-useSpecificsAcls.sql
similarity index 99%
rename from db/changes/232401/00-useSpecificsAcls.sql
rename to db/changes/232601/00-useSpecificsAcls.sql
index 0d17ca948..cfe60ec9c 100644
--- a/db/changes/232401/00-useSpecificsAcls.sql
+++ b/db/changes/232601/00-useSpecificsAcls.sql
@@ -3,11 +3,11 @@ INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `pri
('Ticket', 'editDiscount', 'WRITE', 'ALLOW', 'ROLE', 'claimManager'),
('Ticket', 'editDiscount', 'WRITE', 'ALLOW', 'ROLE', 'salesPerson'),
('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'salesAssistant'),
- ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'deliveryBoss'),
+ ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'deliveryAssist'),
('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'buyer'),
('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'claimManager'),
('Ticket', 'deleteTicketWithPartPrepared', 'WRITE', 'ALLOW', 'ROLE', 'salesAssistant'),
- ('Ticket', 'editZone', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss'),
+ ('Ticket', 'editZone', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssist'),
('State', 'editableStates', 'READ', 'ALLOW', 'ROLE', 'employee'),
('State', 'seeEditableStates', 'READ', 'ALLOW', 'ROLE', 'administrative'),
('State', 'seeEditableStates', 'READ', 'ALLOW', 'ROLE', 'production'),
diff --git a/db/changes/232601/01-deliveryAssistantInheritRole.sql b/db/changes/232601/01-deliveryAssistantInheritRole.sql
new file mode 100644
index 000000000..ad4d7dd1e
--- /dev/null
+++ b/db/changes/232601/01-deliveryAssistantInheritRole.sql
@@ -0,0 +1,23 @@
+-- -- Auto-generated SQL script #202306121403
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,1);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,2);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,3);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,6);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,11);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,13);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,33);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,56);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,57);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,70);
+-- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+-- VALUES (117,76);
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index abb5516f7..67b77d587 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -78,7 +78,7 @@ USE `account`;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
-INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-12 08:47:34',19294),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL);
+INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryAssist','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-12 08:47:34',19294),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
@@ -164,7 +164,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(290,'MailAlias','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(300,'Docuware','*','*','ALLOW','ROLE','employee'),(301,'Agency','*','READ','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(490,'Client','updateUser','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(526,'VnUser','*','*','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(529,'VnUser','changePassword','WRITE','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee');
+INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryAssist'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryAssist'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryAssist'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryAssist'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryAssist'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryAssist'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryAssist'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryAssist'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryAssist'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(290,'MailAlias','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(300,'Docuware','*','*','ALLOW','ROLE','employee'),(301,'Agency','*','READ','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryAssist'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryAssist'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(490,'Client','updateUser','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(526,'VnUser','*','*','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(529,'VnUser','changePassword','WRITE','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/e2e/paths/02-client/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js
index ff2aac6b9..9be9a5915 100644
--- a/e2e/paths/02-client/01_create_client.spec.js
+++ b/e2e/paths/02-client/01_create_client.spec.js
@@ -8,7 +8,7 @@ describe('Client create path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule(' deliveryBoss', 'client');
+ await page.loginAndModule(' deliveryAssist', 'client');
});
afterAll(async() => {
diff --git a/e2e/paths/03-worker/06_create.spec.js b/e2e/paths/03-worker/06_create.spec.js
index 98e67edbf..3257f170f 100644
--- a/e2e/paths/03-worker/06_create.spec.js
+++ b/e2e/paths/03-worker/06_create.spec.js
@@ -45,7 +45,7 @@ describe('Worker create path', () => {
// should create a new worker and go to worker basic data'
await page.pickDate(selectors.workerCreate.birth, new Date(1962, 8, 5));
- await page.autocompleteSearch(selectors.workerCreate.boss, 'deliveryBoss');
+ await page.autocompleteSearch(selectors.workerCreate.boss, 'deliveryAssist');
await page.waitToClick(selectors.workerCreate.createButton);
message = await page.waitForSnackbar();
await page.waitForState('worker.card.basicData');
diff --git a/e2e/paths/11-zone/01_basic-data.spec.js b/e2e/paths/11-zone/01_basic-data.spec.js
index ded40579d..be83ed565 100644
--- a/e2e/paths/11-zone/01_basic-data.spec.js
+++ b/e2e/paths/11-zone/01_basic-data.spec.js
@@ -8,7 +8,8 @@ describe('Zone basic data path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('deliveryBoss', 'zone'); // turns up the zone module name and route aint the same lol
+ // eslint-disable-next-line max-len
+ await page.loginAndModule('deliveryAssist', 'zone'); // turns up the zone module name and route aint the same lol
await page.accessToSearchResult('10');
await page.accessToSection('zone.card.basicData');
});
diff --git a/e2e/paths/11-zone/02_descriptor.spec.js b/e2e/paths/11-zone/02_descriptor.spec.js
index f3c0e7740..56340efe7 100644
--- a/e2e/paths/11-zone/02_descriptor.spec.js
+++ b/e2e/paths/11-zone/02_descriptor.spec.js
@@ -8,7 +8,7 @@ describe('Zone descriptor path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('deliveryBoss', 'zone');
+ await page.loginAndModule('deliveryAssist', 'zone');
await page.accessToSearchResult('13');
});
diff --git a/modules/client/front/address/create/index.html b/modules/client/front/address/create/index.html
index 96bd8f114..1e2bf1470 100644
--- a/modules/client/front/address/create/index.html
+++ b/modules/client/front/address/create/index.html
@@ -31,7 +31,7 @@
-
+
- {{code}} - {{town.name}} ({{town.province.name}},
+ {{code}} - {{town.name}} ({{town.province.name}},
{{town.province.country.country}})
@@ -68,12 +68,12 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
-
-
@@ -190,4 +190,4 @@
-
\ No newline at end of file
+
diff --git a/modules/client/front/address/edit/index.html b/modules/client/front/address/edit/index.html
index 1f0b7d30a..0ba780ef8 100644
--- a/modules/client/front/address/edit/index.html
+++ b/modules/client/front/address/edit/index.html
@@ -73,20 +73,20 @@
show-field="code"
rule>
- {{code}} - {{town.name}} ({{town.province.name}},
+ {{code}} - {{town.name}} ({{town.province.name}},
{{town.province.country.country}})
-
-
-
+
@@ -197,12 +197,12 @@
-
-
@@ -234,4 +234,4 @@
-
\ No newline at end of file
+
diff --git a/modules/client/front/create/index.html b/modules/client/front/create/index.html
index 3e7fdd949..dd13e7a10 100644
--- a/modules/client/front/create/index.html
+++ b/modules/client/front/create/index.html
@@ -26,7 +26,7 @@
-
- {{code}} - {{town.name}} ({{town.province.name}},
+ {{code}} - {{town.name}} ({{town.province.name}},
{{town.province.country.country}})
@@ -76,13 +76,13 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
- {{name}}, {{province.name}}
+ {{name}}, {{province.name}}
({{province.country.country}})
@@ -150,4 +150,4 @@
-
\ No newline at end of file
+
diff --git a/modules/client/front/fiscal-data/index.html b/modules/client/front/fiscal-data/index.html
index d232d6dab..8dffcf4ca 100644
--- a/modules/client/front/fiscal-data/index.html
+++ b/modules/client/front/fiscal-data/index.html
@@ -92,7 +92,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
diff --git a/modules/client/front/postcode/index.html b/modules/client/front/postcode/index.html
index 8f9f35eb8..ad1580945 100644
--- a/modules/client/front/postcode/index.html
+++ b/modules/client/front/postcode/index.html
@@ -27,7 +27,7 @@
icon="add_circle"
vn-tooltip="New city"
ng-click="city.open($event)"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
@@ -45,7 +45,7 @@
icon="add_circle"
vn-tooltip="New province"
ng-click="province.open($event)"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
@@ -73,4 +73,4 @@
-
\ No newline at end of file
+
diff --git a/modules/route/front/descriptor/index.html b/modules/route/front/descriptor/index.html
index 6d6fb082e..8b6cf6535 100644
--- a/modules/route/front/descriptor/index.html
+++ b/modules/route/front/descriptor/index.html
@@ -15,14 +15,14 @@
Update volume
Delete route
@@ -31,23 +31,23 @@
@@ -72,4 +72,4 @@
-
\ No newline at end of file
+
diff --git a/modules/route/front/tickets/index.html b/modules/route/front/tickets/index.html
index 32a4a2d7c..5723b118f 100644
--- a/modules/route/front/tickets/index.html
+++ b/modules/route/front/tickets/index.html
@@ -37,7 +37,7 @@
icon="format_list_numbered">
{{::ticket.street}}
-
diff --git a/modules/supplier/front/address/edit/index.html b/modules/supplier/front/address/edit/index.html
index dd4cbb4d2..2dbb34f15 100644
--- a/modules/supplier/front/address/edit/index.html
+++ b/modules/supplier/front/address/edit/index.html
@@ -40,20 +40,20 @@
show-field="code"
rule>
- {{code}} - {{town.name}} ({{town.province.name}},
+ {{code}} - {{town.name}} ({{town.province.name}},
{{town.province.country.country}})
-
-
-
-
\ No newline at end of file
+
diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html
index 218fe284d..ed6798c3c 100644
--- a/modules/supplier/front/fiscal-data/index.html
+++ b/modules/supplier/front/fiscal-data/index.html
@@ -150,7 +150,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
diff --git a/modules/worker/front/create/index.html b/modules/worker/front/create/index.html
index eb45704a7..24f719a68 100644
--- a/modules/worker/front/create/index.html
+++ b/modules/worker/front/create/index.html
@@ -72,7 +72,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
vn-acl-action="remove">
diff --git a/modules/zone/front/basic-data/index.html b/modules/zone/front/basic-data/index.html
index 8d8fc6c56..39fb25fae 100644
--- a/modules/zone/front/basic-data/index.html
+++ b/modules/zone/front/basic-data/index.html
@@ -12,9 +12,9 @@
@@ -26,7 +26,7 @@
show-field="name"
value-field="id"
label="Agency"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
rule>
@@ -52,13 +52,13 @@
ng-model="$ctrl.zone.travelingDays"
min="0"
step="1"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
rule>
@@ -68,16 +68,16 @@
ng-model="$ctrl.zone.price"
min="0"
step="0.01"
- vn-acl="deliveryBoss"
+ vn-acl="deliveryAssist"
rule>
-
+
@@ -101,7 +101,7 @@
-
diff --git a/modules/zone/front/location/index.html b/modules/zone/front/location/index.html
index a9e9261a8..caace6660 100644
--- a/modules/zone/front/location/index.html
+++ b/modules/zone/front/location/index.html
@@ -16,12 +16,12 @@
root-label="Locations"
fetch-func="$ctrl.onFetch($item)"
sort-func="$ctrl.onSort($a, $b)">
-
+ label="{{::item.name}}">
From ee5677ecb60ec030d10bd4e8a311572a3563f871 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Fri, 16 Jun 2023 09:28:56 +0200
Subject: [PATCH 015/427] refs #5660 fix line
---
e2e/paths/11-zone/01_basic-data.spec.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/e2e/paths/11-zone/01_basic-data.spec.js b/e2e/paths/11-zone/01_basic-data.spec.js
index be83ed565..c06f955c6 100644
--- a/e2e/paths/11-zone/01_basic-data.spec.js
+++ b/e2e/paths/11-zone/01_basic-data.spec.js
@@ -8,8 +8,9 @@ describe('Zone basic data path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- // eslint-disable-next-line max-len
- await page.loginAndModule('deliveryAssist', 'zone'); // turns up the zone module name and route aint the same lol
+
+ await page.loginAndModule('deliveryAssist',
+ 'zone'); // turns up the zone module name and route aint the same lol
await page.accessToSearchResult('10');
await page.accessToSection('zone.card.basicData');
});
From 9870cc7b14c290af7e1d922e257d1f15f76ba5ff Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 21 Jun 2023 13:34:27 +0200
Subject: [PATCH 016/427] refs #5660 change assist
---
db/changes/232601/00-deliveryAssistantACL.sql | 2 +-
db/changes/232601/00-useSpecificsAcls.sql | 4 ++--
db/dump/dumpedFixtures.sql | 4 ++--
e2e/paths/02-client/01_create_client.spec.js | 2 +-
e2e/paths/03-worker/06_create.spec.js | 2 +-
e2e/paths/11-zone/01_basic-data.spec.js | 2 +-
e2e/paths/11-zone/02_descriptor.spec.js | 2 +-
.../client/front/address/create/index.html | 2 +-
modules/client/front/address/edit/index.html | 2 +-
modules/client/front/create/index.html | 2 +-
modules/client/front/fiscal-data/index.html | 2 +-
modules/client/front/postcode/index.html | 4 ++--
modules/route/front/descriptor/index.html | 4 ++--
modules/route/front/tickets/index.html | 2 +-
.../supplier/front/address/create/index.html | 2 +-
.../supplier/front/address/edit/index.html | 2 +-
modules/supplier/front/fiscal-data/index.html | 2 +-
modules/worker/front/create/index.html | 2 +-
modules/zone/front/basic-data/index.html | 22 +++++++++----------
modules/zone/front/index/index.html | 4 ++--
modules/zone/front/location/index.html | 2 +-
21 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/db/changes/232601/00-deliveryAssistantACL.sql b/db/changes/232601/00-deliveryAssistantACL.sql
index 6c829867a..e5152087e 100644
--- a/db/changes/232601/00-deliveryAssistantACL.sql
+++ b/db/changes/232601/00-deliveryAssistantACL.sql
@@ -1,7 +1,7 @@
-- Auto-generated SQL script #202306121356
UPDATE `account`.`role`
SET `description` = 'Asistente de envios'
- WHERE `name` = 'deliveryAssist';
+ WHERE `name` = 'deliveryAssistant';
diff --git a/db/changes/232601/00-useSpecificsAcls.sql b/db/changes/232601/00-useSpecificsAcls.sql
index cfe60ec9c..d124786f6 100644
--- a/db/changes/232601/00-useSpecificsAcls.sql
+++ b/db/changes/232601/00-useSpecificsAcls.sql
@@ -3,11 +3,11 @@ INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `pri
('Ticket', 'editDiscount', 'WRITE', 'ALLOW', 'ROLE', 'claimManager'),
('Ticket', 'editDiscount', 'WRITE', 'ALLOW', 'ROLE', 'salesPerson'),
('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'salesAssistant'),
- ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'deliveryAssist'),
+ ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'buyer'),
('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'claimManager'),
('Ticket', 'deleteTicketWithPartPrepared', 'WRITE', 'ALLOW', 'ROLE', 'salesAssistant'),
- ('Ticket', 'editZone', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssist'),
+ ('Ticket', 'editZone', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssistant'),
('State', 'editableStates', 'READ', 'ALLOW', 'ROLE', 'employee'),
('State', 'seeEditableStates', 'READ', 'ALLOW', 'ROLE', 'administrative'),
('State', 'seeEditableStates', 'READ', 'ALLOW', 'ROLE', 'production'),
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 52c6e1073..3403ffaf3 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -78,7 +78,7 @@ USE `account`;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
-INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryAssist','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-12 08:47:34',19294),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL);
+INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryAssistantant','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-12 08:47:34',19294),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
@@ -164,7 +164,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryAssist'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryAssist'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryAssist'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryAssist'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryAssist'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryAssist'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryAssist'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryAssist'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryAssist'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(290,'MailAlias','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(300,'Docuware','*','*','ALLOW','ROLE','employee'),(301,'Agency','*','READ','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryAssist'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryAssist'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(490,'Client','updateUser','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(526,'VnUser','*','*','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(529,'VnUser','changePassword','WRITE','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee');
+INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryAssistantant'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryAssistant'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryAssistant'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(290,'MailAlias','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(300,'Docuware','*','*','ALLOW','ROLE','employee'),(301,'Agency','*','READ','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryAssistant'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(490,'Client','updateUser','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(526,'VnUser','*','*','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(529,'VnUser','changePassword','WRITE','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/e2e/paths/02-client/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js
index 9be9a5915..889f7c058 100644
--- a/e2e/paths/02-client/01_create_client.spec.js
+++ b/e2e/paths/02-client/01_create_client.spec.js
@@ -8,7 +8,7 @@ describe('Client create path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule(' deliveryAssist', 'client');
+ await page.loginAndModule(' deliveryAssistant', 'client');
});
afterAll(async() => {
diff --git a/e2e/paths/03-worker/06_create.spec.js b/e2e/paths/03-worker/06_create.spec.js
index 3257f170f..0c0822c51 100644
--- a/e2e/paths/03-worker/06_create.spec.js
+++ b/e2e/paths/03-worker/06_create.spec.js
@@ -45,7 +45,7 @@ describe('Worker create path', () => {
// should create a new worker and go to worker basic data'
await page.pickDate(selectors.workerCreate.birth, new Date(1962, 8, 5));
- await page.autocompleteSearch(selectors.workerCreate.boss, 'deliveryAssist');
+ await page.autocompleteSearch(selectors.workerCreate.boss, 'deliveryAssistant');
await page.waitToClick(selectors.workerCreate.createButton);
message = await page.waitForSnackbar();
await page.waitForState('worker.card.basicData');
diff --git a/e2e/paths/11-zone/01_basic-data.spec.js b/e2e/paths/11-zone/01_basic-data.spec.js
index c06f955c6..34d08c57f 100644
--- a/e2e/paths/11-zone/01_basic-data.spec.js
+++ b/e2e/paths/11-zone/01_basic-data.spec.js
@@ -9,7 +9,7 @@ describe('Zone basic data path', () => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('deliveryAssist',
+ await page.loginAndModule('deliveryAssistant',
'zone'); // turns up the zone module name and route aint the same lol
await page.accessToSearchResult('10');
await page.accessToSection('zone.card.basicData');
diff --git a/e2e/paths/11-zone/02_descriptor.spec.js b/e2e/paths/11-zone/02_descriptor.spec.js
index 56340efe7..baccc910f 100644
--- a/e2e/paths/11-zone/02_descriptor.spec.js
+++ b/e2e/paths/11-zone/02_descriptor.spec.js
@@ -8,7 +8,7 @@ describe('Zone descriptor path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('deliveryAssist', 'zone');
+ await page.loginAndModule('deliveryAssistant', 'zone');
await page.accessToSearchResult('13');
});
diff --git a/modules/client/front/address/create/index.html b/modules/client/front/address/create/index.html
index 1e2bf1470..20e7b38e1 100644
--- a/modules/client/front/address/create/index.html
+++ b/modules/client/front/address/create/index.html
@@ -68,7 +68,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/client/front/address/edit/index.html b/modules/client/front/address/edit/index.html
index 0ba780ef8..e6b1dc71e 100644
--- a/modules/client/front/address/edit/index.html
+++ b/modules/client/front/address/edit/index.html
@@ -81,7 +81,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/client/front/create/index.html b/modules/client/front/create/index.html
index dd13e7a10..b2f1236b7 100644
--- a/modules/client/front/create/index.html
+++ b/modules/client/front/create/index.html
@@ -76,7 +76,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/client/front/fiscal-data/index.html b/modules/client/front/fiscal-data/index.html
index 8dffcf4ca..18127db6a 100644
--- a/modules/client/front/fiscal-data/index.html
+++ b/modules/client/front/fiscal-data/index.html
@@ -92,7 +92,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/client/front/postcode/index.html b/modules/client/front/postcode/index.html
index ad1580945..b3dbb74d8 100644
--- a/modules/client/front/postcode/index.html
+++ b/modules/client/front/postcode/index.html
@@ -27,7 +27,7 @@
icon="add_circle"
vn-tooltip="New city"
ng-click="city.open($event)"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
@@ -45,7 +45,7 @@
icon="add_circle"
vn-tooltip="New province"
ng-click="province.open($event)"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/route/front/descriptor/index.html b/modules/route/front/descriptor/index.html
index 8b6cf6535..4e7e99f1a 100644
--- a/modules/route/front/descriptor/index.html
+++ b/modules/route/front/descriptor/index.html
@@ -15,14 +15,14 @@
Update volume
Delete route
diff --git a/modules/route/front/tickets/index.html b/modules/route/front/tickets/index.html
index 5723b118f..5c6f8bee5 100644
--- a/modules/route/front/tickets/index.html
+++ b/modules/route/front/tickets/index.html
@@ -37,7 +37,7 @@
icon="format_list_numbered">
diff --git a/modules/supplier/front/address/edit/index.html b/modules/supplier/front/address/edit/index.html
index 2dbb34f15..b6f90134b 100644
--- a/modules/supplier/front/address/edit/index.html
+++ b/modules/supplier/front/address/edit/index.html
@@ -48,7 +48,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html
index ed6798c3c..3fe67762f 100644
--- a/modules/supplier/front/fiscal-data/index.html
+++ b/modules/supplier/front/fiscal-data/index.html
@@ -150,7 +150,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/worker/front/create/index.html b/modules/worker/front/create/index.html
index 24f719a68..50daacb7d 100644
--- a/modules/worker/front/create/index.html
+++ b/modules/worker/front/create/index.html
@@ -72,7 +72,7 @@
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
vn-acl-action="remove">
diff --git a/modules/zone/front/basic-data/index.html b/modules/zone/front/basic-data/index.html
index 39fb25fae..5070a3aea 100644
--- a/modules/zone/front/basic-data/index.html
+++ b/modules/zone/front/basic-data/index.html
@@ -14,7 +14,7 @@
@@ -26,7 +26,7 @@
show-field="name"
value-field="id"
label="Agency"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
rule>
@@ -52,13 +52,13 @@
ng-model="$ctrl.zone.travelingDays"
min="0"
step="1"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
rule>
@@ -68,14 +68,14 @@
ng-model="$ctrl.zone.price"
min="0"
step="0.01"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
rule>
@@ -86,14 +86,14 @@
ng-model="$ctrl.zone.inflation"
min="0"
step="0.01"
- vn-acl="deliveryAssist"
+ vn-acl="deliveryAssistant"
rule>
@@ -101,7 +101,7 @@
diff --git a/modules/zone/front/location/index.html b/modules/zone/front/location/index.html
index caace6660..b86c618b7 100644
--- a/modules/zone/front/location/index.html
+++ b/modules/zone/front/location/index.html
@@ -16,7 +16,7 @@
root-label="Locations"
fetch-func="$ctrl.onFetch($item)"
sort-func="$ctrl.onSort($a, $b)">
-
Date: Tue, 27 Jun 2023 13:17:00 +0200
Subject: [PATCH 017/427] refs #5660 change sql
---
.../01-deliveryAssistantInheritRole.sql | 23 -------------------
.../00-deliveryAssistantACL.sql | 0
.../01-deliveryAssistantInheritRole.sql | 23 +++++++++++++++++++
e2e/paths/02-client/01_create_client.spec.js | 2 +-
4 files changed, 24 insertions(+), 24 deletions(-)
delete mode 100644 db/changes/232601/01-deliveryAssistantInheritRole.sql
rename db/changes/{232601 => 232801}/00-deliveryAssistantACL.sql (100%)
create mode 100644 db/changes/232801/01-deliveryAssistantInheritRole.sql
diff --git a/db/changes/232601/01-deliveryAssistantInheritRole.sql b/db/changes/232601/01-deliveryAssistantInheritRole.sql
deleted file mode 100644
index ad4d7dd1e..000000000
--- a/db/changes/232601/01-deliveryAssistantInheritRole.sql
+++ /dev/null
@@ -1,23 +0,0 @@
--- -- Auto-generated SQL script #202306121403
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,1);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,2);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,3);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,6);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,11);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,13);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,33);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,56);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,57);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,70);
--- INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
--- VALUES (117,76);
diff --git a/db/changes/232601/00-deliveryAssistantACL.sql b/db/changes/232801/00-deliveryAssistantACL.sql
similarity index 100%
rename from db/changes/232601/00-deliveryAssistantACL.sql
rename to db/changes/232801/00-deliveryAssistantACL.sql
diff --git a/db/changes/232801/01-deliveryAssistantInheritRole.sql b/db/changes/232801/01-deliveryAssistantInheritRole.sql
new file mode 100644
index 000000000..5b3806fa2
--- /dev/null
+++ b/db/changes/232801/01-deliveryAssistantInheritRole.sql
@@ -0,0 +1,23 @@
+-- Auto-generated SQL script #202306121403
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,1);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,2);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,3);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,6);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,11);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,13);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,33);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,56);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,57);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,70);
+INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
+ VALUES (117,76);
diff --git a/e2e/paths/02-client/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js
index 889f7c058..0fd06402a 100644
--- a/e2e/paths/02-client/01_create_client.spec.js
+++ b/e2e/paths/02-client/01_create_client.spec.js
@@ -8,7 +8,7 @@ describe('Client create path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule(' deliveryAssistant', 'client');
+ await page.loginAndModule('deliveryAssistant', 'client');
});
afterAll(async() => {
From 68b65105fdb5026e5ecec3eb0ae3d5fe7d8ef19c Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 28 Jun 2023 08:02:31 +0200
Subject: [PATCH 018/427] refs #5660 role mod
---
db/changes/232801/00-deliveryAssistantACL.sql | 8 +++---
.../01-deliveryAssistantInheritRole.sql | 28 ++++---------------
2 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/db/changes/232801/00-deliveryAssistantACL.sql b/db/changes/232801/00-deliveryAssistantACL.sql
index e5152087e..94873aece 100644
--- a/db/changes/232801/00-deliveryAssistantACL.sql
+++ b/db/changes/232801/00-deliveryAssistantACL.sql
@@ -1,7 +1,7 @@
--- Auto-generated SQL script #202306121356
-UPDATE `account`.`role`
- SET `description` = 'Asistente de envios'
- WHERE `name` = 'deliveryAssistant';
+-- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values.
+INSERT INTO `account`.`role` (name,description)
+ VALUES ('deliveryAssistant','Asistencia de envios');
+
diff --git a/db/changes/232801/01-deliveryAssistantInheritRole.sql b/db/changes/232801/01-deliveryAssistantInheritRole.sql
index 5b3806fa2..e8146e806 100644
--- a/db/changes/232801/01-deliveryAssistantInheritRole.sql
+++ b/db/changes/232801/01-deliveryAssistantInheritRole.sql
@@ -1,23 +1,5 @@
--- Auto-generated SQL script #202306121403
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,1);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,2);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,3);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,6);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,11);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,13);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,33);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,56);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,57);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,70);
-INSERT INTO `account`.`roleInherit` (`role`,inheritsFrom)
- VALUES (117,76);
+INSERT INTO account.roleInherit
+ SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant'), ri.inheritsFrom
+ FROM account.roleInherit ri
+ JOIN account.role r ON r.id = ri.`role`
+ WHERE r.name = 'deliveryBoss';
\ No newline at end of file
From d32563eec7dcca90e86c8327c2a9c1a98ca07e42 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 28 Jun 2023 08:37:30 +0200
Subject: [PATCH 019/427] refs #5660 delivery
---
db/changes/232801/00-changeRole.sql | 1 +
.../{00-deliveryAssistantACL.sql => 01-deliveryAssistantACL.sql} | 0
...istantInheritRole.sql => 02-deliveryAssistantInheritRole.sql} | 0
3 files changed, 1 insertion(+)
create mode 100644 db/changes/232801/00-changeRole.sql
rename db/changes/232801/{00-deliveryAssistantACL.sql => 01-deliveryAssistantACL.sql} (100%)
rename db/changes/232801/{01-deliveryAssistantInheritRole.sql => 02-deliveryAssistantInheritRole.sql} (100%)
diff --git a/db/changes/232801/00-changeRole.sql b/db/changes/232801/00-changeRole.sql
new file mode 100644
index 000000000..3c8c81edb
--- /dev/null
+++ b/db/changes/232801/00-changeRole.sql
@@ -0,0 +1 @@
+ALTER TABLE account.`role` MODIFY COLUMN name varchar(79) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'MySQL doesn''t support more than 14 chars for proxied user names';
diff --git a/db/changes/232801/00-deliveryAssistantACL.sql b/db/changes/232801/01-deliveryAssistantACL.sql
similarity index 100%
rename from db/changes/232801/00-deliveryAssistantACL.sql
rename to db/changes/232801/01-deliveryAssistantACL.sql
diff --git a/db/changes/232801/01-deliveryAssistantInheritRole.sql b/db/changes/232801/02-deliveryAssistantInheritRole.sql
similarity index 100%
rename from db/changes/232801/01-deliveryAssistantInheritRole.sql
rename to db/changes/232801/02-deliveryAssistantInheritRole.sql
From 39f821252927c5e81987e937569f965bde1c0a16 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 28 Jun 2023 11:30:22 +0200
Subject: [PATCH 020/427] refs #5660 fixtures acls
---
db/changes/232801/01-deliveryAssistantACL.sql | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/db/changes/232801/01-deliveryAssistantACL.sql b/db/changes/232801/01-deliveryAssistantACL.sql
index 94873aece..5ee8a566f 100644
--- a/db/changes/232801/01-deliveryAssistantACL.sql
+++ b/db/changes/232801/01-deliveryAssistantACL.sql
@@ -2,6 +2,22 @@
INSERT INTO `account`.`role` (name,description)
VALUES ('deliveryAssistant','Asistencia de envios');
+INSERT INTO `account`.`roleInherit`
+ SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant'), ri.inheritsFrom
+ FROM account.roleInherit ri
+ JOIN account.role r ON r.id = ri.`role`
+ WHERE r.name = 'deliveryBoss';
+
+
+DELETE FROM roleInherit WHERE role = 57;
+
+INSERT INTO `account`.`roleInherit`
+ SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryBoss'), ri.inheritsFrom
+ FROM account.roleInherit ri
+ JOIN account.role r ON r.id = ri.`role`
+ WHERE
+
+
From 3bea23c52a0116652217893223389065b6555319 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 28 Jun 2023 11:30:45 +0200
Subject: [PATCH 021/427] refs #5660 delivery acls
---
db/changes/232801/02-deliveryAssistantInheritRole.sql | 4 ++--
db/dump/dumpedFixtures.sql | 2 +-
db/dump/structure.sql | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/db/changes/232801/02-deliveryAssistantInheritRole.sql b/db/changes/232801/02-deliveryAssistantInheritRole.sql
index e8146e806..403ea5cdc 100644
--- a/db/changes/232801/02-deliveryAssistantInheritRole.sql
+++ b/db/changes/232801/02-deliveryAssistantInheritRole.sql
@@ -1,5 +1,5 @@
-INSERT INTO account.roleInherit
- SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant'), ri.inheritsFrom
+INSERT INTO account.roleInherit(role,inheritsFrom)
+ SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant') role, ri.inheritsFrom
FROM account.roleInherit ri
JOIN account.role r ON r.id = ri.`role`
WHERE r.name = 'deliveryBoss';
\ No newline at end of file
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 3403ffaf3..23aa619e7 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -78,7 +78,7 @@ USE `account`;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
-INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryAssistantant','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-12 08:47:34',19294),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL);
+INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-12 08:47:34',19294),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index b07e88fde..a46971a7d 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -462,7 +462,7 @@ DROP TABLE IF EXISTS `role`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `name` varchar(14) NOT NULL COMMENT 'MySQL doesn''t support more than 14 chars for proxied user names',
+ `name` varchar(79) NOT NULL COMMENT 'MySQL doesn''t support more than 14 chars for proxied user names',
`description` varchar(100) DEFAULT NULL,
`hasLogin` tinyint(3) unsigned NOT NULL DEFAULT 1,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
From b19c15bd68dd9e384d1e6604dbffc875a2d33d22 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 28 Jun 2023 12:28:25 +0200
Subject: [PATCH 022/427] refs #5660 rol fix and inherits rol
---
db/changes/232801/00-changeRole.sql | 1 -
db/changes/232801/01-deliveryAssistantACL.sql | 14 ++++++--------
.../232801/02-deliveryAssistantInheritRole.sql | 5 -----
3 files changed, 6 insertions(+), 14 deletions(-)
delete mode 100644 db/changes/232801/00-changeRole.sql
delete mode 100644 db/changes/232801/02-deliveryAssistantInheritRole.sql
diff --git a/db/changes/232801/00-changeRole.sql b/db/changes/232801/00-changeRole.sql
deleted file mode 100644
index 3c8c81edb..000000000
--- a/db/changes/232801/00-changeRole.sql
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE account.`role` MODIFY COLUMN name varchar(79) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'MySQL doesn''t support more than 14 chars for proxied user names';
diff --git a/db/changes/232801/01-deliveryAssistantACL.sql b/db/changes/232801/01-deliveryAssistantACL.sql
index 5ee8a566f..22ee9d796 100644
--- a/db/changes/232801/01-deliveryAssistantACL.sql
+++ b/db/changes/232801/01-deliveryAssistantACL.sql
@@ -2,22 +2,20 @@
INSERT INTO `account`.`role` (name,description)
VALUES ('deliveryAssistant','Asistencia de envios');
-INSERT INTO `account`.`roleInherit`
+INSERT INTO `account`.`roleInherit` (role,inheritsFrom)
SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant'), ri.inheritsFrom
FROM account.roleInherit ri
JOIN account.role r ON r.id = ri.`role`
WHERE r.name = 'deliveryBoss';
-DELETE FROM roleInherit WHERE role = 57;
+DELETE FROM `account`.`roleInherit` WHERE role = 57;
-INSERT INTO `account`.`roleInherit`
- SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryBoss'), ri.inheritsFrom
- FROM account.roleInherit ri
- JOIN account.role r ON r.id = ri.`role`
- WHERE
-
+INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
+ SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
+ (SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
+CALL account.role_syncPrivileges();
diff --git a/db/changes/232801/02-deliveryAssistantInheritRole.sql b/db/changes/232801/02-deliveryAssistantInheritRole.sql
deleted file mode 100644
index 403ea5cdc..000000000
--- a/db/changes/232801/02-deliveryAssistantInheritRole.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-INSERT INTO account.roleInherit(role,inheritsFrom)
- SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant') role, ri.inheritsFrom
- FROM account.roleInherit ri
- JOIN account.role r ON r.id = ri.`role`
- WHERE r.name = 'deliveryBoss';
\ No newline at end of file
From 639d5963a3517463d0364ec73276583b42cb00b5 Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Mon, 17 Jul 2023 13:50:07 +0200
Subject: [PATCH 023/427] refs #6028 get_routes
---
db/changes/233001/00-getRoutesByWorker.sql | 24 ++++++++++
db/export-data.sh | 1 +
.../client/specs/getRoutesByWorker.spec.js | 19 ++++++++
.../back/methods/route/getDeliveryPoint.js | 2 +-
.../back/methods/route/getRoutesByWorker.js | 48 +++++++++++++++++++
.../route/back/methods/route/guessPriority.js | 4 +-
.../route/back/methods/route/insertTicket.js | 2 +-
modules/route/back/models/route.js | 1 +
modules/route/front/tickets/index.js | 2 +-
9 files changed, 98 insertions(+), 5 deletions(-)
create mode 100644 db/changes/233001/00-getRoutesByWorker.sql
create mode 100644 modules/client/back/methods/client/specs/getRoutesByWorker.spec.js
create mode 100644 modules/route/back/methods/route/getRoutesByWorker.js
diff --git a/db/changes/233001/00-getRoutesByWorker.sql b/db/changes/233001/00-getRoutesByWorker.sql
new file mode 100644
index 000000000..aa612d48e
--- /dev/null
+++ b/db/changes/233001/00-getRoutesByWorker.sql
@@ -0,0 +1,24 @@
+DELETE FROM `salix`.`ACL`
+ WHERE
+ model = 'Route'
+ AND property = '*'
+ AND accessType = 'READ';
+
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('Route', 'find', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'findById', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'findOne', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'getRoutesByWorker', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'canViewAllRoute', 'READ', 'ALLOW', 'ROLE', 'deliveryBoss'),
+ ('Route', 'filter', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'getSuggestedTickets', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'getTickets', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'guessPriority', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'insertTicket', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Route', 'getDeliveryPoint', 'READ', 'ALLOW', 'ROLE', 'deliveryBoss'),
+ ('Route', 'summary', 'READ', 'ALLOW', 'ROLE', 'employee');
+
+
+INSERT INTO salix.AccessToken (id, ttl, scopes, created, userId, outdated) VALUES('1z0GILWTs8huKrJGp7Fj0PvHaGA8Gg9DTNhm6nn6AfhkNJygeVUHMZKOGfMPp0xO', 1209600, NULL, '2023-07-17 13:34:10', 56, '2023-07-31 13:34:10');
+INSERT INTO salix.AccessToken (id, ttl, scopes, created, userId, outdated) VALUES('1z0GILWTs8huKrJGp7Fj0PvHaGA8Gg9DTNhm6nn6AfhkNJygeVUHMZKOGfMPp0xP', 1209600, NULL, '2023-07-17 13:34:10', 57, '2023-07-31 13:34:10');
diff --git a/db/export-data.sh b/db/export-data.sh
index 1df4db030..914564093 100755
--- a/db/export-data.sh
+++ b/db/export-data.sh
@@ -69,6 +69,7 @@ TABLES=(
volumeConfig
workCenter
companyI18n
+ silexACL
)
dump_tables ${TABLES[@]}
diff --git a/modules/client/back/methods/client/specs/getRoutesByWorker.spec.js b/modules/client/back/methods/client/specs/getRoutesByWorker.spec.js
new file mode 100644
index 000000000..b43fe49d2
--- /dev/null
+++ b/modules/client/back/methods/client/specs/getRoutesByWorker.spec.js
@@ -0,0 +1,19 @@
+const {models} = require('vn-loopback/server/server');
+
+describe('getRoutesByWorker', () => {
+ fit('should return the routes of the worker can view all routes', async() => {
+ const deliveryBossId = 57;
+ const ctx = {req: {accessToken: {userId: deliveryBossId}}};
+ const result = await models.Route.getRoutesByWorker(ctx);
+
+ expect(result.length).toEqual(7);
+ });
+
+ fit('should return the routes of the worker can not view all routes', async() => {
+ const deliveryId = 56;
+ const ctx = {req: {accessToken: {userId: deliveryId}}};
+ const result = await models.Route.getRoutesByWorker(ctx);
+
+ expect(result.length).toEqual(5);
+ });
+});
diff --git a/modules/route/back/methods/route/getDeliveryPoint.js b/modules/route/back/methods/route/getDeliveryPoint.js
index e5a50805a..3359f666e 100644
--- a/modules/route/back/methods/route/getDeliveryPoint.js
+++ b/modules/route/back/methods/route/getDeliveryPoint.js
@@ -1,7 +1,7 @@
module.exports = Self => {
Self.remoteMethod('getDeliveryPoint', {
description: 'get the deliveryPoint address',
- accessType: 'WRITE',
+ accessType: 'READ',
accepts: {
arg: 'vehicleId',
type: 'number',
diff --git a/modules/route/back/methods/route/getRoutesByWorker.js b/modules/route/back/methods/route/getRoutesByWorker.js
new file mode 100644
index 000000000..0a6f59816
--- /dev/null
+++ b/modules/route/back/methods/route/getRoutesByWorker.js
@@ -0,0 +1,48 @@
+module.exports = Self => {
+ Self.remoteMethodCtx('getRoutesByWorker', {
+ description: 'Return the routes by worker',
+ accessType: 'READ',
+ returns: {
+ type: 'object',
+ root: true
+ },
+ http: {
+ path: `/get-routes-by-worker`,
+ verb: 'GET'
+ }
+ });
+
+ Self.getRoutesByWorker = async(ctx, options) => {
+ const userId = ctx.req.accessToken.userId;
+ const myOptions = {};
+
+ if (typeof options == 'object')
+ Object.assign(myOptions, options);
+
+ const canViewAll = await Self.app.models.ACL.checkAccessAcl(ctx, 'Route', 'canViewAllRoute', 'READ');
+ const condition = canViewAll ? `ay.warehouseFK = uc.warehouseFk` : `r.workerFk = ${userId}`;
+
+ return Self.rawSql(`
+ SELECT concat(w.firstName , ' ', w.lastName) driver,
+ r.id,
+ Date_format(r.time, '%H:%i') hour,
+ r.created,
+ r.m3,
+ v.numberPlate,
+ a.name,
+ r.kmStart,
+ r.kmEnd,
+ r.started,
+ r.finished
+ FROM vn.route r
+ JOIN vn.vehicle v ON r.vehicleFk = v.id
+ JOIN vn.agencyMode a ON r.agencyModeFk = a.id
+ JOIN vn.agency ay ON a.agencyFk = ay.id
+ JOIN vn.worker w ON r.workerFk = w.id
+ LEFT JOIN vn.userConfig uc ON uc.userFk = ?
+ WHERE (r.created = util.VN_CURDATE() OR r.created = TIMESTAMPADD(day, 1, util.VN_CURDATE()))
+ AND ${condition}
+ ORDER BY r.created ASC, r.time ASC, a.name ASC
+ `, [userId], myOptions);
+ };
+};
diff --git a/modules/route/back/methods/route/guessPriority.js b/modules/route/back/methods/route/guessPriority.js
index c6b2a9b74..749075388 100644
--- a/modules/route/back/methods/route/guessPriority.js
+++ b/modules/route/back/methods/route/guessPriority.js
@@ -1,7 +1,7 @@
module.exports = Self => {
Self.remoteMethodCtx('guessPriority', {
description: 'Changes automatically the priority of the tickets in a route',
- accessType: 'READ',
+ accessType: 'WRITE',
accepts: [{
arg: 'id',
type: 'number',
@@ -15,7 +15,7 @@ module.exports = Self => {
},
http: {
path: `/:id/guessPriority`,
- verb: 'GET'
+ verb: 'PATCH'
}
});
diff --git a/modules/route/back/methods/route/insertTicket.js b/modules/route/back/methods/route/insertTicket.js
index f78e1cb83..4ac8bad1a 100644
--- a/modules/route/back/methods/route/insertTicket.js
+++ b/modules/route/back/methods/route/insertTicket.js
@@ -3,7 +3,7 @@ const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethod('insertTicket', {
description: 'Check if the ticket can be insert into the route and insert it',
- accessType: 'READ',
+ accessType: 'WRITE',
accepts: [{
arg: 'routeId',
type: 'number',
diff --git a/modules/route/back/models/route.js b/modules/route/back/models/route.js
index 883f4597e..fe88f2e08 100644
--- a/modules/route/back/models/route.js
+++ b/modules/route/back/models/route.js
@@ -14,6 +14,7 @@ module.exports = Self => {
require('../methods/route/driverRouteEmail')(Self);
require('../methods/route/sendSms')(Self);
require('../methods/route/downloadZip')(Self);
+ require('../methods/route/getRoutesByWorker')(Self);
Self.validate('kmStart', validateDistance, {
message: 'Distance must be lesser than 1000'
diff --git a/modules/route/front/tickets/index.js b/modules/route/front/tickets/index.js
index 8789708ac..a1b97005e 100644
--- a/modules/route/front/tickets/index.js
+++ b/modules/route/front/tickets/index.js
@@ -120,7 +120,7 @@ class Controller extends Section {
guessPriority() {
let query = `Routes/${this.$params.id}/guessPriority/`;
- this.$http.get(query).then(() => {
+ this.$http.patch(query).then(() => {
this.vnApp.showSuccess(this.$t('Order changed'));
this.$.model.refresh();
});
From 8267daef3a80304060afe759f91276ac05c20ae3 Mon Sep 17 00:00:00 2001
From: vicent
Date: Fri, 21 Jul 2023 12:58:44 +0200
Subject: [PATCH 024/427] refs #5918 fix: permite reenviar el correo si ha dado
fallo
---
modules/worker/front/time-control/index.html | 2 ++
modules/worker/front/time-control/index.js | 31 ++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html
index 760b0dafc..b6161db2d 100644
--- a/modules/worker/front/time-control/index.html
+++ b/modules/worker/front/time-control/index.html
@@ -97,6 +97,8 @@
ng-if="$ctrl.reason && ($ctrl.isHimSelf || $ctrl.isHr)"
ng-click="reason.show()">
+
+ {
+ if (!res.data.length) {
+ this.canResend = false;
+ return;
+ }
+
+ const filter = {
+ where: {
+ workerFk: this.$params.id
+ },
+ include: {
+ relation: 'department'
+ }
+ };
+ this.$http.get('WorkerDepartments', {filter})
+ .then(res => {
+ const department = res.data[0].department;
+ if (department.isTeleworking) this.canResend = true;
+ });
+ });
+ }
+
/**
* Worker hours data
*/
From d3aa6ddf6b7973a424c330b4492e2f03d81dd1c4 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 27 Jul 2023 17:26:36 +0200
Subject: [PATCH 025/427] refs change fixtures acls
---
db/changes/232801/01-deliveryAssistantACL.sql | 21 -------------------
1 file changed, 21 deletions(-)
delete mode 100644 db/changes/232801/01-deliveryAssistantACL.sql
diff --git a/db/changes/232801/01-deliveryAssistantACL.sql b/db/changes/232801/01-deliveryAssistantACL.sql
deleted file mode 100644
index 22ee9d796..000000000
--- a/db/changes/232801/01-deliveryAssistantACL.sql
+++ /dev/null
@@ -1,21 +0,0 @@
--- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values.
-INSERT INTO `account`.`role` (name,description)
- VALUES ('deliveryAssistant','Asistencia de envios');
-
-INSERT INTO `account`.`roleInherit` (role,inheritsFrom)
- SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant'), ri.inheritsFrom
- FROM account.roleInherit ri
- JOIN account.role r ON r.id = ri.`role`
- WHERE r.name = 'deliveryBoss';
-
-
-DELETE FROM `account`.`roleInherit` WHERE role = 57;
-
-INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
- SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
- (SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
-
-
-CALL account.role_syncPrivileges();
-
-
From 0546ae99eb6e518373f818b9e91f8f2c77ff7266 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 27 Jul 2023 17:27:06 +0200
Subject: [PATCH 026/427] refs #5660 add fixtures
---
db/changes/233201/01-deliveryAssistantACL.sql | 21 +++++++++++++++++++
db/dump/dumpedFixtures.sql | 4 ++--
2 files changed, 23 insertions(+), 2 deletions(-)
create mode 100644 db/changes/233201/01-deliveryAssistantACL.sql
diff --git a/db/changes/233201/01-deliveryAssistantACL.sql b/db/changes/233201/01-deliveryAssistantACL.sql
new file mode 100644
index 000000000..22ee9d796
--- /dev/null
+++ b/db/changes/233201/01-deliveryAssistantACL.sql
@@ -0,0 +1,21 @@
+-- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values.
+INSERT INTO `account`.`role` (name,description)
+ VALUES ('deliveryAssistant','Asistencia de envios');
+
+INSERT INTO `account`.`roleInherit` (role,inheritsFrom)
+ SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant'), ri.inheritsFrom
+ FROM account.roleInherit ri
+ JOIN account.role r ON r.id = ri.`role`
+ WHERE r.name = 'deliveryBoss';
+
+
+DELETE FROM `account`.`roleInherit` WHERE role = 57;
+
+INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
+ SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
+ (SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
+
+
+CALL account.role_syncPrivileges();
+
+
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index d32996bd8..b4965766c 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -78,7 +78,7 @@ USE `account`;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
-INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2023-06-08 16:47:57',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2023-06-02 20:33:28',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-17 11:07:21',NULL),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL),(119,'palletizerBoss','Jefe de paletizadores',1,'2023-06-07 11:51:54','2023-06-07 11:51:54',NULL),(120,'developerBoss','Jefe de proyecto de desarrollo',1,'2023-06-19 07:07:21','2023-06-19 07:07:21',21709),(121,'buyerSalesAssistant','Rol para compradores que también son responsables de ventas',1,'2023-06-23 14:48:19','2023-06-23 14:48:19',NULL);
+INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2023-06-08 16:47:57',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2023-06-02 20:33:28',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryAssistant','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-17 11:07:21',NULL),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL),(119,'palletizerBoss','Jefe de paletizadores',1,'2023-06-07 11:51:54','2023-06-07 11:51:54',NULL),(120,'developerBoss','Jefe de proyecto de desarrollo',1,'2023-06-19 07:07:21','2023-06-19 07:07:21',21709),(121,'buyerSalesAssistant','Rol para compradores que también son responsables de ventas',1,'2023-06-23 14:48:19','2023-06-23 14:48:19',NULL);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
@@ -164,7 +164,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(290,'MailAlias','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(300,'Docuware','*','*','ALLOW','ROLE','employee'),(301,'Agency','*','READ','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(490,'Client','updateUser','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(526,'VnUser','*','*','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(529,'VnUser','changePassword','WRITE','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee');
+INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryAssistant'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryAssistant'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(290,'MailAlias','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(300,'Docuware','*','*','ALLOW','ROLE','employee'),(301,'Agency','*','READ','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryAssistant'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(490,'Client','updateUser','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(526,'VnUser','*','*','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(529,'VnUser','changePassword','WRITE','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
From 50155cea8d5e3669b5293764f7666f0223a35c9c Mon Sep 17 00:00:00 2001
From: jorgep
Date: Fri, 28 Jul 2023 15:21:43 +0200
Subject: [PATCH 027/427] refs #5914 WIP transfer invoiceOut
---
.../233201/00-transferInvoiceOutACL.sql | 6 +
db/dump/fixtures.sql | 13 ++
loopback/locale/es.json | 3 +-
.../methods/invoiceOut/transferInvoiceOut.js | 81 +++++++++++
modules/invoiceOut/back/model-config.json | 12 ++
.../back/models/cplus-correcting-type.json | 19 +++
.../back/models/cplus-rectification-type.json | 19 +++
.../back/models/invoice-correction-type.json | 19 +++
modules/invoiceOut/back/models/invoice-out.js | 1 +
.../back/models/invoiceCorrection.json | 28 ++++
.../front/descriptor-menu/index.html | 89 ++++++++++++
.../invoiceOut/front/descriptor-menu/index.js | 13 ++
.../front/descriptor-menu/locale/en.yml | 2 +
.../front/descriptor-menu/locale/es.yml | 2 +
modules/ticket/back/methods/sale/clone.js | 76 ++++++++++
.../back/methods/sale/createTicketRefund.js | 25 ++++
modules/ticket/back/methods/sale/refund.js | 137 +++++++++++++++++-
17 files changed, 543 insertions(+), 2 deletions(-)
create mode 100644 db/changes/233201/00-transferInvoiceOutACL.sql
create mode 100644 modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
create mode 100644 modules/invoiceOut/back/models/cplus-correcting-type.json
create mode 100644 modules/invoiceOut/back/models/cplus-rectification-type.json
create mode 100644 modules/invoiceOut/back/models/invoice-correction-type.json
create mode 100644 modules/invoiceOut/back/models/invoiceCorrection.json
create mode 100644 modules/ticket/back/methods/sale/clone.js
create mode 100644 modules/ticket/back/methods/sale/createTicketRefund.js
diff --git a/db/changes/233201/00-transferInvoiceOutACL.sql b/db/changes/233201/00-transferInvoiceOutACL.sql
new file mode 100644
index 000000000..b549e52a8
--- /dev/null
+++ b/db/changes/233201/00-transferInvoiceOutACL.sql
@@ -0,0 +1,6 @@
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
+ VALUES
+ ('CplusRectificationType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('CplusCorrectingType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('InvoiceCorrectionType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('InvoiceOut', 'transferInvoiceOut', 'WRITE', 'ALLOW', 'ROLE', 'employee');
\ No newline at end of file
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index eaa00a3de..0a17e2e42 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -2958,3 +2958,16 @@ INSERT INTO `vn`.`invoiceInSerial` (`code`, `description`, `cplusTerIdNifFk`, `t
INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
VALUES
(1, 0, 0, 'marvel.com');
+
+INSERT INTO `vn`.`cplusCorrectingType` (`description`)
+ VALUES
+ ('Embalajes'),
+ ('Anulación'),
+ ('Impagado'),
+ ('Moroso');
+
+INSERT INTO `vn`.`invoiceCorrectionType` (`description`)
+ VALUES
+ ('Error en el cálculo del IVA'),
+ ('Error en el detalle de las ventas'),
+ ('Error en los datos del cliente');
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index ac62d62e1..3439adcde 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -311,5 +311,6 @@
"You don't have enough privileges.": "No tienes suficientes permisos.",
"This ticket is locked.": "Este ticket está bloqueado.",
"This ticket is not editable.": "Este ticket no es editable.",
- "The ticket doesn't exist.": "No existe el ticket."
+ "The ticket doesn't exist.": "No existe el ticket.",
+ "There are missing fields.": "There are missing fields."
}
\ No newline at end of file
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
new file mode 100644
index 000000000..b50e4b1a7
--- /dev/null
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
@@ -0,0 +1,81 @@
+const UserError = require('vn-loopback/util/user-error');
+
+module.exports = Self => {
+ Self.remoteMethodCtx('transferInvoiceOut', {
+ description: 'Transfer an invoice out to another client',
+ accessType: 'WRITE',
+ accepts: [
+ {
+ arg: 'data',
+ type: 'Object',
+ required: true
+ }
+ ],
+ returns: {
+ type: 'boolean',
+ root: true
+ },
+ http: {
+ path: '/transferInvoice',
+ verb: 'post'
+ }
+ });
+
+ Self.transferInvoiceOut = async(ctx, params, 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 {ref, newClientFk, cplusRectificationId, cplusCorrectingTypeId, invoiceCorrectionTypeId} = params;
+ if (!ref || !newClientFk || !cplusRectificationId || !cplusCorrectingTypeId || !invoiceCorrectionTypeId)
+ throw new UserError(`There are missing fields.`);
+
+ const filter = {where: {refFk: ref}};
+ const tickets = await models.Ticket.find(filter, myOptions);
+ const ticketsIds = tickets.map(ticket => ticket.id);
+ const refundTicket = await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
+ // Clonar tickets
+ const refundAgencyMode = await models.AgencyMode.findOne({
+ include: {
+ relation: 'zones',
+ scope: {
+ limit: 1,
+ field: ['id', 'name']
+ }
+ },
+ where: {code: 'refund'}
+ }, myOptions);
+ const refoundZoneId = refundAgencyMode.zones()[0].id;
+ const services = await models.TicketService.find(filter, myOptions);
+ const servicesIds = services.map(service => service.id);
+ const salesFilter = {
+ where: {id: {inq: salesIds}},
+ include: {
+ relation: 'components',
+ scope: {
+ fields: ['saleFk', 'componentFk', 'value']
+ }
+ }
+ };
+ const sales = await models.Sale.find(salesFilter, myOptions);
+ // Actualizar cliente
+
+ // Invoice Ticket - Factura rápida ??
+
+ // Insert InvoiceCorrection
+ if (tx) await tx.commit();
+ } catch (e) {
+ if (tx) await tx.rollback();
+ throw e;
+ }
+ return true;
+ };
+};
diff --git a/modules/invoiceOut/back/model-config.json b/modules/invoiceOut/back/model-config.json
index 9e8b119ab..995ea976b 100644
--- a/modules/invoiceOut/back/model-config.json
+++ b/modules/invoiceOut/back/model-config.json
@@ -31,5 +31,17 @@
},
"ZipConfig": {
"dataSource": "vn"
+ },
+ "CplusRectificationType": {
+ "dataSource": "vn"
+ },
+ "CplusCorrectingType": {
+ "dataSource": "vn"
+ },
+ "InvoiceCorrectionType": {
+ "dataSource": "vn"
+ },
+ "InvoiceCorrection": {
+ "dataSource": "vn"
}
}
diff --git a/modules/invoiceOut/back/models/cplus-correcting-type.json b/modules/invoiceOut/back/models/cplus-correcting-type.json
new file mode 100644
index 000000000..660f60008
--- /dev/null
+++ b/modules/invoiceOut/back/models/cplus-correcting-type.json
@@ -0,0 +1,19 @@
+{
+ "name": "CplusCorrectingType",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "cplusCorrectingType"
+ }
+ },
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "number",
+ "description": "Identifier"
+ },
+ "description": {
+ "type": "string"
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/invoiceOut/back/models/cplus-rectification-type.json b/modules/invoiceOut/back/models/cplus-rectification-type.json
new file mode 100644
index 000000000..e7bfb957f
--- /dev/null
+++ b/modules/invoiceOut/back/models/cplus-rectification-type.json
@@ -0,0 +1,19 @@
+{
+ "name": "CplusRectificationType",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "cplusRectificationType"
+ }
+ },
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "number",
+ "description": "Identifier"
+ },
+ "description": {
+ "type": "string"
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/invoiceOut/back/models/invoice-correction-type.json b/modules/invoiceOut/back/models/invoice-correction-type.json
new file mode 100644
index 000000000..ad3f034ea
--- /dev/null
+++ b/modules/invoiceOut/back/models/invoice-correction-type.json
@@ -0,0 +1,19 @@
+{
+ "name": "InvoiceCorrectionType",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "invoiceCorrectionType"
+ }
+ },
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "number",
+ "description": "Identifier"
+ },
+ "description": {
+ "type": "string"
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/invoiceOut/back/models/invoice-out.js b/modules/invoiceOut/back/models/invoice-out.js
index d3aaf3b3d..0bb31ce12 100644
--- a/modules/invoiceOut/back/models/invoice-out.js
+++ b/modules/invoiceOut/back/models/invoice-out.js
@@ -23,6 +23,7 @@ module.exports = Self => {
require('../methods/invoiceOut/getInvoiceDate')(Self);
require('../methods/invoiceOut/negativeBases')(Self);
require('../methods/invoiceOut/negativeBasesCsv')(Self);
+ require('../methods/invoiceOut/transferInvoiceOut')(Self);
Self.filePath = async function(id, options) {
const fields = ['ref', 'issued'];
diff --git a/modules/invoiceOut/back/models/invoiceCorrection.json b/modules/invoiceOut/back/models/invoiceCorrection.json
new file mode 100644
index 000000000..48bd172a6
--- /dev/null
+++ b/modules/invoiceOut/back/models/invoiceCorrection.json
@@ -0,0 +1,28 @@
+{
+ "name": "InvoiceCorrection",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "invoiceCorrection"
+ }
+ },
+ "properties": {
+ "correctingFk": {
+ "id": true,
+ "type": "number",
+ "description": "Identifier"
+ },
+ "correctedFk": {
+ "type": "number"
+ },
+ "cplusRectificationTypeFk": {
+ "type": "number"
+ },
+ "cplusInvoiceType477Fk": {
+ "type": "number"
+ },
+ "invoiceCorrectionTypeFk": {
+ "type": "number"
+ }
+ }
+}
\ 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 106f8e3cc..d6eaa1cc7 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.html
+++ b/modules/invoiceOut/front/descriptor-menu/index.html
@@ -1,3 +1,19 @@
+
+
+
+
+
+
+
+ Transfer invoice to...
+ Confirm
+
+
+
+
+
+
+ #{{id}} - {{::name}}
+
+
+
+
+ {{::description}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/invoiceOut/front/descriptor-menu/index.js b/modules/invoiceOut/front/descriptor-menu/index.js
index 38c3c9434..0b43b73a7 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.js
+++ b/modules/invoiceOut/front/descriptor-menu/index.js
@@ -125,6 +125,19 @@ class Controller extends Section {
this.$state.go('ticket.card.sale', {id: refundTicket.id});
});
}
+
+ transferInvoice() {
+ const params = {
+ data: {
+ ref: this.invoiceOut.ref,
+ newClientFk: this.invoiceOut.client.id,
+ cplusRectificationId: this.cplusRectificationType,
+ cplusCorrectingTypeId: this.cplusCorrectingType,
+ invoiceCorrectionTypeId: this.invoiceCorrectionType
+ }
+ };
+ this.$http.post(`InvoiceOuts/transferInvoice`, params).then(res => console.log(res.data));
+ }
}
Controller.$inject = ['$element', '$scope', 'vnReport', 'vnEmail'];
diff --git a/modules/invoiceOut/front/descriptor-menu/locale/en.yml b/modules/invoiceOut/front/descriptor-menu/locale/en.yml
index d299155d7..8fad5f25e 100644
--- a/modules/invoiceOut/front/descriptor-menu/locale/en.yml
+++ b/modules/invoiceOut/front/descriptor-menu/locale/en.yml
@@ -1 +1,3 @@
The following refund tickets have been created: "The following refund tickets have been created: {{ticketIds}}"
+Transfer invoice to...: Transfer invoice to...
+Cplus Type: Cplus Type
\ No newline at end of file
diff --git a/modules/invoiceOut/front/descriptor-menu/locale/es.yml b/modules/invoiceOut/front/descriptor-menu/locale/es.yml
index 393efd58c..0f74b5fec 100644
--- a/modules/invoiceOut/front/descriptor-menu/locale/es.yml
+++ b/modules/invoiceOut/front/descriptor-menu/locale/es.yml
@@ -21,3 +21,5 @@ The invoice PDF document has been regenerated: El documento PDF de la factura ha
The email can't be empty: El correo no puede estar vacío
The following refund tickets have been created: "Se han creado los siguientes tickets de abono: {{ticketIds}}"
Refund...: Abono...
+Transfer invoice to...: Transferir factura a...
+Cplus Type: Cplus Tipo
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
new file mode 100644
index 000000000..1d69ca158
--- /dev/null
+++ b/modules/ticket/back/methods/sale/clone.js
@@ -0,0 +1,76 @@
+module.exports = async function clone(ctx, Self, sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, isRefund, myOptions) {
+ const models = Self.app.models;
+ const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
+ const [firstTicketId] = ticketsIds;
+
+ const now = Date.vnNew();
+ let refundTickets = [];
+ let refundTicket;
+
+ if (!group) {
+ for (const ticketId of ticketsIds) {
+ refundTicket = await createTicketRefund(
+ ticketId,
+ now,
+ refundAgencyMode,
+ refoundZoneId,
+ null,
+ myOptions
+ );
+ refundTickets.push(refundTicket);
+ }
+ } else {
+ refundTicket = await createTicketRefund(
+ firstTicketId,
+ now,
+ refundAgencyMode,
+ refoundZoneId,
+ withWarehouse,
+ myOptions
+ );
+ }
+
+ for (const sale of sales) {
+ const createdSale = await models.Sale.create({
+ ticketFk: (group) ? refundTicket.id : sale.ticketFk,
+ itemFk: sale.itemFk,
+ quantity: (isRefund) ? - sale.quantity : sale.quantity,
+ concept: sale.concept,
+ price: sale.price,
+ discount: sale.discount,
+ }, myOptions);
+
+ const components = sale.components();
+ for (const component of components)
+ component.saleFk = createdSale.id;
+
+ await models.SaleComponent.create(components, myOptions);
+ }
+
+ if (servicesIds && servicesIds.length > 0) {
+ const servicesFilter = {
+ where: {id: {inq: servicesIds}}
+ };
+ const services = await models.TicketService.find(servicesFilter, myOptions);
+ for (const service of services) {
+ await models.TicketService.create({
+ description: service.description,
+ quantity: (isRefund) ? - service.quantity : service.quantity,
+ price: service.price,
+ taxClassFk: service.taxClassFk,
+ ticketFk: (group) ? refundTicket.id : service.ticketFk,
+ ticketServiceTypeFk: service.ticketServiceTypeFk,
+ }, myOptions);
+ }
+ }
+
+ const query = `CALL vn.ticket_recalc(?, NULL)`;
+ if (refundTickets.length > 0) {
+ for (const refundTicket of refundTickets)
+ await Self.rawSql(query, [refundTicket.id], myOptions);
+ return refundTickets.map(refundTicket => refundTicket.id);
+ } else {
+ await Self.rawSql(query, [refundTicket.id], myOptions);
+ return refundTicket;
+ }
+};
diff --git a/modules/ticket/back/methods/sale/createTicketRefund.js b/modules/ticket/back/methods/sale/createTicketRefund.js
new file mode 100644
index 000000000..0ecc62e0c
--- /dev/null
+++ b/modules/ticket/back/methods/sale/createTicketRefund.js
@@ -0,0 +1,25 @@
+module.exports = async function createTicketRefund(models, ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
+ // const models = Self.app.models;
+
+ const filter = {include: {relation: 'address'}};
+ const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
+
+ const refundTicket = await models.Ticket.create({
+ clientFk: ticket.clientFk,
+ shipped: now,
+ addressFk: ticket.address().id,
+ agencyModeFk: refundAgencyMode.id,
+ nickname: ticket.address().nickname,
+ warehouseFk: withWarehouse ? ticket.warehouseFk : null,
+ companyFk: ticket.companyFk,
+ landed: now,
+ zoneFk: refoundZoneId
+ }, myOptions);
+
+ await models.TicketRefund.create({
+ refundTicketFk: refundTicket.id,
+ originalTicketFk: ticket.id,
+ }, myOptions);
+
+ return refundTicket;
+};
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index a8191610a..fc6d8bbc2 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -28,7 +28,7 @@ module.exports = Self => {
}
});
- Self.refund = async(ctx, salesIds, servicesIds, withWarehouse, options) => {
+ /* Self.refund = async(ctx, salesIds, servicesIds, withWarehouse, options) => {
const models = Self.app.models;
const myOptions = {userId: ctx.req.accessToken.userId};
let tx;
@@ -111,6 +111,64 @@ module.exports = Self => {
if (tx) await tx.commit();
+ return refundTicket;
+ } catch (e) {
+ if (tx) await tx.rollback();
+ throw e;
+ }
+ }; */
+
+ Self.refund = async(ctx, salesIds, servicesIds, withWarehouse, options) => {
+ const models = Self.app.models;
+ 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 refundAgencyMode = await models.AgencyMode.findOne({
+ include: {
+ relation: 'zones',
+ scope: {
+ limit: 1,
+ field: ['id', 'name']
+ }
+ },
+ where: {code: 'refund'}
+ }, myOptions);
+
+ const refoundZoneId = refundAgencyMode.zones()[0].id;
+
+ const salesFilter = {
+ where: {id: {inq: salesIds}},
+ include: {
+ relation: 'components',
+ scope: {
+ fields: ['saleFk', 'componentFk', 'value']
+ }
+ }
+ };
+ const sales = await models.Sale.find(salesFilter, myOptions);
+ const group = true;
+ const isRefund = true;
+
+ const refundTicket = await clone(
+ sales,
+ refundAgencyMode,
+ refoundZoneId, servicesIds,
+ withWarehouse,
+ group,
+ isRefund,
+ myOptions
+ );
+ if (tx) await tx.commit();
+
return refundTicket;
} catch (e) {
if (tx) await tx.rollback();
@@ -118,6 +176,83 @@ module.exports = Self => {
}
};
+ async function clone(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, isRefund, myOptions) {
+ const models = Self.app.models;
+ const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
+ const [firstTicketId] = ticketsIds;
+
+ const now = Date.vnNew();
+ let refundTickets = [];
+ let refundTicket;
+
+ if (!group) {
+ for (const ticketId of ticketsIds) {
+ refundTicket = await createTicketRefund(
+ ticketId,
+ now,
+ refundAgencyMode,
+ refoundZoneId,
+ null,
+ myOptions
+ );
+ refundTickets.push(refundTicket);
+ }
+ } else {
+ refundTicket = await createTicketRefund(
+ firstTicketId,
+ now,
+ refundAgencyMode,
+ refoundZoneId,
+ withWarehouse,
+ myOptions
+ );
+ }
+
+ for (const sale of sales) {
+ const createdSale = await models.Sale.create({
+ ticketFk: (group) ? refundTicket.id : sale.ticketFk,
+ itemFk: sale.itemFk,
+ quantity: (isRefund) ? - sale.quantity : sale.quantity,
+ concept: sale.concept,
+ price: sale.price,
+ discount: sale.discount,
+ }, myOptions);
+
+ const components = sale.components();
+ for (const component of components)
+ component.saleFk = createdSale.id;
+
+ await models.SaleComponent.create(components, myOptions);
+ }
+
+ if (servicesIds && servicesIds.length > 0) {
+ const servicesFilter = {
+ where: {id: {inq: servicesIds}}
+ };
+ const services = await models.TicketService.find(servicesFilter, myOptions);
+ for (const service of services) {
+ await models.TicketService.create({
+ description: service.description,
+ quantity: (isRefund) ? - service.quantity : service.quantity,
+ price: service.price,
+ taxClassFk: service.taxClassFk,
+ ticketFk: (group) ? refundTicket.id : service.ticketFk,
+ ticketServiceTypeFk: service.ticketServiceTypeFk,
+ }, myOptions);
+ }
+ }
+
+ const query = `CALL vn.ticket_recalc(?, NULL)`;
+ if (refundTickets.length > 0) {
+ for (const refundTicket of refundTickets)
+ await Self.rawSql(query, [refundTicket.id], myOptions);
+ return refundTickets.map(refundTicket => refundTicket.id);
+ } else {
+ await Self.rawSql(query, [refundTicket.id], myOptions);
+ return refundTicket;
+ }
+ }
+
async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
const models = Self.app.models;
From 22f76ec6a943282c8e870e54f17b2cebe79f1d5a Mon Sep 17 00:00:00 2001
From: jorgep
Date: Mon, 31 Jul 2023 10:33:51 +0200
Subject: [PATCH 028/427] refs #5914 WIP clone method created
---
.../233201/00-transferInvoiceOutACL.sql | 2 +-
.../methods/invoiceOut/transferInvoiceOut.js | 31 ++++-
modules/invoiceOut/back/model-config.json | 6 +-
...-type.json => cplus-invoice-type-477.json} | 4 +-
.../front/descriptor-menu/index.html | 10 +-
.../invoiceOut/front/descriptor-menu/index.js | 3 +-
modules/ticket/back/methods/sale/clone.js | 127 ++++++++----------
.../back/methods/sale/createTicketRefund.js | 25 ----
modules/ticket/back/methods/sale/refund.js | 71 +++++-----
modules/ticket/back/models/sale.js | 1 +
10 files changed, 129 insertions(+), 151 deletions(-)
rename modules/invoiceOut/back/models/{cplus-correcting-type.json => cplus-invoice-type-477.json} (78%)
delete mode 100644 modules/ticket/back/methods/sale/createTicketRefund.js
diff --git a/db/changes/233201/00-transferInvoiceOutACL.sql b/db/changes/233201/00-transferInvoiceOutACL.sql
index b549e52a8..6e8d88c5d 100644
--- a/db/changes/233201/00-transferInvoiceOutACL.sql
+++ b/db/changes/233201/00-transferInvoiceOutACL.sql
@@ -1,6 +1,6 @@
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('CplusRectificationType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
- ('CplusCorrectingType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('CplusInvoiceType477', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('InvoiceCorrectionType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('InvoiceOut', 'transferInvoiceOut', 'WRITE', 'ALLOW', 'ROLE', 'employee');
\ No newline at end of file
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
index b50e4b1a7..d53581ac6 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
@@ -34,15 +34,17 @@ module.exports = Self => {
myOptions.transaction = tx;
}
try {
- const {ref, newClientFk, cplusRectificationId, cplusCorrectingTypeId, invoiceCorrectionTypeId} = params;
- if (!ref || !newClientFk || !cplusRectificationId || !cplusCorrectingTypeId || !invoiceCorrectionTypeId)
+ const {id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477FkId, invoiceCorrectionTypeId} = params;
+ if (!id || !ref || !newClientFk || !cplusRectificationId || !cplusInvoiceType477FkId || !invoiceCorrectionTypeId)
throw new UserError(`There are missing fields.`);
+ // Refund tickets and group
const filter = {where: {refFk: ref}};
const tickets = await models.Ticket.find(filter, myOptions);
const ticketsIds = tickets.map(ticket => ticket.id);
- const refundTicket = await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
- // Clonar tickets
+ await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
+
+ // Clone tickets
const refundAgencyMode = await models.AgencyMode.findOne({
include: {
relation: 'zones',
@@ -66,11 +68,28 @@ module.exports = Self => {
}
};
const sales = await models.Sale.find(salesFilter, myOptions);
- // Actualizar cliente
+ const isRefund = false;
+ const clonedTicketIds = await models.Sale.clone(sales, refundAgencyMode, refoundZoneId, servicesIds, null, isRefund, myOptions);
- // Invoice Ticket - Factura rápida ??
+ // Update client
+ for (const clonedTicketId of clonedTicketIds) {
+ const ticket = await models.Ticket.findById(clonedTicketId, myOptions);
+ await ticket.updateAttributes({clientFk: newClientFk});
+ }
+ // Quick invoice
+ const invoiceIds = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
// Insert InvoiceCorrection
+ for (const invoiceId of invoiceIds) {
+ await models.invoiceCorrection.create({
+ correctingFk: invoiceId,
+ correctedFk: id,
+ cplusRectificationTypeFk: cplusRectificationId,
+ cplusInvoiceType477Fk: cplusInvoiceType477FkId,
+ invoiceCorrectionType: invoiceCorrectionTypeId
+ });
+ }
+
if (tx) await tx.commit();
} catch (e) {
if (tx) await tx.rollback();
diff --git a/modules/invoiceOut/back/model-config.json b/modules/invoiceOut/back/model-config.json
index 995ea976b..23246893b 100644
--- a/modules/invoiceOut/back/model-config.json
+++ b/modules/invoiceOut/back/model-config.json
@@ -35,13 +35,13 @@
"CplusRectificationType": {
"dataSource": "vn"
},
- "CplusCorrectingType": {
- "dataSource": "vn"
- },
"InvoiceCorrectionType": {
"dataSource": "vn"
},
"InvoiceCorrection": {
"dataSource": "vn"
+ },
+ "CplusInvoiceType477": {
+ "dataSource": "vn"
}
}
diff --git a/modules/invoiceOut/back/models/cplus-correcting-type.json b/modules/invoiceOut/back/models/cplus-invoice-type-477.json
similarity index 78%
rename from modules/invoiceOut/back/models/cplus-correcting-type.json
rename to modules/invoiceOut/back/models/cplus-invoice-type-477.json
index 660f60008..840a9a7e4 100644
--- a/modules/invoiceOut/back/models/cplus-correcting-type.json
+++ b/modules/invoiceOut/back/models/cplus-invoice-type-477.json
@@ -1,9 +1,9 @@
{
- "name": "CplusCorrectingType",
+ "name": "CplusInvoiceType477",
"base": "VnModel",
"options": {
"mysql": {
- "table": "cplusCorrectingType"
+ "table": "cplusInvoiceType477"
}
},
"properties": {
diff --git a/modules/invoiceOut/front/descriptor-menu/index.html b/modules/invoiceOut/front/descriptor-menu/index.html
index d6eaa1cc7..1655290f4 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.html
+++ b/modules/invoiceOut/front/descriptor-menu/index.html
@@ -6,8 +6,8 @@
+ url="CplusInvoiceType477s"
+ data="cplusInvoiceType477">
sale.ticketFk))];
- const [firstTicketId] = ticketsIds;
+module.exports = Self => {
+ Self.clone = async(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, isRefund, myOptions) => {
+ const models = Self.app.models;
+ const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
- const now = Date.vnNew();
- let refundTickets = [];
- let refundTicket;
+ const now = Date.vnNew();
+ let updatedTickets = [];
- if (!group) {
for (const ticketId of ticketsIds) {
- refundTicket = await createTicketRefund(
- ticketId,
- now,
- refundAgencyMode,
- refoundZoneId,
- null,
- myOptions
- );
- refundTickets.push(refundTicket);
- }
- } else {
- refundTicket = await createTicketRefund(
- firstTicketId,
- now,
- refundAgencyMode,
- refoundZoneId,
- withWarehouse,
- myOptions
- );
- }
+ const filter = {include: {relation: 'address'}};
+ const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
- for (const sale of sales) {
- const createdSale = await models.Sale.create({
- ticketFk: (group) ? refundTicket.id : sale.ticketFk,
- itemFk: sale.itemFk,
- quantity: (isRefund) ? - sale.quantity : sale.quantity,
- concept: sale.concept,
- price: sale.price,
- discount: sale.discount,
- }, myOptions);
-
- const components = sale.components();
- for (const component of components)
- component.saleFk = createdSale.id;
-
- await models.SaleComponent.create(components, myOptions);
- }
-
- if (servicesIds && servicesIds.length > 0) {
- const servicesFilter = {
- where: {id: {inq: servicesIds}}
- };
- const services = await models.TicketService.find(servicesFilter, myOptions);
- for (const service of services) {
- await models.TicketService.create({
- description: service.description,
- quantity: (isRefund) ? - service.quantity : service.quantity,
- price: service.price,
- taxClassFk: service.taxClassFk,
- ticketFk: (group) ? refundTicket.id : service.ticketFk,
- ticketServiceTypeFk: service.ticketServiceTypeFk,
+ const ticketUpdated = await models.Ticket.create({
+ clientFk: ticket.clientFk,
+ shipped: now,
+ addressFk: ticket.address().id,
+ agencyModeFk: refundAgencyMode.id,
+ nickname: ticket.address().nickname,
+ warehouseFk: withWarehouse ? ticket.warehouseFk : null,
+ companyFk: ticket.companyFk,
+ landed: now,
+ zoneFk: refoundZoneId
}, myOptions);
+ updatedTickets.push(ticketUpdated);
}
- }
- const query = `CALL vn.ticket_recalc(?, NULL)`;
- if (refundTickets.length > 0) {
- for (const refundTicket of refundTickets)
- await Self.rawSql(query, [refundTicket.id], myOptions);
- return refundTickets.map(refundTicket => refundTicket.id);
- } else {
- await Self.rawSql(query, [refundTicket.id], myOptions);
- return refundTicket;
- }
+ for (const sale of sales) {
+ const createdSale = await models.Sale.create({
+ ticketFk: sale.ticketFk,
+ itemFk: sale.itemFk,
+ quantity: (isRefund) ? - sale.quantity : sale.quantity,
+ concept: sale.concept,
+ price: sale.price,
+ discount: sale.discount,
+ }, myOptions);
+
+ const components = sale.components();
+ for (const component of components)
+ component.saleFk = createdSale.id;
+
+ await models.SaleComponent.create(components, myOptions);
+ }
+
+ if (servicesIds && servicesIds.length > 0) {
+ const servicesFilter = {
+ where: {id: {inq: servicesIds}}
+ };
+ const services = await models.TicketService.find(servicesFilter, myOptions);
+ for (const service of services) {
+ await models.TicketService.create({
+ description: service.description,
+ quantity: (isRefund) ? - service.quantity : service.quantity,
+ price: service.price,
+ taxClassFk: service.taxClassFk,
+ ticketFk: service.ticketFk,
+ ticketServiceTypeFk: service.ticketServiceTypeFk,
+ }, myOptions);
+ }
+ }
+
+ const query = `CALL vn.ticket_recalc(?, NULL)`;
+
+ for (const updatedTicket of updatedTickets)
+ await Self.rawSql(query, [updatedTicket.id], myOptions);
+ return updatedTickets.map(updatedTicket => updatedTicket.id);
+ };
};
diff --git a/modules/ticket/back/methods/sale/createTicketRefund.js b/modules/ticket/back/methods/sale/createTicketRefund.js
deleted file mode 100644
index 0ecc62e0c..000000000
--- a/modules/ticket/back/methods/sale/createTicketRefund.js
+++ /dev/null
@@ -1,25 +0,0 @@
-module.exports = async function createTicketRefund(models, ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
- // const models = Self.app.models;
-
- const filter = {include: {relation: 'address'}};
- const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
-
- const refundTicket = await models.Ticket.create({
- clientFk: ticket.clientFk,
- shipped: now,
- addressFk: ticket.address().id,
- agencyModeFk: refundAgencyMode.id,
- nickname: ticket.address().nickname,
- warehouseFk: withWarehouse ? ticket.warehouseFk : null,
- companyFk: ticket.companyFk,
- landed: now,
- zoneFk: refoundZoneId
- }, myOptions);
-
- await models.TicketRefund.create({
- refundTicketFk: refundTicket.id,
- originalTicketFk: ticket.id,
- }, myOptions);
-
- return refundTicket;
-};
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index fc6d8bbc2..6bb131e4d 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -158,10 +158,11 @@ module.exports = Self => {
const group = true;
const isRefund = true;
- const refundTicket = await clone(
+ const refundTicket = await cloneAndGroup(
sales,
refundAgencyMode,
- refoundZoneId, servicesIds,
+ refoundZoneId,
+ servicesIds,
withWarehouse,
group,
isRefund,
@@ -176,41 +177,37 @@ module.exports = Self => {
}
};
- async function clone(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, isRefund, myOptions) {
- const models = Self.app.models;
+ async function cloneAndGroup(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, isRefund, myOptions) {
+ if (!group) {
+ const tickets = await models.Sale.clone(sales,
+ refundAgencyMode,
+ refoundZoneId, servicesIds,
+ withWarehouse,
+ isRefund,
+ myOptions);
+ return tickets;
+ }
+
const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
const [firstTicketId] = ticketsIds;
+ const filter = {include: {relation: 'address'}};
+ const ticket = await models.Ticket.findById(firstTicketId, filter, myOptions);
- const now = Date.vnNew();
- let refundTickets = [];
- let refundTicket;
-
- if (!group) {
- for (const ticketId of ticketsIds) {
- refundTicket = await createTicketRefund(
- ticketId,
- now,
- refundAgencyMode,
- refoundZoneId,
- null,
- myOptions
- );
- refundTickets.push(refundTicket);
- }
- } else {
- refundTicket = await createTicketRefund(
- firstTicketId,
- now,
- refundAgencyMode,
- refoundZoneId,
- withWarehouse,
- myOptions
- );
- }
+ const ticketUpdated = await models.Ticket.create({
+ clientFk: ticket.clientFk,
+ shipped: now,
+ addressFk: ticket.address().id,
+ agencyModeFk: refundAgencyMode.id,
+ nickname: ticket.address().nickname,
+ warehouseFk: withWarehouse ? ticket.warehouseFk : null,
+ companyFk: ticket.companyFk,
+ landed: now,
+ zoneFk: refoundZoneId
+ }, myOptions);
for (const sale of sales) {
const createdSale = await models.Sale.create({
- ticketFk: (group) ? refundTicket.id : sale.ticketFk,
+ ticketFk: ticketUpdated.id,
itemFk: sale.itemFk,
quantity: (isRefund) ? - sale.quantity : sale.quantity,
concept: sale.concept,
@@ -236,21 +233,15 @@ module.exports = Self => {
quantity: (isRefund) ? - service.quantity : service.quantity,
price: service.price,
taxClassFk: service.taxClassFk,
- ticketFk: (group) ? refundTicket.id : service.ticketFk,
+ ticketFk: ticketUpdated.id,
ticketServiceTypeFk: service.ticketServiceTypeFk,
}, myOptions);
}
}
const query = `CALL vn.ticket_recalc(?, NULL)`;
- if (refundTickets.length > 0) {
- for (const refundTicket of refundTickets)
- await Self.rawSql(query, [refundTicket.id], myOptions);
- return refundTickets.map(refundTicket => refundTicket.id);
- } else {
- await Self.rawSql(query, [refundTicket.id], myOptions);
- return refundTicket;
- }
+ await Self.rawSql(query, [refundTicket.id], myOptions);
+ return ticketUpdated;
}
async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
diff --git a/modules/ticket/back/models/sale.js b/modules/ticket/back/models/sale.js
index bab201fdd..e65c98fea 100644
--- a/modules/ticket/back/models/sale.js
+++ b/modules/ticket/back/models/sale.js
@@ -10,6 +10,7 @@ module.exports = Self => {
require('../methods/sale/refund')(Self);
require('../methods/sale/canEdit')(Self);
require('../methods/sale/usesMana')(Self);
+ require('../methods/sale/clone')(Self);
Self.validatesPresenceOf('concept', {
message: `Concept cannot be blank`
From 3ef74cab5c00ee70ebc8ad78e15a5b0f40145f59 Mon Sep 17 00:00:00 2001
From: jorgep
Date: Tue, 1 Aug 2023 12:45:57 +0200
Subject: [PATCH 029/427] refs #5914 WIP created transferInvoiceOut
---
.../methods/invoiceOut/transferInvoiceOut.js | 66 +++++---
.../front/descriptor-menu/index.html | 3 +-
.../invoiceOut/front/descriptor-menu/index.js | 14 +-
modules/ticket/back/methods/sale/clone.js | 151 +++++++++++-------
modules/ticket/back/methods/sale/refund.js | 87 ++--------
.../back/methods/sale/specs/refund.spec.js | 2 +-
modules/ticket/back/methods/ticket/refund.js | 1 -
modules/ticket/back/models/ticket.json | 5 +
8 files changed, 161 insertions(+), 168 deletions(-)
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
index d53581ac6..86de59e9d 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
@@ -6,10 +6,35 @@ module.exports = Self => {
accessType: 'WRITE',
accepts: [
{
- arg: 'data',
- type: 'Object',
+ arg: 'id',
+ type: 'number',
required: true
- }
+ },
+ {
+ arg: 'ref',
+ type: 'string',
+ required: true
+ },
+ {
+ arg: 'newClientFk',
+ type: 'number',
+ required: true
+ },
+ {
+ arg: 'cplusRectificationId',
+ type: 'number',
+ required: true
+ },
+ {
+ arg: 'cplusInvoiceType477Id',
+ type: 'number',
+ required: true
+ },
+ {
+ arg: 'invoiceCorrectionTypeId',
+ type: 'number',
+ required: true
+ },
],
returns: {
type: 'boolean',
@@ -21,7 +46,7 @@ module.exports = Self => {
}
});
- Self.transferInvoiceOut = async(ctx, params, options) => {
+ Self.transferInvoiceOut = async(ctx, id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477Id, invoiceCorrectionTypeId, options) => {
const models = Self.app.models;
const myOptions = {};
let tx;
@@ -34,16 +59,12 @@ module.exports = Self => {
myOptions.transaction = tx;
}
try {
- const {id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477FkId, invoiceCorrectionTypeId} = params;
- if (!id || !ref || !newClientFk || !cplusRectificationId || !cplusInvoiceType477FkId || !invoiceCorrectionTypeId)
- throw new UserError(`There are missing fields.`);
-
// Refund tickets and group
const filter = {where: {refFk: ref}};
const tickets = await models.Ticket.find(filter, myOptions);
const ticketsIds = tickets.map(ticket => ticket.id);
await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
-
+ console.log('Ticket refunded');
// Clone tickets
const refundAgencyMode = await models.AgencyMode.findOne({
include: {
@@ -58,25 +79,20 @@ module.exports = Self => {
const refoundZoneId = refundAgencyMode.zones()[0].id;
const services = await models.TicketService.find(filter, myOptions);
const servicesIds = services.map(service => service.id);
- const salesFilter = {
- where: {id: {inq: salesIds}},
- include: {
- relation: 'components',
- scope: {
- fields: ['saleFk', 'componentFk', 'value']
- }
- }
- };
+ const salesFilter = {where: {ticketFk: {inq: ticketsIds}}};
const sales = await models.Sale.find(salesFilter, myOptions);
- const isRefund = false;
- const clonedTicketIds = await models.Sale.clone(sales, refundAgencyMode, refoundZoneId, servicesIds, null, isRefund, myOptions);
-
+ const clonedTickets = await models.Sale.clone(sales, refundAgencyMode, refoundZoneId, servicesIds, null, false, false, myOptions);
+ console.log('cloned tickets');
// Update client
- for (const clonedTicketId of clonedTicketIds) {
- const ticket = await models.Ticket.findById(clonedTicketId, myOptions);
- await ticket.updateAttributes({clientFk: newClientFk});
+ for (const clonedTicket of clonedTickets) {
+ // const ticket = await models.Ticket.findById(clonedTicketId, myOptions);
+ console.log(clonedTicket);
+ await clonedTicket.updateAttributes({clientFk: newClientFk}, myOptions);
+ console.log(clonedTicket);
}
// Quick invoice
+ const clonedTicketIds = clonedTickets.map(clonedTicket => clonedTicket.id);
+ console.log(clonedTicketIds);
const invoiceIds = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
// Insert InvoiceCorrection
@@ -85,7 +101,7 @@ module.exports = Self => {
correctingFk: invoiceId,
correctedFk: id,
cplusRectificationTypeFk: cplusRectificationId,
- cplusInvoiceType477Fk: cplusInvoiceType477FkId,
+ cplusInvoiceType477Fk: cplusInvoiceType477Id,
invoiceCorrectionType: invoiceCorrectionTypeId
});
}
diff --git a/modules/invoiceOut/front/descriptor-menu/index.html b/modules/invoiceOut/front/descriptor-menu/index.html
index 1655290f4..dc5c2a8e9 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.html
+++ b/modules/invoiceOut/front/descriptor-menu/index.html
@@ -222,12 +222,13 @@
console.log(res.data));
}
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
index 96e66de2c..e1793d088 100644
--- a/modules/ticket/back/methods/sale/clone.js
+++ b/modules/ticket/back/methods/sale/clone.js
@@ -1,67 +1,104 @@
module.exports = Self => {
- Self.clone = async(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, isRefund, myOptions) => {
+ Self.clone = async(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, negative, myOptions) => {
const models = Self.app.models;
- const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
+ let tx;
+ if (!myOptions.transaction) {
+ tx = await Self.beginTransaction({});
+ myOptions.transaction = tx;
+ }
+
+ const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
+ const [firstTicketId] = ticketsIds;
const now = Date.vnNew();
let updatedTickets = [];
+ let newTicket;
+ const filter = {
+ include: [
+ {relation: 'address'},
+ {
+ relation: 'sale',
+ inq: sales,
+ },
+ ]
+ };
+ try {
+ for (const [index, ticketId] of ticketsIds.entries()) {
+ const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
+ if (!group || !index) {
+ newTicket = await models.Ticket.create({
+ clientFk: ticket.clientFk,
+ shipped: now,
+ addressFk: ticket.address().id,
+ agencyModeFk: refundAgencyMode.id,
+ nickname: ticket.address().nickname,
+ warehouseFk: withWarehouse ? ticket.warehouseFk : null,
+ companyFk: ticket.companyFk,
+ landed: now,
+ zoneFk: refoundZoneId
+ }, myOptions);
+ updatedTickets.push(newTicket);
+ }
+ const sales = ticket.sale();
+ const saleIds = sales.map(sale => sale.id);
+ const saleComponentsFilter = {
+ where: {saleFk: {inq: saleIds}},
+ scope: {
+ fields: ['saleFk', 'componentFk', 'value']
+ }
+ };
+ for (const sale of sales) {
+ const createdSale = await models.Sale.create({
+ ticketFk: newTicket.id,
+ itemFk: sale.itemFk,
+ quantity: (negative) ? - sale.quantity : sale.quantity,
+ concept: sale.concept,
+ price: sale.price,
+ discount: sale.discount,
+ }, myOptions);
+ const components = await models.SaleComponent.find(saleComponentsFilter, myOptions);
+ // const components = sale.components();
+ for (const component of components)
+ component.saleFk = createdSale.id;
- for (const ticketId of ticketsIds) {
- const filter = {include: {relation: 'address'}};
- const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
-
- const ticketUpdated = await models.Ticket.create({
- clientFk: ticket.clientFk,
- shipped: now,
- addressFk: ticket.address().id,
- agencyModeFk: refundAgencyMode.id,
- nickname: ticket.address().nickname,
- warehouseFk: withWarehouse ? ticket.warehouseFk : null,
- companyFk: ticket.companyFk,
- landed: now,
- zoneFk: refoundZoneId
- }, myOptions);
- updatedTickets.push(ticketUpdated);
- }
-
- for (const sale of sales) {
- const createdSale = await models.Sale.create({
- ticketFk: sale.ticketFk,
- itemFk: sale.itemFk,
- quantity: (isRefund) ? - sale.quantity : sale.quantity,
- concept: sale.concept,
- price: sale.price,
- discount: sale.discount,
- }, myOptions);
-
- const components = sale.components();
- for (const component of components)
- component.saleFk = createdSale.id;
-
- await models.SaleComponent.create(components, myOptions);
- }
-
- if (servicesIds && servicesIds.length > 0) {
- const servicesFilter = {
- where: {id: {inq: servicesIds}}
- };
- const services = await models.TicketService.find(servicesFilter, myOptions);
- for (const service of services) {
- await models.TicketService.create({
- description: service.description,
- quantity: (isRefund) ? - service.quantity : service.quantity,
- price: service.price,
- taxClassFk: service.taxClassFk,
- ticketFk: service.ticketFk,
- ticketServiceTypeFk: service.ticketServiceTypeFk,
- }, myOptions);
+ await models.SaleComponent.create(components, myOptions);
+ }
}
+ if (servicesIds && servicesIds.length > 0) {
+ const servicesFilter = {
+ where: {id: {inq: servicesIds}}
+ };
+ const services = await models.TicketService.find(servicesFilter, myOptions);
+ for (const service of services) {
+ await models.TicketService.create({
+ description: service.description,
+ quantity: (negative) ? - service.quantity : service.quantity,
+ price: service.price,
+ taxClassFk: service.taxClassFk,
+ ticketFk: service.ticketFk,
+ ticketServiceTypeFk: service.ticketServiceTypeFk,
+ }, myOptions);
+ }
+ }
+
+ const query = `CALL vn.ticket_recalc(?, NULL)`;
+
+ if (group) {
+ await Self.rawSql(query, [newTicket.id], myOptions);
+ if (tx) await tx.commit();
+ return {
+ refundTicket: newTicket,
+ originalTicketFk: firstTicketId
+ };
+ } else {
+ for (const updatedTicket of updatedTickets)
+ await Self.rawSql(query, [updatedTicket.id], myOptions);
+ if (tx) await tx.commit();
+ return updatedTickets/* updatedTickets.map(updatedTicket => updatedTicket.id) */;
+ }
+ } catch (e) {
+ if (tx) await tx.rollback();
+ throw e;
}
-
- const query = `CALL vn.ticket_recalc(?, NULL)`;
-
- for (const updatedTicket of updatedTickets)
- await Self.rawSql(query, [updatedTicket.id], myOptions);
- return updatedTickets.map(updatedTicket => updatedTicket.id);
};
};
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index 6bb131e4d..c85bcd834 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -155,19 +155,23 @@ module.exports = Self => {
}
};
const sales = await models.Sale.find(salesFilter, myOptions);
- const group = true;
- const isRefund = true;
-
- const refundTicket = await cloneAndGroup(
+ const clonedTicket = await models.Sale.clone(
sales,
refundAgencyMode,
refoundZoneId,
servicesIds,
withWarehouse,
- group,
- isRefund,
+ true,
+ true,
myOptions
);
+
+ const refundTicket = clonedTicket.refundTicket;
+
+ await models.TicketRefund.create({
+ refundTicketFk: refundTicket.id,
+ originalTicketFk: clonedTicket.originalTicketFk,
+ }, myOptions);
if (tx) await tx.commit();
return refundTicket;
@@ -177,74 +181,7 @@ module.exports = Self => {
}
};
- async function cloneAndGroup(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, isRefund, myOptions) {
- if (!group) {
- const tickets = await models.Sale.clone(sales,
- refundAgencyMode,
- refoundZoneId, servicesIds,
- withWarehouse,
- isRefund,
- myOptions);
- return tickets;
- }
-
- const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
- const [firstTicketId] = ticketsIds;
- const filter = {include: {relation: 'address'}};
- const ticket = await models.Ticket.findById(firstTicketId, filter, myOptions);
-
- const ticketUpdated = await models.Ticket.create({
- clientFk: ticket.clientFk,
- shipped: now,
- addressFk: ticket.address().id,
- agencyModeFk: refundAgencyMode.id,
- nickname: ticket.address().nickname,
- warehouseFk: withWarehouse ? ticket.warehouseFk : null,
- companyFk: ticket.companyFk,
- landed: now,
- zoneFk: refoundZoneId
- }, myOptions);
-
- for (const sale of sales) {
- const createdSale = await models.Sale.create({
- ticketFk: ticketUpdated.id,
- itemFk: sale.itemFk,
- quantity: (isRefund) ? - sale.quantity : sale.quantity,
- concept: sale.concept,
- price: sale.price,
- discount: sale.discount,
- }, myOptions);
-
- const components = sale.components();
- for (const component of components)
- component.saleFk = createdSale.id;
-
- await models.SaleComponent.create(components, myOptions);
- }
-
- if (servicesIds && servicesIds.length > 0) {
- const servicesFilter = {
- where: {id: {inq: servicesIds}}
- };
- const services = await models.TicketService.find(servicesFilter, myOptions);
- for (const service of services) {
- await models.TicketService.create({
- description: service.description,
- quantity: (isRefund) ? - service.quantity : service.quantity,
- price: service.price,
- taxClassFk: service.taxClassFk,
- ticketFk: ticketUpdated.id,
- ticketServiceTypeFk: service.ticketServiceTypeFk,
- }, myOptions);
- }
- }
-
- const query = `CALL vn.ticket_recalc(?, NULL)`;
- await Self.rawSql(query, [refundTicket.id], myOptions);
- return ticketUpdated;
- }
-
- async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
+ /* async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
const models = Self.app.models;
const filter = {include: {relation: 'address'}};
@@ -268,5 +205,5 @@ module.exports = Self => {
}, myOptions);
return refundTicket;
- }
+ } */
};
diff --git a/modules/ticket/back/methods/sale/specs/refund.spec.js b/modules/ticket/back/methods/sale/specs/refund.spec.js
index b81f7f84d..727ce2fac 100644
--- a/modules/ticket/back/methods/sale/specs/refund.spec.js
+++ b/modules/ticket/back/methods/sale/specs/refund.spec.js
@@ -1,7 +1,7 @@
const models = require('vn-loopback/server/server').models;
const LoopBackContext = require('loopback-context');
-describe('Sale refund()', () => {
+fdescribe('Sale refund()', () => {
const userId = 5;
const ctx = {req: {accessToken: userId}};
const activeCtx = {
diff --git a/modules/ticket/back/methods/ticket/refund.js b/modules/ticket/back/methods/ticket/refund.js
index c99b6aa83..758384ae2 100644
--- a/modules/ticket/back/methods/ticket/refund.js
+++ b/modules/ticket/back/methods/ticket/refund.js
@@ -39,7 +39,6 @@ module.exports = Self => {
try {
const filter = {where: {ticketFk: {inq: ticketsIds}}};
-
const sales = await models.Sale.find(filter, myOptions);
const salesIds = sales.map(sale => sale.id);
diff --git a/modules/ticket/back/models/ticket.json b/modules/ticket/back/models/ticket.json
index ec4193bed..1c5610a2a 100644
--- a/modules/ticket/back/models/ticket.json
+++ b/modules/ticket/back/models/ticket.json
@@ -136,6 +136,11 @@
"type": "belongsTo",
"model": "Zone",
"foreignKey": "zoneFk"
+ },
+ "sale": {
+ "type": "hasMany",
+ "model": "Sale",
+ "foreignKey": "ticketFk"
}
}
}
From bd122e6327024b2ad885cfcd340d9bcb2f5e42e5 Mon Sep 17 00:00:00 2001
From: jorgep
Date: Tue, 1 Aug 2023 16:13:24 +0200
Subject: [PATCH 030/427] refs #5014 WIP trasactions added
---
.../methods/invoiceOut/transferInvoiceOut.js | 17 +++++------------
...orrection.json => invoice-correction.json} | 0
modules/ticket/back/methods/sale/clone.js | 19 ++++++++++---------
modules/ticket/back/methods/sale/refund.js | 14 ++++++++------
4 files changed, 23 insertions(+), 27 deletions(-)
rename modules/invoiceOut/back/models/{invoiceCorrection.json => invoice-correction.json} (100%)
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
index 86de59e9d..e059aa431 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
@@ -48,7 +48,7 @@ module.exports = Self => {
Self.transferInvoiceOut = async(ctx, id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477Id, invoiceCorrectionTypeId, options) => {
const models = Self.app.models;
- const myOptions = {};
+ const myOptions = {userId: ctx.req.accessToken.userId};
let tx;
if (typeof options == 'object')
@@ -64,7 +64,6 @@ module.exports = Self => {
const tickets = await models.Ticket.find(filter, myOptions);
const ticketsIds = tickets.map(ticket => ticket.id);
await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
- console.log('Ticket refunded');
// Clone tickets
const refundAgencyMode = await models.AgencyMode.findOne({
include: {
@@ -82,22 +81,17 @@ module.exports = Self => {
const salesFilter = {where: {ticketFk: {inq: ticketsIds}}};
const sales = await models.Sale.find(salesFilter, myOptions);
const clonedTickets = await models.Sale.clone(sales, refundAgencyMode, refoundZoneId, servicesIds, null, false, false, myOptions);
- console.log('cloned tickets');
// Update client
- for (const clonedTicket of clonedTickets) {
- // const ticket = await models.Ticket.findById(clonedTicketId, myOptions);
- console.log(clonedTicket);
+ for (const clonedTicket of clonedTickets)
await clonedTicket.updateAttributes({clientFk: newClientFk}, myOptions);
- console.log(clonedTicket);
- }
+
// Quick invoice
const clonedTicketIds = clonedTickets.map(clonedTicket => clonedTicket.id);
- console.log(clonedTicketIds);
const invoiceIds = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
// Insert InvoiceCorrection
for (const invoiceId of invoiceIds) {
- await models.invoiceCorrection.create({
+ await models.InvoiceCorrection.create({
correctingFk: invoiceId,
correctedFk: id,
cplusRectificationTypeFk: cplusRectificationId,
@@ -105,12 +99,11 @@ module.exports = Self => {
invoiceCorrectionType: invoiceCorrectionTypeId
});
}
-
if (tx) await tx.commit();
+ return true;
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
- return true;
};
};
diff --git a/modules/invoiceOut/back/models/invoiceCorrection.json b/modules/invoiceOut/back/models/invoice-correction.json
similarity index 100%
rename from modules/invoiceOut/back/models/invoiceCorrection.json
rename to modules/invoiceOut/back/models/invoice-correction.json
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
index e1793d088..dae15d7df 100644
--- a/modules/ticket/back/methods/sale/clone.js
+++ b/modules/ticket/back/methods/sale/clone.js
@@ -1,8 +1,12 @@
module.exports = Self => {
- Self.clone = async(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, negative, myOptions) => {
+ Self.clone = async(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, negative, 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;
@@ -39,15 +43,15 @@ module.exports = Self => {
}, myOptions);
updatedTickets.push(newTicket);
}
- const sales = ticket.sale();
- const saleIds = sales.map(sale => sale.id);
+ const salesByTicket = ticket.sale();
+ const saleIds = salesByTicket.map(sale => sale.id);
const saleComponentsFilter = {
where: {saleFk: {inq: saleIds}},
scope: {
fields: ['saleFk', 'componentFk', 'value']
}
};
- for (const sale of sales) {
+ for (const sale of salesByTicket) {
const createdSale = await models.Sale.create({
ticketFk: newTicket.id,
itemFk: sale.itemFk,
@@ -56,7 +60,7 @@ module.exports = Self => {
price: sale.price,
discount: sale.discount,
}, myOptions);
- const components = await models.SaleComponent.find(saleComponentsFilter, myOptions);
+ const components = await models.SaleComponent.find(saleComponentsFilter, myOptions); // Revisar con Alex
// const components = sale.components();
for (const component of components)
component.saleFk = createdSale.id;
@@ -86,10 +90,7 @@ module.exports = Self => {
if (group) {
await Self.rawSql(query, [newTicket.id], myOptions);
if (tx) await tx.commit();
- return {
- refundTicket: newTicket,
- originalTicketFk: firstTicketId
- };
+ return newTicket;
} else {
for (const updatedTicket of updatedTickets)
await Self.rawSql(query, [updatedTicket.id], myOptions);
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index c85bcd834..a69c05f36 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -155,7 +155,7 @@ module.exports = Self => {
}
};
const sales = await models.Sale.find(salesFilter, myOptions);
- const clonedTicket = await models.Sale.clone(
+ const refundTicket = await models.Sale.clone(
sales,
refundAgencyMode,
refoundZoneId,
@@ -166,12 +166,14 @@ module.exports = Self => {
myOptions
);
- const refundTicket = clonedTicket.refundTicket;
+ const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
+ for (const ticketId of ticketsIds) {
+ await models.TicketRefund.create({
+ refundTicketFk: refundTicket.id,
+ originalTicketFk: ticketId,
+ }, myOptions);
+ }
- await models.TicketRefund.create({
- refundTicketFk: refundTicket.id,
- originalTicketFk: clonedTicket.originalTicketFk,
- }, myOptions);
if (tx) await tx.commit();
return refundTicket;
From 725fe674c0babb414a7ea7f7b99763c8f066bcce Mon Sep 17 00:00:00 2001
From: jorgep
Date: Thu, 3 Aug 2023 14:01:50 +0200
Subject: [PATCH 031/427] refs #5914 WIP fixing transacticions
---
.../methods/invoiceOut/transferInvoiceOut.js | 47 ++++------
.../invoiceOut/front/descriptor-menu/index.js | 6 +-
modules/ticket/back/methods/sale/clone.js | 9 +-
modules/ticket/back/methods/sale/refund.js | 90 -------------------
4 files changed, 27 insertions(+), 125 deletions(-)
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
index e059aa431..fbb40061d 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
@@ -1,5 +1,3 @@
-const UserError = require('vn-loopback/util/user-error');
-
module.exports = Self => {
Self.remoteMethodCtx('transferInvoiceOut', {
description: 'Transfer an invoice out to another client',
@@ -48,7 +46,7 @@ module.exports = Self => {
Self.transferInvoiceOut = async(ctx, id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477Id, invoiceCorrectionTypeId, options) => {
const models = Self.app.models;
- const myOptions = {userId: ctx.req.accessToken.userId};
+ const myOptions = {};
let tx;
if (typeof options == 'object')
@@ -65,42 +63,35 @@ module.exports = Self => {
const ticketsIds = tickets.map(ticket => ticket.id);
await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
// Clone tickets
- const refundAgencyMode = await models.AgencyMode.findOne({
- include: {
- relation: 'zones',
- scope: {
- limit: 1,
- field: ['id', 'name']
- }
- },
- where: {code: 'refund'}
- }, myOptions);
- const refoundZoneId = refundAgencyMode.zones()[0].id;
const services = await models.TicketService.find(filter, myOptions);
const servicesIds = services.map(service => service.id);
const salesFilter = {where: {ticketFk: {inq: ticketsIds}}};
const sales = await models.Sale.find(salesFilter, myOptions);
- const clonedTickets = await models.Sale.clone(sales, refundAgencyMode, refoundZoneId, servicesIds, null, false, false, myOptions);
+ const clonedTickets = await models.Sale.clone(sales, servicesIds, null, false, false, myOptions);
+ console.log('cloned tickets', clonedTickets);
// Update client
- for (const clonedTicket of clonedTickets)
- await clonedTicket.updateAttributes({clientFk: newClientFk}, myOptions);
+ for (const clonedTicket of clonedTickets) {
+ const ticket = await models.Ticket.findById(clonedTicket);
+ console.log(ticket);
+ await ticket.updateAttributes({clientFk: newClientFk}, myOptions);
+ // await clonedTicket.updateAttributes({clientFk: newClientFk}, myOptions);
+ }
// Quick invoice
const clonedTicketIds = clonedTickets.map(clonedTicket => clonedTicket.id);
- const invoiceIds = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
+ const invoiceId = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
// Insert InvoiceCorrection
- for (const invoiceId of invoiceIds) {
- await models.InvoiceCorrection.create({
- correctingFk: invoiceId,
- correctedFk: id,
- cplusRectificationTypeFk: cplusRectificationId,
- cplusInvoiceType477Fk: cplusInvoiceType477Id,
- invoiceCorrectionType: invoiceCorrectionTypeId
- });
- }
+ await models.InvoiceCorrection.create({
+ correctingFk: invoiceId,
+ correctedFk: id,
+ cplusRectificationTypeFk: cplusRectificationId,
+ cplusInvoiceType477Fk: cplusInvoiceType477Id,
+ invoiceCorrectionType: invoiceCorrectionTypeId
+ });
+
if (tx) await tx.commit();
- return true;
+ return invoiceId;
} catch (e) {
if (tx) await tx.rollback();
throw e;
diff --git a/modules/invoiceOut/front/descriptor-menu/index.js b/modules/invoiceOut/front/descriptor-menu/index.js
index 8ec5de3e6..ef69098c4 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.js
+++ b/modules/invoiceOut/front/descriptor-menu/index.js
@@ -135,7 +135,11 @@ class Controller extends Section {
cplusInvoiceType477Id: this.cplusInvoiceType477,
invoiceCorrectionTypeId: this.invoiceCorrectionType
};
- this.$http.post(`InvoiceOuts/transferInvoice`, params).then(res => console.log(res.data));
+ this.$http.post(`InvoiceOuts/transferInvoice`, params).then(res => {
+ newInvoice = res.data;// id de la nueva factura
+ this.vnApp.showSucces(this.$t('Invoice trasfered!'));
+ this.$state.go('invoiceOut.index', {id: newInvoice});
+ });
}
}
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
index dae15d7df..c168f4b3c 100644
--- a/modules/ticket/back/methods/sale/clone.js
+++ b/modules/ticket/back/methods/sale/clone.js
@@ -1,5 +1,5 @@
module.exports = Self => {
- Self.clone = async(sales, refundAgencyMode, refoundZoneId, servicesIds, withWarehouse, group, negative, options) => {
+ Self.clone = async(sales, servicesIds, withWarehouse, group, negative, options) => {
const models = Self.app.models;
const myOptions = {};
let tx;
@@ -13,7 +13,6 @@ module.exports = Self => {
}
const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
- const [firstTicketId] = ticketsIds;
const now = Date.vnNew();
let updatedTickets = [];
let newTicket;
@@ -22,7 +21,7 @@ module.exports = Self => {
{relation: 'address'},
{
relation: 'sale',
- inq: sales,
+ where: {saleFk: {inq: sales}},
},
]
};
@@ -34,12 +33,10 @@ module.exports = Self => {
clientFk: ticket.clientFk,
shipped: now,
addressFk: ticket.address().id,
- agencyModeFk: refundAgencyMode.id,
nickname: ticket.address().nickname,
warehouseFk: withWarehouse ? ticket.warehouseFk : null,
companyFk: ticket.companyFk,
landed: now,
- zoneFk: refoundZoneId
}, myOptions);
updatedTickets.push(newTicket);
}
@@ -95,7 +92,7 @@ module.exports = Self => {
for (const updatedTicket of updatedTickets)
await Self.rawSql(query, [updatedTicket.id], myOptions);
if (tx) await tx.commit();
- return updatedTickets/* updatedTickets.map(updatedTicket => updatedTicket.id) */;
+ return /* updatedTickets */updatedTickets.map(updatedTicket => updatedTicket.id);
}
} catch (e) {
if (tx) await tx.rollback();
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index a69c05f36..dabafb469 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -28,96 +28,6 @@ module.exports = Self => {
}
});
- /* Self.refund = async(ctx, salesIds, servicesIds, withWarehouse, options) => {
- const models = Self.app.models;
- 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 refundAgencyMode = await models.AgencyMode.findOne({
- include: {
- relation: 'zones',
- scope: {
- limit: 1,
- field: ['id', 'name']
- }
- },
- where: {code: 'refund'}
- }, myOptions);
-
- const refoundZoneId = refundAgencyMode.zones()[0].id;
-
- const salesFilter = {
- where: {id: {inq: salesIds}},
- include: {
- relation: 'components',
- scope: {
- fields: ['saleFk', 'componentFk', 'value']
- }
- }
- };
- const sales = await models.Sale.find(salesFilter, myOptions);
- const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
-
- const now = Date.vnNew();
- const [firstTicketId] = ticketsIds;
-
- const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
-
- for (const sale of sales) {
- const createdSale = await models.Sale.create({
- ticketFk: refundTicket.id,
- itemFk: sale.itemFk,
- quantity: - sale.quantity,
- concept: sale.concept,
- price: sale.price,
- discount: sale.discount,
- }, myOptions);
-
- const components = sale.components();
- for (const component of components)
- component.saleFk = createdSale.id;
-
- await models.SaleComponent.create(components, myOptions);
- }
-
- if (servicesIds && servicesIds.length > 0) {
- const servicesFilter = {
- where: {id: {inq: servicesIds}}
- };
- const services = await models.TicketService.find(servicesFilter, myOptions);
- for (const service of services) {
- await models.TicketService.create({
- description: service.description,
- quantity: - service.quantity,
- price: service.price,
- taxClassFk: service.taxClassFk,
- ticketFk: refundTicket.id,
- ticketServiceTypeFk: service.ticketServiceTypeFk,
- }, myOptions);
- }
- }
-
- const query = `CALL vn.ticket_recalc(?, NULL)`;
- await Self.rawSql(query, [refundTicket.id], myOptions);
-
- if (tx) await tx.commit();
-
- return refundTicket;
- } catch (e) {
- if (tx) await tx.rollback();
- throw e;
- }
- }; */
-
Self.refund = async(ctx, salesIds, servicesIds, withWarehouse, options) => {
const models = Self.app.models;
const myOptions = {userId: ctx.req.accessToken.userId};
From 700ba4a7b1fce37f7575b3308ead22163687a14b Mon Sep 17 00:00:00 2001
From: alexm
Date: Fri, 4 Aug 2023 08:22:43 +0200
Subject: [PATCH 032/427] refs #5914 feat(transferInvoiceOut): optimization
---
.../methods/invoiceOut/transferInvoiceOut.js | 18 ++++++++----------
modules/ticket/back/methods/sale/clone.js | 2 +-
.../back/methods/ticket/invoiceTickets.js | 7 +++++--
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
index fbb40061d..440ebe4d3 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
@@ -46,7 +46,8 @@ module.exports = Self => {
Self.transferInvoiceOut = async(ctx, id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477Id, invoiceCorrectionTypeId, options) => {
const models = Self.app.models;
- const myOptions = {};
+ const myOptions = {userId: ctx.req.accessToken.userId};
+
let tx;
if (typeof options == 'object')
@@ -65,20 +66,17 @@ module.exports = Self => {
// Clone tickets
const services = await models.TicketService.find(filter, myOptions);
const servicesIds = services.map(service => service.id);
- const salesFilter = {where: {ticketFk: {inq: ticketsIds}}};
- const sales = await models.Sale.find(salesFilter, myOptions);
+ const sales = await models.Sale.find({where: {ticketFk: {inq: ticketsIds}}}, myOptions);
const clonedTickets = await models.Sale.clone(sales, servicesIds, null, false, false, myOptions);
- console.log('cloned tickets', clonedTickets);
+ const clonedTicketIds = [];
+
// Update client
for (const clonedTicket of clonedTickets) {
- const ticket = await models.Ticket.findById(clonedTicket);
- console.log(ticket);
- await ticket.updateAttributes({clientFk: newClientFk}, myOptions);
- // await clonedTicket.updateAttributes({clientFk: newClientFk}, myOptions);
+ await clonedTicket.updateAttribute('clientFk', newClientFk, myOptions);
+ clonedTicketIds.push(clonedTicket.id);
}
// Quick invoice
- const clonedTicketIds = clonedTickets.map(clonedTicket => clonedTicket.id);
const invoiceId = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
// Insert InvoiceCorrection
@@ -88,7 +86,7 @@ module.exports = Self => {
cplusRectificationTypeFk: cplusRectificationId,
cplusInvoiceType477Fk: cplusInvoiceType477Id,
invoiceCorrectionType: invoiceCorrectionTypeId
- });
+ }, myOptions);
if (tx) await tx.commit();
return invoiceId;
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
index c168f4b3c..7d52fd0e6 100644
--- a/modules/ticket/back/methods/sale/clone.js
+++ b/modules/ticket/back/methods/sale/clone.js
@@ -92,7 +92,7 @@ module.exports = Self => {
for (const updatedTicket of updatedTickets)
await Self.rawSql(query, [updatedTicket.id], myOptions);
if (tx) await tx.commit();
- return /* updatedTickets */updatedTickets.map(updatedTicket => updatedTicket.id);
+ return /* updatedTickets */updatedTickets;
}
} catch (e) {
if (tx) await tx.rollback();
diff --git a/modules/ticket/back/methods/ticket/invoiceTickets.js b/modules/ticket/back/methods/ticket/invoiceTickets.js
index ca1bf15fb..7baee133d 100644
--- a/modules/ticket/back/methods/ticket/invoiceTickets.js
+++ b/modules/ticket/back/methods/ticket/invoiceTickets.js
@@ -77,9 +77,11 @@ module.exports = function(Self) {
if (tx) await tx.rollback();
throw e;
}
-
- for (const invoiceId of invoicesIds)
+ console.log(invoicesIds, 'invoicesIds');
+ for (const invoiceId of invoicesIds) {
+ console.log(await models.InvoiceOut.find());
await models.InvoiceOut.makePdfAndNotify(ctx, invoiceId, null);
+ }
return invoicesIds;
};
@@ -98,6 +100,7 @@ module.exports = function(Self) {
`, [ticketsIds], myOptions);
const invoiceId = await models.Ticket.makeInvoice(ctx, 'R', companyId, Date.vnNew(), myOptions);
+ console.log(await models.InvoiceOut.find(null, myOptions));
invoicesIds.push(invoiceId);
}
};
From 6eb88f8ab7f7923af915791f9adb4934bd708ee6 Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Fri, 11 Aug 2023 11:58:30 +0200
Subject: [PATCH 033/427] refs #5134 feat: models
---
modules/ticket/back/models/saleMistake.json | 49 +++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 modules/ticket/back/models/saleMistake.json
diff --git a/modules/ticket/back/models/saleMistake.json b/modules/ticket/back/models/saleMistake.json
new file mode 100644
index 000000000..b48e6088d
--- /dev/null
+++ b/modules/ticket/back/models/saleMistake.json
@@ -0,0 +1,49 @@
+{ // A REVISAR QUE NOFA INSERT EN
+ "name": "SaleMistake",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "saleMistake"
+ }
+ },
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "number",
+ "description": "Identifier"
+ },
+ "created": {
+ "type": "date"
+ },
+ "saleFk": {
+ "type": "number"
+ },
+ "userFk": {
+ "type": "number"
+ },
+ "typeFk": {
+ "type": "number"
+ }
+ },
+ "relations": {
+ "sale": {
+ "type": "belongsTo",
+ "model": "Sale",
+ "foreignKey": "saleFk",
+ "required": true
+ },
+ "worker": {
+ "type": "belongsTo",
+ "model": "Worker",
+ "foreignKey": "userFk",
+ "required": true
+ },
+ "mistakeType": {
+ "type": "belongsTo",
+ "model": "MistakeType",
+ "foreignKey": "typeFk",
+ "required": true
+ }
+
+ }
+}
From 9ef4ba9befa6dcf1de94d6d0b7b167e6a049c3ac Mon Sep 17 00:00:00 2001
From: alexm
Date: Fri, 11 Aug 2023 12:32:49 +0200
Subject: [PATCH 034/427] refs #5134 feat: add saleMistake model
---
db/changes/233401/00-acl_saleMistake.sql | 3 +++
db/dump/fixtures.sql | 6 ++++-
modules/ticket/back/model-config.json | 3 +++
.../{saleMistake.json => sale-mistake.json} | 22 +++++++++----------
4 files changed, 22 insertions(+), 12 deletions(-)
create mode 100644 db/changes/233401/00-acl_saleMistake.sql
rename modules/ticket/back/models/{saleMistake.json => sale-mistake.json} (75%)
diff --git a/db/changes/233401/00-acl_saleMistake.sql b/db/changes/233401/00-acl_saleMistake.sql
new file mode 100644
index 000000000..219669c17
--- /dev/null
+++ b/db/changes/233401/00-acl_saleMistake.sql
@@ -0,0 +1,3 @@
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('SaleMistake', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee');
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 7a572fb04..630b6fb6c 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -2955,6 +2955,10 @@ INSERT INTO `vn`.`invoiceInSerial` (`code`, `description`, `cplusTerIdNifFk`, `t
('W', 'Vanaheim', 1, 'WORLD');
-INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
+INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
VALUES
(1, 0, 0, 'marvel.com');
+
+INSERT INTO `vn`.`mistakeType` (`id`, `description`)
+ VALUES
+ (1, 'Incorrect quantity');
diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json
index 3c7e12eea..ef2a14dfe 100644
--- a/modules/ticket/back/model-config.json
+++ b/modules/ticket/back/model-config.json
@@ -44,6 +44,9 @@
"SaleGroup": {
"dataSource": "vn"
},
+ "SaleMistake": {
+ "dataSource": "vn"
+ },
"SaleGroupDetail": {
"dataSource": "vn"
},
diff --git a/modules/ticket/back/models/saleMistake.json b/modules/ticket/back/models/sale-mistake.json
similarity index 75%
rename from modules/ticket/back/models/saleMistake.json
rename to modules/ticket/back/models/sale-mistake.json
index b48e6088d..390e45404 100644
--- a/modules/ticket/back/models/saleMistake.json
+++ b/modules/ticket/back/models/sale-mistake.json
@@ -1,4 +1,4 @@
-{ // A REVISAR QUE NOFA INSERT EN
+{
"name": "SaleMistake",
"base": "VnModel",
"options": {
@@ -16,34 +16,34 @@
"type": "date"
},
"saleFk": {
- "type": "number"
+ "type": "number",
+ "required": true
},
"userFk": {
- "type": "number"
+ "type": "number",
+ "required": true
},
"typeFk": {
- "type": "number"
+ "type": "number",
+ "required": true
}
},
"relations": {
"sale": {
"type": "belongsTo",
"model": "Sale",
- "foreignKey": "saleFk",
- "required": true
+ "foreignKey": "saleFk"
},
"worker": {
"type": "belongsTo",
"model": "Worker",
- "foreignKey": "userFk",
- "required": true
+ "foreignKey": "userFk"
},
"mistakeType": {
"type": "belongsTo",
"model": "MistakeType",
- "foreignKey": "typeFk",
- "required": true
+ "foreignKey": "typeFk"
}
-
+
}
}
From a6047d257b9c118e971767f45baf62208c13f50e Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Fri, 11 Aug 2023 12:45:18 +0200
Subject: [PATCH 035/427] refs #5134 feat:modelsSalix
---
db/changes/233401/00-models.sql | 29 +++++++++++++++++++
modules/invoiceOut/back/models/printer.json | 7 +++++
modules/shelving/back/model-config.json | 3 ++
modules/shelving/back/models/train.json | 19 ++++++++++++
modules/ticket/back/model-config.json | 6 ++++
.../ticket/back/models/expeditionMistake.json | 2 +-
.../back/models/expeditionMistakeType.json | 20 +++++++++++++
modules/ticket/back/models/sale-mistake.json | 2 +-
modules/worker/back/model-config.json | 9 ++++++
modules/worker/back/models/mistakeType.json | 20 +++++++++++++
modules/worker/back/models/workerMistake.json | 25 ++++++++++++++++
.../worker/back/models/workerMistakeType.json | 27 +++++++++++++++++
12 files changed, 167 insertions(+), 2 deletions(-)
create mode 100644 db/changes/233401/00-models.sql
create mode 100644 modules/shelving/back/models/train.json
create mode 100644 modules/ticket/back/models/expeditionMistakeType.json
create mode 100644 modules/worker/back/models/mistakeType.json
create mode 100644 modules/worker/back/models/workerMistake.json
create mode 100644 modules/worker/back/models/workerMistakeType.json
diff --git a/db/changes/233401/00-models.sql b/db/changes/233401/00-models.sql
new file mode 100644
index 000000000..648824287
--- /dev/null
+++ b/db/changes/233401/00-models.sql
@@ -0,0 +1,29 @@
+INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId)
+ VALUES('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
+
+INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId)
+ VALUES('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
+
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee');
+
+INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
+ VALUES('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss');
+
+INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
+ VALUES('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss');
+
+INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId)
+ VALUES('MistakesTypes', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss');
+
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('MistakeType','*','READ','ALLOW','ROLE','employee');
+
+INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId)
+ VALUES(698, 'MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist');
+
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Printer','*','READ','ALLOW','ROLE','employee');
+
+INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
+VALUES( 'SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production');
diff --git a/modules/invoiceOut/back/models/printer.json b/modules/invoiceOut/back/models/printer.json
index 99003560d..46a031f65 100644
--- a/modules/invoiceOut/back/models/printer.json
+++ b/modules/invoiceOut/back/models/printer.json
@@ -18,6 +18,13 @@
"isLabeler": {
"type": "boolean"
}
+ },
+ "relations": {
+ "sector": {
+ "type": "belongsTo",
+ "model": "Sector",
+ "foreignKey": "sectorFk"
+ }
},
"acls": [{
"accessType": "READ",
diff --git a/modules/shelving/back/model-config.json b/modules/shelving/back/model-config.json
index c26c39d38..89a0832b0 100644
--- a/modules/shelving/back/model-config.json
+++ b/modules/shelving/back/model-config.json
@@ -10,5 +10,8 @@
},
"Sector": {
"dataSource": "vn"
+ },
+ "Train": {
+ "dataSource": "vn"
}
}
\ No newline at end of file
diff --git a/modules/shelving/back/models/train.json b/modules/shelving/back/models/train.json
new file mode 100644
index 000000000..cc819664b
--- /dev/null
+++ b/modules/shelving/back/models/train.json
@@ -0,0 +1,19 @@
+{
+ "name": "Train",
+ "options": {
+ "mysql": {
+ "table": "train"
+ }
+ },
+ "properties": {
+ "id": {
+ "type": "number",
+ "id": true
+ },
+ "name": {
+ "type": "string",
+ "required": true
+ }
+
+ }
+}
diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json
index ef2a14dfe..456bb73d3 100644
--- a/modules/ticket/back/model-config.json
+++ b/modules/ticket/back/model-config.json
@@ -29,6 +29,9 @@
"ExpeditionMistake": {
"dataSource": "vn"
},
+ "ExpeditionMistakeType": {
+ "dataSource": "vn"
+ },
"PrintServerQueue": {
"dataSource": "vn"
},
@@ -50,6 +53,9 @@
"SaleGroupDetail": {
"dataSource": "vn"
},
+ "SaleMistake": {
+ "dataSource": "vn"
+ },
"SaleTracking": {
"dataSource": "vn"
},
diff --git a/modules/ticket/back/models/expeditionMistake.json b/modules/ticket/back/models/expeditionMistake.json
index 43033194a..aeed2aa3a 100644
--- a/modules/ticket/back/models/expeditionMistake.json
+++ b/modules/ticket/back/models/expeditionMistake.json
@@ -24,7 +24,7 @@
},
"type": {
"type": "belongsTo",
- "model": "MistakeType",
+ "model": "ExpeditionMistakeType",
"foreignKey": "typeFk"
}
}
diff --git a/modules/ticket/back/models/expeditionMistakeType.json b/modules/ticket/back/models/expeditionMistakeType.json
new file mode 100644
index 000000000..cf997a963
--- /dev/null
+++ b/modules/ticket/back/models/expeditionMistakeType.json
@@ -0,0 +1,20 @@
+{
+ "name": "ExpeditionMistakeType",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "expeditionMistakeType"
+ }
+ },
+ "properties": {
+ "code": {
+ "id":true,
+ "type": "string"
+
+ },
+ "description": {
+ "type": "string"
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/modules/ticket/back/models/sale-mistake.json b/modules/ticket/back/models/sale-mistake.json
index 390e45404..b1cd989e0 100644
--- a/modules/ticket/back/models/sale-mistake.json
+++ b/modules/ticket/back/models/sale-mistake.json
@@ -46,4 +46,4 @@
}
}
-}
+}
\ No newline at end of file
diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json
index 60ec273a5..ca47afaf6 100644
--- a/modules/worker/back/model-config.json
+++ b/modules/worker/back/model-config.json
@@ -40,6 +40,9 @@
},
"EducationLevel": {
"dataSource": "vn"
+ },
+ "MistakeType": {
+ "dataSource": "vn"
},
"ProfileType":{
"dataSource": "vn"
@@ -80,6 +83,12 @@
"WorkerMana": {
"dataSource": "vn"
},
+ "WorkerMistake": {
+ "dataSource": "vn"
+ },
+ "WorkerMistakeType": {
+ "dataSource": "vn"
+ },
"WorkerMedia": {
"dataSource": "vn"
},
diff --git a/modules/worker/back/models/mistakeType.json b/modules/worker/back/models/mistakeType.json
new file mode 100644
index 000000000..71d9e4744
--- /dev/null
+++ b/modules/worker/back/models/mistakeType.json
@@ -0,0 +1,20 @@
+{
+ "name": "MistakeType",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "mistakeType"
+ }
+ },
+ "properties": {
+ "id": {
+ "id":true,
+ "type": "number"
+ },
+ "description": {
+ "type": "string"
+ }
+
+ }
+ }
+
\ No newline at end of file
diff --git a/modules/worker/back/models/workerMistake.json b/modules/worker/back/models/workerMistake.json
new file mode 100644
index 000000000..47ed95f80
--- /dev/null
+++ b/modules/worker/back/models/workerMistake.json
@@ -0,0 +1,25 @@
+{
+ "name": "WorkerMistake",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "workerMistake"
+ }
+ },
+ "properties": {
+ "id": {
+ "id":true,
+ "type": "number"
+ },
+ "userFk": {
+ "type": "number"
+ },
+ "workerMistakeTypeFk": {
+ "type": "string"
+ },
+ "created": {
+ "type": "date"
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/modules/worker/back/models/workerMistakeType.json b/modules/worker/back/models/workerMistakeType.json
new file mode 100644
index 000000000..3c808f24c
--- /dev/null
+++ b/modules/worker/back/models/workerMistakeType.json
@@ -0,0 +1,27 @@
+{
+ "name": "WorkerMistakeType",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "workerMistakeType"
+ }
+ },
+ "properties": {
+ "code": {
+ "id":true,
+ "type": "string"
+
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "relations": {
+ "type": {
+ "type": "belongsTo",
+ "model": "WorkerMistakeType",
+ "foreignKey": "code"
+ }
+ }
+ }
+
\ No newline at end of file
From 1ec51d94cf497df1ed51dc0043d66091583430d8 Mon Sep 17 00:00:00 2001
From: alexm
Date: Fri, 11 Aug 2023 12:53:43 +0200
Subject: [PATCH 036/427] refs #5134 feat: correct sql
---
db/changes/233401/00-acl_saleMistake.sql | 3 ---
db/changes/233401/00-models.sql | 24 ++++++++++++------------
modules/ticket/back/model-config.json | 3 ---
3 files changed, 12 insertions(+), 18 deletions(-)
delete mode 100644 db/changes/233401/00-acl_saleMistake.sql
diff --git a/db/changes/233401/00-acl_saleMistake.sql b/db/changes/233401/00-acl_saleMistake.sql
deleted file mode 100644
index 219669c17..000000000
--- a/db/changes/233401/00-acl_saleMistake.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
- VALUES
- ('SaleMistake', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee');
diff --git a/db/changes/233401/00-models.sql b/db/changes/233401/00-models.sql
index 648824287..c06965b3f 100644
--- a/db/changes/233401/00-models.sql
+++ b/db/changes/233401/00-models.sql
@@ -1,29 +1,29 @@
-INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId)
+INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId)
VALUES('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
-INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId)
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss');
-INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss');
-INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId)
+INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId)
VALUES('MistakesTypes', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('MistakeType','*','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId)
- VALUES(698, 'MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist');
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
+ VALUES('MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Printer','*','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
-VALUES( 'SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production');
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
+ VALUES( 'SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production');
diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json
index 456bb73d3..e90d0409f 100644
--- a/modules/ticket/back/model-config.json
+++ b/modules/ticket/back/model-config.json
@@ -53,9 +53,6 @@
"SaleGroupDetail": {
"dataSource": "vn"
},
- "SaleMistake": {
- "dataSource": "vn"
- },
"SaleTracking": {
"dataSource": "vn"
},
From b1b6bd13ea73fe7860eef2548f1ffeb4f21f12e7 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 22 Aug 2023 10:45:41 +0200
Subject: [PATCH 037/427] refs #5843 change userFk
---
modules/claim/front/descriptor/index.html | 2 +-
modules/client/back/methods/receipt/filter.js | 2 +-
modules/client/front/credit/index/index.html | 10 +++++-----
modules/item/back/methods/item/filter.js | 2 +-
modules/item/front/descriptor/index.html | 6 +++---
modules/item/front/summary/index.html | 2 +-
.../monitor/back/methods/sales-monitor/salesFilter.js | 2 +-
modules/order/back/methods/order/filter.js | 2 +-
modules/route/back/methods/route/filter.js | 4 ++--
.../back/methods/sale-tracking/listSaleTracking.js | 2 +-
modules/ticket/back/methods/ticket-request/filter.js | 4 ++--
modules/ticket/back/methods/ticket/filter.js | 2 +-
modules/worker/back/methods/worker/getWorkedHours.js | 6 +++---
modules/worker/back/models/worker.json | 7 ++-----
modules/worker/front/pbx/index.js | 2 +-
modules/worker/front/summary/index.html | 2 +-
print/templates/email/client-welcome/sql/client.sql | 4 ++--
print/templates/email/printer-setup/sql/client.sql | 4 ++--
print/templates/reports/driver-route/sql/routes.sql | 6 +++---
19 files changed, 34 insertions(+), 37 deletions(-)
diff --git a/modules/claim/front/descriptor/index.html b/modules/claim/front/descriptor/index.html
index 5fd198440..8ff1fd791 100644
--- a/modules/claim/front/descriptor/index.html
+++ b/modules/claim/front/descriptor/index.html
@@ -45,7 +45,7 @@
{{$ctrl.claim.worker.user.name}}
diff --git a/modules/client/back/methods/receipt/filter.js b/modules/client/back/methods/receipt/filter.js
index 6df5e73f8..7b5d73dae 100644
--- a/modules/client/back/methods/receipt/filter.js
+++ b/modules/client/back/methods/receipt/filter.js
@@ -60,7 +60,7 @@ module.exports = Self => {
at2.id IS NOT NULL as isCompensation
FROM vn.receipt r
LEFT JOIN vn.worker w ON w.id = r.workerFk
- LEFT JOIN account.user u ON u.id = w.userFk
+ LEFT JOIN account.user u ON u.id = w.id
JOIN vn.company c ON c.id = r.companyFk
LEFT JOIN vn.accounting a ON a.id = r.bankFk
LEFT JOIN vn.accountingType at2 ON at2.id = a.accountingTypeFk AND at2.code = 'compensation'
diff --git a/modules/client/front/credit/index/index.html b/modules/client/front/credit/index/index.html
index 989a0129f..d11449268 100644
--- a/modules/client/front/credit/index/index.html
+++ b/modules/client/front/credit/index/index.html
@@ -24,8 +24,8 @@
{{::credit.created | date:'dd/MM/yyyy HH:mm'}}
-
{{::credit.worker.user.name}}
@@ -41,10 +41,10 @@
ui-sref="client.card.credit.create"
vn-acl="teamBoss"
vn-acl-action="remove"
- vn-tooltip="New credit"
+ vn-tooltip="New credit"
vn-bind="+"
fixed-bottom-right>
-
-
\ No newline at end of file
+
diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js
index d5de6a954..909b3dff8 100644
--- a/modules/item/back/methods/item/filter.js
+++ b/modules/item/back/methods/item/filter.js
@@ -180,7 +180,7 @@ module.exports = Self => {
LEFT JOIN itemType it ON it.id = i.typeFk
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN worker w ON w.id = it.workerFk
- LEFT JOIN account.user u ON u.id = w.userFk
+ LEFT JOIN account.user u ON u.id = w.id
LEFT JOIN intrastat intr ON intr.id = i.intrastatFk
LEFT JOIN producer pr ON pr.id = i.producerFk
LEFT JOIN origin ori ON ori.id = i.originFk
diff --git a/modules/item/front/descriptor/index.html b/modules/item/front/descriptor/index.html
index 7c442d364..82dfa3c9f 100644
--- a/modules/item/front/descriptor/index.html
+++ b/modules/item/front/descriptor/index.html
@@ -1,6 +1,6 @@
{{$ctrl.item.itemType.worker.user.name}}
diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html
index fcc267b4d..6ec738c7e 100644
--- a/modules/item/front/summary/index.html
+++ b/modules/item/front/summary/index.html
@@ -70,7 +70,7 @@
{{$ctrl.summary.item.itemType.worker.user.name}}
diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js
index 4f9edd11c..693ae122f 100644
--- a/modules/monitor/back/methods/sales-monitor/salesFilter.js
+++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js
@@ -215,7 +215,7 @@ module.exports = Self => {
LEFT JOIN state st ON st.id = ts.stateFk
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.userFk
+ LEFT JOIN account.user u ON u.id = wk.id
LEFT JOIN zoneEstimatedDelivery zed ON zed.zoneFk = t.zoneFk`);
if (args.orderFk) {
diff --git a/modules/order/back/methods/order/filter.js b/modules/order/back/methods/order/filter.js
index 10185af7e..44d8ccb10 100644
--- a/modules/order/back/methods/order/filter.js
+++ b/modules/order/back/methods/order/filter.js
@@ -169,7 +169,7 @@ module.exports = Self => {
LEFT JOIN agencyMode am ON am.id = o.agency_id
LEFT JOIN client c ON c.id = o.customer_id
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
- LEFT JOIN account.user u ON u.id = wk.userFk
+ LEFT JOIN account.user u ON u.id = wk.id
LEFT JOIN company co ON co.id = o.company_id
LEFT JOIN orderTicket ot ON ot.orderFk = o.id
LEFT JOIN ticket t ON t.id = ot.ticketFk
diff --git a/modules/route/back/methods/route/filter.js b/modules/route/back/methods/route/filter.js
index fdec84d4d..fc35e979f 100644
--- a/modules/route/back/methods/route/filter.js
+++ b/modules/route/back/methods/route/filter.js
@@ -111,7 +111,7 @@ module.exports = Self => {
let stmt;
stmt = new ParameterizedSQL(
- `SELECT
+ `SELECT
r.id,
r.workerFk,
r.created,
@@ -134,7 +134,7 @@ module.exports = Self => {
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
LEFT JOIN vehicle v ON v.id = r.vehicleFk
LEFT JOIN worker w ON w.id = r.workerFk
- LEFT JOIN account.user u ON u.id = w.userFk`
+ LEFT JOIN account.user u ON u.id = w.id`
);
stmt.merge(conn.makeSuffix(filter));
diff --git a/modules/ticket/back/methods/sale-tracking/listSaleTracking.js b/modules/ticket/back/methods/sale-tracking/listSaleTracking.js
index 98743d8cc..fbc855501 100644
--- a/modules/ticket/back/methods/sale-tracking/listSaleTracking.js
+++ b/modules/ticket/back/methods/sale-tracking/listSaleTracking.js
@@ -41,7 +41,7 @@ module.exports = Self => {
FROM saleTracking st
JOIN sale s ON s.id = st.saleFk
JOIN worker w ON w.id = st.workerFk
- JOIN account.user u ON u.id = w.userFk
+ JOIN account.user u ON u.id = w.id
JOIN state ste ON ste.id = st.stateFk`);
stmt.merge(Self.makeSuffix(filter));
diff --git a/modules/ticket/back/methods/ticket-request/filter.js b/modules/ticket/back/methods/ticket-request/filter.js
index 921598b57..f27ea5018 100644
--- a/modules/ticket/back/methods/ticket-request/filter.js
+++ b/modules/ticket/back/methods/ticket-request/filter.js
@@ -153,9 +153,9 @@ module.exports = Self => {
LEFT JOIN item i ON i.id = tr.itemFk
LEFT JOIN sale s ON s.id = tr.saleFk
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
- LEFT JOIN account.user u ON u.id = wk.userFk
+ LEFT JOIN account.user u ON u.id = wk.id
LEFT JOIN worker wka ON wka.id = tr.attenderFk
- LEFT JOIN account.user ua ON ua.id = wka.userFk`);
+ LEFT JOIN account.user ua ON ua.id = wka.id`);
stmt.merge(conn.makeSuffix(filter));
return conn.executeStmt(stmt, myOptions);
diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js
index eb3da39af..899fe05cd 100644
--- a/modules/ticket/back/methods/ticket/filter.js
+++ b/modules/ticket/back/methods/ticket/filter.js
@@ -272,7 +272,7 @@ module.exports = Self => {
LEFT JOIN state st ON st.id = ts.stateFk
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.userFk
+ LEFT JOIN account.user u ON u.id = wk.id
LEFT JOIN route r ON r.id = t.routeFk`);
if (args.orderFk) {
diff --git a/modules/worker/back/methods/worker/getWorkedHours.js b/modules/worker/back/methods/worker/getWorkedHours.js
index 44f3eca3a..cac74a416 100644
--- a/modules/worker/back/methods/worker/getWorkedHours.js
+++ b/modules/worker/back/methods/worker/getWorkedHours.js
@@ -38,12 +38,12 @@ module.exports = Self => {
const conn = Self.dataSource.connector;
const worker = await models.Worker.findById(id);
- const userId = worker.userFk;
+ const userId = worker.id;
const stmts = [];
stmts.push(`
- DROP TEMPORARY TABLE IF EXISTS
+ DROP TEMPORARY TABLE IF EXISTS
tmp.timeControlCalculate,
tmp.timeBusinessCalculate
`);
@@ -54,7 +54,7 @@ module.exports = Self => {
const resultIndex = stmts.push(new ParameterizedSQL(`
SELECT tcc.dated, tbc.timeWorkSeconds expectedHours, tcc.timeWorkSeconds workedHours
- FROM tmp.timeControlCalculate tcc
+ FROM tmp.timeControlCalculate tcc
LEFT JOIN tmp.timeBusinessCalculate tbc ON tcc.dated = tbc.dated
WHERE tcc.dated BETWEEN DATE(?) AND DATE(?)
`, [started, ended])) - 1;
diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json
index 6e1371055..dbb3ed23f 100644
--- a/modules/worker/back/models/worker.json
+++ b/modules/worker/back/models/worker.json
@@ -24,9 +24,6 @@
"phone": {
"type" : "string"
},
- "userFk": {
- "type" : "number"
- },
"bossFk": {
"type" : "number"
},
@@ -66,12 +63,12 @@
"client": {
"type": "belongsTo",
"model": "Client",
- "foreignKey": "userFk"
+ "foreignKey": "id"
},
"sip": {
"type": "belongsTo",
"model": "Sip",
- "foreignKey": "userFk"
+ "foreignKey": "id"
},
"department": {
"type": "belongsTo",
diff --git a/modules/worker/front/pbx/index.js b/modules/worker/front/pbx/index.js
index d37f6f7d8..3b6443d3c 100644
--- a/modules/worker/front/pbx/index.js
+++ b/modules/worker/front/pbx/index.js
@@ -5,7 +5,7 @@ class Controller extends Section {
onSubmit() {
const sip = this.worker.sip;
const params = {
- userFk: this.worker.userFk,
+ userFk: this.worker.id,
extension: sip.extension
};
this.$.watcher.check();
diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html
index 2607d9b2f..6604ef6ca 100644
--- a/modules/worker/front/summary/index.html
+++ b/modules/worker/front/summary/index.html
@@ -58,7 +58,7 @@
User data
+ value="{{worker.id}}">
diff --git a/print/templates/email/client-welcome/sql/client.sql b/print/templates/email/client-welcome/sql/client.sql
index 49e1d4bf6..59bdeae4a 100644
--- a/print/templates/email/client-welcome/sql/client.sql
+++ b/print/templates/email/client-welcome/sql/client.sql
@@ -7,5 +7,5 @@ SELECT
FROM client c
JOIN account.user u ON u.id = c.id
LEFT JOIN worker w ON w.id = c.salesPersonFk
- LEFT JOIN account.user wu ON wu.id = w.userFk
-WHERE c.id = ?
\ No newline at end of file
+ LEFT JOIN account.user wu ON wu.id = w.id
+WHERE c.id = ?
diff --git a/print/templates/email/printer-setup/sql/client.sql b/print/templates/email/printer-setup/sql/client.sql
index 2a8a751e0..31454408f 100644
--- a/print/templates/email/printer-setup/sql/client.sql
+++ b/print/templates/email/printer-setup/sql/client.sql
@@ -8,5 +8,5 @@ SELECT
FROM client c
JOIN account.user u ON u.id = c.id
LEFT JOIN worker w ON w.id = c.salesPersonFk
- LEFT JOIN account.user wu ON wu.id = w.userFk
-WHERE c.id = ?
\ No newline at end of file
+ LEFT JOIN account.user wu ON wu.id = w.id
+WHERE c.id = ?
diff --git a/print/templates/reports/driver-route/sql/routes.sql b/print/templates/reports/driver-route/sql/routes.sql
index 4b6f6a318..79bede5b2 100644
--- a/print/templates/reports/driver-route/sql/routes.sql
+++ b/print/templates/reports/driver-route/sql/routes.sql
@@ -1,4 +1,4 @@
-SELECT
+SELECT
r.id,
r.m3,
r.created,
@@ -11,9 +11,9 @@ SELECT
FROM route r
LEFT JOIN vehicle v ON v.id = r.vehicleFk
LEFT JOIN worker w ON w.id = r.workerFk
- LEFT JOIN account.user u ON u.id = w.userFk
+ LEFT JOIN account.user u ON u.id = w.id
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
LEFT JOIN agency a ON a.id = am.agencyFk
LEFT JOIN supplierAgencyTerm sa ON sa.agencyFk = a.id
LEFT JOIN supplier s ON s.id = sa.supplierFk
-WHERE r.id IN(?)
\ No newline at end of file
+WHERE r.id IN(?)
From 91c6ab9e440be19346a24d10eba3b507cefcb9be Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 22 Aug 2023 12:50:27 +0200
Subject: [PATCH 038/427] refs #5843 edit structure
---
db/changes/233601/00-dropUserFk.sql | 5 ++
db/dump/fixtures.sql | 16 ++---
db/dump/structure.sql | 105 +++++++++++++---------------
3 files changed, 60 insertions(+), 66 deletions(-)
create mode 100644 db/changes/233601/00-dropUserFk.sql
diff --git a/db/changes/233601/00-dropUserFk.sql b/db/changes/233601/00-dropUserFk.sql
new file mode 100644
index 000000000..ad4db3110
--- /dev/null
+++ b/db/changes/233601/00-dropUserFk.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `vn`.`workerDocument` DROP FOREIGN KEY `workerDocument_ibfk_1`;
+
+ALTER TABLE `vn`.`worker` DROP KEY `user_id_UNIQUE`;
+
+ALTER TABLE `vn`.`worker` DROP COLUMN `userFk`;
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index b01c07461..e6e10b8ff 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -87,8 +87,8 @@ INSERT INTO `vn`.`educationLevel` (`id`, `name`)
(1, 'ESTUDIOS PRIMARIOS COMPLETOS'),
(2, 'ENSEÑANZAS DE BACHILLERATO');
-INSERT INTO `vn`.`worker`(`id`,`code`, `firstName`, `lastName`, `userFk`, `bossFk`)
- SELECT id,UPPER(LPAD(role, 3, '0')), name, name, id, 9
+INSERT INTO `vn`.`worker`(`id`,`code`, `firstName`, `lastName`, `bossFk`)
+ SELECT id,UPPER(LPAD(role, 3, '0')), name, name, 9
FROM `account`.`user`;
UPDATE `vn`.`worker` SET bossFk = NULL WHERE id = 20;
@@ -188,13 +188,13 @@ INSERT INTO `vn`.`printer` (`id`, `name`, `path`, `isLabeler`, `sectorFk`, `ipAd
UPDATE `vn`.`sector` SET mainPrinterFk = 1 WHERE id = 1;
-INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`)
+INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`,`bossFk`, `phone`)
VALUES
- (1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106),
- (1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107),
- (1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108),
- (1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109),
- (1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110);
+ (1106, 'LGN', 'David Charles', 'Haller', 19, 432978106),
+ (1107, 'ANT', 'Hank' , 'Pym' , 19, 432978107),
+ (1108, 'DCX', 'Charles' , 'Xavier', 19, 432978108),
+ (1109, 'HLK', 'Bruce' , 'Banner', 19, 432978109),
+ (1110, 'JJJ', 'Jessica' , 'Jones' , 19, 432978110);
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`)
VALUES
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index 4e7127310..2d66d456c 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -24465,7 +24465,7 @@ BEGIN
CONCAT('Cliente ', NEW.id),
CONCAT('Recibida la documentación: ', vText)
FROM worker w
- LEFT JOIN account.user u ON w.userFk = u.id AND u.active
+ LEFT JOIN account.user u ON w.id = u.id AND u.active
LEFT JOIN account.account ac ON ac.id = u.id
WHERE w.id = NEW.salesPersonFk;
END IF;
@@ -45621,7 +45621,7 @@ BEGIN
SELECT code INTO vUserCode
FROM worker
- WHERE userFk = account.myUser_getId();
+ WHERE id = account.myUser_getId();
RETURN vUserCode;
END ;;
@@ -48037,22 +48037,22 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` FUNCTION `workerIsBoss`(vUserId INT) RETURNS int(11)
+CREATE DEFINER=`root`@`localhost` FUNCTION `workerIsBoss`(vSelf INT) RETURNS int(11)
DETERMINISTIC
BEGIN
/**
* Comprueba por jerarquía si el trabajador actual es jefe
* de un trabajador en concreto.
*
- * @param vUserId Id del trabajador que se desea comprobar.
+ * @param vSelf Id del trabajador que se desea comprobar.
* @return Revuelve verdadero si es jefe del empleado por escala jerárquica.
*/
DECLARE vWorkerId INT;
DECLARE vBossId INT;
SELECT id INTO vWorkerId
- FROM vn.worker
- WHERE userFk = vUserId;
+ FROM worker
+ WHERE id = vSelf;
IF vWorkerId IS NULL THEN
CALL util.throw('USER_NOT_FOUND');
END IF;
@@ -48064,7 +48064,7 @@ BEGIN
SELECT id workerFk FROM worker LIMIT 0;
LOOP
SELECT bossFk INTO vBossId
- FROM vn.worker
+ FROM worker
WHERE id = vWorkerId;
IF (SELECT COUNT(*) FROM tCheckedWorker WHERE workerFk = vBossId) THEN
CALL util.throw('INFINITE_LOOP');
@@ -64369,7 +64369,7 @@ proc: BEGIN
SELECT isTodayRelative INTO vIsTodayRelative
FROM worker
- WHERE userFk = getUser();
+ WHERE id = getUser();
CALL prepareTicketList( util.VN_CURDATE() - INTERVAL 1 DAY, vEndingDate);
@@ -70656,7 +70656,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_cloneWeekly`(IN vWeek INT)
+CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_cloneWeekly`(vWeek INT)
BEGIN
DECLARE vIsDone BOOL;
DECLARE vLanding DATE;
@@ -70742,8 +70742,7 @@ BEGIN
SELECT e.email INTO vSalesPersonEmail
FROM vn.client c
- JOIN vn.worker sp ON sp.id = c.salesPersonFk
- JOIN account.emailUser e ON e.userFk = sp.userFk
+ JOIN account.emailUser e ON e.userFk = c.salesPersonFk
WHERE c.id = vClientFk;
SET vSubject = CONCAT('Turnos - No se ha podido clonar correctamente el ticket ', vTicketFk,
@@ -72839,7 +72838,7 @@ BEGIN
isAllowedToWork
FROM(SELECT t.dated,
b.id businessFk,
- w.userFk,
+ w.id,
b.departmentFk,
IF(bs.started = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(bs.started,5) ORDER BY bs.started ASC SEPARATOR ' - ')) hourStart ,
IF(bs.started = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(bs.ended,5) ORDER BY bs.ended ASC SEPARATOR ' - ')) hourEnd,
@@ -72849,18 +72848,19 @@ BEGIN
at2.permissionRate,
at2.discountRate,
ct.hoursWeek hoursWeek,
- at2.isAllowedToWork
+ at2.isAllowedToWork,
+ u.userFk
FROM time t
LEFT JOIN business b ON t.dated BETWEEN b.started AND IFNULL(b.ended, vDatedTo)
LEFT JOIN worker w ON w.id = b.workerFk
- JOIN tmp.`user` u ON u.userFK = w.userFK
+ JOIN tmp.`user` u ON u.userFK = w.id
LEFT JOIN workCenter wc ON wc.id = b.workcenterFK
LEFT JOIN calendarType ct ON ct.id = b.calendarTypeFk
LEFT JOIN businessSchedule bs ON bs.businessFk = b.id AND bs.weekday = WEEKDAY(t.dated) + 1
LEFT JOIN calendar c ON c.businessFk = b.id AND c.dated = t.dated
LEFT JOIN absenceType at2 ON at2.id = c.dayOffTypeFk
WHERE t.dated BETWEEN vDatedFrom AND vDatedTo
- GROUP BY w.userFk, t.dated
+ GROUP BY w.id, t.dated
)sub;
UPDATE tmp.timeBusinessCalculate t
@@ -72913,13 +72913,9 @@ BEGIN
* @param vDatedTo workerTimeControl
*/
- DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
-
- CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user`
- SELECT userFk
- FROM vn.worker w
- JOIN account.`user` u ON u.id = w.userFk
- WHERE userFk IS NOT NULL;
+ CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
+ SELECT w.id userFk
+ FROM vn.worker w;
CALL vn.timeBusiness_calculate(vDatedFrom, vDatedTo);
@@ -73023,15 +73019,12 @@ BEGIN
* @param vDatedTo workerTimeControl
*/
- DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
+ CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
+ SELECT w.id userFk
+ FROM worker w
+ WHERE w.id = vWorkerFk;
- CREATE TEMPORARY TABLE tmp.`user`
- SELECT u.id userFk
- FROM account.user u
- JOIN vn.worker w ON w.userFk = u.id
- WHERE w.id = vWorkerFk;
-
- CALL vn.timeBusiness_calculate(vDatedFrom, vDatedTo);
+ CALL timeBusiness_calculate(vDatedFrom, vDatedTo);
DROP TEMPORARY TABLE tmp.`user`;
@@ -73273,13 +73266,9 @@ BEGIN
* @param vDatedTo workerTimeControl
*/
- DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
-
- CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user`
- SELECT userFk
- FROM vn.worker w
- JOIN account.`user` u ON u.id = w.userFk
- WHERE userFk IS NOT NULL;
+ CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
+ SELECT w.id userFk
+ FROM vn.worker w;
CALL vn.timeControl_calculate(vDatedFrom, vDatedTo);
@@ -74723,8 +74712,8 @@ BEGIN
* Create new worker
*
*/
- INSERT INTO worker(id, code, firstName, lastName, userFk, bossFk, fi, birth)
- VALUES (vUserFk, vCode, vFirstname, vLastName, vUserFk, vBossFk, vFi, vBirth);
+ INSERT INTO worker(id, code, firstName, lastName, bossFk, fi, birth)
+ VALUES (vUserFk, vCode, vFirstname, vLastName, vBossFk, vFi, vBirth);
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -74765,8 +74754,8 @@ BEGIN
SET vSurnames = CONCAT(vSurname1, ' ', vSurname2);
END IF;
- INSERT INTO worker(id, firstName, lastName, code, userFk, isFreelance)
- SELECT vUserId, vFirstName, vSurnames, vWorkerCode, vUserId, true;
+ INSERT INTO worker(id, firstName, lastName, code, isFreelance)
+ SELECT vUserId, vFirstName, vSurnames, vWorkerCode, true;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -74789,7 +74778,7 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.workerDepartmentByDate;
CREATE TEMPORARY TABLE tmp.workerDepartmentByDate
ENGINE = MEMORY
- SELECT w.userFk,
+ SELECT w.id,
w.lastName name,
w.firstName firstname,
d.name department,
@@ -75490,7 +75479,7 @@ BEGIN
LIMIT 10000000000000000000)sub
GROUP BY cont
HAVING cont2 MOD 2 = 1
- )sub2
+ )sub2;
JOIN worker w ON w.userFk = sub2.userFk;
END ;;
DELIMITER ;
@@ -76550,10 +76539,10 @@ BEGIN
w.lastName,
w.firstname,
c.fi,
- w.id,
+ w.id userFk,
MONTHNAME(t.dated) mes,
YEAR(t.dated) año,
- w.userFk,
+ w.id,
tm.hoursWeek,
tm.type,
b.started,
@@ -78136,7 +78125,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`zone_getLeaves`(
vSearch VARCHAR(255),
vHasInsert BOOL
)
-BEGIN
+BEGIN
/**
* Devuelve las ubicaciones incluidas en la ruta y que sean hijos de parentFk.
* @param vSelf Id de la zona
@@ -78151,23 +78140,23 @@ BEGIN
CREATE OR REPLACE TEMPORARY TABLE tNodes
(UNIQUE (id))
ENGINE = MEMORY
- SELECT id
- FROM zoneGeo
+ SELECT id
+ FROM zoneGeo
LIMIT 0;
IF vIsSearch THEN
SET vIsNumber = vSearch REGEXP '^[0-9]+$';
-
+
INSERT INTO tNodes
- SELECT id
+ SELECT id
FROM zoneGeo
WHERE (vIsNumber AND `name` = vSearch)
OR (!vIsNumber AND `name` LIKE CONCAT('%', vSearch, '%'))
LIMIT 1000;
-
+
ELSEIF vParentFk IS NULL THEN
INSERT INTO tNodes
- SELECT geoFk
+ SELECT geoFk
FROM zoneIncluded
WHERE zoneFk = vSelf;
END IF;
@@ -78190,25 +78179,25 @@ BEGIN
FROM zoneGeo g
JOIN tChilds c ON c.id = g.id
WHERE g.parentFk IS NOT NULL;
-
+
INSERT IGNORE INTO tNodes
SELECT id FROM tParents;
-
+
IF NOT ROW_COUNT() THEN
LEAVE myLoop;
END IF;
-
+
DELETE FROM tChilds;
INSERT INTO tChilds
SELECT id FROM tParents;
END LOOP;
-
+
DROP TEMPORARY TABLE tChilds, tParents;
END IF;
IF NOT vIsSearch THEN
INSERT IGNORE INTO tNodes
- SELECT id
+ SELECT id
FROM zoneGeo
WHERE parentFk <=> vParentFk;
END IF;
@@ -81824,7 +81813,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb3_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `workerTimeControlUserInfo` AS select `u`.`id` AS `userFk`,`w`.`firstName` AS `name`,`w`.`lastName` AS `surname`,`u`.`name` AS `user`,`u`.`password` AS `password`,`wd`.`departmentFk` AS `departmentFk`,left(`c`.`fi`,8) AS `dni` from (((`account`.`user` `u` join `vn`.`worker` `w` on(`w`.`userFk` = `u`.`id`)) join `vn`.`client` `c` on(`c`.`id` = `u`.`id`)) left join `vn`.`workerDepartment` `wd` on(`wd`.`workerFk` = `w`.`id`)) */;
+/*!50001 VIEW `workerTimeControlUserInfo` AS select `u`.`id` AS `userFk`,`w`.`firstName` AS `name`,`w`.`lastName` AS `surname`,`u`.`name` AS `user`,`u`.`password` AS `password`,`wd`.`departmentFk` AS `departmentFk`,left(`c`.`fi`,8) AS `dni` from (((`account`.`user` `u` join `vn`.`worker` `w` on(`w`.`id` = `u`.`id`)) join `vn`.`client` `c` on(`c`.`id` = `u`.`id`)) left join `vn`.`workerDepartment` `wd` on(`wd`.`workerFk` = `w`.`id`)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
From 1f63648697d585ef03cc18ba77108c14f744ba57 Mon Sep 17 00:00:00 2001
From: vicent
Date: Thu, 24 Aug 2023 09:10:04 +0200
Subject: [PATCH 039/427] =?UTF-8?q?refs=20#5918=20fix:=20muestra=20los=20b?=
=?UTF-8?q?otones=20en=20una=20l=C3=ADnea=20y=20no=20carga=20todos=20los?=
=?UTF-8?q?=20datos=20de=20workerTimeControlMail=20de=20la=20semana?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/changes/233601/00-ACL_workerDepartment.sql | 3 +++
modules/worker/front/time-control/index.html | 12 +++++-------
modules/worker/front/time-control/index.js | 3 ++-
3 files changed, 10 insertions(+), 8 deletions(-)
create mode 100644 db/changes/233601/00-ACL_workerDepartment.sql
diff --git a/db/changes/233601/00-ACL_workerDepartment.sql b/db/changes/233601/00-ACL_workerDepartment.sql
new file mode 100644
index 000000000..ceb8d5d75
--- /dev/null
+++ b/db/changes/233601/00-ACL_workerDepartment.sql
@@ -0,0 +1,3 @@
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
+ VALUES
+ ('WorkerDepartment', '*', '*', 'ALLOW', 'ROLE', 'employee');
diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html
index 307d9a50f..847eb9505 100644
--- a/modules/worker/front/time-control/index.html
+++ b/modules/worker/front/time-control/index.html
@@ -79,32 +79,30 @@
-
+
-
-
+ ng-show="$ctrl.isHr && $ctrl.canResend">
diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js
index f63a766e8..91f095334 100644
--- a/modules/worker/front/time-control/index.js
+++ b/modules/worker/front/time-control/index.js
@@ -117,7 +117,8 @@ class Controller extends Section {
where: {
year: this._date.getFullYear(),
week: this.getWeekNumber(this._date)
- }
+ },
+ limit: 1
};
this.$http.get('WorkerTimeControlMails', {filter})
.then(res => {
From 3d4a99b07e0024d4161bbc91d65e5cd97c560973 Mon Sep 17 00:00:00 2001
From: jorgep
Date: Thu, 24 Aug 2023 10:51:34 +0200
Subject: [PATCH 040/427] refs 5914 transferInvoice created
---
loopback/locale/es.json | 346 ++----------------
.../methods/invoiceOut/makePdfAndNotify.js | 2 +-
...ansferInvoiceOut.js => transferInvoice.js} | 28 +-
.../front/descriptor-menu/index.html | 3 +-
.../invoiceOut/front/descriptor-menu/index.js | 6 +-
.../front/descriptor-menu/style.scss | 8 +-
modules/ticket/back/methods/sale/clone.js | 171 ++++++---
modules/ticket/back/methods/sale/refund.js | 18 +-
.../back/methods/ticket/invoiceTickets.js | 8 +-
.../methods/ticket/invoiceTicketsWithPdf.js | 0
print/templates/reports/invoice/invoice.js | 3 +
11 files changed, 178 insertions(+), 415 deletions(-)
rename modules/invoiceOut/back/methods/invoiceOut/{transferInvoiceOut.js => transferInvoice.js} (76%)
create mode 100644 modules/ticket/back/methods/ticket/invoiceTicketsWithPdf.js
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index d196f99fa..627ab9a46 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -1,324 +1,26 @@
{
- "Phone format is invalid": "El formato del teléfono no es correcto",
- "You are not allowed to change the credit": "No tienes privilegios para modificar el crédito",
- "Unable to mark the equivalence surcharge": "No se puede marcar el recargo de equivalencia",
- "The default consignee can not be unchecked": "No se puede desmarcar el consignatario predeterminado",
- "Unable to default a disabled consignee": "No se puede poner predeterminado un consignatario desactivado",
- "Can't be blank": "No puede estar en blanco",
- "Invalid TIN": "NIF/CIF invalido",
- "TIN must be unique": "El NIF/CIF debe ser único",
- "A client with that Web User name already exists": "Ya existe un cliente con ese Usuario Web",
- "Is invalid": "Is invalid",
- "Quantity cannot be zero": "La cantidad no puede ser cero",
- "Enter an integer different to zero": "Introduce un entero distinto de cero",
- "Package cannot be blank": "El embalaje no puede estar en blanco",
- "The company name must be unique": "La razón social debe ser única",
- "Invalid email": "Correo electrónico inválido",
- "The IBAN does not have the correct format": "El IBAN no tiene el formato correcto",
- "That payment method requires an IBAN": "El método de pago seleccionado requiere un IBAN",
- "That payment method requires a BIC": "El método de pago seleccionado requiere un BIC",
- "State cannot be blank": "El estado no puede estar en blanco",
- "Worker cannot be blank": "El trabajador no puede estar en blanco",
- "Cannot change the payment method if no salesperson": "No se puede cambiar la forma de pago si no hay comercial asignado",
- "can't be blank": "El campo no puede estar vacío",
- "Observation type must be unique": "El tipo de observación no puede repetirse",
+ "Name cannot be blank": "Name cannot be blank",
+ "Swift / BIC cannot be empty": "Swift / BIC cannot be empty",
+ "Social name should be uppercase": "Social name should be uppercase",
+ "Street cannot be empty": "Street cannot be empty",
+ "Street should be uppercase": "Street should be uppercase",
+ "City cannot be empty": "City cannot be empty",
+ "Invalid email": "Invalid email",
+ "Phone cannot be blank": "Phone cannot be blank",
"The credit must be an integer greater than or equal to zero": "The credit must be an integer greater than or equal to zero",
- "The grade must be similar to the last one": "El grade debe ser similar al último",
- "Only manager can change the credit": "Solo el gerente puede cambiar el credito de este cliente",
- "Name cannot be blank": "El nombre no puede estar en blanco",
- "Phone cannot be blank": "El teléfono no puede estar en blanco",
- "Period cannot be blank": "El periodo no puede estar en blanco",
- "Choose a company": "Selecciona una empresa",
- "Se debe rellenar el campo de texto": "Se debe rellenar el campo de texto",
- "Description should have maximum of 45 characters": "La descripción debe tener maximo 45 caracteres",
- "Cannot be blank": "El campo no puede estar en blanco",
- "The grade must be an integer greater than or equal to zero": "El grade debe ser un entero mayor o igual a cero",
- "Sample type cannot be blank": "El tipo de plantilla no puede quedar en blanco",
- "Description cannot be blank": "Se debe rellenar el campo de texto",
- "The new quantity should be smaller than the old one": "La nueva cantidad debe de ser menor que la anterior",
- "The value should not be greater than 100%": "El valor no debe de ser mayor de 100%",
- "The value should be a number": "El valor debe ser un numero",
- "This order is not editable": "Esta orden no se puede modificar",
- "You can't create an order for a frozen client": "No puedes crear una orden para un cliente congelado",
- "You can't create an order for a client that has a debt": "No puedes crear una orden para un cliente con deuda",
- "is not a valid date": "No es una fecha valida",
- "Barcode must be unique": "El código de barras debe ser único",
- "The warehouse can't be repeated": "El almacén no puede repetirse",
- "The tag or priority can't be repeated for an item": "El tag o prioridad no puede repetirse para un item",
- "The observation type can't be repeated": "El tipo de observación no puede repetirse",
- "A claim with that sale already exists": "Ya existe una reclamación para esta línea",
- "You don't have enough privileges to change that field": "No tienes permisos para cambiar ese campo",
- "Warehouse cannot be blank": "El almacén no puede quedar en blanco",
- "Agency cannot be blank": "La agencia no puede quedar en blanco",
- "Not enough privileges to edit a client with verified data": "No tienes permisos para hacer cambios en un cliente con datos comprobados",
- "This address doesn't exist": "Este consignatario no existe",
- "You must delete the claim id %d first": "Antes debes borrar la reclamación %d",
- "You don't have enough privileges": "No tienes suficientes permisos",
- "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF",
- "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos",
- "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ",
- "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado",
- "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo",
- "Tag value cannot be blank": "El valor del tag no puede quedar en blanco",
- "ORDER_EMPTY": "Cesta vacía",
- "You don't have enough privileges to do that": "No tienes permisos para cambiar esto",
- "NO SE PUEDE DESACTIVAR EL CONSIGNAT": "NO SE PUEDE DESACTIVAR EL CONSIGNAT",
- "Error. El NIF/CIF está repetido": "Error. El NIF/CIF está repetido",
- "Street cannot be empty": "Dirección no puede estar en blanco",
- "City cannot be empty": "Cuidad no puede estar en blanco",
- "Code cannot be blank": "Código no puede estar en blanco",
- "You cannot remove this department": "No puedes eliminar este departamento",
- "The extension must be unique": "La extensión debe ser unica",
- "The secret can't be blank": "La contraseña no puede estar en blanco",
- "We weren't able to send this SMS": "No hemos podido enviar el SMS",
- "This client can't be invoiced": "Este cliente no puede ser facturado",
- "This ticket can't be invoiced": "Este ticket no puede ser facturado",
- "You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
- "This ticket can not be modified": "Este ticket no puede ser modificado",
- "The introduced hour already exists": "Esta hora ya ha sido introducida",
- "INFINITE_LOOP": "Existe una dependencia entre dos Jefes",
- "The sales of the receiver ticket can't be modified": "Las lineas del ticket al que envias no pueden ser modificadas",
- "NO_AGENCY_AVAILABLE": "No hay una zona de reparto disponible con estos parámetros",
- "ERROR_PAST_SHIPMENT": "No puedes seleccionar una fecha de envío en pasado",
- "The current ticket can't be modified": "El ticket actual no puede ser modificado",
- "The current claim can't be modified": "La reclamación actual no puede ser modificada",
- "The sales of this ticket can't be modified": "Las lineas de este ticket no pueden ser modificadas",
- "The sales do not exists": "La(s) línea(s) seleccionada(s) no existe(n)",
- "Please select at least one sale": "Por favor selecciona al menos una linea",
- "All sales must belong to the same ticket": "Todas las lineas deben pertenecer al mismo ticket",
- "NO_ZONE_FOR_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
- "This item doesn't exists": "El artículo no existe",
- "NOT_ZONE_WITH_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
- "Extension format is invalid": "El formato de la extensión es inválido",
- "Invalid parameters to create a new ticket": "Parámetros inválidos para crear un nuevo ticket",
- "This item is not available": "Este artículo no está disponible",
- "This postcode already exists": "Este código postal ya existe",
- "Concept cannot be blank": "El concepto no puede quedar en blanco",
- "File doesn't exists": "El archivo no existe",
- "You don't have privileges to change the zone": "No tienes permisos para cambiar la zona o para esos parámetros hay más de una opción de envío, hable con las agencias",
- "This ticket is already on weekly tickets": "Este ticket ya está en tickets programados",
- "Ticket id cannot be blank": "El id de ticket no puede quedar en blanco",
- "Weekday cannot be blank": "El día de la semana no puede quedar en blanco",
- "You can't delete a confirmed order": "No puedes borrar un pedido confirmado",
- "The social name has an invalid format": "El nombre fiscal tiene un formato incorrecto",
- "Invalid quantity": "Cantidad invalida",
- "This postal code is not valid": "This postal code is not valid",
- "is invalid": "is invalid",
- "The postcode doesn't exist. Please enter a correct one": "El código postal no existe. Por favor, introduce uno correcto",
- "The department name can't be repeated": "El nombre del departamento no puede repetirse",
- "This phone already exists": "Este teléfono ya existe",
- "You cannot move a parent to its own sons": "No puedes mover un elemento padre a uno de sus hijos",
- "You can't create a claim for a removed ticket": "No puedes crear una reclamación para un ticket eliminado",
- "You cannot delete a ticket that part of it is being prepared": "No puedes eliminar un ticket en el que una parte que está siendo preparada",
- "You must delete all the buy requests first": "Debes eliminar todas las peticiones de compra primero",
- "You should specify a date": "Debes especificar una fecha",
- "You should specify at least a start or end date": "Debes especificar al menos una fecha de inicio o de fín",
- "Start date should be lower than end date": "La fecha de inicio debe ser menor que la fecha de fín",
- "You should mark at least one week day": "Debes marcar al menos un día de la semana",
- "Swift / BIC can't be empty": "Swift / BIC no puede estar vacío",
- "Customs agent is required for a non UEE member": "El agente de aduanas es requerido para los clientes extracomunitarios",
- "Incoterms is required for a non UEE member": "El incoterms es requerido para los clientes extracomunitarios",
- "Deleted sales from ticket": "He eliminado las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}",
- "Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
- "Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}})",
- "Changed sale quantity": "He cambiado la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}* del ticket [{{ticketId}}]({{{ticketUrl}}})",
- "State": "Estado",
- "regular": "normal",
- "reserved": "reservado",
- "Changed sale reserved state": "He cambiado el estado reservado de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "Bought units from buy request": "Se ha comprado {{quantity}} unidades de [{{itemId}} {{concept}}]({{{urlItem}}}) para el ticket id [{{ticketId}}]({{{url}}})",
- "Deny buy request": "Se ha rechazado la petición de compra para el ticket id [{{ticketId}}]({{{url}}}). Motivo: {{observation}}",
- "MESSAGE_INSURANCE_CHANGE": "He cambiado el crédito asegurado del cliente [{{clientName}} ({{clientId}})]({{{url}}}) a *{{credit}} €*",
- "Changed client paymethod": "He cambiado la forma de pago del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
- "Sent units from ticket": "Envio *{{quantity}}* unidades de [{{concept}} ({{itemId}})]({{{itemUrl}}}) a *\"{{nickname}}\"* provenientes del ticket id [{{ticketId}}]({{{ticketUrl}}})",
- "Change quantity": "{{concept}} cambia de {{oldQuantity}} a {{newQuantity}}",
- "Claim will be picked": "Se recogerá el género de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}*",
- "Claim state has changed to incomplete": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *incompleta*",
- "Claim state has changed to canceled": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *anulado*",
- "Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}",
- "ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto",
- "Distance must be lesser than 1000": "La distancia debe ser inferior a 1000",
- "This ticket is deleted": "Este ticket está eliminado",
- "Unable to clone this travel": "No ha sido posible clonar este travel",
- "This thermograph id already exists": "La id del termógrafo ya existe",
- "Choose a date range or days forward": "Selecciona un rango de fechas o días en adelante",
- "ORDER_ALREADY_CONFIRMED": "ORDER_ALREADY_CONFIRMED",
- "Invalid password": "Invalid password",
- "Password does not meet requirements": "La contraseña no cumple los requisitos",
- "Role already assigned": "Role already assigned",
- "Invalid role name": "Invalid role name",
- "Role name must be written in camelCase": "Role name must be written in camelCase",
- "Email already exists": "Email already exists",
- "User already exists": "User already exists",
- "Absence change notification on the labour calendar": "Notificacion de cambio de ausencia en el calendario laboral",
- "Record of hours week": "Registro de horas semana {{week}} año {{year}} ",
- "Created absence": "El empleado {{author}} ha añadido una ausencia de tipo '{{absenceType}}' a {{employee}} para el día {{dated}}.",
- "Deleted absence": "El empleado {{author}} ha eliminado una ausencia de tipo '{{absenceType}}' a {{employee}} del día {{dated}}.",
- "I have deleted the ticket id": "He eliminado el ticket id [{{id}}]({{{url}}})",
- "I have restored the ticket id": "He restaurado el ticket id [{{id}}]({{{url}}})",
- "You can only restore a ticket within the first hour after deletion": "Únicamente puedes restaurar el ticket dentro de la primera hora después de su eliminación",
- "Changed this data from the ticket": "He cambiado estos datos del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "agencyModeFk": "Agencia",
- "clientFk": "Cliente",
- "zoneFk": "Zona",
- "warehouseFk": "Almacén",
- "shipped": "F. envío",
- "landed": "F. entrega",
- "addressFk": "Consignatario",
- "companyFk": "Empresa",
- "The social name cannot be empty": "La razón social no puede quedar en blanco",
- "The nif cannot be empty": "El NIF no puede quedar en blanco",
- "You need to fill sage information before you check verified data": "Debes rellenar la información de sage antes de marcar datos comprobados",
- "ASSIGN_ZONE_FIRST": "Asigna una zona primero",
- "Amount cannot be zero": "El importe no puede ser cero",
- "Company has to be official": "Empresa inválida",
- "You can not select this payment method without a registered bankery account": "No se puede utilizar este método de pago si no has registrado una cuenta bancaria",
- "Action not allowed on the test environment": "Esta acción no está permitida en el entorno de pruebas",
- "The selected ticket is not suitable for this route": "El ticket seleccionado no es apto para esta ruta",
- "New ticket request has been created with price": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}* y un precio de *{{price}} €*",
- "New ticket request has been created": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}*",
- "Swift / BIC cannot be empty": "Swift / BIC no puede estar vacío",
- "This BIC already exist.": "Este BIC ya existe.",
- "That item doesn't exists": "Ese artículo no existe",
- "There's a new urgent ticket:": "Hay un nuevo ticket urgente:",
- "Invalid account": "Cuenta inválida",
- "Compensation account is empty": "La cuenta para compensar está vacia",
- "This genus already exist": "Este genus ya existe",
- "This specie already exist": "Esta especie ya existe",
- "Client assignment has changed": "He cambiado el comercial ~*\"<{{previousWorkerName}}>\"*~ por *\"<{{currentWorkerName}}>\"* del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
- "None": "Ninguno",
- "The contract was not active during the selected date": "El contrato no estaba activo durante la fecha seleccionada",
- "Cannot add more than one '1/2 day vacation'": "No puedes añadir más de un 'Vacaciones 1/2 dia'",
- "This document already exists on this ticket": "Este documento ya existe en el ticket",
- "Some of the selected tickets are not billable": "Algunos de los tickets seleccionados no son facturables",
- "You can't invoice tickets from multiple clients": "No puedes facturar tickets de multiples clientes",
- "nickname": "nickname",
- "INACTIVE_PROVIDER": "Proveedor inactivo",
- "This client is not invoiceable": "Este cliente no es facturable",
- "serial non editable": "Esta serie no permite asignar la referencia",
- "Max shipped required": "La fecha límite es requerida",
- "Can't invoice to future": "No se puede facturar a futuro",
- "Can't invoice to past": "No se puede facturar a pasado",
- "This ticket is already invoiced": "Este ticket ya está facturado",
- "A ticket with an amount of zero can't be invoiced": "No se puede facturar un ticket con importe cero",
- "A ticket with a negative base can't be invoiced": "No se puede facturar un ticket con una base negativa",
- "Global invoicing failed": "[Facturación global] No se han podido facturar algunos clientes",
- "Wasn't able to invoice the following clients": "No se han podido facturar los siguientes clientes",
- "Can't verify data unless the client has a business type": "No se puede verificar datos de un cliente que no tiene tipo de negocio",
- "You don't have enough privileges to set this credit amount": "No tienes suficientes privilegios para establecer esta cantidad de crédito",
- "You can't change the credit set to zero from a financialBoss": "No puedes cambiar el cŕedito establecido a cero por un jefe de finanzas",
- "Amounts do not match": "Las cantidades no coinciden",
- "The PDF document does not exist": "El documento PDF no existe. Prueba a regenerarlo desde la opción 'Regenerar PDF factura'",
- "The type of business must be filled in basic data": "El tipo de negocio debe estar rellenado en datos básicos",
- "You can't create a claim from a ticket delivered more than seven days ago": "No puedes crear una reclamación de un ticket entregado hace más de siete días",
- "The worker has hours recorded that day": "El trabajador tiene horas fichadas ese día",
- "The worker has a marked absence that day": "El trabajador tiene marcada una ausencia ese día",
- "You can not modify is pay method checked": "No se puede modificar el campo método de pago validado",
- "Can't transfer claimed sales": "No puedes transferir lineas reclamadas",
- "You don't have privileges to create refund": "No tienes permisos para crear un abono",
- "The item is required": "El artículo es requerido",
- "The agency is already assigned to another autonomous": "La agencia ya está asignada a otro autónomo",
- "date in the future": "Fecha en el futuro",
- "reference duplicated": "Referencia duplicada",
- "This ticket is already a refund": "Este ticket ya es un abono",
- "isWithoutNegatives": "isWithoutNegatives",
- "routeFk": "routeFk",
- "Can't change the password of another worker": "No se puede cambiar la contraseña de otro trabajador",
- "No hay un contrato en vigor": "No hay un contrato en vigor",
- "No se permite fichar a futuro": "No se permite fichar a futuro",
- "No está permitido trabajar": "No está permitido trabajar",
- "Fichadas impares": "Fichadas impares",
- "Descanso diario 12h.": "Descanso diario 12h.",
- "Descanso semanal 36h. / 72h.": "Descanso semanal 36h. / 72h.",
- "Dirección incorrecta": "Dirección incorrecta",
- "Modifiable user details only by an administrator": "Detalles de usuario modificables solo por un administrador",
- "Modifiable password only via recovery or by an administrator": "Contraseña modificable solo a través de la recuperación o por un administrador",
- "Not enough privileges to edit a client": "No tienes suficientes privilegios para editar un cliente",
- "This route does not exists": "Esta ruta no existe",
- "Claim pickup order sent": "Reclamación Orden de recogida enviada [{{claimId}}]({{{claimUrl}}}) al cliente *{{clientName}}*",
- "You don't have grant privilege": "No tienes privilegios para dar privilegios",
- "You don't own the role and you can't assign it to another user": "No eres el propietario del rol y no puedes asignarlo a otro usuario",
- "Ticket merged": "Ticket [{{originId}}]({{{originFullPath}}}) ({{{originDated}}}) fusionado con [{{destinationId}}]({{{destinationFullPath}}}) ({{{destinationDated}}})",
- "Already has this status": "Ya tiene este estado",
- "There aren't records for this week": "No existen registros para esta semana",
- "Empty data source": "Origen de datos vacio",
- "App locked": "Aplicación bloqueada por el usuario {{userId}}",
- "Email verify": "Correo de verificación",
- "Landing cannot be lesser than shipment": "Landing cannot be lesser than shipment",
- "Receipt's bank was not found": "No se encontró el banco del recibo",
- "This receipt was not compensated": "Este recibo no ha sido compensado",
- "Client's email was not found": "No se encontró el email del cliente",
- "Negative basis": "Base negativa",
- "This worker code already exists": "Este codigo de trabajador ya existe",
- "This personal mail already exists": "Este correo personal ya existe",
- "This worker already exists": "Este trabajador ya existe",
- "App name does not exist": "El nombre de aplicación no es válido",
- "Try again": "Vuelve a intentarlo",
- "Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9",
- "Failed to upload delivery note": "Error al subir albarán {{id}}",
- "The DOCUWARE PDF document does not exists": "El documento PDF Docuware no existe",
- "It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar",
- "It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo",
- "It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas",
- "A supplier with the same name already exists. Change the country.": "Un proveedor con el mismo nombre ya existe. Cambie el país.",
- "There is no assigned email for this client": "No hay correo asignado para este cliente",
- "Exists an invoice with a future date": "Existe una factura con fecha posterior",
- "Invoice date can't be less than max date": "La fecha de factura no puede ser inferior a la fecha límite",
- "Warehouse inventory not set": "El almacén inventario no está establecido",
- "This locker has already been assigned": "Esta taquilla ya ha sido asignada",
- "Tickets with associated refunds": "No se pueden borrar tickets con abonos asociados. Este ticket está asociado al abono Nº %d",
- "Not exist this branch": "La rama no existe",
- "This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado",
- "Collection does not exist": "La colección no existe",
- "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo",
- "Insert a date range": "Inserte un rango de fechas",
- "Added observation": "{{user}} añadió esta observacion: {{text}}",
- "Comment added to client": "Observación añadida al cliente {{clientFk}}",
- "Invalid auth code": "Código de verificación incorrecto",
- "Invalid or expired verification code": "Código de verificación incorrecto o expirado",
- "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
- "company": "Compañía",
- "country": "País",
- "clientId": "Id cliente",
- "clientSocialName": "Cliente",
- "amount": "Importe",
- "taxableBase": "Base",
- "ticketFk": "Id ticket",
- "isActive": "Activo",
- "hasToInvoice": "Facturar",
- "isTaxDataChecked": "Datos comprobados",
- "comercialId": "Id comercial",
- "comercialName": "Comercial",
- "Pass expired": "La contraseña ha caducado, cambiela desde Salix",
- "Invalid NIF for VIES": "Invalid NIF for VIES",
- "Ticket does not exist": "Este ticket no existe",
- "Ticket is already signed": "Este ticket ya ha sido firmado",
- "Authentication failed": "Autenticación fallida",
- "You can't use the same password": "No puedes usar la misma contraseña",
- "You can only add negative amounts in refund tickets": "Solo se puede añadir cantidades negativas en tickets abono",
- "Fecha fuera de rango": "Fecha fuera de rango",
- "Error while generating PDF": "Error al generar PDF",
- "Error when sending mail to client": "Error al enviar el correo al cliente",
- "Mail not sent": "Se ha producido un fallo al enviar la factura al cliente [{{clientId}}]({{{clientUrl}}}), por favor revisa la dirección de correo electrónico",
- "The renew period has not been exceeded": "El periodo de renovación no ha sido superado",
- "Valid priorities": "Prioridades válidas: %d",
- "Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}",
- "You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado",
- "This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %s",
- "The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias",
- "You cannot assign/remove an alias that you are not assigned to": "No puede asignar/eliminar un alias que no tenga asignado",
- "This invoice has a linked vehicle.": "Esta factura tiene un vehiculo vinculado",
- "You don't have enough privileges.": "No tienes suficientes permisos.",
- "This ticket is locked.": "Este ticket está bloqueado.",
- "This ticket is not editable.": "Este ticket no es editable.",
- "The ticket doesn't exist.": "No existe el ticket.",
-<<<<<<< HEAD
- "There are missing fields.": "There are missing fields."
-}
-=======
- "Social name should be uppercase": "La razón social debe ir en mayúscula",
- "Street should be uppercase": "La dirección fiscal debe ir en mayúscula"
-}
->>>>>>> ce78fc8e5dd383b3c6457fe5f78a45b21b246858
+ "The grade must be an integer greater than or equal to zero": "The grade must be an integer greater than or equal to zero",
+ "Description should have maximum of 45 characters": "Description should have maximum of 45 characters",
+ "Amount cannot be zero": "Amount cannot be zero",
+ "Period cannot be blank": "Period cannot be blank",
+ "Sample type cannot be blank": "Sample type cannot be blank",
+ "Cannot be blank": "Cannot be blank",
+ "The social name cannot be empty": "The social name cannot be empty",
+ "Concept cannot be blank": "Concept cannot be blank",
+ "Enter an integer different to zero": "Enter an integer different to zero",
+ "Package cannot be blank": "Package cannot be blank",
+ "State cannot be blank": "State cannot be blank",
+ "Worker cannot be blank": "Worker cannot be blank",
+ "Description cannot be blank": "Description cannot be blank",
+ "Agency cannot be blank": "Agency cannot be blank",
+ "The renew period has not been exceeded": "The renew period has not been exceeded"
+}
\ No newline at end of file
diff --git a/modules/invoiceOut/back/methods/invoiceOut/makePdfAndNotify.js b/modules/invoiceOut/back/methods/invoiceOut/makePdfAndNotify.js
index a48664b30..e13ec0255 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/makePdfAndNotify.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/makePdfAndNotify.js
@@ -23,7 +23,7 @@ module.exports = Self => {
}
});
- Self.makePdfAndNotify = async function(ctx, id, printerFk) {
+ Self.makePdfAndNotify = async function(ctx, id, printerFk, options) {
const models = Self.app.models;
options = typeof options == 'object'
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
similarity index 76%
rename from modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
rename to modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
index 440ebe4d3..c590ff9ea 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoiceOut.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
@@ -1,6 +1,6 @@
module.exports = Self => {
- Self.remoteMethodCtx('transferInvoiceOut', {
- description: 'Transfer an invoice out to another client',
+ Self.remoteMethodCtx('transferInvoice', {
+ description: 'Transfer an issued invoice to another client',
accessType: 'WRITE',
accepts: [
{
@@ -49,7 +49,6 @@ module.exports = Self => {
const myOptions = {userId: ctx.req.accessToken.userId};
let tx;
-
if (typeof options == 'object')
Object.assign(myOptions, options);
@@ -59,15 +58,21 @@ module.exports = Self => {
}
try {
// Refund tickets and group
- const filter = {where: {refFk: ref}};
- const tickets = await models.Ticket.find(filter, myOptions);
+ const filterRef = {where: {refFk: ref}};
+ const tickets = await models.Ticket.find(filterRef, myOptions);
const ticketsIds = tickets.map(ticket => ticket.id);
await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
+
// Clone tickets
- const services = await models.TicketService.find(filter, myOptions);
+ const filterTicket = {where: {ticketFk: {inq: ticketsIds}}};
+
+ const services = await models.TicketService.find(filterTicket, myOptions);
const servicesIds = services.map(service => service.id);
- const sales = await models.Sale.find({where: {ticketFk: {inq: ticketsIds}}}, myOptions);
- const clonedTickets = await models.Sale.clone(sales, servicesIds, null, false, false, myOptions);
+
+ const sales = await models.Sale.find(filterTicket, myOptions);
+ const salesIds = sales.map(sale => sale.id);
+
+ const clonedTickets = await models.Sale.clone(salesIds, servicesIds, null, false, false, myOptions);
const clonedTicketIds = [];
// Update client
@@ -77,7 +82,8 @@ module.exports = Self => {
}
// Quick invoice
- const invoiceId = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
+ const invoiceIds = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
+ const [invoiceId] = invoiceIds;
// Insert InvoiceCorrection
await models.InvoiceCorrection.create({
@@ -89,6 +95,10 @@ module.exports = Self => {
}, myOptions);
if (tx) await tx.commit();
+
+ // Crear PDF
+ await models.InvoiceOut.makePdfAndNotify(ctx, invoiceId, null);
+
return invoiceId;
} catch (e) {
if (tx) await tx.rollback();
diff --git a/modules/invoiceOut/front/descriptor-menu/index.html b/modules/invoiceOut/front/descriptor-menu/index.html
index dc5c2a8e9..7d465f4ea 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.html
+++ b/modules/invoiceOut/front/descriptor-menu/index.html
@@ -184,9 +184,9 @@
+
+
diff --git a/modules/invoiceOut/front/descriptor-menu/index.js b/modules/invoiceOut/front/descriptor-menu/index.js
index ef69098c4..7d2644158 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.js
+++ b/modules/invoiceOut/front/descriptor-menu/index.js
@@ -136,9 +136,9 @@ class Controller extends Section {
invoiceCorrectionTypeId: this.invoiceCorrectionType
};
this.$http.post(`InvoiceOuts/transferInvoice`, params).then(res => {
- newInvoice = res.data;// id de la nueva factura
- this.vnApp.showSucces(this.$t('Invoice trasfered!'));
- this.$state.go('invoiceOut.index', {id: newInvoice});
+ const invoiceId = res.data;
+ this.vnApp.showSuccess(this.$t('Invoice trasfered!'));
+ this.$state.go('invoiceOut.card.summary', {id: invoiceId});
});
}
}
diff --git a/modules/invoiceOut/front/descriptor-menu/style.scss b/modules/invoiceOut/front/descriptor-menu/style.scss
index b68301961..25c02c80c 100644
--- a/modules/invoiceOut/front/descriptor-menu/style.scss
+++ b/modules/invoiceOut/front/descriptor-menu/style.scss
@@ -21,4 +21,10 @@ vn-invoice-out-descriptor-menu {
font-size: 1.75rem;
}
}
-}
\ No newline at end of file
+
+}
+@media screen and (min-width: 1000px) {
+ .transferInvoice {
+ min-width: 900px;
+ }
+}
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
index 7d52fd0e6..9a3b5fedc 100644
--- a/modules/ticket/back/methods/sale/clone.js
+++ b/modules/ticket/back/methods/sale/clone.js
@@ -1,5 +1,5 @@
module.exports = Self => {
- Self.clone = async(sales, servicesIds, withWarehouse, group, negative, options) => {
+ Self.clone = async(salesIds, servicesIds, withWarehouse, group, negative, options) => {
const models = Self.app.models;
const myOptions = {};
let tx;
@@ -12,91 +12,142 @@ module.exports = Self => {
myOptions.transaction = tx;
}
- const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
- const now = Date.vnNew();
- let updatedTickets = [];
- let newTicket;
- const filter = {
- include: [
- {relation: 'address'},
- {
- relation: 'sale',
- where: {saleFk: {inq: sales}},
- },
- ]
- };
try {
- for (const [index, ticketId] of ticketsIds.entries()) {
- const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
- if (!group || !index) {
- newTicket = await models.Ticket.create({
- clientFk: ticket.clientFk,
- shipped: now,
- addressFk: ticket.address().id,
- nickname: ticket.address().nickname,
- warehouseFk: withWarehouse ? ticket.warehouseFk : null,
- companyFk: ticket.companyFk,
- landed: now,
- }, myOptions);
- updatedTickets.push(newTicket);
- }
- const salesByTicket = ticket.sale();
- const saleIds = salesByTicket.map(sale => sale.id);
- const saleComponentsFilter = {
- where: {saleFk: {inq: saleIds}},
+ const salesFilter = {
+ where: {id: {inq: salesIds}},
+ include: {
+ relation: 'components',
scope: {
fields: ['saleFk', 'componentFk', 'value']
}
- };
- for (const sale of salesByTicket) {
- const createdSale = await models.Sale.create({
- ticketFk: newTicket.id,
- itemFk: sale.itemFk,
- quantity: (negative) ? - sale.quantity : sale.quantity,
- concept: sale.concept,
- price: sale.price,
- discount: sale.discount,
- }, myOptions);
- const components = await models.SaleComponent.find(saleComponentsFilter, myOptions); // Revisar con Alex
- // const components = sale.components();
- for (const component of components)
- component.saleFk = createdSale.id;
+ }
+ };
+ const sales = await models.Sale.find(salesFilter, myOptions);
+ const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
- await models.SaleComponent.create(components, myOptions);
+ const refundTickets = [];
+ const mappedTickets = new Map();
+ const now = Date.vnNew();
+
+ const [firstTicketId] = ticketsIds;
+ if (group) {
+ await createTicketRefund(
+ firstTicketId,
+ withWarehouse,
+ refundTickets,
+ mappedTickets,
+ now,
+ myOptions
+ );
+ } else {
+ for (let ticketId of ticketsIds) {
+ await createTicketRefund(
+ ticketId,
+ withWarehouse,
+ refundTickets,
+ mappedTickets,
+ now,
+ myOptions
+ );
}
}
+
+ for (const sale of sales) {
+ const refundTicketId = await getTicketRefundId(group, sale.ticketFk, refundTickets, mappedTickets);
+
+ const createdSale = await models.Sale.create({
+ ticketFk: refundTicketId,
+ itemFk: sale.itemFk,
+ quantity: negative ? - sale.quantity : sale.quantity,
+ concept: sale.concept,
+ price: sale.price,
+ discount: sale.discount,
+ }, myOptions);
+
+ const components = sale.components();
+ for (const component of components)
+ component.saleFk = createdSale.id;
+
+ await models.SaleComponent.create(components, myOptions);
+ }
+
if (servicesIds && servicesIds.length > 0) {
const servicesFilter = {
where: {id: {inq: servicesIds}}
};
const services = await models.TicketService.find(servicesFilter, myOptions);
+
for (const service of services) {
+ const refundTicketId = await getTicketRefundId(group, service.ticketFk, refundTickets, mappedTickets);
+
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: service.ticketFk,
+ ticketFk: refundTicketId,
ticketServiceTypeFk: service.ticketServiceTypeFk,
}, myOptions);
}
}
- const query = `CALL vn.ticket_recalc(?, NULL)`;
+ if (tx) await tx.commit();
- if (group) {
- await Self.rawSql(query, [newTicket.id], myOptions);
- if (tx) await tx.commit();
- return newTicket;
- } else {
- for (const updatedTicket of updatedTickets)
- await Self.rawSql(query, [updatedTicket.id], myOptions);
- if (tx) await tx.commit();
- return /* updatedTickets */updatedTickets;
- }
+ return refundTickets;
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
+
+ async function createTicketRefund(
+ ticketId,
+ withWarehouse,
+ refundTickets,
+ mappedTickets,
+ now,
+ myOptions
+ ) {
+ const models = Self.app.models;
+
+ const filter = {
+ include: [
+ {
+ relation: 'address'
+ },
+ {
+ relation: 'agencyMode'
+ },
+ {
+ relation: 'zone'
+ }
+ ]
+ };
+ const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
+ const refundTicket = await models.Ticket.create({
+ clientFk: ticket.clientFk,
+ shipped: now,
+ addressFk: ticket.address().id,
+ agencyModeFk: ticket.agencyMode().id,
+ nickname: ticket.address().nickname,
+ warehouseFk: withWarehouse ? ticket.warehouseFk : null,
+ companyFk: ticket.companyFk,
+ zonePrice: ticket.zonePrice,
+ zoneBonus: ticket.zoneBonus,
+ weight: ticket.weight,
+ landed: now,
+ zoneFk: ticket.zone().id,
+ }, myOptions);
+
+ refundTickets.push(refundTicket);
+
+ mappedTickets.set(ticketId, refundTicket.id);
+ }
+
+ async function getTicketRefundId(group, ticketId, refundTickets, mappedTickets) {
+ if (group) {
+ const [firstRefundTicket] = refundTickets;
+ return firstRefundTicket.id;
+ } else return mappedTickets.get(ticketId);
+ }
};
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index dabafb469..3f7e1cd21 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -64,27 +64,19 @@ module.exports = Self => {
}
}
};
- const sales = await models.Sale.find(salesFilter, myOptions);
+ // const sales = await models.Sale.find(salesFilter, myOptions);
const refundTicket = await models.Sale.clone(
- sales,
- refundAgencyMode,
- refoundZoneId,
+ salesIds,
servicesIds,
withWarehouse,
+ // refundAgencyMode,
+ // refoundZoneId,
true,
true,
myOptions
);
- const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
- for (const ticketId of ticketsIds) {
- await models.TicketRefund.create({
- refundTicketFk: refundTicket.id,
- originalTicketFk: ticketId,
- }, myOptions);
- }
-
- if (tx) await tx.commit();
+ if (tx && !options) await tx.commit();
return refundTicket;
} catch (e) {
diff --git a/modules/ticket/back/methods/ticket/invoiceTickets.js b/modules/ticket/back/methods/ticket/invoiceTickets.js
index 7baee133d..e65c14e9a 100644
--- a/modules/ticket/back/methods/ticket/invoiceTickets.js
+++ b/modules/ticket/back/methods/ticket/invoiceTickets.js
@@ -77,10 +77,9 @@ module.exports = function(Self) {
if (tx) await tx.rollback();
throw e;
}
- console.log(invoicesIds, 'invoicesIds');
- for (const invoiceId of invoicesIds) {
- console.log(await models.InvoiceOut.find());
- await models.InvoiceOut.makePdfAndNotify(ctx, invoiceId, null);
+ if (tx) {
+ for (const invoiceId of invoicesIds)
+ await models.InvoiceOut.makePdfAndNotify(ctx, invoiceId, null, myOptions);
}
return invoicesIds;
@@ -100,7 +99,6 @@ module.exports = function(Self) {
`, [ticketsIds], myOptions);
const invoiceId = await models.Ticket.makeInvoice(ctx, 'R', companyId, Date.vnNew(), myOptions);
- console.log(await models.InvoiceOut.find(null, myOptions));
invoicesIds.push(invoiceId);
}
};
diff --git a/modules/ticket/back/methods/ticket/invoiceTicketsWithPdf.js b/modules/ticket/back/methods/ticket/invoiceTicketsWithPdf.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/print/templates/reports/invoice/invoice.js b/print/templates/reports/invoice/invoice.js
index 1c9965d3b..4424c8ea3 100755
--- a/print/templates/reports/invoice/invoice.js
+++ b/print/templates/reports/invoice/invoice.js
@@ -6,7 +6,10 @@ module.exports = {
name: 'invoice',
mixins: [vnReport],
async serverPrefetch() {
+ console.log(this.reference);
this.invoice = await this.findOneFromDef('invoice', [this.reference]);
+ console.log(this.invoice);
+
this.checkMainEntity(this.invoice);
this.client = await this.findOneFromDef('client', [this.reference]);
this.taxes = await this.rawSqlFromDef(`taxes`, [this.reference]);
From f3e43686a3db0f7a1e43434fd8e3396f5436b657 Mon Sep 17 00:00:00 2001
From: vicent
Date: Thu, 24 Aug 2023 14:59:28 +0200
Subject: [PATCH 041/427] refs #5811 feat: al borrar expedicion borrar tmb de
viaexpress
---
.../viaexpress-config/deleteShipment.ejs | 11 +++++
.../viaexpress-config/deleteShipment.js | 45 +++++++++++++++++++
.../deleteShipmentRenderer.js | 44 ++++++++++++++++++
modules/ticket/back/models/expedition.json | 3 ++
4 files changed, 103 insertions(+)
create mode 100644 back/methods/viaexpress-config/deleteShipment.ejs
create mode 100644 back/methods/viaexpress-config/deleteShipment.js
create mode 100644 back/methods/viaexpress-config/deleteShipmentRenderer.js
diff --git a/back/methods/viaexpress-config/deleteShipment.ejs b/back/methods/viaexpress-config/deleteShipment.ejs
new file mode 100644
index 000000000..3be459a8d
--- /dev/null
+++ b/back/methods/viaexpress-config/deleteShipment.ejs
@@ -0,0 +1,11 @@
+
+
+
+
+ <%= viaexpressConfig.client %>
+ <%= viaexpressConfig.user %>
+ <%= viaexpressConfig.password %>
+ <%= externalId %>
+
+
+
diff --git a/back/methods/viaexpress-config/deleteShipment.js b/back/methods/viaexpress-config/deleteShipment.js
new file mode 100644
index 000000000..40509899b
--- /dev/null
+++ b/back/methods/viaexpress-config/deleteShipment.js
@@ -0,0 +1,45 @@
+const axios = require('axios');
+const {DOMParser} = require('xmldom');
+
+module.exports = Self => {
+ Self.remoteMethod('deleteShipment', {
+ description: 'Create an expedition and return a label',
+ accessType: 'WRITE',
+ accepts: [{
+ arg: 'expeditionFk',
+ type: 'number',
+ required: true
+ }],
+ returns: {
+ type: ['object'],
+ root: true
+ },
+ http: {
+ path: `/deleteShipment`,
+ verb: 'POST'
+ }
+ });
+
+ Self.deleteShipment = async expeditionFk => {
+ const models = Self.app.models;
+
+ const viaexpressConfig = await models.ViaexpressConfig.findOne({
+ fields: ['url']
+ });
+
+ const renderedXml = await models.ViaexpressConfig.deleteShipmentRenderer(expeditionFk);
+ const response = await axios.post(`${viaexpressConfig.url}ServicioVxClientes.asmx`, renderedXml, {
+ headers: {
+ 'Content-Type': 'application/soap+xml; charset=utf-8'
+ }
+ });
+
+ const xmlString = response.data;
+ const parser = new DOMParser();
+ const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
+ const resultElement = xmlDoc.getElementsByTagName('DeleteEnvioResult')[0];
+ const result = resultElement.textContent;
+
+ return result;
+ };
+};
diff --git a/back/methods/viaexpress-config/deleteShipmentRenderer.js b/back/methods/viaexpress-config/deleteShipmentRenderer.js
new file mode 100644
index 000000000..d9106a9ec
--- /dev/null
+++ b/back/methods/viaexpress-config/deleteShipmentRenderer.js
@@ -0,0 +1,44 @@
+const fs = require('fs');
+const ejs = require('ejs');
+
+module.exports = Self => {
+ Self.remoteMethod('deleteShipmentRenderer', {
+ description: 'Renders the data from an XML',
+ accessType: 'READ',
+ accepts: [{
+ arg: 'expeditionFk',
+ type: 'number',
+ required: true
+ }],
+ returns: {
+ type: ['object'],
+ root: true
+ },
+ http: {
+ path: `/deleteShipmentRenderer`,
+ verb: 'GET'
+ }
+ });
+
+ Self.deleteShipmentRenderer = async expeditionFk => {
+ const models = Self.app.models;
+
+ const viaexpressConfig = await models.ViaexpressConfig.findOne({
+ fields: ['client', 'user', 'password']
+ });
+
+ const expedition = await models.Expedition.findOne({
+ fields: ['id', 'externalId'],
+ where: {id: expeditionFk}
+ });
+
+ const data = {
+ viaexpressConfig,
+ externalId: expedition.externalId
+ };
+
+ const template = fs.readFileSync(__dirname + '/deleteShipment.ejs', 'utf-8');
+ const renderedXml = ejs.render(template, data);
+ return renderedXml;
+ };
+};
diff --git a/modules/ticket/back/models/expedition.json b/modules/ticket/back/models/expedition.json
index e32a3b23d..1ad083ce3 100644
--- a/modules/ticket/back/models/expedition.json
+++ b/modules/ticket/back/models/expedition.json
@@ -20,6 +20,9 @@
},
"counter": {
"type": "number"
+ },
+ "externalId": {
+ "type": "string"
}
},
"relations": {
From 4ae06d4b6b22a846bf5ad422898c0fb29d0a6bc4 Mon Sep 17 00:00:00 2001
From: pablone
Date: Fri, 25 Aug 2023 07:36:52 +0200
Subject: [PATCH 042/427] refs #6159 fixBusinessAfterInsert
---
.../233601/00-updateAfterBusinnesInsert.sql | 42 +++++++++++++++++++
db/dump/fixtures.sql | 5 +++
2 files changed, 47 insertions(+)
create mode 100644 db/changes/233601/00-updateAfterBusinnesInsert.sql
diff --git a/db/changes/233601/00-updateAfterBusinnesInsert.sql b/db/changes/233601/00-updateAfterBusinnesInsert.sql
new file mode 100644
index 000000000..f2b5dc753
--- /dev/null
+++ b/db/changes/233601/00-updateAfterBusinnesInsert.sql
@@ -0,0 +1,42 @@
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`business_afterInsert`
+ AFTER INSERT ON `business`
+ FOR EACH ROW
+BEGIN
+ CALL worker_updateBusiness(NEW.workerFk);
+
+ IF (
+ SELECT NOT active
+ FROM account.user
+ WHERE id = NEW.workerFk
+ ) THEN
+ UPDATE account.user
+ SET active = TRUE
+ WHERE id = NEW.workerFk;
+ END IF;
+
+ IF (
+ SELECT NOT COUNT(aa.id)
+ FROM account.mailAliasAccount aa
+ JOIN account.mailAlias ma ON ma.id = aa.mailAlias
+ WHERE aa.account = NEW.workerFk
+ AND ma.alias = 'general'
+ ) THEN
+ INSERT INTO account.mailAliasAccount (mailAlias, account)
+ SELECT id, NEW.workerFk
+ FROM account.mailAlias
+ WHERE alias = 'general';
+ END IF;
+
+ IF (
+ SELECT NOT COUNT(account)
+ FROM account.mailForward
+ WHERE account = NEW.workerFk
+ ) THEN
+ INSERT INTO account.mailForward (account, forwardTo)
+ SELECT NEW.workerFk, email
+ FROM account.user
+ WHERE id = NEW.workerFk;
+ END IF;
+END$$
+DELIMITER ;
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index b01c07461..a3d76015f 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -1965,6 +1965,11 @@ INSERT INTO `vn`.`calendarType` (`id`, `description`, `hoursWeek`, `isPartial`)
VALUES
(1, 'General schedule', 40, 0);
+INSERT INTO `account`.`account`(id)
+ SELECT u.id
+ FROM account.user u
+ LEFT JOIN account.account a ON a.id = u.id
+ WHERE a.id IS NULL;
DROP TEMPORARY TABLE IF EXISTS tmp.worker;
CREATE TEMPORARY TABLE tmp.worker
From 9da5c4c1db4d9bff39b578d943406333d33a7625 Mon Sep 17 00:00:00 2001
From: vicent
Date: Fri, 25 Aug 2023 10:04:27 +0200
Subject: [PATCH 043/427] refs #5918 refacotr: cambiado nombre variable
---
modules/worker/front/time-control/index.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js
index 91f095334..88bd2e92a 100644
--- a/modules/worker/front/time-control/index.js
+++ b/modules/worker/front/time-control/index.js
@@ -113,21 +113,21 @@ class Controller extends Section {
}
isMailSended() {
- const filter = {
+ const filterTimeControl = {
where: {
year: this._date.getFullYear(),
week: this.getWeekNumber(this._date)
},
limit: 1
};
- this.$http.get('WorkerTimeControlMails', {filter})
+ this.$http.get('WorkerTimeControlMails', {filterTimeControl})
.then(res => {
if (!res.data.length) {
this.canResend = false;
return;
}
- const filter = {
+ const filterDepartment = {
where: {
workerFk: this.$params.id
},
@@ -135,7 +135,7 @@ class Controller extends Section {
relation: 'department'
}
};
- this.$http.get('WorkerDepartments', {filter})
+ this.$http.get('WorkerDepartments', {filterDepartment})
.then(res => {
const department = res.data[0].department;
if (department.isTeleworking) this.canResend = true;
From c06ee9c5b039e1048a72db7d80027474dd84e987 Mon Sep 17 00:00:00 2001
From: pablone
Date: Fri, 25 Aug 2023 10:55:10 +0200
Subject: [PATCH 044/427] refs #6159 fixUserNoActiveOnNewBusiness
---
db/dump/fixtures.sql | 3 +++
1 file changed, 3 insertions(+)
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index a3d76015f..5ac355ea4 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -1994,6 +1994,9 @@ INSERT INTO `vn`.`business` (`id`, `workerFk`, `companyCodeFk`, `started`, `ende
DROP TEMPORARY TABLE IF EXISTS tmp.worker;
+DELETE FROM `account`.`account`
+ WHERE id = 1105;
+
UPDATE `vn`.`business`
SET `payedHolidays`= 8
WHERE `id`= 1106;
From 2ecc464046493b4ae2c21a8a8e8ae6bd00b6902a Mon Sep 17 00:00:00 2001
From: alexm
Date: Fri, 25 Aug 2023 14:26:17 +0200
Subject: [PATCH 045/427] refs #5673 feat(claim_development): redirect to
lilium
---
modules/claim/front/development/index.html | 118 +-----------------
modules/claim/front/development/index.js | 15 +--
modules/claim/front/development/index.spec.js | 31 -----
modules/claim/front/development/locale/es.yml | 8 --
modules/claim/front/development/style.scss | 0
5 files changed, 8 insertions(+), 164 deletions(-)
delete mode 100644 modules/claim/front/development/index.spec.js
delete mode 100644 modules/claim/front/development/locale/es.yml
delete mode 100644 modules/claim/front/development/style.scss
diff --git a/modules/claim/front/development/index.html b/modules/claim/front/development/index.html
index 1684541ea..7fb3b870e 100644
--- a/modules/claim/front/development/index.html
+++ b/modules/claim/front/development/index.html
@@ -1,116 +1,2 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/modules/claim/front/development/index.js b/modules/claim/front/development/index.js
index 04569f0aa..7b31bd17f 100644
--- a/modules/claim/front/development/index.js
+++ b/modules/claim/front/development/index.js
@@ -1,17 +1,14 @@
import ngModule from '../module';
import Section from 'salix/components/section';
-import './style.scss';
class Controller extends Section {
- onSubmit() {
- this.$.watcher.check();
- this.$.model.save().then(() => {
- this.$.watcher.notifySaved();
- this.$.watcher.updateOriginalData();
+ constructor($element, $) {
+ super($element, $);
+ }
- if (this.aclService.hasAny(['claimManager']))
- this.$state.go('claim.card.action');
- });
+ async $onInit() {
+ this.$state.go('claim.card.summary', {id: this.$params.id});
+ window.location.href = await this.vnApp.getUrl(`claim/${this.$params.id}/development`);
}
}
diff --git a/modules/claim/front/development/index.spec.js b/modules/claim/front/development/index.spec.js
deleted file mode 100644
index e2574ccb9..000000000
--- a/modules/claim/front/development/index.spec.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import './index.js';
-import watcher from 'core/mocks/watcher';
-import crudModel from 'core/mocks/crud-model';
-
-describe('Claim', () => {
- describe('Component vnClaimDevelopment', () => {
- let controller;
- let $scope;
-
- beforeEach(ngModule('claim'));
-
- beforeEach(inject(($componentController, $rootScope) => {
- $scope = $rootScope.$new();
- $scope.watcher = watcher;
- $scope.model = crudModel;
- const $element = angular.element('');
- controller = $componentController('vnClaimDevelopment', {$element, $scope});
- }));
-
- describe('onSubmit()', () => {
- it(`should redirect to 'claim.card.action' state`, () => {
- jest.spyOn(controller.aclService, 'hasAny').mockReturnValue(true);
- jest.spyOn(controller.$state, 'go');
-
- controller.onSubmit();
-
- expect(controller.$state.go).toHaveBeenCalledWith('claim.card.action');
- });
- });
- });
-});
diff --git a/modules/claim/front/development/locale/es.yml b/modules/claim/front/development/locale/es.yml
deleted file mode 100644
index c0c4ed184..000000000
--- a/modules/claim/front/development/locale/es.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-Destination: Destino
-Development: Trazabilidad
-Reason: Motivo
-Result: Consecuencia
-Responsible: Responsable
-Worker: Trabajador
-Redelivery: Devolución
-Add line: Añadir Linea
\ No newline at end of file
diff --git a/modules/claim/front/development/style.scss b/modules/claim/front/development/style.scss
deleted file mode 100644
index e69de29bb..000000000
From d1df8009a620138e1a53de2c19ab952d725590d8 Mon Sep 17 00:00:00 2001
From: guillermo
Date: Tue, 29 Aug 2023 10:52:05 +0200
Subject: [PATCH 046/427] refs #6023 Fix change rol bug
---
back/methods/vn-user/privileges.js | 66 ++++++++++++--------
modules/account/back/methods/account/sync.js | 5 ++
2 files changed, 44 insertions(+), 27 deletions(-)
diff --git a/back/methods/vn-user/privileges.js b/back/methods/vn-user/privileges.js
index 08cfaaae8..05ad4481c 100644
--- a/back/methods/vn-user/privileges.js
+++ b/back/methods/vn-user/privileges.js
@@ -40,44 +40,56 @@ module.exports = Self => {
const userId = ctx.req.accessToken.userId;
const myOptions = {};
+ let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
- const user = await Self.findById(userId, {fields: ['hasGrant']}, myOptions);
+ if (!myOptions.transaction) {
+ tx = await Self.beginTransaction({});
+ myOptions.transaction = tx;
+ };
- const userToUpdate = await Self.findById(id, {
- fields: ['id', 'name', 'hasGrant', 'roleFk', 'password', 'email'],
- include: {
- relation: 'role',
- scope: {
- fields: ['name']
+ try {
+ const user = await Self.findById(userId, {fields: ['hasGrant']}, myOptions);
+
+ const userToUpdate = await Self.findById(id, {
+ fields: ['id', 'name', 'hasGrant', 'roleFk', 'password', 'email'],
+ include: {
+ relation: 'role',
+ scope: {
+ fields: ['name']
+ }
}
- }
- }, myOptions);
+ }, myOptions);
- if (!user.hasGrant)
- throw new UserError(`You don't have grant privilege`);
+ if (!user.hasGrant)
+ throw new UserError(`You don't have grant privilege`);
- const hasRoleFromUser = await Self.hasRole(userId, userToUpdate.role().name, myOptions);
+ const hasRoleFromUser = await Self.hasRole(userId, userToUpdate.role().name, myOptions);
- if (!hasRoleFromUser)
- throw new UserError(`You don't own the role and you can't assign it to another user`);
-
- if (hasGrant != null)
- userToUpdate.hasGrant = hasGrant;
-
- if (roleFk) {
- const role = await models.Role.findById(roleFk, {fields: ['name']}, myOptions);
- const hasRole = await Self.hasRole(userId, role.name, myOptions);
-
- if (!hasRole)
+ if (!hasRoleFromUser)
throw new UserError(`You don't own the role and you can't assign it to another user`);
- userToUpdate.roleFk = roleFk;
- }
+ if (hasGrant != null)
+ userToUpdate.hasGrant = hasGrant;
- await userToUpdate.save(userToUpdate);
- await models.Account.sync(userToUpdate.name);
+ if (roleFk) {
+ const role = await models.Role.findById(roleFk, {fields: ['name']}, myOptions);
+ const hasRole = await Self.hasRole(userId, role.name, myOptions);
+
+ if (!hasRole)
+ throw new UserError(`You don't own the role and you can't assign it to another user`);
+
+ userToUpdate.roleFk = roleFk;
+ }
+
+ await userToUpdate.save(myOptions);
+ await models.Account.sync(userToUpdate.name, null, null, myOptions);
+ await tx.commit();
+ } catch (err) {
+ await tx.rollback();
+ throw err;
+ };
};
};
diff --git a/modules/account/back/methods/account/sync.js b/modules/account/back/methods/account/sync.js
index a5befc22c..3ab19eed5 100644
--- a/modules/account/back/methods/account/sync.js
+++ b/modules/account/back/methods/account/sync.js
@@ -30,6 +30,11 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
+ if (!myOptions.transaction) {
+ tx = await Self.beginTransaction({});
+ myOptions.transaction = tx;
+ };
+
const models = Self.app.models;
const user = await models.VnUser.findOne({
fields: ['id'],
From 9f6d034f9cf044f9ab688bb860bf4277d1df7bec Mon Sep 17 00:00:00 2001
From: guillermo
Date: Tue, 29 Aug 2023 13:45:20 +0200
Subject: [PATCH 047/427] refs #6023 Minor changes
---
back/methods/vn-user/privileges.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/back/methods/vn-user/privileges.js b/back/methods/vn-user/privileges.js
index 05ad4481c..0520fd5c2 100644
--- a/back/methods/vn-user/privileges.js
+++ b/back/methods/vn-user/privileges.js
@@ -86,9 +86,9 @@ module.exports = Self => {
await userToUpdate.save(myOptions);
await models.Account.sync(userToUpdate.name, null, null, myOptions);
- await tx.commit();
+ if (tx) await tx.commit();
} catch (err) {
- await tx.rollback();
+ if (tx) await tx.rollback();
throw err;
};
};
From 0b9199688e786f3da556966fe6ec97dd6a82ad51 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 30 Aug 2023 12:48:57 +0200
Subject: [PATCH 048/427] refs #5843 userFk remove and vchange
---
.../224903/00-timeBusiness_calculate.sql | 6 +--
db/changes/231401/00-clientBeforeUpdate.sql | 2 +-
db/dump/structure.sql | 5 +-
.../claim/back/methods/claim/getSummary.js | 4 +-
modules/claim/back/methods/claim/logs.js | 46 +++++++++----------
modules/claim/front/card/index.js | 2 +-
.../client/front/credit-management/index.js | 2 +-
modules/client/front/credit/index/index.js | 2 +-
modules/client/front/dms/index/index.js | 2 +-
modules/item/back/methods/item/getCard.js | 2 +-
modules/item/back/methods/item/getSummary.js | 2 +-
modules/route/back/methods/route/summary.js | 2 +-
modules/route/front/card/index.js | 2 +-
modules/route/front/descriptor/index.js | 2 +-
.../back/methods/shelving/getSummary.js | 2 +-
modules/shelving/front/card/index.js | 2 +-
modules/shelving/front/summary/index.js | 2 +-
.../back/methods/supplier/getSummary.js | 2 +-
modules/ticket/front/dms/index/index.js | 2 +-
modules/ticket/front/tracking/index/index.js | 2 +-
.../methods/worker-time-control/sendMail.js | 2 +-
.../methods/worker/activeWithInheritedRole.js | 4 +-
modules/worker/back/methods/worker/filter.js | 7 ++-
23 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/db/.archive/224903/00-timeBusiness_calculate.sql b/db/.archive/224903/00-timeBusiness_calculate.sql
index ea13c4a8a..6345475dd 100644
--- a/db/.archive/224903/00-timeBusiness_calculate.sql
+++ b/db/.archive/224903/00-timeBusiness_calculate.sql
@@ -34,7 +34,7 @@ BEGIN
isAllowedToWork
FROM(SELECT t.dated,
b.id businessFk,
- w.userFk,
+ w.id,
b.departmentFk,
IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.start,5) ORDER BY j.start ASC SEPARATOR ' - ')) hourStart ,
IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.end,5) ORDER BY j.end ASC SEPARATOR ' - ')) hourEnd,
@@ -48,14 +48,14 @@ BEGIN
FROM time t
LEFT JOIN business b ON t.dated BETWEEN b.started AND IFNULL(b.ended, vDatedTo)
LEFT JOIN worker w ON w.id = b.workerFk
- JOIN tmp.`user` u ON u.userFK = w.userFK
+ JOIN tmp.`user` u ON u.userFK = w.id
LEFT JOIN workCenter wc ON wc.id = b.workcenterFK
LEFT JOIN postgresql.calendar_labour_type cl ON cl.calendar_labour_type_id = b.calendarTypeFk
LEFT JOIN postgresql.journey j ON j.business_id = b.id AND j.day_id = WEEKDAY(t.dated) + 1
LEFT JOIN postgresql.calendar_employee ce ON ce.businessFk = b.id AND ce.date = t.dated
LEFT JOIN absenceType at2 ON at2.id = ce.calendar_state_id
WHERE t.dated BETWEEN vDatedFrom AND vDatedTo
- GROUP BY w.userFk, t.dated
+ GROUP BY w.id, t.dated
)sub;
UPDATE tmp.timeBusinessCalculate t
diff --git a/db/changes/231401/00-clientBeforeUpdate.sql b/db/changes/231401/00-clientBeforeUpdate.sql
index 8f9f70dd5..6bae98f61 100644
--- a/db/changes/231401/00-clientBeforeUpdate.sql
+++ b/db/changes/231401/00-clientBeforeUpdate.sql
@@ -46,7 +46,7 @@ BEGIN
CONCAT('Cliente ', NEW.id),
CONCAT('Recibida la documentación: ', vText)
FROM worker w
- LEFT JOIN account.user u ON w.userFk = u.id AND u.active
+ LEFT JOIN account.user u ON w.id = u.id AND u.active
LEFT JOIN account.account ac ON ac.id = u.id
WHERE w.id = NEW.salesPersonFk;
END IF;
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index 2d66d456c..c47d0debc 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -73377,7 +73377,7 @@ BEGIN
CREATE TEMPORARY TABLE tmp.`user`
SELECT u.id userFk
FROM account.user u
- JOIN vn.worker w ON w.userFk = u.id
+ JOIN vn.worker w ON w.id = u.id
WHERE w.id = vWorkerFk;
CALL vn.timeControl_calculate(vDatedFrom, vDatedTo);
@@ -75480,7 +75480,7 @@ BEGIN
GROUP BY cont
HAVING cont2 MOD 2 = 1
)sub2;
- JOIN worker w ON w.userFk = sub2.userFk;
+ JOIN worker w ON w.id = sub2.userFk;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -81818,6 +81818,7 @@ USE `vn`;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
+
--
-- Final view structure for view `workerTimeJourneyNG`
--
diff --git a/modules/claim/back/methods/claim/getSummary.js b/modules/claim/back/methods/claim/getSummary.js
index d384f7ebb..2731f1e8f 100644
--- a/modules/claim/back/methods/claim/getSummary.js
+++ b/modules/claim/back/methods/claim/getSummary.js
@@ -35,7 +35,7 @@ module.exports = Self => {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
@@ -109,7 +109,7 @@ module.exports = Self => {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/claim/back/methods/claim/logs.js b/modules/claim/back/methods/claim/logs.js
index f47513e9e..4d1b37822 100644
--- a/modules/claim/back/methods/claim/logs.js
+++ b/modules/claim/back/methods/claim/logs.js
@@ -1,7 +1,7 @@
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
const buildFilter = require('vn-loopback/util/filter').buildFilter;
-const { mergeFilters, mergeWhere } = require('vn-loopback/util/filter');
+const {mergeFilters, mergeWhere} = require('vn-loopback/util/filter');
module.exports = Self => {
Self.remoteMethodCtx('logs', {
@@ -12,27 +12,27 @@ module.exports = Self => {
arg: 'id',
type: 'Number',
description: 'The claim id',
- http: { source: 'path' }
+ http: {source: 'path'}
},
{
arg: 'filter',
type: 'object',
- http: { source: 'query' }
+ http: {source: 'query'}
},
{
arg: 'search',
type: 'string',
- http: { source: 'query' }
+ http: {source: 'query'}
},
{
arg: 'userFk',
type: 'number',
- http: { source: 'query' }
+ http: {source: 'query'}
},
{
arg: 'created',
type: 'date',
- http: { source: 'query' }
+ http: {source: 'query'}
},
],
returns: {
@@ -45,7 +45,7 @@ module.exports = Self => {
}
});
- Self.logs = async (ctx, id, filter, options) => {
+ Self.logs = async(ctx, id, filter, options) => {
const conn = Self.dataSource.connector;
const args = ctx.args;
const myOptions = {};
@@ -56,25 +56,25 @@ module.exports = Self => {
let where = buildFilter(args, (param, value) => {
switch (param) {
- case 'search':
- return {
- or: [
- { changedModel: { like: `%${value}%` } },
- { oldInstance: { like: `%${value}%` } }
- ]
- };
- case 'userFk':
- return { 'cl.userFk': value };
- case 'created':
- value.setHours(0, 0, 0, 0);
- to = new Date(value);
- to.setHours(23, 59, 59, 999);
+ case 'search':
+ return {
+ or: [
+ {changedModel: {like: `%${value}%`}},
+ {oldInstance: {like: `%${value}%`}}
+ ]
+ };
+ case 'userFk':
+ return {'cl.userFk': value};
+ case 'created':
+ value.setHours(0, 0, 0, 0);
+ to = new Date(value);
+ to.setHours(23, 59, 59, 999);
- return { creationDate: { between: [value, to] } };
+ return {creationDate: {between: [value, to]}};
}
});
- where = mergeWhere(where, { ['cl.originFk']: id });
- filter = mergeFilters(args.filter, { where });
+ where = mergeWhere(where, {['cl.originFk']: id});
+ filter = mergeFilters(args.filter, {where});
const stmts = [];
diff --git a/modules/claim/front/card/index.js b/modules/claim/front/card/index.js
index 4a8677c90..5dad0dfc2 100644
--- a/modules/claim/front/card/index.js
+++ b/modules/claim/front/card/index.js
@@ -8,7 +8,7 @@ class Controller extends ModuleCard {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/client/front/credit-management/index.js b/modules/client/front/credit-management/index.js
index 856acd27b..7733319e8 100644
--- a/modules/client/front/credit-management/index.js
+++ b/modules/client/front/credit-management/index.js
@@ -9,7 +9,7 @@ export default class Controller extends Section {
include: [{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/client/front/credit/index/index.js b/modules/client/front/credit/index/index.js
index 28160dfeb..3083ac598 100644
--- a/modules/client/front/credit/index/index.js
+++ b/modules/client/front/credit/index/index.js
@@ -9,7 +9,7 @@ class Controller extends Section {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/client/front/dms/index/index.js b/modules/client/front/dms/index/index.js
index a18f195bb..aff64aa4f 100644
--- a/modules/client/front/dms/index/index.js
+++ b/modules/client/front/dms/index/index.js
@@ -28,7 +28,7 @@ class Controller extends Section {
}, {
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/item/back/methods/item/getCard.js b/modules/item/back/methods/item/getCard.js
index c4ee09d95..49ce3636f 100644
--- a/modules/item/back/methods/item/getCard.js
+++ b/modules/item/back/methods/item/getCard.js
@@ -34,7 +34,7 @@ module.exports = Self => {
include: [{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/item/back/methods/item/getSummary.js b/modules/item/back/methods/item/getSummary.js
index 6cd9d9511..17a38cf07 100644
--- a/modules/item/back/methods/item/getSummary.js
+++ b/modules/item/back/methods/item/getSummary.js
@@ -38,7 +38,7 @@ module.exports = Self => {
include: [{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/route/back/methods/route/summary.js b/modules/route/back/methods/route/summary.js
index 10cfe38ee..acd17759d 100644
--- a/modules/route/back/methods/route/summary.js
+++ b/modules/route/back/methods/route/summary.js
@@ -33,7 +33,7 @@ module.exports = Self => {
}, {
relation: 'worker',
scope: {
- fields: ['id', 'userFk'],
+ fields: ['id'],
include: [
{
relation: 'user',
diff --git a/modules/route/front/card/index.js b/modules/route/front/card/index.js
index 6bf233c0a..07b5a547c 100644
--- a/modules/route/front/card/index.js
+++ b/modules/route/front/card/index.js
@@ -41,7 +41,7 @@ class Controller extends ModuleCard {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/route/front/descriptor/index.js b/modules/route/front/descriptor/index.js
index aa47044b1..4377ac617 100644
--- a/modules/route/front/descriptor/index.js
+++ b/modules/route/front/descriptor/index.js
@@ -79,7 +79,7 @@ class Controller extends Descriptor {
}, {
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/shelving/back/methods/shelving/getSummary.js b/modules/shelving/back/methods/shelving/getSummary.js
index da357c7bf..7488511d0 100644
--- a/modules/shelving/back/methods/shelving/getSummary.js
+++ b/modules/shelving/back/methods/shelving/getSummary.js
@@ -35,7 +35,7 @@ module.exports = Self => {
{
relation: 'worker',
scope: {
- fields: ['id', 'userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/shelving/front/card/index.js b/modules/shelving/front/card/index.js
index 5e2ea9b12..4f571d876 100644
--- a/modules/shelving/front/card/index.js
+++ b/modules/shelving/front/card/index.js
@@ -7,7 +7,7 @@ class Controller extends ModuleCard {
include: [
{relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/shelving/front/summary/index.js b/modules/shelving/front/summary/index.js
index 10a905f1d..91f8e2aa7 100644
--- a/modules/shelving/front/summary/index.js
+++ b/modules/shelving/front/summary/index.js
@@ -12,7 +12,7 @@ class Controller extends Summary {
include: [
{relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/supplier/back/methods/supplier/getSummary.js b/modules/supplier/back/methods/supplier/getSummary.js
index bf3fa56f5..bc869725c 100644
--- a/modules/supplier/back/methods/supplier/getSummary.js
+++ b/modules/supplier/back/methods/supplier/getSummary.js
@@ -91,7 +91,7 @@ module.exports = Self => {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/ticket/front/dms/index/index.js b/modules/ticket/front/dms/index/index.js
index 2ec7e03c0..676a28db8 100644
--- a/modules/ticket/front/dms/index/index.js
+++ b/modules/ticket/front/dms/index/index.js
@@ -29,7 +29,7 @@ class Controller extends Section {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/ticket/front/tracking/index/index.js b/modules/ticket/front/tracking/index/index.js
index 38abcd8ab..95665b071 100644
--- a/modules/ticket/front/tracking/index/index.js
+++ b/modules/ticket/front/tracking/index/index.js
@@ -9,7 +9,7 @@ class Controller extends Section {
{
relation: 'worker',
scope: {
- fields: ['userFk'],
+ fields: ['id'],
include: {
relation: 'user',
scope: {
diff --git a/modules/worker/back/methods/worker-time-control/sendMail.js b/modules/worker/back/methods/worker-time-control/sendMail.js
index ab5e56a77..331c81512 100644
--- a/modules/worker/back/methods/worker-time-control/sendMail.js
+++ b/modules/worker/back/methods/worker-time-control/sendMail.js
@@ -102,7 +102,7 @@ module.exports = Self => {
stmt = new ParameterizedSQL('DROP TEMPORARY TABLE IF EXISTS tmp.`user`');
stmts.push(stmt);
- stmt = new ParameterizedSQL('CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` SELECT userFk FROM vn.worker w JOIN account.`user` u ON u.id = w.userFk WHERE userFk IS NOT NULL');
+ stmt = new ParameterizedSQL('CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` SELECT id as userFk FROM vn.worker w JOIN account.`user` u ON u.id = w.id WHERE id IS NOT NULL');
stmts.push(stmt);
}
diff --git a/modules/worker/back/methods/worker/activeWithInheritedRole.js b/modules/worker/back/methods/worker/activeWithInheritedRole.js
index 9536b0f29..2b75a939e 100644
--- a/modules/worker/back/methods/worker/activeWithInheritedRole.js
+++ b/modules/worker/back/methods/worker/activeWithInheritedRole.js
@@ -23,8 +23,8 @@ module.exports = Self => {
const query =
`SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname
FROM worker w
- JOIN account.user u ON u.id = w.userFk
- JOIN account.roleRole i ON i.role = u.role
+ JOIN account.user u ON u.id = w.id
+ JOIN account.roleRole i ON i.role = u.role
JOIN account.role r ON r.id = i.inheritsFrom`;
return Self.activeWorkers(query, filter);
diff --git a/modules/worker/back/methods/worker/filter.js b/modules/worker/back/methods/worker/filter.js
index 71a8da96f..15a56949f 100644
--- a/modules/worker/back/methods/worker/filter.js
+++ b/modules/worker/back/methods/worker/filter.js
@@ -94,9 +94,8 @@ module.exports = Self => {
{'u.nickname': {like: `%${value}%`}}
]};
case 'id':
- return {'w.id': value};
case 'userFk':
- return {'w.userFk': value};
+ return {'w.id': value};
case 'firstName':
return {'w.firstName': {like: `%${value}%`}};
case 'lastName':
@@ -123,8 +122,8 @@ module.exports = Self => {
FROM worker w
LEFT JOIN workerDepartment wd ON wd.workerFk = w.id
LEFT JOIN department d ON d.id = wd.departmentFk
- LEFT JOIN client c ON c.id = w.userFk
- LEFT JOIN account.user u ON u.id = w.userFk
+ LEFT JOIN client c ON c.id = w.id
+ LEFT JOIN account.user u ON u.id = w.id
LEFT JOIN pbx.sip p ON p.user_id = u.id
LEFT JOIN account.emailUser mu ON mu.userFk = u.id`
);
From 05f0f72c739a6c668c7c73c0370644e3906c143e Mon Sep 17 00:00:00 2001
From: jorgep
Date: Wed, 30 Aug 2023 14:14:48 +0200
Subject: [PATCH 049/427] refs #6119 microsip link added
---
modules/client/front/summary/index.html | 23 ++++++++--
modules/client/front/summary/style.scss | 4 ++
modules/order/front/summary/index.html | 11 ++++-
modules/order/front/summary/style.scss | 4 ++
.../route/front/roadmap/summary/index.html | 11 ++++-
.../route/front/roadmap/summary/style.scss | 6 ++-
modules/ticket/front/summary/index.html | 42 ++++++++++++++++---
modules/ticket/front/summary/style.scss | 5 +++
modules/worker/front/descriptor/index.html | 30 +++++++++++--
modules/worker/front/descriptor/index.js | 2 +-
modules/worker/front/descriptor/style.scss | 6 +++
modules/worker/front/summary/index.html | 41 +++++++++++++++---
modules/worker/front/summary/index.js | 2 +-
modules/worker/front/summary/style.scss | 6 +++
14 files changed, 169 insertions(+), 24 deletions(-)
create mode 100644 modules/worker/front/descriptor/style.scss
create mode 100644 modules/worker/front/summary/style.scss
diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html
index 15a55ec8c..6f7c915c1 100644
--- a/modules/client/front/summary/index.html
+++ b/modules/client/front/summary/index.html
@@ -45,11 +45,26 @@
-
+
+ {{$ctrl.summary.phone}}
+
+
+
+
-
+
+ {{$ctrl.summary.mobile}}
+
+
+
diff --git a/modules/client/front/summary/style.scss b/modules/client/front/summary/style.scss
index 7dc1cc928..dd30edaa0 100644
--- a/modules/client/front/summary/style.scss
+++ b/modules/client/front/summary/style.scss
@@ -11,4 +11,8 @@ vn-client-summary .summary {
font-family: 'salixfont' !important;
content: "\e965";
}
+ vn-icon.tel {
+ font-size: 1.1em;
+ vertical-align: bottom;
+ }
}
diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html
index 3622ae932..52a1afd6d 100644
--- a/modules/order/front/summary/index.html
+++ b/modules/order/front/summary/index.html
@@ -49,7 +49,16 @@
value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy HH:mm'}}">
+ >
+ {{$ctrl.summary.address.phone}}
+
+
+
+
diff --git a/modules/order/front/summary/style.scss b/modules/order/front/summary/style.scss
index a2537c58f..7abcd889b 100644
--- a/modules/order/front/summary/style.scss
+++ b/modules/order/front/summary/style.scss
@@ -17,4 +17,8 @@ vn-order-summary .summary{
}
}
}
+ vn-icon.tel {
+ font-size: 1.1em;
+ vertical-align: bottom;
+ }
}
\ No newline at end of file
diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html
index e6b50601e..c8ba85456 100644
--- a/modules/route/front/roadmap/summary/index.html
+++ b/modules/route/front/roadmap/summary/index.html
@@ -25,7 +25,16 @@
+ >
+ {{summary.phone}}
+
+
+
+
+ >
+ {{$ctrl.summary.address.phone}}
+
+
+
+
+ >
+ {{$ctrl.summary.address.mobile}}
+
+
+
+
+ ng-if="$ctrl.summary.client.phone != null">
+ {{$ctrl.summary.client.phone}}
+
+
+
+ ng-if="$ctrl.summary.client.mobile != null">
+ {{$ctrl.summary.client.mobile}}
+
+
+
diff --git a/modules/ticket/front/summary/style.scss b/modules/ticket/front/summary/style.scss
index e92ff0d42..2f52de65e 100644
--- a/modules/ticket/front/summary/style.scss
+++ b/modules/ticket/front/summary/style.scss
@@ -47,4 +47,9 @@ vn-ticket-summary .summary {
}
}
}
+
+ vn-icon.tel {
+ font-size: 1.1em;
+ vertical-align: bottom;
+ }
}
\ No newline at end of file
diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html
index ea005e1a2..ce318540f 100644
--- a/modules/worker/front/descriptor/index.html
+++ b/modules/worker/front/descriptor/index.html
@@ -36,12 +36,34 @@
value="{{$ctrl.worker.department.department.name}}">
+ label="Phone">
+ -
+
+ {{$ctrl.worker.phone}}
+
+
+
+
+ label="Extension">
+ -
+
+ {{$ctrl.worker.sip.extension}}
+
+
+
+
+
diff --git a/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.js b/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.js
new file mode 100755
index 000000000..4345ead47
--- /dev/null
+++ b/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.js
@@ -0,0 +1,25 @@
+const Component = require(`vn-print/core/component`);
+const emailBody = new Component('email-body');
+const models = require('vn-loopback/server/server').models;
+
+module.exports = {
+ name: 'modified-collection-volumetry',
+ components: {
+ 'email-body': emailBody.build(),
+ },
+ async serverPrefetch() {
+ this.username = (this.data.userFk) ? await this.getUsername(this.data.userFk) : 'system';
+ },
+ methods: {
+ async getUsername(id) {
+ const account = await models.VnUser.findById(id);
+ return account.name;
+ }
+ },
+ props: {
+ data: {
+ type: Object,
+ required: true
+ }
+ }
+};
From d6027096799301eb9ccf2399b3cb0c107cbab967 Mon Sep 17 00:00:00 2001
From: jgallego
Date: Mon, 11 Sep 2023 08:46:26 +0200
Subject: [PATCH 071/427] refs #4059 changes en la carpeta actual
---
db/changes/232001/00-aclClient.sql | 40 -----------------------------
db/changes/232001/01-aclAccount.sql | 13 ----------
2 files changed, 53 deletions(-)
delete mode 100644 db/changes/232001/00-aclClient.sql
delete mode 100644 db/changes/232001/01-aclAccount.sql
diff --git a/db/changes/232001/00-aclClient.sql b/db/changes/232001/00-aclClient.sql
deleted file mode 100644
index dec6f6136..000000000
--- a/db/changes/232001/00-aclClient.sql
+++ /dev/null
@@ -1,40 +0,0 @@
--- No encuentro este back
-DELETE FROM salix.ACL WHERE property = 'activeWorkersWithRole';
-DELETE FROM salix.ACL WHERE model = 'Client' AND property = '*';
-
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Client','findOne','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Client','findById','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Client','find','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Client','exists','READ','ALLOW','ROLE','employee');
-
-DELETE FROM salix.ACL WHERE model = 'Client' AND accessType = '*' AND property IN (
- 'campaignMetricsEmail',
- 'campaignMetricsPdf',
- 'clientDebtStatementEmail',
- 'clientDebtStatementHtml',
- 'clientDebtStatementPdf',
- 'clientWelcomeEmail',
- 'clientWelcomeHtml',
- 'consumptionSendQueued',
- 'creditRequestEmail',
- 'creditRequestHtml',
- 'creditRequestPdf',
- 'getClientOrSupplierReference',
- 'incotermsAuthorizationEmail',
- 'incotermsAuthorizationHtml',
- 'incotermsAuthorizationPdf',
- 'letterDebtorNdEmail',
- 'letterDebtorNdHtml',
- 'letterDebtorPdf',
- 'letterDebtorStEmail',
- 'letterDebtorStHtml',
- 'printerSetupEmail',
- 'printerSetupHtml',
- 'sepaCoreEmail',
- 'setPassword',
- 'updateUser',
- 'uploadFile');
\ No newline at end of file
diff --git a/db/changes/232001/01-aclAccount.sql b/db/changes/232001/01-aclAccount.sql
deleted file mode 100644
index f618ca842..000000000
--- a/db/changes/232001/01-aclAccount.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-DELETE FROM salix.ACL WHERE model = 'Account' AND property = '*';
-
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Account','findOne','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Account','findById','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Account','find','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
- VALUES ('Account','exists','READ','ALLOW','ROLE','employee');
-
-DELETE FROM salix.ACL WHERE id=529;
--- 529 VnUser changePassword WRITE ALLOW ROLE account
\ No newline at end of file
From 9d0e4e7558d2583e7e1863d2fdc69af37d21460c Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 11 Sep 2023 10:47:39 +0200
Subject: [PATCH 072/427] refs #5660 change sql
---
db/changes/{233201 => 233801}/01-deliveryAssistantACL.sql | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename db/changes/{233201 => 233801}/01-deliveryAssistantACL.sql (100%)
diff --git a/db/changes/233201/01-deliveryAssistantACL.sql b/db/changes/233801/01-deliveryAssistantACL.sql
similarity index 100%
rename from db/changes/233201/01-deliveryAssistantACL.sql
rename to db/changes/233801/01-deliveryAssistantACL.sql
From 62a4469803ae0d01195a5bd06280349f16f3e5fb Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 11 Sep 2023 11:34:23 +0200
Subject: [PATCH 073/427] refs #5660 cambios structure
---
db/dump/structure.sql | 10171 ++++++++++++++++++++--------------------
1 file changed, 5027 insertions(+), 5144 deletions(-)
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index b7fb40485..73f6e92cb 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -787,7 +787,7 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
-
+
CALL user_checkName(NEW.`name`);
IF NEW.nickname = '' THEN
@@ -1018,7 +1018,7 @@ BEGIN
SET vSignature = util.hmacSha2(256, CONCAT_WS('/', @userId, @userName), vKey);
RETURN vSignature = @userSignature;
END IF;
-
+
RETURN FALSE;
END ;;
@@ -1047,7 +1047,7 @@ BEGIN
* @return The user id
*/
DECLARE vUser INT DEFAULT NULL;
-
+
IF myUser_checkLogin()
THEN
SET vUser = @userId;
@@ -1055,7 +1055,7 @@ BEGIN
SELECT id INTO vUser FROM user
WHERE name = LEFT(USER(), INSTR(USER(), '@') - 1);
END IF;
-
+
RETURN vUser;
END ;;
DELIMITER ;
@@ -1090,7 +1090,7 @@ BEGIN
ELSE
SET vUser = LEFT(USER(), INSTR(USER(), '@') - 1);
END IF;
-
+
RETURN vUser;
END ;;
DELIMITER ;
@@ -1185,10 +1185,10 @@ BEGIN
DECLARE vDigitChars TEXT DEFAULT '1234567890';
DECLARE vPunctChars TEXT DEFAULT '!$%&()=.';
- SELECT length, nAlpha, nUpper, nDigits, nPunct
+ SELECT length, nAlpha, nUpper, nDigits, nPunct
INTO vMinLength, vMinAlpha, vMinUpper, vMinDigits, vMinPunct FROM userPassword;
- WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha
+ WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha
OR vUpper < vMinUpper OR vDigits < vMinDigits OR vPunct < vMinPunct DO
SET vRandIndex = FLOOR((RAND() * 4) + 1);
@@ -1263,7 +1263,7 @@ BEGIN
DECLARE vRole VARCHAR(255);
SELECT CONCAT(IF(r.hasLogin, c.rolePrefix, ''), r.name) INTO vRole
- FROM role r
+ FROM role r
JOIN user u ON u.role = r.id
JOIN roleConfig c
WHERE u.name = vUserName;
@@ -1290,16 +1290,16 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `user_getNameFromId`(vSelf INT) RETUR
BEGIN
/**
* Gets user name from it's id.
- *
+ *
* @param vSelf The user id
* @return The user name
*/
DECLARE vName VARCHAR(30);
-
- SELECT `name` INTO vName
- FROM user
+
+ SELECT `name` INTO vName
+ FROM user
WHERE id = vSelf;
-
+
RETURN vName;
END ;;
DELIMITER ;
@@ -1371,7 +1371,7 @@ BEGIN
JOIN role r ON r.id = rr.inheritsFrom
WHERE u.`name` = vUser
AND r.id = vRoleId;
-
+
RETURN vHasRole;
END ;;
DELIMITER ;
@@ -1405,7 +1405,7 @@ BEGIN
AND password = MD5(vPassword)
AND active;
- IF vAuthIsOk
+ IF vAuthIsOk
THEN
CALL myUser_loginWithName (vUserName);
ELSE
@@ -1466,7 +1466,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_loginWithName`(vUserName VAR
BEGIN
/**
* Logs in using only the user name. This procedure is intended to be executed
- * by users with a high level of privileges so that normal users should not have
+ * by users with a high level of privileges so that normal users should not have
* execute permissions on it.
*
* @param vUserName The user name
@@ -1502,7 +1502,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_logout`()
BEGIN
/**
* Logouts the user.
- */
+ */
SET @userId = NULL;
SET @userName = NULL;
SET @userSignature = NULL;
@@ -1600,9 +1600,9 @@ BEGIN
SELECT COUNT(*) > 0 INTO vIsRoot
FROM tmp.role t
- JOIN role r ON r.id = t.id
+ JOIN role r ON r.id = t.id
WHERE r.`name` = 'root';
-
+
IF vIsRoot THEN
INSERT IGNORE INTO tmp.role (id)
SELECT id FROM role;
@@ -2321,7 +2321,7 @@ BEGIN
IF vChr REGEXP '[[:alpha:]]'
THEN
SET vNAlpha = vNAlpha+1;
-
+
IF vChr REGEXP '[A-Z]'
THEN
SET vNUpper = vNUpper+1;
@@ -2792,7 +2792,7 @@ BEGIN
IF NOT (NEW.`schema`REGEXP '^[0-9a-zA-Z_]+$') OR NOT (NEW.`procedure`REGEXP '^[0-9a-zA-Z_]+$') THEN
CALL util.throw('ONLY_ALPHANUMERICS_ALLOWED');
-
+
END IF;
END */;;
@@ -2818,7 +2818,7 @@ BEGIN
IF NOT (NEW.`schema`REGEXP '^[0-9a-zA-Z_]+$') OR NOT (NEW.`procedure`REGEXP '^[0-9a-zA-Z_]+$') THEN
CALL util.throw('ONLY_ALPHANUMERICS_ALLOWED');
-
+
END IF;
END */;;
@@ -3341,11 +3341,11 @@ BEGIN
DECLARE vTramo VARCHAR(20);
DECLARE vHour INT;
-
+
SET vHour = HOUR(vDateTime) ;
-
+
SET vTramo =
- CASE
+ CASE
WHEN vHour BETWEEN 0 AND 14 THEN 'Mañana'
WHEN vHour BETWEEN 15 AND 24 THEN 'Tarde'
END ;
@@ -3373,7 +3373,7 @@ BEGIN
* Inserta en la tabla bancos_evolution los saldos acumulados de cada banco
*
* @param vStartingDate Fecha desde la cual se recalculan la tabla bs.bancos_evolution
- */
+ */
DECLARE vCurrentDate DATE;
DECLARE vMaxDate DATE DEFAULT TIMESTAMPADD(MONTH, 7, util.VN_CURDATE());
IF IFNULL(vStartingDate,0) < TIMESTAMPADD(YEAR, -5, util.VN_CURDATE()) THEN
@@ -3387,49 +3387,49 @@ BEGIN
SELECT vCurrentDate, Id_Banco, deuda
FROM bs.bancos_evolution
WHERE Fecha = TIMESTAMPADD(DAY,-1,vCurrentDate);
-
+
WHILE vCurrentDate < vMaxDate DO
-- insertar solo el dia de ayer
INSERT INTO bs.bancos_evolution(Fecha ,Id_Banco, saldo)
- SELECT vCurrentDate, Id_Banco, SUM(saldo)
+ SELECT vCurrentDate, Id_Banco, SUM(saldo)
FROM (
SELECT Id_Banco ,saldo
FROM bs.bancos_evolution
WHERE Fecha = TIMESTAMPADD(DAY,-1,vCurrentDate) -- los saldos acumulados del dia anterior
UNION ALL
-
+
SELECT c.Id_Banco, IFNULL(SUM(Entrada),0) - IFNULL(SUM(Salida),0) as saldo
FROM vn2008.Cajas c
JOIN vn2008.Bancos b using(Id_Banco) -- saldos de las cajas
- JOIN vn.accountingType at2 ON at2.id = b.cash
+ JOIN vn.accountingType at2 ON at2.id = b.cash
WHERE at2.code IN ('wireTransfer','fundingLine')
AND Cajafecha = vCurrentDate
AND (Serie = 'MB' OR at2.code = 'fundingLine')
GROUP BY Id_Banco
- )sub
+ )sub
GROUP BY Id_Banco
ON DUPLICATE KEY UPDATE saldo = saldo + VALUES(saldo);
-
+
SET vCurrentDate = TIMESTAMPADD(DAY,1,vCurrentDate);
END WHILE;
- -- Ahora actualizamos la quilla
+ -- Ahora actualizamos la quilla
UPDATE bs.bancos_evolution be
JOIN
(
SELECT bp.Id_Banco, - sum(bp.importe) as quilla, t.dated
- FROM vn.time t
+ FROM vn.time t
JOIN vn2008.Bancos_poliza bp ON t.dated between apertura AND IFNULL(cierre, t.dated)
WHERE t.dated BETWEEN vStartingDate AND vMaxDate
GROUP BY Id_Banco, t.dated
) sub ON be.Id_Banco = sub.Id_Banco AND sub.dated = be.Fecha
- SET be.quilla = sub.quilla;
+ SET be.quilla = sub.quilla;
-- pagos futuros no concilidados
INSERT INTO bs.bancos_evolution(Fecha, Id_Banco, saldo)
SELECT t.dated, p.id_banco, - importe
- FROM vn.time t
+ FROM vn.time t
join vn2008.pago p ON p.fecha <= t.dated
WHERE t.dated BETWEEN util.VN_CURDATE() AND vMaxDate
AND p.fecha BETWEEN util.VN_CURDATE() AND vMaxDate
@@ -3439,7 +3439,7 @@ BEGIN
-- cobros futuros
INSERT INTO bs.bancos_evolution(Fecha, Id_Banco, saldo)
SELECT t.dated, r.Id_Banco, SUM(Entregado)
- FROM vn.time t
+ FROM vn.time t
JOIN vn2008.Recibos r ON r.Fechacobro <= t.dated
WHERE r.Fechacobro > util.VN_CURDATE() AND r.Fechacobro <= vMaxDate
AND t.dated BETWEEN util.VN_CURDATE() AND vMaxDate
@@ -3449,10 +3449,10 @@ BEGIN
-- saldos de la tabla prevision
INSERT INTO bs.bancos_evolution(Fecha, Id_Banco, saldo)
SELECT t.dated, sp.Id_Banco, SUM(Importe)
- FROM vn.time t
+ FROM vn.time t
JOIN vn2008.Saldos_Prevision sp ON sp.Fecha <= t.dated
JOIN vn2008.Bancos b ON sp.Id_Banco = b.Id_Banco
- JOIN vn.accountingType at2 ON at2.id = b.cash
+ JOIN vn.accountingType at2 ON at2.id = b.cash
WHERE at2.code IN ('wireTransfer','fundingLine')
AND t.dated BETWEEN vStartingDate AND vMaxDate
GROUP BY t.dated, sp.Id_Banco
@@ -3466,12 +3466,12 @@ BEGIN
-- Deuda
UPDATE bs.bancos_evolution be
JOIN vn2008.Bancos b using(Id_Banco)
- JOIN vn.accountingType at2 ON at2.id = b.cash
+ JOIN vn.accountingType at2 ON at2.id = b.cash
SET be.deuda = IF(at2.code = 'fundingLine', be.saldo_aux, 0)
, be.saldo = IF(at2.code = 'fundingLine', 0, be.saldo_aux)
WHERE Fecha >= vStartingDate;
- -- Liquidez
+ -- Liquidez
update bs.bancos_evolution set liquidez = saldo - quilla + deuda WHERE Fecha >= vStartingDate;
-- Disponibilidad
update bs.bancos_evolution set `disponibilidad ajena` = - quilla + deuda WHERE Fecha >= vStartingDate;
@@ -3494,14 +3494,14 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `campaignComparative`(vDateFrom DATE, vDateTo DATE)
BEGIN
- SELECT
- workerName,
- id,
- name,
- CAST(SUM(previousAmmount) AS DECIMAL(10, 0)) AS previousAmmount,
- CAST(SUM(currentAmmount) AS DECIMAL(10, 0)) AS currentAmmount
+ SELECT
+ workerName,
+ id,
+ name,
+ CAST(SUM(previousAmmount) AS DECIMAL(10, 0)) AS previousAmmount,
+ CAST(SUM(currentAmmount) AS DECIMAL(10, 0)) AS currentAmmount
FROM (
- (SELECT
+ (SELECT
CONCAT(w.firstname, ' ', w.lastName) AS workerName,
c.id,
c.name,
@@ -3510,11 +3510,11 @@ BEGIN
FROM bs.ventas v
INNER JOIN vn.`client` c ON v.Id_Cliente = c.id
INNER JOIN vn.worker w ON c.salesPersonFk = w.id
- WHERE v.fecha BETWEEN DATE_ADD(vDateFrom, INTERVAL - 1 YEAR)
+ WHERE v.fecha BETWEEN DATE_ADD(vDateFrom, INTERVAL - 1 YEAR)
AND DATE_ADD(vDateTo, INTERVAL - 1 YEAR)
GROUP BY w.id, v.Id_Cliente)
UNION ALL
- (SELECT
+ (SELECT
CONCAT(w.firstname, ' ', w.lastName) AS workerName,
c.id,
c.name,
@@ -3548,21 +3548,21 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `carteras_add`()
-BEGIN
-/**
- * Inserta en @bs.carteras.
- */
- DELETE FROM bs.carteras
- WHERE Año >= YEAR(util.VN_CURDATE()) - 1;
-
- INSERT INTO bs.carteras(Año,Mes,CodigoTrabajador,Peso)
- SELECT t.year AS Año, t.month AS Mes, w.code AS CodigoTrabajador, SUM(v.importe) AS Peso
- FROM vn.time t
- JOIN bs.ventas v on t.dated = v.fecha
- JOIN vn.client c on c.id = v.Id_Cliente
- JOIN vn.worker w ON w.id = c.salesPersonFk
- WHERE t.year >= YEAR(util.VN_CURDATE()) - 1
- GROUP BY w.code, t.year , t.month;
+BEGIN
+/**
+ * Inserta en @bs.carteras.
+ */
+ DELETE FROM bs.carteras
+ WHERE Año >= YEAR(util.VN_CURDATE()) - 1;
+
+ INSERT INTO bs.carteras(Año,Mes,CodigoTrabajador,Peso)
+ SELECT t.year AS Año, t.month AS Mes, w.code AS CodigoTrabajador, SUM(v.importe) AS Peso
+ FROM vn.time t
+ JOIN bs.ventas v on t.dated = v.fecha
+ JOIN vn.client c on c.id = v.Id_Cliente
+ JOIN vn.worker w ON w.id = c.salesPersonFk
+ WHERE t.year >= YEAR(util.VN_CURDATE()) - 1
+ GROUP BY w.code, t.year , t.month;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -3594,24 +3594,24 @@ BEGIN
DELETE FROM bs.clientNewBorn
WHERE lastShipped < vOneYearAgo;
-
+
DELETE FROM ventas
WHERE fecha < vFourYearsAgo;
-
+
DELETE FROM payMethodClient
WHERE dated < vOneYearAgo;
DELETE FROM payMethodClientEvolution
WHERE dated < vFourYearsAgo;
- DELETE FROM bs.salesByclientSalesPerson
+ DELETE FROM bs.salesByclientSalesPerson
WHERE dated < vFourYearsAgo;
-
- DELETE FROM bs.m3
+
+ DELETE FROM bs.m3
WHERE fecha < vTwoYearAgo;
DELETE FROM salesByItemTypeDay
- WHERE dated < vThreeYearAgo;
+ WHERE dated < vThreeYearAgo;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -3710,16 +3710,16 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `clientNewBorn_recalc`()
BLOCK1: BEGIN
DECLARE vClientFk INT;
- DECLARE vShipped DATE;
+ DECLARE vShipped DATE;
DECLARE vPreviousShipped DATE;
- DECLARE vDone boolean;
- DECLARE cur cursor for
-
- SELECT clientFk, firstShipped
- FROM bs.clientNewBorn;
-
- DECLARE continue HANDLER FOR NOT FOUND SET vDone = TRUE;
- SET vDone := FALSE;
+ DECLARE vDone boolean;
+ DECLARE cur cursor for
+
+ SELECT clientFk, firstShipped
+ FROM bs.clientNewBorn;
+
+ DECLARE continue HANDLER FOR NOT FOUND SET vDone = TRUE;
+ SET vDone := FALSE;
DELETE FROM bs.clientNewBorn WHERE isModified = FALSE;
@@ -3731,7 +3731,7 @@ BLOCK1: BEGIN
WHERE t.shipped BETWEEN TIMESTAMPADD(YEAR, -1, util.VN_CURDATE()) AND util.VN_CURDATE() AND cb.isModified is null
GROUP BY c.id;
OPEN cur;
-
+
LOOP1: LOOP
SET vDone := FALSE;
FETCH cur INTO vClientFk, vShipped;
@@ -3742,37 +3742,37 @@ BLOCK1: BEGIN
END IF;
BLOCK2: BEGIN
- DECLARE vCurrentShipped DATE;
- DECLARE vDone2 boolean;
+ DECLARE vCurrentShipped DATE;
+ DECLARE vDone2 boolean;
DECLARE cur2 CURSOR FOR
- SELECT shipped
- FROM vn.ticket
+ SELECT shipped
+ FROM vn.ticket
WHERE clientFk = vClientFk AND shipped <= util.VN_CURDATE()
ORDER BY shipped DESC;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone2 = TRUE;
SET vDone2 := FALSE;
OPEN cur2;
-
+
SET vPreviousShipped := vShipped;
LOOP2: LOOP
SET vDone2 := FALSE;
FETCH cur2 INTO vCurrentShipped;
-
+
IF DATEDIFF(vPreviousShipped,vCurrentShipped) > 365 THEN
- UPDATE bs.clientNewBorn
- SET firstShipped = vPreviousShipped
+ UPDATE bs.clientNewBorn
+ SET firstShipped = vPreviousShipped
WHERE clientFk= vClientFk;
-
+
CLOSE cur2;
- LEAVE LOOP2;
+ LEAVE LOOP2;
END IF;
-
+
SET vPreviousShipped := vCurrentShipped;
IF vDone2 THEN
- UPDATE bs.clientNewBorn
- SET firstShipped = vCurrentShipped
+ UPDATE bs.clientNewBorn
+ SET firstShipped = vCurrentShipped
WHERE clientFk= vClientFk;
CLOSE cur2;
LEAVE LOOP2;
@@ -3782,14 +3782,14 @@ BLOCK1: BEGIN
END BLOCK2;
END LOOP LOOP1;
- UPDATE bs.clientNewBorn cnb
+ UPDATE bs.clientNewBorn cnb
LEFT JOIN (SELECT DISTINCT t.clientFk
FROM vn.ticket t
JOIN vn.productionConfig pc
WHERE t.shipped BETWEEN util.VN_CURDATE() + INTERVAL -(`notBuyingMonths`) MONTH
AND util.VN_CURDATE() + INTERVAL -(`pc`.`rookieDays`) DAY) notRookie ON notRookie.clientFk = cnb.clientFk
- SET cnb.isRookie = ISNULL(notRookie.clientFk);
-
+ SET cnb.isRookie = ISNULL(notRookie.clientFk);
+
END BLOCK1 ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -3810,16 +3810,16 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `comercialesCompleto`(IN vWorker INT
BEGIN
DECLARE vAYearAgoStarted DATE DEFAULT DATE_FORMAT(TIMESTAMPADD(YEAR, - 1, vDate), '%Y-%m-01');
DECLARE vAYearAgoEnded DATE DEFAULT TIMESTAMPADD(YEAR, - 1, LAST_DAY(vDate));
-
+
CALL vn.worker_GetHierarchy(vWorker);
-
+
INSERT IGNORE INTO tmp.workerHierarchyList (workerFk)
SELECT wd2.workerFk
FROM vn.workerDepartment wd2
WHERE wd2.workerFk = vWorker;
-
+
-- Falta que en algunos casos solo tenga en cuenta los tipos afectados.
- SELECT
+ SELECT
c.Id_Cliente id_cliente,
c.Cliente cliente,
cr.recobro * 100 tarifa,
@@ -3844,7 +3844,7 @@ BEGIN
FROM
vn2008.Clientes c
LEFT JOIN
- (SELECT g.Id_Cliente, CAST( SUM(Importe) as DECIMAL(12,2)) AS Greuge
+ (SELECT g.Id_Cliente, CAST( SUM(Importe) as DECIMAL(12,2)) AS Greuge
FROM vn2008.Greuges g
JOIN vn.`client` c ON c.id = g.Id_Cliente
LEFT JOIN vn.worker w ON c.salesPersonFk = w.id
@@ -3866,14 +3866,14 @@ BEGIN
WHERE v.fecha BETWEEN TIMESTAMPADD(YEAR, - 1, vDate) AND vDate
GROUP BY v.Id_Cliente) c365 ON c365.Id_Cliente = c.Id_Cliente
LEFT JOIN
- (SELECT
+ (SELECT
Id_Cliente, SUM(importe) consumo
FROM
bs.ventas v
INNER JOIN vn2008.Clientes c USING (Id_Cliente)
LEFT JOIN vn2008.Trabajadores tr ON c.Id_Trabajador = tr.Id_Trabajador
WHERE
- (c.Id_Trabajador = vWorker OR tr.boss = vWorker)
+ (c.Id_Trabajador = vWorker OR tr.boss = vWorker)
AND (v.fecha BETWEEN TIMESTAMPADD(DAY, - DAY(vDate) + 1, vDate) AND TIMESTAMPADD(DAY, - 1, vDate))
GROUP BY Id_Cliente) mes_actual ON mes_actual.Id_Cliente = c.Id_Cliente
LEFT JOIN
@@ -3934,17 +3934,17 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `compradores_add`(IN vYear INT, IN v
BEGIN
/**
* Sustituye los registros de "bs.compradores".
- *
+ *
* @param vYear: año ventas
* @param vWeekFrom: semana desde
* @param vWeekTo: semana hasta
*/
REPLACE bs.compradores
- SELECT it.workerFk AS Id_Trabajador, vYear AS año, tm.week AS semana, SUM(importe) AS importe, 0 AS comision
+ SELECT it.workerFk AS Id_Trabajador, vYear AS año, tm.week AS semana, SUM(importe) AS importe, 0 AS comision
FROM bs.ventas v
JOIN vn.time tm ON tm.dated = v.fecha
- JOIN vn.itemType it ON it.id = v.tipo_id
- WHERE tm.year = vYear
+ JOIN vn.itemType it ON it.id = v.tipo_id
+ WHERE tm.year = vYear
AND tm.week BETWEEN vWeekFrom AND vWeekTo
AND it.categoryFk != 6
GROUP BY it.workerFk, tm.week;
@@ -3970,22 +3970,22 @@ BEGIN
DECLARE vYear INT;
DECLARE vWeek INT;
DECLARE done BOOL DEFAULT FALSE;
-
+
DECLARE rs CURSOR FOR
SELECT year, week
FROM vn.time
- WHERE dated <= util.VN_CURDATE()
- AND year = vYear
+ WHERE dated <= util.VN_CURDATE()
+ AND year = vYear
AND week >= vWeek;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
-
- SELECT MAX(año) INTO vYear
+
+ SELECT MAX(año) INTO vYear
FROM compradores;
-
+
SELECT MAX(semana) INTO vWeek
- FROM compradores
- WHERE año = vYear;
+ FROM compradores
+ WHERE año = vYear;
OPEN rs;
@@ -3994,7 +3994,7 @@ BEGIN
WHILE NOT done DO
CALL compradores_add(vYear, vWeek, vWeek);
-
+
FETCH rs INTO vYear, vWeek;
END WHILE;
@@ -4002,7 +4002,7 @@ BEGIN
CLOSE rs;
CALL compradores_evolution_add;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -4023,17 +4023,17 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `compradores_evolution_add`()
BEGIN
/**
* Inserta en la tabla compradores_evolution las ventas acumuladas en los ultimos 365 dias
- *
+ *
*/
DECLARE vDated DATE;
DECLARE vCount INT DEFAULT 1;
- SELECT MAX(fecha) + INTERVAL 1 DAY INTO vDated
+ SELECT MAX(fecha) + INTERVAL 1 DAY INTO vDated
FROM compradores_evolution;
IF vDated IS NULL THEN
-
- SELECT MIN(dated) INTO vDated
+
+ SELECT MIN(dated) INTO vDated
FROM sale;
INSERT INTO compradores_evolution(
@@ -4054,7 +4054,7 @@ BEGIN
WHILE vDated < util.VN_CURDATE() DO
SET vCount = vCount + 1;
-
+
REPLACE compradores_evolution(
Id_Trabajador,
fecha,
@@ -4066,18 +4066,18 @@ BEGIN
SELECT Id_Trabajador, importe
FROM compradores_evolution
JOIN (
- SELECT DISTINCT it.workerFk
- FROM vn.itemType it
+ SELECT DISTINCT it.workerFk
+ FROM vn.itemType it
)sub2 ON sub2.workerFk = Id_Trabajador
- WHERE fecha = vDated - INTERVAL 1 DAY
+ WHERE fecha = vDated - INTERVAL 1 DAY
UNION ALL
- SELECT it.workerFk, s.amount * IF(s.dated < vDated, -1, 1)
+ SELECT it.workerFk, s.amount * IF(s.dated < vDated, -1, 1)
FROM sale s
JOIN vn.itemType it ON it.id = s.typeFk
JOIN vn.itemCategory ic ON ic.id = it.categoryFk
WHERE s.dated IN (vDated, vDated - INTERVAL 1 YEAR)
AND ic.merchandise
- )sub
+ )sub
GROUP BY Id_Trabajador;
SET vDated = vDated + INTERVAL 1 DAY;
@@ -4104,49 +4104,49 @@ BEGIN
* Inserta en la tabla fondo_maniobra los saldos acumulados en los ultimos 365 dias
*/
DECLARE datFEC DATE DEFAULT '2015-01-01';
-
- SELECT TIMESTAMPADD(DAY,1,MAX(fecha))
- INTO datFEC
+
+ SELECT TIMESTAMPADD(DAY,1,MAX(fecha))
+ INTO datFEC
FROM bs.fondo_maniobra;
-
+
WHILE datFEC < util.VN_CURDATE() DO
-
+
IF DAY(datFEC) MOD 28 = 0 THEN -- esto solo sirve para no aburrirse mientras esperamos...
SELECT datFEC;
END IF;
-
+
REPLACE bs.fondo_maniobra(Fecha, clientes_facturas, clientes_cobros,proveedores_facturas,proveedores_pagos, fondo)
SELECT datFEC AS Fecha, Facturas, Cobros,Recibidas,Pagos, Facturas + Cobros + Recibidas + Pagos
FROM (
SELECT SUM(io.amount) AS Facturas
FROM vn.invoiceOut io
- JOIN vn.client c ON io.clientFk = c.id
+ JOIN vn.client c ON io.clientFk = c.id
WHERE c.isRelevant
- AND io.companyFk <> 1381
+ AND io.companyFk <> 1381
AND io.issued BETWEEN '2011-01-01' AND datFEC
) fac
JOIN (
SELECT - SUM(r.amountPaid) AS Cobros
- FROM vn.receipt r
- JOIN vn.client c ON r.clientFk = c.id
- WHERE c.isRelevant
+ FROM vn.receipt r
+ JOIN vn.client c ON r.clientFk = c.id
+ WHERE c.isRelevant
AND r.companyFk <> 1381
AND r.payed BETWEEN '2011-01-01' AND datFEC
) cob
JOIN (
SELECT - SUM(id.amount) AS Recibidas
- FROM vn.invoiceIn ii
- JOIN vn.invoiceInDueDay id ON ii.id = id.invoiceInFk
+ FROM vn.invoiceIn ii
+ JOIN vn.invoiceInDueDay id ON ii.id = id.invoiceInFk
WHERE ii.companyFk <> 1381
AND ii.issued BETWEEN '2015-01-01' AND datFEC
) rec
JOIN (
SELECT SUM(p.amount) AS Pagos
- FROM vn.payment p
- WHERE p.companyFk <>1381
+ FROM vn.payment p
+ WHERE p.companyFk <>1381
AND p.received BETWEEN '2015-01-01' AND datFEC
) pag;
-
+
UPDATE bs.fondo_maniobra
JOIN (
SELECT AVG(fondo) AS media
@@ -4154,7 +4154,7 @@ BEGIN
WHERE fecha <= datFEC
) sub
SET fondo_medio = media WHERE fecha = datFEC;
-
+
SET datFEC = TIMESTAMPADD(DAY,1,datFEC);
END WHILE;
@@ -4178,7 +4178,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `fruitsEvolution`()
BEGIN
-select Id_Cliente,
+select Id_Cliente,
Cliente, count(semana) as semanas, (w.code IS NOT NULL) isWorker
from (
select distinct v.Id_Cliente, c.name as Cliente, week(fecha, 3) as semana
@@ -4219,40 +4219,40 @@ BEGIN
-- Ventas totales del ultimo año
UPDATE indicators
- SET lastYearSales =
+ SET lastYearSales =
(SELECT SUM(importe + recargo)
FROM ventas v
JOIN vn2008.empresa e ON e.id = v.empresa_id
JOIN vn2008.empresa_grupo eg ON eg.empresa_grupo_id = e.empresa_grupo
WHERE fecha BETWEEN oneYearBefore AND vDated
AND eg.grupo = 'Verdnatura'
- )
+ )
WHERE updated = vDated;
-
+
-- Greuge total acumulado
UPDATE indicators
- SET totalGreuge =
+ SET totalGreuge =
(SELECT SUM(amount)
FROM vn.greuge
WHERE shipped <= vDated
- )
+ )
WHERE updated = vDated;
-- Tasa de morosidad con respecto a las ventas del último mes
UPDATE indicators
- SET latePaymentRate =
- (SELECT SUM(amount)
- FROM bi.defaulters
+ SET latePaymentRate =
+ (SELECT SUM(amount)
+ FROM bi.defaulters
WHERE date = vDated AND amount > 0)
/
- (SELECT SUM(importe + recargo)
- FROM ventas
+ (SELECT SUM(importe + recargo)
+ FROM ventas
WHERE fecha BETWEEN oneMonthBefore AND vDated)
WHERE updated = vDated;
-- Número de trabajadores activos
UPDATE indicators
- SET countEmployee =
+ SET countEmployee =
(SELECT CAST(SUM(ct.hoursWeek) / 40 AS DECIMAL (10, 2))
FROM vn.business b
JOIN vn.calendarType ct ON ct.id = b.calendarTypeFk
@@ -4271,7 +4271,7 @@ BEGIN
-- Número de clientes que han comprado en los últimos 30 dias
UPDATE indicators
- SET lastMonthActiveClients =
+ SET lastMonthActiveClients =
(SELECT COUNT(DISTINCT t.clientFk)
FROM vn.ticket t
WHERE t.shipped BETWEEN oneMonthBefore AND vDated
@@ -4280,9 +4280,9 @@ BEGIN
-- Número de clientes que no han comprado en los últimos 30 dias, pero compraron en los 30 anteriores
UPDATE indicators
- SET lastMonthLostClients =
+ SET lastMonthLostClients =
(SELECT COUNT(lm.clientFk)
- FROM
+ FROM
(SELECT DISTINCT t.clientFk
FROM vn.ticket t
WHERE t.shipped BETWEEN oneMonthBefore AND vDated
@@ -4299,9 +4299,9 @@ BEGIN
-- Número de clientes que han comprado en los últimos 30 dias, pero no compraron en los 30 anteriores
UPDATE indicators
- SET lastMonthNewClients =
+ SET lastMonthNewClients =
(SELECT COUNT(cm.clientFk)
- FROM
+ FROM
(SELECT DISTINCT t.clientFk
FROM vn.ticket t
WHERE t.shipped BETWEEN oneMonthBefore AND vDated
@@ -4327,7 +4327,7 @@ BEGIN
-- Cálculo de las ventas agrupado por semanas
SELECT week INTO vWeek
- FROM vn.time
+ FROM vn.time
WHERE dated = vDated;
TRUNCATE salesByWeek;
@@ -4341,12 +4341,12 @@ BEGIN
-- Indicador Ventas semana actual
UPDATE indicators i
- JOIN salesByWeek s ON s.week= vWeek
+ JOIN salesByWeek s ON s.week= vWeek
AND s.year = YEAR(vDated)
SET i.thisWeekSales = s.sales
WHERE updated = vDated;
- -- Indicador ventas semana actual en el año pasado
+ -- Indicador ventas semana actual en el año pasado
UPDATE indicators i
JOIN salesByWeek s ON s.week = vWeek
AND s.year = YEAR(vDated)-1
@@ -4377,15 +4377,15 @@ BEGIN
SELECT IFNULL(TIMESTAMPADD(DAY,1,MAX(updated)), '2018-04-01')
INTO vDated
FROM bs.indicators;
-
+
WHILE vDated < util.VN_CURDATE() DO
-
+
CALL indicatorsUpdate(vDated);
-
+
SELECT TIMESTAMPADD(DAY,1,MAX(updated))
INTO vDated
FROM bs.indicators;
-
+
END WHILE;
END ;;
@@ -4414,7 +4414,7 @@ BEGIN
DECLARE vCalc INT;
DECLARE vWarehouseFk INT;
- DECLARE cWarehouses CURSOR FOR
+ DECLARE cWarehouses CURSOR FOR
SELECT id
FROM vn.warehouse
WHERE isInventory;
@@ -4427,13 +4427,13 @@ BEGIN
read_loop: LOOP
SET vDone = FALSE;
FETCH cWarehouses INTO vWarehouseFk;
-
+
IF vDone THEN
LEAVE read_loop;
END IF;
-
+
CALL cache.visible_refresh(vCalc, FALSE, vWarehouseFk);
-
+
CREATE OR REPLACE TEMPORARY TABLE tVisible
SELECT itemFk, SUM(visible) totalVisible
FROM vn.itemShelving ish
@@ -4442,7 +4442,7 @@ BEGIN
JOIN vn.sector sc ON sc.id = p.sectorFk
WHERE sc.warehouseFk = vWarehouseFk
GROUP BY itemFk;
-
+
INSERT INTO inventoryDiscrepancyDetail(
warehouseFk,
itemFk,
@@ -4514,15 +4514,15 @@ BEGIN
DECLARE datSTART DATE;
DECLARE datEND DATE;
-
+
SELECT TIMESTAMPADD(WEEK, -1,MAX(fecha)) INTO datSTART
FROM bs.m3;
-
+
SET datEND = TIMESTAMPADD(DAY,-1,util.VN_CURDATE());
-
- DELETE FROM bs.m3
+
+ DELETE FROM bs.m3
WHERE fecha >= datSTART;
-
+
INSERT INTO bs.m3 (fecha, provinceFk, warehouseFk, m3, year, month, week, day, dayName, euros)
SELECT v.fecha, a.provinceFk, t.warehouseFk, sum(s.quantity * ic.cm3delivery) / 1000000 AS m3,
tm.year, tm.month, tm.week, tm.day, dayname(v.fecha), sum(importe)
@@ -4565,51 +4565,51 @@ BEGIN
DECLARE vManaBankId INT;
DECLARE vManaGreugeTypeId INT;
- SELECT id INTO vManaId
+ SELECT id INTO vManaId
FROM vn.component WHERE code = 'mana';
-
- SELECT id INTO vManaAutoId
+
+ SELECT id INTO vManaAutoId
FROM vn.component WHERE code = 'autoMana';
-
+
SELECT id INTO vClaimManaId
FROM vn.component WHERE code = 'manaClaim';
-
- SELECT id INTO vManaBankId
+
+ SELECT id INTO vManaBankId
FROM vn.bank WHERE code = 'mana';
-
- SELECT id INTO vManaGreugeTypeId
+
+ SELECT id INTO vManaGreugeTypeId
FROM vn.greugeType WHERE code = 'mana';
SELECT IFNULL(MAX(dated), '2016-01-01')
- INTO vFromDated
+ INTO vFromDated
FROM vn.clientManaCache;
-
+
DELETE
FROM vn.clientManaCache
WHERE dated = vFromDated;
SELECT IFNULL(MAX(dated), '2016-01-01')
- INTO vFromDated
+ INTO vFromDated
FROM vn.clientManaCache;
WHILE timestampadd(DAY,30,vFromDated) < util.VN_CURDATE() DO
SELECT
timestampadd(DAY,30,vFromDated),
- timestampadd(DAY,-90,vFromDated)
- INTO
+ timestampadd(DAY,-90,vFromDated)
+ INTO
vToDated,
vForDeleteDated;
-
+
DELETE FROM vn.clientManaCache
WHERE dated <= vForDeleteDated;
INSERT INTO vn.clientManaCache(clientFk, mana, dated)
- SELECT
+ SELECT
Id_Cliente,
cast(sum(mana) as decimal(10,2)) as mana,
- vToDated as dated
- FROM
+ vToDated as dated
+ FROM
(
SELECT cs.Id_Cliente, Cantidad * Valor as mana
FROM vn2008.Tickets t
@@ -4617,20 +4617,20 @@ BEGIN
JOIN vn2008.Movimientos m on m.Id_Ticket = t.Id_Ticket
JOIN vn2008.Movimientos_componentes mc on mc.Id_Movimiento = m.Id_Movimiento
WHERE Id_Componente IN (vManaAutoId, vManaId, vClaimManaId)
- AND t.Fecha > vFromDated
+ AND t.Fecha > vFromDated
AND date(t.Fecha) <= vToDated
UNION ALL
SELECT r.Id_Cliente, - Entregado
FROM vn2008.Recibos r
WHERE Id_Banco = vManaBankId
- AND Fechacobro > vFromDated
+ AND Fechacobro > vFromDated
AND Fechacobro <= vToDated
-
+
UNION ALL
SELECT g.Id_Cliente, g.Importe
FROM vn2008.Greuges g
WHERE Greuges_type_id = vManaGreugeTypeId
- AND Fecha > vFromDated
+ AND Fecha > vFromDated
AND Fecha <= vToDated
UNION ALL
SELECT clientFk, mana
@@ -4641,7 +4641,7 @@ BEGIN
HAVING Id_Cliente;
SET vFromDated = vToDated;
-
+
END WHILE;
END ;;
@@ -4662,22 +4662,22 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `manaSpellers_actualize`()
BEGIN
-/**
- * Recalcula el valor del campo con el modificador de precio
+/**
+ * Recalcula el valor del campo con el modificador de precio
* para el componente de maná automático.
*/
- UPDATE vn.workerMana wm
+ UPDATE vn.workerMana wm
JOIN (
- SELECT c.lastSalesPersonFk,
+ SELECT c.lastSalesPersonFk,
FLOOR(SUM(s.amount) / 12) amount
FROM salesByclientSalesPerson s
JOIN vn.client c ON c.id = s.clientFk
WHERE s.dated BETWEEN util.VN_CURDATE() - INTERVAL 1 YEAR AND util.VN_CURDATE()
GROUP BY c.lastSalesPersonFk
- )avgPortfolioWeight ON avgPortfolioWeight.lastSalesPersonFk = wm.workerFk
+ )avgPortfolioWeight ON avgPortfolioWeight.lastSalesPersonFk = wm.workerFk
JOIN vn.salespersonConfig spc
SET wm.pricesModifierRate = GREATEST(
- spc.manaMinRate,
+ spc.manaMinRate,
LEAST(spc.manaMaxRate, ROUND( - wm.amount / avgPortfolioWeight.amount)));
END ;;
DELIMITER ;
@@ -4710,8 +4710,8 @@ BEGIN
DECLARE vId INT;
DECLARE rs CURSOR FOR
- SELECT id, `schema`, `procedure`
- FROM nightTask
+ SELECT id, `schema`, `procedure`
+ FROM nightTask
WHERE finished <= util.VN_CURDATE()
OR finished IS NULL
ORDER BY `order`;
@@ -4744,7 +4744,7 @@ BEGIN
vError,
vErrorCode
);
-
+
IF vError IS NOT NULL THEN
SET vNErrors = vNErrors + 1;
@@ -4814,7 +4814,7 @@ BEGIN
vError = MESSAGE_TEXT,
vErrorCode = RETURNED_SQLSTATE;
- CALL util.exec(CONCAT('CALL `', vSchema ,'`.`', vProcedure ,'`'));
+ CALL util.exec(CONCAT('CALL `', vSchema ,'`.`', vProcedure ,'`'));
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -4833,22 +4833,22 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `payMethodClientAdd`()
BEGIN
- INSERT IGNORE INTO `bs`.`payMethodClient` (dated, payMethodFk, clientFk)
+ INSERT IGNORE INTO `bs`.`payMethodClient` (dated, payMethodFk, clientFk)
SELECT util.VN_CURDATE(), c.payMethodFk, c.id
- FROM vn.client c
+ FROM vn.client c
JOIN vn.payMethod p ON c.payMethodFk = p.id;
-
+
TRUNCATE `bs`.`payMethodClientEvolution` ;
-
+
INSERT INTO `bs`.`payMethodClientEvolution` (dated, payMethodName, amountClient, amount, equalizationTax)
- SELECT p.dated, pm.name, COUNT(p.clientFk), SUM(sub.importe) , SUM(sub.recargo)
+ SELECT p.dated, pm.name, COUNT(p.clientFk), SUM(sub.importe) , SUM(sub.recargo)
FROM bs.payMethodClient p
- JOIN (SELECT SUM(v.importe) AS importe, SUM(v.recargo) as recargo, v.fecha, v.Id_cliente
+ JOIN (SELECT SUM(v.importe) AS importe, SUM(v.recargo) as recargo, v.fecha, v.Id_cliente
FROM bs.ventas v
WHERE v.fecha>= (SELECT MIN(dated) FROM bs. payMethodClient)
GROUP BY v.Id_cliente, v.fecha) sub ON sub.fecha = p.dated AND sub.Id_cliente = p.ClientFk
JOIN vn.payMethod pm ON p.payMethodFk = pm.id
- GROUP BY dated,payMethodFk;
+ GROUP BY dated,payMethodFk;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -4868,12 +4868,12 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `saleGraphic`(IN vItemFk INT, IN vTypeFk INT, IN vCategoryFk INT, IN vFromDate DATE,
IN vToDate DATE, IN vProducerFk INT)
BEGIN
-
+
DECLARE vFromDateLastYear DATE;
DECLARE vToDateLastYear DATE;
DECLARE vFromDateTwoYearsAgo DATE;
DECLARE vToDateTwoYearsAgo DATE;
-
+
SET vItemFk = IFNULL(vItemFk,0);
SET vTypeFk = IFNULL(vTypeFk, 0);
SET vCategoryFk = IFNULL(vCategoryFk,0);
@@ -4888,19 +4888,19 @@ BEGIN
SELECT s.quantity, CAST(v.importe AS DECIMAL(10,0)) importe, v.fecha
FROM bs.ventas v
- JOIN vn.sale s ON s.id = v.Id_Movimiento
- JOIN vn.item i ON i.id = s.itemFk
- JOIN vn.itemType it ON it.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = it.categoryFk
+ JOIN vn.sale s ON s.id = v.Id_Movimiento
+ JOIN vn.item i ON i.id = s.itemFk
+ JOIN vn.itemType it ON it.id = i.typeFk
+ JOIN vn.itemCategory ic ON ic.id = it.categoryFk
WHERE vItemFk IN (i.id, 0)
AND vTypeFk IN (i.typeFk, 0)
AND vCategoryFk IN (it.categoryFk, 0)
AND vProducerFk IN (i.producerFk, 0)
AND (v.fecha BETWEEN vFromDate AND vToDate
OR v.fecha BETWEEN vFromDateLastYear AND vToDateLastYear
- OR v.fecha BETWEEN vFromDateTwoYearsAgo AND vToDateTwoYearsAgo
+ OR v.fecha BETWEEN vFromDateTwoYearsAgo AND vToDateTwoYearsAgo
);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -4919,21 +4919,21 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `salePersonEvolutionAdd`(IN vDateStart DATETIME)
BEGIN
- DELETE FROM bs.salePersonEvolution
+ DELETE FROM bs.salePersonEvolution
WHERE dated <= DATE_SUB(util.VN_CURDATE(), INTERVAL 1 YEAR);
-
-
+
+
INSERT INTO bs.salePersonEvolution (dated, amount, equalizationTax, salesPersonFk)
- SELECT fecha dated,
- CAST(SUM(importe) AS DECIMAL(10,2) ) amount,
+ SELECT fecha dated,
+ CAST(SUM(importe) AS DECIMAL(10,2) ) amount,
CAST(SUM(recargo) AS DECIMAL(10,2) ) equalizationTax ,
IFNULL(salesPersonFk,0) salesPersonFk
FROM bs.ventas v
- JOIN vn.client c ON v.Id_Cliente = c.id
+ JOIN vn.client c ON v.Id_Cliente = c.id
JOIN vn.company co ON co.id = v.empresa_id
WHERE co.code = "VNL" AND fecha >= vDateStart
GROUP BY v.fecha,c.salesPersonFk
- ORDER BY salesPersonFk,dated ASC;
+ ORDER BY salesPersonFk,dated ASC;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -4955,7 +4955,7 @@ BEGIN
/**
* Agrupa las ventas por cliente/comercial/fecha en la tabla bs.salesByclientSalesPerson
* El asociación cliente/comercial/fecha, se mantiene correcta en el tiempo
- *
+ *
* @param vDatedFrom el cálculo se realizará desde la fecha introducida hasta ayer
*/
@@ -4963,17 +4963,17 @@ BEGIN
SET vDatedFrom = util.VN_CURDATE() - INTERVAL 1 MONTH;
END IF;
- UPDATE salesByclientSalesPerson
+ UPDATE salesByclientSalesPerson
SET amount = 0,
equalizationTax = 0,
amountNewBorn = 0
WHERE dated BETWEEN vDatedFrom AND util.yesterday();
-
- INSERT INTO salesByclientSalesPerson(
- dated,
- salesPersonFk,
- clientFk,
- amount,
+
+ INSERT INTO salesByclientSalesPerson(
+ dated,
+ salesPersonFk,
+ clientFk,
+ amount,
equalizationTax)
SELECT s.dated,
c.salesPersonFk,
@@ -4982,7 +4982,7 @@ BEGIN
SUM(s.surcharge)
FROM sale s
JOIN vn.client c on s.clientFk = c.id
- WHERE s.dated BETWEEN vDatedFrom AND util.yesterday()
+ WHERE s.dated BETWEEN vDatedFrom AND util.yesterday()
GROUP BY s.dated, c.salesPersonFk, s.clientFk
ON DUPLICATE KEY UPDATE amount= VALUES(amount),
equalizationTax= VALUES(equalizationTax);
@@ -5156,8 +5156,8 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `salesByItemTypeDay_addLauncher`()
-BEGIN
- CALL bs.salesByItemTypeDay_add(util.VN_CURDATE() - INTERVAL 30 DAY, util.VN_CURDATE());
+BEGIN
+ CALL bs.salesByItemTypeDay_add(util.VN_CURDATE() - INTERVAL 30 DAY, util.VN_CURDATE());
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -5177,35 +5177,35 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `salesPersonEvolution_add`()
BEGIN
/**
- * Calcula los datos para los gráficos de evolución agrupado por salesPersonFk y día.
+ * Calcula los datos para los gráficos de evolución agrupado por salesPersonFk y día.
* Recalcula automáticamente los 3 últimos meses para comprobar si hay algún cambio.
*/
DECLARE vDated DATE;
DECLARE vCont INT DEFAULT 1;
- SELECT MAX(dated) - INTERVAL 3 MONTH INTO vDated
+ SELECT MAX(dated) - INTERVAL 3 MONTH INTO vDated
FROM salesPersonEvolution;
- DELETE FROM salesPersonEvolution
+ DELETE FROM salesPersonEvolution
WHERE dated >= vDated;
IF ISNULL(vDated) THEN
- SELECT MIN(dated) INTO vDated
+ SELECT MIN(dated) INTO vDated
FROM salesByclientSalesPerson;
-
+
INSERT INTO salesPersonEvolution(
- salesPersonFk,
- dated,
- amount,
- equalizationTax,
+ salesPersonFk,
+ dated,
+ amount,
+ equalizationTax,
amountNewBorn
)
- SELECT salesPersonFk,
- dated,
- amount,
- equalizationTax,
+ SELECT salesPersonFk,
+ dated,
+ amount,
+ equalizationTax,
amountNewBorn
- FROM salesByclientSalesPerson
+ FROM salesByclientSalesPerson
WHERE dated = vDated
GROUP BY salesPersonFk;
@@ -5213,21 +5213,21 @@ BEGIN
END IF;
WHILE vDated < util.VN_CURDATE() DO
-
+
SET vCont = vCont + 1;
REPLACE salesPersonEvolution(salesPersonFk, dated, amount)
SELECT salesPersonFk, vDated, amount
FROM(SELECT salesPersonFk, SUM(amount) amount
FROM(SELECT salesPersonFk, amount
- FROM salesPersonEvolution
+ FROM salesPersonEvolution
WHERE dated = vDated - INTERVAL 1 DAY
UNION ALL
- SELECT salesPersonFk, amount
- FROM salesByclientSalesPerson
+ SELECT salesPersonFk, amount
+ FROM salesByclientSalesPerson
WHERE dated = vDated
UNION ALL
SELECT salesPersonFk, - amount
- FROM salesByclientSalesPerson
+ FROM salesByclientSalesPerson
WHERE dated = vDated - INTERVAL 1 YEAR
)sub
GROUP BY salesPersonFk
@@ -5256,7 +5256,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `vendedores_add_launcher`()
BEGIN
CALL bs.salesByclientSalesPerson_add(util.VN_CURDATE()- INTERVAL 45 DAY);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -5280,7 +5280,7 @@ BEGIN
/**
* Añade las ventas que se realizaron entre
* vStarted y vEnded
-*
+*
* @param vStarted Fecha de inicio
* @param vEnded Fecha de finalizacion
*
@@ -5288,7 +5288,7 @@ BEGIN
DECLARE vStartingDate DATETIME;
DECLARE vEndingDate DATETIME;
- IF vStarted < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE())
+ IF vStarted < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE())
OR vEnded < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE()) THEN
CALL util.throw('fechaDemasiadoAntigua');
END IF;
@@ -5297,8 +5297,8 @@ BEGIN
SET vStartingDate = vStarted ;
SET vEndingDate = util.dayEnd(vStartingDate);
- DELETE
- FROM sale
+ DELETE
+ FROM sale
WHERE dated BETWEEN vStartingDate AND vEnded;
WHILE vEndingDate <= vEnded DO
@@ -5319,28 +5319,28 @@ BEGIN
JOIN vn.itemType it ON it.id = i.typeFk
JOIN vn.itemCategory ic ON ic.id = it.categoryFk
JOIN vn.ticket t ON t.id = s.ticketFk
- JOIN vn.address a ON a.id = t.addressFk
+ JOIN vn.address a ON a.id = t.addressFk
JOIN vn.client cl ON cl.id = a.clientFk
WHERE t.shipped BETWEEN vStartingDate AND vEndingDate
AND s.quantity <> 0
AND s.discount <> 100
- AND ic.merchandise
+ AND ic.merchandise
GROUP BY sc.saleFk
HAVING IFNULL(importe,0) <> 0 OR IFNULL(recargo,0) <> 0;
UPDATE sale s
JOIN (
- SELECT s.id,
+ SELECT s.id,
SUM(s.quantity * sc.value ) margen,
s.quantity * s.price * (100 - s.discount ) / 100 pvp
FROM vn.sale s
- JOIN vn.ticket t ON t.id = s.ticketFk
+ JOIN vn.ticket t ON t.id = s.ticketFk
JOIN vn.saleComponent sc ON sc.saleFk = s.id
- JOIN vn.component c ON c.id = sc.componentFk
- JOIN vn.componentType ct ON ct.id = c.typeFk
+ JOIN vn.component c ON c.id = sc.componentFk
+ JOIN vn.componentType ct ON ct.id = c.typeFk
WHERE t.shipped BETWEEN vStartingDate AND vEndingDate
AND ct.isMargin = TRUE
- GROUP BY s.id) sub ON sub.id = s.saleFk
+ GROUP BY s.id) sub ON sub.id = s.saleFk
SET s.margin = sub.margen + s.amount + s.surcharge - sub.pvp;
SET vStartingDate = TIMESTAMPADD(DAY,1, vStartingDate);
@@ -5368,7 +5368,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_add_launcher`()
BEGIN
/**
* Añade las ventas a la tabla bs.sale que se realizaron desde hace un mes hasta hoy
- *
+ *
*/
DECLARE vCurDate DATE DEFAULT util.VN_CURDATE();
@@ -5392,7 +5392,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_contables_add`(IN vYear INT, IN vMonth INT)
BEGIN
-
+
/**
* Reemplaza las ventas contables del último año.
* Es el origen de datos para el balance de Entradas
@@ -5404,8 +5404,8 @@ BEGIN
DECLARE TIPO_PATRIMONIAL INT DEFAULT 188;
- DELETE FROM bs.ventas_contables
- WHERE year = vYear
+ DELETE FROM bs.ventas_contables
+ WHERE year = vYear
AND month = vMonth;
DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list;
@@ -5416,7 +5416,7 @@ BEGIN
FROM vn2008.Tickets t
JOIN vn2008.Facturas f ON f.Id_Factura = t.Factura
WHERE year(f.Fecha) = vYear
- AND month(f.Fecha) = vMonth;
+ AND month(f.Fecha) = vMonth;
INSERT INTO bs.ventas_contables(year
, month
@@ -5426,7 +5426,7 @@ BEGIN
, tipo_id
, empresa_id
, gasto)
-
+
SELECT vYear
, vMonth
, round(sum(Cantidad * Preu * (100 - m.Descuento)/100))
@@ -5438,13 +5438,13 @@ BEGIN
, tp.reino_id
, a.tipo_id
, t.empresa_id
- , 7000000000
+ , 7000000000
+ IF(e.empresa_grupo = e2.empresa_grupo
,1
,IF(e2.empresa_grupo,2,0)
- ) * 1000000
+ ) * 1000000
+ tp.reino_id * 10000 as Gasto
- FROM vn2008.Movimientos m
+ FROM vn2008.Movimientos m
JOIN vn2008.Tickets t on t.Id_Ticket = m.Id_Ticket
JOIN vn2008.Consignatarios cs on cs.Id_Consigna = t.Id_Consigna
JOIN vn2008.Clientes c on c.Id_Cliente = cs.Id_Cliente
@@ -5458,7 +5458,7 @@ BEGIN
AND m.Descuento <> 100
AND a.tipo_id != TIPO_PATRIMONIAL
GROUP BY grupo, reino_id, tipo_id, empresa_id, Gasto;
-
+
INSERT INTO bs.ventas_contables(year
, month
, venta
@@ -5477,17 +5477,17 @@ BEGIN
) as grupo
, NULL
, NULL
- , t.companyFk
+ , t.companyFk
, 7050000000
- FROM vn.ticketService ts
+ FROM vn.ticketService ts
JOIN vn.ticket t ON ts.ticketFk = t.id
- JOIN vn.address a on a.id = t.addressFk
- JOIN vn.client cl on cl.id = a.clientFk
+ JOIN vn.address a on a.id = t.addressFk
+ JOIN vn.client cl on cl.id = a.clientFk
JOIN tmp.ticket_list tt on tt.Id_Ticket = t.id
- JOIN vn.company c on c.id = t.companyFk
+ JOIN vn.company c on c.id = t.companyFk
LEFT JOIN vn.company c2 on c2.clientFk = cl.id
- GROUP BY grupo, t.companyFk ;
-
+ GROUP BY grupo, t.companyFk ;
+
DROP TEMPORARY TABLE tmp.ticket_list;
END ;;
DELIMITER ;
@@ -5507,13 +5507,13 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_contables_add_launcher`()
BEGIN
-
+
/**
* Reemplaza las ventas contables del último año.
* Es el origen de datos para el balance de Entradas
*
**/
-
+
CALL bs.ventas_contables_add(YEAR(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())), MONTH(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())));
END ;;
@@ -5534,12 +5534,12 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_contables_por_cliente`(IN vYear INT, IN vMonth INT)
BEGIN
-
+
/**
* Muestra las ventas (€) de cada cliente
* dependiendo del año
*/
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list;
CREATE TEMPORARY TABLE tmp.ticket_list
@@ -5548,8 +5548,8 @@ BEGIN
FROM vn2008.Tickets t
JOIN vn2008.Facturas f ON f.Id_Factura = t.Factura
WHERE year(f.Fecha) = vYear
- AND month(f.Fecha) = vMonth;
-
+ AND month(f.Fecha) = vMonth;
+
SELECT vYear Año,
vMonth Mes,
t.Id_Cliente,
@@ -5559,7 +5559,7 @@ BEGIN
IF(e2.empresa_grupo,2,0))
AS grupo,
t.empresa_id empresa
- FROM vn2008.Movimientos m
+ FROM vn2008.Movimientos m
JOIN vn2008.Tickets t ON t.Id_Ticket = m.Id_Ticket
JOIN vn2008.Consignatarios cs ON cs.Id_Consigna = t.Id_Consigna
JOIN vn2008.Clientes c ON c.Id_Cliente = cs.Id_Cliente
@@ -5573,9 +5573,9 @@ BEGIN
AND m.Descuento <> 100
AND a.tipo_id != 188
GROUP BY t.Id_Cliente, grupo,t.empresa_id;
-
+
DROP TEMPORARY TABLE tmp.ticket_list;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -5594,7 +5594,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `vivosMuertos`()
BEGIN
-
+
/**
* Devuelve el número de clientes nuevos y muertos,
* dependiendo de la fecha actual.
@@ -5605,9 +5605,9 @@ BEGIN
SET @datSTART = TIMESTAMPADD(YEAR,-2,util.VN_CURDATE());
SET @datEND = TIMESTAMPADD(DAY,-DAY(util.VN_CURDATE()),util.VN_CURDATE());
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.VivosMuertos;
-
+
CREATE TEMPORARY TABLE tmp.VivosMuertos
SELECT c.Id_Cliente, tm.yearMonth, f.Compra, 0 as Nuevo, 0 as Muerto
FROM vn2008.Clientes c
@@ -5623,10 +5623,10 @@ BEGIN
WHERE Fecha BETWEEN @datSTART
AND @datEND) f ON f.yearMonth = tm.yearMonth
AND f.Id_Cliente = c.Id_Cliente;
-
+
UPDATE tmp.VivosMuertos vm
JOIN
- (SELECT MIN(tm.yearMonth) firstMonth, f.Id_Cliente
+ (SELECT MIN(tm.yearMonth) firstMonth, f.Id_Cliente
FROM vn2008.Facturas f
JOIN vn2008.time tm ON tm.date = f.Fecha
WHERE Fecha BETWEEN @datSTART AND @datEND
@@ -5634,9 +5634,9 @@ BEGIN
AND fm.Id_Cliente = vm.Id_Cliente
SET Nuevo = 1;
-
+
SELECT max(yearMonth) INTO @lastYearMonth FROM tmp.VivosMuertos;
-
+
UPDATE tmp.VivosMuertos vm
JOIN (
SELECT MAX(tm.yearMonth) firstMonth, f.Id_Cliente
@@ -5677,23 +5677,23 @@ BEGIN
INTO vWeek, vYear
FROM vn.time
WHERE dated = util.VN_CURDATE();
-
+
REPLACE bs.waste
SELECT *, 100 * mermas / total as porcentaje
FROM (
- SELECT buyer,
- year,
+ SELECT buyer,
+ year,
week,
family,
itemFk,
itemTypeFk,
- floor(sum(value)) as total,
+ floor(sum(value)) as total,
floor(sum(IF(clientTypeFk = 'loses', value, 0))) as mermas
- FROM vn.saleValue
+ FROM vn.saleValue
where year = vYear and week = vWeek
-
+
GROUP BY family, itemFk
-
+
) sub
ORDER BY mermas DESC;
END ;;
@@ -5725,56 +5725,56 @@ BEGIN
DECLARE vDateEnded DATE;
DECLARE vCursor CURSOR FOR
- SELECT util.firstDayOfMonth(t.dated), LAST_DAY(t.dated)
+ SELECT util.firstDayOfMonth(t.dated), LAST_DAY(t.dated)
FROM vn.time t
WHERE t.dated BETWEEN vDateStarted AND vDateEnded
- GROUP BY year,month;
+ GROUP BY year,month;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
IF DAY(util.VN_CURDATE()) = 21 THEN
-
+
SELECT util.firstDayOfMonth(DATE_SUB(util.VN_CURDATE(), INTERVAL 12 MONTH)),
LAST_DAY(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH))
- INTO vDateStarted,
+ INTO vDateStarted,
vDateEnded;
-
- DELETE FROM workerLabourDataByMonth
+
+ DELETE FROM workerLabourDataByMonth
WHERE CONCAT(`year`, '-',`month`, '-01') BETWEEN vDateStarted AND vDateEnded;
OPEN vCursor;
l: LOOP
SET vDone = FALSE;
-
+
FETCH vCursor INTO vFristDay, vLastDay;
-
+
IF vDone THEN
LEAVE l;
END IF;
-
+
-- Altas periodo
- INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
- SELECT 'hiring', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
+ INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
+ SELECT 'hiring', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
FROM vn.business b
JOIN vn.workCenter wc ON wc.id = b.workCenterFk
JOIN vn.worker w ON w.id = b.workerFk
LEFT JOIN vn.workerBusinessType wbt ON wbt.id = b.workerBusinessTypeFk
LEFT JOIN (SELECT b.id, b.workerFk
FROM vn.business b
- LEFT JOIN (SELECT ended, workerFk FROM vn.business) wl
+ LEFT JOIN (SELECT ended, workerFk FROM vn.business) wl
ON wl.ended = DATE_SUB(b.started, INTERVAL 1 DAY) AND wl.workerFk = b.workerFk
- WHERE b.started BETWEEN vFristDay AND vLastDay AND wl.ended
+ WHERE b.started BETWEEN vFristDay AND vLastDay AND wl.ended
)sub ON sub.workerFk = b.workerFk
WHERE wc.payrollCenterFk IS NOT NULL
AND b.workCenterFk IS NOT NULL
AND b.started BETWEEN vFristDay AND vLastDay
AND sub.workerFk IS NULL
- AND NOT w.isFreelance;
+ AND NOT w.isFreelance;
-- Bajas periodo
- INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
- SELECT 'layoffs', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
+ INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
+ SELECT 'layoffs', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
FROM vn.business b
JOIN vn.worker w ON w.id = b.workerFk
JOIN vn.workCenter wc ON wc.id = b.workCenterFk
@@ -5785,12 +5785,12 @@ BEGIN
AND b.ended BETWEEN vFristDay AND vLastDay
AND wl.started IS NULL
AND NOT w.isFreelance;
-
+
-- Anterior al periodo
SET vLastDay = LAST_DAY(DATE_SUB(vFristDay, INTERVAL 1 DAY));
- INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
- SELECT 'staff', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
+ INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
+ SELECT 'staff', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
FROM vn.business b
JOIN vn.worker w ON w.id = b.workerFk
JOIN vn.workCenter wc ON wc.id = b.workCenterFk
@@ -5800,8 +5800,8 @@ BEGIN
AND NOT w.isFreelance;
-- Discapacidad
- INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
- SELECT 'disabled', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
+ INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent)
+ SELECT 'disabled', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent)
FROM vn.business b
JOIN vn.worker w ON w.id = b.workerFk
JOIN vn.workCenter wc ON wc.id = b.workCenterFk
@@ -6210,7 +6210,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `addressFriendship_Update`()
BEGIN
- REPLACE cache.addressFriendship
+ REPLACE cache.addressFriendship
SELECT addressFk1, addressFk2, count(*) friendship
FROM
(
@@ -6221,7 +6221,7 @@ BEGIN
AND t2.shipped >= TIMESTAMPADD(MONTH,-3,util.VN_CURDATE())
AND t.addressFk != t2.addressFk) sub
GROUP BY addressFk1, addressFk2;
-
+
REPLACE cache.zoneAgencyFriendship
SELECT r.agencyModeFk, t.zoneFk, count(*) friendship
FROM vn.route r
@@ -6395,12 +6395,12 @@ BEGIN
FROM available a
LEFT JOIN tCalc c ON c.id = a.calc_id
WHERE c.id IS NULL;
-
+
DELETE a
FROM availableNoRaids a
LEFT JOIN tCalc c ON c.id = a.calc_id
WHERE c.id IS NULL;
-
+
DROP TEMPORARY TABLE tCalc;
END ;;
DELIMITER ;
@@ -6579,27 +6579,27 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `cache_calc_end`(IN `v_calc` INT)
-BEGIN
- DECLARE v_cache_name VARCHAR(255);
- DECLARE v_params VARCHAR(255);
-
- -- Libera el bloqueo y actualiza la fecha de ultimo refresco.
-
- UPDATE cache_calc cc JOIN cache c ON c.id = cc.cache_id
- SET
- cc.last_refresh = NOW(),
- cc.expires = ADDTIME(NOW(), c.lifetime),
- cc.connection_id = NULL
- WHERE cc.id = v_calc;
-
- SELECT c.name, ca.params INTO v_cache_name, v_params
- FROM cache c
- JOIN cache_calc ca ON c.id = ca.cache_id
- WHERE ca.id = v_calc;
-
- IF v_cache_name IS NOT NULL THEN
- DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, '')));
- END IF;
+BEGIN
+ DECLARE v_cache_name VARCHAR(255);
+ DECLARE v_params VARCHAR(255);
+
+ -- Libera el bloqueo y actualiza la fecha de ultimo refresco.
+
+ UPDATE cache_calc cc JOIN cache c ON c.id = cc.cache_id
+ SET
+ cc.last_refresh = NOW(),
+ cc.expires = ADDTIME(NOW(), c.lifetime),
+ cc.connection_id = NULL
+ WHERE cc.id = v_calc;
+
+ SELECT c.name, ca.params INTO v_cache_name, v_params
+ FROM cache c
+ JOIN cache_calc ca ON c.id = ca.cache_id
+ WHERE ca.id = v_calc;
+
+ IF v_cache_name IS NOT NULL THEN
+ DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, '')));
+ END IF;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -6617,89 +6617,89 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `cache_calc_start`(OUT `v_calc` INT, INOUT `v_refresh` INT, IN `v_cache_name` VARCHAR(50), IN `v_params` VARCHAR(100))
-proc: BEGIN
- DECLARE v_valid BOOL;
- DECLARE v_lock_id VARCHAR(100);
- DECLARE v_cache_id INT;
- DECLARE v_expires DATETIME;
- DECLARE v_clean_time DATETIME;
- DECLARE vLastRefresh DATETIME;
-
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- IF v_lock_id IS NOT NULL THEN
- DO RELEASE_LOCK(v_lock_id);
- END IF;
-
- RESIGNAL;
- END;
-
- SET v_params = IFNULL(v_params, '');
-
- -- Si el servidor se ha reiniciado invalida todos los calculos.
-
- SELECT COUNT(*) > 0 INTO v_valid FROM cache_valid;
-
- IF !v_valid
- THEN
- DELETE FROM cache_calc;
- INSERT INTO cache_valid (valid) VALUES (TRUE);
- END IF;
-
- -- Obtiene un bloqueo exclusivo para que no haya problemas de concurrencia.
-
- SET v_lock_id = CONCAT_WS('/', v_cache_name, v_params);
-
- IF !GET_LOCK(v_lock_id, 30)
- THEN
- SET v_calc = NULL;
- SET v_refresh = FALSE;
- LEAVE proc;
- END IF;
-
- -- Comprueba si el calculo solicitado existe y esta actualizado.
-
- SELECT c.id, ca.id, ca.expires, ca.last_refresh
- INTO v_cache_id, v_calc, v_expires, vLastRefresh
- FROM cache c
- LEFT JOIN cache_calc ca
- ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci'
- WHERE c.name = v_cache_name COLLATE 'utf8_general_ci';
-
- -- Si existe una calculo valido libera el bloqueo y devuelve su identificador.
-
- IF !v_refresh AND NOW() < v_expires AND vLastRefresh >= CURDATE()
- THEN
- DO RELEASE_LOCK(v_lock_id);
- SET v_refresh = FALSE;
- LEAVE proc;
- END IF;
-
- -- Si el calculo no existe le crea una entrada en la tabla de calculos.
-
- IF v_calc IS NULL
- THEN
- INSERT INTO cache_calc SET
- cache_id = v_cache_id,
- cacheName = v_cache_name,
- params = v_params,
- last_refresh = NULL,
- expires = NULL,
- connection_id = CONNECTION_ID();
-
- SET v_calc = LAST_INSERT_ID();
- ELSE
- UPDATE cache_calc
- SET
- last_refresh = NULL,
- expires = NULL,
- connection_id = CONNECTION_ID()
- WHERE id = v_calc;
- END IF;
-
- -- Si se debe recalcular mantiene el bloqueo y devuelve su identificador.
-
- SET v_refresh = TRUE;
+proc: BEGIN
+ DECLARE v_valid BOOL;
+ DECLARE v_lock_id VARCHAR(100);
+ DECLARE v_cache_id INT;
+ DECLARE v_expires DATETIME;
+ DECLARE v_clean_time DATETIME;
+ DECLARE vLastRefresh DATETIME;
+
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ IF v_lock_id IS NOT NULL THEN
+ DO RELEASE_LOCK(v_lock_id);
+ END IF;
+
+ RESIGNAL;
+ END;
+
+ SET v_params = IFNULL(v_params, '');
+
+ -- Si el servidor se ha reiniciado invalida todos los calculos.
+
+ SELECT COUNT(*) > 0 INTO v_valid FROM cache_valid;
+
+ IF !v_valid
+ THEN
+ DELETE FROM cache_calc;
+ INSERT INTO cache_valid (valid) VALUES (TRUE);
+ END IF;
+
+ -- Obtiene un bloqueo exclusivo para que no haya problemas de concurrencia.
+
+ SET v_lock_id = CONCAT_WS('/', v_cache_name, v_params);
+
+ IF !GET_LOCK(v_lock_id, 30)
+ THEN
+ SET v_calc = NULL;
+ SET v_refresh = FALSE;
+ LEAVE proc;
+ END IF;
+
+ -- Comprueba si el calculo solicitado existe y esta actualizado.
+
+ SELECT c.id, ca.id, ca.expires, ca.last_refresh
+ INTO v_cache_id, v_calc, v_expires, vLastRefresh
+ FROM cache c
+ LEFT JOIN cache_calc ca
+ ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci'
+ WHERE c.name = v_cache_name COLLATE 'utf8_general_ci';
+
+ -- Si existe una calculo valido libera el bloqueo y devuelve su identificador.
+
+ IF !v_refresh AND NOW() < v_expires AND vLastRefresh >= CURDATE()
+ THEN
+ DO RELEASE_LOCK(v_lock_id);
+ SET v_refresh = FALSE;
+ LEAVE proc;
+ END IF;
+
+ -- Si el calculo no existe le crea una entrada en la tabla de calculos.
+
+ IF v_calc IS NULL
+ THEN
+ INSERT INTO cache_calc SET
+ cache_id = v_cache_id,
+ cacheName = v_cache_name,
+ params = v_params,
+ last_refresh = NULL,
+ expires = NULL,
+ connection_id = CONNECTION_ID();
+
+ SET v_calc = LAST_INSERT_ID();
+ ELSE
+ UPDATE cache_calc
+ SET
+ last_refresh = NULL,
+ expires = NULL,
+ connection_id = CONNECTION_ID()
+ WHERE id = v_calc;
+ END IF;
+
+ -- Si se debe recalcular mantiene el bloqueo y devuelve su identificador.
+
+ SET v_refresh = TRUE;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -6729,7 +6729,7 @@ proc: BEGIN
FROM cache c
JOIN cache_calc ca ON c.id = ca.cache_id
WHERE ca.id = v_calc;
-
+
DELETE FROM cache_calc WHERE id = v_calc;
IF v_cache_name IS NOT NULL THEN
@@ -6825,7 +6825,7 @@ DECLARE rs CURSOR FOR
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
- SET myTime = HOUR(util.VN_NOW()) + MINUTE(util.VN_NOW()) / 60;
+ SET myTime = HOUR(util.VN_NOW()) + MINUTE(util.VN_NOW()) / 60;
OPEN rs;
@@ -6834,23 +6834,23 @@ DECLARE rs CURSOR FOR
WHILE NOT done DO
SET resto = IF(inicioProd < rsDeparture, rsDeparture - inicioProd,0);
-
+
SET inicioProd = rsDeparture - rsHoras;
-
+
IF inicioProd - resto < myTime THEN
-
+
SET done = TRUE;
-
+
ELSE
-
+
SET departureLimit = rsDeparture;
-
+
FETCH rs INTO rsDeparture, rsHoras , rsInicio;
-
+
-- SELECT rsDeparture, rsHoras , rsInicio;
-
+
END IF;
-
+
END WHILE;
SET departureLimit = IFNULL(departureLimit,24);
@@ -6895,7 +6895,7 @@ proc: BEGIN
DECLARE started DATE;
DECLARE ended DATE;
DECLARE vLastRefresh DATE;
-
+
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
CALL cache_calc_unlock (vCalc);
@@ -6945,14 +6945,14 @@ proc: BEGIN
DECLARE datEQ DATETIME;
DECLARE timDIF TIME;
DECLARE v_calc INT;
-
+
CALL cache_calc_start (v_calc, v_refresh, 'prod_graphic', wh_id);
-
+
IF !v_refresh
THEN
LEAVE proc;
END IF;
-
+
CALL vn2008.production_control_source(wh_id, 0);
DELETE FROM prod_graphic_source;
@@ -6970,8 +6970,8 @@ proc: BEGIN
WHERE Fecha = util.VN_CURDATE()
GROUP BY wh_id, graphCategory
;
-
-
+
+
CALL cache_calc_end (v_calc);
END ;;
DELIMITER ;
@@ -6992,7 +6992,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `stock_refresh`(v_refresh BOOL)
proc: BEGIN
/**
- * Crea o actualiza la cache con el disponible hasta el dÃa de
+ * Crea o actualiza la cache con el disponible hasta el dÃa de
* ayer. Esta cache es usada como base para otros procedimientos
* como el cáculo del visible o del ATP.
*
@@ -7018,21 +7018,21 @@ proc: BEGIN
SET v_date_inv = (SELECT inventoried FROM vn.config LIMIT 1);
SET vCURDATE = util.VN_CURDATE();
-
+
DELETE FROM stock;
-
+
INSERT INTO stock (item_id, warehouse_id, amount)
SELECT item_id, warehouse_id, SUM(amount) amount FROM
(
- SELECT itemFk AS item_id, warehouseFk AS warehouse_id, quantity AS amount
+ SELECT itemFk AS item_id, warehouseFk AS warehouse_id, quantity AS amount
FROM vn.itemTicketOut
WHERE shipped >= v_date_inv AND shipped < vCURDATE
UNION ALL
- SELECT itemFk ASitem_id, warehouseInFk AS warehouse_id, quantity AS amount
+ SELECT itemFk ASitem_id, warehouseInFk AS warehouse_id, quantity AS amount
FROM vn.itemEntryIn
WHERE landed >= v_date_inv AND landed < vCURDATE AND isVirtualStock is FALSE
UNION ALL
- SELECT itemFk AS item_id ,warehouseOutFk AS warehouse_id, quantity AS amount
+ SELECT itemFk AS item_id ,warehouseOutFk AS warehouse_id, quantity AS amount
FROM vn.itemEntryOut
WHERE shipped >= v_date_inv AND shipped < vCURDATE
) t
@@ -7062,12 +7062,12 @@ BEGIN
(INDEX (id))
ENGINE = MEMORY
SELECT id FROM cache_calc;
-
+
DELETE v
FROM visible v
LEFT JOIN tCalc c ON c.id = v.calc_id
WHERE c.id IS NULL;
-
+
DROP TEMPORARY TABLE tCalc;
END ;;
DELIMITER ;
@@ -7991,9 +7991,9 @@ DELIMITER ;;
BEGIN
DECLARE nextID INT;
-
+
SELECT 1 + MAX(id) INTO nextID FROM putOrder ;
-
+
SET NEW.orderTradelineItemID = nextID;
END */;;
@@ -8015,36 +8015,36 @@ DELIMITER ;;
BEFORE UPDATE ON `putOrder`
FOR EACH ROW
BEGIN
-
+
DECLARE vError VARCHAR(100) DEFAULT 'Orderregel niet meer teruggevonden op basis van de orderps';
DECLARE vVmpIdError INT DEFAULT 7;
DECLARE vVmpFk INT;
DECLARE vSupplyResponseNumberOfUnits INT;
-
- SELECT sr.vmpID INTO vVmpFk
- FROM edi.supplyResponse sr
+
+ SELECT sr.vmpID INTO vVmpFk
+ FROM edi.supplyResponse sr
WHERE sr.id = NEW.supplyResponseID;
-
- IF NEW.OrderStatus = 3
- AND NOT (NEW.OrderStatus <=> OLD.OrderStatus)
- AND NEW.error = vError
- AND vVmpFk = vVmpIdError
-
- THEN
-
+
+ IF NEW.OrderStatus = 3
+ AND NOT (NEW.OrderStatus <=> OLD.OrderStatus)
+ AND NEW.error = vError
+ AND vVmpFk = vVmpIdError
+
+ THEN
+
SET NEW.OrderStatus = 2;
-
+
END IF;
-
+
-- Error de disponible menor de lo solicitado
IF NEW.error LIKE 'error2602%' THEN
-
+
SELECT NumberOfUnits INTO vSupplyResponseNumberOfUnits
- FROM edi.supplyResponse sr
+ FROM edi.supplyResponse sr
WHERE sr.ID = NEW.supplyResponseID;
-
+
SET NEW.error = CONCAT('(',vSupplyResponseNumberOfUnits,') ', NEW.error);
-
+
END IF;
END */;;
DELIMITER ;
@@ -8071,16 +8071,16 @@ BEGIN
DECLARE vIsEktSender BOOLEAN;
IF NEW.OrderStatus = vOrderStatusDenied AND NOT (NEW.OrderStatus <=> OLD.OrderStatus) THEN
-
+
SELECT s.id INTO vSaleFk
- FROM vn.sale s
+ FROM vn.sale s
JOIN vn.ticket t ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk
JOIN deliveryInformation di ON di.ID = NEW.deliveryInformationID
WHERE t.clientFk = NEW.EndUserPartyGLN AND t.shipped >= util.VN_CURDATE()
AND i.supplyResponseFk = NEW.supplyResponseID
LIMIT 1;
-
+
UPDATE vn.sale s
JOIN vn.ticket t ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk
@@ -8088,7 +8088,7 @@ BEGIN
SET s.quantity = 0
WHERE t.clientFk = NEW.EndUserPartyGLN AND t.shipped >= util.VN_CURDATE()
AND i.supplyResponseFk = NEW.supplyResponseID;
-
+
INSERT INTO vn.mail (sender, `subject`, body)
SELECT IF(u.id IS NOT NULL AND c.email IS NOT NULL,
c.email,
@@ -8100,26 +8100,26 @@ BEGIN
IF (u.id IS NOT NULL AND c.email IS NOT NULL ,
CONCAT('https://shop.verdnatura.es/#!form=ecomerce%2Fticket&ticket=', t.id ),
CONCAT('https://salix.verdnatura.es/#!/ticket/', t.id ,'/summary')))
- FROM vn.sale s
+ FROM vn.sale s
JOIN vn.ticket t ON t.id = s.ticketFk
JOIN vn.`client` c ON c.id = t.clientFk
LEFT JOIN account.user u ON u.id= c.salesPersonFk AND u.name IN ('ruben', 'ismaelalcolea')
WHERE s.id = vSaleFk;
-
+
END IF;
IF NEW.OrderStatus = vOrderStatusOK AND NOT (NEW.OrderStatus <=> OLD.OrderStatus) THEN
- SELECT v.isEktSender INTO vIsEktSender
+ SELECT v.isEktSender INTO vIsEktSender
FROM edi.VMPSettings v
- JOIN edi.supplyResponse sr ON sr.vmpID = v.VMPID
+ JOIN edi.supplyResponse sr ON sr.vmpID = v.VMPID
WHERE sr.id = NEW.supplyResponseID;
-
+
IF NOT vIsEktSender THEN
CALL edi.ekt_add(NEW.id);
-
+
END IF;
IF NEW.barcode THEN
@@ -8128,7 +8128,7 @@ BEGIN
SELECT i.id, NEW.barcode
FROM vn.item i
WHERE i.supplyResponseFk = NEW.supplyResponseID;
-
+
END IF;
END IF;
@@ -8326,8 +8326,8 @@ BEGIN
UPDATE vn.buy b
JOIN vn.entry e ON e.id = b.entryFk
- JOIN vn.travel tr ON tr.id = e.travelFk
- JOIN vn.agencyMode am ON am.id = tr.agencyModeFk
+ JOIN vn.travel tr ON tr.id = e.travelFk
+ JOIN vn.agencyMode am ON am.id = tr.agencyModeFk
JOIN vn.item i ON i.id = b.itemFk
JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID
SET b.quantity = NEW.NumberOfItemsPerCask * NEW.NumberOfUnits,
@@ -8336,7 +8336,7 @@ BEGIN
AND am.name = 'LOGIFLORA'
AND e.isRaid
AND tr.landed >= util.VN_CURDATE();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -8478,7 +8478,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `imageName`(vPictureReference VARCHAR(255)) RETURNS varchar(255) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci
DETERMINISTIC
BEGIN
-
+
SET vPictureReference = REPLACE(vPictureReference,'.','');
SET vPictureReference = REPLACE(vPictureReference,'/','');
@@ -8490,7 +8490,7 @@ BEGIN
SET vPictureReference = REPLACE(vPictureReference,'?','');
SET vPictureReference = REPLACE(vPictureReference,'=','');
-
+
RETURN vPictureReference;
END ;;
@@ -8546,27 +8546,27 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `deliveryInformation_Delete`()
BEGIN
-
+
DECLARE vID INT;
DECLARE vGap INT DEFAULT 100;
DECLARE vTope INT;
-
- SELECT MIN(ID), MAX(ID)
+
+ SELECT MIN(ID), MAX(ID)
INTO vID, vTope
FROM edi.deliveryInformation;
- WHILE vID <= vTope DO
-
+ WHILE vID <= vTope DO
+
SET vID = vID + vGap;
-
- DELETE
- FROM edi.deliveryInformation
+
+ DELETE
+ FROM edi.deliveryInformation
WHERE ID < vID
AND EarliestDespatchDateTime IS NULL;
-
+
END WHILE;
-
-
+
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -8585,15 +8585,15 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_add`(vPutOrderFk INT)
BEGIN
-
+
/**
* Añade ekt para las ordenes de compra de proveedores que no envian el ekt por email
- *
+ *
* @param vPutOrderFk PutOrderId de donde coger los datos
**/
-
- INSERT INTO edi.ekt(entryYear,
- deliveryNumber,
+
+ INSERT INTO edi.ekt(entryYear,
+ deliveryNumber,
fec,
hor,
item,
@@ -8633,17 +8633,17 @@ BEGIN
i.value10 s6,
p.id putOrderFk,
sr.Item_ArticleCode,
- sr.vmpID
+ sr.vmpID
FROM edi.putOrder p
- JOIN edi.supplyResponse sr ON sr.ID = p.supplyResponseID
- JOIN edi.deliveryInformation di ON di.id = p.deliveryInformationID
- JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID
- JOIN vn.item i ON i.supplyResponseFk = sr.ID
- JOIN vn.origin o ON o.id = i.originFk
+ JOIN edi.supplyResponse sr ON sr.ID = p.supplyResponseID
+ JOIN edi.deliveryInformation di ON di.id = p.deliveryInformationID
+ JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID
+ JOIN vn.item i ON i.supplyResponseFk = sr.ID
+ JOIN vn.origin o ON o.id = i.originFk
WHERE p.id = vPutOrderFk;
-
+
CALL edi.ekt_load(LAST_INSERT_ID());
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -8662,7 +8662,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_load`(IN `vSelf` INT)
proc:BEGIN
-
+
DECLARE vRef INT;
DECLARE vBuy INT;
DECLARE vItem INT;
@@ -8687,51 +8687,51 @@ proc:BEGIN
FROM edi.ekt e
LEFT JOIN edi.item i ON e.ref = i.id
LEFT JOIN edi.putOrder po ON po.id = e.putOrderFk
- LEFT JOIN vn.item i2 ON i2.supplyResponseFk = po.supplyResponseID
+ LEFT JOIN vn.item i2 ON i2.supplyResponseFk = po.supplyResponseID
LEFT JOIN vn.ektEntryAssign eea ON eea.sub = e.sub
LEFT JOIN edi.item_groupToOffer igto ON igto.group_code = i.group_id
WHERE e.id = vSelf
LIMIT 1;
-
+
IF NOT vHasItemGroup THEN
-
+
CALL vn.mail_insert('logistica@verdnatura.es', 'nocontestar@verdnatura.es', 'Nuevo grupo en Floramondo', vDescription);
-
+
CALL vn.mail_insert('pako@verdnatura.es', 'nocontestar@verdnatura.es', CONCAT('Nuevo grupo en Floramondo: ', vDescription), vDescription);
-
+
LEAVE proc;
-
+
END IF;
-
+
-- Asigna la entrada
SELECT vn.ekt_getEntry(vSelf) INTO vEntryFk;
-
+
-- Inserta el cubo si no existe
IF vPackage = 800 THEN
-
+
SET vHasToChangePackagingFk = TRUE;
-
+
IF vItem THEN
-
+
SELECT vn.item_getPackage(vItem) INTO vPackage ;
-
+
ELSE
-
+
SET vPackage = 8000 + vQty;
INSERT IGNORE INTO vn.packaging(id, width, `depth`)
SELECT vPackage, vc.ccLength / vQty, vc.ccWidth
FROM vn.volumeConfig vc;
-
+
END IF;
-
+
ELSE
-
+
INSERT IGNORE INTO vn2008.Cubos (Id_Cubo, X, Y, Z)
SELECT bucket_id, ROUND(x_size/10), ROUND(y_size/10), ROUND(z_size/10)
FROM bucket WHERE bucket_id = vPackage;
-
+
IF ROW_COUNT() > 0
THEN
INSERT INTO vn2008.mail SET
@@ -8740,27 +8740,27 @@ proc:BEGIN
`to` = 'ekt@verdnatura.es';
END IF;
END IF;
-
+
-- Si es una compra de Logiflora obtiene el articulo
IF vPutOrderFk THEN
-
+
SELECT i.id INTO vItem
FROM edi.putOrder po
JOIN vn.item i ON i.supplyResponseFk = po.supplyResponseID
WHERE po.id = vPutOrderFk
LIMIT 1;
-
+
END IF;
INSERT IGNORE INTO item_track SET
item_id = vRef;
-
+
IF IFNULL(vItem,0) = 0 THEN
-
+
-- Intenta obtener el artículo en base a los atributos holandeses
-
+
SELECT b.id, IFNULL(b.itemOriginalFk ,b.itemFk) INTO vBuy, vItem
- FROM edi.ekt e
+ FROM edi.ekt e
JOIN edi.item_track t ON t.item_id = e.ref
LEFT JOIN edi.ekt l ON l.ref = e.ref
LEFT JOIN vn.buy b ON b.ektFk = l.id
@@ -8781,19 +8781,19 @@ proc:BEGIN
AND IF(t.pro, l.pro = e.pro, TRUE)
AND IF(t.package, l.package = e.package, TRUE)
AND IF(t.item, l.item = e.item, TRUE)
- AND i.isFloramondo = vIsFloramondoDirect
- ORDER BY l.now DESC, b.id ASC
+ AND i.isFloramondo = vIsFloramondoDirect
+ ORDER BY l.now DESC, b.id ASC
LIMIT 1;
END IF;
-
+
-- Si no encuentra el articulo lo crea en el caso de las compras directas en Floramondo
IF ISNULL(vItem) AND vIsFloramondoDirect THEN
-
+
CALL edi.item_getNewByEkt(vSelf, vItem);
-
+
END IF;
-
+
INSERT INTO vn.buy
(
entryFk
@@ -8816,15 +8816,15 @@ proc:BEGIN
,e.qty stickers
,@pac := IFNULL(i.stemMultiplier, 1) * e.pac / @t packing
,IFNULL(b.`grouping`, e.pac)
- ,@pac * e.qty
+ ,@pac * e.qty
,vForceToPacking
,IF(vHasToChangePackagingFk OR ISNULL(b.packageFk), vPackage, b.packageFk)
,(IFNULL(i.weightByPiece,0) * @pac)/1000
- FROM edi.ekt e
+ FROM edi.ekt e
LEFT JOIN vn.buy b ON b.id = vBuy
LEFT JOIN vn.item i ON i.id = b.itemFk
LEFT JOIN vn.supplier s ON e.pro = s.id
- JOIN vn2008.config cfg
+ JOIN vn2008.config cfg
WHERE e.id = vSelf
LIMIT 1;
@@ -8832,36 +8832,36 @@ proc:BEGIN
CREATE TEMPORARY TABLE tmp.buyRecalc
SELECT buy.id
- FROM vn.buy
+ FROM vn.buy
WHERE ektFk = vSelf;
CALL vn.buy_recalcPrices();
-- Si es una compra de Logiflora hay que informar la tabla vn.saleBuy
IF vPutOrderFk THEN
-
+
REPLACE vn.saleBuy(saleFk, buyFk, workerFk)
SELECT po.saleFk, b.id, account.myUser_getId()
FROM edi.putOrder po
JOIN vn.buy b ON b.ektFk = vSelf
WHERE po.id = vPutOrderFk;
-
+
END IF;
- -- Si es una compra directa en Floramondo hay que añadirlo al ticket
+ -- Si es una compra directa en Floramondo hay que añadirlo al ticket
IF vIsFloramondoDirect THEN
SELECT t.id INTO vTicketFk
FROM vn.ticket t
- JOIN vn.ektEntryAssign eea
- ON eea.addressFk = t.addressFk
+ JOIN vn.ektEntryAssign eea
+ ON eea.addressFk = t.addressFk
AND t.warehouseFk = eea.warehouseInFk
- JOIN edi.ekt e
- ON e.sub = eea.sub
+ JOIN edi.ekt e
+ ON e.sub = eea.sub
AND e.id = vSelf
WHERE e.fec = t.shipped
LIMIT 1;
-
+
IF ISNULL(vTicketFk) THEN
INSERT INTO vn.ticket (
@@ -8889,8 +8889,8 @@ proc:BEGIN
z.id,
z.price,
z.bonus
- FROM edi.ekt e
- JOIN vn.ektEntryAssign eea ON eea.sub = e.sub
+ FROM edi.ekt e
+ JOIN vn.ektEntryAssign eea ON eea.sub = e.sub
JOIN vn.address a ON a.id = eea.addressFk
JOIN vn.company c ON c.code = 'VNL'
JOIN vn.`zone` z ON z.code = 'FLORAMONDO'
@@ -8898,11 +8898,11 @@ proc:BEGIN
LIMIT 1;
SET vTicketFk = LAST_INSERT_ID();
-
+
INSERT INTO vn.ticketLog
- SET originFk = vTicketFk,
- userFk = account.myUser_getId(),
- `action` = 'insert',
+ SET originFk = vTicketFk,
+ userFk = account.myUser_getId(),
+ `action` = 'insert',
description = CONCAT('EktLoad ha creado el ticket:', ' ', vTicketFk);
END IF;
@@ -8912,9 +8912,9 @@ proc:BEGIN
FROM edi.ekt e
JOIN edi.floraHollandConfig fhc
WHERE e.id = vSelf;
-
+
SELECT LAST_INSERT_ID() INTO vSaleFk;
-
+
REPLACE vn.saleBuy(saleFk, buyFk, workerFk)
SELECT vSaleFk, b.id, account.myUser_getId()
FROM vn.buy b
@@ -8925,9 +8925,9 @@ proc:BEGIN
FROM edi.ekt e
JOIN vn.component c ON c.code = 'purchaseValue'
WHERE e.id = vSelf;
-
+
INSERT INTO vn.saleComponent(saleFk, componentFk, value)
- SELECT vSaleFk, c.id, e.pri * fhc.floramondoMargin
+ SELECT vSaleFk, c.id, e.pri * fhc.floramondoMargin
FROM edi.ekt e
JOIN edi.floraHollandConfig fhc
JOIN vn.component c ON c.code = 'margin'
@@ -9068,7 +9068,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_scan`(vBarcode VARCHAR(512))
BEGIN
/**
* Busca transaciones a partir de un código de barras, las marca como escaneadas
- * y las devuelve.
+ * y las devuelve.
* Ver https://wiki.verdnatura.es/index.php/Ekt#Algoritmos_de_lectura
*
* @param vBarcode Código de compra de una etiqueta de subasta
@@ -9107,19 +9107,19 @@ BEGIN
ENGINE = MEMORY
SELECT id ektFk FROM ekt LIMIT 0;
- CASE
+ CASE
WHEN LENGTH(vBarcode) <= vFloridayBarcodeLength THEN
INSERT INTO tmp.ekt
- SELECT id
+ SELECT id
FROM edi.ektRecent e
WHERE e.cps = vBarcode
OR e.batchNumber = vBarcode;
WHEN LENGTH(vBarcode) = vFloramondoBarcodeLength THEN
INSERT INTO tmp.ekt
- SELECT e.id
+ SELECT e.id
FROM edi.ektRecent e
- WHERE e.pro = MID(vBarcode,2,6)
+ WHERE e.pro = MID(vBarcode,2,6)
AND CAST(e.ptd AS SIGNED) = MID(vBarcode,8,5);
ELSE
@@ -9134,7 +9134,7 @@ BEGIN
-- Clásico de subasta
-- Trade standard
-- Trade que construye como la subasta
- -- Trade como el anterior pero sin trade code
+ -- Trade como el anterior pero sin trade code
INSERT INTO tmp.ekt
SELECT id
FROM ekt
@@ -9155,9 +9155,9 @@ BEGIN
-- BatchNumber largo
IF NOT vIsFound THEN
INSERT INTO tmp.ekt
- SELECT id
+ SELECT id
FROM edi.ektRecent e
- WHERE e.batchNumber
+ WHERE e.batchNumber
= LEFT(vBarcode,vUsefulAuctionLeftSegmentLength)
AND e.batchNumber > 0;
@@ -9167,7 +9167,7 @@ BEGIN
-- Order Number
IF NOT vIsFound THEN
INSERT INTO tmp.ekt
- SELECT id
+ SELECT id
FROM edi.ektRecent e
WHERE e.putOrderFk = vBarcode;
@@ -9177,7 +9177,7 @@ BEGIN
-- deliveryNumber incrustado
IF NOT vIsFound THEN
INSERT INTO tmp.ekt
- SELECT id
+ SELECT id
FROM edi.ektRecent e
WHERE e.deliveryNumber
= MID(vBarcode, 4, 13)
@@ -9188,7 +9188,7 @@ BEGIN
END CASE;
IF vIsFound THEN
- UPDATE ekt e
+ UPDATE ekt e
JOIN tmp.ekt t ON t.ektFk = e.id
SET e.scanned = TRUE;
END IF;
@@ -9209,524 +9209,524 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `floramondo_offerRefresh`()
-proc: BEGIN
- DECLARE vLanded DATETIME;
- DECLARE vDone INT DEFAULT FALSE;
- DECLARE vFreeId INT;
- DECLARE vSupplyResponseFk INT;
- DECLARE vLastInserted DATETIME;
- DECLARE vIsAuctionDay BOOLEAN;
- DECLARE vMaxNewItems INT DEFAULT 10000;
- DECLARE vStartingTime DATETIME;
- DECLARE vAalsmeerMarketPlaceID VARCHAR(13) DEFAULT '8713783439043';
- DECLARE vDayRange INT;
-
- DECLARE cur1 CURSOR FOR
- SELECT id
- FROM edi.item_free;
-
- DECLARE cur2 CURSOR FOR
- SELECT srId
- FROM itemToInsert;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
- DECLARE EXIT HANDLER FOR SQLSTATE '45000'
- BEGIN
- ROLLBACK;
- RESIGNAL;
- END;
-
- DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
- BEGIN
- DO RELEASE_LOCK('edi.floramondo_offerRefresh');
- SET @isTriggerDisabled = FALSE;
- RESIGNAL;
- END;
-
- IF 'test' = (SELECT environment FROM util.config) THEN
- LEAVE proc;
- END IF;
-
- IF !GET_LOCK('edi.floramondo_offerRefresh', 0) THEN
- LEAVE proc;
- END IF;
-
- SELECT dayRange INTO vDayRange
- FROM offerRefreshConfig;
-
- IF vDayRange IS NULL THEN
- CALL util.throw("Variable vDayRange not declared");
- END IF;
-
- SET vStartingTime = util.VN_NOW();
-
- TRUNCATE edi.offerList;
-
- INSERT INTO edi.offerList(supplier, total)
- SELECT v.name, COUNT(DISTINCT sr.ID) total
- FROM edi.supplyResponse sr
- JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
- WHERE sr.NumberOfUnits > 0
- AND sr.EmbalageCode != 999
- GROUP BY sr.vmpID;
-
- UPDATE edi.offerList o
- JOIN (SELECT v.name, COUNT(*) total
- FROM edi.supplyOffer sr
- JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
- GROUP BY sr.vmpID) sub ON o.supplier = sub.name
- SET o.`filter` = sub.total;
-
- -- Elimina de la lista de items libres aquellos que ya existen
- DELETE itf.*
- FROM edi.item_free itf
- JOIN vn.item i ON i.id = itf.id;
-
- CREATE OR REPLACE TEMPORARY TABLE tmp
- (INDEX (`Item_ArticleCode`))
- ENGINE = MEMORY
- SELECT t.*
- FROM (
- SELECT *
- FROM edi.supplyOffer
- ORDER BY (MarketPlaceID = vAalsmeerMarketPlaceID) DESC,
- NumberOfUnits DESC LIMIT 10000000000000000000) t
- GROUP BY t.srId;
-
- CREATE OR REPLACE TEMPORARY TABLE edi.offer (INDEX (`srID`), INDEX (`EmbalageCode`),
- INDEX (`ef1`), INDEX (`ef2`), INDEX (`ef3`), INDEX (`ef4`),INDEX (`ef5`), INDEX (`ef6`),
- INDEX (`s1Value`), INDEX (`s2Value`), INDEX (`s3Value`), INDEX (`s4Value`),INDEX (`s5Value`), INDEX (`s6Value`))
- ENGINE = MEMORY
- SELECT so.*,
- ev1.type_description s1Value,
- ev2.type_description s2Value,
- ev3.type_description s3Value,
- ev4.type_description s4Value,
- ev5.type_description s5Value,
- ev6.type_description s6Value,
- eif1.feature ef1,
- eif2.feature ef2,
- eif3.feature ef3,
- eif4.feature ef4,
- eif5.feature ef5,
- eif6.feature ef6
- FROM tmp so
- LEFT JOIN edi.item_feature eif1 ON eif1.item_id = so.Item_ArticleCode
- AND eif1.presentation_order = 1
- AND eif1.expiry_date IS NULL
- LEFT JOIN edi.item_feature eif2 ON eif2.item_id = so.Item_ArticleCode
- AND eif2.presentation_order = 2
- AND eif2.expiry_date IS NULL
- LEFT JOIN edi.item_feature eif3 ON eif3.item_id = so.Item_ArticleCode
- AND eif3.presentation_order = 3
- AND eif3.expiry_date IS NULL
- LEFT JOIN edi.item_feature eif4 ON eif4.item_id = so.Item_ArticleCode
- AND eif4.presentation_order = 4
- AND eif4.expiry_date IS NULL
- LEFT JOIN edi.item_feature eif5 ON eif5.item_id = so.Item_ArticleCode
- AND eif5.presentation_order = 5
- AND eif5.expiry_date IS NULL
- LEFT JOIN edi.item_feature eif6 ON eif6.item_id = so.Item_ArticleCode
- AND eif6.presentation_order = 6
- AND eif6.expiry_date IS NULL
- LEFT JOIN edi.`value` ev1 ON ev1.type_id = eif1.feature
- AND so.s1 = ev1.type_value
- LEFT JOIN edi.`value` ev2 ON ev2.type_id = eif2.feature
- AND so.s2 = ev2.type_value
- LEFT JOIN edi.`value` ev3 ON ev3.type_id = eif3.feature
- AND so.s3 = ev3.type_value
- LEFT JOIN edi.`value` ev4 ON ev4.type_id = eif4.feature
- AND so.s4 = ev4.type_value
- LEFT JOIN edi.`value` ev5 ON ev5.type_id = eif5.feature
- AND so.s5 = ev5.type_value
- LEFT JOIN edi.`value` ev6 ON ev6.type_id = eif6.feature
- AND so.s6 = ev6.type_value
- ORDER BY Price;
-
- DROP TEMPORARY TABLE tmp;
-
- DELETE o
- FROM edi.offer o
- LEFT JOIN vn.tag t1 ON t1.ediTypeFk = o.ef1 AND t1.overwrite = 'size'
- LEFT JOIN vn.tag t2 ON t2.ediTypeFk = o.ef2 AND t2.overwrite = 'size'
- LEFT JOIN vn.tag t3 ON t3.ediTypeFk = o.ef3 AND t3.overwrite = 'size'
- LEFT JOIN vn.tag t4 ON t4.ediTypeFk = o.ef4 AND t4.overwrite = 'size'
- LEFT JOIN vn.tag t5 ON t5.ediTypeFk = o.ef5 AND t5.overwrite = 'size'
- LEFT JOIN vn.tag t6 ON t6.ediTypeFk = o.ef6 AND t6.overwrite = 'size'
- JOIN vn.floramondoConfig fc ON TRUE
- WHERE (t1.id IS NOT NULL AND CONVERT(s1Value, UNSIGNED) > fc.itemMaxSize)
- OR (t2.id IS NOT NULL AND CONVERT(s2Value, UNSIGNED) > fc.itemMaxSize)
- OR (t3.id IS NOT NULL AND CONVERT(s3Value, UNSIGNED) > fc.itemMaxSize)
- OR (t4.id IS NOT NULL AND CONVERT(s4Value, UNSIGNED) > fc.itemMaxSize)
- OR (t5.id IS NOT NULL AND CONVERT(s5Value, UNSIGNED) > fc.itemMaxSize)
- OR (t6.id IS NOT NULL AND CONVERT(s6Value, UNSIGNED) > fc.itemMaxSize);
-
- START TRANSACTION;
-
- -- Actualizamos el campo supplyResponseFk para aquellos articulos que ya estan creados y reutilizamos
- UPDATE IGNORE edi.offer o
- JOIN vn.item i
- ON i.name = o.product_name
- AND i.subname <=> o.company_name
- AND i.value5 <=> o.s1Value
- AND i.value6 <=> o.s2Value
- AND i.value7 <=> o.s3Value
- AND i.value8 <=> o.s4Value
- AND i.value9 <=> o.s5Value
- AND i.value10 <=> o.s6Value
- AND i.NumberOfItemsPerCask <=> o.NumberOfItemsPerCask
- AND i.EmbalageCode <=> o.EmbalageCode
- AND i.quality <=> o.Quality
- JOIN vn.itemType it ON it.id = i.typeFk
- LEFT JOIN vn.sale s ON s.itemFk = i.id
- LEFT JOIN vn.ticket t ON t.id = s.ticketFk
- AND t.shipped > (util.VN_CURDATE() - INTERVAL 1 WEEK)
- LEFT JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk
- LEFT JOIN edi.deliveryInformation di ON di.supplyResponseID = sr.ID
- LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk
- AND po.OrderTradeLineDateTime > (util.VN_CURDATE() - INTERVAL 1 WEEK)
- SET i.supplyResponseFk = o.srID
- WHERE (sr.ID IS NULL
- OR sr.NumberOfUnits = 0
- OR di.LatestOrderDateTime < util.VN_NOW()
- OR di.ID IS NULL)
- AND it.isInventory
- AND t.id IS NULL
- AND po.id IS NULL;
-
- CREATE OR REPLACE TEMPORARY TABLE itemToInsert
- ENGINE = MEMORY
- SELECT o.*, CAST(NULL AS DECIMAL(6,0)) itemFk
- FROM edi.offer o
- LEFT JOIN vn.item i ON i.supplyResponseFk = o.srId
- WHERE i.id IS NULL
- LIMIT vMaxNewItems;
-
- -- Reciclado de nº de item
- OPEN cur1;
- OPEN cur2;
-
- read_loop: LOOP
-
- FETCH cur2 INTO vSupplyResponseFk;
- FETCH cur1 INTO vFreeId;
-
- IF vDone THEN
- LEAVE read_loop;
- END IF;
-
- UPDATE itemToInsert
- SET itemFk = vFreeId
- WHERE srId = vSupplyResponseFk;
-
- END LOOP;
-
- CLOSE cur1;
- CLOSE cur2;
-
- -- Insertamos todos los items en Articles de la oferta
- INSERT INTO vn.item(id,
- `name`,
- longName,
- subName,
- expenceFk,
- typeFk,
- intrastatFk,
- originFk,
- supplyResponseFk,
- numberOfItemsPerCask,
- embalageCode,
- quality,
- isFloramondo)
- SELECT iti.itemFk,
- iti.product_name,
- iti.product_name,
- iti.company_name,
- iti.expenseFk,
- iti.itemTypeFk,
- iti.intrastatFk,
- iti.originFk,
- iti.`srId`,
- iti.NumberOfItemsPerCask,
- iti.EmbalageCode,
- iti.Quality,
- TRUE
- FROM itemToInsert iti;
-
- -- Inserta la foto de los articulos nuevos (prioridad alta)
- INSERT IGNORE INTO vn.itemImageQueue(itemFk, url)
- SELECT i.id, PictureReference
- FROM itemToInsert ii
- JOIN vn.item i ON i.supplyResponseFk = ii.srId
- WHERE PictureReference IS NOT NULL
- AND i.image IS NULL;
-
- INSERT INTO edi.`log`(tableName, fieldName,fieldValue)
- SELECT 'itemImageQueue','NumImagenesPtes', COUNT(*)
- FROM vn.itemImageQueue
- WHERE attempts = 0;
-
- -- Inserta si se añadiesen tags nuevos
- INSERT IGNORE INTO vn.tag (name, ediTypeFk)
- SELECT description, type_id FROM edi.type;
-
- -- Desabilita el trigger para recalcular los tags al final
- SET @isTriggerDisabled = TRUE;
-
- -- Inserta los tags sólo en los articulos nuevos
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , ii.product_name, 1
- FROM itemToInsert ii
- JOIN vn.tag t ON t.`name` = 'Producto'
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT ii.product_name IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , ii.Quality, 3
- FROM itemToInsert ii
- JOIN vn.tag t ON t.`name` = 'Calidad'
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT ii.Quality IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , ii.company_name, 4
- FROM itemToInsert ii
- JOIN vn.tag t ON t.`name` = 'Productor'
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT ii.company_name IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , s1Value, 5
- FROM itemToInsert ii
- JOIN vn.tag t ON t.ediTypeFk = ii.ef1
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT s1Value IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , s2Value, 6
- FROM itemToInsert ii
- JOIN vn.tag t ON t.ediTypeFk = ii.ef2
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT s2Value IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , s3Value, 7
- FROM itemToInsert ii
- JOIN vn.tag t ON t.ediTypeFk = ii.ef3
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT s3Value IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , s4Value, 8
- FROM itemToInsert ii
- JOIN vn.tag t ON t.ediTypeFk = ii.ef4
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT s4Value IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , s5Value, 9
- FROM itemToInsert ii
- JOIN vn.tag t ON t.ediTypeFk = ii.ef5
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT s5Value IS NULL;
-
- INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id , s6Value, 10
- FROM itemToInsert ii
- JOIN vn.tag t ON t.ediTypeFk = ii.ef6
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- WHERE NOT s6Value IS NULL;
-
- INSERT IGNORE INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT i.id, t.id, IFNULL(ink.name, ik.color), 11
- FROM itemToInsert ii
- JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
- JOIN vn.tag t ON t.`name` = 'Color'
- LEFT JOIN edi.feature f ON f.item_id = ii.Item_ArticleCode
- LEFT JOIN edi.`type` tp ON tp.type_id = f.feature_type_id
- AND tp.`description` = 'Hoofdkleur 1'
- LEFT JOIN vn.ink ON ink.dutchCode = f.feature_value
- LEFT JOIN vn.itemInk ik ON ik.longName = i.longName
- WHERE ink.name IS NOT NULL
- OR ik.color IS NOT NULL;
-
- CREATE OR REPLACE TABLE tmp.item
- (PRIMARY KEY (id))
- SELECT i.id FROM vn.item i
- JOIN itemToInsert ii ON i.supplyResponseFk = ii.`srId`;
-
- CALL vn.item_refreshTags();
-
- DROP TABLE tmp.item;
-
- SELECT MIN(LatestDeliveryDateTime) INTO vLanded
- FROM edi.supplyResponse sr
- JOIN edi.deliveryInformation di ON di.supplyResponseID = sr.ID
- JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID
- JOIN vn.floramondoConfig fc
- WHERE mp.isLatestOrderDateTimeRelevant
- AND di.LatestOrderDateTime > IF(
- fc.MaxLatestOrderHour > HOUR(util.VN_NOW()),
- util.VN_CURDATE(),
- util.VN_CURDATE() + INTERVAL 1 DAY);
-
- UPDATE vn.floramondoConfig
- SET nextLanded = vLanded
- WHERE vLanded IS NOT NULL;
-
- -- Elimina la oferta obsoleta
- UPDATE vn.buy b
- JOIN vn.entry e ON e.id = b.entryFk
- JOIN vn.travel tr ON tr.id = e.travelFk
- JOIN vn.agencyMode am ON am.id = tr.agencyModeFk
- JOIN vn.item i ON i.id = b.itemFk
- LEFT JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID
- LEFT JOIN edi.deliveryInformation di ON di.ID = b.deliveryFk
- SET b.quantity = 0
- WHERE (IFNULL(di.LatestOrderDateTime,util.VN_NOW()) <= util.VN_NOW()
- OR i.supplyResponseFk IS NULL
- OR sr.NumberOfUnits = 0)
- AND am.name = 'LOGIFLORA'
- AND e.isRaid;
-
- -- Localiza las entradas de cada almacen
- UPDATE edi.warehouseFloramondo
- SET entryFk = vn.entry_getForLogiflora(vLanded + INTERVAL travellingDays DAY, warehouseFk);
-
- IF vLanded IS NOT NULL THEN
- -- Actualiza la oferta existente
- UPDATE vn.buy b
- JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk
- JOIN vn.item i ON i.id = b.itemFk
- JOIN edi.offer o ON i.supplyResponseFk = o.`srId`
- SET b.quantity = o.NumberOfUnits * o.NumberOfItemsPerCask,
- b.buyingValue = o.price
- WHERE (b.quantity <> o.NumberOfUnits * o.NumberOfItemsPerCask
- OR b.buyingValue <> o.price);
-
- -- Inserta el resto
- SET vLastInserted := util.VN_NOW();
-
- -- Inserta la oferta
- INSERT INTO vn.buy (
- entryFk,
- itemFk,
- quantity,
- buyingValue,
- stickers,
- packing,
- `grouping`,
- groupingMode,
- packageFk,
- deliveryFk)
- SELECT wf.entryFk,
- i.id,
- o.NumberOfUnits * o.NumberOfItemsPerCask quantity,
- o.Price,
- o.NumberOfUnits etiquetas,
- o.NumberOfItemsPerCask packing,
- GREATEST(1, IFNULL(o.MinimumQuantity,0)) * o.NumberOfItemsPerCask `grouping`,
- 2, -- Obliga al Packing
- o.embalageCode,
- o.diId
- FROM edi.offer o
- JOIN vn.item i ON i.supplyResponseFk = o.srId
- JOIN edi.warehouseFloramondo wf
- JOIN vn.packaging p ON p.id
- LIKE o.embalageCode
- LEFT JOIN vn.buy b ON b.itemFk = i.id
- AND b.entryFk = wf.entryFk
- WHERE b.id IS NULL; -- Quitar esta linea y mirar de crear los packages a tiempo REAL
-
- INSERT INTO vn.itemCost(
- itemFk,
- warehouseFk,
- cm3,
- cm3delivery)
- SELECT b.itemFk,
- wf.warehouseFk,
- @cm3 := vn.buy_getUnitVolume(b.id),
- IFNULL((vc.standardFlowerBox * 1000) / i.packingOut, @cm3)
- FROM warehouseFloramondo wf
- JOIN vn.volumeConfig vc
- JOIN vn.buy b ON b.entryFk = wf.entryFk
- JOIN vn.item i ON i.id = b.itemFk
- LEFT JOIN vn.itemCost ic ON ic.itemFk = b.itemFk
- AND ic.warehouseFk = wf.warehouseFk
- WHERE (ic.cm3 IS NULL OR ic.cm3 = 0)
- ON DUPLICATE KEY UPDATE cm3 = @cm3, cm3delivery = IFNULL((vc.standardFlowerBox * 1000) / i.packingOut, @cm3);
-
- CREATE OR REPLACE TEMPORARY TABLE tmp.buyRecalc
- SELECT b.id
- FROM vn.buy b
- JOIN warehouseFloramondo wf ON wf.entryFk = b.entryFk
- WHERE b.created >= vLastInserted;
-
- CALL vn.buy_recalcPrices();
-
- UPDATE edi.offerList o
- JOIN (SELECT v.name, COUNT(DISTINCT b.itemFk) total
- FROM vn.buy b
- JOIN vn.item i ON i.id = b.itemFk
- JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk
- JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
- JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk
- JOIN vn.warehouse w ON w.id = wf.warehouseFk
- WHERE w.name = 'VNH'
- AND b.quantity > 0
- GROUP BY sr.vmpID) sub ON o.supplier = sub.name
- SET o.vnh = sub.total;
-
- UPDATE edi.offerList o
- JOIN (SELECT v.name, COUNT(DISTINCT b.itemFk) total
- FROM vn.buy b
- JOIN vn.item i ON i.id = b.itemFk
- JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk
- JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
- JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk
- JOIN vn.warehouse w ON w.id = wf.warehouseFk
- WHERE w.name = 'ALGEMESI'
- AND b.quantity > 0
- GROUP BY sr.vmpID) sub ON o.supplier = sub.name
- SET o.algemesi = sub.total;
- END IF;
-
- DROP TEMPORARY TABLE
- edi.offer,
- itemToInsert;
-
- SET @isTriggerDisabled = FALSE;
-
- COMMIT;
-
- -- Esto habria que pasarlo a procesos programados o trabajar con tags y dejar las familias
- UPDATE vn.item i
- SET typeFk = 121
- WHERE i.longName LIKE 'Rosa Garden %'
- AND typeFk = 17;
-
- UPDATE vn.item i
- SET typeFk = 156
- WHERE i.longName LIKE 'Rosa ec %'
- AND typeFk = 17;
-
- -- Refresca las fotos de los items existentes que mostramos (prioridad baja)
- INSERT IGNORE INTO vn.itemImageQueue(itemFk, url, priority)
- SELECT i.id, sr.PictureReference, 100
- FROM edi.supplyResponse sr
- JOIN vn.item i ON i.supplyResponseFk = sr.ID
- JOIN edi.supplyOffer so ON so.srId = sr.ID
- JOIN hedera.image i2 ON i2.name = i.image
- AND i2.collectionFk = 'catalog'
- WHERE i2.updated <= (UNIX_TIMESTAMP(util.VN_NOW()) - vDayRange)
- AND sr.NumberOfUnits;
-
- INSERT INTO edi.`log`
- SET tableName = 'floramondo_offerRefresh',
- fieldName = 'Tiempo de proceso',
- fieldValue = TIMEDIFF(util.VN_NOW(), vStartingTime);
-
- DO RELEASE_LOCK('edi.floramondo_offerRefresh');
+proc: BEGIN
+ DECLARE vLanded DATETIME;
+ DECLARE vDone INT DEFAULT FALSE;
+ DECLARE vFreeId INT;
+ DECLARE vSupplyResponseFk INT;
+ DECLARE vLastInserted DATETIME;
+ DECLARE vIsAuctionDay BOOLEAN;
+ DECLARE vMaxNewItems INT DEFAULT 10000;
+ DECLARE vStartingTime DATETIME;
+ DECLARE vAalsmeerMarketPlaceID VARCHAR(13) DEFAULT '8713783439043';
+ DECLARE vDayRange INT;
+
+ DECLARE cur1 CURSOR FOR
+ SELECT id
+ FROM edi.item_free;
+
+ DECLARE cur2 CURSOR FOR
+ SELECT srId
+ FROM itemToInsert;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
+ DECLARE EXIT HANDLER FOR SQLSTATE '45000'
+ BEGIN
+ ROLLBACK;
+ RESIGNAL;
+ END;
+
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+ BEGIN
+ DO RELEASE_LOCK('edi.floramondo_offerRefresh');
+ SET @isTriggerDisabled = FALSE;
+ RESIGNAL;
+ END;
+
+ IF 'test' = (SELECT environment FROM util.config) THEN
+ LEAVE proc;
+ END IF;
+
+ IF !GET_LOCK('edi.floramondo_offerRefresh', 0) THEN
+ LEAVE proc;
+ END IF;
+
+ SELECT dayRange INTO vDayRange
+ FROM offerRefreshConfig;
+
+ IF vDayRange IS NULL THEN
+ CALL util.throw("Variable vDayRange not declared");
+ END IF;
+
+ SET vStartingTime = util.VN_NOW();
+
+ TRUNCATE edi.offerList;
+
+ INSERT INTO edi.offerList(supplier, total)
+ SELECT v.name, COUNT(DISTINCT sr.ID) total
+ FROM edi.supplyResponse sr
+ JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
+ WHERE sr.NumberOfUnits > 0
+ AND sr.EmbalageCode != 999
+ GROUP BY sr.vmpID;
+
+ UPDATE edi.offerList o
+ JOIN (SELECT v.name, COUNT(*) total
+ FROM edi.supplyOffer sr
+ JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
+ GROUP BY sr.vmpID) sub ON o.supplier = sub.name
+ SET o.`filter` = sub.total;
+
+ -- Elimina de la lista de items libres aquellos que ya existen
+ DELETE itf.*
+ FROM edi.item_free itf
+ JOIN vn.item i ON i.id = itf.id;
+
+ CREATE OR REPLACE TEMPORARY TABLE tmp
+ (INDEX (`Item_ArticleCode`))
+ ENGINE = MEMORY
+ SELECT t.*
+ FROM (
+ SELECT *
+ FROM edi.supplyOffer
+ ORDER BY (MarketPlaceID = vAalsmeerMarketPlaceID) DESC,
+ NumberOfUnits DESC LIMIT 10000000000000000000) t
+ GROUP BY t.srId;
+
+ CREATE OR REPLACE TEMPORARY TABLE edi.offer (INDEX (`srID`), INDEX (`EmbalageCode`),
+ INDEX (`ef1`), INDEX (`ef2`), INDEX (`ef3`), INDEX (`ef4`),INDEX (`ef5`), INDEX (`ef6`),
+ INDEX (`s1Value`), INDEX (`s2Value`), INDEX (`s3Value`), INDEX (`s4Value`),INDEX (`s5Value`), INDEX (`s6Value`))
+ ENGINE = MEMORY
+ SELECT so.*,
+ ev1.type_description s1Value,
+ ev2.type_description s2Value,
+ ev3.type_description s3Value,
+ ev4.type_description s4Value,
+ ev5.type_description s5Value,
+ ev6.type_description s6Value,
+ eif1.feature ef1,
+ eif2.feature ef2,
+ eif3.feature ef3,
+ eif4.feature ef4,
+ eif5.feature ef5,
+ eif6.feature ef6
+ FROM tmp so
+ LEFT JOIN edi.item_feature eif1 ON eif1.item_id = so.Item_ArticleCode
+ AND eif1.presentation_order = 1
+ AND eif1.expiry_date IS NULL
+ LEFT JOIN edi.item_feature eif2 ON eif2.item_id = so.Item_ArticleCode
+ AND eif2.presentation_order = 2
+ AND eif2.expiry_date IS NULL
+ LEFT JOIN edi.item_feature eif3 ON eif3.item_id = so.Item_ArticleCode
+ AND eif3.presentation_order = 3
+ AND eif3.expiry_date IS NULL
+ LEFT JOIN edi.item_feature eif4 ON eif4.item_id = so.Item_ArticleCode
+ AND eif4.presentation_order = 4
+ AND eif4.expiry_date IS NULL
+ LEFT JOIN edi.item_feature eif5 ON eif5.item_id = so.Item_ArticleCode
+ AND eif5.presentation_order = 5
+ AND eif5.expiry_date IS NULL
+ LEFT JOIN edi.item_feature eif6 ON eif6.item_id = so.Item_ArticleCode
+ AND eif6.presentation_order = 6
+ AND eif6.expiry_date IS NULL
+ LEFT JOIN edi.`value` ev1 ON ev1.type_id = eif1.feature
+ AND so.s1 = ev1.type_value
+ LEFT JOIN edi.`value` ev2 ON ev2.type_id = eif2.feature
+ AND so.s2 = ev2.type_value
+ LEFT JOIN edi.`value` ev3 ON ev3.type_id = eif3.feature
+ AND so.s3 = ev3.type_value
+ LEFT JOIN edi.`value` ev4 ON ev4.type_id = eif4.feature
+ AND so.s4 = ev4.type_value
+ LEFT JOIN edi.`value` ev5 ON ev5.type_id = eif5.feature
+ AND so.s5 = ev5.type_value
+ LEFT JOIN edi.`value` ev6 ON ev6.type_id = eif6.feature
+ AND so.s6 = ev6.type_value
+ ORDER BY Price;
+
+ DROP TEMPORARY TABLE tmp;
+
+ DELETE o
+ FROM edi.offer o
+ LEFT JOIN vn.tag t1 ON t1.ediTypeFk = o.ef1 AND t1.overwrite = 'size'
+ LEFT JOIN vn.tag t2 ON t2.ediTypeFk = o.ef2 AND t2.overwrite = 'size'
+ LEFT JOIN vn.tag t3 ON t3.ediTypeFk = o.ef3 AND t3.overwrite = 'size'
+ LEFT JOIN vn.tag t4 ON t4.ediTypeFk = o.ef4 AND t4.overwrite = 'size'
+ LEFT JOIN vn.tag t5 ON t5.ediTypeFk = o.ef5 AND t5.overwrite = 'size'
+ LEFT JOIN vn.tag t6 ON t6.ediTypeFk = o.ef6 AND t6.overwrite = 'size'
+ JOIN vn.floramondoConfig fc ON TRUE
+ WHERE (t1.id IS NOT NULL AND CONVERT(s1Value, UNSIGNED) > fc.itemMaxSize)
+ OR (t2.id IS NOT NULL AND CONVERT(s2Value, UNSIGNED) > fc.itemMaxSize)
+ OR (t3.id IS NOT NULL AND CONVERT(s3Value, UNSIGNED) > fc.itemMaxSize)
+ OR (t4.id IS NOT NULL AND CONVERT(s4Value, UNSIGNED) > fc.itemMaxSize)
+ OR (t5.id IS NOT NULL AND CONVERT(s5Value, UNSIGNED) > fc.itemMaxSize)
+ OR (t6.id IS NOT NULL AND CONVERT(s6Value, UNSIGNED) > fc.itemMaxSize);
+
+ START TRANSACTION;
+
+ -- Actualizamos el campo supplyResponseFk para aquellos articulos que ya estan creados y reutilizamos
+ UPDATE IGNORE edi.offer o
+ JOIN vn.item i
+ ON i.name = o.product_name
+ AND i.subname <=> o.company_name
+ AND i.value5 <=> o.s1Value
+ AND i.value6 <=> o.s2Value
+ AND i.value7 <=> o.s3Value
+ AND i.value8 <=> o.s4Value
+ AND i.value9 <=> o.s5Value
+ AND i.value10 <=> o.s6Value
+ AND i.NumberOfItemsPerCask <=> o.NumberOfItemsPerCask
+ AND i.EmbalageCode <=> o.EmbalageCode
+ AND i.quality <=> o.Quality
+ JOIN vn.itemType it ON it.id = i.typeFk
+ LEFT JOIN vn.sale s ON s.itemFk = i.id
+ LEFT JOIN vn.ticket t ON t.id = s.ticketFk
+ AND t.shipped > (util.VN_CURDATE() - INTERVAL 1 WEEK)
+ LEFT JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk
+ LEFT JOIN edi.deliveryInformation di ON di.supplyResponseID = sr.ID
+ LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk
+ AND po.OrderTradeLineDateTime > (util.VN_CURDATE() - INTERVAL 1 WEEK)
+ SET i.supplyResponseFk = o.srID
+ WHERE (sr.ID IS NULL
+ OR sr.NumberOfUnits = 0
+ OR di.LatestOrderDateTime < util.VN_NOW()
+ OR di.ID IS NULL)
+ AND it.isInventory
+ AND t.id IS NULL
+ AND po.id IS NULL;
+
+ CREATE OR REPLACE TEMPORARY TABLE itemToInsert
+ ENGINE = MEMORY
+ SELECT o.*, CAST(NULL AS DECIMAL(6,0)) itemFk
+ FROM edi.offer o
+ LEFT JOIN vn.item i ON i.supplyResponseFk = o.srId
+ WHERE i.id IS NULL
+ LIMIT vMaxNewItems;
+
+ -- Reciclado de nº de item
+ OPEN cur1;
+ OPEN cur2;
+
+ read_loop: LOOP
+
+ FETCH cur2 INTO vSupplyResponseFk;
+ FETCH cur1 INTO vFreeId;
+
+ IF vDone THEN
+ LEAVE read_loop;
+ END IF;
+
+ UPDATE itemToInsert
+ SET itemFk = vFreeId
+ WHERE srId = vSupplyResponseFk;
+
+ END LOOP;
+
+ CLOSE cur1;
+ CLOSE cur2;
+
+ -- Insertamos todos los items en Articles de la oferta
+ INSERT INTO vn.item(id,
+ `name`,
+ longName,
+ subName,
+ expenceFk,
+ typeFk,
+ intrastatFk,
+ originFk,
+ supplyResponseFk,
+ numberOfItemsPerCask,
+ embalageCode,
+ quality,
+ isFloramondo)
+ SELECT iti.itemFk,
+ iti.product_name,
+ iti.product_name,
+ iti.company_name,
+ iti.expenseFk,
+ iti.itemTypeFk,
+ iti.intrastatFk,
+ iti.originFk,
+ iti.`srId`,
+ iti.NumberOfItemsPerCask,
+ iti.EmbalageCode,
+ iti.Quality,
+ TRUE
+ FROM itemToInsert iti;
+
+ -- Inserta la foto de los articulos nuevos (prioridad alta)
+ INSERT IGNORE INTO vn.itemImageQueue(itemFk, url)
+ SELECT i.id, PictureReference
+ FROM itemToInsert ii
+ JOIN vn.item i ON i.supplyResponseFk = ii.srId
+ WHERE PictureReference IS NOT NULL
+ AND i.image IS NULL;
+
+ INSERT INTO edi.`log`(tableName, fieldName,fieldValue)
+ SELECT 'itemImageQueue','NumImagenesPtes', COUNT(*)
+ FROM vn.itemImageQueue
+ WHERE attempts = 0;
+
+ -- Inserta si se añadiesen tags nuevos
+ INSERT IGNORE INTO vn.tag (name, ediTypeFk)
+ SELECT description, type_id FROM edi.type;
+
+ -- Desabilita el trigger para recalcular los tags al final
+ SET @isTriggerDisabled = TRUE;
+
+ -- Inserta los tags sólo en los articulos nuevos
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , ii.product_name, 1
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.`name` = 'Producto'
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT ii.product_name IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , ii.Quality, 3
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.`name` = 'Calidad'
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT ii.Quality IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , ii.company_name, 4
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.`name` = 'Productor'
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT ii.company_name IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , s1Value, 5
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.ediTypeFk = ii.ef1
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT s1Value IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , s2Value, 6
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.ediTypeFk = ii.ef2
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT s2Value IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , s3Value, 7
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.ediTypeFk = ii.ef3
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT s3Value IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , s4Value, 8
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.ediTypeFk = ii.ef4
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT s4Value IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , s5Value, 9
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.ediTypeFk = ii.ef5
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT s5Value IS NULL;
+
+ INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id , s6Value, 10
+ FROM itemToInsert ii
+ JOIN vn.tag t ON t.ediTypeFk = ii.ef6
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ WHERE NOT s6Value IS NULL;
+
+ INSERT IGNORE INTO vn.itemTag(itemFk, tagFk, value, priority)
+ SELECT i.id, t.id, IFNULL(ink.name, ik.color), 11
+ FROM itemToInsert ii
+ JOIN vn.item i ON i.supplyResponseFk = ii.`srId`
+ JOIN vn.tag t ON t.`name` = 'Color'
+ LEFT JOIN edi.feature f ON f.item_id = ii.Item_ArticleCode
+ LEFT JOIN edi.`type` tp ON tp.type_id = f.feature_type_id
+ AND tp.`description` = 'Hoofdkleur 1'
+ LEFT JOIN vn.ink ON ink.dutchCode = f.feature_value
+ LEFT JOIN vn.itemInk ik ON ik.longName = i.longName
+ WHERE ink.name IS NOT NULL
+ OR ik.color IS NOT NULL;
+
+ CREATE OR REPLACE TABLE tmp.item
+ (PRIMARY KEY (id))
+ SELECT i.id FROM vn.item i
+ JOIN itemToInsert ii ON i.supplyResponseFk = ii.`srId`;
+
+ CALL vn.item_refreshTags();
+
+ DROP TABLE tmp.item;
+
+ SELECT MIN(LatestDeliveryDateTime) INTO vLanded
+ FROM edi.supplyResponse sr
+ JOIN edi.deliveryInformation di ON di.supplyResponseID = sr.ID
+ JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID
+ JOIN vn.floramondoConfig fc
+ WHERE mp.isLatestOrderDateTimeRelevant
+ AND di.LatestOrderDateTime > IF(
+ fc.MaxLatestOrderHour > HOUR(util.VN_NOW()),
+ util.VN_CURDATE(),
+ util.VN_CURDATE() + INTERVAL 1 DAY);
+
+ UPDATE vn.floramondoConfig
+ SET nextLanded = vLanded
+ WHERE vLanded IS NOT NULL;
+
+ -- Elimina la oferta obsoleta
+ UPDATE vn.buy b
+ JOIN vn.entry e ON e.id = b.entryFk
+ JOIN vn.travel tr ON tr.id = e.travelFk
+ JOIN vn.agencyMode am ON am.id = tr.agencyModeFk
+ JOIN vn.item i ON i.id = b.itemFk
+ LEFT JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID
+ LEFT JOIN edi.deliveryInformation di ON di.ID = b.deliveryFk
+ SET b.quantity = 0
+ WHERE (IFNULL(di.LatestOrderDateTime,util.VN_NOW()) <= util.VN_NOW()
+ OR i.supplyResponseFk IS NULL
+ OR sr.NumberOfUnits = 0)
+ AND am.name = 'LOGIFLORA'
+ AND e.isRaid;
+
+ -- Localiza las entradas de cada almacen
+ UPDATE edi.warehouseFloramondo
+ SET entryFk = vn.entry_getForLogiflora(vLanded + INTERVAL travellingDays DAY, warehouseFk);
+
+ IF vLanded IS NOT NULL THEN
+ -- Actualiza la oferta existente
+ UPDATE vn.buy b
+ JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk
+ JOIN vn.item i ON i.id = b.itemFk
+ JOIN edi.offer o ON i.supplyResponseFk = o.`srId`
+ SET b.quantity = o.NumberOfUnits * o.NumberOfItemsPerCask,
+ b.buyingValue = o.price
+ WHERE (b.quantity <> o.NumberOfUnits * o.NumberOfItemsPerCask
+ OR b.buyingValue <> o.price);
+
+ -- Inserta el resto
+ SET vLastInserted := util.VN_NOW();
+
+ -- Inserta la oferta
+ INSERT INTO vn.buy (
+ entryFk,
+ itemFk,
+ quantity,
+ buyingValue,
+ stickers,
+ packing,
+ `grouping`,
+ groupingMode,
+ packageFk,
+ deliveryFk)
+ SELECT wf.entryFk,
+ i.id,
+ o.NumberOfUnits * o.NumberOfItemsPerCask quantity,
+ o.Price,
+ o.NumberOfUnits etiquetas,
+ o.NumberOfItemsPerCask packing,
+ GREATEST(1, IFNULL(o.MinimumQuantity,0)) * o.NumberOfItemsPerCask `grouping`,
+ 2, -- Obliga al Packing
+ o.embalageCode,
+ o.diId
+ FROM edi.offer o
+ JOIN vn.item i ON i.supplyResponseFk = o.srId
+ JOIN edi.warehouseFloramondo wf
+ JOIN vn.packaging p ON p.id
+ LIKE o.embalageCode
+ LEFT JOIN vn.buy b ON b.itemFk = i.id
+ AND b.entryFk = wf.entryFk
+ WHERE b.id IS NULL; -- Quitar esta linea y mirar de crear los packages a tiempo REAL
+
+ INSERT INTO vn.itemCost(
+ itemFk,
+ warehouseFk,
+ cm3,
+ cm3delivery)
+ SELECT b.itemFk,
+ wf.warehouseFk,
+ @cm3 := vn.buy_getUnitVolume(b.id),
+ IFNULL((vc.standardFlowerBox * 1000) / i.packingOut, @cm3)
+ FROM warehouseFloramondo wf
+ JOIN vn.volumeConfig vc
+ JOIN vn.buy b ON b.entryFk = wf.entryFk
+ JOIN vn.item i ON i.id = b.itemFk
+ LEFT JOIN vn.itemCost ic ON ic.itemFk = b.itemFk
+ AND ic.warehouseFk = wf.warehouseFk
+ WHERE (ic.cm3 IS NULL OR ic.cm3 = 0)
+ ON DUPLICATE KEY UPDATE cm3 = @cm3, cm3delivery = IFNULL((vc.standardFlowerBox * 1000) / i.packingOut, @cm3);
+
+ CREATE OR REPLACE TEMPORARY TABLE tmp.buyRecalc
+ SELECT b.id
+ FROM vn.buy b
+ JOIN warehouseFloramondo wf ON wf.entryFk = b.entryFk
+ WHERE b.created >= vLastInserted;
+
+ CALL vn.buy_recalcPrices();
+
+ UPDATE edi.offerList o
+ JOIN (SELECT v.name, COUNT(DISTINCT b.itemFk) total
+ FROM vn.buy b
+ JOIN vn.item i ON i.id = b.itemFk
+ JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk
+ JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
+ JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk
+ JOIN vn.warehouse w ON w.id = wf.warehouseFk
+ WHERE w.name = 'VNH'
+ AND b.quantity > 0
+ GROUP BY sr.vmpID) sub ON o.supplier = sub.name
+ SET o.vnh = sub.total;
+
+ UPDATE edi.offerList o
+ JOIN (SELECT v.name, COUNT(DISTINCT b.itemFk) total
+ FROM vn.buy b
+ JOIN vn.item i ON i.id = b.itemFk
+ JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk
+ JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
+ JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk
+ JOIN vn.warehouse w ON w.id = wf.warehouseFk
+ WHERE w.name = 'ALGEMESI'
+ AND b.quantity > 0
+ GROUP BY sr.vmpID) sub ON o.supplier = sub.name
+ SET o.algemesi = sub.total;
+ END IF;
+
+ DROP TEMPORARY TABLE
+ edi.offer,
+ itemToInsert;
+
+ SET @isTriggerDisabled = FALSE;
+
+ COMMIT;
+
+ -- Esto habria que pasarlo a procesos programados o trabajar con tags y dejar las familias
+ UPDATE vn.item i
+ SET typeFk = 121
+ WHERE i.longName LIKE 'Rosa Garden %'
+ AND typeFk = 17;
+
+ UPDATE vn.item i
+ SET typeFk = 156
+ WHERE i.longName LIKE 'Rosa ec %'
+ AND typeFk = 17;
+
+ -- Refresca las fotos de los items existentes que mostramos (prioridad baja)
+ INSERT IGNORE INTO vn.itemImageQueue(itemFk, url, priority)
+ SELECT i.id, sr.PictureReference, 100
+ FROM edi.supplyResponse sr
+ JOIN vn.item i ON i.supplyResponseFk = sr.ID
+ JOIN edi.supplyOffer so ON so.srId = sr.ID
+ JOIN hedera.image i2 ON i2.name = i.image
+ AND i2.collectionFk = 'catalog'
+ WHERE i2.updated <= (UNIX_TIMESTAMP(util.VN_NOW()) - vDayRange)
+ AND sr.NumberOfUnits;
+
+ INSERT INTO edi.`log`
+ SET tableName = 'floramondo_offerRefresh',
+ fieldName = 'Tiempo de proceso',
+ fieldValue = TIMEDIFF(util.VN_NOW(), vStartingTime);
+
+ DO RELEASE_LOCK('edi.floramondo_offerRefresh');
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -9793,7 +9793,7 @@ BEGIN
/**
* Devuelve un número nuevo de item a partir de un registro de la tabla edi.ekt
- *
+ *
* @param vEktFk Identificador de la tabla edi.ekt
*/
@@ -9802,17 +9802,17 @@ BEGIN
SELECT MIN(id) id INTO vItemFk
FROM edi.item_free;
- DELETE FROM edi.item_free
+ DELETE FROM edi.item_free
WHERE id = vItemFk;
-
+
COMMIT;
-
+
IF ISNULL(vItemFk) THEN
SELECT MAX(i.id) + 1
INTO vItemFk
FROM vn.item i;
END IF;
-
+
INSERT INTO vn.item(id,
`name`,
longName,
@@ -9838,118 +9838,118 @@ BEGIN
least(IF((e.package = 800),((e.package * 10) + e.pac), e.package), IFNULL(idt.bucket_id, '999')) packageFk,
e.cat,
TRUE
- FROM edi.ekt e
- JOIN edi.item i ON i.id = e.`ref`
- JOIN edi.item_groupToOffer igto ON igto.group_code = i.group_id
- LEFT JOIN edi.item_defaultType idt ON idt.item_id = e.`ref`
+ FROM edi.ekt e
+ JOIN edi.item i ON i.id = e.`ref`
+ JOIN edi.item_groupToOffer igto ON igto.group_code = i.group_id
+ LEFT JOIN edi.item_defaultType idt ON idt.item_id = e.`ref`
WHERE e.id = vEktFk;
SET @isTriggerDisabled = TRUE;
-
+
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.item , 1
- FROM edi.ekt e
+ SELECT vItemFk, t.id , e.item , 1
+ FROM edi.ekt e
JOIN vn.tag t ON t.`name` = 'Producto'
WHERE e.id = vEktFk
AND NOT ISNULL(e.item);
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.cat , 3
- FROM edi.ekt e
+ SELECT vItemFk, t.id , e.cat , 3
+ FROM edi.ekt e
JOIN vn.tag t ON t.`name` = 'Calidad'
WHERE e.id = vEktFk
AND NOT ISNULL(e.cat);
-
+
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , s.company_name , 4
- FROM edi.ekt e
+ SELECT vItemFk, t.id , s.company_name , 4
+ FROM edi.ekt e
JOIN edi.supplier s ON s.supplier_id = e.pro
JOIN vn.tag t ON t.`name` = 'Productor'
WHERE e.id = vEktFk
AND NOT ISNULL(s.company_name);
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.s1, 5
+ SELECT vItemFk, t.id , e.s1, 5
FROM edi.ekt e
- LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
- AND eif.presentation_order = 1
+ LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
+ AND eif.presentation_order = 1
AND eif.expiry_date IS NULL
- LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
+ LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
AND e.s1 = ev.type_value
JOIN vn.tag t ON t.ediTypeFk = eif.feature
WHERE e.id = vEktFk
AND NOT ISNULL(e.s1);
-
+
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.s2, 6
+ SELECT vItemFk, t.id , e.s2, 6
FROM edi.ekt e
- LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
- AND eif.presentation_order = 2
+ LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
+ AND eif.presentation_order = 2
AND eif.expiry_date IS NULL
- LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
+ LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
AND e.s2 = ev.type_value
JOIN vn.tag t ON t.ediTypeFk = eif.feature
WHERE e.id = vEktFk
AND NOT ISNULL(e.s2);
-
+
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.s3, 7
+ SELECT vItemFk, t.id , e.s3, 7
FROM edi.ekt e
- LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
- AND eif.presentation_order = 3
+ LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
+ AND eif.presentation_order = 3
AND eif.expiry_date IS NULL
- LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
+ LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
AND e.s3 = ev.type_value
JOIN vn.tag t ON t.ediTypeFk = eif.feature
WHERE e.id = vEktFk
AND NOT ISNULL(e.s3);
-
+
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.s4, 8
+ SELECT vItemFk, t.id , e.s4, 8
FROM edi.ekt e
- LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
+ LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
AND eif.presentation_order = 4
AND eif.expiry_date IS NULL
- LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
+ LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
AND e.s4 = ev.type_value
JOIN vn.tag t ON t.ediTypeFk = eif.feature
WHERE e.id = vEktFk
AND NOT ISNULL(e.s4);
-
+
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.s5, 9
+ SELECT vItemFk, t.id , e.s5, 9
FROM edi.ekt e
- LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
+ LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
AND eif.presentation_order = 5
AND eif.expiry_date IS NULL
- LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
+ LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
AND e.s5 = ev.type_value
JOIN vn.tag t ON t.ediTypeFk = eif.feature
WHERE e.id = vEktFk
AND NOT ISNULL(e.s5);
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id , e.s6, 10
+ SELECT vItemFk, t.id , e.s6, 10
FROM edi.ekt e
- LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
+ LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref`
AND eif.presentation_order = 6
AND eif.expiry_date IS NULL
- LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
+ LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature
AND e.s6 = ev.type_value
JOIN vn.tag t ON t.ediTypeFk = eif.feature
WHERE e.id = vEktFk
AND NOT ISNULL(e.s6);
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
- SELECT vItemFk, t.id, IFNULL(ink.name, ik.color), 11
- FROM edi.ekt e
+ SELECT vItemFk, t.id, IFNULL(ink.name, ik.color), 11
+ FROM edi.ekt e
JOIN vn.tag t ON t.`name` = 'Color'
- LEFT JOIN edi.feature f ON f.item_id = e.`ref`
+ LEFT JOIN edi.feature f ON f.item_id = e.`ref`
LEFT JOIN edi.`type` tp ON tp.type_id = f.feature_type_id AND tp.`description` = 'Hoofdkleur 1'
LEFT JOIN vn.ink ON ink.dutchCode = f.feature_value
LEFT JOIN vn.itemInk ik ON ik.longName = e.item
WHERE e.id = vEktFk
- AND ( ink.name IS NOT NULL
+ AND ( ink.name IS NOT NULL
OR ik.color IS NOT NULL)
LIMIT 1;
@@ -10016,7 +10016,7 @@ BEGIN
sender = vSender,
senderFk = vSenderId,
messageId = vMessageId;
-
+
IF vIsDuplicated THEN
SELECT id INTO vSelf
FROM mail
@@ -10838,7 +10838,7 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `hedera`.`order_afterInsert`
AFTER INSERT ON `order`
FOR EACH ROW
-BEGIN
+BEGIN
IF NEW.address_id = 2850 THEN
-- Fallo que se insertan no se sabe como tickets en este cliente
CALL vn.mail_insert(
@@ -10847,7 +10847,7 @@ BEGIN
'Creada order al address 2850',
CONCAT(account.myUser_getName(), ' ha creado la order ',NEW.id)
);
-
+
END IF;
END */;;
DELIMITER ;
@@ -10864,27 +10864,27 @@ DELIMITER ;
/*!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 `hedera`.`order_afterUpdate`
- AFTER UPDATE ON `order`
- FOR EACH ROW
-BEGIN
- CALL stock.log_add('order', NEW.id, OLD.id);
-
- IF !(OLD.address_id <=> NEW.address_id)
- OR !(OLD.company_id <=> NEW.company_id)
- OR !(OLD.customer_id <=> NEW.customer_id) THEN
- CALL order_requestRecalc(NEW.id);
- END IF;
-
- IF !(OLD.address_id <=> NEW.address_id) AND NEW.address_id = 2850 THEN
- -- Fallo que se actualiza no se sabe como tickets en este cliente
- CALL vn.mail_insert(
- 'jgallego@verdnatura.es',
- 'noreply@verdnatura.es',
- 'Actualizada order al address 2850',
- CONCAT(account.myUser_getName(), ' ha creado la order ',NEW.id)
- );
- END IF;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `hedera`.`order_afterUpdate`
+ AFTER UPDATE ON `order`
+ FOR EACH ROW
+BEGIN
+ CALL stock.log_add('order', NEW.id, OLD.id);
+
+ IF !(OLD.address_id <=> NEW.address_id)
+ OR !(OLD.company_id <=> NEW.company_id)
+ OR !(OLD.customer_id <=> NEW.customer_id) THEN
+ CALL order_requestRecalc(NEW.id);
+ END IF;
+
+ IF !(OLD.address_id <=> NEW.address_id) AND NEW.address_id = 2850 THEN
+ -- Fallo que se actualiza no se sabe como tickets en este cliente
+ CALL vn.mail_insert(
+ 'jgallego@verdnatura.es',
+ 'noreply@verdnatura.es',
+ 'Actualizada order al address 2850',
+ CONCAT(account.myUser_getName(), ' ha creado la order ',NEW.id)
+ );
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -10999,12 +10999,12 @@ DELIMITER ;;
BEGIN
DECLARE vIsFirst BOOL;
- SELECT (first_row_stamp IS NULL) INTO vIsFirst
- FROM `order`
+ SELECT (first_row_stamp IS NULL) INTO vIsFirst
+ FROM `order`
WHERE id = NEW.orderFk;
IF vIsFirst THEN
- UPDATE `order` SET first_row_stamp = util.VN_NOW()
+ UPDATE `order` SET first_row_stamp = util.VN_NOW()
WHERE id = NEW.orderFk;
END IF;
END */;;
@@ -11593,7 +11593,7 @@ BEGIN
IF vCount = 0 THEN
RETURN FALSE;
- END IF;
+ END IF;
SELECT COUNT(*) > 0
INTO vHasRole
@@ -11674,14 +11674,14 @@ BEGIN
* @return tmp.ticketComponent
* @return tmp.ticketLot
* @return tmp.zoneGetShipped
- */
+ */
DECLARE vAgencyMode INT;
-
+
SELECT a.agencyModeFk
INTO vAgencyMode
FROM myClient c
JOIN vn.address a ON a.clientFk = c.id
- WHERE a.id = vAddress;
+ WHERE a.id = vAddress;
CALL vn.available_calc(vDelivery, vAddress, vAgencyMode);
@@ -11694,7 +11694,7 @@ BEGIN
JOIN tmp.availableCalc a ON a.calcFk = c.calc_id
WHERE c.available > 0
GROUP BY c.item_id;
-
+
CALL vn.catalog_calculate(vDelivery, vAddress, vAgencyMode);
DROP TEMPORARY TABLE tmp.item;
@@ -11796,7 +11796,7 @@ BEGIN
*/
DROP TEMPORARY TABLE IF EXISTS tmp.item;
CREATE TEMPORARY TABLE tmp.item
- ENGINE = MEMORY
+ ENGINE = MEMORY
SELECT vSelf itemFk;
CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
@@ -11836,7 +11836,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getVisible`(
vType INT,
vPrefix VARCHAR(255))
BEGIN
-
+
/**
* Gets visible items of the specified type at specified date.
*
@@ -11845,7 +11845,7 @@ BEGIN
* @param vType The type id
* @param vPrefix The article prefix to filter or %NULL for all
* @return tmp.itemVisible Visible items
- */
+ */
DECLARE vPrefixLen SMALLINT;
DECLARE vFilter VARCHAR(255) DEFAULT NULL;
DECLARE vDateInv DATE DEFAULT vn2008.date_inv();
@@ -11854,13 +11854,13 @@ BEGIN
GET DIAGNOSTICS CONDITION 1
@message = MESSAGE_TEXT;
CALL vn.mail_insert(
- 'cau@verdnatura.es',
- NULL,
+ 'cau@verdnatura.es',
+ NULL,
CONCAT('hedera.item_getVisible error: ', @message),
CONCAT(
- 'warehouse: ', IFNULL(vWarehouse, ''),
- ', Fecha:', IFNULL(vDate, ''),
- ', tipo: ', IFNULL(vType,''),
+ 'warehouse: ', IFNULL(vWarehouse, ''),
+ ', Fecha:', IFNULL(vDate, ''),
+ ', tipo: ', IFNULL(vType,''),
', prefijo: ', IFNULL(vPrefix,'')));
RESIGNAL;
END;
@@ -11939,7 +11939,7 @@ BEGIN
IF(p.depth > 0, p.depth, 0) depth, p.width, p.height,
CEIL(s.quantity / t.packing) etiquetas
FROM vn.item i
- JOIN `filter` f ON f.itemFk = i.id
+ JOIN `filter` f ON f.itemFk = i.id
JOIN currentStock s ON s.itemFk = i.id
LEFT JOIN tmp t ON t.itemFk = i.id
LEFT JOIN vn.packaging p ON p.id = t.packageFk
@@ -12416,15 +12416,15 @@ BEGIN
START TRANSACTION;
- SELECT a.agencyModeFk, a.id
+ SELECT a.agencyModeFk, a.id
INTO vAgencyMode, vAddressFk
- FROM vn.address a
+ FROM vn.address a
WHERE a.id = vAddressFk;
-
+
SELECT deliveryMethodFk INTO vDeliveryMethodId
FROM vn.agencyMode am
WHERE am.id = vAgencyMode;
-
+
IF vCompany IS NULL
THEN
SELECT defaultCompanyFk INTO vCompany
@@ -12442,7 +12442,7 @@ BEGIN
company_id = vCompany;
SET vSelf = LAST_INSERT_ID();
-
+
CALL order_checkConfig(vSelf);
COMMIT;
@@ -12488,15 +12488,15 @@ BEGIN
START TRANSACTION;
- SELECT a.agencyModeFk, a.id
+ SELECT a.agencyModeFk, a.id
INTO vAgencyMode, vAddress
FROM myClient c
JOIN vn.address a ON a.id = c.defaultAddressFk;
-
+
SELECT deliveryMethodFk INTO vDeliveryMethodId
FROM vn.agencyMode am
WHERE am.id = vAgencyMode;
-
+
IF vCompany IS NULL
THEN
SELECT defaultCompanyFk INTO vCompany
@@ -12514,7 +12514,7 @@ BEGIN
company_id = vCompany;
SET vSelf = LAST_INSERT_ID();
-
+
CALL order_checkConfig(vSelf);
COMMIT;
@@ -12697,7 +12697,7 @@ BEGIN
SELECT t.id ticketFk
FROM myTicket t
WHERE shipped BETWEEN TIMESTAMP(vFrom) AND TIMESTAMP(vTo, '23:59:59');
-
+
CALL vn.ticketGetTotal(NULL);
SELECT v.id, IFNULL(v.landed, v.shipped) landed,
@@ -12962,10 +12962,10 @@ BEGIN
CREATE TEMPORARY TABLE tmp.item
(PRIMARY KEY (itemFk))
ENGINE = MEMORY
- SELECT itemFk FROM orderRow
+ SELECT itemFk FROM orderRow
WHERE orderFk = vSelf
GROUP BY itemFk;
-
+
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode);
DROP TEMPORARY TABLE tmp.item;
@@ -13340,7 +13340,7 @@ BEGIN
END;
-- Carga los datos del pedido
- SELECT o.date_send, o.address_id, o.note, a.clientFk,
+ 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
@@ -13661,7 +13661,7 @@ BEGIN
INTO vDelivery, vAddress, vAgencyMode
FROM `order`
WHERE id = vSelf;
-
+
CALL vn.available_calc(vDelivery, vAddress, vAgencyMode);
DROP TEMPORARY TABLE IF EXISTS tmp.itemAvailable;
@@ -13703,7 +13703,7 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany;
CREATE TEMPORARY TABLE tmp.addressCompany
(INDEX (addressFk, companyFk))
- ENGINE = MEMORY
+ ENGINE = MEMORY
SELECT DISTINCT o.address_id addressFk, o.company_id companyFk
FROM tmp.`order` tmpOrder
JOIN hedera.`order` o ON o.id = tmpOrder.orderFk;
@@ -13738,7 +13738,7 @@ BEGIN
JOIN vn.taxClass tc ON tc.id = bp.taxClassFk
GROUP BY tmpOrder.orderFk, pgc.`code`, pgc.rate
HAVING taxableBase != 0;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.orderAmount;
CREATE TEMPORARY TABLE tmp.orderAmount
(INDEX (orderFk))
@@ -13747,7 +13747,7 @@ BEGIN
SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax
FROM tmp.orderTax
GROUP BY orderFk, `code`;
-
+
DROP TEMPORARY TABLE tmp.addressTaxArea;
END ;;
DELIMITER ;
@@ -13817,7 +13817,7 @@ BEGIN
CREATE TEMPORARY TABLE tmp.`order`
ENGINE = MEMORY
SELECT vSelf orderFk;
-
+
CALL order_getTax;
SELECT IFNULL(SUM(taxableBase), 0.0), IFNULL(SUM(tax), 0.0)
@@ -13908,7 +13908,7 @@ proc: BEGIN
FROM orderRow r
JOIN orderRowComponent c ON c.rowFk = r.id
WHERE r.orderFk = vSelf;
-
+
UPDATE orderRow r
LEFT JOIN tmp.ticketComponentPrice p
ON p.warehouseFk = r.warehouseFk
@@ -13933,7 +13933,7 @@ proc: BEGIN
ON t.id = c.componentFk
AND (t.classRate IS NULL OR t.classRate = r.rate)
WHERE r.orderFk = vSelf;
-
+
CALL vn.ticketCalculatePurge;
END IF;
@@ -14461,13 +14461,13 @@ p: BEGIN
AND DATE(FECHA) = vDate
AND EURODEBE = vAmount
LIMIT 1;
-
+
-- Actualiza la transaccion
UPDATE tpvTransaction
SET response = NULL, status = 'started'
WHERE id = vSelf;
-
+
COMMIT;
END ;;
DELIMITER ;
@@ -14500,7 +14500,7 @@ BEGIN
UPDATE userSession SET userVisitFk = vUserVisit
WHERE ssid = vSsid;
-
+
DELETE FROM userSession
WHERE lastUpdate < TIMESTAMPADD(HOUR, -1, util.VN_NOW());
END ;;
@@ -14624,7 +14624,7 @@ BEGIN
UPDATE visitAgent SET firstAccessFk = vAccessId
WHERE id = vAgentId;
END IF;
-
+
-- Returns the visit info
SELECT vVisit visit, vAccessId access;
@@ -15333,7 +15333,7 @@ BEGIN
WHILE vI < vLen
DO
SET vChr = SUBSTR(vPhone, vI + 1, 1);
-
+
IF vChr REGEXP '^[0-9]$'
THEN
SET vNewPhone = CONCAT(vNewPhone, vChr);
@@ -15341,7 +15341,7 @@ BEGIN
THEN
SET vNewPhone = CONCAT(vNewPhone, '00');
END IF;
-
+
SET vI = vI + 1;
END WHILE;
@@ -15440,18 +15440,18 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sip_getExtension`(vUserId INT(10))
BEGIN
-
+
/*
* Devuelve la extensión pbx del usuario
- *
- * @param vUserId Id del usuario
- *
+ *
+ * @param vUserId Id del usuario
+ *
*/
SELECT extension
- FROM sip s
+ FROM sip s
WHERE s.user_id = vUserId;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -16239,22 +16239,22 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `company_getCode`(vCompanyFk INT) RET
READS SQL DATA
BEGIN
/**
- * Devuelve la correspondencía del código de empresa de sage.
+ * Devuelve la correspondencía del código de empresa de sage.
* Tiene en cuenta el entorno
- *
+ *
* @param vSelf Id de empresa de verdnatura
* @return Código de empresa sage
*/
DECLARE vCompanySageFk INT(2);
-
- SELECT IF(c.environment = 'production',
- co.companyCode,
+
+ SELECT IF(c.environment = 'production',
+ co.companyCode,
co.companyCodeTest
) INTO vCompanySageFk
FROM util.config c
JOIN vn.company co
WHERE co.id = vCompanyFk;
-
+
RETURN vCompanySageFk;
END ;;
DELIMITER ;
@@ -16273,12 +16273,12 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `accountingMovements_add`(
- vYear INT,
+ vYear INT,
vCompanyFk INT
)
BEGIN
/**
- * Traslada la info de contabilidad generada en base a vn.XDiario a la tabla sage.movConta
+ * Traslada la info de contabilidad generada en base a vn.XDiario a la tabla sage.movConta
* para poder ejecutar posteriormente el proceso de importación de datos de SQL Server
* Solo traladará los asientos marcados con el campo vn.XDiario.enlazadoSage = FALSE
* @vYear Año contable del que se quiere trasladar la información
@@ -16594,8 +16594,8 @@ BEGIN
mci.FechaFacturaOriginal = x.FECHA_EX,
mci.SuFacturaNo = x.FACTURAEX,
mci.FechaOperacion = x.FECHA_OP,
- mci.ImporteFactura = mci.ImporteFactura +
- x.BASEEURO +
+ mci.ImporteFactura = mci.ImporteFactura +
+ x.BASEEURO +
CAST((x.IVA / 100) * x.BASEEURO AS DECIMAL(10, 2))
WHERE pm.description = 'HP Iva pendiente'
AND mci.enlazadoSage = FALSE
@@ -16614,7 +16614,7 @@ BEGIN
mci.CodigoIva2 = vTaxImportFk,
mci.IvaDeducible2 = TRUE,
mci.ImporteFactura = mci.ImporteFactura +
- x.BASEEURO +
+ x.BASEEURO +
CAST((x.IVA / 100) * x.BASEEURO AS DECIMAL(10, 2))
WHERE pm.description = 'HP Iva pendiente'
AND mci.enlazadoSage = FALSE
@@ -16632,8 +16632,8 @@ BEGIN
mci.CodigoTransaccion3 = vDuaTransactionFk ,
mci.CodigoIva3 = vTaxImportSuperReducedFk,
mci.IvaDeducible3 = TRUE,
- mci.ImporteFactura = mci.ImporteFactura +
- x.BASEEURO +
+ mci.ImporteFactura = mci.ImporteFactura +
+ x.BASEEURO +
CAST((x.IVA / 100) * x.BASEEURO AS DECIMAL(10, 2))
WHERE pm.description = 'HP Iva pendiente'
AND mci.enlazadoSage = FALSE
@@ -16667,14 +16667,14 @@ BEGIN
OR CodigoTransaccion2 = vTransactionExportFk
OR CodigoTransaccion3 = vTransactionExportFk
OR CodigoTransaccion4 = vTransactionExportFk)
- AND SiglaNacion IN (vCountryCanariasCode COLLATE utf8mb3_unicode_ci,
+ AND SiglaNacion IN (vCountryCanariasCode COLLATE utf8mb3_unicode_ci,
vCountryCeutaMelillaCode COLLATE utf8mb3_unicode_ci);
UPDATE movConta mc
SET CodigoDivisa = 'USD',
FactorCambio = TRUE,
- ImporteCambio = ABS( CAST( IF( ImporteDivisa <> 0 AND ImporteCambio = 0,
- ImporteAsiento / ImporteDivisa,
+ ImporteCambio = ABS( CAST( IF( ImporteDivisa <> 0 AND ImporteCambio = 0,
+ ImporteAsiento / ImporteDivisa,
ImporteCambio) AS DECIMAL( 10, 2)))
WHERE enlazadoSage = FALSE
AND (ImporteCambio <> 0 OR ImporteDivisa <> 0 OR FactorCambio);
@@ -16716,8 +16716,8 @@ BEGIN
AND sub.amountTaxableBase/2 <> sub2.amountTaxableBase) sub;
IF vBookEntries IS NOT NULL THEN
- SELECT util.notification_send ("book-entries-imported-incorrectly",
- CONCAT('{"bookEntries":"', vBookEntries,'"}'),
+ SELECT util.notification_send ("book-entries-imported-incorrectly",
+ CONCAT('{"bookEntries":"', vBookEntries,'"}'),
null);
END IF;
END ;;
@@ -16798,8 +16798,8 @@ BEGIN
IF(n.SiglaNacion = vCountryCanariasCode COLLATE utf8mb3_unicode_ci, IF(@isCeutaMelilla := IF(pr.Provincia IN ('CEUTA', 'MELILLA'), TRUE, FALSE), vCountryCeutaMelillaFk, IF (@isCanarias, vCountryCanariasCode, n.CodigoNacion)), n.CodigoNacion),
IF(n.SiglaNacion = vCountryCanariasCode COLLATE utf8mb3_unicode_ci, IF(@isCeutaMelilla, vCountryCeutaMelillaCode, IF (@isCanarias, vCountryCanariasCode, n.SiglaNacion)), n.SiglaNacion),
IF((c.fi REGEXP '^([[:blank:]]|[[:digit:]])'), 'J','F'),
- IF(cu.code = 'ES',
- 1,
+ IF(cu.code = 'ES',
+ 1,
IF((cu.isUeeMember AND c.isVies), 2, 4)),
IFNULL(c.taxTypeSageFk,0),
IF(n.SiglaNacion = vCountryCanariasCode COLLATE utf8mb3_unicode_ci,
@@ -16877,10 +16877,10 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceIn_add`(vInvoiceInFk INT, vX
BEGIN
/**
* Traslada la info de contabilidad relacionada con las facturas recibidas
- *
+ *
* @vInvoiceInFk Factura recibida
* @vXDiarioFk Id tabla XDiario
- */
+ */
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vBase DOUBLE;
DECLARE vVat DOUBLE;
@@ -16897,25 +16897,25 @@ BEGIN
DECLARE vInvoiceTypeInformative VARCHAR(1);
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
- DECLARE vCursor CURSOR FOR
+ DECLARE vCursor CURSOR FOR
SELECT it.taxableBase,
CAST((( it.taxableBase / 100) * t.PorcentajeIva) AS DECIMAL (10,2)),
t.PorcentajeIva,
it.transactionTypeSageFk,
it.taxTypeSageFk,
tty.isIntracommunity,
- tt.ClaveOperacionDefecto
+ tt.ClaveOperacionDefecto
FROM vn.invoiceIn i
JOIN vn.invoiceInTax it ON it.InvoiceInFk = i.id
JOIN TiposIva t ON t.CodigoIva = it.taxTypeSageFk
JOIN taxType tty ON tty.id = t.CodigoIva
JOIN TiposTransacciones tt ON tt.CodigoTransaccion = it.transactionTypeSageFk
LEFT JOIN vn.dua d ON d.id = vInvoiceInFk
- WHERE i.id = vInvoiceInFk
+ WHERE i.id = vInvoiceInFk
AND d.id IS NULL;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
DELETE FROM movContaIVA
WHERE id = vXDiarioFk;
@@ -16938,22 +16938,22 @@ BEGIN
vTaxCode,
vIsIntracommunity,
vOperationCode;
-
- IF vDone THEN
+
+ IF vDone THEN
LEAVE l;
END IF;
- SET vTransactionCodeOld = vTransactionCode;
- SET vTaxCodeOld = vTaxCode;
+ SET vTransactionCodeOld = vTransactionCode;
+ SET vTaxCodeOld = vTaxCode;
- IF vOperationCode IS NOT NULL THEN
+ IF vOperationCode IS NOT NULL THEN
UPDATE movContaIVA
SET ClaveOperacionFactura = vOperationCode
WHERE id = vXDiarioFk;
END IF;
-
+
SET vCounter = vCounter + 1;
- CASE vCounter
+ CASE vCounter
WHEN 1 THEN
UPDATE movContaIVA
SET BaseIva1 = vBase,
@@ -16989,31 +16989,31 @@ BEGIN
WHERE id = vXDiarioFk;
ELSE
SELECT vXDiarioFk INTO vXDiarioFk;
- END CASE;
+ END CASE;
IF vIsIntracommunity THEN
UPDATE movContaIVA
SET Intracomunitaria = TRUE
WHERE id = vXDiarioFk;
END IF;
-
- SET vTransactionCodeOld = vTransactionCode;
- SET vTaxCodeOld = vTaxCode;
-
+
+ SET vTransactionCodeOld = vTransactionCode;
+ SET vTaxCodeOld = vTaxCode;
+
END LOOP;
CLOSE vCursor;
SELECT d.ASIEN AND x.ASIEN IS NULL INTO vIsInformativeExportation
FROM vn.dua d
- LEFT JOIN vn.XDiario x ON x.ASIEN = d.ASIEN
+ LEFT JOIN vn.XDiario x ON x.ASIEN = d.ASIEN
AND x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci
WHERE d.ASIEN = (
SELECT ASIEN
- FROM vn.XDiario
+ FROM vn.XDiario
WHERE id = vXDiarioFk)
LIMIT 1;
-
+
UPDATE movContaIVA mci
JOIN tmp.invoiceIn ii ON ii.id = vInvoiceInFk
JOIN vn.XDiario x ON x.id = mci.id
@@ -17025,13 +17025,13 @@ BEGIN
mci.Serie = ii.serial,
mci.Factura = ii.id,
mci.FechaFactura = ii.issued,
- mci.ImporteFactura = IFNULL(mci.BaseIva1, 0) + IFNULL(mci.CuotaIva1, 0) +
- IFNULL(mci.BaseIva2, 0) + IFNULL(mci.CuotaIva2, 0) +
- IFNULL(mci.BaseIva3, 0) + IFNULL(mci.CuotaIva3, 0) +
+ mci.ImporteFactura = IFNULL(mci.BaseIva1, 0) + IFNULL(mci.CuotaIva1, 0) +
+ IFNULL(mci.BaseIva2, 0) + IFNULL(mci.CuotaIva2, 0) +
+ IFNULL(mci.BaseIva3, 0) + IFNULL(mci.CuotaIva3, 0) +
IFNULL(mci.BaseIva4, 0) + IFNULL(mci.CuotaIva4, 0),
- mci.TipoFactura = IF(id.id,
- IF( ii.serial = vSerialDua COLLATE utf8mb3_unicode_ci, vInvoiceTypeReceived, vInvoiceTypeInformative),
- IF(vIsInformativeExportation,vInvoiceTypeInformative, vInvoiceTypeReceived)),
+ mci.TipoFactura = IF(id.id,
+ IF( ii.serial = vSerialDua COLLATE utf8mb3_unicode_ci, vInvoiceTypeReceived, vInvoiceTypeInformative),
+ IF(vIsInformativeExportation,vInvoiceTypeInformative, vInvoiceTypeReceived)),
mci.CodigoCuentaFactura = x.SUBCTA,
mci.CifDni = IF(LEFT(TRIM(s.nif), 2) = n.SiglaNacion, SUBSTRING(TRIM(s.nif), 3), s.nif),
mci.Nombre = s.name,
@@ -17059,7 +17059,7 @@ BEGIN
JOIN (SELECT SUM(x2.BASEEURO) taxableBase, SUM(x2.EURODEBE) taxBase
FROM vn.XDiario x1
JOIN vn.XDiario x2 ON x1.ASIEN = x2.ASIEN
- WHERE x2.BASEEURO <> 0
+ WHERE x2.BASEEURO <> 0
AND x1.id = vXDiarioFk
)sub
JOIN ClavesOperacion co ON co.Descripcion = 'Arrendamiento de locales de negocio'
@@ -17067,8 +17067,8 @@ BEGIN
mci.ClaveOperacionFactura = IF( t.Retencion = 'ARRENDAMIENTO Y SUBARRENDAMIENTO', co.ClaveOperacionFactura_, mci.ClaveOperacionFactura),
mci.BaseRetencion = IF (t.Retencion = 'ACTIVIDADES AGRICOLAS O GANADERAS', sub.taxableBase + sub.taxBase, sub.taxableBase),
mci.PorRetencion = t.PorcentajeRetencion,
- mci.ImporteRetencion = iit.taxableBase * - 1
- WHERE mci.id = vXDiarioFk
+ mci.ImporteRetencion = iit.taxableBase * - 1
+ WHERE mci.id = vXDiarioFk
AND e.name = 'Retenciones'
AND id.id IS NULL;
@@ -17091,10 +17091,10 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceIn_manager`(vYear INT, vCompanyFk INT)
BEGIN
/**
- * Traslada la info de contabilidad relacionada con las facturas recibidas
- *
+ * Traslada la info de contabilidad relacionada con las facturas recibidas
+ *
* @vYear Año contable del que se quiere trasladar la información
- * @vCompany Empresa de la que se quiere trasladar datos
+ * @vCompany Empresa de la que se quiere trasladar datos
*/
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vInvoiceFk INT;
@@ -17106,22 +17106,22 @@ BEGIN
DECLARE vAccountTaxOutstanding VARCHAR(10);
DECLARE vInvoiceTypeSended VARCHAR(1);
DECLARE vCursor CURSOR FOR
- SELECT IFNULL(x.CLAVE, x.FACTURA) invoiceInFk,
+ SELECT IFNULL(x.CLAVE, x.FACTURA) invoiceInFk,
x.id XDiarioFk
- FROM vn.XDiario x
+ FROM vn.XDiario x
JOIN(SELECT DISTINCT(x.ASIEN)
FROM vn.XDiario x
LEFT JOIN vn.invoiceIn ii ON x.CLAVE = ii.id
LEFT JOIN vn.invoiceInTax it ON it.invoiceInFk = ii.id
- WHERE(it.taxTypeSageFk IS NOT NULL OR x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci)
- AND x.enlazadoSage = FALSE
+ WHERE(it.taxTypeSageFk IS NOT NULL OR x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci)
+ AND x.enlazadoSage = FALSE
AND x.FECHA BETWEEN vDatedFrom AND vDatedTo
- AND x.empresa_id = vCompanyFk
+ AND x.empresa_id = vCompanyFk
) sub ON sub.ASIEN = x.ASIEN
WHERE x.CLAVE IS NOT NULL;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
SELECT CAST(CONCAT(vYear, '-01-01') AS DATETIME), util.dayEnd(CAST(CONCAT(vYear, '-12-31') AS DATE))
INTO vDatedFrom, vDatedTo;
@@ -17135,15 +17135,15 @@ BEGIN
SELECT codeSage INTO vInvoiceTypeSended
FROM invoiceType WHERE `code` ='sended';
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.invoiceDua;
CREATE TEMPORARY TABLE tmp.invoiceDua
- SELECT x.id
+ SELECT x.id
FROM vn.XDiario x
JOIN vn.company c ON c.id = x.empresa_id
JOIN (SELECT ASIEN
- FROM vn.XDiario x
- WHERE x.enlazadoSage = FALSE
+ FROM vn.XDiario x
+ WHERE x.enlazadoSage = FALSE
AND x.SUBCTA = vAccountTaxOutstanding COLLATE utf8mb3_unicode_ci
AND x.FECHA BETWEEN vDatedFrom AND vDatedTo
)sub ON sub.ASIEN = x.ASIEN
@@ -17161,7 +17161,7 @@ BEGIN
FROM vn.invoiceIn i
JOIN vn.currency c ON c.id = i.currencyFk
WHERE i.bookEntried BETWEEN vDatedFrom AND vDatedTo
- UNION ALL
+ UNION ALL
SELECT d.id,
d.code,
vSerialDua COLLATE utf8mb3_unicode_ci,
@@ -17169,8 +17169,8 @@ BEGIN
d.issued,
FALSE,
'' -- EUROS
- FROM vn.dua d
- WHERE d.issued IS NOT NULL
+ FROM vn.dua d
+ WHERE d.issued IS NOT NULL
AND code IS NOT NULL;
OPEN vCursor;
@@ -17178,7 +17178,7 @@ BEGIN
l: LOOP
FETCH vCursor INTO vInvoiceFk, vXDiarioFk;
- IF vDone THEN
+ IF vDone THEN
LEAVE l;
END IF;
CALL invoiceIn_add(vInvoiceFk, vXDiarioFk);
@@ -17266,21 +17266,21 @@ BEGIN
JOIN (SELECT x.ASIEN, x.id
FROM vn.XDiario x
JOIN(SELECT DISTINCT(x.ASIEN) ASIEN
- FROM vn.XDiario x
+ FROM vn.XDiario x
JOIN (SELECT DISTINCT(ASIEN)
FROM vn.XDiario x
- WHERE SUBCTA LIKE '472%'
+ WHERE SUBCTA LIKE '472%'
AND x.enlazadoSage = FALSE
AND x.empresa_id = vCompanyFk
AND x.FECHA BETWEEN vDatedFrom AND vDatedTo
) sub ON sub.ASIEN = x.ASIEN
WHERE x.SUBCTA LIKE '477%'
)sub2 ON sub2.ASIEN = x.ASIEN
- WHERE x.CONTRA IS NOT NULL
+ WHERE x.CONTRA IS NOT NULL
AND x.SUBCTA LIKE '477%'
GROUP BY x.ASIEN
)sub3 ON sub3.ASIEN = x.ASIEN;
-
+
INSERT INTO movContaIVA
(`id`,
`CodigoDivisa`,
@@ -17351,9 +17351,9 @@ BEGIN
`FechaGrabacion`,
`Intracomunitaria`,
`moveData`)
- SELECT *
+ SELECT *
FROM tmp.movContaIVA;
-
+
DROP TEMPORARY TABLE tmp.movContaIVA;
END ;;
@@ -17375,10 +17375,10 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_add`(IN vInvoiceOutFk INT, IN vXDiarioFk INT)
BEGIN
/**
- * Traslada la info de contabilidad relacionada con las facturas emitidas
- *
+ * Traslada la info de contabilidad relacionada con las facturas emitidas
+ *
* @vYear Año contable del que se quiere trasladar la información
- * @vCompany Empresa de la que se quiere trasladar datos
+ * @vCompany Empresa de la que se quiere trasladar datos
*/
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vMaxLengthName INT DEFAULT 35;
@@ -17398,12 +17398,12 @@ BEGIN
DECLARE vHasCustomsAccountingNote BOOL;
DECLARE vCursor CURSOR FOR
- SELECT oit.taxableBase,
- oit.vat,
- pgc.rate,
- pgc.mod347,
- pgcRE.rate,
- oitRE.vat,
+ SELECT oit.taxableBase,
+ oit.vat,
+ pgc.rate,
+ pgc.mod347,
+ pgcRE.rate,
+ oitRE.vat,
tc.transactionCode,
tc.taxCode,
tc.isIntracommunity,
@@ -17412,7 +17412,7 @@ BEGIN
JOIN vn.pgc ON pgc.code = oit.pgcFk
LEFT JOIN vn.pgcEqu e ON e.vatFk = oit.pgcFk
LEFT JOIN vn.pgcEqu eRE ON eRE.equFk = oit.pgcFk
- LEFT JOIN vn.invoiceOutTax oitRE ON oitRE.invoiceOutFk = oit.invoiceOutFk
+ LEFT JOIN vn.invoiceOutTax oitRE ON oitRE.invoiceOutFk = oit.invoiceOutFk
AND oitRE.pgcFk = e.equFk
LEFT JOIN vn.pgc pgcRE ON pgcRE.code = oitRE.pgcFk
LEFT JOIN vn.taxCode tc ON tc.code = pgc.code COLLATE 'utf8mb3_unicode_ci'
@@ -17428,12 +17428,12 @@ BEGIN
WHERE ASIEN = (SELECT ASIEN FROM vn.XDiario WHERE id = vXDiarioFk);
SELECT codeSage INTO vInvoiceTypeSended
- FROM invoiceType
+ FROM invoiceType
WHERE code = IF(vHasCustomsAccountingNote, 'informative', 'sended');
-
+
DELETE FROM movContaIVA
WHERE id = vXDiarioFk;
-
+
INSERT INTO movContaIVA(id) VALUES (vXDiarioFk);
OPEN vCursor;
@@ -17450,13 +17450,13 @@ BEGIN
vIsIntracommunity,
vOperationCode;
- IF vDone THEN
+ IF vDone THEN
LEAVE l;
END IF;
SET vCounter = vCounter + 1;
-
- CASE vCounter
+
+ CASE vCounter
WHEN 1 THEN
UPDATE movContaIVA
SET BaseIva1 = vBase,
@@ -17497,7 +17497,7 @@ BEGIN
CodigoTransaccion4 = vTransactionCode,
CodigoIva4 = vTaxCode
WHERE id = vXDiarioFk;
- END CASE;
+ END CASE;
UPDATE movContaIVA
SET Exclusion347 = NOT vMod347,
@@ -17508,7 +17508,7 @@ BEGIN
END LOOP;
CLOSE vCursor;
-
+
UPDATE movContaIVA mci
JOIN vn.invoiceOut i ON i.id = vInvoiceOutFk
LEFT JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutFk
@@ -17533,25 +17533,25 @@ BEGIN
mci.MantenerAsiento = TRUE,
mci.FechaFacturaOriginal = x.FECHA_EX
WHERE mci.id = vXDiarioFk;
-
+
SELECT correctedFk INTO vInvoiceOutCorrectedFk
FROM vn.invoiceCorrection
WHERE correctingFk = vInvoiceOutFk;
-
- IF vInvoiceOutCorrectedFk THEN
+
+ IF vInvoiceOutCorrectedFk THEN
UPDATE movContaIVA mci
JOIN vn.invoiceOut i ON i.id = vInvoiceOutCorrectedFk
JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutCorrectedFk
- JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase,
+ JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase,
SUM(IF(IFNULL(e.vatFk, TRUE), iot.vat, 0)) vat,
SUM(IF(IFNULL(e.vatFk, TRUE), 0, iot.vat)) equ
FROM vn.invoiceOutTax iot
- LEFT JOIN vn.pgcEqu e ON e.vatFk = iot.pgcFk
+ LEFT JOIN vn.pgcEqu e ON e.vatFk = iot.pgcFk
WHERE iot.invoiceOutFk = vInvoiceOutCorrectedFk
) tax
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
SET mci.TipoRectificativa = 2,
- mci.ClaseAbonoRectificativas = 1,
+ mci.ClaseAbonoRectificativas = 1,
mci.FechaFacturaOriginal = i.issued,
mci.FechaOperacion = i.issued,
mci.BaseImponibleOriginal = tax.taxableBase,
@@ -17582,10 +17582,10 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_manager`(vYear INT, vCompanyFk INT)
BEGIN
/**
- * Traslada la info de contabilidad relacionada con las facturas emitidas
- *
+ * Traslada la info de contabilidad relacionada con las facturas emitidas
+ *
* @vYear Año contable del que se quiere trasladar la información
- * @vCompany Empresa de la que se quiere trasladar datos
+ * @vCompany Empresa de la que se quiere trasladar datos
*/
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vInvoiceFk INT;
@@ -17602,7 +17602,7 @@ BEGIN
JOIN (SELECT x.ASIEN, CONCAT(x.SERIE, x.FACTURA) refFk
FROM vn.XDiario x
WHERE x.enlazadoSage = FALSE
- AND x.FACTURA
+ AND x.FACTURA
AND x.empresa_id = vCompanyFk
AND x.FECHA BETWEEN vDatedFrom AND vDatedTo
GROUP BY refFk
@@ -17611,19 +17611,19 @@ BEGIN
)sub2 ON sub2.refFk = i.ref;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
SELECT CAST(CONCAT(vYear, '-01-01') AS DATETIME), util.dayEnd(CAST(CONCAT(vYear, '-12-31') AS DATE))
INTO vDatedFrom, vDatedTo;
-
+
OPEN vCursor;
l: LOOP
FETCH vCursor INTO vInvoiceFk, vXDiarioFk;
- IF vDone THEN
+ IF vDone THEN
LEAVE l;
END IF;
-
+
CALL invoiceOut_add(vInvoiceFk, vXDiarioFk);
END LOOP;
@@ -17649,7 +17649,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `pgc_add`(vCompanyFk INT)
BEGIN
/**
- * Añade cuentas del plan general contable para exportarlos a Sage
+ * Añade cuentas del plan general contable para exportarlos a Sage
* @vCompanyFk Empresa de la que se quiere trasladar datos
*/
TRUNCATE TABLE planCuentasPGC;
@@ -17659,25 +17659,25 @@ BEGIN
CodigoCuenta,
Cuenta,
ClienteOProveedor)
- SELECT *
+ SELECT *
FROM (SELECT company_getCode(vCompanyFk) companyFk,
e.id accountFk,
UCASE(e.name),
''
FROM vn.expence e
- UNION
+ UNION
SELECT company_getCode(vCompanyFk),
- b.account,
+ b.account,
UCASE(b.bank),
- ''
+ ''
FROM vn.bank b
WHERE b.isActive
AND b.`account`
- UNION
+ UNION
SELECT CodigoEmpresa,
CodigoCuenta,
Nombre,
- ClienteOProveedor
+ ClienteOProveedor
FROM clientesProveedores)sub
GROUP BY companyFk, accountFk;
END ;;
@@ -18026,7 +18026,7 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
SET NEW.isPicked = NEW.isPicked OR NEW.dated < util.VN_CURDATE();
-
+
CALL visible_log(
NEW.isPicked,
NEW.warehouseFk,
@@ -18150,7 +18150,7 @@ DELIMITER ;;
BEGIN
SET NEW.lack = NEW.quantity;
SET NEW.isPicked = NEW.isPicked OR NEW.dated < util.VN_CURDATE();
-
+
CALL visible_log(
NEW.isPicked,
NEW.warehouseFk,
@@ -18361,7 +18361,7 @@ BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET vDone = TRUE;
-
+
SET vSupplied = 0;
OPEN vPicks;
@@ -18377,7 +18377,7 @@ BEGIN
SET vPickGranted = LEAST(vRequested - vSupplied, vPickQuantity);
SET vSupplied = vSupplied + vPickGranted;
CALL inbound_removePick(vSelf, vOutboundFk, vPickGranted, vPickQuantity);
-
+
UPDATE outbound
SET isSync = FALSE,
lack = lack + vPickGranted
@@ -18457,7 +18457,7 @@ BEGIN
END IF;
SET vSupplied = LEAST(vAvailable, vLack);
-
+
IF vSupplied > 0 THEN
SET vAvailable = vAvailable - vSupplied;
UPDATE outbound
@@ -18470,7 +18470,7 @@ BEGIN
SET vSupplied = vSupplied + vSuppliedFromRequest;
SET vAvailable = vAvailable - vSuppliedFromRequest;
END IF;
-
+
IF vSupplied > 0 THEN
CALL inbound_addPick(vSelf, vOutboundFk, vSupplied);
END IF;
@@ -18599,7 +18599,7 @@ BEGIN
DO RELEASE_LOCK('stock.log_sync');
RESIGNAL;
END;
-
+
IF !GET_LOCK('stock.log_sync', 30) THEN
CALL util.throw('Lock timeout exceeded');
END IF;
@@ -19070,7 +19070,7 @@ BEGIN
SET vPickGranted = LEAST(vRequested - vSupplied, vPickQuantity);
SET vSupplied = vSupplied + vPickGranted;
CALL inbound_removePick(vInboundFk, vSelf, vPickGranted, vPickQuantity);
-
+
UPDATE inbound
SET isSync = FALSE,
available = available + vPickGranted
@@ -19510,11 +19510,11 @@ BEGIN
WHILE vI < vLen
DO
SET vSpaceIni = vI;
-
+
WHILE MID(vString, vI, 1) REGEXP '[[:space:]]' DO
SET vI = vI + 1;
END WHILE;
-
+
SET vWordIni = vI;
SET vI = vWordIni + 1;
@@ -19551,11 +19551,11 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `crypt`(vText VARCHAR(255), vKey VARC
BEGIN
DECLARE vResult VARCHAR(255);
-
+
CALL vn.crypt(vText, vKey, vResult);
RETURN vResult;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -19577,11 +19577,11 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `cryptOff`(vText VARCHAR(255), vKey V
BEGIN
DECLARE vResult VARCHAR(255);
-
+
CALL vn.cryptOff(vText, vKey, vResult);
RETURN vResult;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -19749,7 +19749,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `hasDateOverlapped`(vSarted1 DATE, vEnded1 DATE, vSarted2 DATE, vEnded2 DATE) RETURNS tinyint(1)
DETERMINISTIC
-BEGIN
+BEGIN
RETURN GREATEST(vSarted1, vSarted2) <= LEAST(vEnded1,vEnded2);
@@ -19778,7 +19778,7 @@ BEGIN
*/
DECLARE vHashlen INT UNSIGNED;
DECLARE vOpad, vIpad TINYBLOB;
-
+
CASE vAlg
WHEN 224 THEN SET vHashlen = 64;
WHEN 256 THEN SET vHashlen = 64;
@@ -19786,16 +19786,16 @@ BEGIN
WHEN 512 THEN SET vHashlen = 128;
ELSE CALL throw ('WRONG_ALGORYTHM_IDENTIFICATOR_USED');
END CASE;
-
+
IF LENGTH(vKey) > vHashlen THEN
SET vKey = UNHEX(SHA2(vKey, vAlg));
END IF;
-
+
SET vKey = RPAD(vKey, vHashlen, 0x00);
-
+
SET vIpad = stringXor(vKey, 0x36);
SET vOpad = stringXor(vKey, 0x5C);
-
+
RETURN SHA2(CONCAT(vOpad, UNHEX(SHA2(CONCAT(vIpad, vMsg), vAlg))), vAlg);
END ;;
DELIMITER ;
@@ -19818,7 +19818,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `isLeapYear`(vYear INT) RETURNS tinyi
BEGIN
RETURN (DAYOFYEAR(CONCAT(vYear, "-02-29")) IS NOT NULL);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -19977,7 +19977,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `midnight`() RETURNS datetime
READS SQL DATA
BEGIN
-
+
RETURN TIMESTAMP(util.VN_CURDATE(), '23:59:59');
END ;;
@@ -20105,7 +20105,7 @@ BEGIN
* modo 3.
*/
DECLARE vYear INT DEFAULT FLOOR(vYearWeek / 100);
-
+
IF vYearWeek < YEARWEEK(CONCAT(vYear, '-12-31'), 3) THEN
RETURN vYearWeek + 1;
ELSE
@@ -20211,16 +20211,16 @@ BEGIN
*/
DECLARE vLen, vPos INT UNSIGNED;
DECLARE vResult MEDIUMBLOB;
-
+
SET vLen = LENGTH(vString);
SET vPos = 1;
SET vResult = '';
-
+
WHILE vPos <= vLen DO
SET vResult = CONCAT(vResult, LPAD(HEX( ORD(SUBSTR(vString, vPos, 1)) ^ vConst), 2, '0'));
SET vPos = vPos + 1;
END WHILE;
-
+
RETURN UNHEX(vResult);
END ;;
DELIMITER ;
@@ -20491,11 +20491,11 @@ BEGIN
IF vYear = vCurYear THEN
RETURN 'curYear';
END IF;
-
+
IF vYear = vCurYear - 1 THEN
RETURN 'lastYear';
END IF;
-
+
IF vYear = vCurYear - 2 THEN
RETURN 'twoYearsAgo';
END IF;
@@ -20578,7 +20578,7 @@ BEGIN
* @param vValue Valor de la variable
*/
DECLARE vIndex INT DEFAULT INSTR(USER(), '@');
-
+
INSERT INTO debug SET
`connectionId` = CONNECTION_ID(),
`user` = LEFT(USER(), vIndex - 1),
@@ -20981,7 +20981,7 @@ BEGIN
INSERT INTO tmp.time (dated) VALUES (vCurrentDate);
SET vCurrentDate = DATE_ADD(vCurrentDate, INTERVAL 1 DAY);
END WHILE;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -21375,11 +21375,11 @@ BEGIN
END IF;
IF NEW.isEqualizated IS NULL THEN
- SELECT isEqualizated
+ SELECT isEqualizated
INTO vIsEqualizated
FROM client
WHERE id = NEW.clientFk;
-
+
SET NEW.isEqualizated = vIsEqualizated;
END IF;
END */;;
@@ -21401,7 +21401,7 @@ DELIMITER ;;
BEFORE UPDATE ON `address`
FOR EACH ROW
BEGIN
-
+
SET NEW.editorFk = account.myUser_getId();
IF !(NEW.phone <=> OLD.phone) AND (NEW.phone <> '') THEN
@@ -21433,16 +21433,16 @@ DELIMITER ;;
BEGIN
-- Recargos de equivalencia distintos implican facturacion por consignatario
IF NEW.isEqualizated != OLD.isEqualizated THEN
- IF
+ IF
(SELECT COUNT(*) FROM
(
SELECT DISTINCT (isEqualizated = FALSE) as Equ
- FROM address
+ FROM address
WHERE clientFk = NEW.clientFk
) t1
) > 1
- THEN
- UPDATE client
+ THEN
+ UPDATE client
SET hasToInvoiceByAddress = TRUE
WHERE id = NEW.clientFk;
END IF;
@@ -21450,10 +21450,10 @@ BEGIN
IF NEW.isDefaultAddress AND NEW.isActive = FALSE THEN
CALL util.throw ('Cannot desactivate the default address');
END IF;
-
+
IF NOT (NEW.isEqualizated <=> OLD.isEqualizated) THEN
INSERT IGNORE INTO ticketRecalc (ticketFk)
- SELECT id FROM ticket t
+ SELECT id FROM ticket t
WHERE t.addressFk = NEW.id
AND t.refFk IS NULL;
END IF;
@@ -21870,8 +21870,8 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_BI`
BEFORE INSERT ON `autonomy`
FOR EACH ROW
-BEGIN
-
+BEGIN
+
SET NEW.geoFk = zoneGeo_new('autonomy', NEW.`name`, (SELECT geoFk FROM country WHERE id = NEW.countryFk));
END */;;
@@ -21921,7 +21921,7 @@ DELIMITER ;;
AFTER DELETE ON `autonomy`
FOR EACH ROW
BEGIN
- CALL zoneGeo_delete(OLD.geoFk);
+ CALL zoneGeo_delete(OLD.geoFk);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -21996,7 +21996,7 @@ DELIMITER ;;
BEFORE INSERT ON `awb`
FOR EACH ROW
BEGIN
-
+
SET NEW.year= year(util.VN_CURDATE());
@@ -22370,11 +22370,11 @@ DELIMITER ;;
BEFORE INSERT ON `budgetNotes`
FOR EACH ROW
BEGIN
-
+
IF ISNULL(NEW.userFk) THEN
-
+
SET NEW.userFk = account.myUser_getId();
-
+
END IF;
END */;;
@@ -22468,7 +22468,7 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
-
+
IF NEW.ended IS NULL THEN
SET NEW.payedHolidays = 0;
END IF;
@@ -22514,25 +22514,25 @@ BEGIN
DECLARE isOverlapping BOOL;
SET NEW.editorFk = account.myUser_getId();
-
+
IF NEW.ended IS NULL THEN
SET NEW.payedHolidays = 0;
END IF;
IF !(OLD.started <=> NEW.started AND OLD.ended <=> NEW.ended) THEN
-
+
SELECT COUNT(*) > 0 INTO isOverlapping
FROM business b
WHERE (util.hasDateOverlapped(
- NEW.started,
+ NEW.started,
IFNULL(NEW.ended, b.started),
b.started,
IFNULL(b.ended, NEW.started))
OR (NEW.ended <=> NULL AND b.ended <=> NULL))
AND b.id <> OLD.id
AND workerFk = OLD.workerFk;
-
- IF isOverlapping THEN
+
+ IF isOverlapping THEN
CALL util.throw ('IS_OVERLAPPING');
END IF;
@@ -22793,7 +22793,7 @@ trig: BEGIN
END IF;
END IF;
IF NEW.quantity < 0 THEN
- SET NEW.isIgnored = TRUE;
+ SET NEW.isIgnored = TRUE;
END IF;
END */;;
DELIMITER ;
@@ -22988,7 +22988,7 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`buy_beforeDelete`
BEFORE DELETE ON buy
FOR EACH ROW
-BEGIN
+BEGIN
IF OLD.printedStickers <> 0 THEN
CALL util.throw("it is not possible to delete buys with printed labels ");
END IF;
@@ -24192,7 +24192,7 @@ BEGIN
END IF;
SET NEW.accountingAccount = 4300000000 + NEW.id;
-
+
SET NEW.lastSalesPersonFk = NEW.salesPersonFk;
END */;;
DELIMITER ;
@@ -24217,7 +24217,7 @@ BEGIN
DECLARE vPayMethodFk INT;
SET NEW.editorFk = account.myUser_getId();
-
+
-- Comprueba que el formato de los teléfonos es válido
IF !(NEW.phone <=> OLD.phone) AND (NEW.phone <> '') THEN
@@ -24299,18 +24299,18 @@ BEGIN
IF !(NEW.defaultAddressFk <=> OLD.defaultAddressFk) THEN
UPDATE `address` SET isDefaultAddress = 0
WHERE clientFk = NEW.id;
-
+
UPDATE `address` SET isDefaultAddress = 1
- WHERE id = NEW.defaultAddressFk;
+ WHERE id = NEW.defaultAddressFk;
END IF;
IF NOT (NEW.provinceFk <=> OLD.provinceFk) OR NOT (NEW.isVies <=> OLD.isVies) THEN
INSERT IGNORE INTO ticketRecalc (ticketFk)
- SELECT id FROM ticket t
+ SELECT id FROM ticket t
WHERE t.clientFk = NEW.id
AND t.refFk IS NULL;
END IF;
-
+
IF NOT NEW.isActive THEN
UPDATE account.`user`
SET active = FALSE
@@ -24506,15 +24506,15 @@ DELIMITER ;;
AFTER INSERT
ON clientCredit FOR EACH ROW
BEGIN
-
+
DECLARE vSender VARCHAR(50);
SELECT u.name INTO vSender
FROM account.`user` u
WHERE u.id = NEW.workerFk;
-
+
IF vSender IN ('juanvi','pepe') THEN
-
+
CALL `vn`.`mail_insert`('pako@verdnatura.es',
NULL,
CONCAT('ClientCredit ',vSender, ' ', NEW.clientFk, ' ' , NEW.amount, ' €'),
@@ -25095,7 +25095,7 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`cmr_beforeDelete`
BEFORE DELETE ON `cmr`
FOR EACH ROW
-BEGIN
+BEGIN
IF NOT (OLD.companyFk <=> NULL AND OLD.addressFromFk <=> NULL AND OLD.packagesList <=> NULL) THEN
CALL util.throw("Can not delete cmr, fields required not empty");
END IF;
@@ -25226,39 +25226,39 @@ CREATE TABLE `collection` (
/*!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 `vn`.`collection_BEFORE_UPDATE`
- BEFORE UPDATE ON `collection`
- FOR EACH ROW
-BEGIN
-
- DECLARE vStateFk INT;
- DECLARE vTotalLines INT;
- DECLARE vPickedLines INT;
-
- IF NEW.saleTotalCount <= NEW.salePickedCount
- AND (NEW.saleTotalCount != OLD.saleTotalCount
- OR NEW.salePickedCount != OLD.salePickedCount)
- THEN
-
- SELECT id INTO vStateFk
- FROM vn.state
- WHERE code = 'PREPARED';
-
- SET NEW.stateFk = vStateFk;
-
- END IF;
-
- IF NEW.saleTotalCount > NEW.salePickedCount
- AND (NEW.saleTotalCount != OLD.saleTotalCount OR NEW.salePickedCount != OLD.salePickedCount) THEN
-
- SELECT id INTO vStateFk
- FROM vn.state
- WHERE code = 'ON_PREPARATION';
-
- SET NEW.stateFk = vStateFk;
-
- END IF;
-
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`collection_BEFORE_UPDATE`
+ BEFORE UPDATE ON `collection`
+ FOR EACH ROW
+BEGIN
+
+ DECLARE vStateFk INT;
+ DECLARE vTotalLines INT;
+ DECLARE vPickedLines INT;
+
+ IF NEW.saleTotalCount <= NEW.salePickedCount
+ AND (NEW.saleTotalCount != OLD.saleTotalCount
+ OR NEW.salePickedCount != OLD.salePickedCount)
+ THEN
+
+ SELECT id INTO vStateFk
+ FROM vn.state
+ WHERE code = 'PREPARED';
+
+ SET NEW.stateFk = vStateFk;
+
+ END IF;
+
+ IF NEW.saleTotalCount > NEW.salePickedCount
+ AND (NEW.saleTotalCount != OLD.saleTotalCount OR NEW.salePickedCount != OLD.salePickedCount) THEN
+
+ SELECT id INTO vStateFk
+ FROM vn.state
+ WHERE code = 'ON_PREPARATION';
+
+ SET NEW.stateFk = vStateFk;
+
+ END IF;
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -26194,7 +26194,7 @@ BEGIN
UPDATE `client` c
JOIN vn.creditClassification cc ON cc.client = c.id
SET creditInsurance = NEW.credit WHERE cc.id = NEW.creditClassification;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -26463,7 +26463,7 @@ BEGIN
JOIN vn.department d ON d.id = b.departmentFk
SET b.departmentFk = d.parentFk
WHERE b.departmentFk = OLD.id;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -26483,9 +26483,9 @@ DELIMITER ;;
AFTER DELETE ON `department`
FOR EACH ROW
BEGIN
-
+
UPDATE vn.department_recalc SET isChanged = TRUE;
-
+
UPDATE vn.business b
JOIN vn.department d ON d.id = b.departmentFk
SET b.departmentFk = d.parentFk
@@ -26988,20 +26988,20 @@ DELIMITER ;;
BEGIN
DECLARE vHardCopyNumber INT;
DECLARE vDmsTypeCode INT;
-
+
IF (SELECT NOT hasDms FROM warehouse WHERE id = NEW.warehouseFk) THEN
CALL util.throw('this warehouse has not dms');
END IF;
IF NEW.hasFile THEN
- SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber
- FROM dms
+ SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber
+ FROM dms
WHERE warehouseFk = NEW.warehouseFk;
-
+
SET NEW.hardCopyNumber = IFNULL(vHardCopyNumber,1);
END IF;
-
- SELECT code INTO vDmsTypeCode
+
+ SELECT code INTO vDmsTypeCode
FROM dmsType WHERE NEW.dmsTypeFk = id;
IF (vDmsTypeCode ='ticket') THEN
UPDATE ticket SET isSigned = 1 WHERE id = NEW.reference;
@@ -27021,31 +27021,31 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`dms_beforeUpdate`
- BEFORE UPDATE ON `dms`
- FOR EACH ROW
-BEGIN
- DECLARE vHardCopyNumber INT;
-
- IF (NEW.hasFile <> 0) AND (OLD.hasFile = 0) AND (NEW.hardCopyNumber IS NULL)
- OR
- (NEW.hardCopyNumber = OLD.hardCopyNumber AND OLD.warehouseFk <> NEW.warehouseFk) THEN
-
- IF (SELECT NOT hasDms FROM warehouse WHERE id = NEW.warehouseFk) THEN
- SET NEW.warehouseFk = (SELECT id FROM warehouse WHERE name = 'Algemesi');
- END IF;
-
- SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber
- FROM dms
- WHERE warehouseFk = NEW.warehouseFk;
-
- SET NEW.hardCopyNumber = IFNULL(vHardCopyNumber,1);
- END IF;
-
- IF ((NEW.hardCopyNumber = 0) OR NEW.hardCopyNumber IS NULL) AND (OLD.hardCopyNumber <> 0) THEN
-
- SET NEW.hasFile = 0;
- END IF;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`dms_beforeUpdate`
+ BEFORE UPDATE ON `dms`
+ FOR EACH ROW
+BEGIN
+ DECLARE vHardCopyNumber INT;
+
+ IF (NEW.hasFile <> 0) AND (OLD.hasFile = 0) AND (NEW.hardCopyNumber IS NULL)
+ OR
+ (NEW.hardCopyNumber = OLD.hardCopyNumber AND OLD.warehouseFk <> NEW.warehouseFk) THEN
+
+ IF (SELECT NOT hasDms FROM warehouse WHERE id = NEW.warehouseFk) THEN
+ SET NEW.warehouseFk = (SELECT id FROM warehouse WHERE name = 'Algemesi');
+ END IF;
+
+ SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber
+ FROM dms
+ WHERE warehouseFk = NEW.warehouseFk;
+
+ SET NEW.hardCopyNumber = IFNULL(vHardCopyNumber,1);
+ END IF;
+
+ IF ((NEW.hardCopyNumber = 0) OR NEW.hardCopyNumber IS NULL) AND (OLD.hardCopyNumber <> 0) THEN
+
+ SET NEW.hasFile = 0;
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -27064,14 +27064,14 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`dms_beforeDelete`
BEFORE DELETE ON `dms`
FOR EACH ROW
-BEGIN
+BEGIN
DECLARE vCanNotBeDeleted INT;
- SELECT COUNT(*) INTO vCanNotBeDeleted
- FROM dmsType dt
- WHERE NOT (code <=> 'trash')
+ SELECT COUNT(*) INTO vCanNotBeDeleted
+ FROM dmsType dt
+ WHERE NOT (code <=> 'trash')
AND dt.id = OLD.dmsTypeFk;
-
- IF vCanNotBeDeleted THEN
+
+ IF vCanNotBeDeleted THEN
CALL util.throw('A dms can not be deleted');
END IF;
END */;;
@@ -27649,7 +27649,7 @@ BEGIN
END IF;
IF NOT (NEW.travelFk <=> OLD.travelFk)
- OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
+ OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk,NEW.supplierFk);
END IF;
END */;;
@@ -28149,17 +28149,17 @@ BEGIN
SET NEW.editorFk = account.myUser_getId();
- IF NEW.freightItemFk IS NOT NULL THEN
+ IF NEW.freightItemFk IS NOT NULL THEN
UPDATE ticket SET packages = nz(packages) + 1 WHERE id = NEW.ticketFk;
- SELECT IFNULL(MAX(counter),0) +1 INTO intcounter
- FROM expedition e
- INNER JOIN ticket t1 ON e.ticketFk = t1.id
+ SELECT IFNULL(MAX(counter),0) +1 INTO intcounter
+ FROM expedition e
+ INNER JOIN ticket t1 ON e.ticketFk = t1.id
LEFT JOIN ticketState ts ON ts.ticket = t1.id
- INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped)
+ INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped)
AND t1.warehouseFk = t2.warehouseFk
- WHERE t2.id = NEW.ticketFk AND ts.alertLevel < 3 AND t1.companyFk = t2.companyFk
+ WHERE t2.id = NEW.ticketFk AND ts.alertLevel < 3 AND t1.companyFk = t2.companyFk
AND t1.agencyModeFk = t2.agencyModeFk;
SET NEW.`counter` = intcounter;
@@ -28186,9 +28186,9 @@ BEGIN
SET NEW.editorFk = account.myUser_getId();
IF NEW.counter <> OLD.counter THEN
- IF (SELECT COUNT(*) FROM expedition e
+ IF (SELECT COUNT(*) FROM expedition e
INNER JOIN ticket t1 ON e.ticketFk = t1.id
- INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped)
+ INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped)
WHERE t1.id = NEW.ticketFk AND counter = NEW.counter) > 0 THEN
SET NEW.id = NULL;
END IF;
@@ -28212,11 +28212,11 @@ DELIMITER ;;
BEFORE DELETE ON `expedition`
FOR EACH ROW
BEGIN
- UPDATE ticket t
- SET packages = (SELECT COUNT(counter)-1
+ UPDATE ticket t
+ SET packages = (SELECT COUNT(counter)-1
FROM expedition e WHERE e.ticketFk = OLD.ticketFk and e.freightItemFk)
- WHERE t.id = OLD.ticketFk;
-
+ WHERE t.id = OLD.ticketFk;
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -28355,13 +28355,13 @@ DELIMITER ;;
BEGIN
DECLARE vNewPosition INT;
-
+
SELECT MAX(position) + 1 INTO vNewPosition
FROM vn.expeditionPallet
WHERE truckFk = NEW.truckFk;
-
+
SET NEW.position = IFNULL(vNewPosition,1);
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -28460,7 +28460,7 @@ DELIMITER ;;
BEGIN
SET NEW.workerFk = vn.getUser();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -28521,9 +28521,9 @@ DELIMITER ;;
BEFORE INSERT
ON expeditionState FOR EACH ROW
BEGIN
-
+
SET NEW.userFk = account.myUser_getId();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -28547,7 +28547,7 @@ BEGIN
UPDATE vn.expedition e
SET e.stateTypeFk = NEW.typeFk
WHERE e.id = NEW.expeditionFk;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -29578,42 +29578,42 @@ BEGIN
DECLARE vWithholdingSageFk INT;
SET NEW.editorFk = account.myUser_getId();
-
- SELECT withholdingSageFk INTO vWithholdingSageFk
- FROM vn.supplier
+
+ SELECT withholdingSageFk INTO vWithholdingSageFk
+ FROM vn.supplier
WHERE id = NEW.supplierFk;
- SET NEW.withholdingSageFk = vWithholdingSageFk;
-
- SELECT countryFk, isActive INTO vIssuingCountry, vActive
- FROM vn.supplier
+ SET NEW.withholdingSageFk = vWithholdingSageFk;
+
+ SELECT countryFk, isActive INTO vIssuingCountry, vActive
+ FROM vn.supplier
WHERE id = NEW.supplierFk;
-
- SELECT countryFk INTO vhostCountry
- FROM vn.supplier
+
+ SELECT countryFk INTO vhostCountry
+ FROM vn.supplier
WHERE id = NEW.companyFk;
IF vActive = 0 THEN
CALL util.throw('INACTIVE_PROVIDER');
END IF;
-
- IF (SELECT COUNT(*) FROM vn.invoiceIn
- WHERE supplierRef = NEW.supplierRef
- AND supplierFk = NEW.supplierFk
+
+ IF (SELECT COUNT(*) FROM vn.invoiceIn
+ WHERE supplierRef = NEW.supplierRef
+ AND supplierFk = NEW.supplierFk
AND YEAR(issued) = YEAR(NEW.issued)
) THEN
CALL util.throw('reference duplicated');
END IF;
-
+
SELECT CASE WHEN (SELECT account FROM vn.supplier where id = NEW.supplierFk) LIKE '___3______' THEN 'C'
- WHEN (SELECT vIssuingCountry=vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry
+ WHEN (SELECT vIssuingCountry=vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry
where p1.CEE < 2 and p2.CEE < 2) = 1 THEN 'R'
- WHEN (SELECT vIssuingCountry <> vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry
- where p1.CEE < 2 and p2.CEE < 2) = 1 THEN 'E'
+ WHEN (SELECT vIssuingCountry <> vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry
+ where p1.CEE < 2 and p2.CEE < 2) = 1 THEN 'E'
WHEN (SELECT vIssuingCountry<>vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry
- where NOT p1.CEE < 2 AND not p1.id = 1) = 1 THEN 'W'
+ where NOT p1.CEE < 2 AND not p1.id = 1) = 1 THEN 'W'
END INTO vSerie;
-
+
SET NEW.serial = IFNULL(vSerie,'R');
END */;;
@@ -29640,9 +29640,9 @@ BEGIN
SET NEW.editorFk = account.myUser_getId();
- IF (SELECT COUNT(*) FROM vn.invoiceIn
- WHERE supplierRef = NEW.supplierRef
- AND supplierFk = NEW.supplierFk
+ IF (SELECT COUNT(*) FROM vn.invoiceIn
+ WHERE supplierRef = NEW.supplierRef
+ AND supplierFk = NEW.supplierFk
AND YEAR(issued) = YEAR(NEW.issued)
AND id <> NEW.id
) THEN
@@ -29652,7 +29652,7 @@ BEGIN
IF NEW.supplierFk != OLD.supplierFk THEN
CALL supplier_checkIsActive(NEW.supplierFk);
SELECT withholdingSageFk INTO vWithholdingSageFk
- FROM vn.supplier
+ FROM vn.supplier
WHERE id = NEW.supplierFk;
SET NEW.withholdingSageFk = vWithholdingSageFk;
END IF;
@@ -29677,23 +29677,23 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
- IF NEW.issued != OLD.issued
+ IF NEW.issued != OLD.issued
OR NEW.currencyFk != OLD.currencyFk THEN
UPDATE invoiceInTax iit
JOIN invoiceIn ii ON ii.id = iit.invoiceInFk
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
- AND rr.currencyFk = ii.currencyFk
+ AND rr.currencyFk = ii.currencyFk
SET iit.taxableBase = IF(iit.foreignValue IS NULL, iit.taxableBase, iit.foreignValue / rr.value)
WHERE ii.id = NEW.id;
-
+
UPDATE invoiceInDueDay iidd
JOIN invoiceIn ii ON ii.id = iidd.invoiceInFk
LEFT JOIN referenceRate rr ON rr.dated = ii.issued
- AND rr.currencyFk = ii.currencyFk
+ AND rr.currencyFk = ii.currencyFk
SET iidd.amount = IF(iidd.foreignValue IS NULL, iidd.amount, iidd.foreignValue / rr.value)
- WHERE ii.id = NEW.id;
-
+ WHERE ii.id = NEW.id;
+
END IF;
END */;;
@@ -29787,13 +29787,13 @@ BEGIN
DECLARE vIsNotified BOOLEAN;
SET NEW.editorFk = account.myUser_getId();
-
- SELECT isNotified INTO vIsNotified
- FROM vn.invoiceIn ii
+
+ SELECT isNotified INTO vIsNotified
+ FROM vn.invoiceIn ii
JOIN vn.supplier s ON s.id = ii.supplierFk
JOIN vn.payMethod pm ON pm.id = s.payMethodFk
WHERE ii.id = NEW.invoiceInFk;
-
+
IF (NEW.dueDated <= util.VN_CURDATE() AND vIsNotified)
THEN
CALL mail_insert(
@@ -29801,12 +29801,12 @@ BEGIN
'begonya@verdnatura.es',
'Añadido vencimiento en el pasado',
CONCAT(
- account.myUser_getName(), ' ha añadido un vencimiento de ',
+ account.myUser_getName(), ' ha añadido un vencimiento de ',
NEW.amount, '€ en una fecha pasada en la recibida ', NEW.invoiceInFk
)
);
END IF;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -29829,13 +29829,13 @@ BEGIN
DECLARE vIsNotified BOOLEAN;
SET NEW.editorFk = account.myUser_getId();
-
- SELECT isNotified INTO vIsNotified
- FROM vn.invoiceIn ii
+
+ SELECT isNotified INTO vIsNotified
+ FROM vn.invoiceIn ii
JOIN vn.supplier s ON s.id = ii.supplierFk
JOIN vn.payMethod pm ON pm.id = s.payMethodFk
WHERE ii.id = NEW.invoiceInFk;
-
+
IF (NEW.dueDated <= util.VN_CURDATE() AND vIsNotified)
THEN
CALL mail_insert(
@@ -29843,12 +29843,12 @@ BEGIN
'begonya@verdnatura.es',
'Añadido vencimiento en el pasado',
CONCAT(
- account.myUser_getName(), ' ha añadido un vencimiento de ',
+ account.myUser_getName(), ' ha añadido un vencimiento de ',
NEW.amount,'€ en una fecha pasada en la recibida ',NEW.invoiceInFk
)
);
END IF;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -30984,15 +30984,15 @@ BEGIN
IF NEW.itemFk IN (95, 98) THEN
SET NEW.cm3 = 0;
END IF;
-
+
IF !(NEW.cm3delivery <=> OLD.cm3delivery) THEN
INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
- SELECT r.id
+ SELECT r.id
FROM vn.itemCost ic
JOIN vn.sale s ON s.itemFk = ic.itemFk
- JOIN vn.ticket t ON t.id = s.ticketFk AND t.warehouseFk = ic.warehouseFk
+ JOIN vn.ticket t ON t.id = s.ticketFk AND t.warehouseFk = ic.warehouseFk
JOIN vn.route r ON r.id = t.routeFk
- WHERE r.isOk = FALSE
+ WHERE r.isOk = FALSE
AND ic.itemFk = NEW.itemFk
AND r.created >= util.VN_CURDATE()
GROUP BY r.id;
@@ -31312,10 +31312,10 @@ DELIMITER ;;
BEFORE INSERT ON `itemShelving`
FOR EACH ROW
BEGIN
-
+
SET NEW.userFk = account.myUser_getId();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -31424,8 +31424,8 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_BEFORE_DELETE`
BEFORE DELETE ON `itemShelving`
FOR EACH ROW
-INSERT INTO vn.itemShelvingLog(itemShelvingFk,
- workerFk,
+INSERT INTO vn.itemShelvingLog(itemShelvingFk,
+ workerFk,
accion,
shelvingFk,
itemFk)
@@ -31609,7 +31609,7 @@ DELIMITER ;;
BEGIN
UPDATE vn.sale
- SET isPicked = TRUE
+ SET isPicked = TRUE
WHERE id = NEW.saleFk;
END */;;
@@ -31799,9 +31799,9 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemTag_beforeUpdate`
BEFORE UPDATE ON `itemTag`
FOR EACH ROW
-BEGIN
+BEGIN
SET NEW.editorFk = account.myUser_getId();
-
+
IF !(OLD.`value` <=> NEW.`value`)
OR !(OLD.intValue <=> NEW.intValue) THEN
SET NEW.intValue = itemTag_getIntValue(NEW.`value`);
@@ -31834,7 +31834,7 @@ trig: BEGIN
IF @isTriggerDisabled OR visTriggerDisabled THEN
LEAVE trig;
END IF;
-
+
SET vItemFk = NEW.itemFk;
DROP TEMPORARY TABLE IF EXISTS tmp.item;
CREATE TEMPORARY TABLE tmp.item
@@ -32341,7 +32341,7 @@ DELIMITER ;;
BEFORE INSERT ON `machine`
FOR EACH ROW
BEGIN
-
+
SET NEW.workerFk = vn.getUser();
END */;;
@@ -32475,9 +32475,9 @@ DELIMITER ;;
BEGIN
IF NEW.sender IS NOT NULL THEN
-
+
SET NEW.receiver = NEW.sender;
-
+
END IF;
END */;;
@@ -32540,8 +32540,8 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
IF (NEW.code IS NULL) THEN
- SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT
- FROM information_schema.TABLES
+ SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT
+ FROM information_schema.TABLES
WHERE TABLE_SCHEMA='vn' and TABLE_NAME='mandate'));
END IF;
END */;;
@@ -33535,7 +33535,7 @@ DELIMITER ;;
BEGIN
-- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -33660,13 +33660,13 @@ BEGIN
SELECT account INTO cuenta_banco
FROM bank
WHERE id = NEW.bankFk;
-
+
SELECT account INTO cuenta_proveedor
FROM supplier
WHERE id = NEW.supplierFk;
-
+
CALL vn.ledger_next(vNewBookEntry);
-
+
INSERT INTO XDiario ( ASIEN,
FECHA,
SUBCTA,
@@ -33692,7 +33692,7 @@ BEGIN
cuenta_banco CONTRA,
NEW.amount EURODEBE,
0 EUROHABER) gf;
-
+
IF NEW.bankingFees <> 0 THEN
INSERT INTO XDiario ( ASIEN,
FECHA,
@@ -33714,7 +33714,7 @@ BEGIN
FROM supplier s
JOIN country c ON s.countryFk = c.id
WHERE s.id = NEW.supplierFk;
- END IF;
+ END IF;
END IF;
SET NEW.dueDated = IFNULL(NEW.dueDated, NEW.received);
@@ -33722,15 +33722,15 @@ BEGIN
SELECT isActive INTO isSupplierActive
FROM supplier
WHERE id = NEW.supplierFk;
-
+
IF isSupplierActive = FALSE THEN
CALL util.throw('SUPPLIER_INACTIVE');
END IF;
-
+
IF ISNULL(NEW.workerFk) THEN
SET NEW.workerFk = account.myUser_getId();
END IF;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -33752,12 +33752,12 @@ DELIMITER ;;
BEGIN
DECLARE vIsPayMethodChecked BOOLEAN;
DECLARE vEmail VARCHAR(150);
-
+
SELECT isPayMethodChecked INTO vIsPayMethodChecked
FROM supplier
WHERE id = NEW.supplierFk;
-
-
+
+
IF vIsPayMethodChecked = FALSE THEN
SELECT notificationEmail INTO vEmail
@@ -34639,11 +34639,11 @@ DELIMITER ;;
BEFORE INSERT
ON projectNotes FOR EACH ROW
BEGIN
-
+
IF ISNULL(NEW.userFk) THEN
-
+
SET NEW.userFk = account.myUser_getId();
-
+
END IF;
END */;;
@@ -34804,10 +34804,10 @@ DELIMITER ;;
BEFORE INSERT ON `province`
FOR EACH ROW
BEGIN
-
+
SET NEW.geoFk = zoneGeo_new('province', NEW.`name`,
(SELECT geoFk FROM autonomy WHERE id = NEW.autonomyFk));
-
+
SET NEW.countryFk = (SELECT a.countryFk FROM vn.autonomy a WHERE a.id = NEW.autonomyFk);
END */;;
@@ -34828,14 +34828,14 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`province_beforeUpdate`
BEFORE UPDATE ON `province`
FOR EACH ROW
-BEGIN
-
+BEGIN
+
IF !(OLD.autonomyFk <=> NEW.autonomyFk) THEN
-
+
SET NEW.countryFk = (SELECT a.countryFk FROM vn.autonomy a WHERE a.id = NEW.autonomyFk);
END IF;
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -34851,19 +34851,19 @@ DELIMITER ;
/*!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 `vn`.`province_afterUpdate`
- AFTER UPDATE ON `province`
- FOR EACH ROW
-BEGIN
- IF !(OLD.autonomyFk <=> NEW.autonomyFk) THEN
- CALL zoneGeo_setParent(NEW.geoFk,
- (SELECT geoFk FROM autonomy WHERE id = NEW.autonomyFk));
- END IF;
-
- IF !(OLD.`name` <=> NEW.`name`) THEN
- UPDATE zoneGeo SET `name` = NEW.`name`
- WHERE id = NEW.geoFk;
- END IF;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`province_afterUpdate`
+ AFTER UPDATE ON `province`
+ FOR EACH ROW
+BEGIN
+ IF !(OLD.autonomyFk <=> NEW.autonomyFk) THEN
+ CALL zoneGeo_setParent(NEW.geoFk,
+ (SELECT geoFk FROM autonomy WHERE id = NEW.autonomyFk));
+ END IF;
+
+ IF !(OLD.`name` <=> NEW.`name`) THEN
+ UPDATE zoneGeo SET `name` = NEW.`name`
+ WHERE id = NEW.geoFk;
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -34883,7 +34883,7 @@ DELIMITER ;;
AFTER DELETE ON `province`
FOR EACH ROW
BEGIN
- CALL zoneGeo_delete(OLD.geoFk);
+ CALL zoneGeo_delete(OLD.geoFk);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -35107,20 +35107,20 @@ CREATE TABLE `receipt` (
/*!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 `vn`.`receipt_beforeInsert`
- BEFORE INSERT ON `receipt`
- FOR EACH ROW
-BEGIN
- DECLARE vIsAutoConciliated BOOLEAN;
-
- IF NEW.isConciliate = FALSE THEN
- SELECT isAutoConciliated INTO vIsAutoConciliated
- FROM accounting a
- JOIN accountingType at2 ON at2.id = a.accountingTypeFk
- WHERE a.id = NEW.bankFk;
-
- SET NEW.isConciliate = vIsAutoConciliated;
- END IF;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`receipt_beforeInsert`
+ BEFORE INSERT ON `receipt`
+ FOR EACH ROW
+BEGIN
+ DECLARE vIsAutoConciliated BOOLEAN;
+
+ IF NEW.isConciliate = FALSE THEN
+ SELECT isAutoConciliated INTO vIsAutoConciliated
+ FROM accounting a
+ JOIN accountingType at2 ON at2.id = a.accountingTypeFk
+ WHERE a.id = NEW.bankFk;
+
+ SET NEW.isConciliate = vIsAutoConciliated;
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -35176,18 +35176,18 @@ DELIMITER ;
/*!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 `vn`.`receipt_afterUpdate`
- AFTER UPDATE ON `receipt`
- FOR EACH ROW
-BEGIN
- IF NEW.isConciliate = FALSE AND NEW.payed > OLD.payed THEN
- CALL mail_insert(
- 'finanzas@verdnatura.es',
- NULL,
- CONCAT('Cambios de recibos del cliente: ', NEW.clientFk),
- CONCAT('Se ha cambiado el recibo: ', NEW.Id, ' de ', OLD.payed, ' a ', NEW.payed)
- );
- END IF;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`receipt_afterUpdate`
+ AFTER UPDATE ON `receipt`
+ FOR EACH ROW
+BEGIN
+ IF NEW.isConciliate = FALSE AND NEW.payed > OLD.payed THEN
+ CALL mail_insert(
+ 'finanzas@verdnatura.es',
+ NULL,
+ CONCAT('Cambios de recibos del cliente: ', NEW.clientFk),
+ CONCAT('Se ha cambiado el recibo: ', NEW.Id, ' de ', OLD.payed, ' a ', NEW.payed)
+ );
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -35535,7 +35535,7 @@ BEGIN
DECLARE vDefaultAgencyModeFk INT;
SET NEW.editorFk = account.myUser_getId();
-
+
SET NEW.commissionWorkCenterFk = (
SELECT IFNULL(b.workCenterFK, r.defaultWorkCenterFk)
FROM vn.routeConfig r
@@ -35569,7 +35569,7 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`route_afterInsert`
AFTER INSERT ON `route`
FOR EACH ROW
-BEGIN
+BEGIN
CALL route_calcCommission(NEW.id);
END */;;
DELIMITER ;
@@ -35591,16 +35591,16 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
DECLARE vKmMax INT;
-
+
SET NEW.editorFk = account.myUser_getId();
-
+
IF NEW.isOk <> FALSE AND OLD.isOk = FALSE THEN
- SET NEW.m3 = ( SELECT SUM(litros)/1000
- FROM vn.saleVolume s
- JOIN vn.ticket t ON s.ticketFk = t.id
+ SET NEW.m3 = ( SELECT SUM(litros)/1000
+ FROM vn.saleVolume s
+ JOIN vn.ticket t ON s.ticketFk = t.id
WHERE t.routeFk = NEW.id);
END IF;
-
+
IF NEW.kmEnd < NEW.kmStart AND NEW.kmEnd <> 0 THEN
CALL util.throw ('KmEnd menor que kmStart');
END IF;
@@ -35630,18 +35630,18 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`route_afterUpdate`
AFTER UPDATE ON `route`
FOR EACH ROW
-BEGIN
+BEGIN
IF IFNULL(NEW.gestdocFk,0) <> IFNULL(OLD.gestdocFk,0) AND NEW.gestdocFk > 0 THEN
-- JGF 09/09/14 cuando se añade un gestdoc a una ruta, se le asigna automagicamente a todos sus Tickets
-
+
-- Inserta el gestdoc en todos los tickets de la ruta
INSERT INTO ticketDms(ticketFk,dmsFk)
SELECT id, NEW.gestdocFk FROM ticket WHERE routeFk = NEW.id
ON DUPLICATE KEY UPDATE dmsFk = NEW.gestdocFk;
- -- Update del firmado
- UPDATE ticket t
- JOIN ticketDms tg ON t.id = tg.ticketFk
+ -- Update del firmado
+ UPDATE ticket t
+ JOIN ticketDms tg ON t.id = tg.ticketFk
SET isSigned = 1 WHERE t.routeFk = NEW.id;
END IF;
@@ -36099,20 +36099,20 @@ DELIMITER ;;
BEFORE UPDATE ON `sale`
FOR EACH ROW
BEGIN
-/*
+/*
IF (SELECT COUNT(*) from item i WHERE id = NEW.itemFk AND family = 'SER') THEN
CALL util.throw('Cannot insert a service item into a ticket');
END IF;
*/
SET NEW.editorFk = account.myUser_getId();
-
+
IF NEW.discount > 100 THEN
SET NEW.discount = 0;
END IF;
IF old.discount > 0 AND NEW.discount = 0 THEN
INSERT INTO ticketLog
- SET originFk = NEW.ticketFk, userFk = account.myUser_getId(), `action` = 'insert',
+ SET originFk = NEW.ticketFk, userFk = account.myUser_getId(), `action` = 'insert',
description = CONCAT('Cambio de descuento del item :', ' ', new.itemFk, ' de ', old.discount ,' a 0 ');
END IF;
END */;;
@@ -36244,11 +36244,11 @@ DELIMITER ;;
BEGIN
IF OLD.quantity > 0 THEN
INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
- SELECT r.id
+ SELECT r.id
FROM vn.sale s
JOIN vn.ticket t ON t.id = s.ticketFk
JOIN vn.route r ON r.id = t.routeFk
- WHERE r.isOk = FALSE
+ WHERE r.isOk = FALSE
AND s.id = OLD.id
AND r.created >= util.VN_CURDATE()
GROUP BY r.id;
@@ -36350,10 +36350,10 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`BEFORE_INSERT`
BEFORE INSERT ON `saleBuy`
FOR EACH ROW
-BEGIN
-
+BEGIN
+
SET NEW.workerFk = vn.getUser();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -36372,13 +36372,13 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleBuy_AI`
AFTER INSERT ON `saleBuy`
FOR EACH ROW
-BEGIN
+BEGIN
/* Activar de nuevo cuando volvamos a vender fruta y verdura
- *
+ *
UPDATE vn.sale s
SET s.concept = CONCAT(s.concept, ' Lote: ', NEW.buyFk)
WHERE s.id = NEW.saleFk;
-*/
+*/
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -36644,14 +36644,14 @@ DELIMITER ;;
AFTER INSERT ON `saleTracking`
FOR EACH ROW
BEGIN
-
- IF NEW.isChecked THEN
-
+
+ IF NEW.isChecked THEN
+
UPDATE vn.sale s
- SET s.isPicked = TRUE
+ SET s.isPicked = TRUE
WHERE s.id = NEW.saleFk
AND s.isPicked = 0;
-
+
END IF;
END */;;
@@ -37037,9 +37037,9 @@ BEGIN
IF NEW.workerFk = NEW.workerSubstitute THEN
CALL util.throw ('worker and workerSubstitute must be different');
ELSE
- INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated)
- SELECT NEW.workerFk, NEW.workerSubstitute, dated
- FROM time
+ INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated)
+ SELECT NEW.workerFk, NEW.workerSubstitute, dated
+ FROM time
WHERE dated BETWEEN NEW.started AND NEW.ended;
END IF;
END */;;
@@ -37064,14 +37064,14 @@ BEGIN
IF NEW.workerFk = NEW.workerSubstitute THEN
CALL util.throw ('worker and workerSubstitute must be different');
ELSE
- DELETE sc FROM sharingCartDaily sc
- WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND
- sc.ownerFk = OLD.workerFk AND
+ DELETE sc FROM sharingCartDaily sc
+ WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND
+ sc.ownerFk = OLD.workerFk AND
sc.substituteFk = OLD.workerSubstitute;
-
- INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated)
- SELECT NEW.workerFk, NEW.workerSubstitute, dated
- FROM time
+
+ INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated)
+ SELECT NEW.workerFk, NEW.workerSubstitute, dated
+ FROM time
WHERE dated BETWEEN NEW.started AND NEW.ended;
END IF;
@@ -37094,9 +37094,9 @@ DELIMITER ;;
BEFORE DELETE ON `sharingCart`
FOR EACH ROW
BEGIN
- DELETE sc FROM sharingCartDaily sc
- WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND
- sc.ownerFk = OLD.workerFk AND
+ DELETE sc FROM sharingCartDaily sc
+ WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND
+ sc.ownerFk = OLD.workerFk AND
sc.substituteFk = OLD.workerSubstitute;
END */;;
DELIMITER ;
@@ -37478,7 +37478,7 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
UPDATE vn2008.Clientes c
- JOIN creditClassification cc ON c.Id_Cliente = cc.client
+ JOIN creditClassification cc ON c.Id_Cliente = cc.client
JOIN creditInsurance ci ON ci.creditClassification = cc.id
SET creditInsurance = ci.credit * 2 WHERE ci.id = NEW.creditInsurance;
END */;;
@@ -37502,12 +37502,12 @@ DELIMITER ;;
BEGIN
IF NEW.dateLeaving IS NOT NULL THEN
UPDATE vn2008.Clientes c
- JOIN creditClassification cc ON c.Id_Cliente = cc.client
+ JOIN creditClassification cc ON c.Id_Cliente = cc.client
JOIN creditInsurance ci ON ci.creditClassification = cc.id
SET creditInsurance = ci.credit WHERE ci.id = OLD.creditInsurance;
ELSE
UPDATE vn2008.Clientes c
- JOIN creditClassification cc ON c.Id_Cliente = cc.client
+ JOIN creditClassification cc ON c.Id_Cliente = cc.client
JOIN creditInsurance ci ON ci.creditClassification = cc.id
SET creditInsurance = ci.credit * 2 WHERE ci.id = OLD.creditInsurance;
END IF;
@@ -37531,7 +37531,7 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
UPDATE vn2008.Clientes c
- JOIN creditClassification cc ON c.Id_Cliente = cc.client
+ JOIN creditClassification cc ON c.Id_Cliente = cc.client
JOIN creditInsurance ci ON ci.creditClassification = cc.id
SET creditInsurance = ci.credit WHERE ci.id = OLD.creditInsurance;
END */;;
@@ -38743,7 +38743,7 @@ DELIMITER ;;
AFTER INSERT ON `ticket`
FOR EACH ROW
BEGIN
-
+
DECLARE vClientType VARCHAR(255);
DECLARE vStateCode VARCHAR(255);
DECLARE vTransferorFirstShipped DATE;
@@ -38771,7 +38771,7 @@ BEGIN
INSERT INTO bs.clientNewBorn(clientFk, firstShipped, lastShipped)
VALUES(NEW.clientFk, IFNULL(vTransferorFirstShipped, util.VN_CURDATE()), util.VN_CURDATE())
ON DUPLICATE KEY UPDATE lastShipped = util.VN_CURDATE();
-
+
END IF;
END */;;
@@ -38798,10 +38798,10 @@ BEGIN
SET NEW.editorFk = account.myUser_getId();
IF !(NEW.routeFk <=> OLD.routeFk) THEN
- INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
- SELECT r.id
+ INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
+ SELECT r.id
FROM vn.route r
- WHERE r.isOk = FALSE
+ WHERE r.isOk = FALSE
AND r.id IN (OLD.routeFk,NEW.routeFk)
AND r.created >= util.VN_CURDATE()
GROUP BY r.id;
@@ -38818,13 +38818,13 @@ BEGIN
END IF;
END IF;
-
+
IF !(NEW.isDeleted <=> OLD.isDeleted) AND NEW.isDeleted THEN
- INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
- SELECT r.id
+ INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
+ SELECT r.id
FROM vn.ticket t
JOIN vn.route r ON r.id = t.routeFk
- WHERE r.isOk = FALSE
+ WHERE r.isOk = FALSE
AND t.id = NEW.id
AND r.created >= util.VN_CURDATE()
GROUP BY r.id;
@@ -38834,7 +38834,7 @@ BEGIN
SET NEW.zoneFk = NULL;
END IF;
- IF NEW.routeFk AND NEW.isDeleted THEN
+ IF NEW.routeFk AND NEW.isDeleted THEN
CALL util.throw ('This ticket is deleted');
END IF;
@@ -38843,12 +38843,12 @@ BEGIN
FROM vn.ticket
WHERE routeFk = NEW.routeFk
HAVING MAX(TIME(shipped)) > TIME(NEW.shipped);
-
+
IF vNewTime THEN
SET NEW.shipped = TIMESTAMP(DATE(NEW.shipped), vNewTime);
END IF;
INSERT IGNORE INTO zoneAgencyMode (agencyModeFk,zoneFk)
- SELECT r.agencyModeFk, NEW.zoneFk FROM route r
+ SELECT r.agencyModeFk, NEW.zoneFk FROM route r
WHERE r.id = NEW.routeFk;
CALL vn.routeUpdateM3(NEW.routeFk);
@@ -38886,7 +38886,7 @@ BEGIN
END IF;
IF NEW.routeFk <> OLD.routeFk THEN
- UPDATE expedition
+ UPDATE expedition
SET hasNewRoute = TRUE
WHERE ticketFk = NEW.id;
END IF;
@@ -38909,11 +38909,11 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticket_beforeDelete`
BEFORE DELETE ON `ticket`
FOR EACH ROW
-BEGIN
- INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
- SELECT r.id
+BEGIN
+ INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
+ SELECT r.id
FROM vn.route r
- WHERE r.isOk = FALSE
+ WHERE r.isOk = FALSE
AND r.id = OLD.routeFk
AND r.created >= util.VN_CURDATE()
GROUP BY r.id;
@@ -38990,31 +38990,31 @@ CREATE TABLE `ticketCollection` (
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER ticketCollection_afterDelete
-AFTER DELETE
-ON ticketCollection FOR EACH ROW
-BEGIN
-
- DECLARE vSalesRemaining INT;
-
- SELECT count(*) INTO vSalesRemaining
- FROM vn.ticketCollection tc
- JOIN sale s ON s.ticketFk = tc.ticketFk
- WHERE collectionFk = OLD.collectionFk
- AND tc.id != OLD.id;
-
- IF NOT vSalesRemaining THEN
-
- DELETE FROM vn.collection WHERE id = OLD.collectionFk;
-
- ELSE
-
- UPDATE vn.collection
- SET saleTotalCount = vSalesRemaining
- WHERE id = OLD.collectionFk;
-
- END IF;
-
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER ticketCollection_afterDelete
+AFTER DELETE
+ON ticketCollection FOR EACH ROW
+BEGIN
+
+ DECLARE vSalesRemaining INT;
+
+ SELECT count(*) INTO vSalesRemaining
+ FROM vn.ticketCollection tc
+ JOIN sale s ON s.ticketFk = tc.ticketFk
+ WHERE collectionFk = OLD.collectionFk
+ AND tc.id != OLD.id;
+
+ IF NOT vSalesRemaining THEN
+
+ DELETE FROM vn.collection WHERE id = OLD.collectionFk;
+
+ ELSE
+
+ UPDATE vn.collection
+ SET saleTotalCount = vSalesRemaining
+ WHERE id = OLD.collectionFk;
+
+ END IF;
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -39112,13 +39112,13 @@ DELIMITER ;;
BEFORE DELETE ON `ticketDms`
FOR EACH ROW
BEGIN
- UPDATE dms
- SET dmsTypeFk = (SELECT id
- FROM dmsType
+ UPDATE dms
+ SET dmsTypeFk = (SELECT id
+ FROM dmsType
WHERE `code` = 'trash'
)
- WHERE id = OLD.dmsFk AND ( SELECT IF(COUNT(*) > 0, FALSE, TRUE)
- FROM ticketDms
+ WHERE id = OLD.dmsFk AND ( SELECT IF(COUNT(*) > 0, FALSE, TRUE)
+ FROM ticketDms
WHERE dmsFk = OLD.dmsFk
) ;
END */;;
@@ -39594,7 +39594,7 @@ DELIMITER ;;
BEGIN
SET NEW.workerFk = vn.getUser();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -39922,7 +39922,7 @@ DELIMITER ;;
BEGIN
CALL ticket_requestRecalc(NEW.ticketFk);
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -39992,7 +39992,7 @@ BEGIN
`changedModel` = 'TicketService',
`changedModelId` = OLD.id,
`userFk` = account.myUser_getId();
-
+
CALL ticket_requestRecalc(OLD.ticketFk);
END */;;
@@ -40143,11 +40143,11 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
DECLARE vNumTicketsPrepared INT;
-
+
REPLACE vn.ticketLastState(ticketFk, ticketTrackingFk, name)
SELECT NEW.ticketFk, NEW.id, `name`
FROM state
- WHERE id = NEW.stateFk;
+ WHERE id = NEW.stateFk;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -40190,21 +40190,21 @@ BEGIN
DECLARE vTicketFk INT;
DECLARE vTicketTrackingFk INT;
DECLARE vStateName VARCHAR(15);
-
+
IF NEW.stateFk <> OLD.stateFk THEN
REPLACE vn.ticketLastState(ticketFk, ticketTrackingFk, name)
SELECT NEW.ticketFk, NEW.id, `name`
FROM state
WHERE id = NEW.stateFk;
END IF;
-
+
IF NEW.ticketFk <> OLD.ticketFk THEN
SELECT i.ticketFk, i.id, s.`name`
- INTO vTicketFk, vTicketTrackingFk, vStateName
- FROM ticketTracking i
- JOIN state s ON i.stateFk = s.id
- WHERE ticketFk = NEW.ticketFk
- ORDER BY created DESC
+ INTO vTicketFk, vTicketTrackingFk, vStateName
+ FROM ticketTracking i
+ JOIN state s ON i.stateFk = s.id
+ WHERE ticketFk = NEW.ticketFk
+ ORDER BY created DESC
LIMIT 1;
IF vTicketFk > 0 THEN
@@ -40246,18 +40246,18 @@ BEGIN
`changedModel` = 'TicketTracking',
`changedModelId` = OLD.id,
`userFk` = account.myUser_getId();
-
+
CALL util.debugAdd('deletedState',
CONCAT('interFk: ', OLD.id,
' ticketFk: ', OLD.ticketFk,
' stateFk: ', OLD.stateFk));
SELECT i.ticketFk, i.id, s.`name`
- INTO vTicketFk, vTicketTrackingFk, vStateName
- FROM ticketTracking i
- JOIN state s ON i.stateFk = s.id
- WHERE ticketFk = OLD.ticketFk
- ORDER BY created DESC
+ INTO vTicketFk, vTicketTrackingFk, vStateName
+ FROM ticketTracking i
+ JOIN state s ON i.stateFk = s.id
+ WHERE ticketFk = OLD.ticketFk
+ ORDER BY created DESC
LIMIT 1;
IF vTicketFk > 0 THEN
@@ -40449,13 +40449,13 @@ CREATE TABLE `till` (
/*!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 `vn`.`till_beforeInsert`
- BEFORE INSERT ON `till`
- FOR EACH ROW
-BEGIN
- IF NEW.concept IS NULL OR NEW.concept REGEXP '^[[:space:]]*$' THEN
- SET NEW.concept = 'SIN DETALLE';
- END IF;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`till_beforeInsert`
+ BEFORE INSERT ON `till`
+ FOR EACH ROW
+BEGIN
+ IF NEW.concept IS NULL OR NEW.concept REGEXP '^[[:space:]]*$' THEN
+ SET NEW.concept = 'SIN DETALLE';
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -40878,7 +40878,7 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
-
+
IF NOT (NEW.landed <=> OLD.landed)
OR NOT (NEW.shipped <=> OLD.shipped) THEN
CALL travel_checkDates(NEW.shipped, NEW.landed);
@@ -40920,7 +40920,7 @@ BEGIN
CALL stock.log_add('travel', NEW.id, OLD.id);
IF !(NEW.shipped <=> OLD.shipped) THEN
- UPDATE entry
+ UPDATE entry
SET commission = entry_getCommission(travelFk, currencyFk,supplierFk)
WHERE travelFk = NEW.id;
END IF;
@@ -42634,9 +42634,9 @@ DELIMITER ;;
AFTER INSERT ON `workerTimeControl`
FOR EACH ROW
BEGIN
- IF NEW.timed > DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY) THEN
+ IF NEW.timed > DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY) THEN
CALL util.throw('date in the future');
- END IF;
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -43168,10 +43168,10 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_BI`
BEFORE INSERT ON `zoneExclusion`
FOR EACH ROW
-BEGIN
+BEGIN
SET NEW.editorFk = account.myUser_getId();
SET NEW.userFk = account.myUser_getId();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -43190,10 +43190,10 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_BU`
BEFORE UPDATE ON `zoneExclusion`
FOR EACH ROW
-BEGIN
+BEGIN
SET NEW.editorFk = account.myUser_getId();
SET NEW.userFk = account.myUser_getId();
-
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -43590,8 +43590,8 @@ DELIMITER ;;
FROM client c
LEFT JOIN ticket t ON t.clientFk = c.id
WHERE c.salesPersonFk IS NOT NULL
- OR t.created > util.VN_CURDATE() - INTERVAL 2 MONTH
- OR shipped > util.VN_CURDATE() - INTERVAL 2 MONTH
+ OR t.created > util.VN_CURDATE() - INTERVAL 2 MONTH
+ OR shipped > util.VN_CURDATE() - INTERVAL 2 MONTH
);
END */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
@@ -44057,7 +44057,7 @@ BEGIN
DECLARE vGeoFk INT;
SELECT p.geoFk INTO vGeoFk
- FROM address a
+ FROM address a
JOIN town t ON t.provinceFk = a.provinceFk
JOIN postCode p ON p.townFk = t.id AND p.`code` = a.postalCode
WHERE a.id = vSelf
@@ -44084,12 +44084,12 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `barcodeToItem`(vBarcode VARCHAR(22)) RETURNS int(11)
DETERMINISTIC
BEGIN
-
+
/**
* Obtiene el id del artículo
*
* @param vBarcode código de barras
- *
+ *
* return id del item
*/
@@ -44099,35 +44099,35 @@ BEGIN
FROM vn.item
WHERE id = vBarcode OR comment = vBarcode
LIMIT 1;
-
- IF vItemFk THEN
+
+ IF vItemFk THEN
RETURN vItemFk;
END IF;
- SELECT itemFk INTO vItemFk
- FROM buy
+ SELECT itemFk INTO vItemFk
+ FROM buy
WHERE id = vBarcode;
-
- IF vItemFk THEN
- RETURN vItemFk;
- END IF;
-
- SELECT itemFk INTO vItemFk
- FROM itemBarcode
- WHERE code = vBarcode;
-
- IF vItemFk THEN
+
+ IF vItemFk THEN
RETURN vItemFk;
END IF;
- SELECT i.id INTO vItemFk
+ SELECT itemFk INTO vItemFk
+ FROM itemBarcode
+ WHERE code = vBarcode;
+
+ IF vItemFk THEN
+ RETURN vItemFk;
+ END IF;
+
+ SELECT i.id INTO vItemFk
FROM vn.item i
WHERE i.name LIKE CONCAT('%',vBarcode,'%')
ORDER BY i.id ASC
LIMIT 1;
-
+
RETURN vItemFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -44150,9 +44150,9 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `botanicExport_isUpdatable`(vEdiGenus
DETERMINISTIC
BEGIN
DECLARE vIsUpdatable INTEGER;
- SELECT COUNT(*) INTO vIsUpdatable
- FROM botanicExport
- WHERE ediGenusFk = vEdiGenusFk
+ SELECT COUNT(*) INTO vIsUpdatable
+ FROM botanicExport
+ WHERE ediGenusFk = vEdiGenusFk
AND (vEdiSpecieFk = ediSpecieFk OR IFNULL(vEdiSpecieFk,ediSpecieFk) IS NULL)
AND vRestriction = restriction;
RETURN vIsUpdatable;
@@ -44248,16 +44248,16 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `catalog_componentReverse`(vWarehouse
DETERMINISTIC
BEGIN
/* Calcula los componentes para un cliente a partir de un coste y volumen
- * @param vWarehouse
+ * @param vWarehouse
* @param vCost Valor de coste del articulo
* @param vM3 m3 del articulo
- * @param vAddressFk
+ * @param vAddressFk
* @param vZoneFk
- * @return vRetailedPrice precio de venta sin iva
+ * @return vRetailedPrice precio de venta sin iva
* @return tmp.catalog_component (warehouseFk, itemFk, componentFk, cost)
*/
-
- DECLARE vBoxVolume BIGINT;
+
+ DECLARE vBoxVolume BIGINT;
DECLARE vCustomer INT;
DECLARE vComponentRecovery INT DEFAULT 17;
DECLARE vComponentMana INT DEFAULT 39;
@@ -44266,11 +44266,11 @@ BEGIN
DECLARE vComponentCost INT DEFAULT 28;
DECLARE vRetailedPrice DECIMAL(10,2);
DECLARE vItem INT DEFAULT 98;
-
+
SELECT volume INTO vBoxVolume
FROM vn.packaging
WHERE id = '94';
-
+
SELECT clientFk INTO vCustomer FROM address WHERE id = vAddressFk;
DROP TEMPORARY TABLE IF EXISTS tmp.catalog_component;
@@ -44294,7 +44294,7 @@ BEGIN
-- Margen
-- No se aplica margen, cau 12589
/* INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost)
- SELECT vWarehouse, vItem, vComponentMargin, (vCost / ((100 - rate2) / 100)) - vCost
+ SELECT vWarehouse, vItem, vComponentMargin, (vCost / ((100 - rate2) / 100)) - vCost
FROM vn.rate
WHERE dated <= util.VN_CURDATE()
AND warehouseFk = vWarehouse
@@ -44303,7 +44303,7 @@ BEGIN
*/
-- Recobro
INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost)
- SELECT vWarehouse, vItem, vComponentRecovery, ROUND(LEAST(recobro,0.25), 3)
+ SELECT vWarehouse, vItem, vComponentRecovery, ROUND(LEAST(recobro,0.25), 3)
FROM bi.claims_ratio
WHERE Id_Cliente = vCustomer AND recobro > 0.009;
@@ -44320,7 +44320,7 @@ BEGIN
ROUND(
vM3
* (z.price - z.bonus)
- * z.inflation
+ * z.inflation
/ vBoxVolume, 4
)
FROM zone z
@@ -44363,30 +44363,30 @@ BEGIN
DECLARE vAutoManaComponent INT;
DECLARE vManaBank INT;
DECLARE vManaGreugeType INT;
-
+
SELECT id INTO vManaGreugeType FROM greugeType WHERE code = 'mana';
SELECT id INTO vManaBank FROM bank WHERE code = 'mana';
SELECT id INTO vManaComponent FROM component WHERE code = 'mana';
SELECT id INTO vAutoManaComponent FROM component WHERE code = 'autoMana';
-
+
SELECT COUNT(*) INTO vHasMana
FROM `client` c
WHERE c.id = vClient AND c.typeFk = 'normal';
-
+
IF NOT vHasMana THEN
RETURN 0;
END IF;
-
+
SELECT max(dated) INTO vFromDated
FROM clientManaCache;
SELECT sum(mana) INTO vMana
- FROM
+ FROM
(
SELECT mana
FROM clientManaCache
WHERE clientFk = vClient
- AND dated = vFromDated
+ AND dated = vFromDated
UNION ALL
SELECT s.quantity * value
FROM ticket t
@@ -44394,7 +44394,7 @@ BEGIN
JOIN sale s on s.ticketFk = t.id
JOIN saleComponent sc on sc.saleFk = s.id
WHERE sc.componentFk IN (vManaComponent, vAutoManaComponent)
- AND t.shipped > vFromDated
+ AND t.shipped > vFromDated
AND t.shipped < TIMESTAMPADD(DAY,1,util.VN_CURDATE())
AND a.clientFk = vClient
UNION ALL
@@ -44458,7 +44458,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `clientTaxArea`(vClientId INT, vCompa
READS SQL DATA
BEGIN
/**
-* Devuelve el area de un cliente,
+* Devuelve el area de un cliente,
* intracomunitario, extracomunitario o nacional.
*
* @param vClient Id del cliente
@@ -44505,7 +44505,7 @@ BEGIN
SELECT COUNT(*) INTO vHasDebt
FROM `client` c
WHERE c.id = vClient AND c.typeFk = 'normal';
-
+
IF NOT vHasDebt THEN
RETURN 0;
END IF;
@@ -44593,8 +44593,8 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `client_getSalesPerson`(vClientFk INT
DETERMINISTIC
BEGIN
/**
- * Dado un id cliente y una fecha, devuelve su comercial para ese dia, teniendo
- * en cuenta la jerarquía de las tablas: 1º la de sharingclient, 2º la de
+ * Dado un id cliente y una fecha, devuelve su comercial para ese dia, teniendo
+ * en cuenta la jerarquía de las tablas: 1º la de sharingclient, 2º la de
* sharingcart y tercero la de clientes.
*
* @param vClientFk El id del cliente
@@ -44632,29 +44632,29 @@ BEGIN
l: LOOP
SELECT workerSubstitute INTO vWorkerSubstituteFk
- FROM sharingCart
+ FROM sharingCart
WHERE util.VN_CURDATE() BETWEEN started AND ended
AND workerFk = vSalesPersonFk
ORDER BY id
LIMIT 1;
-
+
IF vWorkerSubstituteFk IS NULL THEN
LEAVE l;
END IF;
-
+
SELECT COUNT(*) > 0 INTO vLoop
FROM tmp.stack WHERE substitute = vWorkerSubstituteFk;
IF vLoop THEN
LEAVE l;
END IF;
-
+
INSERT INTO tmp.stack SET
substitute = vWorkerSubstituteFk;
-
+
SET vSalesPersonFk = vWorkerSubstituteFk;
END LOOP;
-
+
DROP TEMPORARY TABLE tmp.stack;
END IF;
@@ -44688,11 +44688,11 @@ BEGIN
**/
DECLARE vClientFk INT;
DECLARE vDated DATE;
-
+
SELECT clientFk, shipped
INTO vClientFk, vDated
FROM ticket WHERE id = vTicketFk;
-
+
RETURN client_getSalesPerson(vClientFk, vDated);
END ;;
DELIMITER ;
@@ -44723,12 +44723,12 @@ BEGIN
**/
DECLARE vWorkerCode CHAR(3);
DECLARE vSalesPersonFk INT;
-
+
SET vSalesPersonFk = client_getSalesPerson(vClientFk, vDated);
SELECT code
INTO vWorkerCode
- FROM worker
+ FROM worker
WHERE id = vSalesPersonFk;
RETURN vWorkerCode;
@@ -44761,11 +44761,11 @@ BEGIN
**/
DECLARE vClientFk INT;
DECLARE vDated DATE;
-
+
SELECT clientFk, shipped
INTO vClientFk, vDated
FROM ticket WHERE id = vTicketFk;
-
+
RETURN client_getSalesPersonCode(vClientFk, vDated);
END ;;
DELIMITER ;
@@ -44857,7 +44857,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `currentRate`(vCurrencyFk INT, vDated
BEGIN
DECLARE curRate DECIMAL(10,4);
-
+
SELECT value INTO curRate
FROM referenceRate
WHERE dated <= vDated
@@ -44888,23 +44888,23 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `deviceProductionUser_accessGranted`(
BEGIN
/*
* Comprueba si el usuario puede entrar en la aplicacion de almacen con ese movil
- *
+ *
* */
-
+
/*DECLARE vIsGranted BOOLEAN;
DECLARE vDeviceProductionFk INT(11) DEFAULT NULL;
- SELECT dp.id INTO vDeviceProductionFk
- FROM vn.deviceProduction dp
+ SELECT dp.id INTO vDeviceProductionFk
+ FROM vn.deviceProduction dp
WHERE dp.android_id = android_id;
IF vDeviceProductionFk THEN
-
- SELECT COUNT(*) INTO vIsGranted
- FROM vn.deviceProductionUser dpu
- WHERE dpu.userFk = vUserFK
+
+ SELECT COUNT(*) INTO vIsGranted
+ FROM vn.deviceProductionUser dpu
+ WHERE dpu.userFk = vUserFK
AND dpu.deviceProductionFk = vDeviceProductionFk;
-
+
RETURN vIsGranted;
END IF;*/
RETURN TRUE;
@@ -44928,16 +44928,16 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `duaTax_getRate`(vDua INT, vTaxClass
DETERMINISTIC
BEGIN
DECLARE vCountryFk INTEGER;
-
+
SELECT s.countryFk INTO vCountryFk
FROM dua d
JOIN supplier s ON s.id = d.companyFk
WHERE d.id = vDua;
-
+
RETURN (SELECT rate
FROM
(SELECT taxClassFk, rate
- FROM invoiceInTaxBookingAccount
+ FROM invoiceInTaxBookingAccount
WHERE effectived <= util.VN_CURDATE()
AND countryFk = vCountryFk
AND taxClassFk = vTaxClass
@@ -44965,24 +44965,24 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `ekt_getEntry`(vEktFk INT) RETURNS in
READS SQL DATA
BEGIN
/**
- * Devuelve el numero de entrada para el ekt
- *
+ * Devuelve el numero de entrada para el ekt
+ *
* @param vEktFk Identificador de edi.ekt
- */
+ */
DECLARE vTravelFk INT;
DECLARE vEntryFk INT DEFAULT 0;
DECLARE vEntryAssignFk INT;
- SELECT ea.id
+ SELECT ea.id
INTO vEntryAssignFk
FROM edi.ekt e
- JOIN vn.ektEntryAssign ea ON
+ JOIN vn.ektEntryAssign ea ON
IFNULL(ea.sub, e.sub) <=> e.sub AND
IFNULL(ea.kop, e.kop) <=> e.kop AND
IFNULL(ea.pro, e.pro) <=> e.pro AND
IFNULL(ea.auction, e.auction) <=> e.auction
WHERE e.id = vEktFk
- ORDER BY
+ ORDER BY
IF(ea.sub,1,0) * 1000 +
IF(ea.kop,1,0) * 100 +
IF(ea.pro,1,0) * 10 +
@@ -44993,7 +44993,7 @@ BEGIN
IF vTravelFk THEN
- SELECT MAX(e.id)
+ SELECT MAX(e.id)
INTO vEntryFk
FROM vn.entry e
JOIN vn.ektEntryAssign ea ON ea.id = vEntryAssignFk
@@ -45008,13 +45008,13 @@ BEGIN
INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk, kop, sub, reference, pro, auction)
SELECT vTravelFk, ea.supplierFk, ea.companyFk, cu.id, ea.kop, ea.sub, ea.ref, ea.pro, ea.auction
FROM vn.ektEntryAssign ea
- JOIN vn.currency cu ON cu.code = 'EUR'
+ JOIN vn.currency cu ON cu.code = 'EUR'
WHERE ea.id = vEntryAssignFk;
SET vEntryFk = LAST_INSERT_ID();
END IF;
- UPDATE vn.ektEntryAssign
+ UPDATE vn.ektEntryAssign
SET entryFk = vEntryFk
WHERE id = vEntryAssignFk;
@@ -45048,7 +45048,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `ekt_getTravel`(vEntryAssignFk INT, v
BEGIN
/**
* Devuelve un vn.travel.id
- *
+ *
* @param vEntryAssignFk Identificador de vn.entryAssign
*/
DECLARE vTravelFk INT;
@@ -45109,36 +45109,36 @@ BEGIN
DECLARE vCurrentCommission INT;
DECLARE vIsCurrencyUsd INT;
DECLARE vLastEntryFk INT;
-
+
SELECT count(*) INTO vIsCurrencyUsd
FROM currency c
WHERE c.code = 'USD' AND id = vCurrencyFk;
-
+
IF NOT vIsCurrencyUsd THEN
-
+
SELECT e.id INTO vLastEntryFk
FROM vn.entry e
JOIN vn.travel tr ON tr.id = e.travelFk
WHERE e.supplierFk = vSupplierFk
ORDER BY tr.landed DESC
LIMIT 1;
-
+
IF vLastEntryFk THEN
-
+
SELECT commission INTO vCurrentCommission
FROM vn.entry
WHERE id = vLastEntryFk;
-
+
ELSE
-
+
SELECT commission INTO vCurrentCommission
FROM supplier s
WHERE s.id = vSupplierFk;
-
+
END IF;
-
+
RETURN vCurrentCommission;
-
+
ELSE
SELECT ROUND(-100 * (1 - (1 / r.value))) INTO vCommission
@@ -45147,11 +45147,11 @@ BEGIN
WHERE t.id = vTravelFk
ORDER BY r.`dated` DESC
LIMIT 1;
-
+
RETURN IFNULL(vCommission, 0);
-
+
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -45202,10 +45202,10 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getForLogiflora`(vLanded DATE, vWarehouseFk INT) RETURNS int(11)
READS SQL DATA
BEGIN
-
+
/**
* Devuelve una entrada para Logiflora. Si no existe la crea.
- *
+ *
* @param vLanded Fecha de llegada al almacén
* @param vWarehouseFk Identificador de vn.warehouse
*/
@@ -45213,51 +45213,51 @@ BEGIN
DECLARE vTravelFk INT;
DECLARE vEntryFk INT;
DECLARE previousEntryFk INT;
-
+
SET vTravelFk = vn.travel_getForLogiflora(vLanded, vWarehouseFk);
-
+
IF vLanded THEN
-
- SELECT IFNULL(MAX(id),0) INTO vEntryFk
+
+ SELECT IFNULL(MAX(id),0) INTO vEntryFk
FROM vn.entry
- WHERE travelFk = vTravelFk
+ WHERE travelFk = vTravelFk
AND isRaid;
IF NOT vEntryFk THEN
-
+
INSERT INTO vn.entry(travelFk, supplierFk, commission, companyFk, currencyFk, isRaid)
SELECT vTravelFk, s.id, 4, c.id, cu.id, TRUE
FROM vn.supplier s
JOIN vn.company c ON c.code = 'VNL'
JOIN vn.currency cu ON cu.code = 'EUR'
WHERE s.name = 'KONINKLIJE COOPERATIEVE BLOEMENVEILING FLORAHOLLAN';
-
- SELECT MAX(id) INTO vEntryFk
+
+ SELECT MAX(id) INTO vEntryFk
FROM vn.entry
WHERE travelFk = vTravelFk;
-
- END IF;
-
- END IF;
- SELECT entryFk INTO previousEntryFk
+ END IF;
+
+ END IF;
+
+ SELECT entryFk INTO previousEntryFk
FROM edi.warehouseFloramondo wf
WHERE wf.warehouseFk = vWarehouseFk;
-
+
IF IFNULL(previousEntryFk,0) != vEntryFk THEN
-
- UPDATE buy b
- SET b.printedStickers = 0
+
+ UPDATE buy b
+ SET b.printedStickers = 0
WHERE entryFk = previousEntryFk;
DELETE FROM buy WHERE entryFk = previousEntryFk;
-
+
DELETE FROM entry WHERE id = previousEntryFk;
-
+
END IF;
-
+
RETURN vEntryFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -45290,21 +45290,21 @@ BEGIN
SELECT IFNULL(a.isUeeMember, c.isUeeMember), c.id
INTO vIsUeeSupplier, vSupplierCountry
- FROM entry e
- JOIN supplier s ON s.id = e.supplierFk
- JOIN country c ON c.id = s.countryFk
+ FROM entry e
+ JOIN supplier s ON s.id = e.supplierFk
+ JOIN country c ON c.id = s.countryFk
LEFT JOIN province p ON p.id = s.provinceFk
LEFT JOIN autonomy a ON a.id = p.autonomyFk
WHERE e.id = vSelf;
-
+
SELECT IFNULL(a.isUeeMember, c.isUeeMember), c.id
INTO vIsUeeCompany, vCompanyCountry
- FROM entry e
- JOIN supplier s ON s.id = e.companyFk
- JOIN country c ON c.id = s.countryFk
+ FROM entry e
+ JOIN supplier s ON s.id = e.companyFk
+ JOIN country c ON c.id = s.countryFk
LEFT JOIN province p ON p.id = s.provinceFk
LEFT JOIN autonomy a ON a.id = p.autonomyFk
- WHERE e.id = vSelf;
+ WHERE e.id = vSelf;
RETURN vIsUeeCompany AND vIsUeeSupplier AND (vSupplierCountry <> vCompanyCountry);
@@ -45369,17 +45369,17 @@ BEGIN
DECLARE vHasDistinctRoutes BOOL;
SELECT t.routeFk INTO vRouteFk
- FROM vn.expedition e
+ FROM vn.expedition e
JOIN vn.ticket t ON e.ticketFk = t.id
WHERE e.id = vExpeditionFk;
-
+
SELECT COUNT(*) > 0 INTO vHasDistinctRoutes
FROM vn.expeditionScan es
JOIN vn.expedition e ON es.expeditionFk = e.id
JOIN vn.ticket t ON e.ticketFk = t.id
WHERE es.palletFk = vPalletFk
AND t.routeFk <> vRouteFk;
-
+
RETURN vHasDistinctRoutes;
END ;;
@@ -45440,27 +45440,27 @@ BEGIN
DECLARE vDeliveryType INTEGER DEFAULT 0;
DECLARE isWaitingForPickUp BOOLEAN DEFAULT FALSE;
DECLARE vCode VARCHAR(45);
-
+
SELECT am.deliveryMethodFk
- INTO vDeliveryType
+ INTO vDeliveryType
FROM ticket t
JOIN agencyMode am ON am.id = t.agencyModeFk
WHERE t.id = vTicket;
-
+
CASE vDeliveryType
WHEN 1 THEN -- AGENCIAS
SET vCode = 'DELIVERED';
-
+
WHEN 2 THEN -- REPARTO
SET vCode = 'ON_DELIVERY';
-
+
ELSE -- MERCADO, OTROS
SELECT MIN(t.warehouseFk <> w.id) INTO isWaitingForPickUp
- FROM ticket t
+ FROM ticket t
LEFT JOIN warehouse w
ON w.pickUpagencyModeFk = t.agencyModeFk
WHERE t.id = vTicket;
-
+
IF isWaitingForPickUp THEN
SET vCode = 'WAITING_FOR_PICKUP';
ELSE
@@ -45490,28 +45490,28 @@ BEGIN
DECLARE vDeliveryType INTEGER DEFAULT 0;
DECLARE isWaitingForPickUp BOOLEAN DEFAULT FALSE;
DECLARE vCode VARCHAR(45);
-
- SELECT
+
+ SELECT
a.Vista
- INTO vDeliveryType
+ INTO vDeliveryType
FROM vn2008.Tickets t
JOIN vn2008.Agencias a ON a.Id_Agencia = t.Id_Agencia
WHERE Id_Ticket = vTicket;
-
+
CASE vDeliveryType
WHEN 1 THEN -- AGENCIAS
SET vCode = 'DELIVERED';
-
+
WHEN 2 THEN -- REPARTO
SET vCode = 'ON_DELIVERY';
-
+
ELSE -- MERCADO, OTROS
SELECT t.warehouse_id <> w.warehouse_id INTO isWaitingForPickUp
- FROM vn2008.Tickets t
- LEFT JOIN vn2008.warehouse_pickup w
+ FROM vn2008.Tickets t
+ LEFT JOIN vn2008.warehouse_pickup w
ON w.agency_id = t.Id_Agencia AND w.warehouse_id = t.warehouse_id
WHERE t.Id_Ticket = vTicket;
-
+
IF isWaitingForPickUp THEN
SET vCode = 'WAITING_FOR_PICKUP';
ELSE
@@ -45619,16 +45619,16 @@ BEGIN
DECLARE vReturn DATE;
DECLARE vDuaDate DATE;
DECLARE vDuaDateDay INT;
-
+
SELECT TIMESTAMPADD(DAY, vGapDays, vDated) INTO vDuaDate;
IF vDuaDate = CONCAT(YEAR(vDuaDate), '-03-01') THEN
- SET vDuaDate = TIMESTAMPADD (DAY , -1, vDuaDate);
+ SET vDuaDate = TIMESTAMPADD (DAY , -1, vDuaDate);
ELSEIF vDuaDate = CONCAT(YEAR(vDuaDate), '-02-29') THEN
- SET vDuaDate = TIMESTAMPADD (DAY , -2, vDuaDate);
+ SET vDuaDate = TIMESTAMPADD (DAY , -2, vDuaDate);
END IF;
- IF MONTH(vDuaDate) = 2 AND vPayDay = 30 THEN
+ IF MONTH(vDuaDate) = 2 AND vPayDay = 30 THEN
IF util.isLeapYear(YEAR(vDuaDate)) THEN
SET vPayDay = 29;
ELSE
@@ -45636,7 +45636,7 @@ BEGIN
END IF;
END IF;
- SELECT DAY(vDuaDate) INTO vDuaDateDay;
+ SELECT DAY(vDuaDate) INTO vDuaDateDay;
RETURN TIMESTAMPADD(MONTH, (vDuaDateDay > vPayDay), DATE_FORMAT(vDuaDate, CONCAT('%y/%m/', vPayDay)));
END ;;
DELIMITER ;
@@ -45658,11 +45658,11 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `getShipmentHour`(vTicket INT) RETURN
READS SQL DATA
BEGIN
DECLARE vShipmentHour INT;
-
+
SELECT HOUR(shipped) INTO vShipmentHour
FROM ticket
WHERE id = vTicket;
-
+
IF vShipmentHour = 0
THEN
DROP TEMPORARY TABLE IF EXISTS tmp.production_buffer;
@@ -45677,11 +45677,11 @@ BEGIN
JOIN agencyMode am on am.id = t.agencyModeFk
JOIN address a on a.id = t.addressFk
WHERE t.id = vTicket;
-
- SELECT Hora INTO vShipmentHour
+
+ SELECT Hora INTO vShipmentHour
FROM tmp.production_buffer;
END IF;
-
+
RETURN vShipmentHour;
END ;;
DELIMITER ;
@@ -45706,12 +45706,12 @@ BEGIN
SELECT rate3 INTO price
FROM vn.priceFixed
- WHERE itemFk = vItemFk
+ WHERE itemFk = vItemFk
AND util.VN_CURDATE() BETWEEN started AND ended ORDER BY created DESC LIMIT 1;
- SELECT `value` INTO price
+ SELECT `value` INTO price
FROM vn.specialPrice
- WHERE itemFk = vItemFk
+ WHERE itemFk = vItemFk
AND clientFk = vClientFk ;
RETURN price;
END ;;
@@ -45735,7 +45735,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `getTicketTrolleyLabelCount`(vTicket
BEGIN
DECLARE vLabelCount INT DEFAULT 0;
- SELECT labelCount INTO vLabelCount
+ SELECT labelCount INTO vLabelCount
FROM ticketTrolley
WHERE ticket = vTicket;
@@ -45865,17 +45865,17 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `hasItemsInSector`(vTicketFk INT, vSe
BEGIN
DECLARE vItemCount INT;
-
+
SELECT count(*) INTO vItemCount
- FROM vn.sale s
+ FROM vn.sale s
JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
JOIN vn.parking p ON p.id = sh.parkingFk
WHERE s.ticketFk = vTicketFk
AND p.sectorFk = vSectorFk;
-
+
RETURN vItemCount;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -45898,7 +45898,7 @@ BEGIN
DECLARE vCountry INT;
DECLARE hasSomeNegativeBase BOOLEAN;
- SELECT s.countryFk
+ SELECT s.countryFk
INTO vCountry
FROM supplier s
JOIN ticket t ON t.companyFk = s.id
@@ -45907,9 +45907,9 @@ BEGIN
SELECT COUNT(*) INTO hasSomeNegativeBase
FROM (
SELECT SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2)) taxableBase
- FROM sale s
+ FROM sale s
JOIN item i ON i.id = s.itemFk
- JOIN itemTaxCountry itc
+ JOIN itemTaxCountry itc
ON itc.itemFk = i.id AND itc.countryFk = vCountry
WHERE s.ticketFk = vTicket
GROUP BY itc.taxClassFk
@@ -45939,12 +45939,12 @@ BEGIN
DECLARE totalAmount DECIMAL(10,2);
SELECT SUM(vat) INTO totalAmount
- FROM (
+ FROM (
SELECT iot.vat
FROM invoiceOutTax iot
JOIN invoiceOut io ON io.id = iot.invoiceOutFk
WHERE io.ref = vInvoiceRef
- UNION ALL
+ UNION ALL
SELECT ioe.amount
FROM invoiceOutExpence ioe
JOIN invoiceOut io ON io.id = ioe.invoiceOutFk
@@ -45975,23 +45975,23 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `invoiceOut_getMaxIssued`(vSerial VAR
READS SQL DATA
BEGIN
/**
- * Retorna la fecha a partir de la cual es válido emitir una factura
+ * Retorna la fecha a partir de la cual es válido emitir una factura
*
- * @param vSerial Serie de facturación
+ * @param vSerial Serie de facturación
* @param vCompanyFk Empresa factura emitida
* @param vYear Año contable
* @return vInvoiceOutIssued fecha factura válida
*/
DECLARE vInvoiceOutIssued DATE;
DECLARE vFirstDayOfYear DATE;
-
+
SET vFirstDayOfYear := MAKEDATE(vYear, 1);
- SELECT IFNULL(MAX(io.issued), vFirstDayOfYear) INTO vInvoiceOutIssued
+ SELECT IFNULL(MAX(io.issued), vFirstDayOfYear) INTO vInvoiceOutIssued
FROM invoiceOut io
WHERE io.serial = vSerial
AND io.companyFk = vCompanyFk
- AND io.issued BETWEEN vFirstDayOfYear
+ AND io.issued BETWEEN vFirstDayOfYear
AND util.lastDayOfYear(vFirstDayOfYear);
RETURN vInvoiceOutIssued;
@@ -46017,7 +46017,7 @@ BEGIN
DECLARE vIssued DATE;
DECLARE vSerial VARCHAR(15);
- SELECT issued, ref
+ SELECT issued, ref
INTO vIssued, vSerial
FROM invoiceOut WHERE id = vSelf;
@@ -46089,9 +46089,9 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `invoiceSerial`(vClientFk INT, vCompa
DETERMINISTIC
BEGIN
/**
- * Obtiene la serie de de una factura
+ * Obtiene la serie de 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"]
@@ -46172,18 +46172,18 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `isLogifloraDay`(vShipped DATE, vWarehouse INT) RETURNS tinyint(1)
DETERMINISTIC
BEGIN
-
+
DECLARE vIsLogifloraDay BOOLEAN;
SELECT COUNT(*) INTO vIsLogifloraDay
FROM edi.warehouseFloramondo wf
- JOIN vn.floramondoConfig fc
+ JOIN vn.floramondoConfig fc
WHERE wf.warehouseFk = vWarehouse
AND vShipped BETWEEN DATE(TIMESTAMPADD(DAY, wf.travellingDays , fc.nextLanded))
AND DATE(TIMESTAMPADD(DAY, wf.travellingDays + wf.dayRange , fc.nextLanded));
-
+
RETURN vIsLogifloraDay;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -46220,7 +46220,7 @@ BEGIN
WHERE sl.scan_id = vScanId
AND t.Id_Ruta
) t1;
-
+
RETURN vDistinctRoutesInThePallet = 1;
END ;;
DELIMITER ;
@@ -46244,20 +46244,20 @@ BEGIN
DECLARE vPacking INTEGER DEFAULT 0;
DECLARE vItemFk INTEGER;
-
+
SELECT vn.barcodeToItem(vBarcode) INTO vItemFk;
-
- SELECT IFNULL(packing,0) INTO vPacking
- FROM vn.buy
+
+ SELECT IFNULL(packing,0) INTO vPacking
+ FROM vn.buy
WHERE id = CAST(vBarcode AS DECIMAL(18,0));
-
-
-
-
+
+
+
+
IF NOT vPacking THEN
CALL cache.last_buy_refresh(FALSE);
SELECT IFNULL(packing,1) INTO vPacking
- FROM
+ FROM
(SELECT packing , created
FROM vn.itemShelving
WHERE itemFk = vItemFk
@@ -46270,11 +46270,11 @@ BEGIN
) packings
ORDER BY created desc
LIMIT 1;
-
+
END IF;
-
+
RETURN vPacking;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -46299,11 +46299,11 @@ BEGIN
DECLARE vColumn INT;
DECLARE vClosestParkingFk INT;
DECLARE vSectorFk INT;
-
+
SELECT p.column, sectorFk INTO vColumn, vSectorFk
FROM vn.parking p
WHERE p.id = vParkingFk;
-
+
SELECT itemShelvingFk INTO vClosestParkingFk
FROM
(
@@ -46313,12 +46313,12 @@ BEGIN
JOIN vn.itemPlacementSupplyList ipsl ON ipsl.sectorFk = ispss.sectorFk AND ipsl.itemFk = ispss.itemFk
WHERE p.sectorFk = vSectorFk
AND ipsl.saldo > 0
- ) sub
+ ) sub
ORDER BY distance
LIMIT 1;
-
+
RETURN vClosestParkingFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -46340,17 +46340,17 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `itemsInSector_get`(vTicketFk INT, vS
BEGIN
DECLARE vItemCount INT;
-
+
SELECT count(*) INTO vItemCount
- FROM vn.sale s
+ FROM vn.sale s
JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
JOIN vn.parking p ON p.id = sh.parkingFk
WHERE s.ticketFk = vTicketFk
AND p.sectorFk = vSectorFk;
-
+
RETURN vItemCount;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -46423,29 +46423,29 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `item_getPackage`(vItemFk INT) RETURNS varchar(50) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci
DETERMINISTIC
BEGIN
-
+
DECLARE vDiameter INT;
DECLARE vPackageFk VARCHAR(50);
DECLARE vCoeficient DOUBLE DEFAULT 1.08;
-
+
SELECT MAX(LEFT(value,3)) INTO vDiameter
- FROM vn.itemTag it
+ FROM vn.itemTag it
JOIN vn.tag t ON t.id = it.tagFk
WHERE it.itemFk = vItemFk
AND t.overwrite = 'diameter';
-
+
SELECT 8000 + FLOOR(vc.ccLength * vc.ccWidth / (vCoeficient * PI() * (vDiameter / 2) * (vDiameter / 2)))
INTO vPackageFk
FROM vn.volumeConfig vc;
-
+
INSERT IGNORE INTO vn.packaging(id, width, `depth`)
- SELECT vPackageFk,
- FLOOR(vc.ccWidth / FLOOR(vc.ccWidth / vDiameter)),
+ SELECT vPackageFk,
+ FLOOR(vc.ccWidth / FLOOR(vc.ccWidth / vDiameter)),
FLOOR(vc.ccLength / FLOOR(vc.ccLength / vDiameter))
FROM vn.volumeConfig vc;
-
+
RETURN vPackageFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -46482,7 +46482,7 @@ BEGIN
FROM packaging p
JOIN item i ON i.id = vSelf
WHERE p.id = vPackaging;
-
+
RETURN vVolume;
END ;;
@@ -46503,7 +46503,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `lastDayOfWeek`(vYear INT, vWeek INT) RETURNS date
DETERMINISTIC
-BEGIN
+BEGIN
/**
* Returns the date of the last day of the week
*
@@ -46542,16 +46542,16 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `machine_checkPlate`(vPlate VARCHAR(1
BEGIN
/**
* Comprueba si existe matrícula
- *
+ *
* @param vPlate matrícula del vehículo
* @return Devuelve TRUE en caso de que exista
- *
+ *
*/
-
+
IF (SELECT COUNT(*)
- FROM machine m
+ FROM machine m
WHERE m.plate = vPlate
- ) THEN
+ ) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
@@ -46578,9 +46578,9 @@ BEGIN
DECLARE result INT;
DECLARE vSenderFk INT;
- SELECT id INTO vSenderFk
+ SELECT id INTO vSenderFk
FROM account.user WHERE `name` = account.myUser_getName();
-
+
RETURN (SELECT messageSendWithUser(vSenderFk, vRecipient, vMessage));
END ;;
DELIMITER ;
@@ -46607,9 +46607,9 @@ BEGIN
DECLARE vSendDate DATETIME DEFAULT util.VN_NOW();
DECLARE vSender VARCHAR(255) CHARSET utf8;
- SELECT `name` INTO vSender
+ SELECT `name` INTO vSender
FROM account.user WHERE id = vSenderFK;
-
+
SET vRecipient = LOWER(vRecipient);
DROP TEMPORARY TABLE IF EXISTS tRecipients;
@@ -46630,7 +46630,7 @@ BEGIN
IF vCount = 0 THEN
RETURN vCount;
- END IF;
+ END IF;
SET vUuid = UUID();
@@ -46641,7 +46641,7 @@ BEGIN
message = vMessage,
sendDate = vSendDate;
- INSERT INTO messageInbox (uuid, sender, recipient, finalRecipient, message, sendDate)
+ INSERT INTO messageInbox (uuid, sender, recipient, finalRecipient, message, sendDate)
SELECT vUuid, vSender, vRecipient, finalRecipient, vMessage, vSendDate
FROM tRecipients;
@@ -46715,7 +46715,7 @@ BEGIN
-- Devuelte el volumen total de la orden sumada
DECLARE vWarehouseId INTEGER;
DECLARE vVolume DECIMAL(10,3);
-
+
SELECT IFNULL(SUM(o.amount * ic.cm3delivery)/1000000,0) INTO vVolume
FROM hedera.orderRow o
JOIN item i ON i.id = o.itemFk
@@ -46792,7 +46792,7 @@ BEGIN
WHERE cb.id = packagingReturnFk;
SET vValue = IF (vAmount IS NULL,
- IFNULL(base,0),
+ IFNULL(base,0),
vAmount / IFNULL(upload, 0) + IFNULL(base, 0));
ELSE
SET vValue = IFNULL(price, 0) + IFNULL(base, 0);
@@ -46819,7 +46819,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `phytoPassport`(vRef VARCHAR(15)) RET
DETERMINISTIC
BEGIN
DECLARE vPhyto TEXT CHARSET utf8 COLLATE utf8_unicode_ci;
-SELECT
+SELECT
GROUP_CONCAT(i.id,
':',
ppa.denomination,
@@ -46908,20 +46908,20 @@ BEGIN
DECLARE vRouteFk INT;
DECLARE vAddressFk INT;
-
+
DECLARE vLanded DATE;
DECLARE vZoneFk INT;
DECLARE vSignificativeFriendship INT DEFAULT 6;
DECLARE vVolumeMax DECIMAL(5,1) DEFAULT 10;
-
+
SELECT addressFk, zoneFk, landed INTO vAddressFk, vZoneFk, vLanded
- FROM vn.ticket
+ FROM vn.ticket
WHERE id = vTicketFk;
-
+
-- Se inicia la selección de rutas posibles con aquellas cuyas agencias alguna vez han estado asociadas con nuestra zona
DROP TEMPORARY TABLE IF EXISTS tmp.route;
CREATE TEMPORARY TABLE tmp.route
- SELECT r.id routeFk,
+ SELECT r.id routeFk,
zf.friendship zoneFriendship
FROM vn.route r
JOIN cache.zoneAgencyFriendship zf ON zf.agencyModeFk = r.agencyModeFk
@@ -46929,16 +46929,16 @@ BEGIN
AND zf.zoneFk = vZoneFk
AND r.created = vLanded
ORDER BY friendship;
-
+
-- Se eliminan aquellas que superan el volumen máximo
DELETE r.*
- FROM tmp.route r
+ FROM tmp.route r
JOIN (SELECT routeFk, sum(volume) volume
FROM vn.saleVolume
WHERE landed = vLanded
GROUP BY routeFk) sub ON sub.routeFk = r.routeFk
WHERE sub.volume > vVolumeMax;
-
+
-- Se ordenan las que quedan en función con la afinidad del resto de consignatarios de cada ruta
SELECT routeFk INTO vRouteFk
FROM
@@ -46950,7 +46950,7 @@ BEGIN
ORDER BY zoneFriendship DESC, friendshipSum DESC
) sub
LIMIT 1;
-
+
RETURN vRouteFk;
END ;;
DELIMITER ;
@@ -46975,9 +46975,9 @@ BEGIN
DECLARE vRouteFk INT;
DECLARE vAddressFk INT;
DECLARE vShipped DATETIME;
-
+
SELECT addressFk, date(shipped) INTO vAddressFk, vShipped
- FROM vn.ticket
+ FROM vn.ticket
WHERE id = vTicketFk;
SELECT routeFk INTO vRouteFk
@@ -46991,7 +46991,7 @@ BEGIN
ORDER BY friendshipSum DESC
) sub
LIMIT 1;
-
+
RETURN vRouteFk;
END ;;
DELIMITER ;
@@ -47015,20 +47015,20 @@ BEGIN
DECLARE vRouteFk INT;
DECLARE vAddressFk INT;
-
+
DECLARE vLanded DATE;
DECLARE vZoneFk INT;
DECLARE vSignificativeFriendship INT DEFAULT 6;
DECLARE vVolumeMax DECIMAL(5,1) DEFAULT 10;
-
+
SELECT addressFk, zoneFk, landed INTO vAddressFk, vZoneFk, vLanded
- FROM vn.ticket
+ FROM vn.ticket
WHERE id = vTicketFk;
-
+
-- Se inicia la selección de rutas posibles con aquellas cuyas agencias alguna vez han estado asociadas con nuestra zona
DROP TEMPORARY TABLE IF EXISTS tmp.route;
CREATE TEMPORARY TABLE tmp.route
- SELECT r.id routeFk,
+ SELECT r.id routeFk,
zf.friendship zoneFriendship
FROM vn.route r
JOIN cache.zoneAgencyFriendship zf ON zf.agencyModeFk = r.agencyModeFk
@@ -47036,16 +47036,16 @@ BEGIN
AND zf.zoneFk = vZoneFk
AND r.created = vLanded
ORDER BY friendship;
-
+
-- Se eliminan aquellas que superan el volumen máximo
DELETE r.*
- FROM tmp.route r
+ FROM tmp.route r
JOIN (SELECT routeFk, sum(volume) volume
FROM vn.saleVolume
WHERE landed = vLanded
GROUP BY routeFk) sub ON sub.routeFk = r.routeFk
WHERE sub.volume > vVolumeMax;
-
+
-- Se ordenan las que quedan en función con la afinidad del resto de consignatarios de cada ruta
SELECT routeFk INTO vRouteFk
FROM
@@ -47057,7 +47057,7 @@ BEGIN
ORDER BY zoneFriendship DESC, friendshipSum DESC
) sub
LIMIT 1;
-
+
RETURN vRouteFk;
END ;;
DELIMITER ;
@@ -47078,26 +47078,26 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `specie_IsForbidden`(vItemFk INT, vAddressFk INT) RETURNS tinyint(1)
READS SQL DATA
BEGIN
-
+
DECLARE vIsForbbiden BOOL;
DECLARE vLeft INT;
SELECT zg.lft INTO vLeft
- FROM vn.address a
- JOIN vn.zoneGeo zg ON zg.name = a.postalCode
+ FROM vn.address a
+ JOIN vn.zoneGeo zg ON zg.name = a.postalCode
WHERE a.id = vAddressFk;
-
+
SELECT sgi.isForbidden INTO vIsForbbiden
- FROM vn.specieGeoInvasive sgi
- JOIN vn.zoneGeo zg ON zg.id = sgi.zoneGeofk
+ FROM vn.specieGeoInvasive sgi
+ JOIN vn.zoneGeo zg ON zg.id = sgi.zoneGeofk
JOIN vn.itemBotanical ib ON ib.genusFk = sgi.genusFk AND sgi.specieFk IN ('sp.',ib.specieFk)
WHERE vLeft BETWEEN zg.lft AND zg.rgt
AND ib.itemFk = vItemFk
- ORDER BY zg.`depth` DESC
+ ORDER BY zg.`depth` DESC
LIMIT 1;
RETURN IFNULL(vIsForbbiden, FALSE);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47117,7 +47117,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `testCIF`(vCIF VARCHAR(9)) RETURNS varchar(10) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci
DETERMINISTIC
BEGIN
-
+
DECLARE vLetraInicial VARCHAR(1);
DECLARE vLetraFinal VARCHAR(1);
DECLARE vParteNumerica VARCHAR(7);
@@ -47129,60 +47129,60 @@ BEGIN
SET vLetraInicial = SUBSTR(vCIF, 1, 1);
SET vLetraFinal = SUBSTR(vCIF, 9, 1);
SET vParteNumerica = SUBSTR(vCIF, 2, 7);
-
- WHILE i < 7 DO
-
+
+ WHILE i < 7 DO
+
SET i = i + 1;
-
+
SET vNumero = CAST(SUBSTR(vParteNumerica, i, 1) AS DECIMAL(1,0));
-
+
IF i MOD 2 THEN
-
+
SET vNumero = vNumero * 2;
SET vNumero = vNumero MOD 10 + FLOOR(vNumero/10);
-
+
END IF;
-
+
SET vSuma = vSuma + vNumero;
-
+
END WHILE;
-
+
SET vSuma = vSuma MOD 10;
-
+
IF vSuma > 0 THEN
-
+
SET vSuma = 10 - vSuma;
-
+
END IF;
-
+
-- Comprobación de dígito de control
IF CAST(vLetraFinal AS DECIMAL(1,0)) = vSuma THEN
-
+
SET vResult = TRUE;
-
+
END IF;
-
+
IF vSuma = 0 THEN
-
+
SET vSuma = 10;
-
+
END IF;
-
+
IF CHAR(64 + vSuma) = vLetraFinal THEN
-
+
SET vResult = TRUE;
-
+
END IF;
-
+
-- Sólo se aceptan letras como caracter inicial
IF ASCII(vLetraInicial) < 65 OR ASCII(vLetraInicial) > 87 THEN -- Ha de ser entre la A y la W
-
+
SET vResult = FALSE;
-
+
END IF;
-
+
RETURN vResult;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47202,7 +47202,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `testNIE`(vNIE VARCHAR(9)) RETURNS tinyint(1)
DETERMINISTIC
BEGIN
-
+
DECLARE vIndice INT;
DECLARE vNumero VARCHAR(7);
DECLARE vOperador VARCHAR(9);
@@ -47211,45 +47211,45 @@ BEGIN
DECLARE vLetraFinal VARCHAR(1);
DECLARE vLetrasFinalesPosibles VARCHAR(24) DEFAULT "TRWAGMYFPDXBNJZSQVHLCKE";
DECLARE vLetraInicialEsIncorrecta BOOL DEFAULT FALSE;
-
+
SET vLetraInicial = SUBSTR(vNIE, 1, 1);
SET vLetraFinal = SUBSTR(vNIE, 9, 1);
SET vNumero = SUBSTR(vNIE, 2, 7);
CASE vLetraInicial
-
+
WHEN 'X' THEN
-
+
SET vOperador = "0";
-
+
WHEN 'Y' THEN
-
+
SET vOperador = "1";
-
+
WHEN 'Z' THEN
-
+
SET vOperador = "2";
-
+
ELSE
-
+
SET vLetraInicialEsIncorrecta = TRUE;
-
+
END CASE;
-
+
SET vOperador = CONCAT(vOperador, vNumero);
SET vParteNumerica = CAST(vOperador AS DECIMAL(8,0));
SET vIndice = Round(vParteNumerica Mod 23, 0) + 1;
IF SUBSTR(vLetrasFinalesPosibles, vIndice, 1) = vLetraFinal AND vLetraInicialEsIncorrecta = FALSE THEN
-
+
RETURN TRUE;
-
+
ELSE
-
+
RETURN FALSE;
-
+
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47274,23 +47274,23 @@ BEGIN
DECLARE vParteNumerica DECIMAL(8,0);
DECLARE vLetra VARCHAR(1);
DECLARE vLetrasPosibles VARCHAR(24) DEFAULT "TRWAGMYFPDXBNJZSQVHLCKE";
-
+
SET vLetra = SUBSTRING(vNIF, 9, 1);
-
+
SET vParteNumerica = CAST(SUBSTRING(vNIF, 1, 8) AS DECIMAL(8,0));
-
+
SET vIndice = Round(vParteNumerica MOD 23, 0) + 1;
-
+
If SUBSTRING(vLetrasPosibles, vIndice, 1) = vLetra Then
-
+
RETURN TRUE;
-
+
ELSE
-
+
RETURN FALSE;
-
+
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47310,21 +47310,21 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `ticketCollection_getNoPacked`(vCollectionFk INT) RETURNS varchar(100) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci
DETERMINISTIC
BEGIN
-
+
/*
* return message with tickets and collection if there is tickets of a collection without expeditions
- *
+ *
* @param vCollectionFk the collection to check
* @return an array with collection and tickets without expeditions
- *
+ *
*/
-
+
DECLARE vAnswer VARCHAR(100) DEFAULT '';
IF collection_isPacked(vCollectionFk) = FALSE THEN
SELECT CONCAT('Colección: ',tc.collectionFk,' Tickets: ' , GROUP_CONCAT(tc.ticketFk) ) INTO vAnswer
FROM vn.ticketCollection tc
- LEFT JOIN vn.expedition e ON e.ticketFk = tc.ticketFk
+ LEFT JOIN vn.expedition e ON e.ticketFk = tc.ticketFk
WHERE tc.collectionFk = vCollectionFk
AND ISNULL(e.id);
END IF;
@@ -47370,9 +47370,9 @@ BEGIN
DROP TEMPORARY TABLE
tmp.ticket,
tmp.ticketTotal;
-
+
RETURN vTotal;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47392,7 +47392,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `ticketPositionInPath`(vTicketId INT) RETURNS varchar(10) CHARSET utf8mb3 COLLATE utf8mb3_general_ci
DETERMINISTIC
BEGIN
-
+
DECLARE vRestTicketsMaxOrder INT;
DECLARE vRestTicketsMinOrder INT;
DECLARE vRestTicketsPacking INT;
@@ -47404,7 +47404,7 @@ BEGIN
DECLARE vExpeditionsCount INT;
DECLARE vIsValenciaPath BOOLEAN DEFAULT FALSE;
-SELECT `order`
+SELECT `order`
INTO PACKING_ORDER
FROM state
WHERE code = 'PACKING';
@@ -47415,7 +47415,7 @@ SELECT t.routeFk, t.warehouseFk, IFNULL(ts.productionOrder,0)
LEFT JOIN ticketState ts on ts.ticket = t.id
WHERE t.id = vTicketId;
-SELECT (ag.`name` = 'VN_VALENCIA')
+SELECT (ag.`name` = 'VN_VALENCIA')
INTO vIsValenciaPath
FROM vn2008.Rutas r
JOIN vn2008.Agencias a on a.Id_Agencia = r.Id_Agencia
@@ -47429,7 +47429,7 @@ IF vIsValenciaPath THEN -- Rutas Valencia
FROM expedition e
JOIN ticket t ON t.id = e.ticketFk
WHERE t.routeFk = vMyPath;
-
+
SELECT MAX(ts.productionOrder), MIN(ts.productionOrder)
INTO vRestTicketsMaxOrder, vRestTicketsMinOrder
FROM ticket t
@@ -47438,7 +47438,7 @@ IF vIsValenciaPath THEN -- Rutas Valencia
AND t.warehouseFk = vMyWarehouse
AND t.id != vTicketid;
- SELECT COUNT(*)
+ SELECT COUNT(*)
INTO vRestTicketsPacking
FROM ticket t
LEFT JOIN ticketState ts on t.id = ts.ticket
@@ -47493,9 +47493,9 @@ BEGIN
LEFT JOIN vn2008.movement_label l ON l.Id_Movimiento = s.id
WHERE ticketFk = vTicketFk
) sub;
-
+
RETURN IFNULL(vSplitCounter,'--');
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47544,21 +47544,21 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `ticketTotalVolumeBoxes`(vTicketId IN
DETERMINISTIC
BEGIN
-/*
+/*
* Devuelve el volumen estimado del ticket sumado, en cajas
*
* vTicketId Numero de ticket
- *
+ *
*/
DECLARE vVolumeBoxM3 DOUBLE;
DECLARE vTicketTotalVolumeBoxes DECIMAL(10,1);
DECLARE vVnBoxId VARCHAR(10) DEFAULT '94';
-
+
SELECT volume / 1000000 INTO vVolumeBoxM3 FROM packaging WHERE id = vVnBoxId;
-
+
SET vTicketTotalVolumeBoxes = ticketTotalVolume(vTicketId) / vVolumeBoxM3;
-
+
RETURN vTicketTotalVolumeBoxes;
END ;;
@@ -47583,7 +47583,7 @@ BEGIN
DECLARE vWarehouseFk INT;
SELECT warehouseFk INTO vWarehouseFk
- FROM ticket
+ FROM ticket
WHERE id = vTicketFk;
RETURN vWarehouseFk;
@@ -47606,18 +47606,18 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_CC_volume`(vTicketFk INT) RETURNS decimal(10,1)
READS SQL DATA
BEGIN
-
+
DECLARE vCC DECIMAL(10,1);
SELECT sum(sv.volume * IF(i.itemPackingTypeFk = 'H', vc.dutchCompressionRate, 1)) / (p.volume / 1000000)
INTO vCC
- FROM vn.saleVolume sv
- JOIN vn.sale s ON s.id = sv.saleFk
- JOIN vn.item i ON i.id = s.itemFk
+ FROM vn.saleVolume sv
+ JOIN vn.sale s ON s.id = sv.saleFk
+ JOIN vn.item i ON i.id = s.itemFk
JOIN vn.packaging p ON p.id = 'CC'
- JOIN vn.volumeConfig vc
+ JOIN vn.volumeConfig vc
WHERE sv.ticketFk = vTicketFk;
-
+
RETURN vCC;
END ;;
@@ -47639,44 +47639,44 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_get`(vParamFk INT) RETURNS int(11)
READS SQL DATA
proc:BEGIN
-
+
/* Devuelve el número de ticket o collection consultando en varias tablas posibles
- *
+ *
* @param vParamFk Número a validar
* @return vValidFk Identificador validado
*/
-
+
DECLARE vValidFk INT;
-- Tabla vn.saleGroup
SELECT s.ticketFk INTO vValidFk
FROM vn.sale s
JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
- JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk
+ JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk
WHERE sg.id = vParamFk
AND sg.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE())
LIMIT 1;
-
+
IF vValidFk THEN
-
+
RETURN vValidFk;
-
+
LEAVE proc;
-
+
END IF;
-- Tabla vn.collection
SELECT c.id INTO vValidFk
- FROM vn.collection c
+ FROM vn.collection c
WHERE c.id = vParamFk
AND c.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE());
-
+
IF vValidFk THEN
-
+
RETURN vValidFk;
-
+
LEAVE proc;
-
+
END IF;
-- Tabla vn.ticket
@@ -47684,17 +47684,17 @@ proc:BEGIN
FROM vn.ticket t
WHERE t.id = vParamFk
AND t.shipped > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE());
-
+
IF vValidFk THEN
-
+
RETURN vValidFk;
-
+
LEAVE proc;
-
+
END IF;
RETURN NULL;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47720,8 +47720,8 @@ BEGIN
* @vTicketFk Id del ticket a calcular
*/
DECLARE deliveryPrice DECIMAL (10,2);
-
- IF (SELECT isVolumetric FROM ticket t JOIN zone z ON t.zoneFk = z.id
+
+ IF (SELECT isVolumetric FROM ticket t JOIN zone z ON t.zoneFk = z.id
WHERE t.id = vTicketFk) THEN
SELECT SUM(sv.freight) INTO deliveryPrice
FROM vn.saleVolume sv
@@ -47732,7 +47732,7 @@ BEGIN
LEFT JOIN expedition e ON e.ticketFk = t.id
JOIN expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk
WHERE t.id = vTicketFk;
-
+
END IF;
RETURN deliveryPrice;
END ;;
@@ -47756,16 +47756,16 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_getWeight`(vTicketFk INT) RET
BEGIN
/**
* Devuelve el peso total del ticket
- *
+ *
* @return Total peso
*/
-
+
DECLARE vWeight DECIMAL(10,3);
SELECT sum(weight) INTO vWeight
FROM saleVolume
WHERE ticketFk = vTicketFk;
-
+
RETURN vWeight;
END ;;
@@ -47787,15 +47787,15 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_HasUbication`(vTicketFk INT) RETURNS tinyint(1)
READS SQL DATA
BEGIN
-
+
DECLARE hasUbication BOOL;
SELECT COUNT(*) INTO hasUbication
FROM vn.ticket t
JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
- WHERE rm.beachFk
+ WHERE rm.beachFk
AND t.id = vTicketFk;
-
+
RETURN hasUbication;
END ;;
@@ -47944,7 +47944,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `timeWorkerControl_getDirection`(vUse
READS SQL DATA
BEGIN
/**
- * Verifica la dirección de la fichada
+ * Verifica la dirección de la fichada
* @param vUserFk Identificador del trabajador
* @param vTimed Hora de la fichada
* @return Retorna sentido de la fichada 'in, out, middle'
@@ -47957,40 +47957,40 @@ BEGIN
DECLARE vDayStayMax INT;
DECLARE vTimedSeconds INT;
DECLARE vLastTimeIn INT;
-
+
SELECT UNIX_TIMESTAMP(vTimed) INTO vTimedSeconds;
-
+
SELECT dayStayMax INTO vDayStayMax
FROM vn.workerTimeControlParams;
SELECT timed, direction INTO vNext,vNextDirection
- FROM vn.workerTimeControl
- WHERE userFk = vUserFk
+ FROM vn.workerTimeControl
+ WHERE userFk = vUserFk
AND direction IN ('in','out')
AND timed > vTimed
ORDER BY timed ASC
LIMIT 1;
-
+
SELECT timed, direction INTO vPrevious, vPreviousDirection
- FROM vn.workerTimeControl
- WHERE userFk = vUserFk
+ FROM vn.workerTimeControl
+ WHERE userFk = vUserFk
AND direction IN ('in','out')
AND timed < vTimed
ORDER BY timed DESC
- LIMIT 1;
-
- IF (vTimedSeconds - UNIX_TIMESTAMP(vPrevious) + UNIX_TIMESTAMP(vNext) - vTimedSeconds)<= vDayStayMax AND vPreviousDirection = 'in' AND vNextDirection = 'out' THEN
+ LIMIT 1;
+
+ IF (vTimedSeconds - UNIX_TIMESTAMP(vPrevious) + UNIX_TIMESTAMP(vNext) - vTimedSeconds)<= vDayStayMax AND vPreviousDirection = 'in' AND vNextDirection = 'out' THEN
RETURN 'middle';
END IF;
-
-
+
+
IF (vTimedSeconds> UNIX_TIMESTAMP(vPrevious)) THEN
- IF vPreviousDirection = 'in' THEN
+ IF vPreviousDirection = 'in' THEN
RETURN 'out';
ELSE
SELECT UNIX_TIMESTAMP(MAX(timed)) INTO vLastTimeIn
- FROM vn.workerTimeControl
- WHERE userFk = vUserFk
+ FROM vn.workerTimeControl
+ WHERE userFk = vUserFk
AND direction ='in'
AND timed < vPrevious;
IF vTimedSeconds - vLastTimeIn <= vDayStayMax THEN
@@ -48044,11 +48044,11 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `travel_getForLogiflora`(vLanded DATE, vWarehouseFk INT) RETURNS int(11)
READS SQL DATA
BEGIN
-
+
/**
* Devuelve un número de travel para compras de Logiflora a partir de la fecha de llegada y del almacén.
* Si no existe lo genera.
- *
+ *
* @param vLanded Fecha de llegada al almacén
* @param vWarehouseFk Identificador de vn.warehouse
*/
@@ -48056,8 +48056,8 @@ BEGIN
DECLARE vTravelFk INT;
IF vLanded THEN
-
- SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk
+
+ SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk
FROM vn.travel tr
JOIN vn.warehouse wIn ON wIn.id = tr.warehouseInFk
JOIN vn.warehouse wOut ON wOut.id = tr.warehouseOutFk
@@ -48068,14 +48068,14 @@ BEGIN
AND landed = vLanded;
IF NOT vTravelFk THEN
-
+
INSERT INTO vn.travel(landed, shipped, warehouseInFk, warehouseOutFk, agencyModeFk)
- SELECT vLanded, util.VN_CURDATE(), vWarehouseFk, wOut.id, am.id
- FROM vn.warehouse wOut
+ SELECT vLanded, util.VN_CURDATE(), vWarehouseFk, wOut.id, am.id
+ FROM vn.warehouse wOut
JOIN vn.agencyMode am ON am.name = 'LOGIFLORA'
WHERE wOut.name = 'Holanda';
-
- SELECT MAX(tr.id) INTO vTravelFk
+
+ SELECT MAX(tr.id) INTO vTravelFk
FROM vn.travel tr
JOIN vn.warehouse wIn ON wIn.id = tr.warehouseInFk
JOIN vn.warehouse wOut ON wOut.id = tr.warehouseOutFk
@@ -48083,11 +48083,11 @@ BEGIN
AND wOut.name = 'Holanda'
AND landed = vLanded;
END IF;
-
+
END IF;
-
+
RETURN vTravelFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -48114,21 +48114,21 @@ BEGIN
DECLARE vChar INT;
SET vLength = length(vString);
-
+
WHILE vLength > 0 DO
-
+
SET vChar = MID(vString,vLength,1);
-
+
SET vSeed = vSeed + ASCII(vChar);
-
+
SET vLength = vLength - 1;
-
+
END WHILE;
SET vCode = FLOOR(SQRT(vSeed)*1000000) mod 1000;
RETURN vCode;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -48155,21 +48155,21 @@ BEGIN
DECLARE vChar INT;
SET vLength = length(vString);
-
+
WHILE vLength > 0 DO
-
+
SET vChar = MID(vString,vLength,1);
-
+
SET vSeed = vSeed + ASCII(vChar);
-
+
SET vLength = vLength - 1;
-
+
END WHILE;
SET vCode = FLOOR(SQRT(vSeed)*1000000) mod 1000;
RETURN vCode;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -48230,15 +48230,15 @@ BEGIN
* @param vTimeOut
* @return vNigthlyHours
*/
- DECLARE vNigthlyHours DECIMAL(5,2);
+ DECLARE vNigthlyHours DECIMAL(5,2);
DECLARE vSecondsPerHour INT(4) DEFAULT 3600;
-
+
SELECT GREATEST(0, TIMESTAMPDIFF(SECOND,
- IF(TIME(vTimeIn) BETWEEN endNightlyHours AND startNightlyHours,
- CONCAT(DATE(vTimeIn), ' ', startNightlyHours),
+ IF(TIME(vTimeIn) BETWEEN endNightlyHours AND startNightlyHours,
+ CONCAT(DATE(vTimeIn), ' ', startNightlyHours),
vTimeIn),
- IF(TIME(vTimeOut) BETWEEN endNightlyHours AND startNightlyHours,
- CONCAT(DATE(vTimeOut), ' ', endNightlyHours),
+ IF(TIME(vTimeOut) BETWEEN endNightlyHours AND startNightlyHours,
+ CONCAT(DATE(vTimeOut), ' ', endNightlyHours),
vTimeOut))) / vSecondsPerHour INTO vNigthlyHours
FROM vn.workerTimeControlConfig;
@@ -48270,47 +48270,47 @@ BEGIN
SELECT dayStayMax INTO vDayStayMax
FROM workerTimeControlParams;
-
+
SELECT timeWorkerControl_getDirection(vUserFk,vTimed) INTO vDirection;
IF vDirection = 'out' THEN
-
+
SELECT MAX(timed) INTO vLastIn
- FROM workerTimeControl
- WHERE userFk = vUserFk
+ FROM workerTimeControl
+ WHERE userFk = vUserFk
AND direction = 'in'
AND timed < vTimed;
-
+
UPDATE workerTimeControl wtc
SET wtc.direction = 'middle'
WHERE userFk = vUserFk
AND direction = 'out'
AND timed BETWEEN vLastIn AND vTimed;
-
+
ELSE IF vDirection = 'in' THEN
-
- SELECT COUNT(*) INTO vHasDirectionOut
+
+ SELECT COUNT(*) INTO vHasDirectionOut
FROM workerTimeControl wtc
- WHERE userFk = vUserFk
+ WHERE userFk = vUserFk
AND direction = 'out'
- AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
+ AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
UPDATE workerTimeControl wtc
SET wtc.direction = IF (vHasDirectionOut,'middle','out')
WHERE userFk = vUserFk
AND direction = 'in'
- AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
+ AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
END IF;
END IF;
-
+
INSERT INTO workerTimeControl(userFk, timed, warehouseFk, direction, manual)
VALUES(vUserFk, vTimed, vWarehouseFk, vDirection, vIsManual);
-
+
SET vLastInsertedId = LAST_INSERT_ID();
-
+
CALL workerTimeControlSOWP(vUserFk, vTimed);
-
+
RETURN vLastInsertedId;
END ;;
DELIMITER ;
@@ -48339,47 +48339,47 @@ BEGIN
SELECT dayStayMax INTO vDayStayMax
FROM workerTimeControlParams;
-
+
SELECT timeWorkerControl_getDirection(vUserFk,vTimed) INTO vDirection;
IF vDirection = 'out' THEN
-
+
SELECT MAX(timed) INTO vLastIn
- FROM workerTimeControl
- WHERE userFk = vUserFk
+ FROM workerTimeControl
+ WHERE userFk = vUserFk
AND direction = 'in'
AND timed < vTimed;
-
+
UPDATE workerTimeControl wtc
SET wtc.direction = 'middle'
WHERE userFk = vUserFk
AND direction = 'out'
AND timed BETWEEN vLastIn AND vTimed;
-
+
ELSE IF vDirection = 'in' THEN
-
- SELECT COUNT(*) INTO vHasDirectionOut
+
+ SELECT COUNT(*) INTO vHasDirectionOut
FROM workerTimeControl wtc
- WHERE userFk = vUserFk
+ WHERE userFk = vUserFk
AND direction = 'out'
- AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
+ AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
UPDATE workerTimeControl wtc
SET wtc.direction = IF (vHasDirectionOut,'middle','out')
WHERE userFk = vUserFk
AND direction = 'in'
- AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
+ AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
END IF;
END IF;
-
+
INSERT INTO workerTimeControl(userFk, timed, warehouseFk, direction, manual)
VALUES(vUserFk, vTimed, vWarehouseFk, vDirection, vIsManual);
-
+
SET vLastInsertedId = LAST_INSERT_ID();
-
+
CALL workerTimeControlSOWP(vUserFk, vTimed);
-
+
RETURN vLastInsertedId;
END ;;
DELIMITER ;
@@ -48490,17 +48490,17 @@ BEGIN
* @return Devuelve TRUE en caso de que este trabajando. Si se encuentra en un descanso devolverá FALSE
*/
DECLARE vLastIn DATETIME ;
-
+
SELECT MAX(timed) INTO vLastIn
- FROM vn.workerTimeControl
+ FROM vn.workerTimeControl
WHERE userFk = vWorkerFk AND
direction = 'in';
- IF (SELECT MOD(COUNT(*),2)
- FROM vn.workerTimeControl
- WHERE userFk = vWorkerFk AND
+ IF (SELECT MOD(COUNT(*),2)
+ FROM vn.workerTimeControl
+ WHERE userFk = vWorkerFk AND
timed >= vLastIn
- ) THEN
+ ) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
@@ -48594,7 +48594,7 @@ BEGIN
SET `type` = vType,
`name` = vName,
parentFk = vParentFk;
-
+
SET vSelf = LAST_INSERT_ID();
UPDATE zoneGeoRecalc SET isChanged = TRUE;
@@ -48618,7 +48618,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `addNoteFromDelivery`(idTicket INT,nota TEXT)
BEGIN
-
+
DECLARE observationTypeFk INT DEFAULT 3; /*3 = REPARTIDOR*/
INSERT INTO ticketObservation(ticketFk,observationTypeFk,description)
@@ -48646,23 +48646,23 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `addressTaxArea`()
READS SQL DATA
BEGIN
/**
- * Devuelve el taxArea para un conjunto de Consignatarios y empresas,
+ * Devuelve el taxArea para un conjunto de Consignatarios y empresas,
*
* @table tmp.addressCompany(addressFk, companyFk) valores a calcular
* @return tmp.addressTaxArea(addressFk,companyFk)
*/
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea;
CREATE TEMPORARY TABLE tmp.addressTaxArea
(PRIMARY KEY (addressFk, companyFk))
ENGINE = MEMORY
- SELECT CASE
- WHEN (NOT IFNULL(auClient.isUeeMember, cClient.isUeeMember) OR NOT cSupplier.isUeeMember)
- AND NOT (auSupplier.id <=> auClient.id) THEN
+ SELECT CASE
+ WHEN (NOT IFNULL(auClient.isUeeMember, cClient.isUeeMember) OR NOT cSupplier.isUeeMember)
+ AND NOT (auSupplier.id <=> auClient.id) THEN
'WORLD'
- WHEN cClient.isUeeMember AND cSupplier.isUeeMember AND c.countryFk != s.countryFk AND c.isVies THEN
+ WHEN cClient.isUeeMember AND cSupplier.isUeeMember AND c.countryFk != s.countryFk AND c.isVies THEN
'CEE'
- WHEN a.isEqualizated AND cClient.code = 'ES' THEN
+ WHEN a.isEqualizated AND cClient.code = 'ES' THEN
'EQU'
ELSE
'NATIONAL'
@@ -48703,27 +48703,27 @@ BEGIN
* @param vAddress id de la direccion
* @param vWarehouse id del warehouse
* @return vShipped la primera fecha disponible y vLanded la fecha de llegada/recojida
-*/
+*/
DECLARE vAgency INT;
DECLARE vShipped DATE;
DECLARE vLanded DATE DEFAULT util.VN_CURDATE();
SELECT agencyFk INTO vAgency FROM agencyMode WHERE id= vAgencyMode;
l: LOOP
-
+
CALL agencyHourGetShipped(vLanded,vAddress,vAgency);
- SELECT shipped INTO vShipped
+ SELECT shipped INTO vShipped
FROM tmp.agencyHourGetShipped
WHERE warehouseFk = vWarehouse LIMIT 1;
-
+
IF vShipped THEN
LEAVE l;
END IF;
-
+
SET vLanded = DATE_ADD(vLanded, INTERVAL +1 DAY);
-
+
END LOOP;
-
+
SELECT vShipped,vLanded;
END ;;
DELIMITER ;
@@ -48774,7 +48774,7 @@ BEGIN
LIMIT 1
) t
WHERE IF(vDated = util.VN_CURDATE(), t.maxHour > HOUR(util.VN_NOW()), TRUE) AND t.substractDay < 225;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -48797,14 +48797,14 @@ BEGIN
* DEPRECATED usar zoneGetWarehouse
* Devuelve el listado de agencias disponibles para la fecha,
* dirección y warehouuse pasadas
- *
+ *
* @param vAddress no puede ser NULL
* @param vWarehouse warehouse donde comprobaremos las agencias y fecha
* @param vDate Fecha de recogida
* @table agencyModeWarehouseList Listado de agencias disponibles
*/
DECLARE vAgency INT;
- DECLARE vDone BOOL DEFAULT FALSE;
+ DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vCur CURSOR FOR
SELECT DISTINCT a.id
FROM agency a
@@ -48828,13 +48828,13 @@ BEGIN
PRIMARY KEY(id)
)
ENGINE = MEMORY;
-
+
OPEN vCur;
FETCH vCur INTO vAgency;
WHILE NOT vDone
DO
-
+
INSERT INTO tmp.agencyModeWarehouseList
SELECT am.id, am.name, am.description,am.deliveryMethodFk, TIMESTAMPADD(DAY, -ah.substractDay, vDate), w.name
FROM agencyHour ah
@@ -48863,7 +48863,7 @@ BEGIN
END WHILE;
CLOSE vCur;
-
+
SELECT * FROM tmp.agencyModeWarehouseList;
DROP TEMPORARY TABLE tmp.agencyModeWarehouseList;
END ;;
@@ -48889,9 +48889,9 @@ BEGIN
CALL vn.agencyHourGetShipped(vDate, vAddress, vAgency);
SELECT * FROM tmp.agencyHourGetShipped;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.agencyHourGetShipped;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -48929,7 +48929,7 @@ BEGIN
DECLARE cWarehouses CURSOR FOR
SELECT warehouseFk, shipped FROM tmp.zoneGetShipped;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET vDone = TRUE;
@@ -48938,7 +48938,7 @@ BEGIN
CALL vn.zone_getShipped (vDate, vAddress, vAgencyMode, FALSE);
DROP TEMPORARY TABLE IF EXISTS tmp.availableCalc;
- CREATE TEMPORARY TABLE tmp.availableCalc(
+ CREATE TEMPORARY TABLE tmp.availableCalc(
calcFk INT UNSIGNED,
PRIMARY KEY (calcFk)
)
@@ -48949,7 +48949,7 @@ BEGIN
l: LOOP
SET vDone = FALSE;
FETCH cWarehouses INTO vWarehouse, vShipment;
-
+
IF vDone THEN
LEAVE l;
END IF;
@@ -48982,7 +48982,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `bankEntity_checkBic`(vBic VARCHAR(2
BEGIN
/**
* If the bic length is Incorrect throw exception
- *
+ *
* @param vBic bic code
*/
@@ -48990,7 +48990,7 @@ BEGIN
SELECT bicLength INTO vConfigBicLenght
FROM vn.bankEntityConfig bec;
-
+
IF LENGTH(vBic) <> vConfigBicLenght THEN
CALL util.throw(CONCAT('bic must be of length ', vConfigBicLenght ));
END IF;
@@ -49017,14 +49017,14 @@ BEGIN
* Manda correo cuando caduca un seguro
* de los leasing
*
-*/
+*/
INSERT INTO mail (receiver,replyTo,subject,body)
SELECT 'administracion@verdnatura.es' receiver,
'noreply@verdnatura.es' replyTo,
CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') subject,
CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') body
- FROM vn.bankPolicy bp
- LEFT JOIN vn.supplier s
+ FROM vn.bankPolicy bp
+ LEFT JOIN vn.supplier s
ON s.id = bp.supplierFk
LEFT JOIN vn.bank b
ON b.id = bp.bankFk
@@ -49253,19 +49253,19 @@ BEGIN
DECLARE vIsFeedStock BOOL;
DECLARE vWeight DECIMAL(10,2);
DECLARE vPacking INT;
-
- SELECT b.entryFk,
- b.itemFk,
- i.packingOut,
- ic.merchandise,
+
+ SELECT b.entryFk,
+ b.itemFk,
+ i.packingOut,
+ ic.merchandise,
vc.standardFlowerBox,
b.weight,
- b.packing
- INTO
- vEntryFk,
- vItemFk,
- vPackingOut,
- vIsMerchandise,
+ b.packing
+ INTO
+ vEntryFk,
+ vItemFk,
+ vPackingOut,
+ vIsMerchandise,
vStandardFlowerBox,
vWeight,
vPacking
@@ -49273,7 +49273,7 @@ BEGIN
LEFT JOIN item i ON i.id = b.itemFk
LEFT JOIN itemType it ON it.id = i.typeFk
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
- LEFT JOIN packaging p ON p.id = b.packageFk AND NOT p.isBox
+ LEFT JOIN packaging p ON p.id = b.packageFk AND NOT p.isBox
JOIN volumeConfig vc ON TRUE
WHERE b.id = vSelf;
@@ -49290,7 +49290,7 @@ BEGIN
warehouseFk = vWarehouse,
cm3 = buy_getUnitVolume(vSelf),
cm3Delivery = IFNULL((vStandardFlowerBox * 1000) / vPackingOut, buy_getUnitVolume(vSelf));
-
+
IF vWeight AND vPacking THEN
UPDATE itemCost SET
grams = vWeight * 1000 / vPacking
@@ -49311,7 +49311,7 @@ BEGIN
WHERE b.id = vSelf;
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -49358,10 +49358,10 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_getSplit`(vSelf INT, vDated DATE)
BEGIN
/**
- * Devuelve tantos registros como etiquetas se necesitan para cada uno de los cubos o cajas de
- * las ventas correspondientes a la compra que se pasa como parámetro, en los almacenes que tienen
+ * Devuelve tantos registros como etiquetas se necesitan para cada uno de los cubos o cajas de
+ * las ventas correspondientes a la compra que se pasa como parámetro, en los almacenes que tienen
* habilitada la venta de productos con stock virtual, aunque los productos pueden ser de cualquier tipo.
- *
+ *
* @param vSelf Identificador de vn.buy
* @param vDated Fecha de preparación de las ventas que queremos etiquetar
*/
@@ -49436,7 +49436,7 @@ BEGIN
WHILE vLabels >= vCounter DO
INSERT INTO tmp.split
SET
- id = vSaleFk,
+ id = vSaleFk,
labels = vLabels,
counter = vCounter;
@@ -49458,11 +49458,11 @@ BEGIN
-- Devuelve los splits creados
SELECT CONCAT(sp.counter,'/',sp.labels) labels,
COALESCE(sfc.nickname, sfa.nickname, a.nickname) destination,
- s.itemFk,
- i.longName,
- i.`size`,
- vn.ticketSplitCounter(t.id) counter,
- IF(sfa.id OR sfc.id,
+ s.itemFk,
+ i.longName,
+ i.`size`,
+ vn.ticketSplitCounter(t.id) counter,
+ IF(sfa.id OR sfc.id,
a.nickname,
CONCAT(a.id, ' ', p.`name`,' (', c.`code`,')')) destination2
FROM tmp.split sp
@@ -49507,12 +49507,12 @@ BEGIN
item_getVolume(b.itemFk, b.packageFk)) / vc.trolleyM3 / 1000000 ,1) AS DECIMAL(10,2)) carros ,
CAST(ROUND(SUM(GREATEST(b.stickers ,b.quantity /b.packing ) *
item_getVolume(b.itemFk, b.packageFk)) / vc.palletM3 / 1000000,1) AS DECIMAL(10,2)) espais
- FROM buy b
+ FROM buy b
JOIN tmp.buy tb ON tb.buyFk = b.id
JOIN volumeConfig vc
JOIN item i ON i.id = b.itemFk
JOIN itemType it ON it.id = i.typeFk
- LEFT JOIN temperature t ON t.code = it.temperatureFk
+ LEFT JOIN temperature t ON t.code = it.temperatureFk
GROUP BY Temp;
END ;;
DELIMITER ;
@@ -49532,21 +49532,21 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_getVolumeByAgency`(vDated DATE, vAgencyFk INT)
BEGIN
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.buy;
CREATE TEMPORARY TABLE tmp.buy (buyFk INT NOT NULL, PRIMARY KEY (buyFk)) ENGINE = MEMORY;
- INSERT INTO tmp.buy
+ INSERT INTO tmp.buy
SELECT b.id
- FROM buy b
- JOIN entry e ON e.id = b.entryFk
- JOIN travel t ON t.id = e.travelFk
+ FROM buy b
+ JOIN entry e ON e.id = b.entryFk
+ JOIN travel t ON t.id = e.travelFk
WHERE t.landed = vDated
AND t.agencyModeFk IN (0, vAgencyFk);
CALL buy_getVolume();
DROP TEMPORARY TABLE tmp.buy;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -49565,19 +49565,19 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_getVolumeByEntry`(vEntryFk INT)
BEGIN
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.buy;
CREATE TEMPORARY TABLE tmp.buy (buyFk INT NOT NULL, PRIMARY KEY (buyFk)) ENGINE = MEMORY;
-
- INSERT INTO tmp.buy
+
+ INSERT INTO tmp.buy
SELECT b.id
- FROM buy b
- JOIN entry e ON e.id = b.entryFk
+ FROM buy b
+ JOIN entry e ON e.id = b.entryFk
WHERE e.id = vEntryFk;
CALL buy_getVolume();
DROP TEMPORARY TABLE tmp.buy;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -49665,12 +49665,12 @@ BEGIN
* inserta en tmp.buyRecalc las compras de un awb
*
* @param awbFk
- */
+ */
DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc;
CREATE TEMPORARY TABLE tmp.buyRecalc
SELECT b.id
- FROM buy b
+ FROM buy b
JOIN entry e ON e.id = b.entryFk
JOIN duaEntry de ON de.entryFk = e.id
JOIN dua d ON d.id = de.duaFk
@@ -49702,7 +49702,7 @@ BEGIN
* Recalcula los precios de una compra
*
* @param vBuyFk
- */
+ */
DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc;
CREATE TEMPORARY TABLE tmp.buyRecalc
@@ -49733,12 +49733,12 @@ BEGIN
* Recalcula los precios de una entrada
*
* @param vEntryFk
- */
+ */
DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc;
CREATE TEMPORARY TABLE tmp.buyRecalc
SELECT b.id
- FROM buy b
+ FROM buy b
WHERE b.entryFk = vEntryFk;
CALL buy_recalcPrices();
@@ -49778,12 +49778,12 @@ BEGIN
LIMIT 0;
INSERT INTO tBuy(buyFk)
- SELECT b.id
+ SELECT b.id
FROM buy b
JOIN tmp.ekt t ON t.ektFk = b.ektFk
JOIN vn.entry en ON en.id = b.entryFk
JOIN vn.travel tr ON tr.id = en.travelFk
- JOIN vn.warehouse w ON w.id = tr.warehouseInFk
+ JOIN vn.warehouse w ON w.id = tr.warehouseInFk
JOIN vn.country c ON c.id = w.countryFk AND c.code = 'NL';
SELECT b.id buy, i.doPhoto do_photo, b.stickers - CAST(b.printedStickers AS INT) stickersToPrint
@@ -49849,7 +49849,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_updatePacking`(vWarehouseFk INT, vItemFk INT, vPacking INT)
BEGIN
/**
- * Actualiza packing
+ * Actualiza packing
*
* @param vWarehouseFk warehouse del item
* @param vItemFk id del item
@@ -49859,8 +49859,8 @@ BEGIN
UPDATE buy b
JOIN tmp.buyUltimate bu ON b.id = bu.buyFk
- SET b.packing = vPacking
- WHERE bu.warehouseFk = vWarehouseFk
+ SET b.packing = vPacking
+ WHERE bu.warehouseFk = vWarehouseFk
AND bu.itemFk = vItemFk;
DROP TEMPORARY TABLE tmp.buyUltimate;
@@ -49899,7 +49899,7 @@ BEGIN
*/
DROP TEMPORARY TABLE IF EXISTS tmp.item;
CREATE TEMPORARY TABLE tmp.item
- ENGINE = MEMORY
+ ENGINE = MEMORY
SELECT vItemFk itemFk;
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
@@ -49921,7 +49921,7 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_calculate`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT)
-BEGIN
+BEGIN
/**
* Calcula los articulos disponibles y sus precios
*
@@ -49929,7 +49929,7 @@ BEGIN
* @param vLanded Fecha de recepcion de mercancia
* @param vAddressFk Id del consignatario
* @param vAgencyModeFk Id de la agencia
- * @return tmp.ticketCalculateItem(itemFk, available, producer,
+ * @return tmp.ticketCalculateItem(itemFk, available, producer,
* item, size, stems, category, inkFk, image, origin, price)
* @return tmp.ticketLot(warehouseFk, itemFk, available, buyFk)
* @return tmp.ticketComponent
@@ -49964,22 +49964,22 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.ticketCalculateItem;
CREATE TEMPORARY TABLE tmp.ticketCalculateItem(
- itemFk INT(11) NOT NULL,
+ itemFk INT(11) NOT NULL,
available INT(11),
- producer VARCHAR(50),
- item VARCHAR(50),
- size INT(10) UNSIGNED,
- stems INT(11),
- category VARCHAR(3),
- inkFk VARCHAR(3),
+ producer VARCHAR(50),
+ item VARCHAR(50),
+ size INT(10) UNSIGNED,
+ stems INT(11),
+ category VARCHAR(3),
+ inkFk VARCHAR(3),
image VARCHAR(50),
- origin VARCHAR(3),
+ origin VARCHAR(3),
price DECIMAL(10,2),
priceKg DECIMAL(10,2),
`grouping` INT(10) UNSIGNED,
PRIMARY KEY `itemFk` (`itemFk`)
) ENGINE = MEMORY DEFAULT CHARSET=utf8;
-
+
OPEN cTravelTree;
l: LOOP
@@ -50001,20 +50001,20 @@ BEGIN
bu.buyFk,
vZoneFk
FROM `cache`.available a
- LEFT JOIN cache.availableNoRaids anr ON anr.item_id = a.item_id
+ LEFT JOIN cache.availableNoRaids anr ON anr.item_id = a.item_id
AND anr.calc_id = vAvailableNoRaidsCalc
JOIN tmp.item i ON i.itemFk = a.item_id
JOIN vn.item it ON it.id = i.itemFk
JOIN vn.`zone` z ON z.id = vZoneFk
- LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = a.item_id
- LEFT JOIN edi.supplyResponse sr ON sr.ID = it.supplyResponseFk
- LEFT JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
+ LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = a.item_id
+ LEFT JOIN edi.supplyResponse sr ON sr.ID = it.supplyResponseFk
+ LEFT JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID
LEFT JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID
LEFT JOIN (SELECT isVNHSupplier, isEarlyBird, TRUE AS itemAllowed
FROM vn.addressFilter af
- JOIN (SELECT ad.provinceFk, p.countryFk, ad.isLogifloraAllowed
- FROM vn.address ad
- JOIN vn.province p ON p.id = ad.provinceFk
+ JOIN (SELECT ad.provinceFk, p.countryFk, ad.isLogifloraAllowed
+ FROM vn.address ad
+ JOIN vn.province p ON p.id = ad.provinceFk
WHERE ad.id = vAddressFk
) sub2 ON sub2.provinceFk <=> IFNULL(af.provinceFk, sub2.provinceFk)
AND sub2.countryFk <=> IFNULL(af.countryFk, sub2.countryFk)
@@ -50031,13 +50031,13 @@ BEGIN
JOIN vn.itemType itt ON itt.id = it.typeFk
JOIN vn.itemCategory itc on itc.id = itt.categoryFk
JOIN vn.address ad ON ad.id = vAddressFk
- LEFT JOIN vn.clientItemType cit
+ LEFT JOIN vn.clientItemType cit
ON cit.clientFk = ad.clientFk
AND cit.itemTypeFk = itt.id
- LEFT JOIN vn.zoneItemType zit
+ LEFT JOIN vn.zoneItemType zit
ON zit.zoneFk = vZoneFk
AND zit.itemTypeFk = itt.id
- LEFT JOIN vn.agencyModeItemType ait
+ LEFT JOIN vn.agencyModeItemType ait
ON ait.agencyModeFk = vAgencyModeFk
AND ait.itemTypeFk = itt.id
WHERE a.calc_id = vAvailableCalc
@@ -50130,7 +50130,7 @@ BEGIN
* Calcula los componentes de los articulos de tmp.ticketLot
*
* @param vZoneFk para calcular el transporte
- * @param vAddressFk Consignatario
+ * @param vAddressFk Consignatario
* @param vShipped dia de salida del pedido
* @param vWarehouseFk warehouse de salida del pedido
* @table tmp.ticketLot (warehouseFk, available, itemFk, buyFk, zoneFk)
@@ -50144,7 +50144,7 @@ BEGIN
SELECT clientFk INTO vClientFK
FROM address
WHERE id = vAddressFk;
-
+
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketComponentCalculate
(PRIMARY KEY (itemFk, warehouseFk))
ENGINE = MEMORY
@@ -50156,7 +50156,7 @@ BEGIN
IFNULL(pf.packing, GREATEST(b.grouping, b.packing)) packing,
IFNULL(pf.`grouping`, b.`grouping`) `grouping`,
ABS(IFNULL(pf.box, b.groupingMode)) groupingMode,
- tl.buyFk,
+ tl.buyFk,
i.typeFk,
IF(i.hasKgPrice, b.weight / b.packing, NULL) weightGrouping
FROM tmp.ticketLot tl
@@ -50164,7 +50164,7 @@ BEGIN
JOIN item i ON i.id = tl.itemFk
JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk
- LEFT JOIN specialPrice sp ON sp.itemFk = i.id
+ LEFT JOIN specialPrice sp ON sp.itemFk = i.id
AND sp.clientFk = vClientFk
LEFT JOIN (
SELECT * FROM (
@@ -50183,7 +50183,7 @@ BEGIN
LIMIT 10000000000000000000
) tpf
GROUP BY tpf.itemFk, tpf.warehouseFk
- ) pf ON pf.itemFk = tl.itemFk
+ ) pf ON pf.itemFk = tl.itemFk
AND pf.warehouseFk = tl.warehouseFk
WHERE b.buyingValue + b.freightValue + b.packageValue + b.comissionValue > 0.01
AND ic.merchandise
@@ -50215,10 +50215,10 @@ BEGIN
FROM tmp.ticketComponent tc
JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tc.itemFk AND tcc.warehouseFk = tc.warehouseFk
GROUP BY tc.itemFk, warehouseFk;
-
+
-- RECOBRO
INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost)
- SELECT tcb.warehouseFk, tcb.itemFk, c2.id,
+ SELECT tcb.warehouseFk, tcb.itemFk, c2.id,
ROUND(tcb.base *
LEAST(
MAX(GREATEST(IFNULL(cr.priceIncreasing,0),
@@ -50249,29 +50249,29 @@ BEGIN
ROUND(base * (0.01 + wm.pricesModifierRate), 3) manaAuto
FROM tmp.ticketComponentBase tcb
JOIN `client` c on c.id = vClientFk
- JOIN workerMana wm ON c.salesPersonFk = wm.workerFk
+ JOIN workerMana wm ON c.salesPersonFk = wm.workerFk
JOIN vn.component c2 ON c2.code = 'autoMana'
WHERE wm.isPricesModifierActivated
HAVING manaAuto <> 0;
-
+
-- Precios especiales
INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost)
SELECT tcb.warehouseFk,
tcb.itemFk,
c2.id,
GREATEST(
- IFNULL(ROUND(tcb.base * c2.tax, 4), 0),
+ IFNULL(ROUND(tcb.base * c2.tax, 4), 0),
IF(i.hasMinPrice, i.minPrice,0) - tcc.rate3
) cost
FROM tmp.ticketComponentBase tcb
JOIN vn.component c2 ON c2.code = 'lastUnitsDiscount'
- JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk
+ JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk
LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
JOIN vn.item i ON i.id = tcb.itemFk
WHERE sp.value IS NULL
AND i.supplyResponseFk IS NULL;
- -- Individual
+ -- Individual
INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost)
SELECT tcb.warehouseFk,
tcb.itemFk,
@@ -50282,10 +50282,10 @@ BEGIN
JOIN vn.client c ON c.id = vClientFk
JOIN vn.businessType bt ON bt.code = c.businessTypeFk
WHERE bt.code = 'individual';
-
+
-- Venta por paquetes
INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost)
- SELECT tcc.warehouseFk, tcc.itemFk, c2.id, tcc.rate2 - tcc.rate3
+ SELECT tcc.warehouseFk, tcc.itemFk, c2.id, tcc.rate2 - tcc.rate3
FROM tmp.ticketComponentCalculate tcc
JOIN vn.component c2 ON c2.code = 'salePerPackage'
JOIN buy b ON b.id = tcc.buyFk
@@ -50297,7 +50297,7 @@ BEGIN
SELECT vZoneFk id;
CALL zone_getOptionsForShipment(vShipped, TRUE);
-
+
-- Reparto
INSERT INTO tmp.ticketComponent
SELECT tcc.warehouseFK,
@@ -50311,7 +50311,7 @@ BEGIN
JOIN agencyMode am ON am.id = z.agencyModeFk
JOIN vn.volumeConfig vc
JOIN vn.component c2 ON c2.code = 'delivery'
- LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk
+ LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk
AND ic.itemFk = tcc.itemFk
HAVING cost <> 0;
@@ -50364,9 +50364,9 @@ BEGIN
CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) price,
CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) / weightGrouping priceKg
FROM tmp.ticketComponentCalculate tcc
- JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
+ JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
AND tcs.warehouseFk = tcc.warehouseFk
- WHERE IFNULL(tcs.classRate, 1) = 1
+ WHERE IFNULL(tcs.classRate, 1) = 1
AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0)
GROUP BY tcs.warehouseFk, tcs.itemFk;
@@ -50403,7 +50403,7 @@ BEGIN
SELECT * FROM tmp.ticketComponentRate ORDER BY price LIMIT 10000000000000000000
) t
GROUP BY itemFk, warehouseFk, `grouping`;
-
+
DROP TEMPORARY TABLE
tmp.ticketComponentCalculate,
tmp.ticketComponentSum,
@@ -50428,7 +50428,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_componentPrepare`()
BEGIN
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponent;
CREATE TEMPORARY TABLE tmp.ticketComponent (
`warehouseFk` INT UNSIGNED NOT NULL,
@@ -50438,9 +50438,9 @@ BEGIN
INDEX `itemWarehouse` USING BTREE (`itemFk` ASC, `warehouseFk` ASC),
UNIQUE `fkItemWarehouseComponent` (`itemFk` ASC, `warehouseFk` ASC, `componentFk` ASC)
)ENGINE=MEMORY DEFAULT CHARSET=utf8;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentPrice;
- CREATE TEMPORARY TABLE tmp.ticketComponentPrice (
+ CREATE TEMPORARY TABLE tmp.ticketComponentPrice (
`warehouseFk` INT UNSIGNED NOT NULL,
`itemFk` INT NOT NULL,
`rate` INT NOT NULL,
@@ -50449,7 +50449,7 @@ BEGIN
`priceKg` DECIMAL(10,4),
INDEX `itemWarehouse` USING BTREE (`itemFk` ASC, `warehouseFk` ASC),
UNIQUE `fkItemWarehouseRate` (`itemFk` ASC, `warehouseFk` ASC, `rate` ASC)
- )ENGINE=MEMORY DEFAULT CHARSET=utf8;
+ )ENGINE=MEMORY DEFAULT CHARSET=utf8;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -50468,7 +50468,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_componentPurge`()
BEGIN
- DROP TEMPORARY TABLE
+ DROP TEMPORARY TABLE
tmp.ticketComponentPrice,
tmp.ticketComponent,
tmp.ticketLot;
@@ -50523,7 +50523,7 @@ BEGIN
DELETE FROM sms WHERE created < v18Month;
DELETE FROM saleTracking WHERE created < vOneYearAgo;
DELETE FROM ticketTracking WHERE created < v18Month;
- DELETE tobs FROM ticketObservation tobs
+ DELETE tobs FROM ticketObservation tobs
JOIN ticket t ON tobs.ticketFk = t.id WHERE t.shipped < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE());
DELETE sc.* FROM saleCloned sc JOIN sale s ON s.id = sc.saleClonedFk JOIN ticket t ON t.id = s.ticketFk WHERE t.shipped < vOneYearAgo;
DELETE FROM sharingCart where ended < vDateShort;
@@ -50597,12 +50597,12 @@ BEGIN
FROM vn.travel t
LEFT JOIN vn.entry e ON e.travelFk = t.id
WHERE t.shipped < TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()) AND e.travelFk IS NULL;
-
+
UPDATE dms d
- JOIN dmsType dt ON dt.id = d.dmsTypeFk
- SET d.dmsTypeFk = vTrashId
+ JOIN dmsType dt ON dt.id = d.dmsTypeFk
+ SET d.dmsTypeFk = vTrashId
WHERE created < TIMESTAMPADD(MONTH, -dt.monthToDelete, util.VN_CURDATE());
-
+
-- borrar entradas sin compras
DROP TEMPORARY TABLE IF EXISTS tmp.entryToDelete;
CREATE TEMPORARY TABLE tmp.entryToDelete
@@ -50621,7 +50621,7 @@ BEGIN
CREATE TEMPORARY TABLE tmp.routeToDelete
SELECT *
FROM vn.route r
- WHERE created < TIMESTAMPADD(YEAR,-4,util.VN_CURDATE());
+ WHERE created < TIMESTAMPADD(YEAR,-4,util.VN_CURDATE());
UPDATE tmp.routeToDelete tmp
JOIN vn.dms d ON d.id = tmp.gestdocFk
@@ -50804,21 +50804,21 @@ BEGIN
*/
DECLARE vClientDebt DOUBLE;
-
+
SELECT vn.client_getDebt(vClientFk, util.VN_CURDATE()) INTO vClientDebt;
-
+
INSERT INTO vn.greuge(clientFk, description, amount, shipped, greugeTypeFk)
VALUES (vClientFk, 'Saldo pendiente', vClientDebt, util.VN_CURDATE(), 5);
-
+
CALL vn.clientGreugeSpray(vClientFk, TRUE, '', TRUE);
-
+
INSERT INTO vn.greuge(clientFk, description, amount, shipped, greugeTypeFk)
SELECT vClientFk, 'Liquidación cliente', sum(amount), util.VN_CURDATE(), 5
FROM vn.greuge
WHERE clientFk = vClientFk;
-
- UPDATE vn.client
- SET salesPersonFk = NULL
+
+ UPDATE vn.client
+ SET salesPersonFk = NULL
WHERE id = vClientFk;
END ;;
@@ -50908,33 +50908,33 @@ BEGIN
DECLARE vIssued DATETIME;
DECLARE vBalance DOUBLE DEFAULT 0.00;
DECLARE cur CURSOR FOR
- SELECT
- created,
- issued,
+ SELECT
+ created,
+ issued,
ROUND(amount, 2) AS balance
FROM invoiceOut
- WHERE clientFk = vClientFk AND companyFk = vCompanyFk
- UNION ALL
- SELECT
- created,
- payed,
+ WHERE clientFk = vClientFk AND companyFk = vCompanyFk
+ UNION ALL
+ SELECT
+ created,
+ payed,
ROUND(-1 * amountPaid, 2) AS balance
- FROM receipt
+ FROM receipt
WHERE clientFk = vClientFk AND companyFk = vCompanyFk
ORDER BY issued, created;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
OPEN cur;
-
+
proc: LOOP
SET vDone = FALSE;
-
+
FETCH cur INTO vCreated, vIssued, vBalance;
IF vDate IS NULL THEN
SET vDate=vIssued;
END IF;
-
+
IF vDone THEN
LEAVE proc;
END IF;
@@ -50946,66 +50946,66 @@ BEGIN
SET vDone = TRUE;
END IF;
END LOOP;
-
+
CLOSE cur;
-
- SELECT
- issued,
- CAST(debtOut AS DECIMAL(10,2)) debtOut,
+
+ SELECT
+ issued,
+ CAST(debtOut AS DECIMAL(10,2)) debtOut,
CAST(debtIn AS DECIMAL(10,2)) debtIn,
- ref,
- companyFk,
+ ref,
+ companyFk,
priority
FROM
- (SELECT
- NULL AS issued,
- SUM(amountUnpaid) AS debtOut,
- NULL AS debtIn,
- 'Saldo Anterior' AS ref,
+ (SELECT
+ NULL AS issued,
+ SUM(amountUnpaid) AS debtOut,
+ NULL AS debtIn,
+ 'Saldo Anterior' AS ref,
companyFk,
- 0 as priority
- FROM
- (SELECT SUM(amount) AS amountUnpaid, companyFk, 0
+ 0 as priority
+ FROM
+ (SELECT SUM(amount) AS amountUnpaid, companyFk, 0
FROM invoiceOut
- WHERE clientFk = vClientFK
- AND issued < vDate
- GROUP BY companyFk
-
- UNION ALL
-
- SELECT SUM(-1 * amountPaid), companyFk, 0
- FROM receipt
- WHERE clientFk = vClientFK
- AND payed < vDate
- GROUP BY companyFk) AS transactions
- GROUP BY companyFk
-
- UNION ALL
-
- SELECT
- issued,
- amount as debtOut,
- NULL AS debtIn,
+ WHERE clientFk = vClientFK
+ AND issued < vDate
+ GROUP BY companyFk
+
+ UNION ALL
+
+ SELECT SUM(-1 * amountPaid), companyFk, 0
+ FROM receipt
+ WHERE clientFk = vClientFK
+ AND payed < vDate
+ GROUP BY companyFk) AS transactions
+ GROUP BY companyFk
+
+ UNION ALL
+
+ SELECT
+ issued,
+ amount as debtOut,
+ NULL AS debtIn,
ref,
companyFk,
- 1
- FROM invoiceOut
- WHERE clientFk = vClientFK
+ 1
+ FROM invoiceOut
+ WHERE clientFk = vClientFK
AND issued >= vDate
- UNION ALL
-
- SELECT
- r.payed,
- NULL as debtOut,
- r.amountPaid,
- r.invoiceFk,
+ UNION ALL
+
+ SELECT
+ r.payed,
+ NULL as debtOut,
+ r.amountPaid,
+ r.invoiceFk,
r.companyFk,
- 0
+ 0
FROM receipt r
- WHERE r.clientFk = vClientFK
- AND r.payed >= vDate) t
- INNER JOIN `client` c ON c.id = vClientFK
- HAVING debtOut <> 0 OR debtIn <> 0
+ WHERE r.clientFk = vClientFK
+ AND r.payed >= vDate) t
+ INNER JOIN `client` c ON c.id = vClientFK
+ HAVING debtOut <> 0 OR debtIn <> 0
ORDER BY issued, priority DESC, debtIn;
END ;;
DELIMITER ;
@@ -51063,13 +51063,13 @@ BEGIN
WHERE id = vClientFk;
ELSE
-
+
SELECT id INTO vOwner
FROM vn.worker
WHERE code = vWorkerCode COLLATE utf8_general_ci;
END IF;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.clientList;
CREATE TEMPORARY TABLE tmp.clientList
SELECT DISTINCT t.clientFk, floor(cr.yearSale / 12) monthSale
@@ -51081,7 +51081,7 @@ BEGIN
AND t.shipped >= TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())
AND c.id != vClientFk
HAVING monthSale > 100;
-
+
SELECT SUM(monthSale) INTO vTotalSale
FROM tmp.clientList;
@@ -51092,7 +51092,7 @@ BEGIN
SELECT vClientFk, 'Reparto greuge', -vGreuge, util.VN_CURDATE(), vGreugeTypeFk;
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -51287,11 +51287,11 @@ BEGIN
LEFT JOIN clientProtected cp ON cp.clientFk = cd.id
JOIN client c ON c.id = cd.id
JOIN province p ON p.id = c.provinceFk
- LEFT JOIN autonomy a ON a.id = p.autonomyFk
+ LEFT JOIN autonomy a ON a.id = p.autonomyFk
JOIN country co ON co.id = p.countryFk
WHERE cd.Aviso = 'TERCER AVISO'
AND cp.clientFk IS NULL
- AND co.code NOT IN ('PT')
+ AND co.code NOT IN ('PT')
AND a.name <> 'Canarias'
AND c.salesPersonFk IS NOT NULL;
@@ -51402,7 +51402,7 @@ BEGIN
JOIN client c ON c.accountingAccount = lc.account
WHERE lc.`date` BETWEEN vDateFrom AND vDateTo
)sub
- GROUP BY companyFk, clientFk
+ GROUP BY companyFk, clientFk
) sub1 ON sub1.clientFk = c.id
JOIN supplier s ON s.id = sub1.companyFk
JOIN company co ON co.id = sub1.companyFk
@@ -51546,13 +51546,13 @@ BEGIN
SET vEnded = TIMESTAMP(IFNULL(vDate, util.VN_CURDATE()), '23:59:59');
DROP TEMPORARY TABLE IF EXISTS tClientRisk;
- CREATE TEMPORARY TABLE tClientRisk
+ CREATE TEMPORARY TABLE tClientRisk
ENGINE = MEMORY
SELECT cr.clientFk, SUM(cr.amount) amount
FROM clientRisk cr
JOIN tmp.clientGetDebt c ON c.clientFk = cr.clientFk
GROUP BY cr.clientFk;
-
+
INSERT INTO tClientRisk
SELECT c.clientFk, SUM(r.amountPaid)
FROM receipt r
@@ -51567,7 +51567,7 @@ BEGIN
WHERE t.receiptFk IS NULL
AND t.status = 'ok'
GROUP BY t.clientFk;
-
+
INSERT INTO tClientRisk
SELECT t.clientFk, totalWithVat
FROM ticket t
@@ -51583,7 +51583,7 @@ BEGIN
FROM client c
JOIN tClientRisk cr ON cr.clientFk = c.id
GROUP BY c.id;
-
+
DROP TEMPORARY TABLE tClientRisk;
END ;;
DELIMITER ;
@@ -51607,9 +51607,9 @@ BEGIN
DECLARE i INT DEFAULT 0;
DECLARE c INT DEFAULT 0;
DECLARE maxClientFk INT;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.client;
-
+
CREATE TEMPORARY TABLE tmp.`client`
(id INT AUTO_INCREMENT,
clientFk INT,
@@ -51617,40 +51617,40 @@ BEGIN
PRIMARY KEY(id),
UNIQUE KEY clientFk (clientFk))
ENGINE = MEMORY;
-
+
INSERT INTO tmp.client(clientFk)
SELECT DISTINCT clientFk
FROM vn.invoiceOut
WHERE issued > TIMESTAMPADD(MONTH, -2, util.VN_CURDATE());
-
+
SELECT max(id) INTO maxClientFk
FROM tmp.client;
-
-
+
+
WHILE i < vNumber DO
-
+
SET i = i + 1;
-
+
WHILE c = 0 DO
-
+
SELECT id INTO c
FROM tmp.client
WHERE id = floor(RAND() * maxClientFk) + 1
AND isSelected = FALSE
LIMIT 1;
-
+
END WHILE;
-
+
-- SELECT i, maxClientFk, c;
-
- UPDATE tmp.client
- SET isSelected = TRUE
+
+ UPDATE tmp.client
+ SET isSelected = TRUE
WHERE id = c;
-
+
SET c = 0;
-
+
END WHILE;
-
+
SELECT c.id, c.name FROM tmp.client tc
JOIN vn.client c ON c.id = tc.clientFk
WHERE isSelected
@@ -51791,35 +51791,35 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `cmr_getByTicket`(vTicketFk INT)
BEGIN
DECLARE vLanded DATE;
-
+
SELECT DATE_ADD(util.VN_CURDATE(), INTERVAL landingDays DAY) INTO vLanded
FROM vn.cmrConfig;
IF vTicketFk THEN
-
+
IF (SELECT count(ticketFk) FROM vn.cmr WHERE ticketFk = vTicketFk) THEN
-
+
SELECT id FROM vn.cmr WHERE ticketFk = vTicketFk;
-
+
ELSE
-
+
INSERT INTO vn.cmr(ticketFk, companyFk, addressFromFk, addressToFk, ead)
SELECT vTicketFk, t.companyFk, a.id, t.addressFk, vLanded
FROM vn.ticket t
- JOIN vn.warehouse w ON w.id = t.warehouseFk
- JOIN vn.address a ON a.id = w.addressFk
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ JOIN vn.address a ON a.id = w.addressFk
WHERE t.id = vTicketFk;
-
+
SELECT LAST_INSERT_ID();
-
+
END IF;
-
+
ELSE
-
+
INSERT INTO vn.cmr(ead) VALUES(vLanded);
-
+
SELECT LAST_INSERT_ID();
-
+
END IF;
END ;;
DELIMITER ;
@@ -51842,7 +51842,7 @@ BEGIN
/**
* Insert the monthly CMR summary in vn.mail on the 5th of each month.
*/
-
+
SET SESSION group_concat_max_len = 1000000;
-- IF (DAY(util.VN_CURDATE()) = 5) THEN
INSERT INTO
@@ -51870,7 +51870,7 @@ BEGIN
CMR
Ticket
'
- , GROUP_CONCAT('
', c.id, '
', c.ticketFk, '
' ORDER BY c.id SEPARATOR '' ),
+ , GROUP_CONCAT('
', c.id, '
', c.ticketFk, '
' ORDER BY c.id SEPARATOR '' ),
'
@@ -51888,7 +51888,7 @@ BEGIN
-- Actualizamos el estado a 'Enviado'
UPDATE vn.cmr c
SET c.state = 'Sent'
- WHERE c.state = 'Pending'
+ WHERE c.state = 'Pending'
AND MONTH(c.created) = MONTH(util.VN_CURDATE() - INTERVAL 1 MONTH)
AND YEAR(c.created) = YEAR(util.VN_CURDATE() - INTERVAL 1 MONTH);
-- END IF;
@@ -52101,15 +52101,15 @@ BEGIN
DATE_FORMAT(util.VN_NOW(), '%H:%i' ),
' ',
i.name
- ) INTO vConcept
+ ) INTO vConcept
FROM item i
WHERE i.id = vItemFk;
SELECT name INTO vItemName FROM item WHERE id = vBarccodeFk;
- SELECT CONCAT('Añadido articulo ',
+ SELECT CONCAT('Añadido articulo ',
vItemName,
- ' cantidad:',
+ ' cantidad:',
vQuantity
) INTO vDescription;
@@ -52146,7 +52146,7 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_assign`(vUserFk INT, OUT vCollectionFk INT)
-proc:BEGIN
+proc:BEGIN
/* Comprueba si existen colecciones libres que se ajustan al perfil del usuario
* y le asigna la más antigua.
* Añade un registro al semillero de colecciones
@@ -52179,14 +52179,14 @@ proc:BEGIN
FROM vn.collection c
JOIN vn.ticketCollection tc ON tc.collectionFk = c.id
JOIN vn.state s ON s.code = 'PRINTED_AUTO'
- JOIN vn.productionConfig pc
- WHERE c.workerFk IS NULL
+ JOIN vn.productionConfig pc
+ WHERE c.workerFk IS NULL
AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime;
DELETE c.*
FROM vn.collection c
- JOIN vn.productionConfig pc
- WHERE c.workerFk IS NULL
+ JOIN vn.productionConfig pc
+ WHERE c.workerFk IS NULL
AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime;
-- Se a�ade registro al semillero
@@ -52196,8 +52196,8 @@ proc:BEGIN
-- Comprueba si hay colecciones disponibles que se ajustan a su configuracion
SELECT MIN(c.id)
INTO vCollectionFk
- FROM vn.collection c
- JOIN vn.operator o
+ FROM vn.collection c
+ JOIN vn.operator o
ON (o.itemPackingTypeFk = c.itemPackingTypeFk OR c.itemPackingTypeFk IS NULL)
AND o.numberOfWagons = c.wagons
AND o.trainFk = c.trainFk
@@ -52244,18 +52244,18 @@ BEGIN
SELECT c.id collectionFk,
date(c.created) created,
COUNT(DISTINCT tc.ticketFk) ticketTotalCount
- FROM collection c
- JOIN ticketCollection tc ON tc.collectionFk = c.id
- JOIN sale s ON s.ticketFk = tc.ticketFk
+ FROM collection c
+ JOIN ticketCollection tc ON tc.collectionFk = c.id
+ JOIN sale s ON s.ticketFk = tc.ticketFk
JOIN ticketState ts ON ts.ticketFk = tc.ticketFk
JOIN state s2 ON s2.id = ts.stateFk
JOIN productionConfig pc
JOIN vn.state ss on ss.code = 'PREPARED'
LEFT JOIN vn.saleTracking st on st.saleFk = s.id AND st.stateFk = ss.id
- WHERE c.workerFk = vWorkerFk
+ WHERE c.workerFk = vWorkerFk
AND TIMESTAMPDIFF(HOUR, c.created , util.VN_NOW()) < pc.pendingCollectionsAge
AND s.quantity != 0
- AND s2.order < pc.pendingCollectionsOrder
+ AND s2.order < pc.pendingCollectionsOrder
GROUP BY c.id
HAVING COUNT(*) > COUNT(DISTINCT st.id);
@@ -52282,15 +52282,15 @@ BEGIN
* Selecciona los tickets de una colección/ticket
* @param vParamFk ticketFk/collectionFk
* @return Retorna ticketFk, level, agencyName, warehouseFk, salesPersonFk, observaciones
- */
+ */
DECLARE vItemPackingTypeFk VARCHAR(1);
-- Si los sacadores son los de pruebas, pinta los colores
SELECT itemPackingTypeFk INTO vItemPackingTypeFk
- FROM vn.collection
+ FROM vn.collection
WHERE id = vParamFk;
- SELECT t.id ticketFk,
+ SELECT t.id ticketFk,
IF (!(vItemPackingTypeFk <=> 'V'), cc.code,CONCAT(SUBSTRING('ABCDEFGH',tc.wagon, 1),'-',tc.`level` )) `level`,
am.name agencyName,
t.warehouseFk,
@@ -52300,20 +52300,20 @@ BEGIN
FROM vn.ticket t
LEFT JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk -- PAK 23/12/21
- LEFT JOIN vn.collectionColors cc
- ON cc.wagon = tc.wagon
- AND cc.shelve = tc.`level`
+ LEFT JOIN vn.collectionColors cc
+ ON cc.wagon = tc.wagon
+ AND cc.shelve = tc.`level`
AND cc.trainFk = c2.trainFk -- PAK 23/12/21
- LEFT JOIN vn.zone z ON z.id = t.zoneFk
+ LEFT JOIN vn.zone z ON z.id = t.zoneFk
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
LEFT JOIN vn.client c ON c.id = t.clientFk
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
- LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id
+ LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id
AND tob.observationTypeFk = 1
- WHERE t.id = vParamFk
+ WHERE t.id = vParamFk
AND t.shipped >= util.yesterday()
UNION ALL
- SELECT t.id ticketFk,
+ SELECT t.id ticketFk,
IF(!(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`,
am.name agencyName,
t.warehouseFk,
@@ -52323,15 +52323,15 @@ BEGIN
FROM vn.ticket t
JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk -- PAK 23/12/21
- LEFT JOIN vn.collectionColors cc
- ON cc.wagon = tc.wagon
- AND cc.shelve = tc.`level`
+ LEFT JOIN vn.collectionColors cc
+ ON cc.wagon = tc.wagon
+ AND cc.shelve = tc.`level`
AND cc.trainFk = c2.trainFk -- PAK 23/12/21
- LEFT JOIN vn.zone z ON z.id = t.zoneFk
+ LEFT JOIN vn.zone z ON z.id = t.zoneFk
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
LEFT JOIN vn.client c ON c.id = t.clientFk
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
- LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id
+ LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id
AND tob.observationTypeFk = 1
WHERE tc.collectionFk = vParamFk;
@@ -52694,8 +52694,8 @@ proc:BEGIN
-- 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
+ LEFT JOIN (SELECT DISTINCT wagon
+ FROM tTrain
WHERE ticketFk IS NOT NULL
) nn ON nn.wagon = tt.wagon
WHERE nn.wagon IS NULL;
@@ -52863,7 +52863,7 @@ BEGIN
DECLARE vDone INT DEFAULT FALSE;
DECLARE vCursor CURSOR FOR
SELECT DISTINCT ticketFk
- FROM ticketCollection tc
+ FROM ticketCollection tc
WHERE tc.collectionFk = vSelf;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
@@ -52910,25 +52910,25 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `company_getFiscaldata`(workerFk INT)
BEGIN
-
+
DECLARE vCompanyFk INT;
-
- SELECT IFNULL(uc.companyFk, rc.defaultCompanyFk)
+
+ SELECT IFNULL(uc.companyFk, rc.defaultCompanyFk)
INTO vCompanyFk
FROM vn.routeConfig rc
LEFT JOIN userConfig uc ON uc.userFk = workerFk;
-
-
+
+
SELECT
s.name AS name ,
s.NIF AS nif ,
s.street AS street ,
s.city AS city ,
- s.postCode AS postCode
-
- FROM vn.company c
+ s.postCode AS postCode
+
+ FROM vn.company c
JOIN vn.worker w ON w.id = c.workerManagerFk
- JOIN vn.supplier s ON s.id = c.id
+ JOIN vn.supplier s ON s.id = c.id
WHERE c.id = vCompanyFk;
END ;;
DELIMITER ;
@@ -52985,7 +52985,7 @@ BEGIN
IF (p.currencyFk = vCurrencyEuroFk, p.amount, p.divisa) AS amount,
p.dueDated < vStartingDate isBeforeStarting,
p.currencyFk
- FROM payment p
+ FROM payment p
WHERE p.received > vStartDate
AND p.companyFk = vSelf
UNION ALL
@@ -52993,9 +52993,9 @@ BEGIN
r.companyFk,
- IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue) AS Total,
rv.dueDated < vStartingDate isBeforeStarting,
- r.currencyFk
- FROM invoiceIn r
- INNER JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk
+ r.currencyFk
+ FROM invoiceIn r
+ INNER JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk
WHERE r.issued > vStartDate
AND r.isBooked
AND r.companyFk = vSelf
@@ -53047,11 +53047,11 @@ BEGIN
-IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue),
r.currencyFk,
FALSE isPayment,
- TRUE
- FROM invoiceIn r
+ TRUE
+ FROM invoiceIn r
LEFT JOIN tOpeningBalances si ON r.companyFk = si.companyFk
AND r.supplierFk = si.supplierFk
- AND r.currencyFk = si.currencyFk
+ AND r.currencyFk = si.currencyFk
JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk
WHERE rv.dueDated >= vStartingDate
AND (si.closingBalances IS NULL OR si.closingBalances <> 0)
@@ -53106,7 +53106,7 @@ BEGIN
FROM tPendingDuedates
WHERE balance < vInvalidBalances
AND balance > - vInvalidBalances;
-
+
DELETE vp.*
FROM tPendingDuedates vp
JOIN tRowsToDelete rd ON (
@@ -53134,9 +53134,9 @@ BEGIN
FROM tPendingDuedates vp
LEFT JOIN supplier s ON s.id = vp.supplierFk
LEFT JOIN client c ON c.fi = s.nif
- LEFT JOIN clientRisk cr ON cr.clientFk = c.id
+ LEFT JOIN clientRisk cr ON cr.clientFk = c.id
AND cr.companyFk = vp.companyFk;
-
+
DROP TEMPORARY TABLE tOpeningBalances;
DROP TEMPORARY TABLE tPendingDuedates;
DROP TEMPORARY TABLE tRowsToDelete;
@@ -53159,7 +53159,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `conveyorExpedition_Add`(vStarted DATETIME, vEnded DATETIME)
BEGIN
-
+
DECLARE startingMinute INT;
TRUNCATE vn.conveyorExpedition;
@@ -53176,23 +53176,23 @@ BEGIN
conveyorBuildingClassFk)
SELECT e.id,
e.created,
- 10 * p.depth as depth,
+ 10 * p.depth as depth,
10 * p.width as width,
10 * p.height as height,
IFNULL(t.routeFk,am.agencyFk) routeFk,
hour(e.created) * 60 + minute(e.created),
IFNULL(et.description , a.name),
IFNULL(t.routeFk,am.agencyFk) criterion,
- IFNULL(p.conveyorBuildingClassFk , pc.defaultConveyorBuildingClass)
+ IFNULL(p.conveyorBuildingClassFk , pc.defaultConveyorBuildingClass)
FROM vn.expedition e
JOIN vn.ticket t ON t.id = e.ticketFk
JOIN vn.packaging p ON p.id = e.packagingFk
LEFT JOIN vn.zone z ON z.id = t.zoneFk
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
- LEFT JOIN vn.agency a ON a.id = am.agencyFk
- LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
- LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
- JOIN vn.packagingConfig pc
+ LEFT JOIN vn.agency a ON a.id = am.agencyFk
+ LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
+ LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
+ JOIN vn.packagingConfig pc
WHERE t.warehouseFk IN (60,1,44)
AND e.created BETWEEN vStarted AND vEnded
AND p.height < 140
@@ -53201,8 +53201,8 @@ BEGIN
SELECT MIN(productionMinute) INTO startingMinute
FROM vn.conveyorExpedition ce ;
-
- UPDATE vn.conveyorExpedition
+
+ UPDATE vn.conveyorExpedition
SET productionMinute = productionMinute - startingMinute;
END ;;
@@ -53271,7 +53271,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `createPedidoInterno`(vItemFk INT,vQuantity INT)
BEGIN
-
+
UPDATE vn.item SET upToDown = vQuantity WHERE id = vItemFk;
END ;;
@@ -53294,52 +53294,52 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `crypt`(vText VARCHAR(255), vKey VAR
BEGIN
DECLARE vEncryptedText VARCHAR(255) DEFAULT '';
-
+
DECLARE vKeyLength INT;
DECLARE vKeyPosition INT DEFAULT 1;
DECLARE vKeyChar VARCHAR(1);
-
+
DECLARE vTextLength INT;
DECLARE vTextPosition INT DEFAULT 1;
DECLARE vTextChar VARCHAR(1);
-
+
DECLARE vEncryptedChar VARCHAR(1);
DECLARE vEncryptedCharPosition INT;
-
+
DECLARE vChain VARCHAR(255) DEFAULT '#$.-_0123456789abcdefghijklmnopqrstuvwxyz';
DECLARE vChainTextPosition INT;
DECLARE vChainKeyPosition INT;
DECLARE vChainLength INT;
-
+
DECLARE vInvalidadChars VARCHAR(255) DEFAULT '';
-
- SET vTextLength = LENGTH(vText);
+
+ SET vTextLength = LENGTH(vText);
SET vKeyLength = LENGTH(vKey);
SET vChainLength = LENGTH(vChain);
-
+
WHILE vTextPosition <= vTextLength DO
-
+
SET vTextChar = MID(vText,vTextPosition,1);
SET vKeyChar = MID(vKey,vKeyPosition,1);
-
+
SET vChainTextPosition = LOCATE(vTextChar, vChain);
SET vInvalidadChars = IF(vChainTextPosition, vInvalidadChars, CONCAT(vInvalidadChars,vTextChar));
SET vChainKeyPosition = LOCATE(vKeyChar, vChain);
SET vEncryptedCharPosition = vChainTextPosition + vChainKeyPosition;
-
+
IF vEncryptedCharPosition > vChainLength THEN
-
+
SET vEncryptedCharPosition = vEncryptedCharPosition - vChainLength;
-
+
END IF;
-
+
SET vEncryptedChar = MID(vChain, vEncryptedCharPosition,1);
-
+
SET vEncryptedText = CONCAT(vEncryptedText, vEncryptedChar);
-
+
SET vKeyPosition = IF(vKeyPosition = vKeyLength, 1,vKeyPosition + 1);
SET vTextPosition = vTextPosition + 1;
-
+
END WHILE;
SET vResult = IF(LENGTH(vInvalidadChars), CONCAT('Caracteres no válidos: ',vInvalidadChars),vEncryptedText);
@@ -53364,49 +53364,49 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `cryptOff`(vText VARCHAR(255), vKey
BEGIN
DECLARE vUncryptedText VARCHAR(255) DEFAULT '';
-
+
DECLARE vKeyLength INT;
DECLARE vKeyPosition INT DEFAULT 1;
DECLARE vKeyChar VARCHAR(1);
-
+
DECLARE vTextLength INT;
DECLARE vTextPosition INT DEFAULT 1;
DECLARE vTextChar VARCHAR(1);
-
+
DECLARE vUncryptedChar VARCHAR(1);
DECLARE vUncryptedCharPosition INT;
-
+
DECLARE vChain VARCHAR(255) DEFAULT '#$.-_0123456789abcdefghijklmnopqrstuvwxyz';
DECLARE vChainTextPosition INT;
DECLARE vChainKeyPosition INT;
DECLARE vChainLength INT;
-
- SET vTextLength = LENGTH(vText);
+
+ SET vTextLength = LENGTH(vText);
SET vKeyLength = LENGTH(vKey);
SET vChainLength = LENGTH(vChain);
-
+
WHILE vTextPosition <= vTextLength DO
-
+
SET vTextChar = MID(vText,vTextPosition,1);
SET vKeyChar = MID(vKey,vKeyPosition,1);
-
+
SET vChainTextPosition = LOCATE(vTextChar, vChain);
SET vChainKeyPosition = LOCATE(vKeyChar, vChain);
SET vUncryptedCharPosition = vChainTextPosition - vChainKeyPosition;
-
+
IF vUncryptedCharPosition < 1 THEN
-
+
SET vUncryptedCharPosition = vUncryptedCharPosition + vChainLength;
-
+
END IF;
-
+
SET vUncryptedChar = MID(vChain, vUncryptedCharPosition,1);
-
+
SET vUncryptedText = CONCAT(vUncryptedText, vUncryptedChar);
-
+
SET vKeyPosition = IF(vKeyPosition = vKeyLength, 1,vKeyPosition + 1);
SET vTextPosition = vTextPosition + 1;
-
+
END WHILE;
SET vResult = vUncryptedText;
@@ -53502,7 +53502,7 @@ BEGIN
OR (vSelf IS NOT NULL AND parentFk = vSelf);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
SET vSons = 0;
OPEN vChildren;
@@ -53513,11 +53513,11 @@ BEGIN
IF vDone THEN
LEAVE myLoop;
END IF;
-
+
SET vIndex = vIndex + 1;
SET vLft = vIndex;
SET vSons = vSons + 1;
-
+
CALL department_calcTreeRec(
vChildFk,
CONCAT(vPath, vChildFk, '/'),
@@ -53572,7 +53572,7 @@ proc: BEGIN
SELECT isChanged INTO vIsChanged
FROM department_recalc;
-
+
IF vIsChanged THEN
UPDATE department_recalc SET isChanged = FALSE;
CALL vn.department_calcTree;
@@ -53597,17 +53597,17 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `department_getHasMistake`()
BEGIN
-
+
/**
* Obtiene los sectores a los cuales les ponemos errores
*
*/
-
+
SELECT id, name
FROM department
WHERE hasToMistake <> FALSE;
-
-
+
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -53666,19 +53666,19 @@ BEGIN
FROM department g
JOIN tChilds c ON c.id = g.id
WHERE g.parentFk IS NOT NULL;
-
+
INSERT IGNORE INTO tNodes
SELECT id FROM tParents;
-
+
IF ROW_COUNT() = 0 THEN
LEAVE myLoop;
END IF;
-
+
DELETE FROM tChilds;
INSERT INTO tChilds
SELECT id FROM tParents;
END LOOP;
-
+
DROP TEMPORARY TABLE
tChilds,
tParents;
@@ -53745,12 +53745,12 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `deviceProductionUser_exists`(vUserFk INT)
BEGIN
-
+
/* SELECT COUNT(*) AS UserExists
- FROM vn.deviceProductionUser dpu
+ FROM vn.deviceProductionUser dpu
WHERE dpu.userFk = vUserFk;*/
SELECT TRUE;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -53822,10 +53822,10 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `device_checkLogin`(vUserFk INT, vAndroidID VARCHAR(50))
BEGIN
-
+
/*
* Comprueba si está registrado el dispositivo mediante su androidId
- *
+ *
* @param vUSerFk el id del user
* @param vAndroidID es el identificador android_id del dispositivo
*/
@@ -53837,20 +53837,20 @@ BEGIN
SELECT dpc.isAllUsersallowed INTO vIsAllUsersAllowed
FROM vn.deviceProductionConfig dpc;
- IF NOT vIsAllUsersAllowed THEN
-
+ IF NOT vIsAllUsersAllowed THEN
+
SELECT COUNT(*) INTO vIsDepartment
- FROM vn.workerDepartment dp
+ FROM vn.workerDepartment dp
JOIN department d ON d.id = dp.departmentFk
WHERE dp.workerFk = vUserFk AND d.hasToCheckLogin;
-
+
IF vIsDepartment THEN
SELECT COUNT(*) INTO vIsAuthorized
- FROM vn.deviceProductionUser dpu
+ FROM vn.deviceProductionUser dpu
JOIN vn.deviceProduction dp ON dp.id = dpu.deviceProductionFk
WHERE dpu.userFk = vUserFk
AND dp.android_id = vAndroidID;
-
+
IF NOT vIsAuthorized THEN
SET vMessage = 'Usuario no autorizado';
END IF;
@@ -53880,15 +53880,15 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `duaEntryValueUpdate`(vDuaFk INT)
BEGIN
UPDATE duaEntry de
- JOIN
+ JOIN
( SELECT b.entryFk, sum(b.quantity * b.buyingValue) as total
FROM buy b
JOIN duaEntry de ON de.entryFk = b.entryFk
WHERE duaFk = vDuaFk
GROUP BY b.entryFk
) sub ON sub.entryFk = de.entryFk
-
- LEFT JOIN
+
+ LEFT JOIN
(SELECT e.id, sum(iit.taxableBase) as euros
FROM entry e
JOIN invoiceInTax iit ON iit.invoiceInFk = e.invoiceInFk
@@ -53896,11 +53896,11 @@ BEGIN
WHERE de.duaFk = vDuaFk
GROUP BY e.id
) sub2 ON sub2.id = de.entryFk
-
+
SET de.value = sub.total,
de.euroValue = sub2.euros
WHERE duaFk = vDuaFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -53924,7 +53924,7 @@ BEGIN
DECLARE vInvoiceFk INT;
DECLARE vASIEN BIGINT DEFAULT 0;
DECLARE vCounter INT DEFAULT 0;
-
+
DECLARE rs CURSOR FOR
SELECT e.invoiceInFk
FROM entry e
@@ -53937,7 +53937,7 @@ BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN rs;
-
+
UPDATE invoiceIn ii
JOIN entry e ON e.invoiceInFk = ii.id
JOIN duaEntry de ON de.entryFk = e.id
@@ -53949,41 +53949,41 @@ BEGIN
ii.bookEntried = IFNULL(ii.bookEntried,d.bookEntried),
e.isConfirmed = TRUE
WHERE d.id = vDuaFk;
-
+
SELECT IFNULL(ASIEN,0) INTO vASIEN
FROM dua
WHERE id = vDuaFk;
-
+
FETCH rs INTO vInvoiceFk;
-
+
WHILE NOT done DO
CALL invoiceIn_booking(vInvoiceFk);
-
+
IF vCounter > 0 OR vASIEN > 0 THEN
-
+
UPDATE vn2008.XDiario x
JOIN vn.ledgerConfig lc ON lc.lastBookEntry = x.ASIEN
SET x.ASIEN = vASIEN;
-
+
ELSE
-
+
SELECT lastBookEntry INTO vASIEN FROM vn.ledgerConfig;
-
+
END IF;
-
+
SET vCounter = vCounter + 1;
-
+
FETCH rs INTO vInvoiceFk;
END WHILE;
-
+
CLOSE rs;
-
- UPDATE dua
+
+ UPDATE dua
SET ASIEN = vASIEN
WHERE id = vDuaFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -54009,9 +54009,9 @@ BEGIN
SELECT awbFk,companyFk
FROM dua
WHERE id = vDuaFk;
-
+
SELECT LAST_INSERT_ID() INTO vNewDuaFk;
-
+
INSERT INTO duaEntry(duaFk, entryFk, value, customsValue)
SELECT vNewDuaFk, entryFk, value, value - customsValue
FROM duaEntry
@@ -54040,11 +54040,11 @@ BEGIN
DECLARE vBookDated DATE;
DECLARE vDiff DECIMAL(10,2);
DECLARE vApunte BIGINT;
-
+
SELECT ASIEN, IFNULL(bookEntried, util.VN_CURDATE()) INTO vBookNumber, vBookDated
- FROM dua
+ FROM dua
WHERE id = vDuaFk;
-
+
IF vBookNumber IS NULL OR NOT vBookNumber THEN
CALL ledger_next(vBookNumber);
END IF;
@@ -54055,14 +54055,14 @@ BEGIN
ASIEN,
FECHA,
SUBCTA,
- CONCEPTO,
+ CONCEPTO,
EUROHABER,
SERIE,
empresa_id,
CLAVE,
FACTURA)
- SELECT
+ SELECT
vBookNumber,
d.bookEntried,
'4700000999',
@@ -54075,20 +54075,20 @@ BEGIN
FROM duaTax dt
JOIN dua d ON d.id = dt.duaFk
WHERE dt.duaFk = vDuaFk;
-
+
-- Apuntes por tipo de IVA y proveedor
-
+
INSERT INTO XDiario(
ASIEN,
FECHA,
SUBCTA,
- CONTRA,
+ CONTRA,
EURODEBE,
BASEEURO,
- CONCEPTO,
- FACTURA,
+ CONCEPTO,
+ FACTURA,
IVA,
- AUXILIAR,
+ AUXILIAR,
SERIE,
FECHA_EX,
FECHA_OP,
@@ -54108,17 +54108,17 @@ BEGIN
FECREGCON
)
- SELECT
+ SELECT
vBookNumber ASIEN,
vBookDated FECHA,
tr.account SUBCTA,
'4330002067' CONTRA,
sum(dt.tax) EURODEBE,
- sum(dt.base) BASEEURO,
+ sum(dt.base) BASEEURO,
CONCAT('DUA nº',d.code) CONCEPTO,
d.id FACTURA,
dt.rate IVA,
- '*' AUXILIAR,
+ '*' AUXILIAR,
'D' SERIE,
d.issued FECHA_EX,
d.operated FECHA_OP,
@@ -54145,10 +54145,10 @@ BEGIN
WHERE ta.effectived <= vBookDated
AND taxAreaFk = 'WORLD'
ORDER BY ta.effectived DESC
- LIMIT 10000000000000000000
+ LIMIT 10000000000000000000
) tba
GROUP BY rate
- ) tr ON tr.rate = dt.rate
+ ) tr ON tr.rate = dt.rate
JOIN supplier s ON s.id = d.companyFk
JOIN country c ON c.id = s.countryFk
WHERE d.id = vDuaFk
@@ -54157,16 +54157,16 @@ BEGIN
SELECT SUM(EURODEBE) -SUM(EUROHABER), MAX(id) INTO vDiff, vApunte
FROM XDiario
WHERE ASIEN = vBookNumber;
-
+
UPDATE XDiario
SET BASEEURO = 100 * (EURODEBE - vDiff) / IVA,
- EURODEBE = EURODEBE - vDiff
+ EURODEBE = EURODEBE - vDiff
WHERE id = vApunte;
UPDATE dua
SET ASIEN = vBookNumber
WHERE id = vDuaFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -54187,21 +54187,21 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `duaTax_doRecalc`(vDuaFk INT)
BEGIN
/**
* Borra los valores de duaTax y los vuelve a crear en base a la tabla duaEntry
- *
+ *
* @param vDuaFk Id del dua a recalcular
**/
DELETE FROM duaTax
WHERE duaFk = vDuaFk;
-
- INSERT INTO duaTax(duaFk, supplierFk, taxClassFk, base)
+
+ INSERT INTO duaTax(duaFk, supplierFk, taxClassFk, base)
SELECT vDuaFk, supplierFk, taxClassFk, sum(sub.Base) as Base
FROM intrastat ist
JOIN
(SELECT
- e.supplierFk,
+ e.supplierFk,
i.intrastatFk,
CAST(sum(b.quantity * b.buyingValue * de.customsValue / de.value) * di.amount/ tei.Base AS DECIMAL(10,2)) as Base
- FROM buy b
+ FROM buy b
JOIN item i ON i.id = b.itemFk
JOIN entry e ON e.id = b.entryFk
JOIN duaEntry de ON de.entryFk = e.id
@@ -54209,15 +54209,15 @@ BEGIN
(
SELECT i.intrastatFk,
CAST(sum(b.quantity * b.buyingValue * de.customsValue / de.value) AS DECIMAL(10,2)) as Base
- FROM buy b
+ FROM buy b
JOIN item i ON i.id = b.itemFk
JOIN entry e ON e.id = b.entryFk
JOIN duaEntry de ON de.entryFk = e.id
WHERE de.duaFk = vDuaFk
GROUP BY i.intrastatFk
-
+
) tei ON tei.intrastatFk = i.intrastatFk
- JOIN
+ JOIN
(
SELECT intrastatFk, sum(amount) as amount
FROM duaIntrastat
@@ -54226,7 +54226,7 @@ BEGIN
) di ON di.intrastatFk = i.intrastatFk
WHERE de.duaFk = vDuaFk
GROUP BY e.supplierFk, i.intrastatFk
- HAVING Base
+ HAVING Base
) sub ON ist.id = sub.intrastatFk
GROUP BY ist.taxClassFk, sub.supplierFk;
END ;;
@@ -54247,13 +54247,13 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ediTables_Update`()
BEGIN
-
- INSERT IGNORE INTO vn.genus(name)
+
+ INSERT IGNORE INTO vn.genus(name)
SELECT latin_genus_name
FROM edi.genus ;
- INSERT IGNORE INTO vn.specie(name)
- SELECT LCASE(latin_species_name)
+ INSERT IGNORE INTO vn.specie(name)
+ SELECT LCASE(latin_species_name)
FROM edi.specie ;
END ;;
DELIMITER ;
@@ -54293,71 +54293,71 @@ DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cur1;
read_loop: LOOP
-
+
SET done = FALSE;
SET vEntryFk = 0;
-
+
FETCH cur1 INTO vId;
-
+
IF done THEN
LEAVE read_loop;
END IF;
-
+
SELECT IFNULL(e.id,0) INTO vEntryFk
FROM vn.entry e
JOIN vn.travel tr ON tr.id = e.travelFk
- JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
+ JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
AND ea.warehouseInFk = tr.warehouseInFk
AND ea.agencyModeFk = tr.agencyModeFk
AND ea.supplierFk = e.supplierFk
WHERE ea.id = vId
AND tr.landed = vLanded
LIMIT 1;
-
+
IF NOT vEntryFk THEN
-
+
SELECT IFNULL(e.id,0) INTO vEntryFk
FROM vn.entry e
JOIN vn.travel tr ON tr.id = e.travelFk
- JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
+ JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
AND ea.warehouseInFk = tr.warehouseInFk
AND ea.agencyModeFk = tr.agencyModeFk
WHERE ea.id = vId
AND tr.landed = vLanded
AND ea.supplierFk IS NULL
LIMIT 1;
-
+
END IF;
-
+
IF NOT vEntryFk THEN
-
+
SET vTravelFk = 0;
-
- SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk
+
+ SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk
FROM vn.travel tr
- JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
+ JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
AND ea.warehouseInFk = tr.warehouseInFk
AND ea.agencyModeFk = tr.agencyModeFk
WHERE ea.id = vId
AND tr.landed = vLanded;
-
+
IF NOT vTravelFk THEN
-
+
INSERT INTO vn.travel(landed, shipped, warehouseInFk, warehouseOutFk, agencyModeFk)
SELECT vLanded, vLanded, warehouseInFk, warehouseOutFk, agencyModeFk
- FROM vn.ektEntryAssign
+ FROM vn.ektEntryAssign
WHERE id = vId;
-
- SELECT MAX(tr.id) INTO vTravelFk
+
+ SELECT MAX(tr.id) INTO vTravelFk
FROM vn.travel tr
- JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
+ JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk
AND ea.warehouseInFk = tr.warehouseInFk
AND ea.agencyModeFk = tr.agencyFk
WHERE ea.id = vId
AND tr.landed = vLanded;
-
+
END IF;
-
+
INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk)
SELECT vTravelFk, IFNULL(ea.supplierFk,s.id), c.id, cu.id
FROM vn.supplier s
@@ -54365,13 +54365,13 @@ OPEN cur1;
JOIN vn.currency cu ON cu.code = 'EUR'
JOIN vn.ektEntryAssign ea ON ea.id = vId
WHERE s.name = 'KONINKLIJE COOPERATIEVE BLOEMENVEILING FLORAHOLLAN';
-
- SELECT MAX(id) INTO vEntryFk
+
+ SELECT MAX(id) INTO vEntryFk
FROM vn.entry
WHERE travelFk = vTravelFk;
-
+
END IF;
-
+
UPDATE vn.ektEntryAssign
SET entryFk = vEntryFk
WHERE id = vId;
@@ -54379,7 +54379,7 @@ OPEN cur1;
END LOOP;
CLOSE cur1;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -54399,18 +54399,18 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `energyMeter_record`(vInput INT, vActiveTime INT)
BEGIN
DECLARE vConsumption INT;
-
+
SELECT consumption INTO vConsumption
FROM energyInput
WHERE input = vInput;
- INSERT INTO vn.energyMeter
- SET
- `input` = vInput,
- `period` = DATE_FORMAT(util.VN_NOW(), '%Y-%m-%d %H:00:00'),
+ INSERT INTO vn.energyMeter
+ SET
+ `input` = vInput,
+ `period` = DATE_FORMAT(util.VN_NOW(), '%Y-%m-%d %H:00:00'),
`activeTime` = vActiveTime,
`consumption` = CAST(IFNULL((vConsumption / 3600) * vActiveTime, 0) AS DECIMAL(10,2))
- ON DUPLICATE KEY UPDATE
+ ON DUPLICATE KEY UPDATE
`activeTime` = `activeTime` + vActiveTime,
`consumption` = `consumption` + CAST(VALUES(`consumption`) AS DECIMAL(10,2));
END ;;
@@ -54433,28 +54433,28 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `entryDelivered`(vDated DATE, vEntry
BEGIN
DECLARE vTravelFk INT;
-
+
SELECT travelFk INTO vTravelFk
- FROM vn.entry
+ FROM vn.entry
WHERE id = vEntryFk;
-
+
IF (SELECT COUNT(*) FROM vn.entry WHERE travelFk = vTravelFk) = 1 THEN
-
+
UPDATE vn.travel SET shipped = LEAST(shipped, vDated), landed = vDated
WHERE id = vTravelFk;
-
+
ELSE
-
+
INSERT INTO vn.travel(shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, ref, isDelivered, isReceived)
SELECT LEAST(shipped, vDated), vDated, warehouseInFk, warehouseOutFk, agencyModeFk, CONCAT(account.myUser_getName(),' ', vEntryFk), TRUE, TRUE
FROM vn.travel WHERE id = vTravelFk;
-
+
SELECT LAST_INSERT_ID() INTO vTravelFk;
-
- UPDATE vn.entry
- SET travelFk = vTravelFk
+
+ UPDATE vn.entry
+ SET travelFk = vTravelFk
WHERE id = vEntryFk;
-
+
END IF;
END ;;
@@ -54480,29 +54480,29 @@ BEGIN
DECLARE vEntry INT;
DECLARE vBucket VARCHAR(10);
DECLARE vSupplierFk INT;
-
+
SET vSupplierFk = IF (vLandingWarehouse = 1, 850, 963);
-- seleccionamos travel
SELECT t.id, e.id INTO vTravel, vEntry
FROM travel t LEFT JOIN entry e ON t.id = e.travelFk
- WHERE t.landed = vInOutDate AND t.shipped = vInOutDate AND t.warehouseOutFk = vShipmentWarehouse
+ WHERE t.landed = vInOutDate AND t.shipped = vInOutDate AND t.warehouseOutFk = vShipmentWarehouse
AND t.warehouseInFk = vLandingWarehouse AND t.agencyModeFk IS NULL AND e.supplierFk = vSupplierFk
- LIMIT 1;
-
+ LIMIT 1;
+
-- creamos el travel si es necesario
IF IFNULL(vTravel, FALSE) = FALSE THEN
INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk)
VALUES (vInOutDate, vInOutDate, vLandingWarehouse, vShipmentWarehouse);
SELECT LAST_INSERT_ID() INTO vTravel;
END IF;
-
+
-- creamos la Entrada si es necesario
IF IFNULL(vEntry, FALSE) = FALSE THEN
INSERT INTO entry (supplierFk, travelFk)
VALUES (vSupplierFk, vTravel); -- proveedor 'CONFECCION ARTIFICIAL'
SELECT LAST_INSERT_ID() INTO vEntry;
END IF;
-
+
-- creamos el cubo si es necesario
SELECT id INTO vBucket FROM packaging WHERE volume = vVolume LIMIT 1;
IF vBucket IS NULL THEN
@@ -54512,7 +54512,7 @@ BEGIN
SELECT id INTO vBucket FROM packaging WHERE volume = vVolume LIMIT 1;
END IF;
- INSERT INTO buy(itemFk,quantity, entryFk, packageFk, packing, stickers, buyingValue, price2, price3)
+ INSERT INTO buy(itemFk,quantity, entryFk, packageFk, packing, stickers, buyingValue, price2, price3)
SELECT itemFk,
quantity,
vEntry,
@@ -54544,7 +54544,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_checkPackaging`(vEntryFk INT)
BEGIN
/**
* Comprueba que los campos package y packaging no sean nulos
- *
+ *
* @param vEntryFk Id de entrada
*/
DECLARE vpackageOrPackingNull INT;
@@ -54846,7 +54846,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_getRate`(vSelf INT)
BEGIN
/**
- * Prepara una tabla con las tarifas aplicables en funcion de la fecha
+ * Prepara una tabla con las tarifas aplicables en funcion de la fecha
* y el almacén
*
* @param vSelf Id de la tabla entry
@@ -54856,7 +54856,7 @@ BEGIN
DECLARE vWarehouseFk INT;
SELECT t.landed, t.warehouseInFk INTO vDated, vWarehouseFk
- FROM entry e
+ FROM entry e
JOIN travel t ON t.id = e.travelFk
WHERE e.id = vSelf;
@@ -54986,7 +54986,7 @@ BEGIN
FROM buy b
WHERE b.entryFk = vSelf
AND b.printedStickers != b.stickers;
-
+
IF vChangeEntry THEN
UPDATE buy
SET stickers = printedStickers,
@@ -54998,7 +54998,7 @@ BEGIN
FROM item i
WHERE i.description = 'MISFIT'
LIMIT 1;
-
+
INSERT INTO buy(entryFk,
itemFk,
quantity,
@@ -55065,7 +55065,7 @@ BEGIN
UPDATE entry
SET gestDocFk = (SELECT gestDocFk FROM entry WHERE id = vSelf LIMIT 1)
WHERE id = vNewEntryFk;
-
+
INSERT INTO duaEntry (duaFk, entryFk)
SELECT duaFk, vNewEntryFk FROM duaEntry WHERE entryFk = vSelf LIMIT 1;
END ;;
@@ -55139,12 +55139,12 @@ BEGIN
*/
DECLARE v_done BOOL DEFAULT FALSE;
DECLARE vEntryFk INTEGER;
-
+
DECLARE vCur CURSOR FOR
SELECT id FROM tmp.recalcEntryCommision;
DECLARE CONTINUE HANDLER FOR NOT FOUND
- SET v_done = TRUE;
+ SET v_done = TRUE;
OPEN vCur;
@@ -55155,7 +55155,7 @@ BEGIN
IF v_done THEN
LEAVE l;
END IF;
-
+
CALL vn2008.buy_tarifas_entry(vEntryFk);
END LOOP;
@@ -55180,7 +55180,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_splitByShelving`(vShelvingFk
BEGIN
/**
* Divide las compras entre dos entradas de acuerdo con lo ubicado en una matr�cula
- *
+ *
* @param vShelvingFk Identificador de vn.shelving
* @param vFromEntryFk Entrada origen
* @param vToEntryFk Entrada destino
@@ -55190,49 +55190,49 @@ BEGIN
DECLARE vBuyStickers INT;
DECLARE vDone BOOLEAN DEFAULT FALSE;
- DECLARE cur CURSOR FOR
+ DECLARE cur CURSOR FOR
SELECT bb.id buyFk,
FLOOR(ish.visible / ish.packing) ishStickers,
bb.stickers buyStickers
FROM vn.itemShelving ish
- JOIN (SELECT b.id, b.itemFk, b.stickers
- FROM vn.buy b
+ JOIN (SELECT b.id, b.itemFk, b.stickers
+ FROM vn.buy b
WHERE b.entryFk = vFromEntryFk
ORDER BY b.stickers DESC
- LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk
+ LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk
AND bb.stickers >= FLOOR(ish.visible / ish.packing)
WHERE shelvingFk = vShelvingFk COLLATE utf8_general_ci
GROUP BY ish.id;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
- -- Cantidades de la matrícula que exceden la de las entradas
- SELECT ish.itemFk,
- i.longName,
+
+ -- Cantidades de la matrícula que exceden la de las entradas
+ SELECT ish.itemFk,
+ i.longName,
FLOOR(ish.visible / ish.packing) AS etiEnMatricula,
bb.stickers etiEnEntrada
FROM vn.itemShelving ish
- JOIN vn.item i ON i.id = ish.itemFk
- LEFT JOIN (SELECT b.id, b.itemFk, b.stickers
- FROM vn.buy b
+ JOIN vn.item i ON i.id = ish.itemFk
+ LEFT JOIN (SELECT b.id, b.itemFk, b.stickers
+ FROM vn.buy b
WHERE b.entryFk = vFromEntryFk
ORDER BY b.stickers DESC
LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk
WHERE shelvingFk = vShelvingFk COLLATE utf8_general_ci
AND IFNULL(bb.stickers,0) < FLOOR(ish.visible / ish.packing)
GROUP BY ish.id;
-
+
OPEN cur;
read_loop: LOOP
SET vDone = FALSE;
-
+
FETCH cur INTO vBuyFk, vIshStickers, vBuyStickers;
-
+
IF vDone THEN
LEAVE read_loop;
END IF;
-
+
IF vIshStickers = vBuyStickers THEN
UPDATE vn.buy
SET entryFk = vToEntryFk
@@ -55240,9 +55240,9 @@ BEGIN
ELSE
UPDATE vn.buy
SET stickers = stickers - vIshStickers,
- quantity = stickers * packing
+ quantity = stickers * packing
WHERE id = vBuyFk;
-
+
INSERT INTO vn.buy(entryFk,
itemFk,
quantity,
@@ -55322,16 +55322,16 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_splitMisfit`(vSelf INT)
BEGIN
-
+
/* Divide una entrada, pasando los registros que ha insertado vn.entry_fixMisfit de la entrada original
* a la nueva
*/
-
+
DECLARE vNewEntryFk INT;
DECLARE vBuyFk INT;
SELECT MAX(b.id) INTO vBuyFk
- FROM vn.buy b
+ FROM vn.buy b
JOIN vn.item i ON i.id = b.itemFk
WHERE b.entryFk = vSelf
AND i.description = 'MISFIT';
@@ -55340,17 +55340,17 @@ BEGIN
SELECT supplierFk, dated, travelFk, currencyFk, companyFk
FROM vn.entry e
WHERE e.id = vSelf;
-
- SET vNewEntryFk = LAST_INSERT_ID();
- UPDATE vn.buy b
+ SET vNewEntryFk = LAST_INSERT_ID();
+
+ UPDATE vn.buy b
SET b.entryFk = vNewEntryFk
WHERE b.entryFk = vSelf
AND b.id > vBuyFk;
-
+
SELECT vNewEntryFk;
-
-
+
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -55373,7 +55373,7 @@ BEGIN
* Unlock the indicated entry
* @vSelf params entry id
*/
- UPDATE `entry`
+ UPDATE `entry`
SET lockerUserFk = NULL,
locked = NULL
WHERE id = vSelf;
@@ -55404,21 +55404,21 @@ BEGIN
DECLARE vComission INT;
CREATE OR REPLACE TEMPORARY TABLE tmp.recalcEntryCommision
- SELECT e.id
+ SELECT e.id
FROM vn.entry e
JOIN vn.travel t ON t.id = e.travelFk
- JOIN vn.warehouse w ON w.id = t.warehouseInFk
+ JOIN vn.warehouse w ON w.id = t.warehouseInFk
WHERE t.shipped >= util.VN_CURDATE()
AND e.currencyFk = vCurrency;
SET vComission = currency_getCommission(vCurrency);
- UPDATE vn.entry e
+ UPDATE vn.entry e
JOIN tmp.recalcEntryCommision tmp ON tmp.id = e.id
SET e.commission = vComission;
- SELECT `name` INTO vCurrencyName
- FROM currency
+ SELECT `name` INTO vCurrencyName
+ FROM currency
WHERE id = vCurrency;
CALL entry_recalc();
@@ -55507,7 +55507,7 @@ BEGIN
WHERE t.shipped BETWEEN vDatedFrom AND vDatedTo
AND cr.description = vDepartment
GROUP BY cd.workerFk;
-
+
CREATE OR REPLACE TEMPORARY TABLE volume
ENGINE = MEMORY
SELECT SUM(w.volume) volume,
@@ -55518,15 +55518,15 @@ BEGIN
CREATE OR REPLACE TEMPORARY TABLE errorsByChecker
ENGINE = MEMORY
- SELECT sub1.workerFk, COUNT(id) errors
+ SELECT sub1.workerFk, COUNT(id) errors
FROM (
SELECT st.workerFk,
t.id
FROM saleMistake sm
JOIN saleTracking st ON sm.saleFk = st.saleFk
JOIN `state` s2 ON s2.id = st.stateFk
- JOIN sale s ON s.id = sm.saleFk
- JOIN ticket t on t.id = s.ticketFk
+ JOIN sale s ON s.id = sm.saleFk
+ JOIN ticket t on t.id = s.ticketFk
WHERE (t.shipped BETWEEN vDatedFrom AND vDatedTo)
AND s2.code IN ('OK','PREVIOUS_PREPARATION','PREPARED','CHECKED')
) sub1
@@ -55537,13 +55537,13 @@ BEGIN
SELECT COUNT(t.id) errors,
e.workerFk
FROM vn.expeditionMistake pm
- JOIN vn.expedition e ON e.id = pm.expeditionFk
+ JOIN vn.expedition e ON e.id = pm.expeditionFk
JOIN vn.ticket t ON t.id = e.ticketFk
WHERE t.shipped BETWEEN vDatedFrom AND vDatedTo
GROUP BY e.workerFk;
IF (vDepartment = 'Sacadores') THEN
-
+
INSERT INTO errorProduction(userFk,
firstname,
lastname,
@@ -55576,12 +55576,12 @@ BEGIN
LEFT JOIN errorsByChecker ec2 ON ec2.workerFk = t.workerFk
JOIN (SELECT DISTINCT w.id -- Verificamos que son sacadores
FROM vn.collection c
- JOIN vn.state s ON s.id = c.stateFk
+ JOIN vn.state s ON s.id = c.stateFk
JOIN vn.train tn ON tn.id = c.trainFk
- JOIN vn.worker w ON w.id = c.workerFk
+ JOIN vn.worker w ON w.id = c.workerFk
WHERE c.created BETWEEN vDatedFrom AND vDatedTo) sub ON sub.id = w.id
GROUP BY w.id;
-
+
CREATE OR REPLACE TEMPORARY TABLE itemPickerErrors -- Errores de los sacadores, derivadores de los revisadores
ENGINE = MEMORY
SELECT COUNT(c.ticketFk) errors,
@@ -55601,7 +55601,7 @@ BEGIN
JOIN itemPickerErrors ipe ON ipe.workerFk = ep.userFk
SET ep.error = ep.error + ipe.errors
WHERE vDatedFrom = ep.dated AND ep.rol = 'Sacadores';
-
+
DROP TEMPORARY TABLE itemPickerErrors;
ELSE
INSERT INTO errorProduction(userFk,
@@ -55637,7 +55637,7 @@ BEGIN
LEFT JOIN expeditionErrors pe ON pe.workerFk = t.workerFk
GROUP BY w.id;
END IF;
-
+
DROP TEMPORARY TABLE total,
errorsByClaim,
volume,
@@ -55663,7 +55663,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `errorProduction_addLauncher`()
BEGIN
DECLARE vDatedFrom DATETIME;
DECLARE vDatedTo DATETIME;
-
+
SELECT DATE_SUB(util.VN_CURDATE(),INTERVAL 1 DAY), CONCAT(DATE_SUB(util.VN_CURDATE(),INTERVAL 1 DAY),' 23:59:59') INTO vDatedFrom, vDatedTo;
CALL vn.errorProduction_add('SACAR', vDatedFrom, vDatedTo);
@@ -55694,7 +55694,7 @@ BEGIN
DECLARE vRouteFk INT DEFAULT 0;
SELECT t.routeFk INTO vRouteFk
- FROM vn.expedition exp
+ FROM vn.expedition exp
INNER JOIN ticket t on t.id = exp.ticketFk
WHERE exp.id = vExpeditionFk;
@@ -55897,14 +55897,14 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionPallet_printLabel`(vSelf INT)
BEGIN
/**
- * Calls the report_print procedure and passes it
+ * Calls the report_print procedure and passes it
* the necessary parameters for printing.
*
* @param vSelf expeditioPallet id.
*/
DECLARE vPrinterFk INT;
DECLARE vUserFk INT DEFAULT account.myUser_getId();
-
+
SELECT o.labelerFk INTO vPrinterFk
FROM operator o
WHERE o.workerFk = vUserFk;
@@ -55971,22 +55971,22 @@ BEGIN
DECLARE vTotal INT DEFAULT 0;
IF vPalletFk = 0 THEN -- Nuevo pallet
-
- INSERT INTO vn.expeditionPallet(truckFk)
+
+ INSERT INTO vn.expeditionPallet(truckFk)
VALUES(vTruckFk);
-
+
SELECT LAST_INSERT_ID() INTO vPalletFk;
-
+
END IF;
-
+
SELECT COUNT(expeditionFk) INTO vTotal FROM vn.expeditionScan WHERE palletFk = vPalletFk;
-
+
IF vTotal <> 0 THEN
- SELECT expeditionFk,
+ SELECT expeditionFk,
palletFk
- FROM vn.expeditionScan
+ FROM vn.expeditionScan
WHERE palletFk = vPalletFk;
- ELSE
+ ELSE
SELECT 0 expeditionFk,vPalletFk palletFk;
END IF;
END ;;
@@ -56059,12 +56059,12 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionScan_Put`(vPalletFk INT, vExpeditionFk INT)
BEGIN
-
- REPLACE vn.expeditionScan(expeditionFk, palletFk)
+
+ REPLACE vn.expeditionScan(expeditionFk, palletFk)
VALUES(vExpeditionFk, vPalletFk);
-
+
SELECT LAST_INSERT_ID() INTO vPalletFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56083,32 +56083,32 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_add`(vParam INT, vStateCode VARCHAR(100))
BEGIN
-
+
/**
* Inserta nuevos registros en la tabla vn.expeditionState, segun el parámetro
- *
+ *
* @param vParam Identificador de vn.expedition o de vn.route
* @param vStateCode Corresponde a vn.expeditionStateType.code
*/
-
+
IF (SELECT COUNT(*) FROM vn.route r WHERE r.id = vParam) THEN
-
+
INSERT INTO vn.expeditionState(expeditionFk, typeFk)
SELECT e.id, est.id
FROM vn.expedition e
JOIN vn.ticket t ON t.id = e.ticketFk
JOIN vn.expeditionStateType est ON est.code = vStateCode
WHERE t.routeFk = vParam;
-
+
ELSE
-
+
INSERT INTO vn.expeditionState(expeditionFk, typeFk)
SELECT vParam, est.id
FROM vn.expeditionStateType est
WHERE est.code = vStateCode;
-
+
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56140,7 +56140,7 @@ BEGIN
SELECT e.id, est.id
FROM vn.expedition e
JOIN vn.expeditionStateType est ON est.code = vStateCode
- JOIN vn.ticket t ON t.id = e.ticketFk
+ JOIN vn.ticket t ON t.id = e.ticketFk
WHERE t.addressFk = vAdressFk AND t.routeFk = vRouteFk;
END ;;
@@ -56161,14 +56161,14 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_addByExpedition`(vExpeditionFk INT, vStateCode VARCHAR(100))
BEGIN
-
+
/**
* Inserta nuevos registros en la tabla vn.expeditionState
- *
+ *
* @param vExpeditionFk Identificador de vn.expedition
* @param vStateCode Corresponde a vn.expeditionStateType.code
*/
-
+
INSERT INTO vn.expeditionState(expeditionFk, typeFk)
SELECT vExpeditionFk, est.id
FROM vn.expeditionStateType est
@@ -56194,7 +56194,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_addByPallet`(vPalle
BEGIN
/**
* Inserta nuevos registros en la tabla vn.expeditionState
- *
+ *
* @param vPalletFk Identificador de vn.expedition
* @param vStateCode Corresponde a vn.expeditionStateType.code
*/
@@ -56211,7 +56211,7 @@ BEGIN
IF NOT hasExpeditions THEN
DROP TEMPORARY TABLE tExpeditionScan;
- CALL util.throw('palletDoesNotExist');
+ CALL util.throw('palletDoesNotExist');
END IF;
INSERT INTO vn.expeditionState(expeditionFk, typeFk)
@@ -56236,21 +56236,21 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_addByRoute`(vRouteFk INT, vStateCode VARCHAR(100))
BEGIN
-
+
/**
* Inserta nuevos registros en la tabla vn.expeditionState, por rutas
- *
+ *
* @param vRouteFk Identificador de vn.route
* @param vStateCode Corresponde a vn.expeditionStateType.code
*/
-
+
INSERT INTO vn.expeditionState(expeditionFk, typeFk)
SELECT e.id, est.id
FROM vn.expedition e
JOIN vn.ticket t ON t.id = e.ticketFk
JOIN vn.expeditionStateType est ON est.code = vStateCode
WHERE t.routeFk = vRouteFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56292,8 +56292,8 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionTruck_List`()
BEGIN
- SELECT id truckFk,
- eta,
+ SELECT id truckFk,
+ eta,
description Destino
FROM expeditionTruck
WHERE eta BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
@@ -56337,7 +56337,7 @@ BEGIN
JOIN address a ON t.addressFk = a.id
JOIN route r ON r.id = t.routeFk
LEFT JOIN warehouse w ON t.warehouseFk = w.id
- LEFT JOIN (SELECT sub.ticketFk,
+ LEFT JOIN (SELECT sub.ticketFk,
CONCAT('(', GROUP_CONCAT(DISTINCT sub.itemPackingTypeFk ORDER BY sub.items DESC SEPARATOR ','), ') ') itemPackingTypeConcat
FROM (SELECT s.ticketFk , i.itemPackingTypeFk, COUNT(*) items
FROM ticket t
@@ -56368,7 +56368,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expedition_getState`(vExpeditionFk INT)
BEGIN
-
+
DECLARE vTicketsPendientes INT;
DECLARE vEtiquetasTotales INT;
DECLARE vEtiquetasEscaneadas INT;
@@ -56378,24 +56378,24 @@ BEGIN
FROM vn.ticket t
JOIN vn.expedition e ON e.ticketFk = t.id
WHERE e.id = vExpeditionFk;
-
+
SELECT COUNT(*) INTO vTicketsPendientes
FROM vn.ticket t
LEFT JOIN vn.expedition e ON e.ticketFk = t.id
WHERE t.routeFk = vRouteFk
AND ISNULL(e.id);
-
+
SELECT COUNT(*) INTO vEtiquetasTotales
- FROM vn.expedition e
+ FROM vn.expedition e
JOIN vn.ticket t ON t.id = e.ticketFk
WHERE t.routeFk = vRouteFk;
-
+
SELECT COUNT(*) INTO vEtiquetasEscaneadas
- FROM vn.expeditionScan es
+ FROM vn.expeditionScan es
JOIN vn.expedition e ON e.id = es.expeditionFk
- JOIN vn.ticket t ON t.id = e.ticketFk
+ JOIN vn.ticket t ON t.id = e.ticketFk
WHERE t.routeFk = vRouteFk;
-
+
SELECT e.ticketFk ticket,
t.nickname cliente,
a.city ciudad,
@@ -56409,17 +56409,17 @@ BEGIN
vTicketsPendientes AS ticketsPendientes,
vEtiquetasTotales AS etiquetasTotales,
vEtiquetasEscaneadas AS etiquetasEscaneadas
- FROM vn.expedition e
- JOIN vn.ticket t ON t.id = e.ticketFk
- JOIN vn.address a ON a.id = t.addressFk
- JOIN vn.province p ON p.id = a.provinceFk
- JOIN vn.`zone`z ON z.id = t.zoneFk
- LEFT JOIN vn.route r ON r.id = t.routeFk
- LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
- LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
- LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
+ FROM vn.expedition e
+ JOIN vn.ticket t ON t.id = e.ticketFk
+ JOIN vn.address a ON a.id = t.addressFk
+ JOIN vn.province p ON p.id = a.provinceFk
+ JOIN vn.`zone`z ON z.id = t.zoneFk
+ LEFT JOIN vn.route r ON r.id = t.routeFk
+ LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
+ LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
+ LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
WHERE e.id = vExpeditionFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56438,12 +56438,12 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expedition_StateGet`(vExpeditionFk INT)
BEGIN
-
+
/* Devuelve una "ficha" con todos los datos relativos a la expedición
- *
- * param vExpeditionFk
+ *
+ * param vExpeditionFk
*/
-
+
DECLARE vTicketsPendientes INT;
DECLARE vEtiquetasTotales INT;
DECLARE vEtiquetasEscaneadas INT;
@@ -56454,34 +56454,34 @@ BEGIN
FROM vn.ticket t
JOIN vn.expedition e ON e.ticketFk = t.id
WHERE e.id = vExpeditionFk;
-
+
SELECT COUNT(*) INTO vTicketsPendientes
FROM vn.ticket t
LEFT JOIN vn.expedition e ON e.ticketFk = t.id
WHERE t.routeFk = vRouteFk
AND ISNULL(e.id);
-
+
SELECT COUNT(*) INTO vEtiquetasTotales
- FROM vn.expedition e
+ FROM vn.expedition e
JOIN vn.ticket t ON t.id = e.ticketFk
WHERE t.routeFk = vRouteFk;
-
+
SELECT COUNT(*) INTO vEtiquetasEscaneadas
- FROM vn.expeditionScan es
+ FROM vn.expeditionScan es
JOIN vn.expedition e ON e.id = es.expeditionFk
- JOIN vn.ticket t ON t.id = e.ticketFk
+ JOIN vn.ticket t ON t.id = e.ticketFk
WHERE t.routeFk = vRouteFk;
-
+
SELECT COUNT(*) INTO vEtiquetasLeidasSorter
- FROM srt.expedition e
+ FROM srt.expedition e
JOIN vn.expedition ve ON ve.id = e.id
LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id
- JOIN vn.ticket t ON t.id = ve.ticketFk
+ JOIN vn.ticket t ON t.id = ve.ticketFk
WHERE t.routeFk = vRouteFk
AND e.created != e.updated
- AND ISNULL(es.expeditionFk);
-
-
+ AND ISNULL(es.expeditionFk);
+
+
SELECT e.ticketFk ticket,
t.nickname cliente,
a.city ciudad,
@@ -56496,17 +56496,17 @@ BEGIN
vEtiquetasTotales AS etiquetasTotales,
vEtiquetasEscaneadas AS etiquetasEscaneadas,
vEtiquetasLeidasSorter AS etiquetasSorter
- FROM vn.expedition e
- JOIN vn.ticket t ON t.id = e.ticketFk
- JOIN vn.address a ON a.id = t.addressFk
- JOIN vn.province p ON p.id = a.provinceFk
- JOIN vn.`zone`z ON z.id = t.zoneFk
- LEFT JOIN vn.route r ON r.id = t.routeFk
- LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
- LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
- LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
+ FROM vn.expedition e
+ JOIN vn.ticket t ON t.id = e.ticketFk
+ JOIN vn.address a ON a.id = t.addressFk
+ JOIN vn.province p ON p.id = a.provinceFk
+ JOIN vn.`zone`z ON z.id = t.zoneFk
+ LEFT JOIN vn.route r ON r.id = t.routeFk
+ LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
+ LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
+ LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
WHERE e.id = vExpeditionFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56552,7 +56552,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `fustControl`(vFromDated DATE, vToDated DATE)
BEGIN
-
+
DECLARE vSijsnerClientFk INT DEFAULT 19752;
DECLARE vDateStart DATETIME;
@@ -56561,68 +56561,68 @@ BEGIN
SET vDateStart = vFromDated;
SET vDateEnd = util.Dayend(vToDated);
- SELECT p.id FustCode,
- CAST(sent.stucks AS DECIMAL(10,0)) FH,
- CAST(tp.stucks AS DECIMAL(10,0)) Tickets,
- CAST(-sj.stucks AS DECIMAL(10,0)) Sijsner,
+ SELECT p.id FustCode,
+ CAST(sent.stucks AS DECIMAL(10,0)) FH,
+ CAST(tp.stucks AS DECIMAL(10,0)) Tickets,
+ CAST(-sj.stucks AS DECIMAL(10,0)) Sijsner,
CAST(IFNULL(sent.stucks,0) - IFNULL(tp.stucks,0) + IFNULL(sj.stucks,0) AS DECIMAL(10,0)) saldo
FROM vn.packaging p
LEFT JOIN (
SELECT FustCode, sum(fustQuantity) stucks
FROM (
SELECT IFNULL(pe.equivalentFk ,b.packageFk) FustCode, s.quantity / b.packing AS fustQuantity
- FROM vn.sale s
- JOIN vn.ticket t ON t.id = s.ticketFk
- JOIN vn.warehouse w ON w.id = t.warehouseFk
- JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
- JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = t.warehouseFk
- JOIN vn.buy b ON b.id = lb.buy_id
- JOIN vn.packaging p ON p.id = b.packageFk
+ FROM vn.sale s
+ JOIN vn.ticket t ON t.id = s.ticketFk
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
+ JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = t.warehouseFk
+ JOIN vn.buy b ON b.id = lb.buy_id
+ JOIN vn.packaging p ON p.id = b.packageFk
LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id
- JOIN vn.address a ON a.id = t.addressFk
- JOIN vn.province p2 ON p2.id = a.provinceFk
- JOIN vn.country c ON c.id = p2.countryFk
+ JOIN vn.address a ON a.id = t.addressFk
+ JOIN vn.province p2 ON p2.id = a.provinceFk
+ JOIN vn.country c ON c.id = p2.countryFk
WHERE t.shipped BETWEEN vDateStart AND vDateEnd
AND wa.name = 'VNH'
- AND p.isPackageReturnable
- AND c.country = 'FRANCIA') sub
+ AND p.isPackageReturnable
+ AND c.country = 'FRANCIA') sub
GROUP BY FustCode) sent ON sent.FustCode = p.id
LEFT JOIN (
SELECT FustCode, sum(quantity) stucks
FROM (
SELECT IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode, tp.quantity
- FROM vn.ticketPackaging tp
- JOIN vn.ticket t ON t.id = tp.ticketFk
- JOIN vn.warehouse w ON w.id = t.warehouseFk
- JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
- JOIN vn.packaging p ON p.id = tp.packagingFk
+ FROM vn.ticketPackaging tp
+ JOIN vn.ticket t ON t.id = tp.ticketFk
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
+ JOIN vn.packaging p ON p.id = tp.packagingFk
LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id
- JOIN vn.address a ON a.id = t.addressFk
- JOIN vn.province p2 ON p2.id = a.provinceFk
- JOIN vn.country c ON c.id = p2.countryFk
+ JOIN vn.address a ON a.id = t.addressFk
+ JOIN vn.province p2 ON p2.id = a.provinceFk
+ JOIN vn.country c ON c.id = p2.countryFk
WHERE t.shipped BETWEEN vDateStart AND vDateEnd
AND wa.name = 'VNH'
- AND p.isPackageReturnable
+ AND p.isPackageReturnable
AND c.country = 'FRANCIA'
AND t.clientFk != vSijsnerClientFk
- AND tp.quantity > 0) sub
+ AND tp.quantity > 0) sub
GROUP BY FustCode) tp ON tp.FustCode = p.id
LEFT JOIN (
SELECT FustCode, sum(quantity) stucks
FROM (
SELECT IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode, tp.quantity
- FROM vn.ticketPackaging tp
- JOIN vn.ticket t ON t.id = tp.ticketFk
- JOIN vn.warehouse w ON w.id = t.warehouseFk
- JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
- JOIN vn.packaging p ON p.id = tp.packagingFk
+ FROM vn.ticketPackaging tp
+ JOIN vn.ticket t ON t.id = tp.ticketFk
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
+ JOIN vn.packaging p ON p.id = tp.packagingFk
LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id
WHERE t.shipped BETWEEN TIMESTAMPADD(DAY, 1, vDateStart ) AND TIMESTAMPADD(DAY, 1, vDateEnd )
AND wa.name = 'VNH'
- AND p.isPackageReturnable
- AND t.clientFk = vSijsnerClientFk) sub
+ AND p.isPackageReturnable
+ AND t.clientFk = vSijsnerClientFk) sub
GROUP BY FustCode) sj ON sj.FustCode = p.id
- WHERE sent.stucks
+ WHERE sent.stucks
OR tp.stucks
OR sj.stucks;
@@ -56644,7 +56644,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `fustControlDetail`(vFromDated DATE, vToDated DATE)
BEGIN
-
+
DECLARE vSijsnerClientFk INT DEFAULT 19752;
DECLARE vDateStart DATETIME;
@@ -56652,29 +56652,29 @@ BEGIN
SET vDateStart = vFromDated;
SET vDateEnd = util.Dayend(vToDated);
-
+
SELECT a.nickname shopName,
- a.city ,
- IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode,
+ a.city ,
+ IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode,
tp.quantity,
tp.ticketFk,
CONCAT('From ', vFromDated,' to ', vToDated) AS dateRange
- FROM vn.ticketPackaging tp
- JOIN vn.ticket t ON t.id = tp.ticketFk
- JOIN vn.warehouse w ON w.id = t.warehouseFk
- JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
- JOIN vn.packaging p ON p.id = tp.packagingFk
+ FROM vn.ticketPackaging tp
+ JOIN vn.ticket t ON t.id = tp.ticketFk
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk
+ JOIN vn.packaging p ON p.id = tp.packagingFk
LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id
- JOIN vn.address a ON a.id = t.addressFk
- JOIN vn.province p2 ON p2.id = a.provinceFk
- JOIN vn.country c ON c.id = p2.countryFk
+ JOIN vn.address a ON a.id = t.addressFk
+ JOIN vn.province p2 ON p2.id = a.provinceFk
+ JOIN vn.country c ON c.id = p2.countryFk
WHERE t.shipped BETWEEN vFromDated AND util.dayend(vToDated)
AND wa.name = 'VNH'
- AND p.isPackageReturnable
+ AND p.isPackageReturnable
AND c.country = 'FRANCIA'
AND t.clientFk != vSijsnerClientFk
AND tp.quantity > 0;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56700,8 +56700,8 @@ DECLARE vTicketFk INT;
DECLARE vSaleFk INT;
DECLARE vClonTicket INT DEFAULT 0;
-DECLARE cur1 CURSOR FOR
-SELECT s.ticketFk, s.id
+DECLARE cur1 CURSOR FOR
+SELECT s.ticketFk, s.id
FROM vn.sale s
JOIN vn.ticket t ON t.id = s.ticketFk
JOIN vn.item i ON i.id = s.itemFk
@@ -56717,17 +56717,17 @@ OPEN cur1;
FETCH cur1 INTO vTicketFk, vSaleFk;
WHILE done = 0 DO
-
+
SELECT t.id INTO vClonTicket
FROM vn.ticket t
JOIN (SELECT addressFk, shipped FROM vn.ticket WHERE id = vTicketFk) sub USING(addressFk, shipped)
WHERE t.warehouseFk = 44
LIMIT 1;
-
+
SELECT vTicketFk, vClonTicket;
-
+
IF vClonTicket = 0 THEN
-
+
INSERT INTO ticket (
clientFk,
shipped,
@@ -56755,12 +56755,12 @@ FETCH cur1 INTO vTicketFk, vSaleFk;
zonePrice,
zoneBonus,
routeFk
-
+
FROM ticket
WHERE id = vTicketFk;
SET vClonTicket = LAST_INSERT_ID();
-
+
SELECT 'lstID', vClonTicket;
/*
INSERT INTO ticketObservation(ticketFk, observationTypeFk, description)
@@ -56770,20 +56770,20 @@ FETCH cur1 INTO vTicketFk, vSaleFk;
WHERE t.id = vClonTicket;
*/
INSERT INTO ticketLog
- SET originFk = vTicketFk, userFk = account.myUser_getId(), `action` = 'insert',
+ SET originFk = vTicketFk, userFk = account.myUser_getId(), `action` = 'insert',
description = CONCAT('Ha creado el ticket:', ' ', vClonTicket, ' clonando el ', vTicketFk);
-
+
END IF;
-
+
UPDATE vn.sale
SET ticketFk = vClonTicket
WHERE id = vSaleFk;
SET vClonTicket = 0;
-
+
SET done = 0;
FETCH cur1 INTO vTicketFk, vSaleFk;
-
+
END WHILE;
CLOSE cur1;
@@ -56808,8 +56808,8 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `getDayExpeditions`()
BEGIN
- SELECT
- e.expeditions_id as expeditionFk,
+ SELECT
+ e.expeditions_id as expeditionFk,
date_format(e.odbc_date,'%Y-%m-%d') as expeditionDate,
e.ticket_id as ticketFk,
t.routeFk as routeFk
@@ -56886,7 +56886,7 @@ BEGIN
SELECT DATE_SUB(util.VN_CURDATE(), INTERVAL yearsToDelete YEAR) INTO vDated
FROM vn.greugeConfig;
-
+
INSERT INTO vn.greuge(clientFk, description, amount, shipped, created, greugeTypeFk)
SELECT clientFk, 'Suma agrupada', SUM(amount), MAX(shipped), MAX(created), greugeTypeFk
FROM vn.greuge
@@ -57004,8 +57004,8 @@ DECLARE done BOOL DEFAULT FALSE;
DECLARE vTicketFk INT;
DECLARE rs CURSOR FOR
- SELECT id FROM vn.ticket
- WHERE shipped = util.yesterday()
+ SELECT id FROM vn.ticket
+ WHERE shipped = util.yesterday()
AND clientFk = 400
AND warehouseFk IN (1,44);
@@ -57016,13 +57016,13 @@ OPEN rs;
FETCH rs INTO vTicketFk;
WHILE NOT done DO
-
+
INSERT INTO vn.inventoryFailure(dated, itemFk, quantity, value, warehouseFk, throwerFk)
- SELECT t.shipped,
- s.itemFk,
- s.quantity,
+ SELECT t.shipped,
+ s.itemFk,
+ s.quantity,
b.buyingValue + b.freightValue + b.packageValue + b.comissionValue,
- t.warehouseFk,
+ t.warehouseFk,
w.id
FROM vn.ticket t
JOIN vn.sale s ON s.ticketFk = t.id
@@ -57033,7 +57033,7 @@ WHILE NOT done DO
AND s.quantity > 0;
FETCH rs INTO vTicketFk;
-
+
END WHILE;
@@ -57101,7 +57101,7 @@ proc: BEGIN
SELECT inventorySupplierFk INTO vInventorySupplierFk
FROM entryConfig;
-
+
SELECT am.id INTO vAgencyModeFkInventory
FROM agencyMode am
where code = 'inv';
@@ -57198,7 +57198,7 @@ proc: BEGIN
JOIN entry e ON e.id = b.entryFk
JOIN travel tr ON tr.id = e.travelFk
WHERE tr.warehouseInFk = vWh
- AND tr.landed BETWEEN vDateLastInventory
+ AND tr.landed BETWEEN vDateLastInventory
AND vDateYesterday
AND NOT isRaid
GROUP BY b.itemFk;
@@ -57252,7 +57252,7 @@ proc: BEGIN
inv.price3 = b.price3,
inv.minPrice = b.minPrice,
inv.producer = p.name;
-
+
INSERT INTO buy( itemFk,
quantity,
buyingValue,
@@ -57286,15 +57286,15 @@ proc: BEGIN
FROM tmp.inventory;
SELECT vWh, COUNT(*), util.VN_NOW() FROM tmp.inventory;
-
+
-- Actualizamos el campo lastUsed de item
UPDATE item i
JOIN tmp.inventory i2 ON i2.itemFk = i.id
SET i.lastUsed = NOW()
WHERE i2.quantity;
-
+
-- DROP TEMPORARY TABLE tmp.inventory;
-
+
END LOOP;
CLOSE cWarehouses;
@@ -57308,11 +57308,11 @@ proc: BEGIN
SELECT e.id as entryId,
t.id as travelId
FROM travel t
- JOIN `entry` e ON e.travelFk = t.id
+ JOIN `entry` e ON e.travelFk = t.id
WHERE e.supplierFk = vInventorySupplierFk
AND t.shipped <= util.VN_CURDATE() - INTERVAL 12 DAY
AND (DAY(t.shipped) <> 1 OR shipped < util.VN_CURDATE() - INTERVAL 12 DAY);
-
+
DELETE e
FROM `entry` e
JOIN tmp.entryToDelete tmp ON tmp.entryId = e.id;
@@ -57374,7 +57374,7 @@ BEGIN
b.id AS buyFk,
b.entryFk,
b.isIgnored,
- b.price2,
+ b.price2,
b.price3,
b.stickers,
b.packing,
@@ -57388,20 +57388,20 @@ BEGIN
s.id AS supplierFk,
s.name AS supplier
FROM itemType it
- RIGHT JOIN (entry e
+ RIGHT JOIN (entry e
LEFT JOIN supplier s ON s.id = e.supplierFk
RIGHT JOIN buy b ON b.entryFk = e.id
LEFT JOIN item i ON i.id = b.itemFk
- LEFT JOIN ink ON ink.id = i.inkFk
+ LEFT JOIN ink ON ink.id = i.inkFk
LEFT JOIN travel tr ON tr.id = e.travelFk
LEFT JOIN warehouse w ON w.id = tr.warehouseInFk
LEFT JOIN origin o ON o.id = i.originFk
) ON it.id = i.typeFk
LEFT JOIN edi.ekt ek ON b.ektFk = ek.id
WHERE (b.packageFk = "--" OR b.price2 = 0 OR b.packing = 0 OR b.buyingValue = 0) AND tr.landed > util.firstDayOfMonth(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())) AND s.name = 'INVENTARIO';
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.lastEntryOk;
- CREATE TEMPORARY TABLE tmp.lastEntryOk
+ CREATE TEMPORARY TABLE tmp.lastEntryOk
(PRIMARY KEY (buyFk))
SELECT
i.id AS itemFk,
@@ -57411,7 +57411,7 @@ BEGIN
b.id AS buyFk,
b.entryFk,
b.isIgnored,
- b.price2,
+ b.price2,
b.price3,
b.stickers,
b.packing,
@@ -57425,11 +57425,11 @@ BEGIN
s.id AS supplierFk,
s.name AS supplier
FROM itemType it
- RIGHT JOIN (entry e
+ RIGHT JOIN (entry e
LEFT JOIN supplier s ON s.id = e.supplierFk
RIGHT JOIN buy b ON b.entryFk = e.id
LEFT JOIN item i ON i.id = b.itemFk
- LEFT JOIN ink ON ink.id = i.inkFk
+ LEFT JOIN ink ON ink.id = i.inkFk
LEFT JOIN travel tr ON tr.id = e.travelFk
LEFT JOIN warehouse w ON w.id = tr.warehouseInFk
LEFT JOIN origin o ON o.id = i.originFk
@@ -57437,34 +57437,34 @@ BEGIN
LEFT JOIN edi.ekt ek ON b.ektFk = ek.id
WHERE b.packageFk != "--" AND b.price2 != 0 AND b.packing != 0 AND b.buyingValue > 0 AND tr.landed > util.firstDayOfMonth(TIMESTAMPADD(MONTH,-2,util.VN_CURDATE()))
ORDER BY tr.landed DESC;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.lastEntryOkGroup;
- CREATE TEMPORARY TABLE tmp.lastEntryOkGroup
+ CREATE TEMPORARY TABLE tmp.lastEntryOkGroup
(INDEX (warehouseFk,itemFk))
SELECT *
FROM tmp.lastEntryOk tmp
GROUP BY tmp.itemFk,tmp.warehouseFk;
-
+
UPDATE buy b
JOIN tmp.lastEntry lt ON lt.buyFk = b.id
JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk
SET b.packageFk = eo.packageFk WHERE b.packageFk = "--";
-
+
UPDATE buy b
JOIN tmp.lastEntry lt ON lt.buyFk = b.id
JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk
SET b.price2 = eo.price2 WHERE b.price2 = 0 ;
-
+
UPDATE buy b
JOIN tmp.lastEntry lt ON lt.buyFk = b.id
JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk
SET b.packing = eo.packing WHERE b.packing = 0;
-
+
UPDATE buy b
JOIN tmp.lastEntry lt ON lt.buyFk = b.id
JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk
SET b.buyingValue = eo.buyingValue WHERE b.buyingValue = 0;
-
+
DROP TEMPORARY TABLE tmp.lastEntry;
DROP TEMPORARY TABLE tmp.lastEntryOk;
DROP TEMPORARY TABLE tmp.lastEntryOkGroup;
@@ -57624,7 +57624,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInDueDay_calculate`(vInvoiceInFk INT)
BEGIN
/**
- * Calcula los vctos. de una factura recibida
+ * Calcula los vctos. de una factura recibida
* En caso de haberlos informado previamente o que el proveedor sea español, no los recalculará
*
* @param vInvoiceInFk Factura recibida
@@ -57645,46 +57645,46 @@ BEGIN
WHERE ii.id = vInvoiceInFk;
SELECT COUNT(*) INTO vHasDueDay
- FROM invoiceInDueDay iid
+ FROM invoiceInDueDay iid
WHERE iid.invoiceInFk = vInvoiceInFk;
IF NOT vHasDueDay AND vCompanyCountryCode = 'ES' THEN
SET @cont := 0;
INSERT INTO invoiceInDueDay (
- invoiceInFk,
- dueDated,
- amount,
+ invoiceInFk,
+ dueDated,
+ amount,
foreignValue
)
SELECT vInvoiceInFk,
- IF(payDay,
+ IF(payDay,
IF(getNextDueDate(issued, pdd.detail, payDay) < created,
created,
- getNextDueDate(issued, pdd.detail, payDay)),
+ getNextDueDate(issued, pdd.detail, payDay)),
GREATEST(created, issued + INTERVAL pdd.detail DAY)),
- IF((@cont := @cont + 1) < cont,
- TRUNCATE(venc / cont, 2),
- venc - (TRUNCATE(venc / cont, 2) * (cont - 1))),
- IF(@cont < cont,
- TRUNCATE(foreignValue / cont, 2),
- foreignValue - (TRUNCATE(foreignValue / cont, 2) * (cont - 1)))
- FROM (
- SELECT SUM((1 + (IFNULL(ti.PorcentajeIva, 0) / 100) * vHasDueDayTax)
- * iit.taxableBase) / COUNT(DISTINCT(pdd.detail)) venc,
+ IF((@cont := @cont + 1) < cont,
+ TRUNCATE(venc / cont, 2),
+ venc - (TRUNCATE(venc / cont, 2) * (cont - 1))),
+ IF(@cont < cont,
+ TRUNCATE(foreignValue / cont, 2),
+ foreignValue - (TRUNCATE(foreignValue / cont, 2) * (cont - 1)))
+ FROM (
+ SELECT SUM((1 + (IFNULL(ti.PorcentajeIva, 0) / 100) * vHasDueDayTax)
+ * iit.taxableBase) / COUNT(DISTINCT(pdd.detail)) venc,
SUM(iit.foreignValue) / COUNT(DISTINCT(pdd.detail)) foreignValue,
- s.payDemFk,
+ s.payDemFk,
ii.companyFk,
COUNT(DISTINCT(pdd.detail)) cont,
s.payDay,
ii.issued,
DATE(ii.created) + INTERVAL 2 DAY created
- FROM invoiceIn ii
- JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
- LEFT JOIN sage.TiposIva ti ON ti.CodigoIva= iit.taxTypeSageFk
- JOIN supplier s ON s.id = ii.supplierFk
- JOIN payDemDetail pdd ON pdd.id = s.payDemFk
- WHERE ii.id = vInvoiceInFk
+ FROM invoiceIn ii
+ JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
+ LEFT JOIN sage.TiposIva ti ON ti.CodigoIva= iit.taxTypeSageFk
+ JOIN supplier s ON s.id = ii.supplierFk
+ JOIN payDemDetail pdd ON pdd.id = s.payDemFk
+ WHERE ii.id = vInvoiceInFk
GROUP BY ii.id
)sub
JOIN payDemDetail pdd ON pdd.id = sub.payDemFk
@@ -57712,9 +57712,9 @@ BEGIN
DELETE FROM invoiceInDueDay
WHERE invoiceInFk = vInvoiceInFk;
-
+
CALL invoiceInDueDay_calculate(vInvoiceInFk);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -57798,7 +57798,7 @@ BEGIN
CALL invoiceInTax_getFromEntries(vInvoiceInFk);
CALL invoiceInDueDay_calculate(vInvoiceInFk);
-
+
FETCH rs INTO vInvoiceInFk;
END WHILE;
@@ -57830,7 +57830,7 @@ BEGIN
SELECT MAX(rr.dated) INTO vDated
FROM referenceRate rr
JOIN invoiceIn ii ON ii.id = vId
- WHERE rr.dated <= ii.issued
+ WHERE rr.dated <= ii.issued
AND rr.currencyFk = ii.currencyFk ;
IF vDated THEN
@@ -57839,13 +57839,13 @@ BEGIN
WHERE dated = vDated;
END IF;
- SELECT id INTO vExpenceFk
- FROM vn.expence
- WHERE `name` = 'Adquisición mercancia Extracomunitaria'
- GROUP BY id
+ SELECT id INTO vExpenceFk
+ FROM vn.expence
+ WHERE `name` = 'Adquisición mercancia Extracomunitaria'
+ GROUP BY id
LIMIT 1;
-
- DELETE FROM invoiceInTax
+
+ DELETE FROM invoiceInTax
WHERE invoiceInFk = vId;
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, foreignValue, taxTypeSageFk, transactionTypeSageFk)
@@ -57859,9 +57859,9 @@ BEGIN
JOIN entry e ON e.invoiceInFk = ii.id
JOIN supplier s ON s.id = e.supplierFk
JOIN buy b ON b.entryFk = e.id
- LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk
+ LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk
AND rr.dated = ii.issued
- WHERE ii.id = vId
+ WHERE ii.id = vId
HAVING taxableBase IS NOT NULL;
END ;;
DELIMITER ;
@@ -57888,7 +57888,7 @@ BEGIN
SELECT ii.bookEntried,
iit.foreignValue,
ii.companyFk,
- ii.expenceFkDeductible,
+ ii.expenceFkDeductible,
iit.taxableBase,
iit.transactionTypeSageFk,
ii.serial,
@@ -57927,7 +57927,7 @@ BEGIN
JOIN country c ON c.id = s.countryFk
JOIN supplier sc ON sc.id = ii.companyFk
JOIN country cc ON cc.id = sc.countryFk
- JOIN invoiceInSerial iis ON iis.code = ii.serial
+ JOIN invoiceInSerial iis ON iis.code = ii.serial
JOIN cplusInvoiceType472 cit ON cit.id = ii.cplusInvoiceType472Fk
LEFT JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
LEFT JOIN sage.TiposTransacciones ttr ON ttr.CodigoTransaccion = iit.transactionTypeSageFk
@@ -57950,18 +57950,18 @@ BEGIN
NFACTICK,
CLAVE,
empresa_id)
- SELECT
+ SELECT
vBookNumber ASIEN,
tii.bookEntried FECHA,
tii.supplierAccount SUBCTA,
- SUM(tii.taxableBase *
- IF(tii.serial= 'R' AND ((tii.taxCode IS NULL OR tii.taxCode <> 'ISP21')
- AND tii.taxTypeSageFk IS NOT NULL),
- 1 + (tii.PorcentajeIva / 100),
- 1)) EUROHABER,
- CONCAT('s/fra',
- RIGHT(tii.supplierRef, 8),
- ':',
+ SUM(tii.taxableBase *
+ IF(tii.serial= 'R' AND ((tii.taxCode IS NULL OR tii.taxCode <> 'ISP21')
+ AND tii.taxTypeSageFk IS NOT NULL),
+ 1 + (tii.PorcentajeIva / 100),
+ 1)) EUROHABER,
+ CONCAT('s/fra',
+ RIGHT(tii.supplierRef, 8),
+ ':',
LEFT(tii.supplierName, 10)) CONCEPTO,
CAST(tii.taxableBase / tii.foreignValue AS DECIMAL (10,4)) CAMBIO,
SUM(tii.foreignValue * IF(tii.serial = 'R', 1 + (tii.PorcentajeIva / 100), 1)) HABERME,
@@ -57978,7 +57978,7 @@ BEGIN
CONTRA,
EURODEBE,
EUROHABER,
- CONCEPTO,
+ CONCEPTO,
CAMBIO,
DEBEME,
HABERME,
@@ -57990,9 +57990,9 @@ BEGIN
tii.supplierAccount CONTRA,
IF(tii.isWithheld AND tii.taxableBase < 0, NULL, ROUND(SUM(tii.taxableBase),2)) EURODEBE,
IF(tii.isWithheld AND tii.taxableBase < 0, ROUND(SUM(-tii.taxableBase), 2), NULL) EUROHABER,
- CONCAT('s/fra',
- RIGHT(tii.supplierRef, 8),
- ':',
+ CONCAT('s/fra',
+ RIGHT(tii.supplierRef, 8),
+ ':',
LEFT(tii.supplierName, 10)) CONCEPTO,
CAST(tii.taxableBase / tii.foreignValue AS DECIMAL (10, 4)) CAMBIO,
IF(tii.isWithheld, NULL,ABS(ROUND(SUM(tii.foreignValue), 2))) DEBEME,
@@ -58004,17 +58004,17 @@ BEGIN
GROUP BY tii.expenceFk;
-- Líneas de IVA
- INSERT INTO XDiario(
+ INSERT INTO XDiario(
ASIEN,
FECHA,
SUBCTA,
- CONTRA,
+ CONTRA,
EURODEBE,
BASEEURO,
CONCEPTO,
- FACTURA,
+ FACTURA,
IVA,
- AUXILIAR,
+ AUXILIAR,
SERIE,
TIPOOPE,
FECHA_EX,
@@ -58063,28 +58063,28 @@ BEGIN
tii.companyFk
FROM tInvoiceIn tii
LEFT JOIN (
- SELECT e.id
+ SELECT e.id
FROM tInvoiceIn tii
- JOIN expence e ON e.id = tii.expenceFk
+ JOIN expence e ON e.id = tii.expenceFk
WHERE e.isWithheld
LIMIT 1
- ) eWithheld ON TRUE
- WHERE tii.taxTypeSageFk IS NOT NULL
- AND (tii.taxCode IS NULL OR tii.taxCode NOT IN ('import10', 'import21'))
+ ) eWithheld ON TRUE
+ WHERE tii.taxTypeSageFk IS NOT NULL
+ AND (tii.taxCode IS NULL OR tii.taxCode NOT IN ('import10', 'import21'))
GROUP BY tii.PorcentajeIva, tii.expenceFk;
-- Línea iva inversor sujeto pasivo
- INSERT INTO XDiario(
+ INSERT INTO XDiario(
ASIEN,
FECHA,
SUBCTA,
- CONTRA,
+ CONTRA,
EUROHABER,
BASEEURO,
CONCEPTO,
- FACTURA,
+ FACTURA,
IVA,
- AUXILIAR,
+ AUXILIAR,
SERIE,
TIPOOPE,
FECHA_EX,
@@ -58133,31 +58133,31 @@ BEGIN
JOIN sage.config c
WHERE tii.taxCode = 'ISP21' OR MID(tii.supplierAccount, 4, 1) = '1'
AND tii.taxTypeSageFk IS NOT NULL
- AND NOT(tii.isVies
- AND c.nontaxableTransactionTypeFk = tii.transactionTypeSageFk
+ AND NOT(tii.isVies
+ AND c.nontaxableTransactionTypeFk = tii.transactionTypeSageFk
AND tii.taxCode = 'nonTaxable')
GROUP BY tii.PorcentajeIva, tii.expenceFk;
-
- -- Actualización del registro original
+
+ -- Actualización del registro original
UPDATE invoiceIn ii
SET ii.isBooked = TRUE
WHERE ii.id = vSelf;
-
+
-- Problemas derivados de la precisión en los decimales al calcular los impuestos
- UPDATE XDiario
- SET EURODEBE = EURODEBE -
+ UPDATE XDiario
+ SET EURODEBE = EURODEBE -
(SELECT IF(ABS(sub.difference) = 0.01, sub.difference, 0)
FROM(
- SELECT SUM(IFNULL(ROUND(EURODEBE, 2),0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) difference
+ SELECT SUM(IFNULL(ROUND(EURODEBE, 2),0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) difference
FROM XDiario
WHERE ASIEN = vBookNumber
)sub
)
- WHERE ASIEN = vBookNumber
+ WHERE ASIEN = vBookNumber
AND EURODEBE <> 0
ORDER BY id DESC
LIMIT 1;
-
+
DROP TEMPORARY TABLE tInvoiceIn;
END ;;
DELIMITER ;
@@ -58272,7 +58272,7 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS rs;
CREATE TEMPORARY TABLE rs
- SELECT
+ SELECT
c.accountingAccount AS clientBookingAccount,
io.amount as totalAmount,
CONCAT('n/fra ', io.ref) as simpleConcept,
@@ -58306,19 +58306,19 @@ BEGIN
WHERE io.id = vInvoice;
CALL vn.ledger_next(vBookNumber);
-
+
-- Linea del cliente
INSERT INTO XDiario(
ASIEN,
FECHA,
- SUBCTA,
+ SUBCTA,
EURODEBE,
- CONCEPTO,
+ CONCEPTO,
FECHA_EX,
FECHA_OP,
empresa_id
)
- SELECT
+ SELECT
vBookNumber AS ASIEN,
rs.FECHA,
rs.clientBookingAccount AS SUBCTA,
@@ -58334,14 +58334,14 @@ BEGIN
ASIEN,
FECHA,
SUBCTA,
- CONTRA,
+ CONTRA,
EUROHABER,
- CONCEPTO,
+ CONCEPTO,
FECHA_EX,
FECHA_OP,
empresa_id
)
- SELECT
+ SELECT
vBookNumber AS ASIEN,
rs.FECHA,
ioe.expenceFk AS SUBCTA,
@@ -58355,8 +58355,8 @@ BEGIN
JOIN invoiceOutExpence ioe
WHERE ioe.invoiceOutFk = vInvoice;
- SELECT GROUP_CONCAT(`name` SEPARATOR ',')
- INTO vExpenceConcept
+ SELECT GROUP_CONCAT(`name` SEPARATOR ',')
+ INTO vExpenceConcept
FROM expence e
JOIN invoiceOutExpence ioe ON ioe.expenceFk = e.id
WHERE ioe.invoiceOutFk = vInvoice;
@@ -58366,7 +58366,7 @@ BEGIN
ASIEN,
FECHA,
SUBCTA,
- CONTRA,
+ CONTRA,
EUROHABER,
BASEEURO,
CONCEPTO,
@@ -58394,7 +58394,7 @@ BEGIN
TIPORECTIF,
empresa_id
)
- SELECT
+ SELECT
vBookNumber AS ASIEN,
rs.FECHA,
iot.pgcFk AS SUBCTA,
@@ -58414,11 +58414,11 @@ BEGIN
rs.FECHA_OP,
rs.FECHA_EX,
rs.TIPOOPE,
- rs.NFACTICK,
+ rs.NFACTICK,
rs.TERIDNIF,
rs.TERNIF,
rs.TERNOM,
- pgc.mod340 AS L340,
+ pgc.mod340 AS L340,
pgc.cplusTrascendency477Fk AS TIPOCLAVE,
pgc.cplusTaxBreakFk as TIPOEXENCI,
rs.TIPONOSUJE,
@@ -58426,13 +58426,13 @@ BEGIN
rs.TIPORECTIF,
rs.companyFk AS empresa_id
FROM rs
- JOIN invoiceOutTax iot
+ JOIN invoiceOutTax iot
JOIN pgc ON pgc.code = iot.pgcFk
LEFT JOIN pgcEqu pe ON pe.vatFk = iot.pgcFk -- --------------- Comprueba si la linea es de iva con rec.equiv. asociado
- LEFT JOIN pgc pgce ON pgce.code = pe.equFk
+ LEFT JOIN pgc pgce ON pgce.code = pe.equFk
LEFT JOIN pgcEqu pe2 ON pe2.equFk = iot.pgcFk -- --------------- Comprueba si la linea es de rec.equiv.
WHERE iot.invoiceOutFk = vInvoice;
-
+
UPDATE invoiceOut
SET booked = util.VN_CURDATE()
WHERE id = vInvoice;
@@ -58464,7 +58464,7 @@ BEGIN
DECLARE done BOOL DEFAULT FALSE;
- DECLARE rs CURSOR FOR
+ DECLARE rs CURSOR FOR
SELECT io.id
FROM invoiceOut io
WHERE RIGHT(ref,7) BETWEEN 1724215 AND 1724224
@@ -58479,15 +58479,15 @@ BEGIN
WHILE NOT done DO
CALL invoiceOutBooking(vInvoice);
-
+
FETCH rs INTO vInvoice ;
-
+
SET vContador = vContador + 1;
-
+
IF vContador MOD 50 = 0 THEN
-
+
SELECT CONCAT(vContador, ' de momento') AS FACTURAS_ASENTADAS;
-
+
END IF;
END WHILE;
@@ -58517,14 +58517,14 @@ BEGIN
DECLARE vAsien INTEGER;
DECLARE vSendMail BOOL;
DECLARE vBody TEXT;
-
+
SELECT ASIEN INTO vAsien
- FROM XDiario
+ FROM XDiario
WHERE SERIE = SUBSTRING(vRef, 1, 1)
AND FACTURA = SUBSTRING(vRef, 2, LENGTH(vRef)-1)
LIMIT 1;
- SELECT IF(enlazado OR enlazadoSage, TRUE, FALSE),
+ SELECT IF(enlazado OR enlazadoSage, TRUE, FALSE),
CONCAT(
'
'
- )
+ )
INTO vSendMail, vBody
- FROM XDiario
+ FROM XDiario
WHERE ASIEN = vAsien;
- DELETE FROM XDiario
+ DELETE FROM XDiario
WHERE ASIEN = vAsien;
-
+
IF vSendMail THEN
CALL mail_insert(
'administracion@verdnatura.es',
@@ -58571,7 +58571,7 @@ BEGIN
SET refFk = NULL
WHERE refFk = vRef;
- DELETE
+ DELETE
FROM invoiceOut
WHERE ref = vRef;
@@ -58594,7 +58594,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOutListByCompany`(vCompany INT, vStarted DATE, vEnded DATE)
BEGIN
-SELECT
+SELECT
c.socialName as RazonSocial,
c.fi as NIF,
io.ref as Factura,
@@ -58606,7 +58606,7 @@ SELECT
pgc.rate as Tipo,
iot.vat as Cuota,
pgc.name as Concepto
-
+
FROM vn.invoiceOut io
JOIN vn.invoiceOutTax iot ON iot.invoiceOutFk = io.id
JOIN vn.client c ON c.id = io.clientFk
@@ -59051,17 +59051,17 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_newFromClient`(
- IN vClientFk INT,
- IN vSerial CHAR(2),
+ IN vClientFk INT,
+ IN vSerial CHAR(2),
IN vMaxShipped DATE,
- IN vCompanyFk INT,
+ IN vCompanyFk INT,
IN vTaxArea VARCHAR(25),
- IN vRef VARCHAR(25),
+ IN vRef VARCHAR(25),
OUT vInvoiceId INT)
BEGIN
/**
* Factura los tickets de un cliente hasta una fecha dada
- * @param vClientFk Id del cliente a facturar
+ * @param vClientFk Id del cliente a facturar
* @param vSerial Serie de factura
* @param vMaxShipped Fecha hasta la cual cogera tickets para facturar
* @param vCompanyFk Id de la empresa desde la que se factura
@@ -59080,11 +59080,11 @@ BEGIN
IF NOT vIsRefEditable THEN
CALL util.throw('serial non editable');
END IF;
- END IF;
+ END IF;
SELECT COUNT(*) INTO vIsExportation
FROM vn.invoiceOutSerial
- WHERE taxAreaFk = 'WORLD'
+ WHERE taxAreaFk = 'WORLD'
AND `code` = vSerial;
IF vIsExportation THEN
@@ -59097,7 +59097,7 @@ BEGIN
UPDATE invoiceOut
SET `ref` = vRef
- WHERE id = vInvoiceId
+ WHERE id = vInvoiceId
AND vRef IS NOT NULL;
IF vSerial <> 'R' AND NOT ISNULL(vInvoiceId) AND vInvoiceId <> 0 THEN
@@ -59126,7 +59126,7 @@ BEGIN
* Factura un ticket
* @param vTicketFk Id del ticket
* @param vSerial Serie de factura
- * @param vTaxArea Area de la factura en caso de querer forzarlo,
+ * @param vTaxArea Area de la factura en caso de querer forzarlo,
* en la mayoria de los casos poner NULL
* @return vInvoiceId
*/
@@ -59141,11 +59141,11 @@ BEGIN
IF NOT vIsRefEditable THEN
CALL util.throw('serial non editable');
END IF;
-
- UPDATE invoiceOut
+
+ UPDATE invoiceOut
SET `ref` = vRef
WHERE id = vInvoiceId;
- END IF;
+ END IF;
IF vSerial <> 'R' AND NOT ISNULL(vInvoiceId) AND vInvoiceId <> 0 THEN
CALL invoiceOutBooking(vInvoiceId);
@@ -59227,7 +59227,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `itemBarcode_update`(vItemFk INT,vCo
BEGIN
IF vDelete THEN
DELETE FROM vn.itemBarcode WHERE itemFk = vItemFk AND code = vCode;
-ELSE
+ELSE
INSERT INTO vn.itemBarcode(itemFk,code) VALUES (vItemFk,vCode);
END IF;
@@ -59249,8 +59249,8 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemFreight_Show`(vItemFk INT, vWarehouseFk INT)
BEGIN
-
- SELECT cm3 Volumen_Entrada,
+
+ SELECT cm3 Volumen_Entrada,
cm3delivery Volumen_Salida,
p.volume Volumen_del_embalaje,
p.width Ancho_del_embalaje,
@@ -59263,11 +59263,11 @@ BEGIN
b.id buyFk,
b.entryFk,
w.name warehouseFk
- FROM vn.itemCost ic
- JOIN vn.item i ON i.id = ic.itemFk
- LEFT JOIN cache.last_buy lb ON lb.item_id = ic.itemFk AND lb.warehouse_id = ic.warehouseFk
- LEFT JOIN vn.buy b ON b.id = lb.buy_id
- LEFT JOIN vn.packaging p ON p.id = b.packageFk
+ FROM vn.itemCost ic
+ JOIN vn.item i ON i.id = ic.itemFk
+ LEFT JOIN cache.last_buy lb ON lb.item_id = ic.itemFk AND lb.warehouse_id = ic.warehouseFk
+ LEFT JOIN vn.buy b ON b.id = lb.buy_id
+ LEFT JOIN vn.packaging p ON p.id = b.packageFk
LEFT JOIN vn.warehouse w ON w.id = ic.warehouseFk
WHERE ic.itemFk = vItemFk
AND ic.warehouseFk = vWarehouseFk;
@@ -59291,33 +59291,33 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `itemFuentesBalance`(vDaysInFuture I
BEGIN
/* Se utiliza para calcular la necesidad de mover mercancia entre el almacén de fuentes y el nuestro
- *
+ *
* @param vDaysInFuture Rango de dias para calcular entradas y salidas
- *
+ *
*/
-
+
DECLARE vWarehouseFk INT;
SELECT s.warehouseFk INTO vWarehouseFk
- FROM vn.sector s
+ FROM vn.sector s
WHERE s.code = 'FUENTES_PICASSE';
-
+
CALL cache.stock_refresh(FALSE);
- SELECT i.id itemFk,
+ SELECT i.id itemFk,
i.longName,
i.size,
i.subName,
- v.amount - IFNULL(fue.Fuentes,0) - IFNULL(alb.albenfruit,0) as visible,
- fue.Fuentes,
+ v.amount - IFNULL(fue.Fuentes,0) - IFNULL(alb.albenfruit,0) as visible,
+ fue.Fuentes,
alb.Albenfruit,
- sale.venta,
- IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) as compra,
- IFNULL(v.amount,0) + IFNULL(sale.venta,0) + IFNULL(buy.compra,0) + IFNULL(mov.traslado,0)
+ sale.venta,
+ IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) as compra,
+ IFNULL(v.amount,0) + IFNULL(sale.venta,0) + IFNULL(buy.compra,0) + IFNULL(mov.traslado,0)
- IFNULL(fue.Fuentes,0) - IFNULL(alb.albenfruit,0) as saldo
- FROM vn.item i
- JOIN vn.itemType it ON it.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = it.categoryFk
+ FROM vn.item i
+ JOIN vn.itemType it ON it.id = i.typeFk
+ JOIN vn.itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN (
SELECT ish.itemFk, CAST(SUM(ish.visible) AS DECIMAL(10,0)) AS Fuentes
FROM vn.itemShelving ish
@@ -59325,7 +59325,7 @@ BEGIN
JOIN vn.parking p ON p.id = sh.parkingFk
JOIN vn.sector s ON s.id = p.sectorFk
WHERE s.code = 'FUENTES_PICASSE'
- GROUP BY ish.itemFk
+ GROUP BY ish.itemFk
) fue ON fue.itemFk = i.id
LEFT JOIN (
SELECT ish.itemFk, CAST(SUM(ish.visible) AS DECIMAL(10,0)) AS Albenfruit
@@ -59334,7 +59334,7 @@ BEGIN
JOIN vn.parking p ON p.id = sh.parkingFk
JOIN vn.sector s ON s.id = p.sectorFk
WHERE s.code = 'ALBENFRUIT'
- GROUP BY ish.itemFk
+ GROUP BY ish.itemFk
) alb ON alb.itemFk = i.id
LEFT JOIN cache.stock v ON i.id = v.item_id AND v.warehouse_id = vWarehouseFk
LEFT JOIN (
@@ -59359,9 +59359,9 @@ BEGIN
AND warehouse_id = vWarehouseFk
GROUP BY item_id
) mov ON mov.item_id = i.id
- WHERE (v.amount OR fue.Fuentes OR alb.Albenfruit)
+ WHERE (v.amount OR fue.Fuentes OR alb.Albenfruit)
AND i.itemPackingTypeFk = 'H'
- AND ic.shortLife
+ AND ic.shortLife
;
END ;;
@@ -59383,7 +59383,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemPlacementFromTicket`(vTicket INT)
BEGIN
/**
- * Llama a itemPlacementUpdateVisible
+ * Llama a itemPlacementUpdateVisible
* de los articulos de la tabla temporal tmp.itemPlacement(itemFk)
* @treturn tmp.itemPlacement
* @param vTicket Id del Ticket
@@ -59397,9 +59397,9 @@ BEGIN
FROM ticket t
JOIN sale s ON s.ticketFk = t.id
WHERE t.id = vTicket;
-
+
CALL itemPlacementUpdateVisible();
-
+
DROP TEMPORARY TABLE tmp.itemPlacement;
END ;;
DELIMITER ;
@@ -59432,7 +59432,7 @@ BEGIN
CAST(FLOOR(LEAST(ish.stock,quantity) / ish.packing) AS DECIMAL(10,0)),
' x ',
ish.packing,
- IF (
+ IF (
LEAST(ish.stock,quantity) MOD ish.packing,
CONCAT(' + ',CAST(LEAST(ish.stock,quantity) MOD ish.packing AS DECIMAL(10,0))),
''
@@ -59463,7 +59463,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemPlacementSupplyCloseOrder`(vId INT, vQuantity INT)
BEGIN
- UPDATE vn.itemPlacementSupply
+ UPDATE vn.itemPlacementSupply
SET priority = 10
WHERE id = vId;
@@ -59489,7 +59489,7 @@ BEGIN
DECLARE vId INT;
DECLARE vLastParkingFk INT;
DECLARE vNextParkingFk INT;
-
+
SELECT sh.parkingFk INTO vLastParkingFk
FROM vn.itemShelvingPlacementSupply isps
JOIN vn.itemShelving ish ON ish.id = isps.itemShelvingFk
@@ -59497,9 +59497,9 @@ BEGIN
WHERE isps.userFk = getUser()
ORDER BY isps.created DESC
LIMIT 1;
-
+
SET vNextParkingFk = vn.itemShelvingPlacementSupply_ClosestGet(vLastParkingFk);
-
+
SELECT ipsl.id INTO vId
FROM vn.itemPlacementSupplyList ipsl
JOIN vn.itemShelvingPlacementSupplyStock ispss ON ispss.itemFk = ipsl.itemFk
@@ -59508,13 +59508,13 @@ BEGIN
AND ipsl.sectorFk = vSector
ORDER BY ipsl.repoUserFk DESC, ipsl.priority DESC, (ispss.parkingFk = vNextParkingFk) DESC, ispss.parking DESC, ipsl.created
LIMIT 1;
-
+
UPDATE vn.itemPlacementSupply
SET repoUserFk = getUser()
WHERE id = vId;
-
- SELECT * FROM vn.itemPlacementSupplyList
- WHERE id = vId
+
+ SELECT * FROM vn.itemPlacementSupplyList
+ WHERE id = vId
AND sectorFk = vSector;
END ;;
@@ -59589,20 +59589,20 @@ BEGIN
* @param vItemFk item id
* @param vTicketFk ticket id
* @param vShowType mostrar tipos
- */
+ */
DECLARE vWarehouseFk INT;
DECLARE vShipped DATE;
DECLARE vCalcFk INT;
DECLARE vTypeFk INT;
-
-
+
+
DECLARE vTag1 VARCHAR(25);
DECLARE vTag5 VARCHAR(25);
DECLARE vTag6 VARCHAR(25);
DECLARE vTag7 VARCHAR(25);
DECLARE vTag8 VARCHAR(25);
-
+
DECLARE vValue1 VARCHAR(50);
DECLARE vValue5 VARCHAR(50);
DECLARE vValue6 VARCHAR(50);
@@ -59612,16 +59612,16 @@ BEGIN
SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped
FROM vn.ticket
WHERE id = vTicketFk;
-
+
SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value
INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1
FROM vn.item i
LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk
WHERE i.id = vItemFk;
-
+
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vShipped);
-
+
SELECT i.id itemFk,
i.longName,
i.subName,
@@ -59654,7 +59654,7 @@ BEGIN
ORDER BY counter DESC,
(t1.name = vTag1 COLLATE utf8_general_ci) DESC,
(it1.value = vValue1 COLLATE utf8_general_ci) DESC,
- (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC,
+ (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC,
(i.value6 = vValue6 COLLATE utf8_general_ci) DESC,
(i.tag5 = vTag5 COLLATE utf8_general_ci) DESC,
(i.value5 = vValue5 COLLATE utf8_general_ci) DESC,
@@ -59662,7 +59662,7 @@ BEGIN
(i.value7 = vValue7 COLLATE utf8_general_ci) DESC,
(i.tag8 = vTag8 COLLATE utf8_general_ci) DESC,
(i.value8 = vValue8 COLLATE utf8_general_ci) DESC;
-
+
END ;;
DELIMITER ;
@@ -59688,7 +59688,7 @@ BEGIN
* @param vSaleFk id de la tabla sale
* @param vMateFk articulo sustituto
* @ param vQuantity cantidad que se va a sustituir
- */
+ */
DECLARE vTicketFk INT;
DECLARE vItemFk INT;
DECLARE vWarehouseFk SMALLINT;
@@ -59697,41 +59697,41 @@ BEGIN
DECLARE vBox INT;
DECLARE vPacking INT;
DECLARE vRoundQuantity INT DEFAULT 1;
-
+
SELECT s.ticketFk, LEAST(s.quantity, vQuantity), s.itemFk,t.shipped,t.warehouseFk
INTO vTicketFk, vQuantity, vItemFk,vDate,vWarehouseFk
FROM vn.sale s
JOIN vn.ticket t ON t.id = s.ticketFk
WHERE s.id = vSaleFk;
-
+
UPDATE vn.sale
SET quantity = quantity - vQuantity
WHERE id = vSaleFk;
-
+
CALL vn.buyUltimate(vWarehouseFk, vDate);
-
+
SELECT `grouping`, groupingMode, packing
INTO vGrouping,vBox,vPacking
FROM buy b
JOIN tmp.buyUltimate tmp ON b.id = tmp.buyFk
WHERE tmp.itemFk = vMateFk AND tmp.WarehouseFk = vWarehouseFk;
-
+
IF vBox = 2 AND vPacking > 0 THEN
SET vRoundQuantity = vPacking;
END IF;
IF vBox = 1 AND vGrouping > 0 THEN
SET vRoundQuantity = vGrouping;
END IF;
-
+
INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept)
SELECT vTicketFk, vMateFk, CEIL(vQuantity / vRoundQuantity) * vRoundQuantity, CONCAT('+ ',i.longName)
FROM vn.item i
WHERE id = vMateFk;
-
+
SELECT LAST_INSERT_ID() INTO vSaleFk;
-
+
CALL vn.sale_calculateComponent(vSaleFk, NULL);
-
+
INSERT INTO vn.itemProposal(itemFk, mateFk, counter)
VALUES(vItemFk, vMateFk, 1)
ON DUPLICATE KEY UPDATE counter = counter + 1;
@@ -59760,13 +59760,13 @@ BEGIN
DECLARE vCalcFk INT;
DECLARE vTypeFk INT;
DECLARE vResultsMax INT DEFAULT 10;
-
+
DECLARE vTag1 VARCHAR(25);
DECLARE vTag5 VARCHAR(25);
DECLARE vTag6 VARCHAR(25);
DECLARE vTag7 VARCHAR(25);
DECLARE vTag8 VARCHAR(25);
-
+
DECLARE vValue1 VARCHAR(50);
DECLARE vValue5 VARCHAR(50);
DECLARE vValue6 VARCHAR(50);
@@ -59776,16 +59776,16 @@ BEGIN
SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped
FROM vn.ticket
WHERE id = vTicketFk;
-
+
SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value
INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1
- FROM vn.item i
+ FROM vn.item i
LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk
WHERE i.id = vItemFk;
-
+
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vShipped);
-
+
SELECT i.id itemFk,
i.longName,
i.subName,
@@ -59803,7 +59803,7 @@ BEGIN
(i.value8 <=> vValue8 COLLATE utf8_general_ci) match8,
a.available,
IFNULL(ip.counter,0) counter
- FROM vn.item i
+ FROM vn.item i
JOIN cache.available a ON a.item_id = i.id
LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id AND ip.itemFk = vItemFk
LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
@@ -59817,7 +59817,7 @@ BEGIN
(it1.value = vValue1 COLLATE utf8_general_ci) DESC,
(i.tag5 = vTag5 COLLATE utf8_general_ci) DESC,
(i.value5 = vValue5 COLLATE utf8_general_ci) DESC,
- (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC,
+ (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC,
(i.value6 = vValue6 COLLATE utf8_general_ci) DESC,
(i.tag7 = vTag7 COLLATE utf8_general_ci) DESC,
(i.value7 = vValue7 COLLATE utf8_general_ci) DESC,
@@ -59853,7 +59853,7 @@ BEGIN
CREATE TEMPORARY TABLE tmp.item
SELECT vItem id;
-
+
CALL item_refreshTags();
DROP TEMPORARY TABLE tmp.item;
@@ -59876,23 +59876,23 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemSale_byWeek`(vWeek INT, IN vYear INT, vItemFk INT, vWarehouseFk INT)
BEGIN
-
+
DECLARE vStarted DATE;
DECLARE vEnded DATETIME;
SELECT MIN(dated), util.dayEnd(MAX(dated)) INTO vStarted, vEnded
- FROM `time` t
+ FROM `time` t
WHERE CONCAT(vYear, LPAD(vWeek, 2, 0)) = t.period;
SELECT t.shipped,
w.name warehouse,
- s.ticketFk,
+ s.ticketFk,
t.nickname client,
- am.name agencyName,
+ am.name agencyName,
wk.code salesPerson,
s.itemFk,
- IFNULL(CONCAT(ig.longName,' ',ig.`size`,' ',ig.subName), s.concept) AS concept,
- s.quantity,
+ IFNULL(CONCAT(ig.longName,' ',ig.`size`,' ',ig.subName), s.concept) AS concept,
+ s.quantity,
s.price,
s.priceFixed,
s.discount,
@@ -59902,15 +59902,15 @@ BEGIN
wk.id salesPersonFk
FROM sale s
JOIN ticket t ON t.id = s.ticketFk
- JOIN warehouse w ON w.id = t.warehouseFk
+ JOIN warehouse w ON w.id = t.warehouseFk
JOIN address a ON a.id = t.addressFk
LEFT JOIN agencyMode am ON am.id = t.agencyModeFk
JOIN `client` c ON c.id = a.clientFk
- LEFT JOIN worker wk ON wk.id = c.salesPersonFk
+ LEFT JOIN worker wk ON wk.id = c.salesPersonFk
LEFT JOIN ticketLastState tls ON tls.ticketFk = t.id
- LEFT JOIN saleBuy sb ON sb.saleFk = s.id
- LEFT JOIN buy b ON b.id = sb.buyFk
- LEFT JOIN item ig ON ig.id = b.itemOriginalFk
+ LEFT JOIN saleBuy sb ON sb.saleFk = s.id
+ LEFT JOIN buy b ON b.id = sb.buyFk
+ LEFT JOIN item ig ON ig.id = b.itemOriginalFk
WHERE s.itemFk = vItemFk
AND t.shipped BETWEEN vStarted AND vEnded
AND IF(vWarehouseFk = 0, w.hasComission , t.warehouseFk = vWarehouseFk)
@@ -59937,9 +59937,9 @@ BEGIN
DECLARE vItemFk INT;
SELECT vn.barcodeToItem(vBarcode) INTO vItemFk;
-
+
UPDATE vn.item SET minimum = min WHERE id = vItemFk;
-
+
END ;;
@@ -59961,8 +59961,8 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemSearchShelving`(`vShelvingFk` VARCHAR(3))
BEGIN
SELECT p.`column` AS col , p.`row`
- FROM vn.shelving s
- JOIN parking p ON s.parkingFk = p.id
+ FROM vn.shelving s
+ JOIN parking p ON s.parkingFk = p.id
WHERE s.`code` = vShelvingFk COLLATE utf8_general_ci;
END ;;
DELIMITER ;
@@ -60003,36 +60003,36 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingLog_get`(vShelvingFk VARCHAR(10) )
BEGIN
-
+
/**
* Devuelve el log de los item en cada carro
*
- * @param vShelvingFk Matrícula del carro
- *
+ * @param vShelvingFk Matrícula del carro
+ *
*/
-
- SELECT isl.itemShelvingFk,
- isl.created,
- isl.accion,
- isl.itemFk,
- isl.shelvingFk,
- isl.quantity,
+
+ SELECT isl.itemShelvingFk,
+ isl.created,
+ isl.accion,
+ isl.itemFk,
+ isl.shelvingFk,
+ isl.quantity,
isl.visible,
- isl.available,
- isl.grouping,
- isl.packing,
- isl.stars,
- item.longName,
- item.size,
- item.subName,
- worker.code,
+ isl.available,
+ isl.grouping,
+ isl.packing,
+ isl.stars,
+ item.longName,
+ item.size,
+ item.subName,
+ worker.code,
isl.accion
- FROM item
- JOIN itemShelvingLog isl ON item.id = isl.itemFk
+ FROM item
+ JOIN itemShelvingLog isl ON item.id = isl.itemFk
JOIN worker ON isl.workerFk = worker.id
WHERE shelvingFk = vShelvingFk OR isl.itemFk = vShelvingFk
ORDER BY isl.created DESC;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -60051,7 +60051,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingMakeFromDate`(IN `vShelvingFk` VARCHAR(8), IN `vBarcode` VARCHAR(22), IN `vQuantity` INT, IN `vPackagingFk` VARCHAR(10), IN `vGrouping` INT, IN `vPacking` INT, IN `vWarehouseFk` INT, `vCreated` VARCHAR(22))
BEGIN
-
+
DECLARE vItemFk INT;
SELECT vn.barcodeToItem(vBarcode) INTO vItemFk;
@@ -60070,9 +60070,9 @@ BEGIN
END IF;
- IF (SELECT COUNT(*) FROM vn.itemShelving
- WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk
- AND itemFk = vItemFk
+ IF (SELECT COUNT(*) FROM vn.itemShelving
+ WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk
+ AND itemFk = vItemFk
AND packing = vPacking) = 1 THEN
UPDATE vn.itemShelving
@@ -60102,8 +60102,8 @@ BEGIN
LEFT JOIN cache.last_buy lb ON i.id = lb.item_id AND lb.warehouse_id = vWarehouseFk
LEFT JOIN vn.buy b ON b.id = lb.buy_id
WHERE i.id = vItemFk;
- END IF;
-
+ END IF;
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -60124,9 +60124,9 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingMatch`(vEntryFk INT, vA
BEGIN
DECLARE vTravelFk INT;
-
- SELECT travelFk INTO vTravelFk
- FROM entry
+
+ SELECT travelFk INTO vTravelFk
+ FROM entry
WHERE id = vEntryFk;
SELECT i.id, i.longName, i.size, i.subName, b.stickers, ish.etiquetas, b.printed
@@ -60139,7 +60139,7 @@ BEGIN
GROUP BY itemFk
) b ON b.itemFk = i.id
LEFT JOIN (
- SELECT itemFk, sum(cast(visible / packing AS DECIMAL(10,0))) AS etiquetas
+ SELECT itemFk, sum(cast(visible / packing AS DECIMAL(10,0))) AS etiquetas
FROM itemShelving ish
JOIN shelving sh ON sh.code = ish.shelvingFk
LEFT JOIN parking pk ON pk.id = sh.parkingFk
@@ -60179,7 +60179,7 @@ BEGIN
UPDATE vn.itemShelving
SET visible = visible - vQuantity
WHERE id = vItemShelvingFk;
-
+
END ;;
DELIMITER ;
@@ -60202,47 +60202,47 @@ BEGIN
DECLARE vVisibleCache INT;
DECLARE vWarehouseFk INT;
-
+
SELECT warehouseFk INTO vWarehouseFk
FROM vn.sector
WHERE id = vSectorFk;
CALL cache.visible_refresh (vVisibleCache, FALSE, vWarehouseFk);
-
- SELECT t.id as ticketFk,
- CAST(s.quantity AS DECIMAL(10,0)) as Cantidad,
- s.itemFk,
- s.concept,
- v.visible - GREATEST(0,iss.visible) + IFNULL(sub3.transit,0) as Nicho,
+
+ SELECT t.id as ticketFk,
+ CAST(s.quantity AS DECIMAL(10,0)) as Cantidad,
+ s.itemFk,
+ s.concept,
+ v.visible - GREATEST(0,iss.visible) + IFNULL(sub3.transit,0) as Nicho,
i.subName,
- GREATEST(0,iss.visible - IFNULL(sub3.transit,0)) as Altillo,
+ GREATEST(0,iss.visible - IFNULL(sub3.transit,0)) as Altillo,
s.id as saleFk,
IFNULL(sub3.transit,0) transit,
v.visible, s.isPicked, s.reserved, t.shipped, tst.productionOrder, mm.Id_Movimiento
- FROM vn.ticket t
+ FROM vn.ticket t
JOIN vn.ticketState tst ON tst.ticketFk = t.id
JOIN vn.sale s ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk
JOIN cache.visible v ON s.itemFk = v.item_id AND v.calc_id = vVisibleCache
LEFT JOIN vn2008.Movimientos_mark mm ON mm.Id_Movimiento = s.id AND mm.stateFk = 26
- JOIN vn.itemShelvingStock iss ON iss.itemFk = v.item_id
+ JOIN vn.itemShelvingStock iss ON iss.itemFk = v.item_id
LEFT JOIN
- (SELECT itemFk, sum(saldo) as transit
- FROM vn.itemPlacementSupplyList
- WHERE saldo > 0
+ (SELECT itemFk, sum(saldo) as transit
+ FROM vn.itemPlacementSupplyList
+ WHERE saldo > 0
AND sectorFk = vSectorFk
GROUP BY itemFk) sub3 ON sub3.itemFk = i.id
- WHERE v.visible + IFNULL(sub3.transit,0) - GREATEST(0,iss.visible) < s.quantity
+ WHERE v.visible + IFNULL(sub3.transit,0) - GREATEST(0,iss.visible) < s.quantity
AND IFNULL(sub3.transit,0) < s.quantity
- AND s.isPicked = FALSE
+ AND s.isPicked = FALSE
AND s.reserved = FALSE
- AND t.shipped BETWEEN util.VN_CURDATE() AND MIDNIGHT(util.VN_CURDATE())
+ AND t.shipped BETWEEN util.VN_CURDATE() AND MIDNIGHT(util.VN_CURDATE())
AND tst.isPreviousPreparable = TRUE
AND t.warehouseFk = vWarehouseFk
AND iss.sectorFk = vSectorFk
AND mm.Id_Movimiento IS NULL
ORDER BY itemFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -60261,7 +60261,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingRadar`(vSectorFk INT)
proc:BEGIN
-
+
DECLARE vCalcVisibleFk INT;
DECLARE vCalcAvailableFk INT;
DECLARE hasFatherSector BOOLEAN;
@@ -60269,17 +60269,17 @@ proc:BEGIN
DECLARE vWarehouseFk INT DEFAULT 0;
DECLARE vSonSectorFk INT;
DECLARE vWorkerFk INT;
-
- SELECT s.workerFk
- INTO vWorkerFk
+
+ SELECT s.workerFk
+ INTO vWorkerFk
FROM vn.sector s
WHERE s.id = vSectorFk;
SELECT w.id, s.warehouseFk INTO vBuyerFk, vWarehouseFk
- FROM vn.worker w
+ FROM vn.worker w
JOIN vn.sector s ON s.code = w.code
WHERE s.id = vSectorFk;
-
+
SELECT s.id INTO vSectorFk
FROM vn.sector s
WHERE s.warehouseFk = vWarehouseFk
@@ -60289,21 +60289,21 @@ proc:BEGIN
SELECT COUNT(*) INTO hasFatherSector
FROM vn.sector
WHERE sonFk = vSectorFk;
-
+
SELECT warehouseFk, sonFk INTO vWarehouseFk, vSonSectorFk
FROM vn.sector
WHERE id = vSectorFk;
-
+
CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk);
CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE());
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingRadar;
-
+
IF hasFatherSector THEN
CREATE TEMPORARY TABLE tmp.itemShelvingRadar
(PRIMARY KEY (itemFk))
- ENGINE = MEMORY
+ ENGINE = MEMORY
SELECT * FROM (
SELECT iss.itemFk,
i.longName,
@@ -60314,7 +60314,7 @@ proc:BEGIN
SUM(IF(iss.sectorFk = vSectorFk, IFNULL(iss.visible,0), 0)) downstairs,
IF(it.isPackaging, null, IFNULL(v.visible,0)) as visible,
vSectorFk as sectorFk
-
+
FROM vn.itemShelvingStock iss
JOIN vn.sector s ON s.id = iss.sectorFk
JOIN vn.item i on i.id = iss.itemFk
@@ -60323,11 +60323,11 @@ proc:BEGIN
LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk
WHERE vSectorFk IN (iss.sectorFk, s.sonFk)
AND it.workerFk != 3366
-
+
GROUP BY iss.itemFk
-
+
UNION ALL
-
+
SELECT v.item_id,
i.longName,
i.size,
@@ -60337,7 +60337,7 @@ proc:BEGIN
0 downstairs,
IF(it.isPackaging, NULL, v.visible) visible,
vSectorFk as sectorFk
- FROM cache.visible v
+ FROM cache.visible v
JOIN vn.item i on i.id = v.item_id
JOIN vn.itemType it ON it.id = i.typeFk AND vBuyerFk IN (0,it.workerFk)
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = v.item_id AND iss.warehouseFk = vWarehouseFk
@@ -60346,8 +60346,8 @@ proc:BEGIN
AND iss.itemFk IS NULL
AND it.isInventory
) sub GROUP BY itemFk;
-
- SELECT ishr.*,
+
+ SELECT ishr.*,
CAST(visible - upstairs - downstairs AS DECIMAL(10,0)) AS nicho,
CAST(downstairs - IFNULL(notPickedYed,0) AS DECIMAL(10,0)) as pendiente
FROM tmp.itemShelvingRadar ishr
@@ -60362,13 +60362,13 @@ proc:BEGIN
) sub ON sub.itemFk = ishr.itemFk
ORDER BY i.typeFk, i.longName
;
-
-
+
+
ELSE
-
+
CREATE TEMPORARY TABLE tmp.itemShelvingRadar
(PRIMARY KEY (itemFk))
- ENGINE = MEMORY
+ ENGINE = MEMORY
SELECT iss.itemFk,
0 `hour`,
0 `minute`,
@@ -60380,7 +60380,7 @@ proc:BEGIN
IFNULL(a.available,0) available,
IFNULL(v.visible - iss.visible,0) dayEndVisible,
IFNULL(v.visible - iss.visible,0) firstNegative,
- IFNULL(v.visible - iss.visible,0) itemPlacementVisible,
+ IFNULL(v.visible - iss.visible,0) itemPlacementVisible,
IFNULL(i.minimum * b.packing,0) itemPlacementSize,
ips.onTheWay,
iss.visible itemShelvingStock,
@@ -60394,13 +60394,13 @@ proc:BEGIN
LEFT JOIN cache.available a ON a.item_id = iss.itemFk AND a.calc_id = vCalcAvailableFk
LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk
LEFT JOIN (SELECT itemFk, sum(saldo) as onTheWay
- FROM vn.itemPlacementSupplyList
- WHERE saldo > 0
+ FROM vn.itemPlacementSupplyList
+ WHERE saldo > 0
GROUP BY itemFk
) ips ON ips.itemFk = i.id
- WHERE IFNULL(iss.sectorFk,0) IN (0, vSectorFk)
- OR iss.sectorFk = vSectorFk;
- /*
+ WHERE IFNULL(iss.sectorFk,0) IN (0, vSectorFk)
+ OR iss.sectorFk = vSectorFk;
+ /*
UPDATE tmp.itemShelvingRadar isr
JOIN vn.itemShelvingStock iss ON iss.itemFk = isr.itemFk
SET isr.dayEndVisible = isr.dayEndVisible + iss.visible,
@@ -60411,10 +60411,10 @@ proc:BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.itemOutTime;
CREATE TEMPORARY TABLE tmp.itemOutTime
SELECT *,SUM(amount) quantity
- FROM
+ FROM
(SELECT item_id itemFk,
- amount,
- IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) as hours,
+ amount,
+ IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) as hours,
IF(MINUTE(t.shipped), MINUTE(t.shipped), MINUTE(z.`hour`)) as minutes
FROM vn2008.item_out io
JOIN tmp.itemShelvingRadar isr ON isr.itemFk = io.item_id
@@ -60422,23 +60422,23 @@ proc:BEGIN
JOIN vn.ticketState ts on ts.ticketFk = io.ticketFk
JOIN vn.state s ON s.id = ts.stateFk
LEFT JOIN vn.zone z ON z.id = t.zoneFk
- LEFT JOIN (SELECT DISTINCT saleFk
- FROM vn.saleTracking st
- WHERE st.created > util.VN_CURDATE()
+ LEFT JOIN (SELECT DISTINCT saleFk
+ FROM vn.saleTracking st
+ WHERE st.created > util.VN_CURDATE()
AND st.isChecked
) stPrevious ON `stPrevious`.`saleFk` = io.saleFk
WHERE t.warehouseFk = vWarehouseFk
- AND s.isPicked = 0
- AND NOT io.Reservado
+ AND s.isPicked = 0
+ AND NOT io.Reservado
AND stPrevious.saleFk IS NULL
- AND io.dat >= util.VN_CURDATE()
+ AND io.dat >= util.VN_CURDATE()
AND io.dat < util.VN_CURDATE() + INTERVAL 1 DAY
) sub
GROUP BY itemFk, hours, minutes;
-
+
INSERT INTO tmp.itemShelvingRadar (itemFk)
SELECT itemFk FROM tmp.itemOutTime
- ON DUPLICATE KEY UPDATE dayEndVisible = dayEndVisible + quantity,
+ ON DUPLICATE KEY UPDATE dayEndVisible = dayEndVisible + quantity,
firstNegative = if (firstNegative < 0, firstNegative, firstNegative + quantity),
`hour` = ifnull(if (firstNegative > 0 , `hour`, hours),0),
`minute` = ifnull(if (firstNegative > 0, `minute`, minutes),0);
@@ -60454,7 +60454,7 @@ proc:BEGIN
END IF;
DROP TEMPORARY TABLE tmp.itemShelvingRadar;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -60478,24 +60478,24 @@ BEGIN
DECLARE vCalcVisibleFk INT;
DECLARE vCalcAvailableFk INT;
DECLARE vTodayDayEnd DATETIME DEFAULT util.dayEnd(util.VN_CURDATE());
-
+
CALL cache.visible_refresh(vCalcVisibleFk, FALSE, 1);
CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE());
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.item;
CREATE TEMPORARY TABLE tmp.item
ENGINE = MEMORY
SELECT DISTINCT itemFk
- FROM vn.buy
+ FROM vn.buy
WHERE entryFk = vEntryFk;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.item2;
CREATE TEMPORARY TABLE tmp.item2
ENGINE = MEMORY
SELECT *
FROM tmp.item;
-
- SELECT i.id as itemFk,
+
+ SELECT i.id as itemFk,
i.minimum,
CAST(IFNULL(v.visible,0) - IFNULL(iss.visible,0) AS DECIMAL(10,0)) as enNicho,
CAST(IFNULL(a.available,0) AS DECIMAL(10,0)) as disponible,
@@ -60515,11 +60515,11 @@ BEGIN
AND IFNULL(tst.productionOrder,0) < 5
GROUP BY s.itemFK
) ts ON ts.itemFk = i.id;
-
-
+
+
DROP TEMPORARY TABLE tmp.item;
DROP TEMPORARY TABLE tmp.item2;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -60543,34 +60543,34 @@ BEGIN
DECLARE vCalcVisibleFk INT;
DECLARE vCalcAvailableFk INT;
DECLARE vTodayDayEnd DATETIME DEFAULT util.dayEnd(util.VN_CURDATE());
-
+
CALL cache.visible_refresh(vCalcVisibleFk, FALSE, 1);
CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE());
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.item;
CREATE TEMPORARY TABLE tmp.item
ENGINE = MEMORY
SELECT DISTINCT itemFk
- FROM vn.buy
+ FROM vn.buy
WHERE entryFk = vEntryFk;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.item2;
CREATE TEMPORARY TABLE tmp.item2
ENGINE = MEMORY
SELECT *
FROM tmp.item;
-
- SELECT i.id as itemFk,
+
+ SELECT i.id as itemFk,
CAST(IFNULL(iss.visible,0) - IFNULL(v.visible,0) AS DECIMAL(10,0)) as outShelving
FROM vn.item i
JOIN tmp.item ti ON ti.itemFk = i.id
LEFT JOIN cache.visible v ON v.calc_id = vCalcVisibleFk AND v.item_id = i.id
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id;
-
-
+
+
DROP TEMPORARY TABLE tmp.item;
DROP TEMPORARY TABLE tmp.item2;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -60591,10 +60591,10 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingSale_Add`(vItemShelving
BEGIN
/**
* Añade línea a itemShelvingSale y regulariza el carro
- *
+ *
* @param vItemShelvingFk Id itemShelving
* @param vSaleFk Id de sale
- * @param vQuantity cantidad a regularizar
+ * @param vQuantity cantidad a regularizar
*/
INSERT INTO itemShelvingSale(itemShelvingFk,
saleFk,
@@ -60689,7 +60689,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_add`(IN vShelvingFk VARCHAR(8), IN vBarcode VARCHAR(22), IN vQuantity INT, IN vPackagingFk VARCHAR(10), IN vGrouping INT, IN vPacking INT, IN vWarehouseFk INT)
BEGIN
-
+
/**
* Añade registro o lo actualiza si ya existe.
@@ -60701,7 +60701,7 @@ BEGIN
* @param vGrouping el grouping del producto en itemShelving, NULL para coger el de la ultima compra
* @param vPacking el packing del producto, NULL para coger el de la ultima compra
* @param vWarehouseFk indica el sector
- *
+ *
**/
DECLARE vItemFk INT;
@@ -60711,21 +60711,21 @@ BEGIN
IF (SELECT COUNT(*) FROM shelving WHERE code = vShelvingFk COLLATE utf8_unicode_ci) = 0 THEN
INSERT IGNORE INTO parking(code) VALUES(vShelvingFk);
- INSERT INTO shelving(code, parkingFk)
+ INSERT INTO shelving(code, parkingFk)
SELECT vShelvingFk, id
- FROM parking
+ FROM parking
WHERE `code` = vShelvingFk COLLATE utf8_unicode_ci;
END IF;
- IF (SELECT COUNT(*) FROM itemShelving
- WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk
- AND itemFk = vItemFk
+ IF (SELECT COUNT(*) FROM itemShelving
+ WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk
+ AND itemFk = vItemFk
AND packing = vPacking) = 1 THEN
UPDATE itemShelving
SET visible = visible+vQuantity
- WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk AND itemFk = vItemFk AND packing = vPacking;
+ WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk AND itemFk = vItemFk AND packing = vPacking;
ELSE
CALL cache.last_buy_refresh(FALSE);
@@ -60870,7 +60870,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_BuyerGet`( )
BEGIN
SELECT * FROM vn.buyer;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -60897,10 +60897,10 @@ proc:BEGIN
* @return Lista de articulos
*/
DECLARE vCalcVisibleFk INT;
-
+
CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk);
- SELECT * FROM
+ SELECT * FROM
(SELECT sub.itemFk,
sub.longName,
CONCAT('Hoy saldrán ', CAST(sub2.pendiente AS DECIMAL(10,0)), ' unidades.') `size`,
@@ -60917,28 +60917,28 @@ proc:BEGIN
0 upstairs,
SUM(IFNULL(iss.visible,0)) downstairs,
IF(it.isPackaging, null, IFNULL(v.visible, 0)) visible,
- ik.name
+ ik.name
FROM itemShelvingStock iss
JOIN sector s ON s.id = iss.sectorFk
JOIN item i on i.id = iss.itemFk
- LEFT JOIN ink ik ON ik.id = i.inkFk
+ LEFT JOIN ink ik ON ik.id = i.inkFk
JOIN itemType it ON it.id = i.typeFk
LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk
WHERE s.warehouseFk = vWarehouseFk
AND it.workerFk = vBuyerFk
- GROUP BY itemFk
+ GROUP BY itemFk
) sub LEFT JOIN (SELECT s.itemFk, SUM(s.quantity) pendiente
FROM sale s
LEFT JOIN saleTracking st ON st.saleFk = s.id
- JOIN ticket t ON t.id = s.ticketFk
+ JOIN ticket t ON t.id = s.ticketFk
JOIN client c on c.id = t.clientFk
JOIN clientType ct ON ct.id = c.clientTypeFk
WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
AND st.saleFk IS NULL
AND ct.code IN ('normal', 'trust')
GROUP BY s.itemFk
- ) sub2 ON sub2.itemFk = sub.itemFk
- UNION ALL
+ ) sub2 ON sub2.itemFk = sub.itemFk
+ UNION ALL
SELECT v.item_id ,
i.longName,
CONCAT('Hoy saldrán ', CAST(sub5.pendiente AS DECIMAL(10,0)), ' unidades.') `size`,
@@ -60956,7 +60956,7 @@ proc:BEGIN
LEFT JOIN (SELECT s.itemFk, SUM(s.quantity) pendiente
FROM sale s
LEFT JOIN saleTracking st ON st.saleFk = s.id
- JOIN ticket t ON t.id = s.ticketFk
+ JOIN ticket t ON t.id = s.ticketFk
JOIN client c on c.id = t.clientFk
JOIN clientType ct ON ct.id = c.clientTypeFk
WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
@@ -60989,12 +60989,12 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_get`(IN vSelf VARCHAR(8))
BEGIN
/**
-* Lista artículos de itemshelving
+* Lista artículos de itemshelving
*
* @param vSelf matrícula del carro
**/
- SELECT ish.itemFk item,
- IFNULL(i.longName, CONCAT(i.name, ' ', i.size)) description,
+ SELECT ish.itemFk item,
+ IFNULL(i.longName, CONCAT(i.name, ' ', i.size)) description,
ish.visible,
CEIL(ish.visible/ish.packing) stickers,
ish.packing,
@@ -61032,7 +61032,7 @@ BEGIN
*
* @param vShelvingFk matricula del carro
*/
- SELECT is2.id,is2.shelvingFk , p.code, is2.itemFk , is2.visible, p.pickingOrder
+ SELECT is2.id,is2.shelvingFk , p.code, is2.itemFk , is2.visible, p.pickingOrder
FROM itemShelving is2
JOIN shelving sh ON sh.code = is2.shelvingFk
JOIN parking p ON p.id = sh.parkingFk
@@ -61098,35 +61098,35 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_getSaleDate`(vShelvingFk VARCHAR(3))
BEGIN
-
+
/* Devuelve la minima fecha en que se necesita cada producto en esa matricula.
- *
+ *
* @param vShelvingFk Matrícula del carro o pallet
*/
-
+
DECLARE vWarehouseFk INT;
SELECT warehouseFk INTO vWarehouseFk
FROM shelving s
- JOIN parking p ON s.parkingFk = p.id
+ JOIN parking p ON s.parkingFk = p.id
JOIN sector st ON st.id = p.sectorFk
WHERE s.code = vShelvingFk COLLATE utf8_unicode_ci;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingDistinct;
CREATE TEMPORARY TABLE tmp.itemShelvingDistinct
(PRIMARY KEY (itemFk))
ENGINE = MEMORY
SELECT itemFk, SUM(visible) visible
- FROM vn.itemShelving
+ FROM vn.itemShelving
WHERE shelvingFk = vShelvingFk COLLATE utf8_unicode_ci
- GROUP BY itemFk;
-
+ GROUP BY itemFk;
+
DROP TEMPORARY TABLE IF EXISTS tmp.item;
CREATE TEMPORARY TABLE tmp.item
(PRIMARY KEY (itemFk))
ENGINE = MEMORY
SELECT * FROM tmp.itemShelvingDistinct;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.stockByDay;
CREATE TEMPORARY TABLE tmp.stockByDay
(index (itemFk, dated))
@@ -61137,16 +61137,16 @@ BEGIN
FROM (
SELECT * FROM (
SELECT t2.* FROM (
- SELECT item_id itemFk, amount, util.VN_CURDATE() dated
- FROM cache.stock
+ SELECT item_id itemFk, amount, util.VN_CURDATE() dated
+ FROM cache.stock
WHERE warehouse_id = vWarehouseFk
UNION ALL
SELECT ish.itemFk, - sum(visible), util.VN_CURDATE()
- FROM vn.itemShelving ish
- JOIN shelving sh ON sh.code = ish.shelvingFk
- JOIN parking p ON sh.parkingFk = p.id
+ FROM vn.itemShelving ish
+ JOIN shelving sh ON sh.code = ish.shelvingFk
+ JOIN parking p ON sh.parkingFk = p.id
JOIN sector s ON s.id = p.sectorFk
- WHERE s.isReserve
+ WHERE s.isReserve
GROUP BY ish.itemFk
UNION ALL
SELECT item_id, sum(iei.amount), dat
@@ -61155,9 +61155,9 @@ BEGIN
AND warehouse_id = vWarehouseFk
AND isVirtualStock = FALSE
GROUP BY item_id, dat
- UNION ALL
+ UNION ALL
SELECT item_id, sum(ieo.amount), dat
- FROM vn2008.item_entry_out ieo
+ FROM vn2008.item_entry_out ieo
WHERE dat >= util.VN_CURDATE()
AND warehouse_id = vWarehouseFk
GROUP BY item_id, dat
@@ -61168,11 +61168,11 @@ BEGIN
WHERE io.dat >= util.VN_CURDATE()
AND io.warehouse_id = vWarehouseFk
GROUP BY io.item_id, io.dat
- ) t2
+ ) t2
JOIN tmp.itemShelvingDistinct ish ON ish.itemFk = t2.itemFk) t
order by t.itemFk, DATE(t.dated), t.amount DESC) t3;
-
- SELECT sbd.itemFk, i.longName, DATE(dated) dated, ish.visible amount, sbd.stock
+
+ SELECT sbd.itemFk, i.longName, DATE(dated) dated, ish.visible amount, sbd.stock
FROM tmp.stockByDay sbd
JOIN vn.item i ON i.id = sbd.itemFk
JOIN tmp.itemShelvingDistinct ish ON ish.itemFk = sbd.itemFk
@@ -61275,15 +61275,15 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_selfConsumption`(
- vShelvingFk VARCHAR(10) COLLATE utf8_general_ci,
- vItemFk INT,
+ vShelvingFk VARCHAR(10) COLLATE utf8_general_ci,
+ vItemFk INT,
vQuantity INT
)
-BEGIN
+BEGIN
/**
- * Leave the indicated amount on the shelf
+ * Leave the indicated amount on the shelf
* and create a ticket with the difference.
- *
+ *
* @param vShelvingFk id of the shelf where the item is located.
* @param vItemFk article of which the self-consumption ticket is to be created.
* @param vQuantity amount that will stay on the shelf
@@ -61327,10 +61327,10 @@ BEGIN
END IF;
SELECT SUM(visible), id INTO vVisible, vItemShelvingFk
- FROM itemShelving
+ FROM itemShelving
WHERE shelvingFk = vShelvingFk
AND itemFk = vItemFk;
-
+
IF vVisible IS NULL THEN
CALL util.throw('The item is not on the shelf.');
END IF;
@@ -61383,9 +61383,9 @@ BEGIN
* @param vGrouping el grouping del producto en itemShelving
*/
UPDATE itemShelving
- SET visible = vVisible,
- packing = vPacking,
- grouping = vGrouping
+ SET visible = vVisible,
+ packing = vPacking,
+ grouping = vGrouping
WHERE id = vShelf;
END ;;
@@ -61407,7 +61407,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTagMake`(vItemFk INT)
BEGIN
-/* * Crea los tags usando la tabla plantilla itemTag
+/* * Crea los tags usando la tabla plantilla itemTag
* y si no existe a partir de la ficha del artículo.
* @param vItemFk El item al que se le añaden los tags
*/
@@ -61417,33 +61417,33 @@ BEGIN
DECLARE vProducer VARCHAR(50);
DECLARE vOrigin VARCHAR(20);
DECLARE vTypeFk INTEGER;
-
- DELETE FROM itemTag
+
+ DELETE FROM itemTag
WHERE itemFk = vItemFk;
-
- SELECT typeFk INTO vTypeFk
+
+ SELECT typeFk INTO vTypeFk
FROM item
WHERE id = vItemFk;
-
+
INSERT INTO itemTag(itemFk, tagFk, value, priority)
SELECT vItemFk, itt.tagFk, NULL, itt.priority
FROM itemTag it
LEFT JOIN itemTypeTag itt ON itt.itemTypeFk = vTypeFk
WHERE it.itemFk = vItemFk;
-
+
IF (SELECT COUNT(*) FROM itemTag WHERE itemFk = vItemFk LIMIT 1) = 0 THEN
- SELECT ik.name, i.size, i.category, p.name, o.name
+ SELECT ik.name, i.size, i.category, p.name, o.name
INTO vInk, vSize, vCategory, vProducer, vOrigin
FROM item i
LEFT JOIN ink ik ON ik.id = i.inkFk
LEFT JOIN producer p ON p.id = i.producerFk AND p.isVisible
LEFT JOIN origin o ON o.id = i.originFk
WHERE i.id = vItemFk;
-
+
INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority)
VALUES(vItemFk, 1, vInk, 1);
-
+
INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority)
VALUES (vItemFk, 8, vSize, 2);
@@ -61452,11 +61452,11 @@ BEGIN
INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority)
VALUES(vItemFk, 37, vProducer, 4);
-
+
INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority)
VALUES(vItemFk, 35, vOrigin, 5);
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -61477,12 +61477,12 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTagReorder`(itemTypeFk INT)
BEGIN
SET @isTriggerDisabled = TRUE;
-
+
-- No se puede usar temporary porque da error Error Code: 1137. No puedo reabrir tabla: 'i
DROP TABLE IF EXISTS tmp.item;
CREATE TABLE tmp.item
SELECT DISTINCT i.id
- FROM vn.item i
+ FROM vn.item i
WHERE i.typeFk = itemTypeFk;
UPDATE itemTag it
@@ -61491,8 +61491,8 @@ BEGIN
JOIN itemTypeTag itt ON itt.itemTypeFk = item.typeFk AND itt.tagFk = it.tagFk
SET it.priority = itt.priority
WHERE itt.itemTypeFk = itemTypeFk;
-
- CALL item_refreshTags();
+
+ CALL item_refreshTags();
SET @isTriggerDisabled = FALSE;
@@ -61517,12 +61517,12 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTagReorderByName`(vName VARCHAR
BEGIN
SET @isTriggerDisabled = TRUE;
-
+
-- No se puede usar temporary porque da error Error Code: 1137. No puedo reabrir tabla: 'i
DROP TABLE IF EXISTS tmp.item;
CREATE TABLE tmp.item
SELECT DISTINCT i.id
- FROM vn.item i
+ FROM vn.item i
WHERE i.`name` LIKE CONCAT(vName,'%');
UPDATE itemTag it
@@ -61531,8 +61531,8 @@ BEGIN
JOIN itemTypeTag itt ON itt.itemTypeFk = item.typeFk AND itt.tagFk = it.tagFk
SET it.priority = itt.priority
WHERE itt.itemTypeFk = itemTypeFk;
-
- CALL item_refreshTags();
+
+ CALL item_refreshTags();
SET @isTriggerDisabled = FALSE;
@@ -61555,36 +61555,36 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTag_replace`(vItemFromFk INT, vItemToFk INT, vPicture VARCHAR(100))
BEGIN
-
+
/* Reemplaza los tags de un artículo por los de otro, así como su imagen
- *
+ *
* @param vItemFromFk id de vn.item con el artículo del que se toman los tags
* @param vItemToFk id de vn.item con el artículo del que se toman los tags
* @param vPicture imagen del artículo. Opcional. Si no se especifica, hereada la del vItemFromFk
*/
- DELETE FROM vn.itemTag
+ DELETE FROM vn.itemTag
WHERE itemFk = vItemToFk;
-
+
INSERT INTO vn.itemTag(itemFk, tagFk, value, priority)
SELECT vItemToFk, tagFk, value, priority
- FROM vn.itemTag
+ FROM vn.itemTag
WHERE itemFk = vItemFromFk;
-
+
IF ISNULL(vPicture) THEN
-
- SELECT image INTO vPicture
- FROM vn.item
+
+ SELECT image INTO vPicture
+ FROM vn.item
WHERE id = vItemFromFk;
-
+
END IF;
- UPDATE vn.item i
+ UPDATE vn.item i
SET i.image = vPicture
WHERE i.id = vItemToFk;
-
+
CALL vn.itemRefreshTags(vItemToFk);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -61609,9 +61609,9 @@ BEGIN
SELECT DISTINCT id
FROM vn.itemCategory
WHERE merchandise <> FALSE;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
- DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN
RESIGNAL;
END;
@@ -61622,45 +61622,45 @@ BEGIN
INNER JOIN bs.ventas v ON v.Id_Movimiento = s.id
WHERE v.fecha BETWEEN TIMESTAMPADD(DAY, - 7, util.VN_CURDATE()) AND util.VN_CURDATE()
GROUP BY s.itemFk;
-
+
DROP TABLE IF EXISTS tmp.topSeller;
- CREATE TEMPORARY TABLE tmp.topSeller
- (
+ CREATE TEMPORARY TABLE tmp.topSeller
+ (
`id` int(11) NOT NULL DEFAULT '0',
`typeFk` smallint(5) unsigned NOT NULL,
`itemCategoryFk` int(10) unsigned NOT NULL,
`total` bigint(21) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
+
OPEN rs;
read_loop: LOOP
FETCH rs INTO vCategoryFk;
-
+
IF vDone THEN
LEAVE read_loop;
END IF;
-
+
INSERT INTO tmp.topSeller
SELECT tsm.itemFk, tsm.typeFk, it.categoryFk, tsm.total
FROM tmp.topSellerMin tsm
INNER JOIN vn.itemType it ON it.id = tsm.typeFk
WHERE it.categoryFk = vCategoryFk
ORDER BY tsm.itemFk ,tsm.total DESC
- LIMIT 5;
+ LIMIT 5;
END LOOP;
CLOSE rs;
-
+
SELECT i.name ,i.id, i.image, i.typeFk, it.categoryFk AS itemCategoryFk,
ic.name AS itemCategoryName, it.name AS itemTypeName, ts.total
FROM tmp.topSeller ts
INNER JOIN vn.item i ON i.id = ts.id
INNER JOIN vn.itemType it ON it.id = ts.typeFk
INNER JOIN vn.itemCategory ic ON ic.id = it.categoryFk;
-
+
DROP TABLE IF EXISTS topSellerMin;
DROP TABLE IF EXISTS tmp.topSeller;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -61770,7 +61770,7 @@ SET tag6 = t.name, value6 = it.value
WHERE it.priority = 2
AND (vItem IS NULL OR vItem = it.itemFk);
-UPDATE item i
+UPDATE item i
JOIN itemTag it ON it.itemFk = i.id
JOIN tag t ON t.id = it.tagFk
SET tag7 = t.name, value7 = it.value
@@ -61803,7 +61803,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `item_cleanFloramondo`()
BEGIN
/**
-* Elimina todos los items repetidos de floramondo
+* Elimina todos los items repetidos de floramondo
* y los sustituye por el que tiene menor id
*/
DECLARE vItemFrom INT;
@@ -61869,7 +61869,7 @@ BEGIN
AND i2.EmbalageCode <=> i.EmbalageCode
AND i2.quality <=> i.quality
JOIN (
- SELECT DISTINCT b.itemFk
+ SELECT DISTINCT b.itemFk
FROM buy b
JOIN item i ON i.id = b.itemFk
WHERE i.isFloramondo
@@ -61877,7 +61877,7 @@ BEGIN
)sub2 ON sub2.itemFk = GREATEST(i.id, i2.id)
WHERE i.isFloramondo
AND i.id <> i2.id;
-
+
DECLARE EXIT HANDLER FOR SQLEXCEPTION SET vDone = TRUE;
BEGIN
SET vDone = TRUE;
@@ -62131,13 +62131,13 @@ BEGIN
/**
* @vItemFk item a buscar
* @vWarehouseFk almacen donde buscar
- * @vDate Si la fecha es null, muestra el histórico desde el inventario.
+ * @vDate Si la fecha es null, muestra el histórico desde el inventario.
* Si la fecha no es null, muestra histórico desde la fecha pasada.
*/
DECLARE vDateInventory DATETIME;
IF vDate IS NULL THEN
- SELECT inventoried INTO vDateInventory
+ SELECT inventoried INTO vDateInventory
FROM config;
ELSE
SELECT mockUtcTime INTO vDateInventory
@@ -62163,7 +62163,7 @@ BEGIN
inventorySupplierFk INT(10)
);
- INSERT INTO tItemDiary
+ INSERT INTO tItemDiary
SELECT tr.landed shipped,
b.quantity `in`,
NULL `out`,
@@ -62184,14 +62184,14 @@ BEGIN
JOIN entry e ON e.id = b.entryFk
JOIN travel tr ON tr.id = e.travelFk
JOIN supplier s ON s.id = e.supplierFk
- JOIN state st ON st.`code` = IF( tr.landed < util.VN_CURDATE()
+ JOIN state st ON st.`code` = IF( tr.landed < util.VN_CURDATE()
OR (util.VN_CURDATE() AND tr.isReceived),
- 'DELIVERED',
+ 'DELIVERED',
'FREE')
JOIN entryConfig ec
WHERE tr.landed >= vDateInventory
AND vWarehouseFk = tr.warehouseInFk
- AND (s.id <> ec.inventorySupplierFk OR vDate IS NULL)
+ AND (s.id <> ec.inventorySupplierFk OR vDate IS NULL)
AND b.itemFk = vItemFk
AND e.isExcludedFromAvailable = FALSE
AND e.isRaid = FALSE
@@ -62217,14 +62217,14 @@ BEGIN
JOIN travel tr ON tr.id = e.travelFk
JOIN warehouse w ON w.id = tr.warehouseOutFk
JOIN supplier s ON s.id = e.supplierFk
- JOIN state st ON st.`code` = IF(tr.shipped < util.VN_CURDATE()
+ JOIN state st ON st.`code` = IF(tr.shipped < util.VN_CURDATE()
OR (tr.shipped = util.VN_CURDATE() AND tr.isReceived),
- 'DELIVERED',
+ 'DELIVERED',
'FREE')
JOIN entryConfig ec
WHERE tr.shipped >= vDateInventory
AND vWarehouseFk = tr.warehouseOutFk
- AND (s.id <> ec.inventorySupplierFk OR vDate IS NULL)
+ AND (s.id <> ec.inventorySupplierFk OR vDate IS NULL)
AND b.itemFk = vItemFk
AND e.isExcludedFromAvailable = FALSE
AND w.isFeedStock = FALSE
@@ -62253,12 +62253,12 @@ BEGIN
JOIN client c ON c.id = t.clientFk
JOIN clientType ct ON ct.id = c.clientTypeFk
JOIN state st2 ON st2.`code` = IF(t.shipped < util.VN_CURDATE(),
- 'DELIVERED',
+ 'DELIVERED',
IF (t.shipped > util.dayEnd(util.VN_CURDATE()),
'FREE',
IFNULL(ts.code, 'FREE')))
LEFT JOIN state stPrep ON stPrep.`code` = 'PREPARED'
- LEFT JOIN saleTracking stk ON stk.saleFk = s.id
+ LEFT JOIN saleTracking stk ON stk.saleFk = s.id
AND stk.stateFk = stPrep.id
LEFT JOIN claimBeginning cb ON s.id = cb.saleFk
WHERE t.shipped >= vDateInventory
@@ -62274,7 +62274,7 @@ BEGIN
`out` DESC;
IF vDate IS NULL THEN
-
+
SET @a := 0;
SET @currentLineFk := 0;
SET @shipped := '';
@@ -62289,9 +62289,9 @@ BEGIN
`in` invalue,
`out`,
@a := @a + IFNULL(`in`, 0) - IFNULL(`out`, 0) balance,
- @currentLineFk := IF (@shipped < util.VN_CURDATE()
+ @currentLineFk := IF (@shipped < util.VN_CURDATE()
OR (@shipped = util.VN_CURDATE() AND (isPicked OR a.`code` >= 'ON_PREPARATION')),
- lineFk,
+ lineFk,
@currentLineFk) lastPreparedLineFk,
isTicket,
lineFk,
@@ -62323,25 +62323,25 @@ BEGIN
0 clientType,
0 claimFk
UNION ALL
- SELECT shipped,
- alertlevel,
- stateName,
- origin,
- reference,
- clientFk,
- name, `in`,
- `out`,
- @a := @a + IFNULL(`in`, 0) - IFNULL(`out`, 0),
- 0,
- isTicket,
- lineFk,
- isPicked,
- clientType,
+ SELECT shipped,
+ alertlevel,
+ stateName,
+ origin,
+ reference,
+ clientFk,
+ name, `in`,
+ `out`,
+ @a := @a + IFNULL(`in`, 0) - IFNULL(`out`, 0),
+ 0,
+ isTicket,
+ lineFk,
+ isPicked,
+ clientType,
claimFk
FROM tItemDiary
WHERE shipped >= vDate;
END IF;
-
+
DROP TEMPORARY TABLE tItemDiary;
END ;;
DELIMITER ;
@@ -62448,7 +62448,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getLack`(IN vForce BOOLEAN, IN
BEGIN
/**
* Calcula una tabla con el máximo negativo visible para cada producto y almacen
- *
+ *
* @param vForce Fuerza el recalculo del stock
* @param vDays Numero de dias a considerar
**/
@@ -62457,31 +62457,31 @@ BEGIN
CALL item_getMinacum(NULL, util.VN_CURDATE(), vDays, NULL);
CALL item_getMinETD();
- SELECT i.id itemFk,
+ SELECT i.id itemFk,
i.longName,
w.id warehouseFk,
- p.`name` producer,
+ p.`name` producer,
i.`size`,
i.category,
- w.name warehouse,
+ w.name warehouse,
SUM(IFNULL(sub.amount,0)) lack,
i.inkFk,
- IFNULL(im.timed, util.midnight()) timed
- FROM (SELECT item_id,
- warehouse_id,
+ IFNULL(im.timed, util.midnight()) timed
+ FROM (SELECT item_id,
+ warehouse_id,
amount
FROM cache.stock
WHERE amount > 0
UNION ALL
- SELECT itemFk,
- warehouseFk,
+ SELECT itemFk,
+ warehouseFk,
amount
FROM tmp.itemMinacum
) sub
JOIN warehouse w ON w.id = sub.warehouse_id
JOIN item i ON i.id = sub.item_id
- LEFT JOIN producer p ON p.id = i.producerFk
- JOIN itemType it ON it.id = i.typeFk
+ LEFT JOIN producer p ON p.id = i.producerFk
+ JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN tmp.itemMinETD im ON im.itemFk = i.id
WHERE w.isForTicket
@@ -62602,12 +62602,12 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getMinETD`()
BEGIN
-
+
/* Devuelve una tabla temporal con la primera ETD, para todos los artículos con salida hoy.
- *
+ *
* @return tmp.itemMinETD(itemFk, timed)
*/
-
+
DECLARE vMidnight DATETIME DEFAULT util.midnight();
DROP TEMPORARY TABLE IF EXISTS tmp.itemMinETD;
@@ -62618,7 +62618,7 @@ BEGIN
SELECT s.itemFk, MIN(TIME(IFNULL(z.`hour`,vMidnight))) timed
FROM ticket t
JOIN sale s ON s.ticketFk = t.id
- LEFT JOIN `zone` z ON z.id = t.zoneFk
+ LEFT JOIN `zone` z ON z.id = t.zoneFk
WHERE t.shipped BETWEEN util.VN_CURDATE() AND vMidnight
GROUP BY s.itemFk;
END ;;
@@ -62648,33 +62648,33 @@ BEGIN
* @param vWarehouseFk warehouse id
* @param vDate fecha para revisar disponible
* @param vIsShowedByType para mostrar solo artículos de ese tipo
- */
+ */
DECLARE vCalcFk INT;
DECLARE vTypeFk INT;
-
+
DECLARE vTag1 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vTag5 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vTag6 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vTag7 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vTag8 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
-
+
DECLARE vValue1 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vValue5 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vValue6 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vValue7 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
DECLARE vValue8 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
-
+
SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value
INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1
FROM vn.item i
LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk
WHERE i.id = vItemFk;
-
+
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDate);
-
+
SELECT i.id itemFk,
i.longName,
i.subName,
@@ -62707,7 +62707,7 @@ BEGIN
ORDER BY counter DESC,
(t1.name = vTag1) DESC,
(it1.value = vValue1) DESC,
- (i.tag6 = vTag6) DESC,
+ (i.tag6 = vTag6) DESC,
(i.value6 = vValue6) DESC,
(i.tag5 = vTag5) DESC,
(i.value5 = vValue5) DESC,
@@ -62716,7 +62716,7 @@ BEGIN
(i.tag8 = vTag8) DESC,
(i.value8 = vValue8) DESC
LIMIT 30;
-
+
END ;;
DELIMITER ;
@@ -63001,11 +63001,11 @@ BEGIN
* @param vBarcode del item
* @param vReference referencia a actualizar
*/
-
+
DECLARE vItemFk INT;
SELECT barcodeToItem(vBarcode) INTO vItemFk;
-
+
UPDATE item SET comment = vReference WHERE id = vItemFk;
END ;;
@@ -63028,7 +63028,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `item_setGeneric`(vSelf INT)
BEGIN
/**
* Asigna el código genérico a un item, salvo que sea un código de item genérico.
- *
+ *
* @param vSelf identificador de vn.item
*/
DECLARE vGenericFk INT;
@@ -63038,7 +63038,7 @@ BEGIN
SELECT itemFk, SUM(matches) = maxMatches `match`
FROM (
SELECT ga.id gaid, ga.itemFk,
- CASE
+ CASE
WHEN t.code = 'nflowers' THEN
it.value <=> ga.numFlores
WHEN t.code = 'origin' THEN
@@ -63069,13 +63069,13 @@ BEGIN
AND (i.`size` = ga.`size` OR ga.`size` IS NULL)
AND i.id != ga.itemFk
WHERE i.id = vSelf
- AND NOT i.isFloramondo) sub
+ AND NOT i.isFloramondo) sub
GROUP BY gaid
HAVING `match`) sub2
LIMIT 1;
- UPDATE vn.item
- SET genericFk = vGenericFk
+ UPDATE vn.item
+ SET genericFk = vGenericFk
WHERE id = vSelf;
END ;;
DELIMITER ;
@@ -63095,18 +63095,18 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `item_updatePackingShelve`(vSelf INT, vPacking INT)
BEGIN
-
+
/**
* Actualiza el valor de item.packingShelve
- *
+ *
* @param vSelf Identificador de vn.item
* @param vPacking Cantidad de unidades de venta que caben en una bandeja
*/
-
- UPDATE vn.item i
+
+ UPDATE vn.item i
SET i.packingShelve = vPacking
WHERE i.id = vSelf;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -63156,9 +63156,9 @@ BEGIN
DECLARE vHasNotInventory BOOLEAN DEFAULT FALSE;
DECLARE vInventoried2 DATE;
DECLARE vDateDayEnd DATETIME;
-
+
SET vDateDayEnd = util.dayEnd(vDated);
-
+
SELECT landed INTO vInventoried
FROM travel tr
JOIN entry E ON E.travelFk = tr.id
@@ -63168,7 +63168,7 @@ BEGIN
LIMIT 1;
SET vHasNotInventory = IF (vInventoried is null, TRUE, FALSE);
-
+
IF vHasNotInventory THEN
SELECT landed INTO vInventoried2
@@ -63189,13 +63189,13 @@ BEGIN
CREATE TEMPORARY TABLE inv
(warehouseFk SMALLINT,
Id_Article BIGINT,
- cantidad INT,
+ cantidad INT,
coste DOUBLE DEFAULT 0,
total DOUBLE DEFAULT 0,
Almacen VARCHAR(20),
PRIMARY KEY (Almacen, Id_Article) USING HASH)
ENGINE = MEMORY;
-
+
IF vHasNotInventory = TRUE THEN
INSERT INTO inv(warehouseFk, Id_Article, cantidad, Almacen)
@@ -63272,7 +63272,7 @@ BEGIN
AND it.isInventory
ON DUPLICATE KEY UPDATE inv.cantidad = inv.cantidad + s.quantity * IF(vHasNotInventory,0,1);
- END IF;
+ END IF;
-- Mercancia en transito
INSERT INTO inv(warehouseFk, Id_Article, cantidad, Almacen)
@@ -63290,7 +63290,7 @@ BEGIN
AND t.isInventory
AND e.isConfirmed
ON DUPLICATE KEY UPDATE inv.cantidad = inv.cantidad + (b.quantity);
-
+
CALL vn.buyUltimate(NULL,vDateDayEnd);
UPDATE inv i
@@ -63305,20 +63305,20 @@ BEGIN
IF vIsDetailed THEN
SELECT inv.warehouseFk,
- i.id itemFk,
- i.longName ,
- i.size,
- inv.Cantidad,
+ i.id itemFk,
+ i.longName ,
+ i.size,
+ inv.Cantidad,
tp.name Tipo,
- ic.name Reino,
- inv.coste,
+ ic.name Reino,
+ inv.coste,
cast(inv.total as decimal(10,2)) total,
almacen
FROM inv
JOIN warehouse w on w.id = warehouseFk
JOIN item i ON i.id = inv.Id_Article
JOIN itemType tp ON tp.id = i.typeFk
- JOIN itemCategory ic ON ic.id = tp.categoryFk
+ JOIN itemCategory ic ON ic.id = tp.categoryFk
WHERE w.valuatedInventory
and inv.total > 0
order by inv.total desc;
@@ -63365,37 +63365,37 @@ BEGIN
* @param vConcept descripcion
* @param vAmount cantidad que se compensa
* @param vCompany empresa
- * @param vOriginalAccount cuenta contable desde la cual se compensa
- *
- */
+ * @param vOriginalAccount cuenta contable desde la cual se compensa
+ *
+ */
DECLARE vNewBookEntry INT;
DECLARE vIsClientCompensation INT;
DECLARE vClientFk INT;
DECLARE vSupplierFk INT;
DECLARE vIsOriginalAClient BOOL;
DECLARE vPayMethodCompensation INT;
-
+
CALL ledger_next(vNewBookEntry);
SELECT COUNT(id) INTO vIsOriginalAClient FROM client WHERE accountingAccount LIKE vOriginalAccount COLLATE utf8_general_ci;
- SELECT id, COUNT(id) INTO vClientFk, vIsClientCompensation
- FROM client
+ SELECT id, COUNT(id) INTO vClientFk, vIsClientCompensation
+ FROM client
WHERE accountingAccount LIKE vCompensationAccount COLLATE utf8_general_ci;
-
+
SET @vAmount1:= 0.0;
SET @vAmount2:= 0.0;
- INSERT INTO XDiario (ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, empresa_id)
- VALUES ( vNewBookEntry,
- vDated,
- vOriginalAccount,
- vCompensationAccount,
- vConcept,
+ INSERT INTO XDiario (ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, empresa_id)
+ VALUES ( vNewBookEntry,
+ vDated,
+ vOriginalAccount,
+ vCompensationAccount,
+ vConcept,
@vAmount1:= IF(
- (vIsOriginalAClient AND vAmount > 0) OR
- (NOT vIsOriginalAClient AND vAmount < 0),
- 0,
+ (vIsOriginalAClient AND vAmount > 0) OR
+ (NOT vIsOriginalAClient AND vAmount < 0),
+ 0,
ABS(vAmount)
),
@vAmount2:= IF(@vAmount1,
@@ -63404,20 +63404,20 @@ BEGIN
),
vCompanyFk
),
- ( vNewBookEntry,
- vDated,
- vCompensationAccount,
- vOriginalAccount,
- vConcept,
+ ( vNewBookEntry,
+ vDated,
+ vCompensationAccount,
+ vOriginalAccount,
+ vConcept,
@vAmount2,
@vAmount1,
vCompanyFk);
-
+
IF vIsClientCompensation THEN
IF vIsOriginalAClient THEN
SET vAmount = -vAmount;
END IF;
- INSERT INTO receipt(invoiceFk, amountPaid, payed, bankFk, companyFk, clientFk, isConciliate)
+ INSERT INTO receipt(invoiceFk, amountPaid, payed, bankFk, companyFk, clientFk, isConciliate)
VALUES (vConcept, vAmount, vDated, vBankFk, vCompanyFk, vClientFk, TRUE);
ELSE
IF NOT vIsOriginalAClient THEN
@@ -63425,7 +63425,7 @@ BEGIN
END IF;
SELECT id INTO vSupplierFk FROM supplier WHERE `account` LIKE vCompensationAccount COLLATE utf8_general_ci;
SELECT id INTO vPayMethodCompensation FROM payMethod WHERE `code` = 'compensation';
-
+
INSERT INTO payment (received, dueDated, supplierFk, amount, bankFk, payMethodFk, concept, companyFk, isConciliated)
VALUES(vDated, vDated, vSupplierFk, vAmount, vBankFk, vPayMethodCompensation, vConcept, vCompanyFk, TRUE);
END IF;
@@ -63447,10 +63447,10 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ledger_next`(OUT vNewBookEntry INT)
BEGIN
-
+
UPDATE vn.ledgerConfig SET lastBookEntry = LAST_INSERT_ID(lastBookEntry + 1);
SET vNewBookEntry = LAST_INSERT_ID();
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -63476,15 +63476,15 @@ BEGIN
* @param vEntity Nombre que hace referencia a la tabla.
*/
DECLARE vTableName VARCHAR(45);
-
+
SET vTableName = CONCAT(vEntity, 'Log');
-
+
SET @qryLog := CONCAT(
'SELECT ot.id, ot.originFk, ot.userFk, u.name, ot.action, ot.creationDate, ot.description FROM ', vTableName, ' AS ot',
' INNER JOIN account.user u ON u.id = ot.userFk',
' WHERE ot.originFk = ', vOriginFk, ' ORDER BY ot.creationDate DESC'
);
-
+
PREPARE stmt FROM @qryLog;
EXECUTE stmt;
END ;;
@@ -63509,9 +63509,9 @@ BEGIN
SET @buildingOrder := 0;
SET @route := 0;
set @cajas := 0;
-
+
UPDATE tmp.sorter
- SET buildingOrder = @buildingOrder := IF(@route = @route := routeFk, @buildingOrder, 0) + 1
+ SET buildingOrder = @buildingOrder := IF(@route = @route := routeFk, @buildingOrder, 0) + 1
where date(created) = vDate
order by routeFk, created, weight DESC;
@@ -63529,23 +63529,23 @@ set @cajas := 0;
UPDATE tmp.sorter
SET lungGrow = IF(palletOrder = 0, -13, lungGrow);
-
+
DELETE FROM tmp.lungSize WHERE dia = vDate;
-
+
INSERT INTO tmp.lungSize(dia, hora,size)
select vDate,hora, @cajas := @cajas + cajas as size
from
(
select IF(lungGrow BETWEEN -12 AND -1, ETD,time_format(created,"%H:%i")) as hora, sum(if(lungGrow <= 0, lungGrow, 1)) as cajas, @cajas := 0
- from tmp.sorter
+ from tmp.sorter
where date(created) = vDate
group by hora
) sub;
-
+
SELECT * FROM tmp.lungSize
WHERE dia = vDate;
-
-
+
+
END ;;
@@ -63566,23 +63566,23 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `machineWorker_add`(vPlate VARCHAR(10), vWorkerFk INT)
BEGIN
-
+
/**
* Inserta registro si el vWorkerFk no ha registrado nada en las últimas 12 horas
* @param vPlate número de matrícula
- * @param vWorkerFk id del worker
- *
-*/
- UPDATE vn.machineWorker mw
- JOIN vn.machine m ON m.id = mw.machineFk
+ * @param vWorkerFk id del worker
+ *
+*/
+ UPDATE vn.machineWorker mw
+ JOIN vn.machine m ON m.id = mw.machineFk
SET mw.outTimed = util.VN_NOW()
WHERE (mw.workerFk = vWorkerFk OR m.plate = vPlate)
AND ISNULL(mw.outTimed);
-
+
INSERT INTO machineWorker (machineFk, workerFk)
SELECT m.id, vWorkerFk
FROM machine m
- WHERE m.plate= vPlate;
+ WHERE m.plate= vPlate;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -63602,21 +63602,21 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `machineWorker_getHistorical`(vPlate VARCHAR(20), vWorkerFk INT)
BEGIN
/**
- * Obtiene historial de la matrícula vPlate que el trabajador vWorkerFk escanea,
+ * Obtiene historial de la matrícula vPlate que el trabajador vWorkerFk escanea,
* si es jefe de producción muestra el historial completo.
- *
+ *
* @param vPlate número de matrícula
- * @param vWorkerFk id del trabajador
- *
+ * @param vWorkerFk id del trabajador
+ *
*/
DECLARE vWorkerName VARCHAR(255) DEFAULT account.user_getNameFromId(vWorkerFk);
- SELECT mw.inTimed,account.user_getNameFromId(mw.workerFk) as workerName, mw.outTimed
+ SELECT mw.inTimed,account.user_getNameFromId(mw.workerFk) as workerName, mw.outTimed
FROM machineWorker mw
JOIN machine m ON m.plate = vPlate
WHERE mw.machineFk = m.id
AND mw.workerFk = IF(account.user_hasRole(vWorkerName, 'coolerAssist'), mw.workerFk, vWorkerFk)
- ORDER BY mw.inTimed DESC;
+ ORDER BY mw.inTimed DESC;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -63635,13 +63635,13 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `machineWorker_update`(vPlate VARCHAR(10), vWorkerFk INT)
BEGIN
-
+
/**
- * Actualiza el registro correspondiente si el vWorkerFk se ha registrado en las últimas horas (campo maxHours de machineWorkerConfig) con vPlate,
- *
+ * Actualiza el registro correspondiente si el vWorkerFk se ha registrado en las últimas horas (campo maxHours de machineWorkerConfig) con vPlate,
+ *
* @param vPlate número de matrícula
- * @param vWorkerFk id del trabajador
- *
+ * @param vWorkerFk id del trabajador
+ *
*/
DECLARE vMachineFk INT(10);
@@ -63650,24 +63650,24 @@ BEGIN
SELECT m.id INTO vMachineFk
FROM machine m
WHERE m.plate = vPlate;
-
+
SELECT maxHours INTO vMaxHours
FROM machineWorkerConfig;
- IF (SELECT COUNT(*)
+ IF (SELECT COUNT(*)
FROM machineWorker m
WHERE m.workerFk = vWorkerFk
- AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW()) AND ISNULL(m.outTimed)) THEN
-
+ AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW()) AND ISNULL(m.outTimed)) THEN
+
UPDATE machineWorker m
SET m.outTimed = CURRENT_TIMESTAMP()
- WHERE m.workerFk = vWorkerFk
- AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW())
+ WHERE m.workerFk = vWorkerFk
+ AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW())
AND ISNULL(m.outTimed)
AND m.machineFk = vMachineFk;
-
+
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -63722,12 +63722,12 @@ BEGIN
/**
* Inserta en la tabla vn.mail
*
- * @param vReceiver Receptor del correo
+ * @param vReceiver Receptor del correo
* @param vReplyTo A quién contestar el correo
* @param vSubject Título del correo
* @param vBody Cuerpo del correo
*/
-
+
DECLARE vIsRepeated BOOLEAN;
SELECT COUNT(*) INTO vIsRepeated
@@ -63768,12 +63768,12 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `makeNewItem`()
BEGIN
DECLARE newItemFk INT;
-
+
SELECT getNewItemId() INTO newItemFk;
-
+
INSERT INTO item(id,name,typeFk,originFk)
SELECT newItemFk, 'Nuevo artículo', 78,39;
-
+
SELECT newItemFk;
@@ -63801,34 +63801,34 @@ BEGIN
DECLARE vMinute INT DEFAULT 0;
DECLARE vBoxes INT;
-
+
DROP TEMPORARY TABLE IF EXISTS vn.pcsDay;
CREATE TEMPORARY TABLE vn.pcsDay
SELECT 0 as hh, 0 as mm, 0 as boxes;
-
+
-- Creamos una tabla soporte para acumular las cajas a lo largo del dia
WHILE vHour < 24 DO
-
+
WHILE vMinute < 59 DO
-
+
SET vMinute = vMinute + 1;
-
+
INSERT INTO vn.pcsDay(hh,mm) VALUES(vHour, vMinute);
-
+
END WHILE;
-
+
SET vMinute = -1;
SET vHour = vHour + 1;
-
+
END WHILE;
-
+
-- Acumulamos
UPDATE vn.pcsDay pd
LEFT JOIN (SELECT * FROM vn.pcs_graf WHERE dia = vDated) pg USING(hh,mm)
SET pd.boxes = pd.boxes + pg.box;
-
+
SELECT * FROM vn.pcsDay;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -63851,7 +63851,7 @@ BEGIN
* Recalcula el mana consumido por un trabajador
*
* @param vWorkerFk Id Trabajador
- */
+ */
DECLARE vWorkerIsExcluded BOOLEAN;
DECLARE vFromDated DATE;
DECLARE vToDated DATE DEFAULT TIMESTAMPADD(DAY,1,util.VN_CURDATE());
@@ -63860,32 +63860,32 @@ BEGIN
DECLARE vClaimMana INT;
DECLARE vManaBank INT;
DECLARE vManaGreugeType INT;
-
+
SELECT COUNT(*) INTO vWorkerIsExcluded
FROM workerManaExcluded
WHERE workerFk = vWorkerFk;
-
+
IF NOT vWorkerIsExcluded THEN
- SELECT id INTO vMana
+ SELECT id INTO vMana
FROM `component` WHERE code = 'mana';
-
- SELECT id INTO vAutoMana
+
+ SELECT id INTO vAutoMana
FROM `component` WHERE code = 'autoMana';
-
- SELECT id INTO vClaimMana
+
+ SELECT id INTO vClaimMana
FROM `component` WHERE code = 'manaClaim';
-
- SELECT id INTO vManaBank
+
+ SELECT id INTO vManaBank
FROM `bank` WHERE code = 'mana';
-
- SELECT id INTO vManaGreugeType
+
+ SELECT id INTO vManaGreugeType
FROM `greugeType` WHERE code = 'mana';
- SELECT max(dated) INTO vFromDated
+ SELECT max(dated) INTO vFromDated
FROM clientManaCache;
-
+
REPLACE workerMana (workerFk, amount)
- SELECT vWorkerFk, sum(mana) FROM
+ SELECT vWorkerFk, sum(mana) FROM
(
SELECT s.quantity * sc.value as mana
FROM ticket t
@@ -63906,8 +63906,8 @@ BEGIN
FROM greuge g
JOIN client c ON c.id = g.clientFk
WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = vManaGreugeType
- AND g.shipped > vFromDated and g.shipped < util.VN_CURDATE()
- UNION ALL
+ AND g.shipped > vFromDated and g.shipped < util.VN_CURDATE()
+ UNION ALL
SELECT cc.mana
FROM clientManaCache cc
JOIN client c ON c.id = cc.clientFk
@@ -63934,20 +63934,20 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqlConnectionsSorter_kill`()
BEGIN
/**
- * Elimina conexiones del usuario sorter con tiempo >= 30seg. Asociado al evento con el mismo nombre
- */
-
+ * Elimina conexiones del usuario sorter con tiempo >= 30seg. Asociado al evento con el mismo nombre
+ */
+
DECLARE vDone INT DEFAULT 0;
DECLARE vProcesId INT;
DECLARE vCursor CURSOR FOR
- SELECT p.id
+ SELECT p.id
FROM information_schema.processlist p
- WHERE USER = 'sorter'
+ WHERE USER = 'sorter'
AND TIME >= 30;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
OPEN vCursor;
l: LOOP
@@ -63984,7 +63984,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqlPreparedCount_check`()
BEGIN
DECLARE vPreparedCount INTEGER;
- SELECT VARIABLE_VALUE INTO vPreparedCount
+ SELECT VARIABLE_VALUE INTO vPreparedCount
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE '%prepared_stmt_count%';
@@ -63992,7 +63992,7 @@ BEGIN
CALL `vn`.`mail_insert`('cau@verdnatura.es',
NULL,
'Problemas BBDD prepared_stmt_count',
- CONCAT('Existen problemas con el servicio de Logiflora, prepared_stmt_count con valor: ',
+ CONCAT('Existen problemas con el servicio de Logiflora, prepared_stmt_count con valor: ',
vPreparedCount,
', está próximo a exceder su límite. \r\n Hay que reiniciar el servicio LF.VMP.Service del servidor a3.')
);
@@ -64019,37 +64019,37 @@ BEGIN
DECLARE newShelving VARCHAR(3);
DECLARE vCode VARCHAR(3);
-
+
SELECT MAX(code) INTO vCode
FROM vn.shelving
WHERE isPrinted = FALSE;
-
+
SET @a1 := ASCII(MID(vCode,1,1));
SET @a2 := ASCII(MID(vCode,2,1));
SET @a3 := ASCII(MID(vCode,3,1)) + 1;
-
+
IF @a3 > 90 THEN
-
+
SET @a3 = 65;
SET @a2 = @a2 + 1;
-
+
IF @a2 > 90 THEN
-
+
SET @a2 = 65;
SET @a1 = @a1 + 1;
-
+
IF @a1 > 90 THEN
-
+
SET @a1 = 65;
-
+
END IF;
-
+
END IF;
-
+
END IF;
SET newShelving = CHAR(@a1,@a2,@a3 USING utf8);
-
+
INSERT INTO vn.shelving(code) VALUES(newShelving);
END ;;
@@ -64078,18 +64078,18 @@ BEGIN
* @param descripcion Texto de la observacion
*/
DECLARE vTableName VARCHAR(45);
-
+
SET vTableName = CONCAT(vTableCode,'Observation');
-
+
IF ISNULL(vTableName) THEN
CALL util.throw('CODE_NOT_FOUND');
END IF;
-
+
SET @qryLog := CONCAT(
'INSERT INTO ', vTableName, ' (originFk, userFk, description)',
' VALUES (', vOriginFk, ', ', account.myUser_getId(), ', "', vDescription, '")'
);
-
+
PREPARE stmt FROM @qryLog;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
@@ -64119,15 +64119,15 @@ BEGIN
DECLARE vDeliveryMethod INT;
DECLARE vClient INT;
-
+
SELECT deliveryMethodFk INTO vDeliveryMethod
- FROM vn.agencyMode
+ FROM vn.agencyMode
WHERE id = vAgencyMode;
-
+
SELECT clientFk INTO vClient
FROM vn.address
WHERE id = vAddress;
-
+
INSERT INTO hedera.order(date_send,customer_id,delivery_method_id,agency_id,address_id,source_app)
VALUES( vLanded,vClient ,vDeliveryMethod,vAgencyMode ,vAddress ,vSourceApp);
@@ -64153,7 +64153,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `orderDelete`(IN vId INT)
BEGIN
DELETE FROM hedera.`order` where id = vId;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64180,7 +64180,7 @@ BEGIN
DECLARE vOrderId INT;
CALL vn.orderCreate(vLanded,vAgencyMode,vAddress,vSourceApp,vOrderId);
SELECT vOrderId;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64200,7 +64200,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `orderListVolume`(IN vOrderId INT)
BEGIN
- SELECT
+ SELECT
o.id,
o.itemFk,
i.description,
@@ -64226,7 +64226,7 @@ DELIMITER ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `packageInvoicing`(
+CREATE DEFINER=`root`@`localhost` PROCEDURE `packageInvoicing`(
IN vClient INT,
IN vDate DATE,
IN vCompany INT,
@@ -64245,20 +64245,20 @@ BEGIN
SET vGraceDays = IF(vIsAllInvoiceable ,0, 30);
SET vGraceDate = TIMESTAMPADD(DAY, - vGraceDays, vDate);
-
- /* Clientes especiales:
+
+ /* Clientes especiales:
3240 MADEFLOR
992 JAVIER FELIU
4 TONI VENDRELL
*/
-
+
IF vClient IN (992, 3240, 4) THEN
-
+
SET vGraceDays = 365;
-
+
END IF;
/* Fin clientes especiales */
-
+
SET vDateEnd = DATE_ADD(vDate, INTERVAL 1 DAY);
DROP TEMPORARY TABLE IF EXISTS tmp.packageToInvoice;
@@ -64282,22 +64282,22 @@ BEGIN
FROM tmp.packageToInvoice
GROUP BY itemFk
HAVING totalQuantity > 0;
-
+
SELECT COUNT(*)
INTO vIsInvoiceable
FROM tmp.packageToInvoicePositives;
IF vIsInvoiceable THEN
- CALL ticket_add(vClient,
+ CALL ticket_add(vClient,
vDateEnd,
- vWarehouse,
- vCompany,
- NULL,
- NULL,
- NULL,
- vDateEnd,
- account.myUser_getId(),
+ vWarehouse,
+ vCompany,
+ NULL,
+ NULL,
+ NULL,
+ vDateEnd,
+ account.myUser_getId(),
TRUE,
vNewTicket);
@@ -64306,44 +64306,44 @@ BEGIN
packagingFk,
quantity,
pvp)
- SELECT vNewTicket,
- pti.packagingFk,
- - SUM(pti.quantity) AS totalQuantity,
+ SELECT vNewTicket,
+ pti.packagingFk,
+ - SUM(pti.quantity) AS totalQuantity,
pti.price
FROM tmp.packageToInvoice pti
- LEFT JOIN tmp.packageToInvoicePositives ptip ON pti.itemFk = ptip.itemFk
- WHERE ptip.itemFK IS NOT NULL
+ LEFT JOIN tmp.packageToInvoicePositives ptip ON pti.itemFk = ptip.itemFk
+ WHERE ptip.itemFK IS NOT NULL
OR vIsAllInvoiceable
GROUP BY packagingFk
HAVING totalQuantity;
INSERT INTO sale(
ticketFk,
- itemFk,
- concept,
- quantity,
+ itemFk,
+ concept,
+ quantity,
price
)
- SELECT vNewTicket,
- pti.itemFk,
- i.name as concept,
- sum(pti.quantity) as totalQuantity,
+ SELECT vNewTicket,
+ pti.itemFk,
+ i.name as concept,
+ sum(pti.quantity) as totalQuantity,
pti.price
FROM tmp.packageToInvoice pti
JOIN item i ON i.id = pti.itemFk
LEFT JOIN tmp.packageToInvoicePositives ptip ON pti.itemFk = ptip.itemFk
- WHERE ptip.itemFK IS NOT NULL
+ WHERE ptip.itemFK IS NOT NULL
OR vIsAllInvoiceable
GROUP BY pti.itemFk
HAVING totalQuantity;
-
+
INSERT INTO saleComponent(saleFk, componentFk, value)
SELECT id, vComponentCost, price
FROM sale
WHERE ticketFk = vNewTicket;
-
+
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64369,7 +64369,7 @@ BEGIN
WHERE mm.valor = 1 -- Listo para imprimir
AND mm.stateFk = 9 -- Encajando
AND m.Id_Ticket = ticketFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64391,15 +64391,15 @@ BEGIN
DECLARE valueFk INT;
DECLARE encajando INT DEFAULT 9;
-
- SELECT valor INTO valueFk
- FROM vn2008.Movimientos_mark
- WHERE Id_Movimiento = saleFk
+
+ SELECT valor INTO valueFk
+ FROM vn2008.Movimientos_mark
+ WHERE Id_Movimiento = saleFk
AND stateFk = encajando;
-
+
SET valueFk = (IFNULL(valueFk,0) + 1) MOD 3;
-
- REPLACE vn2008.Movimientos_mark(Id_Movimiento, valor, Id_Trabajador, stateFk)
+
+ REPLACE vn2008.Movimientos_mark(Id_Movimiento, valor, Id_Trabajador, stateFk)
VALUES(saleFk,valueFk,account.myUser_getId(),encajando);
@@ -64491,34 +64491,34 @@ BEGIN
DECLARE vLetters VARCHAR(26) DEFAULT 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
DECLARE vMaxId INT;
DECLARE vCode VARCHAR(8);
-
+
SET vColumn = vFromColumn;
SET vRow = vFromRow;
SET vCode = CONCAT(LPAD(vColumn,3,'0'),'-',IF(vIsLetterMode, MID(vLetters, vRow, 1), LPAD(vRow, 2,'0')));
-
+
SELECT MAX(id) INTO vMaxId
FROM vn.parking;
WHILE vColumn <= vToColumn DO
-
+
WHILE vRow <= vToRow DO
-
+
INSERT IGNORE INTO vn.parking(`column`, `row`, sectorFk, `code`, pickingOrder)
VALUES (vColumn, vRow, vSectorFk, vCode, vColumn * 100 + vRow )
ON DUPLICATE KEY UPDATE `code` = vCode;
-
+
SET vRow = vRow + 1;
SET vCode = CONCAT(LPAD(vColumn,3,'0'),'-',IF(vIsLetterMode, MID(vLetters, vRow, 1), LPAD(vRow, 2,'0')));
-
+
END WHILE;
-
+
SET vRow = vFromRow;
SET vColumn = vColumn + 1;
-
+
SET vCode = CONCAT(LPAD(vColumn,3,'0'),'-',IF(vIsLetterMode, MID(vLetters, vRow, 1), LPAD(vRow, 2,'0')));
-
+
END WHILE;
-
+
SELECT * FROM vn.parking WHERE `column` BETWEEN vFromColumn AND vToColumn;
END ;;
@@ -64543,59 +64543,59 @@ BEGIN
DECLARE vRow INT;
DECLARE vCode VARCHAR(8);
DECLARE i INT;
-
+
IF vToRow < vFromRow THEN
-
+
SET vRow = vFromRow;
-
+
WHILE vRow >= vToRow DO
-
+
SET i = 1;
-
+
WHILE i <= vTrolleysByLine DO
-
+
SET vCode = CONCAT(vLetter,'-', LPAD(vRow,2,'0'),'-', i);
-
+
INSERT IGNORE INTO vn.parking( sectorFk, `code`, pickingOrder)
VALUES (vSectorFk, vCode, vPickingOrder + (i * 10))
ON DUPLICATE KEY UPDATE `code` = vCode;
-
+
SET i = i + 1;
-
+
END WHILE;
-
+
SET vRow = vRow - 1;
-
+
END WHILE;
ELSE
-
+
SET vRow = vFromRow;
-
+
WHILE vRow <= vToRow DO
-
+
SET i = 1;
-
+
WHILE i <= vTrolleysByLine DO
-
+
SET vCode = CONCAT(vLetter,'-', LPAD(vRow,2,'0'),'-', i);
-
+
INSERT IGNORE INTO vn.parking( sectorFk, `code`, pickingOrder)
VALUES (vSectorFk, vCode, vPickingOrder + (i * 10) )
ON DUPLICATE KEY UPDATE `code` = vCode;
-
+
SET i = i + 1;
-
+
END WHILE;
-
+
SET vRow = vRow + 1;
-
+
END WHILE;
-
-
+
+
END IF;
-
-
+
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64619,28 +64619,28 @@ BEGIN
DECLARE vColumn INT;
DECLARE vLetters VARCHAR(200);
DECLARE vLettersLength INT;
-
+
SET vColumn = vStart;
SET vRow = 1;
SET vLetters = 'ABCDEF';
SET vLettersLength = LENGTH(vLetters);
-
+
WHILE vColumn <= vEnd DO
-
+
REPLACE vn.parking(`column`, `row`, `code`, sectorFk)
VALUES(vColumn, vRow, CONCAT(vColumn,MID(vLetters,vRow,1)), vSectorFk);
-
+
SET vRow = vRow + 1;
-
+
IF vRow > vLettersLength THEN
-
+
SET vRow = 1;
SET vColumn = vColumn + 1;
-
+
END IF;
-
+
END WHILE;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64659,11 +64659,11 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `parking_setOrder`(vWarehouseFk INT)
BEGIN
-
+
/*
* Ordena el orden de preparacion de los parking de acuerdo con la tabla vn.corridor
*/
-
+
UPDATE vn.parking p
JOIN (
SELECT code,
@@ -64672,15 +64672,15 @@ BEGIN
SELECT c.prepOrder,
p.code,
@orden := 0,
- IF(c.isAscendent, 1,-1) * CAST(SUBSTRING(p.code,3,2) AS DECIMAL(2,0)) subCorridor ,
- CAST(IF(LENGTH(p.code) > 5, SUBSTRING(p.code,6,2), 0) AS DECIMAL(2,0)) ubication
+ IF(c.isAscendent, 1,-1) * CAST(SUBSTRING(p.code,3,2) AS DECIMAL(2,0)) subCorridor ,
+ CAST(IF(LENGTH(p.code) > 5, SUBSTRING(p.code,6,2), 0) AS DECIMAL(2,0)) ubication
FROM vn.parking p
- JOIN vn.sector s ON s.id = p.sectorFk
+ JOIN vn.sector s ON s.id = p.sectorFk
JOIN vn.corridor c ON c.code = LEFT(p.code,1) COLLATE utf8_general_ci
- WHERE s.warehouseFk = vWarehouseFk) sub
- ORDER BY sub.prepOrder, subCorridor, ubication) sub2 ON sub2.code = p.code
+ WHERE s.warehouseFk = vWarehouseFk) sub
+ ORDER BY sub.prepOrder, subCorridor, ubication) sub2 ON sub2.code = p.code
SET p.pickingOrder = sub2.po;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64699,17 +64699,17 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `prepareClientList`()
BEGIN
-
+
/*
* Require la tabla tmp.ticket(id,clientFk)
*/
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.client;
CREATE TEMPORARY TABLE tmp.client
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT DISTINCT clientFk id
- FROM tmp.ticket;
+ FROM tmp.ticket;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -64837,14 +64837,14 @@ BEGIN
/**
* Comprueba si la impresora pertenece al sector
*
- * @param vLabelerFk id de la impresora
+ * @param vLabelerFk id de la impresora
* @param vSector sector a comprobar
*/
DECLARE isPrinterInNewSector BOOL;
IF vLabelerFk IS NOT NULL THEN
SELECT COUNT(sectorFK) INTO isPrinterInNewSector
- FROM vn.printer p
+ FROM vn.printer p
WHERE id = vLabelerFk AND sectorFk = vSector;
IF !isPrinterInNewSector THEN
@@ -64868,7 +64868,7 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `productionControl`(
- vWarehouseFk INT,
+ vWarehouseFk INT,
vScopeDays INT
)
proc: BEGIN
@@ -64969,7 +64969,7 @@ proc: BEGIN
LEFT JOIN parking pk ON pk.id = tp.parkingFk
WHERE t.warehouseFk = vWarehouseFk
AND dm.code IN ('AGENCY', 'DELIVERY', 'PICKUP');
-
+
UPDATE tmp.productionBuffer pb
JOIN (
SELECT pb.ticketFk, GROUP_CONCAT(p.code) previaParking
@@ -64977,12 +64977,12 @@ proc: BEGIN
JOIN sale s ON s.ticketFk = pb.ticketFk
JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
JOIN saleGroup sg ON sg.id = sgd.saleGroupFk
- JOIN parking p ON p.id = sg.parkingFk
+ JOIN parking p ON p.id = sg.parkingFk
GROUP BY pb.ticketFk
) t ON t.ticketFk = pb.ticketFk
SET pb.previaParking = t.previaParking;
- -- Problemas por ticket
+ -- Problemas por ticket
ALTER TABLE tmp.productionBuffer
CHANGE COLUMN `problem` `problem` VARCHAR(255),
ADD COLUMN `collectionH` INT,
@@ -65263,7 +65263,7 @@ BEGIN
`yearMonth` INT
)
ENGINE = MEMORY;
-
+
WHILE vDated <= vEnded DO
INSERT INTO tmp.rangeDate
SET `dated` = vDated,
@@ -65273,7 +65273,7 @@ BEGIN
`day` = DAY(vDated),
`week` = WEEK(vDated, 1),
`yearMonth` = YEAR(vDated) * 100 + MONTH(vDated);
-
+
SET vDated = DATE_ADD(vDated, INTERVAL 1 DAY);
END WHILE;
END ;;
@@ -65362,7 +65362,7 @@ BEGIN
CALL cache.available_refresh(vCalc, FALSE, vWarehouseFk, vDate);
DROP TEMPORARY TABLE IF EXISTS tmp.recipeCook;
-
+
CREATE TEMPORARY TABLE tmp.recipeCook
SELECT *,
@counter := IF(@element = element COLLATE utf8_general_ci , @counter + 1, 1) as counter,
@@ -65380,22 +65380,22 @@ BEGIN
IFNULL((i.inkFk = r.inkFk ) ,0)
+ IFNULL((i.size = r.size) ,0)
+ IFNULL((i.name LIKE CONCAT('%',r.name,'%')) ,0)
- + IFNULL((i.longName LIKE CONCAT('%',r.longName,'%')),0)
+ + IFNULL((i.longName LIKE CONCAT('%',r.longName,'%')),0)
+ IFNULL((i.typeFk = r.typeFk),0) as matches,
i.typeFk,
rl.previousSelected
- FROM vn.recipe r
+ FROM vn.recipe r
JOIN vn.item i ON (IFNULL(i.name LIKE CONCAT('%',r.name,'%'), 0)
OR IFNULL(i.longName LIKE CONCAT('%',r.longName,'%'),0))
OR i.typeFk <=> r.typeFk
JOIN cache.available a ON a.item_id = i.id AND a.calc_id = vCalc
LEFT JOIN (SELECT recipe_ItemFk, element as log_element, selected_ItemFk, count(*) as previousSelected
FROM vn.recipe_log
- GROUP BY recipe_ItemFk, element, selected_ItemFk) rl ON rl.recipe_ItemFk = r.itemFk
+ GROUP BY recipe_ItemFk, element, selected_ItemFk) rl ON rl.recipe_ItemFk = r.itemFk
AND rl.log_element = r.element
AND rl.selected_ItemFk = i.id
WHERE r.itemFk = vItemFk
- AND a.available > vBunchesQuantity * r.quantity
+ AND a.available > vBunchesQuantity * r.quantity
UNION ALL
SELECT 100 itemFk,
CONCAT('? ',r.element,' ',IFNULL(r.size,''),' ',IFNULL(r.inkFk,'')) as longName,
@@ -65412,15 +65412,15 @@ BEGIN
WHERE r.itemFk = vItemFk
GROUP BY r.element
) sub
-
+
ORDER BY element, matches DESC, previousSelected DESC;
-
- SELECT *
+
+ SELECT *
FROM tmp.recipeCook
WHERE counter < 6
- OR itemFk = 100
+ OR itemFk = 100
;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -65445,71 +65445,71 @@ BEGIN
DECLARE vShipped DATE;
DECLARE vEntryFk INT;
DECLARE vTravelFk INT;
-
+
CALL cache.last_buy_refresh(FALSE);
-
- SELECT warehouseFk, shipped
+
+ SELECT warehouseFk, shipped
INTO vWarehouseFk, vShipped
- FROM vn.ticket
+ FROM vn.ticket
WHERE id = vTicketFk;
UPDATE vn.ticket t
JOIN vn.item i ON i.id = vItemFk
SET t.nickname = CONCAT(vQuantity,' ',i.longName)
WHERE t.id = vTicketFk;
-
+
SELECT b.buyingValue INTO vLastCost
FROM vn.buy b
JOIN cache.last_buy lb ON lb.buy_id = b.id
WHERE lb.item_id = vItemFk
ORDER BY (lb.warehouse_id = vWarehouseFk) DESC
LIMIT 1;
-
+
INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price)
SELECT vTicketFk, 98, - vQuantity, i.longName, vLastCost
FROM vn.item i
WHERE i.id = vItemFk;
- /*
+ /*
SELECT tr.id INTO vTravelFk
FROM vn.travel tr
JOIN vn.warehouse w ON w.id = tr.warehouseOutFk
WHERE tr.warehouseInFk = vWarehouseFk
AND tr.landed = vShipped
AND w.name = 'Confeccion';
-
+
IF IFNULL(vTravelFk,0) = 0 THEN
-
+
INSERT INTO vn.travel(shipped, landed, warehouseInFk, warehouseOutFk, agencyFk)
SELECT vShipped, vShipped, vWarehouseFk, w.id, am.id
- FROM vn.warehouse w
- JOIN vn.agencyMode am
+ FROM vn.warehouse w
+ JOIN vn.agencyMode am
WHERE w.name = 'Confeccion'
AND am.name = 'DIRECTO PROVEEDOR';
-
+
SET vTravelFk = LAST_INSERT_ID();
-
- END IF;
-
+
+ END IF;
+
SELECT e.id INTO vEntryFk
FROM vn.entry e
JOIN vn.supplier s ON s.id = supplierFk
WHERE e.travelFk = vTravelFk
AND s.name = 'Confeccion Natural'
AND e.isRaid = FALSE;
-
+
IF IFNULL(vEntryFk,0) = 0 THEN
-
+
INSERT INTO vn.entry(supplierFk, evaNotes, travelFk, companyFk)
SELECT s.id, t.nickname, vTravelFk, c.id
FROM vn.supplier s
JOIN vn.ticket t ON t.id = vTicketFk
- JOIN vn.company c ON c.code = 'VNL'
+ JOIN vn.company c ON c.code = 'VNL'
WHERE s.name = 'Confeccion Natural';
-
+
SET vEntryFk = LAST_INSERT_ID();
-
+
END IF;
-
+
INSERT INTO vn.buy(entryFk, itemFk, quantity, buyingValue, packageFk, packing, grouping)
SELECT vEntryFk, b.itemFk, vQuantity, b.buyingValue, b.packageFk, b.packing, b.grouping
FROM cache.last_buy lb
@@ -65611,7 +65611,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `report_print`(
)
BEGIN
/**
- * Inserts in the print queue the report to be printed and the necessary parameters for this
+ * Inserts in the print queue the report to be printed and the necessary parameters for this
* one taking into account the paper size of both the printer and the report.
*
* @param vReportName the report to be printed.
@@ -65654,11 +65654,11 @@ BEGIN
END IF;
IF vReportFk IS NULL THEN
- CALL util.throw('reportNotExists');
+ CALL util.throw('reportNotExists');
END IF;
IF vReportSize <> vPrinteSize THEN
- CALL util.throw('incorrectSize');
+ CALL util.throw('incorrectSize');
END IF;
START TRANSACTION;
@@ -65667,7 +65667,7 @@ BEGIN
priorityFk = vPriorityFk,
reportFk = vReportFk,
workerFk = vUserFk;
-
+
SET vPrintQueueFk = LAST_INSERT_ID();
WHILE vI < vLength DO
@@ -65700,16 +65700,16 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `riskAllClients`(maxRiskDate DATE)
BEGIN
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.client_list;
CREATE TEMPORARY TABLE tmp.client_list
(PRIMARY KEY (Id_Cliente))
ENGINE = MEMORY
SELECT id Id_Cliente, null grade FROM vn.client;
-
+
CALL vn2008.risk_vs_client_list(maxRiskDate);
-
- SELECT
+
+ SELECT
c.RazonSocial,
c.Id_Cliente,
c.Credito,
@@ -65721,7 +65721,7 @@ BEGIN
JOIN tmp.risk r ON r.Id_Cliente = c.Id_Cliente
JOIN tmp.client_list ci ON c.Id_Cliente = ci.Id_Cliente
GROUP BY c.Id_cliente;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.risk;
DROP TEMPORARY TABLE IF EXISTS tmp.client_list;
END ;;
@@ -65780,25 +65780,25 @@ BEGIN
DECLARE vM3 INT;
DECLARE vKg INT;
DECLARE vMatricula varchar(50);
-
+
SELECT sum(packages) as bultos
INTO vPackages
- FROM vn.ticket t
+ FROM vn.ticket t
WHERE routeFk = vRouteFk;
-
+
SELECT SUM(sv.physicalVolume), SUM(sv.physicalWeight)
INTO vM3, vKg
FROM vn.saleVolume sv
WHERE sv.routeFk = vRouteFk;
-
+
SELECT v.numberPlate as matricula
INTO vMatricula
- FROM vn.route r
+ FROM vn.route r
JOIN vn.vehicle v ON r.vehicleFk = v.id
WHERE r.id = vRouteFk;
-
+
SELECT vRouteFk as Ruta,
- vPackages as Bultos,
+ vPackages as Bultos,
vM3 as m3,
vKg as Kg,
vMatricula as Matricula;
@@ -65863,7 +65863,7 @@ BEGIN
) sub ON sub.routeFk = rm.routeFk
SET rm.ticketFree = sub.ticketFree;
- UPDATE routesMonitor rm
+ UPDATE routesMonitor rm
JOIN(
SELECT t.routeFk, COUNT(*) AS ticketPacked
FROM vn.ticket t
@@ -65949,11 +65949,11 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `routeSetOk`(
vRouteFk INT)
BEGIN
-
+
UPDATE vn.route r
SET r.isOk = 1
WHERE r.id = vRouteFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -66018,17 +66018,17 @@ proc: BEGIN
IF vIsFreelance THEN
INSERT INTO routeCommission (
- routeFk,
- workCenterFk,
- freelanceYearlyM3,
- cat4m3,
+ routeFk,
+ workCenterFk,
+ freelanceYearlyM3,
+ cat4m3,
cat5m3
)
SELECT vSelf,
r.commissionWorkCenterFk,
rc.freelanceM3 * IF(
- IFNULL(r.m3, 0) >= rc.freelanceMinM3,
- IFNULL(r.m3, 0),
+ IFNULL(r.m3, 0) >= rc.freelanceMinM3,
+ IFNULL(r.m3, 0),
0),
rc.distributionCat4M3 * IFNULL(r.m3, 0),
rc.distributionCat5M3 * IFNULL(r.m3, 0)
@@ -66040,20 +66040,20 @@ proc: BEGIN
AND r.commissionWorkCenterFk;
ELSE
INSERT INTO routeCommission (
- routeFk,
- workCenterFk,
- km,
- m3,
- yearlyKm,
- yearlyM3,
- cat4m3,
+ routeFk,
+ workCenterFk,
+ km,
+ m3,
+ yearlyKm,
+ yearlyM3,
+ cat4m3,
cat5m3
)
SELECT vSelf,
r.commissionWorkCenterFk,
- (r.kmEnd - r.kmStart) *
+ (r.kmEnd - r.kmStart) *
IF(v.isKmTruckRate, rc.kmHeavy, rc.kmLight),
- IFNULL(r.m3, 0) *
+ IFNULL(r.m3, 0) *
IF(v.isKmTruckRate, rc.deliveryM3Cat5, rc.deliveryM3Cat4),
(r.kmEnd - r.kmStart) * rc.kmYearly,
IFNULL(r.m3, 0) * rc.m3Yearly,
@@ -66090,7 +66090,7 @@ proc: BEGIN
/**
* Recalculates modified route.
*/
-
+
DECLARE vDone BOOL;
DECLARE vRouteFk INT;
@@ -66099,7 +66099,7 @@ proc: BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET vDone = TRUE;
-
+
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
DO RELEASE_LOCK('vn.route_doRecalc');
@@ -66257,27 +66257,27 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `saleBuy_Add`(vSaleFk INT, vBuyFk INT)
BEGIN
-
+
/* Añade un registro a la tabla saleBuy en el caso de que sea posible mantener la trazabilidad
- *
+ *
* @param vSaleFk clave primaria de vn.sale
* @param vBuyFk clave primaria de vn.buy
*/
- /*IF (SELECT COUNT(*)
+ /*IF (SELECT COUNT(*)
FROM vn.sale s
JOIN vn.item i ON i.id = s.itemFk
- JOIN vn.itemType it ON it.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = it.categoryFk
+ JOIN vn.itemType it ON it.id = i.typeFk
+ JOIN vn.itemCategory ic ON ic.id = it.categoryFk
WHERE s.id = vSaleFk
AND ic.code = 'fruit') THEN */
-
- IF (SELECT COUNT(*) FROM vn.buy WHERE id = vBuyFk AND itemOriginalFk) THEN
-
+
+ IF (SELECT COUNT(*) FROM vn.buy WHERE id = vBuyFk AND itemOriginalFk) THEN
+
INSERT INTO vn.saleBuy (saleFk, buyFk)
VALUES(vSaleFk, vBuyFk);
-
+
END IF;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -66301,7 +66301,7 @@ BEGIN
*
* @param vSectorFk Identificador de vn.sector
*/
- INSERT INTO vn.saleGroup(userFk, sectorFk)
+ INSERT INTO vn.saleGroup(userFk, sectorFk)
VALUES (account.myUser_getId(), vSectorFk);
SELECT LAST_INSERT_ID();
@@ -66433,41 +66433,41 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sales_merge`(vTicketFk INT)
-BEGIN
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- ROLLBACK;
- RESIGNAL;
- END;
-
- CREATE OR REPLACE TEMPORARY TABLE tSalesToPreserve
- 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 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;
+BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK;
+ RESIGNAL;
+ END;
+
+ CREATE OR REPLACE TEMPORARY TABLE tSalesToPreserve
+ 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 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 ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -66502,17 +66502,17 @@ BEGIN
OPEN cCur;
myLoop: LOOP
-
+
SET vDone = FALSE;
-
+
FETCH cCur INTO vTicketFk;
IF vDone THEN
LEAVE myLoop;
END IF;
-
+
CALL vn.sales_merge(vTicketFk);
-
+
END LOOP;
CLOSE cCur;
@@ -66643,9 +66643,9 @@ BEGIN
DELETE st.*
FROM vn.saleTracking st
JOIN vn.state s ON s.id = st.stateFk
- WHERE st.saleFk = vSaleFk
+ WHERE st.saleFk = vSaleFk
AND s.code = vState COLLATE utf8_unicode_ci;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -66662,12 +66662,12 @@ DELIMITER ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_new`(
- vSaleFK INT,
- vIsChecked BOOLEAN,
- vOriginalQuantity INT,
- vWorkerFk INT,
- vAction VARCHAR(50),
+CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_new`(
+ vSaleFK INT,
+ vIsChecked BOOLEAN,
+ vOriginalQuantity INT,
+ vWorkerFk INT,
+ vAction VARCHAR(50),
vState VARCHAR(50),
vIsScanned BOOLEAN)
BEGIN
@@ -66683,12 +66683,12 @@ BEGIN
* @param vIsScanned Identificador si se ha escaneado automáticamente o manual
*/
- REPLACE vn.saleTracking(saleFk,
- isChecked,
- originalQuantity,
- workerFk,
+ REPLACE vn.saleTracking(saleFk,
+ isChecked,
+ originalQuantity,
+ workerFk,
stateFk,
- isScanned)
+ isScanned)
SELECT vSaleFK,
vIsChecked,
vOriginalQuantity,
@@ -66715,27 +66715,27 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_updateIsChecked`(vSaleFK INT, vIsChecked BOOL, vIsScanned BOOL)
BEGIN
-
+
/**
* Actualiza el estado del campo vn.saleTracking.isChecked y elimina las lineas de vn.itemShelving
* si procede, en el caso de las preparaciones previas, por usuario
- *
+ *
* @param vSaleFk Identificador de vn.sale
* @param vIsChecked Estado del registro
*/
-
+
UPDATE vn.saleTracking st
JOIN vn.state s ON s.id = st.stateFk AND s.code = 'PREVIOUS_PREPARATION'
SET st.isChecked = vIsChecked,
st.isScanned = vIsScanned
WHERE st.saleFk = vSaleFK
AND st.workerFk = account.myUser_getId();
-
+
IF vIsChecked = FALSE THEN
-
- DELETE FROM vn.itemShelvingSale
+
+ DELETE FROM vn.itemShelvingSale
WHERE saleFk = vSaleFK;
-
+
END IF;
END ;;
@@ -66761,14 +66761,14 @@ proc: BEGIN
*
* @param vSelf Id de la venta
* @param vOption indica en que componente pone el descuadre, NULL en casos habituales
- */
+ */
CREATE OR REPLACE TEMPORARY TABLE tmp.recalculateSales
SELECT s.id
FROM sale s
WHERE s.id = vSelf;
-
+
CALL sale_recalcComponent(vOption);
-
+
DROP TEMPORARY TABLE tmp.recalculateSales;
END ;;
DELIMITER ;
@@ -66815,7 +66815,7 @@ BEGIN
GROUP BY s.id;
DECLARE CONTINUE HANDLER FOR NOT FOUND
- SET v_done = TRUE;
+ SET v_done = TRUE;
DROP TEMPORARY TABLE IF EXISTS tmp.coste;
@@ -66823,7 +66823,7 @@ BEGIN
CREATE TEMPORARY TABLE tmp.coste
(PRIMARY KEY (id)) ENGINE = MEMORY
SELECT s.id
- FROM sale s
+ FROM sale s
JOIN item i ON i.id = s.itemFk
JOIN itemType tp ON tp.id = i.typeFk
JOIN itemCategory ic ON ic.id = tp.categoryFk
@@ -66842,17 +66842,17 @@ BEGIN
IF v_done THEN
LEAVE l;
END IF;
-
+
SELECT ticketFk, concept
INTO vTicketFk, vConcept
FROM sale
WHERE id = vSaleFk;
-
+
CALL sale_calculateComponent(vSaleFk, 1);
END LOOP;
CLOSE vCur;
- DROP TEMPORARY TABLE tmp.coste;
+ DROP TEMPORARY TABLE tmp.coste;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -66938,7 +66938,7 @@ DECLARE vIsCollection BOOL;
TRIM(CONCAT(LPAD(s.concept,30,' '), ' ',
RPAD(IFNULL(i.size,''),5,' '))) line1,
'' cel1,
- TRIM(CONCAT(LPAD(IFNULL(ip.productor,''),30,' '), ' ',LPAD(IFNULL(o.code,''),4,' '))) line2,
+ TRIM(CONCAT(LPAD(IFNULL(ip.productor,''),30,' '), ' ',LPAD(IFNULL(o.code,''),4,' '))) line2,
IF(s.quantity MOD IFNULL(b.packing,s.quantity + 1),
CONCAT(CAST(s.quantity/IFNULL(b.`grouping`,1) AS DECIMAL(10,0)),' x ',IFNULL(b.`grouping`,1)),
CONCAT(CAST(s.quantity / IFNULL(b.packing,1) AS DECIMAL(10,0)),' pack de ',IFNULL(b.packing,1))) cel2,
@@ -66955,12 +66955,12 @@ DECLARE vIsCollection BOOL;
JOIN sale s ON s.ticketFk = t.id
JOIN ticket tt ON tt.id = t.id
LEFT JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = tt.warehouseFk
- LEFT JOIN buy b ON b.id = lb.buy_id
+ LEFT JOIN buy b ON b.id = lb.buy_id
JOIN item i ON i.id = s.itemFk
LEFT JOIN ticketCollection tc ON tc.ticketFk = t.id
LEFT JOIN collection c ON c.id = tc.collectionFk
- LEFT JOIN (SELECT sub.saleFk, sub.isChecked, sub.stateFk, sub.originalQuantity
- FROM (SELECT DISTINCT st.id, st.saleFk, st.isChecked, st.stateFk, st.originalQuantity
+ LEFT JOIN (SELECT sub.saleFk, sub.isChecked, sub.stateFk, sub.originalQuantity
+ FROM (SELECT DISTINCT st.id, st.saleFk, st.isChecked, st.stateFk, st.originalQuantity
FROM tmp.ticket2 t
JOIN sale s ON s.ticketFk = t.id
JOIN saleTracking st ON st.saleFk = s.id
@@ -66972,7 +66972,7 @@ DECLARE vIsCollection BOOL;
LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk
LEFT JOIN itemProductor ip ON ip.itemFk = s.itemFk
LEFT JOIN origin o ON o.id = i.originFk
- LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
+ LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
LEFT JOIN saleGroup sg ON sg.id = sgd.saleGroupFk
LEFT JOIN parking p ON p.id = sg.parkingFk
LEFT JOIN saleMistake sm ON sm.saleFk = s.id
@@ -67024,8 +67024,8 @@ BEGIN
DELETE tt.*
FROM tmp.sale_getProblems tt
JOIN vn.ticketObservation tto ON tto.ticketFk = tt.ticketFk
- JOIN vn.observationType ot ON ot.id = tto.observationTypeFk
- WHERE ot.code = 'administrative'
+ JOIN vn.observationType ot ON ot.id = tto.observationTypeFk
+ WHERE ot.code = 'administrative'
AND tto.description = 'Miriam';
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_problems (
@@ -67057,7 +67057,7 @@ BEGIN
-- Too Little
INSERT INTO tmp.sale_problems(ticketFk, isTooLittle)
- SELECT tp.ticketFk, TRUE
+ SELECT tp.ticketFk, TRUE
FROM tmp.sale_getProblems tp
JOIN vn.ticket t ON t.id = tp.ticketFk
JOIN (SELECT t.addressFk, SUM(sv.litros) litros, t.totalWithoutVat
@@ -67144,25 +67144,25 @@ BEGIN
-- Disponible: no va a haber suficiente producto para preparar todos los pedidos
CALL cache.available_refresh(vAvailableCache, FALSE, vWarehouseFk, vDate);
-
- -- Faltas: visible, disponible y ubicado son menores que la cantidad vendida
+
+ -- Faltas: visible, disponible y ubicado son menores que la cantidad vendida
CALL cache.visible_refresh(vVisibleCache, FALSE, vWarehouseFk);
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,
+ SELECT tl.ticketFk,
+ LEFT(CONCAT('F: ',GROUP_CONCAT(i.id, ' ', i.longName, ' ')),250) problem,
s.id AS saleFk
FROM tmp.ticket_list tl
JOIN vn.ticket t ON t.id = tl.ticketFk
JOIN vn.sale s ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk
JOIN vn.itemType it on it.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = it.categoryFk
+ JOIN vn.itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN cache.visible v ON v.item_id = i.id AND v.calc_id = vVisibleCache
LEFT JOIN cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache
- LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
+ LEFT JOIN vn.itemShelvingStock_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
AND IFNULL(issw.visible, 0) < s.quantity
@@ -67175,7 +67175,7 @@ BEGIN
AND t.warehouseFk = vWarehouseFk
GROUP BY tl.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
@@ -67188,7 +67188,7 @@ BEGIN
JOIN vn.itemType it on it.id = i.typeFk
JOIN vn.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 vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
+ LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible,0) >= s.quantity
AND IFNULL(issw.visible, 0) < s.quantity
AND s.quantity > 0
@@ -67201,7 +67201,7 @@ BEGIN
AND t.warehouseFk = vWarehouseFk
GROUP BY tl.ticketFk) sub
ON DUPLICATE KEY UPDATE itemDelay = 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
@@ -67215,7 +67215,7 @@ BEGIN
JOIN vn.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 cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache
- LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
+ LEFT JOIN vn.itemShelvingStock_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
AND IFNULL(issw.visible, 0) < s.quantity
@@ -67235,13 +67235,13 @@ BEGIN
INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
SELECT ticketFk, problem, saleFk
FROM (
- SELECT
- tl.ticketFk,
+ SELECT
+ tl.ticketFk,
s.id saleFk ,
- LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,''), ' '), 250) problem,
+ LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,''), ' '), 250) problem,
MOD(s.quantity, b.`grouping`) hasRounding
FROM tmp.ticket_list tl
- JOIN ticket t ON t.id = tl.ticketFk
+ 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
@@ -67249,12 +67249,12 @@ BEGIN
JOIN buy b ON b.id = bu.buyFk
GROUP BY tl.ticketFk
HAVING hasRounding
- ) sub
+ ) 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
@@ -67284,16 +67284,16 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_getProblemsByTicket`(IN vTicketFk INT, IN vIsTodayRelative TINYINT(1))
BEGIN
/**
- * Calcula los problemas de cada venta
+ * Calcula los problemas de cada venta
* para un conjunto de tickets.
*
* @return Problems result
*/
DROP TEMPORARY TABLE IF EXISTS tmp.sale_getProblems;
- CREATE TEMPORARY TABLE tmp.sale_getProblems
+ CREATE TEMPORARY TABLE tmp.sale_getProblems
(INDEX (ticketFk))
ENGINE = MEMORY
- SELECT t.id ticketFk, t.clientFk, t.warehouseFk, t.shipped
+ SELECT t.id ticketFk, t.clientFk, t.warehouseFk, t.shipped
FROM ticket t
WHERE t.id = vTicketFk;
@@ -67322,7 +67322,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_PriceFix`(vTicketFk INT)
BEGIN
-
+
DELETE sc.*
FROM vn.saleComponent sc
JOIN vn.sale s ON s.id = sc.saleFk
@@ -67358,52 +67358,52 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_recalcComponent`(vOption INT)
proc: BEGIN
/**
- * Este procedimiento recalcula los componentes de un conjunto de sales,
+ * Este procedimiento recalcula los componentes de un conjunto de sales,
* eliminando los componentes existentes e insertandolos de nuevo
*
* @param vOption si no se quiere forzar llamar con NULL
* @table tmp.recalculateSales (id)
- */
- DECLARE vShipped DATE;
+ */
+ DECLARE vShipped DATE;
DECLARE vWarehouseFk SMALLINT;
DECLARE vAgencyModeFk INT;
DECLARE vAddressFk INT;
DECLARE vTicketFk INT;
- DECLARE vLanded DATE;
+ DECLARE vLanded DATE;
DECLARE vIsEditable BOOLEAN;
DECLARE vZoneFk INTEGER;
DECLARE vDone BOOL DEFAULT FALSE;
-
+
DECLARE vCur CURSOR FOR
SELECT DISTINCT s.ticketFk
FROM tmp.recalculateSales rs
JOIN vn.sale s ON s.id = rs.id;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
+
OPEN vCur;
l: LOOP
SET vDone = FALSE;
- FETCH vCur INTO vTicketFk;
-
+ FETCH vCur INTO vTicketFk;
+
IF vDone THEN
LEAVE l;
END IF;
- SELECT (hasToRecalcPrice OR ts.alertLevel IS NULL) AND t.refFk IS NULL,
- t.zoneFk,
- t.warehouseFk,
- t.shipped,
- t.addressFk,
- t.agencyModeFk,
+ SELECT (hasToRecalcPrice OR ts.alertLevel IS NULL) AND t.refFk IS NULL,
+ t.zoneFk,
+ t.warehouseFk,
+ t.shipped,
+ t.addressFk,
+ t.agencyModeFk,
t.landed
- INTO vIsEditable,
- vZoneFk,
- vWarehouseFk,
- vShipped,
- vAddressFk,
- vAgencyModeFk,
+ INTO vIsEditable,
+ vZoneFk,
+ vWarehouseFk,
+ vShipped,
+ vAddressFk,
+ vAgencyModeFk,
vLanded
FROM ticket t
LEFT JOIN ticketState ts ON t.id = ts.ticket
@@ -67411,31 +67411,31 @@ proc: BEGIN
WHERE t.id = vTicketFk;
CALL zone_getLanded(vShipped, vAddressFk, vAgencyModeFk, vWarehouseFk, TRUE);
-
+
IF NOT EXISTS (SELECT TRUE FROM tmp.zoneGetLanded LIMIT 1) THEN
CALL util.throw(CONCAT('There is no zone for these parameters ', vTicketFk));
END IF;
-
+
IF vLanded IS NULL OR vZoneFk IS NULL THEN
-
+
UPDATE ticket t
- SET t.landed = (SELECT landed FROM tmp.zoneGetLanded LIMIT 1)
+ SET t.landed = (SELECT landed FROM tmp.zoneGetLanded LIMIT 1)
WHERE t.id = vTicketFk AND t.landed IS NULL;
-
+
IF vZoneFk IS NULL THEN
SELECT zoneFk INTO vZoneFk FROM tmp.zoneGetLanded LIMIT 1;
UPDATE ticket t
SET t.zoneFk = vZoneFk
WHERE t.id = vTicketFk AND t.zoneFk IS NULL;
END IF;
-
+
END IF;
-
+
DROP TEMPORARY TABLE tmp.zoneGetLanded;
-
- -- rellena la tabla buyUltimate con la ultima compra
- CALL buyUltimate (vWarehouseFk, vShipped);
-
+
+ -- rellena la tabla buyUltimate con la ultima compra
+ CALL buyUltimate (vWarehouseFk, vShipped);
+
CREATE OR REPLACE TEMPORARY TABLE tmp.sale
(PRIMARY KEY (saleFk)) ENGINE = MEMORY
SELECT s.id saleFk, vWarehouseFk warehouseFk
@@ -67443,7 +67443,7 @@ proc: BEGIN
JOIN tmp.recalculateSales rs ON s.id = rs.id
WHERE s.ticketFk = vTicketFk;
- CREATE OR REPLACE TEMPORARY TABLE tmp.ticketLot
+ CREATE OR REPLACE TEMPORARY TABLE tmp.ticketLot
SELECT vWarehouseFk warehouseFk, NULL available, s.itemFk, bu.buyFk, vZoneFk zoneFk
FROM sale s
JOIN tmp.recalculateSales rs ON s.id = rs.id
@@ -67457,15 +67457,15 @@ proc: BEGIN
IF vOption IS NULL THEN
SET vOption = IF(vIsEditable, 1, 6);
END IF;
-
- CALL ticketComponentUpdateSale(vOption);
+
+ CALL ticketComponentUpdateSale(vOption);
CALL catalog_componentPurge();
-
+
DROP TEMPORARY TABLE tmp.buyUltimate;
DROP TEMPORARY TABLE tmp.sale;
-
+
END LOOP;
- CLOSE vCur;
+ CLOSE vCur;
END ;;
DELIMITER ;
@@ -67486,22 +67486,22 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sectorCollectionSaleGroup_add`(vSaleGroupFk INT, vSectorCollectionFk INT)
BEGIN
/**
- * Inserta un nuevo registro en vn.sectorCollectionSaleGroup
+ * Inserta un nuevo registro en vn.sectorCollectionSaleGroup
* Actualiza el usuario en vn.saleGroup y reemplaza los registros de vn.saleTracking
- *
+ *
* @param vSaleGroupFk Identificador de vn.saleGroup
* @param vSectorCollectionFk Identificador de vn.sectorCollection
*/
REPLACE sectorCollectionSaleGroup
- SET sectorCollectionFk = vSectorCollectionFk,
+ SET sectorCollectionFk = vSectorCollectionFk,
saleGroupFk = vSaleGroupFk;
-
+
UPDATE saleGroup sg
JOIN sectorCollectionSaleGroup scsg ON scsg.saleGroupFk = sg.id
JOIN sectorCollection sc ON sc.id = scsg.sectorCollectionFk
- SET sg.userFk = sc.userFk
+ SET sg.userFk = sc.userFk
WHERE sg.id = vSaleGroupFk;
-
+
INSERT IGNORE saleTracking(
saleFk,
isChecked,
@@ -67513,8 +67513,8 @@ BEGIN
sc.userFk,
s.id
FROM saleGroupDetail sgd
- JOIN sectorCollectionSaleGroup scsg
- ON scsg.saleGroupFk = sgd.saleGroupFk
+ JOIN sectorCollectionSaleGroup scsg
+ ON scsg.saleGroupFk = sgd.saleGroupFk
JOIN sectorCollection sc ON sc.id = scsg.sectorCollectionFk
JOIN state s ON s.code = 'PREVIOUS_PREPARATION'
WHERE sgd.saleGroupFk = vSaleGroupFk;
@@ -67615,30 +67615,30 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sectorCollection_new`(vSectorFk INT)
-BEGIN
-/**
- * Inserta una nueva colección, si el usuario no tiene ninguna vacia.
- * Esto se hace para evitar que por error se generen colecciones sin sentido.
- *
- * @param vSectorFk Identificador de #vn.sector
- */
- DECLARE hasEmptyCollections BOOL;
- DECLARE vUserFk INT;
-
- SET vUserFk = account.myUser_getId();
-
- SELECT (COUNT(sc.id) > 0) INTO hasEmptyCollections
- FROM vn.sectorCollection sc
- LEFT JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
- WHERE ISNULL(scsg.id)
- AND sc.userFk = vUserFk
- AND sc.sectorFk = vSectorFk
- AND sc.created >= util.VN_CURDATE();
-
- IF NOT hasEmptyCollections THEN
- INSERT INTO vn.sectorCollection(userFk, sectorFk)
- VALUES(vUserFk, vSectorFk);
- END IF;
+BEGIN
+/**
+ * Inserta una nueva colección, si el usuario no tiene ninguna vacia.
+ * Esto se hace para evitar que por error se generen colecciones sin sentido.
+ *
+ * @param vSectorFk Identificador de #vn.sector
+ */
+ DECLARE hasEmptyCollections BOOL;
+ DECLARE vUserFk INT;
+
+ SET vUserFk = account.myUser_getId();
+
+ SELECT (COUNT(sc.id) > 0) INTO hasEmptyCollections
+ FROM vn.sectorCollection sc
+ LEFT JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
+ WHERE ISNULL(scsg.id)
+ AND sc.userFk = vUserFk
+ AND sc.sectorFk = vSectorFk
+ AND sc.created >= util.VN_CURDATE();
+
+ IF NOT hasEmptyCollections THEN
+ INSERT INTO vn.sectorCollection(userFk, sectorFk)
+ VALUES(vUserFk, vSectorFk);
+ END IF;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -67774,7 +67774,7 @@ BEGIN
SELECT s.warehouseFk
FROM vn.sector s
WHERE s.id = vSectorFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -67869,10 +67869,10 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `shelvingChange`(IN `vShelvingO` VAR
BEGIN
UPDATE vn.itemShelving
- SET shelvingFk = vShelvingD COLLATE utf8_unicode_ci
- WHERE shelvingFk = vShelvingO COLLATE utf8_unicode_ci;
-
-
+ SET shelvingFk = vShelvingD COLLATE utf8_unicode_ci
+ WHERE shelvingFk = vShelvingO COLLATE utf8_unicode_ci;
+
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -67891,16 +67891,16 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `shelvingLog_get`(shelvingFk VARCHAR(10))
BEGIN
-
+
/* Lista el log de un carro
- *
+ *
* @param shelvingFk matrícula del carro
- *
+ *
*/
-
+
SELECT originFk, name, creationDate, description
FROM shelvingLog sl
- JOIN account.user u ON u.id = sl.userFk
+ JOIN account.user u ON u.id = sl.userFk
WHERE sl.originFk = shelvingFk COLLATE utf8_general_ci
ORDER BY creationDate DESC;
@@ -67923,22 +67923,22 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `shelvingParking_get`(vShelvingFk VARCHAR(10), vWarehouseFk INT, vDayRange INT)
BEGIN
-
-SELECT s.itemFk,
+
+SELECT s.itemFk,
s.concept,
- CAST(SUM(s.quantity) AS DECIMAL(10,0)) as sinServir,
- CAST(IFNULL(ist.visible,0) AS DECIMAL(10,0)) as aparcado
+ CAST(SUM(s.quantity) AS DECIMAL(10,0)) as sinServir,
+ CAST(IFNULL(ist.visible,0) AS DECIMAL(10,0)) as aparcado
FROM vn.sale s
LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id
JOIN vn.ticket t ON t.id = s.ticketFk
LEFT JOIN vn.itemShelvingStock ist ON ist.itemFk = s.itemFk AND ist.warehouseFk = vWarehouseFk
JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk AND ish.shelvingFk = vShelvingFk COLLATE utf8_general_ci
- WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(TIMESTAMPADD(DAY, GREATEST(0,vDayRange), util.VN_CURDATE()))
+ WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(TIMESTAMPADD(DAY, GREATEST(0,vDayRange), util.VN_CURDATE()))
AND iss.saleFk IS NULL
AND t.warehouseFk = vWarehouseFk
GROUP BY s.itemFk
HAVING sinServir > aparcado;
-
+
END ;;
DELIMITER ;
@@ -67983,12 +67983,12 @@ BEGIN
DELETE FROM vn.shelving
WHERE length(code) > 3
AND parked < TIMESTAMPADD(WEEK,-1,util.VN_CURDATE());
-
+
DELETE FROM vn.itemShelving
WHERE visible <= 0
AND created < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE());
- DELETE ish.*
+ DELETE ish.*
FROM vn.itemShelving ish
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
WHERE sh.parkingFk IS NULL
@@ -67996,12 +67996,12 @@ BEGIN
UPDATE vn.shelving sh
LEFT JOIN vn.itemShelving its ON its.shelvingFk = sh.`code`
- SET isPrinted = 0,
+ SET isPrinted = 0,
parkingFk = NULL
WHERE its.id IS NULL
- AND sh.isRecyclable
- AND ( sh.parked IS NULL
- OR
+ AND sh.isRecyclable
+ AND ( sh.parked IS NULL
+ OR
sh.parked < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())
);
@@ -68178,20 +68178,20 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `solunionRiskRequest`()
BEGIN
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.client_list;
CREATE TEMPORARY TABLE tmp.client_list
(PRIMARY KEY (Id_Cliente))
ENGINE = MEMORY
- SELECT * FROM (SELECT cc.client Id_Cliente, ci.grade FROM vn.creditClassification cc
+ SELECT * FROM (SELECT cc.client Id_Cliente, ci.grade FROM vn.creditClassification cc
JOIN vn.creditInsurance ci ON cc.id = ci.creditClassification
WHERE dateEnd IS NULL
ORDER BY ci.creationDate DESC
LIMIT 10000000000000000000) t1 GROUP BY Id_Cliente;
-
+
CALL vn2008.risk_vs_client_list(util.VN_CURDATE());
-
- SELECT
+
+ SELECT
c.Id_Cliente, c.Cliente, c.Credito credito_vn, c.creditInsurance solunion, cast(r.risk as DECIMAL(10,0)) riesgo_vivo,
cast(c.creditInsurance - r.risk as decimal(10,0)) margen_vivo,
f.Consumo consumo_anual, c.Vencimiento, ci.grade
@@ -68201,7 +68201,7 @@ BEGIN
JOIN tmp.client_list ci ON c.Id_Cliente = ci.Id_Cliente
JOIN bi.facturacion_media_anual f ON c.Id_Cliente = f.Id_Cliente
GROUP BY Id_cliente;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.risk;
DROP TEMPORARY TABLE IF EXISTS tmp.client_list;
END ;;
@@ -68416,10 +68416,10 @@ BEGIN
DECLARE vBossId INT;
DECLARE vDone BOOL;
DECLARE workerCur CURSOR FOR
- SELECT workerFk
- FROM tmp.subordinate
+ SELECT workerFk
+ FROM tmp.subordinate
WHERE NOT isChecked;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DECLARE EXIT HANDLER FOR 1062 BEGIN
@@ -68427,29 +68427,29 @@ BEGIN
END;
DROP TEMPORARY TABLE IF EXISTS tmp.subordinate;
-
+
CREATE TEMPORARY TABLE tmp.subordinate
(PRIMARY KEY (workerFk))
ENGINE = MEMORY
SELECT vBossFk AS workerFk, 0 AS isChecked;
-
+
WHILE (SELECT COUNT(*) FROM tmp.subordinate WHERE NOT isChecked) > 0 DO
OPEN workerCur;
workerLoop: LOOP
SET vDone = FALSE;
FETCH workerCur INTO vBossId;
-
+
IF vDone THEN
LEAVE workerLoop;
END IF;
-
- INSERT INTO tmp.subordinate
- SELECT id, 0
- FROM worker
+
+ INSERT INTO tmp.subordinate
+ SELECT id, 0
+ FROM worker
WHERE bossFk = vBossId;
-
- UPDATE tmp.subordinate
+
+ UPDATE tmp.subordinate
SET isChecked = 1
WHERE workerFk = vBossId;
END LOOP;
@@ -68489,13 +68489,13 @@ BEGIN
-- Calcula el balance inicial y final de cada proveedor
INSERT INTO openingBalance
SELECT MAX(dueDated),
- supplierFk,
- companyFk,
+ supplierFk,
+ companyFk,
sum(amount) eurAmount,
sum(divisa) foreignAmount
FROM (
SELECT p.dueDated,
- p.supplierFk,
+ p.supplierFk,
p.companyFk,
p.amount,
p.divisa
@@ -68511,7 +68511,7 @@ BEGIN
SELECT iidd.dueDated,
ii.supplierFk,
ii.companyFk,
- - iidd.amount,
+ - iidd.amount,
- iidd.foreignValue
FROM invoiceIn ii
JOIN invoiceInDueDay iidd ON ii.id = iidd.invoiceInFk
@@ -68519,14 +68519,14 @@ BEGIN
JOIN company co ON co.id = ii.companyFk
WHERE iidd.dueDated > '2014-12-31'
AND iidd.dueDated <= vEnded
- AND ii.isBooked AND co.`code` = 'VNL'
+ AND ii.isBooked AND co.`code` = 'VNL'
AND c.`code` <> 'EUR'
UNION ALL
SELECT se.dueDated,
se.supplierFk,
se.companyFk,
- - se.amount,
+ - se.amount,
0
FROM supplierExpense se
JOIN currency c ON c.id = se.currencyFk
@@ -68536,7 +68536,7 @@ BEGIN
AND co.`code` = 'VNL' AND c.`code` <> 'EUR'
) sub
GROUP BY companyFk, supplierFk;
-
+
SELECT ob.dueDated
, ob.supplierFk
, ob.companyFk
@@ -68750,7 +68750,7 @@ BEGIN
- SUM(iid.amount) mysql,
0 sage
FROM invoiceInDueDay iid
- JOIN invoiceIn ii ON ii.id = iid.invoiceInFk
+ JOIN invoiceIn ii ON ii.id = iid.invoiceInFk
WHERE IFNULL(ii.bookEntried, ii.issued) BETWEEN vDateFrom AND vDateTo
AND ii.isBooked
GROUP BY ii.id
@@ -68889,15 +68889,15 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketBoxesView`(IN vTicketFk INT)
BEGIN
-
- SELECT s.id,
- s.itemFk,
- s.concept,
- floor(s.quantity / b.packing) as Cajas,
- b.packing,
- s.isPicked,
+
+ SELECT s.id,
+ s.itemFk,
+ s.concept,
+ floor(s.quantity / b.packing) as Cajas,
+ b.packing,
+ s.isPicked,
i.size
- FROM ticket t
+ FROM ticket t
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk
JOIN cache.last_buy lb on lb.warehouse_id = t.warehouseFk AND lb.item_id = s.itemFk
@@ -68908,7 +68908,7 @@ BEGIN
AND p.isBox
GROUP BY s.itemFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -68930,7 +68930,7 @@ BEGIN
DECLARE vDateStart DATETIME DEFAULT DATE(vDate);
DECLARE vDateEnd DATETIME DEFAULT util.dayEnd(vDate);
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketBuiltTime;
CREATE TEMPORARY TABLE tmp.ticketBuiltTime
@@ -68943,7 +68943,7 @@ BEGIN
SELECT ticketFk, builtTime
FROM
(
- SELECT
+ SELECT
ticketFk,
created as builtTime
FROM
@@ -68951,13 +68951,13 @@ BEGIN
WHERE created BETWEEN vDateStart AND vDateEnd
ORDER BY ticketFk, created DESC
LIMIT 10000000000000000000
- ) sub
+ ) sub
GROUP BY ticketFk
) sub2 ON sub2.ticketFk = t.id
WHERE t.shipped BETWEEN vDate AND util.dayEnd(vDate)
AND t.clientFk NOT IN (50,400,200)
AND t.companyFk = 442
-
+
;
END ;;
@@ -68986,30 +68986,30 @@ BEGIN
*/
REPLACE INTO orderTicket(orderFk,ticketFk)
- SELECT orderFk, vTicketNew
- FROM orderTicket
+ SELECT orderFk, vTicketNew
+ FROM orderTicket
WHERE ticketFk = vTicketOld;
-
+
-- Bionizamos lineas con Preu = 0
CREATE OR REPLACE TEMPORARY TABLE tmp.recalculateSales
(PRIMARY KEY (id)) ENGINE = MEMORY
- SELECT id
+ SELECT id
FROM sale
WHERE ticketFk = vTicketNew AND price = 0;
-
+
CALL sale_recalcComponent(1);
-- Bionizamos lineas con Preu > 0
CREATE OR REPLACE TEMPORARY TABLE tmp.recalculateSales
(PRIMARY KEY (id)) ENGINE = MEMORY
- SELECT id
+ SELECT id
FROM sale
WHERE ticketFk = vTicketNew AND price > 0;
-
+
CALL sale_recalcComponent(6);
DROP TEMPORARY TABLE IF EXISTS tmp.recalculateSales;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69032,12 +69032,12 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCalculateFromType`( vLanded D
vTypeFk INT)
BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.item;
- CREATE TEMPORARY TABLE tmp.item
- (INDEX (itemFk))
- ENGINE = MEMORY
+ CREATE TEMPORARY TABLE tmp.item
+ (INDEX (itemFk))
+ ENGINE = MEMORY
SELECT id itemFk FROM vn.item
WHERE typeFk = vTypeFk;
-
+
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
DROP TEMPORARY TABLE tmp.item;
DROP TEMPORARY TABLE tmp.ticketLot;
@@ -69059,7 +69059,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCalculatePurge`()
BEGIN
- DROP TEMPORARY TABLE
+ DROP TEMPORARY TABLE
tmp.ticketCalculateItem,
tmp.ticketComponentPrice,
tmp.ticketComponent,
@@ -69083,56 +69083,56 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketClon`(vTicketFk INT, vNewShipped DATE)
BEGIN
-
+
DECLARE done INT DEFAULT FALSE;
- DECLARE vNewTicketFk INT;
+ DECLARE vNewTicketFk INT;
DECLARE vOldSaleFk INT;
DECLARE vNewSaleFk INT;
-
+
DECLARE cur1 CURSOR FOR
SELECT id
FROM vn.sale
WHERE ticketFk = vTicketFk;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
-
+
SET vNewShipped = IFNULL(vNewShipped, util.VN_CURDATE());
-
+
CALL vn.ticket_Clone(vTicketFk, vNewTicketFk);
-
- UPDATE vn.ticket
+
+ UPDATE vn.ticket
SET landed = TIMESTAMPADD(DAY, DATEDIFF(vNewShipped, shipped), landed),
shipped = vNewShipped
WHERE id = vNewTicketFk;
-
+
OPEN cur1;
-
+
read_loop: LOOP
-
+
FETCH cur1 INTO vOldSaleFk;
-
+
IF done THEN
LEAVE read_loop;
END IF;
-
+
INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed)
SELECT vNewTicketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed
FROM vn.sale
WHERE id = vOldSaleFk;
-
+
SELECT max(id) INTO vNewSaleFk
FROM vn.sale
WHERE ticketFk = vNewTicketFk;
-
+
INSERT INTO vn.saleComponent(saleFk, componentFk, value, isGreuge)
SELECT vNewSaleFk, componentFk, value, isGreuge
FROM vn.saleComponent
WHERE saleFk = vOldSaleFk;
-
+
END LOOP;
CLOSE cur1;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69154,18 +69154,18 @@ BEGIN
DECLARE vShipped DATE;
DECLARE vMaxDated DATE;
-
- SELECT shipped, TIMESTAMPADD(YEAR,1,shipped)
+
+ SELECT shipped, TIMESTAMPADD(YEAR,1,shipped)
INTO vShipped, vMaxDated
FROM vn.ticket
WHERE id = vTicketFk;
-
+
WHILE vShipped <= vMaxDated DO
-
+
SET vShipped = TIMESTAMPADD(WEEK, 1, vShipped);
-
+
CALL vn.ticketClon(vTicketFk, vShipped);
-
+
END WHILE;
END ;;
@@ -69187,10 +69187,10 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCollection_get`(vTicketFk INT)
BEGIN
- SELECT tc.collectionFk
+ SELECT tc.collectionFk
FROM vn.ticketCollection tc
WHERE ticketFk = vTicketFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69209,18 +69209,18 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCollection_setUsedShelves`(vTicketFk INT, vUsedShelves INT)
BEGIN
-
+
/*
* Inserta número de baldas que ocupa un ticket
- *
+ *
* @param vTicketFk Identificador de ticket
* @param vUsedShelves Número de baldas
*/
-
+
UPDATE ticketCollection tc
SET tc.usedShelves = vUsedShelves
WHERE tc.ticketFk = vTicketFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69258,18 +69258,18 @@ BEGIN
END;
START TRANSACTION;
-
+
IF (SELECT addressFk FROM ticket WHERE id = vTicketFk) <> vAddressFk THEN
-
- UPDATE ticket t
+
+ UPDATE ticket t
JOIN address a ON a.id = vAddressFk
SET t.nickname = a.nickname
WHERE t.id = vTicketFk;
-
+
END IF;
-
+
UPDATE ticket t
- SET
+ SET
t.clientFk = vClientFk,
t.agencyModeFk = vAgencyModeFk,
t.addressFk = vAddressFk,
@@ -69280,12 +69280,12 @@ BEGIN
t.isDeleted = vIsDeleted
WHERE
t.id = vTicketFk;
-
+
IF vHasToBeUnrouted THEN
UPDATE ticket t SET t.routeFk = NULL
WHERE t.id = vTicketFk;
END IF;
-
+
IF vOption <> 8 THEN
DROP TEMPORARY TABLE IF EXISTS tmp.sale;
CREATE TEMPORARY TABLE tmp.sale
@@ -69327,104 +69327,104 @@ BEGIN
DECLARE vComponentFk INT;
DECLARE vRenewComponents BOOLEAN;
DECLARE vKeepPrices BOOLEAN;
-
+
CASE vOption
- WHEN 1 THEN
+ WHEN 1 THEN
SET vRenewComponents = TRUE;
SET vKeepPrices = FALSE;
WHEN 2 THEN
- SELECT id INTO vComponentFk FROM component WHERE `code` = 'debtCollection';
+ SELECT id INTO vComponentFk FROM component WHERE `code` = 'debtCollection';
SET vRenewComponents = TRUE;
SET vKeepPrices = TRUE;
- WHEN 3 THEN
- SELECT id INTO vComponentFk FROM component WHERE `code` = 'mana';
- SET vRenewComponents = TRUE;
- SET vKeepPrices = TRUE;
- WHEN 4 THEN
- SELECT id INTO vComponentFk FROM component WHERE `code` = 'buyerDiscount';
+ WHEN 3 THEN
+ SELECT id INTO vComponentFk FROM component WHERE `code` = 'mana';
SET vRenewComponents = TRUE;
SET vKeepPrices = TRUE;
- /* WHEN 5 THEN
+ WHEN 4 THEN
+ SELECT id INTO vComponentFk FROM component WHERE `code` = 'buyerDiscount';
+ SET vRenewComponents = TRUE;
+ SET vKeepPrices = TRUE;
+ /* WHEN 5 THEN
SET vComponentFk = 35;
SET vRenewComponents = TRUE;
SET vKeepPrices = TRUE;*/
- WHEN 6 THEN
+ WHEN 6 THEN
SELECT id INTO vComponentFk FROM component WHERE `code` = 'imbalance';
SET vRenewComponents = TRUE;
SET vKeepPrices = TRUE;
WHEN 7 THEN
REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.8, 3)
+ SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.8, 3)
FROM sale s
JOIN tmp.sale tmps ON tmps.saleFk = s.id
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
+ LEFT JOIN saleComponent sc ON sc.saleFk = s.id
AND sc.componentFk NOT IN (28, 29)
GROUP BY s.id;
-
+
REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 29, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.2, 3)
+ SELECT s.id, 29, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.2, 3)
FROM sale s
JOIN tmp.sale tmps ON tmps.saleFk = s.id
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
+ LEFT JOIN saleComponent sc ON sc.saleFk = s.id
AND sc.componentFk NOT IN (28, 29)
GROUP BY s.id;
-
+
SET vRenewComponents = FALSE;
SET vKeepPrices = FALSE;
WHEN 8 THEN
- DELETE sc.*
+ DELETE sc.*
FROM tmp.sale tmps JOIN saleComponent sc ON sc.saleFk = tmps.saleFk;
-
+
REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100)), 3)
+ SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100)), 3)
FROM sale s
JOIN tmp.sale tmps ON tmps.saleFk = s.id;
-
+
SET vRenewComponents = FALSE;
SET vKeepPrices = FALSE;
- WHEN 9 THEN
+ WHEN 9 THEN
SET vRenewComponents = TRUE;
SET vKeepPrices = TRUE;
END CASE;
IF vRenewComponents THEN
- DELETE sc.*
- FROM tmp.sale tmps
+ DELETE sc.*
+ FROM tmp.sale tmps
JOIN saleComponent sc ON sc.saleFk = tmps.saleFk
JOIN `component` c ON c.id = sc.componentFk
WHERE c.isRenewable;
-
+
REPLACE INTO saleComponent(saleFk, componentFk, value)
SELECT s.id, tc.componentFk, tc.cost
- FROM sale s
+ FROM sale s
JOIN tmp.sale tmps ON tmps.saleFk = s.id
JOIN tmp.ticketComponent tc ON tc.itemFk = s.itemFk AND tc.warehouseFk = tmps.warehouseFk
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
- AND sc.componentFk = tc.componentFk
- LEFT JOIN `component` c ON c.id = tc.componentFk
+ LEFT JOIN saleComponent sc ON sc.saleFk = s.id
+ AND sc.componentFk = tc.componentFk
+ LEFT JOIN `component` c ON c.id = tc.componentFk
WHERE IF(sc.componentFk IS NULL AND NOT c.isRenewable, FALSE, TRUE);
-
- -- Añadir componente venta por paquete
+
+ -- Añadir componente venta por paquete
DROP TEMPORARY TABLE IF EXISTS tmp.sale2;
CREATE TEMPORARY TABLE tmp.sale2
(PRIMARY KEY (saleFk))
- ENGINE = MEMORY
+ ENGINE = MEMORY
SELECT * FROM tmp.sale;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponent2;
CREATE TEMPORARY TABLE tmp.ticketComponent2
- SELECT * FROM tmp.ticketComponent;
-
- REPLACE INTO saleComponent(saleFk, componentFk, value)
+ SELECT * FROM tmp.ticketComponent;
+
+ REPLACE INTO saleComponent(saleFk, componentFk, value)
SELECT t.id, t.componentFk, t.cost
FROM (
SELECT s.id, tc.componentFk, tc.cost, MOD(s.quantity, b.packing) as resto
FROM vn.sale s
JOIN tmp.sale tmps ON tmps.saleFk = s.id
- JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND tmps.warehouseFk = lb.warehouse_id
+ JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND tmps.warehouseFk = lb.warehouse_id
JOIN vn.buy b ON b.id = buy_id
JOIN tmp.ticketComponent tc ON tc.itemFk = s.itemFk AND tc.warehouseFk = tmps.warehouseFk
- JOIN `component` c ON c.id = tc.componentFk AND c.code = 'salePerPackage'
+ JOIN `component` c ON c.id = tc.componentFk AND c.code = 'salePerPackage'
LEFT JOIN (
SELECT s.id
FROM vn.sale s
@@ -69435,8 +69435,8 @@ BEGIN
) tp ON tp.id = s.id
WHERE tp.id IS NULL
HAVING resto <> 0) t;
-
- DROP TEMPORARY TABLE IF EXISTS
+
+ DROP TEMPORARY TABLE IF EXISTS
tmp.sale2,
tmp.ticketComponent2;
END IF;
@@ -69454,26 +69454,26 @@ BEGIN
UPDATE sale s
JOIN item i on i.id = s.itemFk
JOIN itemType it on it.id = i.typeFk
- JOIN (SELECT SUM(sc.value) sumValue, sc.saleFk
+ JOIN (SELECT SUM(sc.value) sumValue, sc.saleFk
FROM saleComponent sc
JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
GROUP BY sc.saleFk) sc ON sc.saleFk = s.id
SET s.price = sumValue / ((100 - s.discount) / 100)
- WHERE it.code != 'PRT' ;
-
+ WHERE it.code != 'PRT' ;
+
REPLACE INTO saleComponent(saleFk, componentFk, value)
SELECT s.id, 21, ROUND((s.price * (100 - s.discount) / 100) - SUM(value), 3) saleValue
FROM sale s
JOIN tmp.sale tmps ON tmps.saleFk = s.id
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
WHERE sc.componentFk != 21
- GROUP BY s.id
+ GROUP BY s.id
HAVING ROUND(saleValue, 4) <> 0;
END IF;
-
+
UPDATE sale s
JOIN (
- SELECT SUM(sc.value) sumValue, sc.saleFk
+ SELECT SUM(sc.value) sumValue, sc.saleFk
FROM saleComponent sc
JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
JOIN `component` c ON c.id = sc.componentFk
@@ -69487,10 +69487,10 @@ BEGIN
JOIN sale s on s.id = sc.saleFk
JOIN item i ON i.id = s.itemFk
JOIN itemType it ON it.id = i.typeFk
- WHERE it.code = 'PRT';
-
+ WHERE it.code = 'PRT';
+
INSERT INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 15, s.price
+ SELECT s.id, 15, s.price
FROM sale s
JOIN tmp.sale tmps ON tmps.saleFk = s.id
JOIN item i ON i.id = s.itemFK
@@ -69557,24 +69557,24 @@ BEGIN
CREATE TEMPORARY TABLE tmp.ticket
ENGINE = MEMORY
SELECT vTicketFk ticketFk;
-
+
CALL vn.ticket_getTax(NULL);
- SELECT
+ SELECT
tt.ticketFk,
CAST(tt.taxableBase AS DECIMAL(10, 2)) AS taxableBase,
CAST(tt.rate * tt.taxableBase / 100 AS DECIMAL(10, 2)) AS tax,
- pgc.*,
+ pgc.*,
CAST(IF(pe.equFk IS NULL, taxableBase, 0) AS DECIMAL(10, 2)) AS Base,
pgc.rate / 100 as vatPercent
FROM tmp.ticketTax tt
JOIN vn.pgc ON pgc.code = tt.pgcFk
LEFT JOIN vn.pgcEqu pe ON pe.equFk = pgc.code;
-
+
DROP TEMPORARY TABLE tmp.ticket;
DROP TEMPORARY TABLE tmp.ticketTax;
DROP TEMPORARY TABLE tmp.ticketAmount;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69612,29 +69612,29 @@ BEGIN
JOIN ticket t ON t.id = tmpTicket.ticketFk;
CALL addressTaxArea ();
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax;
CREATE TEMPORARY TABLE tmp.ticketTax
(INDEX (ticketFk))
ENGINE = MEMORY
SELECT tmpTicket.ticketFk,
bp.pgcFk,
- SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2)
+ SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2)
) AS taxableBase,
SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2)
) * pgc.rate / 100 AS tax,
tc.code
-
+
FROM tmp.ticket tmpTicket
JOIN sale s ON s.ticketFk = tmpTicket.ticketFk
JOIN item i ON i.id = s.itemFk
JOIN ticket t ON t.id = tmpTicket.ticketFk
JOIN supplier su ON su.id = t.companyFk
- JOIN tmp.addressTaxArea ata
+ JOIN tmp.addressTaxArea ata
ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk
- JOIN itemTaxCountry itc
+ JOIN itemTaxCountry itc
ON itc.itemFk = i.id AND itc.countryFk = su.countryFk
- JOIN bookingPlanner bp
+ JOIN bookingPlanner bp
ON bp.countryFk = su.countryFk
AND bp.taxAreaFk = ata.areaFk
AND bp.taxClassFk = itc.taxClassFk
@@ -69642,7 +69642,7 @@ BEGIN
JOIN taxClass tc ON tc.id = bp.taxClassFk
GROUP BY tmpTicket.ticketFk, pgc.code
HAVING taxableBase != 0;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount;
CREATE TEMPORARY TABLE tmp.ticketAmount
(INDEX (ticketFk))
@@ -69653,7 +69653,7 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany;
DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69674,7 +69674,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketGetTotal`(vTaxArea VARCHAR(25
BEGIN
/**
* Calcula el total con IVA para un conjunto de tickets.
- *
+ *
* @param vTaxArea
* @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular
* @return tmp.ticketTotal Total para cada ticket
@@ -69691,7 +69691,7 @@ BEGIN
FROM tmp.ticket t
LEFT JOIN tmp.ticketAmount ta ON t.ticketFk = ta.ticketFk
GROUP BY ticketFk;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount;
DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax;
END ;;
@@ -69763,18 +69763,18 @@ BEGIN
DECLARE vParked DATETIME;
DECLARE vLevel INT;
DECLARE vCollectionFk INT;
-
- SELECT IFNULL(`level`,0), IFNULL(collectionFk,0)
+
+ SELECT IFNULL(`level`,0), IFNULL(collectionFk,0)
INTO vLevel, vCollectionFk
FROM vn.ticketCollection
WHERE ticketFk = vTicketFk
LIMIT 1;
-
- SELECT created, parkingFk
+
+ SELECT created, parkingFk
INTO vParked, vParkingFk
FROM vn.ticketParking
WHERE ticketFk = vTicketFk;
-
+
SELECT tp.ticketFk, CONCAT(tc.collectionFk, ' - ', tc.level) coleccion, tp.created, p.code, am.name as Agencia
FROM vn.ticketParking tp
JOIN vn.parking p ON p.id = tp.parkingFk
@@ -69801,7 +69801,7 @@ BEGIN
AND sc.isPackagingArea
AND tp.created < vParked
AND t.packages <=> 0);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69822,7 +69822,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketNotInvoicedByClient`(vClientF
BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
-
+
CREATE TEMPORARY TABLE tmp.ticket
SELECT id ticketFk
FROM ticket
@@ -69832,7 +69832,7 @@ BEGIN
CALL vn.ticketGetTotal(NULL);
- SELECT c.id,
+ SELECT c.id,
c.name as Cliente,
t.shipped as Fecha,
t.id as Id_Ticket,
@@ -69843,7 +69843,7 @@ BEGIN
DROP TEMPORARY TABLE
tmp.ticket,
- tmp.ticketTotal;
+ tmp.ticketTotal;
END ;;
DELIMITER ;
@@ -69863,21 +69863,21 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketObservation_addNewBorn`(vTicketFk INT)
BEGIN
-
+
/**
* Inserta observaciones para los tickets con clientes nuevos o recuperados
- *
+ *
* @param vTicketFk Identificador de vn.ticket
*/
-
+
DECLARE vDescription VARCHAR(20) DEFAULT '¡Cliente NUEVO! ';
INSERT INTO vn.ticketObservation(ticketFk, observationTypeFk, description)
SELECT vTicketFk, ot.id, vDescription
FROM vn.observationType ot
WHERE ot.hasNewBornMessage
- ON DUPLICATE KEY UPDATE description = CONCAT(vDescription, ticketObservation.description);
-
+ ON DUPLICATE KEY UPDATE description = CONCAT(vDescription, ticketObservation.description);
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -69917,7 +69917,7 @@ BEGIN
DECLARE vComponentCost INT;
DECLARE vDone INT DEFAULT FALSE;
DECLARE vClientId INT;
-
+
DECLARE vCursor CURSOR FOR
SELECT DISTINCT clientFk
FROM (
@@ -69934,31 +69934,31 @@ BEGIN
RESIGNAL;
END;
- SELECT id INTO vWarehouseInventory
- FROM warehouse
+ SELECT id INTO vWarehouseInventory
+ FROM warehouse
WHERE `code`= 'inv';
-
- SELECT id INTO vComponentCost
- FROM component
+
+ SELECT id INTO vComponentCost
+ FROM component
WHERE `code`= 'purchaseValue';
-
- SELECT packagingInvoicingDated INTO vDateStart
- FROM ticketConfig;
-
+
+ SELECT packagingInvoicingDated INTO vDateStart
+ FROM ticketConfig;
+
IF vWarehouseInventory IS NULL THEN
CALL util.throw('Warehouse inventory not set');
END IF;
IF vComponentCost IS NULL THEN
CALL util.throw('Component cost not set');
- END IF;
+ END IF;
SET vDateEnd = vDated + INTERVAL 1 DAY;
-
+
IF NOT vWithoutPeriodGrace THEN
SET vGraceDate = vGraceDate -INTERVAL 1 MONTH;
END IF;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.packagingToInvoice;
CREATE TEMPORARY TABLE tmp.packagingToInvoice
(INDEX (clientFk))
@@ -69971,7 +69971,7 @@ BEGIN
t.clientFk
FROM ticketPackaging tp
JOIN packaging p ON p.id = tp.packagingFk
- JOIN ticket t ON t.id = tp.ticketFk
+ JOIN ticket t ON t.id = tp.ticketFk
JOIN client c ON c.id = t.clientFk
WHERE c.isActive
AND (vClientFk IS NULL OR t.clientFk = vClientFk)
@@ -69979,7 +69979,7 @@ BEGIN
AND (tp.quantity < 0 OR (tp.quantity > 0 AND t.shipped < vGraceDate))
AND tp.quantity
AND p.itemFk;
-
+
OPEN vCursor;
l: LOOP
@@ -69992,25 +69992,25 @@ BEGIN
START TRANSACTION;
CALL ticket_add(
- vClientId,
+ vClientId,
vDateEnd,
- vWarehouseInventory,
- vCompanyFk,
- NULL,
- NULL,
- NULL,
- vDateEnd,
- account.myUser_getId(),
+ vWarehouseInventory,
+ vCompanyFk,
+ NULL,
+ NULL,
+ NULL,
+ vDateEnd,
+ account.myUser_getId(),
TRUE,
vNewTicket);
-
+
INSERT INTO ticketPackaging(ticketFk, packagingFk, quantity, pvp)
SELECT vNewTicket, packagingFk, - SUM(quantity) totalQuantity, price
- FROM tmp.packagingToInvoice
+ FROM tmp.packagingToInvoice
WHERE clientFk = vClientId
GROUP BY packagingFk
HAVING IF(vWithoutPeriodGrace, totalQuantity <> 0, totalQuantity < 0);
-
+
INSERT INTO sale(ticketFk, itemFk, concept, quantity, price)
SELECT vNewTicket, pti.itemFk, i.name, SUM(pti.quantity) totalQuantity, pti.price
FROM tmp.packagingToInvoice pti
@@ -70018,12 +70018,12 @@ BEGIN
WHERE pti.clientFk = vClientId
GROUP BY pti.itemFk
HAVING IF(vWithoutPeriodGrace, totalQuantity <> 0, totalQuantity > 0);
-
+
INSERT INTO saleComponent(saleFk, componentFk, value)
SELECT id, vComponentCost, price
FROM sale
WHERE ticketFk = vNewTicket;
-
+
COMMIT;
END LOOP;
CLOSE vCursor;
@@ -70047,37 +70047,37 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketParking_findSkipped`(vTicketFk INT, vItemPackingTypeFk VARCHAR(1))
BEGIN
-
+
/**
* Averigua los tickets que se han saltado por un error en el proceso encajado
* @param vTicketFk Ticket
* @param vItemPackingTypeFk Modo de encajado
* @return un select con los tickets afectados
- */
+ */
DECLARE vParkingFk INT;
DECLARE vParked DATETIME;
DECLARE vLevel INT;
DECLARE vWagon INT;
DECLARE vCollectionFk INT;
-
- SELECT IFNULL(`level`,0), IFNULL(`wagon`,0),IFNULL(collectionFk,0)
+
+ SELECT IFNULL(`level`,0), IFNULL(`wagon`,0),IFNULL(collectionFk,0)
INTO vLevel, vWagon, vCollectionFk
FROM vn.ticketCollection tc
JOIN vn.collection c ON c.id = tc.collectionFk AND c.itemPackingTypeFk = vItemPackingTypeFk
WHERE ticketFk = vTicketFk
ORDER BY c.id DESC
LIMIT 1;
-
- SELECT created, parkingFk
+
+ SELECT created, parkingFk
INTO vParked, vParkingFk
FROM vn.ticketParking tp
- JOIN vn.parking p ON p.id = tp.parkingFk
- JOIN vn.sector s ON s.id = p.sectorFk
+ JOIN vn.parking p ON p.id = tp.parkingFk
+ JOIN vn.sector s ON s.id = p.sectorFk
WHERE ticketFk = vTicketFk
AND s.itemPackingTypeFk = vItemPackingTypeFk
AND s.isPackagingArea ;
-
+
SELECT tp.ticketFk, CONCAT(tc.collectionFk, ' ', tc.wagon, ' - ', tc.level) coleccion, tp.created, p.code, am.name as Agencia
FROM vn.ticketParking tp
JOIN vn.parking p ON p.id = tp.parkingFk
@@ -70094,9 +70094,9 @@ BEGIN
AND (
( IFNULL(tc.collectionFk,-1) != IFNULL(@vCollectionFk,0) AND tp.created < vParked )
OR
- ( tc.collectionFk = vCollectionFk
+ ( tc.collectionFk = vCollectionFk
AND (LEFT(tc.wagon,1) < LEFT(vWagon,1)
- OR (LEFT(tc.wagon,1) = LEFT(vWagon,1) AND LEFT(tc.level,1) < LEFT(vLevel,1)))
+ OR (LEFT(tc.wagon,1) = LEFT(vWagon,1) AND LEFT(tc.level,1) < LEFT(vLevel,1)))
)
)
) -- Etiquetas que no se han escaneado y ya estamos con una posterior
@@ -70104,7 +70104,7 @@ BEGIN
(s.alertLevel > 1
AND tp.parkingFk = vParkingFk
AND sc.isPackagingArea
- AND tp.created < vParked
+ AND tp.created < vParked
AND t.packages <=> 0);
END ;;
DELIMITER ;
@@ -70156,11 +70156,11 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketRequest_Add`(vDescription VARCHAR(255), vQuantity INT, vPrice DOUBLE, vTicketFk INT, vBuyerCode VARCHAR(3))
BEGIN
- INSERT INTO vn.ticketRequest(description,
- quantity,
- price,
- ticketFk,
- buyerCode,
+ INSERT INTO vn.ticketRequest(description,
+ quantity,
+ price,
+ ticketFk,
+ buyerCode,
requesterFk)
VALUES(vDescription,
vQuantity,
@@ -70168,7 +70168,7 @@ BEGIN
vTicketFk,
vBuyerCode,
vn.getUser());
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -70187,26 +70187,26 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketStateToday_setState`(vTicketFk INT, vStateCode VARCHAR(45))
BEGIN
-
+
/* Modifica el estado de un ticket de hoy
- *
+ *
* @param vTicketFk el id del ticket
* @param vStateCode estado a modificar del ticket
- *
+ *
*/
-
+
DECLARE vAlertLevel INT;
-
- SELECT s.alertLevel INTO vAlertLevel
- FROM state s
- JOIN ticketStateToday tst ON tst.state = s.id
+
+ SELECT s.alertLevel INTO vAlertLevel
+ FROM state s
+ JOIN ticketStateToday tst ON tst.state = s.id
WHERE tst.ticket = vTicketFk
LIMIT 1;
-
+
IF vAlertLevel < 2 THEN
-
+
CALL vn.ticket_setState(vTicketFk, vStateCode);
-
+
END IF;
END ;;
@@ -70227,23 +70227,23 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketStateUpdate`(vTicketFk INT, vStateCode VARCHAR(45))
BEGIN
-
+
/*
* @deprecated:utilizar ticket_setState
*/
-
+
DECLARE vAlertLevel INT;
- SELECT s.alertLevel INTO vAlertLevel
+ SELECT s.alertLevel INTO vAlertLevel
FROM vn.state s
JOIN vn.ticketState ts ON ts.stateFk = s.id
WHERE ts.ticketFk = vTicketFk;
-
- IF !(vStateCode = 'ON_CHECKING' AND vAlertLevel > 1) THEN
-
+
+ IF !(vStateCode = 'ON_CHECKING' AND vAlertLevel > 1) THEN
+
INSERT INTO ticketTracking(stateFk, ticketFk, workerFk)
SELECT id, vTicketFk, account.myUser_getId()
- FROM vn.state
+ FROM vn.state
WHERE `code` = vStateCode collate utf8_unicode_ci;
END IF;
@@ -70523,20 +70523,20 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_administrativeCopy`(vOriginalTicket INT, OUT vNewTicket INT)
BEGIN
-
+
INSERT INTO vn.ticket(clientFk, addressFk, shipped, warehouseFk, companyFk, landed)
- SELECT t.clientFk , t.addressFk , t.shipped ,w.id, t.companyFk , t.landed
+ SELECT t.clientFk , t.addressFk , t.shipped ,w.id, t.companyFk , t.landed
FROM vn.ticket t
JOIN vn.warehouse w ON w.name = 'INVENTARIO'
WHERE t.id = vOriginalTicket;
-
+
SELECT LAST_INSERT_ID() INTO vNewTicket;
INSERT INTO vn.sale(ticketFk, itemFk, concept, quantity, price, discount)
- SELECT vNewTicket, s.itemFk , s.concept , s.quantity , s.price , s.discount
+ SELECT vNewTicket, s.itemFk , s.concept , s.quantity , s.price , s.discount
FROM vn.sale s
WHERE s.ticketFk = vOriginalTicket;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -70780,7 +70780,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_canMerge`(vDated DATE, vScop
BEGIN
/**
* Devuelve un listado de tickets susceptibles de fusionarse con otros tickets en el futuro
- *
+ *
* @param vDated Fecha en cuestión
* @param vScopeDays Dias en el futuro a sondear
* @param vLitersMax Volumen máximo de los tickets a catapultar
@@ -70861,10 +70861,10 @@ BEGIN
* Comprueba que los tickets entre un rango de fechas tienen componentes
* y recalcula sus componentes
*
- * @param vShippedFrom rango inicial de fecha
+ * @param vShippedFrom rango inicial de fecha
* @param vShippedTo rango final de fecha
*/
-
+
CREATE OR REPLACE TEMPORARY TABLE tmp.coste
(primary key (id)) ENGINE = MEMORY
SELECT s.id
@@ -70893,9 +70893,9 @@ BEGIN
AND ic.merchandise;
CALL vn.sale_recalcComponent(1);
-
+
DROP TEMPORARY TABLE tmp.recalculateSales;
- DROP TEMPORARY TABLE tmp.coste;
+ DROP TEMPORARY TABLE tmp.coste;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -71011,7 +71011,7 @@ BEGIN
t.companyFk,
t.addressFk,
tt.agencyModeFk
- FROM ticketWeekly tt
+ FROM ticketWeekly tt
JOIN ticket t ON tt.ticketFk = t.id;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE;
@@ -71025,15 +71025,15 @@ BEGIN
DECLARE vIsDuplicateMail BOOL;
DECLARE vSubject VARCHAR(150);
DECLARE vMessage TEXT;
-
+
SET vIsDone = FALSE;
FETCH rsTicket INTO vTicketFk, vWeekDay, vClientFk, vWarehouseFk, vCompanyFk, vAddressFk, vAgencyModeFk;
IF vIsDone THEN
LEAVE myLoop;
END IF;
-
- SELECT dated INTO vShipment
+
+ SELECT dated INTO vShipment
FROM `time`
WHERE `year` = vYear AND `week` = vWeek
AND WEEKDAY(dated) = vWeekDay;
@@ -71044,17 +71044,17 @@ BEGIN
JOIN saleCloned sc ON sc.saleOriginalFk = saleOrig.id
JOIN sale saleClon ON saleClon.id = sc.saleClonedFk
JOIN ticket tClon ON tClon.id = saleClon.ticketFk
- WHERE tOrig.id = vTicketFk
- AND tClon.isDeleted = FALSE
+ WHERE tOrig.id = vTicketFk
+ AND tClon.isDeleted = FALSE
AND DATE(tClon.shipped) = vShipment)
THEN
ITERATE myLoop;
END IF;
IF vAgencyModeFk IS NULL THEN
- SELECT agencyModeFk INTO vAgencyModeFk
+ SELECT agencyModeFk INTO vAgencyModeFk
FROM address
- WHERE clientFk = vClientFk
+ WHERE clientFk = vClientFk
AND isDefaultAddress;
END IF;
@@ -71075,8 +71075,8 @@ BEGIN
FALSE,
vNewTicket);
- UPDATE ticket
- SET clonedFrom = vTicketFk
+ UPDATE ticket
+ SET clonedFrom = vTicketFk
WHERE id = vNewTicket;
INSERT INTO sale (ticketFk, itemFk, concept, quantity, price,
@@ -71095,7 +71095,7 @@ BEGIN
INSERT IGNORE INTO saleCloned(saleOriginalFk, saleClonedFk)
SELECT saleOriginal.id, saleClon.id
FROM sale saleOriginal
- JOIN sale saleClon ON saleOriginal.itemFk = saleClon.itemFk
+ JOIN sale saleClon ON saleOriginal.itemFk = saleClon.itemFk
AND saleOriginal.quantity = saleClon.quantity
WHERE saleOriginal.ticketFk = vTicketFk
AND saleClon.ticketFk = vNewTicket;
@@ -71125,7 +71125,7 @@ BEGIN
buyed,
requesterFk,
attenderFk,
- vNewTicket
+ vNewTicket
FROM ticketRequest
WHERE ticketFk =vTicketFk;
@@ -71140,26 +71140,26 @@ BEGIN
INSERT INTO ticketObservation(
ticketFk,
observationTypeFk,
- description)
+ description)
VALUES(
vNewTicket,
vSalesPersonFK,
CONCAT('turno desde ticket: ',vTicketFk))
- ON DUPLICATE KEY UPDATE description =
+ ON DUPLICATE KEY UPDATE description =
CONCAT(ticketObservation.description,VALUES(description),' ');
INSERT INTO ticketObservation(ticketFk,
observationTypeFk,
- description)
+ description)
VALUES(
vNewTicket,
vItemPicker,
'ATENCION: Contiene lineas de TURNO')
- ON DUPLICATE KEY UPDATE description =
+ ON DUPLICATE KEY UPDATE description =
CONCAT(ticketObservation.description,VALUES(description),' ');
IF (vLanding IS NULL) THEN
-
+
SELECT e.email INTO vSalesPersonEmail
FROM client c
JOIN account.emailUser e ON e.userFk = c.salesPersonFk
@@ -71167,8 +71167,8 @@ BEGIN
SET vSubject = CONCAT('Turnos - No se ha podido clonar correctamente el ticket ',
vTicketFk,' para el dia: ', vShipment);
- SET vMessage = CONCAT('No se ha podido clonar el ticket ', vTicketFk,
- ' para el dia: ', vShipment,
+ SET vMessage = CONCAT('No se ha podido clonar el ticket ', vTicketFk,
+ ' para el dia: ', vShipment,
' porque no hay una zona de envío disponible. Se ha creado el ticket: ',
vNewTicket, ' pero ha que revisar las fechas y la agencia');
@@ -71207,7 +71207,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `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
@@ -71225,7 +71225,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;
@@ -71235,7 +71235,7 @@ BEGIN
proc: LOOP
SET vDone = FALSE;
-
+
FETCH cur INTO vCurTicketFk;
IF vDone THEN
@@ -71252,12 +71252,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
@@ -71267,22 +71267,22 @@ BEGIN
INSERT INTO ticketPackaging (ticketFk, packagingFk, quantity)
(SELECT vCurTicketFk, p.id, COUNT(*)
- FROM expedition e
+ FROM expedition e
JOIN packaging p ON p.itemFk = e.freightItemFk
WHERE e.ticketFk = vCurTicketFk AND p.isPackageReturnable
AND vWithPackage
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
@@ -71290,10 +71290,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, 'M')),
+ vShipped,
+ vCompanyFk,
NULL,
NULL,
vNewInvoiceId);
@@ -71361,25 +71361,25 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_componentMakeUpdate`(
- vTicketFk INT,
+ vTicketFk INT,
vClientFk INT,
- vNickname VARCHAR(50),
+ vNickname VARCHAR(50),
vAgencyModeFk INT,
- vAddressFk INT,
- vZoneFk INT,
+ vAddressFk INT,
+ vZoneFk INT,
vWarehouseFk INT,
- vCompanyFk INT,
+ vCompanyFk INT,
vShipped DATETIME,
- vLanded DATE,
+ vLanded DATE,
vIsDeleted BOOLEAN,
- vHasToBeUnrouted BOOLEAN,
+ vHasToBeUnrouted BOOLEAN,
vOption INT)
BEGIN
-
+
/**
* Modifica en el ticket los campos que se le pasan por parámetro
* y cambia sus componentes
- *
+ *
* @param vTicketFk Id del ticket a modificar
* @param vClientFk nuevo cliente
* @param vNickname nuevo alias
@@ -71394,29 +71394,29 @@ BEGIN
* @param vHasToBeUnrouted si se le elimina la ruta al ticket
* @param vOption opcion para el case del proc ticketComponentUpdateSale
*/
-
+
DECLARE vPrice DECIMAL(10,2);
DECLARE vBonus DECIMAL(10,2);
CALL ticket_componentPreview (vTicketFk, vLanded, vAddressFk, vZoneFk, vWarehouseFk);
IF (SELECT addressFk FROM ticket WHERE id = vTicketFk) <> vAddressFk THEN
-
- UPDATE ticket t
+
+ UPDATE ticket t
JOIN address a ON a.id = vAddressFk
SET t.nickname = a.nickname
WHERE t.id = vTicketFk;
-
+
END IF;
CALL zone_getShipped(vLanded, vAddressFk, vAgencyModeFk, TRUE);
- SELECT zoneFk, price, bonus INTO vZoneFk, vPrice, vBonus
+ SELECT zoneFk, price, bonus INTO vZoneFk, vPrice, vBonus
FROM tmp.zoneGetShipped
WHERE shipped BETWEEN DATE(vShipped) AND util.dayEnd(vShipped) AND warehouseFk = vWarehouseFk LIMIT 1;
-
+
UPDATE ticket t
- SET
+ SET
t.clientFk = vClientFk,
t.nickname = vNickname,
t.agencyModeFk = vAgencyModeFk,
@@ -71431,12 +71431,12 @@ BEGIN
t.isDeleted = vIsDeleted
WHERE
t.id = vTicketFk;
-
+
IF vHasToBeUnrouted THEN
UPDATE ticket t SET t.routeFk = NULL
WHERE t.id = vTicketFk;
END IF;
-
+
IF vOption <> 8 THEN
DROP TEMPORARY TABLE IF EXISTS tmp.sale;
CREATE TEMPORARY TABLE tmp.sale
@@ -71474,7 +71474,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_componentPreview`(
vTicketFk INT,
- vLanded DATE,
+ vLanded DATE,
vAddressFk INT,
vZoneFk INT,
vWarehouseFk SMALLINT)
@@ -71490,7 +71490,7 @@ BEGIN
*
* @return tmp.ticketComponentPreview (warehouseFk, itemFk, componentFk, cost)
*/
- DECLARE vHasDataChanged BOOL DEFAULT FALSE;
+ DECLARE vHasDataChanged BOOL DEFAULT FALSE;
DECLARE vHasAddressChanged BOOL;
DECLARE vHasZoneChanged BOOL DEFAULT FALSE;
DECLARE vHasWarehouseChanged BOOL DEFAULT FALSE;
@@ -71501,8 +71501,8 @@ BEGIN
DECLARE vHasChangeAll BOOL DEFAULT FALSE;
- SELECT DATE(landed) <> vLanded,
- addressFk <> vAddressFk,
+ SELECT DATE(landed) <> vLanded,
+ addressFk <> vAddressFk,
zoneFk <> vZoneFk,
warehouseFk <> vWarehouseFk
INTO
@@ -71525,15 +71525,15 @@ BEGIN
SET vAgencyModeTypeRateFk = 6;
END IF;
- SELECT TIMESTAMPADD(DAY, -travelingDays, vLanded) INTO vShipped
+ SELECT TIMESTAMPADD(DAY, -travelingDays, vLanded) INTO vShipped
FROM zone
WHERE id = vZoneFk;
-
+
CALL buyUltimate(vWarehouseFk, vShipped);
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot;
- CREATE TEMPORARY TABLE tmp.ticketLot ENGINE = MEMORY (
- SELECT
+ CREATE TEMPORARY TABLE tmp.ticketLot ENGINE = MEMORY (
+ SELECT
vWarehouseFk AS warehouseFk,
NULL AS available,
s.itemFk,
@@ -71553,9 +71553,9 @@ BEGIN
JOIN sale s ON s.id = sc.saleFk
JOIN ticket t ON t.id = s.ticketFk
JOIN `component` c ON c.id = sc.componentFk
- WHERE s.ticketFk = vTicketFk
- AND (c.isRenewable = FALSE
- OR
+ WHERE s.ticketFk = vTicketFk
+ AND (c.isRenewable = FALSE
+ OR
(NOT vHasChangeAll
AND (NOT (c.typeFk <=> vAddressTypeRateFk
OR c.typeFk <=> vAgencyModeTypeRateFk))));
@@ -71635,52 +71635,52 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_DelayTruckSplit`(vTicketFk INT)
BEGIN
-
+
/*
* Splita las lineas de ticket que no estan ubicadas
- *
+ *
*/
-
+
DECLARE vNewTicketFk INT;
DECLARE vTotalLines INT;
DECLARE vLinesToSplit INT;
DROP TEMPORARY TABLE IF EXISTS tmp.SalesToSplit;
-
+
SELECT COUNT(*) INTO vTotalLines
- FROM vn.sale
+ FROM vn.sale
WHERE ticketFk = vTicketFk;
-
+
CREATE TEMPORARY TABLE tmp.SalesToSplit
SELECT s.id saleFk
FROM vn.ticket t
- JOIN vn.sale s ON t.id = s.ticketFk
- LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = s.itemFk AND issw.warehouseFk = t.warehouseFk
+ JOIN vn.sale s ON t.id = s.ticketFk
+ LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = s.itemFk AND issw.warehouseFk = t.warehouseFk
WHERE s.quantity > IFNULL(issw.visible, 0)
AND s.quantity > 0
AND s.isPicked = FALSE
AND s.reserved = FALSE
AND t.id = vTicketFk;
-
+
SELECT COUNT(*) INTO vLinesToSplit
FROM tmp.SalesToSplit;
-
+
IF vLinesToSplit = vTotalLines AND vLinesToSplit > 0 THEN
-
+
SET vNewTicketFk = vTicketFk;
-
+
ELSE
-
+
CALL vn.ticket_Clone(vTicketFk, vNewTicketFk);
-
- UPDATE vn.sale s
- JOIN tmp.SalesToSplit sts ON sts.saleFk = s.id
+
+ UPDATE vn.sale s
+ JOIN tmp.SalesToSplit sts ON sts.saleFk = s.id
SET s.ticketFk = vNewTicketFk;
-
+
END IF;
-
+
CALL vn.ticketStateUpdate(vNewTicketFk, 'FIXING');
-
+
DROP TEMPORARY TABLE tmp.SalesToSplit;
END ;;
@@ -71700,91 +71700,91 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_doCmr`(vSelf INT)
-BEGIN
-/**
-* Crea u actualiza la información del CMR asociado con
-* un ticket específico en caso de que sea necesario.
-*
-* @param vSelf El id del ticket
-*/
- DECLARE vCmrFk, vPreviousCmrFk, vCurrentCmrFk INT;
- SELECT cmrFk INTO vCmrFk
- FROM ticket
- WHERE id = vSelf;
-
- CREATE OR REPLACE TEMPORARY TABLE tTicket
- SELECT wo.firstName,
- v.numberPlate,
- com.id companyFk,
- a.id addressFk,
- c2.defaultAddressFk,
- su.id supplierFk,
- t.landed
- FROM ticket t
- JOIN ticketState ts ON ts.ticketFk = t.id
- JOIN `state` s ON s.id = ts.stateFk
- JOIN alertLevel al ON al.id = s.alertLevel
- JOIN client c ON c.id = t.clientFk
- JOIN `address` a ON a.id = t.addressFk
- JOIN province p ON p.id = a.provinceFk
- JOIN country co ON co.id = p.countryFk
- JOIN agencyMode am ON am.id = t.agencyModeFk
- JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
- JOIN warehouse w ON w.id = t.warehouseFk
- JOIN company com ON com.id = t.companyFk
- JOIN client c2 ON c2.id = com.clientFk
- JOIN supplierAccount sa ON sa.id = com.supplierAccountFk
- JOIN supplier su ON su.id = sa.supplierFk
- LEFT JOIN route r ON r.id = t.routeFk
- LEFT JOIN worker wo ON wo.id = r.workerFk
- LEFT JOIN vehicle v ON v.id = r.vehicleFk
- WHERE t.shipped BETWEEN util.yesterday() AND util.dayEnd(util.VN_CURDATE())
- AND al.code IN ('PACKED', 'DELIVERED')
- AND co.code <> 'ES'
- AND am.name <> 'ABONO'
- AND w.code = 'ALG'
- AND dm.code = 'DELIVERY'
- AND t.id = vSelf
- GROUP BY t.id;
-
- START TRANSACTION;
-
- IF vCmrFk THEN
- UPDATE cmr c
- JOIN tTicket t
- SET c.senderInstruccions = t.firstName,
- c.truckPlate = t.numberPlate,
- c.companyFk = t.companyFk,
- c.addressToFk = t.addressFk,
- c.addressFromFk = t.defaultAddressFk,
- c.supplierFk = t.supplierFk,
- c.ead = t.landed
- WHERE id = vCmrFk;
- ELSE
- SELECT MAX(id) INTO vPreviousCmrFk FROM cmr;
-
- INSERT INTO cmr (
- senderInstruccions,
- truckPlate,
- companyFk,
- addressToFk,
- addressFromFk,
- supplierFk,
- ead
- )
- SELECT * FROM tTicket;
-
- SELECT MAX(id) INTO vCurrentCmrFk FROM cmr;
-
- IF vPreviousCmrFk <> vCurrentCmrFk THEN
- UPDATE ticket
- SET cmrFk = vCurrentCmrFk
- WHERE id = vSelf;
- END IF;
- END IF;
-
- COMMIT;
- DROP TEMPORARY TABLE tTicket;
+BEGIN
+/**
+* Crea u actualiza la información del CMR asociado con
+* un ticket específico en caso de que sea necesario.
+*
+* @param vSelf El id del ticket
+*/
+ DECLARE vCmrFk, vPreviousCmrFk, vCurrentCmrFk INT;
+ SELECT cmrFk INTO vCmrFk
+ FROM ticket
+ WHERE id = vSelf;
+
+ CREATE OR REPLACE TEMPORARY TABLE tTicket
+ SELECT wo.firstName,
+ v.numberPlate,
+ com.id companyFk,
+ a.id addressFk,
+ c2.defaultAddressFk,
+ su.id supplierFk,
+ t.landed
+ FROM ticket t
+ JOIN ticketState ts ON ts.ticketFk = t.id
+ JOIN `state` s ON s.id = ts.stateFk
+ JOIN alertLevel al ON al.id = s.alertLevel
+ JOIN client c ON c.id = t.clientFk
+ JOIN `address` a ON a.id = t.addressFk
+ JOIN province p ON p.id = a.provinceFk
+ JOIN country co ON co.id = p.countryFk
+ JOIN agencyMode am ON am.id = t.agencyModeFk
+ JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
+ JOIN warehouse w ON w.id = t.warehouseFk
+ JOIN company com ON com.id = t.companyFk
+ JOIN client c2 ON c2.id = com.clientFk
+ JOIN supplierAccount sa ON sa.id = com.supplierAccountFk
+ JOIN supplier su ON su.id = sa.supplierFk
+ LEFT JOIN route r ON r.id = t.routeFk
+ LEFT JOIN worker wo ON wo.id = r.workerFk
+ LEFT JOIN vehicle v ON v.id = r.vehicleFk
+ WHERE t.shipped BETWEEN util.yesterday() AND util.dayEnd(util.VN_CURDATE())
+ AND al.code IN ('PACKED', 'DELIVERED')
+ AND co.code <> 'ES'
+ AND am.name <> 'ABONO'
+ AND w.code = 'ALG'
+ AND dm.code = 'DELIVERY'
+ AND t.id = vSelf
+ GROUP BY t.id;
+
+ START TRANSACTION;
+
+ IF vCmrFk THEN
+ UPDATE cmr c
+ JOIN tTicket t
+ SET c.senderInstruccions = t.firstName,
+ c.truckPlate = t.numberPlate,
+ c.companyFk = t.companyFk,
+ c.addressToFk = t.addressFk,
+ c.addressFromFk = t.defaultAddressFk,
+ c.supplierFk = t.supplierFk,
+ c.ead = t.landed
+ WHERE id = vCmrFk;
+ ELSE
+ SELECT MAX(id) INTO vPreviousCmrFk FROM cmr;
+
+ INSERT INTO cmr (
+ senderInstruccions,
+ truckPlate,
+ companyFk,
+ addressToFk,
+ addressFromFk,
+ supplierFk,
+ ead
+ )
+ SELECT * FROM tTicket;
+
+ SELECT MAX(id) INTO vCurrentCmrFk FROM cmr;
+
+ IF vPreviousCmrFk <> vCurrentCmrFk THEN
+ UPDATE ticket
+ SET cmrFk = vCurrentCmrFk
+ WHERE id = vSelf;
+ END IF;
+ END IF;
+
+ COMMIT;
+ DROP TEMPORARY TABLE tTicket;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -72017,37 +72017,37 @@ BEGIN
* @param vTicketFk -> Ticket
* @param vDatedNew -> Nueva fecha
* @return Sales con Movible
-*/
+*/
DECLARE vDatedOld DATETIME;
SET vDatedNew = DATE_ADD(vDatedNew, INTERVAL 1 DAY);
SELECT t.shipped INTO vDatedOld
- FROM ticket t
+ FROM ticket t
WHERE t.id = vTicketFk;
- CALL item_getStock(vWarehouseFk, vDatedNew, NULL);
+ CALL item_getStock(vWarehouseFk, vDatedNew, NULL);
CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(DATE_SUB(vDatedOld, INTERVAL 1 DAY), vDatedNew), NULL);
-
- SELECT s.id,
- s.itemFk,
- s.quantity,
- s.concept,
- s.price,
+
+ SELECT s.id,
+ s.itemFk,
+ s.quantity,
+ s.concept,
+ s.price,
s.reserved,
- s.discount,
- i.image,
- i.subName,
+ s.discount,
+ i.image,
+ i.subName,
il.stock + IFNULL(im.amount, 0) AS movable
FROM ticket t
JOIN sale s ON s.ticketFk = t.id
- JOIN item i ON i.id = s.itemFk
+ JOIN item i ON i.id = s.itemFk
LEFT JOIN tmp.itemMinacum im ON im.itemFk = s.itemFk AND im.warehouseFk = vWarehouseFk
LEFT JOIN tmp.itemList il ON il.itemFk = s.itemFk
WHERE t.id = vTicketFk;
DROP TEMPORARY TABLE IF EXISTS tmp.itemList;
- DROP TEMPORARY TABLE IF EXISTS tmp.itemMinacum;
-
+ DROP TEMPORARY TABLE IF EXISTS tmp.itemMinacum;
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -72076,10 +72076,10 @@ BEGIN
CALL sale_getProblems(vIsTodayRelative);
DROP TEMPORARY TABLE IF EXISTS tmp.ticket_problems;
- CREATE TEMPORARY TABLE tmp.ticket_problems
+ CREATE TEMPORARY TABLE tmp.ticket_problems
(PRIMARY KEY (ticketFk))
ENGINE = MEMORY
- SELECT
+ SELECT
ticketFk,
MAX(p.isFreezed) isFreezed,
MAX(p.risk) risk,
@@ -72097,7 +72097,7 @@ BEGIN
GROUP BY ticketFk;
UPDATE tmp.ticket_problems tp
- SET tp.totalProblems =
+ SET tp.totalProblems =
(
(tp.isFreezed) +
IF(tp.risk, TRUE, FALSE) +
@@ -72151,17 +72151,17 @@ BEGIN
(saleFk INT PRIMARY KEY,
ticketFk INT,
problem VARCHAR(1)) ENGINE = MEMORY;
-
+
INSERT INTO tmp.salesToSplit(saleFk, ticketFk, problem)
SELECT s.id, s.ticketFk, 'F'
FROM vn.ticket t
JOIN vn.sale s ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk
JOIN vn.itemType it on it.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = it.categoryFk
+ JOIN vn.itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN cache.visible v ON v.item_id = i.id AND v.calc_id = vVisibleCache
LEFT JOIN cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache
- LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
+ LEFT JOIN vn.itemShelvingStock_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
AND IFNULL(issw.visible, 0) < s.quantity
@@ -72171,16 +72171,16 @@ BEGIN
AND t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
AND NOT i.generic
AND t.warehouseFk = vWarehouseFk;
-
+
INSERT IGNORE INTO tmp.salesToSplit(saleFk, ticketFk, problem)
SELECT s.id, s.ticketFk, 'I'
- FROM vn.ticket t
+ FROM vn.ticket t
JOIN vn.sale s ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk
JOIN vn.itemType it on it.id = i.typeFk
JOIN vn.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 vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
+ LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible,0) >= s.quantity
AND IFNULL(issw.visible, 0) < s.quantity
AND s.quantity > 0
@@ -72190,7 +72190,7 @@ BEGIN
AND t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
AND NOT i.generic
AND t.warehouseFk = vWarehouseFk;
-
+
INSERT IGNORE INTO tmp.salesToSplit(saleFk, ticketFk, problem)
SELECT s.id, s.ticketFk, 'R'
FROM vn.ticket t
@@ -72200,7 +72200,7 @@ BEGIN
JOIN vn.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 cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache
- LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk
+ LEFT JOIN vn.itemShelvingStock_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
AND IFNULL(issw.visible, 0) < s.quantity
@@ -72211,7 +72211,7 @@ BEGIN
AND t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
AND NOT i.generic
AND t.warehouseFk = vWarehouseFk;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketsToSplit;
CREATE TEMPORARY TABLE tmp.ticketsToSplit
@@ -72232,11 +72232,11 @@ BEGIN
JOIN vn.ticket t ON t.id = ss.ticketFk
JOIN vn.sale s ON s.id = ss.saleFk
JOIN vn.item i ON i.id = s.itemFk
- LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk
+ LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk
GROUP BY ss.ticketFk;
-
- SELECT
- ts.*,
+
+ SELECT
+ ts.*,
t.id ticketFuture,
st.name state,
zc.`hour` tfEtd,
@@ -72245,23 +72245,23 @@ BEGIN
FROM tmp.ticketsToSplit ts
LEFT JOIN vn.ticketState ts2 ON ts2.ticketFk = ts.ticketFk
LEFT JOIN vn.state st ON st.id = ts2.stateFk
- LEFT JOIN vn.ticket t
- ON t.id != ts.ticketFk
+ LEFT JOIN vn.ticket t
+ ON t.id != ts.ticketFk
AND t.addressFk = ts.addressFk
AND t.shipped BETWEEN vDated AND util.dayend(vDated)
LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk AND zc.dated = vDated
LEFT JOIN vn.sale s ON s.ticketFk = t.id
LEFT JOIN vn.item i ON i.id = s.itemFk
- LEFT JOIN vn.ticketState tst ON tst.ticketFk = t.id
+ LEFT JOIN vn.ticketState tst ON tst.ticketFk = t.id
LEFT JOIN vn.state st2 ON st2.id = tst.stateFk
- WHERE (t.id IS NULL
+ WHERE (t.id IS NULL
OR (vDated > util.VN_CURDATE())
OR (vDated = util.VN_CURDATE() AND vHour >= zc.`hour`))
AND ts.etd <= vHour
GROUP BY ts.ticketFk, t.id
ORDER BY ts.etd, ts.ticketFk;
-
- DROP TEMPORARY TABLE
+
+ DROP TEMPORARY TABLE
tmp.ticketsToSplit;
END ;;
DELIMITER ;
@@ -72298,7 +72298,7 @@ BEGIN
JOIN ticket t ON t.id = tmpTicket.ticketFk;
CALL addressTaxArea ();
-
+
IF vTaxArea IS NOT NULL THEN
UPDATE tmp.addressTaxArea
SET areaFk = vTaxArea;
@@ -72370,8 +72370,8 @@ BEGIN
CREATE TEMPORARY TABLE tmp.ticketAmount
(INDEX (ticketFk))
ENGINE = MEMORY
- SELECT ticketFk,
- taxableBase,
+ SELECT ticketFk,
+ taxableBase,
SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax,
code
FROM tmp.ticketTax
@@ -72451,11 +72451,11 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_getWithParameters`(
- vClientFk INT,
+ vClientFk INT,
vWarehouseFk INT,
- vShipped DATE,
- vAddressFk INT,
- vCompanyFk INT,
+ vShipped DATE,
+ vAddressFk INT,
+ vCompanyFk INT,
vAgencyModeFk INT,
OUT vTicketFk INT
)
@@ -72469,8 +72469,8 @@ BEGIN
* @param vAddressFk Consignatario
* @param vCompanyFk Empresa
* @param vAgencyModeFk agencia
- */
-
+ */
+
SELECT t.id INTO vTicketFk
FROM vn.ticket t
WHERE t.clientFk <=> vClientFk
@@ -72480,7 +72480,7 @@ BEGIN
AND (t.companyFk <=> vCompanyFk OR vCompanyFk IS NULL)
AND (t.agencyModeFk <=> vAgencyModeFk OR vAgencyModeFk IS NULL)
LIMIT 1;
-
+
IF vTicketFk IS NULL THEN
CALL vn.ticket_add(
vClientFk,
@@ -72520,24 +72520,24 @@ BEGIN
DECLARE vAddressFk INT;
DECLARE vAgencyModeFk INT;
DECLARE vWarehouseFk INT;
- DECLARE vCursor CURSOR FOR
+ DECLARE vCursor CURSOR FOR
SELECT id, landed, addressFk, agencyModeFk, warehouseFk
FROM vn.ticket WHERE shipped > '2020-01-01' AND zoneFk is null;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET vDone = 1;
-
+
OPEN vCursor;
REPEAT
FETCH vCursor INTO vFechedTicket, vLanded, vAddressFk, vAgencyModeFk, vWarehouseFk;
CALL vn.zone_getShipped (vlanded, vAddressFk, vAgencyModeFk, TRUE);
-
+
UPDATE vn.ticket t
JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = vWarehouseFk
SET t.zoneFk = zgs.zoneFk
WHERE t.id = vFechedTicket;
-
+
UNTIL vDone END REPEAT;
DROP TEMPORARY TABLE tmp.zoneGetShipped;
-
+
CLOSE vCursor;
END ;;
DELIMITER ;
@@ -72557,14 +72557,14 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_priceDifference`(
vTicketFk INT,
- vLanded DATE,
+ vLanded DATE,
vAddressFk INT,
vZoneFk INT,
vWarehouseFk INT)
BEGIN
/**
* Devuelve las diferencias de precio de los movimientos de un ticket.
- *
+ *
* @param vTicketFk Id del ticket
* @param vLanded Fecha de recepcion
* @param vAddressFk Id del consignatario
@@ -72573,26 +72573,26 @@ BEGIN
*/
CALL vn.ticket_componentPreview(vTicketFk, vLanded, vAddressFk, vZoneFk, vWarehouseFk);
- SELECT s.itemFk,
- i.name,
- i.size,
- i.category,
- IFNULL(s.quantity, 0) AS quantity,
- IFNULL(s.price, 0) AS price,
+ SELECT s.itemFk,
+ i.name,
+ i.size,
+ i.category,
+ IFNULL(s.quantity, 0) AS quantity,
+ IFNULL(s.price, 0) AS price,
ROUND(SUM(tc.cost), 2) AS newPrice,
s.quantity * (s.price - ROUND(SUM(tc.cost), 2)) difference,
s.id AS saleFk
FROM sale s
- JOIN item i ON i.id = s.itemFk
- JOIN ticket t ON t.id = s.ticketFk
- LEFT JOIN tmp.ticketComponentPreview tc ON tc.itemFk = s.itemFk
+ JOIN item i ON i.id = s.itemFk
+ JOIN ticket t ON t.id = s.ticketFk
+ LEFT JOIN tmp.ticketComponentPreview tc ON tc.itemFk = s.itemFk
AND tc.warehouseFk = vWarehouseFk
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
+ LEFT JOIN saleComponent sc ON sc.saleFk = s.id
AND sc.componentFk = tc.componentFk
- LEFT JOIN `component` c ON c.id = tc.componentFk
- WHERE t.id = vTicketFk
- AND IF(sc.componentFk IS NULL
- AND c.classRate IS NOT NULL, FALSE, TRUE)
+ LEFT JOIN `component` c ON c.id = tc.componentFk
+ WHERE t.id = vTicketFk
+ AND IF(sc.componentFk IS NULL
+ AND c.classRate IS NOT NULL, FALSE, TRUE)
GROUP BY s.id ORDER BY s.id;
DROP TEMPORARY TABLE tmp.ticketComponentPreview;
@@ -72615,7 +72615,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_printLabelPrevious`(vTicketFk INT)
BEGIN
/**
- * Calls the report_print procedure and passes it
+ * Calls the report_print procedure and passes it
* the necessary parameters for printing.
*
* @param vTicketFk id ticket to print.
@@ -72623,18 +72623,18 @@ BEGIN
DECLARE vPrinterFk INT;
DECLARE vSaleGroup INT;
DECLARE vUserFk INT DEFAULT account.myUser_getId();
-
+
SELECT sg.id, o.labelerFk INTO vSaleGroup, vPrinterFk
FROM saleGroup sg
JOIN sector sc ON sc.id = sg.sectorFk
- JOIN saleGroupDetail sgd ON sg.id = sgd.saleGroupFk
+ JOIN saleGroupDetail sgd ON sg.id = sgd.saleGroupFk
JOIN sale s ON sgd.saleFk = s.id
JOIN ticket t ON s.ticketFk = t.id
JOIN operator o ON o.workerFk = vUserFk
- WHERE sc.id = o.sectorFk
+ WHERE sc.id = o.sectorFk
AND t.id = vTicketFk
LIMIT 1;
-
+
CALL report_print(
'LabelPrevia',
vPrinterFk,
@@ -72668,12 +72668,12 @@ proc:BEGIN
*/
DECLARE hasInvoice BOOL;
- SELECT COUNT(*) INTO hasInvoice
- FROM ticket
+ SELECT COUNT(*) INTO hasInvoice
+ FROM ticket
WHERE id = vSelf
AND refFk IS NOT NULL;
-
- IF hasInvoice THEN
+
+ IF hasInvoice THEN
LEAVE proc;
END IF;
@@ -72907,62 +72907,62 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_setState`(vSelf INT, vStateCode VARCHAR(255) COLLATE utf8_general_ci)
-BEGIN
-/**
- * Modifica el estado de un ticket si se cumplen las condiciones necesarias.
- *
- * @param vSelf el id del ticket
- * @param vStateCode estado a modificar del ticket
- */
- DECLARE vticketAlertLevel INT;
- DECLARE vTicketStateCode VARCHAR(255);
- DECLARE vCanChangeState BOOL;
- DECLARE vPackedAlertLevel INT;
- DECLARE vOnPreparationAlertLevel INT;
- DECLARE vNextAlertLevel INT;
- DECLARE vZoneFk INT;
-
- SELECT s.alertLevel, s.`code`, s2.alertLevel, t.zoneFk
- INTO vticketAlertLevel, vTicketStateCode, vNextAlertLevel , vZoneFk
- FROM state s
- JOIN ticketTracking tt ON tt.stateFk = s.id
- JOIN state s2 ON s2.code = vStateCode
- JOIN ticket t ON t.id = tt.ticketFk
- WHERE tt.ticketFk = vSelf
- ORDER BY tt.created DESC
- LIMIT 1;
-
- SELECT id INTO vPackedAlertLevel FROM alertLevel WHERE code = 'PACKED';
- SELECT id INTO vOnPreparationAlertLevel FROM alertLevel WHERE code = 'ON_PREPARATION';
-
- IF vStateCode = 'OK' AND vZoneFk IS NULL THEN
- CALL util.throw('ASSIGN_ZONE_FIRST');
- END IF;
-
- IF vNextAlertLevel > vticketAlertLevel && vticketAlertLevel < vOnPreparationAlertLevel THEN
- UPDATE sale
- SET originalQuantity = quantity
- WHERE ticketFk = vSelf;
- END IF;
-
- SET vCanChangeState = (vStateCode <> 'ON_CHECKING' OR vticketAlertLevel < vPackedAlertLevel)
- AND NOT (
- vTicketStateCode IN ('CHECKED', 'CHECKING')
- AND vStateCode IN ('PREPARED', 'ON_PREPARATION')
- );
-
- IF vCanChangeState THEN
- INSERT INTO ticketTracking (stateFk, ticketFk, workerFk)
- SELECT id, vSelf, account.myUser_getId()
- FROM state
- WHERE `code` = vStateCode COLLATE utf8_unicode_ci;
-
- IF vStateCode = 'PACKED' THEN
- CALL ticket_doCmr(vSelf);
- END IF;
- ELSE
- CALL util.throw('INCORRECT_TICKET_STATE');
- END IF;
+BEGIN
+/**
+ * Modifica el estado de un ticket si se cumplen las condiciones necesarias.
+ *
+ * @param vSelf el id del ticket
+ * @param vStateCode estado a modificar del ticket
+ */
+ DECLARE vticketAlertLevel INT;
+ DECLARE vTicketStateCode VARCHAR(255);
+ DECLARE vCanChangeState BOOL;
+ DECLARE vPackedAlertLevel INT;
+ DECLARE vOnPreparationAlertLevel INT;
+ DECLARE vNextAlertLevel INT;
+ DECLARE vZoneFk INT;
+
+ SELECT s.alertLevel, s.`code`, s2.alertLevel, t.zoneFk
+ INTO vticketAlertLevel, vTicketStateCode, vNextAlertLevel , vZoneFk
+ FROM state s
+ JOIN ticketTracking tt ON tt.stateFk = s.id
+ JOIN state s2 ON s2.code = vStateCode
+ JOIN ticket t ON t.id = tt.ticketFk
+ WHERE tt.ticketFk = vSelf
+ ORDER BY tt.created DESC
+ LIMIT 1;
+
+ SELECT id INTO vPackedAlertLevel FROM alertLevel WHERE code = 'PACKED';
+ SELECT id INTO vOnPreparationAlertLevel FROM alertLevel WHERE code = 'ON_PREPARATION';
+
+ IF vStateCode = 'OK' AND vZoneFk IS NULL THEN
+ CALL util.throw('ASSIGN_ZONE_FIRST');
+ END IF;
+
+ IF vNextAlertLevel > vticketAlertLevel && vticketAlertLevel < vOnPreparationAlertLevel THEN
+ UPDATE sale
+ SET originalQuantity = quantity
+ WHERE ticketFk = vSelf;
+ END IF;
+
+ SET vCanChangeState = (vStateCode <> 'ON_CHECKING' OR vticketAlertLevel < vPackedAlertLevel)
+ AND NOT (
+ vTicketStateCode IN ('CHECKED', 'CHECKING')
+ AND vStateCode IN ('PREPARED', 'ON_PREPARATION')
+ );
+
+ IF vCanChangeState THEN
+ INSERT INTO ticketTracking (stateFk, ticketFk, workerFk)
+ SELECT id, vSelf, account.myUser_getId()
+ FROM state
+ WHERE `code` = vStateCode COLLATE utf8_unicode_ci;
+
+ IF vStateCode = 'PACKED' THEN
+ CALL ticket_doCmr(vSelf);
+ END IF;
+ ELSE
+ CALL util.throw('INCORRECT_TICKET_STATE');
+ END IF;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -72996,40 +72996,40 @@ proc:BEGIN
SELECT COUNT(*) INTO vProblemLines
FROM tmp.salesToSplit
WHERE ticketFk = vTicketFk;
-
+
SELECT count(*) INTO vTotalLines
- FROM vn.sale s
+ FROM vn.sale s
WHERE s.ticketFk = vTicketFk;
-
+
SET vHasFullProblem = (vTotalLines = vProblemLines);
-- Ticket completo
IF vHasFullProblem THEN
-
+
UPDATE vn.ticket
SET landed = vDated + INTERVAL 1 DAY,
shipped = vDated,
nickname = CONCAT('(',DAY(util.VN_CURDATE()),') ', nickname )
WHERE id = vTicketFk;
-
+
SELECT CONCAT("Se ha cambiado el ticket ", vTicketFk, " al dia ", vDated);
LEAVE proc;
-
+
END IF;
-- Ticket a futuro existe
IF vTicketFutureFk THEN
-
- UPDATE vn.sale s
+
+ UPDATE vn.sale s
JOIN tmp.salesToSplit ss ON s.id = ss.saleFk
SET s.ticketFk = vTicketFutureFk,
s.concept = CONCAT('(s) ', s.concept)
WHERE ss.ticketFk = vTicketFk;
-
- SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk,
+
+ SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk,
" al ticket existente ", vTicketFutureFk,"(", vDated,")");
LEAVE proc;
-
+
END IF;
-- Ticket nuevo
@@ -73041,18 +73041,18 @@ proc:BEGIN
t.landed = vDated + INTERVAL 1 DAY,
t.shipped = vDated,
t.agencyModeFk = pc.defautlAgencyMode,
- t.zoneFk = pc.defaultZone
+ t.zoneFk = pc.defaultZone
WHERE t.id = vTicketFutureFk;
-
- UPDATE vn.sale s
- JOIN tmp.salesToSplit sts ON sts.saleFk = s.id
+
+ UPDATE vn.sale s
+ JOIN tmp.salesToSplit sts ON sts.saleFk = s.id
SET s.ticketFk = vTicketFutureFk,
s.concept = CONCAT('(s) ', s.concept)
WHERE sts.ticketFk = vTicketFk;
CALL vn.ticketStateUpdate(vTicketFutureFk, 'FIXING');
- SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk,
+ SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk,
" al nuevo ticket ", vTicketFutureFk,"(", vDated,")");
END ;;
DELIMITER ;
@@ -73191,43 +73191,43 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_splitPackingComplete`(vTicketFk INT, vSectorFk INT)
BEGIN
-
+
DECLARE vNeedToSplit BOOLEAN;
DECLARE vNewTicketFk INT;
-
+
DROP TEMPORARY TABLE IF EXISTS tmpSale;
-
+
CREATE TEMPORARY TABLE tmpSale
SELECT DISTINCT s.id
- FROM vn.ticket t
+ FROM vn.ticket t
JOIN vn.sale s ON s.ticketFk = t.id
- JOIN vn.item i ON i.id = s.itemFk
+ JOIN vn.item i ON i.id = s.itemFk
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = s.itemFk AND iss.sectorFk = vSectorFk
- JOIN vn.packagingConfig pc
+ JOIN vn.packagingConfig pc
WHERE t.id = vTicketFk
AND ( s.quantity MOD IFNULL(iss.packing,1) != 0
- OR
+ OR
IFNULL(iss.packing,1) = 1
- OR
+ OR
i.`size` <= pc.previousPreparationMinimumSize
);
-
- SELECT COUNT(*)
+
+ SELECT COUNT(*)
INTO vNeedToSplit
- FROM tmpSale;
-
+ FROM tmpSale;
+
IF vNeedToSplit THEN
-
+
CALL vn.ticket_Clone(vTicketFk, vNewTicketFk);
-
+
UPDATE vn.sale s
- JOIN vn.tmpSale ts ON ts.id = s.id
+ JOIN vn.tmpSale ts ON ts.id = s.id
SET s.ticketFk = vNewTicketFk;
-
+
END IF;
-
+
DROP TEMPORARY TABLE tmpSale;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -73258,7 +73258,7 @@ BEGIN
WHERE ot.description = 'Peso Aduana'
AND t.clientFk = vClientFk
AND t.shipped BETWEEN vDated AND util.dayend(vDated);
-
+
SELECT sum(IF(sv.physicalWeight = 0, sv.weight, sv.physicalWeight)) INTO vTheorycalWeight
FROM vn.ticket t
JOIN vn.sale s ON s.ticketFk = t.id
@@ -73267,9 +73267,9 @@ BEGIN
JOIN vn.itemCost ic ON ic.itemFk = i.id AND ic.warehouseFk = t.warehouseFk
WHERE t.clientFk = vClientFk
AND t.shipped BETWEEN vDated AND util.dayend(vDated);
-
+
SET vRatio = vRealWeight / vTheorycalWeight;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticketWeight;
CREATE TEMPORARY TABLE tmp.ticketWeight
@@ -73290,7 +73290,7 @@ BEGIN
AND t.shipped BETWEEN vDated AND util.dayend(vDated)
GROUP BY ib.ediBotanic, o.code;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -73410,18 +73410,18 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculateAll`(vDatedFr
BEGIN
/**
- * @param vDatedFrom Fecha desde
+ * @param vDatedFrom Fecha desde
* @param vDatedTo Fecha hasta
*/
- CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
+ CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
SELECT w.id userFk
FROM vn.worker w;
-
+
CALL vn.timeBusiness_calculate(vDatedFrom, vDatedTo);
DROP TEMPORARY TABLE tmp.`user`;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -73441,21 +73441,21 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculateByDepartment`(vDepartmentFk INT, vDatedFrom DATETIME, vDatedTo DATETIME)
BEGIN
/**
- * @param vDepartmentFk
+ * @param vDepartmentFk
* @param vDatedFrom workerTimeControl
* @param vDatedTo workerTimeControl
*/
DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
-
+
CREATE TEMPORARY TABLE tmp.`user`
SELECT DISTINCT b.workerFk userFk
- FROM business AS b
- WHERE (b.started BETWEEN vDatedFrom AND vDatedTo
+ FROM business AS b
+ WHERE (b.started BETWEEN vDatedFrom AND vDatedTo
OR IFNULL(b.ended, vDatedTo) BETWEEN vDatedFrom AND vDatedTo
OR (b.started <= vDatedFrom AND b.ended >= vDatedTo)
) AND b.departmentFk = vDepartmentFk
ORDER BY b.ended DESC;
-
+
CALL timeBusiness_calculate(vDatedFrom, vDatedTo);
DROP TEMPORARY TABLE tmp.`user`;
@@ -73480,19 +73480,19 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculateByUser`(vUser
BEGIN
/**
- * @param vUserFk
+ * @param vUserFk
* @param vDatedFrom workerTimeControl
* @param vDatedTo workerTimeControl
*/
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
-
+
CREATE TEMPORARY TABLE tmp.`user`
SELECT id userFk
- FROM account.user
- WHERE id = vUserFk;
+ FROM account.user
+ WHERE id = vUserFk;
CALL vn.timeBusiness_calculate(vDatedFrom, vDatedTo);
-
+
DROP TEMPORARY TABLE tmp.`user`;
END ;;
@@ -73519,14 +73519,14 @@ BEGIN
* @param vDatedFrom Fecha desde
* @param vDatedTo Fecha hasta
*/
-
- CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
+
+ CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
SELECT w.id userFk
FROM worker w
WHERE w.id = vWorkerFk;
-
+
CALL timeBusiness_calculate(vDatedFrom, vDatedTo);
-
+
DROP TEMPORARY TABLE tmp.`user`;
END ;;
@@ -73546,30 +73546,30 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculate`(
- vDatedFrom DATETIME,
+ vDatedFrom DATETIME,
vDatedTo DATETIME)
BEGIN
/*
* @param vDatedFrom
- * @param vDatedTo
- * Cálculo de horas trabajadas por empleado y día,
+ * @param vDatedTo
+ * Cálculo de horas trabajadas por empleado y día,
* sin tener en cuenta los días con fichadas incorrectas (tabla tmp.timeControlError)
- * En el caso de haber hecho descanso y trabajado un mínimo de tiempo (vTimeToBreakTime),
+ * En el caso de haber hecho descanso y trabajado un mínimo de tiempo (vTimeToBreakTime),
* se añade al tiempo de trabajo efectivo el descanso (vBreakTime)
- * @return tmp.timeControlCalculate
+ * @return tmp.timeControlCalculate
* (workerFk, dated, timeWorkSeconds, timeWorkSexagesimal, timeWorkDecimal, timed)
*/
DECLARE vHourToSeconds INTEGER;
DECLARE vDatedFromYesterday DATETIME;
- DECLARE vDatedToTomorrow DATETIME;
+ DECLARE vDatedToTomorrow DATETIME;
DECLARE vTimeToBreakTime INT;
DECLARE vBreakTime INT;
-
- SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY)
+
+ SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY)
INTO vDatedFromYesterday, vDatedToTomorrow;
-
+
SELECT timeToBreakTime, breakTime INTO vTimeToBreakTime, vBreakTime
- FROM workerTimeControlConfig
+ FROM workerTimeControlConfig
LIMIT 1;
CALL timeControl_getError(vDatedFrom, vDatedTo);
@@ -73578,9 +73578,9 @@ BEGIN
CREATE TEMPORARY TABLE tmp.workerTimeControl
(INDEX (userFk), INDEX (timed))
ENGINE = MEMORY
- SELECT DISTINCT(wtc.id),
- wtc.userFk,
- wtc.timed,
+ SELECT DISTINCT(wtc.id),
+ wtc.userFk,
+ wtc.timed,
wtc.direction,
TRUE isReal
FROM workerTimeControl wtc
@@ -73590,10 +73590,10 @@ BEGIN
AND tce.id IS NULL
ORDER BY wtc.userFk, wtc.timed ASC;
- SELECT MAX(id) INTO @vCont
+ SELECT MAX(id) INTO @vCont
FROM tmp.workerTimeControl;
- DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux;
+ DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux;
CREATE TEMPORARY TABLE tmp.workerTimeControlAux (
`id` int(11) ,
`userFk` int(10) unsigned ,
@@ -73606,14 +73606,14 @@ BEGIN
-- Cambio de dia en medio de un descanso
INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction)
- SELECT @vCont:= @vCont + 1 id,
- userFk,
- util.dayEnd(dated) timed,
+ SELECT @vCont:= @vCont + 1 id,
+ userFk,
+ util.dayEnd(dated) timed,
'middle' direction
FROM(SELECT wtc.userFk,
DATE(@lastTimed) dated,
(@vIsOdd := NOT @vIsOdd) isOdd,
- IF(@vIsOdd AND wtc.direction = 'middle'
+ IF(@vIsOdd AND wtc.direction = 'middle'
AND DATE(timed) <> DATE(@lastTimed), TRUE, FALSE) hasBreak,
@lastTimed := wtc.timed
FROM tmp.workerTimeControl wtc
@@ -73626,14 +73626,14 @@ BEGIN
SET @vIsOdd := FALSE;
INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction)
- SELECT @vCont:= @vCont + 1,
- userFk,
- DATE_ADD(sub.dated, INTERVAL 1 DAY),
+ SELECT @vCont:= @vCont + 1,
+ userFk,
+ DATE_ADD(sub.dated, INTERVAL 1 DAY),
'middle'
FROM(SELECT wtc.userFk,
DATE(@lastTimed) dated,
(@vIsOdd := NOT @vIsOdd) isOdd,
- IF(@vIsOdd AND wtc.direction = 'middle'
+ IF(@vIsOdd AND wtc.direction = 'middle'
AND DATE(timed) <> DATE(@lastTimed), TRUE, FALSE) hasBreak,
@lastTimed := wtc.timed
FROM tmp.workerTimeControl wtc
@@ -73644,9 +73644,9 @@ BEGIN
-- Cambio de dia
INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction)
- SELECT @vCont:= @vCont + 1 id,
- sub.userFk,
- util.dayEnd(sub.dated) timed,
+ SELECT @vCont:= @vCont + 1 id,
+ sub.userFk,
+ util.dayEnd(sub.dated) timed,
'out' direction
FROM (SELECT MAX(wtc.timed) timed, wtc.userFk, date(wtc.timed) dated
FROM workerTimeControl wtc
@@ -73656,7 +73656,7 @@ BEGIN
AND tce.id IS NULL
GROUP BY wtc.userFk, DATE(wtc.timed)
) sub
- JOIN tmp.workerTimeControl wtc ON wtc.timed = sub.timed
+ JOIN tmp.workerTimeControl wtc ON wtc.timed = sub.timed
AND wtc.userFk = sub.userFk
WHERE wtc.direction <> 'out';
@@ -73670,7 +73670,7 @@ BEGIN
AND tce.id IS NULL
GROUP BY wtc.userFk, DATE(wtc.timed)
) sub
- JOIN tmp.workerTimeControl wtc ON wtc.timed = sub.timed
+ JOIN tmp.workerTimeControl wtc ON wtc.timed = sub.timed
AND wtc.userFk = sub.userFk
WHERE wtc.direction <> 'out';
@@ -73687,7 +73687,7 @@ BEGIN
CREATE TEMPORARY TABLE tmp.workerBreakDays
(INDEX (userFk), INDEX (dated))
ENGINE = MEMORY
- SELECT sub.userFk,
+ SELECT sub.userFk,
sub.dated
FROM (SELECT (@vIsOdd := NOT @vIsOdd),
IF(wtc.direction = 'in', @vIsOdd := TRUE, NULL),
@@ -73696,7 +73696,7 @@ BEGIN
IF(direction='in', @vDated := DATE(wtc.timed), @vDated) dated,
wtc.userFk
FROM tmp.workerTimeControl wtc
- ORDER BY wtc.userFk, wtc.timed, wtc.id
+ ORDER BY wtc.userFk, wtc.timed, wtc.id
LIMIT 10000000000000000000
)sub
GROUP BY sub.userFk, sub.dated
@@ -73707,9 +73707,9 @@ BEGIN
SET @vLastTimed := 0;
DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux2;
- CREATE TEMPORARY TABLE tmp.workerTimeControlAux2
+ CREATE TEMPORARY TABLE tmp.workerTimeControlAux2
SELECT *
- FROM tmp.workerTimeControl
+ FROM tmp.workerTimeControl
WHERE timed BETWEEN vDatedFromYesterday AND vDatedTo
ORDER BY userFk, timed, id;
@@ -73722,7 +73722,7 @@ BEGIN
IF(wb.userFk, vBreakTime, 0) + SUM(sub.timeWork) timeWorkSeconds,
SEC_TO_TIME(IF(wb.userFk, vBreakTime, 0) + SUM(sub.timeWork)) timeWorkSexagesimal,
(IF(wb.userFk, vBreakTime, 0) + SUM(sub.timeWork)) / vHourToSeconds timeWorkDecimal,
- CAST(GROUP_CONCAT(DATE_FORMAT(sub.realTimed, "%H:%i")
+ CAST(GROUP_CONCAT(DATE_FORMAT(sub.realTimed, "%H:%i")
ORDER BY sub.timed ASC SEPARATOR ' - ') AS CHAR(256)) timed
FROM (SELECT (@vIsOdd := NOT @vIsOdd),
IF(direction='in', @vIsOdd := TRUE, 0),
@@ -73767,14 +73767,14 @@ BEGIN
* @param vDatedTo Fecha hasta
*/
- CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
+ CREATE OR REPLACE TEMPORARY TABLE tmp.`user`
SELECT w.id userFk
FROM vn.worker w;
-
+
CALL vn.timeControl_calculate(vDatedFrom, vDatedTo);
DROP TEMPORARY TABLE tmp.`user`;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -73794,21 +73794,21 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculateByDepartment`(vDepartmentFk INT, vDatedFrom DATETIME, vDatedTo DATETIME)
BEGIN
/**
- * @param vDepartmentFk
+ * @param vDepartmentFk
* @param vDatedFrom workerTimeControl
* @param vDatedTo workerTimeControl
*/
DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
-
+
CREATE TEMPORARY TABLE tmp.`user`
SELECT DISTINCT b.workerFk userFk
- FROM business AS b
- WHERE (b.started BETWEEN vDatedFrom AND vDatedTo
+ FROM business AS b
+ WHERE (b.started BETWEEN vDatedFrom AND vDatedTo
OR IFNULL(b.ended, vDatedTo) BETWEEN vDatedFrom AND vDatedTo
OR (b.started <= vDatedFrom AND b.ended >= vDatedTo)
) AND b.departmentFk = vDepartmentFk
ORDER BY b.ended DESC;
-
+
CALL timeControl_calculate(vDatedFrom, vDatedTo);
DROP TEMPORARY TABLE tmp.`user`;
@@ -73833,19 +73833,19 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculateByUser`(vUserF
BEGIN
/**
- * @param vUserFk
+ * @param vUserFk
* @param vDatedFrom workerTimeControl
* @param vDatedTo workerTimeControl
*/
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
-
+
CREATE TEMPORARY TABLE tmp.`user`
SELECT id userFk
- FROM account.user
- WHERE id = vUserFk;
+ FROM account.user
+ WHERE id = vUserFk;
CALL vn.timeControl_calculate(vDatedFrom, vDatedTo);
-
+
DROP TEMPORARY TABLE tmp.`user`;
END ;;
@@ -73868,21 +73868,21 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculateByWorker`(vWor
BEGIN
/**
- * @param vWorkerFk
+ * @param vWorkerFk
* @param vDatedFrom workerTimeControl
* @param vDatedTo workerTimeControl
*/
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
-
+
CREATE TEMPORARY TABLE tmp.`user`
SELECT u.id userFk
FROM account.user u
JOIN vn.worker w ON w.userFk = u.id
WHERE w.id = vWorkerFk;
-
+
CALL vn.timeControl_calculate(vDatedFrom, vDatedTo);
-
+
DROP TEMPORARY TABLE tmp.`user`;
END ;;
@@ -73905,12 +73905,12 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_getError`(vDatedFrom DA
BEGIN
/*
* @param vDatedFrom
- * @param vDatedTo
+ * @param vDatedTo
* @table tmp.`user`(userFk)
* Fichadas incorrectas de las cuales no se puede calcular horas trabajadas
* @return tmp.timeControlError (id)
*/
- DECLARE vDayMaxTime INTEGER;
+ DECLARE vDayMaxTime INTEGER;
SET @journeyCounter := 0;
SET @lastUserFk := NULL;
@@ -73918,16 +73918,16 @@ BEGIN
SELECT dayMaxTime INTO vDayMaxTime
FROM workerTimeControlConfig LIMIT 1;
- DROP TEMPORARY TABLE IF EXISTS tmp.timeControl;
- CREATE TEMPORARY TABLE tmp.timeControl
+ DROP TEMPORARY TABLE IF EXISTS tmp.timeControl;
+ CREATE TEMPORARY TABLE tmp.timeControl
(INDEX(id), INDEX(journeyCounter))
ENGINE = MEMORY
SELECT sub.id,
- sub.direction,
+ sub.direction,
sub.timed,
IF(sub.direction = 'in' OR @hasOut OR sub.userFk <> @lastUserFk, @journeyCounter := @journeyCounter + 1, @journeyCounter) journeyCounter,
- @lastUserFk := sub.userFk workerFk,
- IF(sub.direction = 'out', @hasOut:= TRUE, @hasOut:= FALSE)
+ @lastUserFk := sub.userFk workerFk,
+ IF(sub.direction = 'out', @hasOut:= TRUE, @hasOut:= FALSE)
FROM (
SELECT DISTINCT wtc.id,
wtc.direction,
@@ -73938,36 +73938,36 @@ BEGIN
WHERE wtc.timed BETWEEN DATE_SUB(vDatedFrom, INTERVAL 1 DAY) AND DATE_ADD(vDatedTo, INTERVAL 1 DAY)
ORDER BY wtc.userFk, wtc.timed
) sub;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux;
CREATE TEMPORARY TABLE tmp.timeControlAux
(INDEX(id), INDEX(journeyCounter))
ENGINE = MEMORY
SELECT * FROM tmp.timeControl;
- DROP TEMPORARY TABLE IF EXISTS tmp.timeControlError;
- CREATE TEMPORARY TABLE tmp.timeControlError
+ DROP TEMPORARY TABLE IF EXISTS tmp.timeControlError;
+ CREATE TEMPORARY TABLE tmp.timeControlError
(INDEX(id))
ENGINE = MEMORY
- SELECT id
+ SELECT id
FROM tmp.timeControlAux tca
JOIN (
- SELECT journeyCounter,
+ SELECT journeyCounter,
UNIX_TIMESTAMP(MAX(timed)) - UNIX_TIMESTAMP(MIN(timed)) timeWork,
- SUM(direction = 'in') totalIn,
+ SUM(direction = 'in') totalIn,
SUM(direction = 'out') totalOut,
timed
FROM tmp.timeControl
GROUP BY journeyCounter
- HAVING COUNT(*) MOD 2 = 1
- OR totalIn <> 1
- OR totalOut <> 1
+ HAVING COUNT(*) MOD 2 = 1
+ OR totalIn <> 1
+ OR totalOut <> 1
OR timeWork >= vDayMaxTime
)sub ON sub.journeyCounter = tca.journeyCounter
WHERE sub.timed BETWEEN vDatedFrom AND vDatedTo;
- DROP TEMPORARY TABLE IF EXISTS tmp.timeControl;
- DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux;
+ DROP TEMPORARY TABLE IF EXISTS tmp.timeControl;
+ DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -73990,7 +73990,7 @@ proc: BEGIN
* deprecated call workerTimeControl_check
*/
CALL vn.workerTimeControl_check(vUserFk,vDated,vTabletFk);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -74046,12 +74046,12 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `travelVolume`(vTravelFk INT)
BEGIN
-
- SELECT w1.name AS ORI,
- w2.name AS DES,
+
+ SELECT w1.name AS ORI,
+ w2.name AS DES,
tr.shipped shipment,
tr.landed landing,
- a.name Agencia,
+ a.name Agencia,
s.name Proveedor,
e.id Id_Entrada,
e.invoiceNumber Referencia,
@@ -74059,18 +74059,18 @@ BEGIN
vn.item_getVolume(b.itemFk ,b.packageFk)) / vc.trolleyM3 / 1000000 ,1) AS DECIMAL(10,2)) AS CC,
CAST(ROUND(SUM(GREATEST(b.stickers ,b.quantity /b.packing ) *
vn.item_getVolume(b.itemFk ,b.packageFk)) / vc.palletM3 / 1000000,1) AS DECIMAL(10,2)) AS espais
- FROM vn.buy b
- JOIN vn.entry e ON e.id = b.entryFk
- JOIN vn.supplier s ON s.id = e.supplierFk
- JOIN vn.travel tr ON tr.id = e.travelFk
+ FROM vn.buy b
+ JOIN vn.entry e ON e.id = b.entryFk
+ JOIN vn.supplier s ON s.id = e.supplierFk
+ JOIN vn.travel tr ON tr.id = e.travelFk
JOIN vn.agencyMode a ON a.id = tr.agencyModeFk
- JOIN vn.warehouse w1 ON w1.id = tr.warehouseInFk
- JOIN vn.warehouse w2 ON w2.id = tr.warehouseOutFk
- JOIN vn.volumeConfig vc
- JOIN vn.item i ON i.id = b.itemFk
+ JOIN vn.warehouse w1 ON w1.id = tr.warehouseInFk
+ JOIN vn.warehouse w2 ON w2.id = tr.warehouseOutFk
+ JOIN vn.volumeConfig vc
+ JOIN vn.item i ON i.id = b.itemFk
JOIN vn.itemType it ON it.id = i.typeFk
WHERE tr.id = vTravelFk;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -74126,11 +74126,11 @@ BEGIN
* @param vShipped The shipment date
* @param vLanded The landing date
*/
-
+
IF vLanded < vShipped THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Landing cannot be lesser than shipment';
- END IF;
+ END IF;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -74194,7 +74194,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_checkWarehouseIsFeedStock`(v
proc: BEGIN
/*
* Check that the warehouse is not Feed Stock
- *
+ *
* @vWarehouseFk param warehouse id
*/
IF vWarehouseFk IS NULL THEN
@@ -74282,13 +74282,13 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_cloneWithEntries`(
- IN vTravelFk INT,
- IN vDateStart DATE,
+ IN vTravelFk INT,
+ IN vDateStart DATE,
IN vDateEnd DATE,
IN vWarehouseOutFk INT,
- IN vWarehouseInFk INT,
- IN vRef VARCHAR(255),
- IN vAgencyModeFk INT,
+ IN vWarehouseInFk INT,
+ IN vRef VARCHAR(255),
+ IN vAgencyModeFk INT,
OUT vNewTravelFk INT)
BEGIN
/**
@@ -74312,29 +74312,29 @@ BEGIN
FROM entry e
JOIN travel t ON t.id = e.travelFk
WHERE e.travelFk = vTravelFk;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
+ BEGIN
ROLLBACK;
RESIGNAL;
END;
-
+
START TRANSACTION;
INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg,clonedFrom)
SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg,vTravelFk
FROM travel
WHERE id = vTravelFk;
-
+
SET vNewTravelFk = LAST_INSERT_ID();
SET vDone = FALSE;
SET @isModeInventory = TRUE;
OPEN vRsEntry;
-
+
l: LOOP
SET vDone = FALSE;
FETCH vRsEntry INTO vAuxEntryFk;
@@ -74403,11 +74403,11 @@ BEGIN
SELECT COUNT(*) INTO vTotalEntries
FROM entry
WHERE travelFk = vTravelFk;
-
+
UPDATE travel
SET totalEntries = vTotalEntries
WHERE id = vTravelFk;
-
+
DELETE FROM travelRecalc WHERE travelFk = vTravelFk;
END LOOP;
@@ -74438,10 +74438,10 @@ BEGIN
WHERE id = vSelf;
SELECT e.id entryFk
- FROM travel t
- JOIN entry e ON e.travelFk = t.id
- JOIN buy b ON b.entryFk = e.id
- WHERE t.id = vTravelFk
+ FROM travel t
+ JOIN entry e ON e.travelFk = t.id
+ JOIN buy b ON b.entryFk = e.id
+ WHERE t.id = vTravelFk
AND (b.packing IS NULL OR b.packageFk IS NULL);
END ;;
DELIMITER ;
@@ -74464,7 +74464,7 @@ BEGIN
/*
* Desplaza al dia siguiente los travels que contengan redadas y avisa a los compradores
- *
+ *
*/
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vWorkerName VARCHAR(50);
@@ -74476,7 +74476,7 @@ BEGIN
SELECT GROUP_CONCAT( DISTINCT CONCAT('https://salix.verdnatura.es/#!/travel/', ttr.id, '/summary ') ORDER BY ttr.id SEPARATOR '\n\r'),
u.name
FROM tmp.travel ttr
- JOIN entry e ON e.travelFk = ttr.id
+ JOIN entry e ON e.travelFk = ttr.id
JOIN buy b ON b.entryFk = e.id
JOIN item i ON i.id = b.itemFk
JOIN itemType it ON it.id = i.typeFk
@@ -74484,19 +74484,19 @@ BEGIN
GROUP BY u.name;
DECLARE CONTINUE HANDLER FOR NOT FOUND
- SET vDone = TRUE;
+ SET vDone = TRUE;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
RESIGNAL;
END;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.travel;
CREATE TEMPORARY TABLE tmp.travel
SELECT tr.id,tr.landed
FROM travel tr
- JOIN entry e ON e.travelFk = tr.id
+ JOIN entry e ON e.travelFk = tr.id
WHERE tr.landed = util.tomorrow()
AND e.isRaid
GROUP BY tr.id;
@@ -74554,7 +74554,7 @@ proc: BEGIN
IF vSelf IS NULL THEN
LEAVE proc;
END IF;
-
+
INSERT IGNORE INTO travelRecalc SET travelFk = vSelf;
END ;;
DELIMITER ;
@@ -74580,10 +74580,10 @@ BEGIN
* @param vItemFk id del item
* @param vPacking nuevo packing
*/
-
+
DECLARE vAuctionWarehouseFk INT;
DECLARE vMainWarehouseFk INT;
-
+
SELECT warehouseFk INTO vAuctionWarehouseFk
FROM auctionConfig;
@@ -74643,7 +74643,7 @@ BEGIN
FROM travelClonedWeekly
WHERE travelFk;
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
SET vCounter = vSinceWeek;
@@ -74705,12 +74705,12 @@ BEGIN
/*
* Plantilla para modificar reemplazar todos los tags
* por los valores que tienen los articulos
- *
+ *
* @param vTypeFk tipo a modificar
- *
+ *
*/
- DELETE it.*
- FROM itemTag it
+ DELETE it.*
+ FROM itemTag it
JOIN item i ON i.id = it.itemFk
WHERE i.typeFk = vTypeFk;
@@ -74719,40 +74719,40 @@ BEGIN
FROM item i
JOIN tag t ON t.name = 'Longitud' COLLATE utf8_general_ci
WHERE i.typeFk = vTypeFk;
-
+
INSERT INTO itemTag(itemFk, tagFk, value, priority)
SELECT i.id, t.id, i.category, 5
FROM item i
JOIN tag t ON t.name = 'Categoria' COLLATE utf8_general_ci
WHERE i.typeFk = vTypeFk;
-
+
INSERT INTO itemTag(itemFk, tagFk, value, priority)
SELECT i.id, t.id, ink.name, 2
FROM item i
JOIN tag t ON t.name = 'Color' COLLATE utf8_general_ci
JOIN ink ON ink.id = i.inkFk
WHERE i.typeFk = vTypeFk;
-
+
INSERT INTO itemTag(itemFk, tagFk, value, priority)
SELECT i.id, t.id, p.name, 3
FROM item i
JOIN tag t ON t.name = 'Productor' COLLATE utf8_general_ci
JOIN producer p ON p.id = i.producerFk
- WHERE i.typeFk = vTypeFk;
-
+ WHERE i.typeFk = vTypeFk;
+
INSERT INTO itemTag(itemFk, tagFk, value, priority)
SELECT i.id, t.id, o.name, 4
FROM item i
JOIN tag t ON t.name = 'Origen' COLLATE utf8_general_ci
JOIN origin o ON o.id = i.originFk
WHERE i.typeFk = vTypeFk;
- /*
+ /*
INSERT INTO itemTag(itemFk, tagFk, value, priority)
SELECT i.id, t.id, i.stems, 6
FROM item i
JOIN tag t ON t.name = 'Tallos' COLLATE utf8_general_ci
- WHERE i.typeFk = vTypeFk;
- */
+ WHERE i.typeFk = vTypeFk;
+ */
-- CALL itemTagArrangedUpdate(NULL);
END ;;
@@ -74775,7 +74775,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `updatePedidosInternos`(vItemFk INT)
BEGIN
UPDATE vn.item SET upToDown = 0 WHERE item.id = vItemFk;
-
+
END ;;
DELIMITER ;
@@ -74803,7 +74803,7 @@ BEGIN
SELECT vp.regex INTO vRegex
FROM vehiclePlateRegex vp
WHERE vp.countryCodeFk = vCountryCodeFk;
-
+
IF NOT vNumberPlate REGEXP BINARY (vRegex)THEN
CALL util.throw(CONCAT('Error: la matricula ', vNumberPlate, ' no es valida para ',vCountryCodeFk));
END IF;
@@ -74836,7 +74836,7 @@ proc:BEGIN
ROLLBACK;
RESIGNAL;
END;
-
+
SELECT eventEarlyDays INTO vEventEarlyDays
FROM vehicleConfig;
@@ -74854,7 +74854,7 @@ proc:BEGIN
IF NOT vHasEvents THEN
LEAVE proc;
END IF;
-
+
START TRANSACTION;
SELECT util.notification_send('vehicle-event-expired',
@@ -74889,21 +74889,21 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `visible_getMisfit`(vSectorFk INT)
BEGIN
-
+
/* Devuelve una tabla temporal con los descuadres entre el visible teórico y lo ubicado en la práctica
- *
+ *
* @param vSectorFk Identificador de vn.sector
- *
+ *
* @return tmp.stockMisfit(itemFk, visible, parked)
*/
-
+
DECLARE vCalcVisibleFk INT;
DECLARE vWarehouseFk INT;
SELECT warehouseFk INTO vWarehouseFk
- FROM vn.sector s
+ FROM vn.sector s
WHERE s.id = vSectorFk;
-
+
CALL cache.visible_refresh(vCalcVisibleFk, FALSE, vWarehouseFk);
DROP TEMPORARY TABLE IF EXISTS tmp.stockMisfit;
@@ -74916,17 +74916,17 @@ BEGIN
INSERT INTO tmp.stockMisfit(itemFk, parked)
SELECT iss.itemFk , sum(iss.visible )
- FROM vn.itemShelvingStock iss
- JOIN vn.sector s ON s.id = iss.sectorFk
+ FROM vn.itemShelvingStock iss
+ JOIN vn.sector s ON s.id = iss.sectorFk
WHERE vSectorFk IN (s.id, s.sonFk)
GROUP BY iss.itemFk;
-
+
INSERT INTO tmp.stockMisfit(itemFk, visible)
- SELECT v.item_id , v.visible
- FROM cache.visible v
- WHERE v.calc_id = vCalcVisibleFk
+ SELECT v.item_id , v.visible
+ FROM cache.visible v
+ WHERE v.calc_id = vCalcVisibleFk
ON DUPLICATE KEY UPDATE visible = v.visible;
-
+
DELETE FROM tmp.stockMisfit
WHERE visible = parked;
@@ -74950,17 +74950,17 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `warehouseFitting`(IN vWhOrigin INT
BEGIN
DECLARE vCacheVisibleOriginFk INT;
DECLARE vCacheVisibleDestinyFk INT;
-
+
CALL cache.visible_refresh(vCacheVisibleOriginFk, FALSE, vWhOrigin);
CALL cache.visible_refresh(vCacheVisibleDestinyFk, FALSE, vWhDestiny);
-
+
SELECT i.id itemFk,
i.longName,
i.size,
i.subName,
vOrigin.visible AS Origen,
vDestiny.visible Destino
-
+
FROM vn.item i
JOIN vn.itemType it ON it.id = i.typeFk
LEFT JOIN cache.visible vOrigin ON vOrigin.calc_id = vCacheVisibleOriginFk AND vOrigin.item_id = i.id
@@ -74989,13 +74989,13 @@ BEGIN
DECLARE vWhOrigin INT;
DECLARE vWhDestiny INT;
-
+
SELECT warehouseInFk, warehouseOutFk INTO vWhDestiny, vWhOrigin
FROM vn.travel
WHERE id = vTravelFk;
-
+
CALL vn.warehouseFitting(vWhOrigin, vWhDestiny);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -75059,7 +75059,7 @@ BEGIN
* Calcula los días y horas de vacaciones en función de un contrato y año
*
* @param vYear
- * @param vBusinessFk
+ * @param vBusinessFk
* @return tmp.workerCalendarCalculateBusiness (days, hours, daysEnjoyed, hoursEnjoyed)
*/
DECLARE vStarted DATE;
@@ -75071,17 +75071,17 @@ BEGIN
DECLARE vPayedHolidays DECIMAL(5,2);
DECLARE vDifDays INT;
- SELECT IF(b.started < CONCAT(vYear,"-01-01"), CONCAT(vYear,"-01-01"),b.started),
- IF(b.ended IS NULL OR YEAR(b.ended)>vYear , CONCAT(vYear,"-12-31"), b.ended),
+ SELECT IF(b.started < CONCAT(vYear,"-01-01"), CONCAT(vYear,"-01-01"),b.started),
+ IF(b.ended IS NULL OR YEAR(b.ended)>vYear , CONCAT(vYear,"-12-31"), b.ended),
IF(wbt.hasHolidayEntitlement, w.days, 0),
c.hoursWeek,
IF(YEAR(b.ended) = vYear, b.payedHolidays, 0) payedHolidays
- INTO vStarted,
- vEnded,
- vDaysHoliday,
+ INTO vStarted,
+ vEnded,
+ vDaysHoliday,
vHoursWeek,
vPayedHolidays
- FROM business b
+ FROM business b
JOIN workerBusinessType wbt ON wbt.id = b.workerBusinessTypeFk
JOIN workCenterHoliday w ON w.workcenterFk = b.workcenterFk
LEFT JOIN calendarType c ON c.id = b.calendarTypeFk
@@ -75089,23 +75089,23 @@ BEGIN
AND w.year = vYear;
DROP TEMPORARY TABLE IF EXISTS tmp.workerCalendarCalculateBusiness;
-
+
IF vStarted < vEnded THEN
SET vDifDays = DAYOFYEAR(vEnded) - DAYOFYEAR(vStarted) + 1;
- SELECT IFNULL(SUM(a.holidayEntitlementRate), 0),
+ SELECT IFNULL(SUM(a.holidayEntitlementRate), 0),
SUM(-(a.discountRate - 1)) + vPayedHolidays
- INTO vDaysToSubtract,
- vDaysHolidayEnjoyed
+ INTO vDaysToSubtract,
+ vDaysHolidayEnjoyed
FROM calendar c
JOIN absenceType a ON a.id = c.dayOffTypeFk
JOIN business b ON b.id = c.businessFk
- WHERE b.id = vBusinessFk
+ WHERE b.id = vBusinessFk
AND YEAR(c.dated) = vYear;
END IF;
- CREATE TEMPORARY TABLE tmp.workerCalendarCalculateBusiness
+ CREATE TEMPORARY TABLE tmp.workerCalendarCalculateBusiness
ENGINE = MEMORY
SELECT @days := IFNULL(ROUND((vDaysHoliday * (vDifDays - vDaysToSubtract) / IF(util.isLeapYear(vYear) , 366, 365)), 1), 0) days,
@days * (vHoursWeek / 5) hours,
@@ -75133,32 +75133,32 @@ BEGIN
/**
* Calcula los días y horas de vacaciones en función de un trabajador y año
*
- * @param vYear
- * @param vWorkerFk
+ * @param vYear
+ * @param vWorkerFk
* @return tmp.workerCalendarCalculateYear (days, hours, daysEnjoyed, hoursEnjoyed)
- */
+ */
DECLARE vDone BOOL;
DECLARE vBusinessFk INT;
DECLARE cur CURSOR FOR
- SELECT b.id
+ SELECT b.id
FROM business b
- WHERE vYear BETWEEN YEAR(b.started) AND IFNULL(YEAR(b.ended), vYear)
+ WHERE vYear BETWEEN YEAR(b.started) AND IFNULL(YEAR(b.ended), vYear)
AND b.workerFk = vWorkerFk;
DECLARE CONTINUE HANDLER FOR NOT FOUND
- SET vDone = TRUE;
-
+ SET vDone = TRUE;
+
DROP TEMPORARY TABLE IF EXISTS tmp.workerCalendarCalculateYear;
CREATE TEMPORARY TABLE tmp.workerCalendarCalculateYear
- (days DEC(5,2),
+ (days DEC(5,2),
hours DEC(5,2),
- daysEnjoyed DEC(5,2),
- hoursEnjoyed DEC(5,2))
+ daysEnjoyed DEC(5,2),
+ hoursEnjoyed DEC(5,2))
ENGINE = MEMORY;
INSERT INTO tmp.workerCalendarCalculateYear VALUES(0, 0, 0, 0);
-
+
OPEN cur;
l: LOOP
@@ -75171,12 +75171,12 @@ BEGIN
CALL workerCalendar_calculateBusiness(vYear, vBusinessFk);
UPDATE tmp.workerCalendarCalculateYear w
- JOIN tmp.workerCalendarCalculateBusiness wc
+ JOIN tmp.workerCalendarCalculateBusiness wc
SET w.days = w.days + wc.days,
w.hours = w.hours + wc.hours,
w.daysEnjoyed = w.daysEnjoyed + wc.daysEnjoyed,
w.hoursEnjoyed = w.hoursEnjoyed + wc.hoursEnjoyed;
-
+
DROP TEMPORARY TABLE tmp.workerCalendarCalculateBusiness;
END LOOP;
@@ -75201,7 +75201,7 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerCreate`(
vFirstname VARCHAR(50),
- vLastName VARCHAR(50),
+ vLastName VARCHAR(50),
vCode CHAR(3),
vBossFk INT,
vUserFk INT,
@@ -75213,7 +75213,7 @@ BEGIN
* Create new worker
*
*/
- INSERT INTO worker(id, code, firstName, lastName, bossFk, fi, birth,userFk)
+ INSERT INTO worker(id, code, firstName, lastName, bossFk, fi, birth,userFk)
VALUES (vUserFk, vCode, vFirstname, vLastName, vBossFk, vFi, vBirth,vUserFk);
END ;;
DELIMITER ;
@@ -75279,20 +75279,20 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp.workerDepartmentByDate;
CREATE TEMPORARY TABLE tmp.workerDepartmentByDate
ENGINE = MEMORY
- SELECT w.id userFk,
- w.lastName name,
- w.firstName firstname,
- d.name department,
+ SELECT w.id userFk,
+ w.lastName name,
+ w.firstName firstname,
+ d.name department,
d.id departmentFk,
- b.started,
- d.isProduction,
+ b.started,
+ d.isProduction,
CAST(12 * b.amount / ct.hoursWeek / 52 AS DECIMAL(10,2)) costeHora,
w.fi nif
FROM business b
JOIN calendarType ct ON ct.id = b.calendarTypeFk
JOIN department d ON d.id = b.departmentFk
JOIN worker w ON w.id = b.workerFk
- WHERE b.started <= vDate
+ WHERE b.started <= vDate
AND (b.ended > vDate OR b.ended IS NULL);
END ;;
DELIMITER ;
@@ -75319,18 +75319,18 @@ mainLabel:BEGIN
DELETE FROM account.account
WHERE id = vUserId;
- UPDATE account.user
+ UPDATE account.user
SET role = 2
- WHERE id = vUserId;
+ WHERE id = vUserId;
- DELETE FROM pbx.sip
- WHERE user_id = vUserId;
+ DELETE FROM pbx.sip
+ WHERE user_id = vUserId;
UPDATE `client` c
JOIN payMethod p ON p.name = 'CONTADO'
SET c.credit = 0, c.payMethodFk = p.id, hasCoreVnl = FALSE
WHERE c.id = vUserId;
-
+
UPDATE `client` c
SET c.salesPersonFk = null
WHERE c.salesPersonFk = vUserId;
@@ -75359,12 +75359,12 @@ BEGIN
SELECT b.workerFk
FROM business b
JOIN vn.worker w ON w.id = b.workerFk
- JOIN account.account a ON a.id = b.workerFk
- LEFT JOIN (SELECT b.workerFk
+ JOIN account.account a ON a.id = b.workerFk
+ LEFT JOIN (SELECT b.workerFk
FROM business b
WHERE (ended IS NULL OR ended >=util.VN_CURDATE())
)sub ON sub.workerFk = a.id
- LEFT JOIN vn.workerDisableExcluded wd ON wd.workerFk = b.workerFk
+ LEFT JOIN vn.workerDisableExcluded wd ON wd.workerFk = b.workerFk
WHERE sub.workerFk IS NULL
AND wd.workerFk IS NULL
GROUP BY w.id;
@@ -75382,7 +75382,7 @@ BEGIN
END WHILE;
CLOSE rs;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -75446,19 +75446,19 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerJourney_replace`(
- vDatedFrom DATE,
- vDatedTo DATE,
+ vDatedFrom DATE,
+ vDatedTo DATE,
vWorkerFk INT)
BEGIN
/**
- * Actualiza la tabla workerJourney para que actue como caché permanente revisable
+ * Actualiza la tabla workerJourney para que actue como caché permanente revisable
* de las jornadas laborales.
* @param vDatedFrom workerTimeControl
* @param vDatedTo workerTimeControl
* @param vWorkerFk, en caso de pasar 0 ó NULL se aplica a todos
- */
+ */
DECLARE vDatedTimeTo DATETIME;
- DECLARE vMaxTimePerDay INT;
+ DECLARE vMaxTimePerDay INT;
DECLARE vMinHoursToBreak DECIMAL(10,2);
DECLARE vBreakHours DECIMAL(10,2);
DECLARE vMonthByYear INT;
@@ -75466,57 +75466,57 @@ BEGIN
DECLARE vMonthsByYear INT DEFAULT 12;
DECLARE vDaysByWeek INT DEFAULT 5;
DECLARE vDatedFromYesterday DATETIME;
- DECLARE vDatedToTomorrow DATETIME;
-
- SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY)
+ DECLARE vDatedToTomorrow DATETIME;
+
+ SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY)
INTO vDatedFromYesterday, vDatedToTomorrow;
SET vDatedTimeTo = util.dayEnd(vDatedTo);
-
- SELECT minHoursToBreak, breakHours, maxTimePerDay
+
+ SELECT minHoursToBreak, breakHours, maxTimePerDay
INTO vMinHoursToBreak, vBreakHours, vMaxTimePerDay
FROM workerTimeControlConfig;
DELETE FROM workerJourney
- WHERE dated BETWEEN vDatedFrom AND vDatedTo
+ WHERE dated BETWEEN vDatedFrom AND vDatedTo
AND NOT isPaid
AND NOT isUpdated
- AND (vWorkerFk IS NULL OR userFK = vWorkerFk);
+ AND (vWorkerFk IS NULL OR userFK = vWorkerFk);
- -- Se inserta todos los días del periodo por worker y business en el rango de fechas.
+ -- Se inserta todos los días del periodo por worker y business en el rango de fechas.
INSERT IGNORE INTO workerJourney(userFk, dated, businessFk)
SELECT b.workerFk, t.dated, b.id
- FROM business b
+ FROM business b
JOIN time t ON t.dated BETWEEN b.started AND IFNULL(b.ended,util.VN_CURDATE())
WHERE t.dated BETWEEN vDatedFrom AND vDatedTo
AND (vWorkerFk IS NULL OR b.workerFk = vWorkerFk)
ORDER BY b.workerFk, t.dated, b.id;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
IF vWorkerFk THEN
CALL timeControl_calculateByUser(vWorkerFk, vDatedFrom , vDatedTimeTo);
- CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user`
- SELECT vWorkerFk userFk;
+ CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user`
+ SELECT vWorkerFk userFk;
ELSE
CALL timeControl_calculateAll(vDatedFrom, vDatedTimeTo);
- CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user`
+ CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user`
SELECT id userFk
FROM worker w;
- END IF;
+ END IF;
UPDATE workerJourney wj
JOIN tmp.timeControlCalculate t ON wj.dated = t.dated AND wj.userFk = t.userFk
- SET wj.total = CAST(IF(t.timeWorkDecimal >= vMinHoursToBreak,
- t.timeWorkDecimal - vBreakHours,
+ SET wj.total = CAST(IF(t.timeWorkDecimal >= vMinHoursToBreak,
+ t.timeWorkDecimal - vBreakHours,
t.timeWorkDecimal) AS DECIMAL (10,2)),
wj.lunch = IF(t.timeWorkDecimal >= vMinHoursToBreak , vBreakHours , 0)
WHERE wj.dated BETWEEN vDatedFrom AND vDatedTo
AND NOT wj.isPaid
AND NOT wj.isUpdated
AND (vWorkerFk IS NULL OR wj.userFk = vWorkerFk);
-
- -- NOCTURNIDAD
+
+ -- NOCTURNIDAD
CALL timeControl_getError(vDatedFrom, vDatedTimeTo);
SET @vIsOdd := TRUE;
@@ -75526,9 +75526,9 @@ BEGIN
CREATE TEMPORARY TABLE tmp.workerTimeControl
(INDEX (userFk), INDEX (timed))
ENGINE = MEMORY
- SELECT DISTINCT(wtc.id),
- wtc.userFk,
- wtc.timed,
+ SELECT DISTINCT(wtc.id),
+ wtc.userFk,
+ wtc.timed,
wtc.direction
FROM workerTimeControl wtc
JOIN tmp.`user` w ON w.userFk = wtc.userFk
@@ -75538,10 +75538,10 @@ BEGIN
AND (vWorkerFk IS NULL OR wtc.userFk = vWorkerFk)
ORDER BY wtc.userFk, wtc.timed ASC;
- SELECT MAX(id) INTO @vCont
+ SELECT MAX(id) INTO @vCont
FROM tmp.workerTimeControl;
- DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux;
+ DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux;
CREATE TEMPORARY TABLE tmp.workerTimeControlAux (
`id` int(11) ,
`userFk` int(10) unsigned ,
@@ -75563,9 +75563,9 @@ BEGIN
DATE(@lastTimed) dated,
@lastUserFk lastUserFk,
IF(direction ='middle', @vIsOdd := NOT @vIsOdd, FALSE) isOdd,
- IF(@vIsOdd
- AND @lastDirection = 'middle'
- AND (DATE(@lastTimed) <> date(timed)
+ IF(@vIsOdd
+ AND @lastDirection = 'middle'
+ AND (DATE(@lastTimed) <> date(timed)
OR @lastUserFk <> userFk), TRUE, FALSE) hasBreak,
@lastTimed := wtc.timed,
@lastUserFk := userFk,
@@ -75579,16 +75579,16 @@ BEGIN
SET @lastDirection := NULL;
INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction)
- SELECT @vCont:= @vCont + 1,
- lastUserFk,
- DATE_ADD(sub.dated, INTERVAL 1 DAY),
+ SELECT @vCont:= @vCont + 1,
+ lastUserFk,
+ DATE_ADD(sub.dated, INTERVAL 1 DAY),
'middle'
FROM (SELECT IF(@lastUserFk <> userFk, @vIsOdd := TRUE, NULL),
DATE(@lastTimed) dated,
@lastUserFk lastUserFk,
IF(direction ='middle', @vIsOdd := NOT @vIsOdd, FALSE) isOdd,
- IF(@vIsOdd
- AND @lastDirection = 'middle'
+ IF(@vIsOdd
+ AND @lastDirection = 'middle'
AND (DATE(@lastTimed)<>date(timed)
OR @lastUserFk<>userFk), TRUE, FALSE) hasBreak,
@lastTimed := wtc.timed,
@@ -75601,7 +75601,7 @@ BEGIN
-- Cambio de dia
INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction)
SELECT @vCont:= @vCont + 1,
- wtc.userFk,
+ wtc.userFk,
util.dayEnd(date(wtc.timed)),
'out'
FROM workerTimeControl wtc
@@ -75612,8 +75612,8 @@ BEGIN
GROUP BY wtc.userFk, DATE(wtc.timed);
INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction)
- SELECT @vCont:= @vCont + 1,
- wtc.userFk,
+ SELECT @vCont:= @vCont + 1,
+ wtc.userFk,
DATE_ADD(date(wtc.timed), INTERVAL 1 DAY),
'in'
FROM workerTimeControl wtc
@@ -75639,8 +75639,8 @@ BEGIN
IF(@vIsOdd, @vLastTimed:=UNIX_TIMESTAMP(timed),@vLastTimed),
IF(direction='in', @vDated := DATE(wtc.timed), @vDated ) dated,
wtc.userFk,
- IF(UNIX_TIMESTAMP(timed)- @vLastTimed < vMaxTimePerDay,
- workerNigthlyHours_calculate(FROM_UNIXTIME(@vLastTimed), wtc.timed),
+ IF(UNIX_TIMESTAMP(timed)- @vLastTimed < vMaxTimePerDay,
+ workerNigthlyHours_calculate(FROM_UNIXTIME(@vLastTimed), wtc.timed),
0) NigthlyHours,
@lastUserFk := userFk
FROM (SELECT DISTINCT(wtc.id), wtc.userFk, wtc.timed, wtc.direction
@@ -75653,7 +75653,7 @@ BEGIN
) wtc
ORDER BY wtc.userFk, wtc.timed
)sub
- WHERE sub.dated BETWEEN vDatedFrom AND vDatedTo
+ WHERE sub.dated BETWEEN vDatedFrom AND vDatedTo
GROUP BY userFk, sub.dated
)night ON night.userFk = wj.userFk AND night.dated = wj.dated
SET wj.nocturn = night.NigthlyHours
@@ -75665,8 +75665,8 @@ BEGIN
UPDATE workerJourney wj
JOIN business b ON b.id = wj.businessFk
JOIN calendarType ct ON ct.id = b.calendarTypeFk
- SET wj.priceOrdinaryHour =
- (vMonthsByYear * b.amount) /
+ SET wj.priceOrdinaryHour =
+ (vMonthsByYear * b.amount) /
(vWeeksByYear * ct.hoursWeek),
wj.contractJourney = ct.hoursWeek / vDaysByWeek
WHERE wj.dated BETWEEN vDatedFrom AND vDatedTo
@@ -75674,7 +75674,7 @@ BEGIN
AND NOT wj.isPaid
AND NOT isUpdated;
- -- Precio Extras, Vacaciones y Nocturnas
+ -- Precio Extras, Vacaciones y Nocturnas
UPDATE workerJourney wj
JOIN(SELECT MAX(w.dated), t.dated, w.holidayInc, w.nightInc, w.extraInc
FROM time t
@@ -75698,12 +75698,12 @@ BEGIN
WHERE ct.isPartial
AND wj.dated BETWEEN vDatedFrom AND vDatedTo
AND (vWorkerFk IS NULL OR wj.userFk = vWorkerFk)
- AND NOT wj.isPaid
+ AND NOT wj.isPaid
AND NOT wj.isUpdated;
-- Ausencias
UPDATE workerJourney wj
- JOIN businessCalendar bc ON bc.businessFk = wj.businessFk
+ JOIN businessCalendar bc ON bc.businessFk = wj.businessFk
AND bc.dated = wj.dated
JOIN absenceType ab ON ab.id = bc.absenceTypeFk
SET wj.permission = ab.permissionRate * wj.contractJourney,
@@ -75718,7 +75718,7 @@ BEGIN
UPDATE workerJourney
SET holiday = IF(DAYNAME(dated)='sábado', 0, total),
contractJourney = 0
- WHERE DAYNAME(dated) IN ('sábado', 'domingo')
+ WHERE DAYNAME(dated) IN ('sábado', 'domingo')
AND dated BETWEEN vDatedFrom AND vDatedTo
AND (vWorkerFk IS NULL OR userFk = vWorkerFk)
AND NOT isPaid
@@ -75727,8 +75727,8 @@ BEGIN
-- Festivos por centro de trabajo
UPDATE workerJourney wj
JOIN calendarHolidays ch ON ch.dated = wj.dated
- JOIN business b ON b.id = wj.businessFk
- AND b.workcenterFk = ch.workcenterFk
+ JOIN business b ON b.id = wj.businessFk
+ AND b.workcenterFk = ch.workcenterFk
SET wj.holiday = wj.total,
wj.permission = wj.contractJourney,
wj.contractJourney = 0
@@ -75738,7 +75738,7 @@ BEGIN
AND NOT wj.isUpdated;
-- Horas extras
- UPDATE workerJourney
+ UPDATE workerJourney
SET extra = lunch + total - contractJourney
WHERE dated BETWEEN vDatedFrom AND vDatedTo
AND (vWorkerFk IS NULL OR userFk = vWorkerFk)
@@ -75768,15 +75768,15 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerMistakeType_get`()
BEGIN
-
+
/**
* Obtiene los tipos de error para los trabajadores
*/
-
- SELECT code, description
- FROM workerMistakeType
+
+ SELECT code, description
+ FROM workerMistakeType
ORDER BY description;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -75803,7 +75803,7 @@ BEGIN
*
*/
INSERT INTO vn.workerMistake(userFk, workerMistakeTypeFk)
- VALUES(vWorkerFk, vWorkerMistakeTypeFk);
+ VALUES(vWorkerFk, vWorkerMistakeTypeFk);
END ;;
DELIMITER ;
@@ -75826,11 +75826,11 @@ BEGIN
/*INSERT INTO workerTimeControl(userFk, timed, manual, warehouseFk)
VALUES(vUserFk, vDated, FALSE, vWarehouseFk);
-
+
CALL vn.workerTimeControlSOWP(vUserFk , vDated);*/
-
+
CALL vn.workerTimeControl_add(vUserFk,vWarehouseFk,util.VN_NOW(),FALSE);
-
+
END ;;
DELIMITER ;
@@ -75856,8 +75856,8 @@ BEGIN
*
*/
-
-
+
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -75906,13 +75906,13 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControlSOWP`(IN vUserFk INT, IN vDated DATE)
BEGIN
SET @order := 0;
-
- UPDATE workerTimeControl
- SET `order` = @order := @order + 1
- WHERE vUserFk =userFk
+
+ UPDATE workerTimeControl
+ SET `order` = @order := @order + 1
+ WHERE vUserFk =userFk
AND vDated = DATE(timed)
ORDER BY timed;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -75931,8 +75931,8 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_add`(IN vUserFk INT, IN vWarehouseFk INT, IN vTimed DATETIME, IN vIsManual BOOL)
BEGIN
-
-
+
+
SELECT workerTimeControl_add(vUserFk,vWarehouseFk,vTimed,vIsManual);
END ;;
DELIMITER ;
@@ -76020,73 +76020,73 @@ proc: BEGIN
DECLARE vTo VARCHAR(50) DEFAULT NULL;
DECLARE vUserName VARCHAR(50) DEFAULT NULL;
DECLARE vBody VARCHAR(255) DEFAULT NULL;
-
- SELECT dayBreak, weekBreak, weekScope, dayWorkMax, dayStayMax
+
+ SELECT dayBreak, weekBreak, weekScope, dayWorkMax, dayStayMax
INTO vDayBreak, vWeekBreak, vWeekScope, vDayWorkMax, vDayStayMax
FROM workerTimeControlParams;
SELECT MAX(timed) INTO vLastIn
- FROM workerTimeControl
- WHERE userFk = vUserFk
+ FROM workerTimeControl
+ WHERE userFk = vUserFk
AND direction = 'in';
-
+
SELECT MAX(timed) INTO vLastOut
- FROM workerTimeControl
- WHERE userFk = vUserFk
- AND direction = 'out';
+ FROM workerTimeControl
+ WHERE userFk = vUserFk
+ AND direction = 'out';
SELECT CONCAT(u.name,'@verdnatura.es') INTO vTo
FROM account.user u
- WHERE u.id = (SELECT bossFk FROM worker WHERE id = vUserFk);
-
+ WHERE u.id = (SELECT bossFk FROM worker WHERE id = vUserFk);
+
SELECT CONCAT(firstName,' ',lastName) INTO vUserName
FROM worker w
WHERE w.id = vUserFk;
IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastIn) > vDayStayMax THEN -- NUEVA JORNADA
-
- -- VERIFICAR DESCANSO DIARIO
- IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vDayBreak THEN
+
+ -- VERIFICAR DESCANSO DIARIO
+ IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vDayBreak THEN
SELECT "Descansos 12 h" AS problem;
-- ENVIAMOS CORREO AL BOSSFK
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Descansos 12 h") INTO vBody;
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
LEAVE proc;
- END IF;
-
+ END IF;
+
-- VERIFICAR FICHADAS IMPARES DEL ÚLTIMO DÍA QUE SE FICHÓ
- IF (SELECT MOD(COUNT(*),2) -- <>0
- FROM workerTimeControl
+ IF (SELECT MOD(COUNT(*),2) -- <>0
+ FROM workerTimeControl
WHERE userFk = vUserFk
AND timed >= vLastIn
- ) THEN
+ ) THEN
SELECT "Dias con fichadas impares" AS problem;
-- ENVIAMOS CORREO AL BOSSFK
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Dias con fichadas impares") INTO vBody;
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
- LEAVE proc;
+ LEAVE proc;
END IF;
-
+
-- VERIFICAR VACACIONES
SELECT at2.name INTO vCalendarStateType
- FROM calendar c
+ FROM calendar c
JOIN business b ON b.id = c.businessFk
JOIN absenceType at2 ON at2.id = c.dayOffTypeFk
WHERE c.dated = util.VN_CURDATE()
AND at2.isAllowedToWork = FALSE
AND b.workerFk = vUserFk
LIMIT 1;
-
+
IF(LENGTH(vCalendarStateType)) THEN
SELECT vCalendarStateType AS problem;
-- ENVIAMOS CORREO AL BOSSFK
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Vacaciones") INTO vBody;
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
- LEAVE proc;
-
+ LEAVE proc;
+
END IF;
-
+
-- VERIFICAR CONTRATO EN VIGOR
IF (SELECT COUNT(*)
FROM business b
@@ -76098,44 +76098,44 @@ proc: BEGIN
-- ENVIAMOS CORREO AL BOSSFK
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"No hay un contrato en vigor") INTO vBody;
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
- LEAVE proc;
-
+ LEAVE proc;
+
END IF;
-- VERIFICAR DESCANSO SEMANAL
SET @vHasBreakWeek:= FALSE;
- SET @vLastTimed:= UNIX_TIMESTAMP((util.VN_NOW() - INTERVAL vWeekScope SECOND));
-
+ SET @vLastTimed:= UNIX_TIMESTAMP((util.VN_NOW() - INTERVAL vWeekScope SECOND));
+
DROP TEMPORARY TABLE IF EXISTS tmp.trash;
CREATE TEMPORARY TABLE tmp.trash
SELECT IF(vWeekBreak-(UNIX_TIMESTAMP(timed)-@vLastTimed) <= 0, @vHasBreakWeek:=TRUE, TRUE) alias,
@vLastTimed:= UNIX_TIMESTAMP(timed)
- FROM workerTimeControl
+ FROM workerTimeControl
WHERE timed>= (util.VN_NOW() - INTERVAL vWeekScope SECOND)
AND userFk= vUserFk
AND direction IN ('in','out')
- ORDER BY timed ASC;
-
- IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vWeekBreak AND @vHasBreakWeek = FALSE THEN -- REVISA SI EL DESCANSO SE HA REALIZADO DESPUÉS DE LA ÚLTIMA FICHADA
+ ORDER BY timed ASC;
+
+ IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vWeekBreak AND @vHasBreakWeek = FALSE THEN -- REVISA SI EL DESCANSO SE HA REALIZADO DESPUÉS DE LA ÚLTIMA FICHADA
SELECT "Descansos 36 h" AS problem;
-- ENVIAMOS CORREO AL BOSSFK
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Descansos 36 h") INTO vBody;
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
LEAVE proc;
END IF;
-
- DROP TEMPORARY TABLE tmp.trash;
- ELSE -- DIA ACTUAL
-
+ DROP TEMPORARY TABLE tmp.trash;
+
+ ELSE -- DIA ACTUAL
+
-- VERIFICA QUE EL TIEMPO EFECTIVO NO SUPERE EL MÁXIMO
- SELECT IFNULL(SUM(if( mod(wtc.order,2)=1, -UNIX_TIMESTAMP(timed), UNIX_TIMESTAMP(timed))),0) - IF( MOD(COUNT(*),2), UNIX_TIMESTAMP(util.VN_NOW()), 0) INTO vTimedWorked
+ SELECT IFNULL(SUM(if( mod(wtc.order,2)=1, -UNIX_TIMESTAMP(timed), UNIX_TIMESTAMP(timed))),0) - IF( MOD(COUNT(*),2), UNIX_TIMESTAMP(util.VN_NOW()), 0) INTO vTimedWorked
FROM workerTimeControl wtc
- WHERE userFk = vUserFk
+ WHERE userFk = vUserFk
AND timed >= vLastIn
ORDER BY timed;
- IF vTimedWorked > vDayWorkMax THEN
+ IF vTimedWorked > vDayWorkMax THEN
SELECT "Jornadas" AS problem;
-- ENVIAMOS CORREO AL BOSSFK
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Jornadas") INTO vBody;
@@ -76158,10 +76158,10 @@ proc: BEGIN
-- ENVIAMOS CORREO AL BOSSFK
SELECT CONCAT(vUserName,' No a podido fichar por el siguiente problema: ',"No perteneces a este departamento.") INTO vBody;
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
- LEAVE proc;
+ LEAVE proc;
END IF;
END IF;*/
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -76181,7 +76181,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_checkBreak`(vStarted DATE)
BEGIN
/**
- * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas
+ * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas
* El sistema verificará el descanso corto en la siguiente semana
* o el largo en las 2 siguientes semanas a partir de la fecha dada
* @param vStarted día inicio de la semana en el que se quiere verificar
@@ -76192,27 +76192,27 @@ BEGIN
DECLARE vShortWeekBreak INT;
DECLARE vLongWeekBreak INT;
- SELECT util.dayEnd(DATE_ADD(vStarted, INTERVAL shortWeekDays DAY)),
+ SELECT util.dayEnd(DATE_ADD(vStarted, INTERVAL shortWeekDays DAY)),
util.dayEnd(DATE_ADD(vStarted, INTERVAL longWeekDays DAY)),
- shortWeekBreak,
+ shortWeekBreak,
longWeekBreak
INTO vShortEnded, vLongEnded, vShortWeekBreak, vLongWeekBreak
FROM workerTimeControlConfig;
-
+
SET @previousTimed:= UNIX_TIMESTAMP(vStarted);
SET @lastUserFk := NULL;
-
+
-- Descanso corto en la semana
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.worker;
CREATE TEMPORARY TABLE tmp.worker
(PRIMARY KEY(workerFk))
ENGINE = MEMORY
SELECT DISTINCT userFk workerFk
- FROM workerTimeControl
+ FROM workerTimeControl
WHERE timed BETWEEN vStarted AND vShortEnded
AND direction IN ('in', 'out');
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.worker2;
CREATE TEMPORARY TABLE tmp.worker2
(PRIMARY KEY(workerFk))
@@ -76225,28 +76225,28 @@ BEGIN
SELECT sub2.userFk workerFk
FROM(SELECT sub.userFk,
IF(sub.userFk <> @lastUserFk,
- @previousTimed:= sub.timed,
+ @previousTimed:= sub.timed,
FALSE),
- IF(sub.timed - @previousTimed >= vShortWeekBreak,
- TRUE,
+ IF(sub.timed - @previousTimed >= vShortWeekBreak,
+ TRUE,
FALSE) hasShortWeekBreak,
@previousTimed:= sub.timed,
@lastUserFk:= sub.userFk
FROM (
SELECT userFk, UNIX_TIMESTAMP(timed) timed
- FROM workerTimeControl
+ FROM workerTimeControl
WHERE timed BETWEEN vStarted AND vShortEnded
AND direction IN ('in', 'out')
- UNION
+ UNION
SELECT w.workerFk,
UNIX_TIMESTAMP(IFNULL(
- MIN(wtc.timed),
+ MIN(wtc.timed),
DATE_ADD(vShortEnded, INTERVAL vShortWeekBreak SECOND)))
FROM tmp.worker w
- LEFT JOIN workerTimeControl wtc
- ON wtc.userFk = w.workerFk
- AND wtc.timed BETWEEN vShortEnded
- AND DATE_ADD(vShortEnded, INTERVAL vShortWeekBreak SECOND)
+ LEFT JOIN workerTimeControl wtc
+ ON wtc.userFk = w.workerFk
+ AND wtc.timed BETWEEN vShortEnded
+ AND DATE_ADD(vShortEnded, INTERVAL vShortWeekBreak SECOND)
GROUP BY w.workerFk
UNION
SELECT w.workerFk,
@@ -76254,10 +76254,10 @@ BEGIN
MAX(wtc.timed),
DATE_SUB(vStarted, INTERVAL vShortWeekBreak SECOND)))
FROM tmp.worker2 w
- LEFT JOIN workerTimeControl wtc
- ON wtc.userFk = w.workerFk
- AND wtc.timed BETWEEN
- DATE_SUB(vStarted, INTERVAL vShortWeekBreak SECOND)
+ LEFT JOIN workerTimeControl wtc
+ ON wtc.userFk = w.workerFk
+ AND wtc.timed BETWEEN
+ DATE_SUB(vStarted, INTERVAL vShortWeekBreak SECOND)
AND vStarted
GROUP BY w.workerFk
ORDER BY userFk, timed
@@ -76267,7 +76267,7 @@ BEGIN
GROUP BY sub2.userFk
HAVING NOT SUM(hasShortWeekBreak);
- -- Descanso largo en las 2 siguientes semanas
+ -- Descanso largo en las 2 siguientes semanas
DROP TEMPORARY TABLE tmp.worker;
CREATE TEMPORARY TABLE tmp.worker
(PRIMARY KEY(workerFk))
@@ -76287,12 +76287,12 @@ BEGIN
(PRIMARY KEY(workerFk))
ENGINE = MEMORY
SELECT sub2.userFk workerFk
- FROM(SELECT userFk,
+ FROM(SELECT userFk,
IF(userFk <> @lastUserFk,
- @previousTimed:= timed,
+ @previousTimed:= timed,
TRUE),
- IF(timed - @previousTimed >= vLongWeekBreak,
- TRUE,
+ IF(timed - @previousTimed >= vLongWeekBreak,
+ TRUE,
FALSE) hasLongWeekBreak,
@previousTimed:= timed,
@lastUserFk:= userFk
@@ -76301,24 +76301,24 @@ BEGIN
JOIN tmp.workerWithoutShortWeekBreak wws ON wws.workerFk = wtc.userFk
WHERE timed BETWEEN vStarted AND vLongEnded
AND direction IN ('in', 'out')
- UNION
+ UNION
SELECT w.workerFk,
- UNIX_TIMESTAMP(IFNULL(MIN(wtc.timed),
+ UNIX_TIMESTAMP(IFNULL(MIN(wtc.timed),
DATE_ADD(vLongEnded, INTERVAL vLongWeekBreak SECOND)))
FROM tmp.worker w
- LEFT JOIN workerTimeControl wtc
- ON wtc.userFk = w.workerFk
- AND timed BETWEEN vLongEnded
- AND DATE_ADD(vLongEnded, INTERVAL vLongWeekBreak SECOND)
+ LEFT JOIN workerTimeControl wtc
+ ON wtc.userFk = w.workerFk
+ AND timed BETWEEN vLongEnded
+ AND DATE_ADD(vLongEnded, INTERVAL vLongWeekBreak SECOND)
GROUP BY w.workerFk
UNION
- SELECT w.workerFk,
- UNIX_TIMESTAMP(IFNULL(MAX(wtc.timed),
+ SELECT w.workerFk,
+ UNIX_TIMESTAMP(IFNULL(MAX(wtc.timed),
DATE_SUB(vStarted, INTERVAL vLongWeekBreak SECOND)))
FROM tmp.worker2 w
- LEFT JOIN workerTimeControl wtc
- ON wtc.userFk = w.workerFk
- AND timed BETWEEN DATE_SUB(vStarted, INTERVAL vLongWeekBreak SECOND)
+ LEFT JOIN workerTimeControl wtc
+ ON wtc.userFk = w.workerFk
+ AND timed BETWEEN DATE_SUB(vStarted, INTERVAL vLongWeekBreak SECOND)
AND vStarted
GROUP BY w.workerFk
ORDER BY userFk, timed
@@ -76695,27 +76695,27 @@ BEGIN
* Devuelve que direcciones de fichadas son lógicas a partir de la anterior fichada
* @param vWorkerFk Identificador del trabajador
* @return (option1, option2)
- * Los valores posibles de retorno son ('in', 'inMiddle', 'outMiddle', 'out')
+ * Los valores posibles de retorno son ('in', 'inMiddle', 'outMiddle', 'out')
*/
DECLARE vLastIn DATETIME ;
DECLARE vIsMiddleOdd BOOLEAN ;
- IF (vTimed IS NULL) THEN
+ IF (vTimed IS NULL) THEN
SET vTimed = util.VN_NOW();
END IF;
-
+
SELECT timed INTO vLastIn
- FROM workerTimeControl
+ FROM workerTimeControl
WHERE userFk = vWorkerFk
- AND direction = 'in'
+ AND direction = 'in'
AND timed < vTimed
ORDER BY timed DESC
LIMIT 1;
-
+
SELECT (COUNT(*)mod 2 = 1) INTO vIsMiddleOdd
- FROM workerTimeControl
+ FROM workerTimeControl
WHERE userFk = vWorkerFk
- AND direction = 'middle'
+ AND direction = 'middle'
AND timed BETWEEN vLastIn AND util.VN_NOW();
DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlDirection;
@@ -76764,7 +76764,7 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_getClockIn`(
- vUserFk INT,
+ vUserFk INT,
vDated DATE)
BEGIN
/**
@@ -76774,9 +76774,9 @@ BEGIN
* @param vDated Fecha proporcionada
*/
CALL timeControl_calculateByWorker(
- vUserFk,
+ vUserFk,
DATE_SUB(vDated, INTERVAL 6 DAY), util.dayEnd(vDated));
-
+
SET @position := 0;
SET @lastDated := NULL;
@@ -76793,7 +76793,7 @@ BEGIN
MAX(2daysAgoDirection) 2daysAgoDirection,
MAX(1daysAgo) 1daysAgo,
MAX(1daysAgoDirection) 1daysAgoDirection,
- MAX(0daysAgo) 0daysAgo,
+ MAX(0daysAgo) 0daysAgo,
MAX(0daysAgoDirection) 0daysAgoDirection
FROM(SELECT IF(daysAgo = 6, timed, '') 6daysAgo,
IF(daysAgo = 5, timed, '') 5daysAgo,
@@ -76813,7 +76813,7 @@ BEGIN
direction,
position
FROM(SELECT DATEDIFF(vDated, timed) daysAgo,
- TIME_FORMAT(timed,'%H:%i') timed,
+ TIME_FORMAT(timed,'%H:%i') timed,
IF(DATE(timed) <> @lastDated, @position := 0, NULL),
@position := @position+1 position,
@lastDated := DATE(timed),
@@ -76825,18 +76825,18 @@ BEGIN
LIMIT 10000000000000000000
)sub
)sub2
- GROUP BY position) sub3
+ GROUP BY position) sub3
JOIN (SELECT MAX(IF(daysAgo = 6, timeWorkSeconds, 0)) 6daysAgoTotal,
MAX(IF(daysAgo = 5, timeWorkSeconds, 0)) 5daysAgoTotal,
MAX(IF(daysAgo = 4, timeWorkSeconds, 0)) 4daysAgoTotal,
MAX(IF(daysAgo = 3, timeWorkSeconds, 0)) 3daysAgoTotal,
MAX(IF(daysAgo = 2, timeWorkSeconds, 0)) 2daysAgoTotal,
MAX(IF(daysAgo = 1, timeWorkSeconds, 0)) 1daysAgoTotal,
- MAX(IF(daysAgo = 0, timeWorkSeconds, 0)) 0daysAgoTotal
+ MAX(IF(daysAgo = 0, timeWorkSeconds, 0)) 0daysAgoTotal
FROM (SELECT DATEDIFF(vDated, dated) daysAgo,
timeWorkSeconds
FROM tmp.timeControlCalculate) sub4)sub5 ON TRUE;
-
+
DROP TEMPORARY TABLE tmp.timeControlCalculate;
END ;;
DELIMITER ;
@@ -76900,45 +76900,45 @@ BEGIN
DECLARE vDirectionPrevious VARCHAR(6);
DECLARE vTimedPrevious DATETIME;
- SELECT direction INTO vDirectionRemove
- FROM vn.workerTimeControl
- WHERE userFk = vUserFk
+ SELECT direction INTO vDirectionRemove
+ FROM vn.workerTimeControl
+ WHERE userFk = vUserFk
AND timed = vTimed ;
IF vDirectionRemove = 'out' THEN
-
+
SELECT timed, direction INTO vTimedPrevious, vDirectionPrevious
- FROM vn.workerTimeControl
- WHERE userFk = vUserFk
+ FROM vn.workerTimeControl
+ WHERE userFk = vUserFk
AND timed < vTimed
ORDER BY timed DESC
- LIMIT 1;
-
+ LIMIT 1;
+
IF vDirectionPrevious = "middle" THEN
- UPDATE vn.workerTimeControl
+ UPDATE vn.workerTimeControl
SET direction = "out"
WHERE userFk = vUserFk
AND timed = vTimedPrevious;
END IF;
-
+
ELSE IF vDirectionRemove = 'in' THEN
- UPDATE vn.workerTimeControl
+ UPDATE vn.workerTimeControl
SET direction = "in"
WHERE userFk = vUserFk
AND timed > vTimed
ORDER BY timed ASC
- LIMIT 1;
+ LIMIT 1;
END IF;
-
+
END IF;
-
+
DELETE FROM vn.workerTimeControl
- WHERE userFk = vUserFk
+ WHERE userFk = vUserFk
AND timed = vTimed;
-
+
CALL vn.workerTimeControlSOWP(vUserFk, vTimed);
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -76966,31 +76966,31 @@ proc: BEGIN
UPDATE vn.workerTimeControl SET direction = 'middle';
/*2- poner los out*/
-UPDATE vn.workerTimeControl wtc
- JOIN
+UPDATE vn.workerTimeControl wtc
+ JOIN
(SELECT userFk,MAX(timed) maxTimed FROM
(SELECT id, userFk, timed, date(timed) dated
- FROM vn.workerTimeControl
- ) sub
+ FROM vn.workerTimeControl
+ ) sub
GROUP BY userFk,dated
)sub
SET direction = "out"
- WHERE wtc.userFk = sub.userFk
+ WHERE wtc.userFk = sub.userFk
AND wtc.timed = sub.maxTimed;
-
- /*3- poner los in*/
-UPDATE vn.workerTimeControl wtc
- JOIN
+
+ /*3- poner los in*/
+UPDATE vn.workerTimeControl wtc
+ JOIN
(SELECT userFk,MIN(timed) maxTimed FROM
(SELECT id, userFk, timed, date(timed) dated
- FROM vn.workerTimeControl
- ) sub
+ FROM vn.workerTimeControl
+ ) sub
GROUP BY userFk,dated
)sub
SET direction = "in"
- WHERE wtc.userFk = sub.userFk
- AND wtc.timed = sub.maxTimed ;
-
+ WHERE wtc.userFk = sub.userFk
+ AND wtc.timed = sub.maxTimed ;
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -77063,7 +77063,7 @@ BEGIN
AND w.businessFk
GROUP BY tm.userFk,t.dated
ORDER BY tm.userFk,t.dated;
-
+
INSERT INTO vn.mail (receiver, replyTo, subject, body)
SELECT eu.email, 'laboral@verdnatura.es', CONCAT('Registro de horas semana ', WEEK(vDatedFrom), ' año ', YEAR(vDatedFrom)) ,
CONCAT('
@@ -77155,7 +77155,7 @@ BEGIN
IF (DAYNAME(util.VN_CURDATE()) = 'miércoles') THEN
SELECT DATE_SUB(util.VN_CURDATE(), INTERVAL 9 DAY), CONCAT(DATE_SUB(util.VN_CURDATE(), INTERVAL 3 DAY), ' 23:59:59') INTO vDatedFrom, vDatedTo;
-
+
CALL vn.workerTimeControl_sendMailByDepartment(vDatedFrom, vDatedTo, NULL);
END IF;
END ;;
@@ -77205,9 +77205,9 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_weekCheckBreak`(vStarted DATE, vEnded DATE)
BEGIN
/**
- * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas
- * El sistema verificará el descanso corto en la siguiente semana
- * o el largo en las 2 siguientes semanas a partir de las fechas dadas
+ * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas
+ * El sistema verificará el descanso corto en la siguiente semana
+ * o el largo en las 2 siguientes semanas a partir de las fechas dadas
* @param vStarted día inicio para verificar
* @param vEnded día final para verificar
* @return tmp.workerWithoutWeekBreak (workerFk)
@@ -77229,10 +77229,10 @@ BEGIN
CALL workerTimeControl_checkBreak(vStarted);
INSERT IGNORE INTO tmp.workerWithoutWeekBreakInWeek
- SELECT workerFk
+ SELECT workerFk
FROM tmp.workerWithoutWeekBreak;
DROP TEMPORARY TABLE IF EXISTS tmp.workerWithoutWeekBreak;
- SET vStarted = DATE_ADD(vStarted, INTERVAL 1 DAY);
+ SET vStarted = DATE_ADD(vStarted, INTERVAL 1 DAY);
END WHILE;
END ;;
@@ -77270,7 +77270,7 @@ BEGIN
DECLARE vDepartmentFk INT;
DECLARE isEnabled BOOLEAN DEFAULT TRUE;
- SELECT COUNT(*) INTO vHasSignedToday
+ SELECT COUNT(*) INTO vHasSignedToday
FROM workerTimeControl WHERE timed >= vDated AND userFk = vUserFk;
SET @day := 0;
@@ -77283,16 +77283,16 @@ BEGIN
SELECT fichada_anterior, fichada_actual, interval_in_minutes, jornadas
FROM
(
- SELECT @lastTimed fichada_anterior,
+ SELECT @lastTimed fichada_anterior,
timed,
CAST(time_to_sec(timediff(timed,@lastTimed )) / 60 AS UNSIGNED) as interval_in_minutes,
IF(day(timed) != @day, 1, 0) as jornadas,
@day := day(timed) dia_del_mes,
- @lastTimed := timed fichada_actual
+ @lastTimed := timed fichada_actual
FROM
(
SELECT day(timed) as dayNumber, dayname(timed) as dayName, timed
- FROM
+ FROM
(SELECT TIMESTAMPADD(DAY, -11, util.VN_NOW()) as timed, vUserFk as userFk -- Fichada virtual para los en los que no se ha trabajado la semana anterior
UNION ALL
SELECT timed, userFk
@@ -77300,18 +77300,18 @@ BEGIN
WHERE userFk = vUserFk
AND timed >= TIMESTAMPADD(DAY, -10,vDated)
UNION ALL
- SELECT IF(vHasSignedToday, '2000-01-01 00:00', util.VN_NOW()) as timed, vUserFk
+ SELECT IF(vHasSignedToday, '2000-01-01 00:00', util.VN_NOW()) as timed, vUserFk
) sub4
ORDER BY timed
) sub
-
+
) sub2
WHERE fichada_actual >= TIMESTAMPADD(WEEK, -1, vDated)
) sub3 ;
SELECT IFNULL(SUM(impar),0) into vImpares
FROM (
- SELECT day(timed) as dayNumber,
+ SELECT day(timed) as dayNumber,
count(*) mod 2 as impar
FROM vn.workerTimeControl wtc
WHERE userFk = vUserFk
@@ -77328,29 +77328,29 @@ BEGIN
AND at2.isAllowedToWork = FALSE
AND b.workerFk = vUserFk
LIMIT 1;
-
+
-- Contrato en vigor
SELECT IF(COUNT(*),vCantWork,'Sin contrato') INTO vCantWork
FROM business b
WHERE b.workerFk = vUserFk
AND b.started <= vDated
AND IFNULL(b.ended, vDated) >= vDated;
-
+
-- Departamento si vTabletFk es 0 no hacemos comprobacion (Madrid y Vilassar)
IF vTabletFk <> '0' THEN
-- 1 Obtener el departamento del usuario
SELECT wtcu.departmentFk INTO vDepartmentFk
FROM workerTimeControlUserInfo wtcu
WHERE wtcu.userFk = vUserFk;
- -- 2 Comprobar si la tablet pertenece al departamento
+ -- 2 Comprobar si la tablet pertenece al departamento
SELECT COUNT(td.tabletFk) INTO isEnabled
FROM tabletDepartment td
WHERE td.tabletFk = vTabletFk AND td.departmentFk = vDepartmentFk;
-
+
END IF;
-
+
IF vJornadas IS NOT NULL THEN
-
+
SELECT 'Jornadas' as Item, vJornadas as Cantidad, 'Correcto' AS Análisis
UNION ALL
SELECT 'Descansos 12 h' as Item, vDescansos12h as Cantidad, IF(vDescansos12h >= vJornadas, 'Correcto','Error: 1 por jornada') as Análisis
@@ -77359,9 +77359,9 @@ BEGIN
UNION ALL
SELECT 'Dias con fichadas impares' as Item, vImpares as Cantidad, IF(vImpares = 0, 'Correcto','Error') as Análisis
UNION ALL
- SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item,
- '' as Cantidad,
- IF(LENGTH(vCantWork),'Error', 'Correcto') as Análisis
+ SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item,
+ '' as Cantidad,
+ IF(LENGTH(vCantWork),'Error', 'Correcto') as Análisis
UNION ALL
SELECT 'El fichador no pertenece a tu departamento.' as Item, '' as Cantidad, IF(isEnabled, 'Correcto','Error') as Análisis;
@@ -77375,7 +77375,7 @@ BEGIN
UNION ALL
SELECT 'Dias con fichadas impares' as Item, vImpares as Cantidad, 'Correcto' as Análisis
UNION ALL
- SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item,
+ SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item,
'' as Cantidad, IF(LENGTH(vCantWork),'Error', 'Correcto') as Análisis
UNION ALL
SELECT 'El fichador no pertenece a tu departamento.' as Item, '' as Cantidad, IF(isEnabled, 'Correcto','Error') as Análisis;
@@ -77405,11 +77405,11 @@ BEGIN
* @param vDepartmentFk id del departamento
*
*/
-
- SELECT w.id,w.firstName, w.lastName,d.name
- FROM worker w
- JOIN workerDepartment wd ON wd.workerFk = w.id
- JOIN department d ON d.id = wd.departmentFk
+
+ SELECT w.id,w.firstName, w.lastName,d.name
+ FROM worker w
+ JOIN workerDepartment wd ON wd.workerFk = w.id
+ JOIN department d ON d.id = wd.departmentFk
WHERE d.id = vDepartmentFk
ORDER BY firstName;
@@ -77440,7 +77440,7 @@ BEGIN
(PRIMARY KEY (workerFk))
ENGINE = MEMORY
SELECT vBoss AS workerFk;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.workerHierarchyList;
CREATE TEMPORARY TABLE tmp.workerHierarchyList
(PRIMARY KEY (workerFk))
@@ -77451,7 +77451,7 @@ BEGIN
WHILE (SELECT COUNT(*) FROM tmp.workerHierarchyList WHERE NOT isChecked) > 0 DO
INSERT INTO tmp.workerHierarchyList
- SELECT w.id, 0
+ SELECT w.id, 0
FROM worker w
JOIN workerHierarchy wh ON wh.workerFk = w.bossFk;
@@ -77462,12 +77462,12 @@ BEGIN
TRUNCATE workerHierarchy;
INSERT INTO workerHierarchy
- SELECT workerFk
+ SELECT workerFk
FROM tmp.workerHierarchyList
WHERE NOT isChecked;
END WHILE;
-
+
DROP TEMPORARY TABLE IF EXISTS workerHierarchy;
END ;;
DELIMITER ;
@@ -77494,7 +77494,7 @@ BEGIN
SELECT s.id,s.description,s.warehouseFk
FROM sector s
- JOIN operator o ON o.sectorFk = s.id
+ JOIN operator o ON o.sectorFk = s.id
WHERE o.workerFk = account.myUser_getId();
END ;;
@@ -77579,8 +77579,8 @@ BEGIN
DECLARE vDone BOOL;
DECLARE vCursor CURSOR FOR
- SELECT DISTINCT b.workerFk
- FROM business b
+ SELECT DISTINCT b.workerFk
+ FROM business b
WHERE b.started > vBusinessUpdated AND b.started <= vCurdate
OR b.ended >= vBusinessUpdated AND b.ended < vCurdate;
@@ -77623,10 +77623,10 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `workingHours`(username varchar(255), logon boolean)
BEGIN
DECLARE userid int(11);
-
+
SELECT vn.getUserId(username) INTO userid;
SELECT username, userid;
- IF userid IS NOT NULL THEN
+ IF userid IS NOT NULL THEN
IF (logon) THEN
CALL vn.workingHoursTimeIn(userid);
ELSE
@@ -77695,17 +77695,17 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `wrongEqualizatedClient`()
BEGIN
SELECT clientFk, c.name, c.isActive, c.isTaxDataChecked, count(ie) as num
FROM vn.client c
- JOIN
+ JOIN
(
- SELECT DISTINCT
+ SELECT DISTINCT
`a`.`clientFk` ,
a.isEqualizated = 0 as ie
-
+
FROM
`vn`.`address` `a`
) sub ON sub.clientFk = c.id
WHERE c.hasToInvoiceByAddress = FALSE
-
+
GROUP BY clientFk
HAVING num > 1
UNION ALL
@@ -77789,27 +77789,27 @@ proc: BEGIN
SELECT scope INTO vScope
FROM zoneConfig;
-
+
DROP TEMPORARY TABLE IF EXISTS tmp.zone;
CREATE TEMPORARY TABLE tmp.zone
(INDEX (id))
ENGINE = MEMORY
SELECT id FROM zone;
-
+
TRUNCATE TABLE zoneClosure;
-
+
WHILE vCounter <= vScope DO
-
+
CALL zone_getOptionsForShipment(vShipped, TRUE);
-
+
REPLACE zoneClosure(zoneFk, dated, `hour`)
- SELECT zoneFk, vShipped, `hour`
+ SELECT zoneFk, vShipped, `hour`
FROM tmp.zoneOption;
-
+
SET vCounter = vCounter + 1;
SET vShipped = TIMESTAMPADD(DAY, 1, vShipped);
END WHILE;
-
+
-- DROP TEMPORARY TABLE tmp.zone;
DO RELEASE_LOCK('vn.zoneClosure_recalc');
END ;;
@@ -77903,7 +77903,7 @@ BEGIN
OR (vSelf IS NOT NULL AND parentFk = vSelf);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
+
SET vSons = 0;
OPEN vChildren;
@@ -77914,11 +77914,11 @@ BEGIN
IF vDone THEN
LEAVE myLoop;
END IF;
-
+
SET vIndex = vIndex + 1;
SET vLft = vIndex;
SET vSons = vSons + 1;
-
+
CALL zoneGeo_calcTreeRec(
vChildFk,
CONCAT(vPath, vChildFk, '/'),
@@ -78021,7 +78021,7 @@ proc: BEGIN
SELECT isChanged INTO vIsChanged
FROM zoneGeoRecalc;
-
+
IF vIsChanged THEN
UPDATE zoneGeoRecalc SET isChanged = FALSE;
CALL vn.zoneGeo_calcTree;
@@ -78209,7 +78209,7 @@ proc:BEGIN
* @table tmp.closedZones(zoneFk, warehouseFk);
*/
DROP TEMPORARY TABLE IF EXISTS tmp.closedZones;
-
+
CREATE TEMPORARY TABLE tmp.closedZones (
`zoneFk` int(11) NOT NULL,
`warehouseFk` smallint(6) unsigned NOT NULL,
@@ -78251,7 +78251,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getCollisions`()
BEGIN
/**
- * Calcula si para un mismo codigo postal y dia
+ * Calcula si para un mismo codigo postal y dia
* hay mas de una zona configurada y manda correo
*
*/
@@ -78260,16 +78260,16 @@ BEGIN
DECLARE vIsDone INT DEFAULT FALSE;
DECLARE vTableCollisions TEXT;
DECLARE cur1 CURSOR FOR SELECT zoneFk from tmp.zoneOption;
-
+
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE;
DROP TEMPORARY TABLE IF EXISTS tmp.zone;
CREATE TEMPORARY TABLE tmp.zone
- SELECT z.id
+ SELECT z.id
FROM zone z
JOIN agencyMode am ON am.id = z.agencyModeFk
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
- WHERE dm.code IN ('AGENCY','DELIVERY');
+ WHERE dm.code IN ('AGENCY','DELIVERY');
CALL zone_getOptionsForShipment(util.VN_CURDATE(),FALSE);
@@ -78284,7 +78284,7 @@ BEGIN
PRIMARY KEY zoneFkk (zoneFk, geoFk),
INDEX(geoFk))
ENGINE = MyISAM;
-
+
OPEN cur1;
cur1Loop: LOOP
SET vIsDone = FALSE;
@@ -78292,40 +78292,40 @@ BEGIN
IF vIsDone THEN
LEAVE cur1Loop;
END IF;
-
+
CALL zone_getLeaves(vZoneFk, NULL, NULL, TRUE);
- myLoop: LOOP
+ myLoop: LOOP
SET vGeoFk = NULL;
- SELECT geoFk INTO vGeoFk
+ SELECT geoFk INTO vGeoFk
FROM tmp.zoneNodes zn
WHERE NOT isChecked
LIMIT 1;
-
+
IF vGeoFk IS NULL THEN
LEAVE myLoop;
END IF;
-
+
CALL zone_getLeaves(vZoneFk, vGeoFk, NULL, TRUE);
UPDATE tmp.zoneNodes
- SET isChecked = TRUE
+ SET isChecked = TRUE
WHERE geoFk = vGeoFk;
END LOOP;
END LOOP;
CLOSE cur1;
- DELETE FROM tmp.zoneNodes
+ DELETE FROM tmp.zoneNodes
WHERE sons > 0;
-
+
DROP TEMPORARY TABLE IF EXISTS geoCollision;
CREATE TEMPORARY TABLE geoCollision
SELECT z.agencyModeFk, zn.geoFk, zw.warehouseFk
FROM tmp.zoneNodes zn
JOIN zone z ON z.id = zn.zoneFk
- JOIN zoneWarehouse zw ON z.id = zw.zoneFk
+ JOIN zoneWarehouse zw ON z.id = zw.zoneFk
GROUP BY z.agencyModeFk, zn.geoFk, zw.warehouseFk
HAVING count(*) > 1;
-
+
SELECT '
C.Postal
@@ -78335,39 +78335,39 @@ BEGIN
Almacén
Salix
' INTO vTableCollisions;
-
- INSERT INTO mail (receiver,replyTo,subject,body)
+
+ INSERT INTO mail (receiver,replyTo,subject,body)
SELECT 'pepe@verdnatura.es' receiver,
'noreply@verdnatura.es' replyTo,
CONCAT('Colisiones en zonas ', util.VN_CURDATE()) subject,
CONCAT(vTableCollisions,
GROUP_CONCAT(sub.td SEPARATOR ''),
'
') td
FROM tmp.zoneNodes zn
JOIN zone z ON z.id = zn.zoneFk
JOIN geoCollision gc ON gc.agencyModeFk = z.agencyModeFk AND zn.geoFk = gc.geoFk
JOIN warehouse w ON w.id = gc.warehouseFk) sub;
-
- DROP TEMPORARY TABLE
- geoCollision,
+
+ DROP TEMPORARY TABLE
+ geoCollision,
tmp.zone,
tmp.zoneNodes;
END ;;
@@ -78474,18 +78474,18 @@ BEGIN
DECLARE vChildFk INT DEFAULT vGeoFk;
DECLARE vParentFk INT;
DECLARE vLevel INT DEFAULT 1;
-
+
DROP TEMPORARY TABLE IF EXISTS tNodes;
CREATE TEMPORARY TABLE tNodes
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT vGeoFk id, vLevel `level`;
-
+
myLoop: LOOP
SELECT parentFk INTO vParentFk
FROM zoneGeo
WHERE id = vChildFk;
-
+
SET vChildFk = vParentFk;
SET vLevel = vLevel + 1;
@@ -78493,7 +78493,7 @@ BEGIN
SELECT vChildFk, vLevel
FROM DUAL
WHERE vChildFk IS NOT NULL;
-
+
IF ROW_COUNT() = 0 THEN
LEAVE myLoop;
END IF;
@@ -78592,13 +78592,12 @@ DELIMITER ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getLeaves`(
- vSelf INT,
- vParentFk INT,
- vSearch VARCHAR(255),
- vHasInsert BOOL
+CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getLeaves`(
+ vSelf INT,
+ vParentFk INT,
+ vSearch VARCHAR(255),
+ vHasInsert BOOL
)
-<<<<<<< HEAD
BEGIN
/**
* Devuelve las ubicaciones incluidas en la ruta y que sean hijos de parentFk.
@@ -78713,122 +78712,6 @@ BEGIN
END IF;
DROP TEMPORARY TABLE tNodes, tZones;
-=======
-BEGIN
-/**
- * Devuelve las ubicaciones incluidas en la ruta y que sean hijos de parentFk.
- * @param vSelf Id de la zona
- * @param vParentFk Id del geo a calcular
- * @param vSearch Cadena a buscar
- * @param vHasInsert Indica si inserta en tmp.zoneNodes
- * Optional @table tmp.zoneNodes(geoFk, name, parentFk, sons, isChecked, zoneFk)
- */
- DECLARE vIsNumber BOOL;
- DECLARE vIsSearch BOOL DEFAULT vSearch IS NOT NULL AND vSearch <> '';
-
- CREATE OR REPLACE TEMPORARY TABLE tNodes
- (UNIQUE (id))
- ENGINE = MEMORY
- SELECT id
- FROM zoneGeo
- LIMIT 0;
-
- IF vIsSearch THEN
- SET vIsNumber = vSearch REGEXP '^[0-9]+$';
-
- INSERT INTO tNodes
- SELECT id
- FROM zoneGeo
- WHERE (vIsNumber AND `name` = vSearch)
- OR (!vIsNumber AND `name` LIKE CONCAT('%', vSearch, '%'))
- LIMIT 1000;
-
- ELSEIF vParentFk IS NULL THEN
- INSERT INTO tNodes
- SELECT geoFk
- FROM zoneIncluded
- WHERE zoneFk = vSelf;
- END IF;
-
- IF vParentFk IS NULL THEN
- CREATE OR REPLACE TEMPORARY TABLE tChilds
- (INDEX(id))
- ENGINE = MEMORY
- SELECT id FROM tNodes;
-
- CREATE OR REPLACE TEMPORARY TABLE tParents
- (INDEX(id))
- ENGINE = MEMORY
- SELECT id FROM zoneGeo LIMIT 0;
-
- myLoop: LOOP
- DELETE FROM tParents;
- INSERT INTO tParents
- SELECT parentFk id
- FROM zoneGeo g
- JOIN tChilds c ON c.id = g.id
- WHERE g.parentFk IS NOT NULL;
-
- INSERT IGNORE INTO tNodes
- SELECT id FROM tParents;
-
- IF NOT ROW_COUNT() THEN
- LEAVE myLoop;
- END IF;
-
- DELETE FROM tChilds;
- INSERT INTO tChilds
- SELECT id FROM tParents;
- END LOOP;
-
- DROP TEMPORARY TABLE tChilds, tParents;
- END IF;
-
- IF NOT vIsSearch THEN
- INSERT IGNORE INTO tNodes
- SELECT id
- FROM zoneGeo
- WHERE parentFk <=> vParentFk;
- END IF;
-
- CREATE OR REPLACE TEMPORARY TABLE tZones
- SELECT g.id,
- g.name,
- g.parentFk,
- g.sons,
- NOT g.sons OR `type` = 'country' isChecked,
- i.isIncluded selected,
- g.`depth`,
- vSelf
- FROM zoneGeo g
- JOIN tNodes n ON n.id = g.id
- LEFT JOIN zoneIncluded i ON i.geoFk = g.id
- AND i.zoneFk = vSelf
- ORDER BY g.`depth`, selected DESC, g.name;
-
- IF vHasInsert THEN
- INSERT IGNORE INTO tmp.zoneNodes(geoFk, name, parentFk, sons, isChecked, zoneFk)
- SELECT id,
- name,
- parentFk,
- sons,
- isChecked,
- vSelf
- FROM tZones
- WHERE selected
- OR (selected IS NULL AND vParentFk IS NOT NULL);
- ELSE
- SELECT id,
- name,
- parentFk,
- sons,
- selected
- FROM tZones
- ORDER BY `depth`, selected DESC, name;
- END IF;
-
- DROP TEMPORARY TABLE tNodes, tZones;
->>>>>>> 08e97b6a19c411bac7301a28ab1e358d4d546af7
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -78853,7 +78736,7 @@ BEGIN
* @table tmp.zone(id) The zones ids
* @param vLanded The delivery date
* @return tmp.zoneOption The computed options
- */
+ */
DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption;
CREATE TEMPORARY TABLE tmp.zoneOption
ENGINE = MEMORY
@@ -78894,13 +78777,13 @@ BEGIN
END
LIMIT 10000000000000000000
) t
- GROUP BY zoneFk;
-
+ GROUP BY zoneFk;
+
DELETE t FROM tmp.zoneOption t
JOIN zoneExclusion e ON e.zoneFk = t.zoneFk AND e.`dated` = t.landed
LEFT JOIN zoneExclusionGeo eg ON eg.zoneExclusionFk = e.id
WHERE eg.zoneExclusionFk IS NULL;
-
+
IF NOT vShowExpiredZones THEN
DELETE FROM tmp.zoneOption
WHERE shipped < util.VN_CURDATE()
@@ -78932,7 +78815,7 @@ BEGIN
* @return tmp.zoneOption(zoneFk, hour, travelingDays, price, bonus, specificity) The computed options
*/
DECLARE vHour TIME DEFAULT TIME(util.VN_NOW());
-
+
DROP TEMPORARY TABLE IF EXISTS tLandings;
CREATE TEMPORARY TABLE tLandings
(INDEX (eventFk))
@@ -79011,53 +78894,53 @@ DELIMITER ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getPostalCode`(vSelf INT)
-BEGIN
-/**
- * Devuelve los códigos postales incluidos en una zona
- */
- DECLARE vGeoFk INT DEFAULT NULL;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes;
- CREATE TEMPORARY TABLE tmp.zoneNodes (
- geoFk INT,
- name VARCHAR(100),
- parentFk INT,
- sons INT,
- isChecked BOOL DEFAULT 0,
- zoneFk INT,
- PRIMARY KEY zoneNodesPk (zoneFk, geoFk),
- INDEX(geoFk))
- ENGINE = MEMORY;
-
- CALL zone_getLeaves(vSelf, NULL , NULL, TRUE);
-
- UPDATE tmp.zoneNodes zn
- SET isChecked = 0
- WHERE parentFk IS NULL;
-
- myLoop: LOOP
- SET vGeoFk = NULL;
- SELECT geoFk INTO vGeoFk
- FROM tmp.zoneNodes zn
- WHERE NOT isChecked
- LIMIT 1;
-
- CALL zone_getLeaves(vSelf, vGeoFk, NULL, TRUE);
- UPDATE tmp.zoneNodes
- SET isChecked = TRUE
- WHERE geoFk = vGeoFk;
-
- IF vGeoFk IS NULL THEN
- LEAVE myLoop;
- END IF;
- END LOOP;
-
- DELETE FROM tmp.zoneNodes
- WHERE sons > 0;
-
- SELECT zn.geoFk, zn.name
- FROM tmp.zoneNodes zn
- JOIN zone z ON z.id = zn.zoneFk;
+BEGIN
+/**
+ * Devuelve los códigos postales incluidos en una zona
+ */
+ DECLARE vGeoFk INT DEFAULT NULL;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes;
+ CREATE TEMPORARY TABLE tmp.zoneNodes (
+ geoFk INT,
+ name VARCHAR(100),
+ parentFk INT,
+ sons INT,
+ isChecked BOOL DEFAULT 0,
+ zoneFk INT,
+ PRIMARY KEY zoneNodesPk (zoneFk, geoFk),
+ INDEX(geoFk))
+ ENGINE = MEMORY;
+
+ CALL zone_getLeaves(vSelf, NULL , NULL, TRUE);
+
+ UPDATE tmp.zoneNodes zn
+ SET isChecked = 0
+ WHERE parentFk IS NULL;
+
+ myLoop: LOOP
+ SET vGeoFk = NULL;
+ SELECT geoFk INTO vGeoFk
+ FROM tmp.zoneNodes zn
+ WHERE NOT isChecked
+ LIMIT 1;
+
+ CALL zone_getLeaves(vSelf, vGeoFk, NULL, TRUE);
+ UPDATE tmp.zoneNodes
+ SET isChecked = TRUE
+ WHERE geoFk = vGeoFk;
+
+ IF vGeoFk IS NULL THEN
+ LEAVE myLoop;
+ END IF;
+ END LOOP;
+
+ DELETE FROM tmp.zoneNodes
+ WHERE sons > 0;
+
+ SELECT zn.geoFk, zn.name
+ FROM tmp.zoneNodes zn
+ JOIN zone z ON z.id = zn.zoneFk;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -79088,7 +78971,7 @@ BEGIN
DECLARE vZoneGeo INT;
SELECT address_getGeo(vAddressFk) INTO vZoneGeo;
-
+
CALL vn.zone_getFromGeo(vZoneGeo);
CALL vn.zone_getOptionsForLanding(vLanded, vShowExpiredZones);
CALL vn.zone_excludeFromGeo(vZoneGeo);
@@ -79108,7 +78991,7 @@ BEGIN
FROM tmp.zoneOption zo
JOIN vn.zoneWarehouse zw ON zw.zoneFk = zo.zoneFk
JOIN vn.`zone` z ON z.id = zo.zoneFk
- LEFT JOIN tmp.closedZones cz
+ LEFT JOIN tmp.closedZones cz
ON cz.warehouseFk = zw.warehouseFk
AND cz.zoneFk = zw.zoneFk
AND zo.shipped = util.VN_CURDATE()
@@ -79142,9 +79025,9 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getState`(vDated DATE)
BEGIN
/**
* Devuelve las zonas y el estado para la fecha solicitada
- *
+ *
* @param vDated Fecha en cuestión
- */
+ */
DROP TEMPORARY TABLE IF EXISTS tmp.zone;
CREATE TEMPORARY TABLE tmp.zone (
@@ -79158,7 +79041,7 @@ BEGIN
CALL vn.zone_getOptionsForShipment(vDated, TRUE);
CALL vn.zone_getClosed();
-
+
SELECT zo.zoneFk,
zo.`hour`etd,
(zo.`hour` <= TIME(util.VN_NOW())) isLate,
@@ -79168,11 +79051,11 @@ BEGIN
FROM tmp.zoneOption zo
JOIN vn.zone z ON z.id = zo.zoneFk
JOIN vn.zoneWarehouse zw ON zw.zoneFk = z.id
- LEFT JOIN tmp.closedZones cz
- ON cz.warehouseFk = zw.warehouseFk
+ LEFT JOIN tmp.closedZones cz
+ ON cz.warehouseFk = zw.warehouseFk
AND cz.zoneFk = zo.zoneFk;
-
- DROP TEMPORARY TABLE
+
+ DROP TEMPORARY TABLE
tmp.closedZones,
tmp.zoneOption,
tmp.zone;
@@ -79198,21 +79081,21 @@ BEGIN
/**
* Devuelve el listado de agencias disponibles para la fecha,
* dirección y almacén pasados.
- *
+ *
* @param vAddress
* @param vWarehouse warehouse
* @param vLanded Fecha de recogida
* @select Listado de agencias disponibles
*/
-
+
CALL zone_getFromGeo(address_getGeo(vAddress));
CALL zone_getOptionsForLanding(vLanded, FALSE);
-
- SELECT am.id agencyModeFk,
- am.name agencyMode,
- am.description,
+
+ SELECT am.id agencyModeFk,
+ am.name agencyMode,
+ am.description,
am.deliveryMethodFk,
- TIMESTAMPADD(DAY, -zo.travelingDays, vLanded) shipped,
+ TIMESTAMPADD(DAY, -zo.travelingDays, vLanded) shipped,
zw.warehouseFk,
z.id zoneFk
FROM tmp.zoneOption zo
@@ -79222,11 +79105,11 @@ BEGIN
WHERE zw.warehouseFk = vWarehouse
GROUP BY z.agencyModeFk
ORDER BY agencyMode;
-
+
DROP TEMPORARY TABLE
tmp.zone,
tmp.zoneOption;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -79247,7 +79130,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_upcomingDeliveries`()
BEGIN
DECLARE vForwardDays INT;
-
+
SELECT forwardDays INTO vForwardDays FROM zoneConfig;
CALL util.time_createTable(util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL vForwardDays DAY));
@@ -79263,7 +79146,7 @@ BEGIN
JOIN zoneEvent e ON e.zoneFk = z.id
JOIN tmp.time ti ON ti.dated BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY, vForwardDays, util.VN_CURDATE());
- DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption;
+ DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption;
CREATE TEMPORARY TABLE tmp.zoneOption
ENGINE = MEMORY
SELECT *
@@ -79304,7 +79187,7 @@ BEGIN
JOIN zoneExclusion e ON e.zoneFk = t.zoneFk AND e.`dated` = t.landed
LEFT JOIN zoneExclusionGeo eg ON eg.zoneExclusionFk = e.id
WHERE eg.zoneExclusionFk IS NULL;
-
+
SELECT MAX(zo.`hour`) `hour`, zg.`name`, zo.shipped, zo.zoneFk
FROM tmp.zoneOption zo
JOIN `zone` z ON z.id = zo.zoneFk
@@ -79315,7 +79198,7 @@ BEGIN
WHERE dm.code = 'DELIVERY'
GROUP BY shipped, zg.`name`
ORDER BY shipped, zg.`name`;
-
+
DROP TEMPORARY TABLE tmp.time, tLandings;
END ;;
DELIMITER ;
From ccfd8fad058b0f75deea374a7536a64974495a86 Mon Sep 17 00:00:00 2001
From: pablone
Date: Mon, 11 Sep 2023 12:32:46 +0200
Subject: [PATCH 074/427] refs #6213 fixCreateError
---
.../233801/00-supplierAccountCheckLength.sql | 1 +
loopback/locale/es.json | 10 ++++++----
modules/supplier/back/models/supplier.js | 17 +++++++++++++++++
modules/supplier/front/create/index.html | 1 -
modules/supplier/front/create/index.js | 1 +
5 files changed, 25 insertions(+), 5 deletions(-)
create mode 100644 db/changes/233801/00-supplierAccountCheckLength.sql
diff --git a/db/changes/233801/00-supplierAccountCheckLength.sql b/db/changes/233801/00-supplierAccountCheckLength.sql
new file mode 100644
index 000000000..99f571ba1
--- /dev/null
+++ b/db/changes/233801/00-supplierAccountCheckLength.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.supplier ADD CONSTRAINT supplier_CHECK CHECK (LENGTH(account) = 10);
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index ccd63e0ff..6388c01a4 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -216,6 +216,7 @@
"The worker has hours recorded that day": "El trabajador tiene horas fichadas ese día",
"The worker has a marked absence that day": "El trabajador tiene marcada una ausencia ese día",
"You can not modify is pay method checked": "No se puede modificar el campo método de pago validado",
+ "The account size must be exactly 10 characters": "El tamaño de la cuenta debe ser exactamente de 10 caracteres",
"Can't transfer claimed sales": "No puedes transferir lineas reclamadas",
"You don't have privileges to create refund": "No tienes permisos para crear un abono",
"The item is required": "El artículo es requerido",
@@ -307,14 +308,15 @@
"Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}",
"You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado",
"This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %s",
- "The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias",
+ "The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias",
"You cannot assign/remove an alias that you are not assigned to": "No puede asignar/eliminar un alias que no tenga asignado",
"This invoice has a linked vehicle.": "Esta factura tiene un vehiculo vinculado",
"You don't have enough privileges.": "No tienes suficientes permisos.",
"This ticket is locked.": "Este ticket está bloqueado.",
"This ticket is not editable.": "Este ticket no es editable.",
"The ticket doesn't exist.": "No existe el ticket.",
- "Social name should be uppercase": "La razón social debe ir en mayúscula",
+ "Social name should be uppercase": "La razón social debe ir en mayúscula",
"Street should be uppercase": "La dirección fiscal debe ir en mayúscula",
- "Ticket without Route": "Ticket sin ruta"
-}
+ "Ticket without Route": "Ticket sin ruta",
+ "The account size must be exactly 10 characters": "The account size must be exactly 10 characters"
+}
\ No newline at end of file
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 96042c9a0..28e53e3c5 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -112,9 +112,26 @@ module.exports = Self => {
const hasChanges = orgData && changes;
const isPayMethodCheckedChanged = hasChanges
&& orgData.isPayMethodChecked != isPayMethodChecked;
+ const isAccountChanged = hasChanges && orgData.account != changes.account;
if (!editPayMethodCheck && isPayMethodCheckedChanged)
throw new UserError('You can not modify is pay method checked');
+
+ if (isAccountChanged && !(changes.account.length === 10))
+ throw new UserError('The account size must be exactly 10 characters');
+ });
+
+ Self.observe('after save', async function(ctx) {
+ if (ctx.instance && ctx.isNewInstance) {
+ const supplierId = ctx.instance.id;
+ const models = Self.app.models;
+
+ const supplier = await models.Supplier.findById(supplierId);
+ await supplier.updateAttribute(
+ 'account',
+ supplierId.toString().padStart(10, '0')
+ );
+ }
});
Self.validateAsync('name', 'countryFk', hasSupplierSameName, {
diff --git a/modules/supplier/front/create/index.html b/modules/supplier/front/create/index.html
index c3efcf6ae..eb6e7261e 100644
--- a/modules/supplier/front/create/index.html
+++ b/modules/supplier/front/create/index.html
@@ -18,7 +18,6 @@
Date: Mon, 11 Sep 2023 12:36:42 +0200
Subject: [PATCH 075/427] refs #6213 remove console log
---
modules/supplier/front/create/index.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/modules/supplier/front/create/index.js b/modules/supplier/front/create/index.js
index f11df2884..c33367dac 100644
--- a/modules/supplier/front/create/index.js
+++ b/modules/supplier/front/create/index.js
@@ -4,7 +4,6 @@ import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
- console.log($.name);
}
onSubmit() {
From d3e5e187e100db766701c0ca8504cda9b0707cb3 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 11 Sep 2023 13:46:52 +0200
Subject: [PATCH 076/427] refs #5660 change acl
---
e2e/paths/02-client/01_create_client.spec.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/e2e/paths/02-client/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js
index 744b11a72..cb06d3616 100644
--- a/e2e/paths/02-client/01_create_client.spec.js
+++ b/e2e/paths/02-client/01_create_client.spec.js
@@ -8,7 +8,7 @@ describe('Client create path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('deliveryAssistant', 'client');
+ await page.loginAndModule('deliveryBoss', 'client');
});
afterAll(async() => {
From 49e635ff4bb5b79db310f5f2a53547786da04eaa Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 11 Sep 2023 13:49:18 +0200
Subject: [PATCH 077/427] refs #5660 dump dumpedFixtures
---
db/dump/dumpedFixtures.sql | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 683fff77c..2e1511b59 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -78,7 +78,7 @@ USE `account`;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
-INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2023-06-08 16:47:57',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2023-06-02 20:33:28',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-17 11:07:21',NULL),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL),(119,'palletizerBoss','Jefe de paletizadores',1,'2023-06-07 11:51:54','2023-06-07 11:51:54',NULL),(120,'developerBoss','Jefe de proyecto de desarrollo',1,'2023-06-19 07:07:21','2023-06-19 07:07:21',21709),(121,'buyerSalesAssistant','Rol para compradores que también son responsables de ventas',1,'2023-06-23 14:48:19','2023-06-23 14:48:19',NULL);
+INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2023-06-08 16:47:57',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2023-06-02 20:33:28',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-17 11:07:21',NULL),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL),(119,'palletizerBoss','Jefe de paletizadores',1,'2023-06-07 11:51:54','2023-06-07 11:51:54',NULL),(120,'developerBoss','Jefe de proyecto de desarrollo',1,'2023-06-19 07:07:21','2023-06-19 07:07:21',21709),(121,'buyerSalesAssistant','Rol para compradores que también son responsables de ventas',1,'2023-06-23 14:48:19','2023-06-23 14:48:19',NULL),(122,'logisticAssistant','Jefe auxiliar de logística',1,'2023-06-26 07:21:15','2023-06-26 07:21:15',NULL);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
@@ -164,7 +164,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(526,'VnUser','*','*','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(529,'VnUser','changePassword','WRITE','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryBoss'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryBoss'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','employee'),(569,'Client','isNotEditableCredit','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','employee'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logistic'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryBoss'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryBoss'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryBoss'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryBoss'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logistic');
+INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryBoss'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryBoss'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'),(569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryBoss'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryBoss'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryBoss'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryBoss'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'),(655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'),(656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'),(657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'),(658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'),(659,'Account','*','*','ALLOW','ROLE','itManagement'),(660,'Account','*','READ','ALLOW','ROLE','employee'),(664,'MailForward','*','*','ALLOW','ROLE','itManagement'),(665,'Role','*','READ','ALLOW','ROLE','employee'),(666,'Role','*','WRITE','ALLOW','ROLE','it'),(667,'VnUser','*','*','ALLOW','ROLE','itManagement'),(668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'),(669,'VnUser','preview','*','ALLOW','ROLE','employee'),(670,'VnUser','create','*','ALLOW','ROLE','itManagement'),(671,'VnUser','renewToken','WRITE','ALLOW','ROLE','employee'),(672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'),(673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),(674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'),(676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'),(680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'),(681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'),(682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'),(683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'),(684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'),(685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'),(686,'MailForward','*','*','ALLOW','ROLE','hr'),(687,'ClientSms','find','READ','ALLOW','ROLE','employee'),(688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'),(689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'),(690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss'),(691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'),(692,'ExpeditionTruck','*','*','ALLOW','ROLE','palletizerBoss'),(693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'),(694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss'),(695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'),(696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'),(697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'),(698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'),(699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'),(701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryBoss'),(702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
From 5f5a0645be9b0c40c0e780566092d62cbe71e4c3 Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Mon, 11 Sep 2023 16:16:49 +0200
Subject: [PATCH 078/427] refs #5652 feat:itemTrash_new
---
db/changes/233801/00-address_getLosesLastYear.sql | 3 +--
modules/client/back/methods/address/getAddress.js | 4 ++--
modules/client/back/methods/address/specs/getAddress.spec.js | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/db/changes/233801/00-address_getLosesLastYear.sql b/db/changes/233801/00-address_getLosesLastYear.sql
index 3b8fa209b..dc75c3121 100644
--- a/db/changes/233801/00-address_getLosesLastYear.sql
+++ b/db/changes/233801/00-address_getLosesLastYear.sql
@@ -1,6 +1,6 @@
DELIMITER $$
-CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_getLosesLastYear`()
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_getLoses`()
BEGIN
SELECT t.addressFk , a.nickname, c.name
FROM ticket t
@@ -8,7 +8,6 @@ BEGIN
JOIN client c ON a.clientFk = c.id
WHERE c.typeFk = 'loses'
AND a.isactive = 1
- AND t.created >= (CURRENT_DATE() - INTERVAL 1 YEAR)
GROUP BY t.addressFk;
END$$
DELIMITER ;
diff --git a/modules/client/back/methods/address/getAddress.js b/modules/client/back/methods/address/getAddress.js
index 94e0439da..a15fb8aba 100644
--- a/modules/client/back/methods/address/getAddress.js
+++ b/modules/client/back/methods/address/getAddress.js
@@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethod('getAddress', {
- description: 'Get all activated address last year ',
+ description: 'Get all activated address client active',
accessType: 'READ',
accepts: [],
returns: {
@@ -14,7 +14,7 @@ module.exports = Self => {
});
Self.getAddress = async() => {
- const query = `CALL vn.address_getLosesLastYear()`;
+ const query = `CALL vn.address_getLoses()`;
const [result] = await Self.rawSql(query);
return result;
};
diff --git a/modules/client/back/methods/address/specs/getAddress.spec.js b/modules/client/back/methods/address/specs/getAddress.spec.js
index d2b219495..2c84769e6 100644
--- a/modules/client/back/methods/address/specs/getAddress.spec.js
+++ b/modules/client/back/methods/address/specs/getAddress.spec.js
@@ -1,7 +1,7 @@
const {models} = require('vn-loopback/server/server');
describe('getAddress()', () => {
- it('return list of address last year', async() => {
+ fit('return list of address last year', async() => {
let response = await models.Address.getAddress();
expect(response.length).toBeGreaterThan(0);
From 705505b931a3398b5406bb993d00c2610ffdb366 Mon Sep 17 00:00:00 2001
From: jgallego
Date: Mon, 11 Sep 2023 16:24:47 +0200
Subject: [PATCH 079/427] fixes #4059 acl for address
---
db/changes/233801/00-aclClient.sql | 2 ++
1 file changed, 2 insertions(+)
diff --git a/db/changes/233801/00-aclClient.sql b/db/changes/233801/00-aclClient.sql
index 5308dbbe2..8e85c027b 100644
--- a/db/changes/233801/00-aclClient.sql
+++ b/db/changes/233801/00-aclClient.sql
@@ -10,6 +10,8 @@ INSERT INTO salix.ACL (model,property,accessType,permission,principalType,princi
VALUES ('Client','find','READ','ALLOW','ROLE','employee');
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('Client','exists','READ','ALLOW','ROLE','employee');
+INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+ VALUES ('Client','__get__addresses','READ','ALLOW','ROLE','employee');
DELETE FROM salix.ACL WHERE model = 'Client' AND property = '*' AND accessType IN (
'campaignMetricsEmail',
From 6a753d26af5573c910732be2dc1f190f2b56ca8c Mon Sep 17 00:00:00 2001
From: pablone
Date: Mon, 11 Sep 2023 18:28:47 +0200
Subject: [PATCH 080/427] refs #6213 default account value
---
db/changes/233801/00-supplierAccountCheckLength.sql | 8 +++++++-
modules/supplier/back/models/supplier.js | 9 +++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/db/changes/233801/00-supplierAccountCheckLength.sql b/db/changes/233801/00-supplierAccountCheckLength.sql
index 99f571ba1..30ff739b8 100644
--- a/db/changes/233801/00-supplierAccountCheckLength.sql
+++ b/db/changes/233801/00-supplierAccountCheckLength.sql
@@ -1 +1,7 @@
-ALTER TABLE vn.supplier ADD CONSTRAINT supplier_CHECK CHECK (LENGTH(account) = 10);
+
+UPDATE `vn`.`supplier`
+ SET account = LPAD(id,10,'0')
+ WHERE account IS NULL;
+
+ALTER TABLE `vn`.`supplier` ADD CONSTRAINT supplierAccountTooShort CHECK (LENGTH(account) = 10);
+ALTER TABLE vn.supplier MODIFY COLUMN account varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 4100000000 NOT NULL COMMENT 'Default accounting code for suppliers.';
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 28e53e3c5..6bfec86d1 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -112,13 +112,9 @@ module.exports = Self => {
const hasChanges = orgData && changes;
const isPayMethodCheckedChanged = hasChanges
&& orgData.isPayMethodChecked != isPayMethodChecked;
- const isAccountChanged = hasChanges && orgData.account != changes.account;
if (!editPayMethodCheck && isPayMethodCheckedChanged)
throw new UserError('You can not modify is pay method checked');
-
- if (isAccountChanged && !(changes.account.length === 10))
- throw new UserError('The account size must be exactly 10 characters');
});
Self.observe('after save', async function(ctx) {
@@ -126,10 +122,11 @@ module.exports = Self => {
const supplierId = ctx.instance.id;
const models = Self.app.models;
- const supplier = await models.Supplier.findById(supplierId);
+ const supplier = await models.Supplier.findById(supplierId, null, ctx.options);
await supplier.updateAttribute(
'account',
- supplierId.toString().padStart(10, '0')
+ supplier.account + supplierId,
+ ctx.options
);
}
});
From 1d25355423969b71392b38fb96b18569d23d7e1c Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Tue, 12 Sep 2023 08:44:42 +0200
Subject: [PATCH 081/427] refs #5652 fix:without fit
---
modules/client/back/methods/address/specs/getAddress.spec.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/client/back/methods/address/specs/getAddress.spec.js b/modules/client/back/methods/address/specs/getAddress.spec.js
index 2c84769e6..d2b219495 100644
--- a/modules/client/back/methods/address/specs/getAddress.spec.js
+++ b/modules/client/back/methods/address/specs/getAddress.spec.js
@@ -1,7 +1,7 @@
const {models} = require('vn-loopback/server/server');
describe('getAddress()', () => {
- fit('return list of address last year', async() => {
+ it('return list of address last year', async() => {
let response = await models.Address.getAddress();
expect(response.length).toBeGreaterThan(0);
From 0ddcb57209845852889d1e16874bb1ff873b71a7 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 12 Sep 2023 10:40:10 +0200
Subject: [PATCH 082/427] refs #5660 fix e2e
---
db/dump/dumpedFixtures.sql | 4 ++--
e2e/paths/02-client/01_create_client.spec.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 2e1511b59..383cc4722 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -78,7 +78,7 @@ USE `account`;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
-INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2023-06-08 16:47:57',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2023-06-02 20:33:28',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-17 11:07:21',NULL),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL),(119,'palletizerBoss','Jefe de paletizadores',1,'2023-06-07 11:51:54','2023-06-07 11:51:54',NULL),(120,'developerBoss','Jefe de proyecto de desarrollo',1,'2023-06-19 07:07:21','2023-06-19 07:07:21',21709),(121,'buyerSalesAssistant','Rol para compradores que también son responsables de ventas',1,'2023-06-23 14:48:19','2023-06-23 14:48:19',NULL),(122,'logisticAssistant','Jefe auxiliar de logística',1,'2023-06-26 07:21:15','2023-06-26 07:21:15',NULL);
+INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2023-06-08 16:47:57',NULL),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2023-06-02 20:33:28',NULL),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35',NULL),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30',NULL),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10',NULL),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58',NULL),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27',NULL),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15',NULL),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52',NULL),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12',NULL),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36',NULL),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27',NULL),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20',NULL),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34',NULL),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53',NULL),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42',NULL),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08',NULL),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53',NULL),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09',NULL),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41',NULL),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12',NULL),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26',NULL),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59',NULL),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16',NULL),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12',NULL),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23',NULL),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18',NULL),(48,'coolerBoss','Jefe de cámara',1,'2018-02-23 13:12:01','2023-03-13 08:49:43',NULL),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35',NULL),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12',NULL),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39',NULL),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57',NULL),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57',NULL),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17',NULL),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31',NULL),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02',NULL),(57,'deliveryAssistant','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19',NULL),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45',NULL),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10',NULL),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01',NULL),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07',NULL),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05',NULL),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08',NULL),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26',NULL),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56',NULL),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23',NULL),(69,'coolerAssist','Asistente de cámara con permiso compras',1,'2020-02-05 12:36:09','2023-03-13 08:50:07',NULL),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25',NULL),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07',NULL),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46',NULL),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27',NULL),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27',NULL),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41',NULL),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07',NULL),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17',NULL),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37',NULL),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22',NULL),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49',NULL),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09',NULL),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16',NULL),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10',NULL),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51',NULL),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56',NULL),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30',NULL),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55',NULL),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35',NULL),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-05-17 11:07:21',NULL),(115,'itManagement','TI management',1,'2023-03-29 07:27:55','2023-03-29 07:28:04',NULL),(119,'palletizerBoss','Jefe de paletizadores',1,'2023-06-07 11:51:54','2023-06-07 11:51:54',NULL),(120,'developerBoss','Jefe de proyecto de desarrollo',1,'2023-06-19 07:07:21','2023-06-19 07:07:21',21709),(121,'buyerSalesAssistant','Rol para compradores que también son responsables de ventas',1,'2023-06-23 14:48:19','2023-06-23 14:48:19',NULL),(122,'logisticAssistant','Jefe auxiliar de logística',1,'2023-06-26 07:21:15','2023-06-26 07:21:15',NULL);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
@@ -164,7 +164,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryBoss'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryBoss'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'),(569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryBoss'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryBoss'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryBoss'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryBoss'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'),(655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'),(656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'),(657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'),(658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'),(659,'Account','*','*','ALLOW','ROLE','itManagement'),(660,'Account','*','READ','ALLOW','ROLE','employee'),(664,'MailForward','*','*','ALLOW','ROLE','itManagement'),(665,'Role','*','READ','ALLOW','ROLE','employee'),(666,'Role','*','WRITE','ALLOW','ROLE','it'),(667,'VnUser','*','*','ALLOW','ROLE','itManagement'),(668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'),(669,'VnUser','preview','*','ALLOW','ROLE','employee'),(670,'VnUser','create','*','ALLOW','ROLE','itManagement'),(671,'VnUser','renewToken','WRITE','ALLOW','ROLE','employee'),(672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'),(673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),(674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'),(676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'),(680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'),(681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'),(682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'),(683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'),(684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'),(685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'),(686,'MailForward','*','*','ALLOW','ROLE','hr'),(687,'ClientSms','find','READ','ALLOW','ROLE','employee'),(688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'),(689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'),(690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss'),(691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'),(692,'ExpeditionTruck','*','*','ALLOW','ROLE','palletizerBoss'),(693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'),(694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss'),(695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'),(696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'),(697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'),(698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'),(699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'),(701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryBoss'),(702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson');
+INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryAssistant'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryAssistant'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryAssistant'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryAssistant'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryAssistant'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryAssistant'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'),(569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryAssistant'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryAssistant'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryAssistant'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryAssistant'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'),(655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'),(656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'),(657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'),(658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'),(659,'Account','*','*','ALLOW','ROLE','itManagement'),(660,'Account','*','READ','ALLOW','ROLE','employee'),(664,'MailForward','*','*','ALLOW','ROLE','itManagement'),(665,'Role','*','READ','ALLOW','ROLE','employee'),(666,'Role','*','WRITE','ALLOW','ROLE','it'),(667,'VnUser','*','*','ALLOW','ROLE','itManagement'),(668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'),(669,'VnUser','preview','*','ALLOW','ROLE','employee'),(670,'VnUser','create','*','ALLOW','ROLE','itManagement'),(671,'VnUser','renewToken','WRITE','ALLOW','ROLE','employee'),(672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'),(673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),(674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'),(676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'),(680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'),(681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'),(682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'),(683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'),(684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'),(685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'),(686,'MailForward','*','*','ALLOW','ROLE','hr'),(687,'ClientSms','find','READ','ALLOW','ROLE','employee'),(688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'),(689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'),(690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss'),(691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'),(692,'ExpeditionTruck','*','*','ALLOW','ROLE','palletizerBoss'),(693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'),(694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss'),(695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'),(696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'),(697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'),(698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'),(699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'),(701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryAssistant'),(702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/e2e/paths/02-client/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js
index cb06d3616..744b11a72 100644
--- a/e2e/paths/02-client/01_create_client.spec.js
+++ b/e2e/paths/02-client/01_create_client.spec.js
@@ -8,7 +8,7 @@ describe('Client create path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('deliveryBoss', 'client');
+ await page.loginAndModule('deliveryAssistant', 'client');
});
afterAll(async() => {
From a9b2aef27adb2ae6a967d3bdd377d1d2857ac2fa Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 13 Sep 2023 12:02:25 +0200
Subject: [PATCH 083/427] refs #5660 join and value
---
db/changes/233801/01-deliveryAssistantACL.sql | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/db/changes/233801/01-deliveryAssistantACL.sql b/db/changes/233801/01-deliveryAssistantACL.sql
index 22ee9d796..34acf2427 100644
--- a/db/changes/233801/01-deliveryAssistantACL.sql
+++ b/db/changes/233801/01-deliveryAssistantACL.sql
@@ -1,21 +1,18 @@
-- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values.
INSERT INTO `account`.`role` (name,description)
- VALUES ('deliveryAssistant','Asistencia de envios');
-
-INSERT INTO `account`.`roleInherit` (role,inheritsFrom)
- SELECT (SELECT id FROM account.role r WHERE r.name = 'deliveryAssistant'), ri.inheritsFrom
- FROM account.roleInherit ri
- JOIN account.role r ON r.id = ri.`role`
- WHERE r.name = 'deliveryBoss';
+ VALUES ('deliveryAssistant','Jefe auxiliar repartos');
+INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
+ SELECT (SELECT id FROM account.role r1 WHERE r1.name = 'deliveryAssistant'), ri.inheritsFrom
+FROM account.roleInherit ri
+ JOIN account.role r2 ON r2.id = ri.`role`
+WHERE r2.name = 'deliveryBoss';
DELETE FROM `account`.`roleInherit` WHERE role = 57;
-
+
INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
- SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
+ SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
(SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
CALL account.role_syncPrivileges();
-
-
From f82af979ed5511e893c60651f2c1987892b31987 Mon Sep 17 00:00:00 2001
From: pablone
Date: Wed, 13 Sep 2023 16:54:50 +0200
Subject: [PATCH 084/427] refs #6213 fixTraductionFile
---
loopback/locale/es.json | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 6388c01a4..f568b9a58 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -317,6 +317,5 @@
"The ticket doesn't exist.": "No existe el ticket.",
"Social name should be uppercase": "La razón social debe ir en mayúscula",
"Street should be uppercase": "La dirección fiscal debe ir en mayúscula",
- "Ticket without Route": "Ticket sin ruta",
- "The account size must be exactly 10 characters": "The account size must be exactly 10 characters"
+ "Ticket without Route": "Ticket sin ruta"
}
\ No newline at end of file
From 7ab8cb37cd4b2a34c3899ccfafac3a5c22e8d33f Mon Sep 17 00:00:00 2001
From: pablone
Date: Wed, 13 Sep 2023 19:22:21 +0200
Subject: [PATCH 085/427] ref #6213 fixformat
---
modules/supplier/back/models/supplier.js | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 6bfec86d1..0337fe9db 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -119,15 +119,12 @@ module.exports = Self => {
Self.observe('after save', async function(ctx) {
if (ctx.instance && ctx.isNewInstance) {
- const supplierId = ctx.instance.id;
- const models = Self.app.models;
+ const {id} = ctx.instance;
+ const {Supplier} = Self.app.models;
- const supplier = await models.Supplier.findById(supplierId, null, ctx.options);
- await supplier.updateAttribute(
- 'account',
- supplier.account + supplierId,
- ctx.options
- );
+ const supplier = await Supplier.findById(id, null, ctx.options);
+ if (supplier)
+ await supplier.updateAttribute('account', `${supplier.account}${id}`, ctx.options);
}
});
From 66e851b5ea631c021d7461d1a35ec286130ead42 Mon Sep 17 00:00:00 2001
From: pablone
Date: Wed, 13 Sep 2023 19:48:58 +0200
Subject: [PATCH 086/427] refs #4131 changeStateRefactor
---
.../233801/00-ACLticketTrackingState.sql | 3 +
.../233801/00-ticketSetStateRefactor.sql | 69 +++++++++++++++++++
db/dump/dumpedFixtures.sql | 2 +-
front/core/directives/anchor.js | 4 +-
modules/claim/front/summary/index.html | 2 +-
modules/claim/front/summary/index.js | 2 +-
modules/claim/front/summary/index.spec.js | 4 +-
.../methods/ticket-tracking/setDelivered.js | 2 +-
.../ticket-tracking/specs/changeState.spec.js | 10 +--
.../{changeState.js => state.js} | 6 +-
modules/ticket/back/models/ticket-tracking.js | 2 +-
modules/ticket/front/sale/index.html | 4 +-
modules/ticket/front/sale/index.js | 4 +-
modules/ticket/front/sale/index.spec.js | 6 +-
modules/ticket/front/summary/index.html | 2 +-
modules/ticket/front/summary/index.js | 4 +-
modules/ticket/front/summary/index.spec.js | 6 +-
modules/ticket/front/tracking/edit/index.html | 2 +-
modules/ticket/front/tracking/edit/index.js | 2 +-
.../ticket/front/tracking/edit/index.spec.js | 2 +-
modules/worker/front/time-control/index.js | 2 +-
21 files changed, 106 insertions(+), 34 deletions(-)
create mode 100644 db/changes/233801/00-ACLticketTrackingState.sql
create mode 100644 db/changes/233801/00-ticketSetStateRefactor.sql
rename modules/ticket/back/methods/ticket-tracking/{changeState.js => state.js} (94%)
diff --git a/db/changes/233801/00-ACLticketTrackingState.sql b/db/changes/233801/00-ACLticketTrackingState.sql
new file mode 100644
index 000000000..a0e3824db
--- /dev/null
+++ b/db/changes/233801/00-ACLticketTrackingState.sql
@@ -0,0 +1,3 @@
+UPDATE `salix`.`ACL`
+ SET property = 'state'
+ WHERE property = 'changeState';
\ No newline at end of file
diff --git a/db/changes/233801/00-ticketSetStateRefactor.sql b/db/changes/233801/00-ticketSetStateRefactor.sql
new file mode 100644
index 000000000..1ad453299
--- /dev/null
+++ b/db/changes/233801/00-ticketSetStateRefactor.sql
@@ -0,0 +1,69 @@
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setState`(
+ vSelf INT,
+ vStateCode VARCHAR(255) COLLATE utf8_general_ci
+)
+BEGIN
+/**
+ * Modifica el estado de un ticket si se cumplen las condiciones necesarias.
+ *
+ * @param vSelf el id del ticket
+ * @param vStateCode estado a modificar del ticket
+ */
+ DECLARE vticketAlertLevel INT;
+ DECLARE vTicketStateCode VARCHAR(255);
+ DECLARE vCanChangeState BOOL;
+ DECLARE vPackedAlertLevel INT;
+ DECLARE vOnPreparationAlertLevel INT;
+ DECLARE vNextAlertLevel INT;
+ DECLARE vZoneFk INT;
+
+ SELECT s.alertLevel, s.`code`, s2.alertLevel, t.zoneFk
+ INTO vticketAlertLevel, vTicketStateCode, vNextAlertLevel , vZoneFk
+ FROM state s
+ JOIN ticketTracking tt ON tt.stateFk = s.id
+ JOIN state s2 ON s2.code = vStateCode
+ JOIN ticket t ON t.id = tt.ticketFk
+ WHERE tt.ticketFk = vSelf
+ ORDER BY tt.created DESC
+ LIMIT 1;
+
+ SELECT id INTO vPackedAlertLevel FROM alertLevel WHERE code = 'PACKED';
+ SELECT id INTO vOnPreparationAlertLevel
+ FROM alertLevel
+ WHERE code = 'ON_PREPARATION';
+
+ IF vStateCode = 'OK' AND vZoneFk IS NULL THEN
+ CALL util.throw('ASSIGN_ZONE_FIRST');
+ END IF;
+
+ IF vNextAlertLevel > vticketAlertLevel &&
+ vticketAlertLevel < vOnPreparationAlertLevel
+ THEN
+ UPDATE sale
+ SET originalQuantity = quantity
+ WHERE ticketFk = vSelf;
+ END IF;
+
+ SET vCanChangeState = (
+ vStateCode <> 'ON_CHECKING' OR
+ vticketAlertLevel < vPackedAlertLevel
+ )AND NOT (
+ vTicketStateCode IN ('CHECKED', 'CHECKING')
+ AND vStateCode IN ('PREPARED', 'ON_PREPARATION')
+ );
+
+ IF vCanChangeState THEN
+ INSERT INTO ticketTracking (stateFk, ticketFk, workerFk)
+ SELECT id, vSelf, account.myUser_getId()
+ FROM state
+ WHERE `code` = vStateCode COLLATE utf8_unicode_ci;
+
+ IF vStateCode = 'PACKED' THEN
+ CALL ticket_doCmr(vSelf);
+ END IF;
+ ELSE
+ CALL util.throw('INCORRECT_TICKET_STATE');
+ END IF;
+END$$
+DELIMITER ;
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 2e1511b59..5ff2e03ef 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -164,7 +164,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryBoss'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryBoss'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'),(569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryBoss'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryBoss'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryBoss'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryBoss'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'),(655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'),(656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'),(657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'),(658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'),(659,'Account','*','*','ALLOW','ROLE','itManagement'),(660,'Account','*','READ','ALLOW','ROLE','employee'),(664,'MailForward','*','*','ALLOW','ROLE','itManagement'),(665,'Role','*','READ','ALLOW','ROLE','employee'),(666,'Role','*','WRITE','ALLOW','ROLE','it'),(667,'VnUser','*','*','ALLOW','ROLE','itManagement'),(668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'),(669,'VnUser','preview','*','ALLOW','ROLE','employee'),(670,'VnUser','create','*','ALLOW','ROLE','itManagement'),(671,'VnUser','renewToken','WRITE','ALLOW','ROLE','employee'),(672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'),(673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),(674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'),(676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'),(680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'),(681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'),(682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'),(683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'),(684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'),(685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'),(686,'MailForward','*','*','ALLOW','ROLE','hr'),(687,'ClientSms','find','READ','ALLOW','ROLE','employee'),(688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'),(689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'),(690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss'),(691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'),(692,'ExpeditionTruck','*','*','ALLOW','ROLE','palletizerBoss'),(693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'),(694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss'),(695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'),(696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'),(697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'),(698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'),(699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'),(701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryBoss'),(702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson');
+INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','state','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryBoss'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryBoss'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'),(569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryBoss'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryBoss'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryBoss'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryBoss'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'),(655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'),(656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'),(657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'),(658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'),(659,'Account','*','*','ALLOW','ROLE','itManagement'),(660,'Account','*','READ','ALLOW','ROLE','employee'),(664,'MailForward','*','*','ALLOW','ROLE','itManagement'),(665,'Role','*','READ','ALLOW','ROLE','employee'),(666,'Role','*','WRITE','ALLOW','ROLE','it'),(667,'VnUser','*','*','ALLOW','ROLE','itManagement'),(668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'),(669,'VnUser','preview','*','ALLOW','ROLE','employee'),(670,'VnUser','create','*','ALLOW','ROLE','itManagement'),(671,'VnUser','renewToken','WRITE','ALLOW','ROLE','employee'),(672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'),(673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),(674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'),(676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'),(680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'),(681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'),(682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'),(683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'),(684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'),(685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'),(686,'MailForward','*','*','ALLOW','ROLE','hr'),(687,'ClientSms','find','READ','ALLOW','ROLE','employee'),(688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'),(689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'),(690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss'),(691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'),(692,'ExpeditionTruck','*','*','ALLOW','ROLE','palletizerBoss'),(693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'),(694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss'),(695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'),(696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'),(697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'),(698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'),(699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'),(701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryBoss'),(702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/front/core/directives/anchor.js b/front/core/directives/anchor.js
index b460b3ada..81e252e04 100644
--- a/front/core/directives/anchor.js
+++ b/front/core/directives/anchor.js
@@ -8,7 +8,7 @@ export function stringifyParams(data) {
return params;
}
-export function changeState($state, event, data) {
+export function state($state, event, data) {
const params = stringifyParams(data);
$state.go(data.state, params);
@@ -53,7 +53,7 @@ export function directive($state, $window) {
if (ctrlPressed || data.target == '_blank')
openNewTab($state, $window, event, data);
else
- changeState($state, event, data);
+ state($state, event, data);
});
$element.on('mousedown', event => {
diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html
index 3115cb451..877a8c0f2 100644
--- a/modules/claim/front/summary/index.html
+++ b/modules/claim/front/summary/index.html
@@ -21,7 +21,7 @@
value-field="id"
show-field="description"
url="claimStates"
- on-change="$ctrl.changeState(value)">
+ on-change="$ctrl.state(value)">
diff --git a/modules/claim/front/summary/index.js b/modules/claim/front/summary/index.js
index 7cd4805e9..f1310c298 100644
--- a/modules/claim/front/summary/index.js
+++ b/modules/claim/front/summary/index.js
@@ -71,7 +71,7 @@ class Controller extends Summary {
return this.vnFile.getPath(`/api/dms/${dmsId}/downloadFile`);
}
- changeState(value) {
+ state(value) {
const params = {
id: this.claim.id,
claimStateFk: value
diff --git a/modules/claim/front/summary/index.spec.js b/modules/claim/front/summary/index.spec.js
index 8540a3a97..04a270c5f 100644
--- a/modules/claim/front/summary/index.spec.js
+++ b/modules/claim/front/summary/index.spec.js
@@ -28,14 +28,14 @@ describe('Claim', () => {
});
});
- describe('changeState()', () => {
+ describe('state()', () => {
it('should make an HTTP post query, then call the showSuccess()', () => {
jest.spyOn(controller.vnApp, 'showSuccess').mockReturnThis();
const expectedParams = {id: 1, claimStateFk: 1};
$httpBackend.when('GET', `Claims/1/getSummary`).respond(200, 24);
$httpBackend.expect('PATCH', `Claims/updateClaim/1`, expectedParams).respond(200);
- controller.changeState(1);
+ controller.state(1);
$httpBackend.flush();
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
diff --git a/modules/ticket/back/methods/ticket-tracking/setDelivered.js b/modules/ticket/back/methods/ticket-tracking/setDelivered.js
index bd6e32dcf..bfbc71942 100644
--- a/modules/ticket/back/methods/ticket-tracking/setDelivered.js
+++ b/modules/ticket/back/methods/ticket-tracking/setDelivered.js
@@ -47,7 +47,7 @@ module.exports = Self => {
const promises = [];
for (const id of ticketIds) {
- const promise = models.TicketTracking.changeState(ctx, {
+ const promise = models.TicketTracking.state(ctx, {
stateFk: state.id,
workerFk: worker.id,
ticketFk: id
diff --git a/modules/ticket/back/methods/ticket-tracking/specs/changeState.spec.js b/modules/ticket/back/methods/ticket-tracking/specs/changeState.spec.js
index 175bc4e4b..b01d02389 100644
--- a/modules/ticket/back/methods/ticket-tracking/specs/changeState.spec.js
+++ b/modules/ticket/back/methods/ticket-tracking/specs/changeState.spec.js
@@ -1,7 +1,7 @@
const models = require('vn-loopback/server/server').models;
const LoopBackContext = require('loopback-context');
-describe('ticket changeState()', () => {
+describe('ticket state()', () => {
const salesPersonId = 18;
const employeeId = 1;
const productionId = 49;
@@ -47,7 +47,7 @@ describe('ticket changeState()', () => {
activeCtx.accessToken.userId = salesPersonId;
const params = {ticketFk: 2, stateFk: 3};
- await models.TicketTracking.changeState(ctx, params, options);
+ await models.TicketTracking.state(ctx, params, options);
await tx.rollback();
} catch (e) {
@@ -69,7 +69,7 @@ describe('ticket changeState()', () => {
activeCtx.accessToken.userId = employeeId;
const params = {ticketFk: 11, stateFk: 13};
- await models.TicketTracking.changeState(ctx, params, options);
+ await models.TicketTracking.state(ctx, params, options);
await tx.rollback();
} catch (e) {
@@ -91,7 +91,7 @@ describe('ticket changeState()', () => {
activeCtx.accessToken.userId = productionId;
const params = {ticketFk: ticket.id, stateFk: 3};
- const ticketTracking = await models.TicketTracking.changeState(ctx, params, options);
+ const ticketTracking = await models.TicketTracking.state(ctx, params, options);
expect(ticketTracking.__data.ticketFk).toBe(params.ticketFk);
expect(ticketTracking.__data.stateFk).toBe(params.stateFk);
@@ -115,7 +115,7 @@ describe('ticket changeState()', () => {
const ctx = {req: {accessToken: {userId: 18}}};
const assignedState = await models.State.findOne({where: {code: 'PICKER_DESIGNED'}}, options);
const params = {ticketFk: ticket.id, stateFk: assignedState.id, workerFk: 1};
- const res = await models.TicketTracking.changeState(ctx, params, options);
+ const res = await models.TicketTracking.state(ctx, params, options);
expect(res.__data.ticketFk).toBe(params.ticketFk);
expect(res.__data.stateFk).toBe(params.stateFk);
diff --git a/modules/ticket/back/methods/ticket-tracking/changeState.js b/modules/ticket/back/methods/ticket-tracking/state.js
similarity index 94%
rename from modules/ticket/back/methods/ticket-tracking/changeState.js
rename to modules/ticket/back/methods/ticket-tracking/state.js
index 4ae9ab40c..cfc69b20c 100644
--- a/modules/ticket/back/methods/ticket-tracking/changeState.js
+++ b/modules/ticket/back/methods/ticket-tracking/state.js
@@ -1,7 +1,7 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
- Self.remoteMethodCtx('changeState', {
+ Self.remoteMethodCtx('state', {
description: 'Change the state of a ticket',
accessType: 'WRITE',
accepts: [
@@ -18,12 +18,12 @@ module.exports = Self => {
root: true
},
http: {
- path: `/changeState`,
+ path: `/state`,
verb: 'POST'
}
});
- Self.changeState = async(ctx, params, options) => {
+ Self.state = async(ctx, params, options) => {
const models = Self.app.models;
const myOptions = {};
let tx;
diff --git a/modules/ticket/back/models/ticket-tracking.js b/modules/ticket/back/models/ticket-tracking.js
index 2e6d3403e..48e4c93d7 100644
--- a/modules/ticket/back/models/ticket-tracking.js
+++ b/modules/ticket/back/models/ticket-tracking.js
@@ -1,5 +1,5 @@
module.exports = function(Self) {
- require('../methods/ticket-tracking/changeState')(Self);
+ require('../methods/ticket-tracking/state')(Self);
require('../methods/ticket-tracking/setDelivered')(Self);
Self.validatesPresenceOf('stateFk', {message: 'State cannot be blank'});
diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html
index be9e81964..a3bb861fe 100644
--- a/modules/ticket/front/sale/index.html
+++ b/modules/ticket/front/sale/index.html
@@ -15,7 +15,7 @@
+ on-change="$ctrl.state(value)">
{
+ return this.$http.post('TicketTrackings/state', params).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.card.reload();
}).finally(() => this.resetChanges());
diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js
index 9da8e6e7c..a0906dd00 100644
--- a/modules/ticket/front/sale/index.spec.js
+++ b/modules/ticket/front/sale/index.spec.js
@@ -230,15 +230,15 @@ describe('Ticket', () => {
});
});
- describe('changeState()', () => {
+ describe('state()', () => {
it('should make an HTTP post query, then call the showSuccess(), reload() and resetChanges() methods', () => {
jest.spyOn(controller.card, 'reload').mockReturnThis();
jest.spyOn(controller.vnApp, 'showSuccess').mockReturnThis();
jest.spyOn(controller, 'resetChanges').mockReturnThis();
const expectedParams = {ticketFk: 1, code: 'OK'};
- $httpBackend.expect('POST', `TicketTrackings/changeState`, expectedParams).respond(200);
- controller.changeState('OK');
+ $httpBackend.expect('POST', `TicketTrackings/state`, expectedParams).respond(200);
+ controller.state('OK');
$httpBackend.flush();
expect(controller.card.reload).toHaveBeenCalledWith();
diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html
index dd0e94f42..c35e5b118 100644
--- a/modules/ticket/front/summary/index.html
+++ b/modules/ticket/front/summary/index.html
@@ -18,7 +18,7 @@
value-field="code"
fields="['id', 'name', 'alertLevel', 'code']"
url="States/editableStates"
- on-change="$ctrl.changeState(value)">
+ on-change="$ctrl.state(value)">
{
if ('id' in this.$params) this.reload();
})
diff --git a/modules/ticket/front/summary/index.spec.js b/modules/ticket/front/summary/index.spec.js
index 599da73ae..b8c6f0513 100644
--- a/modules/ticket/front/summary/index.spec.js
+++ b/modules/ticket/front/summary/index.spec.js
@@ -43,15 +43,15 @@ describe('Ticket', () => {
});
});
- describe('changeState()', () => {
+ describe('state()', () => {
it('should change the state', () => {
jest.spyOn(controller.vnApp, 'showSuccess');
const value = 'myTicketState';
let res = {id: 1, nickname: 'myNickname'};
$httpBackend.when('GET', `Tickets/1/summary`).respond(200, res);
- $httpBackend.expectPOST(`TicketTrackings/changeState`).respond(200, 'ok');
- controller.changeState(value);
+ $httpBackend.expectPOST(`TicketTrackings/state`).respond(200, 'ok');
+ controller.state(value);
$httpBackend.flush();
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
diff --git a/modules/ticket/front/tracking/edit/index.html b/modules/ticket/front/tracking/edit/index.html
index bff8e71b1..90f045813 100644
--- a/modules/ticket/front/tracking/edit/index.html
+++ b/modules/ticket/front/tracking/edit/index.html
@@ -1,4 +1,4 @@
-
+ {
+ this.$http.post(`TicketTrackings/state`, this.params).then(() => {
this.$.watcher.updateOriginalData();
this.card.reload();
this.vnApp.showSuccess(this.$t('Data saved!'));
diff --git a/modules/ticket/front/tracking/edit/index.spec.js b/modules/ticket/front/tracking/edit/index.spec.js
index 1ba5912b5..e97dc1337 100644
--- a/modules/ticket/front/tracking/edit/index.spec.js
+++ b/modules/ticket/front/tracking/edit/index.spec.js
@@ -61,7 +61,7 @@ describe('Ticket', () => {
jest.spyOn(controller.vnApp, 'showSuccess');
jest.spyOn(controller.$state, 'go');
- $httpBackend.expectPOST(`TicketTrackings/changeState`, controller.params).respond({});
+ $httpBackend.expectPOST(`TicketTrackings/state`, controller.params).respond({});
controller.onSubmit();
$httpBackend.flush();
diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js
index 38e6721d6..dae2a950b 100644
--- a/modules/worker/front/time-control/index.js
+++ b/modules/worker/front/time-control/index.js
@@ -385,7 +385,7 @@ class Controller extends Section {
});
}
- changeState(state, reason) {
+ state(state, reason) {
this.state = state;
this.reason = reason;
this.repaint();
From d2cd522842dbb024f9812b68ed8a58fff4e2fc99 Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Thu, 14 Sep 2023 07:47:10 +0200
Subject: [PATCH 087/427] refs #5652 modify:without fit
---
db/changes/233801/00-item_setVisibleDiscard.sql | 13 +++++--------
db/changes/233801/00-ticketConfig.sql | 11 -----------
db/dump/fixtures.sql | 7 ++-----
modules/client/back/methods/address/getAddress.js | 13 ++++++++-----
.../back/methods/address/specs/getAddress.spec.js | 5 ++---
5 files changed, 17 insertions(+), 32 deletions(-)
diff --git a/db/changes/233801/00-item_setVisibleDiscard.sql b/db/changes/233801/00-item_setVisibleDiscard.sql
index 1b9bf0ffb..e73a77046 100644
--- a/db/changes/233801/00-item_setVisibleDiscard.sql
+++ b/db/changes/233801/00-item_setVisibleDiscard.sql
@@ -14,9 +14,8 @@ BEGIN
SELECT barcodeToItem(vItemFk) INTO vItemFk;
- SELECT companyDefaultFk INTO vCompanyVnlFk
- FROM ticketConfig ;
-
+ SELECT DEFAULT(companyFk) INTO vCompanyVnlFk
+ FROM vn.ticket LIMIT 1;
SELECT c.id INTO vClientFk
FROM client c
JOIN address a ON a.clientFk = c.id
@@ -26,10 +25,8 @@ BEGIN
FROM ticket t
JOIN address a ON a.id = t.addressFk
WHERE t.warehouseFk = vWarehouseFk
- AND t.clientFk = vClientFk
- AND DATE(t.shipped) = util.VN_CURDATE()
- AND a.isDefaultAddress
- LIMIT 1;
+ AND a.id = vAddressFk
+ AND DATE(t.shipped) = util.VN_CURDATE();
CALL cache.visible_refresh(vCalc, TRUE, vWarehouseFk);
@@ -39,7 +36,7 @@ BEGIN
util.VN_CURDATE(),
vWarehouseFk,
vCompanyVnlFk,
- NULL,
+ vAddressFk,
NULL,
NULL,
util.VN_CURDATE(),
diff --git a/db/changes/233801/00-ticketConfig.sql b/db/changes/233801/00-ticketConfig.sql
index 5cef1ba5f..5429878b4 100644
--- a/db/changes/233801/00-ticketConfig.sql
+++ b/db/changes/233801/00-ticketConfig.sql
@@ -1,15 +1,4 @@
-ALTER TABLE `vn`.`ticketConfig` ADD companyDefaultFk int(10) unsigned DEFAULT 442 NOT NULL COMMENT 'Compañía por defecto para crear ticket';
-
-ALTER TABLE `vn`.`ticketConfig` ADD CONSTRAINT ticketConfig_FK FOREIGN KEY (companyDefaultFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE;
-
--- Se desactivan por utilizarse muy poco
-
-UPDATE vn.address
- SET isDefaultAddress = 0,
- isActive = 0
- WHERE id IN (6,47);
-
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES('Item', 'setVisibleDiscard', 'WRITE', 'ALLOW', 'ROLE', 'employee');
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 7ce39287e..4e56c8385 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -2959,11 +2959,8 @@ INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
VALUES
(1, 0, 0, 'marvel.com');
---fixtures for getaddressLastYear
+--fixtures for getaddress
UPDATE vn.client
SET typeFk='loses'
WHERE id=1101;
-
-UPDATE vn.ticket
- SET created='2023-08-01 00:00:00'
- WHERE id=6;
\ No newline at end of file
+
\ No newline at end of file
diff --git a/modules/client/back/methods/address/getAddress.js b/modules/client/back/methods/address/getAddress.js
index a15fb8aba..86a23674f 100644
--- a/modules/client/back/methods/address/getAddress.js
+++ b/modules/client/back/methods/address/getAddress.js
@@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethod('getAddress', {
- description: 'Get all activated address client active',
+ description: 'Get all activated address with loses client activated',
accessType: 'READ',
accepts: [],
returns: {
@@ -12,10 +12,13 @@ module.exports = Self => {
verb: 'GET'
}
});
-
Self.getAddress = async() => {
- const query = `CALL vn.address_getLoses()`;
- const [result] = await Self.rawSql(query);
- return result;
+ let getAddressQuery = `
+ SELECT a.id, a.nickname
+ FROM vn.address a
+ JOIN vn.client c ON a.clientFk = c.id AND c.isActive = 1
+ WHERE c.typeFk = 'loses' AND a.isActive = 1;`;
+
+ return result = await Self.rawSql(getAddressQuery);
};
};
diff --git a/modules/client/back/methods/address/specs/getAddress.spec.js b/modules/client/back/methods/address/specs/getAddress.spec.js
index d2b219495..a86e1007c 100644
--- a/modules/client/back/methods/address/specs/getAddress.spec.js
+++ b/modules/client/back/methods/address/specs/getAddress.spec.js
@@ -1,10 +1,9 @@
const {models} = require('vn-loopback/server/server');
describe('getAddress()', () => {
- it('return list of address last year', async() => {
+ it('return list of activated address with loses client activated', async() => {
let response = await models.Address.getAddress();
- expect(response.length).toBeGreaterThan(0);
- expect(response[0].addressFk).toEqual(1);
+ expect(response.length).toEqual(2);
});
});
From 4c1ff2e4d7b53a7eaf15dea69b7b6f10bb6949d5 Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Thu, 14 Sep 2023 08:27:49 +0200
Subject: [PATCH 088/427] refs #6141feat:buyer model
---
back/model-config.json | 3 +++
back/models/buyer.json | 28 ++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
create mode 100644 back/models/buyer.json
diff --git a/back/model-config.json b/back/model-config.json
index b88956dee..ebc0e321b 100644
--- a/back/model-config.json
+++ b/back/model-config.json
@@ -15,6 +15,9 @@
},
"Bank": {
"dataSource": "vn"
+ },
+ "Buyer": {
+ "dataSource": "vn"
},
"Campaign": {
"dataSource": "vn"
diff --git a/back/models/buyer.json b/back/models/buyer.json
new file mode 100644
index 000000000..a17d3b538
--- /dev/null
+++ b/back/models/buyer.json
@@ -0,0 +1,28 @@
+{
+ "name": "Buyer",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "buyer"
+ }
+ },
+ "properties": {
+ "userFk": {
+ "type": "number",
+ "required": true,
+ "id": true
+ },
+ "nickname": {
+ "type": "string",
+ "required": true
+ }
+ },
+ "acls": [
+ {
+ "accessType": "READ",
+ "principalType": "ROLE",
+ "principalId": "employee",
+ "permission": "ALLOW"
+ }
+ ]
+}
From 82631d6fcdf53aa8378e9848062f03e1f59ed72f Mon Sep 17 00:00:00 2001
From: jgallego
Date: Thu, 14 Sep 2023 10:26:59 +0200
Subject: [PATCH 089/427] claimingRate divide por 100
---
modules/client/front/summary/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html
index 15a55ec8c..c622913bb 100644
--- a/modules/client/front/summary/index.html
+++ b/modules/client/front/summary/index.html
@@ -255,7 +255,7 @@
value="{{$ctrl.summary.averageInvoiced.invoiced | currency: 'EUR':2}}">
+ value="{{$ctrl.claimingRate($ctrl.summary.claimsRatio.claimingRate / 100) | percentage}}">
From 11109d72a69b9402387f507b318017b4d9f1c192 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 14 Sep 2023 11:36:09 +0200
Subject: [PATCH 090/427] move sql
---
db/changes/{233601 => 233801}/00-firstScript.sql | 0
db/changes/{233401 => 233801}/01-deviceLog_acl.sql | 0
2 files changed, 0 insertions(+), 0 deletions(-)
rename db/changes/{233601 => 233801}/00-firstScript.sql (100%)
rename db/changes/{233401 => 233801}/01-deviceLog_acl.sql (100%)
diff --git a/db/changes/233601/00-firstScript.sql b/db/changes/233801/00-firstScript.sql
similarity index 100%
rename from db/changes/233601/00-firstScript.sql
rename to db/changes/233801/00-firstScript.sql
diff --git a/db/changes/233401/01-deviceLog_acl.sql b/db/changes/233801/01-deviceLog_acl.sql
similarity index 100%
rename from db/changes/233401/01-deviceLog_acl.sql
rename to db/changes/233801/01-deviceLog_acl.sql
From ca2257d29b858ddcd0eef6c1f602c02b5b29cbac Mon Sep 17 00:00:00 2001
From: jgallego
Date: Thu, 14 Sep 2023 13:47:04 +0200
Subject: [PATCH 091/427] subo version 2340
---
CHANGELOG.md | 7 +++++++
db/changes/234001/.gitkeep | 0
package.json | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 db/changes/234001/.gitkeep
diff --git a/CHANGELOG.md b/CHANGELOG.md
index acb5d7457..0573a6790 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [2340.01] - 2023-10-05
+
+### Added
+### Changed
+
+### Fixed
+
## [2338.01] - 2023-09-21
### Added
diff --git a/db/changes/234001/.gitkeep b/db/changes/234001/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/package.json b/package.json
index 44a651af4..d250071a6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "salix-back",
- "version": "23.38.01",
+ "version": "23.40.01",
"author": "Verdnatura Levante SL",
"description": "Salix backend",
"license": "GPL-3.0",
From a44e5206a7f2701f9195fd9af64ae3a538c342c1 Mon Sep 17 00:00:00 2001
From: pablone
Date: Thu, 14 Sep 2023 14:18:00 +0200
Subject: [PATCH 092/427] refs #6213 fixConcatBug
---
modules/supplier/back/models/supplier.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 0337fe9db..273c8c816 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -124,7 +124,7 @@ module.exports = Self => {
const supplier = await Supplier.findById(id, null, ctx.options);
if (supplier)
- await supplier.updateAttribute('account', `${supplier.account}${id}`, ctx.options);
+ await supplier.updateAttribute('account', Number(supplier.account) + id, ctx.options);
}
});
From b756d2f938f715d3f4aa86326a02b7564c14def5 Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Thu, 14 Sep 2023 18:03:30 +0200
Subject: [PATCH 093/427] refs #5652 modify
---
.../233801/00-address_getLosesLastYear.sql | 14 ---------
.../233801/00-item_setVisibleDiscard.sql | 6 ++--
db/dump/fixtures.sql | 31 +++++++++----------
.../client/back/methods/address/getAddress.js | 4 +--
4 files changed, 19 insertions(+), 36 deletions(-)
delete mode 100644 db/changes/233801/00-address_getLosesLastYear.sql
diff --git a/db/changes/233801/00-address_getLosesLastYear.sql b/db/changes/233801/00-address_getLosesLastYear.sql
deleted file mode 100644
index dc75c3121..000000000
--- a/db/changes/233801/00-address_getLosesLastYear.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-
-DELIMITER $$
-CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_getLoses`()
-BEGIN
- SELECT t.addressFk , a.nickname, c.name
- FROM ticket t
- JOIN address a ON a.id = t.addressFk
- JOIN client c ON a.clientFk = c.id
- WHERE c.typeFk = 'loses'
- AND a.isactive = 1
- GROUP BY t.addressFk;
-END$$
-DELIMITER ;
-
diff --git a/db/changes/233801/00-item_setVisibleDiscard.sql b/db/changes/233801/00-item_setVisibleDiscard.sql
index e73a77046..6ee66a947 100644
--- a/db/changes/233801/00-item_setVisibleDiscard.sql
+++ b/db/changes/233801/00-item_setVisibleDiscard.sql
@@ -16,9 +16,9 @@ BEGIN
SELECT DEFAULT(companyFk) INTO vCompanyVnlFk
FROM vn.ticket LIMIT 1;
- SELECT c.id INTO vClientFk
- FROM client c
- JOIN address a ON a.clientFk = c.id
+
+ SELECT a.clientFk INTO vClientFk
+ FROM address a
WHERE a.id = vAddressFk;
SELECT t.id INTO vTicketFk
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 03a805069..9be9d69f6 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -358,20 +358,20 @@ INSERT INTO `vn`.`contactChannel`(`id`, `name`)
(4, 'GCN Channel'),
(5, 'The Newspaper');
-INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`,`clientTypeFk`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`, `businessTypeFk`)
+INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`,`clientTypeFk`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`, `businessTypeFk`,`typeFk`)
VALUES
- (1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
- (1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
- (1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
- (1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
- (1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist'),
- (1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist'),
- (1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist'),
- (1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist'),
- (1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist'),
- (1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist'),
- (1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others'),
- (1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others');
+ (1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','loses'),
+ (1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
+ (1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
+ (1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
+ (1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
+ (1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
+ (1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
+ (1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
+ (1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist','normal'),
+ (1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist','normal'),
+ (1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','normal'),
+ (1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','normal');
INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`)
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1
@@ -2974,8 +2974,5 @@ INSERT INTO vn.XDiario (id, ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EU
(4, 2.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T4444444', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(5, 2.0, util.VN_CURDATE(), '2000000000', '4300001104', 'n/fra T4444444 Tony Stark', NULL, 8.07, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
---fixtures for getaddress
-UPDATE vn.client
- SET typeFk='loses'
- WHERE id=1101;
+
\ No newline at end of file
diff --git a/modules/client/back/methods/address/getAddress.js b/modules/client/back/methods/address/getAddress.js
index 86a23674f..a62a0ec6f 100644
--- a/modules/client/back/methods/address/getAddress.js
+++ b/modules/client/back/methods/address/getAddress.js
@@ -16,8 +16,8 @@ module.exports = Self => {
let getAddressQuery = `
SELECT a.id, a.nickname
FROM vn.address a
- JOIN vn.client c ON a.clientFk = c.id AND c.isActive = 1
- WHERE c.typeFk = 'loses' AND a.isActive = 1;`;
+ JOIN vn.client c ON a.clientFk = c.id AND c.isActive <> FALSE
+ WHERE c.typeFk = 'loses' AND a.isActive <> FALSE;`;
return result = await Self.rawSql(getAddressQuery);
};
From 0912bd40f3d51572cbd7c5923c056a0163ea31b4 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Fri, 15 Sep 2023 09:15:48 +0200
Subject: [PATCH 094/427] refs #5660 sql fix
---
db/changes/{233801 => 234001}/01-deliveryAssistantACL.sql | 2 --
1 file changed, 2 deletions(-)
rename db/changes/{233801 => 234001}/01-deliveryAssistantACL.sql (93%)
diff --git a/db/changes/233801/01-deliveryAssistantACL.sql b/db/changes/234001/01-deliveryAssistantACL.sql
similarity index 93%
rename from db/changes/233801/01-deliveryAssistantACL.sql
rename to db/changes/234001/01-deliveryAssistantACL.sql
index 34acf2427..9f3caf848 100644
--- a/db/changes/233801/01-deliveryAssistantACL.sql
+++ b/db/changes/234001/01-deliveryAssistantACL.sql
@@ -8,8 +8,6 @@ FROM account.roleInherit ri
JOIN account.role r2 ON r2.id = ri.`role`
WHERE r2.name = 'deliveryBoss';
-DELETE FROM `account`.`roleInherit` WHERE role = 57;
-
INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
(SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
From 881a1ee0b84b5d9893a84b4adffa78f9c9eb750d Mon Sep 17 00:00:00 2001
From: sergiodt
Date: Fri, 15 Sep 2023 11:24:17 +0200
Subject: [PATCH 095/427] refs #5652 modify: solved Tests
---
.../back/methods/sales-monitor/specs/salesFilter.spec.js | 4 ++--
modules/ticket/back/methods/ticket/specs/filter.spec.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js b/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js
index 4e0fb85b7..c3da7f08b 100644
--- a/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js
+++ b/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js
@@ -39,7 +39,7 @@ describe('SalesMonitor salesFilter()', () => {
const filter = {};
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
- expect(result.length).toBeGreaterThan(15);
+ expect(result.length).toBeGreaterThan(11);
await tx.rollback();
} catch (e) {
@@ -151,7 +151,7 @@ describe('SalesMonitor salesFilter()', () => {
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
const firstRow = result[0];
- expect(result.length).toEqual(12);
+ expect(result.length).toEqual(15);
expect(firstRow.alertLevel).not.toEqual(0);
await tx.rollback();
diff --git a/modules/ticket/back/methods/ticket/specs/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js
index 510446cab..2e5730980 100644
--- a/modules/ticket/back/methods/ticket/specs/filter.spec.js
+++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js
@@ -68,7 +68,7 @@ describe('ticket filter()', () => {
const filter = {};
const result = await models.Ticket.filter(ctx, filter, options);
- expect(result.length).toEqual(6);
+ expect(result.length).toEqual(9);
await tx.rollback();
} catch (e) {
@@ -154,7 +154,7 @@ describe('ticket filter()', () => {
const secondRow = result[1];
const thirdRow = result[2];
- expect(result.length).toBeGreaterThan(15);
+ expect(result.length).toBeGreaterThan(11);
expect(firstRow.state).toEqual('Entregado');
expect(secondRow.state).toEqual('Entregado');
expect(thirdRow.state).toEqual('Entregado');
From 690df509d392970e1bde9edb1cef2ec941297b68 Mon Sep 17 00:00:00 2001
From: guillermo
Date: Mon, 18 Sep 2023 07:10:12 +0200
Subject: [PATCH 096/427] refs #5684 Fixed no error
---
back/methods/edi/updateData.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js
index 10c81a795..6bebad1e4 100644
--- a/back/methods/edi/updateData.js
+++ b/back/methods/edi/updateData.js
@@ -139,7 +139,7 @@ module.exports = Self => {
ftpClient.exec((err, response) => {
if (err || response.error) {
console.debug(`Error downloading checksum file... ${response.error}`);
- return reject(err);
+ return reject(response.error || err);
}
resolve(response);
From 55b53c86c436ca42f76a34c045dc9f961303106a Mon Sep 17 00:00:00 2001
From: pablone
Date: Mon, 18 Sep 2023 07:38:30 +0200
Subject: [PATCH 097/427] refs #6213 formatfix
---
modules/supplier/back/models/supplier.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 273c8c816..5cf357c13 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -123,8 +123,7 @@ module.exports = Self => {
const {Supplier} = Self.app.models;
const supplier = await Supplier.findById(id, null, ctx.options);
- if (supplier)
- await supplier.updateAttribute('account', Number(supplier.account) + id, ctx.options);
+ await supplier?.updateAttribute('account', Number(supplier.account) + id, ctx.options);
}
});
From fa87757d0f8452df28c936d52f7c0015622c972a Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 18 Sep 2023 08:56:25 +0200
Subject: [PATCH 098/427] refs #5560 sql fix
---
db/changes/234001/01-deliveryAssistantACL.sql | 2 --
1 file changed, 2 deletions(-)
diff --git a/db/changes/234001/01-deliveryAssistantACL.sql b/db/changes/234001/01-deliveryAssistantACL.sql
index 9f3caf848..bde29d165 100644
--- a/db/changes/234001/01-deliveryAssistantACL.sql
+++ b/db/changes/234001/01-deliveryAssistantACL.sql
@@ -12,5 +12,3 @@ INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
(SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
-
-CALL account.role_syncPrivileges();
From 6c34421413c82ffb9ce255350e8fa3d8e7d990bd Mon Sep 17 00:00:00 2001
From: guillermo
Date: Mon, 18 Sep 2023 10:03:31 +0200
Subject: [PATCH 099/427] refs #5995 Requested changes
---
loopback/locale/en.json | 3 ++-
loopback/locale/es.json | 3 ++-
modules/route/back/methods/route/downloadCmrsZip.js | 10 +++-------
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/loopback/locale/en.json b/loopback/locale/en.json
index 46b48e2ea..30b0664b5 100644
--- a/loopback/locale/en.json
+++ b/loopback/locale/en.json
@@ -185,5 +185,6 @@
"You don't have enough privileges.": "You don't have enough privileges.",
"This ticket is locked.": "This ticket is locked.",
"This ticket is not editable.": "This ticket is not editable.",
- "The ticket doesn't exist.": "The ticket doesn't exist."
+ "The ticket doesn't exist.": "The ticket doesn't exist.",
+ "The response is not a PDF": "The response is not a PDF"
}
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 195b683ad..1cfcf2f83 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -315,5 +315,6 @@
"This ticket is not editable.": "Este ticket no es editable.",
"The ticket doesn't exist.": "No existe el ticket.",
"Social name should be uppercase": "La razón social debe ir en mayúscula",
- "Street should be uppercase": "La dirección fiscal debe ir en mayúscula"
+ "Street should be uppercase": "La dirección fiscal debe ir en mayúscula",
+ "The response is not a PDF": "La respuesta no es un PDF"
}
diff --git a/modules/route/back/methods/route/downloadCmrsZip.js b/modules/route/back/methods/route/downloadCmrsZip.js
index 61f9701b5..532e019b6 100644
--- a/modules/route/back/methods/route/downloadCmrsZip.js
+++ b/modules/route/back/methods/route/downloadCmrsZip.js
@@ -55,14 +55,10 @@ module.exports = Self => {
responseType: 'arraybuffer',
});
- if (response.headers['content-type'] !== 'application/pdf') {
- throw new UserError(`The response for cmr id ${id} is not a PDF.`);
- }
+ if (response.headers['content-type'] !== 'application/pdf')
+ throw new UserError(`The response is not a PDF`);
- const pdfData = response.data;
- const fileName = `${id}.pdf`;
-
- zip.file(fileName, pdfData, { binary: true });
+ zip.file(`${id}.pdf`, response.data, { binary: true });
}
const zipStream = zip.generateNodeStream({ streamFiles: true });
From cdf0951a1b9106015ffcf187d4c3da96e2e889d6 Mon Sep 17 00:00:00 2001
From: pablone
Date: Mon, 18 Sep 2023 10:12:32 +0200
Subject: [PATCH 100/427] refs #6213 newSuplierSpec
---
.../back/models/specs/supplier.spec.js | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js
index f317f1fb9..d75c80558 100644
--- a/modules/supplier/back/models/specs/supplier.spec.js
+++ b/modules/supplier/back/models/specs/supplier.spec.js
@@ -124,4 +124,22 @@ describe('loopback model Supplier', () => {
}
});
});
+
+ describe('after save observer', () => {
+ fit('should update the account attribute when a new supplier is created', async() => {
+ const tx = await models.Supplier.beginTransaction({});
+ const options = {transaction: tx};
+
+ try {
+ const newSupplier = await models.Supplier.create({id: '6969', name: 'Alfred Pennyworth'}, options);
+ const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options);
+
+ expect(fetchedSupplier.account).toEqual('4100006969');
+ await tx.rollback();
+ } catch (e) {
+ await tx.rollback();
+ throw e;
+ }
+ });
+ });
});
From 63068ddfb82b42883935dae84bd2640439a7aa42 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 18 Sep 2023 12:24:26 +0200
Subject: [PATCH 101/427] refs #5660 call and insert
---
db/changes/234001/01-deliveryAssistantACL.sql | 2 ++
1 file changed, 2 insertions(+)
diff --git a/db/changes/234001/01-deliveryAssistantACL.sql b/db/changes/234001/01-deliveryAssistantACL.sql
index bde29d165..9f3caf848 100644
--- a/db/changes/234001/01-deliveryAssistantACL.sql
+++ b/db/changes/234001/01-deliveryAssistantACL.sql
@@ -12,3 +12,5 @@ INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
(SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
+
+CALL account.role_syncPrivileges();
From 3d1ee374c28d71a1a03a68b87f03f7ba4423e6ef Mon Sep 17 00:00:00 2001
From: alexm
Date: Mon, 18 Sep 2023 13:49:45 +0200
Subject: [PATCH 102/427] refs #5673 feat: remove claim_development e2e
---
.../{03_detail.spec.js => 02_detail.spec.js} | 2 +-
e2e/paths/06-claim/02_development.spec.js | 97 -------------------
...action.spec.js => 03_claim_action.spec.js} | 2 +-
...{05_summary.spec.js => 04_summary.spec.js} | 2 +-
...scriptor.spec.js => 05_descriptor.spec.js} | 2 +-
.../{07_note.spec.js => 06_note.spec.js} | 0
6 files changed, 4 insertions(+), 101 deletions(-)
rename e2e/paths/06-claim/{03_detail.spec.js => 02_detail.spec.js} (98%)
delete mode 100644 e2e/paths/06-claim/02_development.spec.js
rename e2e/paths/06-claim/{04_claim_action.spec.js => 03_claim_action.spec.js} (97%)
rename e2e/paths/06-claim/{05_summary.spec.js => 04_summary.spec.js} (98%)
rename e2e/paths/06-claim/{06_descriptor.spec.js => 05_descriptor.spec.js} (97%)
rename e2e/paths/06-claim/{07_note.spec.js => 06_note.spec.js} (100%)
diff --git a/e2e/paths/06-claim/03_detail.spec.js b/e2e/paths/06-claim/02_detail.spec.js
similarity index 98%
rename from e2e/paths/06-claim/03_detail.spec.js
rename to e2e/paths/06-claim/02_detail.spec.js
index ddcfd9302..eb4ac5d71 100644
--- a/e2e/paths/06-claim/03_detail.spec.js
+++ b/e2e/paths/06-claim/02_detail.spec.js
@@ -1,5 +1,5 @@
import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
+import getBrowser from '../../helpers/puppeteer.js';
// #1528 e2e claim/detail
xdescribe('Claim detail', () => {
diff --git a/e2e/paths/06-claim/02_development.spec.js b/e2e/paths/06-claim/02_development.spec.js
deleted file mode 100644
index b7352dcc2..000000000
--- a/e2e/paths/06-claim/02_development.spec.js
+++ /dev/null
@@ -1,97 +0,0 @@
-import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
-
-describe('Claim development', () => {
- let browser;
- let page;
-
- beforeAll(async() => {
- browser = await getBrowser();
- page = browser.page;
- await page.loginAndModule('claimManager', 'claim');
- await page.accessToSearchResult('1');
- await page.accessToSection('claim.card.development');
- });
-
- afterAll(async() => {
- await browser.close();
- });
-
- it('should delete a development and create a new one', async() => {
- await page.waitToClick(selectors.claimDevelopment.firstDeleteDevelopmentButton);
- await page.waitToClick(selectors.claimDevelopment.addDevelopmentButton);
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimReason, 'Baja calidad');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResult, 'Deshidratacion');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResponsible, 'Calidad general');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimWorker, 'deliveryNick');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimRedelivery, 'Reparto');
- await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it(`should redirect to the next section of claims as the role is claimManager`, async() => {
- await page.waitForState('claim.card.action');
- });
-
- it('should edit a development', async() => {
- await page.reloadSection('claim.card.development');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimReason, 'Calor');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResult, 'Cocido');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResponsible, 'Calidad general');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimWorker, 'adminAssistantNick');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimRedelivery, 'Cliente');
- await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
- const message = await page.waitForSnackbar();
-
- expect(message.text).toContain('Data saved!');
- });
-
- it('should confirm the first development is the expected one', async() => {
- await page.reloadSection('claim.card.development');
- const reason = await page
- .waitToGetProperty(selectors.claimDevelopment.firstClaimReason, 'value');
-
- const result = await page
- .waitToGetProperty(selectors.claimDevelopment.firstClaimResult, 'value');
-
- const responsible = await page
- .waitToGetProperty(selectors.claimDevelopment.firstClaimResponsible, 'value');
-
- const worker = await page
- .waitToGetProperty(selectors.claimDevelopment.firstClaimWorker, 'value');
-
- const redelivery = await page
- .waitToGetProperty(selectors.claimDevelopment.firstClaimRedelivery, 'value');
-
- expect(reason).toEqual('Calor');
- expect(result).toEqual('Baboso/Cocido');
- expect(responsible).toEqual('Calidad general');
- expect(worker).toEqual('adminAssistantNick');
- expect(redelivery).toEqual('Cliente');
- });
-
- it('should confirm the second development is the expected one', async() => {
- const reason = await page
- .waitToGetProperty(selectors.claimDevelopment.secondClaimReason, 'value');
-
- const result = await page
- .waitToGetProperty(selectors.claimDevelopment.secondClaimResult, 'value');
-
- const responsible = await page
- .waitToGetProperty(selectors.claimDevelopment.secondClaimResponsible, 'value');
-
- const worker = await page
- .waitToGetProperty(selectors.claimDevelopment.secondClaimWorker, 'value');
-
- const redelivery = await page
- .waitToGetProperty(selectors.claimDevelopment.secondClaimRedelivery, 'value');
-
- expect(reason).toEqual('Baja calidad');
- expect(result).toEqual('Deshidratacion');
- expect(responsible).toEqual('Calidad general');
- expect(worker).toEqual('deliveryNick');
- expect(redelivery).toEqual('Reparto');
- });
-});
diff --git a/e2e/paths/06-claim/04_claim_action.spec.js b/e2e/paths/06-claim/03_claim_action.spec.js
similarity index 97%
rename from e2e/paths/06-claim/04_claim_action.spec.js
rename to e2e/paths/06-claim/03_claim_action.spec.js
index 62a0ac232..ac6f72e37 100644
--- a/e2e/paths/06-claim/04_claim_action.spec.js
+++ b/e2e/paths/06-claim/03_claim_action.spec.js
@@ -1,5 +1,5 @@
import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
+import getBrowser from '../../helpers/puppeteer.js';
describe('Claim action path', () => {
let browser;
diff --git a/e2e/paths/06-claim/05_summary.spec.js b/e2e/paths/06-claim/04_summary.spec.js
similarity index 98%
rename from e2e/paths/06-claim/05_summary.spec.js
rename to e2e/paths/06-claim/04_summary.spec.js
index 1333ed01a..dda8484a6 100644
--- a/e2e/paths/06-claim/05_summary.spec.js
+++ b/e2e/paths/06-claim/04_summary.spec.js
@@ -1,6 +1,6 @@
import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
+import getBrowser from '../../helpers/puppeteer.js';
describe('Claim summary path', () => {
let browser;
diff --git a/e2e/paths/06-claim/06_descriptor.spec.js b/e2e/paths/06-claim/05_descriptor.spec.js
similarity index 97%
rename from e2e/paths/06-claim/06_descriptor.spec.js
rename to e2e/paths/06-claim/05_descriptor.spec.js
index 059bd68dd..49912b26a 100644
--- a/e2e/paths/06-claim/06_descriptor.spec.js
+++ b/e2e/paths/06-claim/05_descriptor.spec.js
@@ -1,5 +1,5 @@
import selectors from '../../helpers/selectors.js';
-import getBrowser from '../../helpers/puppeteer';
+import getBrowser from '../../helpers/puppeteer.js';
describe('Claim descriptor path', () => {
let browser;
diff --git a/e2e/paths/06-claim/07_note.spec.js b/e2e/paths/06-claim/06_note.spec.js
similarity index 100%
rename from e2e/paths/06-claim/07_note.spec.js
rename to e2e/paths/06-claim/06_note.spec.js
From 747ba0124c988287192526635cc3f5b4be3d2776 Mon Sep 17 00:00:00 2001
From: pablone
Date: Mon, 18 Sep 2023 13:53:56 +0200
Subject: [PATCH 103/427] refs #4131 dumpedFixtures
---
db/dump/dumpedFixtures.sql | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 5ff2e03ef..2e1511b59 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -164,7 +164,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','state','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryBoss'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryBoss'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'),(569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryBoss'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryBoss'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryBoss'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryBoss'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'),(655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'),(656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'),(657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'),(658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'),(659,'Account','*','*','ALLOW','ROLE','itManagement'),(660,'Account','*','READ','ALLOW','ROLE','employee'),(664,'MailForward','*','*','ALLOW','ROLE','itManagement'),(665,'Role','*','READ','ALLOW','ROLE','employee'),(666,'Role','*','WRITE','ALLOW','ROLE','it'),(667,'VnUser','*','*','ALLOW','ROLE','itManagement'),(668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'),(669,'VnUser','preview','*','ALLOW','ROLE','employee'),(670,'VnUser','create','*','ALLOW','ROLE','itManagement'),(671,'VnUser','renewToken','WRITE','ALLOW','ROLE','employee'),(672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'),(673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),(674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'),(676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'),(680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'),(681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'),(682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'),(683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'),(684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'),(685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'),(686,'MailForward','*','*','ALLOW','ROLE','hr'),(687,'ClientSms','find','READ','ALLOW','ROLE','employee'),(688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'),(689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'),(690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss'),(691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'),(692,'ExpeditionTruck','*','*','ALLOW','ROLE','palletizerBoss'),(693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'),(694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss'),(695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'),(696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'),(697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'),(698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'),(699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'),(701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryBoss'),(702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson');
+INSERT INTO `ACL` VALUES (3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','logisticBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','find','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','READ','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'),(439,'NotificationSubscription','*','*','ALLOW','ROLE','employee'),(440,'NotificationAcl','*','READ','ALLOW','ROLE','employee'),(441,'MdbApp','*','READ','ALLOW','ROLE','$everyone'),(442,'MdbApp','*','*','ALLOW','ROLE','developer'),(443,'ItemConfig','*','*','ALLOW','ROLE','employee'),(444,'DeviceProduction','*','*','ALLOW','ROLE','hr'),(445,'DeviceProductionModels','*','*','ALLOW','ROLE','hr'),(446,'DeviceProductionState','*','*','ALLOW','ROLE','hr'),(447,'DeviceProductionUser','*','*','ALLOW','ROLE','hr'),(448,'DeviceProduction','*','*','ALLOW','ROLE','productionAssi'),(449,'DeviceProductionModels','*','*','ALLOW','ROLE','productionAssi'),(450,'DeviceProductionState','*','*','ALLOW','ROLE','productionAssi'),(451,'DeviceProductionUser','*','*','ALLOW','ROLE','productionAssi'),(452,'Worker','deallocatePDA','*','ALLOW','ROLE','hr'),(453,'Worker','allocatePDA','*','ALLOW','ROLE','hr'),(454,'Worker','deallocatePDA','*','ALLOW','ROLE','productionAssi'),(455,'Worker','allocatePDA','*','ALLOW','ROLE','productionAssi'),(456,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(457,'Account','setPassword','WRITE','ALLOW','ROLE','itManagement'),(458,'Operator','*','READ','ALLOW','ROLE','employee'),(459,'Operator','*','WRITE','ALLOW','ROLE','employee'),(460,'InvoiceIn','getSerial','READ','ALLOW','ROLE','administrative'),(461,'Ticket','saveSign','WRITE','ALLOW','ROLE','employee'),(462,'InvoiceOut','negativeBases','READ','ALLOW','ROLE','administrative'),(463,'InvoiceOut','negativeBasesCsv','READ','ALLOW','ROLE','administrative'),(464,'WorkerObservation','*','*','ALLOW','ROLE','hr'),(465,'ClientInforma','*','READ','ALLOW','ROLE','employee'),(466,'ClientInforma','*','WRITE','ALLOW','ROLE','financial'),(467,'Receipt','receiptEmail','*','ALLOW','ROLE','salesAssistant'),(468,'Client','setRating','WRITE','ALLOW','ROLE','financial'),(469,'Client','*','READ','ALLOW','ROLE','employee'),(470,'Client','addressesPropagateRe','*','ALLOW','ROLE','employee'),(471,'Client','canBeInvoiced','*','ALLOW','ROLE','employee'),(472,'Client','canCreateTicket','*','ALLOW','ROLE','employee'),(473,'Client','consumption','*','ALLOW','ROLE','employee'),(474,'Client','createAddress','*','ALLOW','ROLE','employee'),(475,'Client','createWithUser','*','ALLOW','ROLE','employee'),(476,'Client','extendedListFilter','*','ALLOW','ROLE','employee'),(477,'Client','getAverageInvoiced','*','ALLOW','ROLE','employee'),(478,'Client','getCard','*','ALLOW','ROLE','employee'),(479,'Client','getDebt','*','ALLOW','ROLE','employee'),(480,'Client','getMana','*','ALLOW','ROLE','employee'),(481,'Client','transactions','*','ALLOW','ROLE','employee'),(482,'Client','hasCustomerRole','*','ALLOW','ROLE','employee'),(483,'Client','isValidClient','*','ALLOW','ROLE','employee'),(484,'Client','lastActiveTickets','*','ALLOW','ROLE','employee'),(485,'Client','sendSms','*','ALLOW','ROLE','employee'),(486,'Client','setPassword','*','ALLOW','ROLE','employee'),(487,'Client','summary','*','ALLOW','ROLE','employee'),(488,'Client','updateAddress','*','ALLOW','ROLE','employee'),(489,'Client','updateFiscalData','*','ALLOW','ROLE','employee'),(491,'Client','uploadFile','*','ALLOW','ROLE','employee'),(492,'Client','campaignMetricsPdf','*','ALLOW','ROLE','employee'),(493,'Client','campaignMetricsEmail','*','ALLOW','ROLE','employee'),(494,'Client','clientWelcomeHtml','*','ALLOW','ROLE','employee'),(495,'Client','clientWelcomeEmail','*','ALLOW','ROLE','employee'),(496,'Client','printerSetupHtml','*','ALLOW','ROLE','employee'),(497,'Client','printerSetupEmail','*','ALLOW','ROLE','employee'),(498,'Client','sepaCoreEmail','*','ALLOW','ROLE','employee'),(499,'Client','letterDebtorPdf','*','ALLOW','ROLE','employee'),(500,'Client','letterDebtorStHtml','*','ALLOW','ROLE','employee'),(501,'Client','letterDebtorStEmail','*','ALLOW','ROLE','employee'),(502,'Client','letterDebtorNdHtml','*','ALLOW','ROLE','employee'),(503,'Client','letterDebtorNdEmail','*','ALLOW','ROLE','employee'),(504,'Client','clientDebtStatementPdf','*','ALLOW','ROLE','employee'),(505,'Client','clientDebtStatementHtml','*','ALLOW','ROLE','employee'),(506,'Client','clientDebtStatementEmail','*','ALLOW','ROLE','employee'),(507,'Client','creditRequestPdf','*','ALLOW','ROLE','employee'),(508,'Client','creditRequestHtml','*','ALLOW','ROLE','employee'),(509,'Client','creditRequestEmail','*','ALLOW','ROLE','employee'),(510,'Client','incotermsAuthorizationPdf','*','ALLOW','ROLE','employee'),(511,'Client','incotermsAuthorizationHtml','*','ALLOW','ROLE','employee'),(512,'Client','incotermsAuthorizationEmail','*','ALLOW','ROLE','employee'),(513,'Client','consumptionSendQueued','*','ALLOW','ROLE','employee'),(514,'Client','filter','*','ALLOW','ROLE','employee'),(515,'Client','getClientOrSupplierReference','*','ALLOW','ROLE','employee'),(516,'Client','upsert','*','ALLOW','ROLE','employee'),(517,'Client','create','*','ALLOW','ROLE','employee'),(518,'Client','replaceById','*','ALLOW','ROLE','employee'),(519,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(520,'Client','updateAttributes','*','ALLOW','ROLE','employee'),(521,'Client','deleteById','*','ALLOW','ROLE','employee'),(522,'Client','replaceOrCreate','*','ALLOW','ROLE','employee'),(523,'Client','updateAll','*','ALLOW','ROLE','employee'),(524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee'),(525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee'),(527,'VnUser','acl','READ','ALLOW','ROLE','account'),(528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),(530,'Account','exists','READ','ALLOW','ROLE','account'),(531,'Account','exists','READ','ALLOW','ROLE','account'),(532,'UserLog','*','READ','ALLOW','ROLE','employee'),(533,'RoleLog','*','READ','ALLOW','ROLE','employee'),(534,'WagonType','*','*','ALLOW','ROLE','productionAssi'),(535,'WagonTypeColor','*','*','ALLOW','ROLE','productionAssi'),(536,'WagonTypeTray','*','*','ALLOW','ROLE','productionAssi'),(537,'WagonConfig','*','*','ALLOW','ROLE','productionAssi'),(538,'CollectionWagon','*','*','ALLOW','ROLE','productionAssi'),(539,'CollectionWagonTicket','*','*','ALLOW','ROLE','productionAssi'),(540,'Wagon','*','*','ALLOW','ROLE','productionAssi'),(541,'WagonType','createWagonType','*','ALLOW','ROLE','productionAssi'),(542,'WagonType','deleteWagonType','*','ALLOW','ROLE','productionAssi'),(543,'WagonType','editWagonType','*','ALLOW','ROLE','productionAssi'),(544,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(545,'Agency','find','READ','ALLOW','ROLE','employee'),(546,'Agency','seeExpired','READ','ALLOW','ROLE','coolerAssist'),(547,'WorkerLog','models','READ','ALLOW','ROLE','hr'),(548,'Ticket','editDiscount','WRITE','ALLOW','ROLE','claimManager'),(549,'Ticket','editDiscount','WRITE','ALLOW','ROLE','salesPerson'),(550,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','salesAssistant'),(551,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','deliveryBoss'),(552,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','buyer'),(553,'Ticket','isRoleAdvanced','*','ALLOW','ROLE','claimManager'),(554,'Ticket','deleteTicketWithPartPrepared','WRITE','ALLOW','ROLE','salesAssistant'),(555,'Ticket','editZone','WRITE','ALLOW','ROLE','deliveryBoss'),(556,'State','editableStates','READ','ALLOW','ROLE','employee'),(557,'State','seeEditableStates','READ','ALLOW','ROLE','administrative'),(558,'State','seeEditableStates','READ','ALLOW','ROLE','production'),(559,'State','isSomeEditable','READ','ALLOW','ROLE','salesPerson'),(560,'State','isAllEditable','READ','ALLOW','ROLE','production'),(561,'State','isAllEditable','READ','ALLOW','ROLE','administrative'),(562,'Agency','seeExpired','READ','ALLOW','ROLE','administrative'),(563,'Agency','seeExpired','READ','ALLOW','ROLE','productionBoss'),(564,'Claim','createAfterDeadline','WRITE','ALLOW','ROLE','claimManager'),(565,'Client','editAddressLogifloraAllowed','WRITE','ALLOW','ROLE','salesAssistant'),(566,'Client','editFiscalDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(567,'Client','editVerifiedDataWithoutTaxDataCheck','WRITE','ALLOW','ROLE','salesAssistant'),(568,'Client','editCredit','WRITE','ALLOW','ROLE','financialBoss'),(569,'Client','zeroCreditEditor','WRITE','ALLOW','ROLE','financialBoss'),(570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE','invoicing'),(571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial'),(572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss'),(573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr'),(574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager'),(575,'Claim','find','READ','ALLOW','ROLE','salesPerson'),(576,'Claim','findById','READ','ALLOW','ROLE','salesPerson'),(577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson'),(578,'Claim','getSummary','READ','ALLOW','ROLE','salesPerson'),(579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson'),(580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager'),(581,'Claim','updateClaimDestination','WRITE','ALLOW','ROLE','claimManager'),(582,'Claim','downloadFile','READ','ALLOW','ROLE','claimManager'),(583,'Claim','deleteById','WRITE','ALLOW','ROLE','claimManager'),(584,'Claim','filter','READ','ALLOW','ROLE','salesPerson'),(585,'Claim','logs','READ','ALLOW','ROLE','claimManager'),(586,'Ticket','find','READ','ALLOW','ROLE','employee'),(587,'Ticket','findById','READ','ALLOW','ROLE','employee'),(588,'Ticket','findOne','READ','ALLOW','ROLE','employee'),(589,'Ticket','getVolume','READ','ALLOW','ROLE','employee'),(590,'Ticket','getTotalVolume','READ','ALLOW','ROLE','employee'),(591,'Ticket','summary','READ','ALLOW','ROLE','employee'),(592,'Ticket','priceDifference','READ','ALLOW','ROLE','employee'),(593,'Ticket','componentUpdate','WRITE','ALLOW','ROLE','employee'),(594,'Ticket','new','WRITE','ALLOW','ROLE','employee'),(595,'Ticket','isEditable','READ','ALLOW','ROLE','employee'),(596,'Ticket','setDeleted','WRITE','ALLOW','ROLE','salesPerson'),(597,'Ticket','restore','WRITE','ALLOW','ROLE','employee'),(598,'Ticket','getSales','READ','ALLOW','ROLE','employee'),(599,'Ticket','getSalesPersonMana','READ','ALLOW','ROLE','employee'),(600,'Ticket','filter','READ','ALLOW','ROLE','employee'),(601,'Ticket','makeInvoice','WRITE','ALLOW','ROLE','employee'),(602,'Ticket','updateEditableTicket','WRITE','ALLOW','ROLE','employee'),(603,'Ticket','updateDiscount','WRITE','ALLOW','ROLE','employee'),(604,'Ticket','transferSales','WRITE','ALLOW','ROLE','employee'),(605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employee'),(606,'Ticket','isLocked','READ','ALLOW','ROLE','employee'),(607,'Ticket','freightCost','READ','ALLOW','ROLE','employee'),(608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee'),(609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery'),(610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee'),(611,'State','find','READ','ALLOW','ROLE','employee'),(612,'State','findById','READ','ALLOW','ROLE','employee'),(613,'State','findOne','READ','ALLOW','ROLE','employee'),(614,'Worker','find','READ','ALLOW','ROLE','employee'),(615,'Worker','findById','READ','ALLOW','ROLE','employee'),(616,'Worker','findOne','READ','ALLOW','ROLE','employee'),(617,'Worker','filter','READ','ALLOW','ROLE','employee'),(618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee'),(619,'Worker','active','READ','ALLOW','ROLE','employee'),(620,'Worker','activeWithRole','READ','ALLOW','ROLE','employee'),(621,'Worker','uploadFile','WRITE','ALLOW','ROLE','hr'),(622,'Worker','contracts','READ','ALLOW','ROLE','employee'),(623,'Worker','holidays','READ','ALLOW','ROLE','employee'),(624,'Worker','activeContract','READ','ALLOW','ROLE','employee'),(625,'Worker','activeWithInheritedRole','READ','ALLOW','ROLE','employee'),(626,'Ticket','collectionLabel','READ','ALLOW','ROLE','employee'),(628,'Ticket','expeditionPalletLabel','READ','ALLOW','ROLE','employee'),(629,'Ticket','editDiscount','WRITE','ALLOW','ROLE','artificialBoss'),(630,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesTeamBoss'),(635,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','administrative'),(636,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','salesPerson'),(637,'Claim','downloadFile','READ','ALLOW','ROLE','salesPerson'),(638,'Agency','seeExpired','READ','ALLOW','ROLE','artificialBoss'),(639,'Agency','seeExpired','READ','ALLOW','ROLE','logisticAssistant'),(640,'Claim','filter','READ','ALLOW','ROLE','buyer'),(641,'Claim','find','READ','ALLOW','ROLE','buyer'),(642,'Claim','findById','READ','ALLOW','ROLE','buyer'),(643,'Claim','getSummary','READ','ALLOW','ROLE','buyer'),(644,'Claim','filter','READ','ALLOW','ROLE','handmadeBoss'),(645,'Claim','find','READ','ALLOW','ROLE','handmadeBoss'),(646,'Claim','findById','READ','ALLOW','ROLE','handmadeBoss'),(647,'Claim','getSummary','READ','ALLOW','ROLE','handmadeBoss'),(648,'Claim','__get__lines','READ','ALLOW','ROLE','claimManager'),(649,'Claim','__get__lines','READ','ALLOW','ROLE','salesPerson'),(650,'Claim','getSummary','READ','ALLOW','ROLE','deliveryBoss'),(651,'Claim','findById','READ','ALLOW','ROLE','deliveryBoss'),(652,'Claim','find','READ','ALLOW','ROLE','deliveryBoss'),(653,'Claim','filter','READ','ALLOW','ROLE','deliveryBoss'),(654,'Ticket','editZone','WRITE','ALLOW','ROLE','logisticAssistant'),(655,'Entry','addFromPackaging','WRITE','ALLOW','ROLE','production'),(656,'Entry','addFromBuy','WRITE','ALLOW','ROLE','production'),(657,'Supplier','getItemsPackaging','READ','ALLOW','ROLE','production'),(658,'Ticket','closeAll','WRITE','ALLOW','ROLE','system'),(659,'Account','*','*','ALLOW','ROLE','itManagement'),(660,'Account','*','READ','ALLOW','ROLE','employee'),(664,'MailForward','*','*','ALLOW','ROLE','itManagement'),(665,'Role','*','READ','ALLOW','ROLE','employee'),(666,'Role','*','WRITE','ALLOW','ROLE','it'),(667,'VnUser','*','*','ALLOW','ROLE','itManagement'),(668,'VnUser','__get__preview','READ','ALLOW','ROLE','employee'),(669,'VnUser','preview','*','ALLOW','ROLE','employee'),(670,'VnUser','create','*','ALLOW','ROLE','itManagement'),(671,'VnUser','renewToken','WRITE','ALLOW','ROLE','employee'),(672,'PackingSiteAdvanced','*','*','ALLOW','ROLE','production'),(673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),(674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing'),(676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee'),(680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'),(681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'),(682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'),(683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'),(684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'),(685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'),(686,'MailForward','*','*','ALLOW','ROLE','hr'),(687,'ClientSms','find','READ','ALLOW','ROLE','employee'),(688,'ClientSms','create','WRITE','ALLOW','ROLE','employee'),(689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee'),(690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss'),(691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'),(692,'ExpeditionTruck','*','*','ALLOW','ROLE','palletizerBoss'),(693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'),(694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss'),(695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'),(696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'),(697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'),(698,'Ticket','canEditWeekly','WRITE','ALLOW','ROLE','buyer'),(699,'TicketSms','find','READ','ALLOW','ROLE','salesPerson'),(701,'Docuware','upload','WRITE','ALLOW','ROLE','deliveryBoss'),(702,'Ticket','docuwareDownload','READ','ALLOW','ROLE','salesPerson');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
From aef34165d276edad2e12556d43ea2fad276f7c7c Mon Sep 17 00:00:00 2001
From: pablone
Date: Mon, 18 Sep 2023 13:57:17 +0200
Subject: [PATCH 104/427] refs #4131 reverse claim changes
---
front/core/directives/anchor.js | 4 ++--
modules/claim/front/summary/index.html | 2 +-
modules/claim/front/summary/index.js | 2 +-
modules/claim/front/summary/index.spec.js | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/front/core/directives/anchor.js b/front/core/directives/anchor.js
index 81e252e04..b460b3ada 100644
--- a/front/core/directives/anchor.js
+++ b/front/core/directives/anchor.js
@@ -8,7 +8,7 @@ export function stringifyParams(data) {
return params;
}
-export function state($state, event, data) {
+export function changeState($state, event, data) {
const params = stringifyParams(data);
$state.go(data.state, params);
@@ -53,7 +53,7 @@ export function directive($state, $window) {
if (ctrlPressed || data.target == '_blank')
openNewTab($state, $window, event, data);
else
- state($state, event, data);
+ changeState($state, event, data);
});
$element.on('mousedown', event => {
diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html
index 877a8c0f2..3115cb451 100644
--- a/modules/claim/front/summary/index.html
+++ b/modules/claim/front/summary/index.html
@@ -21,7 +21,7 @@
value-field="id"
show-field="description"
url="claimStates"
- on-change="$ctrl.state(value)">
+ on-change="$ctrl.changeState(value)">
diff --git a/modules/claim/front/summary/index.js b/modules/claim/front/summary/index.js
index f1310c298..7cd4805e9 100644
--- a/modules/claim/front/summary/index.js
+++ b/modules/claim/front/summary/index.js
@@ -71,7 +71,7 @@ class Controller extends Summary {
return this.vnFile.getPath(`/api/dms/${dmsId}/downloadFile`);
}
- state(value) {
+ changeState(value) {
const params = {
id: this.claim.id,
claimStateFk: value
diff --git a/modules/claim/front/summary/index.spec.js b/modules/claim/front/summary/index.spec.js
index 04a270c5f..8540a3a97 100644
--- a/modules/claim/front/summary/index.spec.js
+++ b/modules/claim/front/summary/index.spec.js
@@ -28,14 +28,14 @@ describe('Claim', () => {
});
});
- describe('state()', () => {
+ describe('changeState()', () => {
it('should make an HTTP post query, then call the showSuccess()', () => {
jest.spyOn(controller.vnApp, 'showSuccess').mockReturnThis();
const expectedParams = {id: 1, claimStateFk: 1};
$httpBackend.when('GET', `Claims/1/getSummary`).respond(200, 24);
$httpBackend.expect('PATCH', `Claims/updateClaim/1`, expectedParams).respond(200);
- controller.state(1);
+ controller.changeState(1);
$httpBackend.flush();
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
From 90b3107537db966d037d727b6593e838e2dcb340 Mon Sep 17 00:00:00 2001
From: pablone
Date: Tue, 19 Sep 2023 07:07:52 +0200
Subject: [PATCH 105/427] refs #4131 grant and revoke
---
db/changes/233801/00-ACLticketTrackingState.sql | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/db/changes/233801/00-ACLticketTrackingState.sql b/db/changes/233801/00-ACLticketTrackingState.sql
index a0e3824db..ddd838e7e 100644
--- a/db/changes/233801/00-ACLticketTrackingState.sql
+++ b/db/changes/233801/00-ACLticketTrackingState.sql
@@ -1,3 +1,11 @@
UPDATE `salix`.`ACL`
SET property = 'state'
- WHERE property = 'changeState';
\ No newline at end of file
+ WHERE property = 'changeState';
+
+REVOKE INSERT, UPDATE, DELETE ON `vn`.`ticketTracking` FROM 'productionboss'@;
+REVOKE INSERT, UPDATE, DELETE ON `vn`.`ticketTracking` FROM 'productionAssi'@;
+REVOKE INSERT, UPDATE, DELETE ON `vn`.`ticketTracking` FROM 'hr'@;
+REVOKE INSERT, UPDATE, DELETE ON `vn`.`ticketTracking` FROM 'salesPerson'@;
+REVOKE INSERT, UPDATE, DELETE ON `vn`.`ticketTracking` FROM 'deliveryPerson'@;
+REVOKE INSERT, UPDATE, DELETE ON `vn`.`ticketTracking` FROM 'employee'@;
+REVOKE EXECUTE ON `vn`.`ticket_setState` FROM 'employee'@;
From 361c2b4cad3cfccaddb2d012055ecd72ed10a77d Mon Sep 17 00:00:00 2001
From: pablone
Date: Tue, 19 Sep 2023 07:33:27 +0200
Subject: [PATCH 106/427] refs #6213 fixSpec
---
.../{233801 => 234001}/00-supplierAccountCheckLength.sql | 0
modules/supplier/back/models/specs/supplier.spec.js | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
rename db/changes/{233801 => 234001}/00-supplierAccountCheckLength.sql (100%)
diff --git a/db/changes/233801/00-supplierAccountCheckLength.sql b/db/changes/234001/00-supplierAccountCheckLength.sql
similarity index 100%
rename from db/changes/233801/00-supplierAccountCheckLength.sql
rename to db/changes/234001/00-supplierAccountCheckLength.sql
diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js
index d75c80558..043399dc9 100644
--- a/modules/supplier/back/models/specs/supplier.spec.js
+++ b/modules/supplier/back/models/specs/supplier.spec.js
@@ -126,12 +126,12 @@ describe('loopback model Supplier', () => {
});
describe('after save observer', () => {
- fit('should update the account attribute when a new supplier is created', async() => {
+ it('should update the account attribute when a new supplier is created', async() => {
const tx = await models.Supplier.beginTransaction({});
const options = {transaction: tx};
try {
- const newSupplier = await models.Supplier.create({id: '6969', name: 'Alfred Pennyworth'}, options);
+ const newSupplier = await models.Supplier.create({id: '9999', name: 'Alfred Pennyworth'}, options);
const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options);
expect(fetchedSupplier.account).toEqual('4100006969');
From 971d77a198148582d8411d5eee04c34760eba906 Mon Sep 17 00:00:00 2001
From: pablone
Date: Tue, 19 Sep 2023 07:46:44 +0200
Subject: [PATCH 107/427] refs #6213 specChangeId
---
modules/supplier/back/models/specs/supplier.spec.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js
index 043399dc9..9dd84d9fa 100644
--- a/modules/supplier/back/models/specs/supplier.spec.js
+++ b/modules/supplier/back/models/specs/supplier.spec.js
@@ -134,7 +134,7 @@ describe('loopback model Supplier', () => {
const newSupplier = await models.Supplier.create({id: '9999', name: 'Alfred Pennyworth'}, options);
const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options);
- expect(fetchedSupplier.account).toEqual('4100006969');
+ expect(fetchedSupplier.account).toEqual('4100009999');
await tx.rollback();
} catch (e) {
await tx.rollback();
From 9524ff69320c1b3e806406211472f75f6178fcf0 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 19 Sep 2023 11:02:12 +0200
Subject: [PATCH 108/427] refs #5660 fix sql
---
db/changes/234001/01-deliveryAssistantACL.sql | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/db/changes/234001/01-deliveryAssistantACL.sql b/db/changes/234001/01-deliveryAssistantACL.sql
index 9f3caf848..44459c432 100644
--- a/db/changes/234001/01-deliveryAssistantACL.sql
+++ b/db/changes/234001/01-deliveryAssistantACL.sql
@@ -13,4 +13,4 @@ INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
(SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
-CALL account.role_syncPrivileges();
+CALL `account`.`role_syncPrivileges`();
From 661563a2b6a0fe9bf8689170b81b54e95b129087 Mon Sep 17 00:00:00 2001
From: guillermo
Date: Tue, 19 Sep 2023 12:14:55 +0200
Subject: [PATCH 109/427] refs #6210 Refactor filter client (zoneFk)
---
modules/client/back/methods/client/filter.js | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/client/back/methods/client/filter.js b/modules/client/back/methods/client/filter.js
index 3bf29501b..d7d1450ab 100644
--- a/modules/client/back/methods/client/filter.js
+++ b/modules/client/back/methods/client/filter.js
@@ -80,10 +80,15 @@ module.exports = Self => {
Object.assign(myOptions, options);
if (args.zoneFk) {
- query = `CALL vn.zone_getPostalCode(?)`;
- const [geos] = await Self.rawSql(query, [args.zoneFk]);
- for (let geo of geos)
- postalCode.push(geo.name);
+ let stmts = [];
+ stmts.push(new ParameterizedSQL('CALL vn.zone_getPostalCode(?)', [ args.zoneFk]));
+ stmts.push(`SELECT name FROM tmp.zoneNodes`);
+ stmts.push(`DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes`);
+ const sql = ParameterizedSQL.join(stmts, ';');
+ const [results] = await conn.executeStmt(sql);
+
+ for (let result of results)
+ postalCode.push(result.name);
}
const where = buildFilter(ctx.args, (param, value) => {
From 77b55e5b0947cd14d855326ba12a6260bbd671a5 Mon Sep 17 00:00:00 2001
From: guillermo
Date: Tue, 19 Sep 2023 12:15:23 +0200
Subject: [PATCH 110/427] refs #6210 Minor change
---
modules/client/back/methods/client/filter.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/client/back/methods/client/filter.js b/modules/client/back/methods/client/filter.js
index d7d1450ab..c109ea5b7 100644
--- a/modules/client/back/methods/client/filter.js
+++ b/modules/client/back/methods/client/filter.js
@@ -81,7 +81,7 @@ module.exports = Self => {
if (args.zoneFk) {
let stmts = [];
- stmts.push(new ParameterizedSQL('CALL vn.zone_getPostalCode(?)', [ args.zoneFk]));
+ stmts.push(new ParameterizedSQL('CALL vn.zone_getPostalCode(?)', [args.zoneFk]));
stmts.push(`SELECT name FROM tmp.zoneNodes`);
stmts.push(`DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes`);
const sql = ParameterizedSQL.join(stmts, ';');
From 2686fd0601aca0b92d6635c355005c0836d938bd Mon Sep 17 00:00:00 2001
From: guillermo
Date: Tue, 19 Sep 2023 12:18:46 +0200
Subject: [PATCH 111/427] refs #6210 Minor change
---
modules/client/back/methods/client/filter.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/client/back/methods/client/filter.js b/modules/client/back/methods/client/filter.js
index c109ea5b7..eaf4ecf30 100644
--- a/modules/client/back/methods/client/filter.js
+++ b/modules/client/back/methods/client/filter.js
@@ -83,7 +83,7 @@ module.exports = Self => {
let stmts = [];
stmts.push(new ParameterizedSQL('CALL vn.zone_getPostalCode(?)', [args.zoneFk]));
stmts.push(`SELECT name FROM tmp.zoneNodes`);
- stmts.push(`DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes`);
+ stmts.push(`DROP TEMPORARY TABLE tmp.zoneNodes`);
const sql = ParameterizedSQL.join(stmts, ';');
const [results] = await conn.executeStmt(sql);
From 45cf1b1ff313287560ea3bf16803196033ccd7e5 Mon Sep 17 00:00:00 2001
From: jgallego
Date: Wed, 20 Sep 2023 08:12:07 +0200
Subject: [PATCH 112/427] fixes #6241 dbTest fixed
---
db/dump/fixtures.sql | 4 +-
db/tests/vn/item_getBalance.spec.js | 6 +--
db/tests/vn/logAddWithUser.spec.js | 42 -------------------
.../vn/timeControl_calculateByUser.spec.js | 24 ++---------
db/tests/vn/zone_getFromGeo.spec.js | 2 +-
.../05-ticket/06_basic_data_steps.spec.js | 2 +-
.../methods/sale/specs/updatePrice.spec.js | 2 +-
7 files changed, 12 insertions(+), 70 deletions(-)
delete mode 100644 db/tests/vn/logAddWithUser.spec.js
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 9187e2871..78b0967b9 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -1013,7 +1013,7 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
(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.44, 0, 0, 0, util.VN_CURDATE()),
+ (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()),
@@ -2973,4 +2973,4 @@ INSERT INTO vn.XDiario (id, ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EU
(3, 1.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T3333333 Tony Stark', NULL, 0.81, 8.07, 'T', '3333333', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1),
(4, 2.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T4444444', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(5, 2.0, util.VN_CURDATE(), '2000000000', '4300001104', 'n/fra T4444444 Tony Stark', NULL, 8.07, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
- (6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
\ No newline at end of file
+ (6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
diff --git a/db/tests/vn/item_getBalance.spec.js b/db/tests/vn/item_getBalance.spec.js
index 2e24d5ce7..74e1e6659 100644
--- a/db/tests/vn/item_getBalance.spec.js
+++ b/db/tests/vn/item_getBalance.spec.js
@@ -6,13 +6,13 @@ describe('item_getBalance()', () => {
let stmts = [];
let params = {
- warehouseFk: 1,
- itemFk: 1
+ itemFk: 1,
+ warehouseFk: 1
};
const conn = await app.models.Item.dataSource.connector;
- stmts.push(new ParameterizedSQL('CALL vn.item_getBalance(?, ?)', [
+ stmts.push(new ParameterizedSQL('CALL vn.item_getBalance(?, ?, NULL)', [
params.warehouseFk,
params.itemFk
]));
diff --git a/db/tests/vn/logAddWithUser.spec.js b/db/tests/vn/logAddWithUser.spec.js
deleted file mode 100644
index 8711769d0..000000000
--- a/db/tests/vn/logAddWithUser.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-const app = require('vn-loopback/server/server');
-const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
-
-describe('logAddWithUser()', () => {
- it('should log any action taken by the user in a table ending in Log', async() => {
- let stmts = [];
- let stmt;
-
- stmts.push('START TRANSACTION');
-
- let params = {
- ticketFk: 1,
- userId: 9,
- actionCode: 'update',
- targetEntity: 'ticket',
- description: 'we are testing stuff'
- };
-
- stmt = new ParameterizedSQL('CALL vn.logAddWithUser(?, ?, ?, ?, ?)', [
- params.ticketFk,
- params.userId,
- params.actionCode,
- params.targetEntity,
- params.description
- ]);
- stmts.push(stmt);
-
- stmt = new ParameterizedSQL('SELECT * FROM vn.ticketLog WHERE description = ?', [
- params.description
- ]);
- let ticketLogIndex = stmts.push(stmt) - 1;
-
- stmts.push('ROLLBACK');
-
- let sql = ParameterizedSQL.join(stmts, ';');
- let result = await app.models.Ticket.rawStmt(sql);
-
- savedDescription = result[ticketLogIndex][0].description;
-
- expect(savedDescription).toEqual(params.description);
- });
-});
diff --git a/db/tests/vn/timeControl_calculateByUser.spec.js b/db/tests/vn/timeControl_calculateByUser.spec.js
index 73e00ec3a..0b385d2c9 100644
--- a/db/tests/vn/timeControl_calculateByUser.spec.js
+++ b/db/tests/vn/timeControl_calculateByUser.spec.js
@@ -14,14 +14,6 @@ describe('timeControl_calculateByUser()', () => {
let stmts = [];
let stmt;
- stmts.push('START TRANSACTION');
-
- stmts.push(`
- DROP TEMPORARY TABLE IF EXISTS
- tmp.timeControlCalculate,
- tmp.timeBusinessCalculate
- `);
-
let params = {
workerID: 1106,
start: start,
@@ -37,17 +29,15 @@ describe('timeControl_calculateByUser()', () => {
let tableIndex = stmts.push('SELECT * FROM tmp.timeControlCalculate') - 1;
- stmts.push('ROLLBACK');
-
let sql = ParameterizedSQL.join(stmts, ';');
let result = await app.models.Ticket.rawStmt(sql);
let [timeControlCalculateTable] = result[tableIndex];
- expect(timeControlCalculateTable.timeWorkSeconds).toEqual(29400);
+ expect(timeControlCalculateTable.timeWorkSeconds).toEqual(28200);
});
-
- it(`should return the worked hours between last sunday and monday`, async() => {
+ // #2261
+ xit(`should return the worked hours between last sunday and monday`, async() => {
let lastSunday = Date.vnNew();
let daysSinceSunday = lastSunday.getDay();
if (daysSinceSunday === 0) // this means today is sunday but you need the previous sunday :)
@@ -65,13 +55,7 @@ describe('timeControl_calculateByUser()', () => {
stmts.push('START TRANSACTION');
- stmts.push(`
- DROP TEMPORARY TABLE IF EXISTS
- tmp.timeControlCalculate,
- tmp.timeBusinessCalculate
- `);
-
- const workerID = 1107;
+ const workerID = 1108;
stmt = new ParameterizedSQL(`
INSERT INTO vn.workerTimeControl(userFk, timed, manual, direction)
diff --git a/db/tests/vn/zone_getFromGeo.spec.js b/db/tests/vn/zone_getFromGeo.spec.js
index 0dccf92cc..74b6e00cc 100644
--- a/db/tests/vn/zone_getFromGeo.spec.js
+++ b/db/tests/vn/zone_getFromGeo.spec.js
@@ -7,7 +7,7 @@ describe('zone zone_getFromGeo()', () => {
let stmt;
stmts.push('START TRANSACTION');
- let geoFk = 17;
+ let geoFk = 16;
stmt = new ParameterizedSQL('CALL zone_getFromGeo(?)', [
geoFk,
diff --git a/e2e/paths/05-ticket/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js
index 55aec45fb..77f0e0459 100644
--- a/e2e/paths/05-ticket/06_basic_data_steps.spec.js
+++ b/e2e/paths/05-ticket/06_basic_data_steps.spec.js
@@ -75,7 +75,7 @@ describe('Ticket Edit basic data path', () => {
const result = await page
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
- expect(result).toContain('-€232.75');
+ expect(result).toContain('-€228.25');
});
it(`should select a new reason for the changes made then click on finalize`, async() => {
diff --git a/modules/ticket/back/methods/sale/specs/updatePrice.spec.js b/modules/ticket/back/methods/sale/specs/updatePrice.spec.js
index 133be8de3..9d1403df0 100644
--- a/modules/ticket/back/methods/sale/specs/updatePrice.spec.js
+++ b/modules/ticket/back/methods/sale/specs/updatePrice.spec.js
@@ -108,7 +108,7 @@ describe('sale updatePrice()', () => {
}}, options);
expect(updatedSale.price).toBe(price);
- expect(createdSaleComponent.value).toEqual(-2.04);
+ expect(createdSaleComponent.value).toEqual(-2.34);
const updatedSalesPersonMana = await models.WorkerMana.findById(18, null, options);
From 4870b0830b720ba609afe4880d2b8f3813759aa6 Mon Sep 17 00:00:00 2001
From: jorgep
Date: Wed, 20 Sep 2023 11:06:30 +0200
Subject: [PATCH 113/427] ref #5914 fix refund and change method name
---
.../00-transferInvoiceACL.sql} | 2 +-
loopback/locale/es.json | 304 +-----------------
.../methods/invoiceOut/transferInvoice.js | 2 +-
modules/invoiceOut/back/models/invoice-out.js | 2 +-
modules/ticket/back/methods/sale/refund.js | 83 +----
5 files changed, 13 insertions(+), 380 deletions(-)
rename db/changes/{233201/00-transferInvoiceOutACL.sql => 233601/00-transferInvoiceACL.sql} (80%)
diff --git a/db/changes/233201/00-transferInvoiceOutACL.sql b/db/changes/233601/00-transferInvoiceACL.sql
similarity index 80%
rename from db/changes/233201/00-transferInvoiceOutACL.sql
rename to db/changes/233601/00-transferInvoiceACL.sql
index 6e8d88c5d..a45e3f479 100644
--- a/db/changes/233201/00-transferInvoiceOutACL.sql
+++ b/db/changes/233601/00-transferInvoiceACL.sql
@@ -3,4 +3,4 @@ INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalTyp
('CplusRectificationType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('CplusInvoiceType477', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('InvoiceCorrectionType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
- ('InvoiceOut', 'transferInvoiceOut', 'WRITE', 'ALLOW', 'ROLE', 'employee');
\ No newline at end of file
+ ('InvoiceOut', 'transferInvoice', 'WRITE', 'ALLOW', 'ROLE', 'employee');
\ No newline at end of file
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index b2c6ae3e9..d436ec197 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -8,7 +8,6 @@
"Invalid email": "Invalid email",
"Phone cannot be blank": "Phone cannot be blank",
"The credit must be an integer greater than or equal to zero": "The credit must be an integer greater than or equal to zero",
-<<<<<<< HEAD
"The grade must be an integer greater than or equal to zero": "The grade must be an integer greater than or equal to zero",
"Description should have maximum of 45 characters": "Description should have maximum of 45 characters",
"Amount cannot be zero": "Amount cannot be zero",
@@ -22,304 +21,5 @@
"State cannot be blank": "State cannot be blank",
"Worker cannot be blank": "Worker cannot be blank",
"Description cannot be blank": "Description cannot be blank",
- "Agency cannot be blank": "Agency cannot be blank",
- "The renew period has not been exceeded": "The renew period has not been exceeded"
-}
-=======
- "The grade must be similar to the last one": "El grade debe ser similar al último",
- "Only manager can change the credit": "Solo el gerente puede cambiar el credito de este cliente",
- "Name cannot be blank": "El nombre no puede estar en blanco",
- "Phone cannot be blank": "El teléfono no puede estar en blanco",
- "Period cannot be blank": "El periodo no puede estar en blanco",
- "Choose a company": "Selecciona una empresa",
- "Se debe rellenar el campo de texto": "Se debe rellenar el campo de texto",
- "Description should have maximum of 45 characters": "La descripción debe tener maximo 45 caracteres",
- "Cannot be blank": "El campo no puede estar en blanco",
- "The grade must be an integer greater than or equal to zero": "El grade debe ser un entero mayor o igual a cero",
- "Sample type cannot be blank": "El tipo de plantilla no puede quedar en blanco",
- "Description cannot be blank": "Se debe rellenar el campo de texto",
- "The new quantity should be smaller than the old one": "La nueva cantidad debe de ser menor que la anterior",
- "The value should not be greater than 100%": "El valor no debe de ser mayor de 100%",
- "The value should be a number": "El valor debe ser un numero",
- "This order is not editable": "Esta orden no se puede modificar",
- "You can't create an order for a frozen client": "No puedes crear una orden para un cliente congelado",
- "You can't create an order for a client that has a debt": "No puedes crear una orden para un cliente con deuda",
- "is not a valid date": "No es una fecha valida",
- "Barcode must be unique": "El código de barras debe ser único",
- "The warehouse can't be repeated": "El almacén no puede repetirse",
- "The tag or priority can't be repeated for an item": "El tag o prioridad no puede repetirse para un item",
- "The observation type can't be repeated": "El tipo de observación no puede repetirse",
- "A claim with that sale already exists": "Ya existe una reclamación para esta línea",
- "You don't have enough privileges to change that field": "No tienes permisos para cambiar ese campo",
- "Warehouse cannot be blank": "El almacén no puede quedar en blanco",
- "Agency cannot be blank": "La agencia no puede quedar en blanco",
- "Not enough privileges to edit a client with verified data": "No tienes permisos para hacer cambios en un cliente con datos comprobados",
- "This address doesn't exist": "Este consignatario no existe",
- "You must delete the claim id %d first": "Antes debes borrar la reclamación %d",
- "You don't have enough privileges": "No tienes suficientes permisos",
- "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF",
- "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos",
- "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ",
- "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado",
- "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo",
- "Tag value cannot be blank": "El valor del tag no puede quedar en blanco",
- "ORDER_EMPTY": "Cesta vacía",
- "You don't have enough privileges to do that": "No tienes permisos para cambiar esto",
- "NO SE PUEDE DESACTIVAR EL CONSIGNAT": "NO SE PUEDE DESACTIVAR EL CONSIGNAT",
- "Error. El NIF/CIF está repetido": "Error. El NIF/CIF está repetido",
- "Street cannot be empty": "Dirección no puede estar en blanco",
- "City cannot be empty": "Cuidad no puede estar en blanco",
- "Code cannot be blank": "Código no puede estar en blanco",
- "You cannot remove this department": "No puedes eliminar este departamento",
- "The extension must be unique": "La extensión debe ser unica",
- "The secret can't be blank": "La contraseña no puede estar en blanco",
- "We weren't able to send this SMS": "No hemos podido enviar el SMS",
- "This client can't be invoiced": "Este cliente no puede ser facturado",
- "This ticket can't be invoiced": "Este ticket no puede ser facturado",
- "You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
- "This ticket can not be modified": "Este ticket no puede ser modificado",
- "The introduced hour already exists": "Esta hora ya ha sido introducida",
- "INFINITE_LOOP": "Existe una dependencia entre dos Jefes",
- "The sales of the receiver ticket can't be modified": "Las lineas del ticket al que envias no pueden ser modificadas",
- "NO_AGENCY_AVAILABLE": "No hay una zona de reparto disponible con estos parámetros",
- "ERROR_PAST_SHIPMENT": "No puedes seleccionar una fecha de envío en pasado",
- "The current ticket can't be modified": "El ticket actual no puede ser modificado",
- "The current claim can't be modified": "La reclamación actual no puede ser modificada",
- "The sales of this ticket can't be modified": "Las lineas de este ticket no pueden ser modificadas",
- "The sales do not exists": "La(s) línea(s) seleccionada(s) no existe(n)",
- "Please select at least one sale": "Por favor selecciona al menos una linea",
- "All sales must belong to the same ticket": "Todas las lineas deben pertenecer al mismo ticket",
- "NO_ZONE_FOR_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
- "This item doesn't exists": "El artículo no existe",
- "NOT_ZONE_WITH_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
- "Extension format is invalid": "El formato de la extensión es inválido",
- "Invalid parameters to create a new ticket": "Parámetros inválidos para crear un nuevo ticket",
- "This item is not available": "Este artículo no está disponible",
- "This postcode already exists": "Este código postal ya existe",
- "Concept cannot be blank": "El concepto no puede quedar en blanco",
- "File doesn't exists": "El archivo no existe",
- "You don't have privileges to change the zone": "No tienes permisos para cambiar la zona o para esos parámetros hay más de una opción de envío, hable con las agencias",
- "This ticket is already on weekly tickets": "Este ticket ya está en tickets programados",
- "Ticket id cannot be blank": "El id de ticket no puede quedar en blanco",
- "Weekday cannot be blank": "El día de la semana no puede quedar en blanco",
- "You can't delete a confirmed order": "No puedes borrar un pedido confirmado",
- "The social name has an invalid format": "El nombre fiscal tiene un formato incorrecto",
- "Invalid quantity": "Cantidad invalida",
- "This postal code is not valid": "This postal code is not valid",
- "is invalid": "is invalid",
- "The postcode doesn't exist. Please enter a correct one": "El código postal no existe. Por favor, introduce uno correcto",
- "The department name can't be repeated": "El nombre del departamento no puede repetirse",
- "This phone already exists": "Este teléfono ya existe",
- "You cannot move a parent to its own sons": "No puedes mover un elemento padre a uno de sus hijos",
- "You can't create a claim for a removed ticket": "No puedes crear una reclamación para un ticket eliminado",
- "You cannot delete a ticket that part of it is being prepared": "No puedes eliminar un ticket en el que una parte que está siendo preparada",
- "You must delete all the buy requests first": "Debes eliminar todas las peticiones de compra primero",
- "You should specify a date": "Debes especificar una fecha",
- "You should specify at least a start or end date": "Debes especificar al menos una fecha de inicio o de fín",
- "Start date should be lower than end date": "La fecha de inicio debe ser menor que la fecha de fín",
- "You should mark at least one week day": "Debes marcar al menos un día de la semana",
- "Swift / BIC can't be empty": "Swift / BIC no puede estar vacío",
- "Customs agent is required for a non UEE member": "El agente de aduanas es requerido para los clientes extracomunitarios",
- "Incoterms is required for a non UEE member": "El incoterms es requerido para los clientes extracomunitarios",
- "Deleted sales from ticket": "He eliminado las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}",
- "Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
- "Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}})",
- "Changed sale quantity": "He cambiado la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}* del ticket [{{ticketId}}]({{{ticketUrl}}})",
- "State": "Estado",
- "regular": "normal",
- "reserved": "reservado",
- "Changed sale reserved state": "He cambiado el estado reservado de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "Bought units from buy request": "Se ha comprado {{quantity}} unidades de [{{itemId}} {{concept}}]({{{urlItem}}}) para el ticket id [{{ticketId}}]({{{url}}})",
- "Deny buy request": "Se ha rechazado la petición de compra para el ticket id [{{ticketId}}]({{{url}}}). Motivo: {{observation}}",
- "MESSAGE_INSURANCE_CHANGE": "He cambiado el crédito asegurado del cliente [{{clientName}} ({{clientId}})]({{{url}}}) a *{{credit}} €*",
- "Changed client paymethod": "He cambiado la forma de pago del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
- "Sent units from ticket": "Envio *{{quantity}}* unidades de [{{concept}} ({{itemId}})]({{{itemUrl}}}) a *\"{{nickname}}\"* provenientes del ticket id [{{ticketId}}]({{{ticketUrl}}})",
- "Change quantity": "{{concept}} cambia de {{oldQuantity}} a {{newQuantity}}",
- "Claim will be picked": "Se recogerá el género de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}*",
- "Claim state has changed to incomplete": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *incompleta*",
- "Claim state has changed to canceled": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *anulado*",
- "Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}",
- "ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto",
- "Distance must be lesser than 1000": "La distancia debe ser inferior a 1000",
- "This ticket is deleted": "Este ticket está eliminado",
- "Unable to clone this travel": "No ha sido posible clonar este travel",
- "This thermograph id already exists": "La id del termógrafo ya existe",
- "Choose a date range or days forward": "Selecciona un rango de fechas o días en adelante",
- "ORDER_ALREADY_CONFIRMED": "ORDER_ALREADY_CONFIRMED",
- "Invalid password": "Invalid password",
- "Password does not meet requirements": "La contraseña no cumple los requisitos",
- "Role already assigned": "Role already assigned",
- "Invalid role name": "Invalid role name",
- "Role name must be written in camelCase": "Role name must be written in camelCase",
- "Email already exists": "Email already exists",
- "User already exists": "User already exists",
- "Absence change notification on the labour calendar": "Notificacion de cambio de ausencia en el calendario laboral",
- "Record of hours week": "Registro de horas semana {{week}} año {{year}} ",
- "Created absence": "El empleado {{author}} ha añadido una ausencia de tipo '{{absenceType}}' a {{employee}} para el día {{dated}}.",
- "Deleted absence": "El empleado {{author}} ha eliminado una ausencia de tipo '{{absenceType}}' a {{employee}} del día {{dated}}.",
- "I have deleted the ticket id": "He eliminado el ticket id [{{id}}]({{{url}}})",
- "I have restored the ticket id": "He restaurado el ticket id [{{id}}]({{{url}}})",
- "You can only restore a ticket within the first hour after deletion": "Únicamente puedes restaurar el ticket dentro de la primera hora después de su eliminación",
- "Changed this data from the ticket": "He cambiado estos datos del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
- "agencyModeFk": "Agencia",
- "clientFk": "Cliente",
- "zoneFk": "Zona",
- "warehouseFk": "Almacén",
- "shipped": "F. envío",
- "landed": "F. entrega",
- "addressFk": "Consignatario",
- "companyFk": "Empresa",
- "The social name cannot be empty": "La razón social no puede quedar en blanco",
- "The nif cannot be empty": "El NIF no puede quedar en blanco",
- "You need to fill sage information before you check verified data": "Debes rellenar la información de sage antes de marcar datos comprobados",
- "ASSIGN_ZONE_FIRST": "Asigna una zona primero",
- "Amount cannot be zero": "El importe no puede ser cero",
- "Company has to be official": "Empresa inválida",
- "You can not select this payment method without a registered bankery account": "No se puede utilizar este método de pago si no has registrado una cuenta bancaria",
- "Action not allowed on the test environment": "Esta acción no está permitida en el entorno de pruebas",
- "The selected ticket is not suitable for this route": "El ticket seleccionado no es apto para esta ruta",
- "New ticket request has been created with price": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}* y un precio de *{{price}} €*",
- "New ticket request has been created": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}*",
- "Swift / BIC cannot be empty": "Swift / BIC no puede estar vacío",
- "This BIC already exist.": "Este BIC ya existe.",
- "That item doesn't exists": "Ese artículo no existe",
- "There's a new urgent ticket:": "Hay un nuevo ticket urgente:",
- "Invalid account": "Cuenta inválida",
- "Compensation account is empty": "La cuenta para compensar está vacia",
- "This genus already exist": "Este genus ya existe",
- "This specie already exist": "Esta especie ya existe",
- "Client assignment has changed": "He cambiado el comercial ~*\"<{{previousWorkerName}}>\"*~ por *\"<{{currentWorkerName}}>\"* del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
- "None": "Ninguno",
- "The contract was not active during the selected date": "El contrato no estaba activo durante la fecha seleccionada",
- "Cannot add more than one '1/2 day vacation'": "No puedes añadir más de un 'Vacaciones 1/2 dia'",
- "This document already exists on this ticket": "Este documento ya existe en el ticket",
- "Some of the selected tickets are not billable": "Algunos de los tickets seleccionados no son facturables",
- "You can't invoice tickets from multiple clients": "No puedes facturar tickets de multiples clientes",
- "nickname": "nickname",
- "INACTIVE_PROVIDER": "Proveedor inactivo",
- "This client is not invoiceable": "Este cliente no es facturable",
- "serial non editable": "Esta serie no permite asignar la referencia",
- "Max shipped required": "La fecha límite es requerida",
- "Can't invoice to future": "No se puede facturar a futuro",
- "Can't invoice to past": "No se puede facturar a pasado",
- "This ticket is already invoiced": "Este ticket ya está facturado",
- "A ticket with an amount of zero can't be invoiced": "No se puede facturar un ticket con importe cero",
- "A ticket with a negative base can't be invoiced": "No se puede facturar un ticket con una base negativa",
- "Global invoicing failed": "[Facturación global] No se han podido facturar algunos clientes",
- "Wasn't able to invoice the following clients": "No se han podido facturar los siguientes clientes",
- "Can't verify data unless the client has a business type": "No se puede verificar datos de un cliente que no tiene tipo de negocio",
- "You don't have enough privileges to set this credit amount": "No tienes suficientes privilegios para establecer esta cantidad de crédito",
- "You can't change the credit set to zero from a financialBoss": "No puedes cambiar el cŕedito establecido a cero por un jefe de finanzas",
- "Amounts do not match": "Las cantidades no coinciden",
- "The PDF document does not exist": "El documento PDF no existe. Prueba a regenerarlo desde la opción 'Regenerar PDF factura'",
- "The type of business must be filled in basic data": "El tipo de negocio debe estar rellenado en datos básicos",
- "You can't create a claim from a ticket delivered more than seven days ago": "No puedes crear una reclamación de un ticket entregado hace más de siete días",
- "The worker has hours recorded that day": "El trabajador tiene horas fichadas ese día",
- "The worker has a marked absence that day": "El trabajador tiene marcada una ausencia ese día",
- "You can not modify is pay method checked": "No se puede modificar el campo método de pago validado",
- "Can't transfer claimed sales": "No puedes transferir lineas reclamadas",
- "You don't have privileges to create refund": "No tienes permisos para crear un abono",
- "The item is required": "El artículo es requerido",
- "The agency is already assigned to another autonomous": "La agencia ya está asignada a otro autónomo",
- "date in the future": "Fecha en el futuro",
- "reference duplicated": "Referencia duplicada",
- "This ticket is already a refund": "Este ticket ya es un abono",
- "isWithoutNegatives": "isWithoutNegatives",
- "routeFk": "routeFk",
- "Can't change the password of another worker": "No se puede cambiar la contraseña de otro trabajador",
- "No hay un contrato en vigor": "No hay un contrato en vigor",
- "No se permite fichar a futuro": "No se permite fichar a futuro",
- "No está permitido trabajar": "No está permitido trabajar",
- "Fichadas impares": "Fichadas impares",
- "Descanso diario 12h.": "Descanso diario 12h.",
- "Descanso semanal 36h. / 72h.": "Descanso semanal 36h. / 72h.",
- "Dirección incorrecta": "Dirección incorrecta",
- "Modifiable user details only by an administrator": "Detalles de usuario modificables solo por un administrador",
- "Modifiable password only via recovery or by an administrator": "Contraseña modificable solo a través de la recuperación o por un administrador",
- "Not enough privileges to edit a client": "No tienes suficientes privilegios para editar un cliente",
- "This route does not exists": "Esta ruta no existe",
- "Claim pickup order sent": "Reclamación Orden de recogida enviada [{{claimId}}]({{{claimUrl}}}) al cliente *{{clientName}}*",
- "You don't have grant privilege": "No tienes privilegios para dar privilegios",
- "You don't own the role and you can't assign it to another user": "No eres el propietario del rol y no puedes asignarlo a otro usuario",
- "Ticket merged": "Ticket [{{originId}}]({{{originFullPath}}}) ({{{originDated}}}) fusionado con [{{destinationId}}]({{{destinationFullPath}}}) ({{{destinationDated}}})",
- "Already has this status": "Ya tiene este estado",
- "There aren't records for this week": "No existen registros para esta semana",
- "Empty data source": "Origen de datos vacio",
- "App locked": "Aplicación bloqueada por el usuario {{userId}}",
- "Email verify": "Correo de verificación",
- "Landing cannot be lesser than shipment": "Landing cannot be lesser than shipment",
- "Receipt's bank was not found": "No se encontró el banco del recibo",
- "This receipt was not compensated": "Este recibo no ha sido compensado",
- "Client's email was not found": "No se encontró el email del cliente",
- "Negative basis": "Base negativa",
- "This worker code already exists": "Este codigo de trabajador ya existe",
- "This personal mail already exists": "Este correo personal ya existe",
- "This worker already exists": "Este trabajador ya existe",
- "App name does not exist": "El nombre de aplicación no es válido",
- "Try again": "Vuelve a intentarlo",
- "Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9",
- "Failed to upload delivery note": "Error al subir albarán {{id}}",
- "The DOCUWARE PDF document does not exists": "El documento PDF Docuware no existe",
- "It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar",
- "It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo",
- "It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas",
- "A supplier with the same name already exists. Change the country.": "Un proveedor con el mismo nombre ya existe. Cambie el país.",
- "There is no assigned email for this client": "No hay correo asignado para este cliente",
- "Exists an invoice with a future date": "Existe una factura con fecha posterior",
- "Invoice date can't be less than max date": "La fecha de factura no puede ser inferior a la fecha límite",
- "Warehouse inventory not set": "El almacén inventario no está establecido",
- "This locker has already been assigned": "Esta taquilla ya ha sido asignada",
- "Tickets with associated refunds": "No se pueden borrar tickets con abonos asociados. Este ticket está asociado al abono Nº %d",
- "Not exist this branch": "La rama no existe",
- "This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado",
- "Collection does not exist": "La colección no existe",
- "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo",
- "Insert a date range": "Inserte un rango de fechas",
- "Added observation": "{{user}} añadió esta observacion: {{text}}",
- "Comment added to client": "Observación añadida al cliente {{clientFk}}",
- "Invalid auth code": "Código de verificación incorrecto",
- "Invalid or expired verification code": "Código de verificación incorrecto o expirado",
- "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
- "company": "Compañía",
- "country": "País",
- "clientId": "Id cliente",
- "clientSocialName": "Cliente",
- "amount": "Importe",
- "taxableBase": "Base",
- "ticketFk": "Id ticket",
- "isActive": "Activo",
- "hasToInvoice": "Facturar",
- "isTaxDataChecked": "Datos comprobados",
- "comercialId": "Id comercial",
- "comercialName": "Comercial",
- "Pass expired": "La contraseña ha caducado, cambiela desde Salix",
- "Invalid NIF for VIES": "Invalid NIF for VIES",
- "Ticket does not exist": "Este ticket no existe",
- "Ticket is already signed": "Este ticket ya ha sido firmado",
- "Authentication failed": "Autenticación fallida",
- "You can't use the same password": "No puedes usar la misma contraseña",
- "You can only add negative amounts in refund tickets": "Solo se puede añadir cantidades negativas en tickets abono",
- "Fecha fuera de rango": "Fecha fuera de rango",
- "Error while generating PDF": "Error al generar PDF",
- "Error when sending mail to client": "Error al enviar el correo al cliente",
- "Mail not sent": "Se ha producido un fallo al enviar la factura al cliente [{{clientId}}]({{{clientUrl}}}), por favor revisa la dirección de correo electrónico",
- "The renew period has not been exceeded": "El periodo de renovación no ha sido superado",
- "Valid priorities": "Prioridades válidas: %d",
- "Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}",
- "You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado",
- "This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %s",
- "The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias",
- "You cannot assign/remove an alias that you are not assigned to": "No puede asignar/eliminar un alias que no tenga asignado",
- "This invoice has a linked vehicle.": "Esta factura tiene un vehiculo vinculado",
- "You don't have enough privileges.": "No tienes suficientes permisos.",
- "This ticket is locked.": "Este ticket está bloqueado.",
- "This ticket is not editable.": "Este ticket no es editable.",
- "The ticket doesn't exist.": "No existe el ticket.",
- "Social name should be uppercase": "La razón social debe ir en mayúscula",
- "Street should be uppercase": "La dirección fiscal debe ir en mayúscula",
- "The response is not a PDF": "La respuesta no es un PDF",
- "Ticket without Route": "Ticket sin ruta"
-}
->>>>>>> 72a8256aee7bff0be1dd68c8d4cfbe2edcf8ce60
+ "Agency cannot be blank": "Agency cannot be blank"
+}
\ No newline at end of file
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
index c590ff9ea..0b123dd3d 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
@@ -44,7 +44,7 @@ module.exports = Self => {
}
});
- Self.transferInvoiceOut = async(ctx, id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477Id, invoiceCorrectionTypeId, options) => {
+ Self.transferInvoice = async(ctx, id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477Id, invoiceCorrectionTypeId, options) => {
const models = Self.app.models;
const myOptions = {userId: ctx.req.accessToken.userId};
diff --git a/modules/invoiceOut/back/models/invoice-out.js b/modules/invoiceOut/back/models/invoice-out.js
index 0bb31ce12..ca77c856f 100644
--- a/modules/invoiceOut/back/models/invoice-out.js
+++ b/modules/invoiceOut/back/models/invoice-out.js
@@ -23,7 +23,7 @@ module.exports = Self => {
require('../methods/invoiceOut/getInvoiceDate')(Self);
require('../methods/invoiceOut/negativeBases')(Self);
require('../methods/invoiceOut/negativeBasesCsv')(Self);
- require('../methods/invoiceOut/transferInvoiceOut')(Self);
+ require('../methods/invoiceOut/transferInvoice')(Self);
Self.filePath = async function(id, options) {
const fields = ['ref', 'issued'];
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index 303d830b6..3f7e1cd21 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -5,7 +5,8 @@ module.exports = Self => {
accepts: [
{
arg: 'salesIds',
- type: ['number']
+ type: ['number'],
+ required: true
},
{
arg: 'servicesIds',
@@ -40,7 +41,6 @@ module.exports = Self => {
myOptions.transaction = tx;
}
- let refundTicket = null;
try {
const refundAgencyMode = await models.AgencyMode.findOne({
include: {
@@ -55,42 +55,14 @@ module.exports = Self => {
const refoundZoneId = refundAgencyMode.zones()[0].id;
- if (salesIds) {
- const salesFilter = {
- where: {id: {inq: salesIds}},
- include: {
- relation: 'components',
- scope: {
- fields: ['saleFk', 'componentFk', 'value']
- }
+ const salesFilter = {
+ where: {id: {inq: salesIds}},
+ include: {
+ relation: 'components',
+ scope: {
+ fields: ['saleFk', 'componentFk', 'value']
}
- };
- const sales = await models.Sale.find(salesFilter, myOptions);
- const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
-
- const now = Date.vnNew();
- const [firstTicketId] = ticketsIds;
-
- // eslint-disable-next-line max-len
- refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
-
- for (const sale of sales) {
- const createdSale = await models.Sale.create({
- ticketFk: refundTicket.id,
- itemFk: sale.itemFk,
- quantity: - sale.quantity,
- concept: sale.concept,
- price: sale.price,
- discount: sale.discount,
- }, myOptions);
-
- const components = sale.components();
- for (const component of components)
- component.saleFk = createdSale.id;
-
- await models.SaleComponent.create(components, myOptions);
}
-<<<<<<< HEAD
};
// const sales = await models.Sale.find(salesFilter, myOptions);
const refundTicket = await models.Sale.clone(
@@ -105,45 +77,6 @@ module.exports = Self => {
);
if (tx && !options) await tx.commit();
-=======
- }
-
- if (!refundTicket) {
- const servicesFilter = {
- where: {id: {inq: servicesIds}}
- };
- const services = await models.TicketService.find(servicesFilter, myOptions);
- const ticketsIds = [...new Set(services.map(service => service.ticketFk))];
-
- const now = Date.vnNew();
- const [firstTicketId] = ticketsIds;
-
- // eslint-disable-next-line max-len
- refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
- }
-
- if (servicesIds && servicesIds.length > 0) {
- const servicesFilter = {
- where: {id: {inq: servicesIds}}
- };
- const services = await models.TicketService.find(servicesFilter, myOptions);
- for (const service of services) {
- await models.TicketService.create({
- description: service.description,
- quantity: service.quantity,
- price: - service.price,
- taxClassFk: service.taxClassFk,
- ticketFk: refundTicket.id,
- ticketServiceTypeFk: service.ticketServiceTypeFk,
- }, myOptions);
- }
- }
-
- const query = `CALL vn.ticket_recalc(?, NULL)`;
- await Self.rawSql(query, [refundTicket.id], myOptions);
-
- if (tx) await tx.commit();
->>>>>>> 72a8256aee7bff0be1dd68c8d4cfbe2edcf8ce60
return refundTicket;
} catch (e) {
From f60b6b84fedb6e0ca9b0b75bf7c2fe48f2825a8a Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 20 Sep 2023 11:58:36 +0200
Subject: [PATCH 114/427] refs #5843 fix back
---
.../{233601 => 234001}/00-dropUserFk.sql | 0
.../234001/00-timeBusiness_calculate.sql | 86 +++++++++++++++++++
.../importToNewRefundTicket.js | 2 +-
.../client/back/models/client-observation.js | 2 +-
.../back/methods/ticket-request/deny.js | 2 +-
.../methods/ticket-tracking/changeState.js | 2 +-
.../methods/ticket-tracking/setDelivered.js | 2 +-
modules/ticket/back/models/ticket-request.js | 2 +-
modules/zone/back/methods/zone/deleteZone.js | 2 +-
9 files changed, 93 insertions(+), 7 deletions(-)
rename db/changes/{233601 => 234001}/00-dropUserFk.sql (100%)
create mode 100644 db/changes/234001/00-timeBusiness_calculate.sql
diff --git a/db/changes/233601/00-dropUserFk.sql b/db/changes/234001/00-dropUserFk.sql
similarity index 100%
rename from db/changes/233601/00-dropUserFk.sql
rename to db/changes/234001/00-dropUserFk.sql
diff --git a/db/changes/234001/00-timeBusiness_calculate.sql b/db/changes/234001/00-timeBusiness_calculate.sql
new file mode 100644
index 000000000..599dba74a
--- /dev/null
+++ b/db/changes/234001/00-timeBusiness_calculate.sql
@@ -0,0 +1,86 @@
+DELIMITER $$
+$$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`timeBusiness_calculate`(vDatedFrom DATETIME, vDatedTo DATETIME)
+BEGIN
+/**
+ * Horas que debe trabajar un empleado según contrato y día.
+ * @param vDatedFrom workerTimeControl
+ * @param vDatedTo workerTimeControl
+ * @table tmp.user(userFk)
+ * @return tmp.timeBusinessCalculate
+ */
+ DROP TEMPORARY TABLE IF EXISTS tmp.timeBusinessCalculate;
+ CREATE TEMPORARY TABLE tmp.timeBusinessCalculate
+ (INDEX (departmentFk))
+ SELECT dated,
+ businessFk,
+ sub.id userFk,
+ departmentFk,
+ hourStart,
+ hourEnd,
+ timeTable,
+ timeWorkSeconds,
+ SEC_TO_TIME(timeWorkSeconds) timeWorkSexagesimal,
+ timeWorkSeconds / 3600 timeWorkDecimal,
+ timeWorkSeconds timeBusinessSeconds,
+ SEC_TO_TIME(timeWorkSeconds) timeBusinessSexagesimal,
+ timeWorkSeconds / 3600 timeBusinessDecimal,
+ name type,
+ permissionRate,
+ hoursWeek,
+ discountRate,
+ isAllowedToWork
+ FROM(SELECT t.dated,
+ b.id businessFk,
+ w.id,
+ b.departmentFk,
+ IF(bs.started = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(bs.started,5) ORDER BY bs.started ASC SEPARATOR ' - ')) hourStart ,
+ IF(bs.started = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(bs.ended,5) ORDER BY bs.ended ASC SEPARATOR ' - ')) hourEnd,
+ IF(bs.started = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(bs.started,5), " - ", LEFT(bs.ended,5) ORDER BY bs.ended ASC SEPARATOR ' - ')) timeTable,
+ IF(bs.started = NULL, 0, IFNULL(SUM(TIME_TO_SEC(bs.ended)) - SUM(TIME_TO_SEC(bs.started)), 0)) timeWorkSeconds,
+ at2.name,
+ at2.permissionRate,
+ at2.discountRate,
+ ct.hoursWeek hoursWeek,
+ at2.isAllowedToWork
+ FROM time t
+ LEFT JOIN business b ON t.dated BETWEEN b.started AND IFNULL(b.ended, vDatedTo)
+ LEFT JOIN worker w ON w.id = b.workerFk
+ JOIN tmp.`user` u ON u.userFK = w.id
+ LEFT JOIN workCenter wc ON wc.id = b.workcenterFK
+ LEFT JOIN calendarType ct ON ct.id = b.calendarTypeFk
+ LEFT JOIN businessSchedule bs ON bs.businessFk = b.id AND bs.weekday = WEEKDAY(t.dated) + 1
+ LEFT JOIN calendar c ON c.businessFk = b.id AND c.dated = t.dated
+ LEFT JOIN absenceType at2 ON at2.id = c.dayOffTypeFk
+ WHERE t.dated BETWEEN vDatedFrom AND vDatedTo
+ GROUP BY w.id, t.dated
+ )sub;
+
+ UPDATE tmp.timeBusinessCalculate t
+ LEFT JOIN businessSchedule bs ON bs.businessFk = t.businessFk
+ SET t.timeWorkSeconds = t.hoursWeek / 5 * 3600,
+ t.timeWorkSexagesimal = SEC_TO_TIME( t.hoursWeek / 5 * 3600),
+ t.timeWorkDecimal = t.hoursWeek / 5,
+ t.timeBusinessSeconds = t.hoursWeek / 5 * 3600,
+ t.timeBusinessSexagesimal = SEC_TO_TIME( t.hoursWeek / 5 * 3600),
+ t.timeBusinessDecimal = t.hoursWeek / 5
+ WHERE DAYOFWEEK(t.dated) IN(2,3,4,5,6) AND bs.id IS NULL ;
+
+ UPDATE tmp.timeBusinessCalculate t
+ SET t.timeWorkSeconds = t.timeWorkSeconds - (t.timeWorkSeconds * permissionRate) ,
+ t.timeWorkSexagesimal = SEC_TO_TIME ((t.timeWorkDecimal - (t.timeWorkDecimal * permissionRate)) * 3600),
+ t.timeWorkDecimal = t.timeWorkDecimal - (t.timeWorkDecimal * permissionRate)
+ WHERE permissionRate <> 0;
+
+ UPDATE tmp.timeBusinessCalculate t
+ JOIN calendarHolidays ch ON ch.dated = t.dated
+ JOIN business b ON b.id = t.businessFk
+ AND b.workcenterFk = ch.workcenterFk
+ SET t.timeWorkSeconds = 0,
+ t.timeWorkSexagesimal = 0,
+ t.timeWorkDecimal = 0,
+ t.permissionrate = 1,
+ t.type = 'Festivo'
+ WHERE t.type IS NULL;
+END$$
+DELIMITER ;
diff --git a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js
index cdf3fc2c3..be3baccd7 100644
--- a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js
+++ b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js
@@ -75,7 +75,7 @@ module.exports = Self => {
try {
const worker = await models.Worker.findOne({
- where: {userFk: userId}
+ where: {id: userId}
}, myOptions);
const obsevationType = await models.ObservationType.findOne({
diff --git a/modules/client/back/models/client-observation.js b/modules/client/back/models/client-observation.js
index f208cb552..e34eedca9 100644
--- a/modules/client/back/models/client-observation.js
+++ b/modules/client/back/models/client-observation.js
@@ -9,7 +9,7 @@ module.exports = function(Self) {
let token = ctx.options.accessToken;
let userId = token && token.userId;
- Self.app.models.Worker.findOne({where: {userFk: userId}}, (err, user) => {
+ Self.app.models.Worker.findOne({where: {id: userId}}, (err, user) => {
if (err) return next(err);
ctx.instance.workerFk = user.id;
next();
diff --git a/modules/ticket/back/methods/ticket-request/deny.js b/modules/ticket/back/methods/ticket-request/deny.js
index 35de765d7..92f020083 100644
--- a/modules/ticket/back/methods/ticket-request/deny.js
+++ b/modules/ticket/back/methods/ticket-request/deny.js
@@ -39,7 +39,7 @@ module.exports = Self => {
try {
const userId = ctx.req.accessToken.userId;
- const worker = await Self.app.models.Worker.findOne({where: {userFk: userId}}, myOptions);
+ const worker = await Self.app.models.Worker.findOne({where: {id: userId}}, myOptions);
const params = {
isOk: false,
diff --git a/modules/ticket/back/methods/ticket-tracking/changeState.js b/modules/ticket/back/methods/ticket-tracking/changeState.js
index 4ae9ab40c..dbef8762e 100644
--- a/modules/ticket/back/methods/ticket-tracking/changeState.js
+++ b/modules/ticket/back/methods/ticket-tracking/changeState.js
@@ -53,7 +53,7 @@ module.exports = Self => {
if (!params.workerFk) {
const worker = await models.Worker.findOne({
- where: {userFk: userId}
+ where: {id: userId}
}, myOptions);
params.workerFk = worker.id;
diff --git a/modules/ticket/back/methods/ticket-tracking/setDelivered.js b/modules/ticket/back/methods/ticket-tracking/setDelivered.js
index bd6e32dcf..df482fd01 100644
--- a/modules/ticket/back/methods/ticket-tracking/setDelivered.js
+++ b/modules/ticket/back/methods/ticket-tracking/setDelivered.js
@@ -43,7 +43,7 @@ module.exports = Self => {
fields: ['id', 'name', 'alertLevel', 'code']
}, myOptions);
- const worker = await models.Worker.findOne({where: {userFk: userId}}, myOptions);
+ const worker = await models.Worker.findOne({where: {id: userId}}, myOptions);
const promises = [];
for (const id of ticketIds) {
diff --git a/modules/ticket/back/models/ticket-request.js b/modules/ticket/back/models/ticket-request.js
index 4125126dc..d133f85d5 100644
--- a/modules/ticket/back/models/ticket-request.js
+++ b/modules/ticket/back/models/ticket-request.js
@@ -10,7 +10,7 @@ module.exports = function(Self) {
Self.observe('before save', async function(ctx) {
if (ctx.isNewInstance) {
const loopBackContext = LoopBackContext.getCurrentContext();
- const filter = {where: {userFk: loopBackContext.active.accessToken.userId}};
+ const filter = {where: {id: loopBackContext.active.accessToken.userId}};
const models = Self.app.models;
const worker = await models.Worker.findOne(filter);
diff --git a/modules/zone/back/methods/zone/deleteZone.js b/modules/zone/back/methods/zone/deleteZone.js
index bcfb91e3d..13d45428c 100644
--- a/modules/zone/back/methods/zone/deleteZone.js
+++ b/modules/zone/back/methods/zone/deleteZone.js
@@ -54,7 +54,7 @@ module.exports = Self => {
const ticketList = await models.Ticket.find(filter, myOptions);
const fixingState = await models.State.findOne({where: {code: 'FIXING'}}, myOptions);
const worker = await models.Worker.findOne({
- where: {userFk: userId}
+ where: {id: userId}
}, myOptions);
await models.Ticket.rawSql('UPDATE ticket SET zoneFk = NULL WHERE zoneFk = ?', [id], myOptions);
From 3b90d7e5e5927c063cd806fcbb29ea706d61fe5a Mon Sep 17 00:00:00 2001
From: alexm
Date: Wed, 20 Sep 2023 15:10:28 +0200
Subject: [PATCH 115/427] refs #6067 refactor: vnUser and mailForward
privileges. fix: emailVerification
---
back/models/vn-user.js | 92 ++++++++++++-------
back/models/vn-user.json | 12 ++-
db/changes/234001/00-account_acl.sql | 12 +++
modules/account/back/models/mail-forward.js | 14 +++
modules/account/back/models/mail-forward.json | 16 +++-
modules/account/front/routes.json | 3 +-
6 files changed, 107 insertions(+), 42 deletions(-)
create mode 100644 db/changes/234001/00-account_acl.sql
create mode 100644 modules/account/back/models/mail-forward.js
diff --git a/back/models/vn-user.js b/back/models/vn-user.js
index cf210b61b..642d3fdf3 100644
--- a/back/models/vn-user.js
+++ b/back/models/vn-user.js
@@ -1,6 +1,7 @@
const vnModel = require('vn-loopback/common/models/vn-model');
const LoopBackContext = require('loopback-context');
const {Email} = require('vn-print');
+const UserError = require('vn-loopback/util/user-error');
module.exports = function(Self) {
vnModel(Self);
@@ -178,45 +179,68 @@ module.exports = function(Self) {
Self.sharedClass._methods.find(method => method.name == 'changePassword').ctor.settings.acls
.filter(acl => acl.property != 'changePassword');
+ Self.observe('before save', async ctx => {
+ const instance = ctx.currentInstance || ctx.instance;
+ console.log(ctx);
+ await Self.userSecurity(ctx, instance.id);
+ });
+
+ Self.userSecurity = async(ctx, userId) => {
+ const models = Self.app.models;
+ const accessToken = ctx.options.accessToken || LoopBackContext.getCurrentContext().active.accessToken;
+ console.log(accessToken, LoopBackContext.getCurrentContext().active.http.req);
+ const ctxToken = {req: {accessToken}};
+
+ const hasHigherPrivileges = await models.ACL.checkAccessAcl(ctxToken, 'VnUser', 'higherPrivileges');
+ if (hasHigherPrivileges) return;
+
+ const hasMediumPrivileges = await models.ACL.checkAccessAcl(ctxToken, 'VnUser', 'mediumPrivileges');
+ const user = await models.VnUser.findById(userId, {fields: ['id', 'emailVerified']});
+ if (!user.emailVerified && hasMediumPrivileges) return;
+
+ if (userId != accessToken.userId)
+ throw new UserError(`You don't have enough privileges`);
+ };
+
// FIXME: https://redmine.verdnatura.es/issues/5761
- // Self.afterRemote('prototype.patchAttributes', async(ctx, instance) => {
- // if (!ctx.args || !ctx.args.data.email) return;
+ Self.afterRemote('prototype.patchAttributes', async(ctx, instance) => {
+ if (!ctx.args || !ctx.args.data.email) return;
- // const loopBackContext = LoopBackContext.getCurrentContext();
- // const httpCtx = {req: loopBackContext.active};
- // const httpRequest = httpCtx.req.http.req;
- // const headers = httpRequest.headers;
- // const origin = headers.origin;
- // const url = origin.split(':');
+ const loopBackContext = LoopBackContext.getCurrentContext();
+ const httpCtx = {req: loopBackContext.active};
+ const httpRequest = httpCtx.req.http.req;
+ const headers = httpRequest.headers;
+ const origin = headers.origin;
+ const url = origin.split(':');
- // class Mailer {
- // async send(verifyOptions, cb) {
- // const params = {
- // url: verifyOptions.verifyHref,
- // recipient: verifyOptions.to,
- // lang: ctx.req.getLocale()
- // };
+ class Mailer {
+ async send(verifyOptions, cb) {
+ const params = {
+ url: verifyOptions.verifyHref,
+ recipient: verifyOptions.to,
+ lang: ctx.req.getLocale()
+ };
- // const email = new Email('email-verify', params);
- // email.send();
+ const email = new Email('email-verify', params);
+ email.send();
- // cb(null, verifyOptions.to);
- // }
- // }
+ cb(null, verifyOptions.to);
+ }
+ }
- // const options = {
- // type: 'email',
- // to: instance.email,
- // from: {},
- // redirect: `${origin}/#!/account/${instance.id}/basic-data?emailConfirmed`,
- // template: false,
- // mailer: new Mailer,
- // host: url[1].split('/')[2],
- // port: url[2],
- // protocol: url[0],
- // user: Self
- // };
+ const options = {
+ type: 'email',
+ to: instance.email,
+ from: {},
+ redirect: `${origin}/#!/account/${instance.id}/basic-data?emailConfirmed`,
+ template: false,
+ mailer: new Mailer,
+ host: url[1].split('/')[2],
+ port: url[2],
+ protocol: url[0],
+ user: Self
+ };
- // await instance.verify(options);
- // });
+ await instance.verify(options);
+ });
};
diff --git a/back/models/vn-user.json b/back/models/vn-user.json
index 9131c9134..23df2241f 100644
--- a/back/models/vn-user.json
+++ b/back/models/vn-user.json
@@ -13,10 +13,6 @@
"type": "number",
"id": true
},
- "name": {
- "type": "string",
- "required": true
- },
"username": {
"type": "string",
"mysql": {
@@ -127,7 +123,13 @@
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
- }
+ },
+ {
+ "principalType": "ROLE",
+ "principalId": "$authenticated",
+ "permission": "ALLOW",
+ "property": "patchAttributes"
+ }
],
"scopes": {
"preview": {
diff --git a/db/changes/234001/00-account_acl.sql b/db/changes/234001/00-account_acl.sql
new file mode 100644
index 000000000..23f47b99f
--- /dev/null
+++ b/db/changes/234001/00-account_acl.sql
@@ -0,0 +1,12 @@
+DELETE FROM `salix`.`ACL`
+ WHERE
+ model = 'MailForward'
+ AND accessType = '*'
+ AND property = '*'
+ AND principalId = 'hr';
+
+
+INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
+ VALUES
+ ('VnUser', 'higherPrivileges', '*', 'ALLOW', 'ROLE', 'itManagement'),
+ ('VnUser', 'mediumPrivileges', '*', 'ALLOW', 'ROLE', 'hr');
diff --git a/modules/account/back/models/mail-forward.js b/modules/account/back/models/mail-forward.js
new file mode 100644
index 000000000..d55f5ddbc
--- /dev/null
+++ b/modules/account/back/models/mail-forward.js
@@ -0,0 +1,14 @@
+
+module.exports = Self => {
+ Self.observe('loaded', async ctx => {
+ if (!ctx.data.account) return;
+ await Self.app.models.VnUser.userSecurity(ctx, ctx.data.account);
+ });
+ Self.observe('before save', async ctx => {
+ const instance = ctx.currentInstance || ctx.instance;
+ await Self.app.models.VnUser.userSecurity(ctx, instance.account);
+ });
+ Self.observe('before delete', async ctx => {
+ await Self.app.models.VnUser.userSecurity(ctx, ctx.where.account);
+ });
+};
diff --git a/modules/account/back/models/mail-forward.json b/modules/account/back/models/mail-forward.json
index edef1bf08..af4de3218 100644
--- a/modules/account/back/models/mail-forward.json
+++ b/modules/account/back/models/mail-forward.json
@@ -21,5 +21,19 @@
"model": "VnUser",
"foreignKey": "account"
}
- }
+ },
+ "acls": [
+ {
+ "accessType": "READ",
+ "principalType": "ROLE",
+ "principalId": "$authenticated",
+ "permission": "ALLOW"
+ },
+ {
+ "accessType": "WRITE",
+ "principalType": "ROLE",
+ "principalId": "$authenticated",
+ "permission": "ALLOW"
+ }
+ ]
}
diff --git a/modules/account/front/routes.json b/modules/account/front/routes.json
index fd33e7122..8472c3574 100644
--- a/modules/account/front/routes.json
+++ b/modules/account/front/routes.json
@@ -77,8 +77,7 @@
"url": "/basic-data?emailConfirmed",
"state": "account.card.basicData",
"component": "vn-user-basic-data",
- "description": "Basic data",
- "acl": ["itManagement"]
+ "description": "Basic data"
},
{
"url" : "/log",
From 4e6808ec4aad00f121777076618bec717a669d32 Mon Sep 17 00:00:00 2001
From: jgallego
Date: Thu, 21 Sep 2023 08:24:57 +0200
Subject: [PATCH 116/427] fixes #4059 muevo archivos a changes actual
---
db/changes/{233801 => 234001}/00-aclClient.sql | 0
db/changes/{233801 => 234001}/01-aclAccount.sql | 0
2 files changed, 0 insertions(+), 0 deletions(-)
rename db/changes/{233801 => 234001}/00-aclClient.sql (100%)
rename db/changes/{233801 => 234001}/01-aclAccount.sql (100%)
diff --git a/db/changes/233801/00-aclClient.sql b/db/changes/234001/00-aclClient.sql
similarity index 100%
rename from db/changes/233801/00-aclClient.sql
rename to db/changes/234001/00-aclClient.sql
diff --git a/db/changes/233801/01-aclAccount.sql b/db/changes/234001/01-aclAccount.sql
similarity index 100%
rename from db/changes/233801/01-aclAccount.sql
rename to db/changes/234001/01-aclAccount.sql
From b615062c09c2683a1c775eeeaad2df0875884a56 Mon Sep 17 00:00:00 2001
From: alexm
Date: Thu, 21 Sep 2023 08:40:17 +0200
Subject: [PATCH 117/427] refs #6225 add more info in changelog
---
CHANGELOG.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index acb5d7457..7fa6d453c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- (Ticket -> Servicios) Se pueden abonar servicios
+- (Facturas -> Datos básicos) Muestra valores por defecto
+- (Facturas -> Borrado) Notificación al borrar un asiento ya enlazado en Sage
### Changed
- (Trabajadores -> Calendario) Icono de check arreglado cuando pulsas un tipo de dia
From acd4f398c7d22da5c1f5857cc45ee2cc5fc3dd70 Mon Sep 17 00:00:00 2001
From: pablone
Date: Thu, 21 Sep 2023 08:44:52 +0200
Subject: [PATCH 118/427] refs #6159 procBasedUpdate
---
.../233801/00-updateAfterBusinnesInsert.sql | 66 ++++++++++++++-----
1 file changed, 51 insertions(+), 15 deletions(-)
diff --git a/db/changes/233801/00-updateAfterBusinnesInsert.sql b/db/changes/233801/00-updateAfterBusinnesInsert.sql
index 82c71507c..71356db80 100644
--- a/db/changes/233801/00-updateAfterBusinnesInsert.sql
+++ b/db/changes/233801/00-updateAfterBusinnesInsert.sql
@@ -1,21 +1,57 @@
DELIMITER $$
-CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`business_afterInsert`
- AFTER INSERT ON `business`
- FOR EACH ROW
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `account`.`account_enable`(vSelf INT)
BEGIN
- CALL worker_updateBusiness(NEW.workerFk);
- UPDATE account.user
- SET active = TRUE
- WHERE id = NEW.workerFk;
+/**
+ * Enables a worker's account and sets up email configurations.
+ */
+ UPDATE user
+ SET active = TRUE
+ WHERE id = vSelf;
- INSERT IGNORE INTO account.mailAliasAccount (mailAlias, account)
- SELECT id, NEW.workerFk
- FROM account.mailAlias
- WHERE alias = 'general';
+ INSERT IGNORE INTO account
+ SET id = vSelf;
- INSERT IGNORE INTO account.mailForward (account, forwardTo)
- SELECT NEW.workerFk, email
- FROM account.user
- WHERE id = NEW.workerFk;
+ INSERT IGNORE INTO mailAliasAccount (mailAlias, account)
+ SELECT id, vSelf
+ FROM mailAlias
+ WHERE alias = 'general';
+
+ INSERT IGNORE INTO mailForward (account, forwardTo)
+ SELECT vSelf, email
+ FROM user
+ WHERE id = vSelf;
+END$$
+DELIMITER ;
+
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`worker_updateBusiness`(vSelf INT)
+BEGIN
+/**
+ * Activates an account and configures its email settings.
+ *
+ * @param vSelf account id.
+ */
+ DECLARE vOldBusinessFk INT;
+ DECLARE vNewBusinessFk INT;
+
+ SELECT businessFk INTO vOldBusinessFk FROM worker WHERE id = vSelf;
+
+ SELECT id INTO vNewBusinessFk
+ FROM business
+ WHERE workerFk = vSelf
+ AND util.VN_CURDATE() BETWEEN started AND IFNULL(ended, util.VN_CURDATE());
+
+ UPDATE worker
+ SET businessFk = vNewBusinessFk
+ WHERE id = vSelf;
+
+ IF NOT (vOldBusinessFk <=> vNewBusinessFk) THEN
+ IF vNewBusinessFk IS NULL THEN
+ CALL workerDisable(vSelf);
+ END IF;
+ IF vOldBusinessFk IS NULL THEN
+ CALL account.account_enable(vSelf);
+ END IF;
+ END IF;
END$$
DELIMITER ;
From ac4aea7d38f6d0492561606818af213c3ef1698f Mon Sep 17 00:00:00 2001
From: jorgep
Date: Thu, 21 Sep 2023 09:14:46 +0200
Subject: [PATCH 119/427] ref #5914 created transfer issued invoice
---
db/dump/fixtures.sql | 17 +-
loopback/locale/en.json | 10 +-
loopback/locale/es.json | 341 ++++++++++++++++--
.../methods/invoiceOut/transferInvoice.js | 39 +-
modules/ticket/back/methods/sale/clone.js | 1 -
modules/ticket/back/methods/sale/refund.js | 55 +--
.../back/methods/sale/specs/refund.spec.js | 2 +-
7 files changed, 351 insertions(+), 114 deletions(-)
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 691f7e6df..bb46880bd 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -604,7 +604,7 @@ INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaF
INSERT INTO `vn`.`invoiceOut`(`id`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `hasPdf`)
VALUES
- (1, 'T', 1014.24, util.VN_CURDATE(), 1101, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
+ (1, 'T', 1026.24, util.VN_CURDATE(), 1101, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
(2, 'T', 121.36, util.VN_CURDATE(), 1102, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
(3, 'T', 8.88, util.VN_CURDATE(), 1103, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
(4, 'T', 8.88, util.VN_CURDATE(), 1103, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0),
@@ -2966,20 +2966,6 @@ INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
VALUES
(1, 0, 0, 'marvel.com');
-<<<<<<< HEAD
-INSERT INTO `vn`.`cplusCorrectingType` (`description`)
- VALUES
- ('Embalajes'),
- ('Anulación'),
- ('Impagado'),
- ('Moroso');
-
-INSERT INTO `vn`.`invoiceCorrectionType` (`description`)
- VALUES
- ('Error en el cálculo del IVA'),
- ('Error en el detalle de las ventas'),
- ('Error en los datos del cliente');
-=======
INSERT INTO vn.XDiario (id, ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, BASEEURO, SERIE, FACTURA, IVA, RECEQUIV, CLAVE, CAMBIO, DEBEME, HABERME, AUXILIAR, MONEDAUSO, TIPOOPE, NFACTICK, TERIDNIF, TERNIF, TERNOM, OPBIENES, L340, enlazado, FECHA_EX, LRECT349, empresa_id, LDIFADUAN, METAL, METALIMP, CLIENTE, METALEJE, FECHA_OP, FACTURAEX, TIPOCLAVE, TIPOEXENCI, TIPONOSUJE, TIPOFACT, TIPORECTIF, SERIE_RT, FACTU_RT, BASEIMP_RT, BASEIMP_RF, RECTIFICA, FECHA_RT, FECREGCON, enlazadoSage)
VALUES
(1, 1.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T3333333', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1),
@@ -2988,4 +2974,3 @@ INSERT INTO vn.XDiario (id, ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EU
(4, 2.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T4444444', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(5, 2.0, util.VN_CURDATE(), '2000000000', '4300001104', 'n/fra T4444444 Tony Stark', NULL, 8.07, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
->>>>>>> 72a8256aee7bff0be1dd68c8d4cfbe2edcf8ce60
diff --git a/loopback/locale/en.json b/loopback/locale/en.json
index fb4e72bd6..3755c4a67 100644
--- a/loopback/locale/en.json
+++ b/loopback/locale/en.json
@@ -187,5 +187,11 @@
"This ticket is not editable.": "This ticket is not editable.",
"The ticket doesn't exist.": "The ticket doesn't exist.",
"The sales do not exists": "The sales do not exists",
- "Ticket without Route": "Ticket without route"
-}
+ "Ticket without Route": "Ticket without route",
+ "Select a different customer": "Select a different customer",
+ "Fill all the fields": "Fill all the fields",
+ "Error while generating PDF": "Error while generating PDF",
+ "Can't invoice to future": "Can't invoice to future",
+ "This ticket is already invoiced": "This ticket is already invoiced",
+ "Negative basis of tickets: 23": "Negative basis of tickets: 23"
+}
\ No newline at end of file
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index d436ec197..f5973dcb7 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -1,25 +1,322 @@
{
- "Name cannot be blank": "Name cannot be blank",
- "Swift / BIC cannot be empty": "Swift / BIC cannot be empty",
- "Social name should be uppercase": "Social name should be uppercase",
- "Street cannot be empty": "Street cannot be empty",
- "Street should be uppercase": "Street should be uppercase",
- "City cannot be empty": "City cannot be empty",
- "Invalid email": "Invalid email",
- "Phone cannot be blank": "Phone cannot be blank",
+ "Phone format is invalid": "El formato del teléfono no es correcto",
+ "You are not allowed to change the credit": "No tienes privilegios para modificar el crédito",
+ "Unable to mark the equivalence surcharge": "No se puede marcar el recargo de equivalencia",
+ "The default consignee can not be unchecked": "No se puede desmarcar el consignatario predeterminado",
+ "Unable to default a disabled consignee": "No se puede poner predeterminado un consignatario desactivado",
+ "Can't be blank": "No puede estar en blanco",
+ "Invalid TIN": "NIF/CIF invalido",
+ "TIN must be unique": "El NIF/CIF debe ser único",
+ "A client with that Web User name already exists": "Ya existe un cliente con ese Usuario Web",
+ "Is invalid": "Is invalid",
+ "Quantity cannot be zero": "La cantidad no puede ser cero",
+ "Enter an integer different to zero": "Introduce un entero distinto de cero",
+ "Package cannot be blank": "El embalaje no puede estar en blanco",
+ "The company name must be unique": "La razón social debe ser única",
+ "Invalid email": "Correo electrónico inválido",
+ "The IBAN does not have the correct format": "El IBAN no tiene el formato correcto",
+ "That payment method requires an IBAN": "El método de pago seleccionado requiere un IBAN",
+ "That payment method requires a BIC": "El método de pago seleccionado requiere un BIC",
+ "State cannot be blank": "El estado no puede estar en blanco",
+ "Worker cannot be blank": "El trabajador no puede estar en blanco",
+ "Cannot change the payment method if no salesperson": "No se puede cambiar la forma de pago si no hay comercial asignado",
+ "can't be blank": "El campo no puede estar vacío",
+ "Observation type must be unique": "El tipo de observación no puede repetirse",
"The credit must be an integer greater than or equal to zero": "The credit must be an integer greater than or equal to zero",
- "The grade must be an integer greater than or equal to zero": "The grade must be an integer greater than or equal to zero",
- "Description should have maximum of 45 characters": "Description should have maximum of 45 characters",
- "Amount cannot be zero": "Amount cannot be zero",
- "Period cannot be blank": "Period cannot be blank",
- "Sample type cannot be blank": "Sample type cannot be blank",
- "Cannot be blank": "Cannot be blank",
- "The social name cannot be empty": "The social name cannot be empty",
- "Concept cannot be blank": "Concept cannot be blank",
- "Enter an integer different to zero": "Enter an integer different to zero",
- "Package cannot be blank": "Package cannot be blank",
- "State cannot be blank": "State cannot be blank",
- "Worker cannot be blank": "Worker cannot be blank",
- "Description cannot be blank": "Description cannot be blank",
- "Agency cannot be blank": "Agency cannot be blank"
+ "The grade must be similar to the last one": "El grade debe ser similar al último",
+ "Only manager can change the credit": "Solo el gerente puede cambiar el credito de este cliente",
+ "Name cannot be blank": "El nombre no puede estar en blanco",
+ "Phone cannot be blank": "El teléfono no puede estar en blanco",
+ "Period cannot be blank": "El periodo no puede estar en blanco",
+ "Choose a company": "Selecciona una empresa",
+ "Se debe rellenar el campo de texto": "Se debe rellenar el campo de texto",
+ "Description should have maximum of 45 characters": "La descripción debe tener maximo 45 caracteres",
+ "Cannot be blank": "El campo no puede estar en blanco",
+ "The grade must be an integer greater than or equal to zero": "El grade debe ser un entero mayor o igual a cero",
+ "Sample type cannot be blank": "El tipo de plantilla no puede quedar en blanco",
+ "Description cannot be blank": "Se debe rellenar el campo de texto",
+ "The new quantity should be smaller than the old one": "La nueva cantidad debe de ser menor que la anterior",
+ "The value should not be greater than 100%": "El valor no debe de ser mayor de 100%",
+ "The value should be a number": "El valor debe ser un numero",
+ "This order is not editable": "Esta orden no se puede modificar",
+ "You can't create an order for a frozen client": "No puedes crear una orden para un cliente congelado",
+ "You can't create an order for a client that has a debt": "No puedes crear una orden para un cliente con deuda",
+ "is not a valid date": "No es una fecha valida",
+ "Barcode must be unique": "El código de barras debe ser único",
+ "The warehouse can't be repeated": "El almacén no puede repetirse",
+ "The tag or priority can't be repeated for an item": "El tag o prioridad no puede repetirse para un item",
+ "The observation type can't be repeated": "El tipo de observación no puede repetirse",
+ "A claim with that sale already exists": "Ya existe una reclamación para esta línea",
+ "You don't have enough privileges to change that field": "No tienes permisos para cambiar ese campo",
+ "Warehouse cannot be blank": "El almacén no puede quedar en blanco",
+ "Agency cannot be blank": "La agencia no puede quedar en blanco",
+ "Not enough privileges to edit a client with verified data": "No tienes permisos para hacer cambios en un cliente con datos comprobados",
+ "This address doesn't exist": "Este consignatario no existe",
+ "You must delete the claim id %d first": "Antes debes borrar la reclamación %d",
+ "You don't have enough privileges": "No tienes suficientes permisos",
+ "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF",
+ "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos",
+ "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ",
+ "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado",
+ "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo",
+ "Tag value cannot be blank": "El valor del tag no puede quedar en blanco",
+ "ORDER_EMPTY": "Cesta vacía",
+ "You don't have enough privileges to do that": "No tienes permisos para cambiar esto",
+ "NO SE PUEDE DESACTIVAR EL CONSIGNAT": "NO SE PUEDE DESACTIVAR EL CONSIGNAT",
+ "Error. El NIF/CIF está repetido": "Error. El NIF/CIF está repetido",
+ "Street cannot be empty": "Dirección no puede estar en blanco",
+ "City cannot be empty": "Cuidad no puede estar en blanco",
+ "Code cannot be blank": "Código no puede estar en blanco",
+ "You cannot remove this department": "No puedes eliminar este departamento",
+ "The extension must be unique": "La extensión debe ser unica",
+ "The secret can't be blank": "La contraseña no puede estar en blanco",
+ "We weren't able to send this SMS": "No hemos podido enviar el SMS",
+ "This client can't be invoiced": "Este cliente no puede ser facturado",
+ "This ticket can't be invoiced": "Este ticket no puede ser facturado",
+ "You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
+ "This ticket can not be modified": "Este ticket no puede ser modificado",
+ "The introduced hour already exists": "Esta hora ya ha sido introducida",
+ "INFINITE_LOOP": "Existe una dependencia entre dos Jefes",
+ "The sales of the receiver ticket can't be modified": "Las lineas del ticket al que envias no pueden ser modificadas",
+ "NO_AGENCY_AVAILABLE": "No hay una zona de reparto disponible con estos parámetros",
+ "ERROR_PAST_SHIPMENT": "No puedes seleccionar una fecha de envío en pasado",
+ "The current ticket can't be modified": "El ticket actual no puede ser modificado",
+ "The current claim can't be modified": "La reclamación actual no puede ser modificada",
+ "The sales of this ticket can't be modified": "Las lineas de este ticket no pueden ser modificadas",
+ "The sales do not exists": "La(s) línea(s) seleccionada(s) no existe(n)",
+ "Please select at least one sale": "Por favor selecciona al menos una linea",
+ "All sales must belong to the same ticket": "Todas las lineas deben pertenecer al mismo ticket",
+ "NO_ZONE_FOR_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
+ "This item doesn't exists": "El artículo no existe",
+ "NOT_ZONE_WITH_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
+ "Extension format is invalid": "El formato de la extensión es inválido",
+ "Invalid parameters to create a new ticket": "Parámetros inválidos para crear un nuevo ticket",
+ "This item is not available": "Este artículo no está disponible",
+ "This postcode already exists": "Este código postal ya existe",
+ "Concept cannot be blank": "El concepto no puede quedar en blanco",
+ "File doesn't exists": "El archivo no existe",
+ "You don't have privileges to change the zone": "No tienes permisos para cambiar la zona o para esos parámetros hay más de una opción de envío, hable con las agencias",
+ "This ticket is already on weekly tickets": "Este ticket ya está en tickets programados",
+ "Ticket id cannot be blank": "El id de ticket no puede quedar en blanco",
+ "Weekday cannot be blank": "El día de la semana no puede quedar en blanco",
+ "You can't delete a confirmed order": "No puedes borrar un pedido confirmado",
+ "The social name has an invalid format": "El nombre fiscal tiene un formato incorrecto",
+ "Invalid quantity": "Cantidad invalida",
+ "This postal code is not valid": "This postal code is not valid",
+ "is invalid": "is invalid",
+ "The postcode doesn't exist. Please enter a correct one": "El código postal no existe. Por favor, introduce uno correcto",
+ "The department name can't be repeated": "El nombre del departamento no puede repetirse",
+ "This phone already exists": "Este teléfono ya existe",
+ "You cannot move a parent to its own sons": "No puedes mover un elemento padre a uno de sus hijos",
+ "You can't create a claim for a removed ticket": "No puedes crear una reclamación para un ticket eliminado",
+ "You cannot delete a ticket that part of it is being prepared": "No puedes eliminar un ticket en el que una parte que está siendo preparada",
+ "You must delete all the buy requests first": "Debes eliminar todas las peticiones de compra primero",
+ "You should specify a date": "Debes especificar una fecha",
+ "You should specify at least a start or end date": "Debes especificar al menos una fecha de inicio o de fín",
+ "Start date should be lower than end date": "La fecha de inicio debe ser menor que la fecha de fín",
+ "You should mark at least one week day": "Debes marcar al menos un día de la semana",
+ "Swift / BIC can't be empty": "Swift / BIC no puede estar vacío",
+ "Customs agent is required for a non UEE member": "El agente de aduanas es requerido para los clientes extracomunitarios",
+ "Incoterms is required for a non UEE member": "El incoterms es requerido para los clientes extracomunitarios",
+ "Deleted sales from ticket": "He eliminado las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}",
+ "Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
+ "Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
+ "Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
+ "Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}})",
+ "Changed sale quantity": "He cambiado la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}* del ticket [{{ticketId}}]({{{ticketUrl}}})",
+ "State": "Estado",
+ "regular": "normal",
+ "reserved": "reservado",
+ "Changed sale reserved state": "He cambiado el estado reservado de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
+ "Bought units from buy request": "Se ha comprado {{quantity}} unidades de [{{itemId}} {{concept}}]({{{urlItem}}}) para el ticket id [{{ticketId}}]({{{url}}})",
+ "Deny buy request": "Se ha rechazado la petición de compra para el ticket id [{{ticketId}}]({{{url}}}). Motivo: {{observation}}",
+ "MESSAGE_INSURANCE_CHANGE": "He cambiado el crédito asegurado del cliente [{{clientName}} ({{clientId}})]({{{url}}}) a *{{credit}} €*",
+ "Changed client paymethod": "He cambiado la forma de pago del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
+ "Sent units from ticket": "Envio *{{quantity}}* unidades de [{{concept}} ({{itemId}})]({{{itemUrl}}}) a *\"{{nickname}}\"* provenientes del ticket id [{{ticketId}}]({{{ticketUrl}}})",
+ "Change quantity": "{{concept}} cambia de {{oldQuantity}} a {{newQuantity}}",
+ "Claim will be picked": "Se recogerá el género de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}*",
+ "Claim state has changed to incomplete": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *incompleta*",
+ "Claim state has changed to canceled": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *anulado*",
+ "Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}",
+ "ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto",
+ "Distance must be lesser than 1000": "La distancia debe ser inferior a 1000",
+ "This ticket is deleted": "Este ticket está eliminado",
+ "Unable to clone this travel": "No ha sido posible clonar este travel",
+ "This thermograph id already exists": "La id del termógrafo ya existe",
+ "Choose a date range or days forward": "Selecciona un rango de fechas o días en adelante",
+ "ORDER_ALREADY_CONFIRMED": "ORDER_ALREADY_CONFIRMED",
+ "Invalid password": "Invalid password",
+ "Password does not meet requirements": "La contraseña no cumple los requisitos",
+ "Role already assigned": "Role already assigned",
+ "Invalid role name": "Invalid role name",
+ "Role name must be written in camelCase": "Role name must be written in camelCase",
+ "Email already exists": "Email already exists",
+ "User already exists": "User already exists",
+ "Absence change notification on the labour calendar": "Notificacion de cambio de ausencia en el calendario laboral",
+ "Record of hours week": "Registro de horas semana {{week}} año {{year}} ",
+ "Created absence": "El empleado {{author}} ha añadido una ausencia de tipo '{{absenceType}}' a {{employee}} para el día {{dated}}.",
+ "Deleted absence": "El empleado {{author}} ha eliminado una ausencia de tipo '{{absenceType}}' a {{employee}} del día {{dated}}.",
+ "I have deleted the ticket id": "He eliminado el ticket id [{{id}}]({{{url}}})",
+ "I have restored the ticket id": "He restaurado el ticket id [{{id}}]({{{url}}})",
+ "You can only restore a ticket within the first hour after deletion": "Únicamente puedes restaurar el ticket dentro de la primera hora después de su eliminación",
+ "Changed this data from the ticket": "He cambiado estos datos del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
+ "agencyModeFk": "Agencia",
+ "clientFk": "Cliente",
+ "zoneFk": "Zona",
+ "warehouseFk": "Almacén",
+ "shipped": "F. envío",
+ "landed": "F. entrega",
+ "addressFk": "Consignatario",
+ "companyFk": "Empresa",
+ "The social name cannot be empty": "La razón social no puede quedar en blanco",
+ "The nif cannot be empty": "El NIF no puede quedar en blanco",
+ "You need to fill sage information before you check verified data": "Debes rellenar la información de sage antes de marcar datos comprobados",
+ "ASSIGN_ZONE_FIRST": "Asigna una zona primero",
+ "Amount cannot be zero": "El importe no puede ser cero",
+ "Company has to be official": "Empresa inválida",
+ "You can not select this payment method without a registered bankery account": "No se puede utilizar este método de pago si no has registrado una cuenta bancaria",
+ "Action not allowed on the test environment": "Esta acción no está permitida en el entorno de pruebas",
+ "The selected ticket is not suitable for this route": "El ticket seleccionado no es apto para esta ruta",
+ "New ticket request has been created with price": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}* y un precio de *{{price}} €*",
+ "New ticket request has been created": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}*",
+ "Swift / BIC cannot be empty": "Swift / BIC no puede estar vacío",
+ "This BIC already exist.": "Este BIC ya existe.",
+ "That item doesn't exists": "Ese artículo no existe",
+ "There's a new urgent ticket:": "Hay un nuevo ticket urgente:",
+ "Invalid account": "Cuenta inválida",
+ "Compensation account is empty": "La cuenta para compensar está vacia",
+ "This genus already exist": "Este genus ya existe",
+ "This specie already exist": "Esta especie ya existe",
+ "Client assignment has changed": "He cambiado el comercial ~*\"<{{previousWorkerName}}>\"*~ por *\"<{{currentWorkerName}}>\"* del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
+ "None": "Ninguno",
+ "The contract was not active during the selected date": "El contrato no estaba activo durante la fecha seleccionada",
+ "Cannot add more than one '1/2 day vacation'": "No puedes añadir más de un 'Vacaciones 1/2 dia'",
+ "This document already exists on this ticket": "Este documento ya existe en el ticket",
+ "Some of the selected tickets are not billable": "Algunos de los tickets seleccionados no son facturables",
+ "You can't invoice tickets from multiple clients": "No puedes facturar tickets de multiples clientes",
+ "nickname": "nickname",
+ "INACTIVE_PROVIDER": "Proveedor inactivo",
+ "This client is not invoiceable": "Este cliente no es facturable",
+ "serial non editable": "Esta serie no permite asignar la referencia",
+ "Max shipped required": "La fecha límite es requerida",
+ "Can't invoice to future": "No se puede facturar a futuro",
+ "Can't invoice to past": "No se puede facturar a pasado",
+ "This ticket is already invoiced": "Este ticket ya está facturado",
+ "A ticket with an amount of zero can't be invoiced": "No se puede facturar un ticket con importe cero",
+ "A ticket with a negative base can't be invoiced": "No se puede facturar un ticket con una base negativa",
+ "Global invoicing failed": "[Facturación global] No se han podido facturar algunos clientes",
+ "Wasn't able to invoice the following clients": "No se han podido facturar los siguientes clientes",
+ "Can't verify data unless the client has a business type": "No se puede verificar datos de un cliente que no tiene tipo de negocio",
+ "You don't have enough privileges to set this credit amount": "No tienes suficientes privilegios para establecer esta cantidad de crédito",
+ "You can't change the credit set to zero from a financialBoss": "No puedes cambiar el cŕedito establecido a cero por un jefe de finanzas",
+ "Amounts do not match": "Las cantidades no coinciden",
+ "The PDF document does not exist": "El documento PDF no existe. Prueba a regenerarlo desde la opción 'Regenerar PDF factura'",
+ "The type of business must be filled in basic data": "El tipo de negocio debe estar rellenado en datos básicos",
+ "You can't create a claim from a ticket delivered more than seven days ago": "No puedes crear una reclamación de un ticket entregado hace más de siete días",
+ "The worker has hours recorded that day": "El trabajador tiene horas fichadas ese día",
+ "The worker has a marked absence that day": "El trabajador tiene marcada una ausencia ese día",
+ "You can not modify is pay method checked": "No se puede modificar el campo método de pago validado",
+ "Can't transfer claimed sales": "No puedes transferir lineas reclamadas",
+ "You don't have privileges to create refund": "No tienes permisos para crear un abono",
+ "The item is required": "El artículo es requerido",
+ "The agency is already assigned to another autonomous": "La agencia ya está asignada a otro autónomo",
+ "date in the future": "Fecha en el futuro",
+ "reference duplicated": "Referencia duplicada",
+ "This ticket is already a refund": "Este ticket ya es un abono",
+ "isWithoutNegatives": "isWithoutNegatives",
+ "routeFk": "routeFk",
+ "Can't change the password of another worker": "No se puede cambiar la contraseña de otro trabajador",
+ "No hay un contrato en vigor": "No hay un contrato en vigor",
+ "No se permite fichar a futuro": "No se permite fichar a futuro",
+ "No está permitido trabajar": "No está permitido trabajar",
+ "Fichadas impares": "Fichadas impares",
+ "Descanso diario 12h.": "Descanso diario 12h.",
+ "Descanso semanal 36h. / 72h.": "Descanso semanal 36h. / 72h.",
+ "Dirección incorrecta": "Dirección incorrecta",
+ "Modifiable user details only by an administrator": "Detalles de usuario modificables solo por un administrador",
+ "Modifiable password only via recovery or by an administrator": "Contraseña modificable solo a través de la recuperación o por un administrador",
+ "Not enough privileges to edit a client": "No tienes suficientes privilegios para editar un cliente",
+ "This route does not exists": "Esta ruta no existe",
+ "Claim pickup order sent": "Reclamación Orden de recogida enviada [{{claimId}}]({{{claimUrl}}}) al cliente *{{clientName}}*",
+ "You don't have grant privilege": "No tienes privilegios para dar privilegios",
+ "You don't own the role and you can't assign it to another user": "No eres el propietario del rol y no puedes asignarlo a otro usuario",
+ "Ticket merged": "Ticket [{{originId}}]({{{originFullPath}}}) ({{{originDated}}}) fusionado con [{{destinationId}}]({{{destinationFullPath}}}) ({{{destinationDated}}})",
+ "Already has this status": "Ya tiene este estado",
+ "There aren't records for this week": "No existen registros para esta semana",
+ "Empty data source": "Origen de datos vacio",
+ "App locked": "Aplicación bloqueada por el usuario {{userId}}",
+ "Email verify": "Correo de verificación",
+ "Landing cannot be lesser than shipment": "Landing cannot be lesser than shipment",
+ "Receipt's bank was not found": "No se encontró el banco del recibo",
+ "This receipt was not compensated": "Este recibo no ha sido compensado",
+ "Client's email was not found": "No se encontró el email del cliente",
+ "Negative basis": "Base negativa",
+ "This worker code already exists": "Este codigo de trabajador ya existe",
+ "This personal mail already exists": "Este correo personal ya existe",
+ "This worker already exists": "Este trabajador ya existe",
+ "App name does not exist": "El nombre de aplicación no es válido",
+ "Try again": "Vuelve a intentarlo",
+ "Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9",
+ "Failed to upload delivery note": "Error al subir albarán {{id}}",
+ "The DOCUWARE PDF document does not exists": "El documento PDF Docuware no existe",
+ "It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar",
+ "It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo",
+ "It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas",
+ "A supplier with the same name already exists. Change the country.": "Un proveedor con el mismo nombre ya existe. Cambie el país.",
+ "There is no assigned email for this client": "No hay correo asignado para este cliente",
+ "Exists an invoice with a future date": "Existe una factura con fecha posterior",
+ "Invoice date can't be less than max date": "La fecha de factura no puede ser inferior a la fecha límite",
+ "Warehouse inventory not set": "El almacén inventario no está establecido",
+ "This locker has already been assigned": "Esta taquilla ya ha sido asignada",
+ "Tickets with associated refunds": "No se pueden borrar tickets con abonos asociados. Este ticket está asociado al abono Nº %d",
+ "Not exist this branch": "La rama no existe",
+ "This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado",
+ "Collection does not exist": "La colección no existe",
+ "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo",
+ "Insert a date range": "Inserte un rango de fechas",
+ "Added observation": "{{user}} añadió esta observacion: {{text}}",
+ "Comment added to client": "Observación añadida al cliente {{clientFk}}",
+ "Invalid auth code": "Código de verificación incorrecto",
+ "Invalid or expired verification code": "Código de verificación incorrecto o expirado",
+ "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
+ "company": "Compañía",
+ "country": "País",
+ "clientId": "Id cliente",
+ "clientSocialName": "Cliente",
+ "amount": "Importe",
+ "taxableBase": "Base",
+ "ticketFk": "Id ticket",
+ "isActive": "Activo",
+ "hasToInvoice": "Facturar",
+ "isTaxDataChecked": "Datos comprobados",
+ "comercialId": "Id comercial",
+ "comercialName": "Comercial",
+ "Pass expired": "La contraseña ha caducado, cambiela desde Salix",
+ "Invalid NIF for VIES": "Invalid NIF for VIES",
+ "Ticket does not exist": "Este ticket no existe",
+ "Ticket is already signed": "Este ticket ya ha sido firmado",
+ "Authentication failed": "Autenticación fallida",
+ "You can't use the same password": "No puedes usar la misma contraseña",
+ "You can only add negative amounts in refund tickets": "Solo se puede añadir cantidades negativas en tickets abono",
+ "Fecha fuera de rango": "Fecha fuera de rango",
+ "Error while generating PDF": "Error al generar PDF",
+ "Error when sending mail to client": "Error al enviar el correo al cliente",
+ "Mail not sent": "Se ha producido un fallo al enviar la factura al cliente [{{clientId}}]({{{clientUrl}}}), por favor revisa la dirección de correo electrónico",
+ "The renew period has not been exceeded": "El periodo de renovación no ha sido superado",
+ "Valid priorities": "Prioridades válidas: %d",
+ "Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}",
+ "You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado",
+ "This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %s",
+ "The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias",
+ "You cannot assign/remove an alias that you are not assigned to": "No puede asignar/eliminar un alias que no tenga asignado",
+ "This invoice has a linked vehicle.": "Esta factura tiene un vehiculo vinculado",
+ "You don't have enough privileges.": "No tienes suficientes permisos.",
+ "This ticket is locked.": "Este ticket está bloqueado.",
+ "This ticket is not editable.": "Este ticket no es editable.",
+ "The ticket doesn't exist.": "No existe el ticket.",
+ "Social name should be uppercase": "La razón social debe ir en mayúscula",
+ "Street should be uppercase": "La dirección fiscal debe ir en mayúscula",
+ "Ticket without Route": "Ticket sin ruta",
+ "Select a different customer": "Seleccione un cliente distinto",
+ "Fill all the fields": "Rellene todos los campos"
}
\ No newline at end of file
diff --git a/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
index 0b123dd3d..65b671716 100644
--- a/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
+++ b/modules/invoiceOut/back/methods/invoiceOut/transferInvoice.js
@@ -1,3 +1,5 @@
+const UserError = require('vn-loopback/util/user-error');
+
module.exports = Self => {
Self.remoteMethodCtx('transferInvoice', {
description: 'Transfer an issued invoice to another client',
@@ -6,7 +8,8 @@ module.exports = Self => {
{
arg: 'id',
type: 'number',
- required: true
+ required: true,
+ description: 'Issued invoice id'
},
{
arg: 'ref',
@@ -16,22 +19,18 @@ module.exports = Self => {
{
arg: 'newClientFk',
type: 'number',
- required: true
},
{
arg: 'cplusRectificationId',
type: 'number',
- required: true
},
{
arg: 'cplusInvoiceType477Id',
type: 'number',
- required: true
},
{
arg: 'invoiceCorrectionTypeId',
type: 'number',
- required: true
},
],
returns: {
@@ -44,26 +43,32 @@ module.exports = Self => {
}
});
- Self.transferInvoice = async(ctx, id, ref, newClientFk, cplusRectificationId, cplusInvoiceType477Id, invoiceCorrectionTypeId, options) => {
+ Self.transferInvoice = async(ctx, options) => {
const models = Self.app.models;
const myOptions = {userId: ctx.req.accessToken.userId};
-
+ const args = ctx.args;
let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
+ const {clientFk} = await models.InvoiceOut.findById(args.id);
+
+ if (clientFk == args.newClientFk)
+ throw new UserError(`Select a different customer`);
+
+ if (!args.newClientFk || !args.cplusRectificationId || !args.cplusInvoiceType477Id || !args.invoiceCorrectionTypeId)
+ throw new UserError(`Fill all the fields`);
+
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
- // Refund tickets and group
- const filterRef = {where: {refFk: ref}};
+ const filterRef = {where: {refFk: args.ref}};
const tickets = await models.Ticket.find(filterRef, myOptions);
const ticketsIds = tickets.map(ticket => ticket.id);
await models.Ticket.refund(ctx, ticketsIds, null, myOptions);
- // Clone tickets
const filterTicket = {where: {ticketFk: {inq: ticketsIds}}};
const services = await models.TicketService.find(filterTicket, myOptions);
@@ -75,28 +80,24 @@ module.exports = Self => {
const clonedTickets = await models.Sale.clone(salesIds, servicesIds, null, false, false, myOptions);
const clonedTicketIds = [];
- // Update client
for (const clonedTicket of clonedTickets) {
- await clonedTicket.updateAttribute('clientFk', newClientFk, myOptions);
+ await clonedTicket.updateAttribute('clientFk', args.newClientFk, myOptions);
clonedTicketIds.push(clonedTicket.id);
}
- // Quick invoice
const invoiceIds = await models.Ticket.invoiceTickets(ctx, clonedTicketIds, myOptions);
const [invoiceId] = invoiceIds;
- // Insert InvoiceCorrection
await models.InvoiceCorrection.create({
correctingFk: invoiceId,
- correctedFk: id,
- cplusRectificationTypeFk: cplusRectificationId,
- cplusInvoiceType477Fk: cplusInvoiceType477Id,
- invoiceCorrectionType: invoiceCorrectionTypeId
+ correctedFk: args.id,
+ cplusRectificationTypeFk: args.cplusRectificationId,
+ cplusInvoiceType477Fk: args.cplusInvoiceType477Id,
+ invoiceCorrectionType: args.invoiceCorrectionTypeId
}, myOptions);
if (tx) await tx.commit();
- // Crear PDF
await models.InvoiceOut.makePdfAndNotify(ctx, invoiceId, null);
return invoiceId;
diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js
index 9a3b5fedc..d899b3c44 100644
--- a/modules/ticket/back/methods/sale/clone.js
+++ b/modules/ticket/back/methods/sale/clone.js
@@ -28,7 +28,6 @@ module.exports = Self => {
const refundTickets = [];
const mappedTickets = new Map();
const now = Date.vnNew();
-
const [firstTicketId] = ticketsIds;
if (group) {
await createTicketRefund(
diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js
index 3f7e1cd21..ba7d71253 100644
--- a/modules/ticket/back/methods/sale/refund.js
+++ b/modules/ticket/back/methods/sale/refund.js
@@ -42,35 +42,10 @@ module.exports = Self => {
}
try {
- const refundAgencyMode = await models.AgencyMode.findOne({
- include: {
- relation: 'zones',
- scope: {
- limit: 1,
- field: ['id', 'name']
- }
- },
- where: {code: 'refund'}
- }, myOptions);
-
- const refoundZoneId = refundAgencyMode.zones()[0].id;
-
- const salesFilter = {
- where: {id: {inq: salesIds}},
- include: {
- relation: 'components',
- scope: {
- fields: ['saleFk', 'componentFk', 'value']
- }
- }
- };
- // const sales = await models.Sale.find(salesFilter, myOptions);
- const refundTicket = await models.Sale.clone(
+ const refundsTicket = await models.Sale.clone(
salesIds,
servicesIds,
withWarehouse,
- // refundAgencyMode,
- // refoundZoneId,
true,
true,
myOptions
@@ -78,36 +53,10 @@ module.exports = Self => {
if (tx && !options) await tx.commit();
- return refundTicket;
+ return refundsTicket[0];
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
-
- /* async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
- const models = Self.app.models;
-
- const filter = {include: {relation: 'address'}};
- const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
-
- const refundTicket = await models.Ticket.create({
- clientFk: ticket.clientFk,
- shipped: now,
- addressFk: ticket.address().id,
- agencyModeFk: refundAgencyMode.id,
- nickname: ticket.address().nickname,
- warehouseFk: withWarehouse ? ticket.warehouseFk : null,
- companyFk: ticket.companyFk,
- landed: now,
- zoneFk: refoundZoneId
- }, myOptions);
-
- await models.TicketRefund.create({
- refundTicketFk: refundTicket.id,
- originalTicketFk: ticket.id,
- }, myOptions);
-
- return refundTicket;
- } */
};
diff --git a/modules/ticket/back/methods/sale/specs/refund.spec.js b/modules/ticket/back/methods/sale/specs/refund.spec.js
index 727ce2fac..b81f7f84d 100644
--- a/modules/ticket/back/methods/sale/specs/refund.spec.js
+++ b/modules/ticket/back/methods/sale/specs/refund.spec.js
@@ -1,7 +1,7 @@
const models = require('vn-loopback/server/server').models;
const LoopBackContext = require('loopback-context');
-fdescribe('Sale refund()', () => {
+describe('Sale refund()', () => {
const userId = 5;
const ctx = {req: {accessToken: userId}};
const activeCtx = {
From 4761b0f7840c78d0ce8fbef765feec97fc834d9a Mon Sep 17 00:00:00 2001
From: jgallego
Date: Thu, 21 Sep 2023 10:41:20 +0200
Subject: [PATCH 120/427] =?UTF-8?q?fixes=20#4059=20a=C3=B1ado=20comillas?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/changes/234001/00-aclClient.sql | 16 ++++++++--------
db/changes/234001/01-aclAccount.sql | 10 +++++-----
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/db/changes/234001/00-aclClient.sql b/db/changes/234001/00-aclClient.sql
index 8e85c027b..109b3a4fb 100644
--- a/db/changes/234001/00-aclClient.sql
+++ b/db/changes/234001/00-aclClient.sql
@@ -1,19 +1,19 @@
-- No encuentro este back
-DELETE FROM salix.ACL WHERE property = 'activeWorkersWithRole';
-DELETE FROM salix.ACL WHERE model = 'Client' AND property = '*';
+DELETE FROM `salix`.`ACL` WHERE property = 'activeWorkersWithRole';
+DELETE FROM `salix`.`ACL` WHERE model = 'Client' AND property = '*';
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Client','findOne','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Client','findById','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Client','find','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Client','exists','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Client','__get__addresses','READ','ALLOW','ROLE','employee');
-DELETE FROM salix.ACL WHERE model = 'Client' AND property = '*' AND accessType IN (
+DELETE FROM `salix`.`ACL` WHERE model = 'Client' AND property = '*' AND accessType IN (
'campaignMetricsEmail',
'campaignMetricsPdf',
'clientDebtStatementEmail',
diff --git a/db/changes/234001/01-aclAccount.sql b/db/changes/234001/01-aclAccount.sql
index 0f2d6d48c..d749b52ab 100644
--- a/db/changes/234001/01-aclAccount.sql
+++ b/db/changes/234001/01-aclAccount.sql
@@ -1,10 +1,10 @@
-DELETE FROM salix.ACL WHERE model = 'Account' AND property = '*' AND principalId = 'employee';
+DELETE FROM `salix`.`ACL` WHERE model = 'Account' AND property = '*' AND principalId = 'employee';
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Account','findOne','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Account','findById','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Account','find','READ','ALLOW','ROLE','employee');
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('Account','exists','READ','ALLOW','ROLE','employee');
From 1f1dfae7e32bc6217b2b18f53cfd6cb7e79f47d4 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 21 Sep 2023 12:50:07 +0200
Subject: [PATCH 121/427] refs #5843 changes models
---
back/models/vn-user.json | 2 +-
db/changes/234001/00-dropUserFk.sql | 3 +-
db/changes/234001/01-deliveryAssistantACL.sql | 2 +-
db/changes/234001/01-workerCreate.sql | 20 +++++
db/dump/structure.sql | 82 ++-----------------
.../back/models/client-observation.json | 2 +-
modules/route/back/models/roadmap.json | 2 +-
modules/shelving/back/models/shelving.json | 2 +-
modules/worker/back/methods/worker/filter.js | 2 -
.../back/models/worker-time-control.json | 2 +-
modules/worker/front/search-panel/index.html | 4 +-
11 files changed, 35 insertions(+), 88 deletions(-)
create mode 100644 db/changes/234001/01-workerCreate.sql
diff --git a/back/models/vn-user.json b/back/models/vn-user.json
index 9131c9134..9e3f8df89 100644
--- a/back/models/vn-user.json
+++ b/back/models/vn-user.json
@@ -84,7 +84,7 @@
"worker": {
"type": "hasOne",
"model": "Worker",
- "foreignKey": "userFk"
+ "foreignKey": "id"
},
"userConfig": {
"type": "hasOne",
diff --git a/db/changes/234001/00-dropUserFk.sql b/db/changes/234001/00-dropUserFk.sql
index ad4db3110..d6ce328a8 100644
--- a/db/changes/234001/00-dropUserFk.sql
+++ b/db/changes/234001/00-dropUserFk.sql
@@ -1,5 +1,4 @@
-ALTER TABLE `vn`.`workerDocument` DROP FOREIGN KEY `workerDocument_ibfk_1`;
-
ALTER TABLE `vn`.`worker` DROP KEY `user_id_UNIQUE`;
ALTER TABLE `vn`.`worker` DROP COLUMN `userFk`;
+
diff --git a/db/changes/234001/01-deliveryAssistantACL.sql b/db/changes/234001/01-deliveryAssistantACL.sql
index 44459c432..504760d6f 100644
--- a/db/changes/234001/01-deliveryAssistantACL.sql
+++ b/db/changes/234001/01-deliveryAssistantACL.sql
@@ -1,5 +1,5 @@
-- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values.
-INSERT INTO `account`.`role` (name,description)
+INSERT INTO `account`.`role` (name, description)
VALUES ('deliveryAssistant','Jefe auxiliar repartos');
INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
diff --git a/db/changes/234001/01-workerCreate.sql b/db/changes/234001/01-workerCreate.sql
new file mode 100644
index 000000000..166c65a26
--- /dev/null
+++ b/db/changes/234001/01-workerCreate.sql
@@ -0,0 +1,20 @@
+DELIMITER $$
+$$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`workerCreate`(
+ vFirstname VARCHAR(50),
+ vLastName VARCHAR(50),
+ vCode CHAR(3),
+ vBossFk INT,
+ vUserFk INT,
+ vFi VARCHAR(15) ,
+ vBirth DATE
+)
+BEGIN
+/**
+ * Create new worker
+ *
+ */
+ INSERT INTO worker(id, code, firstName, lastName, bossFk, fi, birth)
+ VALUES (vUserFk, vCode, vFirstname, vLastName, vBossFk, vFi, vBirth);
+END$$
+DELIMITER ;
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index eea10eeed..73f6e92cb 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -24255,7 +24255,6 @@ BEGIN
CONCAT('Cliente ', NEW.id),
CONCAT('Recibida la documentación: ', vText)
FROM worker w
- LEFT JOIN account.user u ON w.id = u.id AND u.active
LEFT JOIN account.user u ON w.id = u.id AND u.active
LEFT JOIN account.account ac ON ac.id = u.id
WHERE w.id = NEW.salesPersonFk;
@@ -45804,23 +45803,6 @@ DELIMITER ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` FUNCTION `getWorkerCode`() RETURNS varchar(3) CHARSET utf8mb3 COLLATE utf8mb3_general_ci
- READS SQL DATA
-BEGIN
- DECLARE vUserCode VARCHAR(3) CHARSET utf8 COLLATE utf8_unicode_ci;
-
- SELECT code INTO vUserCode
- FROM worker
- WHERE userFk = account.myUser_getId();
-
- RETURN vUserCode;
-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 DROP FUNCTION IF EXISTS `hasAnyNegativeBase` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -48196,56 +48178,6 @@ DELIMITER ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` FUNCTION `workerIsBoss`(vUserId INT) RETURNS int(11)
- DETERMINISTIC
-BEGIN
-/**
- * Comprueba por jerarquía si el trabajador actual es jefe
- * de un trabajador en concreto.
- *
- * @param vUserId Id del trabajador que se desea comprobar.
- * @return Revuelve verdadero si es jefe del empleado por escala jerárquica.
- */
- DECLARE vWorkerId INT;
- DECLARE vBossId INT;
-
- SELECT id INTO vWorkerId
- FROM vn.worker
- WHERE userFk = vUserId;
- IF vWorkerId IS NULL THEN
- CALL util.throw('USER_NOT_FOUND');
- END IF;
-
- DROP TEMPORARY TABLE IF EXISTS tCheckedWorker;
- CREATE TEMPORARY TABLE tCheckedWorker
- (PRIMARY KEY (workerFk))
- ENGINE = MEMORY
- SELECT id workerFk FROM worker LIMIT 0;
- LOOP
- SELECT bossFk INTO vBossId
- FROM vn.worker
- WHERE id = vWorkerId;
- IF (SELECT COUNT(*) FROM tCheckedWorker WHERE workerFk = vBossId) THEN
- CALL util.throw('INFINITE_LOOP');
- END IF;
- IF vBossId = vWorkerId THEN
- RETURN FALSE;
- ELSEIF vBossId = account.myUser_getId() THEN
- RETURN TRUE;
- ELSE
- INSERT INTO tCheckedWorker VALUES (vWorkerId);
- SET vWorkerId = vBossId;
- END IF;
- END LOOP;
- DROP TEMPORARY TABLE tCheckedWorker;
- RETURN FALSE;
-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 DROP FUNCTION IF EXISTS `workerMachinery_isRegistered` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -71229,9 +71161,8 @@ BEGIN
IF (vLanding IS NULL) THEN
SELECT e.email INTO vSalesPersonEmail
- FROM vn.client c
- JOIN vn.worker sp ON sp.id = c.salesPersonFk
- JOIN account.emailUser e ON e.userFk = sp.userFk
+ FROM client c
+ JOIN account.emailUser e ON e.userFk = c.salesPersonFk
WHERE c.id = vClientFk;
SET vSubject = CONCAT('Turnos - No se ha podido clonar correctamente el ticket ',
@@ -73418,7 +73349,8 @@ BEGIN
at2.permissionRate,
at2.discountRate,
ct.hoursWeek hoursWeek,
- at2.isAllowedToWork
+ at2.isAllowedToWork,
+ u.userFk
FROM time t
LEFT JOIN business b ON t.dated BETWEEN b.started AND IFNULL(b.ended, vDatedTo)
LEFT JOIN worker w ON w.id = b.workerFk
@@ -73946,7 +73878,7 @@ BEGIN
CREATE TEMPORARY TABLE tmp.`user`
SELECT u.id userFk
FROM account.user u
- JOIN vn.worker w ON w.id = u.id
+ JOIN vn.worker w ON w.userFk = u.id
WHERE w.id = vWorkerFk;
CALL vn.timeControl_calculate(vDatedFrom, vDatedTo);
@@ -76048,8 +75980,7 @@ BEGIN
LIMIT 10000000000000000000)sub
GROUP BY cont
HAVING cont2 MOD 2 = 1
- )sub2
- JOIN worker w ON w.userFk = sub2.userFk;
+ )sub2;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -82085,7 +82016,6 @@ USE `vn`;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-
--
-- Final view structure for view `workerTimeJourneyNG`
--
diff --git a/modules/client/back/models/client-observation.json b/modules/client/back/models/client-observation.json
index b8852b186..95d00d374 100644
--- a/modules/client/back/models/client-observation.json
+++ b/modules/client/back/models/client-observation.json
@@ -41,7 +41,7 @@
"include": {
"relation": "worker",
"scope": {
- "fields": ["userFk"],
+ "fields": ["id"],
"include": {
"relation": "user",
"scope": {
diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json
index 7ca8fe0f6..2f6bb8c02 100644
--- a/modules/route/back/models/roadmap.json
+++ b/modules/route/back/models/roadmap.json
@@ -47,7 +47,7 @@
"worker": {
"type": "belongsTo",
"model": "Worker",
- "foreignKey": "userFk"
+ "foreignKey": "id"
},
"supplier": {
"type": "belongsTo",
diff --git a/modules/shelving/back/models/shelving.json b/modules/shelving/back/models/shelving.json
index 5f60318a5..aab569d7b 100644
--- a/modules/shelving/back/models/shelving.json
+++ b/modules/shelving/back/models/shelving.json
@@ -41,7 +41,7 @@
"worker": {
"type": "belongsTo",
"model": "Worker",
- "foreignKey": "userFk"
+ "foreignKey": "id"
}
}
}
diff --git a/modules/worker/back/methods/worker/filter.js b/modules/worker/back/methods/worker/filter.js
index 15a56949f..f9eae2db8 100644
--- a/modules/worker/back/methods/worker/filter.js
+++ b/modules/worker/back/methods/worker/filter.js
@@ -94,8 +94,6 @@ module.exports = Self => {
{'u.nickname': {like: `%${value}%`}}
]};
case 'id':
- case 'userFk':
- return {'w.id': value};
case 'firstName':
return {'w.firstName': {like: `%${value}%`}};
case 'lastName':
diff --git a/modules/worker/back/models/worker-time-control.json b/modules/worker/back/models/worker-time-control.json
index b045946e7..c40989d84 100644
--- a/modules/worker/back/models/worker-time-control.json
+++ b/modules/worker/back/models/worker-time-control.json
@@ -36,7 +36,7 @@
"worker": {
"type": "hasOne",
"model": "Worker",
- "foreignKey": "userFk"
+ "foreignKey": "id"
},
"warehouse": {
"type": "belongsTo",
diff --git a/modules/worker/front/search-panel/index.html b/modules/worker/front/search-panel/index.html
index 2adb56587..c93eef78b 100644
--- a/modules/worker/front/search-panel/index.html
+++ b/modules/worker/front/search-panel/index.html
@@ -18,7 +18,7 @@
+ ng-model="filter.id">
@@ -64,4 +64,4 @@
-
diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.js b/print/templates/reports/incoterms-authorization/incoterms-authorization.js
index 53425487e..0fbbd10d2 100755
--- a/print/templates/reports/incoterms-authorization/incoterms-authorization.js
+++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.js
@@ -17,6 +17,9 @@ module.exports = {
companyId: {
type: Number,
required: true
+ },
+ address: {
+ type: String
}
}
};
diff --git a/print/templates/reports/incoterms-authorization/locale/es.yml b/print/templates/reports/incoterms-authorization/locale/es.yml
index 6936ebda9..8bdce7085 100644
--- a/print/templates/reports/incoterms-authorization/locale/es.yml
+++ b/print/templates/reports/incoterms-authorization/locale/es.yml
@@ -1,28 +1,25 @@
reportName: autorizacion-incoterms
description: '{socialName} una sociedad debidamente constituida con responsabilidad limitada
-y registrada conforme al derecho de sociedades de {country} y aquí representada por
-___________________. {socialName}, con domicilio en {address},
+y registrada conforme al derecho de sociedades de {country} y aquí representada por {socialName}, con domicilio en {address},
CIF {fiscalID}. En adelante denominada {name}.'
issued: 'En {0}, a {1} de {2} de {3}'
client: 'Cliente {0}'
declaration: '{socialName} declara por la presente que:'
declarations:
- - 'Todas las compras realizadas por {socialName} con {companyName} se
-entregan, Ex Works (Incoterms), en el almacén de {companyName} situado en
-{companyCity}.'
- - '{socialName} reconoce que es importante para {companyName} tener
-comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para
+ - 'Todas las compras realizadas por {socialName} con {companyName} se entregan según las condiciones definidas en el incoterm {incotermsFk} ({Incoterm description}).'
+ - '{socialName} reconoce que es importante para {companyName} tener
+comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para
poder facturar con 0% de IVA.'
- - 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que
+ - 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que
se compren a {companyName} serán entregados a {destinationCountry}.'
- - 'Además, {socialName} deberá, a primera solicitud de {companyName},
-proporcionar una prueba de que todos los productos comprados a {companyName} han
+ - 'Además, {socialName} deberá, a primera solicitud de {companyName},
+proporcionar una prueba de que todos los productos comprados a {companyName} han
sido entregados en {destinationCountry}.'
- - 'Además de lo anterior, {companyName} proporcionará a {socialName}
-un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes).
-{socialName} firmará y devolverá el resumen mensual a {companyName},
+ - 'Además de lo anterior, {companyName} proporcionará a {socialName}
+un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes).
+{socialName} firmará y devolverá el resumen mensual a {companyName},
S.L. dentro de los 5 días posteriores a la recepción del resumen.'
-signer:
+signer:
representative: Representante
representativeRole: Cargo del representante
signed: Fecha de firma
@@ -39,4 +36,4 @@ months:
- 'Septiembre'
- 'Octubre'
- 'Noviembre'
- - 'Diciembre'
\ No newline at end of file
+ - 'Diciembre'
diff --git a/print/templates/reports/incoterms-authorization/locale/pt.yml b/print/templates/reports/incoterms-authorization/locale/pt.yml
index 2d33e6a1a..996c0961e 100644
--- a/print/templates/reports/incoterms-authorization/locale/pt.yml
+++ b/print/templates/reports/incoterms-authorization/locale/pt.yml
@@ -1,28 +1,27 @@
reportName: autorizacion-incoterms
description: '{socialName} uma sociedade devidamente constituída com responsabilidade limitada e registada
-conforme ao direito de sociedades da {country} e aqui representada por
-___________________. {socialName}, com domicílio em {address},
+conforme ao direito de sociedades da {country} e aqui representada por {socialName}, com domicílio em {address},
CIF {fiscalID}. Em adiante denominada {name}.'
issued: 'Em {0}, em {1} de {2} de {3}'
client: 'Cliente {0}'
declaration: '{socialName} declara através da presente que:'
declarations:
- - 'Todas as compras realizadas por {socialName} a {companyName} se entregam,
+ - 'Todas as compras realizadas por {socialName} a {companyName} se entregam,
Ex Works (Incoterms), no armazém da {companyName} situado em
{companyCity}.'
- - '{socialName} reconhece ser importante para {companyName}
- ter o comprovante da entrega intracomunitária da mercadoria a {destinationCountry}
+ - '{socialName} reconhece ser importante para {companyName}
+ ter o comprovante da entrega intracomunitária da mercadoria em {destinationCountry}
para poder faturar com 0% de IVA.'
- - 'Portanto, ao assinar este acordo, {socialName} declara que todos os bens
+ - 'Portanto, ao assinar este acordo, {socialName} declara que todos os bens
que se comprem na {companyName} serão entregues na {destinationCountry}.'
- 'Além disto, {socialName} deverá, na primeira solicitude da {companyName},
- proporcionar uma prova de que todos os produtos comprados na {companyName}
- foram entregues na {destinationCountry}.'
- - 'Além do anterio, {companyName} proporcionará a {socialName}
+ proporcionar uma prova de que todos os produtos comprados em {companyName}
+ foram entregues em {destinationCountry}.'
+ - 'Além do anterior, {companyName} proporcionará a {socialName}
um resumo mensal onde se incluem todas as faturas (e as entregas correspondentes).
{socialName} assinará e devolverá o resumo mensal à {companyName},
dentro dos 5 dias posteriores à receção do resumo.'
-signer:
+signer:
representative: Representante
representativeRole: Cargo de representante
signed: Data da assinatura
@@ -39,4 +38,4 @@ months:
- 'Setembro'
- 'Outubro'
- 'Novembro'
- - 'Dezembro'
\ No newline at end of file
+ - 'Dezembro'
From 850df643489f5025453379e822e1ff3ba7e6b0a7 Mon Sep 17 00:00:00 2001
From: pablone
Date: Thu, 21 Sep 2023 14:59:26 +0200
Subject: [PATCH 123/427] refs #6159 moveChangefile
---
db/changes/{233801 => 234001}/00-updateAfterBusinnesInsert.sql | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename db/changes/{233801 => 234001}/00-updateAfterBusinnesInsert.sql (100%)
diff --git a/db/changes/233801/00-updateAfterBusinnesInsert.sql b/db/changes/234001/00-updateAfterBusinnesInsert.sql
similarity index 100%
rename from db/changes/233801/00-updateAfterBusinnesInsert.sql
rename to db/changes/234001/00-updateAfterBusinnesInsert.sql
From a78348f2de7624b3e44b004ede1f055659c256c0 Mon Sep 17 00:00:00 2001
From: alexm
Date: Thu, 21 Sep 2023 15:06:14 +0200
Subject: [PATCH 124/427] refs #6067 feat(account_basicData): use
vnUser/preview
---
modules/account/front/basic-data/index.html | 14 ++++++++------
modules/account/front/basic-data/index.js | 7 +++++++
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/modules/account/front/basic-data/index.html b/modules/account/front/basic-data/index.html
index 6f757753e..1f7ce1a05 100644
--- a/modules/account/front/basic-data/index.html
+++ b/modules/account/front/basic-data/index.html
@@ -1,9 +1,11 @@
+
+ where="{id: $ctrl.$params.id}"
+ form="form"
+ save="post">