diff --git a/CHANGELOG.md b/CHANGELOG.md
index 36347bd19..76527ac83 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
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).
-## [2328.01] - 2023-07-13
+## [2330.01] - 2023-07-27
### Added
@@ -14,12 +14,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
+## [2328.01] - 2023-07-13
+
+### Added
+- (Clientes -> Morosos) Añadida columna "es trabajador"
+- (Trabajadores -> Departamentos) Nueva sección
+- (Trabajadores -> Departamentos) Añadido listado de Trabajadores por departamento
+- (Trabajadores -> Departamentos) Añadido características de departamento e información
+
+### Changed
+
+### Fixed
+- (Trabajadores -> Departamentos) Arreglado búscador
+
+
## [2326.01] - 2023-06-29
### Added
- (Entradas -> Correo) Al cambiar el tipo de cambio enviará un correo a las personas designadas
- (General -> Históricos) Botón para ver el estado del registro en cada punto
- (General -> Históricos) Al filtar por registro se muestra todo el histórial desde que fue creado
+- (Tickets -> Índice) Permite enviar varios albaranes a Docuware
### Changed
- (General -> Históricos) Los registros se muestran agrupados por usuario y entidad
diff --git a/back/methods/vn-user/renew-token.js b/back/methods/vn-user/renew-token.js
index 41470dfea..9850267d6 100644
--- a/back/methods/vn-user/renew-token.js
+++ b/back/methods/vn-user/renew-token.js
@@ -17,23 +17,22 @@ module.exports = Self => {
Self.renewToken = async function(ctx) {
const models = Self.app.models;
- const userId = ctx.req.accessToken.userId;
- const created = ctx.req.accessToken.created;
- const tokenId = ctx.req.accessToken.id;
+ const token = ctx.req.accessToken;
const now = new Date();
- const differenceMilliseconds = now - created;
+ const differenceMilliseconds = now - token.created;
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
- const accessTokenConfig = await models.AccessTokenConfig.findOne({fields: ['renewPeriod']});
+ const fields = ['renewPeriod', 'courtesyTime'];
+ const accessTokenConfig = await models.AccessTokenConfig.findOne({fields});
- if (differenceSeconds <= accessTokenConfig.renewPeriod)
- throw new UserError(`The renew period has not been exceeded`);
+ if (differenceSeconds < accessTokenConfig.renewPeriod - accessTokenConfig.courtesyTime)
+ throw new UserError(`The renew period has not been exceeded`, 'periodNotExceeded');
- await Self.logout(tokenId);
- const user = await Self.findById(userId);
+ await Self.logout(token.id);
+ const user = await Self.findById(token.userId);
const accessToken = await user.createAccessToken();
- return {token: accessToken.id, created: accessToken.created};
+ return {id: accessToken.id, ttl: accessToken.ttl};
};
};
diff --git a/back/methods/vn-user/sign-in.js b/back/methods/vn-user/sign-in.js
new file mode 100644
index 000000000..73cc705de
--- /dev/null
+++ b/back/methods/vn-user/sign-in.js
@@ -0,0 +1,102 @@
+const ForbiddenError = require('vn-loopback/util/forbiddenError');
+const UserError = require('vn-loopback/util/user-error');
+
+module.exports = Self => {
+ Self.remoteMethodCtx('signIn', {
+ description: 'Login a user with username/email and password',
+ accepts: [
+ {
+ arg: 'user',
+ type: 'String',
+ description: 'The user name or email',
+ required: true
+ }, {
+ arg: 'password',
+ type: 'String',
+ description: 'The password'
+ }
+ ],
+ returns: {
+ type: 'object',
+ root: true
+ },
+ http: {
+ path: `/sign-in`,
+ verb: 'POST'
+ }
+ });
+
+ Self.signIn = async function(ctx, user, password, options) {
+ const myOptions = {};
+ if (typeof options == 'object')
+ Object.assign(myOptions, options);
+
+ const where = Self.userUses(user);
+ const vnUser = await Self.findOne({
+ fields: ['id', 'name', 'password', 'active', 'email', 'passExpired', 'twoFactor'],
+ where
+ }, myOptions);
+
+ const validCredentials = vnUser
+ && await vnUser.hasPassword(password);
+
+ if (validCredentials) {
+ if (!vnUser.active)
+ throw new UserError('User disabled');
+ await Self.sendTwoFactor(ctx, vnUser, myOptions);
+ await Self.passExpired(vnUser, myOptions);
+
+ if (vnUser.twoFactor)
+ throw new ForbiddenError(null, 'REQUIRES_2FA');
+ }
+
+ return Self.validateLogin(user, password);
+ };
+
+ Self.passExpired = async(vnUser, myOptions) => {
+ const today = Date.vnNew();
+ today.setHours(0, 0, 0, 0);
+
+ if (vnUser.passExpired && vnUser.passExpired.getTime() <= today.getTime()) {
+ const $ = Self.app.models;
+ const changePasswordToken = await $.AccessToken.create({
+ scopes: ['changePassword'],
+ userId: vnUser.id
+ }, myOptions);
+ const err = new UserError('Pass expired', 'passExpired');
+ changePasswordToken.twoFactor = vnUser.twoFactor ? true : false;
+ err.details = {token: changePasswordToken};
+ throw err;
+ }
+ };
+
+ Self.sendTwoFactor = async(ctx, vnUser, myOptions) => {
+ if (vnUser.twoFactor === 'email') {
+ const $ = Self.app.models;
+
+ const code = String(Math.floor(Math.random() * 999999));
+ const maxTTL = ((60 * 1000) * 5); // 5 min
+ await $.AuthCode.upsertWithWhere({userFk: vnUser.id}, {
+ userFk: vnUser.id,
+ code: code,
+ expires: Date.vnNow() + maxTTL
+ }, myOptions);
+
+ const headers = ctx.req.headers;
+ const platform = headers['sec-ch-ua-platform']?.replace(/['"=]+/g, '');
+ const browser = headers['sec-ch-ua']?.replace(/['"=]+/g, '');
+ const params = {
+ args: {
+ recipientId: vnUser.id,
+ recipient: vnUser.email,
+ code: code,
+ ip: ctx.req?.connection?.remoteAddress,
+ device: platform && browser ? platform + ', ' + browser : headers['user-agent'],
+ },
+ req: {getLocale: ctx.req.getLocale},
+ };
+
+ await Self.sendTemplate(params, 'auth-code', true);
+ }
+ };
+};
diff --git a/back/methods/vn-user/signIn.js b/back/methods/vn-user/signIn.js
deleted file mode 100644
index c98f1da54..000000000
--- a/back/methods/vn-user/signIn.js
+++ /dev/null
@@ -1,81 +0,0 @@
-const UserError = require('vn-loopback/util/user-error');
-
-module.exports = Self => {
- Self.remoteMethod('signIn', {
- description: 'Login a user with username/email and password',
- accepts: [
- {
- arg: 'user',
- type: 'String',
- description: 'The user name or email',
- http: {source: 'form'},
- required: true
- }, {
- arg: 'password',
- type: 'String',
- description: 'The password'
- }
- ],
- returns: {
- type: 'object',
- root: true
- },
- http: {
- path: `/signIn`,
- verb: 'POST'
- }
- });
-
- Self.signIn = async function(user, password) {
- const models = Self.app.models;
- const usesEmail = user.indexOf('@') !== -1;
- let token;
-
- const userInfo = usesEmail
- ? {email: user}
- : {username: user};
- const instance = await Self.findOne({
- fields: ['username', 'password'],
- where: userInfo
- });
-
- const where = usesEmail
- ? {email: user}
- : {name: user};
- const vnUser = await Self.findOne({
- fields: ['id', 'active', 'passExpired'],
- where
- });
-
- const today = Date.vnNew();
- today.setHours(0, 0, 0, 0);
-
- const validCredentials = instance
- && await instance.hasPassword(password);
-
- if (validCredentials) {
- if (!vnUser.active)
- throw new UserError('User disabled');
-
- if (vnUser.passExpired && vnUser.passExpired.getTime() <= today.getTime()) {
- const changePasswordToken = await models.AccessToken.create({
- scopes: ['change-password'],
- userId: vnUser.id
- });
- const err = new UserError('Pass expired', 'passExpired');
- err.details = {token: changePasswordToken};
- throw err;
- }
-
- try {
- await models.Account.sync(instance.username, password);
- } catch (err) {
- console.warn(err);
- }
- }
-
- let loginInfo = Object.assign({password}, userInfo);
- token = await Self.login(loginInfo, 'user');
- return {token: token.id, created: token.created};
- };
-};
diff --git a/back/methods/vn-user/specs/sign-in.spec.js b/back/methods/vn-user/specs/sign-in.spec.js
new file mode 100644
index 000000000..f4cad88b9
--- /dev/null
+++ b/back/methods/vn-user/specs/sign-in.spec.js
@@ -0,0 +1,101 @@
+const {models} = require('vn-loopback/server/server');
+
+describe('VnUser Sign-in()', () => {
+ const employeeId = 1;
+ const unauthCtx = {
+ req: {
+ headers: {},
+ connection: {
+ remoteAddress: '127.0.0.1'
+ },
+ getLocale: () => 'en'
+ },
+ args: {}
+ };
+ const {VnUser, AccessToken} = models;
+ describe('when credentials are correct', () => {
+ it('should return the token', async() => {
+ let login = await VnUser.signIn(unauthCtx, 'salesAssistant', 'nightmare');
+ let accessToken = await AccessToken.findById(login.token);
+ let ctx = {req: {accessToken: accessToken}};
+
+ expect(login.token).toBeDefined();
+
+ await VnUser.logout(ctx.req.accessToken.id);
+ });
+
+ it('should return the token if the user doesnt exist but the client does', async() => {
+ let login = await VnUser.signIn(unauthCtx, 'PetterParker', 'nightmare');
+ let accessToken = await AccessToken.findById(login.token);
+ let ctx = {req: {accessToken: accessToken}};
+
+ expect(login.token).toBeDefined();
+
+ await VnUser.logout(ctx.req.accessToken.id);
+ });
+ });
+
+ describe('when credentials are incorrect', () => {
+ it('should throw a 401 error', async() => {
+ let error;
+
+ try {
+ await VnUser.signIn(unauthCtx, 'IDontExist', 'TotallyWrongPassword');
+ } catch (e) {
+ error = e;
+ }
+
+ expect(error).toBeDefined();
+ expect(error.statusCode).toBe(401);
+ expect(error.code).toBe('LOGIN_FAILED');
+ });
+ });
+
+ describe('when two-factor auth is required', () => {
+ it('should throw a 403 error', async() => {
+ const employee = await VnUser.findById(employeeId);
+ const tx = await VnUser.beginTransaction({});
+
+ let error;
+ try {
+ const options = {transaction: tx};
+ await employee.updateAttribute('twoFactor', 'email', options);
+
+ await VnUser.signIn(unauthCtx, 'employee', 'nightmare', options);
+ await tx.rollback();
+ } catch (e) {
+ await tx.rollback();
+ error = e;
+ }
+
+ expect(error).toBeDefined();
+ expect(error.statusCode).toBe(403);
+ expect(error.code).toBe('REQUIRES_2FA');
+ });
+ });
+
+ describe('when passExpired', () => {
+ it('should throw a passExpired error', async() => {
+ const tx = await VnUser.beginTransaction({});
+ const employee = await VnUser.findById(employeeId);
+ const yesterday = Date.vnNew();
+ yesterday.setDate(yesterday.getDate() - 1);
+
+ let error;
+ try {
+ const options = {transaction: tx};
+ await employee.updateAttribute('passExpired', yesterday, options);
+
+ await VnUser.signIn(unauthCtx, 'employee', 'nightmare', options);
+ await tx.rollback();
+ } catch (e) {
+ await tx.rollback();
+ error = e;
+ }
+
+ expect(error).toBeDefined();
+ expect(error.statusCode).toBe(400);
+ expect(error.message).toBe('Pass expired');
+ });
+ });
+});
diff --git a/back/methods/vn-user/specs/signIn.spec.js b/back/methods/vn-user/specs/signIn.spec.js
deleted file mode 100644
index c3f4630c6..000000000
--- a/back/methods/vn-user/specs/signIn.spec.js
+++ /dev/null
@@ -1,41 +0,0 @@
-const {models} = require('vn-loopback/server/server');
-
-describe('VnUser signIn()', () => {
- describe('when credentials are correct', () => {
- it('should return the token', async() => {
- let login = await models.VnUser.signIn('salesAssistant', 'nightmare');
- let accessToken = await models.AccessToken.findById(login.token);
- let ctx = {req: {accessToken: accessToken}};
-
- expect(login.token).toBeDefined();
-
- await models.VnUser.logout(ctx.req.accessToken.id);
- });
-
- it('should return the token if the user doesnt exist but the client does', async() => {
- let login = await models.VnUser.signIn('PetterParker', 'nightmare');
- let accessToken = await models.AccessToken.findById(login.token);
- let ctx = {req: {accessToken: accessToken}};
-
- expect(login.token).toBeDefined();
-
- await models.VnUser.logout(ctx.req.accessToken.id);
- });
- });
-
- describe('when credentials are incorrect', () => {
- it('should throw a 401 error', async() => {
- let error;
-
- try {
- await models.VnUser.signIn('IDontExist', 'TotallyWrongPassword');
- } catch (e) {
- error = e;
- }
-
- expect(error).toBeDefined();
- expect(error.statusCode).toBe(401);
- expect(error.code).toBe('LOGIN_FAILED');
- });
- });
-});
diff --git a/back/methods/vn-user/specs/validate-auth.spec.js b/back/methods/vn-user/specs/validate-auth.spec.js
new file mode 100644
index 000000000..8018bd3e1
--- /dev/null
+++ b/back/methods/vn-user/specs/validate-auth.spec.js
@@ -0,0 +1,52 @@
+const {models} = require('vn-loopback/server/server');
+
+describe('VnUser validate-auth()', () => {
+ describe('validateAuth', () => {
+ it('should signin if data is correct', async() => {
+ await models.AuthCode.create({
+ userFk: 9,
+ code: '555555',
+ expires: Date.vnNow() + (60 * 1000)
+ });
+ const token = await models.VnUser.validateAuth('developer', 'nightmare', '555555');
+
+ expect(token.token).toBeDefined();
+ });
+ });
+
+ describe('validateCode', () => {
+ it('should throw an error for a non existent code', async() => {
+ let error;
+ try {
+ await models.VnUser.validateCode('developer', '123456');
+ } catch (e) {
+ error = e;
+ }
+
+ expect(error).toBeDefined();
+ expect(error.statusCode).toBe(400);
+ expect(error.message).toEqual('Invalid or expired verification code');
+ });
+
+ it('should throw an error when a code doesn`t match the login username', async() => {
+ let error;
+ let authCode;
+ try {
+ authCode = await models.AuthCode.create({
+ userFk: 1,
+ code: '555555',
+ expires: Date.vnNow() + (60 * 1000)
+ });
+
+ await models.VnUser.validateCode('developer', '555555');
+ } catch (e) {
+ authCode && await authCode.destroy();
+ error = e;
+ }
+
+ expect(error).toBeDefined();
+ expect(error.statusCode).toBe(400);
+ expect(error.message).toEqual('Authentication failed');
+ });
+ });
+});
diff --git a/back/methods/vn-user/validate-auth.js b/back/methods/vn-user/validate-auth.js
new file mode 100644
index 000000000..beab43417
--- /dev/null
+++ b/back/methods/vn-user/validate-auth.js
@@ -0,0 +1,66 @@
+const UserError = require('vn-loopback/util/user-error');
+
+module.exports = Self => {
+ Self.remoteMethod('validateAuth', {
+ description: 'Login a user with username/email and password',
+ accepts: [
+ {
+ arg: 'user',
+ type: 'String',
+ description: 'The user name or email',
+ required: true
+ },
+ {
+ arg: 'password',
+ type: 'String',
+ description: 'The password'
+ },
+ {
+ arg: 'code',
+ type: 'String',
+ description: 'The auth code'
+ }
+ ],
+ returns: {
+ type: 'object',
+ root: true
+ },
+ http: {
+ path: `/validate-auth`,
+ verb: 'POST'
+ }
+ });
+
+ Self.validateAuth = async(username, password, code, options) => {
+ const myOptions = {};
+ if (typeof options == 'object')
+ Object.assign(myOptions, options);
+
+ const token = Self.validateLogin(username, password);
+ await Self.validateCode(username, code, myOptions);
+ return token;
+ };
+
+ Self.validateCode = async(username, code, myOptions) => {
+ const {AuthCode} = Self.app.models;
+
+ const authCode = await AuthCode.findOne({
+ where: {
+ code: code
+ }
+ }, myOptions);
+
+ const expired = authCode && Date.vnNow() > authCode.expires;
+ if (!authCode || expired)
+ throw new UserError('Invalid or expired verification code');
+
+ const user = await Self.findById(authCode.userFk, {
+ fields: ['name', 'twoFactor']
+ }, myOptions);
+
+ if (user.name !== username)
+ throw new UserError('Authentication failed');
+
+ await authCode.destroy(myOptions);
+ };
+};
diff --git a/back/model-config.json b/back/model-config.json
index d945f3250..0e37bf527 100644
--- a/back/model-config.json
+++ b/back/model-config.json
@@ -1,7 +1,4 @@
{
- "AccountingType": {
- "dataSource": "vn"
- },
"AccessTokenConfig": {
"dataSource": "vn",
"options": {
@@ -10,6 +7,12 @@
}
}
},
+ "AccountingType": {
+ "dataSource": "vn"
+ },
+ "AuthCode": {
+ "dataSource": "vn"
+ },
"Bank": {
"dataSource": "vn"
},
diff --git a/back/models/access-token-config.json b/back/models/access-token-config.json
index 6d90a0f4d..d5838a158 100644
--- a/back/models/access-token-config.json
+++ b/back/models/access-token-config.json
@@ -16,6 +16,10 @@
"type": "number",
"required": true
},
+ "courtesyTime": {
+ "type": "number",
+ "required": true
+ },
"renewInterval": {
"type": "number",
"required": true
diff --git a/back/models/auth-code.json b/back/models/auth-code.json
new file mode 100644
index 000000000..b6a89115f
--- /dev/null
+++ b/back/models/auth-code.json
@@ -0,0 +1,31 @@
+{
+ "name": "AuthCode",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "salix.authCode"
+ }
+ },
+ "properties": {
+ "userFk": {
+ "type": "number",
+ "required": true,
+ "id": true
+ },
+ "code": {
+ "type": "string",
+ "required": true
+ },
+ "expires": {
+ "type": "number",
+ "required": true
+ }
+ },
+ "relations": {
+ "user": {
+ "type": "belongsTo",
+ "model": "Account",
+ "foreignKey": "userFk"
+ }
+ }
+}
diff --git a/back/models/vn-user.js b/back/models/vn-user.js
index b58395acc..a7ce12073 100644
--- a/back/models/vn-user.js
+++ b/back/models/vn-user.js
@@ -5,11 +5,12 @@ const {Email} = require('vn-print');
module.exports = function(Self) {
vnModel(Self);
- require('../methods/vn-user/signIn')(Self);
+ require('../methods/vn-user/sign-in')(Self);
require('../methods/vn-user/acl')(Self);
require('../methods/vn-user/recover-password')(Self);
require('../methods/vn-user/validate-token')(Self);
require('../methods/vn-user/privileges')(Self);
+ require('../methods/vn-user/validate-auth')(Self);
require('../methods/vn-user/renew-token')(Self);
Self.definition.settings.acls = Self.definition.settings.acls.filter(acl => acl.property !== 'create');
@@ -111,6 +112,18 @@ module.exports = function(Self) {
return email.send();
});
+ Self.validateLogin = async function(user, password) {
+ let loginInfo = Object.assign({password}, Self.userUses(user));
+ token = await Self.login(loginInfo, 'user');
+ return {token: token.id, ttl: token.ttl};
+ };
+
+ Self.userUses = function(user) {
+ return user.indexOf('@') !== -1
+ ? {email: user}
+ : {username: user};
+ };
+
const _setPassword = Self.prototype.setPassword;
Self.prototype.setPassword = async function(newPassword, options, cb) {
if (cb === undefined && typeof options === 'function') {
@@ -143,8 +156,9 @@ module.exports = function(Self) {
}
};
- Self.sharedClass._methods.find(method => method.name == 'changePassword')
- .accessScopes = ['change-password'];
+ Self.sharedClass._methods.find(method => method.name == 'changePassword').ctor.settings.acls =
+ Self.sharedClass._methods.find(method => method.name == 'changePassword').ctor.settings.acls
+ .filter(acl => acl.property != 'changePassword');
// FIXME: https://redmine.verdnatura.es/issues/5761
// Self.afterRemote('prototype.patchAttributes', async(ctx, instance) => {
diff --git a/back/models/vn-user.json b/back/models/vn-user.json
index 61e42f77a..9131c9134 100644
--- a/back/models/vn-user.json
+++ b/back/models/vn-user.json
@@ -59,7 +59,10 @@
},
"passExpired": {
"type": "date"
- }
+ },
+ "twoFactor": {
+ "type": "string"
+ }
},
"relations": {
"role": {
@@ -111,6 +114,13 @@
"principalId": "$authenticated",
"permission": "ALLOW"
},
+ {
+ "property": "validateAuth",
+ "accessType": "EXECUTE",
+ "principalType": "ROLE",
+ "principalId": "$everyone",
+ "permission": "ALLOW"
+ },
{
"property": "privileges",
"accessType": "*",
diff --git a/db/changes/232601/00-salix.sql b/db/changes/232601/00-salix.sql
index dc1ed69be..44366abce 100644
--- a/db/changes/232601/00-salix.sql
+++ b/db/changes/232601/00-salix.sql
@@ -1,10 +1,11 @@
CREATE TABLE `salix`.`accessTokenConfig` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`renewPeriod` int(10) unsigned DEFAULT NULL,
+ `courtesyTime` int(10) unsigned DEFAULT NULL,
`renewInterval` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
-INSERT IGNORE INTO `salix`.`accessTokenConfig` (`id`, `renewPeriod`, `renewInterval`)
+INSERT IGNORE INTO `salix`.`accessTokenConfig` (`id`, `renewPeriod`, `courtesyTime`, `renewInterval`)
VALUES
- (1, 21600, 300);
+ (1, 21600, 5, 300);
diff --git a/db/changes/232601/01-invoiceOutPdf.sql b/db/changes/232601/01-invoiceOutPdf.sql
index 38e0b8bbb..e013736df 100644
--- a/db/changes/232601/01-invoiceOutPdf.sql
+++ b/db/changes/232601/01-invoiceOutPdf.sql
@@ -1,9 +1,9 @@
-INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES
('InvoiceOut','makePdfAndNotify','WRITE','ALLOW','ROLE','invoicing'),
('InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing');
-CREATE OR REPLACE TABLE vn.invoiceOutConfig (
+CREATE OR REPLACE TABLE `vn`.`invoiceOutConfig` (
id INT UNSIGNED auto_increment NOT NULL,
parallelism int UNSIGNED DEFAULT 1 NOT NULL,
PRIMARY KEY (id)
diff --git a/db/changes/232801/00-authCode.sql b/db/changes/232801/00-authCode.sql
new file mode 100644
index 000000000..a256db43f
--- /dev/null
+++ b/db/changes/232801/00-authCode.sql
@@ -0,0 +1,13 @@
+create table `salix`.`authCode`
+(
+ userFk int UNSIGNED not null,
+ code int not null,
+ expires bigint not null,
+ constraint authCode_pk
+ primary key (userFk),
+ constraint authCode_unique
+ unique (code),
+ constraint authCode_user_id_fk
+ foreign key (userFk) references `account`.`user` (id)
+ on update cascade on delete cascade
+);
diff --git a/db/changes/232801/00-client_create.sql b/db/changes/232801/00-client_create.sql
new file mode 100644
index 000000000..d21094dad
--- /dev/null
+++ b/db/changes/232801/00-client_create.sql
@@ -0,0 +1,89 @@
+DROP PROCEDURE IF EXISTS `vn`.`clientCreate`;
+
+DELIMITER $$
+CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_create`(
+ vFirstname VARCHAR(50),
+ vSurnames VARCHAR(50),
+ vFi VARCHAR(9),
+ vAddress TEXT,
+ vPostcode CHAR(5),
+ vCity VARCHAR(25),
+ vProvinceFk SMALLINT(5),
+ vCompanyFk SMALLINT(5),
+ vPhone VARCHAR(11),
+ vEmail VARCHAR(255),
+ vUserFk INT
+)
+BEGIN
+/**
+ * Create new client
+ *
+ * @params vFirstname firstName
+ * @params vSurnames surnames
+ * @params vFi company code from accounting transactions
+ * @params vAddress address
+ * @params vPostcode postCode
+ * @params vCity city
+ * @params vProvinceFk province
+ * @params vCompanyFk company in which he has become a client
+ * @params vPhone telephone number
+ * @params vEmail email address
+ * @params vUserFk user id
+ */
+ DECLARE vPayMethodFk INT;
+ DECLARE vDueDay INT;
+ DECLARE vDefaultCredit DECIMAL(10, 2);
+ DECLARE vIsTaxDataChecked TINYINT(1);
+ DECLARE vHasCoreVnl BOOLEAN;
+ DECLARE vMandateTypeFk INT;
+
+ SELECT defaultPayMethodFk,
+ defaultDueDay,
+ defaultCredit,
+ defaultIsTaxDataChecked,
+ defaultHasCoreVnl,
+ defaultMandateTypeFk
+ INTO vPayMethodFk,
+ vDueDay,
+ vDefaultCredit,
+ vIsTaxDataChecked,
+ vHasCoreVnl,
+ vMandateTypeFk
+ FROM clientConfig;
+
+ INSERT INTO `client`
+ SET id = vUserFk,
+ name = CONCAT(vFirstname, ' ', vSurnames),
+ street = vAddress,
+ fi = TRIM(vFi),
+ phone = vPhone,
+ email = vEmail,
+ provinceFk = vProvinceFk,
+ city = vCity,
+ postcode = vPostcode,
+ socialName = CONCAT(vSurnames, ' ', vFirstname),
+ payMethodFk = vPayMethodFk,
+ dueDay = vDueDay,
+ credit = vDefaultCredit,
+ isTaxDataChecked = vIsTaxDataChecked,
+ hasCoreVnl = vHasCoreVnl,
+ isEqualizated = FALSE
+ ON duplicate KEY UPDATE
+ payMethodFk = vPayMethodFk,
+ dueDay = vDueDay,
+ credit = vDefaultCredit,
+ isTaxDataChecked = vIsTaxDataChecked,
+ hasCoreVnl = vHasCoreVnl,
+ isActive = TRUE;
+
+ INSERT INTO mandate (clientFk, companyFk, mandateTypeFk)
+ SELECT vUserFk, vCompanyFk, vMandateTypeFk
+ WHERE NOT EXISTS (
+ SELECT id
+ FROM mandate
+ WHERE clientFk = vUserFk
+ AND companyFk = vCompanyFk
+ AND mandateTypeFk = vMandateTypeFk
+ );
+END$$
+DELIMITER ;
diff --git a/db/changes/232801/00-client_create2.sql b/db/changes/232801/00-client_create2.sql
new file mode 100644
index 000000000..f2e660351
--- /dev/null
+++ b/db/changes/232801/00-client_create2.sql
@@ -0,0 +1,17 @@
+ALTER TABLE `vn`.`clientConfig` ADD defaultPayMethodFk tinyint(3) unsigned NULL;
+ALTER TABLE `vn`.`clientConfig` ADD defaultDueDay int unsigned NULL;
+ALTER TABLE `vn`.`clientConfig` ADD defaultCredit decimal(10, 2) NULL;
+ALTER TABLE `vn`.`clientConfig` ADD defaultIsTaxDataChecked tinyint(1) NULL;
+ALTER TABLE `vn`.`clientConfig` ADD defaultHasCoreVnl boolean NULL;
+ALTER TABLE `vn`.`clientConfig` ADD defaultMandateTypeFk smallint(5) NULL;
+ALTER TABLE `vn`.`clientConfig` ADD CONSTRAINT clientNewConfigPayMethod_FK FOREIGN KEY (defaultPayMethodFk) REFERENCES vn.payMethod(id);
+ALTER TABLE `vn`.`clientConfig` ADD CONSTRAINT clientNewConfigMandateType_FK FOREIGN KEY (defaultMandateTypeFk) REFERENCES vn.mandateType(id);
+
+UPDATE `vn`.`clientConfig`
+ SET defaultPayMethodFk = 4,
+ defaultDueDay = 5,
+ defaultCredit = 300.0,
+ defaultIsTaxDataChecked = 1,
+ defaultHasCoreVnl = 1,
+ defaultMandateTypeFk = 2
+ WHERE id = 1;
diff --git a/db/changes/232801/00-department.sql b/db/changes/232801/00-department.sql
new file mode 100644
index 000000000..3dcb8501d
--- /dev/null
+++ b/db/changes/232801/00-department.sql
@@ -0,0 +1,24 @@
+alter table `vn`.`department`
+ add `twoFactor` ENUM ('email') null comment 'Default user two-factor auth type';
+
+drop trigger `vn`.`department_afterUpdate`;
+
+DELIMITER $$
+$$
+create definer = root@localhost trigger `vn`.`department_afterUpdate`
+ after update
+ on department
+ for each row
+BEGIN
+ IF !(OLD.parentFk <=> NEW.parentFk) THEN
+ UPDATE vn.department_recalc SET isChanged = TRUE;
+ END IF;
+
+ IF !(OLD.twoFactor <=> NEW.twoFactor) THEN
+ UPDATE account.user u
+ JOIN vn.workerDepartment wd ON wd.workerFk = u.id
+ SET u.twoFactor = NEW.twoFactor
+ WHERE wd.departmentFk = NEW.id;
+ END IF;
+END;$$
+DELIMITER ;
diff --git a/db/changes/232801/00-fix_editCredit.sql b/db/changes/232801/00-fix_editCredit.sql
new file mode 100644
index 000000000..ff0d9e2b3
--- /dev/null
+++ b/db/changes/232801/00-fix_editCredit.sql
@@ -0,0 +1,13 @@
+UPDATE `salix`.`ACL`
+ SET principalId='financialBoss'
+ WHERE
+ model = 'Client'
+ AND property = 'editCredit';
+
+UPDATE `salix`.`ACL`
+ SET property='zeroCreditEditor'
+ WHERE
+ model = 'Client'
+ AND property = 'isNotEditableCredit';
+
+
diff --git a/db/changes/232801/00-user.sql b/db/changes/232801/00-user.sql
new file mode 100644
index 000000000..376b3dbb1
--- /dev/null
+++ b/db/changes/232801/00-user.sql
@@ -0,0 +1,5 @@
+alter table `account`.`user`
+ add `twoFactor` ENUM ('email') null comment 'Two-factor auth type';
+
+DELETE FROM `salix`.`ACL`
+ WHERE model = 'VnUser' AND property = 'changePassword';
diff --git a/db/changes/232801/.gitkeep b/db/changes/233001/.gitkeep
similarity index 100%
rename from db/changes/232801/.gitkeep
rename to db/changes/233001/.gitkeep
diff --git a/db/changes/233001/00-ticketWeight.sql b/db/changes/233001/00-ticketWeight.sql
new file mode 100644
index 000000000..0b727b434
--- /dev/null
+++ b/db/changes/233001/00-ticketWeight.sql
@@ -0,0 +1,7 @@
+UPDATE `vn`.`ticket` t
+ JOIN `vn`.`ticketObservation` o ON o.ticketFk = t.id
+ SET t.weight = cast(REPLACE(o.description, ',', '.') as decimal(10,2))
+ WHERE o.observationTypeFk = 6;
+
+DELETE FROM `vn`.`ticketObservation` WHERE observationTypeFk = 6;
+DELETE FROM `vn`.`observationType` WHERE id = 6;
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 2513972db..e9bbf9bb3 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -2,7 +2,7 @@
USE `util`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: util
+-- Host: db1.static.verdnatura.es Database: util
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -22,7 +22,7 @@ USE `util`;
LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
-INSERT INTO `config` VALUES (1,'231801',0,'production',NULL,'2001-01-01 11:00:00',NULL,0);
+INSERT INTO `config` VALUES (1,'232401',0,'production',NULL,'2001-01-01 11:00:00',NULL,0);
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;
@@ -32,7 +32,7 @@ UNLOCK TABLES;
LOCK TABLES `version` WRITE;
/*!40000 ALTER TABLE `version` DISABLE KEYS */;
-INSERT INTO `version` VALUES ('salix','10230','53f69ae8e526a4a5d827c237a5b076d38507b392','2020-11-09 11:06:43',NULL),('vn-database','10598','11ac980456205f7851dc94367d04243d33ca3c0b','2023-05-16 08:20:30','10600');
+INSERT INTO `version` VALUES ('salix','10230','53f69ae8e526a4a5d827c237a5b076d38507b392','2020-11-09 11:06:43',NULL),('vn-database','10649','4a8ae703b8ce8219887432ad1d1677a44e0cbdd8','2023-06-22 10:03:04','10654');
/*!40000 ALTER TABLE `version` ENABLE KEYS */;
UNLOCK TABLES;
@@ -42,7 +42,7 @@ UNLOCK TABLES;
LOCK TABLES `versionLog` WRITE;
/*!40000 ALTER TABLE `versionLog` DISABLE KEYS */;
-INSERT INTO `versionLog` VALUES ('vn-database','00001','00-test.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','00003','00-sage.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','10008','00-alterRoleConfig.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','10014','00-rolePrefix.sql','jenkins@10.0.2.68','2022-02-11 00:13:25',NULL,NULL),('vn-database','10017','01-firstScript.sql','jenkins@10.0.2.70','2022-03-09 11:36:54',NULL,NULL),('vn-database','10021','00-bankAccount.sql','jenkins@10.0.2.69','2022-03-16 14:11:22',NULL,NULL),('vn-database','10023','00-firstScript.sql','jenkins@10.0.2.69','2022-03-16 15:05:29',NULL,NULL),('vn-database','10026','00-invoiceInIntrastat.sql','jenkins@10.0.2.69','2022-03-21 15:10:53',NULL,NULL),('vn-database','10027','00-Clientes_cedidos.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10028','00-item_last_buy_.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10029','00-bankToViewAccountingToTable.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10030','00-KkejarNiche.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10036','00-updateBuyConfig.sql','jenkins@10.0.2.69','2022-03-29 12:36:54',NULL,NULL),('vn-database','10037','00-firstScript.sql','jenkins@10.0.2.69','2022-03-28 11:14:26',NULL,NULL),('vn-database','10038','00-printServerQueue.sql','jenkins@10.0.2.69','2022-03-29 08:13:24',NULL,NULL),('vn-database','10048','00-firstScript.sql','jenkins@10.0.2.69','2022-03-30 12:29:06',NULL,NULL),('vn-database','10058','00-vehicleAddFields.sql','jenkins@10.0.2.69','2022-04-06 08:48:34',NULL,NULL),('vn-database','10060','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:11',NULL,NULL),('vn-database','10062','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 10:51:45',NULL,NULL),('vn-database','10064','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 13:57:11',NULL,NULL),('vn-database','10066','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:12',NULL,NULL),('vn-database','10067','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 10:18:20',NULL,NULL),('vn-database','10071','00-packingSiteLog.sql','jenkins@10.0.2.69','2022-04-08 09:37:30',NULL,NULL),('vn-database','10072','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 11:01:46',NULL,NULL),('vn-database','10073','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 13:40:56',NULL,NULL),('vn-database','10074','00-firstScript.sql','jenkins@10.0.2.69','2022-04-10 13:15:05',NULL,NULL),('vn-database','10077','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 08:07:15',NULL,NULL),('vn-database','10078','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 07:44:21',NULL,NULL),('vn-database','10079','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 12:01:37',NULL,NULL),('vn-database','10086','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 08:58:34',NULL,NULL),('vn-database','10087','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 09:39:49',NULL,NULL),('vn-database','10088','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 15:05:12',NULL,NULL),('vn-database','10089','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:12:52',NULL,NULL),('vn-database','10090','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:34:46',NULL,NULL),('vn-database','10092','00-firstScript.sql','jenkins@10.0.2.69','2022-04-19 14:45:46',NULL,NULL),('vn-database','10093','00-autoradioConfig.sql','jenkins@10.0.2.69','2022-05-03 09:16:47',NULL,NULL),('vn-database','10094','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 10:57:30',NULL,NULL),('vn-database','10097','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10099','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL),('vn-database','10100','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL),('vn-database','10101','00-firstScript.sql','jenkins@10.0.2.69','2022-04-21 14:59:31',NULL,NULL),('vn-database','10103','00-awbVolume.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10104','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10105','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL),('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL),('vn-database','10113','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10114','00-updateConfig.sql','jenkins@10.0.2.69','2022-04-27 13:37:25',NULL,NULL),('vn-database','10116','00-firstScript.sql','jenkins@10.0.2.69','2022-04-28 11:10:14',NULL,NULL),('vn-database','10118','00-firstScript.sql','jenkins@10.0.2.69','2022-04-29 08:10:15',NULL,NULL),('vn-database','10119','00-AfegirFKPart1.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10119','01-AfegirFkPart2.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL),('vn-database','10125','00-firstScript.sql','jenkins@10.0.2.68','2022-05-18 18:44:30',NULL,NULL),('vn-database','10127','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 11:04:46',NULL,NULL),('vn-database','10128','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 13:04:31',NULL,NULL),('vn-database','10129','00-firstScript.sql','jenkins@10.0.2.69','2022-05-03 08:21:01',NULL,NULL),('vn-database','10132','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL),('vn-database','10133','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 14:32:30',NULL,NULL),('vn-database','10134','00-firstScript.sql','jenkins@10.0.2.69','2022-05-06 07:45:25',NULL,NULL),('vn-database','10135','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL),('vn-database','10136','00-workerTimeControl.sql','jenkins@10.0.2.69','2022-05-09 13:51:12',NULL,NULL),('vn-database','10138','00-firstScript.sql','jenkins@10.0.2.69','2022-05-10 13:58:05',NULL,NULL),('vn-database','10139','00-firstScript.sql','jenkins@10.0.2.68','2022-05-16 14:32:37',NULL,NULL),('vn-database','10139','01-secondScript.sql','jenkins@10.0.2.68','2022-05-17 12:16:13',NULL,NULL),('vn-database','10141','00-firstScript.sql','jenkins@10.0.2.70','2022-05-12 08:27:31',NULL,NULL),('vn-database','10142','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL),('vn-database','10143','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL),('vn-database','10144','00-AfegirFKPArt1.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10144','00-firstScript.sql','jenkins@10.0.2.68','2022-05-13 09:44:25',NULL,NULL),('vn-database','10147','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10149','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10150','00-firstScript.sql','jenkins@10.0.2.68','2022-05-17 09:57:16',NULL,NULL),('vn-database','10152','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10153','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10154','00-compressionKk.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10157','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:35',NULL,NULL),('vn-database','10158','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL),('vn-database','10160','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:30:50',NULL,NULL),('vn-database','10163','00-firstScript.sql','jenkins@10.0.2.68','2022-05-23 08:17:14',NULL,NULL),('vn-database','10164','00-borrarSectorsDesus.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL),('vn-database','10165','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10166','00-firstScript.sql','jenkins@10.0.2.68','2022-05-24 16:11:21',NULL,NULL),('vn-database','10167','00-renameVnActiveContrat.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10168','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10169','00-createTableBankEntityConfig.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10169','02-addNotNullToBankEntityBic.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10171','00-volumeConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 14:11:11',NULL,NULL),('vn-database','10171','01-itemWeight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL),('vn-database','10171','02-agencymode.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL),('vn-database','10172','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10174','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL),('vn-database','10175','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10177','00-crearTablaSpecialLabels.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10178','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10179','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10183','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10184','00-firstScript.sql','jenkins@10.0.2.68','2022-06-03 08:05:34',NULL,NULL),('vn-database','10185','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 09:07:45',NULL,NULL),('vn-database','10186','00-desactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:31:23',NULL,NULL),('vn-database','10186','01-alter_Table_buy.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL),('vn-database','10186','02-alter_table_entryConfig.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL),('vn-database','10186','04-regularizar_Sticker_Inventario.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL),('vn-database','10186','09-reactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL),('vn-database','10187','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 12:37:31',NULL,NULL),('vn-database','10188','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 14:03:36',NULL,NULL),('vn-database','10189','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10191','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10194','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10195','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10200','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10201','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10202','00-Remove_FK_to_ediGenus.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10203','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL),('vn-database','10204','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL),('vn-database','10205','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:21',NULL,NULL),('vn-database','10207','00-Alter_table_entry.sql','jenkins@10.0.2.69','2022-06-16 07:22:50',NULL,NULL),('vn-database','10207','01-Update_invoiceAmount.sql','jenkins@10.0.2.69','2022-06-16 07:23:00',NULL,NULL),('vn-database','10208','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10209','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 08:47:40',NULL,NULL),('vn-database','10210','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 17:39:17',1046,'Base de datos no seleccionada'),('vn-database','10211','01-firstScript.sql','jenkins@10.0.2.69','2022-06-17 07:11:27',NULL,NULL),('vn-database','10215','00-renameIsInventory.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10216','00-firstScript.sql','jenkins@10.0.2.69','2022-06-23 11:15:28',NULL,NULL),('vn-database','10216','01-batchIndex.sql','jenkins@10.0.2.70','2022-06-27 18:10:55',NULL,NULL),('vn-database','10219','00-AddCollectionFkOnPackingSite.sql','jenkins@10.0.2.70','2022-06-29 09:23:42',NULL,NULL),('vn-database','10219','01-AddFkToCollectionFk.sql','jenkins@10.0.2.70','2022-06-29 09:23:43',NULL,NULL),('vn-database','10220','00-createPersonalProtectionEquipment.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10222','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:12:40',NULL,NULL),('vn-database','10223','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:52',NULL,NULL),('vn-database','10224','00-cosetes.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-21 12:03:45',NULL,NULL),('vn-database','10229','00-firstScript.sql','jenkins@10.0.2.69','2022-07-01 11:59:34',NULL,NULL),('vn-database','10231','01-tablaEktConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:25:39',NULL,NULL),('vn-database','10233','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10235','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10236','00-firstScript.sql','jenkins@10.0.2.69','2022-07-05 12:11:40',NULL,NULL),('vn-database','10237','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10238','00-worker_mobileExtension.sql','jenkins@10.0.2.69','2022-07-14 09:14:09',NULL,NULL),('vn-database','10239','00-firstScript.sql','jenkins@10.0.2.69','2022-07-07 21:51:58',NULL,NULL),('vn-database','10241','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-29 08:14:01',NULL,NULL),('vn-database','10242','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL),('vn-database','10243','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL),('vn-database','10245','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL),('vn-database','10247','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL),('vn-database','10248','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-20 17:27:51',NULL,NULL),('vn-database','10250','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:40',NULL,NULL),('vn-database','10253','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:57',NULL,NULL),('vn-database','10254','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10256','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10258','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:48',NULL,NULL),('vn-database','10259','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-02 08:54:56',NULL,NULL),('vn-database','10261','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-22 08:42:20',NULL,NULL),('vn-database','10262','00-createTablepackagingWithFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','01-alterTablePackagingConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','02-insertsInicials.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','03-createTablepackingWithoutFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10263','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10265','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10267','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10267','01-fixMerge.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10275','00-improvedGeneralLog.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 09:55:56',NULL,NULL),('vn-database','10277','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL),('vn-database','10278','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 17:51:41',NULL,NULL),('vn-database','10279','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10281','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10282','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10283','00-alterTable.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10284','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-04 16:59:08',NULL,NULL),('vn-database','10285','00-firstScript.sql','jenkins@swarm-worker3.static.verdnatura.es','2022-08-05 09:19:33',NULL,NULL),('vn-database','10287','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL),('vn-database','10288','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL),('vn-database','10289','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:36',NULL,NULL),('vn-database','10291','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-10 14:19:34',NULL,NULL),('vn-database','10293','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL),('vn-database','10297','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-16 12:43:36',NULL,NULL),('vn-database','10298','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-13 21:04:13',NULL,NULL),('vn-database','10299','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','00-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','01-drop.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','02-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','00-CreateTableEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','01-insertDataEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','02-alterTableEntry.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:22',NULL,NULL),('vn-database','10303','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:23',NULL,NULL),('vn-database','10304','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:48',NULL,NULL),('vn-database','10304','01-altertableticket.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:51',NULL,NULL),('vn-database','10305','00-ektAssign.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:24:52',NULL,NULL),('vn-database','10306','00-deliveryInformation.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:25',NULL,NULL),('vn-database','10307','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:26',NULL,NULL),('vn-database','10308','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:26:43',NULL,NULL),('vn-database','10309','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:54',NULL,NULL),('vn-database','10310','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL),('vn-database','10311','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:55',NULL,NULL),('vn-database','10312','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL),('vn-database','10313','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:27:21',NULL,NULL),('vn-database','10314','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:19',NULL,NULL),('vn-database','10315','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10317','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10318','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10319','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:41',NULL,NULL),('vn-database','10320','00-operator.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL),('vn-database','10320','01-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL),('vn-database','10320','02-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10321','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 11:11:12',NULL,NULL),('vn-database','10322','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-09 09:19:05',NULL,NULL),('vn-database','10326','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10328','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10329','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10330','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10332','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10334','00-collectionHotbed.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10334','01-saleGroupDetail.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10335','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10336','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10337','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10339','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-19 09:41:19',NULL,NULL),('vn-database','10340','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10341','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10342','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10343','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:35:30',NULL,NULL),('vn-database','10345','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL),('vn-database','10347','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10347','01-addVirtualField.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10349','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10350','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-30 10:11:56',NULL,NULL),('vn-database','10352','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL),('vn-database','10353','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10354','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10356','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10356','01-orderConfigFk.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10356','02-orderConfigDrop.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10357','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10359','00-improvedGeneralLog_collate.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL),('vn-database','10360','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL),('vn-database','10361','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 11:16:07',NULL,NULL),('vn-database','10362','00-dropUdfs.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-10 11:01:15',NULL,NULL),('vn-database','10363','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10365','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-13 19:30:46',NULL,NULL),('vn-database','10368','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10369','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-14 13:38:06',NULL,NULL),('vn-database','10370','00-deleteForeignKey.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:41',NULL,NULL),('vn-database','10370','01-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:47',NULL,NULL),('vn-database','10370','02-deleteTable.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL),('vn-database','10370','03-accion.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL),('vn-database','10370','04-inter.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL),('vn-database','10371','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10372','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:48',NULL,NULL),('vn-database','10373','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-19 08:31:58',NULL,NULL),('vn-database','10378','00-rename_routeUserPercentage.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10379','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:16',NULL,NULL),('vn-database','10382','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10383','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL),('vn-database','10384','00-business_workcenterFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:18:01',NULL,NULL),('vn-database','10385','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL),('vn-database','10386','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL),('vn-database','10387','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-16 14:05:33',NULL,NULL),('vn-database','10388','00-resizeUtilVerionLogCode.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10388','01-resizeUtilVersionCode.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10390','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:16',NULL,NULL),('vn-database','10391','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10394','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:24',NULL,NULL),('vn-database','10395','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10396','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 15:36:38',NULL,NULL),('vn-database','10397','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10399','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10400','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10402','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-21 14:11:31',NULL,NULL),('vn-database','10404','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10405','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:58:22',NULL,NULL),('vn-database','10407','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:49',NULL,NULL),('vn-database','10408','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10409','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:49',NULL,NULL),('vn-database','10412','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-30 12:45:44',NULL,NULL),('vn-database','10413','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:24',NULL,NULL),('vn-database','10416','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:24',NULL,NULL),('vn-database','10420','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:25',NULL,NULL),('vn-database','10421','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:26',NULL,NULL),('vn-database','10426','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:40',NULL,NULL),('vn-database','10428','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10431','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:22',NULL,NULL),('vn-database','10433','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10434','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10435','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-13 07:30:10',NULL,NULL),('vn-database','10436','00-createFkWorker.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:58:59',NULL,NULL),('vn-database','10436','01-addStateToWorkerProductivity.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:00',NULL,NULL),('vn-database','10436','02-DeprecateVnSaleTrackingState.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:00',NULL,NULL),('vn-database','10436','03-DeprecateColumnVnSaleTrackingActionFk.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10436','04-DropSchemaVnControl.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10436','05-RemoveFkWorkerProductivity.sql','jenkins@db-proxy2.static.verdnatura.es','2023-02-17 14:51:19',NULL,NULL),('vn-database','10440','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10444','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10445','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10448','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10450','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-27 08:28:04',NULL,NULL),('vn-database','10451','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-06 08:08:32',NULL,NULL),('vn-database','10452','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10453','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 14:04:37',NULL,NULL),('vn-database','10454','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10455','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10456','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:00:30',NULL,NULL),('vn-database','10457','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:00:33',NULL,NULL),('vn-database','10458','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:17',NULL,NULL),('vn-database','10459','00-alterTableUtilConfig.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','01-createFunctionCurdate.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','02-createFunctionMockTime.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','03-createFunctionMockTimeBase.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','04-createFunctionNow.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10460','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10461','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10463','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-03 12:59:26',NULL,NULL),('vn-database','10468','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10469','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10470','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10471','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10472','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10477','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:31',NULL,NULL),('vn-database','10478','00-dropBasket.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10478','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10478','01-orderConfigured.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:29:16',NULL,NULL),('vn-database','10478','02-configuredUpdate.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:29:53',NULL,NULL),('vn-database','10478','99-privileges.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:29:53',NULL,NULL),('vn-database','10480','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-17 15:09:26',NULL,NULL),('vn-database','10481','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-17 16:37:22',NULL,NULL),('vn-database','10482','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-02-21 10:00:28',NULL,NULL),('vn-database','10485','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:17',NULL,NULL),('vn-database','10488','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:17',NULL,NULL),('vn-database','10491','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:18',NULL,NULL),('vn-database','10492','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:18',NULL,NULL),('vn-database','10493','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:18:01',NULL,NULL),('vn-database','10495','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:19',NULL,NULL),('vn-database','10498','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:38',NULL,NULL),('vn-database','10500','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-03-03 07:06:03',NULL,NULL),('vn-database','10501','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-03-03 10:52:24',NULL,NULL),('vn-database','10502','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:48',NULL,NULL),('vn-database','10506','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:48',NULL,NULL),('vn-database','10507','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:35:23',NULL,NULL),('vn-database','10508','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:43',NULL,NULL),('vn-database','10510','00-dropBusinessFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:47',NULL,NULL),('vn-database','10510','01-createTableProfessionalCategory.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:47',NULL,NULL),('vn-database','10510','02-exportToNewTable.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:47',NULL,NULL),('vn-database','10510','03-RecreateFK.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:51',NULL,NULL),('vn-database','10510','04-kkPostgresqlTable.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:51',NULL,NULL),('vn-database','10511','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10512','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:52',NULL,NULL),('vn-database','10513','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:56',NULL,NULL),('vn-database','10514','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10516','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:48',NULL,NULL),('vn-database','10521','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-21 06:58:13',NULL,NULL),('vn-database','10522','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10523','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10525','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-21 12:42:50',NULL,NULL),('vn-database','10526','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:57',NULL,NULL),('vn-database','10528','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:37:00',NULL,NULL),('vn-database','10530','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-03-23 14:49:30',NULL,NULL),('vn-database','10531','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-24 11:47:10',NULL,NULL),('vn-database','10532','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-24 11:17:38',NULL,NULL),('vn-database','10533','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:37:04',NULL,NULL),('vn-database','10537','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-29 15:18:36',NULL,NULL),('vn-database','10538','00-createChronopostConfig.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','01-createChronopostService.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','02-createChronopostExpedition.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','03-createChronopostSenderAddress.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','04-addgrantPrivilegies.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','05-updateChronopostConfig.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 11:54:57',NULL,NULL),('vn-database','10539','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:37:07',NULL,NULL),('vn-database','10540','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:18:01',NULL,NULL),('vn-database','10545','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-11 08:31:03',NULL,NULL),('vn-database','10546','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:08:10',NULL,NULL),('vn-database','10547','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:21:58',NULL,NULL),('vn-database','10549','00-updateUpdateLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:29:22',NULL,NULL),('vn-database','10549','01-updateInsertLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:30:11',NULL,NULL),('vn-database','10549','02-updateDeleteLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:30:51',NULL,NULL),('vn-database','10549','03-deleteEmptyLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:31:34',NULL,NULL),('vn-database','10549','04-optimizeLogTables.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:33:58',NULL,NULL),('vn-database','10550','00-editorFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:42:33',NULL,NULL),('vn-database','10550','01-originFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10552','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-13 08:25:10',NULL,NULL),('vn-database','10554','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:08:10',NULL,NULL),('vn-database','10557','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-17 07:45:56',NULL,NULL),('vn-database','10559','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-18 10:53:50',NULL,NULL),('vn-database','10560','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-17 09:19:31',NULL,NULL),('vn-database','10562','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10563','00-delivery_ticketFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-20 09:30:53',NULL,NULL),('vn-database','10566','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-20 10:08:41',NULL,NULL),('vn-database','10567','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-20 10:18:06',NULL,NULL),('vn-database','10568','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10569','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-24 09:14:35',NULL,NULL),('vn-database','10570','00-createSendingConfig.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10570','01-createSendingServiceWeekday.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10570','02-createSendingService.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10570','03-permisos.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10575','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-26 11:27:32',NULL,NULL),('vn-database','10577','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-27 14:00:12',NULL,NULL),('vn-database','10578','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10579','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-28 11:27:36',NULL,NULL),('vn-database','10580','00-itemTypeDropConstraint.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-28 18:18:52',NULL,NULL),('vn-database','10580','01-itemTypeAddConstraint.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-28 18:19:10',NULL,NULL),('vn-database','10581','00-itemTypeAutoIncrement.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-28 19:06:46',NULL,NULL),('vn-database','10582','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10583','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10584','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10598','00-workerLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL),('vn-database','10598','01-supplierLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL),('vn-database','10598','02-workerTimeControlLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL),('vn-database','10598','03-workerClockLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL);
+INSERT INTO `versionLog` VALUES ('vn-database','00001','00-test.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','00003','00-sage.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','10008','00-alterRoleConfig.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','10014','00-rolePrefix.sql','jenkins@10.0.2.68','2022-02-11 00:13:25',NULL,NULL),('vn-database','10017','01-firstScript.sql','jenkins@10.0.2.70','2022-03-09 11:36:54',NULL,NULL),('vn-database','10021','00-bankAccount.sql','jenkins@10.0.2.69','2022-03-16 14:11:22',NULL,NULL),('vn-database','10023','00-firstScript.sql','jenkins@10.0.2.69','2022-03-16 15:05:29',NULL,NULL),('vn-database','10026','00-invoiceInIntrastat.sql','jenkins@10.0.2.69','2022-03-21 15:10:53',NULL,NULL),('vn-database','10027','00-Clientes_cedidos.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10028','00-item_last_buy_.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10029','00-bankToViewAccountingToTable.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10030','00-KkejarNiche.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10036','00-updateBuyConfig.sql','jenkins@10.0.2.69','2022-03-29 12:36:54',NULL,NULL),('vn-database','10037','00-firstScript.sql','jenkins@10.0.2.69','2022-03-28 11:14:26',NULL,NULL),('vn-database','10038','00-printServerQueue.sql','jenkins@10.0.2.69','2022-03-29 08:13:24',NULL,NULL),('vn-database','10048','00-firstScript.sql','jenkins@10.0.2.69','2022-03-30 12:29:06',NULL,NULL),('vn-database','10058','00-vehicleAddFields.sql','jenkins@10.0.2.69','2022-04-06 08:48:34',NULL,NULL),('vn-database','10060','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:11',NULL,NULL),('vn-database','10062','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 10:51:45',NULL,NULL),('vn-database','10064','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 13:57:11',NULL,NULL),('vn-database','10066','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:12',NULL,NULL),('vn-database','10067','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 10:18:20',NULL,NULL),('vn-database','10071','00-packingSiteLog.sql','jenkins@10.0.2.69','2022-04-08 09:37:30',NULL,NULL),('vn-database','10072','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 11:01:46',NULL,NULL),('vn-database','10073','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 13:40:56',NULL,NULL),('vn-database','10074','00-firstScript.sql','jenkins@10.0.2.69','2022-04-10 13:15:05',NULL,NULL),('vn-database','10077','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 08:07:15',NULL,NULL),('vn-database','10078','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 07:44:21',NULL,NULL),('vn-database','10079','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 12:01:37',NULL,NULL),('vn-database','10086','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 08:58:34',NULL,NULL),('vn-database','10087','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 09:39:49',NULL,NULL),('vn-database','10088','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 15:05:12',NULL,NULL),('vn-database','10089','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:12:52',NULL,NULL),('vn-database','10090','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:34:46',NULL,NULL),('vn-database','10092','00-firstScript.sql','jenkins@10.0.2.69','2022-04-19 14:45:46',NULL,NULL),('vn-database','10093','00-autoradioConfig.sql','jenkins@10.0.2.69','2022-05-03 09:16:47',NULL,NULL),('vn-database','10094','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 10:57:30',NULL,NULL),('vn-database','10097','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10099','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL),('vn-database','10100','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL),('vn-database','10101','00-firstScript.sql','jenkins@10.0.2.69','2022-04-21 14:59:31',NULL,NULL),('vn-database','10103','00-awbVolume.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10104','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10105','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL),('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL),('vn-database','10113','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10114','00-updateConfig.sql','jenkins@10.0.2.69','2022-04-27 13:37:25',NULL,NULL),('vn-database','10116','00-firstScript.sql','jenkins@10.0.2.69','2022-04-28 11:10:14',NULL,NULL),('vn-database','10118','00-firstScript.sql','jenkins@10.0.2.69','2022-04-29 08:10:15',NULL,NULL),('vn-database','10119','00-AfegirFKPart1.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10119','01-AfegirFkPart2.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL),('vn-database','10125','00-firstScript.sql','jenkins@10.0.2.68','2022-05-18 18:44:30',NULL,NULL),('vn-database','10127','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 11:04:46',NULL,NULL),('vn-database','10128','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 13:04:31',NULL,NULL),('vn-database','10129','00-firstScript.sql','jenkins@10.0.2.69','2022-05-03 08:21:01',NULL,NULL),('vn-database','10132','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL),('vn-database','10133','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 14:32:30',NULL,NULL),('vn-database','10134','00-firstScript.sql','jenkins@10.0.2.69','2022-05-06 07:45:25',NULL,NULL),('vn-database','10135','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL),('vn-database','10136','00-workerTimeControl.sql','jenkins@10.0.2.69','2022-05-09 13:51:12',NULL,NULL),('vn-database','10138','00-firstScript.sql','jenkins@10.0.2.69','2022-05-10 13:58:05',NULL,NULL),('vn-database','10139','00-firstScript.sql','jenkins@10.0.2.68','2022-05-16 14:32:37',NULL,NULL),('vn-database','10139','01-secondScript.sql','jenkins@10.0.2.68','2022-05-17 12:16:13',NULL,NULL),('vn-database','10141','00-firstScript.sql','jenkins@10.0.2.70','2022-05-12 08:27:31',NULL,NULL),('vn-database','10142','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL),('vn-database','10143','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL),('vn-database','10144','00-AfegirFKPArt1.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10144','00-firstScript.sql','jenkins@10.0.2.68','2022-05-13 09:44:25',NULL,NULL),('vn-database','10147','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10149','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10150','00-firstScript.sql','jenkins@10.0.2.68','2022-05-17 09:57:16',NULL,NULL),('vn-database','10152','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10153','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10154','00-compressionKk.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10157','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:35',NULL,NULL),('vn-database','10158','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL),('vn-database','10160','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:30:50',NULL,NULL),('vn-database','10163','00-firstScript.sql','jenkins@10.0.2.68','2022-05-23 08:17:14',NULL,NULL),('vn-database','10164','00-borrarSectorsDesus.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL),('vn-database','10165','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10166','00-firstScript.sql','jenkins@10.0.2.68','2022-05-24 16:11:21',NULL,NULL),('vn-database','10167','00-renameVnActiveContrat.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10168','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10169','00-createTableBankEntityConfig.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10169','02-addNotNullToBankEntityBic.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10171','00-volumeConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 14:11:11',NULL,NULL),('vn-database','10171','01-itemWeight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL),('vn-database','10171','02-agencymode.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL),('vn-database','10172','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10174','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL),('vn-database','10175','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10177','00-crearTablaSpecialLabels.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10178','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10179','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10183','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10184','00-firstScript.sql','jenkins@10.0.2.68','2022-06-03 08:05:34',NULL,NULL),('vn-database','10185','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 09:07:45',NULL,NULL),('vn-database','10186','00-desactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:31:23',NULL,NULL),('vn-database','10186','01-alter_Table_buy.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL),('vn-database','10186','02-alter_table_entryConfig.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL),('vn-database','10186','04-regularizar_Sticker_Inventario.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL),('vn-database','10186','09-reactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL),('vn-database','10187','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 12:37:31',NULL,NULL),('vn-database','10188','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 14:03:36',NULL,NULL),('vn-database','10189','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10191','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10193','00-delete.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-15 12:14:35',NULL,NULL),('vn-database','10193','01-botanicExport.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-15 12:14:43',NULL,NULL),('vn-database','10193','02-item.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-15 12:14:44',NULL,NULL),('vn-database','10193','03-autonomy.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-15 12:14:44',NULL,NULL),('vn-database','10193','03-turn.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-15 12:14:44',NULL,NULL),('vn-database','10193','04-country.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-15 12:14:44',NULL,NULL),('vn-database','10194','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10195','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10200','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10201','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10202','00-Remove_FK_to_ediGenus.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10203','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL),('vn-database','10204','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL),('vn-database','10205','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:21',NULL,NULL),('vn-database','10207','00-Alter_table_entry.sql','jenkins@10.0.2.69','2022-06-16 07:22:50',NULL,NULL),('vn-database','10207','01-Update_invoiceAmount.sql','jenkins@10.0.2.69','2022-06-16 07:23:00',NULL,NULL),('vn-database','10208','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10209','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 08:47:40',NULL,NULL),('vn-database','10210','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 17:39:17',1046,'Base de datos no seleccionada'),('vn-database','10211','01-firstScript.sql','jenkins@10.0.2.69','2022-06-17 07:11:27',NULL,NULL),('vn-database','10215','00-renameIsInventory.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10216','00-firstScript.sql','jenkins@10.0.2.69','2022-06-23 11:15:28',NULL,NULL),('vn-database','10216','01-batchIndex.sql','jenkins@10.0.2.70','2022-06-27 18:10:55',NULL,NULL),('vn-database','10219','00-AddCollectionFkOnPackingSite.sql','jenkins@10.0.2.70','2022-06-29 09:23:42',NULL,NULL),('vn-database','10219','01-AddFkToCollectionFk.sql','jenkins@10.0.2.70','2022-06-29 09:23:43',NULL,NULL),('vn-database','10220','00-createPersonalProtectionEquipment.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10222','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:12:40',NULL,NULL),('vn-database','10223','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:52',NULL,NULL),('vn-database','10224','00-cosetes.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-21 12:03:45',NULL,NULL),('vn-database','10229','00-firstScript.sql','jenkins@10.0.2.69','2022-07-01 11:59:34',NULL,NULL),('vn-database','10231','01-tablaEktConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:25:39',NULL,NULL),('vn-database','10233','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10235','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10236','00-firstScript.sql','jenkins@10.0.2.69','2022-07-05 12:11:40',NULL,NULL),('vn-database','10237','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10238','00-worker_mobileExtension.sql','jenkins@10.0.2.69','2022-07-14 09:14:09',NULL,NULL),('vn-database','10239','00-firstScript.sql','jenkins@10.0.2.69','2022-07-07 21:51:58',NULL,NULL),('vn-database','10241','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-29 08:14:01',NULL,NULL),('vn-database','10242','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL),('vn-database','10243','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL),('vn-database','10245','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL),('vn-database','10247','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL),('vn-database','10248','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-20 17:27:51',NULL,NULL),('vn-database','10250','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:40',NULL,NULL),('vn-database','10253','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:57',NULL,NULL),('vn-database','10254','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10256','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10258','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:48',NULL,NULL),('vn-database','10259','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-02 08:54:56',NULL,NULL),('vn-database','10261','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-22 08:42:20',NULL,NULL),('vn-database','10262','00-createTablepackagingWithFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','01-alterTablePackagingConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','02-insertsInicials.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','03-createTablepackingWithoutFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10263','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10265','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10267','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10267','01-fixMerge.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10275','00-improvedGeneralLog.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 09:55:56',NULL,NULL),('vn-database','10277','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL),('vn-database','10278','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 17:51:41',NULL,NULL),('vn-database','10279','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10281','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10282','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10283','00-alterTable.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10284','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-04 16:59:08',NULL,NULL),('vn-database','10285','00-firstScript.sql','jenkins@swarm-worker3.static.verdnatura.es','2022-08-05 09:19:33',NULL,NULL),('vn-database','10287','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL),('vn-database','10288','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL),('vn-database','10289','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:36',NULL,NULL),('vn-database','10291','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-10 14:19:34',NULL,NULL),('vn-database','10293','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL),('vn-database','10297','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-16 12:43:36',NULL,NULL),('vn-database','10298','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-13 21:04:13',NULL,NULL),('vn-database','10299','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','00-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','01-drop.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','02-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','00-CreateTableEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','01-insertDataEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','02-alterTableEntry.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:22',NULL,NULL),('vn-database','10303','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:23',NULL,NULL),('vn-database','10304','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:48',NULL,NULL),('vn-database','10304','01-altertableticket.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:51',NULL,NULL),('vn-database','10305','00-ektAssign.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:24:52',NULL,NULL),('vn-database','10306','00-deliveryInformation.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:25',NULL,NULL),('vn-database','10307','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:26',NULL,NULL),('vn-database','10308','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:26:43',NULL,NULL),('vn-database','10309','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:54',NULL,NULL),('vn-database','10310','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL),('vn-database','10311','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:55',NULL,NULL),('vn-database','10312','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL),('vn-database','10313','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:27:21',NULL,NULL),('vn-database','10314','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:19',NULL,NULL),('vn-database','10315','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10317','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10318','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10319','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:41',NULL,NULL),('vn-database','10320','00-operator.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL),('vn-database','10320','01-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL),('vn-database','10320','02-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10321','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 11:11:12',NULL,NULL),('vn-database','10322','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-09 09:19:05',NULL,NULL),('vn-database','10326','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10328','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10329','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10330','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10332','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10334','00-collectionHotbed.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10334','01-saleGroupDetail.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10335','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10336','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10337','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10339','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-19 09:41:19',NULL,NULL),('vn-database','10340','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10341','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10342','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10343','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:35:30',NULL,NULL),('vn-database','10345','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL),('vn-database','10347','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10347','01-addVirtualField.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10349','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10350','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-30 10:11:56',NULL,NULL),('vn-database','10352','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL),('vn-database','10353','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10354','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10356','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10356','01-orderConfigFk.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10356','02-orderConfigDrop.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10357','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10359','00-improvedGeneralLog_collate.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL),('vn-database','10360','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL),('vn-database','10361','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 11:16:07',NULL,NULL),('vn-database','10362','00-dropUdfs.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-10 11:01:15',NULL,NULL),('vn-database','10363','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10365','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-13 19:30:46',NULL,NULL),('vn-database','10368','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10369','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-14 13:38:06',NULL,NULL),('vn-database','10370','00-deleteForeignKey.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:41',NULL,NULL),('vn-database','10370','01-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:47',NULL,NULL),('vn-database','10370','02-deleteTable.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL),('vn-database','10370','03-accion.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL),('vn-database','10370','04-inter.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL),('vn-database','10371','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10372','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:48',NULL,NULL),('vn-database','10373','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-19 08:31:58',NULL,NULL),('vn-database','10378','00-rename_routeUserPercentage.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10379','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:16',NULL,NULL),('vn-database','10382','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10383','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL),('vn-database','10384','00-business_workcenterFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:18:01',NULL,NULL),('vn-database','10385','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL),('vn-database','10386','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL),('vn-database','10387','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-16 14:05:33',NULL,NULL),('vn-database','10388','00-resizeUtilVerionLogCode.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10388','01-resizeUtilVersionCode.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10390','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:16',NULL,NULL),('vn-database','10391','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10394','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:24',NULL,NULL),('vn-database','10395','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10396','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 15:36:38',NULL,NULL),('vn-database','10397','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10399','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10400','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10402','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-21 14:11:31',NULL,NULL),('vn-database','10404','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10405','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:58:22',NULL,NULL),('vn-database','10407','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:49',NULL,NULL),('vn-database','10408','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10409','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:49',NULL,NULL),('vn-database','10412','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-30 12:45:44',NULL,NULL),('vn-database','10413','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:24',NULL,NULL),('vn-database','10416','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:24',NULL,NULL),('vn-database','10420','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:25',NULL,NULL),('vn-database','10421','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:26',NULL,NULL),('vn-database','10426','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:40',NULL,NULL),('vn-database','10428','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10431','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:22',NULL,NULL),('vn-database','10433','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10434','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10435','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-13 07:30:10',NULL,NULL),('vn-database','10436','00-createFkWorker.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:58:59',NULL,NULL),('vn-database','10436','01-addStateToWorkerProductivity.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:00',NULL,NULL),('vn-database','10436','02-DeprecateVnSaleTrackingState.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:00',NULL,NULL),('vn-database','10436','03-DeprecateColumnVnSaleTrackingActionFk.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10436','04-DropSchemaVnControl.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10436','05-RemoveFkWorkerProductivity.sql','jenkins@db-proxy2.static.verdnatura.es','2023-02-17 14:51:19',NULL,NULL),('vn-database','10439','00-fixRole.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-25 09:13:26',NULL,NULL),('vn-database','10440','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10444','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10445','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10448','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10450','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-27 08:28:04',NULL,NULL),('vn-database','10451','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-06 08:08:32',NULL,NULL),('vn-database','10452','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10453','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 14:04:37',NULL,NULL),('vn-database','10454','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10455','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10456','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:00:30',NULL,NULL),('vn-database','10457','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:00:33',NULL,NULL),('vn-database','10458','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:17',NULL,NULL),('vn-database','10459','00-alterTableUtilConfig.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','01-createFunctionCurdate.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','02-createFunctionMockTime.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','03-createFunctionMockTimeBase.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10459','04-createFunctionNow.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:41',NULL,NULL),('vn-database','10460','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10461','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10463','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-03 12:59:26',NULL,NULL),('vn-database','10468','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10469','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10470','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10471','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10472','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10477','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:31',NULL,NULL),('vn-database','10478','00-dropBasket.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10478','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:28:54',NULL,NULL),('vn-database','10478','01-orderConfigured.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:29:16',NULL,NULL),('vn-database','10478','02-configuredUpdate.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:29:53',NULL,NULL),('vn-database','10478','99-privileges.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-23 10:29:53',NULL,NULL),('vn-database','10480','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-17 15:09:26',NULL,NULL),('vn-database','10481','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-17 16:37:22',NULL,NULL),('vn-database','10482','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-02-21 10:00:28',NULL,NULL),('vn-database','10485','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:17',NULL,NULL),('vn-database','10488','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:17',NULL,NULL),('vn-database','10491','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:18',NULL,NULL),('vn-database','10492','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:18',NULL,NULL),('vn-database','10493','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:18:01',NULL,NULL),('vn-database','10495','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-09 08:40:19',NULL,NULL),('vn-database','10498','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:38',NULL,NULL),('vn-database','10500','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-03-03 07:06:03',NULL,NULL),('vn-database','10501','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-03-03 10:52:24',NULL,NULL),('vn-database','10502','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:48',NULL,NULL),('vn-database','10504','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-25 09:13:27',NULL,NULL),('vn-database','10506','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:48',NULL,NULL),('vn-database','10506','01-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10506','02-secondScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10506','03-thirdScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10507','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:35:23',NULL,NULL),('vn-database','10508','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:43',NULL,NULL),('vn-database','10510','00-dropBusinessFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:47',NULL,NULL),('vn-database','10510','01-createTableProfessionalCategory.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:47',NULL,NULL),('vn-database','10510','02-exportToNewTable.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:47',NULL,NULL),('vn-database','10510','03-RecreateFK.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:51',NULL,NULL),('vn-database','10510','04-kkPostgresqlTable.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:51',NULL,NULL),('vn-database','10511','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10512','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:52',NULL,NULL),('vn-database','10513','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:56',NULL,NULL),('vn-database','10514','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10516','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-23 09:09:48',NULL,NULL),('vn-database','10521','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-21 06:58:13',NULL,NULL),('vn-database','10522','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10523','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10525','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-21 12:42:50',NULL,NULL),('vn-database','10526','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:36:57',NULL,NULL),('vn-database','10528','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:37:00',NULL,NULL),('vn-database','10530','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-03-23 14:49:30',NULL,NULL),('vn-database','10531','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-24 11:47:10',NULL,NULL),('vn-database','10532','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-24 11:17:38',NULL,NULL),('vn-database','10533','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:37:04',NULL,NULL),('vn-database','10537','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-03-29 15:18:36',NULL,NULL),('vn-database','10538','00-createChronopostConfig.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','01-createChronopostService.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','02-createChronopostExpedition.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','03-createChronopostSenderAddress.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','04-addgrantPrivilegies.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:07:41',NULL,NULL),('vn-database','10538','05-updateChronopostConfig.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 11:54:57',NULL,NULL),('vn-database','10539','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-05 10:37:07',NULL,NULL),('vn-database','10540','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:18:01',NULL,NULL),('vn-database','10545','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-11 08:31:03',NULL,NULL),('vn-database','10546','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:08:10',NULL,NULL),('vn-database','10547','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:21:58',NULL,NULL),('vn-database','10549','00-updateUpdateLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:29:22',NULL,NULL),('vn-database','10549','01-updateInsertLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:30:11',NULL,NULL),('vn-database','10549','02-updateDeleteLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:30:51',NULL,NULL),('vn-database','10549','03-deleteEmptyLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:31:34',NULL,NULL),('vn-database','10549','04-optimizeLogTables.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-21 07:33:58',NULL,NULL),('vn-database','10550','00-editorFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:42:33',NULL,NULL),('vn-database','10550','01-originFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10552','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-13 08:25:10',NULL,NULL),('vn-database','10554','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-20 09:08:10',NULL,NULL),('vn-database','10557','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-17 07:45:56',NULL,NULL),('vn-database','10559','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-18 10:53:50',NULL,NULL),('vn-database','10560','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-17 09:19:31',NULL,NULL),('vn-database','10562','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10563','00-delivery_ticketFk.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-20 09:30:53',NULL,NULL),('vn-database','10566','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-20 10:08:41',NULL,NULL),('vn-database','10567','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-20 10:18:06',NULL,NULL),('vn-database','10568','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10569','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-24 09:14:35',NULL,NULL),('vn-database','10570','00-createSendingConfig.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10570','01-createSendingServiceWeekday.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10570','02-createSendingService.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10570','03-permisos.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10571','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-25 09:13:27',NULL,NULL),('vn-database','10575','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-26 11:27:32',NULL,NULL),('vn-database','10577','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-27 14:00:12',NULL,NULL),('vn-database','10578','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10579','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-04-28 11:27:36',NULL,NULL),('vn-database','10580','00-itemTypeDropConstraint.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-28 18:18:52',NULL,NULL),('vn-database','10580','01-itemTypeAddConstraint.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-28 18:19:10',NULL,NULL),('vn-database','10581','00-itemTypeAutoIncrement.sql','jenkins@db-proxy2.static.verdnatura.es','2023-04-28 19:06:46',NULL,NULL),('vn-database','10582','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10583','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10584','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:28',NULL,NULL),('vn-database','10585','00-ticketLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-25 09:20:10',NULL,NULL),('vn-database','10585','01-entryLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-25 09:21:12',NULL,NULL),('vn-database','10585','02-claimLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:28:36',NULL,NULL),('vn-database','10585','03-clientLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:28:54',NULL,NULL),('vn-database','10585','04-invoiceInLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:28:55',NULL,NULL),('vn-database','10585','05-itemLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:29:46',NULL,NULL),('vn-database','10585','06-routeLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:18',NULL,NULL),('vn-database','10585','07-shelvingLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:32',NULL,NULL),('vn-database','10585','08-supplierLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:32',NULL,NULL),('vn-database','10585','09-travelLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:41',NULL,NULL),('vn-database','10585','10-workerLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:42',NULL,NULL),('vn-database','10585','11-zoneLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:43',NULL,NULL),('vn-database','10585','12-userLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:44',NULL,NULL),('vn-database','10585','13-roleLog.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:44',NULL,NULL),('vn-database','10587','00-arcRead_addMinimum.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-16 13:13:15',NULL,NULL),('vn-database','10593','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:44',NULL,NULL),('vn-database','10596','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:44',NULL,NULL),('vn-database','10597','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:44',NULL,NULL),('vn-database','10598','00-workerLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL),('vn-database','10598','01-supplierLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL),('vn-database','10598','02-workerTimeControlLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL),('vn-database','10598','03-workerClockLog.sql','jenkins@db-proxy2.static.verdnatura.es','2023-05-12 09:45:29',NULL,NULL),('vn-database','10599','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 09:30:44',NULL,NULL),('vn-database','10601','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-17 09:26:26',NULL,NULL),('vn-database','10602','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-18 08:52:15',NULL,NULL),('vn-database','10606','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-18 09:26:00',NULL,NULL),('vn-database','10608','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-18 12:36:31',NULL,NULL),('vn-database','10609','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-01 08:28:07',NULL,NULL),('vn-database','10610','00-updateCompanyId.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-01 09:11:07',NULL,NULL),('vn-database','10610','01-updateSupplierId.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-01 09:11:39',NULL,NULL),('vn-database','10610','02-invoiceOutCompany.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-01 09:49:55',NULL,NULL),('vn-database','10611','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-19 14:39:41',NULL,NULL),('vn-database','10613','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10614','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-01 09:11:40',NULL,NULL),('vn-database','10615','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-01 09:11:40',NULL,NULL),('vn-database','10617','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-01 09:11:41',NULL,NULL),('vn-database','10618','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-25 12:55:56',NULL,NULL),('vn-database','10619','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10624','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-05-30 19:01:10',NULL,NULL),('vn-database','10628','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10630','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-02 13:30:58',NULL,NULL),('vn-database','10631','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-05 08:37:25',NULL,NULL),('vn-database','10632','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10633','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:18',NULL,NULL),('vn-database','10634','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-06 12:15:55',NULL,NULL),('vn-database','10637','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-15 12:30:19',NULL,NULL),('vn-database','10640','00-companyFkDrop.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-07 14:43:23',NULL,NULL),('vn-database','10640','00-updateCompany.sql','jenkins@db-proxy1.static.verdnatura.es','2023-06-07 14:22:13',1205,'Tiempo de espera de bloqueo excedido; intente rearrancar la transacción'),('vn-database','10640','01-companyFkAi.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-07 14:43:23',NULL,NULL),('vn-database','10640','02-companyFkCreate.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-07 14:47:04',NULL,NULL),('vn-database','10640','04-supplierFkDrop.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-07 14:48:30',NULL,NULL),('vn-database','10640','05-supplierFkAi.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-07 14:53:17',NULL,NULL),('vn-database','10640','06-supplierFkCreate.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-07 15:06:00',NULL,NULL),('vn-database','10643','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-09 15:04:35',NULL,NULL),('vn-database','10649','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-06-16 10:59:06',NULL,NULL);
/*!40000 ALTER TABLE `versionLog` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -54,11 +54,11 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:00
USE `account`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: account
+-- Host: db1.static.verdnatura.es Database: account
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -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','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);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
@@ -88,7 +88,7 @@ UNLOCK TABLES;
LOCK TABLES `roleInherit` WRITE;
/*!40000 ALTER TABLE `roleInherit` DISABLE KEYS */;
-INSERT INTO `roleInherit` VALUES (1,1,2,NULL),(2,1,3,NULL),(3,1,70,NULL),(4,2,11,NULL),(5,3,11,NULL),(6,5,1,NULL),(8,5,33,NULL),(10,11,6,NULL),(11,13,1,NULL),(12,15,35,NULL),(15,16,15,NULL),(16,17,20,NULL),(17,17,37,NULL),(18,17,39,NULL),(19,17,64,NULL),(20,18,1,NULL),(21,19,21,NULL),(22,20,13,NULL),(23,20,16,NULL),(24,20,65,NULL),(25,21,13,NULL),(26,21,18,NULL),(27,21,53,NULL),(28,22,13,NULL),(29,22,21,NULL),(30,30,5,NULL),(31,30,20,NULL),(32,30,22,NULL),(33,30,53,NULL),(34,30,64,NULL),(35,31,1,NULL),(36,32,1,NULL),(37,34,1,NULL),(38,34,13,NULL),(39,34,33,NULL),(40,35,1,NULL),(41,36,44,NULL),(42,36,47,NULL),(43,37,1,NULL),(44,38,37,NULL),(45,38,64,NULL),(46,39,5,NULL),(47,39,21,NULL),(48,39,57,NULL),(49,40,1,NULL),(50,40,49,NULL),(51,41,13,NULL),(52,41,35,NULL),(53,41,40,NULL),(54,42,35,NULL),(55,42,49,NULL),(56,43,13,NULL),(57,43,42,NULL),(58,44,1,NULL),(59,45,13,NULL),(60,45,44,NULL),(61,47,1,NULL),(62,48,13,NULL),(63,48,47,NULL),(64,49,36,NULL),(65,49,58,NULL),(66,50,13,NULL),(67,50,21,NULL),(68,50,35,NULL),(69,50,49,NULL),(70,50,57,NULL),(72,51,1,NULL),(73,52,13,NULL),(74,52,19,NULL),(76,52,51,NULL),(77,53,1,NULL),(78,54,1,NULL),(79,55,13,NULL),(80,55,54,NULL),(81,56,1,NULL),(82,57,13,NULL),(83,57,56,NULL),(84,58,1,NULL),(85,59,13,NULL),(87,60,5,NULL),(91,61,13,NULL),(92,61,36,NULL),(94,65,35,NULL),(97,67,5,NULL),(98,67,37,NULL),(99,69,35,NULL),(101,70,11,NULL),(102,71,1,NULL),(103,71,58,NULL),(105,72,18,NULL),(106,73,5,NULL),(107,73,64,NULL),(108,73,19,NULL),(109,59,50,NULL),(115,39,76,NULL),(117,65,76,NULL),(118,30,76,NULL),(124,5,76,NULL),(125,37,76,NULL),(126,38,76,NULL),(128,42,76,NULL),(129,35,76,NULL),(130,60,76,NULL),(131,21,76,NULL),(132,18,76,NULL),(133,50,76,NULL),(134,20,76,NULL),(135,41,76,NULL),(136,17,76,NULL),(137,52,76,NULL),(138,57,76,NULL),(139,37,74,NULL),(140,51,74,NULL),(141,51,75,NULL),(142,35,75,NULL),(143,15,49,NULL),(145,17,67,NULL),(146,38,13,NULL),(147,101,35,NULL),(148,101,13,NULL),(150,15,56,NULL),(152,69,47,NULL),(153,48,35,NULL),(154,102,1,NULL),(167,9,103,NULL),(168,66,9,NULL),(169,104,100,NULL),(172,103,76,NULL),(173,103,1,NULL),(174,103,44,NULL),(175,103,45,NULL),(176,103,11,NULL),(177,103,39,NULL),(178,103,17,NULL),(179,103,5,NULL),(180,103,67,NULL),(181,103,3,NULL),(182,103,34,NULL),(183,103,42,NULL),(184,103,43,NULL),(185,103,64,NULL),(186,103,35,NULL),(187,103,101,NULL),(188,103,75,NULL),(189,103,71,NULL),(190,103,72,NULL),(191,103,47,NULL),(192,103,69,NULL),(193,103,48,NULL),(194,103,2,NULL),(195,103,56,NULL),(196,103,57,NULL),(197,103,32,NULL),(198,103,73,NULL),(199,103,30,NULL),(200,103,31,NULL),(201,103,6,NULL),(202,103,40,NULL),(203,103,41,NULL),(204,103,37,NULL),(205,103,38,NULL),(206,103,53,NULL),(207,103,33,NULL),(210,103,54,NULL),(211,103,55,NULL),(212,103,15,NULL),(213,103,16,NULL),(215,103,51,NULL),(216,103,52,NULL),(218,103,65,NULL),(219,103,58,NULL),(220,103,59,NULL),(221,103,102,NULL),(222,103,49,NULL),(223,103,60,NULL),(224,103,50,NULL),(225,103,36,NULL),(226,103,61,NULL),(228,103,21,NULL),(229,103,19,NULL),(230,103,18,NULL),(231,103,13,NULL),(232,103,22,NULL),(233,103,70,NULL),(234,103,74,NULL),(237,66,103,NULL),(238,103,20,NULL),(239,106,11,NULL),(240,107,60,NULL),(241,21,72,NULL),(242,20,9,NULL),(245,57,33,NULL),(246,102,35,NULL),(247,108,1,NULL),(248,102,13,NULL),(249,109,18,NULL),(250,109,13,NULL),(251,51,21,NULL),(253,48,49,NULL),(254,110,1,NULL),(255,110,76,NULL),(256,48,69,NULL),(257,47,111,NULL),(258,43,111,NULL),(259,72,111,NULL),(260,35,111,NULL),(261,5,111,NULL),(262,112,1,NULL),(263,114,112,NULL),(264,51,35,NULL),(265,72,49,NULL),(266,101,18,NULL),(268,65,57,NULL),(269,65,59,NULL),(270,65,49,NULL),(271,65,18,NULL),(272,65,13,NULL),(273,60,35,NULL),(275,50,59,NULL),(276,60,49,NULL),(280,5,53,NULL),(281,5,18,NULL),(282,50,60,NULL),(283,5,21,NULL),(284,60,57,NULL),(285,58,76,NULL),(287,69,58,NULL),(288,115,66,NULL),(289,115,9,NULL),(290,104,115,NULL),(291,115,103,NULL),(297,21,33,NULL),(298,49,54,NULL),(299,112,49,NULL),(300,114,13,NULL);
+INSERT INTO `roleInherit` VALUES (1,1,2,NULL),(2,1,3,NULL),(3,1,70,NULL),(4,2,11,NULL),(5,3,11,NULL),(6,5,1,NULL),(8,5,33,NULL),(10,11,6,NULL),(11,13,1,NULL),(12,15,35,NULL),(15,16,15,NULL),(16,17,20,NULL),(17,17,37,NULL),(18,17,39,NULL),(19,17,64,NULL),(20,18,1,NULL),(21,19,21,NULL),(22,20,13,NULL),(23,20,16,NULL),(24,20,65,NULL),(25,21,13,NULL),(26,21,18,NULL),(27,21,53,NULL),(28,22,13,NULL),(29,22,21,NULL),(30,30,5,NULL),(31,30,20,NULL),(32,30,22,NULL),(33,30,53,NULL),(34,30,64,NULL),(35,31,1,NULL),(36,32,1,NULL),(37,34,1,NULL),(38,34,13,NULL),(39,34,33,NULL),(40,35,1,NULL),(41,36,44,NULL),(42,36,47,NULL),(43,37,1,NULL),(44,38,37,NULL),(45,38,64,NULL),(46,39,5,NULL),(47,39,21,NULL),(48,39,57,NULL),(49,40,1,NULL),(50,40,49,NULL),(51,41,13,NULL),(52,41,35,NULL),(53,41,40,NULL),(54,42,35,NULL),(55,42,49,NULL),(56,43,13,NULL),(57,43,42,NULL),(58,44,1,NULL),(59,45,13,NULL),(60,45,44,NULL),(61,47,1,NULL),(62,48,13,NULL),(63,48,47,NULL),(64,49,36,NULL),(65,49,58,NULL),(66,50,13,NULL),(67,50,21,NULL),(68,50,35,NULL),(69,50,49,NULL),(70,50,57,NULL),(72,51,1,NULL),(73,52,13,NULL),(74,52,19,NULL),(76,52,51,NULL),(77,53,1,NULL),(78,54,1,NULL),(79,55,13,NULL),(80,55,54,NULL),(81,56,1,NULL),(82,57,13,NULL),(83,57,56,NULL),(84,58,1,NULL),(85,59,13,NULL),(87,60,5,NULL),(91,61,13,NULL),(92,61,36,NULL),(94,65,35,NULL),(97,67,5,NULL),(98,67,37,NULL),(99,69,35,NULL),(101,70,11,NULL),(102,71,1,NULL),(103,71,58,NULL),(105,72,18,NULL),(106,73,5,NULL),(107,73,64,NULL),(108,73,19,NULL),(109,59,50,NULL),(115,39,76,NULL),(117,65,76,NULL),(118,30,76,NULL),(124,5,76,NULL),(125,37,76,NULL),(126,38,76,NULL),(128,42,76,NULL),(129,35,76,NULL),(130,60,76,NULL),(131,21,76,NULL),(132,18,76,NULL),(133,50,76,NULL),(134,20,76,NULL),(135,41,76,NULL),(136,17,76,NULL),(137,52,76,NULL),(138,57,76,NULL),(139,37,74,NULL),(140,51,74,NULL),(141,51,75,NULL),(142,35,75,NULL),(143,15,49,NULL),(145,17,67,NULL),(146,38,13,NULL),(147,101,35,NULL),(148,101,13,NULL),(150,15,56,NULL),(152,69,47,NULL),(153,48,35,NULL),(154,102,1,NULL),(167,9,103,NULL),(168,66,9,NULL),(169,104,100,NULL),(172,103,76,NULL),(173,103,1,NULL),(174,103,44,NULL),(175,103,45,NULL),(176,103,11,NULL),(177,103,39,NULL),(178,103,17,NULL),(179,103,5,NULL),(180,103,67,NULL),(181,103,3,NULL),(182,103,34,NULL),(183,103,42,NULL),(184,103,43,NULL),(185,103,64,NULL),(186,103,35,NULL),(187,103,101,NULL),(188,103,75,NULL),(189,103,71,NULL),(190,103,72,NULL),(191,103,47,NULL),(192,103,69,NULL),(193,103,48,NULL),(194,103,2,NULL),(195,103,56,NULL),(196,103,57,NULL),(197,103,32,NULL),(198,103,73,NULL),(199,103,30,NULL),(200,103,31,NULL),(201,103,6,NULL),(202,103,40,NULL),(203,103,41,NULL),(204,103,37,NULL),(205,103,38,NULL),(206,103,53,NULL),(207,103,33,NULL),(210,103,54,NULL),(211,103,55,NULL),(212,103,15,NULL),(213,103,16,NULL),(215,103,51,NULL),(216,103,52,NULL),(218,103,65,NULL),(219,103,58,NULL),(220,103,59,NULL),(221,103,102,NULL),(222,103,49,NULL),(223,103,60,NULL),(224,103,50,NULL),(225,103,36,NULL),(226,103,61,NULL),(228,103,21,NULL),(229,103,19,NULL),(230,103,18,NULL),(231,103,13,NULL),(232,103,22,NULL),(233,103,70,NULL),(234,103,74,NULL),(237,66,103,NULL),(238,103,20,NULL),(239,106,11,NULL),(240,107,60,NULL),(241,21,72,NULL),(242,20,9,NULL),(245,57,33,NULL),(246,102,35,NULL),(247,108,1,NULL),(248,102,13,NULL),(249,109,18,NULL),(250,109,13,NULL),(251,51,21,NULL),(253,48,49,NULL),(254,110,1,NULL),(255,110,76,NULL),(256,48,69,NULL),(257,47,111,NULL),(258,43,111,NULL),(259,72,111,NULL),(260,35,111,NULL),(261,5,111,NULL),(262,112,1,NULL),(263,114,112,NULL),(264,51,35,NULL),(265,72,49,NULL),(266,101,18,NULL),(268,65,57,NULL),(269,65,59,NULL),(270,65,49,NULL),(271,65,18,NULL),(272,65,13,NULL),(273,60,35,NULL),(275,50,59,NULL),(276,60,49,NULL),(280,5,53,NULL),(281,5,18,NULL),(282,50,60,NULL),(283,5,21,NULL),(284,60,57,NULL),(285,58,76,NULL),(287,69,58,NULL),(288,115,66,NULL),(290,104,115,NULL),(291,115,103,NULL),(297,21,33,NULL),(298,49,54,NULL),(299,112,49,NULL),(300,114,13,NULL),(302,5,35,NULL),(303,69,49,NULL),(306,119,110,NULL),(307,1,76,NULL),(309,120,9,NULL),(310,120,66,NULL),(311,120,13,25508),(312,115,120,NULL),(314,43,18,NULL),(315,121,35,NULL),(316,121,21,NULL);
/*!40000 ALTER TABLE `roleInherit` ENABLE KEYS */;
UNLOCK TABLES;
@@ -98,7 +98,7 @@ UNLOCK TABLES;
LOCK TABLES `roleRole` WRITE;
/*!40000 ALTER TABLE `roleRole` DISABLE KEYS */;
-INSERT INTO `roleRole` VALUES (234609,1,1),(234610,1,2),(234611,1,3),(234614,1,6),(234613,1,11),(234612,1,70),(234496,2,2),(234498,2,6),(234497,2,11),(234357,3,3),(234359,3,6),(234358,3,11),(234313,5,1),(234324,5,2),(234323,5,3),(234312,5,5),(234330,5,6),(234326,5,11),(234321,5,13),(234314,5,18),(234315,5,21),(234316,5,33),(234329,5,36),(234332,5,44),(234331,5,47),(234325,5,49),(234317,5,53),(234328,5,54),(234327,5,58),(234322,5,70),(234320,5,72),(234318,5,76),(234319,5,111),(234720,6,6),(234549,9,1),(234550,9,2),(234551,9,3),(234552,9,5),(234553,9,6),(234547,9,9),(234554,9,11),(234555,9,13),(234556,9,15),(234557,9,16),(234558,9,17),(234559,9,18),(234560,9,19),(234561,9,20),(234562,9,21),(234563,9,22),(234564,9,30),(234565,9,31),(234566,9,32),(234567,9,33),(234568,9,34),(234569,9,35),(234570,9,36),(234571,9,37),(234572,9,38),(234573,9,39),(234574,9,40),(234575,9,41),(234576,9,42),(234577,9,43),(234578,9,44),(234579,9,45),(234580,9,47),(234581,9,48),(234582,9,49),(234583,9,50),(234584,9,51),(234585,9,52),(234586,9,53),(234587,9,54),(234588,9,55),(234589,9,56),(234590,9,57),(234591,9,58),(234592,9,59),(234593,9,60),(234594,9,61),(234595,9,64),(234596,9,65),(234597,9,67),(234598,9,69),(234599,9,70),(234600,9,71),(234601,9,72),(234602,9,73),(234603,9,74),(234604,9,75),(234605,9,76),(234606,9,101),(234607,9,102),(234548,9,103),(234608,9,111),(234225,11,6),(234224,11,11),(235592,13,1),(235593,13,2),(235594,13,3),(235597,13,6),(235596,13,11),(235591,13,13),(235595,13,70),(235008,15,1),(235017,15,2),(235016,15,3),(235019,15,6),(235018,15,11),(235002,15,15),(235003,15,35),(235010,15,36),(235014,15,44),(235013,15,47),(235004,15,49),(235011,15,54),(235005,15,56),(235012,15,58),(235015,15,70),(235007,15,75),(235006,15,76),(235009,15,111),(235027,16,1),(235036,16,2),(235035,16,3),(235038,16,6),(235037,16,11),(235021,16,15),(235020,16,16),(235022,16,35),(235029,16,36),(235033,16,44),(235032,16,47),(235023,16,49),(235030,16,54),(235024,16,56),(235031,16,58),(235034,16,70),(235026,16,75),(235025,16,76),(235028,16,111),(234258,17,1),(234268,17,2),(234267,17,3),(234263,17,5),(234293,17,6),(234262,17,9),(234292,17,11),(234261,17,13),(234273,17,15),(234260,17,16),(234250,17,17),(234272,17,18),(234291,17,19),(234251,17,20),(234264,17,21),(234290,17,22),(234289,17,30),(234288,17,31),(234287,17,32),(234275,17,33),(234286,17,34),(234271,17,35),(234285,17,36),(234252,17,37),(234284,17,38),(234253,17,39),(234283,17,40),(234282,17,41),(234281,17,42),(234280,17,43),(234294,17,44),(234295,17,45),(234296,17,47),(234297,17,48),(234270,17,49),(234298,17,50),(234299,17,51),(234300,17,52),(234276,17,53),(234301,17,54),(234302,17,55),(234279,17,56),(234265,17,57),(234303,17,58),(234269,17,59),(234304,17,60),(234305,17,61),(234254,17,64),(234259,17,65),(234255,17,67),(234306,17,69),(234266,17,70),(234307,17,71),(234278,17,72),(234308,17,73),(234257,17,74),(234309,17,75),(234256,17,76),(234310,17,101),(234311,17,102),(234274,17,103),(234277,17,111),(235504,18,1),(235507,18,2),(235506,18,3),(235510,18,6),(235509,18,11),(235503,18,18),(235508,18,70),(235505,18,76),(235492,19,1),(235498,19,2),(235497,19,3),(235502,19,6),(235501,19,11),(235484,19,13),(235485,19,18),(235482,19,19),(235483,19,21),(235486,19,33),(235495,19,36),(235500,19,44),(235499,19,47),(235491,19,49),(235487,19,53),(235494,19,54),(235493,19,58),(235496,19,70),(235488,19,72),(235489,19,76),(235490,19,111),(235080,20,1),(235092,20,2),(235091,20,3),(235090,20,5),(235089,20,6),(235072,20,9),(235088,20,11),(235073,20,13),(235079,20,15),(235074,20,16),(235087,20,17),(235078,20,18),(235086,20,19),(235071,20,20),(235085,20,21),(235093,20,22),(235094,20,30),(235095,20,31),(235096,20,32),(235097,20,33),(235098,20,34),(235077,20,35),(235099,20,36),(235100,20,37),(235101,20,38),(235102,20,39),(235103,20,40),(235104,20,41),(235105,20,42),(235106,20,43),(235107,20,44),(235108,20,45),(235109,20,47),(235110,20,48),(235082,20,49),(235111,20,50),(235112,20,51),(235113,20,52),(235114,20,53),(235115,20,54),(235116,20,55),(235117,20,56),(235083,20,57),(235118,20,58),(235084,20,59),(235119,20,60),(235120,20,61),(235121,20,64),(235075,20,65),(235122,20,67),(235123,20,69),(235124,20,70),(235125,20,71),(235126,20,72),(235127,20,73),(235128,20,74),(235129,20,75),(235076,20,76),(235130,20,101),(235131,20,102),(235081,20,103),(235132,20,111),(235471,21,1),(235477,21,2),(235476,21,3),(235481,21,6),(235480,21,11),(235463,21,13),(235464,21,18),(235462,21,21),(235465,21,33),(235474,21,36),(235479,21,44),(235478,21,47),(235470,21,49),(235466,21,53),(235473,21,54),(235472,21,58),(235475,21,70),(235467,21,72),(235468,21,76),(235469,21,111),(235602,22,1),(235611,22,2),(235610,22,3),(235618,22,6),(235615,22,11),(235599,22,13),(235601,22,18),(235600,22,21),(235598,22,22),(235603,22,33),(235614,22,36),(235617,22,44),(235616,22,47),(235608,22,49),(235604,22,53),(235613,22,54),(235612,22,58),(235609,22,70),(235605,22,72),(235606,22,76),(235607,22,111),(234662,30,1),(234674,30,2),(234673,30,3),(234651,30,5),(234684,30,6),(234657,30,9),(234685,30,11),(234663,30,13),(234669,30,15),(234664,30,16),(234683,30,17),(234661,30,18),(234682,30,19),(234652,30,20),(234660,30,21),(234653,30,22),(234650,30,30),(234681,30,31),(234680,30,32),(234659,30,33),(234679,30,34),(234668,30,35),(234678,30,36),(234677,30,37),(234676,30,38),(234686,30,39),(234687,30,40),(234688,30,41),(234689,30,42),(234690,30,43),(234691,30,44),(234692,30,45),(234693,30,47),(234694,30,48),(234667,30,49),(234695,30,50),(234696,30,51),(234697,30,52),(234654,30,53),(234698,30,54),(234699,30,55),(234700,30,56),(234666,30,57),(234701,30,58),(234675,30,59),(234702,30,60),(234703,30,61),(234655,30,64),(234665,30,65),(234704,30,67),(234705,30,69),(234672,30,70),(234706,30,71),(234671,30,72),(234707,30,73),(234708,30,74),(234709,30,75),(234656,30,76),(234710,30,101),(234711,30,102),(234670,30,103),(234658,30,111),(234713,31,1),(234714,31,2),(234715,31,3),(234718,31,6),(234717,31,11),(234712,31,31),(234716,31,70),(234617,32,1),(234618,32,2),(234619,32,3),(234622,32,6),(234621,32,11),(234616,32,32),(234620,32,70),(234783,33,33),(234361,34,1),(234366,34,2),(234365,34,3),(234368,34,6),(234367,34,11),(234362,34,13),(234363,34,33),(234360,34,34),(234364,34,70),(234407,35,1),(234413,35,2),(234412,35,3),(234415,35,6),(234414,35,11),(234406,35,35),(234411,35,70),(234408,35,75),(234409,35,76),(234410,35,111),(235368,36,1),(235370,36,2),(235369,36,3),(235373,36,6),(235372,36,11),(235364,36,36),(235365,36,44),(235366,36,47),(235371,36,70),(235367,36,111),(234756,37,1),(234761,37,2),(234760,37,3),(234763,37,6),(234762,37,11),(234755,37,37),(234759,37,70),(234757,37,74),(234758,37,76),(234770,38,1),(234773,38,2),(234772,38,3),(234775,38,6),(234774,38,11),(234765,38,13),(234766,38,37),(234764,38,38),(234767,38,64),(234771,38,70),(234769,38,74),(234768,38,76),(234234,39,1),(234242,39,2),(234241,39,3),(234227,39,5),(234249,39,6),(234246,39,11),(234236,39,13),(234233,39,18),(234228,39,21),(234232,39,33),(234245,39,36),(234226,39,39),(234248,39,44),(234247,39,47),(234239,39,49),(234231,39,53),(234244,39,54),(234238,39,56),(234229,39,57),(234243,39,58),(234240,39,70),(234237,39,72),(234230,39,76),(234235,39,111),(234722,40,1),(234725,40,2),(234724,40,3),(234735,40,6),(234733,40,11),(234727,40,36),(234721,40,40),(234732,40,44),(234731,40,47),(234723,40,49),(234728,40,54),(234729,40,58),(234726,40,70),(234730,40,76),(234734,40,111),(234744,41,1),(234748,41,2),(234747,41,3),(234754,41,6),(234753,41,11),(234737,41,13),(234738,41,35),(234745,41,36),(234739,41,40),(234736,41,41),(234752,41,44),(234751,41,47),(234741,41,49),(234749,41,54),(234750,41,58),(234746,41,70),(234743,41,75),(234740,41,76),(234742,41,111),(234375,42,1),(234383,42,2),(234382,42,3),(234385,42,6),(234384,42,11),(234370,42,35),(234376,42,36),(234369,42,42),(234380,42,44),(234379,42,47),(234371,42,49),(234377,42,54),(234378,42,58),(234381,42,70),(234374,42,75),(234372,42,76),(234373,42,111),(234392,43,1),(234397,43,2),(234396,43,3),(234404,43,6),(234403,43,11),(234387,43,13),(234391,43,35),(234398,43,36),(234388,43,42),(234386,43,43),(234402,43,44),(234401,43,47),(234390,43,49),(234399,43,54),(234400,43,58),(234395,43,70),(234394,43,75),(234393,43,76),(234389,43,111),(234209,44,1),(234210,44,2),(234211,44,3),(234214,44,6),(234213,44,11),(234208,44,44),(234212,44,70),(234218,45,1),(234220,45,2),(234219,45,3),(234223,45,6),(234222,45,11),(234216,45,13),(234217,45,44),(234215,45,45),(234221,45,70),(234457,47,1),(234460,47,2),(234459,47,3),(234463,47,6),(234462,47,11),(234456,47,47),(234461,47,70),(234458,47,111),(234487,48,1),(234493,48,2),(234492,48,3),(234495,48,6),(234494,48,11),(234478,48,13),(234479,48,35),(234483,48,36),(234490,48,44),(234480,48,47),(234477,48,48),(234481,48,49),(234488,48,54),(234489,48,58),(234482,48,69),(234491,48,70),(234486,48,75),(234485,48,76),(234484,48,111),(235273,49,1),(235279,49,2),(235278,49,3),(235282,49,6),(235281,49,11),(235270,49,36),(235275,49,44),(235274,49,47),(235269,49,49),(235271,49,54),(235272,49,58),(235277,49,70),(235276,49,76),(235280,49,111),(235325,50,1),(235334,50,2),(235333,50,3),(235329,50,5),(235336,50,6),(235335,50,11),(235310,50,13),(235324,50,18),(235311,50,21),(235323,50,33),(235312,50,35),(235318,50,36),(235331,50,44),(235330,50,47),(235313,50,49),(235309,50,50),(235322,50,53),(235326,50,54),(235328,50,56),(235314,50,57),(235327,50,58),(235315,50,59),(235316,50,60),(235332,50,70),(235321,50,72),(235320,50,75),(235317,50,76),(235319,50,111),(235134,51,1),(235143,51,2),(235142,51,3),(235154,51,6),(235150,51,11),(235140,51,13),(235139,51,18),(235135,51,21),(235144,51,33),(235136,51,35),(235153,51,36),(235156,51,44),(235155,51,47),(235149,51,49),(235133,51,51),(235145,51,53),(235152,51,54),(235151,51,58),(235141,51,70),(235146,51,72),(235137,51,74),(235138,51,75),(235147,51,76),(235148,51,111),(235165,52,1),(235171,52,2),(235170,52,3),(235180,52,6),(235176,52,11),(235158,52,13),(235168,52,18),(235159,52,19),(235164,52,21),(235167,52,33),(235163,52,35),(235179,52,36),(235182,52,44),(235181,52,47),(235175,52,49),(235160,52,51),(235157,52,52),(235172,52,53),(235178,52,54),(235177,52,58),(235169,52,70),(235173,52,72),(235162,52,74),(235166,52,75),(235161,52,76),(235174,52,111),(234777,53,1),(234778,53,2),(234779,53,3),(234782,53,6),(234781,53,11),(234776,53,53),(234780,53,70),(234923,54,1),(234924,54,2),(234925,54,3),(234928,54,6),(234927,54,11),(234922,54,54),(234926,54,70),(234932,55,1),(234934,55,2),(234933,55,3),(234937,55,6),(234936,55,11),(234930,55,13),(234931,55,54),(234929,55,55),(234935,55,70),(234500,56,1),(234501,56,2),(234502,56,3),(234505,56,6),(234504,56,11),(234499,56,56),(234503,56,70),(234511,57,1),(234514,57,2),(234513,57,3),(234516,57,6),(234515,57,11),(234507,57,13),(234508,57,33),(234509,57,56),(234506,57,57),(234512,57,70),(234510,57,76),(235214,58,1),(235217,58,2),(235216,58,3),(235220,58,6),(235219,58,11),(235213,58,58),(235218,58,70),(235215,58,76),(235225,59,1),(235237,59,2),(235236,59,3),(235244,59,5),(235248,59,6),(235247,59,11),(235222,59,13),(235234,59,18),(235224,59,21),(235233,59,33),(235226,59,35),(235240,59,36),(235246,59,44),(235245,59,47),(235227,59,49),(235223,59,50),(235232,59,53),(235241,59,54),(235243,59,56),(235228,59,57),(235242,59,58),(235221,59,59),(235229,59,60),(235235,59,70),(235231,59,72),(235238,59,75),(235230,59,76),(235239,59,111),(235293,60,1),(235306,60,2),(235305,60,3),(235284,60,5),(235308,60,6),(235307,60,11),(235299,60,13),(235292,60,18),(235291,60,21),(235290,60,33),(235285,60,35),(235296,60,36),(235302,60,44),(235301,60,47),(235286,60,49),(235289,60,53),(235297,60,54),(235300,60,56),(235287,60,57),(235298,60,58),(235283,60,60),(235304,60,70),(235303,60,72),(235295,60,75),(235288,60,76),(235294,60,111),(235378,61,1),(235382,61,2),(235381,61,3),(235385,61,6),(235384,61,11),(235375,61,13),(235376,61,36),(235377,61,44),(235379,61,47),(235374,61,61),(235380,61,70),(235383,61,111),(235183,62,62),(234405,64,64),(235198,65,1),(235207,65,2),(235206,65,3),(235208,65,5),(235212,65,6),(235211,65,11),(235185,65,13),(235186,65,18),(235202,65,21),(235192,65,33),(235187,65,35),(235195,65,36),(235204,65,44),(235203,65,47),(235188,65,49),(235200,65,50),(235210,65,53),(235194,65,54),(235199,65,56),(235189,65,57),(235193,65,58),(235190,65,59),(235201,65,60),(235184,65,65),(235205,65,70),(235209,65,72),(235197,65,75),(235191,65,76),(235196,65,111),(235525,66,1),(235524,66,2),(235526,66,3),(235527,66,5),(235528,66,6),(235522,66,9),(235529,66,11),(235530,66,13),(235531,66,15),(235532,66,16),(235533,66,17),(235534,66,18),(235535,66,19),(235536,66,20),(235537,66,21),(235538,66,22),(235539,66,30),(235540,66,31),(235541,66,32),(235542,66,33),(235543,66,34),(235544,66,35),(235545,66,36),(235546,66,37),(235547,66,38),(235548,66,39),(235549,66,40),(235550,66,41),(235551,66,42),(235552,66,43),(235553,66,44),(235554,66,45),(235555,66,47),(235556,66,48),(235557,66,49),(235558,66,50),(235559,66,51),(235560,66,52),(235561,66,53),(235562,66,54),(235563,66,55),(235564,66,56),(235565,66,57),(235566,66,58),(235567,66,59),(235568,66,60),(235569,66,61),(235570,66,64),(235571,66,65),(235521,66,66),(235572,66,67),(235573,66,69),(235574,66,70),(235575,66,71),(235576,66,72),(235577,66,73),(235578,66,74),(235579,66,75),(235580,66,76),(235581,66,101),(235582,66,102),(235523,66,103),(235583,66,111),(234337,67,1),(234348,67,2),(234347,67,3),(234334,67,5),(234354,67,6),(234350,67,11),(234345,67,13),(234336,67,18),(234338,67,21),(234339,67,33),(234353,67,36),(234335,67,37),(234356,67,44),(234355,67,47),(234349,67,49),(234340,67,53),(234352,67,54),(234351,67,58),(234333,67,67),(234346,67,70),(234344,67,72),(234343,67,74),(234341,67,76),(234342,67,111),(234470,69,1),(234474,69,2),(234473,69,3),(234476,69,6),(234475,69,11),(234465,69,35),(234466,69,47),(234467,69,58),(234464,69,69),(234472,69,70),(234469,69,75),(234468,69,76),(234471,69,111),(235621,70,6),(235620,70,11),(235619,70,70),(234432,71,1),(234435,71,2),(234434,71,3),(234439,71,6),(234438,71,11),(234433,71,58),(234436,71,70),(234431,71,71),(234437,71,76),(234446,72,1),(234453,72,2),(234452,72,3),(234455,72,6),(234454,72,11),(234441,72,18),(234444,72,36),(234450,72,44),(234449,72,47),(234442,72,49),(234447,72,54),(234448,72,58),(234451,72,70),(234440,72,72),(234445,72,76),(234443,72,111),(234632,73,1),(234641,73,2),(234640,73,3),(234627,73,5),(234647,73,6),(234643,73,11),(234638,73,13),(234631,73,18),(234628,73,19),(234630,73,21),(234633,73,33),(234646,73,36),(234649,73,44),(234648,73,47),(234642,73,49),(234634,73,53),(234645,73,54),(234644,73,58),(234629,73,64),(234639,73,70),(234637,73,72),(234626,73,73),(234635,73,76),(234636,73,111),(235622,74,74),(234429,75,75),(234430,76,76),(235413,100,1),(235408,100,2),(235394,100,3),(235392,100,5),(235421,100,6),(235412,100,9),(235389,100,11),(235458,100,13),(235433,100,15),(235434,100,16),(235391,100,17),(235454,100,18),(235453,100,19),(235437,100,20),(235452,100,21),(235459,100,22),(235418,100,30),(235419,100,31),(235415,100,32),(235427,100,33),(235395,100,34),(235399,100,35),(235450,100,36),(235424,100,37),(235425,100,38),(235390,100,39),(235422,100,40),(235423,100,41),(235396,100,42),(235397,100,43),(235387,100,44),(235388,100,45),(235405,100,47),(235407,100,48),(235446,100,49),(235448,100,50),(235438,100,51),(235439,100,52),(235426,100,53),(235430,100,54),(235431,100,55),(235409,100,56),(235410,100,57),(235442,100,58),(235443,100,59),(235447,100,60),(235451,100,61),(235440,100,62),(235398,100,64),(235441,100,65),(235456,100,66),(235393,100,67),(235406,100,69),(235460,100,70),(235403,100,71),(235404,100,72),(235417,100,73),(235461,100,74),(235401,100,75),(235402,100,76),(235386,100,100),(235400,100,101),(235445,100,102),(235428,100,103),(235429,100,104),(235420,100,105),(235416,100,106),(235449,100,107),(235457,100,108),(235455,100,109),(235444,100,110),(235414,100,111),(235435,100,112),(235436,100,114),(235432,100,115),(235411,100,116),(234422,101,1),(234426,101,2),(234425,101,3),(234428,101,6),(234427,101,11),(234417,101,13),(234418,101,18),(234419,101,35),(234424,101,70),(234420,101,75),(234421,101,76),(234416,101,101),(234423,101,111),(235258,102,1),(235263,102,2),(235262,102,3),(235268,102,6),(235267,102,11),(235259,102,13),(235260,102,35),(235261,102,70),(235264,102,75),(235265,102,76),(235257,102,102),(235266,102,111),(234785,103,1),(234786,103,2),(234787,103,3),(234788,103,5),(234789,103,6),(234844,103,9),(234790,103,11),(234791,103,13),(234792,103,15),(234793,103,16),(234794,103,17),(234795,103,18),(234796,103,19),(234797,103,20),(234798,103,21),(234799,103,22),(234800,103,30),(234801,103,31),(234802,103,32),(234803,103,33),(234804,103,34),(234805,103,35),(234806,103,36),(234807,103,37),(234808,103,38),(234809,103,39),(234810,103,40),(234811,103,41),(234812,103,42),(234813,103,43),(234814,103,44),(234815,103,45),(234816,103,47),(234817,103,48),(234818,103,49),(234819,103,50),(234820,103,51),(234821,103,52),(234822,103,53),(234823,103,54),(234824,103,55),(234825,103,56),(234826,103,57),(234827,103,58),(234828,103,59),(234829,103,60),(234830,103,61),(234831,103,64),(234832,103,65),(234833,103,67),(234834,103,69),(234835,103,70),(234836,103,71),(234837,103,72),(234838,103,73),(234839,103,74),(234840,103,75),(234841,103,76),(234842,103,101),(234843,103,102),(234784,103,103),(234845,103,111),(234854,104,1),(234853,104,2),(234852,104,3),(234855,104,5),(234856,104,6),(234850,104,9),(234857,104,11),(234858,104,13),(234859,104,15),(234860,104,16),(234861,104,17),(234862,104,18),(234863,104,19),(234864,104,20),(234865,104,21),(234866,104,22),(234867,104,30),(234868,104,31),(234869,104,32),(234870,104,33),(234871,104,34),(234872,104,35),(234873,104,36),(234874,104,37),(234875,104,38),(234876,104,39),(234877,104,40),(234878,104,41),(234879,104,42),(234880,104,43),(234881,104,44),(234882,104,45),(234883,104,47),(234884,104,48),(234885,104,49),(234886,104,50),(234887,104,51),(234888,104,52),(234889,104,53),(234890,104,54),(234891,104,55),(234892,104,56),(234893,104,57),(234894,104,58),(234895,104,59),(234896,104,60),(234897,104,61),(234917,104,62),(234898,104,64),(234899,104,65),(234849,104,66),(234900,104,67),(234901,104,69),(234902,104,70),(234903,104,71),(234904,104,72),(234905,104,73),(234906,104,74),(234907,104,75),(234908,104,76),(234847,104,100),(234909,104,101),(234910,104,102),(234851,104,103),(234846,104,104),(234914,104,105),(234913,104,106),(234919,104,107),(234921,104,108),(234920,104,109),(234918,104,110),(234911,104,111),(234915,104,112),(234916,104,114),(234848,104,115),(234912,104,116),(234719,105,105),(234625,106,6),(234624,106,11),(234623,106,106),(235348,107,1),(235361,107,2),(235360,107,3),(235339,107,5),(235363,107,6),(235362,107,11),(235354,107,13),(235347,107,18),(235346,107,21),(235345,107,33),(235340,107,35),(235351,107,36),(235357,107,44),(235356,107,47),(235341,107,49),(235344,107,53),(235352,107,54),(235355,107,56),(235342,107,57),(235353,107,58),(235338,107,60),(235359,107,70),(235358,107,72),(235350,107,75),(235343,107,76),(235337,107,107),(235349,107,111),(235585,108,1),(235586,108,2),(235587,108,3),(235590,108,6),(235589,108,11),(235588,108,70),(235584,108,108),(235515,109,1),(235517,109,2),(235516,109,3),(235520,109,6),(235519,109,11),(235512,109,13),(235513,109,18),(235518,109,70),(235514,109,76),(235511,109,109),(235250,110,1),(235253,110,2),(235252,110,3),(235256,110,6),(235255,110,11),(235254,110,70),(235251,110,76),(235249,110,110),(234615,111,111),(235040,112,1),(235043,112,2),(235042,112,3),(235053,112,6),(235051,112,11),(235045,112,36),(235050,112,44),(235049,112,47),(235041,112,49),(235046,112,54),(235047,112,58),(235044,112,70),(235048,112,76),(235052,112,111),(235039,112,112),(235058,114,1),(235060,114,2),(235059,114,3),(235070,114,6),(235068,114,11),(235055,114,13),(235062,114,36),(235067,114,44),(235066,114,47),(235057,114,49),(235063,114,54),(235064,114,58),(235061,114,70),(235065,114,76),(235069,114,111),(235056,114,112),(235054,114,114),(234944,115,1),(234943,115,2),(234942,115,3),(234945,115,5),(234946,115,6),(234939,115,9),(234947,115,11),(234948,115,13),(234949,115,15),(234950,115,16),(234951,115,17),(234952,115,18),(234953,115,19),(234954,115,20),(234955,115,21),(234956,115,22),(234957,115,30),(234958,115,31),(234959,115,32),(234960,115,33),(234961,115,34),(234962,115,35),(234963,115,36),(234964,115,37),(234965,115,38),(234966,115,39),(234967,115,40),(234968,115,41),(234969,115,42),(234970,115,43),(234971,115,44),(234972,115,45),(234973,115,47),(234974,115,48),(234975,115,49),(234976,115,50),(234977,115,51),(234978,115,52),(234979,115,53),(234980,115,54),(234981,115,55),(234982,115,56),(234983,115,57),(234984,115,58),(234985,115,59),(234986,115,60),(234987,115,61),(234988,115,64),(234989,115,65),(234940,115,66),(234990,115,67),(234991,115,69),(234992,115,70),(234993,115,71),(234994,115,72),(234995,115,73),(234996,115,74),(234997,115,75),(234998,115,76),(234999,115,101),(235000,115,102),(234941,115,103),(235001,115,111),(234938,115,115),(234533,116,1),(234544,116,2),(234543,116,3),(234521,116,5),(234546,116,6),(234545,116,11),(234537,116,13),(234532,116,18),(234525,116,19),(234531,116,21),(234530,116,33),(234520,116,35),(234534,116,36),(234540,116,44),(234539,116,47),(234522,116,49),(234529,116,53),(234535,116,54),(234538,116,56),(234523,116,57),(234536,116,58),(234518,116,60),(234526,116,64),(234542,116,70),(234541,116,72),(234519,116,73),(234527,116,75),(234524,116,76),(234528,116,111),(234517,116,116);
+INSERT INTO `roleRole` VALUES (276665,1,1),(276666,1,2),(276667,1,3),(276671,1,6),(276670,1,11),(276668,1,70),(276669,1,76),(276672,2,2),(276674,2,6),(276673,2,11),(276675,3,3),(276677,3,6),(276676,3,11),(276679,5,1),(276692,5,2),(276691,5,3),(276678,5,5),(276698,5,6),(276694,5,11),(276689,5,13),(276680,5,18),(276681,5,21),(276682,5,33),(276683,5,35),(276697,5,36),(276700,5,44),(276699,5,47),(276693,5,49),(276684,5,53),(276696,5,54),(276695,5,58),(276690,5,70),(276688,5,72),(276687,5,75),(276685,5,76),(276686,5,111),(276701,6,6),(276704,9,1),(276705,9,2),(276706,9,3),(276707,9,5),(276708,9,6),(276702,9,9),(276709,9,11),(276710,9,13),(276711,9,15),(276712,9,16),(276713,9,17),(276714,9,18),(276715,9,19),(276716,9,20),(276717,9,21),(276718,9,22),(276719,9,30),(276720,9,31),(276721,9,32),(276722,9,33),(276723,9,34),(276724,9,35),(276725,9,36),(276726,9,37),(276727,9,38),(276728,9,39),(276729,9,40),(276730,9,41),(276731,9,42),(276732,9,43),(276733,9,44),(276734,9,45),(276735,9,47),(276736,9,48),(276737,9,49),(276738,9,50),(276739,9,51),(276740,9,52),(276741,9,53),(276742,9,54),(276743,9,55),(276744,9,56),(276745,9,57),(276746,9,58),(276747,9,59),(276748,9,60),(276749,9,61),(276750,9,64),(276751,9,65),(276752,9,67),(276753,9,69),(276754,9,70),(276755,9,71),(276756,9,72),(276757,9,73),(276758,9,74),(276759,9,75),(276760,9,76),(276761,9,101),(276762,9,102),(276703,9,103),(276763,9,111),(276765,11,6),(276764,11,11),(276767,13,1),(276768,13,2),(276769,13,3),(276773,13,6),(276772,13,11),(276766,13,13),(276770,13,70),(276771,13,76),(276780,15,1),(276789,15,2),(276788,15,3),(276791,15,6),(276790,15,11),(276774,15,15),(276775,15,35),(276782,15,36),(276786,15,44),(276785,15,47),(276776,15,49),(276783,15,54),(276777,15,56),(276784,15,58),(276787,15,70),(276779,15,75),(276778,15,76),(276781,15,111),(276799,16,1),(276808,16,2),(276807,16,3),(276810,16,6),(276809,16,11),(276793,16,15),(276792,16,16),(276794,16,35),(276801,16,36),(276805,16,44),(276804,16,47),(276795,16,49),(276802,16,54),(276796,16,56),(276803,16,58),(276806,16,70),(276798,16,75),(276797,16,76),(276800,16,111),(276819,17,1),(276829,17,2),(276828,17,3),(276824,17,5),(276854,17,6),(276823,17,9),(276853,17,11),(276822,17,13),(276834,17,15),(276821,17,16),(276811,17,17),(276833,17,18),(276852,17,19),(276812,17,20),(276825,17,21),(276851,17,22),(276850,17,30),(276849,17,31),(276848,17,32),(276836,17,33),(276847,17,34),(276832,17,35),(276846,17,36),(276813,17,37),(276845,17,38),(276814,17,39),(276844,17,40),(276843,17,41),(276842,17,42),(276841,17,43),(276855,17,44),(276856,17,45),(276857,17,47),(276858,17,48),(276831,17,49),(276859,17,50),(276860,17,51),(276861,17,52),(276837,17,53),(276862,17,54),(276863,17,55),(276840,17,56),(276826,17,57),(276864,17,58),(276830,17,59),(276865,17,60),(276866,17,61),(276815,17,64),(276820,17,65),(276816,17,67),(276867,17,69),(276827,17,70),(276868,17,71),(276839,17,72),(276869,17,73),(276818,17,74),(276870,17,75),(276817,17,76),(276871,17,101),(276872,17,102),(276835,17,103),(276838,17,111),(276874,18,1),(276877,18,2),(276876,18,3),(276880,18,6),(276879,18,11),(276873,18,18),(276878,18,70),(276875,18,76),(276891,19,1),(276897,19,2),(276896,19,3),(276901,19,6),(276900,19,11),(276883,19,13),(276884,19,18),(276881,19,19),(276882,19,21),(276885,19,33),(276894,19,36),(276899,19,44),(276898,19,47),(276890,19,49),(276886,19,53),(276893,19,54),(276892,19,58),(276895,19,70),(276887,19,72),(276888,19,76),(276889,19,111),(276911,20,1),(276923,20,2),(276922,20,3),(276921,20,5),(276920,20,6),(276903,20,9),(276919,20,11),(276904,20,13),(276910,20,15),(276905,20,16),(276918,20,17),(276909,20,18),(276917,20,19),(276902,20,20),(276916,20,21),(276924,20,22),(276925,20,30),(276926,20,31),(276927,20,32),(276928,20,33),(276929,20,34),(276908,20,35),(276930,20,36),(276931,20,37),(276932,20,38),(276933,20,39),(276934,20,40),(276935,20,41),(276936,20,42),(276937,20,43),(276938,20,44),(276939,20,45),(276940,20,47),(276941,20,48),(276913,20,49),(276942,20,50),(276943,20,51),(276944,20,52),(276945,20,53),(276946,20,54),(276947,20,55),(276948,20,56),(276914,20,57),(276949,20,58),(276915,20,59),(276950,20,60),(276951,20,61),(276952,20,64),(276906,20,65),(276953,20,67),(276954,20,69),(276955,20,70),(276956,20,71),(276957,20,72),(276958,20,73),(276959,20,74),(276960,20,75),(276907,20,76),(276961,20,101),(276962,20,102),(276912,20,103),(276963,20,111),(276973,21,1),(276979,21,2),(276978,21,3),(276983,21,6),(276982,21,11),(276965,21,13),(276966,21,18),(276964,21,21),(276967,21,33),(276976,21,36),(276981,21,44),(276980,21,47),(276972,21,49),(276968,21,53),(276975,21,54),(276974,21,58),(276977,21,70),(276969,21,72),(276970,21,76),(276971,21,111),(276988,22,1),(276997,22,2),(276996,22,3),(277004,22,6),(277001,22,11),(276985,22,13),(276987,22,18),(276986,22,21),(276984,22,22),(276989,22,33),(277000,22,36),(277003,22,44),(277002,22,47),(276994,22,49),(276990,22,53),(276999,22,54),(276998,22,58),(276995,22,70),(276991,22,72),(276992,22,76),(276993,22,111),(277017,30,1),(277031,30,2),(277030,30,3),(277006,30,5),(277040,30,6),(277018,30,9),(277041,30,11),(277019,30,13),(277025,30,15),(277020,30,16),(277039,30,17),(277016,30,18),(277038,30,19),(277007,30,20),(277015,30,21),(277008,30,22),(277005,30,30),(277037,30,31),(277036,30,32),(277014,30,33),(277035,30,34),(277013,30,35),(277034,30,36),(277033,30,37),(277032,30,38),(277042,30,39),(277043,30,40),(277044,30,41),(277045,30,42),(277046,30,43),(277047,30,44),(277048,30,45),(277049,30,47),(277050,30,48),(277024,30,49),(277051,30,50),(277052,30,51),(277053,30,52),(277009,30,53),(277054,30,54),(277055,30,55),(277056,30,56),(277023,30,57),(277057,30,58),(277022,30,59),(277058,30,60),(277059,30,61),(277010,30,64),(277021,30,65),(277060,30,67),(277061,30,69),(277029,30,70),(277062,30,71),(277028,30,72),(277063,30,73),(277064,30,74),(277027,30,75),(277011,30,76),(277065,30,101),(277066,30,102),(277026,30,103),(277012,30,111),(277068,31,1),(277069,31,2),(277070,31,3),(277074,31,6),(277073,31,11),(277067,31,31),(277071,31,70),(277072,31,76),(277076,32,1),(277077,32,2),(277078,32,3),(277082,32,6),(277081,32,11),(277075,32,32),(277079,32,70),(277080,32,76),(277083,33,33),(277085,34,1),(277090,34,2),(277089,34,3),(277093,34,6),(277092,34,11),(277086,34,13),(277087,34,33),(277084,34,34),(277088,34,70),(277091,34,76),(277095,35,1),(277101,35,2),(277100,35,3),(277103,35,6),(277102,35,11),(277094,35,35),(277099,35,70),(277096,35,75),(277097,35,76),(277098,35,111),(277108,36,1),(277110,36,2),(277109,36,3),(277114,36,6),(277113,36,11),(277104,36,36),(277105,36,44),(277106,36,47),(277111,36,70),(277112,36,76),(277107,36,111),(277116,37,1),(277121,37,2),(277120,37,3),(277123,37,6),(277122,37,11),(277115,37,37),(277119,37,70),(277117,37,74),(277118,37,76),(277130,38,1),(277133,38,2),(277132,38,3),(277135,38,6),(277134,38,11),(277125,38,13),(277126,38,37),(277124,38,38),(277127,38,64),(277131,38,70),(277129,38,74),(277128,38,76),(277144,39,1),(277154,39,2),(277153,39,3),(277137,39,5),(277161,39,6),(277158,39,11),(277147,39,13),(277143,39,18),(277138,39,21),(277142,39,33),(277141,39,35),(277157,39,36),(277136,39,39),(277160,39,44),(277159,39,47),(277150,39,49),(277145,39,53),(277156,39,54),(277149,39,56),(277139,39,57),(277155,39,58),(277152,39,70),(277148,39,72),(277151,39,75),(277140,39,76),(277146,39,111),(277163,40,1),(277166,40,2),(277165,40,3),(277176,40,6),(277174,40,11),(277169,40,36),(277162,40,40),(277173,40,44),(277172,40,47),(277164,40,49),(277170,40,54),(277171,40,58),(277167,40,70),(277168,40,76),(277175,40,111),(277185,41,1),(277189,41,2),(277188,41,3),(277195,41,6),(277194,41,11),(277178,41,13),(277179,41,35),(277186,41,36),(277180,41,40),(277177,41,41),(277193,41,44),(277192,41,47),(277182,41,49),(277190,41,54),(277191,41,58),(277187,41,70),(277184,41,75),(277181,41,76),(277183,41,111),(277202,42,1),(277210,42,2),(277209,42,3),(277212,42,6),(277211,42,11),(277197,42,35),(277203,42,36),(277196,42,42),(277207,42,44),(277206,42,47),(277198,42,49),(277204,42,54),(277205,42,58),(277208,42,70),(277201,42,75),(277199,42,76),(277200,42,111),(277221,43,1),(277225,43,2),(277224,43,3),(277232,43,6),(277231,43,11),(277214,43,13),(277215,43,18),(277219,43,35),(277226,43,36),(277216,43,42),(277213,43,43),(277230,43,44),(277229,43,47),(277218,43,49),(277227,43,54),(277228,43,58),(277223,43,70),(277222,43,75),(277220,43,76),(277217,43,111),(277234,44,1),(277235,44,2),(277236,44,3),(277240,44,6),(277239,44,11),(277233,44,44),(277237,44,70),(277238,44,76),(277244,45,1),(277246,45,2),(277245,45,3),(277250,45,6),(277249,45,11),(277242,45,13),(277243,45,44),(277241,45,45),(277247,45,70),(277248,45,76),(277252,47,1),(277255,47,2),(277254,47,3),(277259,47,6),(277258,47,11),(277251,47,47),(277256,47,70),(277257,47,76),(277253,47,111),(277270,48,1),(277276,48,2),(277275,48,3),(277278,48,6),(277277,48,11),(277261,48,13),(277262,48,35),(277266,48,36),(277273,48,44),(277263,48,47),(277260,48,48),(277264,48,49),(277271,48,54),(277272,48,58),(277265,48,69),(277274,48,70),(277269,48,75),(277268,48,76),(277267,48,111),(277283,49,1),(277289,49,2),(277288,49,3),(277292,49,6),(277291,49,11),(277280,49,36),(277285,49,44),(277284,49,47),(277279,49,49),(277281,49,54),(277282,49,58),(277287,49,70),(277286,49,76),(277290,49,111),(277309,50,1),(277318,50,2),(277317,50,3),(277313,50,5),(277320,50,6),(277319,50,11),(277294,50,13),(277308,50,18),(277295,50,21),(277307,50,33),(277296,50,35),(277302,50,36),(277315,50,44),(277314,50,47),(277297,50,49),(277293,50,50),(277306,50,53),(277310,50,54),(277312,50,56),(277298,50,57),(277311,50,58),(277299,50,59),(277300,50,60),(277316,50,70),(277305,50,72),(277304,50,75),(277301,50,76),(277303,50,111),(277322,51,1),(277331,51,2),(277330,51,3),(277342,51,6),(277338,51,11),(277327,51,13),(277332,51,18),(277323,51,21),(277333,51,33),(277324,51,35),(277341,51,36),(277344,51,44),(277343,51,47),(277337,51,49),(277321,51,51),(277334,51,53),(277340,51,54),(277339,51,58),(277329,51,70),(277335,51,72),(277325,51,74),(277326,51,75),(277328,51,76),(277336,51,111),(277353,52,1),(277359,52,2),(277358,52,3),(277368,52,6),(277364,52,11),(277346,52,13),(277356,52,18),(277347,52,19),(277352,52,21),(277355,52,33),(277351,52,35),(277367,52,36),(277370,52,44),(277369,52,47),(277363,52,49),(277348,52,51),(277345,52,52),(277360,52,53),(277366,52,54),(277365,52,58),(277357,52,70),(277361,52,72),(277350,52,74),(277354,52,75),(277349,52,76),(277362,52,111),(277372,53,1),(277373,53,2),(277374,53,3),(277378,53,6),(277377,53,11),(277371,53,53),(277375,53,70),(277376,53,76),(277380,54,1),(277381,54,2),(277382,54,3),(277386,54,6),(277385,54,11),(277379,54,54),(277383,54,70),(277384,54,76),(277390,55,1),(277392,55,2),(277391,55,3),(277396,55,6),(277395,55,11),(277388,55,13),(277389,55,54),(277387,55,55),(277393,55,70),(277394,55,76),(277398,56,1),(277399,56,2),(277400,56,3),(277404,56,6),(277403,56,11),(277397,56,56),(277401,56,70),(277402,56,76),(277410,57,1),(277413,57,2),(277412,57,3),(277415,57,6),(277414,57,11),(277406,57,13),(277407,57,33),(277408,57,56),(277405,57,57),(277411,57,70),(277409,57,76),(277417,58,1),(277420,58,2),(277419,58,3),(277423,58,6),(277422,58,11),(277416,58,58),(277421,58,70),(277418,58,76),(277428,59,1),(277440,59,2),(277439,59,3),(277447,59,5),(277451,59,6),(277450,59,11),(277425,59,13),(277437,59,18),(277427,59,21),(277436,59,33),(277429,59,35),(277443,59,36),(277449,59,44),(277448,59,47),(277430,59,49),(277426,59,50),(277435,59,53),(277444,59,54),(277446,59,56),(277431,59,57),(277445,59,58),(277424,59,59),(277432,59,60),(277438,59,70),(277434,59,72),(277441,59,75),(277433,59,76),(277442,59,111),(277462,60,1),(277475,60,2),(277474,60,3),(277453,60,5),(277477,60,6),(277476,60,11),(277468,60,13),(277461,60,18),(277460,60,21),(277459,60,33),(277454,60,35),(277465,60,36),(277471,60,44),(277470,60,47),(277455,60,49),(277458,60,53),(277466,60,54),(277469,60,56),(277456,60,57),(277467,60,58),(277452,60,60),(277473,60,70),(277472,60,72),(277464,60,75),(277457,60,76),(277463,60,111),(277482,61,1),(277486,61,2),(277485,61,3),(277490,61,6),(277489,61,11),(277479,61,13),(277480,61,36),(277481,61,44),(277483,61,47),(277478,61,61),(277484,61,70),(277487,61,76),(277488,61,111),(277491,62,62),(277492,64,64),(277507,65,1),(277516,65,2),(277515,65,3),(277517,65,5),(277521,65,6),(277520,65,11),(277494,65,13),(277495,65,18),(277511,65,21),(277501,65,33),(277496,65,35),(277504,65,36),(277513,65,44),(277512,65,47),(277497,65,49),(277509,65,50),(277519,65,53),(277503,65,54),(277508,65,56),(277498,65,57),(277502,65,58),(277499,65,59),(277510,65,60),(277493,65,65),(277514,65,70),(277518,65,72),(277506,65,75),(277500,65,76),(277505,65,111),(277526,66,1),(277525,66,2),(277527,66,3),(277528,66,5),(277529,66,6),(277523,66,9),(277530,66,11),(277531,66,13),(277532,66,15),(277533,66,16),(277534,66,17),(277535,66,18),(277536,66,19),(277537,66,20),(277538,66,21),(277539,66,22),(277540,66,30),(277541,66,31),(277542,66,32),(277543,66,33),(277544,66,34),(277545,66,35),(277546,66,36),(277547,66,37),(277548,66,38),(277549,66,39),(277550,66,40),(277551,66,41),(277552,66,42),(277553,66,43),(277554,66,44),(277555,66,45),(277556,66,47),(277557,66,48),(277558,66,49),(277559,66,50),(277560,66,51),(277561,66,52),(277562,66,53),(277563,66,54),(277564,66,55),(277565,66,56),(277566,66,57),(277567,66,58),(277568,66,59),(277569,66,60),(277570,66,61),(277571,66,64),(277572,66,65),(277522,66,66),(277573,66,67),(277574,66,69),(277575,66,70),(277576,66,71),(277577,66,72),(277578,66,73),(277579,66,74),(277580,66,75),(277581,66,76),(277582,66,101),(277583,66,102),(277524,66,103),(277584,66,111),(277589,67,1),(277602,67,2),(277601,67,3),(277586,67,5),(277608,67,6),(277604,67,11),(277599,67,13),(277588,67,18),(277590,67,21),(277591,67,33),(277592,67,35),(277607,67,36),(277587,67,37),(277610,67,44),(277609,67,47),(277603,67,49),(277593,67,53),(277606,67,54),(277605,67,58),(277585,67,67),(277600,67,70),(277598,67,72),(277596,67,74),(277597,67,75),(277594,67,76),(277595,67,111),(277619,69,1),(277625,69,2),(277624,69,3),(277627,69,6),(277626,69,11),(277612,69,35),(277620,69,36),(277622,69,44),(277613,69,47),(277614,69,49),(277621,69,54),(277615,69,58),(277611,69,69),(277623,69,70),(277618,69,75),(277617,69,76),(277616,69,111),(277630,70,6),(277629,70,11),(277628,70,70),(277632,71,1),(277635,71,2),(277634,71,3),(277639,71,6),(277638,71,11),(277633,71,58),(277636,71,70),(277631,71,71),(277637,71,76),(277646,72,1),(277653,72,2),(277652,72,3),(277655,72,6),(277654,72,11),(277641,72,18),(277644,72,36),(277650,72,44),(277649,72,47),(277642,72,49),(277647,72,54),(277648,72,58),(277651,72,70),(277640,72,72),(277645,72,76),(277643,72,111),(277662,73,1),(277673,73,2),(277672,73,3),(277657,73,5),(277679,73,6),(277675,73,11),(277670,73,13),(277661,73,18),(277658,73,19),(277660,73,21),(277663,73,33),(277664,73,35),(277678,73,36),(277681,73,44),(277680,73,47),(277674,73,49),(277665,73,53),(277677,73,54),(277676,73,58),(277659,73,64),(277671,73,70),(277669,73,72),(277656,73,73),(277668,73,75),(277666,73,76),(277667,73,111),(277682,74,74),(277683,75,75),(277684,76,76),(277686,100,1),(277687,100,2),(277688,100,3),(277689,100,5),(277690,100,6),(277691,100,9),(277692,100,11),(277693,100,13),(277694,100,15),(277695,100,16),(277696,100,17),(277697,100,18),(277698,100,19),(277699,100,20),(277700,100,21),(277701,100,22),(277702,100,30),(277703,100,31),(277704,100,32),(277705,100,33),(277706,100,34),(277707,100,35),(277708,100,36),(277709,100,37),(277710,100,38),(277711,100,39),(277712,100,40),(277713,100,41),(277714,100,42),(277715,100,43),(277716,100,44),(277717,100,45),(277718,100,47),(277719,100,48),(277720,100,49),(277721,100,50),(277722,100,51),(277723,100,52),(277724,100,53),(277725,100,54),(277726,100,55),(277727,100,56),(277728,100,57),(277729,100,58),(277730,100,59),(277731,100,60),(277732,100,61),(277733,100,62),(277734,100,64),(277735,100,65),(277736,100,66),(277737,100,67),(277738,100,69),(277739,100,70),(277740,100,71),(277741,100,72),(277742,100,73),(277743,100,74),(277744,100,75),(277745,100,76),(277685,100,100),(277746,100,101),(277747,100,102),(277748,100,103),(277749,100,104),(277750,100,105),(277751,100,106),(277752,100,107),(277753,100,108),(277754,100,109),(277755,100,110),(277756,100,111),(277757,100,112),(277758,100,114),(277759,100,115),(277760,100,119),(277762,100,120),(277761,100,121),(277769,101,1),(277773,101,2),(277772,101,3),(277775,101,6),(277774,101,11),(277764,101,13),(277765,101,18),(277766,101,35),(277771,101,70),(277767,101,75),(277768,101,76),(277763,101,101),(277770,101,111),(277777,102,1),(277782,102,2),(277781,102,3),(277787,102,6),(277786,102,11),(277778,102,13),(277779,102,35),(277780,102,70),(277784,102,75),(277783,102,76),(277776,102,102),(277785,102,111),(277789,103,1),(277790,103,2),(277791,103,3),(277792,103,5),(277793,103,6),(277848,103,9),(277794,103,11),(277795,103,13),(277796,103,15),(277797,103,16),(277798,103,17),(277799,103,18),(277800,103,19),(277801,103,20),(277802,103,21),(277803,103,22),(277804,103,30),(277805,103,31),(277806,103,32),(277807,103,33),(277808,103,34),(277809,103,35),(277810,103,36),(277811,103,37),(277812,103,38),(277813,103,39),(277814,103,40),(277815,103,41),(277816,103,42),(277817,103,43),(277818,103,44),(277819,103,45),(277820,103,47),(277821,103,48),(277822,103,49),(277823,103,50),(277824,103,51),(277825,103,52),(277826,103,53),(277827,103,54),(277828,103,55),(277829,103,56),(277830,103,57),(277831,103,58),(277832,103,59),(277833,103,60),(277834,103,61),(277835,103,64),(277836,103,65),(277837,103,67),(277838,103,69),(277839,103,70),(277840,103,71),(277841,103,72),(277842,103,73),(277843,103,74),(277844,103,75),(277845,103,76),(277846,103,101),(277847,103,102),(277788,103,103),(277849,103,111),(277857,104,1),(277856,104,2),(277859,104,3),(277860,104,5),(277861,104,6),(277858,104,9),(277862,104,11),(277863,104,13),(277864,104,15),(277865,104,16),(277866,104,17),(277867,104,18),(277868,104,19),(277869,104,20),(277870,104,21),(277871,104,22),(277872,104,30),(277873,104,31),(277874,104,32),(277875,104,33),(277876,104,34),(277877,104,35),(277878,104,36),(277879,104,37),(277880,104,38),(277881,104,39),(277882,104,40),(277883,104,41),(277884,104,42),(277885,104,43),(277886,104,44),(277887,104,45),(277888,104,47),(277889,104,48),(277890,104,49),(277891,104,50),(277892,104,51),(277893,104,52),(277894,104,53),(277895,104,54),(277896,104,55),(277897,104,56),(277898,104,57),(277899,104,58),(277900,104,59),(277901,104,60),(277902,104,61),(277922,104,62),(277903,104,64),(277904,104,65),(277854,104,66),(277905,104,67),(277906,104,69),(277907,104,70),(277908,104,71),(277909,104,72),(277910,104,73),(277911,104,74),(277912,104,75),(277913,104,76),(277851,104,100),(277914,104,101),(277915,104,102),(277853,104,103),(277850,104,104),(277919,104,105),(277918,104,106),(277925,104,107),(277927,104,108),(277926,104,109),(277923,104,110),(277916,104,111),(277920,104,112),(277921,104,114),(277852,104,115),(277924,104,119),(277855,104,120),(277917,104,121),(277928,105,105),(277931,106,6),(277930,106,11),(277929,106,106),(277943,107,1),(277956,107,2),(277955,107,3),(277934,107,5),(277958,107,6),(277957,107,11),(277949,107,13),(277942,107,18),(277941,107,21),(277940,107,33),(277935,107,35),(277946,107,36),(277952,107,44),(277951,107,47),(277936,107,49),(277939,107,53),(277947,107,54),(277950,107,56),(277937,107,57),(277948,107,58),(277933,107,60),(277954,107,70),(277953,107,72),(277945,107,75),(277938,107,76),(277932,107,107),(277944,107,111),(277960,108,1),(277961,108,2),(277962,108,3),(277966,108,6),(277965,108,11),(277963,108,70),(277964,108,76),(277959,108,108),(277971,109,1),(277973,109,2),(277972,109,3),(277976,109,6),(277975,109,11),(277968,109,13),(277969,109,18),(277974,109,70),(277970,109,76),(277967,109,109),(277978,110,1),(277981,110,2),(277980,110,3),(277984,110,6),(277983,110,11),(277982,110,70),(277979,110,76),(277977,110,110),(277985,111,111),(277987,112,1),(277990,112,2),(277989,112,3),(278000,112,6),(277998,112,11),(277993,112,36),(277997,112,44),(277996,112,47),(277988,112,49),(277994,112,54),(277995,112,58),(277991,112,70),(277992,112,76),(277999,112,111),(277986,112,112),(278005,114,1),(278007,114,2),(278006,114,3),(278017,114,6),(278015,114,11),(278002,114,13),(278010,114,36),(278014,114,44),(278013,114,47),(278004,114,49),(278011,114,54),(278012,114,58),(278008,114,70),(278009,114,76),(278016,114,111),(278003,114,112),(278001,114,114),(278023,115,1),(278022,115,2),(278025,115,3),(278026,115,5),(278027,115,6),(278024,115,9),(278028,115,11),(278029,115,13),(278030,115,15),(278031,115,16),(278032,115,17),(278033,115,18),(278034,115,19),(278035,115,20),(278036,115,21),(278037,115,22),(278038,115,30),(278039,115,31),(278040,115,32),(278041,115,33),(278042,115,34),(278043,115,35),(278044,115,36),(278045,115,37),(278046,115,38),(278047,115,39),(278048,115,40),(278049,115,41),(278050,115,42),(278051,115,43),(278052,115,44),(278053,115,45),(278054,115,47),(278055,115,48),(278056,115,49),(278057,115,50),(278058,115,51),(278059,115,52),(278060,115,53),(278061,115,54),(278062,115,55),(278063,115,56),(278064,115,57),(278065,115,58),(278066,115,59),(278067,115,60),(278068,115,61),(278069,115,64),(278070,115,65),(278019,115,66),(278071,115,67),(278072,115,69),(278073,115,70),(278074,115,71),(278075,115,72),(278076,115,73),(278077,115,74),(278078,115,75),(278079,115,76),(278080,115,101),(278081,115,102),(278020,115,103),(278082,115,111),(278018,115,115),(278021,115,120),(278085,119,1),(278088,119,2),(278087,119,3),(278091,119,6),(278090,119,11),(278089,119,70),(278086,119,76),(278084,119,110),(278083,119,119),(278119,120,1),(278123,120,2),(278122,120,3),(278121,120,5),(278124,120,6),(278116,120,9),(278125,120,11),(278117,120,13),(278126,120,15),(278127,120,16),(278128,120,17),(278129,120,18),(278130,120,19),(278131,120,20),(278132,120,21),(278133,120,22),(278134,120,30),(278135,120,31),(278136,120,32),(278137,120,33),(278138,120,34),(278139,120,35),(278140,120,36),(278141,120,37),(278142,120,38),(278143,120,39),(278144,120,40),(278145,120,41),(278146,120,42),(278147,120,43),(278148,120,44),(278149,120,45),(278150,120,47),(278151,120,48),(278152,120,49),(278153,120,50),(278154,120,51),(278155,120,52),(278156,120,53),(278157,120,54),(278158,120,55),(278159,120,56),(278160,120,57),(278161,120,58),(278162,120,59),(278163,120,60),(278164,120,61),(278165,120,64),(278166,120,65),(278118,120,66),(278167,120,67),(278168,120,69),(278169,120,70),(278170,120,71),(278171,120,72),(278172,120,73),(278173,120,74),(278174,120,75),(278175,120,76),(278176,120,101),(278177,120,102),(278120,120,103),(278178,120,111),(278115,120,120),(278101,121,1),(278106,121,2),(278105,121,3),(278112,121,6),(278108,121,11),(278096,121,13),(278095,121,18),(278093,121,21),(278097,121,33),(278094,121,35),(278111,121,36),(278114,121,44),(278113,121,47),(278107,121,49),(278098,121,53),(278110,121,54),(278109,121,58),(278104,121,70),(278099,121,72),(278102,121,75),(278100,121,76),(278103,121,111),(278092,121,121);
/*!40000 ALTER TABLE `roleRole` ENABLE KEYS */;
UNLOCK TABLES;
@@ -140,11 +140,11 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:02
USE `salix`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: salix
+-- Host: db1.static.verdnatura.es Database: salix
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -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'),(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');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
@@ -206,11 +206,11 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:03
USE `vn`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: vn
+-- Host: db1.static.verdnatura.es Database: vn
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -250,7 +250,7 @@ UNLOCK TABLES;
LOCK TABLES `bookingPlanner` WRITE;
/*!40000 ALTER TABLE `bookingPlanner` DISABLE KEYS */;
-INSERT INTO `bookingPlanner` VALUES (5,'2017-06-30 22:00:00','4770000002','WORLD',7,4,1),(6,'2017-06-30 22:00:00','4770000010','NATIONAL',3,1,1),(8,'2017-06-30 22:00:00','4770000021','NATIONAL',1,2,1),(9,'2017-06-30 22:00:00','4770000101','EQU',3,1,1),(11,'2017-06-30 22:00:00','4770000110','EQU',4,1,1),(12,'2017-06-30 22:00:00','4770000215','EQU',1,2,1),(13,'2017-06-30 22:00:00','4770000521','EQU',2,2,1),(15,'2017-06-30 22:00:00','4771000000','CEE',3,1,1),(16,'2017-06-30 22:00:00','4771000001','CEE',8,3,1),(19,'2017-07-05 11:54:58','4770000020','NATIONAL',7,4,1),(20,'2017-07-05 12:09:24','4771000000','CEE',1,2,1),(21,'2017-07-05 12:09:24','4771000000','CEE',7,4,1),(22,'2017-07-05 12:12:14','4770000002','WORLD',3,1,1),(23,'2017-07-05 12:12:14','4770000002','WORLD',1,2,1),(24,'2017-07-06 08:07:21','4770000002','WORLD',7,4,5),(25,'2017-07-06 08:07:21','HolandaRED','NATIONAL',3,1,5),(27,'2017-07-06 08:07:21','HolandaGEN','NATIONAL',1,2,5),(32,'2017-07-06 08:07:21','4771000000','CEE',3,1,5),(33,'2017-07-06 08:07:21','4771000001','CEE',8,3,5),(34,'2017-07-06 08:07:21','4770000020','NATIONAL',7,4,5),(35,'2017-07-06 08:07:21','4771000000','CEE',1,2,5),(36,'2017-07-06 08:07:21','4771000000','CEE',7,4,5),(37,'2017-07-06 08:07:21','4770000002','WORLD',3,1,5),(38,'2017-07-06 08:07:21','4770000002','WORLD',1,2,5),(70,'2017-07-06 08:08:48','4770000002','WORLD',7,4,30),(71,'2017-07-06 08:08:48','IGIC reduc','NATIONAL',3,1,30),(72,'2017-07-06 08:08:48','4770000020','NATIONAL',7,4,30),(73,'2017-07-06 08:08:48','IGIC gener','NATIONAL',1,2,30),(78,'2017-07-06 08:08:48','4770000020','NATIONAL',7,4,30),(79,'2017-07-06 08:08:48','4770000002','WORLD',3,1,30),(80,'2017-07-06 08:08:48','4770000002','WORLD',1,2,30),(81,'2017-07-05 22:00:00','IGIC cero','NATIONAL',5,5,30),(82,'2019-01-01 11:51:56','4770000504','EQU',5,5,1),(83,'2019-09-11 10:54:03','4770000405','EQU',6,5,1),(84,'2019-09-11 10:58:17','4770000004','NATIONAL',5,5,1),(85,'2019-09-18 22:00:00','4771000000','CEE',5,5,1),(86,'2021-10-13 22:00:00','4770000002','WORLD',5,5,1);
+INSERT INTO `bookingPlanner` VALUES (5,'2017-06-30 22:00:00','4770000002','WORLD',7,4,1),(6,'2017-06-30 22:00:00','4770000010','NATIONAL',3,1,1),(8,'2017-06-30 22:00:00','4770000021','NATIONAL',1,2,1),(9,'2017-06-30 22:00:00','4770000101','EQU',3,1,1),(11,'2017-06-30 22:00:00','4770000110','EQU',4,1,1),(12,'2017-06-30 22:00:00','4770000215','EQU',1,2,1),(13,'2017-06-30 22:00:00','4770000521','EQU',2,2,1),(15,'2017-06-30 22:00:00','4771000000','CEE',3,1,1),(16,'2017-06-30 22:00:00','4771000001','CEE',8,3,1),(19,'2017-07-05 11:54:58','4770000020','NATIONAL',7,4,1),(20,'2017-07-05 12:09:24','4771000000','CEE',1,2,1),(21,'2017-07-05 12:09:24','4771000000','CEE',7,4,1),(22,'2017-07-05 12:12:14','4770000002','WORLD',3,1,1),(23,'2017-07-05 12:12:14','4770000002','WORLD',1,2,1),(24,'2017-07-06 08:07:21','4770000002','WORLD',7,4,5),(25,'2017-07-06 08:07:21','HolandaRED','NATIONAL',3,1,5),(27,'2017-07-06 08:07:21','HolandaGEN','NATIONAL',1,2,5),(32,'2017-07-06 08:07:21','4771000000','CEE',3,1,5),(33,'2017-07-06 08:07:21','4771000001','CEE',8,3,5),(34,'2017-07-06 08:07:21','4770000020','NATIONAL',7,4,5),(35,'2017-07-06 08:07:21','4771000000','CEE',1,2,5),(36,'2017-07-06 08:07:21','4771000000','CEE',7,4,5),(37,'2017-07-06 08:07:21','4770000002','WORLD',3,1,5),(38,'2017-07-06 08:07:21','4770000002','WORLD',1,2,5),(82,'2019-01-01 11:51:56','4770000504','EQU',5,5,1),(83,'2019-09-11 10:54:03','4770000405','EQU',6,5,1),(84,'2019-09-11 10:58:17','4770000004','NATIONAL',5,5,1),(85,'2019-09-18 22:00:00','4771000000','CEE',5,5,1),(86,'2021-10-13 22:00:00','4770000002','WORLD',5,5,1);
/*!40000 ALTER TABLE `bookingPlanner` ENABLE KEYS */;
UNLOCK TABLES;
@@ -260,7 +260,7 @@ UNLOCK TABLES;
LOCK TABLES `businessType` WRITE;
/*!40000 ALTER TABLE `businessType` DISABLE KEYS */;
-INSERT INTO `businessType` VALUES ('decoration','Decoración'),('events','Eventos'),('florist','Floristería'),('gardenCentre','Vivero'),('gardening','Jardinería'),('individual','Particular'),('mortuary','Funeraria'),('officialOrganism','Organismo oficial'),('others','Otros'),('otherSector','Profesional de otro sector'),('restoration','Restauración'),('trainingCentre','Centro de formación'),('wholesaler','Mayorista');
+INSERT INTO `businessType` VALUES ('decoration','Decoración'),('events','Eventos'),('florist','Floristería'),('gardenCentre','Vivero'),('gardening','Jardinería'),('individual','Particular'),('mortuary','Funeraria'),('officialOrganism','Organismo oficial'),('others','Otros'),('otherSector','Profesional de otro sector'),('restoration','Restauración'),('trainingCentre','Centro de formación'),('wholesaler','Mayorista'),('worker','Trabajador');
/*!40000 ALTER TABLE `businessType` ENABLE KEYS */;
UNLOCK TABLES;
@@ -340,7 +340,7 @@ UNLOCK TABLES;
LOCK TABLES `claimReason` WRITE;
/*!40000 ALTER TABLE `claimReason` DISABLE KEYS */;
-INSERT INTO `claimReason` VALUES (1,'Prisas',0),(2,'Novato',0),(3,'Exceso de confianza',0),(4,'Exceso de celo',0),(5,'Indiferencia',0),(6,'Extraviado o Hurto',0),(7,'Incompetencia',0),(8,'Ubicación erronea',0),(9,'Dat.Inctos/Pak.conf',0),(10,'Datos duplicados',0),(11,'Fallo stock',0),(12,'Innovación',0),(13,'Distracción',1),(15,'Portes indebidos',0),(16,'Baja calidad',0),(17,'Defectuoso',0),(19,'Endiñado',0),(20,'Calor',0),(21,'Frio',0),(22,'Cambiado',0),(24,'Cansancio',1),(25,'Mal etiquetado',1),(26,'Cantidad malentendido',0),(30,'No revisado',1),(34,'Error fotografia',0),(40,'Fallo Personal VN',0),(41,'Fallo Personal Cliente',0),(42,'Otros',0),(43,'Precio alto',0),(44,'Abuso de confianza',0),(45,'Retraso Agencia',0),(46,'Delicado',0),(47,'Seco',0),(48,'Retraso Reparto',0),(49,'Mal Embalado',0),(50,'Tumbado',0),(51,'Enfermo/Plaga',0),(52,'Mala gestión comercial',0),(53,'Mala gestión comprador',0),(54,'A2',0);
+INSERT INTO `claimReason` VALUES (1,'Prisas',0),(2,'Novato',0),(3,'Exceso de confianza',0),(4,'Exceso de celo',0),(5,'Indiferencia',0),(6,'Extraviado o Hurto',0),(7,'Incompetencia',0),(8,'Ubicación erronea',0),(9,'Dat.Inctos/Pak.conf',0),(10,'Datos duplicados',0),(11,'Fallo stock',0),(12,'Innovación',0),(13,'Distracción',1),(15,'Portes indebidos',0),(16,'Baja calidad',0),(17,'Defectuoso',0),(19,'Endiñado',0),(20,'Calor',0),(21,'Frio',0),(22,'Cambiado',0),(24,'Cansancio',1),(25,'Mal etiquetado',1),(26,'Cantidad malentendido',0),(30,'No revisado',1),(34,'Error fotografia',0),(40,'Fallo Personal VN',0),(41,'Fallo Personal Cliente',0),(42,'Otros',0),(43,'Precio alto',0),(44,'Abuso de confianza',0),(45,'Retraso Agencia',0),(46,'Delicado',0),(47,'Seco',0),(48,'Retraso Reparto',0),(49,'Mal Embalado',0),(50,'Tumbado',0),(51,'Enfermo/Plaga',0),(52,'Mala gestión comercial',0),(53,'Mala gestión comprador',0),(54,'A2',0),(55,'Entrega 48h o más',0);
/*!40000 ALTER TABLE `claimReason` ENABLE KEYS */;
UNLOCK TABLES;
@@ -400,7 +400,7 @@ UNLOCK TABLES;
LOCK TABLES `department` WRITE;
/*!40000 ALTER TABLE `department` DISABLE KEYS */;
-INSERT INTO `department` VALUES (1,NULL,'VERDNATURA',1,100,763,0,0,0,0,29,NULL,'/',NULL,0,NULL,0,0,0,0,NULL),(22,NULL,'COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL),(31,'IT','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL),(34,NULL,'CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(35,NULL,'FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL),(36,NULL,'LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(37,'PROD','PRODUCCION',12,27,NULL,72,1,1,1,7,1,'/1/',NULL,0,NULL,0,1,1,1,NULL),(38,NULL,'SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(39,NULL,'ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(41,NULL,'ADMINISTRACION',28,29,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(43,'VT','VENTAS',30,53,NULL,0,0,0,1,11,1,'/1/',NULL,1,'',1,0,0,0,NULL),(44,'management','GERENCIA',54,55,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(45,NULL,'LOGISTICA',56,57,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(46,NULL,'REPARTO',58,59,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL),(48,NULL,'ALMACENAJE',60,61,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(49,NULL,'PROPIEDAD',62,63,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(52,NULL,'CARGA AEREA',64,65,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(53,NULL,'MARKETING Y COMUNICACIÓN',66,67,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(54,NULL,'ORNAMENTALES',68,69,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(55,NULL,'TALLER NATURAL',70,73,14548,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,1,1,0,1118),(56,NULL,'TALLER ARTIFICIAL',71,72,8470,72,0,0,2,0,55,'/1/55/',NULL,0,NULL,0,1,1,0,1927),(58,'CMP','CAMPOS',74,77,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(59,NULL,'MANTENIMIENTO',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL),(60,NULL,'RECLAMACIONES',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,1,0,0,NULL),(61,NULL,'VNH',82,83,NULL,73,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(66,NULL,'VERDNAMADRID',84,85,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(68,NULL,'COMPLEMENTOS',19,20,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL),(69,NULL,'VERDNABARNA',86,87,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(80,NULL,'EQUIPO J VALLES',31,32,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(86,NULL,'LIMPIEZA',88,89,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(89,NULL,'COORDINACION',90,91,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(90,NULL,'TRAILER',92,93,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(91,NULL,'ARTIFICIAL',21,22,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(92,NULL,'EQUIPO SILVERIO',33,34,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(93,NULL,'CONFECCION',94,95,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,1,0,NULL),(94,NULL,'EQUIPO J BROCAL',35,36,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(95,NULL,'EQUIPO C ZAMBRANO',37,38,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(96,NULL,'EQUIPO C LOPEZ',39,40,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(115,NULL,'EQUIPO CLAUDI',41,42,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(123,NULL,'EQUIPO ELENA BASCUÑANA',43,44,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(124,NULL,'CONTROL INTERNO',96,97,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL),(125,NULL,'EQUIPO MIRIAM MAR',45,46,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(126,NULL,'PRESERVADO',98,99,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,1,0,NULL),(128,NULL,'PALETIZADO',23,24,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(130,NULL,'REVISION',25,26,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(131,NULL,'INVERNADERO',75,76,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL),(132,NULL,'EQUIPO DC',47,48,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(133,'franceTeam','EQUIPO FRANCIA',49,50,1731,72,0,0,2,0,43,'/1/43/','fra_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(134,NULL,'EQUIPO RODRI',51,52,6264,0,0,0,2,0,43,'/1/43/','rhr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL);
+INSERT INTO `department` VALUES (1,NULL,'VERDNATURA',1,104,763,0,0,0,0,30,NULL,'/',NULL,0,NULL,0,0,0,0,NULL),(22,'shopping','COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL),(31,'it','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL),(34,NULL,'CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(35,NULL,'FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL),(36,NULL,'LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(37,'PROD','PRODUCCION',12,27,NULL,72,1,1,1,7,1,'/1/',NULL,0,NULL,0,1,1,1,NULL),(38,NULL,'SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(39,NULL,'ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(41,NULL,'ADMINISTRACION',28,29,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(43,'VT','VENTAS',30,53,NULL,0,0,0,1,11,1,'/1/',NULL,1,'',1,0,0,0,NULL),(44,'management','GERENCIA',54,55,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(45,NULL,'LOGISTICA',56,57,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(46,'delivery','REPARTO',58,59,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL),(48,NULL,'ALMACENAJE',60,61,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(49,NULL,'PROPIEDAD',62,63,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(52,NULL,'CARGA AEREA',64,65,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(53,NULL,'MARKETING Y COMUNICACIÓN',66,67,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(54,NULL,'ORNAMENTALES',68,69,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(55,NULL,'TALLER NATURAL',70,73,14548,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,1,1,0,1118),(56,NULL,'TALLER ARTIFICIAL',71,72,8470,72,0,0,2,0,55,'/1/55/',NULL,0,NULL,0,1,1,0,1927),(58,'CMP','CAMPOS',74,77,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(59,NULL,'MANTENIMIENTO',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL),(60,NULL,'RECLAMACIONES',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,1,0,0,NULL),(61,NULL,'VNH',82,85,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(66,NULL,'VERDNAMADRID',86,87,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(68,NULL,'COMPLEMENTOS',19,20,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL),(69,NULL,'VERDNABARNA',88,89,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(80,NULL,'EQUIPO J VALLES',31,32,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(86,NULL,'LIMPIEZA',90,91,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(89,NULL,'COORDINACION',92,93,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(90,NULL,'TRAILER',83,84,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL),(91,NULL,'ARTIFICIAL',21,22,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(92,NULL,'EQUIPO SILVERIO',33,34,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(93,NULL,'CONFECCION',94,95,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,1,0,NULL),(94,NULL,'EQUIPO J BROCAL',35,36,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(95,NULL,'EQUIPO C ZAMBRANO',37,38,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(96,NULL,'EQUIPO C LOPEZ',39,40,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(115,NULL,'EQUIPO CLAUDI',41,42,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(123,NULL,'EQUIPO ELENA BASCUÑANA',43,44,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(124,NULL,'CONTROL INTERNO',96,97,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL),(125,NULL,'EQUIPO MIRIAM MAR',45,46,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(126,NULL,'PRESERVADO',98,99,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,1,0,NULL),(128,NULL,'PALETIZADO',23,24,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(130,NULL,'REVISION',25,26,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(131,NULL,'INVERNADERO',75,76,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL),(132,NULL,'EQUIPO DC',47,48,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(133,'franceTeam','EQUIPO FRANCIA',49,50,1731,72,0,0,2,0,43,'/1/43/','fra_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(134,NULL,'EQUIPO RODRI',51,52,6264,0,0,0,2,0,43,'/1/43/','rhr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(135,'routers','ENRUTADORES',100,101,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(136,'heavyVehicles','VEHICULOS PESADOS',102,103,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL);
/*!40000 ALTER TABLE `department` ENABLE KEYS */;
UNLOCK TABLES;
@@ -512,11 +512,11 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:09
USE `cache`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: cache
+-- Host: db1.static.verdnatura.es Database: cache
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -548,11 +548,11 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:10
USE `hedera`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: hedera
+-- Host: db1.static.verdnatura.es Database: hedera
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -642,7 +642,7 @@ UNLOCK TABLES;
LOCK TABLES `message` WRITE;
/*!40000 ALTER TABLE `message` DISABLE KEYS */;
-INSERT INTO `message` VALUES (1,'ORDER_DATE_HOLIDAY','No es posible realizar pedidos para días festivos'),(2,'ORDER_EMPTY','El pedido esta vacío'),(3,'ORDER_UNAVAILABLE','Algunos artículos ya no están disponibles, verifica las cantidades resaltadas en rojo'),(4,'SURVEY_MAX_ONE_VOTE','Solo es posible realizar un voto por encuesta'),(5,'ORDER_MAX_EXCEEDED','Has excedido el número máximo de pedidos por confirmar, por favor elimina o confirma los pedidos iniciados'),(6,'LOGIN_INCORRECT','Usuario o contraseña incorrectos. Recuerda que se hace distinción entre mayúsculas y minúsculas.'),(7,'ORDER_DATE_PAST','La fecha de su pedido debe ser mayor o igual al día de hoy'),(8,'ORDER_DATE_LAST','No es posible realizar más para hoy, por favor atrasa la fecha de tu pedido a mañana o días posteriores'),(9,'ORDER_DATE_SUNDAY','No es posible confirmar pedidos para Domingo'),(10,'ORDER_DATE_SATURATED','Estamos saturados de pedidos, por favor selecciona otra fecha de envío o recogida '),(11,'USER_DISCONNECTED','Has sido desconectado del servidor, por favor vuelve a iniciar sesión'),(12,'UNAUTH_ACTION','Acción no permitida'),(13,'ORDER_INVALID_AGENCY','La agencia de envío no es válida'),(14,'ORDER_EMPTY_ADDRESS','Selecciona una dirección de envío'),(15,'ORDER_AMOUNT_ROUNDED','Este artículo se vende agrupado y la cantidad ha sido redondeada'),(17,'orderOutdated','La configuración del pedido es incorrecta, por favor vuelve a configurarlo para continuar comprando'),(18,'orderNotOwnedByUser','El pedido pertenece a otro usuario'),(19,'orderConfirmed','El pedido ya ha sido confirmado y no puede modificarse');
+INSERT INTO `message` VALUES (1,'ORDER_DATE_HOLIDAY','No es posible realizar pedidos para días festivos'),(2,'ORDER_EMPTY','El pedido esta vacío'),(3,'ORDER_UNAVAILABLE','Algunos artículos ya no están disponibles, verifica las cantidades resaltadas en rojo'),(4,'SURVEY_MAX_ONE_VOTE','Solo es posible realizar un voto por encuesta'),(5,'ORDER_MAX_EXCEEDED','Has excedido el número máximo de pedidos por confirmar, por favor elimina o confirma los pedidos iniciados'),(6,'LOGIN_INCORRECT','Usuario o contraseña incorrectos. Recuerda que se hace distinción entre mayúsculas y minúsculas.'),(7,'ORDER_DATE_PAST','La fecha de su pedido debe ser mayor o igual al día de hoy'),(8,'ORDER_DATE_LAST','No es posible realizar más para hoy, por favor atrasa la fecha de tu pedido a mañana o días posteriores'),(9,'ORDER_DATE_SUNDAY','No es posible confirmar pedidos para Domingo'),(10,'ORDER_DATE_SATURATED','Estamos saturados de pedidos, por favor selecciona otra fecha de envío o recogida '),(11,'USER_DISCONNECTED','Has sido desconectado del servidor, por favor vuelve a iniciar sesión'),(12,'UNAUTH_ACTION','Acción no permitida'),(13,'ORDER_INVALID_AGENCY','La agencia de envío no es válida'),(14,'ORDER_EMPTY_ADDRESS','Selecciona una dirección de envío'),(15,'ORDER_AMOUNT_ROUNDED','Este artículo se vende agrupado y la cantidad ha sido redondeada'),(17,'orderOutdated','La configuración del pedido es incorrecta, por favor vuelve a configurarlo para continuar comprando'),(18,'orderNotOwnedByUser','El pedido pertenece a otro usuario'),(19,'orderConfirmed','El pedido ya ha sido confirmado y no puede modificarse'),(20,'clientNotVerified','Datos fiscales incompletos, por favor contacte con su comercial');
/*!40000 ALTER TABLE `message` ENABLE KEYS */;
UNLOCK TABLES;
@@ -714,11 +714,11 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:14
USE `postgresql`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: postgresql
+-- Host: db1.static.verdnatura.es Database: postgresql
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -760,11 +760,11 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:15
USE `sage`;
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: sage
+-- Host: db1.static.verdnatura.es Database: sage
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -782,41 +782,9 @@ USE `sage`;
-- Dumping data for table `TiposIva`
--
-LOCK TABLES `taxType` WRITE;
-/*!40000 ALTER TABLE `taxType` DISABLE KEYS */;
-INSERT INTO `sage`.`taxType` (id, code, isIntracommunity) VALUES
- (2, NULL, 0),
- (4, 'national4', 0),
- (5, NULL, 0),
- (6, NULL, 1),
- (7, NULL, 1),
- (8, NULL, 1),
- (10, 'national10', 0),
- (11, NULL, 0),
- (16, 'CEEServices21', 1),
- (18, NULL, 0),
- (20, 'national0', 0),
- (21, 'national21', 0),
- (22, 'import10', 0),
- (26, NULL, 0),
- (90, 'import21', 0),
- (91, NULL, 0),
- (92, NULL, 0),
- (93, NULL, 0),
- (94, NULL, 0),
- (100, NULL, 0),
- (108, NULL, 0),
- (109, NULL, 0),
- (110, NULL, 1),
- (111, NULL, 0),
- (112, NULL, 0),
- (113, 'ISP21', 0),
- (114, NULL, 0),
- (115, 'import4', 0);
-
LOCK TABLES `TiposIva` WRITE;
/*!40000 ALTER TABLE `TiposIva` DISABLE KEYS */;
-INSERT INTO `TiposIva` VALUES (2,0,'Operaciones no sujetas',0.0000000000,0.0000000000,0.0000000000,'','4770000020','','','','','','','95B21A93-5910-489D-83BB-C32788C9B19D','','','','','','','','','',0,0),(4,0,'I.V.A. 4%',0.0000000000,4.0000000000,0.0000000000,'4720000004','4770000004','','6310000000','','','','','9E6160D5-984E-4643-ACBC-1EBC3BF73360','','','','','','','','','',0,0),(5,0,'I.V.A. 4% y R.E. 0.5%',0.0000000000,4.0000000000,0.5000000000,'','4770000504','4770000405','','','','','','DBEFA562-63FB-4FFC-8171-64F0C6F065FF','','','','','','','','','',0,0),(6,0,'H.P. IVA 4% CEE',0.0000000000,4.0000000000,0.0000000000,'4721000004','4771000004','','','','','','','DD0ECBA8-2EF5-425E-911B-623580BADA77','','','','','','','','','',0,1),(7,0,'H.P. IVA 10% CEE',0.0000000000,10.0000000000,0.0000000000,'4721000011','4771000010','','','','','','','593208CD-6F28-4489-B6EC-907AD689EAC9','','','','','','','','','',0,1),(8,0,'H.P. IVA 21% CEE',0.0000000000,21.0000000000,0.0000000000,'4721000021','4771000021','','','','','','','27061852-9BC1-4C4F-9B6E-69970E208F23','','','','','','','','','',0,1),(10,0,'I.V.A. 10% Nacional',0.0000000000,10.0000000000,0.0000000000,'4720000011','4770000010','','6290000553','','','','','828A9D6F-5C01-4C3A-918A-B2E4482830D3','','','','','','','','','',0,0),(11,0,'I.V.A. 10% y R.E. 1,4%',0.0000000000,10.0000000000,1.4000000000,'','4770000101','4770000110','','','','','','C1F2D910-83A1-4191-A76C-8B3D7AB98348','','','','','','','','','',0,0),(16,0,'I.V.A. Adqui. servicios CEE',0.0000000000,21.0000000000,0.0000000000,'4721000015','4771000016','','','','','','','E3EDE961-CE8F-41D4-9E6C-D8BCD32275A1','','','','','','','','','',0,1),(18,0,'H.P. Iva Importación 0% ISP',0.0000000000,0.0000000000,0.0000000000,'4720000005','4770000005','','','','','','','27AD4158-2349-49C2-B53A-A4E0EFAC5D09','','','','','','','','','',0,0),(20,0,'I.V.A 0% Nacional',0.0000000000,0.0000000000,0.0000000000,'4720000000','','','','','','','','B90B0FBD-E513-4F04-9721-C873504E08DF','','','','','','','','','',0,0),(21,0,'I.V.A. 21%',0.0000000000,21.0000000000,0.0000000000,'4720000021','4770000021','4770000000','','','','','','BA8C4E28-DCFA-4F7B-AE4F-CA044626B55E','','','','','','','','','',0,0),(22,0,'IVA 10% importaciones',0.0000000000,10.0000000000,0.0000000000,'4722000010','','','','','','','','540450A8-4B41-4607-96D1-E7F296FB6933','','','','','','','','','',0,0),(26,0,'I.V.A. 21% y R.E. 5,2%',0.0000000000,21.0000000000,5.2000000000,'4720000021','4770000215','4770000521','631000000','','','','','2BC0765F-7739-49AE-A5F0-28B648B81677','','','','','','','','','',0,0),(90,0,'IVA 21% importaciones',0.0000000000,21.0000000000,0.0000000000,'4722000021','','','','','','','','EB675F91-5FF2-4E26-A31E-EEB674125945','','','','','','','','','',0,0),(91,0,'IVA 0% importaciones',0.0000000000,0.0000000000,0.0000000000,'4723000000','','','','','','','','5E5EFA56-2A99-4D54-A16B-5D818274CA18','','','','','','','','','',0,0),(92,0,'8.5% comp. ganadera o pesquera',0.0000000000,8.5000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0),(93,0,'12% com. agrícola o forestal',0.0000000000,12.0000000000,0.0000000000,'4720000012','','','','','','','','267B1DDB-247F-4A71-AB95-3349FEFC5F92','','','','','','','','','',0,0),(94,0,'10,5% com. ganadera o pesquera',0.0000000000,10.5000000000,0.0000000000,'4770000000','4720000000','631000000','477000000','','','','','','','','','','','','','','',0,0),(100,0,'HP IVA SOPORTADO 5%',0.0000000000,5.0000000000,0.0000000000,'4720000055','','','','','','','','3AD36CB2-4172-4CC9-9F87-2BF2B56AAC80','','','','','','','','','',0,0),(108,0,'I.V.A. 8%',0.0000000000,8.0000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0),(109,0,'I.V.A. 8% y R.E. 1%',0.0000000000,8.0000000000,1.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0),(110,0,'HP IVA Devengado Exento CEE',0.0000000000,0.0000000000,0.0000000000,'','4771000000','','','','','','','C605BC32-E161-42FD-83F3-3A66B1FBE399','','','','','','','','','',0,1),(111,0,'H.P. Iva Devengado Exento Ser',0.0000000000,0.0000000000,0.0000000000,'','4771000001','','','','','','','F1AEC4DC-AFE5-498E-A713-2648FFB6DA32','','','','','','','','','',0,0),(112,0,'H.P. IVA Devengado en exportac',0.0000000000,0.0000000000,0.0000000000,'','4770000002','','','','','','','F980AE74-BF75-4F4C-927F-0CCCE0DB8D15','','','','','','','','','',0,0),(113,0,'HP DEVENGADO 21 ISP ',0.0000000000,21.0000000000,0.0000000000,'4720000006','4770000006','','','','','','','728D7A76-E936-438C-AF05-3CA38FE16EA5','','','','','','','','','',0,0),(114,0,'HP.IVA NO DEDUCIBLE 10%',0.0000000000,0.0000000000,0.0000000000,'4720000026','','','','','','','','','','','','','','','','','',0,0),(115,0,'H.P. IVA Soportado Impor 4% ',0.0000000000,4.0000000000,0.0000000000,'4722000004','','','','','','','','','','','','','','','','','',0,0);
+INSERT INTO `TiposIva` VALUES (2,0,'Operaciones no sujetas',0.0000000000,0.0000000000,0.0000000000,'','4770000020','','','','','','','95B21A93-5910-489D-83BB-C32788C9B19D','','','','','','','','','',0),(4,0,'I.V.A. 4%',0.0000000000,4.0000000000,0.0000000000,'4720000004','4770000004','','6310000000','','','','','9E6160D5-984E-4643-ACBC-1EBC3BF73360','','','','','','','','','',0),(5,0,'I.V.A. 4% y R.E. 0.5%',0.0000000000,4.0000000000,0.5000000000,'','4770000504','4770000405','','','','','','DBEFA562-63FB-4FFC-8171-64F0C6F065FF','','','','','','','','','',0),(6,0,'H.P. IVA 4% CEE',0.0000000000,4.0000000000,0.0000000000,'4721000004','4771000004','','','','','','','DD0ECBA8-2EF5-425E-911B-623580BADA77','','','','','','','','','',0),(7,0,'H.P. IVA 10% CEE',0.0000000000,10.0000000000,0.0000000000,'4721000011','4771000010','','','','','','','593208CD-6F28-4489-B6EC-907AD689EAC9','','','','','','','','','',0),(8,0,'H.P. IVA 21% CEE',0.0000000000,21.0000000000,0.0000000000,'4721000021','4771000021','','','','','','','27061852-9BC1-4C4F-9B6E-69970E208F23','','','','','','','','','',0),(10,0,'I.V.A. 10% Nacional',0.0000000000,10.0000000000,0.0000000000,'4720000011','4770000010','','6290000553','','','','','828A9D6F-5C01-4C3A-918A-B2E4482830D3','','','','','','','','','',0),(11,0,'I.V.A. 10% y R.E. 1,4%',0.0000000000,10.0000000000,1.4000000000,'','4770000101','4770000110','','','','','','C1F2D910-83A1-4191-A76C-8B3D7AB98348','','','','','','','','','',0),(16,0,'I.V.A. Adqui. servicios CEE',0.0000000000,21.0000000000,0.0000000000,'4721000015','4771000016','','','','','','','E3EDE961-CE8F-41D4-9E6C-D8BCD32275A1','','','','','','','','','',0),(18,0,'H.P. Iva Importación 0% ISP',0.0000000000,0.0000000000,0.0000000000,'4720000005','4770000005','','','','','','','27AD4158-2349-49C2-B53A-A4E0EFAC5D09','','','','','','','','','',0),(20,0,'I.V.A 0% Nacional',0.0000000000,0.0000000000,0.0000000000,'4720000000','','','','','','','','B90B0FBD-E513-4F04-9721-C873504E08DF','','','','','','','','','',0),(21,0,'I.V.A. 21%',0.0000000000,21.0000000000,0.0000000000,'4720000021','4770000021','4770000000','','','','','','BA8C4E28-DCFA-4F7B-AE4F-CA044626B55E','','','','','','','','','',0),(22,0,'IVA 10% importaciones',0.0000000000,10.0000000000,0.0000000000,'4722000010','','','','','','','','540450A8-4B41-4607-96D1-E7F296FB6933','','','','','','','','','',0),(26,0,'I.V.A. 21% y R.E. 5,2%',0.0000000000,21.0000000000,5.2000000000,'4720000021','4770000215','4770000521','631000000','','','','','2BC0765F-7739-49AE-A5F0-28B648B81677','','','','','','','','','',0),(90,0,'IVA 21% importaciones',0.0000000000,21.0000000000,0.0000000000,'4722000021','','','','','','','','EB675F91-5FF2-4E26-A31E-EEB674125945','','','','','','','','','',0),(91,0,'IVA 0% importaciones',0.0000000000,0.0000000000,0.0000000000,'4723000000','','','','','','','','5E5EFA56-2A99-4D54-A16B-5D818274CA18','','','','','','','','','',0),(92,0,'8.5% comp. ganadera o pesquera',0.0000000000,8.5000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0),(93,0,'12% com. agrícola o forestal',0.0000000000,12.0000000000,0.0000000000,'4720000012','','','','','','','','267B1DDB-247F-4A71-AB95-3349FEFC5F92','','','','','','','','','',0),(94,0,'10,5% com. ganadera o pesquera',0.0000000000,10.5000000000,0.0000000000,'4770000000','4720000000','631000000','477000000','','','','','','','','','','','','','','',0),(100,0,'HP IVA SOPORTADO 5%',0.0000000000,5.0000000000,0.0000000000,'4720000055','','','','','','','','3AD36CB2-4172-4CC9-9F87-2BF2B56AAC80','','','','','','','','','',0),(108,0,'I.V.A. 8%',0.0000000000,8.0000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0),(109,0,'I.V.A. 8% y R.E. 1%',0.0000000000,8.0000000000,1.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0),(110,0,'HP IVA Devengado Exento CEE',0.0000000000,0.0000000000,0.0000000000,'','4771000000','','','','','','','C605BC32-E161-42FD-83F3-3A66B1FBE399','','','','','','','','','',0),(111,0,'H.P. Iva Devengado Exento Ser',0.0000000000,0.0000000000,0.0000000000,'','4771000001','','','','','','','F1AEC4DC-AFE5-498E-A713-2648FFB6DA32','','','','','','','','','',0),(112,0,'H.P. IVA Devengado en exportac',0.0000000000,0.0000000000,0.0000000000,'','4770000002','','','','','','','F980AE74-BF75-4F4C-927F-0CCCE0DB8D15','','','','','','','','','',0),(113,0,'HP DEVENGADO 21 ISP ',0.0000000000,21.0000000000,0.0000000000,'4720000006','4770000006','','','','','','','728D7A76-E936-438C-AF05-3CA38FE16EA5','','','','','','','','','',0),(114,0,'HP.IVA NO DEDUCIBLE 10%',0.0000000000,0.0000000000,0.0000000000,'4720000026','','','','','','','','','','','','','','','','','',0),(115,0,'H.P. IVA Soportado Impor 4% ',0.0000000000,4.0000000000,0.0000000000,'4722000004','','','','','','','','','','','','','','','','','',0);
/*!40000 ALTER TABLE `TiposIva` ENABLE KEYS */;
UNLOCK TABLES;
@@ -839,6 +807,16 @@ LOCK TABLES `TiposRetencion` WRITE;
INSERT INTO `TiposRetencion` VALUES (1,'RETENCION ESTIMACION OBJETIVA',1.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'03811652-0F3A-44A1-AE1C-B19624525D7F'),(2,'ACTIVIDADES AGRICOLAS O GANADERAS',2.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'F3F91EF3-FED6-444D-B03C-75B639D13FB4'),(9,'ACTIVIDADES PROFESIONALES 2 PRIMEROS AÑOS',9.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'73F95642-E951-4C91-970A-60C503A4792B'),(15,'ACTIVIDADES PROFESIONALES',15.0000000000,'4730000000','4751000000','6',NULL,NULL,'F6BDE0EE-3B01-4023-8FFF-A73AE9AC50D7'),(19,'ARRENDAMIENTO Y SUBARRENDAMIENTO',19.0000000000,'4730000000','4751000000','8',NULL,NULL,'09B033AE-16E5-4057-8D4A-A7710C8A4FB9');
/*!40000 ALTER TABLE `TiposRetencion` ENABLE KEYS */;
UNLOCK TABLES;
+
+--
+-- Dumping data for table `taxType`
+--
+
+LOCK TABLES `taxType` WRITE;
+/*!40000 ALTER TABLE `taxType` DISABLE KEYS */;
+INSERT INTO `taxType` VALUES (2,NULL,0),(4,'national4',0),(5,NULL,0),(6,NULL,1),(7,NULL,1),(8,NULL,1),(10,'national10',0),(11,NULL,0),(16,'CEEServices21',1),(18,NULL,0),(20,'national0',0),(21,'national21',0),(22,'import10',0),(26,NULL,0),(90,'import21',0),(91,NULL,0),(92,NULL,0),(93,NULL,0),(94,NULL,0),(100,NULL,0),(108,NULL,0),(109,NULL,0),(110,NULL,1),(111,NULL,0),(112,NULL,0),(113,'ISP21',0),(114,NULL,0),(115,'import4',0);
+/*!40000 ALTER TABLE `taxType` ENABLE KEYS */;
+UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -848,4 +826,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:24:00
+-- Dump completed on 2023-06-26 8:40:15
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 1e096b3c1..7649e3594 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -77,7 +77,10 @@ INSERT INTO `account`.`user`(`id`,`name`, `nickname`, `role`,`active`,`email`, `
ORDER BY id;
INSERT INTO `account`.`account`(`id`)
- SELECT id FROM `account`.`user`;
+ SELECT `u`.`id`
+ FROM `account`.`user` `u`
+ JOIN `account`.`role` `r` ON `u`.`role` = `r`.`id`
+ WHERE `r`.`name` <> 'customer';
INSERT INTO `vn`.`educationLevel` (`id`, `name`)
VALUES
@@ -144,17 +147,17 @@ INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
(3, 'GBP', 'Libra', 1),
(4, 'JPY', 'Yen Japones', 1);
-INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`, `politicalCountryFk`)
+INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`)
VALUES
- (1, 'España', 1, 'ES', 1, 24, 4, 0, 1, 1),
- (2, 'Italia', 1, 'IT', 1, 27, 4, 0, 1, 2),
- (3, 'Alemania', 1, 'DE', 1, 22, 4, 0, 1, 3),
- (4, 'Rumania', 1, 'RO', 1, 24, 4, 0, 1, 4),
- (5, 'Holanda', 1, 'NL', 1, 18, 4, 0, 1, 5),
- (8, 'Portugal', 1, 'PT', 1, 27, 4, 0, 1, 8),
- (13,'Ecuador', 0, 'EC', 1, 24, 2, 1, 2, 13),
- (19,'Francia', 1, 'FR', 1, 27, 4, 0, 1, 19),
- (30,'Canarias', 1, 'IC', 1, 24, 4, 1, 2, 30);
+ (1, 'España', 1, 'ES', 1, 24, 4, 0, 1),
+ (2, 'Italia', 1, 'IT', 1, 27, 4, 0, 1),
+ (3, 'Alemania', 1, 'DE', 1, 22, 4, 0, 1),
+ (4, 'Rumania', 1, 'RO', 1, 24, 4, 0, 1),
+ (5, 'Holanda', 1, 'NL', 1, 18, 4, 0, 1),
+ (8, 'Portugal', 1, 'PT', 1, 27, 4, 0, 1),
+ (13,'Ecuador', 0, 'EC', 1, 24, 2, 1, 2),
+ (19,'Francia', 1, 'FR', 1, 27, 4, 0, 1),
+ (30,'Canarias', 1, 'IC', 1, 24, 4, 1, 2);
INSERT INTO `vn`.`warehouseAlias`(`id`, `name`)
VALUES
@@ -382,9 +385,16 @@ INSERT INTO `vn`.`clientManaCache`(`clientFk`, `mana`, `dated`)
(1103, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
(1104, -30, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH));
-INSERT INTO `vn`.`clientConfig`(`riskTolerance`, `maxCreditRows`)
+INSERT INTO `vn`.`mandateType`(`id`, `name`)
VALUES
- (200, 10);
+ (1, 'B2B'),
+ (2, 'CORE'),
+ (3, 'LCR');
+
+INSERT INTO `vn`.`clientConfig`(`id`, `riskTolerance`, `maxCreditRows`, `maxPriceIncreasingRatio`, `riskScope`, `defaultPayMethodFk`, `defaultDueDay`, `defaultCredit`, `defaultIsTaxDataChecked`, `defaultHasCoreVnl`, `defaultMandateTypeFk`)
+ VALUES
+ (1, 200, 10, 0.25, 2, 4, 5, 300.00, 1, 1, 2);
+
INSERT INTO `vn`.`address`(`id`, `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `phone`, `mobile`, `isActive`, `clientFk`, `agencyModeFk`, `longitude`, `latitude`, `isEqualizated`, `isDefaultAddress`)
VALUES
@@ -550,10 +560,13 @@ INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `pr
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`, `healthRegister`)
VALUES
- (1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
- (2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
- (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
- (1381, 'Ornamentales', 'Ornamentales', 7185000440, 1, '03815934E', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
+ (1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
+ (2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
+ (69, 'Packaging', 'Packaging nick', 4100000069, 1, '94935005K', 0, util.VN_CURDATE(), 1, 'supplier address 5', 'ASGARD', 3, 46600, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
+ (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
+ (567, 'Holland', 'Holland nick', 4000020567, 1, '14364089Z', 0, util.VN_CURDATE(), 1, 'supplier address 6', 'ASGARD', 3, 46600, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
+ (791, 'Bros SL', 'Bros nick', 5115000791, 1, '37718083S', 0, util.VN_CURDATE(), 1, 'supplier address 7', 'ASGARD', 3, 46600, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
+ (1381, 'Ornamentales', 'Ornamentales', 7185001381, 1, '07972486L', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
VALUES
@@ -697,40 +710,40 @@ INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agen
(6, NULL, 57, util.VN_CURDATE(), 5, 7, 'sixth route', 1.7, 60, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 3),
(7, NULL, 57, util.VN_CURDATE(), 6, 8, 'seventh route', 0, 70, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 5);
-INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`)
+INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`)
VALUES
- (1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T2222222', 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
- (4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T3333333', 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)),
- (5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T4444444', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)),
- (6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, 'A1111111', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
- (7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE()),
- (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE()),
- (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR)),
- (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE()),
- (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
- (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
- (22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
- (23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE()),
- (24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE()),
- (25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
- (32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE());
+ (1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1),
+ (2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2),
+ (3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL),
+ (4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL),
+ (5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL),
+ (6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL),
+ (7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL),
+ (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
+ (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL),
+ (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL),
+ (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL),
+ (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL),
+ (22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL),
+ (23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL),
+ (24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL),
+ (25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
+ (32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL);
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
VALUES
@@ -821,12 +834,6 @@ INSERT INTO `vn`.`greuge`(`id`, `clientFk`, `description`, `amount`, `shipped`,
(11, 1101, 'some heritage charges', -15.99, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 5, 1),
(12, 1101, 'some miscellaneous charges', 58.00, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 6, 1);
-INSERT INTO `vn`.`mandateType`(`id`, `name`)
- VALUES
- (1, 'B2B'),
- (2, 'CORE'),
- (3, 'LCR');
-
INSERT INTO `vn`.`mandate`(`id`, `clientFk`, `companyFk`, `code`, `created`, `mandateTypeFk`)
VALUES
(1, 1102, 442, '1-1', util.VN_CURDATE(), 2);
@@ -2572,6 +2579,26 @@ INSERT INTO `vn`.`ticketRecalc`(`ticketFk`)
CALL `vn`.`ticket_doRecalc`();
+UPDATE `vn`.`ticket`
+ SET refFk = 'T1111111'
+ WHERE id IN (1,2);
+
+UPDATE `vn`.`ticket`
+ SET refFk = 'T2222222'
+ WHERE id = 3;
+
+UPDATE `vn`.`ticket`
+ SET refFk = 'T3333333'
+ WHERE id = 4;
+
+UPDATE `vn`.`ticket`
+ SET refFk = 'T4444444'
+ WHERE id = 5;
+
+UPDATE `vn`.`ticket`
+ SET refFk = 'A1111111'
+ WHERE id = 6;
+
INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`)
VALUES
(1, 1, 1),
@@ -2579,7 +2606,7 @@ INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`)
(3, 6, 5),
(4, 7, 1);
-INSERT INTO `vn`.`expeditionTruck` (`id`, `ETD`, `description`)
+INSERT INTO `vn`.`expeditionTruck` (`id`, `eta`, `description`)
VALUES
(1, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL +3 YEAR))), 'Best truck in fleet');
@@ -2825,8 +2852,8 @@ INSERT INTO `vn`.`profileType` (`id`, `name`)
INSERT INTO `salix`.`url` (`appName`, `environment`, `url`)
VALUES
- ('lilium', 'dev', 'http://localhost:9000/#/'),
- ('salix', 'dev', 'http://localhost:5000/#!/');
+ ('lilium', 'development', 'http://localhost:9000/#/'),
+ ('salix', 'development', 'http://localhost:5000/#!/');
INSERT INTO `vn`.`report` (`id`, `name`, `paperSizeFk`, `method`)
VALUES
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index b07e88fde..ee5fb40a1 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -1,6 +1,7 @@
-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: db.verdnatura.es Database: account
+
+-- Host: db1.static.verdnatura.es Database: account
-- ------------------------------------------------------
-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log
@@ -76,7 +77,6 @@ BEGIN
SELECT `name` FROM `user` WHERE id = NEW.id;
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 */ ;
@@ -114,6 +114,12 @@ DELIMITER ;;
AFTER DELETE ON `account`
FOR EACH ROW
BEGIN
+ INSERT INTO userLog
+ SET `action` = 'delete',
+ `changedModel` = 'Account',
+ `changedModelId` = OLD.id,
+ `userFk` = account.myUser_getId();
+
INSERT IGNORE INTO userSync (`name`)
SELECT `name` FROM `user` WHERE id = OLD.id;
END */;;
@@ -243,7 +249,6 @@ BEGIN
SET NEW.editorFk = account.myUser_getId();
END */;;
DELIMITER ;
-
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
@@ -347,7 +352,6 @@ CREATE TABLE `mailConfig` (
-- Table structure for table `mailForward`
--
-
DROP TABLE IF EXISTS `mailForward`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -397,7 +401,30 @@ BEGIN
SET NEW.editorFk = account.myUser_getId();
END */;;
DELIMITER ;
-
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `account`.`mailForward_afterDelete`
+ AFTER DELETE ON `mailForward`
+ FOR EACH ROW
+BEGIN
+ INSERT INTO userLog
+ SET `action` = 'delete',
+ `changedModel` = 'MailForward',
+ `changedModelId` = OLD.account,
+ `userFk` = account.myUser_getId();
+END */;;
+DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
@@ -462,7 +489,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 'MariaDB doesn''t support more than 79 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(),
@@ -661,17 +688,18 @@ CREATE TABLE `roleLog` (
`action` set('insert','update','delete','select') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Role','RoleInherit') NOT NULL DEFAULT 'Role',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `roleLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `roleLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `roleLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `roleLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -720,7 +748,7 @@ CREATE TABLE `user` (
`realm` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`name` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`nickname` varchar(127) NOT NULL,
- `bcryptPassword` varchar(512) DEFAULT NULL,
+ `password` varchar(512) DEFAULT NULL,
`role` int(10) unsigned NOT NULL DEFAULT 2,
`active` tinyint(1) NOT NULL DEFAULT 1,
`email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
@@ -731,11 +759,12 @@ CREATE TABLE `user` (
`created` timestamp NOT NULL DEFAULT current_timestamp(),
`updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`image` varchar(255) DEFAULT NULL,
- `password` char(64) NOT NULL COMMENT 'Deprecated',
+ `password__` char(64) NOT NULL COMMENT 'Deprecated',
`recoverPass` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT 'Deprecated',
`sync` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Deprecated',
`hasGrant` tinyint(1) NOT NULL,
`editorFk` int(10) unsigned DEFAULT NULL,
+ `passExpired` date DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
UNIQUE KEY `mail` (`email`),
@@ -799,11 +828,11 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET character_set_client = utf8mb3 */ ;
+/*!50003 SET character_set_results = utf8mb3 */ ;
+/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `account`.`user_beforeUpdate`
BEFORE UPDATE ON `user`
@@ -816,7 +845,6 @@ BEGIN
END IF;
IF !(NEW.`password` <=> OLD.`password`) THEN
- SET NEW.bcryptPassword = NULL;
SET NEW.lastPassChange = util.VN_NOW();
END IF;
END */;;
@@ -851,7 +879,34 @@ BEGIN
END */;;
DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `account`.`user_afterDelete`
+ AFTER DELETE ON `user`
+ FOR EACH ROW
+BEGIN
+ INSERT INTO userLog
+ SET `action` = 'delete',
+ `changedModel` = 'User',
+ `changedModelId` = OLD.id,
+ `userFk` = account.myUser_getId();
+ CALL hedera.image_unref('user', OLD.image);
+
+ INSERT IGNORE INTO userSync SET `name` = OLD.`name`;
+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 */ ;
@@ -885,17 +940,18 @@ CREATE TABLE `userLog` (
`action` set('insert','update','delete','select') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('VnUser','Account','MailAliasAccount','MailForward') NOT NULL DEFAULT 'VnUser',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `userLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `userLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `userLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `userLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -1327,31 +1383,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `myUser_changePassword` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_changePassword`(vOldPassword VARCHAR(255), vPassword VARCHAR(255))
-BEGIN
-/**
- * Changes the current user password.
- *
- * @param vOldPassword The current password
- * @param vPassword The new password
- */
- CALL user_changePassword(myUser_getId(), vOldPassword, vPassword);
-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 PROCEDURE IF EXISTS `myUser_login` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -1485,31 +1516,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `myUser_restorePassword` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_restorePassword`(vVerificationToken VARCHAR(255), vPassword VARCHAR(255))
-BEGIN
-/**
- * Changes the current user password using recovery token.
- *
- * @param vVerificationToken The current password
- * @param vPassword The new password
- */
- CALL user_restorePassword(myUser_getId(), vVerificationToken, vPassword);
-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 PROCEDURE IF EXISTS `role_checkName` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -2254,45 +2260,6 @@ BEGIN
FLUSH PRIVILEGES;
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 PROCEDURE IF EXISTS `user_changePassword` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `user_changePassword`(vSelf INT, vOldPassword VARCHAR(255), vPassword VARCHAR(255))
-BEGIN
-/**
- * Changes the user password.
- *
- * @param vSelf The user id
- * @param vOldPassword The current password
- * @param vPassword The new password
- */
- DECLARE vPasswordOk BOOL;
- DECLARE vUserName VARCHAR(255);
-
- SELECT `password` = MD5(vOldPassword), `name`
- INTO vPasswordOk, vUserName
- FROM user WHERE id = vSelf;
-
- IF NOT vPasswordOk THEN
- SIGNAL SQLSTATE '45000'
- SET MESSAGE_TEXT = 'Invalid password';
- END IF;
-
- CALL user_setPassword(vSelf, vPassword);
-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 */ ;
@@ -2393,76 +2360,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `user_restorePassword` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `user_restorePassword`(vSelf INT, vVerificationToken VARCHAR(255), vPassword VARCHAR(255))
-BEGIN
-/**
- * Changes the user password using recovery token.
- *
- * @param vSelf The user id
- * @param vVerificationToken The verification token
- * @param vPassword The new password
- */
- DECLARE vTokenVerified BOOL;
- DECLARE vUserName VARCHAR(255);
-
- SELECT verificationToken = vVerificationToken, `name`
- INTO vTokenVerified, vUserName
- FROM user WHERE id = vSelf;
-
- IF NOT vTokenVerified THEN
- SIGNAL SQLSTATE '45000'
- SET MESSAGE_TEXT = 'Invalid verification token';
- END IF;
-
- CALL user_setPassword(vSelf, vPassword);
-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 PROCEDURE IF EXISTS `user_setPassword` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `user_setPassword`(vSelf INT, vPassword VARCHAR(255))
-BEGIN
-/**
- * Change the password of the passed as a parameter. Only administrators should
- * have execute privileges on the procedure since it does not request the user's
- * current password.
- *
- * @param vSelf The user id
- * @param vPassword New password
- */
- CALL user_checkPassword(vPassword);
-
- UPDATE user SET
- `password` = MD5(vPassword),
- `verificationToken` = NULL
- WHERE id = vSelf;
-END ;;
-DELIMITER ;
-/*!50003 SET sql_mode = @saved_sql_mode */ ;
-/*!50003 SET character_set_client = @saved_cs_client */ ;
-/*!50003 SET character_set_results = @saved_cs_results */ ;
-/*!50003 SET collation_connection = @saved_col_connection */ ;
--
-- Current Database: `bs`
@@ -3008,16 +2905,16 @@ CREATE TABLE `sale` (
`dated` date NOT NULL,
`typeFk` smallint(5) unsigned NOT NULL,
`clientFk` int(11) NOT NULL DEFAULT 1,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`margin` decimal(10,3) NOT NULL DEFAULT 0.000,
PRIMARY KEY (`saleFk`),
KEY `tip_to_tip_idx` (`typeFk`),
KEY `clientes_bs_ventas_idx` (`clientFk`),
KEY `empresa_bs_ventas_idx` (`companyFk`),
KEY `fecha_bs` (`dated`,`clientFk`),
+ CONSTRAINT `saleCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `vn`.`company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `sale_FK` FOREIGN KEY (`saleFk`) REFERENCES `vn`.`sale` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `sale_FK_1` FOREIGN KEY (`clientFk`) REFERENCES `vn`.`client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `sale_FK_2` FOREIGN KEY (`companyFk`) REFERENCES `vn`.`company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `sale_FK_3` FOREIGN KEY (`typeFk`) REFERENCES `vn`.`itemType` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -3320,7 +3217,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `nightTask_launchAll` ON SCHEDULE EVERY 1 DAY STARTS '2022-02-08 04:14:00' ON COMPLETION PRESERVE ENABLE DO CALL bs.nightTask_launchAll */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `nightTask_launchAll` ON SCHEDULE EVERY 1 DAY STARTS '2022-02-08 04:14:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL bs.nightTask_launchAll */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -5978,7 +5875,7 @@ CREATE TABLE `cache_valid` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`valid` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MEMORYDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -6102,7 +5999,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `cacheCalc_clean` ON SCHEDULE EVERY 30 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE ENABLE DO CALL cacheCalc_clean */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `cacheCalc_clean` ON SCHEDULE EVERY 30 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL cacheCalc_clean */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -6120,7 +6017,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `cache_clean` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE ENABLE DO CALL cache_clean */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `cache_clean` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL cache_clean */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -7038,8 +6935,7 @@ proc: BEGIN
CALL `cache`.stock_refresh(false);
- DROP TEMPORARY TABLE IF EXISTS vn2008.tmp_item;
- CREATE TEMPORARY TABLE vn2008.tmp_item
+ CREATE OR REPLACE TEMPORARY TABLE tmp.itemVisible
(PRIMARY KEY (item_id))
ENGINE = MEMORY
SELECT item_id, amount stock, amount visible FROM `cache`.stock
@@ -7050,11 +6946,11 @@ proc: BEGIN
DELETE FROM visible WHERE calc_id = v_calc;
INSERT INTO visible (calc_id, item_id,visible)
- SELECT v_calc, item_id, visible FROM vn2008.tmp_item;
+ SELECT v_calc, item_id, visible FROM tmp.itemVisible;
CALL cache_calc_end (v_calc);
- DROP TEMPORARY TABLE vn2008.tmp_item;
+ DROP TEMPORARY TABLE tmp.itemVisible;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -8392,7 +8288,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `floramondo` ON SCHEDULE EVERY 6 MINUTE STARTS '2022-01-28 09:52:45' ON COMPLETION NOT PRESERVE ENABLE DO CALL edi.floramondo_offerRefresh() */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `floramondo` ON SCHEDULE EVERY 6 MINUTE STARTS '2022-01-28 09:52:45' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL edi.floramondo_offerRefresh() */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -9544,70 +9440,87 @@ proc: BEGIN
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.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
- DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc;
-
- CREATE TEMPORARY TABLE tmp.buyRecalc
- SELECT b.id
- FROM vn.buy b
- JOIN edi.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
+ 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
- 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;
+ 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);
- 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;
+ 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
@@ -10312,6 +10225,36 @@ CREATE TABLE `message` (
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `messageI18n`
+--
+
+DROP TABLE IF EXISTS `messageI18n`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `messageI18n` (
+ `code` char(35) NOT NULL,
+ `lang` char(2) NOT NULL,
+ `description` varchar(255) NOT NULL,
+ PRIMARY KEY (`code`,`lang`),
+ CONSTRAINT `messageI18nFk` FOREIGN KEY (`code`) REFERENCES `message` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Temporary table structure for view `messageL10n`
+--
+
+DROP TABLE IF EXISTS `messageL10n`;
+/*!50001 DROP VIEW IF EXISTS `messageL10n`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `messageL10n` (
+ `code` tinyint NOT NULL,
+ `description` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
--
-- Table structure for table `metatag`
--
@@ -10830,15 +10773,15 @@ CREATE TABLE `orderConfig` (
`guestMethod` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`guestAgencyFk` int(11) NOT NULL,
`reserveTime` time NOT NULL,
- `defaultCompanyFk` smallint(6) unsigned DEFAULT NULL,
+ `defaultCompanyFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `employeeFk` (`employeeFk`),
KEY `guestAgencyFk` (`guestAgencyFk`),
KEY `defaultCompanyFk` (`defaultCompanyFk`),
KEY `guestMethod` (`guestMethod`),
KEY `defaultAgencyFk` (`defaultAgencyFk`),
+ CONSTRAINT `orderConfigCompany_Fk` FOREIGN KEY (`defaultCompanyFk`) REFERENCES `vn`.`company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `orderConfig_ibfk_1` FOREIGN KEY (`employeeFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `orderConfig_ibfk_2` FOREIGN KEY (`defaultCompanyFk`) REFERENCES `vn`.`company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `orderConfig_ibfk_3` FOREIGN KEY (`guestAgencyFk`) REFERENCES `vn`.`agencyMode` (`id`) ON UPDATE CASCADE,
CONSTRAINT `orderConfig_ibfk_4` FOREIGN KEY (`defaultAgencyFk`) REFERENCES `vn`.`agencyMode` (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
@@ -11436,7 +11379,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `order_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2019-08-29 14:18:04' ON COMPLETION PRESERVE ENABLE DO CALL order_doRecalc */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `order_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2019-08-29 14:18:04' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL order_doRecalc */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -12605,7 +12548,7 @@ BEGIN
FROM myTicket t
WHERE shipped BETWEEN TIMESTAMP(vFrom) AND TIMESTAMP(vTo, '23:59:59');
- CALL vn.ticketGetTotal;
+ CALL vn.ticketGetTotal(NULL);
SELECT v.id, IFNULL(v.landed, v.shipped) landed,
v.shipped, v.companyFk, v.nickname,
@@ -13217,6 +13160,7 @@ BEGIN
DECLARE vIsLogifloraItem BOOL;
DECLARE vOldQuantity INT;
DECLARE vNewQuantity INT;
+ DECLARE vIsTaxDataChecked BOOL;
DECLARE cDates CURSOR FOR
SELECT zgs.shipped, r.warehouse_id
@@ -13245,14 +13189,20 @@ BEGIN
END;
-- Carga los datos del pedido
- SELECT o.date_send, o.address_id, o.note,
- a.clientFk, o.company_id, o.agency_id
- INTO vDelivery, vAddress, vNotes,
- vClientId, vCompanyId, vAgencyModeId
+ SELECT o.date_send, o.address_id, o.note, a.clientFk,
+ o.company_id, o.agency_id, c.isTaxDataChecked
+ INTO vDelivery, vAddress, vNotes, vClientId,
+ vCompanyId, vAgencyModeId, vIsTaxDataChecked
FROM hedera.`order` o
JOIN vn.address a ON a.id = o.address_id
+ JOIN vn.client c ON c.id = a.clientFk
WHERE o.id = vSelf;
+ -- Verifica si el cliente tiene los datos comprobados
+ IF NOT vIsTaxDataChecked THEN
+ CALL util.throw ('clientNotVerified');
+ END IF;
+
-- Carga las fechas de salida de cada almacen
CALL vn.zone_getShipped (vDelivery, vAddress, vAgencyModeId, FALSE);
@@ -15463,26 +15413,6 @@ CREATE TABLE `incometype_employee__` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='@deprecated 2023-03-15';
/*!40101 SET character_set_client = @saved_cs_client */;
---
--- Table structure for table `journey`
---
-
-DROP TABLE IF EXISTS `journey`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `journey` (
- `journey_id` int(11) NOT NULL AUTO_INCREMENT,
- `day_id` smallint(6) NOT NULL DEFAULT 1 COMMENT 'Lunes = 1 \nDomingo = 7',
- `start` time DEFAULT NULL,
- `end` time DEFAULT NULL,
- `business_id` int(11) NOT NULL,
- PRIMARY KEY (`journey_id`),
- UNIQUE KEY `day_id` (`day_id`,`start`,`end`,`business_id`),
- KEY `journey_business_id_idx` (`business_id`),
- CONSTRAINT `journey_business_id` FOREIGN KEY (`business_id`) REFERENCES `vn`.`business` (`id`) ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
--
-- Table structure for table `labour_agreement`
--
@@ -15620,18 +15550,6 @@ CREATE TABLE `ClavesOperacion` (
--
-- Table structure for table `Municipios`
--
-DROP TABLE IF EXISTS `taxType`;
-
-CREATE TABLE `taxType` (
- id INT(11) NOT NULL,
- code VARCHAR(25) DEFAULT NULL NULL,
- isIntracommunity TINYINT(1) DEFAULT FALSE NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `taxType_UN` (`code`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Coincidencia del id con Sage.TiposIVA.CodigoIva(propia de Sage), en ningún caso vincular mediate FK';
-
-ALTER TABLE `sage`.`taxType` ADD CONSTRAINT taxType_PK PRIMARY KEY IF NOT EXISTS (id);
-ALTER TABLE `sage`.`taxType` ADD CONSTRAINT taxType_UN UNIQUE KEY IF NOT EXISTS (code);
DROP TABLE IF EXISTS `Municipios`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -15724,7 +15642,6 @@ CREATE TABLE `TiposIva` (
`CuentaIVARecCajaPu` varchar(15) NOT NULL DEFAULT '',
`CuentaIVARecCajaVen` varchar(15) NOT NULL DEFAULT '',
`IGICImplicito` smallint(6) NOT NULL DEFAULT 0,
- `isIntracommunity` tinyint(2) NOT NULL DEFAULT 0,
PRIMARY KEY (`CodigoIva`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -15927,25 +15844,6 @@ CREATE TABLE `config` (
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
---
--- Temporary table structure for view `invoiceInList`
---
-
-DROP TABLE IF EXISTS `invoiceInList`;
-/*!50001 DROP VIEW IF EXISTS `invoiceInList`*/;
-SET @saved_cs_client = @@character_set_client;
-SET character_set_client = utf8;
-/*!50001 CREATE TABLE `invoiceInList` (
- `id` tinyint NOT NULL,
- `supplierRef` tinyint NOT NULL,
- `serial` tinyint NOT NULL,
- `supplierFk` tinyint NOT NULL,
- `issued` tinyint NOT NULL,
- `isVatDeductible` tinyint NOT NULL,
- `serialNumber` tinyint NOT NULL
-) ENGINE=MyISAM */;
-SET character_set_client = @saved_cs_client;
-
--
-- Table structure for table `invoiceType`
--
@@ -16309,6 +16207,22 @@ SET character_set_client = utf8;
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
+--
+-- Table structure for table `taxType`
+--
+
+DROP TABLE IF EXISTS `taxType`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `taxType` (
+ `id` int(11) NOT NULL,
+ `code` varchar(25) DEFAULT NULL,
+ `isIntracommunity` tinyint(1) NOT NULL DEFAULT 0,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `taxType_UN` (`code`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Coincidencia del id con Sage.TiposIVA.CodigoIva(propia de Sage), en ningún caso vincular mediate FK';
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Dumping events for database 'sage'
--
@@ -16357,16 +16271,20 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb3 */ ;
-/*!50003 SET character_set_results = utf8mb3 */ ;
-/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `accountingMovements_add`(vYear INT, vCompanyFk INT)
+CREATE DEFINER=`root`@`localhost` PROCEDURE `accountingMovements_add`(
+ vYear INT,
+ vCompanyFk INT
+)
BEGIN
/**
- * 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
+ * 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
* @vCompanyFk Empresa de la que se quiere trasladar datos
@@ -16396,17 +16314,17 @@ BEGIN
FROM TiposTransacciones
WHERE Transaccion = 'Import. bienes y serv. corrientes pdte. liquidar';
- SELECT CodigoIva INTO vTaxImportFk
- FROM TiposIva
- WHERE Iva = 'IVA 21% importaciones';
+ SELECT id INTO vTaxImportFk
+ FROM taxType
+ WHERE code = 'import21';
- SELECT CodigoIva INTO vTaxImportReducedFk
- FROM TiposIva
- WHERE Iva = 'IVA 10% importaciones';
+ SELECT id INTO vTaxImportReducedFk
+ FROM taxType
+ WHERE code = 'import10';
- SELECT CodigoIva INTO vTaxImportSuperReducedFk
- FROM TiposIva
- WHERE Iva = 'H.P. IVA Soportado Impor 4%';
+ SELECT id INTO vTaxImportSuperReducedFk
+ FROM taxType
+ WHERE code = 'import4';
SELECT CodigoTransaccion INTO vTransactionExportFk
FROM TiposTransacciones
@@ -16419,7 +16337,7 @@ BEGIN
SELECT codeSage INTO vInvoiceTypeInformativeCode
FROM invoiceType WHERE code ='informative';
- SELECT CAST(CONCAT(vYear, '-01-01') AS DATETIME), util.dayEnd(CAST(CONCAT(vYear, '-12-31') AS DATE))
+ SELECT MAKEDATE(vYear, 1), MAKEDATE(vYear + 1, 1) - INTERVAL 1 DAY
INTO vDatedFrom, vDatedTo;
TRUNCATE movContaIVA;
@@ -16524,7 +16442,8 @@ BEGIN
YEAR(x.FECHA) Ejercicio,
company_getCode(vCompanyFk) AS CodigoEmpresa,
x.ASIEN Asiento,
- IF(EURODEBE <> 0 OR (EURODEBE = 0 AND EUROHABER IS NULL), 'D', 'H') CargoAbono,
+ IF(EURODEBE <> 0 OR (EURODEBE = 0 AND EUROHABER IS NULL),
+ 'D', 'H') CargoAbono,
x.SUBCTA CodigoCuenta,
x.CONTRA Contrapartida,
x.FECHA FechaAsiento,
@@ -16671,7 +16590,8 @@ BEGIN
-- DUAS
UPDATE movConta mci
JOIN vn.XDiario x ON x.ASIEN = mci.Asiento
- JOIN TiposIva ti ON ti.CodigoIva = x.IVA
+ JOIN TiposIva ti ON ti.PorcentajeIva = x.IVA
+ JOIN taxType tt ON tt.id = ti.CodigoIva
JOIN vn.pgcMaster pm ON pm.code = mci.CodigoCuenta COLLATE utf8mb3_unicode_ci
SET mci.BaseIva1 = x.BASEEURO,
mci.PorIva1 = x.IVA,
@@ -16682,15 +16602,18 @@ BEGIN
mci.FechaFacturaOriginal = x.FECHA_EX,
mci.SuFacturaNo = x.FACTURAEX,
mci.FechaOperacion = x.FECHA_OP,
- mci.ImporteFactura = mci.ImporteFactura + x.BASEEURO + CAST((x.IVA / 100) * x.BASEEURO AS DECIMAL(10, 2))
+ 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
AND x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci
- AND ti.Iva = 'I.V.A. 10% Nacional';
+ AND tt.code = 'national10';
UPDATE movConta mci
JOIN vn.XDiario x ON x.ASIEN = mci.Asiento
- JOIN TiposIva ti ON ti.CodigoIva = x.IVA
+ JOIN TiposIva ti ON ti.PorcentajeIva = x.IVA
+ JOIN taxType tt ON tt.id = ti.CodigoIva
JOIN vn.pgcMaster pm ON pm.code = mci.CodigoCuenta COLLATE utf8mb3_unicode_ci
SET mci.BaseIva2 = x.BASEEURO ,
mci.PorIva2 = x.IVA,
@@ -16698,15 +16621,18 @@ BEGIN
mci.CodigoTransaccion2 = vDuaTransactionFk ,
mci.CodigoIva2 = vTaxImportFk,
mci.IvaDeducible2 = TRUE,
- mci.ImporteFactura = mci.ImporteFactura + x.BASEEURO + CAST((x.IVA / 100) * x.BASEEURO AS DECIMAL(10, 2))
+ 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
AND x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci
- AND ti.Iva = 'I.V.A. 21%';
+ AND tt.code = 'national21';
UPDATE movConta mci
JOIN vn.XDiario x ON x.ASIEN = mci.Asiento
- JOIN TiposIva ti ON ti.CodigoIva = x.IVA
+ JOIN TiposIva ti ON ti.PorcentajeIva = x.IVA
+ JOIN taxType tt ON tt.id = ti.CodigoIva
JOIN vn.pgcMaster pm ON pm.code = mci.CodigoCuenta COLLATE utf8mb3_unicode_ci
SET mci.BaseIva3 = x.BASEEURO ,
mci.PorIva3 = x.IVA,
@@ -16714,11 +16640,13 @@ BEGIN
mci.CodigoTransaccion3 = vDuaTransactionFk ,
mci.CodigoIva3 = vTaxImportSuperReducedFk,
mci.IvaDeducible3 = TRUE,
- mci.ImporteFactura = mci.ImporteFactura + x.BASEEURO + CAST((x.IVA / 100) * x.BASEEURO AS DECIMAL(10, 2))
+ 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
AND x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci
- AND ti.Iva = 'I.V.A. 4%';
+ AND tt.code = 'national4';
-- Rectificativas
UPDATE movConta mci
@@ -16747,12 +16675,15 @@ BEGIN
OR CodigoTransaccion2 = vTransactionExportFk
OR CodigoTransaccion3 = vTransactionExportFk
OR CodigoTransaccion4 = vTransactionExportFk)
- AND SiglaNacion IN (vCountryCanariasCode COLLATE utf8mb3_unicode_ci, vCountryCeutaMelillaCode 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) AS DECIMAL( 10, 2)))
+ 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);
@@ -16793,7 +16724,9 @@ 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,'"}'), null);
+ SELECT util.notification_send ("book-entries-imported-incorrectly",
+ CONCAT('{"bookEntries":"', vBookEntries,'"}'),
+ null);
END IF;
END ;;
DELIMITER ;
@@ -16873,7 +16806,7 @@ 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 IN('ES','EX'),
+ IF(cu.code = 'ES',
1,
IF((cu.isUeeMember AND c.isVies), 2, 4)),
IFNULL(c.taxTypeSageFk,0),
@@ -16911,7 +16844,7 @@ BEGIN
n.CodigoNacion,
n.SiglaNacion COLLATE utf8mb3_unicode_ci,
IF((s.nif REGEXP '^([[:blank:]]|[[:digit:]])'),'J','F'),
- IF(co.country IN ('España', 'España exento'), 1,IF(co.isUeeMember = 1, 2, 4)),
+ IF(co.code = 'ES', 1, IF(co.isUeeMember, 2, 4)),
IFNULL(s.taxTypeSageFk, 0),
n.Nacion,
IFNULL(sc.phone, ''),
@@ -16978,11 +16911,12 @@ BEGIN
t.PorcentajeIva,
it.transactionTypeSageFk,
it.taxTypeSageFk,
- t.isIntracommunity,
+ tty.isIntracommunity,
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
@@ -16999,15 +16933,6 @@ BEGIN
SELECT codeSage INTO vInvoiceTypeInformative
FROM invoiceType WHERE code ='informative';
- SELECT d.ASIEN AND x.ASIEN IS NULL INTO vIsInformativeExportation
- FROM vn.dua d
- 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
- WHERE id = vXDiarioFk);
-
INSERT INTO movContaIVA(id, LibreA1)
VALUES (vXDiarioFk, vInvoiceInFk);
@@ -17087,6 +17012,16 @@ BEGIN
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
+ AND x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci
+ WHERE d.ASIEN = (
+ SELECT ASIEN
+ 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
@@ -17096,7 +17031,7 @@ BEGIN
SET mci.CodigoDivisa = ii.currencyFk,
mci.Año = YEAR(ii.issued),
mci.Serie = ii.serial,
- mci.Factura = ii.serialNumber,
+ 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) +
@@ -17230,7 +17165,6 @@ BEGIN
i.supplierFk,
i.issued,
IF(expenceFkDeductible, FALSE, i.isVatDeductible) isVatDeductible,
- i.serialNumber,
IF(c.code = 'EUR', '',c.`code`) currencyFk
FROM vn.invoiceIn i
JOIN vn.currency c ON c.id = i.currencyFk
@@ -17238,11 +17172,10 @@ BEGIN
UNION ALL
SELECT d.id,
d.code,
- vSerialDua,
+ vSerialDua COLLATE utf8mb3_unicode_ci,
d.companyFk ,
d.issued,
FALSE,
- d.id,
'' -- EUROS
FROM vn.dua d
WHERE d.issued IS NOT NULL
@@ -17989,7 +17922,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `accessToken_prune` ON SCHEDULE EVERY 1 DAY STARTS '2023-03-14 05:14:00' ON COMPLETION PRESERVE ENABLE DO CALL salix.accessToken_prune */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `accessToken_prune` ON SCHEDULE EVERY 1 DAY STARTS '2023-03-14 05:14:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL salix.accessToken_prune */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -18275,7 +18208,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `log_clean` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE ENABLE DO CALL log_clean */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `log_clean` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL log_clean */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -19497,7 +19430,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `slowLog_prune` ON SCHEDULE EVERY 1 DAY STARTS '2021-10-08 00:00:00' ON COMPLETION PRESERVE ENABLE DO CALL util.slowLog_prune */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `slowLog_prune` ON SCHEDULE EVERY 1 DAY STARTS '2021-10-08 00:00:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL util.slowLog_prune */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -20064,7 +19997,7 @@ BEGIN
RETURN NOW();
END IF;
*/
- RETURN CONVERT_TZ('2001-01-01 11:00:00', 'utc', 'Europe/Madrid');
+ RETURN NOW();
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -20090,7 +20023,19 @@ BEGIN
* @param vIsUtc If date must be returned as UTC format
* @return The formatted mock time
*/
- RETURN CONVERT_TZ('2001-01-01 11:00:00', 'utc', 'Europe/Madrid');
+DECLARE vMockUtcTime DATETIME;
+ DECLARE vMockTz VARCHAR(255);
+
+ SELECT mockUtcTime, mockTz
+ INTO vMockUtcTime, vMockTz
+ FROM config
+ LIMIT 1;
+
+ IF vIsUtc OR vMockTz IS NULL THEN
+ RETURN vMockUtcTime;
+ ELSE
+ RETURN CONVERT_TZ(vMockUtcTime, '+00:00', vMockTz);
+ END IF;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -20127,7 +20072,7 @@ BEGIN
RETURN UTC_TIMESTAMP();
END IF;
*/
- RETURN CONVERT_TZ('2001-01-01 11:00:00', 'utc', 'Europe/Madrid');
+ RETURN UTC_TIMESTAMP();
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -21002,6 +20947,7 @@ BEGIN
SET vNewInstance = vNew;
WHEN 'delete' THEN
SET vOldInstance = json_removeNulls(vOldInstance);
+ ELSE BEGIN END;
END CASE;
SET vOldInstance = log_formatDate(vOldInstance);
@@ -21303,7 +21249,7 @@ CREATE TABLE `XDiario` (
`enlazado` tinyint(1) NOT NULL DEFAULT 0,
`FECHA_EX` date DEFAULT NULL COMMENT 'FEcha de expedicion de la factura',
`LRECT349` tinyint(1) NOT NULL DEFAULT 0,
- `empresa_id` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `empresa_id` int(10) unsigned NOT NULL DEFAULT 442,
`LDIFADUAN` tinyint(4) NOT NULL DEFAULT 0,
`METAL` tinyint(1) NOT NULL DEFAULT 0,
`METALIMP` decimal(10,2) NOT NULL DEFAULT 0.00,
@@ -21332,7 +21278,7 @@ CREATE TABLE `XDiario` (
KEY `SERIEidx` (`ASIEN`,`SERIE`),
KEY `XDiario` (`enlazado`),
KEY `enlazadoSage` (`enlazadoSage`),
- CONSTRAINT `XDiario_ibfk_1` FOREIGN KEY (`empresa_id`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+ CONSTRAINT `XDiarioCompany_Fk` FOREIGN KEY (`empresa_id`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -21997,6 +21943,7 @@ CREATE TABLE `arcRead` (
`ip` varchar(50) NOT NULL,
`counter` smallint(2) unsigned DEFAULT NULL COMMENT 'Número de etiquetas leídas del pallet actual por el arco',
`error` varchar(50) DEFAULT NULL,
+ `minimum` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `arcRead_ip_UN` (`ip`),
KEY `worker_printer_FK` (`printerFk`),
@@ -22093,7 +22040,7 @@ CREATE TABLE `autonomy` (
KEY `autonomy_FK_1` (`geoFk`),
CONSTRAINT `autonomy_FK` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `autonomy_FK_1` FOREIGN KEY (`geoFk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Comunidades autónomas o su equivalente en otros paises. Agrupación de provincias, en una categoria inferior a country.';
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Comunidades autónomas o su equivalente en otros paises. Agrupación de provincias, en una categoria inferior a country.';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -22179,12 +22126,12 @@ CREATE TABLE `awb` (
`package` float unsigned NOT NULL,
`weight` float unsigned DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
- `transitoryFk` int(11) DEFAULT NULL,
+ `transitoryFk` int(10) unsigned DEFAULT NULL,
`taxFk` int(10) unsigned DEFAULT 62,
`duakk` varchar(18) DEFAULT NULL,
`docFk` int(11) DEFAULT NULL,
`amount` double NOT NULL DEFAULT 0,
- `freightFk` int(11) DEFAULT NULL,
+ `freightFk` int(10) unsigned DEFAULT NULL,
`m3` double unsigned DEFAULT NULL,
`stems` int(10) unsigned DEFAULT NULL,
`flightFk` varchar(10) DEFAULT NULL,
@@ -22213,12 +22160,11 @@ CREATE TABLE `awb` (
KEY `awb_FK` (`docFk`),
KEY `awb_FK_3` (`invoiceInPaletizedFk`),
CONSTRAINT `awbInvoiceIn` FOREIGN KEY (`invoiceInFk`) REFERENCES `invoiceIn` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
- CONSTRAINT `awbTransitoryFk` FOREIGN KEY (`transitoryFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
CONSTRAINT `awb_FK` FOREIGN KEY (`docFk`) REFERENCES `dms` (`id`) ON UPDATE CASCADE,
CONSTRAINT `awb_FK_1` FOREIGN KEY (`flightFk`) REFERENCES `vn2008`.`flight` (`flight_id`) ON UPDATE CASCADE,
- CONSTRAINT `awb_FK_2` FOREIGN KEY (`freightFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
CONSTRAINT `awb_FK_3` FOREIGN KEY (`invoiceInPaletizedFk`) REFERENCES `invoiceIn` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `awb_ibfk_1` FOREIGN KEY (`taxFk`) REFERENCES `taxCode` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `awb_ibfk_1` FOREIGN KEY (`taxFk`) REFERENCES `taxCode` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `awb_supplierFk` FOREIGN KEY (`transitoryFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -22350,6 +22296,7 @@ DROP TABLE IF EXISTS `bankEntityConfig`;
CREATE TABLE `bankEntityConfig` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`bicLength` tinyint(4) DEFAULT 11 COMMENT 'Tamaño del campo bic',
+ `defaultBankId` int(11) NOT NULL DEFAULT 3117 COMMENT 'Id del banco por defecto',
PRIMARY KEY (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -22454,16 +22401,16 @@ CREATE TABLE `botanicExport` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`ediGenusFk` mediumint(8) unsigned NOT NULL,
`ediSpecieFk` mediumint(8) unsigned DEFAULT NULL,
- `countryFk` mediumint(8) unsigned DEFAULT NULL,
+ `countryFk__` mediumint(8) unsigned DEFAULT NULL,
`restriction` enum('Sin restriccion','Importacion Prohibida','pasaporte fitosanitario','pasaporte individual','declaracion origen') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`description` varchar(45) DEFAULT NULL,
`isProtectedZone` tinyint(1) NOT NULL DEFAULT 0,
`code` enum('importProhibited','phytosanitaryPassport','individualPassport') DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `Id_Paises` (`countryFk`),
+ KEY `Id_Paises` (`countryFk__`),
KEY `botanicExport_ibfk_2_idx` (`ediGenusFk`),
KEY `botanicExport_ibfk_3_idx` (`ediSpecieFk`),
- CONSTRAINT `botanicExport_ibfk_1` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`)
+ CONSTRAINT `botanicExport_ibfk_1` FOREIGN KEY (`countryFk__`) REFERENCES `country` (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Especifica los generos y especies prohibidos en paises';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -22479,7 +22426,7 @@ DELIMITER ;;
BEFORE INSERT ON `botanicExport`
FOR EACH ROW
BEGIN
- IF (SELECT botanicExport_isUpdatable (NEW.ediGenusFk, NEW.ediSpecieFk, NEW.countryFk, NEW.restriction) ) > 0 THEN
+ IF (SELECT botanicExport_isUpdatable (NEW.ediGenusFk, NEW.ediSpecieFk, NEW.restriction) ) > 0 THEN
CALL util.throw ('Datos duplicados');
END IF;
END */;;
@@ -22504,7 +22451,7 @@ CREATE TABLE `budget` (
`finished` date DEFAULT NULL,
`userFk` int(10) unsigned DEFAULT NULL,
`departmentFk` int(11) DEFAULT NULL,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
`photo` blob DEFAULT NULL,
`amount` decimal(10,2) DEFAULT NULL,
`projectFk` int(11) NOT NULL,
@@ -22512,11 +22459,11 @@ CREATE TABLE `budget` (
KEY `budget_FK` (`projectFk`),
KEY `budget_FK_1` (`userFk`),
KEY `budget_FK_2` (`departmentFk`),
- KEY `budget_FK_3` (`supplierFk`),
+ KEY `budget_supplierFk` (`supplierFk`),
CONSTRAINT `budget_FK` FOREIGN KEY (`projectFk`) REFERENCES `project` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `budget_FK_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `budget_FK_2` FOREIGN KEY (`departmentFk`) REFERENCES `department` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `budget_FK_3` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+ CONSTRAINT `budget_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Master de presupuestos de project';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -22651,7 +22598,6 @@ CREATE TABLE `business` (
KEY `business_fk_editor` (`editorFk`),
CONSTRAINT `business_FK` FOREIGN KEY (`workerBusinessProfessionalCategoryFk`) REFERENCES `professionalCategory` (`id`) ON UPDATE CASCADE,
CONSTRAINT `business_calendarTypeFk` FOREIGN KEY (`calendarTypeFk`) REFERENCES `calendarType` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `business_companyCodeFk` FOREIGN KEY (`companyCodeFk`) REFERENCES `company` (`code`) ON UPDATE CASCADE,
CONSTRAINT `business_departmentFk` FOREIGN KEY (`departmentFk`) REFERENCES `department` (`id`) ON UPDATE CASCADE,
CONSTRAINT `business_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
CONSTRAINT `business_occupationCodeFk` FOREIGN KEY (`occupationCodeFk`) REFERENCES `occupationCode` (`code`) ON UPDATE CASCADE,
@@ -22833,6 +22779,26 @@ CREATE TABLE `businessReasonEnd` (
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `businessSchedule`
+--
+
+DROP TABLE IF EXISTS `businessSchedule`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `businessSchedule` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `weekday` smallint(6) NOT NULL DEFAULT 1 COMMENT 'Lunes = 1 \nDomingo = 7',
+ `started` time DEFAULT NULL,
+ `ended` time DEFAULT NULL,
+ `businessFk` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `day_id` (`weekday`,`started`,`ended`,`businessFk`),
+ KEY `journey_business_id_idx` (`businessFk`),
+ CONSTRAINT `journey_business_id` FOREIGN KEY (`businessFk`) REFERENCES `business` (`id`) ON UPDATE CASCADE
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Table structure for table `businessType`
--
@@ -22973,7 +22939,9 @@ trig: BEGIN
SET NEW.itemFk = vGenericFk;
END IF;
-
+ END IF;
+ IF NEW.quantity < 0 THEN
+ SET NEW.isIgnored = TRUE;
END IF;
END */;;
DELIMITER ;
@@ -23060,6 +23028,10 @@ trig:BEGIN
CALL util.throw("Stickers cannot be modified if they are inventory");
END IF;
END IF;
+
+ IF NEW.quantity < 0 THEN
+ SET NEW.isIgnored = TRUE;
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -23191,6 +23163,20 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
+--
+-- Table structure for table `buyConfig`
+--
+
+DROP TABLE IF EXISTS `buyConfig`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `buyConfig` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `monthsAgo` int(11) NOT NULL DEFAULT 6 COMMENT 'Meses desde la última compra',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Table structure for table `buyMark`
--
@@ -23586,7 +23572,7 @@ DELIMITER ;;
AFTER DELETE ON `claim`
FOR EACH ROW
BEGIN
- INSERT INTO clientLog
+ INSERT INTO claimLog
SET `action` = 'delete',
`changedModel` = 'Claim',
`changedModelId` = OLD.id,
@@ -24007,17 +23993,18 @@ CREATE TABLE `claimLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Claim','ClaimBeginning','ClaimState','ClaimDevelopment','ClaimDms','ClaimEnd','ClaimObservation') NOT NULL DEFAULT 'Claim',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `claimLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `claimLog_claimLog` (`originFk`,`creationDate`),
CONSTRAINT `claimOriginFk` FOREIGN KEY (`originFk`) REFERENCES `claim` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `claimUserFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -24309,7 +24296,7 @@ CREATE TABLE `client` (
`mobile` varchar(15) DEFAULT NULL,
`accountingAccount` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`isEqualizated` tinyint(1) NOT NULL DEFAULT 0,
- `city` varchar(25) DEFAULT NULL,
+ `city` varchar(100) DEFAULT NULL,
`provinceFk` smallint(5) unsigned NOT NULL,
`postcode` varchar(8) DEFAULT NULL,
`socialName` varchar(60) DEFAULT NULL,
@@ -24900,17 +24887,18 @@ CREATE TABLE `clientLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Client','Address','ClientContact','ClientDms','ClientObservation','ClientSample','Greuge','Recovery','TpvTransaction','WorkerDms','Sms') NOT NULL DEFAULT 'Client',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `clientLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `clientLog_clientLog` (`originFk`,`creationDate`),
CONSTRAINT `clientLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `clientLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -25092,12 +25080,12 @@ DROP TABLE IF EXISTS `clientRisk`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clientRisk` (
`clientFk` int(11) NOT NULL DEFAULT 0,
- `companyFk` smallint(6) unsigned NOT NULL DEFAULT 0,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 0,
`amount` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`clientFk`,`companyFk`),
KEY `company_id` (`companyFk`),
- CONSTRAINT `clientRisk_ibfk_1` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `clientRisk_ibfk_2` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+ CONSTRAINT `clientRiskCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `clientRisk_ibfk_1` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Saldo de apertura < 2015-01-01';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -25115,14 +25103,14 @@ CREATE TABLE `clientSample` (
`created` datetime NOT NULL DEFAULT current_timestamp(),
`workerFk` int(10) unsigned NOT NULL,
`balance` float NOT NULL,
- `companyFk` smallint(5) unsigned DEFAULT NULL,
+ `companyFk` int(10) unsigned DEFAULT NULL,
`userFk` int(11) DEFAULT NULL,
`editorFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `empresa_id` (`companyFk`),
KEY `clientSample_fk_editor` (`editorFk`),
- CONSTRAINT `clientSample_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
- CONSTRAINT `clientSample_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `clientSampleCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `clientSample_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -25256,10 +25244,10 @@ CREATE TABLE `cmr` (
`paymentInstruccions` varchar(255) DEFAULT 'Carriage paid',
`specialAgreements` varchar(255) DEFAULT NULL,
`created` timestamp NULL DEFAULT current_timestamp(),
- `companyFk` smallint(5) unsigned DEFAULT NULL,
+ `companyFk` int(10) unsigned DEFAULT NULL,
`addressToFk` int(11) DEFAULT NULL,
`addressFromFk` int(11) DEFAULT NULL,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
`packagesList` varchar(255) DEFAULT NULL,
`merchandiseDetail` varchar(255) DEFAULT NULL,
`state` varchar(100) DEFAULT NULL,
@@ -25271,11 +25259,11 @@ CREATE TABLE `cmr` (
KEY `cmr_fk3_idx` (`addressToFk`),
KEY `cm_fk4_idx` (`supplierFk`),
KEY `cmr_FK` (`addressFromFk`),
- CONSTRAINT `cm_fk4` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `cmrCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `cmr_FK` FOREIGN KEY (`addressFromFk`) REFERENCES `address` (`id`) ON UPDATE CASCADE,
CONSTRAINT `cmr_fk1` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `cmr_fk2` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
- CONSTRAINT `cmr_fk3` FOREIGN KEY (`addressToFk`) REFERENCES `address` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
+ CONSTRAINT `cmr_fk3` FOREIGN KEY (`addressToFk`) REFERENCES `address` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `cmr_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -25320,6 +25308,28 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`cmr_beforeDelete`
+ BEFORE DELETE ON `cmr`
+ FOR EACH ROW
+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;
+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 */ ;
--
-- Table structure for table `cmrConfig`
@@ -25659,7 +25669,7 @@ DROP TABLE IF EXISTS `company`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `company` (
- `id` smallint(5) unsigned NOT NULL,
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`code` char(3) DEFAULT NULL,
`register` varchar(120) NOT NULL,
`workerManagerFk` int(10) unsigned NOT NULL,
@@ -25691,10 +25701,11 @@ CREATE TABLE `company` (
KEY `empresa_grupo_fk_idx` (`companyGroupFk`),
KEY `company_fhAdminNumber_IDX` (`fhAdminNumber`) USING BTREE,
CONSTRAINT `company_ibfk_1` FOREIGN KEY (`workerManagerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `company_supplierFk` FOREIGN KEY (`id`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
CONSTRAINT `empresa_cliente` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `empresa_fk4` FOREIGN KEY (`supplierAccountFk`) REFERENCES `supplierAccount` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `fk_empresa_grupo` FOREIGN KEY (`companyGroupFk`) REFERENCES `companyGroup` (`id`) ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -25719,11 +25730,11 @@ DROP TABLE IF EXISTS `companyI18n`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `companyI18n` (
- `companyFk` smallint(5) unsigned NOT NULL,
+ `companyFk` int(10) unsigned NOT NULL,
`lang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`footnotes` longtext DEFAULT NULL,
PRIMARY KEY (`companyFk`,`lang`),
- CONSTRAINT `companyI18n_FK` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `companyI18nCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -25892,29 +25903,6 @@ CREATE TABLE `continent` (
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='World continents';
/*!40101 SET character_set_client = @saved_cs_client */;
---
--- Table structure for table `contratos_subvencion_270619`
---
-
-DROP TABLE IF EXISTS `contratos_subvencion_270619`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `contratos_subvencion_270619` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `workerFk` int(10) unsigned NOT NULL,
- `cod_centroFk` int(11) NOT NULL,
- `CodContratoFk` int(11) NOT NULL,
- `journey` decimal(5,2) NOT NULL DEFAULT 8.00,
- `name` varchar(50) NOT NULL,
- `nif` varchar(12) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `contratos_subvencion_270619_fk2_idx` (`cod_centroFk`),
- KEY `contratos_subvencion_270619_fk1_idx` (`workerFk`),
- CONSTRAINT `contratos_subvencion_270619_fk1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `contratos_subvencion_270619_fk2` FOREIGN KEY (`cod_centroFk`) REFERENCES `vn2008`.`payroll_centros` (`cod_centro`) ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Segun los informes de vida laboral aportados por la SS';
-/*!40101 SET character_set_client = @saved_cs_client */;
-
--
-- Table structure for table `conveyor`
--
@@ -26066,7 +26054,7 @@ CREATE TABLE `country` (
`CEE` tinyint(1) NOT NULL DEFAULT 1,
`code` varchar(2) DEFAULT NULL,
`currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 1,
- `politicalCountryFk` mediumint(8) unsigned NOT NULL COMMENT 'Pais Real(apaño por culpa del España Exento)',
+ `politicalCountryFk__` mediumint(8) unsigned DEFAULT NULL COMMENT 'Pais Real(apaño por culpa del España Exento)',
`geoFk` int(11) DEFAULT NULL,
`hasDailyInvoice` tinyint(4) NOT NULL DEFAULT 0,
`isUeeMember` tinyint(4) NOT NULL DEFAULT 0,
@@ -26074,13 +26062,13 @@ CREATE TABLE `country` (
`continentFk` tinyint(4) DEFAULT NULL,
`a3Code` int(11) DEFAULT NULL COMMENT 'Código país para a3',
PRIMARY KEY (`id`),
- KEY `Id_Paisreal` (`politicalCountryFk`),
+ KEY `Id_Paisreal` (`politicalCountryFk__`),
KEY `currency_id_fk_idx` (`currencyFk`),
KEY `country_Ix4` (`country`),
KEY `continent_id_fk_idx` (`continentFk`),
KEY `country_FK_1` (`geoFk`),
CONSTRAINT `continent_id_fk` FOREIGN KEY (`continentFk`) REFERENCES `continent` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
- CONSTRAINT `country_FK` FOREIGN KEY (`politicalCountryFk`) REFERENCES `country` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `country_FK` FOREIGN KEY (`politicalCountryFk__`) REFERENCES `country` (`id`) ON UPDATE CASCADE,
CONSTRAINT `country_FK_1` FOREIGN KEY (`geoFk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE,
CONSTRAINT `currency_id_fk` FOREIGN KEY (`currencyFk`) REFERENCES `currency` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
@@ -26506,7 +26494,9 @@ SET character_set_client = utf8;
`created` tinyint NOT NULL,
`amount` tinyint NOT NULL,
`defaulterSinced` tinyint NOT NULL,
- `hasChanged` tinyint NOT NULL
+ `hasChanged` tinyint NOT NULL,
+ `country` tinyint NOT NULL,
+ `payMethod` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
@@ -26905,7 +26895,7 @@ CREATE TABLE `deviceProductionLog` (
`changedModel` varchar(50) DEFAULT NULL,
`changedModelId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -26980,7 +26970,7 @@ CREATE TABLE `dms` (
`dmsTypeFk` int(11) NOT NULL DEFAULT 1,
`reference` varchar(50) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`hardCopyNumber` mediumint(8) unsigned DEFAULT NULL,
`contentType` varchar(150) DEFAULT NULL,
`file` varchar(30) DEFAULT NULL,
@@ -26994,7 +26984,7 @@ CREATE TABLE `dms` (
KEY `trabajador_id` (`workerFk`),
KEY `warehouse_id` (`warehouseFk`),
KEY `dms_dmsTypeFk_idx` (`dmsTypeFk`),
- CONSTRAINT `dms_companyFk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `dmsCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `dms_dmsTypeFk` FOREIGN KEY (`dmsTypeFk`) REFERENCES `dmsType` (`id`) ON UPDATE CASCADE,
CONSTRAINT `dms_warehouseFk` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE,
CONSTRAINT `dms_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE
@@ -27195,16 +27185,16 @@ CREATE TABLE `dua` (
`bookEntried` date DEFAULT NULL,
`gestdocFk` int(11) DEFAULT NULL,
`customsValue` decimal(10,2) DEFAULT NULL,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`ASIEN` double DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code_UNIQUE` (`code`),
KEY `fk_awb_dua_awb_idx` (`awbFk`),
KEY `fk_dua_gestdoc1_idx` (`gestdocFk`),
KEY `dua_fk4_idx` (`companyFk`),
+ CONSTRAINT `duaCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `dua_fk1` FOREIGN KEY (`gestdocFk`) REFERENCES `dms` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
- CONSTRAINT `dua_fk2` FOREIGN KEY (`awbFk`) REFERENCES `awb` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `dua_fk4` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `dua_fk2` FOREIGN KEY (`awbFk`) REFERENCES `awb` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -27279,7 +27269,7 @@ DROP TABLE IF EXISTS `duaTax`;
CREATE TABLE `duaTax` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`duaFk` int(11) NOT NULL,
- `supplierFk` int(11) NOT NULL,
+ `supplierFk` int(10) unsigned NOT NULL,
`taxClassFk` tinyint(3) unsigned NOT NULL,
`base` decimal(10,2) NOT NULL,
`rate` decimal(5,2) NOT NULL,
@@ -27289,8 +27279,8 @@ CREATE TABLE `duaTax` (
KEY `duaTax_fk2_idx` (`supplierFk`),
KEY `duaTax_fk3_idx` (`taxClassFk`),
CONSTRAINT `duaTax_fk1` FOREIGN KEY (`duaFk`) REFERENCES `dua` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `duaTax_fk2` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `duaTax_fk3` FOREIGN KEY (`taxClassFk`) REFERENCES `taxClass` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `duaTax_fk3` FOREIGN KEY (`taxClassFk`) REFERENCES `taxClass` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `duaTax_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -27524,7 +27514,7 @@ DROP TABLE IF EXISTS `entry`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `entry` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `supplierFk` int(11) NOT NULL DEFAULT 644,
+ `supplierFk` int(10) unsigned NOT NULL DEFAULT 644,
`dated` datetime NOT NULL,
`invoiceNumber` varchar(50) DEFAULT NULL,
`isBooked` tinyint(1) NOT NULL DEFAULT 0,
@@ -27537,7 +27527,7 @@ CREATE TABLE `entry` (
`evaNotes` varchar(45) DEFAULT NULL,
`travelFk` int(11) unsigned DEFAULT NULL,
`currencyFk` tinyint(3) unsigned DEFAULT 1,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`gestDocFk` int(11) DEFAULT NULL,
`invoiceInFk` mediumint(8) unsigned DEFAULT NULL,
`isBlocked` tinyint(4) NOT NULL DEFAULT 0,
@@ -27565,13 +27555,13 @@ CREATE TABLE `entry` (
KEY `entry_observationEditorFk` (`observationEditorFk`),
KEY `entry_fk_editor` (`editorFk`),
CONSTRAINT `Entradas_fk8` FOREIGN KEY (`invoiceInFk`) REFERENCES `invoiceIn` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `entryCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `entry_FK` FOREIGN KEY (`buyerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE,
CONSTRAINT `entry_FK_1` FOREIGN KEY (`typeFk`) REFERENCES `entryType` (`code`) ON UPDATE CASCADE,
CONSTRAINT `entry_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
- CONSTRAINT `entry_ibfk_1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
CONSTRAINT `entry_ibfk_6` FOREIGN KEY (`travelFk`) REFERENCES `travel` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `entry_ibfk_7` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `entry_observationEditorFk` FOREIGN KEY (`observationEditorFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `entry_observationEditorFk` FOREIGN KEY (`observationEditorFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `entry_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='InnoDB free: 88064 kB; (`Id_Proveedor`) REFER `vn2008/Provee';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -27675,14 +27665,6 @@ BEGIN
OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk,NEW.supplierFk);
END IF;
-
- IF NOT (ABS(NEW.isBooked) <=> ABS(OLD.isBooked)) THEN
- INSERT INTO entryLog SET
- action = 'update',
- description = 'Cambia a Contabilizada',
- userFk = account.myUser_getId(),
- originFk = NEW.id;
- END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -27794,18 +27776,18 @@ CREATE TABLE `entryLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Entry','Buy','EntryObservation') NOT NULL DEFAULT 'Entry',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `logEntry_ibfk_1` (`originFk`),
KEY `entryLog_ibfk_2` (`userFk`),
KEY `entryLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `entryLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `entryLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `entry` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `entryLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -28142,7 +28124,7 @@ CREATE TABLE `expedition` (
`itemPackingTypeFk` varchar(1) DEFAULT NULL,
`hostFk` varchar(6) NOT NULL,
`stateTypeFk` int(11) DEFAULT NULL COMMENT 'Ultimo estado de la expedicion',
- `hasNewRoute` bit(1) NOT NULL DEFAULT b'0',
+ `hasNewRoute` tinyint(1) NOT NULL DEFAULT 0,
`isBox` int(11) GENERATED ALWAYS AS (`freightItemFk`) VIRTUAL COMMENT 'Columna virtual provisional para Salix',
`editorFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
@@ -28307,7 +28289,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `expeditionCommon` (
`truckFk` tinyint NOT NULL,
- `etd` tinyint NOT NULL,
+ `eta` tinyint NOT NULL,
`description` tinyint NOT NULL,
`palletFk` tinyint NOT NULL,
`routeFk` tinyint NOT NULL,
@@ -28678,13 +28660,13 @@ CREATE TABLE `expeditionTruck` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roadmapFk` int(10) unsigned DEFAULT NULL,
`warehouseFk` smallint(6) unsigned DEFAULT NULL,
- `ETD` datetime DEFAULT NULL,
+ `eta` datetime DEFAULT NULL COMMENT 'Estimated time of arrival',
`description` varchar(45) NOT NULL,
`bufferFk` int(11) DEFAULT NULL COMMENT 'buffer destino de las cajas',
`created` timestamp NULL DEFAULT current_timestamp(),
`userFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `expeditionTruck_idx1` (`ETD`),
+ KEY `expeditionTruck_idx1` (`eta`),
KEY `expeditionTruck_FK` (`bufferFk`),
KEY `expeditionTruck_FK_1` (`warehouseFk`),
KEY `expeditionTruck_FK_2` (`roadmapFk`),
@@ -28772,7 +28754,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `expeditionTruck_Control_Detail` (
`id` tinyint NOT NULL,
- `ETD` tinyint NOT NULL,
+ `eta` tinyint NOT NULL,
`destino` tinyint NOT NULL,
`pallet` tinyint NOT NULL,
`routes` tinyint NOT NULL,
@@ -28793,7 +28775,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `expeditionTruck_Control_Detail_Pallet` (
`id` tinyint NOT NULL,
- `ETD` tinyint NOT NULL,
+ `eta` tinyint NOT NULL,
`destino` tinyint NOT NULL,
`pallet` tinyint NOT NULL,
`route` tinyint NOT NULL,
@@ -28816,13 +28798,12 @@ CREATE TABLE `expence` (
`id` varchar(10) NOT NULL,
`name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
`isWithheld` tinyint(4) NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`)
+ `code` varchar(25) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `expence_UN` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-ALTER TABLE `vn`.`expence`
- ADD code VARCHAR(25) DEFAULT NULL NULL;
-ALTER TABLE `vn`.`expence`
- ADD CONSTRAINT expence_UN UNIQUE KEY IF NOT EXISTS (code);
+
--
-- Table structure for table `farming`
--
@@ -28833,18 +28814,18 @@ DROP TABLE IF EXISTS `farming`;
CREATE TABLE `farming` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
- `location` varchar(255) NOT NULL,
- `warehouseFk` smallint(6) unsigned NOT NULL,
+ `location` varchar(255) DEFAULT NULL,
+ `warehouseFk` smallint(6) unsigned DEFAULT NULL,
`description` text DEFAULT NULL,
`photo` blob DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT 1,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
- `companyFk` smallint(5) unsigned DEFAULT NULL,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
PRIMARY KEY (`id`),
KEY `farming_FK` (`warehouseFk`),
- KEY `farming_FK_1` (`companyFk`),
- CONSTRAINT `farming_FK` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `farming_FK_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`)
+ KEY `farmingCompany_Fk` (`companyFk`),
+ CONSTRAINT `farmingCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`),
+ CONSTRAINT `farming_FK` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -29281,7 +29262,7 @@ CREATE TABLE `host` (
`windowsSerial` varchar(40) DEFAULT NULL,
`printerFk` tinyint(3) unsigned DEFAULT NULL,
`warehouseFk` smallint(5) unsigned DEFAULT 60,
- `companyFk` smallint(5) unsigned DEFAULT 442,
+ `companyFk` int(10) unsigned DEFAULT 442,
`bankFk` int(11) DEFAULT 13,
`routeDaysBefore` smallint(6) DEFAULT 2,
`routeDaysAfter` smallint(6) DEFAULT 1,
@@ -29295,9 +29276,9 @@ CREATE TABLE `host` (
KEY `configHost_FK_5` (`workerFk`),
CONSTRAINT `configHost_FK` FOREIGN KEY (`printerFk`) REFERENCES `printer` (`id`) ON UPDATE CASCADE,
CONSTRAINT `configHost_FK_2` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `configHost_FK_3` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `configHost_FK_4` FOREIGN KEY (`bankFk`) REFERENCES `accounting` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `configHost_FK_5` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`)
+ CONSTRAINT `configHost_FK_5` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`),
+ CONSTRAINT `hostCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -29556,13 +29537,13 @@ CREATE TABLE `invoiceIn` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`serialNumber` mediumint(11) unsigned DEFAULT NULL COMMENT 'insertado por Trigger',
`serial` char(1) NOT NULL DEFAULT 'R',
- `supplierFk` int(11) NOT NULL,
+ `supplierFk` int(10) unsigned NOT NULL,
`issued` date DEFAULT NULL COMMENT 'Fecha de emision de la factura',
`supplierRef` varchar(50) DEFAULT NULL,
`isBooked` tinyint(1) NOT NULL DEFAULT 0,
`currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 1,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`docFk` int(11) DEFAULT NULL,
`booked` date DEFAULT NULL COMMENT 'Fecha de contabilizacion',
`operated` date DEFAULT NULL COMMENT 'Fecha de entrega de la mercancia o el suministro',
@@ -29591,15 +29572,15 @@ CREATE TABLE `invoiceIn` (
KEY `invoiceIn_withholdingFk_idx` (`withholdingSageFk`),
KEY `invoiceIn_expenceFkDeductible_idx` (`expenceFkDeductible`),
KEY `invoiceIn_fk_editor` (`editorFk`),
+ CONSTRAINT `invoiceInCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_expenceFkDeductible` FOREIGN KEY (`expenceFkDeductible`) REFERENCES `expence` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
- CONSTRAINT `invoiceIn_ibfk_1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `invoiceIn_ibfk_2` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_ibfk_3` FOREIGN KEY (`cplusSubjectOpFk`) REFERENCES `cplusSubjectOp` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_ibfk_4` FOREIGN KEY (`cplusTaxBreakFk`) REFERENCES `cplusTaxBreak` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_ibfk_5` FOREIGN KEY (`cplusInvoiceType472Fk`) REFERENCES `cplusInvoiceType472` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_ibfk_6` FOREIGN KEY (`cplusRectificationTypeFk`) REFERENCES `cplusRectificationType` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_ibfk_7` FOREIGN KEY (`cplusTrascendency472Fk`) REFERENCES `cplusTrascendency472` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `invoiceIn_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceIn_withholdingFk` FOREIGN KEY (`withholdingSageFk`) REFERENCES `sage`.`TiposRetencion` (`CodigoRetencion`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -29661,14 +29642,6 @@ BEGIN
SET NEW.serial = IFNULL(vSerie,'R');
- IF vSerie LIKE 'W' THEN
- SELECT IFNULL(MAX(serialNumber) + 1,1) INTO vNumReceived
- FROM invoiceIn
- WHERE `serial` LIKE NEW.serial AND
- YEAR(issued) = YEAR(NEW.issued) AND
- companyFk = NEW.companyFk;
- SET NEW.serialNumber = vNumReceived;
- END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -29941,17 +29914,18 @@ CREATE TABLE `invoiceInLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('InvoiceIn','invoiceInTax') NOT NULL DEFAULT 'InvoiceIn',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `invoiceInLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `invoiceInLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `invoiceInLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `invoiceInLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -30147,7 +30121,7 @@ CREATE TABLE `invoiceOut` (
`bankFk` int(11) DEFAULT NULL,
`clientFk` int(11) DEFAULT 0,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`hasPdf` tinyint(3) unsigned NOT NULL DEFAULT 0,
`booked` date DEFAULT NULL,
`cplusInvoiceType477Fk` int(10) unsigned NOT NULL DEFAULT 1,
@@ -30166,7 +30140,6 @@ CREATE TABLE `invoiceOut` (
KEY `Facturas_ibfk_5_idx` (`cplusTrascendency477Fk`),
KEY `Facturas_idx_Vencimiento` (`dued`),
KEY `invoiceOut_serial` (`serial`),
- CONSTRAINT `invoiceOut_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceOut_ibfk_2` FOREIGN KEY (`cplusInvoiceType477Fk`) REFERENCES `cplusInvoiceType477` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceOut_ibfk_3` FOREIGN KEY (`cplusSubjectOpFk`) REFERENCES `cplusSubjectOp` (`id`) ON UPDATE CASCADE,
CONSTRAINT `invoiceOut_ibfk_4` FOREIGN KEY (`cplusTaxBreakFk`) REFERENCES `cplusTaxBreak` (`id`) ON UPDATE CASCADE,
@@ -30397,7 +30370,7 @@ CREATE TABLE `item` (
`intrastatFk` int(8) unsigned zerofill NOT NULL DEFAULT 06039010,
`hasMinPrice` tinyint(1) NOT NULL DEFAULT 0,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
- `comment` varchar(150) DEFAULT NULL,
+ `comment` varchar(150) DEFAULT NULL COMMENT 'referencia del proveedor',
`typeFk` smallint(5) unsigned NOT NULL,
`generic` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
`producerFk` mediumint(3) unsigned DEFAULT NULL,
@@ -30516,8 +30489,7 @@ BEGIN
INSERT INTO vn.itemTaxCountry(itemFk, countryFk) VALUES
(NEW.id, 1),
- (NEW.id, 5),
- (NEW.id, 30);
+ (NEW.id, 5);
DELETE ifr.*
FROM edi.item_free ifr
@@ -31138,19 +31110,18 @@ CREATE TABLE `itemLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Item','ItemBarcode','ItemBotanical','ItemNiche','ItemTag','ItemTaxCountry') NOT NULL DEFAULT 'Item',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `itemLogItemFk_idx` (`originFk`),
KEY `itemLogUserFk_idx` (`userFk`),
- KEY `itemLog_changedModel_idx` (`changedModel`,`changedModelId`) USING BTREE,
KEY `itemLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `itemLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `itemLogItemFk` FOREIGN KEY (`originFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `itemLogUserFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -31989,26 +31960,6 @@ 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`.`supplierAccount_beforeInsert`
- BEFORE INSERT ON `itemTaxCountry`
- FOR EACH ROW
-BEGIN
- SET NEW.editorFk = account.myUser_getId();
-END */;;
-DELIMITER ;
-/*!50003 SET sql_mode = @saved_sql_mode */ ;
-/*!50003 SET character_set_client = @saved_cs_client */ ;
-/*!50003 SET character_set_results = @saved_cs_results */ ;
-/*!50003 SET collation_connection = @saved_col_connection */ ;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemTaxCountry_beforeUpdate`
BEFORE UPDATE ON `itemTaxCountry`
FOR EACH ROW
@@ -32029,26 +31980,6 @@ 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`.`supplierAccount_beforeUpdate`
- BEFORE UPDATE ON `itemTaxCountry`
- FOR EACH ROW
-BEGIN
- SET NEW.editorFk = account.myUser_getId();
-END */;;
-DELIMITER ;
-/*!50003 SET sql_mode = @saved_sql_mode */ ;
-/*!50003 SET character_set_client = @saved_cs_client */ ;
-/*!50003 SET character_set_results = @saved_cs_results */ ;
-/*!50003 SET collation_connection = @saved_col_connection */ ;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemTaxCountry_afterDelete`
AFTER DELETE ON `itemTaxCountry`
FOR EACH ROW
@@ -32407,16 +32338,16 @@ CREATE TABLE `machine` (
`workerFk` int(10) unsigned DEFAULT NULL,
`companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
`ppeFk` int(11) DEFAULT NULL,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `plate` (`plate`),
UNIQUE KEY `serialNumber` (`serialNumber`),
KEY `machine_FK` (`ppeFk`),
- KEY `machine_FK_2` (`supplierFk`),
KEY `machine_FK_1` (`workerFk`),
+ KEY `machine_supplierFk` (`supplierFk`),
CONSTRAINT `machine_FK` FOREIGN KEY (`ppeFk`) REFERENCES `ppe` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `machine_FK_1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `machine_FK_2` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
+ CONSTRAINT `machine_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Maquinaria industrial, vehículos y demás elementos amortizables';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -32603,7 +32534,7 @@ DROP TABLE IF EXISTS `mandate`;
CREATE TABLE `mandate` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`clientFk` int(11) NOT NULL,
- `companyFk` smallint(5) unsigned NOT NULL,
+ `companyFk` int(10) unsigned NOT NULL,
`code` varchar(32) DEFAULT NULL,
`created` timestamp NULL DEFAULT current_timestamp(),
`finished` timestamp NULL DEFAULT NULL,
@@ -32612,8 +32543,8 @@ CREATE TABLE `mandate` (
KEY `mandato_fgkey1_idx` (`clientFk`),
KEY `mandato_fgkey2_idx` (`companyFk`),
KEY `mandato_fgkey3_idx` (`mandateTypeFk`),
+ CONSTRAINT `mandateCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT `mandato_fgkey1` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
- CONSTRAINT `mandato_fgkey2` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT `mandato_fgkey3` FOREIGN KEY (`mandateTypeFk`) REFERENCES `mandateType` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -33684,7 +33615,7 @@ DROP TABLE IF EXISTS `payment`;
CREATE TABLE `payment` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`received` date NOT NULL,
- `supplierFk` int(11) NOT NULL,
+ `supplierFk` int(10) unsigned NOT NULL,
`amount` decimal(10,2) NOT NULL DEFAULT 0.00,
`currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 1,
`divisa` decimal(10,2) DEFAULT NULL,
@@ -33692,7 +33623,7 @@ CREATE TABLE `payment` (
`payMethodFk` tinyint(3) unsigned NOT NULL,
`bankingFees` double(6,2) unsigned NOT NULL DEFAULT 0.00,
`concept` varchar(30) DEFAULT NULL,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`isConciliated` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
`dueDated` date DEFAULT NULL,
@@ -33703,14 +33634,14 @@ CREATE TABLE `payment` (
KEY `id_moneda` (`currencyFk`),
KEY `pay_met` (`payMethodFk`),
KEY `pagoDueDatedIdx` (`dueDated`),
- KEY `pago_ibfk_3` (`supplierFk`),
KEY `payment_FK` (`workerFk`),
- CONSTRAINT `pago_ibfk_3` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
+ KEY `payment_supplierFk` (`supplierFk`),
CONSTRAINT `pago_moneda_1` FOREIGN KEY (`currencyFk`) REFERENCES `currency` (`id`) ON UPDATE CASCADE,
CONSTRAINT `pago_pay_met` FOREIGN KEY (`payMethodFk`) REFERENCES `payMethod` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `paymentCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `payment_FK` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`),
- CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `payment_ibfk_2` FOREIGN KEY (`bankFk`) REFERENCES `accounting` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `payment_ibfk_2` FOREIGN KEY (`bankFk`) REFERENCES `accounting` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `payment_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -34238,7 +34169,7 @@ CREATE TABLE `ppe` (
`photo` blob DEFAULT NULL,
`isInvestmentAsset` tinyint(4) NOT NULL DEFAULT 0,
`workerFk` int(10) unsigned DEFAULT NULL,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`description` varchar(45) DEFAULT NULL,
`isDone` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
@@ -34250,11 +34181,11 @@ CREATE TABLE `ppe` (
KEY `ppe_fk6` (`endowment`),
KEY `ppe_fk7` (`elementAccount`),
KEY `ppe_FK` (`location`),
+ CONSTRAINT `ppeCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ppe_FK` FOREIGN KEY (`location`) REFERENCES `ppeLocation` (`code`) ON UPDATE CASCADE,
CONSTRAINT `ppe_fk1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `ppe_fk2` FOREIGN KEY (`planFk`) REFERENCES `ppePlan` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ppe_fk3` FOREIGN KEY (`groupFk`) REFERENCES `ppeGroup` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
- CONSTRAINT `ppe_fk4` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ppe_fk5` FOREIGN KEY (`account`) REFERENCES `pgcMaster` (`code`) ON UPDATE CASCADE,
CONSTRAINT `ppe_fk6` FOREIGN KEY (`endowment`) REFERENCES `pgcMaster` (`code`) ON UPDATE CASCADE,
CONSTRAINT `ppe_fk7` FOREIGN KEY (`elementAccount`) REFERENCES `pgcMaster` (`code`) ON UPDATE CASCADE
@@ -34674,18 +34605,18 @@ CREATE TABLE `project` (
`finished` date DEFAULT NULL,
`userFk` int(11) unsigned NOT NULL,
`departmentFk` int(11) DEFAULT NULL,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`location` varchar(100) DEFAULT NULL,
`amount` decimal(15,2) DEFAULT NULL,
`stateFk` varchar(25) DEFAULT 'open',
PRIMARY KEY (`id`),
KEY `project_FK` (`userFk`),
KEY `project_FK_1` (`departmentFk`),
- KEY `project_FK_2` (`companyFk`),
KEY `project_FK_3` (`stateFk`),
+ KEY `projectCompany_Fk` (`companyFk`),
+ CONSTRAINT `projectCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `project_FK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `project_FK_1` FOREIGN KEY (`departmentFk`) REFERENCES `department` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `project_FK_2` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `project_FK_3` FOREIGN KEY (`stateFk`) REFERENCES `projectState` (`code`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Tabla master de proyectos';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -34773,7 +34704,7 @@ CREATE TABLE `property` (
`registration` int(11) DEFAULT NULL,
`value` int(11) DEFAULT NULL,
`propertyGroupFk` int(11) NOT NULL,
- `companyFk` smallint(5) unsigned NOT NULL,
+ `companyFk` int(10) unsigned NOT NULL,
`photo` blob DEFAULT NULL,
`allocation` varchar(200) DEFAULT NULL,
`m2` decimal(10,2) DEFAULT NULL,
@@ -34786,9 +34717,9 @@ CREATE TABLE `property` (
KEY `property_FK` (`propertyGroupFk`),
KEY `property_FK_1` (`townFk`),
KEY `property_company` (`companyFk`),
+ CONSTRAINT `propertyCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `property_FK` FOREIGN KEY (`propertyGroupFk`) REFERENCES `propertyGroup` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `property_FK_1` FOREIGN KEY (`townFk`) REFERENCES `town` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `property_company` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `property_FK_1` FOREIGN KEY (`townFk`) REFERENCES `town` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -35069,7 +35000,7 @@ CREATE TABLE `receipt` (
`bankFk` int(11) DEFAULT 0,
`clientFk` int(11) DEFAULT 0,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`isConciliate` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
PRIMARY KEY (`Id`),
KEY `Id_Banco` (`bankFk`),
@@ -35078,8 +35009,8 @@ CREATE TABLE `receipt` (
KEY `clientDate` (`clientFk`,`payed`),
KEY `id_factura` (`invoiceFk`),
KEY `payed` (`payed`),
+ CONSTRAINT `receiptCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `receiptWorkerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `receipt_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `receipt_ibfk_2` FOREIGN KEY (`bankFk`) REFERENCES `accounting` (`id`) ON UPDATE CASCADE,
CONSTRAINT `recibo_customer_id` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
@@ -35426,16 +35357,16 @@ CREATE TABLE `roadmap` (
`tractorPlate` varchar(10) DEFAULT NULL,
`trailerPlate` varchar(12) DEFAULT NULL,
`phone` varchar(15) DEFAULT NULL,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
`etd` datetime DEFAULT NULL,
`observations` varchar(255) DEFAULT NULL,
`created` timestamp NULL DEFAULT current_timestamp(),
`userFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `supplierFk` (`supplierFk`),
KEY `userFk` (`userFk`),
- CONSTRAINT `roadmap_ibfk_1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `roadmap_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE
+ KEY `roadmap_supplierFk` (`supplierFk`),
+ CONSTRAINT `roadmap_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `roadmap_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -35748,7 +35679,7 @@ CREATE TABLE `routeConfig` (
`distributionM3Category2` decimal(5,2) DEFAULT NULL,
`plusCategory1Concept` varchar(45) DEFAULT NULL,
`plusCategory2Concept` varchar(45) DEFAULT NULL,
- `defaultCompanyFk` smallint(5) unsigned DEFAULT 442,
+ `defaultCompanyFk` int(10) unsigned DEFAULT 442,
`kmHeavy` decimal(5,2) DEFAULT NULL COMMENT 'Comisión por kilometro vehículo pesado',
`kmLight` decimal(5,2) DEFAULT NULL COMMENT 'Comisión por kilometro vehículo ligero',
`kmYearly` decimal(5,2) DEFAULT NULL COMMENT 'Comisión por kilometro objetivo anual',
@@ -35771,8 +35702,8 @@ CREATE TABLE `routeConfig` (
`kmMax` int(11) DEFAULT 4000 COMMENT 'Máximo número de km validos para una ruta',
`truckerBusinessProfessionalCategoryFk` int(11) NOT NULL DEFAULT 42,
PRIMARY KEY (`id`),
- KEY `routeConfig_FK` (`defaultCompanyFk`),
- CONSTRAINT `routeConfig_FK` FOREIGN KEY (`defaultCompanyFk`) REFERENCES `company` (`id`)
+ KEY `routeConfigCompany_Fk` (`defaultCompanyFk`),
+ CONSTRAINT `routeConfigCompany_Fk` FOREIGN KEY (`defaultCompanyFk`) REFERENCES `company` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -35805,17 +35736,18 @@ CREATE TABLE `routeLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Route') NOT NULL DEFAULT 'Route',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `routeLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `routeLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `routeLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `route` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `routeLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -35928,7 +35860,7 @@ SET character_set_client = utf8;
`description` tinyint NOT NULL,
`name` tinyint NOT NULL,
`routeFk` tinyint NOT NULL,
- `ETD` tinyint NOT NULL,
+ `eta` tinyint NOT NULL,
`bufferFk` tinyint NOT NULL,
`beachFk` tinyint NOT NULL,
`itempackingTypeFk` tinyint NOT NULL
@@ -36825,15 +36757,17 @@ CREATE TABLE `sector` (
`isMain` tinyint(1) NOT NULL DEFAULT 0,
`itemPackingTypeFk` varchar(1) DEFAULT NULL,
`workerFk` int(11) DEFAULT NULL,
- `printerFk` tinyint(3) unsigned DEFAULT NULL,
`isHideForPickers` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'sector a ocultar a los sacadores',
`isReserve` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Sectores de reserva, como Albenfruit o Fuentes',
+ `mainPrinterFk` tinyint(3) unsigned DEFAULT NULL,
PRIMARY KEY (`id`,`warehouseFk`),
UNIQUE KEY `code_UNIQUE` (`code`),
KEY `sector_fk1_idx` (`warehouseFk`),
KEY `sector_report` (`reportFk`),
KEY `sector_FK` (`sonFk`,`warehouseFk`),
+ KEY `sector_FK_1` (`mainPrinterFk`),
CONSTRAINT `sector_FK` FOREIGN KEY (`sonFk`, `warehouseFk`) REFERENCES `sector` (`id`, `warehouseFk`) ON UPDATE CASCADE,
+ CONSTRAINT `sector_FK_1` FOREIGN KEY (`mainPrinterFk`) REFERENCES `printer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `sector_fk1` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `sector_report` FOREIGN KEY (`reportFk`) REFERENCES `report` (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
@@ -37255,16 +37189,18 @@ CREATE TABLE `shelvingLog` (
`action` set('insert','update','delete','select') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Shelving') NOT NULL DEFAULT 'Shelving',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `userFk` (`userFk`),
- KEY `originFk` (`originFk`),
+ KEY `shelvingLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `shelvingLog_originFk` (`originFk`,`creationDate`),
+ CONSTRAINT `shelvingLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `shelving` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `shelvingLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -37293,23 +37229,23 @@ DROP TABLE IF EXISTS `sinister`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sinister` (
`id` int(11) NOT NULL,
- `supplierFk` int(11) NOT NULL,
+ `supplierFk` int(10) unsigned NOT NULL,
`clientFk` int(11) NOT NULL,
`amount` decimal(10,2) NOT NULL,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
`insureRate` decimal(3,2) NOT NULL DEFAULT 0.75,
`isBooked` tinyint(4) NOT NULL DEFAULT 0,
`workerFk` int(10) unsigned NOT NULL,
- `companyFk` smallint(5) unsigned NOT NULL,
+ `companyFk` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `sinister_fk1_idx` (`supplierFk`),
KEY `sinister_fk2_idx` (`clientFk`),
KEY `sinister_fk3_idx` (`workerFk`),
KEY `sinister_fk4_idx` (`companyFk`),
- CONSTRAINT `sinister_fk1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `sinisterCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `sinister_fk2` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `sinister_fk3` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `sinister_fk4` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+ CONSTRAINT `sinister_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Impago de cliente asegurado';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -37768,7 +37704,7 @@ DROP TABLE IF EXISTS `supplier`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `supplier` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
`account` varchar(10) DEFAULT NULL,
`street` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
@@ -37937,7 +37873,7 @@ DROP TABLE IF EXISTS `supplierAccount`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `supplierAccount` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
`iban` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`office` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`DC` varchar(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
@@ -37952,9 +37888,9 @@ CREATE TABLE `supplierAccount` (
KEY `fk_Proveedores_account_entity1_idx` (`bankEntityFk`),
KEY `fk_banco_prov_account_idx` (`accountingFk`),
KEY `supplierAccount_fk_editor` (`editorFk`),
- CONSTRAINT `supplierAccount_FK` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
CONSTRAINT `supplierAccount_FK_1` FOREIGN KEY (`bankEntityFk`) REFERENCES `bankEntity` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `supplierAccount_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`)
+ CONSTRAINT `supplierAccount_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
+ CONSTRAINT `supplierAccount_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -37966,6 +37902,46 @@ CREATE TABLE `supplierAccount` (
/*!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`.`supplierAccount_beforeInsert`
+ BEFORE INSERT ON `supplierAccount`
+ FOR EACH ROW
+BEGIN
+ SET NEW.editorFk = account.myUser_getId();
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierAccount_beforeUpdate`
+ BEFORE UPDATE ON `supplierAccount`
+ FOR EACH ROW
+BEGIN
+ SET NEW.editorFk = account.myUser_getId();
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierAccount_afterDelete`
AFTER DELETE ON `supplierAccount`
FOR EACH ROW
@@ -38095,7 +38071,7 @@ DROP TABLE IF EXISTS `supplierAgencyTerm`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `supplierAgencyTerm` (
`agencyFk` smallint(5) unsigned NOT NULL,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
`minimumPackages` int(11) NOT NULL DEFAULT 0 COMMENT 'numero minimo de bultos',
`kmPrice` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'precio extra por km',
`packagePrice` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'precio extra por bulto',
@@ -38104,9 +38080,9 @@ CREATE TABLE `supplierAgencyTerm` (
`minimumM3` decimal(10,2) NOT NULL DEFAULT 0.00,
`m3Price` decimal(10,2) NOT NULL DEFAULT 0.00,
PRIMARY KEY (`agencyFk`),
- KEY `agencyTerm_FK_1` (`supplierFk`),
+ KEY `supplierAgencyTerm_supplierFk` (`supplierFk`),
CONSTRAINT `agencyTerm_FK` FOREIGN KEY (`agencyFk`) REFERENCES `agency` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `agencyTerm_FK_1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `supplierAgencyTerm_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -38119,7 +38095,7 @@ DROP TABLE IF EXISTS `supplierContact`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `supplierContact` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
`phone` varchar(16) DEFAULT NULL,
`mobile` varchar(16) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
@@ -38127,12 +38103,76 @@ CREATE TABLE `supplierContact` (
`name` varchar(255) DEFAULT NULL,
`editorFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `supplier_id` (`supplierFk`),
KEY `supplierContact_fk_editor` (`editorFk`),
+ KEY `supplierContact_supplierFk` (`supplierFk`),
CONSTRAINT `supplierContact_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
- CONSTRAINT `supplier_id` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+ CONSTRAINT `supplierContact_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierContact_beforeInsert`
+ BEFORE INSERT ON `supplierContact`
+ FOR EACH ROW
+BEGIN
+ SET NEW.editorFk = account.myUser_getId();
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierContact_beforeUpdate`
+ BEFORE UPDATE ON `supplierContact`
+ FOR EACH ROW
+BEGIN
+ SET NEW.editorFk = account.myUser_getId();
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierContact_afterDelete`
+ AFTER DELETE ON `supplierContact`
+ FOR EACH ROW
+BEGIN
+ INSERT INTO supplierLog
+ SET `action` = 'delete',
+ `changedModel` = 'SupplierContact',
+ `changedModelId` = OLD.id,
+ `userFk` = account.myUser_getId();
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
--
-- Table structure for table `supplierDebtConfig`
@@ -38157,11 +38197,11 @@ DROP TABLE IF EXISTS `supplierExpense`;
CREATE TABLE `supplierExpense` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`dated` date NOT NULL,
- `supplierFk` int(11) NOT NULL,
+ `supplierFk` int(10) unsigned NOT NULL,
`currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 2,
`amount` decimal(10,2) NOT NULL DEFAULT 0.00,
`description` varchar(50) DEFAULT NULL,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`dmsFk` int(11) DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`isConciliated` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
@@ -38174,9 +38214,9 @@ CREATE TABLE `supplierExpense` (
KEY `gestdoc_id` (`dmsFk`),
KEY `dueDatedIdx` (`dueDated`),
CONSTRAINT `gestdoc_fk` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `pago_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `pago_moneda` FOREIGN KEY (`currencyFk`) REFERENCES `currency` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `proveedor_pago` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `supplierExpenseCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `supplierExpense_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -38189,22 +38229,23 @@ DROP TABLE IF EXISTS `supplierLog`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `supplierLog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `originFk` int(11) DEFAULT NULL,
+ `originFk` int(10) unsigned DEFAULT NULL,
`userFk` int(10) unsigned DEFAULT NULL,
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Supplier','SupplierAddress','SupplierAccount','SupplierContact') NOT NULL DEFAULT 'Supplier',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `logSupplier_ibfk_1` (`originFk`),
KEY `supplierLog_ibfk_2` (`userFk`),
- CONSTRAINT `supplierLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `supplierLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+ KEY `supplierLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `supplierLog_originFk` (`originFk`,`creationDate`),
+ CONSTRAINT `supplierLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `supplierLog_supplierFk` FOREIGN KEY (`originFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -38494,7 +38535,7 @@ DROP TABLE IF EXISTS `ticket`;
CREATE TABLE `ticket` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`clientFk` int(11) NOT NULL DEFAULT 0,
- `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1,
+ `warehouseFk` smallint(6) unsigned DEFAULT NULL,
`shipped` datetime NOT NULL,
`nickname` varchar(50) DEFAULT NULL,
`refFk` varchar(20) DEFAULT NULL,
@@ -38513,7 +38554,7 @@ CREATE TABLE `ticket` (
`routeFk` int(10) unsigned DEFAULT NULL,
`priority` tinyint(3) unsigned DEFAULT NULL,
`hasPriority` tinyint(1) unsigned NOT NULL DEFAULT 1,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned NOT NULL DEFAULT 442,
`agencyModeFk` int(11) DEFAULT NULL,
`landed` date DEFAULT NULL,
`isBoxed` tinyint(2) NOT NULL DEFAULT 0,
@@ -38539,11 +38580,11 @@ CREATE TABLE `ticket` (
KEY `Fecha` (`shipped`,`clientFk`),
KEY `tickets_zone_fk_idx` (`zoneFk`),
KEY `ticket_fk_editor` (`editorFk`),
+ CONSTRAINT `ticketCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ticket_FK` FOREIGN KEY (`refFk`) REFERENCES `invoiceOut` (`ref`) ON UPDATE CASCADE,
CONSTRAINT `ticket_customer_id` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ticket_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
CONSTRAINT `ticket_ibfk_1` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `ticket_ibfk_5` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ticket_ibfk_6` FOREIGN KEY (`addressFk`) REFERENCES `address` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ticket_ibfk_8` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`),
CONSTRAINT `ticket_ibfk_9` FOREIGN KEY (`routeFk`) REFERENCES `route` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
@@ -38686,14 +38727,6 @@ BEGIN
IF vNewTime THEN
SET NEW.shipped = TIMESTAMP(DATE(NEW.shipped), vNewTime);
- INSERT INTO vn.ticketLog
- SET originFk = NEW.id,
- userFk = account.myUser_getId(),
- `action` = 'update',
- description = CONCAT('Cambia la hora por cambio de ruta de ',
- TIME(OLD.shipped),
- ' a ',
- TIME(NEW.shipped));
END IF;
INSERT IGNORE INTO zoneAgencyMode (agencyModeFk,zoneFk)
SELECT r.agencyModeFk, NEW.zoneFk FROM route r
@@ -39110,19 +39143,18 @@ CREATE TABLE `ticketLog` (
`action` set('insert','update','delete','select') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Ticket','Sale','TicketWeekly','TicketTracking','TicketService','TicketRequest','TicketRefund','TicketPackaging','TicketObservation','TicketDms','Expedition','Sms') NOT NULL DEFAULT 'Ticket',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `logTicketoriginFk` (`originFk`),
KEY `logTicketuserFk` (`userFk`),
- KEY `ticketLog_creationDate_IDX` (`creationDate`) USING BTREE,
KEY `ticketLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `ticketLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `ticketLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ticketLog_user` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -39505,8 +39537,8 @@ CREATE TABLE `ticketRefund` (
`originalTicketFk` int(11) NOT NULL,
`editorFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
+ UNIQUE KEY `ticketRefund_UN` (`refundTicketFk`),
KEY `ticketRefund_FK_1` (`originalTicketFk`),
- KEY `ticketRefund_FK` (`refundTicketFk`),
KEY `ticketRefund_fk_editor` (`editorFk`),
CONSTRAINT `ticketRefund_FK` FOREIGN KEY (`refundTicketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ticketRefund_FK_1` FOREIGN KEY (`originalTicketFk`) REFERENCES `ticket` (`id`) ON UPDATE CASCADE,
@@ -39959,6 +39991,7 @@ CREATE TABLE `ticketTracking` (
KEY `inter_state` (`stateFk`),
KEY `inter_id` (`ticketFk`,`id`) USING BTREE,
KEY `ticketTracking_fk_editor` (`editorFk`),
+ KEY `ticketTracking_created_IDX` (`created`) USING BTREE,
CONSTRAINT `inter_state` FOREIGN KEY (`stateFk`) REFERENCES `state` (`id`) ON UPDATE CASCADE,
CONSTRAINT `responsable` FOREIGN KEY (`supervisorFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE,
CONSTRAINT `ticketTracking_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
@@ -40715,6 +40748,8 @@ BEGIN
IF NEW.agencyModeFk THEN
SET NEW.agencyFk = NEW.agencyModeFk;
END IF;
+
+ CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -40754,6 +40789,7 @@ BEGIN
CALL travel_checkPackaging(NEW.id);
END IF;
+ CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -40828,20 +40864,20 @@ CREATE TABLE `travelClonedWeekly` (
`weekDay` tinyint(3) unsigned NOT NULL,
`duration` tinyint(3) unsigned NOT NULL,
`ref` varchar(50) NOT NULL,
- `supplierFk` int(11) DEFAULT NULL,
+ `supplierFk` int(10) unsigned DEFAULT NULL,
`kg` decimal(10,0) unsigned DEFAULT NULL,
`travelFk` int(11) unsigned DEFAULT NULL COMMENT 'Travel origen para clonar ademas sus entradas',
PRIMARY KEY (`id`),
KEY `travelClonedWeekly_FK` (`warehouseOutFk`),
KEY `travelClonedWeekly_FK_1` (`warehouseInFk`),
KEY `travelClonedWeekly_FK_2` (`agencyModeFk`),
- KEY `travelClonedWeekly_FK_3` (`supplierFk`),
KEY `travelClonedWeekly_FK_4` (`travelFk`),
+ KEY `travelClonedWeekly_supplierFk` (`supplierFk`),
CONSTRAINT `travelClonedWeekly_FK` FOREIGN KEY (`warehouseOutFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE,
CONSTRAINT `travelClonedWeekly_FK_1` FOREIGN KEY (`warehouseInFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE,
CONSTRAINT `travelClonedWeekly_FK_2` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `travelClonedWeekly_FK_3` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
- CONSTRAINT `travelClonedWeekly_FK_4` FOREIGN KEY (`travelFk`) REFERENCES `travel` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `travelClonedWeekly_FK_4` FOREIGN KEY (`travelFk`) REFERENCES `travel` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `travelClonedWeekly_supplierFk` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -40859,17 +40895,18 @@ CREATE TABLE `travelLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Travel','TravelThermograph') NOT NULL DEFAULT 'Travel',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `travelLog_changedModel` (`changedModel`,`changedModelId`,`originFk`),
+ KEY `travelLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `travelLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `travel` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `travelLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -41058,7 +41095,7 @@ CREATE TABLE `userLog` (
KEY `userFk` (`userFk`),
CONSTRAINT `userLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `userLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -41104,10 +41141,10 @@ DROP TABLE IF EXISTS `vehicle`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `numberPlate` varchar(10) NOT NULL,
+ `numberPlate` varchar(10) DEFAULT NULL,
`model` varchar(20) NOT NULL,
`tradeMark` varchar(20) NOT NULL,
- `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442,
+ `companyFk` int(10) unsigned DEFAULT 442,
`m3` double DEFAULT NULL,
`isActive` tinyint(4) NOT NULL DEFAULT 1,
`warehouseFk` smallint(6) unsigned DEFAULT NULL,
@@ -41118,6 +41155,8 @@ CREATE TABLE `vehicle` (
`chassis` varchar(100) DEFAULT NULL COMMENT 'numero de bastidor',
`fuelTypeFk` int(11) DEFAULT NULL,
`ppeFk` int(11) DEFAULT NULL,
+ `countryCodeFk` varchar(2) DEFAULT 'ES',
+ `leasing` varchar(50) DEFAULT NULL COMMENT 'Id de arrendamiento',
PRIMARY KEY (`id`),
KEY `empresa_id` (`companyFk`),
KEY `provinceFk_idx` (`warehouseFk`),
@@ -41125,12 +41164,52 @@ CREATE TABLE `vehicle` (
KEY `vehicle_FK` (`fuelTypeFk`),
KEY `vehicle_FK_1` (`ppeFk`),
CONSTRAINT `provinceFk` FOREIGN KEY (`warehouseFk`) REFERENCES `province` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT `vehicleCompany_Fk` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
CONSTRAINT `vehicle_FK` FOREIGN KEY (`fuelTypeFk`) REFERENCES `fuelType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `vehicle_FK_1` FOREIGN KEY (`ppeFk`) REFERENCES `ppe` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
- CONSTRAINT `vehicle_deliveryPointFk` FOREIGN KEY (`deliveryPointFk`) REFERENCES `deliveryPoint` (`id`) ON UPDATE CASCADE,
- CONSTRAINT `vehicle_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
+ CONSTRAINT `vehicle_deliveryPointFk` FOREIGN KEY (`deliveryPointFk`) REFERENCES `deliveryPoint` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`vehicle_beforeInsert`
+ BEFORE INSERT ON `vehicle`
+ FOR EACH ROW
+BEGIN
+ CALL vehicle_checkNumberPlate(NEW.numberPlate, NEW.countryCodeFk);
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`vehicle_beforeUpdate`
+ BEFORE UPDATE ON `vehicle`
+ FOR EACH ROW
+BEGIN
+ CALL vehicle_checkNumberPlate(NEW.numberPlate, NEW.countryCodeFk);
+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 */ ;
--
-- Table structure for table `vehicleConfig`
@@ -41228,6 +41307,20 @@ CREATE TABLE `vehicleNotes` (
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `vehiclePlateRegex`
+--
+
+DROP TABLE IF EXISTS `vehiclePlateRegex`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `vehiclePlateRegex` (
+ `countryCodeFk` varchar(2) NOT NULL,
+ `regex` varchar(45) NOT NULL,
+ PRIMARY KEY (`countryCodeFk`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Table structure for table `vehicleState`
--
@@ -41279,7 +41372,9 @@ CREATE TABLE `wagon` (
`plate` varchar(10) NOT NULL COMMENT 'Matrícula',
`typeFk` int(11) unsigned NOT NULL,
`label` int(11) unsigned NOT NULL,
- PRIMARY KEY (`id`)
+ PRIMARY KEY (`id`),
+ KEY `wagon_type` (`typeFk`),
+ CONSTRAINT `wagon_type` FOREIGN KEY (`typeFk`) REFERENCES `wagonType` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -41314,7 +41409,7 @@ CREATE TABLE `wagonType` (
`divisible` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -41411,6 +41506,8 @@ CREATE TABLE `warehouse` (
`isLogiflora` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Este almacén acepta productos de Logiflora',
`isBionic` tinyint(1) NOT NULL DEFAULT 1,
`isHalt` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Almacén en el que descargan nuestros troncales',
+ `isOrigin` tinyint(1) DEFAULT NULL,
+ `isDestiny` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`),
KEY `Id_Paises` (`countryFk`),
@@ -41434,13 +41531,11 @@ CREATE TABLE `warehouse` (
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`warehouse_afterInsert`
- AFTER INSERT ON `warehouse`
+ BEFORE UPDATE ON `warehouse`
FOR EACH ROW
BEGIN
- IF NEW.isFeedStock THEN
- INSERT INTO warehouseAlias(`name`) VALUES(NEW.`name`);
- INSERT INTO warehouseJoined(warehouseFk, warehouseAliasFk)
- VALUES(NEW.id,LAST_INSERT_ID());
+ IF NEW.isFeedStock AND NEW.isInventory THEN
+ CALL util.throw("isFeedStock and isInventory cannot both be true");
END IF;
END */;;
DELIMITER ;
@@ -41462,8 +41557,8 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
IF NEW.isFeedStock IS TRUE and OLD.isFeedStock IS FALSE then
- INSERT INTO warehouseAlias(`name`) VALUES(NEW.`name`);
- INSERT INTO warehouseJoined(warehouseFk, warehouseAliasFk)
+ INSERT IGNORE INTO warehouseAlias(`name`) VALUES(NEW.`name`);
+ INSERT IGNORE INTO warehouseJoined(warehouseFk, warehouseAliasFk)
VALUES(NEW.id,LAST_INSERT_ID());
END IF;
END */;;
@@ -41593,9 +41688,10 @@ CREATE TABLE `worker` (
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`worker_beforeInsert`
-BEFORE INSERT
-ON worker FOR EACH ROW
+ BEFORE INSERT ON `worker`
+ FOR EACH ROW
BEGIN
+ SET NEW.editorFk = account.myUser_getId();
CALL vn.printer_checkSector(NEW.labelerFk, NEW.sectorFk);
END */;;
DELIMITER ;
@@ -41606,16 +41702,18 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb3 */ ;
-/*!50003 SET character_set_results = utf8mb3 */ ;
-/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`worker_beforeUpdate`
BEFORE UPDATE ON `worker`
FOR EACH ROW
BEGIN
+ SET NEW.editorFk = account.myUser_getId();
+
IF NOT (NEW.labelerFk <=> OLD.labelerFk AND NEW.sectorFk <=> OLD.sectorFk) THEN
CALL vn.printer_checkSector(NEW.labelerFk, NEW.sectorFk);
@@ -41633,6 +41731,30 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`worker_afterDelete`
+ AFTER DELETE ON `worker`
+ FOR EACH ROW
+BEGIN
+ INSERT INTO workerLog
+ SET `action` = 'delete',
+ `changedModel` = 'Worker',
+ `changedModelId` = OLD.id,
+ `userFk` = account.myUser_getId();
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
--
-- Table structure for table `workerAppTester`
@@ -41732,7 +41854,13 @@ CREATE TABLE `workerConfig` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`businessUpdated` date DEFAULT NULL,
`roleFk` int(10) unsigned NOT NULL COMMENT 'Rol por defecto al dar de alta un trabajador nuevo',
- PRIMARY KEY (`id`)
+ `businessTypeFk` varchar(100) DEFAULT NULL COMMENT 'Tipo de negocio por defecto al dar de alta un trabajador nuevo',
+ `payMethodFk` tinyint(3) unsigned DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `workerConfig_FK` (`roleFk`),
+ KEY `workerConfig_FK_1` (`payMethodFk`),
+ CONSTRAINT `workerConfig_FK` FOREIGN KEY (`roleFk`) REFERENCES `account`.`role` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `workerConfig_FK_1` FOREIGN KEY (`payMethodFk`) REFERENCES `payMethod` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -42081,18 +42209,19 @@ CREATE TABLE `workerLog` (
`userFk` int(10) unsigned DEFAULT NULL,
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
- `description` text NOT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `description` text DEFAULT NULL,
+ `changedModel` enum('Worker','Calendar','WorkerTimeControlMail','Business','WorkerDms') NOT NULL DEFAULT 'Worker',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `workerFk_idx` (`originFk`),
KEY `userFk_idx` (`userFk`),
+ KEY `workerLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `workerLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `userFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `workerFk` FOREIGN KEY (`originFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -42396,8 +42525,6 @@ CREATE TABLE `workerTimeControlConfig` (
`longWeekDays` int(11) DEFAULT NULL COMMENT 'Días a tener en cuenta para calcular el descanso largo',
`teleworkingStart` int(11) DEFAULT NULL COMMENT 'Hora comienzo jornada de los teletrabajdores expresada en segundos',
`teleworkingStartBreakTime` int(11) DEFAULT NULL COMMENT 'Hora comienzo descanso de los teletrabjadores expresada en segundos',
- `breakTimeSplitDay` int(11) unsigned DEFAULT 3600 COMMENT 'Tiempo de descanso a partir del cual se determina que la jornada es partida',
- `dateSplitDay` date DEFAULT '2023-03-01' COMMENT 'Fecha a partir de la cual se tiene en cuenta el valor de configuración de breakTimeSplitDay',
PRIMARY KEY (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='All values in seconds';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -42511,7 +42638,6 @@ SET character_set_client = utf8;
`surname` tinyint NOT NULL,
`user` tinyint NOT NULL,
`password` tinyint NOT NULL,
- `bcryptPassword` tinyint NOT NULL,
`departmentFk` tinyint NOT NULL,
`dni` tinyint NOT NULL
) ENGINE=MyISAM */;
@@ -43190,17 +43316,18 @@ CREATE TABLE `zoneLog` (
`action` set('insert','update','delete') NOT NULL,
`creationDate` timestamp NULL DEFAULT current_timestamp(),
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
- `changedModel` varchar(45) DEFAULT NULL,
- `oldInstance` text DEFAULT NULL,
- `newInstance` text DEFAULT NULL,
- `changedModelId` int(11) DEFAULT NULL,
+ `changedModel` enum('Zone','ZoneEvent','ZoneExclusion','ZoneIncluded','ZoneWarehouse') NOT NULL DEFAULT 'Zone',
+ `oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
+ `newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
+ `changedModelId` int(11) NOT NULL,
`changedModelValue` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
- KEY `originFk` (`originFk`),
KEY `userFk` (`userFk`),
+ KEY `zoneLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
+ KEY `zoneLog_originFk` (`originFk`,`creationDate`),
CONSTRAINT `zoneLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `zoneLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci `PAGE_COMPRESSED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -43305,7 +43432,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `collection_make` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-09-15 00:00:00' ON COMPLETION PRESERVE ENABLE DO CALL vn.collection_make */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `collection_make` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-09-15 00:00:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL vn.collection_make */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43323,7 +43450,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `department_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-11-15 00:00:00' ON COMPLETION PRESERVE ENABLE DO CALL vn.department_doCalc */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `department_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-11-15 00:00:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL vn.department_doCalc */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43341,7 +43468,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `envialiaThreHoldChecker` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:52:46' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `envialiaThreHoldChecker` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:52:46' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO BEGIN
DECLARE vActualNumber BIGINT;
DECLARE vEndRange BIGINT;
DECLARE vIsAlreadyNotified BOOLEAN;
@@ -43387,7 +43514,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `greuge_notify` ON SCHEDULE EVERY 1 DAY STARTS '2023-01-01 00:07:00' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'Notifies subscribed users of events in wrong greuges' DO CALL vn.greuge_notifyEvents(util.CURDATE(), util.CURDATE()) */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `greuge_notify` ON SCHEDULE EVERY 1 DAY STARTS '2023-01-01 00:07:00' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE COMMENT 'Notifies subscribed users of events in wrong greuges' DO CALL vn.greuge_notifyEvents() */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43405,7 +43532,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `mysqlConnectionsSorter_kill` ON SCHEDULE EVERY 1 MINUTE STARTS '2021-10-28 09:56:27' ON COMPLETION NOT PRESERVE ENABLE DO CALL mysqlConnectionsSorter_kill() */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `mysqlConnectionsSorter_kill` ON SCHEDULE EVERY 1 MINUTE STARTS '2021-10-28 09:56:27' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL mysqlConnectionsSorter_kill() */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43423,7 +43550,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2022-01-28 09:52:46' ON COMPLETION PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2022-01-28 09:52:46' ON COMPLETION PRESERVE DISABLE ON SLAVE DO BEGIN
DECLARE vCurrentCount INT;
DECLARE vCheckSum INT;
@@ -43532,7 +43659,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `route_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2021-07-08 07:32:23' ON COMPLETION PRESERVE ENABLE DO CALL route_doRecalc */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `route_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2021-07-08 07:32:23' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL route_doRecalc */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43550,7 +43677,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `sale_checkWithoutComponents` ON SCHEDULE EVERY 10 MINUTE STARTS '2020-05-04 11:56:23' ON COMPLETION PRESERVE DISABLE ON SLAVE DO call sale_checkNoComponents(DATE_ADD(util.VN_NOW(), INTERVAL -10 MINUTE),DATE_ADD(util.VN_NOW(), INTERVAL -1 MINUTE)) */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `sale_checkWithoutComponents` ON SCHEDULE EVERY 10 MINUTE STARTS '2020-05-04 11:56:23' ON COMPLETION PRESERVE DISABLE DO call sale_checkNoComponents(DATE_ADD(util.VN_NOW(), INTERVAL -10 MINUTE),DATE_ADD(util.VN_NOW(), INTERVAL -1 MINUTE)) */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43568,7 +43695,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticketClosure` ON SCHEDULE EVERY 1 DAY STARTS '2017-09-18 00:30:00' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE COMMENT 'Realiza el cierre de todos los almacenes del dia actual' DO CALL ticketClosureMultiWarehouse(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 DAY)) */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticketClosure` ON SCHEDULE EVERY 1 DAY STARTS '2017-09-18 00:30:00' ON COMPLETION NOT PRESERVE DISABLE COMMENT 'Realiza el cierre de todos los almacenes del dia actual' DO CALL ticketClosureMultiWarehouse(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 DAY)) */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43586,7 +43713,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticket_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE ENABLE DO CALL ticket_doRecalc */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticket_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL ticket_doRecalc */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43604,7 +43731,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `travel_doRecalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-05-17 10:52:29' ON COMPLETION PRESERVE ENABLE DO CALL travel_doRecalc */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `travel_doRecalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-05-17 10:52:29' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL travel_doRecalc */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43622,7 +43749,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `vehicle_notify` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-01 00:07:00' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'Notifies subscribed users of events in vehicles that are about t' DO CALL vn.vehicle_notifyEvents */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `vehicle_notify` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-01 00:07:00' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE COMMENT 'Notifies subscribed users of events in vehicles that are about t' DO CALL vn.vehicle_notifyEvents */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43640,7 +43767,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `worker_updateChangedBusiness` ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:05' ON COMPLETION NOT PRESERVE ENABLE DO CALL worker_updateChangedBusiness */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `worker_updateChangedBusiness` ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:05' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL worker_updateChangedBusiness */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43658,7 +43785,7 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `zoneGeo_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-09-13 15:30:47' ON COMPLETION PRESERVE ENABLE DO CALL vn.zoneGeo_doCalc */ ;;
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `zoneGeo_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-09-13 15:30:47' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL vn.zoneGeo_doCalc */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
/*!50003 SET character_set_client = @saved_cs_client */ ;;
@@ -43820,8 +43947,9 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` FUNCTION `botanicExport_isUpdatable`(vEdiGenusFk MEDIUMINT,vEdiSpecieFk MEDIUMINT,
- vCountryFk MEDIUMINT,vRestriction MEDIUMINT) RETURNS int(11)
+CREATE DEFINER=`root`@`localhost` FUNCTION `botanicExport_isUpdatable`(vEdiGenusFk MEDIUMINT,
+ vEdiSpecieFk MEDIUMINT,
+ vRestriction MEDIUMINT) RETURNS int(11)
DETERMINISTIC
BEGIN
DECLARE vIsUpdatable INTEGER;
@@ -43829,8 +43957,7 @@ BEGIN
FROM botanicExport
WHERE ediGenusFk = vEdiGenusFk
AND (vEdiSpecieFk = ediSpecieFk OR IFNULL(vEdiSpecieFk,ediSpecieFk) IS NULL)
- AND (vCountryFk = countryFk OR IFNULL(vCountryFk,countryFk) IS NULL)
- AND vRestriction = restriction;
+ AND vRestriction = restriction;
RETURN vIsUpdatable;
END ;;
DELIMITER ;
@@ -44134,21 +44261,21 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `clientTaxArea`(vClientId INT, vCompa
READS SQL DATA
BEGIN
/**
- * Devuelve el area de un cliente,
- * intracomunitario, extracomunitario o nacional.
- *
- * @param vClient Id del cliente
- * @param vCompanyFk Compañia desde la que se factura
- * @return Código de area
- */
- DECLARE vTaxArea VARCHAR(25);
+* Devuelve el area de un cliente,
+* intracomunitario, extracomunitario o nacional.
+*
+* @param vClient Id del cliente
+* @param vCompanyFk Compañia desde la que se factura
+* @return Código de area
+*/
+ DECLARE vTaxArea VARCHAR(25);
- SELECT addressTaxArea(defaultAddressFk, vCompanyId)
- INTO vTaxArea
- FROM client
- WHERE id = vClientId;
+ SELECT addressTaxArea(defaultAddressFk, vCompanyId)
+ INTO vTaxArea
+ FROM client
+ WHERE id = vClientId;
- RETURN vTaxArea;
+ RETURN vTaxArea;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -44940,6 +45067,56 @@ DELIMITER ;
/*!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 `entry_isIntrastat` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` FUNCTION `entry_isIntrastat`(vSelf INT) RETURNS int(11)
+ READS SQL DATA
+BEGIN
+/**
+* Devuelve si el proveedor de la entrada es de la CEE
+*
+* @param vSelf Id de la entrada
+* @return true si es de la CEE
+*/
+ DECLARE vIsUeeSupplier BOOLEAN;
+ DECLARE vIsUeeCompany BOOLEAN;
+ DECLARE vSupplierCountry INT;
+ DECLARE vCompanyCountry INT;
+
+ 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
+ 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
+ LEFT JOIN province p ON p.id = s.provinceFk
+ LEFT JOIN autonomy a ON a.id = p.autonomyFk
+ WHERE e.id = vSelf;
+
+
+ RETURN vIsUeeCompany AND vIsUeeSupplier AND (vSupplierCountry <> vCompanyCountry);
+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 `entry_isInventoryOrPrevious` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -45340,115 +45517,6 @@ BEGIN
WHERE itemFk = vItemFk
AND clientFk = vClientFk ;
RETURN price;
-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 `getTicketToPrepare` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` FUNCTION `getTicketToPrepare`(`vWorker` INT, `vWarehouse` INT) RETURNS int(11)
- READS SQL DATA
-BEGIN
-/**
- * Devuelve el ticket que debe de preparar el trabajador
- *
- * @param vWorker Id del trabajador
- * @param vWarehouse Id del almacén
- * @return Id del ticket
- *
- * #UPDATED PAK 2019/08/16
- * #PENDING REVIEW
- **/
-
- DECLARE vToday DATETIME DEFAULT util.VN_CURDATE();
- DECLARE vYesterday DATETIME;
- DECLARE vTodayvMidniight DATETIME DEFAULT midnight(vToday);
- DECLARE vTicket INT DEFAULT NULL;
- DECLARE PREVIOUS_PREPARATION INT;
- DECLARE vHasBeenPreviouslyPrepared INT DEFAULT 0;
-
- SELECT id INTO PREVIOUS_PREPARATION
- FROM vn.state
- WHERE code LIKE 'PREVIOUS_PREPARATION';
-
- SET vYesterday = TIMESTAMPADD(DAY,-1,vToday);
-
- DROP TEMPORARY TABLE IF EXISTS tmp.workerComercial;
- CREATE TEMPORARY TABLE tmp.workerComercial
- ENGINE = MEMORY
- SELECT workerFk as worker FROM `grant` g
- JOIN grantGroup gg ON g.`groupFk` = gg.id
- WHERE gg.description = 'Comerciales';
-
- DELETE wc.*
- FROM tmp.workerComercial wc
- JOIN `grant` g ON g.workerFk = wc.worker
- JOIN grantGroup gg ON g.`groupFk` = gg.id
- WHERE gg.description = 'Gerencia';
-
- DROP TEMPORARY TABLE IF EXISTS tmp.production_buffer;
- CREATE TEMPORARY TABLE tmp.production_buffer
- ENGINE = MEMORY
- SELECT t.id as ticket
- , am.agencyFk as agency_id
- , t.warehouseFk as warehouse_id
- , a.provinceFk as province_id
- , IF (HOUR(t.shipped),HOUR(t.shipped),HOUR(z.`hour`)) as Hora
- , HOUR(t.shipped) as Departure
- , IF (MINUTE(t.shipped),MINUTE(t.shipped),MINUTE(z.`hour`)) as Minuto
- , tls.code
- , IFNULL(t.priority,0) loadingOrder
- FROM ticket t
- JOIN ticketState tls on t.id = tls.ticket
- JOIN agencyMode am on am.id = t.agencyModeFk
- JOIN address a on a.id = t.addressFk
- LEFT JOIN tmp.workerComercial wc ON wc.worker = vWorker
- LEFT JOIN vn.zone z ON z.id = t.zoneFk
- WHERE t.shipped BETWEEN vYesterday AND vTodayvMidniight
- AND t.warehouseFk = vWarehouse
- AND
- (
- (tls.code = 'PRINTED' AND wc.worker IS NULL)
- OR
- (tls.code ='PICKER_DESIGNED' AND tls.worker = vWorker)
- OR
- (tls.code = 'PRINTED_BACK')
- OR
- (tls.code = 'PRINTED PREVIOUS')
- );
-
-
- SELECT ticket INTO vTicket
- FROM tmp.production_buffer
- ORDER BY (code = 'PICKER_DESIGNED') DESC, (code = 'PRINTED PREVIOUS') DESC ,Hora, Minuto, loadingOrder
- LIMIT 1;
-
- -- Aviso de ticket para bajar
- SELECT COUNT(*) INTO vHasBeenPreviouslyPrepared
- FROM ticketTracking
- WHERE ticketFk = vTicket
- AND stateFk = PREVIOUS_PREPARATION;
-
- IF vHasBeenPreviouslyPrepared AND ticketWarehouseGet(vTicket) = 1 THEN
-
- INSERT IGNORE INTO vn.ticketDown(ticketFk) VALUES(vTicket);
-
- END IF;
-
- -- END IF;
-
- RETURN vTicket;
-
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -45933,30 +46001,9 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `isIntrastatEntry`(vEntryFk INT) RETURNS int(11)
READS SQL DATA
BEGIN
- DECLARE isIntrastatOperation BOOL DEFAULT FALSE;
- DECLARE vSupplierCountry INT DEFAULT -1;
- DECLARE vClientCountry INT DEFAULT -1;
+ -- para retrocompatibilidad, eliminar en la siguiente version
- SELECT c.id INTO vSupplierCountry
- FROM vn.country c
- JOIN vn.supplier s ON s.countryFk = c.id
- JOIN vn.entry e ON e.supplierFk = s.id
- WHERE e.id = vEntryFk
- AND c.isUeeMember = TRUE;
-
- SELECT c.id INTO vClientCountry
- FROM vn.country c
- JOIN vn.supplier s ON s.countryFk = c.id
- JOIN vn.company co ON co.id = s.id
- JOIN vn.entry e ON e.companyFk = co.id
- WHERE e.id = vEntryFk
- AND c.isUeeMember = TRUE;
-
- IF vSupplierCountry != vClientCountry AND vSupplierCountry * vClientCountry > 0 THEN
- SET isIntrastatOperation = TRUE;
- END IF;
-
- RETURN isIntrastatOperation;
+ RETURN (SELECT entry_isIntrastat(vEntryFk));
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -47167,7 +47214,7 @@ BEGIN
ENGINE = MEMORY
SELECT vTicketId ticketFk;
- CALL ticketGetTotal;
+ CALL ticketGetTotal(NULL);
SELECT total INTO vTotal FROM tmp.ticketTotal;
@@ -48430,18 +48477,17 @@ BEGIN
* @return tmp.addressTaxArea(addressFk,companyFk)
*/
- DECLARE vSpainCountryCode INT DEFAULT 1;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea;
+ DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea;
CREATE TEMPORARY TABLE tmp.addressTaxArea
(PRIMARY KEY (addressFk, companyFk))
ENGINE = MEMORY
SELECT CASE
- WHEN (NOT cClient.isUeeMember OR NOT cSupplier.isUeeMember) AND s.countryFk != c.countryFk THEN
+ 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
'CEE'
- WHEN a.isEqualizated AND c.countryFk = vSpainCountryCode THEN
+ WHEN a.isEqualizated AND cClient.code = 'ES' THEN
'EQU'
ELSE
'NATIONAL'
@@ -48450,8 +48496,12 @@ BEGIN
JOIN address a ON a.id = ac.addressFk
JOIN `client` c ON c.id = a.clientFk
JOIN country cClient ON cClient.id = c.countryFk
+ LEFT JOIN province pClient ON pClient.id = c.provinceFk
+ LEFT JOIN autonomy auClient ON auClient.id = pClient.autonomyFk
JOIN supplier s ON s.id = ac.companyFk
- JOIN country cSupplier ON cSupplier.id = s.countryFk;
+ JOIN country cSupplier ON cSupplier.id = s.countryFk
+ LEFT JOIN province pSupplier ON pSupplier.id = s.provinceFk
+ LEFT JOIN autonomy auSupplier ON auSupplier.id = pSupplier.autonomyFk;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -50345,7 +50395,7 @@ BEGIN
c.created < vDateShort;
DELETE
FROM vn.expeditionTruck
- WHERE ETD < v3Month;
+ WHERE eta < v3Month;
-- borrar travels sin entradas
DROP TEMPORARY TABLE IF EXISTS tmp.thermographToDelete;
@@ -50570,11 +50620,11 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET character_set_client = utf8mb3 */ ;
+/*!50003 SET character_set_results = utf8mb3 */ ;
+/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `clientCreate`(
vFirstname VARCHAR(50),
@@ -50619,7 +50669,7 @@ BEGIN
isEqualizated)
VALUES (
vUserFk,
- CONCAT('TR ', vFirstname, ' ', vSurnames),
+ CONCAT(vFirstname, ' ', vSurnames),
vAddress,
TRIM(vFi),
vPhone,
@@ -50960,169 +51010,6 @@ BEGIN
END IF;
-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 PROCEDURE IF EXISTS `clientPackagingOverstock` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `clientPackagingOverstock`(vClientFk INT, vGraceDays INT )
-BEGIN
- DROP TEMPORARY TABLE IF EXISTS tmp.clientPackagingOverstock;
- CREATE TEMPORARY TABLE tmp.clientPackagingOverstock
- ENGINE = MEMORY
- SELECT itemFk,
- sum(GotfromClient) - sum(SenttoClient) as devueltos,
- sum(InvoicedtoClient) - sum(InvoicedfromClient) as facturados,
- LEAST(
- sum(GotfromClient) - sum(SenttoClient),
- sum(InvoicedtoClient) - sum(InvoicedfromClient)
- ) as abonables
- FROM
- (
- SELECT t.*,
- IF(@month = month, 0, 1) monthEnd,
- @month := month
- FROM
- (
- SELECT x.id as ticketFk,
- date(x.shipped) as shipped,
- x.itemFk,
- IFNULL(cast(sum(x.InvoicedtoClient) as DECIMAL(10,0)),0) InvoicedtoClient,
- IFNULL(cast(sum(x.InvoicedfromClient) as DECIMAL(10,0)),0) InvoicedfromClient,
- IFNULL(cast(sum(x.SenttoClient) as DECIMAL(10,0)),0) SenttoClient,
- IFNULL(cast(sum(x.GotfromClient) as DECIMAL(10,0)),0) GotfromClient,
- i.name as concept,
- x.refFk as invoice,
- month(shipped) month,
- x.companyFk
- FROM
- (
- SELECT t.id,
- t.shipped,
- IFNULL(pe.equivalentFk, s.itemFk) itemFk,
- IF(s.quantity > 0, s.quantity, NULL) InvoicedtoClient,
- IF(s.quantity < 0, -s.quantity, NULL) InvoicedfromClient,
- NULL SenttoClient,
- NULL GotfromClient,
- t.refFk,
- @month := 0 month,
- t.companyFk
- FROM sale s
- JOIN ticket t on t.id = s.ticketFk
- JOIN packaging p ON p.itemFk = s.itemFk
- LEFT JOIN packageEquivalentItem pe ON pe.itemFk = s.itemFk
- WHERE t.clientFk = vClientFk
- AND t.shipped > '2017-11-30'
- AND p.isPackageReturnable
- UNION ALL
- SELECT NULL,
- '2017-11-30',
- IFNULL(pe.equivalentFk, tps.itemFk) itemFk,
- tps.sent InvoicedtoClient,
- tps.returned InvoicedfromClient,
- NULL SenttoClient,
- NULL GotfromClient,
- 'Histórico',
- NULL,
- NULL
-
- FROM ticketPackagingStartingStock tps
- LEFT JOIN packageEquivalentItem pe ON pe.itemFk = tps.itemFk
- WHERE tps.clientFk = vClientFk
- AND tps.isForgetable = FALSE
- UNION ALL
- SELECT t.id,
- t.shipped,
- IFNULL(pe.equivalentFk, p.itemFk) itemFk,
- NULL,
- NULL,
- IF(tp.quantity > 0 AND t.shipped <= TIMESTAMPADD(DAY, - vGraceDays, util.VN_CURDATE()), tp.quantity, NULL) SenttoClient,
- IF(tp.quantity < 0, -tp.quantity, NULL) GotfromClient,
- NULL AS refFk,
- NULL,
- t.companyFk
- FROM ticketPackaging tp
- JOIN ticket t on t.id = tp.ticketFk
- JOIN packaging p ON p.id = tp.packagingFk
- LEFT JOIN packageEquivalentItem pe ON pe.itemFk = p.itemFk
- WHERE t.clientFk = vClientFk
- AND t.shipped > '2017-11-21' ) x
-
- JOIN item i ON x.itemFk = i.id
- GROUP BY x.id, x.itemFk
- ) t
- ORDER BY itemFk, shipped DESC
- LIMIT 10000000000000000000
- ) t2
- GROUP BY itemFk;
-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 PROCEDURE IF EXISTS `clientPackagingOverstockReturn` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `clientPackagingOverstockReturn`(vClientFk INT, vGraceDays INT )
-BEGIN
-
- DECLARE vNewTicket INT DEFAULT 0;
- DECLARE vWarehouseFk INT;
- -- SET vGraceDays = GREATEST(vGraceDays, 90);
-
- CALL vn.clientPackagingOverstock(vClientFk,vGraceDays);
-
- SELECT id INTO vWarehouseFk
- FROM vn.warehouse
- WHERE hasConfectionTeam;
-
- CALL vn.ticket_add(
- vClientFk
- ,util.VN_CURDATE()
- ,vWarehouseFk -- Algemesi
- ,442 -- Verdnatura
- ,NULL -- address
- ,NULL -- agencia
- ,NULL -- route
- ,util.VN_CURDATE()
- ,account.myUser_getId()
- ,TRUE
- ,vNewTicket);
-
- INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price)
- SELECT vNewTicket, cpo.itemFk, - cpo.abonables, i.longName, p.price
- FROM tmp.clientPackagingOverstock cpo
- JOIN vn.item i ON i.id = cpo.itemFk
- JOIN vn.packaging p ON p.itemFk = cpo.itemFk
- WHERE cpo.abonables > 0;
-
- INSERT INTO vn.ticketPackaging(ticketFk, packagingFk, quantity)
- SELECT vNewTicket, p.id, cpo.abonables
- FROM tmp.clientPackagingOverstock cpo
- JOIN vn.packaging p ON p.itemFk = cpo.itemFk
- WHERE cpo.abonables > 0;
-
- SELECT vNewTicket;
-
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -51156,22 +51043,22 @@ BEGIN
CREATE TEMPORARY TABLE tmp.clientGetDebt
SELECT cd.id as clientFk
FROM bs.clientDied cd
- LEFT JOIN vn.clientProtected cp ON cp.clientFk = cd.id
- JOIN vn.client c ON c.id = cd.id
- JOIN vn.province p ON p.id = c.provinceFk
- JOIN vn.country co ON co.id = p.countryFk
- WHERE cd.Aviso = 'TERCER AVISO' AND
- cp.clientFk IS NULL AND
- co.country NOT IN ('Portugal','Francia','España exento') AND
- c.salesPersonFk IS NOT NULL;
+ 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
+ JOIN country co ON co.id = p.countryFk
+ WHERE cd.Aviso = 'TERCER AVISO'
+ AND cp.clientFk IS NULL
+ AND co.code NOT IN ('PT','FR')
+ AND a.name <> 'Canarias'
+ AND c.salesPersonFk IS NOT NULL;
OPEN rs;
FETCH rs INTO vClientFk;
WHILE NOT vDone DO
CALL vn.clientGreugeSpray(vClientFk, TRUE, '',TRUE);
UPDATE vn.client SET salesPersonFk = NULL WHERE id = vClientFk;
- INSERT INTO vn.clientLog (originFk, userFk, `action`, description)
- VALUES (vClientFk, account.myUser_getId(), 'update', CONCAT('Se ha desasignado el cliente por que no ha comprado en 3 meses'));
FETCH rs INTO vClientFk;
END WHILE;
CLOSE rs;
@@ -52180,7 +52067,7 @@ proc:BEGIN
DECLARE vWagons INT;
DECLARE vTrainFk INT;
DECLARE vMaxTickets INT;
- DECLARE vStateFk INT;
+ DECLARE vStateFk VARCHAR(45);
DECLARE vFirstTicketFk INT;
DECLARE vHour INT;
DECLARE vMinute INT;
@@ -52217,7 +52104,7 @@ proc:BEGIN
w.code,
o.warehouseFk,
o.itemPackingTypeFk,
- st.id,
+ st.code,
CONCAT('collection_new', o.warehouseFk, ':',o.itemPackingTypeFk),
o.numberOfWagons,
o.trainFk
@@ -52231,10 +52118,10 @@ proc:BEGIN
vLockName,
vWagons,
vTrainFk
- FROM vn.productionConfig pc
- JOIN vn.worker w ON w.id = vUserFk
- JOIN vn.state st ON st.`code` = 'ON_PREPARATION'
- JOIN vn.operator o ON o.workerFk = vUserFk;
+ FROM productionConfig pc
+ JOIN worker w ON w.id = vUserFk
+ JOIN state st ON st.`code` = 'ON_PREPARATION'
+ JOIN operator o ON o.workerFk = vUserFk;
IF NOT GET_LOCK(vLockName,vLockTime) THEN
LEAVE proc;
@@ -52256,20 +52143,20 @@ proc:BEGIN
INSERT INTO tTrain(wagon, shelve, liters, `lines`, height)
SELECT vWagonCounter, cv.`level` , cv.liters , cv.`lines` , cv.height
- FROM vn.collectionVolumetry cv
+ FROM collectionVolumetry cv
WHERE cv.trainFk = vTrainFk
AND cv.itemPackingTypeFk = vItemPackingTypeFk;
END WHILE;
-- Esto desaparecerá cuando tengamos la table cache.ticket
- CALL vn.productionControl(vWarehouseFk, 0);
+ CALL productionControl(vWarehouseFk, 0);
ALTER TABLE tmp.productionBuffer
ADD COLUMN liters INT,
ADD COLUMN height INT;
-- Se obtiene nº de colección.
- INSERT INTO vn.collection
+ INSERT INTO collection
SET itemPackingTypeFk = vItemPackingTypeFk,
trainFk = vTrainFk,
wagons = vWagons,
@@ -52281,7 +52168,7 @@ proc:BEGIN
-- Los pedidos con riesgo no se sacan aunque se asignen.
DELETE pb.*
FROM tmp.productionBuffer pb
- JOIN vn.state s ON s.id = pb.state
+ JOIN state s ON s.id = pb.state
WHERE (pb.agency = 'REC_ALGEMESI'
AND s.code <> 'PICKER_DESIGNED')
OR pb.problem LIKE '%RIESGO%';
@@ -52291,7 +52178,7 @@ proc:BEGIN
-- de problemas o tamaños
SELECT COUNT(*) INTO vHasAssignedTickets
FROM tmp.productionBuffer pb
- JOIN vn.state s ON s.id = pb.state
+ JOIN state s ON s.id = pb.state
WHERE s.code = 'PICKER_DESIGNED'
AND pb.workerCode = vWorkerCode;
@@ -52299,16 +52186,16 @@ proc:BEGIN
IF vHasAssignedTickets THEN
DELETE pb.*
FROM tmp.productionBuffer pb
- JOIN vn.state s ON s.id = pb.state
+ JOIN state s ON s.id = pb.state
WHERE s.code <> 'PICKER_DESIGNED'
OR pb.workerCode <> vWorkerCode;
ELSE
DELETE pb.*
FROM tmp.productionBuffer pb
- JOIN vn.state s ON s.id = pb.state
- JOIN vn.agencyMode am ON am.id = pb.agencyModeFk
- JOIN vn.agency a ON a.id = am.agencyFk
- JOIN vn.productionConfig pc
+ JOIN state s ON s.id = pb.state
+ JOIN agencyMode am ON am.id = pb.agencyModeFk
+ JOIN agency a ON a.id = am.agencyFk
+ JOIN productionConfig pc
WHERE pb.shipped <> util.VN_CURDATE()
OR (pb.ubicacion IS NULL AND a.isOwn = TRUE)
OR (s.isPreparable = FALSE AND s.isPrintable = FALSE)
@@ -52351,15 +52238,15 @@ proc:BEGIN
read_loop: LOOP
SET vDone = FALSE;
- CALL vn.ticket_splitItemPackingType(vTicketFk, vItemPackingTypeFk);
+ CALL ticket_splitItemPackingType(vTicketFk, vItemPackingTypeFk);
DROP TEMPORARY TABLE tmp.ticketIPT;
UPDATE tmp.productionBuffer pb
JOIN (SELECT @litros:= SUM(litros) liters, COUNT(*) `lines`, MAX(i.`size`) height
- FROM vn.saleVolume sv
- JOIN vn.sale s ON s.id = sv.saleFk
- JOIN vn.item i ON i.id = s.itemFk
+ FROM saleVolume sv
+ JOIN sale s ON s.id = sv.saleFk
+ JOIN item i ON i.id = s.itemFk
WHERE sv.ticketFk = vTicketFk ) sub
SET pb.liters = sub.liters, pb.`lines` = sub.`lines`, pb.height = sub.height
WHERE pb.ticketFk = vTicketFk;
@@ -52420,37 +52307,35 @@ proc:BEGIN
CLOSE cur1;
IF (SELECT COUNT(*) FROM tTrain WHERE ticketFk) THEN
- UPDATE vn.collection c
- JOIN vn.state st ON st.code = 'ON_PREPARATION'
+ UPDATE collection c
+ JOIN state st ON st.code = 'ON_PREPARATION'
SET c.stateFk = st.id
WHERE c.id = vCollectionFk;
-- Asigna las bandejas
- INSERT IGNORE INTO vn.ticketCollection(ticketFk, collectionFk, `level`, wagon, liters)
+ INSERT IGNORE INTO ticketCollection(ticketFk, collectionFk, `level`, wagon, liters)
SELECT tt.ticketFk, vCollectionFk, tt.shelve, tt.wagon, tt.liters
FROM tTrain tt
WHERE tt.ticketFk IS NOT NULL
ORDER BY tt.wagon, tt.shelve;
-- Actualiza el estado de los tickets
- INSERT INTO ticketTracking(stateFk, ticketFk, workerFk)
- SELECT vStateFk, ticketFk, vUserFk
- FROM vn.ticketCollection tc
- WHERE tc.collectionFk = vCollectionFk;
+
+ CALL collection_setState(vCollectionFk, vStateFk);
-- Aviso para la preparacion previa
- INSERT INTO vn.ticketDown(ticketFk, collectionFk)
+ INSERT INTO ticketDown(ticketFk, collectionFk)
SELECT tc.ticketFk, tc.collectionFk
- FROM vn.ticketCollection tc
+ FROM ticketCollection tc
WHERE tc.collectionFk = vCollectionFk;
- CALL vn.sales_mergeByCollection(vCollectionFk);
+ CALL sales_mergeByCollection(vCollectionFk);
- UPDATE vn.collection c
+ UPDATE collection c
JOIN (SELECT count(*) saleTotalCount ,
sum(s.isPicked != 0) salePickedCount
- FROM vn.ticketCollection tc
- JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ FROM ticketCollection tc
+ JOIN sale s ON s.ticketFk = tc.ticketFk
WHERE tc.collectionFk = vCollectionFk
AND s.quantity > 0
) sub
@@ -52461,7 +52346,7 @@ proc:BEGIN
ELSE
-- CALL util.throw('No ha sido posible obtener colección');
- DELETE FROM vn.collection WHERE id = vCollectionFk;
+ DELETE FROM collection WHERE id = vCollectionFk;
SET vCollectionFk = NULL;
END IF;
@@ -52551,6 +52436,63 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `collection_setState` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_setState`(vSelf INT, vStateCode VARCHAR(255) COLLATE utf8_general_ci)
+BEGIN
+/**
+ * Modifica el estado de los tickets de una colección.
+ *
+ * @param vSelf el id del colección
+ * @param vStateCode estado a modificar de los tickets
+ */
+ DECLARE vTicketFk INT;
+ DECLARE vDone INT DEFAULT FALSE;
+ DECLARE vCursor CURSOR FOR
+ SELECT DISTINCT ticketFk
+ FROM ticketCollection tc
+ WHERE tc.collectionFk = vSelf;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK;
+ RESIGNAL;
+ END;
+
+ START TRANSACTION;
+
+ OPEN vCursor;
+
+ read_loop: LOOP
+
+ FETCH vCursor INTO vTicketFk;
+
+ IF vDone THEN
+ LEAVE read_loop;
+ END IF;
+
+ CALL ticket_setState(vTicketFk, vStateCode);
+
+ END LOOP;
+
+ CLOSE vCursor;
+
+ COMMIT;
+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 PROCEDURE IF EXISTS `company_getFiscaldata` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -53616,7 +53558,7 @@ BEGIN
WHILE NOT done DO
- CALL invoiceInBookingMain(vInvoiceFk);
+ CALL invoiceIn_booking(vInvoiceFk);
IF vCounter > 0 OR vASIEN > 0 THEN
@@ -53703,9 +53645,9 @@ BEGIN
FROM dua
WHERE id = vDuaFk;
- IF vBookNumber IS NULL OR NOT vBookNumber THEN
+ IF vBookNumber IS NULL OR NOT vBookNumber THEN
CALL ledger_next(vBookNumber);
- END IF;
+ END IF;
-- Apunte de la aduana
@@ -53715,10 +53657,10 @@ BEGIN
SUBCTA,
CONCEPTO,
EUROHABER,
- SERIE,
+ SERIE,
empresa_id,
- CLAVE,
- FACTURA)
+ CLAVE,
+ FACTURA)
SELECT
vBookNumber,
@@ -53726,15 +53668,15 @@ BEGIN
'4700000999',
CONCAT('DUA ',d.`code`),
sum(dt.base * dt.rate / 100) EUROHABER,
- 'R',
+ 'R',
d.companyFk,
- vDuaFk,
- vDuaFk
+ vDuaFk,
+ vDuaFk
FROM duaTax dt
JOIN dua d ON d.id = dt.duaFk
- WHERE dt.duaFk = vDuaFk;
+ WHERE dt.duaFk = vDuaFk;
- -- Apuntes por tipo de IVA y proveedor
+ -- Apuntes por tipo de IVA y proveedor
INSERT INTO XDiario(
ASIEN,
@@ -53789,27 +53731,28 @@ BEGIN
1 TIPONOSUJE,
5 TIPOFACT,
1 TIPORECTIF,
- IF(s.countryFk IN (30, 1), 1, 4) TERIDNIF,
+ IF(c.code = 'ES', 1, 4) TERIDNIF,
s.nif TERNIF,
s.name TERNOM,
d.companyFk,
d.booked FECREGCON
FROM duaTax dt
JOIN dua d ON dt.duaFk = d.id
- JOIN (SELECT account, rate
+ JOIN (SELECT account, rate
FROM
(SELECT rate, account
FROM invoiceInTaxBookingAccount ta
- WHERE ta.effectived <= vBookDated
- AND taxAreaFk = 'WORLD'
- ORDER BY ta.effectived DESC
+ WHERE ta.effectived <= vBookDated
+ AND taxAreaFk = 'WORLD'
+ ORDER BY ta.effectived DESC
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
- GROUP BY dt.rate;
+ GROUP BY dt.rate;
SELECT SUM(EURODEBE) -SUM(EUROHABER), MAX(id) INTO vDiff, vApunte
FROM XDiario
@@ -53820,9 +53763,9 @@ BEGIN
EURODEBE = EURODEBE - vDiff
WHERE id = vApunte;
- UPDATE dua
+ UPDATE dua
SET ASIEN = vBookNumber
- WHERE id = vDuaFk;
+ WHERE id = vDuaFk;
END ;;
DELIMITER ;
@@ -54120,54 +54063,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `entryLog_add` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `entryLog_add`(
- vChangedModel VARCHAR(45),
- vOriginFk INT,
- vChangedModelId INT,
- vActionCode VARCHAR(45),
- vChangedModelValue VARCHAR(255),
- vOldInstance JSON,
- vNewInstance JSON)
-BEGIN
-/**
- * Guarda las acciones realizadas por el usuario
- *
- * @param vChangedModel Nombre que hace referencia a la tabla que se modifica
- * @param vOriginFk Id del registro de la tabla origen
- * @param vChangedModelId Id del registro de la tabla a la que se realiza la acción
- * @param vActionCode Código de la acción {insert | delete | update}
- * @param vOldInstance JSON que contiene los valores viejos
- * @param vNewInstance JSON que contiene los valores nuevos
- */
- CALL util.log_cleanInstances(vActionCode, vOldInstance, vNewInstance);
-
- IF !(vOldInstance = '{}' AND vNewInstance = '{}') THEN
- INSERT INTO entryLog SET
- changedModel = vChangedModel,
- originFk = vOriginFk,
- changedModelId = vChangedModelId,
- `action` = vActionCode,
- changedModelValue = vChangedModelValue,
- oldInstance = vOldInstance,
- newInstance = vNewInstance,
- userFk = account.myUser_getId();
- END IF;
-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 PROCEDURE IF EXISTS `entryWithItem` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -54758,18 +54653,6 @@ BEGIN
e.invoiceAmount = vInvoiceAmountNewEntry
WHERE e.id = vNewEntryFk;
- INSERT INTO entryLog
- SET `action` = 'update',
- description = CONCAT('Se ha creado la entrada ', vNewEntryFk,' transferida desde la ', vSelf),
- userFk = account.myUser_getId(),
- originFk = vSelf;
-
- INSERT INTO entryLog
- SET `action` = 'update',
- description = CONCAT('Se ha creado la entrada ', vNewEntryFk,' transferida desde la ', vSelf),
- userFk = account.myUser_getId(),
- originFk = vNewEntryFk;
-
UPDATE entry
SET gestDocFk = (SELECT gestDocFk FROM entry WHERE id = vSelf LIMIT 1)
WHERE id = vNewEntryFk;
@@ -55939,7 +55822,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionTruck_Add`(vHour VARCHAR(5), vDescription VARCHAR(45))
BEGIN
- INSERT INTO vn.expeditionTruck(ETD,description)
+ INSERT INTO vn.expeditionTruck(eta,description)
VALUES(CONCAT(util.VN_CURDATE(), ' ', vHour), vDescription);
END ;;
@@ -55962,11 +55845,11 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionTruck_List`()
BEGIN
SELECT id truckFk,
- ETD,
+ eta,
description Destino
- FROM vn.expeditionTruck
- WHERE ETD BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
- ORDER BY ETD;
+ FROM expeditionTruck
+ WHERE eta BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
+ ORDER BY eta;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56073,7 +55956,7 @@ BEGIN
am.name zonaRuta,
t.routeFk ruta,
rm.beachFk ubicacion,
- et.ETD ,
+ et.eta ,
et.description camion,
vTicketsPendientes AS ticketsPendientes,
vEtiquetasTotales AS etiquetasTotales,
@@ -56159,7 +56042,7 @@ BEGIN
am.name zonaRuta,
t.routeFk ruta,
rm.beachFk ubicacion,
- et.ETD ,
+ et.eta ,
et.description camion,
vTicketsPendientes AS ticketsPendientes,
vEtiquetasTotales AS etiquetasTotales,
@@ -57274,7 +57157,7 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `invoiceInBookingCommon` */;
+/*!50003 DROP PROCEDURE IF EXISTS `invoiceInDueDay_calculate` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
@@ -57284,50 +57167,219 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInBookingCommon`(vInvoiceInId INT, OUT vSerialNumber INT)
+CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInDueDay_calculate`(vInvoiceInFk INT)
BEGIN
- DROP TEMPORARY TABLE IF EXISTS newInvoiceIn;
+ IF !(SELECT COUNT(*)
+ FROM invoiceInDueDay iid
+ WHERE iid.invoiceInFk = vInvoiceInFk) THEN
- CREATE TEMPORARY TABLE newInvoiceIn
- SELECT
- i.*,
- YEAR(i.booked) datedYear,
- CONCAT('s/fra',RIGHT(i.supplierRef,8),':',LEFT(s.name, 10)) conceptWithSupplier,
- (cc.id = c.id) isSameCountry,
- cit.id invoicesCount
- FROM invoiceIn i
- JOIN cplusInvoiceType472 cit ON cit.id = i.cplusInvoiceType472Fk
- JOIN supplier s ON s.id = i.supplierFk
- JOIN country c ON c.id = s.countryFk
- JOIN supplier sc ON sc.id = i.companyFk
- JOIN country cc ON cc.id = sc.countryFk
- WHERE i.id = vInvoiceInId;
+ INSERT INTO invoiceInDueDay (invoiceInFk,
+ dueDated,
+ amount,
+ foreignValue)
+ SELECT vInvoiceInFk,
+ IF(payDay,
+ IF(vn.getNextDueDate(issued, detail, payDay) < DATE_ADD(created, INTERVAL 2 DAY),
+ DATE_ADD(created, INTERVAL 2 DAY),
+ vn.getNextDueDate(issued, detail, payDay)),
+ GREATEST(TIMESTAMPADD(DAY, 2, created), TIMESTAMPADD(DAY, detail, issued))),
+ 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)*(s.countryFk = s2.countryFk)) * iit.taxableBase)/COUNT(DISTINCT(pdd.detail)) venc,
+ SUM(iit.foreignValue)/COUNT(DISTINCT(pdd.detail)) foreignValue,
+ s.payDemFk,
+ ii.companyFk,
+ COUNT(DISTINCT(pdd.detail)) cont,
+ s.payDay,
+ ii.issued,
+ DATE(ii.created) created
+ FROM invoiceIn ii
+ JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
+ LEFT JOIN sage.TiposIva AS ti ON ti.CodigoIva= iit.taxTypeSageFk
+ JOIN supplier s ON s.id = ii.supplierFk
+ JOIN supplier s2 ON s2.id = ii.companyFk
+ JOIN vn.payDemDetail pdd ON pdd.id = s.payDemFk
+ WHERE ii.id = vInvoiceInFk
+ GROUP BY ii.id
+ ) sub
+ JOIN (SELECT @cont:=0) sub2
+ JOIN vn.payDemDetail pdd ON pdd.id = sub.payDemFk
+ GROUP BY detail;
+ END IF;
- DROP TEMPORARY TABLE IF EXISTS newSupplier;
- CREATE TEMPORARY TABLE newSupplier
- SELECT
- s.*,
- REPLACE(s.account,' ','') supplierAccount,
- IF(c.CEE < 2, TRUE, FALSE) isUeeMember
- FROM supplier s
- JOIN newInvoiceIn n
- JOIN country c ON c.id = s.countryFk
- WHERE s.id = n.supplierFk;
+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 PROCEDURE IF EXISTS `invoiceInDueDay_recalc` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInDueDay_recalc`(vInvoiceInFk INT)
+BEGIN
- IF (SELECT isActive FROM newSupplier) = 0 THEN
- CALL util.throw('INACTIVE_PROVIDER');
+ DELETE FROM invoiceInDueDay
+ WHERE invoiceInFk = vInvoiceInFk;
+
+ CALL invoiceInDueDay_calculate(vInvoiceInFk);
+
+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 PROCEDURE IF EXISTS `invoiceInTaxMakeByDua` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTaxMakeByDua`(vDuaFk INT)
+BEGIN
+
+ DECLARE done BOOL DEFAULT FALSE;
+ DECLARE vInvoiceInFk INT;
+
+ DECLARE rs CURSOR FOR
+ SELECT invoiceInFk
+ FROM entry e
+ JOIN duaEntry de ON de.entryFk = e.id
+ WHERE de.duaFk = vDuaFk;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
+
+ OPEN rs;
+
+ FETCH rs INTO vInvoiceInFk;
+
+ WHILE NOT done DO
+
+ CALL vn2008.recibidaIvaInsert(vInvoiceInFk);
+ CALL invoiceInDueDay_recalc(vInvoiceInFk);
+
+ FETCH rs INTO vInvoiceInFk;
+
+ END WHILE;
+
+ CLOSE rs;
+
+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 PROCEDURE IF EXISTS `invoiceInTax_getFromDua` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTax_getFromDua`(vDuaFk INT)
+BEGIN
+
+ DECLARE done BOOL DEFAULT FALSE;
+ DECLARE vInvoiceInFk INT;
+
+ DECLARE rs CURSOR FOR
+ SELECT invoiceInFk
+ FROM entry e
+ JOIN duaEntry de ON de.entryFk = e.id
+ WHERE de.duaFk = vDuaFk;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
+
+ OPEN rs;
+
+ FETCH rs INTO vInvoiceInFk;
+
+ WHILE NOT done DO
+
+ CALL invoiceInTax_getFromEntries(vInvoiceInFk);
+ CALL invoiceInDueDay_calculate(vInvoiceInFk);
+
+ FETCH rs INTO vInvoiceInFk;
+
+ END WHILE;
+
+ CLOSE rs;
+
+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 PROCEDURE IF EXISTS `invoiceInTax_getFromEntries` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTax_getFromEntries`(IN vId INT)
+BEGIN
+ DECLARE vRate DOUBLE DEFAULT 1;
+ DECLARE vDated DATE;
+ DECLARE vExpenceFk VARCHAR(10);
+
+ SELECT MAX(rr.dated) INTO vDated
+ FROM referenceRate rr
+ JOIN invoiceIn ii ON ii.id = vId
+ WHERE rr.dated <= ii.issued
+ AND rr.currencyFk = ii.currencyFk ;
+
+ IF vDated THEN
+ SELECT `value` INTO vRate
+ FROM referenceRate
+ WHERE dated = vDated;
END IF;
- SELECT IFNULL(MAX(i.serialNumber) + 1,1)
- INTO vSerialNumber
- FROM invoiceIn i
- JOIN newInvoiceIn n
- WHERE i.serial LIKE n.serial
- AND YEAR(i.booked) = n.datedYear
- AND i.companyFk = n.companyFk
- GROUP BY i.companyFk;
+ SELECT id INTO vExpenceFk
+ FROM vn.expence
+ WHERE `name` = 'Adquisición mercancia Extracomunitaria'
+ GROUP BY id
+ LIMIT 1;
+ DELETE FROM invoiceInTax
+ WHERE invoiceInFk = vId;
+
+ INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, foreignValue, taxTypeSageFk, transactionTypeSageFk)
+ SELECT ii.id,
+ SUM(b.buyingValue * b.quantity) / IFNULL(vRate,1) taxableBase,
+ vExpenceFk,
+ IF(ii.currencyFk = 1,NULL,SUM(b.buyingValue * b.quantity )) divisa,
+ taxTypeSageFk,
+ transactionTypeSageFk
+ FROM invoiceIn ii
+ 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
+ AND rr.dated = ii.issued
+ WHERE ii.id = vId
+ HAVING taxableBase IS NOT NULL;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -57340,14 +57392,11 @@ DELIMITER ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
-
-
-
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceIn_booking`(vSelf INT)
+CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceIn_booking`(vSelf INT)
BEGIN
DECLARE vBookNumber INT;
@@ -57624,238 +57673,6 @@ BEGIN
DROP TEMPORARY TABLE tInvoiceIn;
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 PROCEDURE IF EXISTS `invoiceInDueDay_calculate` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInDueDay_calculate`(vInvoiceInFk INT)
-BEGIN
-
- IF !(SELECT COUNT(*)
- FROM invoiceInDueDay iid
- WHERE iid.invoiceInFk = vInvoiceInFk) THEN
-
- INSERT INTO invoiceInDueDay (invoiceInFk,
- dueDated,
- amount,
- foreignValue)
- SELECT vInvoiceInFk,
- IF(payDay,
- IF(vn.getNextDueDate(issued, detail, payDay) < DATE_ADD(created, INTERVAL 2 DAY),
- DATE_ADD(created, INTERVAL 2 DAY),
- vn.getNextDueDate(issued, detail, payDay)),
- GREATEST(TIMESTAMPADD(DAY, 2, created), TIMESTAMPADD(DAY, detail, issued))),
- 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)*(s.countryFk = s2.countryFk)) * iit.taxableBase)/COUNT(DISTINCT(pdd.detail)) venc,
- SUM(iit.foreignValue)/COUNT(DISTINCT(pdd.detail)) foreignValue,
- s.payDemFk,
- ii.companyFk,
- COUNT(DISTINCT(pdd.detail)) cont,
- s.payDay,
- ii.issued,
- DATE(ii.created) created
- FROM invoiceIn ii
- JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
- LEFT JOIN sage.TiposIva AS ti ON ti.CodigoIva= iit.taxTypeSageFk
- JOIN supplier s ON s.id = ii.supplierFk
- JOIN supplier s2 ON s2.id = ii.companyFk
- JOIN vn.payDemDetail pdd ON pdd.id = s.payDemFk
- WHERE ii.id = vInvoiceInFk
- GROUP BY ii.id
- ) sub
- JOIN (SELECT @cont:=0) sub2
- JOIN vn.payDemDetail pdd ON pdd.id = sub.payDemFk
- GROUP BY detail;
- END IF;
-
-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 PROCEDURE IF EXISTS `invoiceInDueDay_recalc` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInDueDay_recalc`(vInvoiceInFk INT)
-BEGIN
-
- DELETE FROM invoiceInDueDay
- WHERE invoiceInFk = vInvoiceInFk;
-
- CALL invoiceInDueDay_calculate(vInvoiceInFk);
-
-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 PROCEDURE IF EXISTS `invoiceInTaxMakeByDua` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTaxMakeByDua`(vDuaFk INT)
-BEGIN
-
- DECLARE done BOOL DEFAULT FALSE;
- DECLARE vInvoiceInFk INT;
-
- DECLARE rs CURSOR FOR
- SELECT invoiceInFk
- FROM entry e
- JOIN duaEntry de ON de.entryFk = e.id
- WHERE de.duaFk = vDuaFk;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
-
- OPEN rs;
-
- FETCH rs INTO vInvoiceInFk;
-
- WHILE NOT done DO
-
- CALL vn2008.recibidaIvaInsert(vInvoiceInFk);
- CALL vn2008.recibidaVencimientoReplace(vInvoiceInFk);
-
- FETCH rs INTO vInvoiceInFk;
-
- END WHILE;
-
- CLOSE rs;
-
-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 PROCEDURE IF EXISTS `invoiceInTax_getFromDua` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTax_getFromDua`(vDuaFk INT)
-BEGIN
-
- DECLARE done BOOL DEFAULT FALSE;
- DECLARE vInvoiceInFk INT;
-
- DECLARE rs CURSOR FOR
- SELECT invoiceInFk
- FROM entry e
- JOIN duaEntry de ON de.entryFk = e.id
- WHERE de.duaFk = vDuaFk;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
-
- OPEN rs;
-
- FETCH rs INTO vInvoiceInFk;
-
- WHILE NOT done DO
-
- CALL invoiceInTax_getFromEntries(vInvoiceInFk);
- CALL invoiceInDueDay_calculate(vInvoiceInFk);
-
- FETCH rs INTO vInvoiceInFk;
-
- END WHILE;
-
- CLOSE rs;
-
-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 PROCEDURE IF EXISTS `invoiceInTax_getFromEntries` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTax_getFromEntries`(IN vId INT)
-BEGIN
- DECLARE vRate DOUBLE DEFAULT 1;
- DECLARE vDated DATE;
- DECLARE vExpenceFk VARCHAR(10);
-
- SELECT MAX(rr.dated) INTO vDated
- FROM referenceRate rr
- JOIN invoiceIn ii ON ii.id = vId
- WHERE rr.dated <= ii.issued
- AND rr.currencyFk = ii.currencyFk ;
-
- IF vDated THEN
- SELECT `value` INTO vRate
- FROM referenceRate
- WHERE dated = vDated;
- END IF;
-
- SELECT id INTO vExpenceFk
- FROM vn.expence
- WHERE `name` = 'Adquisición mercancia Extracomunitaria'
- GROUP BY id
- LIMIT 1;
-
- DELETE FROM invoiceInTax
- WHERE invoiceInFk = vId;
-
- INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, foreignValue, taxTypeSageFk, transactionTypeSageFk)
- SELECT ii.id,
- SUM(b.buyingValue * b.quantity) / IFNULL(vRate,1) taxableBase,
- vExpenceFk,
- IF(ii.currencyFk = 1,NULL,SUM(b.buyingValue * b.quantity )) divisa,
- taxTypeSageFk,
- transactionTypeSageFk
- FROM invoiceIn ii
- 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
- AND rr.dated = ii.issued
- WHERE ii.id = vId
- HAVING taxableBase IS NOT NULL;
-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 */ ;
@@ -57948,7 +57765,6 @@ BEGIN
*/
DECLARE vBookNumber INT;
DECLARE vExpenceConcept VARCHAR(50);
- DECLARE vIsUeeMember BOOL DEFAULT TRUE;
DECLARE vSpainCountryFk INT;
DECLARE vOldBookNumber INT;
@@ -57986,8 +57802,8 @@ BEGIN
ic.cplusRectificationTypeFk AS TIPORECTIF,
io.companyFk,
RIGHT(io.ref, LENGTH(io.ref) - 1) AS invoiceNum,
- IF(ct.politicalCountryFk = vSpainCountryFk, vSpainCountryFk, IF(ct.isUeeMember = vIsUeeMember,2,4)) AS TERIDNIF,
- CONCAT(IF(ct.isUeeMember = vIsUeeMember AND ct.politicalCountryFk <> vSpainCountryFk,ct.code,''),c.fi) AS TERNIF,
+ IF(c.countryFk = vSpainCountryFk, vSpainCountryFk, IF(ct.isUeeMember,2,4)) AS TERIDNIF,
+ CONCAT(IF(ct.isUeeMember AND c.countryFk <> vSpainCountryFk,ct.code,''),c.fi) AS TERNIF,
c.socialName AS TERNOM,
ior.serial AS SERIE_RT,
RIGHT(ior.ref, LENGTH(ior.ref) - 1) AS FACTU_RT,
@@ -58455,11 +58271,11 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET character_set_client = utf8mb3 */ ;
+/*!50003 SET character_set_results = utf8mb3 */ ;
+/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_new`(
vSerial VARCHAR(255),
@@ -58494,6 +58310,13 @@ BEGIN
DECLARE vIsCEESerial BOOL DEFAULT FALSE;
DECLARE vIsCorrectInvoiceDate BOOL;
DECLARE vMaxShipped DATE;
+ DECLARE vDone BOOL;
+ DECLARE vTicketFk INT;
+ DECLARE vCursor CURSOR FOR
+ SELECT id
+ FROM tmp.ticketToInvoice;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
SET vInvoiceDate = IFNULL(vInvoiceDate, util.VN_CURDATE());
@@ -58579,6 +58402,20 @@ BEGIN
FROM invoiceOut
WHERE id = vNewInvoiceId;
+ OPEN vCursor;
+ l: LOOP
+ SET vDone = FALSE;
+ FETCH vCursor INTO vTicketFk;
+
+ IF vDone THEN
+ LEAVE l;
+ END IF;
+
+ CALL ticket_recalc(vTicketFk, vTaxArea);
+
+ END LOOP;
+ CLOSE vCursor;
+
UPDATE ticket t
JOIN tmp.ticketToInvoice ti ON ti.id = t.id
SET t.refFk = vNewRef;
@@ -58594,10 +58431,6 @@ BEGIN
INSERT INTO ticketTracking(stateFk,ticketFk,workerFk)
SELECT * FROM tmp.updateInter;
- INSERT INTO ticketLog (action, userFk, originFk, description)
- SELECT 'UPDATE', account.myUser_getId(), ti.id, CONCAT('Crea factura ', vNewRef)
- FROM tmp.ticketToInvoice ti;
-
CALL invoiceExpenceMake(vNewInvoiceId);
CALL invoiceTaxMake(vNewInvoiceId,vTaxArea);
@@ -59049,54 +58882,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `itemLog_add` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `itemLog_add`(
- vChangedModel VARCHAR(45),
- vOriginFk INT,
- vChangedModelId INT,
- vActionCode VARCHAR(45),
- vChangedModelValue VARCHAR(255),
- vOldInstance JSON,
- vNewInstance JSON)
-BEGIN
-/**
- * Guarda las acciones realizadas por el usuario
- *
- * @param vChangedModel Nombre que hace referencia a la tabla que se modifica
- * @param vOriginFk Id del registro de la tabla origen
- * @param vChangedModelId Id del registro de la tabla a la que se realiza la acción
- * @param vActionCode Código de la acción {insert | delete | update}
- * @param vOldInstance JSON que contiene los valores viejos
- * @param vNewInstance JSON que contiene los valores nuevos
- */
- CALL util.log_cleanInstances(vActionCode, vOldInstance, vNewInstance);
-
- IF !(vOldInstance = '{}' AND vNewInstance = '{}') THEN
- INSERT INTO itemLog SET
- changedModel = vChangedModel,
- originFk = vOriginFk,
- changedModelId = vChangedModelId,
- `action` = vActionCode,
- changedModelValue = vChangedModelValue,
- oldInstance = vOldInstance,
- newInstance = vNewInstance,
- userFk = account.myUser_getId();
- END IF;
-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 PROCEDURE IF EXISTS `itemPlacementFromTicket` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -59996,51 +59781,43 @@ proc:BEGIN
DECLARE vBuyerFk INT DEFAULT 0;
DECLARE vWarehouseFk INT DEFAULT 0;
DECLARE vSonSectorFk INT;
- DECLARE vWorkerFk INT;
+ DECLARE vWorkerFk INT;
- SELECT s.workerFk
- INTO vWorkerFk
- FROM vn.sector s
- WHERE s.id = vSectorFk;
+ SELECT s.workerFk
+ INTO vWorkerFk
+ FROM vn.sector s
+ WHERE s.id = vSectorFk;
- IF IFNULL(vWorkerFk,0) THEN
-
- CALL vn.itemShelvingRadar_Urgent(vWorkerFk);
- LEAVE proc;
-
- end if;
-
-
- SELECT w.id, s.warehouseFk INTO vBuyerFk, vWarehouseFk
+ SELECT w.id, s.warehouseFk INTO vBuyerFk, vWarehouseFk
FROM vn.worker w
JOIN vn.sector s ON s.code = w.code
- WHERE s.id = vSectorFk;
+ WHERE s.id = vSectorFk;
- SELECT s.id INTO vSectorFk
+ SELECT s.id INTO vSectorFk
FROM vn.sector s
- WHERE s.warehouseFk = vWarehouseFk
+ WHERE s.warehouseFk = vWarehouseFk
AND s.isMain;
- SELECT COUNT(*) INTO hasFatherSector
+ SELECT COUNT(*) INTO hasFatherSector
FROM vn.sector
- WHERE sonFk = vSectorFk;
+ WHERE sonFk = vSectorFk;
- SELECT warehouseFk, sonFk INTO vWarehouseFk, vSonSectorFk
+ SELECT warehouseFk, sonFk INTO vWarehouseFk, vSonSectorFk
FROM vn.sector
- WHERE id = vSectorFk;
+ WHERE id = vSectorFk;
CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk);
- CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE());
+ CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE());
- DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingRadar;
+ DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingRadar;
- IF hasFatherSector THEN
+ IF hasFatherSector THEN
CREATE TEMPORARY TABLE tmp.itemShelvingRadar
(PRIMARY KEY (itemFk))
ENGINE = MEMORY
- SELECT * FROM (
+ SELECT * FROM (
SELECT iss.itemFk,
i.longName,
i.size,
@@ -60049,22 +59826,22 @@ proc:BEGIN
SUM(IF(s.sonFk = vSectorFk, IFNULL(iss.visible,0), 0)) upstairs,
SUM(IF(iss.sectorFk = vSectorFk, IFNULL(iss.visible,0), 0)) downstairs,
IF(it.isPackaging, null, IFNULL(v.visible,0)) as visible,
- vSectorFk as sectorFk
+ 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
- JOIN vn.itemType it ON it.id = i.typeFk AND vBuyerFk IN (0,it.workerFk)
+ JOIN vn.itemType it ON it.id = i.typeFk AND vBuyerFk IN (0,it.workerFk)
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
- WHERE vSectorFk IN (iss.sectorFk, s.sonFk)
+ WHERE vSectorFk IN (iss.sectorFk, s.sonFk)
AND it.workerFk != 3366
GROUP BY iss.itemFk
- UNION ALL
+ UNION ALL
- SELECT v.item_id,
+ SELECT v.item_id,
i.longName,
i.size,
i.subName producer,
@@ -60072,35 +59849,35 @@ proc:BEGIN
0 upstairs,
0 downstairs,
IF(it.isPackaging, NULL, v.visible) visible,
- vSectorFk as sectorFk
+ vSectorFk as sectorFk
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
- LEFT JOIN cache.available a ON a.item_id = v.item_id AND a.calc_id = vCalcAvailableFk
- WHERE v.calc_id = vCalcVisibleFk
+ 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
+ LEFT JOIN cache.available a ON a.item_id = v.item_id AND a.calc_id = vCalcAvailableFk
+ WHERE v.calc_id = vCalcVisibleFk
AND iss.itemFk IS NULL
- AND it.isInventory
- ) sub GROUP BY itemFk;
+ AND it.isInventory
+ ) sub GROUP BY itemFk;
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
+ CAST(downstairs - IFNULL(notPickedYed,0) AS DECIMAL(10,0)) as pendiente
+ FROM tmp.itemShelvingRadar ishr
JOIN vn.item i ON i.id = ishr.itemFk
LEFT JOIN (SELECT s.itemFk, sum(s.quantity) as notPickedYed
FROM vn.ticket t
JOIN vn.ticketStateToday tst ON tst.ticket = t.id
JOIN vn.sale s ON s.ticketFk = t.id
WHERE t.warehouseFk = vWarehouseFk
- AND tst.alertLevel = 0
+ AND tst.alertLevel = 0
GROUP BY s.itemFk
) sub ON sub.itemFk = ishr.itemFk
ORDER BY i.typeFk, i.longName
;
- ELSE
+ ELSE
CREATE TEMPORARY TABLE tmp.itemShelvingRadar
(PRIMARY KEY (itemFk))
@@ -60139,16 +59916,16 @@ proc:BEGIN
/*
UPDATE tmp.itemShelvingRadar isr
JOIN vn.itemShelvingStock iss ON iss.itemFk = isr.itemFk
- SET isr.dayEndVisible = isr.dayEndVisible + iss.visible,
+ SET isr.dayEndVisible = isr.dayEndVisible + iss.visible,
isr.firstNegative = isr.firstNegative + iss.visible,
- isr.itemPlacementVisible = isr.itemPlacementVisible + iss.visible
+ isr.itemPlacementVisible = isr.itemPlacementVisible + iss.visible
WHERE iss.sectorFk = vSonSectorFk;
- */
+ */
DROP TEMPORARY TABLE IF EXISTS tmp.itemOutTime;
CREATE TEMPORARY TABLE tmp.itemOutTime
- SELECT *,SUM(amount) quantity
+ SELECT *,SUM(amount) quantity
FROM
- (SELECT item_id itemFk,
+ (SELECT item_id itemFk,
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
@@ -60168,8 +59945,8 @@ proc:BEGIN
AND NOT io.Reservado
AND stPrevious.saleFk IS NULL
AND io.dat >= util.VN_CURDATE()
- AND io.dat < util.VN_CURDATE()+1
- ) sub
+ AND io.dat < util.VN_CURDATE() + INTERVAL 1 DAY
+ ) sub
GROUP BY itemFk, hours, minutes;
INSERT INTO tmp.itemShelvingRadar (itemFk)
@@ -60184,7 +59961,7 @@ proc:BEGIN
dayEndVisible = 0,
firstNegative = 0
WHERE itemPlacementVisible = - itemShelvingStock;
- */
+*/
SELECT * FROM tmp.itemShelvingRadar;
END IF;
@@ -60313,102 +60090,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `itemShelvingRadar_Urgent` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingRadar_Urgent`()
-BEGIN
-/**
- * Devuelve lo mismo que itemShelving_filterBuyer per sin filtrar
- */
- DECLARE vCalcVisibleFk INT;
- DECLARE vWarehouseFk INT DEFAULT 60;
-
- CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk);
-
- SELECT * FROM
- (SELECT sub.itemFk,
- sub.longName,
- CONCAT(DATE_FORMAT(sub2.etd,'%H:%i'), ' salen ', CAST(sub2.pendiente AS DECIMAL(10,0)), ' unidades.') `size`,
- CONCAT(IF(sub2.itemFk, IF(sub2.pendiente > (sub.upstairs + sub.downstairs),'(1) ','(2) '),'(3) ' ),sub.producer) producer,
- sub.upstairs,
- sub.downstairs,
- sub.visible,
- sub.sectorFk,
- CAST(visible - upstairs - downstairs AS DECIMAL(10,0)) nicho,
- sub2.etd
- FROM (SELECT iss.itemFk,
- CONCAT(i.longName,' ',i.size,' ',IFNULL(i.subName,'') ) longName,
- '' size,
- CONCAT(iss.parkingCode , ' ', iss.shelvingFk) producer,
- 0 upstairs,
- SUM(IFNULL(iss.visible,0)) downstairs,
- IF(it.isPackaging, null, IFNULL(v.visible,0)) visible,
- IFNULL(iss.sectorFk,0) sectorFk
- FROM itemShelvingStock iss
- JOIN sector s ON s.id = iss.sectorFk
- JOIN item i on i.id = iss.itemFk
- 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
- GROUP BY itemFk
- ) sub LEFT JOIN (SELECT s.itemFk, SUM(s.quantity) pendiente, MIN(zc.`hour`) etd
- FROM sale s
- LEFT JOIN saleTracking st ON st.saleFk = s.id
- JOIN ticket t ON t.id = s.ticketFk
- LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk
- 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 ISNULL(st.saleFk)
- AND ct.code IN ('normal', 'trust')
- GROUP BY s.itemFk
- ) sub2 ON sub2.itemFk = sub.itemFk
- UNION ALL
- SELECT v.item_id ,
- i.longName,
- CONCAT(DATE_FORMAT(sub5.etd,'%H:%i'), ' salen ', CAST(sub5.pendiente AS DECIMAL(10,0)), ' unidades.') `size`,
- CONCAT(IF(sub5.pendiente,'(0) ','(3) ')) producer,
- 0,
- 0,
- v.visible,
- IFNULL(iss.sectorFk,0),
- v.visible nicho,
- sub5.etd
- FROM cache.visible v
- JOIN item i ON i.id = v.item_id
- JOIN itemType it ON it.id = i.typeFk
- LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id
- LEFT JOIN (SELECT s.itemFk , SUM(s.quantity) pendiente, MIN(zc.`hour`) etd
- FROM sale s
- LEFT JOIN saleTracking st ON st.saleFk = s.id
- JOIN ticket t ON t.id = s.ticketFk
- LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk
- 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 ISNULL(st.saleFk)
- AND ct.code IN ('normal', 'trust')
- GROUP BY s.itemFk
- ) sub5 ON sub5.itemFk = v.item_id
- WHERE v.calc_id = @vCalcVisibleFk
- AND ISNULL(iss.itemFk)
- ) sub3
- WHERE nicho
- ORDER BY LEFT(producer,3), etd, producer;
-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 PROCEDURE IF EXISTS `itemShelvingSale_Add` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -60784,7 +60465,7 @@ proc:BEGIN
JOIN item i ON i.id = v.item_id
LEFT JOIN ink ik ON ik.id = i.inkFk
JOIN itemType it ON it.id = i.typeFk
- LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id
+ LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id AND iss.warehouseFk = vWarehouseFk
LEFT JOIN (SELECT s.itemFk, SUM(s.quantity) pendiente
FROM sale s
LEFT JOIN saleTracking st ON st.saleFk = s.id
@@ -61090,7 +60771,7 @@ DELIMITER ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_selfConsumption`(
- vShelvingFk VARCHAR(255) COLLATE utf8_general_ci,
+ vShelvingFk VARCHAR(10) COLLATE utf8_general_ci,
vItemFk INT,
vQuantity INT
)
@@ -61113,11 +60794,9 @@ BEGIN
SELECT c.id,
c.clientFk,
- a.agencyModeFk,
s.warehouseFk
INTO vCompanyFk,
vClientFk,
- vAgencyModeFk,
vWarehouseFk
FROM company c
JOIN address a ON a.clientFk = c.clientFk
@@ -61158,7 +60837,7 @@ BEGIN
CURDATE(),
NULL,
vCompanyFk,
- vAgencyModeFk,
+ NULL,
vTicketFk
);
@@ -61167,11 +60846,12 @@ BEGIN
FROM item
WHERE id = vItemFk;
- CALL sale_calculateComponent(LAST_INSERT_ID(), NULL);
UPDATE itemShelving
SET visible = IF(id = vItemShelvingFk, vQuantity, 0)
WHERE shelvingFk = vShelvingFk
AND itemFk = vItemFk;
+
+ CALL vn.ticket_setState(vTicketFk, 'DELIVERED');
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -61999,12 +61679,17 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_getBalance`(vItemFk int, vWarehouseFk int, vDate DATETIME)
+CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getBalance`(
+ vItemFk INT,
+ vWarehouseFk INT,
+ vDate DATETIME
+)
BEGIN
/**
* @vItemFk item a buscar
* @vWarehouseFk almacen donde buscar
- * @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.
+ * @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;
DECLARE vInvCalculated INT;
@@ -62017,7 +61702,7 @@ BEGIN
FROM util.config;
END IF;
- CREATE OR REPLACE TEMPORARY TABLE itemDiary(
+ CREATE OR REPLACE TEMPORARY TABLE tItemDiary(
shipped DATE,
`in` INT(11),
`out` INT(11),
@@ -62032,119 +61717,125 @@ BEGIN
lineFk INT(11),
`order` TINYINT(3) UNSIGNED,
clientType VARCHAR(20),
- claimFk INT(10) UNSIGNED
+ claimFk INT(10) UNSIGNED,
+ inventorySupplierFk INT(10)
);
- INSERT INTO itemDiary
- SELECT tr.landed shipped,
- b.quantity `in`,
- NULL `out`,
- al.id alertLevel,
- st.name stateName,
- s.name `name`,
- e.invoiceNumber reference,
- e.id origin,
- s.id clientFk,
- IF(al.code = 'DELIVERED', TRUE, FALSE) isPicked,
- FALSE isTicket,
- b.id lineFk,
- NULL `order`,
- NULL clientType,
- NULL claimFk
- FROM buy b
- 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 alertLevel al ON al.code =
- CASE
- WHEN tr.landed < util.VN_CURDATE() THEN 'DELIVERED'
- WHEN tr.landed = util.VN_CURDATE() AND tr.isReceived = TRUE THEN 'DELIVERED'
- ELSE 'FREE'
- END
- JOIN state st ON st.code = al.code
- WHERE tr.landed >= vDateInventory
- AND vWarehouseFk = tr.warehouseInFk
- AND b.itemFk = vItemFk
- AND e.isExcludedFromAvailable = FALSE
- AND e.isRaid = FALSE
- UNION ALL
- SELECT tr.shipped,
- NULL,
- b.quantity,
- al.id,
- st.name,
- s.name,
- e.invoiceNumber,
- e.id,
- s.id,
- IF(al.code = 'DELIVERED', TRUE, FALSE),
- FALSE,
- b.id,
- NULL,
- NULL,
- NULL
- FROM buy b
- JOIN entry e ON e.id = b.entryFk
- 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 alertLevel al ON al.code =
- CASE
- WHEN tr.shipped < util.VN_CURDATE() THEN 'DELIVERED'
- WHEN tr.shipped = util.VN_CURDATE() AND tr.isReceived = TRUE THEN 'DELIVERED'
- ELSE 'FREE'
- END
- JOIN state st ON st.code = al.code
- JOIN entryConfig ec
- WHERE tr.shipped >= vDateInventory
- AND vWarehouseFk =tr.warehouseOutFk
- AND s.id <> ec.inventorySupplierFk
- AND b.itemFk = vItemFk
- AND e.isExcludedFromAvailable = FALSE
- AND w.isFeedStock = FALSE
- AND e.isRaid = FALSE
- UNION ALL
- SELECT DATE(t.shipped),
+ INSERT INTO tItemDiary
+ SELECT tr.landed shipped,
+ b.quantity `in`,
+ NULL `out`,
+ st.alertLevel ,
+ st.name stateName,
+ s.name `name`,
+ e.invoiceNumber reference,
+ e.id origin,
+ s.id clientFk,
+ IF(st.`code` = 'DELIVERED', TRUE, FALSE) isPicked,
+ FALSE isTicket,
+ b.id lineFk,
+ NULL `order`,
+ NULL clientType,
+ NULL claimFk,
+ ec.inventorySupplierFk
+ FROM buy b
+ 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()
+ OR (util.VN_CURDATE() AND tr.isReceived),
+ 'DELIVERED',
+ 'FREE')
+ JOIN entryConfig ec
+ WHERE tr.landed >= vDateInventory
+ AND vWarehouseFk = tr.warehouseInFk
+ AND (s.id <> ec.inventorySupplierFk OR vDate IS NULL)
+ AND b.itemFk = vItemFk
+ AND e.isExcludedFromAvailable = FALSE
+ AND e.isRaid = FALSE
+ UNION ALL
+ SELECT tr.shipped,
NULL,
- s.quantity,
- al3.id,
+ b.quantity,
+ st.alertLevel,
st.name,
- t.nickname,
- t.refFk,
- t.id,
- t.clientFk,
- stk.id,
- TRUE,
+ s.name,
+ e.invoiceNumber,
+ e.id,
s.id,
- st.`order`,
- ct.code,
- cb.claimFk
- FROM sale s
- JOIN ticket t ON t.id = s.ticketFk
- LEFT JOIN ticketState ts ON ts.ticket = t.id
- LEFT JOIN state st ON st.code = ts.code
- JOIN client c ON c.id = t.clientFk
- JOIN clientType ct ON ct.id = c.clientTypeFk
- JOIN alertLevel al ON al.code = 'DELIVERED'
- JOIN alertLevel al2 ON al2.code = 'FREE'
- JOIN alertLevel al3 ON al3.id =
- CASE
- WHEN t.shipped < util.VN_CURDATE() THEN al.code
- WHEN t.shipped > util.dayEnd(util.VN_CURDATE()) THEN al2.code
- ELSE IFNULL(ts.alertLevel, al2.code)
- END
- LEFT JOIN state stPrep ON stPrep.`code` = 'PREPARED'
- 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
- AND s.itemFk = vItemFk
- AND vWarehouseFk =t.warehouseFk
- ORDER BY shipped, alertLevel DESC, isTicket, `order` DESC, isPicked DESC, `in` DESC, `out` DESC;
+ IF(st.`code` = 'DELIVERED' , TRUE, FALSE),
+ FALSE,
+ b.id,
+ NULL,
+ NULL,
+ NULL,
+ ec.inventorySupplierFk
+ FROM buy b
+ JOIN entry e ON e.id = b.entryFk
+ 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()
+ OR (tr.shipped = util.VN_CURDATE() AND tr.isReceived),
+ 'DELIVERED',
+ 'FREE')
+ JOIN entryConfig ec
+ WHERE tr.shipped >= vDateInventory
+ AND vWarehouseFk = tr.warehouseOutFk
+ AND (s.id <> ec.inventorySupplierFk OR vDate IS NULL)
+ AND b.itemFk = vItemFk
+ AND e.isExcludedFromAvailable = FALSE
+ AND w.isFeedStock = FALSE
+ AND e.isRaid = FALSE
+ UNION ALL
+ SELECT DATE(t.shipped),
+ NULL,
+ s.quantity,
+ st2.alertLevel,
+ st2.name,
+ t.nickname,
+ t.refFk,
+ t.id,
+ t.clientFk,
+ stk.id,
+ TRUE,
+ s.id,
+ st.`order`,
+ ct.`code`,
+ cb.claimFk,
+ NULL
+ FROM sale s
+ JOIN ticket t ON t.id = s.ticketFk
+ LEFT JOIN ticketState ts ON ts.ticket = t.id
+ LEFT JOIN state st ON st.`code` = ts.`code`
+ 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',
+ 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
+ AND stk.stateFk = stPrep.id
+ LEFT JOIN claimBeginning cb ON s.id = cb.saleFk
+ WHERE t.shipped >= vDateInventory
+ AND s.itemFk = vItemFk
+ AND vWarehouseFk =t.warehouseFk
+ ORDER BY shipped,
+ (inventorySupplierFk = clientFk) DESC,
+ alertLevel DESC,
+ isTicket,
+ `order` DESC,
+ isPicked DESC,
+ `in` DESC,
+ `out` DESC;
IF vDate IS NULL THEN
- SET @a = 0;
- SET @currentLineFk = 0;
- SET @shipped = '';
+
+ SET @a := 0;
+ SET @currentLineFk := 0;
+ SET @shipped := '';
SELECT DATE(@shipped:= shipped) shipped,
alertLevel,
@@ -62153,50 +61844,63 @@ BEGIN
reference,
clientFk,
name,
- `in` AS invalue,
+ `in` invalue,
`out`,
- @a := @a + IFNULL(`in`,0) - IFNULL(`out`,0) as balance,
+ @a := @a + IFNULL(`in`, 0) - IFNULL(`out`, 0) balance,
@currentLineFk := IF (@shipped < util.VN_CURDATE()
- OR (@shipped = util.VN_CURDATE() AND (isPicked OR a.code >= 'ON_PREPARATION')),
- lineFk, @currentLineFk) lastPreparedLineFk,
+ OR (@shipped = util.VN_CURDATE() AND (isPicked OR a.`code` >= 'ON_PREPARATION')),
+ lineFk,
+ @currentLineFk) lastPreparedLineFk,
isTicket,
lineFk,
isPicked,
clientType,
claimFk
- FROM itemDiary
- JOIN alertLevel a ON a.id = itemDiary.alertLevel;
+ FROM tItemDiary
+ LEFT JOIN alertLevel a ON a.id = tItemDiary.alertLevel;
+
ELSE
- SELECT sum(`in`) - sum(`out`) INTO vInvCalculated
- FROM itemDiary
+ SELECT SUM(`in`) - SUM(`out`) INTO vInvCalculated
+ FROM tItemDiary
WHERE shipped < vDate;
- SELECT p1.*
- FROM(
- SELECT vDate shipped,
- 0 alertLevel,
- 0 stateName,
- 0 origin,
- '' reference,
- 0 clientFk,
- 'Inventario calculado',
- vInvCalculated invalue,
- NULL `out`,
- 0 balance,
- 0 lastPreparedLineFk,
- 0 isTicket,
- 0 lineFk,
- 0 isPicked,
- 0 clientType,
- 0 claimFk
- UNION ALL
- SELECT shipped, alertlevel, stateName, origin, reference, clientFk, name, `in`, `out`, 0,0, isTicket, lineFk, isPicked, clientType, claimFk
- FROM itemDiary
- WHERE shipped >= vDate
- )as p1;
+ SELECT vDate shipped,
+ 0 alertLevel,
+ 0 stateName,
+ 0 origin,
+ '' reference,
+ 0 clientFk,
+ 'Inventario calculado',
+ vInvCalculated invalue,
+ NULL `out`,
+ 0 balance,
+ 0 lastPreparedLineFk,
+ 0 isTicket,
+ 0 lineFk,
+ 0 isPicked,
+ 0 clientType,
+ 0 claimFk
+ UNION ALL
+ SELECT shipped,
+ alertlevel,
+ stateName,
+ origin,
+ reference,
+ clientFk,
+ name, `in`,
+ `out`,
+ 0,
+ 0,
+ isTicket,
+ lineFk,
+ isPicked,
+ clientType,
+ claimFk
+ FROM tItemDiary
+ WHERE shipped >= vDate;
END IF;
- DROP TEMPORARY TABLE itemDiary;
+ DROP TEMPORARY TABLE tItemDiary;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -62592,7 +62296,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `item_GetVisible`(vWarehouse SMALLIN
BEGIN
DECLARE vTomorrow DATETIME DEFAULT TIMESTAMPADD(DAY, 1, util.VN_CURDATE());
- INSERT INTO vn2008.tmp_item (item_id, visible)
+ INSERT INTO tmp.itemVisible (item_id, visible)
SELECT item_id, SUM(amount) amount
FROM (
SELECT i.itemFk AS item_id, quantity AS amount
@@ -62781,149 +62485,6 @@ BEGIN
CLOSE cur1;
-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 PROCEDURE IF EXISTS `item_refreshTags_beta` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `item_refreshTags_beta`()
-BEGIN
-/**
- * Actualiza la tabla item, los campos "cache" de tags
- *
- * @param temporary table tmp.item(id) del articulo
- **/
-
- DECLARE done INT DEFAULT FALSE;
- DECLARE vItemFk INT;
- DECLARE cur1 CURSOR FOR SELECT id FROM tmp.item;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
-
- OPEN cur1;
-
- read_loop: LOOP
-
- FETCH cur1 INTO vItemFk;
-
- IF done THEN
- LEAVE read_loop;
- END IF;
-
- UPDATE item i
- LEFT JOIN itemTag it1 ON it1.priority = 1 AND it1.itemFk = i.id
- LEFT JOIN itemTag it2 ON it2.priority = 2 AND it2.itemFk = i.id
- LEFT JOIN itemTag it3 ON it3.priority = 3 AND it3.itemFk = i.id
- SET i.longName = CONCAT_WS(' ', it1.`value`, it2.`value`, IF(it3.`value` = 'A1','',it3.`value`))
- WHERE i.id = vItemFk;
-
- UPDATE item i
- LEFT JOIN itemTag it1 ON it1.priority = 1 AND it1.itemFk = i.id
- LEFT JOIN tagAbbreviation ta1 ON ta1.`value` = it1.`value`
- LEFT JOIN itemTag it2 ON it2.priority = 2 AND it2.itemFk = i.id
- LEFT JOIN tagAbbreviation ta2 ON ta2.`value` = it2.`value`
- LEFT JOIN itemTag it3 ON it3.priority = 3 AND it3.itemFk = i.id
- LEFT JOIN tagAbbreviation ta3 ON ta3.`value` = it3.`value`
- SET i.`name` = CONCAT_WS(' ',
- IFNULL(ta1.abbreviation,it1.`value`),
- IFNULL(ta2.abbreviation,it2.`value`),
- IF(i.isFloramondo,'',IFNULL(ta3.abbreviation,it3.`value`)))
- WHERE i.id = vItemFk;
-
- UPDATE item i
- JOIN tmp.itemToRefresh tmpI ON tmpI.id = i.id
- LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 4
- SET i.subName = it.`value`;
-
- UPDATE item i
- LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 5
- LEFT JOIN tag t ON t.id = it.tagFk
- SET tag5 = t.name, value5 = it.`value`
- WHERE i.id = vItemFk;
-
- UPDATE item i
- LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 6
- LEFT JOIN tag t ON t.id = it.tagFk
- SET tag6 = t.name, value6 = it.`value`
- WHERE i.id = vItemFk;
-
- UPDATE item i
- LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 7
- LEFT JOIN tag t ON t.id = it.tagFk
- SET i.tag7 = t.name, i.value7 = it.`value`
- WHERE i.id = vItemFk;
-
- UPDATE item i
- LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 8
- LEFT JOIN tag t ON t.id = it.tagFk
- SET tag8 = t.name, value8 = it.`value`
- WHERE i.id = vItemFk;
-
- UPDATE item i
- LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 9
- LEFT JOIN tag t ON t.id = it.tagFk
- SET tag9 = t.name, value9 = it.`value`
- WHERE i.id = vItemFk;
-
- UPDATE item i
- LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 10
- LEFT JOIN tag t ON t.id = it.tagFk
- SET tag10 = t.name, value10 = it.`value`
- WHERE i.id = vItemFk;
-
- -- Al insertar el tag color se modifica también el antiguo campo color
- UPDATE item i
- JOIN tag t ON t.overwrite = 'inkFk'
- JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id
- JOIN ink ON ink.`name` = it.`value`
- SET i.inkFk = ink.id
- WHERE i.id = vItemFk;
-
- -- Al insertar el tag origen se modifica también en la tabla item
- UPDATE item i
- JOIN tag t ON t.overwrite = 'originFk'
- JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id
- JOIN origin o ON o.`name` = it.`value`
- SET i.originFk = o.id
- WHERE i.id = vItemFk;
-
- -- Al insertar el tag medida se modifica también en la tabla item
- UPDATE item i
- JOIN tag t ON t.overwrite = 'size'
- JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id
- SET i.size = it.`value`
- WHERE i.id = vItemFk;
-
- -- Al insertar el tag productor se modifica también en la tabla item
- UPDATE item i
- JOIN tag t ON t.overwrite = 'producerFk'
- JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id
- JOIN producer p ON p.`name` = it.`value`
- SET i.producerFk = p.id
- WHERE i.id = vItemFk;
-
- -- Al insertar el tag tallos se modifica también en la tabla item
- UPDATE item i
- JOIN tag t ON t.overwrite = 'stems'
- JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id
- SET i.stems = it.`value`
- WHERE i.id = vItemFk;
-
- END LOOP;
-
- CLOSE cur1;
-
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -63394,75 +62955,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `logAdd` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `logAdd`(vOriginFk INT, vActionCode VARCHAR(45), vEntity VARCHAR(45), vDescription TEXT)
-BEGIN
-/**
- * Guarda las acciones realizadas por el usuario
- *
- * @param vOriginFk Id del registro de origen
- * @param vActionCode Código de la acción {insert | delete | update}
- * @param vEntity Nombre que hace referencia a la tabla.
- * @param descripcion Descripción de la acción realizada por el usuario
- */
-
- CALL logAddWithUser(vOriginFk, account.myUser_getId(), vActionCode, vEntity, vDescription);
-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 PROCEDURE IF EXISTS `logAddWithUser` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `logAddWithUser`(vOriginFk INT, vUserId INT, vActionCode VARCHAR(45), vEntity VARCHAR(45), vDescription TEXT)
-BEGIN
- /**
- * Guarda las acciones realizadas por el usuario
- *
- * @param vOriginFk Id del registro de origen
- * @param vActionCode Código de la acción {insert | delete | update}
- * @param vEntity Nombre que hace referencia a la tabla.
- * @param descripcion Descripción de la acción realizada por el usuario
- */
- DECLARE vTableName VARCHAR(255) DEFAULT CONCAT(IFNULL(vEntity, ''), 'Log');
-
- SET @sqlQuery = CONCAT(
- 'INSERT INTO vn.', vTableName, ' SET originFk = ?, userFk = ?, action = ?, description = ?'
- );
- SET @originFk = vOriginFk;
- SET @userFk = vUserId;
- SET @action = vActionCode;
- SET @description = vDescription;
-
- PREPARE stmt FROM @sqlQuery;
- EXECUTE stmt USING @originFk, @userFk, @action, @description;
- DEALLOCATE PREPARE stmt;
-
- SET @sqlQuery = NULL;
-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 PROCEDURE IF EXISTS `logShow` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -65820,54 +65312,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `routeLog_add` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `routeLog_add`(
- vChangedModel VARCHAR(45),
- vOriginFk INT,
- vChangedModelId INT,
- vActionCode VARCHAR(45),
- vChangedModelValue VARCHAR(255),
- vOldInstance JSON,
- vNewInstance JSON)
-BEGIN
-/**
- * Guarda las acciones realizadas por el usuario
- *
- * @param vChangedModel Nombre que hace referencia a la tabla que se modifica
- * @param vOriginFk Id del registro de la tabla origen
- * @param vChangedModelId Id del registro de la tabla a la que se realiza la acción
- * @param vActionCode Código de la acción {insert | delete | update}
- * @param vOldInstance JSON que contiene los valores viejos
- * @param vNewInstance JSON que contiene los valores nuevos
- */
- CALL util.log_cleanInstances(vActionCode, vOldInstance, vNewInstance);
-
- IF !(vOldInstance = '{}' AND vNewInstance = '{}') THEN
- INSERT INTO routeLog SET
- changedModel = vChangedModel,
- originFk = vOriginFk,
- changedModelId = vChangedModelId,
- `action` = vActionCode,
- changedModelValue = vChangedModelValue,
- oldInstance = vOldInstance,
- newInstance = vNewInstance,
- userFk = account.myUser_getId();
- END IF;
-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 PROCEDURE IF EXISTS `routeMonitor_calculate` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -65986,7 +65430,7 @@ BEGIN
UPDATE routesMonitor rm
JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
- SET rm.etd = et.ETD;
+ SET rm.etd = et.eta;
DROP TEMPORARY TABLE tmp.routesMonitor;
END ;;
@@ -67107,7 +66551,7 @@ BEGIN
*
* @param vParam Identificador de ticket o collection
*/
- DECLARE vIsCollection BOOL;
+DECLARE vIsCollection BOOL;
SELECT COUNT(*) INTO vIsCollection
FROM collection c
@@ -67146,16 +66590,16 @@ BEGIN
SELECT s.ticketFk,
sgd.saleGroupFk,
- s.id as saleFk,
+ s.id saleFk,
s.itemFk,
s.quantity,
i.longName,
i.size,
s.reserved,
- MAX(IF(st.semaphore <=> 1, TRUE, FALSE)) as isPreviousPrepared,
- MAX(IF(st.semaphore <=> 2, TRUE, FALSE)) as isPrepared,
- MAX(IF(st.semaphore <=> 3, TRUE, FALSE)) as isControlled,
- MAX(IF(st.semaphore <=> 4, TRUE, FALSE)) as isPreControlled,
+ MAX(IF(st.semaphore <=> 1, TRUE, FALSE)) isPreviousPrepared,
+ MAX(IF(st.semaphore <=> 2, TRUE, FALSE)) isPrepared,
+ MAX(IF(st.semaphore <=> 3, TRUE, FALSE)) isControlled,
+ MAX(IF(st.semaphore <=> 4, TRUE, FALSE)) isPreControlled,
ic.color,
ip.productor,
s.discount,
@@ -67175,11 +66619,12 @@ BEGIN
TRIM(CONCAT(ic.color)) line3,
p.code cel3,
s.isAdded,
- sub2.originalQuantity as startQuantity, -- eliminar cuando tengamos la nueva apk
- IFNULL(c.workerFk,getUser()) as workerFk,
- IFNULL(SUM(iss.quantity),0) as pickedQuantity,
+ sub2.originalQuantity startQuantity, -- eliminar cuando tengamos la nueva apk
+ IF(c.workerFk IS NULL, getUser(), c.workerFk) workerFk,
+ IF(SUM(iss.quantity) IS NULL, 0, SUM(iss.quantity)) pickedQuantity,
i.packingShelve,
- MIN(iss.created) picked
+ MIN(iss.created) picked,
+ IF(sm.id, TRUE, FALSE) hasMistake
FROM tmp.ticket t
JOIN sale s ON s.ticketFk = t.id
JOIN ticket tt ON tt.id = t.id
@@ -67204,6 +66649,7 @@ BEGIN
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
GROUP BY s.id;
DROP TEMPORARY TABLE
@@ -67268,6 +66714,7 @@ BEGIN
itemDelay VARCHAR(255),
itemLost VARCHAR(255),
hasComponentLack INTEGER(1),
+ hasRounding VARCHAR(255),
isTooLittle BOOL DEFAULT FALSE,
PRIMARY KEY (ticketFk, saleFk)
) ENGINE = MEMORY;
@@ -67455,6 +66902,28 @@ BEGIN
AND t.warehouseFk = vWarehouseFk
GROUP BY tl.ticketFk) sub
ON DUPLICATE KEY UPDATE itemDelay = sub.problem, saleFk = sub.saleFk;
+
+ -- Redondeo: Cantidad pedida incorrecta en al grouping de la última compra
+ CALL buyUltimate(vWarehouseFk, vDate);
+ INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
+ SELECT ticketFk, problem, saleFk
+ FROM (
+ SELECT
+ tl.ticketFk,
+ s.id saleFk ,
+ LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,''), ' '), 250) problem,
+ MOD(s.quantity, b.`grouping`) hasRounding
+ FROM tmp.ticket_list tl
+ JOIN ticket t ON t.id = tl.ticketFk
+ AND t.warehouseFk = vWarehouseFk
+ JOIN sale s ON s.ticketFk = tl.ticketFk
+ JOIN item i ON i.id = s.itemFk
+ JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
+ JOIN buy b ON b.id = bu.buyFk
+ GROUP BY tl.ticketFk
+ HAVING hasRounding
+ ) sub
+ ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
END LOOP;
CLOSE vCursor;
@@ -68330,15 +67799,17 @@ proc: BEGIN
* @param vShelvingCode code de la matrícula
* @param vParkingFk id del parking
*/
- INSERT INTO vn.shelvingLog (originFk, userFk, action , description)
- SELECT s.id, account.myUser_getId(), 'update', CONCAT("Cambio parking ",vShelvingCode," de ", p.code," a ", pNew.code)
+ INSERT INTO vn.shelvingLog (originFk, userFk, action , description,changedModel,changedModelId)
+ SELECT s.id, account.myUser_getId(), 'update', CONCAT("Cambio parking ",vShelvingCode," de ", p.code," a ", pNew.code),'Shelving',s.id
FROM parking p
JOIN shelving s ON s.parkingFk = p.id
JOIN parking pNew ON pNew.id = vParkingFk
WHERE s.code = vShelvingCode COLLATE utf8_unicode_ci;
UPDATE vn.shelving
- SET parkingFk = vParkingFk, parked = util.VN_NOW(), isPrinted = TRUE
+ SET parkingFk = vParkingFk,
+ parked = util.VN_NOW(),
+ isPrinted = TRUE
WHERE code = vShelvingCode COLLATE utf8_unicode_ci;
END ;;
DELIMITER ;
@@ -68452,7 +67923,7 @@ BEGIN
/ vVolume buyed,
b.packageFk id_cubo,
b.packing
- FROM tmp_item ti
+ FROM tmp.item ti
JOIN item i ON i.id = ti.item_id
JOIN itemType it ON i.typeFk = it.id
JOIN itemCategory ic ON ic.id = it.categoryFk
@@ -68464,7 +67935,7 @@ BEGIN
DROP TEMPORARY TABLE
tmp.buyUltimate,
- tmp_item;
+ tmp.item;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -68499,7 +67970,7 @@ BEGIN
SUM(( ti.amount / b.packing ) * vn.buy_getVolume(b.id)) / vc.palletM3 / 1000000 buyed,
vDated,
u.name
- FROM tmp_item ti
+ FROM tmp.item ti
JOIN vn.item i ON i.id = ti.item_id
JOIN vn.itemType it ON it.id = i.typeFk
JOIN vn.itemCategory ic ON ic.id = it.categoryFk
@@ -68527,7 +67998,7 @@ BEGIN
DROP TEMPORARY TABLE
tmp.buyUltimate,
- tmp_item;
+ tmp.item;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -68559,8 +68030,8 @@ BEGIN
SELECT warehouseFk INTO vAuctionWarehouseFk
FROM auctionConfig;
- DROP TEMPORARY TABLE IF EXISTS tmp_item;
- CREATE TEMPORARY TABLE tmp_item
+ DROP TEMPORARY TABLE IF EXISTS tmp.item;
+ CREATE TEMPORARY TABLE tmp.item
(UNIQUE INDEX i USING HASH (item_id))
ENGINE = MEMORY
SELECT item_id, SUM(amount) amount
@@ -68574,11 +68045,11 @@ BEGIN
CALL `cache`.stock_refresh (FALSE);
- INSERT INTO tmp_item (item_id,amount)
+ INSERT INTO tmp.item (item_id,amount)
SELECT item_id,s.amount
FROM `cache`.stock s
WHERE warehouse_id = vAuctionWarehouseFk
- ON DUPLICATE KEY UPDATE amount = tmp_item.amount + VALUES(amount);
+ ON DUPLICATE KEY UPDATE amount = tmp.item.amount + VALUES(amount);
CALL buyUltimate(vAuctionWarehouseFk, vDate);
@@ -69870,7 +69341,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketGetTotal`()
+CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketGetTotal`(vTaxArea VARCHAR(25))
BEGIN
/**
* Calcula el total con IVA para un conjunto de tickets.
@@ -69878,7 +69349,7 @@ BEGIN
* @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular
* @return tmp.ticketTotal Total para cada ticket
*/
- CALL ticket_getTax(NULL);
+ CALL ticket_getTax(vTaxArea);
DROP TEMPORARY TABLE IF EXISTS tmp.ticketTotal;
CREATE TEMPORARY TABLE tmp.ticketTotal
@@ -70029,7 +69500,7 @@ BEGIN
AND clientFk = vClientFk
AND shipped > '2001-01-01';
- CALL vn.ticketGetTotal;
+ CALL vn.ticketGetTotal(NULL);
SELECT c.id,
c.name as Cliente,
@@ -70331,7 +69802,7 @@ BEGIN
SELECT COUNT(*) INTO vAlreadyExists
FROM ticketRefund
- WHERE originalTicketFk = vOriginalTicketFk;
+ WHERE refundTicketFk = vOriginalTicketFk;
IF vAlreadyExists > 0 THEN
CALL util.throw('This ticket is already a refund');
@@ -70795,81 +70266,83 @@ BEGIN
) t
GROUP BY itemFk HAVING amount != 0;
- DROP TEMPORARY TABLE IF EXISTS tmp.filter;
- CREATE TEMPORARY TABLE tmp.filter
- (INDEX (id))
-
- SELECT
- origin.ticketFk futureId,
- dest.ticketFk id,
- dest.state,
- origin.futureState,
- origin.futureIpt,
- dest.ipt,
- origin.workerFk,
- origin.futureLiters,
- origin.futureLines,
- dest.shipped,
- origin.shipped futureShipped,
- dest.totalWithVat,
- origin.totalWithVat futureTotalWithVat,
- dest.agency,
- origin.futureAgency,
- dest.lines,
- dest.liters,
- origin.futureLines - origin.hasStock AS notMovableLines,
- (origin.futureLines = origin.hasStock) AS isFullMovable
- FROM (
- SELECT
- s.ticketFk,
- t.workerFk,
- t.shipped,
- t.totalWithVat,
- st.name futureState,
- t.addressFk,
- am.name futureAgency,
- count(s.id) futureLines,
- GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) futureIpt,
- CAST(SUM(litros) AS DECIMAL(10,0)) futureLiters,
- SUM((s.quantity <= IFNULL(st.amount,0))) hasStock
- FROM ticket t
- JOIN sale s ON s.ticketFk = t.id
- JOIN saleVolume sv ON sv.saleFk = s.id
- JOIN item i ON i.id = s.itemFk
- JOIN ticketState ts ON ts.ticketFk = t.id
- JOIN state st ON st.id = ts.stateFk
- JOIN agencyMode am ON t.agencyModeFk = am.id
- LEFT JOIN itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
- LEFT JOIN tmp.stock st ON st.itemFk = i.id
- WHERE t.shipped BETWEEN vDateFuture AND util.dayend(vDateFuture)
- AND t.warehouseFk = vWarehouseFk
- GROUP BY t.id
- ) origin
- JOIN (
- SELECT
- t.id ticketFk,
- t.addressFk,
- st.name state,
- GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) ipt,
- t.shipped,
- t.totalWithVat,
- am.name agency,
- CAST(SUM(litros) AS DECIMAL(10,0)) liters,
- CAST(COUNT(*) AS DECIMAL(10,0)) `lines`
- FROM ticket t
- JOIN sale s ON s.ticketFk = t.id
- JOIN saleVolume sv ON sv.saleFk = s.id
- JOIN item i ON i.id = s.itemFk
- JOIN ticketState ts ON ts.ticketFk = t.id
- JOIN state st ON st.id = ts.stateFk
- JOIN agencyMode am ON t.agencyModeFk = am.id
- LEFT JOIN itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
- WHERE t.shipped BETWEEN vDateToAdvance AND util.dayend(vDateToAdvance)
- AND t.warehouseFk = vWarehouseFk
- AND st.order <= 5
- GROUP BY t.id
- ) dest ON dest.addressFk = origin.addressFk
- WHERE origin.hasStock != 0;
+ CREATE OR REPLACE TEMPORARY TABLE tmp.filter
+ (INDEX (id))
+ SELECT
+ origin.ticketFk futureId,
+ dest.ticketFk id,
+ dest.state,
+ origin.futureState,
+ origin.futureIpt,
+ dest.ipt,
+ origin.workerFk,
+ origin.futureLiters,
+ origin.futureLines,
+ dest.shipped,
+ origin.shipped futureShipped,
+ dest.totalWithVat,
+ origin.totalWithVat futureTotalWithVat,
+ dest.agency,
+ origin.futureAgency,
+ dest.lines,
+ dest.liters,
+ origin.futureLines - origin.hasStock AS notMovableLines,
+ (origin.futureLines = origin.hasStock) AS isFullMovable,
+ origin.classColor futureClassColor,
+ dest.classColor
+ FROM (
+ SELECT
+ s.ticketFk,
+ t.workerFk,
+ t.shipped,
+ t.totalWithVat,
+ st.name futureState,
+ t.addressFk,
+ am.name futureAgency,
+ count(s.id) futureLines,
+ GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) futureIpt,
+ CAST(SUM(litros) AS DECIMAL(10,0)) futureLiters,
+ SUM((s.quantity <= IFNULL(st.amount,0))) hasStock,
+ st.classColor
+ FROM ticket t
+ JOIN sale s ON s.ticketFk = t.id
+ JOIN saleVolume sv ON sv.saleFk = s.id
+ JOIN item i ON i.id = s.itemFk
+ JOIN ticketState ts ON ts.ticketFk = t.id
+ JOIN state st ON st.id = ts.stateFk
+ JOIN agencyMode am ON t.agencyModeFk = am.id
+ LEFT JOIN itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
+ LEFT JOIN tmp.stock st ON st.itemFk = i.id
+ WHERE t.shipped BETWEEN vDateFuture AND util.dayend(vDateFuture)
+ AND t.warehouseFk = vWarehouseFk
+ GROUP BY t.id
+ ) origin
+ JOIN (
+ SELECT
+ t.id ticketFk,
+ t.addressFk,
+ st.name state,
+ GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) ipt,
+ t.shipped,
+ t.totalWithVat,
+ am.name agency,
+ CAST(SUM(litros) AS DECIMAL(10,0)) liters,
+ CAST(COUNT(*) AS DECIMAL(10,0)) `lines`,
+ st.classColor
+ FROM ticket t
+ JOIN sale s ON s.ticketFk = t.id
+ JOIN saleVolume sv ON sv.saleFk = s.id
+ JOIN item i ON i.id = s.itemFk
+ JOIN ticketState ts ON ts.ticketFk = t.id
+ JOIN state st ON st.id = ts.stateFk
+ JOIN agencyMode am ON t.agencyModeFk = am.id
+ LEFT JOIN itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
+ WHERE t.shipped BETWEEN vDateToAdvance AND util.dayend(vDateToAdvance)
+ AND t.warehouseFk = vWarehouseFk
+ AND st.order <= 5
+ GROUP BY t.id
+ ) dest ON dest.addressFk = origin.addressFk
+ WHERE origin.hasStock != 0;
DROP TEMPORARY TABLE tmp.stock;
END ;;
@@ -70882,11 +70355,11 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb3 */ ;
-/*!50003 SET character_set_results = utf8mb3 */ ;
-/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_canbePostponed`(vOriginDated DATE, vFutureDated DATE, vWarehouseFk INT)
BEGIN
@@ -70897,10 +70370,9 @@ BEGIN
* @param vFutureDated Fecha en el futuro a sondear
* @param vWarehouseFk Identificador de vn.warehouse
*/
- DROP TEMPORARY TABLE IF EXISTS tmp.filter;
- CREATE TEMPORARY TABLE tmp.filter
- (INDEX (id))
- SELECT sv.ticketFk id,
+ CREATE OR REPLACE TEMPORARY TABLE tmp.filter
+ (INDEX (id))
+ SELECT sv.ticketFk id,
sub2.id futureId,
GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) ipt,
CAST(sum(litros) AS DECIMAL(10,0)) liters,
@@ -70915,7 +70387,9 @@ BEGIN
sub2.shipped futureShipped,
t.workerFk,
st.code stateCode,
- sub2.code futureStateCode
+ sub2.code futureStateCode,
+ st.classColor,
+ sub2.classColor futureClassColor
FROM vn.saleVolume sv
JOIN vn.sale s ON s.id = sv.saleFk
JOIN vn.item i ON i.id = s.itemFk
@@ -70935,7 +70409,8 @@ BEGIN
t.id,
t.shipped,
st.name state,
- st.code code,
+ st.code,
+ st.classColor,
GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) iptd
FROM vn.ticket t
JOIN vn.ticketState ts ON ts.ticketFk = t.id
@@ -71160,14 +70635,6 @@ BEGIN
FROM ticketObservation o
WHERE o.ticketFk = vOriginalTicket;
- INSERT INTO ticketLog
- SET originFk = vNewTicket, userFk = account.myUser_getId(), `action` = 'insert',
- description = CONCAT('Ha creado el ticket:', ' ', vNewTicket, ' clonando el ', vOriginalTicket);
-
- INSERT INTO ticketLog
- SET originFk = vOriginalTicket, userFk = account.myUser_getId(), `action` = 'insert',
- description = CONCAT('Ha creado el ticket:', ' ', vNewTicket, ' clonando el ', vOriginalTicket);
-
INSERT INTO ticketTracking(ticketFk, stateFk, workerFk, created)
SELECT vNewTicket, stateFk, workerFk , created
FROM ticketTracking
@@ -71381,13 +70848,12 @@ BEGIN
LEAVE proc;
END IF;
- -- Fetch ticket data
SELECT
c.id,
c.isTaxDataChecked,
t.companyFk,
t.shipped,
- co.hasDailyInvoice,
+ IFNULL(a.hasDailyInvoice, co.hasDailyInvoice),
w.isManaged,
c.hasToInvoice
INTO vClientFk,
@@ -71400,6 +70866,7 @@ BEGIN
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
JOIN country co ON co.id = p.countryFk
JOIN warehouse w ON w.id = t.warehouseFk
WHERE t.id = vCurTicketFk;
@@ -71878,7 +71345,7 @@ proc: BEGIN
LEAVE myLoop;
END IF;
- CALL ticket_recalc(vTicketFk);
+ CALL ticket_recalc(vTicketFk, NULL);
END LOOP;
CLOSE cCur;
@@ -72118,17 +71585,18 @@ BEGIN
ENGINE = MEMORY
SELECT
ticketFk,
- MAX(p.isFreezed) AS isFreezed,
- MAX(p.risk) AS risk,
- MAX(p.hasHighRisk) AS hasHighRisk,
- MAX(p.hasTicketRequest) AS hasTicketRequest,
- MAX(p.itemShortage) AS itemShortage,
- MIN(p.isTaxDataChecked) AS isTaxDataChecked,
- MAX(p.hasComponentLack) AS hasComponentLack,
- MAX(p.isTooLittle) AS isTooLittle,
- MAX(p.itemDelay) AS itemDelay,
- MAX(p.itemLost) AS itemLost,
- 0 AS totalProblems
+ MAX(p.isFreezed) isFreezed,
+ MAX(p.risk) risk,
+ MAX(p.hasHighRisk) hasHighRisk,
+ MAX(p.hasTicketRequest) hasTicketRequest,
+ MAX(p.itemShortage) itemShortage,
+ MIN(p.isTaxDataChecked) isTaxDataChecked,
+ MAX(p.hasComponentLack) hasComponentLack,
+ MAX(p.isTooLittle) isTooLittle,
+ MAX(p.itemDelay) itemDelay,
+ MAX(p.hasRounding) hasRounding,
+ MAX(p.itemLost) itemLost,
+ 0 totalProblems
FROM tmp.sale_problems p
GROUP BY ticketFk;
@@ -72143,6 +71611,7 @@ BEGIN
(tp.itemDelay) +
(tp.isTooLittle) +
(tp.itemLost) +
+ (tp.hasRounding) +
(tp.itemShortage)
);
@@ -72334,14 +71803,14 @@ BEGIN
CALL addressTaxArea ();
- IF vTaxArea > '' THEN
+ IF vTaxArea IS NOT NULL THEN
UPDATE tmp.addressTaxArea
SET areaFk = vTaxArea;
END IF;
+
/* Solo se calcula la base imponible (taxableBase) y el impuesto se calculará posteriormente
* No se debería cambiar el sistema por problemas con los decimales
*/
-
DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax;
CREATE TEMPORARY TABLE tmp.ticketTax
(PRIMARY KEY (ticketFk, code, rate))
@@ -72349,7 +71818,7 @@ BEGIN
SELECT * FROM (
SELECT tmpTicket.ticketFk,
bp.pgcFk,
- SUM(s.quantity * s.price * (100 - s.discount)/100 ) AS taxableBase,
+ SUM(s.quantity * s.price * (100 - s.discount)/100 ) taxableBase,
pgc.rate,
tc.code,
bp.priority
@@ -72369,7 +71838,7 @@ BEGIN
JOIN pgc ON pgc.code = bp.pgcFk
JOIN taxClass tc ON tc.id = bp.taxClassFk
GROUP BY tmpTicket.ticketFk, pgc.code, pgc.rate
- HAVING taxableBase != 0) t3
+ HAVING taxableBase <> 0) t3
ORDER BY priority;
DROP TEMPORARY TABLE IF EXISTS tmp.ticketServiceTax;
@@ -72378,7 +71847,7 @@ BEGIN
ENGINE = MEMORY
SELECT tt.ticketFk,
pgc.code pgcFk,
- SUM(ts.quantity * ts.price) AS taxableBase,
+ SUM(ts.quantity * ts.price) taxableBase,
pgc.rate,
tc.code
FROM tmp.ticket tt
@@ -72394,7 +71863,7 @@ BEGIN
JOIN pgc ON pgc.code = bp.pgcFk
JOIN taxClass tc ON tc.id = bp.taxClassFk
GROUP BY tt.ticketFk, pgc.code
- HAVING taxableBase != 0;
+ HAVING taxableBase <> 0;
INSERT INTO tmp.ticketTax (ticketFk, pgcFk, taxableBase, rate, code)
SELECT ts.ticketFk, ts.pgcFk, ts.taxableBase, ts.rate, ts.code
@@ -72580,38 +72049,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `ticket_merge` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_merge`(vSelf INT, vTicketTargetFk INT)
-BEGIN
-/**
- * Fusiona el primer ticket al segundo.
- *
- * @param vSelf Número de ticket a fusionar
- * @param vTicketTargetFk Ticket destino
- *
- */
- UPDATE vn.sale s
- SET s.ticketFk = vTicketTargetFk
- WHERE s.ticketFk = vSelf;
-
- UPDATE vn.ticket t
- SET t.shipped = TIMESTAMPADD(YEAR, - YEAR(util.VN_NOW()) MOD 2000, t.shipped )
- WHERE t.id = vSelf;
-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 PROCEDURE IF EXISTS `ticket_priceDifference` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -72725,20 +72162,31 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_recalc`(vTicketId INT)
-BEGIN
+CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_recalc`(vSelf INT, vTaxArea VARCHAR(25))
+proc:BEGIN
/**
* Calcula y guarda el total con/sin IVA en un ticket.
*
* @param vTicketId Identificador del ticket
*/
+ DECLARE hasInvoice BOOL;
+
+ SELECT COUNT(*) INTO hasInvoice
+ FROM ticket
+ WHERE id = vSelf
+ AND refFk IS NOT NULL;
+
+ IF hasInvoice THEN
+ LEAVE proc;
+ END IF;
+
DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
CREATE TEMPORARY TABLE tmp.ticket
ENGINE = MEMORY
- SELECT vTicketId ticketFk;
+ SELECT vSelf ticketFk;
- CALL ticketGetTotal;
+ CALL ticketGetTotal(vTaxArea);
UPDATE ticket t
JOIN tmp.ticketTotal tt ON tt.ticketFk = t.id
@@ -73393,10 +72841,10 @@ BEGIN
b.id businessFk,
w.userFk,
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,
- IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.start,5), " - ", LEFT(j.end,5) ORDER BY j.end ASC SEPARATOR ' - ')) timeTable,
- IF(j.start = NULL, 0, IFNULL(SUM(TIME_TO_SEC(j.end)) - SUM(TIME_TO_SEC(j.start)), 0)) timeWorkSeconds,
+ 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,
@@ -73408,7 +72856,7 @@ BEGIN
JOIN tmp.`user` u ON u.userFK = w.userFK
LEFT JOIN workCenter wc ON wc.id = b.workcenterFK
LEFT JOIN calendarType ct ON ct.id = b.calendarTypeFk
- LEFT JOIN postgresql.journey j ON j.business_id = b.id AND j.day_id = WEEKDAY(t.dated) + 1
+ 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
@@ -73416,14 +72864,14 @@ BEGIN
)sub;
UPDATE tmp.timeBusinessCalculate t
- LEFT JOIN postgresql.journey j ON j.business_id = t.businessFk
+ 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 j.journey_id IS NULL ;
+ 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) ,
@@ -73611,9 +73059,9 @@ BEGIN
* @param vDatedFrom
* @param vDatedTo
* Cálculo de horas trabajadas por empleado y día,
- * sin tener encuenta los días con fichadas incorrectas según la tabla tmp.timeControlError
- * En el caso de haber hecho descanso y hacer jornada intensiva,
- * se añade al tiempo de trabajo efectivo un descanso el valor de vBreakTime
+ * 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),
+ * se añade al tiempo de trabajo efectivo el descanso (vBreakTime)
* @return tmp.timeControlCalculate
* (workerFk, dated, timeWorkSeconds, timeWorkSexagesimal, timeWorkDecimal, timed)
*/
@@ -73622,15 +73070,13 @@ BEGIN
DECLARE vDatedToTomorrow DATETIME;
DECLARE vTimeToBreakTime INT;
DECLARE vBreakTime INT;
- DECLARE vBreakTimeSplitDay INT;
- DECLARE vDateSplitDay DATE;
SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY)
INTO vDatedFromYesterday, vDatedToTomorrow;
- SELECT timeToBreakTime, breakTime, breakTimeSplitDay, dateSplitDay
- INTO vTimeToBreakTime, vBreakTime, vBreakTimeSplitDay, vDateSplitDay
- FROM workerTimeControlConfig LIMIT 1;
+ SELECT timeToBreakTime, breakTime INTO vTimeToBreakTime, vBreakTime
+ FROM workerTimeControlConfig
+ LIMIT 1;
CALL timeControl_getError(vDatedFrom, vDatedTo);
@@ -73661,7 +73107,6 @@ BEGIN
`direction` enum('in', 'out','middle')
) ENGINE=MEMORY;
-
SET @counter := 0;
SET @vIsOdd := FALSE;
@@ -73749,27 +73194,19 @@ BEGIN
(INDEX (userFk), INDEX (dated))
ENGINE = MEMORY
SELECT sub.userFk,
- sub.dated,
- SUM(isSplitDay) isSplitDay
+ sub.dated
FROM (SELECT (@vIsOdd := NOT @vIsOdd),
IF(wtc.direction = 'in', @vIsOdd := TRUE, NULL),
- IF(@vIsOdd AND direction <> 'in'
- AND UNIX_TIMESTAMP(wtc.timed) - @previousTimed > vBreakTimeSplitDay,
- TRUE,
- FALSE
- ) isSplitDay,
IF(@vIsOdd, @vLastTimed := UNIX_TIMESTAMP(wtc.timed), NULL),
IF(@vIsOdd, 0, UNIX_TIMESTAMP(wtc.timed) - @vLastTimed) timeWork,
IF(direction='in', @vDated := DATE(wtc.timed), @vDated) dated,
- @previousTimed := UNIX_TIMESTAMP(wtc.timed),
wtc.userFk
FROM tmp.workerTimeControl wtc
ORDER BY wtc.userFk, wtc.timed, wtc.id
LIMIT 10000000000000000000
)sub
GROUP BY sub.userFk, sub.dated
- HAVING SUM(sub.timeWork) >= vTimeToBreakTime
- AND (NOT isSplitDay OR dated < vDateSplitDay);
+ HAVING SUM(sub.timeWork) >= vTimeToBreakTime;
SET @vIsOdd := TRUE;
SET @vDated := 0;
@@ -74107,54 +73544,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `travelLog_add` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `travelLog_add`(
- vChangedModel VARCHAR(45),
- vOriginFk INT,
- vChangedModelId INT,
- vActionCode VARCHAR(45),
- vChangedModelValue VARCHAR(255),
- vOldInstance JSON,
- vNewInstance JSON)
-BEGIN
-/**
- * Guarda las acciones realizadas por el usuario
- *
- * @param vChangedModel Nombre que hace referencia a la tabla que se modifica
- * @param vOriginFk Id del registro de la tabla origen
- * @param vChangedModelId Id del registro de la tabla a la que se realiza la acción
- * @param vActionCode Código de la acción {insert | delete | update}
- * @param vOldInstance JSON que contiene los valores viejos
- * @param vNewInstance JSON que contiene los valores nuevos
- */
- CALL util.log_cleanInstances(vActionCode, vOldInstance, vNewInstance);
-
- IF !(vOldInstance = '{}' AND vNewInstance = '{}') THEN
- INSERT INTO travelLog SET
- changedModel = vChangedModel,
- originFk = vOriginFk,
- changedModelId = vChangedModelId,
- `action` = vActionCode,
- changedModelValue = vChangedModelValue,
- oldInstance = vOldInstance,
- newInstance = vNewInstance,
- userFk = account.myUser_getId();
- END IF;
-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 PROCEDURE IF EXISTS `travelVolume` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -74301,6 +73690,36 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `travel_checkWarehouseIsFeedStock` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_checkWarehouseIsFeedStock`(vWarehouseFk INT)
+proc: BEGIN
+/*
+ * Check that the warehouse is not Feed Stock
+ *
+ * @vWarehouseFk param warehouse id
+ */
+ IF vWarehouseFk IS NULL THEN
+ LEAVE proc;
+ END IF;
+
+ IF (SELECT isFeedStock FROM warehouse WHERE id = vWarehouseFk) THEN
+ CALL util.throw('Cannot create a travel with a source warehouse marked isFeedStock');
+ END IF;
+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 PROCEDURE IF EXISTS `travel_clone` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -74460,11 +73879,11 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET character_set_client = utf8mb3 */ ;
+/*!50003 SET character_set_results = utf8mb3 */ ;
+/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_doRecalc`()
BEGIN
@@ -74598,10 +74017,6 @@ BEGIN
JOIN tmp.travel ttr ON ttr.id = tr.id
SET tr.landed = TIMESTAMPADD(DAY, 1, tr.landed);
- INSERT INTO travelLog (originFk, userFk , action, description)
- SELECT ttr.id, account.myUser_getId(), 'update', CONCAT('Se ha cambiado la fecha del travel al dia ', util.tomorrow())
- FROM tmp.travel ttr;
-
OPEN vCur;
l: LOOP
@@ -74872,6 +74287,36 @@ BEGIN
UPDATE vn.item SET upToDown = 0 WHERE item.id = vItemFk;
+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 PROCEDURE IF EXISTS `vehicle_checkNumberPlate` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`localhost` PROCEDURE `vehicle_checkNumberPlate`(vNumberPlate VARCHAR(10), vCountryCodeFk VARCHAR(2))
+BEGIN
+/**
+ * Comprueba si la matricula pasada tiene el formato correcto dependiendo del pais del vehiculo
+ */
+ DECLARE vRegex VARCHAR(45);
+
+ 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;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -75821,52 +75266,6 @@ DELIMITER ;
/*!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 PROCEDURE IF EXISTS `workerLog_add` */;
-/*!50003 SET @saved_cs_client = @@character_set_client */ ;
-/*!50003 SET @saved_cs_results = @@character_set_results */ ;
-/*!50003 SET @saved_col_connection = @@collation_connection */ ;
-/*!50003 SET character_set_client = utf8mb4 */ ;
-/*!50003 SET character_set_results = utf8mb4 */ ;
-/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`localhost` PROCEDURE `workerLog_add`(
- vChangedModel VARCHAR(45),
- vOriginFk INT,
- vChangedModelId INT,
- vActionCode VARCHAR(45),
- vOldInstance JSON,
- vNewInstance JSON)
-BEGIN
-/**
- * Guarda las acciones realizadas por el usuario
- *
- * @param vChangedModel Nombre que hace referencia a la tabla que se modifica
- * @param vOriginFk Id del registro de la tabla origen
- * @param vChangedModelId Id del registro de la tabla a la que se realiza la acción
- * @param vActionCode Código de la acción {insert | delete | update}
- * @param vOldInstance JSON que contiene los valores viejos
- * @param vNewInstance JSON que contiene los valores nuevos
- */
- CALL util.log_cleanInstances(vActionCode, vOldInstance, vNewInstance);
-
- IF !(vOldInstance = '{}' AND vNewInstance = '{}') THEN
- INSERT INTO workerLog SET
- changedModel = vChangedModel,
- originFk = vOriginFk,
- changedModelId = vChangedModelId,
- `action` = vActionCode,
- oldInstance = vOldInstance,
- newInstance = vNewInstance,
- userFk = account.myUser_getId();
- END IF;
-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 PROCEDURE IF EXISTS `workerMistakeType_get` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -78422,7 +77821,7 @@ BEGIN
zoneFk INT,
PRIMARY KEY zoneFkk (zoneFk, geoFk),
INDEX(geoFk))
- ENGINE = MEMORY;
+ ENGINE = MyISAM;
OPEN cur1;
cur1Loop: LOOP
@@ -79451,12 +78850,12 @@ USE `account`;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8mb4 */;
-/*!50001 SET character_set_results = utf8mb4 */;
-/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
+/*!50001 SET character_set_client = utf8mb3 */;
+/*!50001 SET character_set_results = utf8mb3 */;
+/*!50001 SET collation_connection = utf8mb3_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `accountDovecot` AS select `u`.`name` AS `name`,`u`.`bcryptPassword` AS `password` from (`user` `u` join `account` `a` on(`a`.`id` = `u`.`id`)) where `u`.`active` <> 0 */;
+/*!50001 VIEW `accountDovecot` AS select `u`.`name` AS `name`,`u`.`password` AS `password` from (`user` `u` join `account` `a` on(`a`.`id` = `u`.`id`)) where `u`.`active` <> 0 */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -79733,6 +79132,25 @@ USE `hedera`;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
+--
+-- Final view structure for view `messageL10n`
+--
+
+/*!50001 DROP TABLE IF EXISTS `messageL10n`*/;
+/*!50001 DROP VIEW IF EXISTS `messageL10n`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8mb4 */;
+/*!50001 SET character_set_results = utf8mb4 */;
+/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `messageL10n` AS select `m`.`code` AS `code`,ifnull(`mi`.`description`,`m`.`description`) AS `description` from (`message` `m` left join `messageI18n` `mi` on(`mi`.`code` = `m`.`code` and `mi`.`lang` = `util`.`LANG`())) */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
--
-- Final view structure for view `myAddress`
--
@@ -80194,25 +79612,6 @@ USE `sage`;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
---
--- Final view structure for view `invoiceInList`
---
-
-/*!50001 DROP TABLE IF EXISTS `invoiceInList`*/;
-/*!50001 DROP VIEW IF EXISTS `invoiceInList`*/;
-/*!50001 SET @saved_cs_client = @@character_set_client */;
-/*!50001 SET @saved_cs_results = @@character_set_results */;
-/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8mb4 */;
-/*!50001 SET character_set_results = utf8mb4 */;
-/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
-/*!50001 CREATE ALGORITHM=UNDEFINED */
-/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `invoiceInList` AS select `vn`.`invoiceIn`.`id` AS `id`,`vn`.`invoiceIn`.`supplierRef` AS `supplierRef`,`vn`.`invoiceIn`.`serial` AS `serial`,`vn`.`invoiceIn`.`supplierFk` AS `supplierFk`,`vn`.`invoiceIn`.`issued` AS `issued`,if(`vn`.`invoiceIn`.`expenceFkDeductible` > 0,1,0) AS `isVatDeductible`,`vn`.`invoiceIn`.`serialNumber` AS `serialNumber` from `vn`.`invoiceIn` where `vn`.`invoiceIn`.`issued` >= date_format(`util`.`VN_CURDATE`(),'%Y-01-01') + interval -1 year union all select `vn`.`dua`.`id` AS `id`,`vn`.`dua`.`code` AS `code`,'D' AS `D`,`c`.`id` AS `supplierFk`,`vn`.`dua`.`issued` AS `issued`,0 AS `FALSE`,`vn`.`dua`.`id` AS `serialNumber` from (`vn`.`dua` join `vn`.`company` `c` on(`c`.`code` = 'VNL')) */;
-/*!50001 SET character_set_client = @saved_cs_client */;
-/*!50001 SET character_set_results = @saved_cs_results */;
-/*!50001 SET collation_connection = @saved_col_connection */;
-
--
-- Final view structure for view `supplierLastThreeMonths`
--
@@ -80304,12 +79703,12 @@ USE `salix`;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8mb4 */;
-/*!50001 SET character_set_results = utf8mb4 */;
-/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
+/*!50001 SET character_set_client = utf8mb3 */;
+/*!50001 SET character_set_results = utf8mb3 */;
+/*!50001 SET collation_connection = utf8mb3_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `User` AS select `account`.`user`.`id` AS `id`,`account`.`user`.`realm` AS `realm`,`account`.`user`.`name` AS `username`,`account`.`user`.`bcryptPassword` AS `password`,`account`.`user`.`email` AS `email`,`account`.`user`.`emailVerified` AS `emailVerified`,`account`.`user`.`verificationToken` AS `verificationToken` from `account`.`user` */;
+/*!50001 VIEW `User` AS select `account`.`user`.`id` AS `id`,`account`.`user`.`realm` AS `realm`,`account`.`user`.`name` AS `username`,`account`.`user`.`password` AS `password`,`account`.`user`.`email` AS `email`,`account`.`user`.`emailVerified` AS `emailVerified`,`account`.`user`.`verificationToken` AS `verificationToken` from `account`.`user` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -80607,9 +80006,9 @@ USE `vn`;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8mb3 */;
-/*!50001 SET character_set_results = utf8mb3 */;
-/*!50001 SET collation_connection = utf8mb3_general_ci */;
+/*!50001 SET character_set_client = utf8mb4 */;
+/*!50001 SET character_set_results = utf8mb4 */;
+/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `companyL10n` AS select `c`.`id` AS `id`,ifnull(`ci`.`footnotes`,`c`.`footnotes`) AS `footnotes` from (`company` `c` left join `companyI18n` `ci` on(`ci`.`companyFk` = `c`.`id` and `ci`.`lang` = `util`.`LANG`())) */;
@@ -80631,7 +80030,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `defaulter` AS select `d`.`clientFk` AS `clientFk`,`d`.`created` AS `created`,`d`.`amount` AS `amount`,`d`.`defaulterSinced` AS `defaulterSinced`,`d`.`hasChanged` AS `hasChanged` from `bs`.`defaulter` `d` */;
+/*!50001 VIEW `defaulter` AS select `d`.`clientFk` AS `clientFk`,`d`.`created` AS `created`,`d`.`amount` AS `amount`,`d`.`defaulterSinced` AS `defaulterSinced`,`d`.`hasChanged` AS `hasChanged`,`c`.`countryFk` AS `country`,`c`.`payMethodFk` AS `payMethod` from (((`bs`.`defaulter` `d` join `vn`.`client` `c` on(`c`.`id` = `d`.`clientFk`)) join `vn`.`country` `co` on(`co`.`id` = `c`.`countryFk`)) join `vn`.`payMethod` `pm` on(`pm`.`id` = `c`.`payMethodFk`)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -80802,7 +80201,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `expeditionCommon` AS select `et`.`id` AS `truckFk`,`et`.`ETD` AS `etd`,ifnull(ucase(`et`.`description`),'SIN ESCANEAR') AS `description`,`es`.`palletFk` AS `palletFk`,`t`.`routeFk` AS `routeFk`,`es`.`id` AS `scanFk`,`e`.`id` AS `expeditionFk`,`r`.`expeditionTruckFk` AS `expeditionTruckFk`,`t`.`warehouseFk` AS `warehouseFk`,`e`.`created` AS `lastPacked`,`t`.`id` AS `ticketFk` from (((((`expeditionTruck` `et` left join `routesMonitor` `r` on(`et`.`id` = `r`.`expeditionTruckFk`)) left join `ticket` `t` on(`r`.`routeFk` = `t`.`routeFk`)) left join `expedition` `e` on(`t`.`id` = `e`.`ticketFk`)) left join `expeditionScan` `es` on(`e`.`id` = `es`.`expeditionFk`)) left join `expeditionPallet` `ep` on(`es`.`palletFk` = `ep`.`id`)) where `et`.`ETD` >= `util`.`VN_CURDATE`() */;
+/*!50001 VIEW `expeditionCommon` AS select `et`.`id` AS `truckFk`,`et`.`eta` AS `eta`,ifnull(ucase(`et`.`description`),'SIN ESCANEAR') AS `description`,`es`.`palletFk` AS `palletFk`,`t`.`routeFk` AS `routeFk`,`es`.`id` AS `scanFk`,`e`.`id` AS `expeditionFk`,`r`.`expeditionTruckFk` AS `expeditionTruckFk`,`t`.`warehouseFk` AS `warehouseFk`,`e`.`created` AS `lastPacked`,`t`.`id` AS `ticketFk` from (((((`expeditionTruck` `et` left join `routesMonitor` `r` on(`et`.`id` = `r`.`expeditionTruckFk`)) left join `ticket` `t` on(`r`.`routeFk` = `t`.`routeFk`)) left join `expedition` `e` on(`t`.`id` = `e`.`ticketFk`)) left join `expeditionScan` `es` on(`e`.`id` = `es`.`expeditionFk`)) left join `expeditionPallet` `ep` on(`es`.`palletFk` = `ep`.`id`)) where `et`.`eta` >= `util`.`VN_CURDATE`() */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -80878,7 +80277,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `expeditionScan_Monitor` AS select `et`.`id` AS `truckFk`,`et`.`ETD` AS `ETD`,`et`.`description` AS `description`,`ep`.`id` AS `palletFk`,`ep`.`position` AS `position`,`ep`.`built` AS `built`,`es`.`id` AS `scanFk`,`es`.`expeditionFk` AS `expeditionFk`,`es`.`scanned` AS `scanned` from ((`expeditionTruck` `et` left join `expeditionPallet` `ep` on(`ep`.`truckFk` = `et`.`id`)) left join `expeditionScan` `es` on(`es`.`palletFk` = `ep`.`id`)) */;
+/*!50001 VIEW `expeditionScan_Monitor` AS select `et`.`id` AS `truckFk`,`et`.`eta` AS `ETD`,`et`.`description` AS `description`,`ep`.`id` AS `palletFk`,`ep`.`position` AS `position`,`ep`.`built` AS `built`,`es`.`id` AS `scanFk`,`es`.`expeditionFk` AS `expeditionFk`,`es`.`scanned` AS `scanned` from ((`expeditionTruck` `et` left join `expeditionPallet` `ep` on(`ep`.`truckFk` = `et`.`id`)) left join `expeditionScan` `es` on(`es`.`palletFk` = `ep`.`id`)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -80916,7 +80315,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `expeditionTicket_NoBoxes` AS select `t`.`id` AS `ticketFk`,`t`.`warehouseFk` AS `warehouseFk`,`t`.`routeFk` AS `routeFk`,`et`.`description` AS `description` from (((`ticket` `t` left join `expedition` `e` on(`e`.`ticketFk` = `t`.`id`)) join `routesMonitor` `rm` on(`rm`.`routeFk` = `t`.`routeFk`)) join `expeditionTruck` `et` on(`et`.`id` = `rm`.`expeditionTruckFk`)) where `e`.`id` is null and `et`.`ETD` > `util`.`VN_CURDATE`() */;
+/*!50001 VIEW `expeditionTicket_NoBoxes` AS select `t`.`id` AS `ticketFk`,`t`.`warehouseFk` AS `warehouseFk`,`t`.`routeFk` AS `routeFk`,`et`.`description` AS `description` from (((`ticket` `t` left join `expedition` `e` on(`e`.`ticketFk` = `t`.`id`)) join `routesMonitor` `rm` on(`rm`.`routeFk` = `t`.`routeFk`)) join `expeditionTruck` `et` on(`et`.`id` = `rm`.`expeditionTruckFk`)) where `e`.`id` is null and `et`.`eta` > `util`.`VN_CURDATE`() */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -80954,7 +80353,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `expeditionTruck_Control` AS select `e`.`truckFk` AS `id`,`e`.`etd` AS `ETD`,`e`.`description` AS `description`,count(distinct if(`e`.`expeditionFk` is null,`e`.`ticketFk`,NULL)) AS `ticketsSinBultos`,count(distinct `e`.`palletFk`) AS `pallets`,count(distinct `e`.`routeFk`) AS `routes`,count(distinct `e`.`scanFk`) AS `scans`,count(distinct `e`.`expeditionFk`) AS `expeditions`,sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,max(`e`.`lastPacked`) AS `lastPacked` from `expeditionCommon` `e` group by `e`.`truckFk` order by sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) desc,`e`.`etd` */;
+/*!50001 VIEW `expeditionTruck_Control` AS select `e`.`truckFk` AS `id`,`e`.`eta` AS `ETD`,`e`.`description` AS `description`,count(distinct if(`e`.`expeditionFk` is null,`e`.`ticketFk`,NULL)) AS `ticketsSinBultos`,count(distinct `e`.`palletFk`) AS `pallets`,count(distinct `e`.`routeFk`) AS `routes`,count(distinct `e`.`scanFk`) AS `scans`,count(distinct `e`.`expeditionFk`) AS `expeditions`,sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,max(`e`.`lastPacked`) AS `lastPacked` from `expeditionCommon` `e` group by `e`.`truckFk` order by sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) desc,`e`.`eta` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -80973,7 +80372,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `expeditionTruck_Control_Detail` AS select `e`.`truckFk` AS `id`,`e`.`etd` AS `ETD`,`e`.`description` AS `destino`,`e`.`palletFk` AS `pallet`,count(distinct `e`.`routeFk`) AS `routes`,count(distinct `e`.`scanFk`) AS `scans`,count(distinct `e`.`expeditionTruckFk`) AS `destinos`,sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,max(`e`.`lastPacked`) AS `lastPacked` from `expeditionCommon` `e` group by `e`.`truckFk`,`e`.`palletFk` order by sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) desc,`e`.`etd`,`e`.`truckFk` */;
+/*!50001 VIEW `expeditionTruck_Control_Detail` AS select `e`.`truckFk` AS `id`,`e`.`eta` AS `eta`,`e`.`description` AS `destino`,`e`.`palletFk` AS `pallet`,count(distinct `e`.`routeFk`) AS `routes`,count(distinct `e`.`scanFk`) AS `scans`,count(distinct `e`.`expeditionTruckFk`) AS `destinos`,sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,max(`e`.`lastPacked`) AS `lastPacked` from `expeditionCommon` `e` group by `e`.`truckFk`,`e`.`palletFk` order by sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) desc,`e`.`eta`,`e`.`truckFk` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -80992,7 +80391,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `expeditionTruck_Control_Detail_Pallet` AS select `e`.`truckFk` AS `id`,`e`.`etd` AS `ETD`,`e`.`description` AS `destino`,`e`.`palletFk` AS `pallet`,`e`.`routeFk` AS `route`,count(distinct `e`.`scanFk`) AS `scans`,`et`.`description` AS `destinos`,sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,`e`.`expeditionTruckFk` AS `expeditionTruckFk`,max(`e`.`lastPacked`) AS `lastPacked` from (`expeditionCommon` `e` left join `expeditionTruck` `et` on(`et`.`id` = `e`.`expeditionTruckFk`)) group by `e`.`truckFk`,`e`.`palletFk`,`e`.`routeFk` order by sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) desc,`e`.`palletFk` */;
+/*!50001 VIEW `expeditionTruck_Control_Detail_Pallet` AS select `e`.`truckFk` AS `id`,`e`.`eta` AS `eta`,`e`.`description` AS `destino`,`e`.`palletFk` AS `pallet`,`e`.`routeFk` AS `route`,count(distinct `e`.`scanFk`) AS `scans`,`et`.`description` AS `destinos`,sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,`e`.`expeditionTruckFk` AS `expeditionTruckFk`,max(`e`.`lastPacked`) AS `lastPacked` from (`expeditionCommon` `e` left join `expeditionTruck` `et` on(`et`.`id` = `e`.`expeditionTruckFk`)) group by `e`.`truckFk`,`e`.`palletFk`,`e`.`routeFk` order by sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) desc,`e`.`palletFk` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -81771,7 +81170,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `routesReduced` AS select `et`.`description` AS `description`,`rm`.`name` AS `name`,`t`.`routeFk` AS `routeFk`,`et`.`ETD` AS `ETD`,`rm`.`bufferFk` AS `bufferFk`,`rm`.`beachFk` AS `beachFk`,`i`.`itemPackingTypeFk` AS `itempackingTypeFk` from (((((((`expeditionTruck` `et` join `routesMonitor` `rm` on(`rm`.`expeditionTruckFk` = `et`.`id`)) join `ticket` `t` on(`t`.`routeFk` = `rm`.`routeFk`)) join `ticketState` `ts` on(`ts`.`ticketFk` = `t`.`id`)) join `state` `st` on(`st`.`id` = `ts`.`stateFk`)) join `sale` `s` on(`s`.`ticketFk` = `t`.`id`)) join `item` `i` on(`i`.`id` = `s`.`itemFk`)) join `config` `c`) where `et`.`ETD` > `util`.`yesterday`() group by `t`.`routeFk` order by `et`.`ETD`,`t`.`routeFk` */;
+/*!50001 VIEW `routesReduced` AS select `et`.`description` AS `description`,`rm`.`name` AS `name`,`t`.`routeFk` AS `routeFk`,`et`.`eta` AS `eta`,`rm`.`bufferFk` AS `bufferFk`,`rm`.`beachFk` AS `beachFk`,`i`.`itemPackingTypeFk` AS `itempackingTypeFk` from (((((((`expeditionTruck` `et` join `routesMonitor` `rm` on(`rm`.`expeditionTruckFk` = `et`.`id`)) join `ticket` `t` on(`t`.`routeFk` = `rm`.`routeFk`)) join `ticketState` `ts` on(`ts`.`ticketFk` = `t`.`id`)) join `state` `st` on(`st`.`id` = `ts`.`stateFk`)) join `sale` `s` on(`s`.`ticketFk` = `t`.`id`)) join `item` `i` on(`i`.`id` = `s`.`itemFk`)) join `config` `c`) where `et`.`eta` > `util`.`yesterday`() group by `t`.`routeFk` order by `et`.`eta`,`t`.`routeFk` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -82393,12 +81792,12 @@ USE `vn`;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8mb4 */;
-/*!50001 SET character_set_results = utf8mb4 */;
-/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
+/*!50001 SET character_set_client = utf8mb3 */;
+/*!50001 SET character_set_results = utf8mb3 */;
+/*!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`,`u`.`bcryptPassword` AS `bcryptPassword`,`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`.`userFk` = `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 */;
@@ -82450,9 +81849,9 @@ USE `vn`;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8mb3 */;
-/*!50001 SET character_set_results = utf8mb3 */;
-/*!50001 SET collation_connection = utf8mb3_general_ci */;
+/*!50001 SET character_set_client = utf8mb4 */;
+/*!50001 SET character_set_results = utf8mb4 */;
+/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `zoneEstimatedDelivery` AS select `t`.`zoneFk` AS `zoneFk`,cast(`util`.`VN_CURDATE`() + interval hour(ifnull(`zc`.`hour`,`z`.`hour`)) * 60 + minute(ifnull(`zc`.`hour`,`z`.`hour`)) minute as time) AS `hourTheoretical`,cast(sum(`sv`.`volume`) as decimal(5,1)) AS `totalVolume`,cast(sum(if(`s`.`alertLevel` < 2,`sv`.`volume`,0)) as decimal(5,1)) AS `remainingVolume`,greatest(ifnull(`lhp`.`m3`,0),ifnull(`dl`.`minSpeed`,0)) AS `speed`,cast(`zc`.`hour` + interval -sum(if(`s`.`alertLevel` < 2,`sv`.`volume`,0)) * 60 / greatest(ifnull(`lhp`.`m3`,0),ifnull(`dl`.`minSpeed`,0)) minute as time) AS `hourEffective`,floor(-sum(if(`s`.`alertLevel` < 2,`sv`.`volume`,0)) * 60 / greatest(ifnull(`lhp`.`m3`,0),ifnull(`dl`.`minSpeed`,0))) AS `minutesLess`,cast(`zc`.`hour` + interval -sum(if(`s`.`alertLevel` < 2,`sv`.`volume`,0)) * 60 / greatest(ifnull(`lhp`.`m3`,0),ifnull(`dl`.`minSpeed`,0)) minute as time) AS `etc` from (((((((((`vn`.`ticket` `t` join `vn`.`ticketStateToday` `tst` on(`tst`.`ticket` = `t`.`id`)) join `vn`.`state` `s` on(`s`.`id` = `tst`.`state`)) join `vn`.`saleVolume` `sv` on(`sv`.`ticketFk` = `t`.`id`)) left join `vn`.`lastHourProduction` `lhp` on(`lhp`.`warehouseFk` = `t`.`warehouseFk`)) join `vn`.`warehouse` `w` on(`w`.`id` = `t`.`warehouseFk`)) join `vn`.`warehouseAlias` `wa` on(`wa`.`id` = `w`.`aliasFk`)) straight_join `vn`.`zone` `z` on(`z`.`id` = `t`.`zoneFk`)) left join `vn`.`zoneClosure` `zc` on(`zc`.`zoneFk` = `t`.`zoneFk` and `zc`.`dated` = `util`.`VN_CURDATE`())) left join `cache`.`departure_limit` `dl` on(`dl`.`warehouse_id` = `t`.`warehouseFk` and `dl`.`fecha` = `util`.`VN_CURDATE`())) where `w`.`hasProduction` <> 0 and cast(`t`.`shipped` as date) = `util`.`VN_CURDATE`() group by `t`.`zoneFk` */;
@@ -82469,4 +81868,4 @@ USE `vn`;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-05-16 8:23:56
+-- Dump completed on 2023-06-26 8:39:32
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 640a224cb..977c8a837 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -312,8 +312,8 @@ export default {
clientDefaulter: {
anyClient: 'vn-client-defaulter tbody > tr',
firstClientName: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(2) > span',
- firstSalesPersonName: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(3) > span',
- firstObservation: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(8) > vn-textarea[ng-model="defaulter.observation"]',
+ firstSalesPersonName: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(4) > span',
+ firstObservation: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(9) > vn-textarea[ng-model="defaulter.observation"]',
allDefaulterCheckbox: 'vn-client-defaulter thead vn-multi-check',
addObservationButton: 'vn-client-defaulter vn-button[icon="icon-notes"]',
observation: '.vn-dialog.shown vn-textarea[ng-model="$ctrl.defaulter.observation"]',
@@ -547,6 +547,7 @@ export default {
moreMenuMakeInvoice: '.vn-menu [name="makeInvoice"]',
moreMenuRegenerateInvoice: '.vn-menu [name="regenerateInvoice"]',
moreMenuChangeShippedHour: '.vn-menu [name="changeShipped"]',
+ moreMenuSMSOptions: '.vn-menu [name="smsOptions"]',
moreMenuPaymentSMS: '.vn-menu [name="sendPaymentSms"]',
moreMenuSendImportSms: '.vn-menu [name="sendImportSms"]',
SMStext: 'textarea[name="message"]',
@@ -894,6 +895,18 @@ export default {
extension: 'vn-worker-summary vn-one:nth-child(2) > vn-label-value:nth-child(5) > section > span',
},
+ department: {
+ firstDepartment: 'vn-worker-department-index vn-card > vn-treeview vn-treeview-childs vn-treeview-childs vn-treeview-childs a'
+ },
+ departmentSummary: {
+ header: 'vn-worker-department-summary h5',
+ name: 'vn-worker-department-summary vn-horizontal > vn-one > vn-vertical > vn-label-value:nth-child(1) > section > span',
+ code: 'vn-worker-department-summary vn-horizontal > vn-one > vn-vertical > vn-label-value:nth-child(2) > section > span',
+ chat: 'vn-worker-department-summary vn-horizontal > vn-one > vn-vertical > vn-label-value:nth-child(3) > section > span',
+ bossDepartment: 'vn-worker-department-summary vn-horizontal > vn-one > vn-vertical > vn-label-value:nth-child(4) > section > span',
+ email: 'vn-worker-department-summary vn-horizontal > vn-one > vn-vertical > vn-label-value:nth-child(5) > section > span',
+ clientFk: 'vn-worker-department-summary vn-horizontal > vn-one > vn-vertical > vn-label-value:nth-child(6) > section > span',
+ },
workerBasicData: {
name: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.firstName"]',
surname: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.lastName"]',
@@ -901,6 +914,13 @@ export default {
locker: 'vn-worker-basic-data vn-input-number[ng-model="$ctrl.worker.locker"]',
saveButton: 'vn-worker-basic-data button[type=submit]'
},
+ departmentBasicData: {
+ Name: 'vn-worker-department-basic-data vn-textfield[ng-model="$ctrl.department.name"]',
+ Code: 'vn-worker-department-basic-data vn-textfield[ng-model="$ctrl.department.code"]',
+ Chat: 'vn-worker-department-basic-data vn-textfield[ng-model="$ctrl.department.chat"]',
+ Email: 'vn-worker-department-basic-data vn-textfield[ng-model="$ctrl.department.notificationEmail"]',
+ saveButton: 'vn-worker-department-basic-data button[type=submit]'
+ },
workerNotes: {
addNoteFloatButton: 'vn-worker-note vn-icon[icon="add"]',
note: 'vn-note-worker-create vn-textarea[ng-model="$ctrl.note.text"]',
diff --git a/e2e/paths/01-salix/05_changePassword.spec.js b/e2e/paths/01-salix/05_changePassword.spec.js
index 6e4cfb7f3..950f773dd 100644
--- a/e2e/paths/01-salix/05_changePassword.spec.js
+++ b/e2e/paths/01-salix/05_changePassword.spec.js
@@ -16,6 +16,7 @@ describe('ChangePassword path', async() => {
await browser.close();
});
+ const badPassword = 'badpass';
const oldPassword = 'nightmare';
const newPassword = 'newPass.1234';
describe('Bad login', async() => {
@@ -37,13 +38,22 @@ describe('ChangePassword path', async() => {
expect(message.text).toContain('Invalid current password');
// Bad attempt: password not meet requirements
+ message = await page.sendForm($.form, {
+ oldPassword: oldPassword,
+ newPassword: badPassword,
+ repeatPassword: badPassword
+ });
+
+ expect(message.text).toContain('Password does not meet requirements');
+
+ // Bad attempt: same password
message = await page.sendForm($.form, {
oldPassword: oldPassword,
newPassword: oldPassword,
repeatPassword: oldPassword
});
- expect(message.text).toContain('Password does not meet requirements');
+ expect(message.text).toContain('You can not use the same password');
// Correct attempt: change password
message = await page.sendForm($.form, {
diff --git a/e2e/paths/02-client/07_edit_web_access.spec.js b/e2e/paths/02-client/07_edit_web_access.spec.js
index 3847ec7cd..c5e132ab7 100644
--- a/e2e/paths/02-client/07_edit_web_access.spec.js
+++ b/e2e/paths/02-client/07_edit_web_access.spec.js
@@ -39,9 +39,9 @@ describe('Client web access path', () => {
const userName = await page.getValue($.userName);
const email = await page.getValue($.email);
- await page.accessToSection('client.card.log');
- const logName = await page.innerText($.nameValue);
- const logActive = await page.innerText($.activeValue);
+ // await page.accessToSection('client.card.log');
+ // const logName = await page.innerText($.nameValue);
+ // const logActive = await page.innerText($.activeValue);
expect(enableMessage.type).toBe('success');
expect(modifyMessage.type).toBe('success');
@@ -50,7 +50,7 @@ describe('Client web access path', () => {
expect(userName).toEqual('Legion');
expect(email).toEqual('legion@marvel.com');
- expect(logName).toEqual('Legion');
- expect(logActive).toEqual('✗');
+ // expect(logName).toEqual('Legion');
+ // expect(logActive).toEqual('✗');
});
});
diff --git a/e2e/paths/03-worker/01-department/01_summary.spec.js b/e2e/paths/03-worker/01-department/01_summary.spec.js
new file mode 100644
index 000000000..e4bf8fc2d
--- /dev/null
+++ b/e2e/paths/03-worker/01-department/01_summary.spec.js
@@ -0,0 +1,29 @@
+import selectors from '../../../helpers/selectors.js';
+import getBrowser from '../../../helpers/puppeteer';
+
+describe('department summary path', () => {
+ let browser;
+ let page;
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('hr', 'worker');
+ await page.accessToSection('worker.department');
+ await page.doSearch('INFORMATICA');
+ await page.click(selectors.department.firstDepartment);
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should reach the employee summary section and check all properties', async() => {
+ expect(await page.waitToGetProperty(selectors.departmentSummary.header, 'innerText')).toEqual('INFORMATICA');
+ expect(await page.getProperty(selectors.departmentSummary.name, 'innerText')).toEqual('INFORMATICA');
+ expect(await page.getProperty(selectors.departmentSummary.code, 'innerText')).toEqual('it');
+ expect(await page.getProperty(selectors.departmentSummary.chat, 'innerText')).toEqual('informatica-cau');
+ expect(await page.getProperty(selectors.departmentSummary.bossDepartment, 'innerText')).toEqual('');
+ expect(await page.getProperty(selectors.departmentSummary.email, 'innerText')).toEqual('-');
+ expect(await page.getProperty(selectors.departmentSummary.clientFk, 'innerText')).toEqual('-');
+ });
+});
diff --git a/e2e/paths/03-worker/01-department/02-basicData.spec.js b/e2e/paths/03-worker/01-department/02-basicData.spec.js
new file mode 100644
index 000000000..219d1426c
--- /dev/null
+++ b/e2e/paths/03-worker/01-department/02-basicData.spec.js
@@ -0,0 +1,43 @@
+import getBrowser from '../../../helpers/puppeteer';
+import selectors from '../../../helpers/selectors.js';
+
+const $ = {
+ form: 'vn-worker-department-basic-data form',
+};
+
+describe('department summary path', () => {
+ let browser;
+ let page;
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('hr', 'worker');
+ await page.accessToSection('worker.department');
+ await page.doSearch('INFORMATICA');
+ await page.click(selectors.department.firstDepartment);
+ });
+
+ beforeEach(async() => {
+ await page.accessToSection('worker.department.card.basicData');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it(`should edit the department basic data and confirm the department data was edited`, async() => {
+ const values = {
+ Name: 'Informatica',
+ Code: 'IT',
+ Chat: 'informatica-cau',
+ Email: 'it@verdnatura.es',
+ };
+
+ await page.fillForm($.form, values);
+ const formValues = await page.fetchForm($.form, Object.keys(values));
+ const message = await page.sendForm($.form, values);
+
+ expect(message.isSuccess).toBeTrue();
+ expect(formValues).toEqual(values);
+ });
+});
diff --git a/e2e/paths/04-item/03_tax.spec.js b/e2e/paths/04-item/03_tax.spec.js
index 83f4e6bee..16cc1667d 100644
--- a/e2e/paths/04-item/03_tax.spec.js
+++ b/e2e/paths/04-item/03_tax.spec.js
@@ -19,7 +19,6 @@ describe('Item edit tax path', () => {
it(`should add the item tax to all countries`, async() => {
await page.autocompleteSearch(selectors.itemTax.firstClass, 'General VAT');
await page.autocompleteSearch(selectors.itemTax.secondClass, 'General VAT');
- await page.autocompleteSearch(selectors.itemTax.thirdClass, 'General VAT');
await page.waitToClick(selectors.itemTax.submitTaxButton);
const message = await page.waitForSnackbar();
@@ -40,13 +39,6 @@ describe('Item edit tax path', () => {
expect(secondVatType).toEqual('General VAT');
});
- it(`should confirm the third item tax class was edited`, async() => {
- const thirdVatType = await page
- .waitToGetProperty(selectors.itemTax.thirdClass, 'value');
-
- expect(thirdVatType).toEqual('General VAT');
- });
-
it(`should edit the first class without saving the form`, async() => {
await page.autocompleteSearch(selectors.itemTax.firstClass, 'Reduced VAT');
const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
diff --git a/e2e/paths/05-ticket/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js
index ca6fb8290..95a114c45 100644
--- a/e2e/paths/05-ticket/12_descriptor.spec.js
+++ b/e2e/paths/05-ticket/12_descriptor.spec.js
@@ -124,6 +124,7 @@ describe('Ticket descriptor path', () => {
describe('SMS', () => {
it('should send the payment SMS using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
+ await page.waitToClick(selectors.ticketDescriptor.moreMenuSMSOptions);
await page.waitToClick(selectors.ticketDescriptor.moreMenuPaymentSMS);
await page.waitForSelector(selectors.ticketDescriptor.SMStext);
await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 128);
@@ -134,8 +135,7 @@ describe('Ticket descriptor path', () => {
});
it('should send the import SMS using the descriptor menu', async() => {
- await page.waitToClick(selectors.ticketDescriptor.moreMenu);
- await page.waitForContentLoaded();
+ await page.waitToClick(selectors.ticketDescriptor.moreMenuSMSOptions);
await page.waitToClick(selectors.ticketDescriptor.moreMenuSendImportSms);
await page.waitForSelector(selectors.ticketDescriptor.SMStext);
await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 144);
diff --git a/e2e/paths/10-travel/03_descriptor.spec.js b/e2e/paths/10-travel/03_descriptor.spec.js
index 3752400c6..4723cc4a3 100644
--- a/e2e/paths/10-travel/03_descriptor.spec.js
+++ b/e2e/paths/10-travel/03_descriptor.spec.js
@@ -9,7 +9,7 @@ describe('Travel descriptor path', () => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'travel');
- await page.write(selectors.travelIndex.generalSearchFilter, '1');
+ await page.write(selectors.travelIndex.generalSearchFilter, '3');
await page.keyboard.press('Enter');
await page.waitForState('travel.card.summary');
});
@@ -23,7 +23,7 @@ describe('Travel descriptor path', () => {
await page.waitForState('travel.index');
const result = await page.countElement(selectors.travelIndex.anySearchResult);
- expect(result).toBeGreaterThanOrEqual(7);
+ expect(result).toBeGreaterThanOrEqual(1);
});
it('should navigate to the first search result', async() => {
diff --git a/e2e/paths/14-account/03_role_create_and_basic_data.spec.js b/e2e/paths/14-account/03_role_create_and_basic_data.spec.js
index 294a500ca..6acf82318 100644
--- a/e2e/paths/14-account/03_role_create_and_basic_data.spec.js
+++ b/e2e/paths/14-account/03_role_create_and_basic_data.spec.js
@@ -81,6 +81,6 @@ describe('Account Role create and basic data path', () => {
await page.accessToSection('account.role.card.inherited');
const rolesCount = await page.countElement(selectors.accountRoleInheritance.anyResult);
- expect(rolesCount).toEqual(6);
+ expect(rolesCount).toEqual(7);
});
});
diff --git a/front/core/services/auth.js b/front/core/services/auth.js
index ef6c07637..844a5145d 100644
--- a/front/core/services/auth.js
+++ b/front/core/services/auth.js
@@ -24,7 +24,7 @@ export default class Auth {
initialize() {
let criteria = {
to: state => {
- const outLayout = ['login', 'recover-password', 'reset-password', 'change-password'];
+ const outLayout = ['login', 'recover-password', 'reset-password', 'change-password', 'validate-email'];
return !outLayout.some(ol => ol == state.name);
}
};
@@ -59,12 +59,31 @@ export default class Auth {
password: password || undefined
};
- return this.$http.post('VnUsers/signIn', params)
- .then(json => this.onLoginOk(json, remember));
+ const now = new Date();
+ return this.$http.post('VnUsers/sign-in', params).then(
+ json => this.onLoginOk(json, now, remember));
}
- onLoginOk(json, remember) {
- this.vnToken.set(json.data.token, json.data.created, remember);
+ validateCode(user, password, code, remember) {
+ if (!user) {
+ let err = new UserError('Please enter your username');
+ err.code = 'EmptyLogin';
+ return this.$q.reject(err);
+ }
+
+ let params = {
+ user: user,
+ password: password || undefined,
+ code: code
+ };
+
+ const now = new Date();
+ return this.$http.post('VnUsers/validate-auth', params)
+ .then(json => this.onLoginOk(json, now, remember));
+ }
+
+ onLoginOk(json, now, remember) {
+ this.vnToken.set(json.data.token, now, json.data.ttl, remember);
return this.loadAcls().then(() => {
let continueHash = this.$state.params.continue;
diff --git a/front/core/services/interceptor.js b/front/core/services/interceptor.js
index 3f3d9912b..0c3253c69 100644
--- a/front/core/services/interceptor.js
+++ b/front/core/services/interceptor.js
@@ -1,11 +1,16 @@
import ngModule from '../module';
import HttpError from 'core/lib/http-error';
-interceptor.$inject = ['$q', 'vnApp', 'vnToken', '$translate'];
-function interceptor($q, vnApp, vnToken, $translate) {
+interceptor.$inject = ['$q', 'vnApp', '$translate'];
+function interceptor($q, vnApp, $translate) {
let apiPath = 'api/';
+ let token = sessionStorage.getItem('vnToken')
+ ?? localStorage.getItem('vnToken');
return {
+ setToken(newToken) {
+ token = newToken;
+ },
setApiPath(path) {
apiPath = path;
},
@@ -14,8 +19,8 @@ function interceptor($q, vnApp, vnToken, $translate) {
if (config.url.charAt(0) !== '/' && apiPath)
config.url = `${apiPath}${config.url}`;
- if (vnToken.token)
- config.headers.Authorization = vnToken.token;
+ if (token)
+ config.headers.Authorization = token;
if ($translate.use())
config.headers['Accept-Language'] = $translate.use();
if (config.filter) {
diff --git a/front/core/services/token.js b/front/core/services/token.js
index c1bb5a173..c4b644a89 100644
--- a/front/core/services/token.js
+++ b/front/core/services/token.js
@@ -6,37 +6,117 @@ import ngModule from '../module';
* @property {String} token The current login token or %null
*/
export default class Token {
- constructor() {
- try {
- this.token = sessionStorage.getItem('vnToken');
- this.created = sessionStorage.getItem('vnTokenCreated');
- if (!this.token) {
- this.token = localStorage.getItem('vnToken');
- this.created = localStorage.getItem('vnTokenCreated');
- }
- } catch (e) {}
- }
- set(token, created, remember) {
- this.unset();
- try {
- if (remember) {
- localStorage.setItem('vnToken', token);
- localStorage.setItem('vnTokenCreated', created);
- } else {
- sessionStorage.setItem('vnToken', token);
- sessionStorage.setItem('vnTokenCreated', created);
- }
- } catch (e) {}
+ constructor(vnInterceptor, $http, $rootScope) {
+ Object.assign(this, {
+ vnInterceptor,
+ $http,
+ $rootScope
+ });
- this.token = token;
- this.created = created;
+ try {
+ this.getStorage(sessionStorage);
+ this.remember = true;
+
+ if (!this.token) {
+ this.getStorage(localStorage);
+ this.remember = false;
+ }
+ } catch (e) {}
}
+
+ set(token, created, ttl, remember) {
+ this.unset();
+
+ Object.assign(this, {
+ token,
+ created,
+ ttl,
+ remember
+ });
+ this.vnInterceptor.setToken(token);
+ try {
+ if (remember)
+ this.setStorage(localStorage, token, created, ttl);
+ else
+ this.setStorage(sessionStorage, token, created, ttl);
+ } catch (err) {
+ console.error(err);
+ }
+ }
+
unset() {
- localStorage.removeItem('vnToken');
- sessionStorage.removeItem('vnToken');
this.token = null;
this.created = null;
+ this.ttl = null;
+ this.remember = null;
+ this.vnInterceptor.setToken(null);
+
+ this.removeStorage(localStorage);
+ this.removeStorage(sessionStorage);
+ }
+
+ getStorage(storage) {
+ this.token = storage.getItem('vnToken');
+ if (!this.token) return;
+ const created = storage.getItem('vnTokenCreated');
+ this.created = created && new Date(created);
+ this.renewPeriod = storage.getItem('vnTokenRenewPeriod');
+ }
+
+ setStorage(storage, token, created, ttl) {
+ storage.setItem('vnToken', token);
+ storage.setItem('vnTokenCreated', created.toJSON());
+ storage.setItem('vnTokenTtl', ttl);
+ }
+
+ removeStorage(storage) {
+ storage.removeItem('vnToken');
+ storage.removeItem('vnTokenCreated');
+ storage.removeItem('vnTokenTtl');
+ }
+
+ fetchConfig() {
+ const filter = {fields: ['renewInterval', 'renewPeriod']};
+ this.$http.get('AccessTokenConfigs/findOne', {filter}).then(res => {
+ const data = res.data;
+ if (!data) return;
+ this.renewPeriod = data.renewPeriod;
+ this.stopRenewer();
+ this.inservalId = setInterval(() => this.checkValidity(), data.renewInterval * 1000);
+ this.checkValidity();
+ });
+ }
+
+ checkValidity() {
+ if (this.checking || !this.created) return;
+ this.checking = true;
+ const renewPeriod = Math.min(this.ttl, this.renewPeriod) * 1000;
+ const maxDate = this.created.getTime() + renewPeriod;
+ const now = new Date();
+
+ if (now.getTime() <= maxDate) {
+ this.checking = false;
+ return;
+ }
+
+ this.$http.post('VnUsers/renewToken')
+ .then(res => {
+ const token = res.data;
+ this.set(token.id, now, token.ttl, this.remember);
+ })
+ .catch(res => {
+ if (res.data?.error?.code !== 'periodNotExceeded')
+ throw res;
+ })
+ .finally(() => {
+ this.checking = false;
+ });
+ }
+
+ stopRenewer() {
+ clearInterval(this.inservalId);
}
}
+Token.$inject = ['vnInterceptor', '$http', '$rootScope'];
ngModule.service('vnToken', Token);
diff --git a/front/salix/components/change-password/index.html b/front/salix/components/change-password/index.html
index 8d338d411..04f66976e 100644
--- a/front/salix/components/change-password/index.html
+++ b/front/salix/components/change-password/index.html
@@ -21,6 +21,14 @@
type="password"
autocomplete="false">
+
{{ $t('description') }}
++ {{ $t('device') }}: {{ device }} +
++ {{$t('ip')}}: {{ ip }} +
+{{ $t('Enter the following code to continue to your account') }}
+{{ $t('It expires in 5 minutes') }}
+