Merge branch 'dev' into 6414-testBackClient
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-02-21 09:29:45 +00:00
commit 7514348d13
87 changed files with 2646 additions and 4121 deletions

View File

@ -1,20 +0,0 @@
module.exports = Self => {
Self.remoteMethod('getSectors', {
description: 'Get all sectors',
accessType: 'READ',
returns: {
type: 'Object',
root: true
},
http: {
path: `/getSectors`,
verb: 'GET'
}
});
Self.getSectors = async() => {
const query = `CALL vn.sector_get()`;
const [result] = await Self.rawSql(query);
return result;
};
};

View File

@ -1,11 +0,0 @@
const {models} = require('vn-loopback/server/server');
describe('getSectors()', () => {
it('return list of sectors', async() => {
let response = await models.Collection.getSectors();
expect(response.length).toBeGreaterThan(0);
expect(response[0].id).toEqual(1);
expect(response[0].description).toEqual('First sector');
});
});

View File

@ -1,6 +1,5 @@
module.exports = Self => { module.exports = Self => {
require('../methods/collection/getCollection')(Self); require('../methods/collection/getCollection')(Self);
require('../methods/collection/getSectors')(Self);
require('../methods/collection/setSaleQuantity')(Self); require('../methods/collection/setSaleQuantity')(Self);
require('../methods/collection/previousLabel')(Self); require('../methods/collection/previousLabel')(Self);
require('../methods/collection/getTickets')(Self); require('../methods/collection/getTickets')(Self);

View File

@ -1,23 +1,6 @@
const models = require('vn-loopback/server/server').models; const models = require('vn-loopback/server/server').models;
describe('loopback model MailAliasAccount', () => { describe('loopback model MailAliasAccount', () => {
it('should fail to add a mail Alias if the worker doesnt have ACLs', async() => {
const tx = await models.MailAliasAccount.beginTransaction({});
let error;
try {
const options = {transaction: tx, accessToken: {userId: 57}};
await models.MailAliasAccount.create({mailAlias: 2, account: 5}, options);
await tx.rollback();
} catch (e) {
await tx.rollback();
error = e;
}
expect(error.message).toEqual('The alias cant be modified');
});
it('should add a mail Alias', async() => { it('should add a mail Alias', async() => {
const tx = await models.MailAliasAccount.beginTransaction({}); const tx = await models.MailAliasAccount.beginTransaction({});
let error; let error;

16
db/.pullinfo.json Normal file
View File

@ -0,0 +1,16 @@
{
"lastPull": "2024-02-15T08:58:24.000Z",
"shaSums": {
"srt": {
"view": {
"routePalletized": "765f8933a6a5a86dfe8f22825cc77351bc8620cdf1be9d3f25abb130460f3a61",
"ticketPalletized": "c327f3243e717cc607f01d3747967ba68158f90ef1038986b0aa6ae6d5ce7309"
}
},
"vn": {
"view": {
"expeditionPallet_Print": "288cbd6e8289df083ed5eb1a2c808f7a82ba4c90c8ad9781104808a7a54471fb"
}
}
}
}

View File

@ -0,0 +1,5 @@
DELETE FROM salix.ACL
WHERE model = 'MailAliasAccount'
AND property = 'canEditAlias'
AND principalType = 'ROLE'
AND principalId = 'marketingBoss';

View File

@ -3,8 +3,7 @@ USE `util`;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
INSERT INTO `version` VALUES ('salix','10230','53f69ae8e526a4a5d827c237a5b076d38507b392','2020-11-09 11:06:43',NULL); INSERT INTO `version` VALUES ('vn-database','10861','6685a201143a320920bbe04db7f8d0d1bd32d415','2024-02-15 10:04:54','10886');
INSERT INTO `version` VALUES ('vn-database','10818','b7edbbe12f35d0cbc3e6b83e54977ac1c8acfc74','2024-01-25 10:00:48','10831');
INSERT INTO `versionLog` VALUES ('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL);
@ -539,6 +538,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10757','00-firstScript.sql','jen
INSERT INTO `versionLog` VALUES ('vn-database','10758','00-sectorType.sql','jenkins@db-proxy1.static.verdnatura.es','2023-12-14 12:17:18',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10758','00-sectorType.sql','jenkins@db-proxy1.static.verdnatura.es','2023-12-14 12:17:18',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10758','01-dipole.sql','jenkins@db-proxy1.static.verdnatura.es','2023-12-14 12:17:18',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10758','01-dipole.sql','jenkins@db-proxy1.static.verdnatura.es','2023-12-14 12:17:18',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10758','02-agencyMode.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:32',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10758','02-agencyMode.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:32',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10758','03-item.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:44',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10761','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-11-16 09:30:58',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10761','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-11-16 09:30:58',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10764','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2024-01-04 12:07:59',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10764','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2024-01-04 12:07:59',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10768','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-11-30 13:11:37',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10768','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-11-30 13:11:37',NULL,NULL);
@ -546,6 +546,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10771','00-firstScript.sql','jen
INSERT INTO `versionLog` VALUES ('vn-database','10773','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-11-30 13:11:38',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10773','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-11-30 13:11:38',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10775','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2024-01-03 10:18:16',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10775','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2024-01-03 10:18:16',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10778','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-11-30 13:11:38',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10778','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2023-11-30 13:11:38',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10781','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10782','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2024-01-03 10:18:16',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10782','00-firstScript.sql','jenkins@db-proxy2.static.verdnatura.es','2024-01-03 10:18:16',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10783','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-11-24 14:49:17',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10783','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-11-24 14:49:17',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10784','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:32',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10784','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:32',NULL,NULL);
@ -574,7 +575,45 @@ INSERT INTO `versionLog` VALUES ('vn-database','10815','00-firstScript.sql','jen
INSERT INTO `versionLog` VALUES ('vn-database','10816','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:36',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10816','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:36',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10817','00-invoiceOutConfig_refLen.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-24 21:47:35',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10817','00-invoiceOutConfig_refLen.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-24 21:47:35',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10818','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:36',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10818','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-25 09:00:36',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10819','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10820','00-grants.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10825','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-01 10:24:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10827','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-23 12:32:13',NULL,NULL); INSERT INTO `versionLog` VALUES ('vn-database','10827','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-23 12:32:13',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10828','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10828','01-RevokeClientes_regalos_lista.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10832','00-util_tx_commit.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10832','00-util_tx_rollback.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10832','00-util_tx_start.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10832','01-update_procedure_TravelCloneWithEntries.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10832','02-grant_privileges_util_tx.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10838','00-createInventoryConfig.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-07 22:36:27',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10845','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10848','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','00-roleLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','01-userLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','02-entryLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','03-clientLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','04-itemLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','05-shelvingLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','06-workerLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','07-deviceProductionLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','08-zoneLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','09-rateLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','10-ticketLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','11-userLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','12-routeLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','13-claimLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','14-supplierLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','15-invoiceInLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','16-travelLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10849','17-packingSiteDeviceLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10851','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-01-30 13:31:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10853','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:46:05',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10853','00-secondScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:46:06',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10854','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-30 16:20:34',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10855','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:46:06',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10858','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:46:06',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10861','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:46:06',NULL,NULL);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@ -631,7 +670,7 @@ INSERT INTO `role` VALUES (57,'deliveryBoss','Jefe de personal de reparto',1,'20
INSERT INTO `role` VALUES (58,'packager','Departamento encajadores',1,'2019-01-21 13:43:45','2019-01-21 13:43:45',NULL); INSERT INTO `role` VALUES (58,'packager','Departamento encajadores',1,'2019-01-21 13:43:45','2019-01-21 13:43:45',NULL);
INSERT INTO `role` VALUES (59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 13:44:10','2019-01-21 13:44:10',NULL); INSERT INTO `role` VALUES (59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 13:44:10','2019-01-21 13:44:10',NULL);
INSERT INTO `role` VALUES (60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 14:29:01','2019-01-29 14:29:01',NULL); INSERT INTO `role` VALUES (60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 14:29:01','2019-01-29 14:29:01',NULL);
INSERT INTO `role` VALUES (61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 08:44:07','2019-07-01 08:44:07',NULL); INSERT INTO `role` VALUES (61,'replenisherBoss','Jefe de Complementos/Camara',1,'2019-07-01 08:44:07','2024-02-01 12:07:29',19336);
INSERT INTO `role` VALUES (62,'noLogin','Role without login access to MySQL',0,'2019-07-01 08:50:19','2019-07-02 15:42:05',NULL); INSERT INTO `role` VALUES (62,'noLogin','Role without login access to MySQL',0,'2019-07-01 08:50:19','2019-07-02 15:42:05',NULL);
INSERT INTO `role` VALUES (64,'balanceSheet','Consulta de Balance',0,'2019-07-16 14:12:08','2019-07-16 14:12:08',NULL); INSERT INTO `role` VALUES (64,'balanceSheet','Consulta de Balance',0,'2019-07-16 14:12:08','2019-07-16 14:12:08',NULL);
INSERT INTO `role` VALUES (65,'officeBoss','Jefe de filial',1,'2019-08-02 08:54:26','2019-08-02 08:54:26',NULL); INSERT INTO `role` VALUES (65,'officeBoss','Jefe de filial',1,'2019-08-02 08:54:26','2019-08-02 08:54:26',NULL);
@ -669,6 +708,7 @@ INSERT INTO `role` VALUES (124,'hrBuyer','Recursos Humanos con Buyer',1,'2023-10
INSERT INTO `role` VALUES (125,'claimViewer','Trabajadores que consulta las reclamaciones ',1,'2023-11-16 09:14:46','2023-11-16 09:14:46',10578); INSERT INTO `role` VALUES (125,'claimViewer','Trabajadores que consulta las reclamaciones ',1,'2023-11-16 09:14:46','2023-11-16 09:14:46',10578);
INSERT INTO `role` VALUES (126,'greenhouseBoss','Jefe de invernadero',1,'2023-11-16 14:32:13','2023-11-16 14:32:13',NULL); INSERT INTO `role` VALUES (126,'greenhouseBoss','Jefe de invernadero',1,'2023-11-16 14:32:13','2023-11-16 14:32:13',NULL);
INSERT INTO `role` VALUES (127,'timeControl','Tablet para fichar',1,'2024-01-09 16:36:56','2024-01-09 16:36:56',NULL); INSERT INTO `role` VALUES (127,'timeControl','Tablet para fichar',1,'2024-01-09 16:36:56','2024-01-09 16:36:56',NULL);
INSERT INTO `role` VALUES (129,'buyerAssistant','Comprador que tienes mas permisos para ayudar al buyerBoss en algunas tareas',1,'2024-02-06 06:59:12','2024-02-06 06:59:12',783);
INSERT INTO `roleInherit` VALUES (1,1,2,NULL); INSERT INTO `roleInherit` VALUES (1,1,2,NULL);
INSERT INTO `roleInherit` VALUES (2,1,3,NULL); INSERT INTO `roleInherit` VALUES (2,1,3,NULL);
@ -932,6 +972,7 @@ INSERT INTO `roleInherit` VALUES (355,127,11,NULL);
INSERT INTO `roleInherit` VALUES (356,123,125,NULL); INSERT INTO `roleInherit` VALUES (356,123,125,NULL);
INSERT INTO `roleInherit` VALUES (357,36,35,NULL); INSERT INTO `roleInherit` VALUES (357,36,35,NULL);
INSERT INTO `roleInherit` VALUES (358,36,49,NULL); INSERT INTO `roleInherit` VALUES (358,36,49,NULL);
INSERT INTO `roleInherit` VALUES (359,129,35,NULL);
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1); INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
@ -1508,7 +1549,7 @@ INSERT INTO `ACL` VALUES (676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','
INSERT INTO `ACL` VALUES (680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee'); INSERT INTO `ACL` VALUES (680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee'); INSERT INTO `ACL` VALUES (681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee'); INSERT INTO `ACL` VALUES (682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','itManagement'); INSERT INTO `ACL` VALUES (683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','developerBoss');
INSERT INTO `ACL` VALUES (684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement'); INSERT INTO `ACL` VALUES (684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement');
INSERT INTO `ACL` VALUES (685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement'); INSERT INTO `ACL` VALUES (685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement');
INSERT INTO `ACL` VALUES (686,'MailForward','*','*','ALLOW','ROLE','hr'); INSERT INTO `ACL` VALUES (686,'MailForward','*','*','ALLOW','ROLE','hr');
@ -1519,7 +1560,6 @@ INSERT INTO `ACL` VALUES (690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss')
INSERT INTO `ACL` VALUES (691,'Roadmap','*','*','ALLOW','ROLE','productionBoss'); INSERT INTO `ACL` VALUES (691,'Roadmap','*','*','ALLOW','ROLE','productionBoss');
INSERT INTO `ACL` VALUES (692,'ExpeditionTruck','*','*','ALLOW','ROLE','production'); INSERT INTO `ACL` VALUES (692,'ExpeditionTruck','*','*','ALLOW','ROLE','production');
INSERT INTO `ACL` VALUES (693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss'); INSERT INTO `ACL` VALUES (693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss');
INSERT INTO `ACL` VALUES (694,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','marketingBoss');
INSERT INTO `ACL` VALUES (695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee'); INSERT INTO `ACL` VALUES (695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee'); INSERT INTO `ACL` VALUES (696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative'); INSERT INTO `ACL` VALUES (697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative');
@ -1610,6 +1650,8 @@ INSERT INTO `ACL` VALUES (783,'WorkerTimeControl','resendWeeklyHourEmail','WRITE
INSERT INTO `ACL` VALUES (784,'VnRole','*','READ','ALLOW','ROLE','employee'); INSERT INTO `ACL` VALUES (784,'VnRole','*','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (785,'VnRole','*','WRITE','ALLOW','ROLE','it'); INSERT INTO `ACL` VALUES (785,'VnRole','*','WRITE','ALLOW','ROLE','it');
INSERT INTO `ACL` VALUES (786,'State','isAllEditable','READ','ALLOW','ROLE','delivery'); INSERT INTO `ACL` VALUES (786,'State','isAllEditable','READ','ALLOW','ROLE','delivery');
INSERT INTO `ACL` VALUES (787,'Ticket','makePdfList','*','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (788,'Ticket','invoiceTicketsAndPdf','*','ALLOW','ROLE','employee');
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee'); INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee'); INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
@ -1708,8 +1750,6 @@ USE `vn`;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
INSERT INTO `agencyTermConfig` VALUES ('6240000000','4721000015',21.0000000000,'Adquisiciones intracomunitarias de servicios');
INSERT INTO `alertLevel` VALUES ('FREE',0,1); INSERT INTO `alertLevel` VALUES ('FREE',0,1);
INSERT INTO `alertLevel` VALUES ('ON_PREPARATION',1,1); INSERT INTO `alertLevel` VALUES ('ON_PREPARATION',1,1);
INSERT INTO `alertLevel` VALUES ('PACKED',2,0); INSERT INTO `alertLevel` VALUES ('PACKED',2,0);
@ -1909,6 +1949,7 @@ INSERT INTO `component` VALUES (45,'maná reclamacion',7,4,NULL,0,'manaClaim',0)
INSERT INTO `component` VALUES (46,'recargo a particular',2,NULL,0.25,0,'individual',0); INSERT INTO `component` VALUES (46,'recargo a particular',2,NULL,0.25,0,'individual',0);
INSERT INTO `component` VALUES (47,'promocion Italia',4,NULL,NULL,1,'italianOffer',0); INSERT INTO `component` VALUES (47,'promocion Italia',4,NULL,NULL,1,'italianOffer',0);
INSERT INTO `component` VALUES (48,'fusión de lineas',4,NULL,NULL,1,'lineFusion',0); INSERT INTO `component` VALUES (48,'fusión de lineas',4,NULL,NULL,1,'lineFusion',0);
INSERT INTO `component` VALUES (49,'sustitución',4,NULL,NULL,1,'substitution',0);
INSERT INTO `componentType` VALUES (1,'coste',1,0,'COST'); INSERT INTO `componentType` VALUES (1,'coste',1,0,'COST');
INSERT INTO `componentType` VALUES (2,'com ventas',1,1,NULL); INSERT INTO `componentType` VALUES (2,'com ventas',1,1,NULL);
@ -1929,59 +1970,61 @@ INSERT INTO `continent` VALUES (3,'África','AF');
INSERT INTO `continent` VALUES (4,'Europa','EU'); INSERT INTO `continent` VALUES (4,'Europa','EU');
INSERT INTO `continent` VALUES (5,'Oceanía','OC'); INSERT INTO `continent` VALUES (5,'Oceanía','OC');
INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,106,763,0,0,0,0,28,NULL,'/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,110,763,0,0,0,0,28,NULL,'/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (22,'shopping','COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (22,'shopping','COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL,NULL); INSERT INTO `department` VALUES (23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL,NULL);
INSERT INTO `department` VALUES (31,'it','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (31,'it','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (35,'finance','FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (35,'finance','FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (36,'labor','LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (36,'labor','LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (37,'PROD','PRODUCCION',12,33,NULL,72,1,1,1,10,1,'/1/',NULL,0,NULL,0,1,1,1,NULL,NULL); INSERT INTO `department` VALUES (37,'PROD','PRODUCCION',12,35,NULL,72,1,1,1,11,1,'/1/',NULL,0,NULL,0,1,1,1,NULL,NULL);
INSERT INTO `department` VALUES (38,'picking','SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (38,'picking','SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (39,'packing','ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (39,'packing','ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',34,35,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',36,37,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (43,'VT','VENTAS',36,61,NULL,0,0,0,1,12,1,'/1/',NULL,1,'',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (43,'VT','VENTAS',38,65,NULL,0,0,0,1,13,1,'/1/',NULL,1,'',1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (44,'management','GERENCIA',62,63,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (44,'management','GERENCIA',66,67,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',64,65,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',68,69,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (46,'delivery','REPARTO',66,67,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL); INSERT INTO `department` VALUES (46,'delivery','REPARTO',70,71,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL);
INSERT INTO `department` VALUES (48,'storage','ALMACENAJE',68,69,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (48,'storage','ALMACENAJE',72,73,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (49,NULL,'PROPIEDAD',70,71,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (49,NULL,'PROPIEDAD',74,75,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (52,NULL,'CARGA AEREA',72,73,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (52,NULL,'CARGA AEREA',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (53,'marketing','MARKETING Y COMUNICACIÓN',74,75,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (53,'marketing','MARKETING Y COMUNICACIÓN',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (54,NULL,'ORNAMENTALES',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (54,NULL,'ORNAMENTALES',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (55,NULL,'TALLER NATURAL',19,20,14548,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1118,NULL); INSERT INTO `department` VALUES (55,NULL,'TALLER NATURAL',19,20,14548,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1118,NULL);
INSERT INTO `department` VALUES (56,NULL,'TALLER ARTIFICIAL',21,22,8470,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1927,NULL); INSERT INTO `department` VALUES (56,NULL,'TALLER ARTIFICIAL',21,22,8470,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1927,NULL);
INSERT INTO `department` VALUES (58,'CMP','CAMPOS',78,81,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (58,'CMP','CAMPOS',82,85,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',82,83,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL); INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',86,87,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL);
INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',84,85,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,1,0,0,NULL,NULL); INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',88,89,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,1,0,0,NULL,NULL);
INSERT INTO `department` VALUES (61,NULL,'VNH',86,89,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (61,NULL,'VNH',90,93,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (66,NULL,'VERDNAMADRID',90,91,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (66,NULL,'VERDNAMADRID',94,95,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (68,NULL,'COMPLEMENTOS',23,24,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL,NULL); INSERT INTO `department` VALUES (68,NULL,'COMPLEMENTOS',23,24,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL,NULL);
INSERT INTO `department` VALUES (69,NULL,'VERDNABARNA',92,93,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (69,NULL,'VERDNABARNA',96,97,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (80,NULL,'EQUIPO J VALLES',37,38,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (80,NULL,'EQUIPO J VALLES',39,40,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'equipojvalles@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (86,NULL,'LIMPIEZA',94,95,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (86,NULL,'LIMPIEZA',98,99,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (89,NULL,'COORDINACION',96,97,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (89,NULL,'COORDINACION',100,101,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (90,NULL,'TRAILER',87,88,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (90,NULL,'TRAILER',91,92,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (91,'artificial','ARTIFICIAL',25,26,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (91,'artificial','ARTIFICIAL',25,26,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (92,NULL,'EQUIPO SILVERIO',39,40,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (92,NULL,'EQUIPO SILVERIO',41,42,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (94,NULL,'EQUIPO J BROCAL',41,42,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (94,NULL,'EQUIPO J BROCAL',43,44,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',1,'equipojbrocal@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (95,NULL,'EQUIPO C ZAMBRANO',43,44,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (95,NULL,'EQUIPO C ZAMBRANO',45,46,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',1,'equipoczambrano@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (96,NULL,'EQUIPO C LOPEZ',45,46,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (96,NULL,'EQUIPO C LOPEZ',47,48,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (115,NULL,'EQUIPO CLAUDI',47,48,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (115,NULL,'EQUIPO CLAUDI',49,50,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (123,NULL,'EQUIPO ELENA BASCUÑANA',49,50,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (123,NULL,'EQUIPO ELENA BASCUÑANA',51,52,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',98,99,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',102,103,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (125,NULL,'EQUIPO MIRIAM MAR',51,52,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (125,NULL,'EQUIPO MIRIAM MAR',53,54,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',1,'equipomirgir@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',27,28,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL); INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',27,28,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL);
INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (130,NULL,'REVISION',31,32,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (130,NULL,'REVISION',31,32,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',79,80,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL); INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',83,84,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL);
INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',53,54,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',55,56,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',55,56,1731,72,0,0,2,0,43,'/1/43/','fra_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',57,58,1731,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'francia@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (134,NULL,'EQUIPO RODRI',57,58,6264,0,0,0,2,0,43,'/1/43/','rhr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',59,60,6264,0,0,0,2,0,43,'/1/43/','pt_equipo',1,'portugal@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',100,101,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',104,105,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',102,103,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',106,107,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (137,'sorter','SORTER',104,105,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (137,'sorter','SORTER',108,109,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (139,NULL,'EQUIPO MIRIAM MAR 2',59,60,3803,0,0,0,2,0,43,'/1/43/','mir2_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL,NULL); INSERT INTO `department` VALUES (139,NULL,'EQUIPO J SORIA ',61,62,3803,0,0,0,2,0,43,'/1/43/','jss_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (140,'hollandTeam','EQUIPO HOLANDA',63,64,NULL,0,0,0,2,0,43,'/1/43/','nl_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL);
INSERT INTO `department` VALUES (141,NULL,'PREVIA',33,34,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL);
INSERT INTO `docuware` VALUES (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N',NULL); INSERT INTO `docuware` VALUES (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N',NULL);
INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL); INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL);

View File

@ -108,7 +108,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','edi','buyer','item_feature','alexm
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','itemTag','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','itemTag','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','itemCategoryL10n','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','itemCategoryL10n','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','guest','warehouse','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','guest','warehouse','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Vistas','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','guest','Tipos','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','guest','Tipos','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','producer','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','producer','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','mdbVersion','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','mdbVersion','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
@ -300,7 +299,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','manager','v_botanic_expor
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionPlus','v_Articles_botanical','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionPlus','v_Articles_botanical','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Colores','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Colores','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Clientes','alexm@%','0000-00-00 00:00:00','Update',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Clientes','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','clientes_regalos_lista_enc','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','jerarquia','juan@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','jerarquia','juan@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','warehouse','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','warehouse','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerBusinessAgreement','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerBusinessAgreement','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
@ -335,7 +333,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','preservedBoss','travel','
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','travel','alexm@%','0000-00-00 00:00:00','Insert,Update',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','travel','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Cubos_Retorno','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Cubos_Retorno','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Cubos','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Cubos','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financialBoss','credit','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Cubos','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Cubos','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Cubos','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Cubos','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Cubos_Retorno','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Cubos_Retorno','alexm@%','0000-00-00 00:00:00','Select','');
@ -492,8 +489,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','Reservas
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','cmr','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','cmr','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Rutas','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Rutas','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','address','alexm@%','0000-00-00 00:00:00','Insert',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','address','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','Rutas_Master','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Rutas_monitor','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','address','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','address','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','accountingType','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','accountingType','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','itemShelvingStock_byWarehouse','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','itemShelvingStock_byWarehouse','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
@ -588,7 +583,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','marketingBoss','saleGoal','al
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','saleGroup','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','saleGroup','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','saleGroupDetail','alexm@%','0000-00-00 00:00:00','Delete',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','saleGroupDetail','alexm@%','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','account_detail','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','account_detail','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component_type','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Update',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component_type','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','employee','accion','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','employee','accion','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','volumeConfig','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','volumeConfig','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','currency','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','currency','alexm@%','0000-00-00 00:00:00','Select','');
@ -831,7 +826,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','printServerQueue__
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','artificialBoss','buy','alexm@%','0000-00-00 00:00:00','Update',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','artificialBoss','buy','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Movimientos','alexm@%','0000-00-00 00:00:00','Update',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Movimientos','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerAssist','buy','alexm@%','0000-00-00 00:00:00','Update',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerAssist','buy','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','tarifas','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','receipt','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','receipt','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','producer','alexm@%','0000-00-00 00:00:00','Update',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','producer','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','link','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','link','alexm@%','0000-00-00 00:00:00','Select','');
@ -969,7 +963,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','travel','alexm@%',
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','travelClonedWeekly','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','travelClonedWeekly','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','employee','facturacion_media_anual','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','bi','employee','facturacion_media_anual','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','travelObservation','alexm@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','travelObservation','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','tarifas','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','travelThermograph','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','travelThermograph','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','tillConfig','juan@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','tillConfig','juan@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','till','juan@%','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','till','juan@%','0000-00-00 00:00:00','Select','');
@ -1340,6 +1333,11 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','company','juan@db-p
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','grafana','buffer','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','srt','grafana','buffer','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','greuge','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select',''); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','greuge','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','item','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','','Select,Update'); INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','item','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','','Select,Update');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerBoss','itemShelving','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','negativeOrigin','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryBoss','Vehiculos_consumo','carlosap@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBos','project','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','ink','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */; /*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */; /*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
@ -1659,6 +1657,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','srt','production','expedition_scan'
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','buyer','historico_absoluto','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','buyer','historico_absoluto','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','buyer','historico_multiple','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','buyer','historico_multiple','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','client_getDebt','PROCEDURE','guillermo@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','client_getDebt','PROCEDURE','guillermo@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','tx_commit','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','hrBoss','balance_create','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','hrBoss','balance_create','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','cooler','buyultimate','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','cooler','buyultimate','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','grafana','firstdayofyear','FUNCTION','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','util','grafana','firstdayofyear','FUNCTION','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
@ -1812,7 +1811,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','account','guest','myuser_hasroutine
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','productionAssi','timebusiness_calculateall','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','productionAssi','timebusiness_calculateall','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','timecontrol_geterror','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','timecontrol_geterror','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','logistic','travel_weeklyclone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','logistic','travel_weeklyclone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','workerTimeControl_add','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_recalcPricesByBuy','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','coolerAssist','itemproposal','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','coolerAssist','itemproposal','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','company_getsuppliersdebt','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','company_getsuppliersdebt','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','agency','desglose_volume','PROCEDURE','juan@10.5.1.2','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','agency','desglose_volume','PROCEDURE','juan@10.5.1.2','Execute','0000-00-00 00:00:00');
@ -1827,7 +1826,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_UTC_TIMESTAMP','F
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemshelving_getsaledate','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemshelving_getsaledate','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','ticket_setState','PROCEDURE','guillermo@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','ticket_setState','PROCEDURE','guillermo@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','invoicing','invoiceout_new','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','invoicing','invoiceout_new','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','sale_replaceItem','PROCEDURE','jgallego@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','sale_replaceItem','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','ledger_next','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','ledger_next','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','deliveryAssistant','workerjourney_replace','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','deliveryAssistant','workerjourney_replace','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','account','developerBoss','role_sync','PROCEDURE','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','account','developerBoss','role_sync','PROCEDURE','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
@ -1940,7 +1939,12 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemShelving_getinf
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','collection_get','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','collection_get','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','item_comparative','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','item_comparative','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','sale_getBoxPickingList','PROCEDURE','guillermo@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','sale_getBoxPickingList','PROCEDURE','guillermo@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','worker_isInDepartment','FUNCTION','jgallego@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00'); INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','worker_isInDepartment','FUNCTION','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','tx_rollback','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','tx_start','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_recalcPrices','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_recalcPricesByAwb','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_recalcPricesByEntry','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
/*!40000 ALTER TABLE `procs_priv` ENABLE KEYS */; /*!40000 ALTER TABLE `procs_priv` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@ -1962,25 +1966,25 @@ INSERT IGNORE INTO `global_priv` VALUES ('','android','{\"access\":0,\"version_
INSERT IGNORE INTO `global_priv` VALUES ('','artificialBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','artificialBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','assetManager','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','assetManager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','buyer','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}'); INSERT IGNORE INTO `global_priv` VALUES ('','buyer','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','buyerBoss','{\"access\": 0, \"version_id\": 100707, \"is_role\": true}'); INSERT IGNORE INTO `global_priv` VALUES ('','buyerBoss','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','claimManager','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','claimManager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','cooler','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','cooler','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','coolerAssist','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','coolerAssist','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','coolerBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','coolerBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','customer','{\"access\": 0, \"max_questions\": 0, \"max_updates\": 30000, \"max_connections\": 300000, \"max_user_connections\": 400, \"max_statement_time\": 0.000000, \"is_role\": true,\"version_id\":100707}'); INSERT IGNORE INTO `global_priv` VALUES ('','customer','{\"access\": 0, \"max_questions\": 0, \"max_updates\": 30000, \"max_connections\": 300000, \"max_user_connections\": 400, \"max_statement_time\": 0.000000, \"is_role\": true,\"version_id\":100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','delivery','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','delivery','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','deliveryAssistant','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','deliveryAssistant','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','deliveryBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','deliveryBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','developer','{\"access\": 5909905728, \"is_role\": true, \"version_id\": 100707}'); INSERT IGNORE INTO `global_priv` VALUES ('','developer','{\"access\": 5909905728, \"is_role\": true, \"version_id\": 100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','developerBoss','{\"access\":33554432,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','developerBoss','{\"access\":33554432,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','employee','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}'); INSERT IGNORE INTO `global_priv` VALUES ('','employee','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
INSERT IGNORE INTO `global_priv` VALUES ('','entryEditor','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','entryEditor','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','ext','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}'); INSERT IGNORE INTO `global_priv` VALUES ('','ext','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','financial','{\"access\": 0, \"version_id\": 100707, \"is_role\": true}'); INSERT IGNORE INTO `global_priv` VALUES ('','financial','{\"access\": 0, \"version_id\": 100707, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','financialBoss','{\"access\": 0, \"version_id\": 100707, \"is_role\": true}'); INSERT IGNORE INTO `global_priv` VALUES ('','financialBoss','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','grafana','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','grafana','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','greenhouseBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','greenhouseBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','guest','{\"access\": 0, \"max_questions\": 40000, \"max_updates\": 1000, \"max_connections\": 150000, \"max_user_connections\": 200, \"max_statement_time\": 0.000000, \"is_role\": true, \"version_id\": 100707}'); INSERT IGNORE INTO `global_priv` VALUES ('','guest','{\"access\": 0, \"max_questions\": 40000, \"max_updates\": 1000, \"max_connections\": 150000, \"max_user_connections\": 200, \"max_statement_time\": 0.000000, \"is_role\": true, \"version_id\": 101106}');
INSERT IGNORE INTO `global_priv` VALUES ('','handmadeBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','handmadeBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','hedera-web','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','hedera-web','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','hr','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}'); INSERT IGNORE INTO `global_priv` VALUES ('','hr','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}');
@ -1989,10 +1993,10 @@ INSERT IGNORE INTO `global_priv` VALUES ('','invoicing','{\"access\":0,\"versio
INSERT IGNORE INTO `global_priv` VALUES ('','itBoss','{\"access\": 541165846527, \"is_role\": true, \"version_id\": 100707}'); INSERT IGNORE INTO `global_priv` VALUES ('','itBoss','{\"access\": 541165846527, \"is_role\": true, \"version_id\": 100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','itManagement','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','itManagement','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','itemPicker','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','itemPicker','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','logistic','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}'); INSERT IGNORE INTO `global_priv` VALUES ('','logistic','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
INSERT IGNORE INTO `global_priv` VALUES ('','logisticBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','logisticBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','maintenance','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','maintenance','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBos','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBos','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','manager','{\"access\":0,\"version_id\":100707,\"is_role\":true}'); INSERT IGNORE INTO `global_priv` VALUES ('','manager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','marketing','{\"access\": 0, \"is_role\": true}'); INSERT IGNORE INTO `global_priv` VALUES ('','marketing','{\"access\": 0, \"is_role\": true}');

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
-- MariaDB dump 10.19 Distrib 10.5.21-MariaDB, for debian-linux-gnu (x86_64) -- MariaDB dump 10.19 Distrib 10.5.23-MariaDB, for debian-linux-gnu (x86_64)
-- --
-- Host: db.verdnatura.es Database: account -- Host: db.verdnatura.es Database: account
-- ------------------------------------------------------ -- ------------------------------------------------------
@ -517,7 +517,7 @@ USE `bs`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `bs`.`clientNewBorn_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `bs`.`clientNewBorn_beforeUpdate`
BEFORE UPDATE ON `clientNewBorn` BEFORE UPDATE ON `clientNewBorn`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -540,7 +540,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `bs`.`nightTaskBeforeInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `bs`.`nightTask_beforeInsert`
BEFORE INSERT ON `nightTask` BEFORE INSERT ON `nightTask`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -566,7 +566,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `bs`.`nightTaskBeforeUpdate` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `bs`.`nightTask_beforeUpdate`
BEFORE UPDATE ON `nightTask` BEFORE UPDATE ON `nightTask`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -610,7 +610,7 @@ USE `edi`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`item_feature_bi` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`item_feature_beforeInsert`
BEFORE INSERT ON `item_feature` BEFORE INSERT ON `item_feature`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -632,7 +632,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`putOrder_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`putOrder_beforeInsert`
BEFORE INSERT ON `putOrder` BEFORE INSERT ON `putOrder`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -658,7 +658,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`BEFORE UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`putOrder_beforeUpdate`
BEFORE UPDATE ON `putOrder` BEFORE UPDATE ON `putOrder`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -708,7 +708,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`putOrder_AFTER_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`putOrder_afterUpdate`
AFTER UPDATE ON `putOrder` AFTER UPDATE ON `putOrder`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -795,7 +795,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`supplyResponse_AFTER_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `edi`.`supplyResponse_afterUpdate`
AFTER UPDATE ON `supplyResponse` AFTER UPDATE ON `supplyResponse`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -1412,7 +1412,7 @@ USE `sage`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `sage`.`movConta_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `sage`.`movConta_beforeUpdate`
BEFORE UPDATE ON `movConta` BEFORE UPDATE ON `movConta`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -1446,7 +1446,7 @@ USE `srt`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `srt`.`expedition_BU` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `srt`.`expedition_beforeUpdate`
BEFORE UPDATE ON `expedition` BEFORE UPDATE ON `expedition`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -1464,11 +1464,11 @@ DELIMITER ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = 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 @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `srt`.`moving_AI` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `srt`.`moving_afterInsert`
AFTER INSERT ON `moving` AFTER INSERT ON `moving`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -1924,7 +1924,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_BI` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_beforeInsert`
BEFORE INSERT ON `autonomy` BEFORE INSERT ON `autonomy`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -1946,7 +1946,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_BU` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_beforeUpdate`
BEFORE UPDATE ON `autonomy` BEFORE UPDATE ON `autonomy`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -1974,7 +1974,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_AD` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_afterDelete`
AFTER DELETE ON `autonomy` AFTER DELETE ON `autonomy`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -1994,7 +1994,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`awb_bi` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`awb_beforeInsert`
BEFORE INSERT ON `awb` BEFORE INSERT ON `awb`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -2059,7 +2059,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`budgetNotes_BeforeInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`budgetNotes_beforeInsert`
BEFORE INSERT ON `budgetNotes` BEFORE INSERT ON `budgetNotes`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -2551,6 +2551,70 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`calendar_beforeInsert`
BEFORE INSERT ON `calendar`
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`.`calendar_beforeUpdate`
BEFORE UPDATE ON `calendar`
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`.`calendar_afterDelete`
AFTER DELETE ON `calendar`
FOR EACH ROW
BEGIN
INSERT INTO workerLog
SET `action` = 'delete',
`changedModel` = 'Calendar',
`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 */ ;
/*!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`.`claim_beforeInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`claim_beforeInsert`
BEFORE INSERT ON `claim` BEFORE INSERT ON `claim`
FOR EACH ROW FOR EACH ROW
@ -3026,13 +3090,13 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`client_AfterInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`client_afterInsert`
AFTER INSERT ON `client` AFTER INSERT ON `client`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -3246,15 +3310,15 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER clientCredit_AfterInsert /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`clientCredit_afterInsert`
AFTER INSERT AFTER INSERT ON `clientCredit`
ON clientCredit FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
DECLARE vSender VARCHAR(50); DECLARE vSender VARCHAR(50);
@ -3501,7 +3565,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`collection_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`collection_beforeUpdate`
BEFORE UPDATE ON `collection` BEFORE UPDATE ON `collection`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -3743,7 +3807,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`country_AFTER_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`country_afterInsert`
AFTER INSERT ON `country` AFTER INSERT ON `country`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4414,7 +4478,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`duaTax_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`duaTax_beforeInsert`
BEFORE INSERT ON `duaTax` BEFORE INSERT ON `duaTax`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4435,7 +4499,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`duaTax_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`duaTax_beforeUpdate`
BEFORE UPDATE ON `duaTax` BEFORE UPDATE ON `duaTax`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4858,7 +4922,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionPallet_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionPallet_beforeInsert`
BEFORE INSERT ON `expeditionPallet` BEFORE INSERT ON `expeditionPallet`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4886,7 +4950,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionScan_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionScan_beforeInsert`
BEFORE INSERT ON `expeditionScan` BEFORE INSERT ON `expeditionScan`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4908,7 +4972,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionState_BeforeInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionState_beforeInsert`
BEFORE INSERT ON `expeditionState` BEFORE INSERT ON `expeditionState`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4922,15 +4986,15 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER expeditionState_AfterInsert /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionState_afterInsert`
AFTER INSERT AFTER INSERT ON `expeditionState`
ON expeditionState FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
UPDATE vn.expedition e UPDATE vn.expedition e
@ -4952,7 +5016,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionTruck_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionTruck_beforeInsert`
BEFORE INSERT ON `expeditionTruck` BEFORE INSERT ON `expeditionTruck`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4974,7 +5038,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionTruck_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionTruck_beforeUpdate`
BEFORE UPDATE ON `expeditionTruck` BEFORE UPDATE ON `expeditionTruck`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -4996,7 +5060,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`floramondoConfig_AFTER_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`floramondoConfig_afterInsert`
AFTER INSERT ON `floramondoConfig` AFTER INSERT ON `floramondoConfig`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -5122,7 +5186,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`invoiceIn_bi` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`invoiceIn_beforeInsert`
BEFORE INSERT ON `invoiceIn` BEFORE INSERT ON `invoiceIn`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -5186,7 +5250,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`invoiceIn_bu` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`invoiceIn_beforeUpdate`
BEFORE UPDATE ON `invoiceIn` BEFORE UPDATE ON `invoiceIn`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -5227,7 +5291,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`invoiceIn_au` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`invoiceIn_afterUpdate`
AFTER UPDATE ON `invoiceIn` AFTER UPDATE ON `invoiceIn`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -5665,14 +5729,6 @@ BEGIN
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
IF ISNULL(NEW.packingShelve) AND NOT ISNULL(NEW.packingOut) THEN
SELECT NEW.packingOut * vc.shelveVolume / vc.standardFlowerBox
INTO vNewPackingShelve
FROM vn.volumeConfig vc;
SET NEW.packingShelve = vNewPackingShelve;
END IF;
IF NEW.itemPackingTypeFk = '' THEN IF NEW.itemPackingTypeFk = '' THEN
SET NEW.itemPackingTypeFk = NULL; SET NEW.itemPackingTypeFk = NULL;
END IF; END IF;
@ -5867,7 +5923,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemCategory_AFTER_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemCategory_afterInsert`
AFTER INSERT ON `itemCategory` AFTER INSERT ON `itemCategory`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -5955,7 +6011,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_beforeInsert`
BEFORE INSERT ON `itemShelving` BEFORE INSERT ON `itemShelving`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -5977,7 +6033,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_AFTER_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_afterInsert`
AFTER INSERT ON `itemShelving` AFTER INSERT ON `itemShelving`
FOR EACH ROW FOR EACH ROW
INSERT INTO vn.itemShelvingLog( itemShelvingFk, INSERT INTO vn.itemShelvingLog( itemShelvingFk,
@ -6011,7 +6067,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_beforeUpdate`
BEFORE UPDATE ON `itemShelving` BEFORE UPDATE ON `itemShelving`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -6034,11 +6090,10 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_AFTER_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_afterUpdate`
AFTER UPDATE ON `itemShelving` AFTER UPDATE ON `itemShelving`
FOR EACH ROW FOR EACH ROW
INSERT INTO itemShelvingLog
INSERT INTO itemShelvingLog
SET itemShelvingFk = NEW.id, SET itemShelvingFk = NEW.id,
workerFk = account.myUser_getId(), workerFk = account.myUser_getId(),
accion = 'CAMBIO', accion = 'CAMBIO',
@ -6061,7 +6116,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_BEFORE_DELETE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_beforeDelete`
BEFORE DELETE ON `itemShelving` BEFORE DELETE ON `itemShelving`
FOR EACH ROW FOR EACH ROW
INSERT INTO vn.itemShelvingLog(itemShelvingFk, INSERT INTO vn.itemShelvingLog(itemShelvingFk,
@ -6106,13 +6161,13 @@ DELIMITER ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelvingSale_AFTER_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelvingSale_afterInsert`
AFTER INSERT ON `itemShelvingSale` AFTER INSERT ON `itemShelvingSale`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -6366,7 +6421,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`machine_BI` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`machine_beforeInsert`
BEFORE INSERT ON `machine` BEFORE INSERT ON `machine`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -6584,7 +6639,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`parking_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`parking_beforeInsert`
BEFORE INSERT ON `parking` BEFORE INSERT ON `parking`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -6606,7 +6661,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`parking_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`parking_beforeUpdate`
BEFORE UPDATE ON `parking` BEFORE UPDATE ON `parking`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -6935,13 +6990,13 @@ DELIMITER ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = 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 @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER projectNotes_BeforeInsert /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`projectNotes_beforeInsert`
BEFORE INSERT BEFORE INSERT ON `projectNotes`
ON projectNotes FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
IF ISNULL(NEW.userFk) THEN IF ISNULL(NEW.userFk) THEN
@ -7742,7 +7797,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`sale_BEFORE_DELETE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`sale_beforeDelete`
BEFORE DELETE ON `sale` BEFORE DELETE ON `sale`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -7832,7 +7887,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleBuy_beforeInsert`
BEFORE INSERT ON `saleBuy` BEFORE INSERT ON `saleBuy`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -7854,31 +7909,6 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleBuy_AI`
AFTER INSERT ON `saleBuy`
FOR EACH ROW
BEGIN
/* Activar de nuevo cuando volvamos a vender fruta y verdura
*
UPDATE vn.sale s
SET s.concept = CONCAT(s.concept, ' Lote: ', NEW.buyFk)
WHERE s.id = NEW.saleFk;
*/
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!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`.`saleGroup_beforeInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleGroup_beforeInsert`
BEFORE INSERT ON `saleGroup` BEFORE INSERT ON `saleGroup`
FOR EACH ROW FOR EACH ROW
@ -7943,7 +7973,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleTracking_After_Insert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleTracking_afterInsert`
AFTER INSERT ON `saleTracking` AFTER INSERT ON `saleTracking`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -8122,7 +8152,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`shelving_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`shelving_beforeUpdate`
BEFORE UPDATE ON `shelving` BEFORE UPDATE ON `shelving`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -8174,7 +8204,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`solunionCAP_AFTER_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`solunionCAP_afterInsert`
AFTER INSERT ON `solunionCAP` AFTER INSERT ON `solunionCAP`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -8197,7 +8227,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`solunionCAP_AFTER_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`solunionCAP_afterUpdate`
AFTER UPDATE ON `solunionCAP` AFTER UPDATE ON `solunionCAP`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -8227,7 +8257,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`solunionCAP_BEFORE_DELETE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`solunionCAP_beforeDelete`
BEFORE DELETE ON `solunionCAP` BEFORE DELETE ON `solunionCAP`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -8250,7 +8280,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`specie_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`specie_beforeInsert`
BEFORE INSERT ON `specie` BEFORE INSERT ON `specie`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -8270,7 +8300,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`specie_BEFORE_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`specie_beforeUpdate`
BEFORE UPDATE ON `specie` BEFORE UPDATE ON `specie`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -8582,7 +8612,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`tag_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`tag_beforeInsert`
BEFORE INSERT ON `tag` BEFORE INSERT ON `tag`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -9051,7 +9081,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketPackaging_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketPackaging_beforeInsert`
BEFORE INSERT ON `ticketPackaging` BEFORE INSERT ON `ticketPackaging`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -9117,7 +9147,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketParking_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketParking_beforeInsert`
BEFORE INSERT ON `ticketParking` BEFORE INSERT ON `ticketParking`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -9313,7 +9343,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketService_ai` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketService_afterInsert`
AFTER INSERT ON `ticketService` AFTER INSERT ON `ticketService`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -9355,7 +9385,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketService_au` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketService_afterUpdate`
AFTER UPDATE ON `ticketService` AFTER UPDATE ON `ticketService`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -9380,7 +9410,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketService_ad` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketService_afterDelete`
AFTER DELETE ON `ticketService` AFTER DELETE ON `ticketService`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -9450,7 +9480,7 @@ DELIMITER ;
/*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketTracking_beforeUpdate` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticketTracking_beforeUpdate`
BEFORE UPDATE ON `ticketTracking` BEFORE UPDATE ON `ticketTracking`
@ -9632,7 +9662,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`time_AFTER_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`time_afterUpdate`
AFTER UPDATE ON `time` AFTER UPDATE ON `time`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -10203,11 +10233,31 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`workerTimeControl_AI` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`workerTimeControl_beforeInsert`
BEFORE INSERT ON `workerTimeControl`
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`.`workerTimeControl_afterInsert`
AFTER INSERT ON `workerTimeControl` AFTER INSERT ON `workerTimeControl`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
IF NEW.timed > DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY) THEN IF NEW.timed > (util.VN_NOW() + INTERVAL 1 DAY) THEN
CALL util.throw('date in the future'); CALL util.throw('date in the future');
END IF; END IF;
END */;; END */;;
@ -10225,7 +10275,51 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`workingHoursBeforeInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`workerTimeControl_beforeUpdate`
BEFORE UPDATE ON `workerTimeControl`
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`.`workerTimeControl_afterDelete`
AFTER DELETE ON `workerTimeControl`
FOR EACH ROW
BEGIN
INSERT INTO workerLog
SET `action` = 'delete',
`changedModel` = 'WorkerTimeControl',
`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 */ ;
/*!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`.`workingHours_beforeInsert`
BEFORE INSERT ON `workingHours` BEFORE INSERT ON `workingHours`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -10375,7 +10469,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_BI` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_beforeInsert`
BEFORE INSERT ON `zoneExclusion` BEFORE INSERT ON `zoneExclusion`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -10397,7 +10491,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_BU` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_beforeUpdate`
BEFORE UPDATE ON `zoneExclusion` BEFORE UPDATE ON `zoneExclusion`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -10619,7 +10713,7 @@ USE `vn2008`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`Conteo_ai` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`Conteo_afterInsert`
AFTER INSERT ON `Conteo` AFTER INSERT ON `Conteo`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -10645,7 +10739,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`account_conciliacion_BEFORE_INSERT` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`account_conciliacion_beforeInsert`
BEFORE INSERT ON `account_conciliacion` BEFORE INSERT ON `account_conciliacion`
FOR EACH ROW FOR EACH ROW
set new.id_calculated = replace( set new.id_calculated = replace(
@ -10671,7 +10765,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`agency_hourBeforeInsert` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`agency_hour_beforeInsert`
BEFORE INSERT ON `agency_hour` BEFORE INSERT ON `agency_hour`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -10704,7 +10798,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`agency_hour_AFTER_UPDATE` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`agency_hour_afterUpdate`
AFTER UPDATE ON `agency_hour` AFTER UPDATE ON `agency_hour`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
@ -10734,7 +10828,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`awb_recibida_ad` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`awb_recibida_afterDelete`
AFTER DELETE ON `awb_recibida` AFTER DELETE ON `awb_recibida`
FOR EACH ROW FOR EACH ROW
IF (SELECT COUNT(*) FROM recibida_iva where recibida_id = OLD.recibida_id) = 0 IF (SELECT COUNT(*) FROM recibida_iva where recibida_id = OLD.recibida_id) = 0
@ -10759,10 +10853,9 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`movement_label_au` /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`movement_label_afterUpdate`
AFTER UPDATE ON `movement_label` AFTER UPDATE ON `movement_label`
FOR EACH ROW FOR EACH ROW
-- Edit trigger body code below this line. Do not edit lines above this one
IF NEW.stem >= (SELECT Cantidad FROM Movimientos WHERE Id_Movimiento = NEW.Id_Movimiento) THEN IF NEW.stem >= (SELECT Cantidad FROM Movimientos WHERE Id_Movimiento = NEW.Id_Movimiento) THEN
UPDATE Movimientos SET OK = 1 WHERE Id_Movimiento = NEW.Id_Movimiento; UPDATE Movimientos SET OK = 1 WHERE Id_Movimiento = NEW.Id_Movimiento;
END IF */;; END IF */;;
@ -10777,4 +10870,4 @@ DELIMITER ;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-01-25 16:24:46 -- Dump completed on 2024-02-15 10:21:45

View File

@ -653,6 +653,7 @@ INSERT INTO `vn`.`expense`(`id`, `name`, `isWithheld`)
(7001000000, 'Mercaderia', 0), (7001000000, 'Mercaderia', 0),
(7050000000, 'Prestacion de servicios', 1); (7050000000, 'Prestacion de servicios', 1);
INSERT INTO `vn`.`agencyTermConfig` VALUES ('6240000000','4721000015',21.0000000000,'Adquisiciones intracomunitarias de servicios');
INSERT INTO `vn`.`invoiceOutExpense`(`id`, `invoiceOutFk`, `amount`, `expenseFk`, `created`) INSERT INTO `vn`.`invoiceOutExpense`(`id`, `invoiceOutFk`, `amount`, `expenseFk`, `created`)
VALUES VALUES

View File

@ -47,12 +47,12 @@ BEGIN
, tp.reino_id , tp.reino_id
, a.tipo_id , a.tipo_id
, t.empresa_id , t.empresa_id
, 7000000000 , a.expenseFk
+ IF(e.empresa_grupo = e2.empresa_grupo + IF(e.empresa_grupo = e2.empresa_grupo
,1 ,1
,IF(e2.empresa_grupo,2,0) ,IF(e2.empresa_grupo,2,0)
) * 1000000 ) * 100000
+ tp.reino_id * 10000 as Gasto + tp.reino_id * 1000 as Gasto
FROM vn2008.Movimientos m FROM vn2008.Movimientos m
JOIN vn2008.Tickets t on t.Id_Ticket = m.Id_Ticket JOIN vn2008.Tickets t on t.Id_Ticket = m.Id_Ticket
JOIN vn2008.Consignatarios cs on cs.Id_Consigna = t.Id_Consigna JOIN vn2008.Consignatarios cs on cs.Id_Consigna = t.Id_Consigna

View File

@ -0,0 +1,13 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_commit`(isTx BOOL)
BEGIN
/**
* Confirma los cambios asociados a una transacción.
*
* @param isTx es true si existe transacción asociada
*/
IF isTx THEN
COMMIT;
END IF;
END$$
DELIMITER ;

View File

@ -0,0 +1,13 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_rollback`(isTx BOOL)
BEGIN
/**
* Deshace los cambios asociados a una transacción.
*
* @param isTx es true si existe transacción asociada
*/
IF isTx THEN
ROLLBACK;
END IF;
END$$
DELIMITER ;

View File

@ -0,0 +1,13 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_start`(isTx BOOL)
BEGIN
/**
* Inicia una transacción.
*
* @param isTx es true si existe transacción asociada
*/
IF isTx THEN
START TRANSACTION;
END IF;
END$$
DELIMITER ;

View File

@ -4,32 +4,25 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`hasAnyNegativeBase`(
DETERMINISTIC DETERMINISTIC
BEGIN BEGIN
/* Calcula si existe alguna base imponible negativa /**
* Requiere la tabla temporal tmp.ticketToInvoice(id) * Calcula si existe alguna base imponible negativa
* Requiere la tabla temporal tmp.ticketToInvoice(id) para getTaxBases()
* *
* returns BOOLEAN * returns BOOLEAN
*/ */
DECLARE hasAnyNegativeBase BOOLEAN; DECLARE hasAnyNegativeBase BOOLEAN;
DROP TEMPORARY TABLE IF EXISTS tmp.ticket; CALL getTaxBases();
CREATE TEMPORARY TABLE tmp.ticket
(KEY (ticketFk))
ENGINE = MEMORY
SELECT id ticketFk
FROM tmp.ticketToInvoice;
CALL ticket_getTax(NULL); SELECT negative INTO hasAnyNegativeBase
FROM tmp.taxBases
LIMIT 1;
SELECT COUNT(*) INTO hasAnyNegativeBase DROP TEMPORARY TABLE
FROM( tmp.ticketTax,
SELECT SUM(taxableBase) as taxableBase tmp.ticket,
FROM tmp.ticketTax tmp.taxBases;
GROUP BY pgcFk
HAVING taxableBase < 0
) t;
DROP TEMPORARY TABLE tmp.ticketTax;
DROP TEMPORARY TABLE tmp.ticket;
RETURN hasAnyNegativeBase; RETURN hasAnyNegativeBase;

View File

@ -0,0 +1,30 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`hasAnyPositiveBase`()
RETURNS tinyint(1)
DETERMINISTIC
BEGIN
/**
* Calcula si existe alguna base imponible positiva
* Requiere la tabla temporal tmp.ticketToInvoice(id) para getTaxBases()
*
* returns BOOLEAN
*/
DECLARE hasAnyPositiveBase BOOLEAN;
CALL getTaxBases();
SELECT positive INTO hasAnyPositiveBase
FROM tmp.taxBases
LIMIT 1;
DROP TEMPORARY TABLE
tmp.ticketTax,
tmp.ticket,
tmp.taxBases;
RETURN hasAnyPositiveBase;
END$$
DELIMITER ;

View File

@ -9,6 +9,7 @@ BEGIN
DECLARE v26Month DATE; DECLARE v26Month DATE;
DECLARE v3Month DATE; DECLARE v3Month DATE;
DECLARE vTrashId VARCHAR(15); DECLARE vTrashId VARCHAR(15);
DECLARE v2Years DATE;
DECLARE v5Years DATE; DECLARE v5Years DATE;
SET vDateShort = util.VN_CURDATE() - INTERVAL 2 MONTH; SET vDateShort = util.VN_CURDATE() - INTERVAL 2 MONTH;
@ -18,6 +19,7 @@ BEGIN
SET v18Month = util.VN_CURDATE() - INTERVAL 18 MONTH; SET v18Month = util.VN_CURDATE() - INTERVAL 18 MONTH;
SET v26Month = util.VN_CURDATE() - INTERVAL 26 MONTH; SET v26Month = util.VN_CURDATE() - INTERVAL 26 MONTH;
SET v3Month = util.VN_CURDATE() - INTERVAL 3 MONTH; SET v3Month = util.VN_CURDATE() - INTERVAL 3 MONTH;
SET v2Years = util.VN_CURDATE() - INTERVAL 2 YEAR;
SET v5Years = util.VN_CURDATE() - INTERVAL 5 YEAR; SET v5Years = util.VN_CURDATE() - INTERVAL 5 YEAR;
DELETE FROM ticketParking WHERE created < vDateShort; DELETE FROM ticketParking WHERE created < vDateShort;
@ -163,7 +165,11 @@ BEGIN
FROM tmp.duaToDelete tmp FROM tmp.duaToDelete tmp
JOIN vn.dua d ON d.id = tmp.id; JOIN vn.dua d ON d.id = tmp.id;
DELETE FROM vn.awb WHERE created < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE()); DELETE a
FROM vn.awb a
LEFT JOIN vn.travel t ON t.awbFk = a.id
WHERE a.created < v2Years
AND t.id IS NULL;
-- Borra los registros de collection y ticketcollection -- Borra los registros de collection y ticketcollection
DELETE FROM vn.collection WHERE created < vDateShort; DELETE FROM vn.collection WHERE created < vDateShort;

View File

@ -1,14 +1,18 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`duaInvoiceInBooking`(vDuaFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`duaInvoiceInBooking`(vDuaFk INT)
BEGIN BEGIN
/**
* Genera el asiento de un DUA y marca las entradas como confirmadas
*
* @param vDuaFk Id del dua a recalcular
*/
DECLARE done BOOL DEFAULT FALSE; DECLARE done BOOL DEFAULT FALSE;
DECLARE vInvoiceFk INT; DECLARE vInvoiceFk INT;
DECLARE vASIEN BIGINT DEFAULT 0; DECLARE vASIEN BIGINT DEFAULT 0;
DECLARE vCounter INT DEFAULT 0; DECLARE vCounter INT DEFAULT 0;
DECLARE rs CURSOR FOR DECLARE rs CURSOR FOR
SELECT e.invoiceInFk SELECT DISTINCT e.invoiceInFk
FROM entry e FROM entry e
JOIN duaEntry de ON de.entryFk = e.id JOIN duaEntry de ON de.entryFk = e.id
JOIN invoiceIn ii ON ii.id = e.invoiceInFk JOIN invoiceIn ii ON ii.id = e.invoiceInFk
@ -44,13 +48,13 @@ BEGIN
IF vCounter > 0 OR vASIEN > 0 THEN IF vCounter > 0 OR vASIEN > 0 THEN
UPDATE vn.XDiario x UPDATE vn2008.XDiario x
JOIN vn.ledgerConfig lc ON lc.lastBookEntry = x.ASIEN JOIN ledgerConfig lc ON lc.lastBookEntry = x.ASIEN
SET x.ASIEN = vASIEN; SET x.ASIEN = vASIEN;
ELSE ELSE
SELECT lastBookEntry INTO vASIEN FROM vn.ledgerConfig; SELECT lastBookEntry INTO vASIEN FROM ledgerConfig;
END IF; END IF;

View File

@ -0,0 +1,32 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`getTaxBases`()
BEGIN
/**
* Calcula y devuelve en número de bases imponibles postivas y negativas
* Requiere la tabla temporal tmp.ticketToInvoice(id)
*
* returns tmp.taxBases
*/
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
(KEY (ticketFk))
ENGINE = MEMORY
SELECT id ticketFk
FROM tmp.ticketToInvoice;
CALL ticket_getTax(NULL);
DROP TEMPORARY TABLE IF EXISTS tmp.taxBases;
CREATE TEMPORARY TABLE tmp.taxBases
ENGINE = MEMORY
SELECT
SUM(taxableBase > 0) as positive,
SUM(taxableBase < 0) as negative
FROM(
SELECT SUM(taxableBase) taxableBase
FROM tmp.ticketTax
GROUP BY pgcFk
) t;
END$$
DELIMITER ;

View File

@ -1,120 +1,115 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`inventoryMake`(vDate DATE, vWh INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`inventoryMake`(vInventoryDate DATE)
proc: BEGIN BEGIN
/** /**
* Recalcula los inventarios de todos los almacenes, si vWh = 0 * Recalculate the inventories
* *
* @param vDate Fecha de los nuevos inventarios * @param vInventoryDate date for the new inventory
* @param vWh almacen al cual hacer el inventario
*/ */
DECLARE vDone BOOL; DECLARE vDone BOOL;
DECLARE vEntryFk INT; DECLARE vEntryFk INT;
DECLARE vTravelFk INT; DECLARE vTravelFk INT;
DECLARE vDateLastInventory DATE; DECLARE vDateLastInventory DATE;
DECLARE vDateYesterday DATETIME DEFAULT vDate - INTERVAL 1 SECOND; DECLARE vDateYesterday DATETIME DEFAULT vInventoryDate - INTERVAL 1 SECOND;
DECLARE vWarehouseOutFkInventory INT; DECLARE vWarehouseOutFkInventory INT;
DECLARE vInventorySupplierFk INT; DECLARE vInventorySupplierFk INT;
DECLARE vAgencyModeFkInventory INT; DECLARE vAgencyModeFkInventory INT;
DECLARE vMaxRecentInventories INT;
DECLARE vWarehouseFk INT;
DECLARE cWarehouses CURSOR FOR DECLARE cWarehouses CURSOR FOR
SELECT id SELECT id
FROM warehouse FROM warehouse
WHERE isInventory WHERE isInventory;
AND vWh IN (0,id);
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
RESIGNAL;
END;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
SELECT inventorySupplierFk INTO vInventorySupplierFk FROM entryConfig LIMIT 1;
SELECT inventoried INTO vDateLastInventory FROM config LIMIT 1;
SELECT maxRecentInventories,
warehouseOutFk,
agencyModeFk
INTO vMaxRecentInventories,
vWarehouseOutFkInventory,
vAgencyModeFkInventory
FROM inventoryConfig
LIMIT 1;
IF vDateLastInventory IS NULL
OR vInventorySupplierFk IS NULL
OR vMaxRecentInventories IS NULL
OR vInventoryDate IS NULL
OR vWarehouseOutFkInventory IS NULL
OR vAgencyModeFkInventory IS NULL THEN
CALL util.throw('Some config parameters are not set');
END IF;
START TRANSACTION;
OPEN cWarehouses; OPEN cWarehouses;
-- Environment variable to disable the triggers of the affected tables
SET @isModeInventory := TRUE; SET @isModeInventory := TRUE;
l: LOOP l: LOOP
SET vDone = FALSE; SET vDone = FALSE;
FETCH cWarehouses INTO vWh; SET vEntryFk = NULL;
SET vTravelFk = NULL;
FETCH cWarehouses INTO vWarehouseFk;
IF vDone THEN IF vDone THEN
LEAVE l; LEAVE l;
END IF; END IF;
SELECT w.id INTO vWarehouseOutFkInventory -- Generate travel, if it does not exist
FROM warehouse w
WHERE w.code = 'inv';
SELECT inventorySupplierFk INTO vInventorySupplierFk
FROM entryConfig;
SELECT am.id INTO vAgencyModeFkInventory
FROM agencyMode am
where code = 'inv';
SELECT MAX(landed) INTO vDateLastInventory
FROM travel tr
JOIN entry e ON e.travelFk = tr.id
JOIN buy b ON b.entryFk = e.id
WHERE warehouseOutFk = vWarehouseOutFkInventory
AND landed < vDate
AND e.supplierFk = vInventorySupplierFk
AND warehouseInFk = vWh
AND NOT isRaid;
IF vDateLastInventory IS NULL THEN
SELECT inventoried INTO vDateLastInventory FROM config;
END IF;
-- Generamos travel, si no existe.
SET vTravelFK = 0;
SELECT id INTO vTravelFk SELECT id INTO vTravelFk
FROM travel FROM travel
WHERE warehouseOutFk = vWarehouseOutFkInventory WHERE warehouseOutFk = vWarehouseOutFkInventory
AND warehouseInFk = vWh AND warehouseInFk = vWarehouseFk
AND landed = vDate AND landed = vInventoryDate
AND agencyModeFk = vAgencyModeFkInventory AND agencyModeFk = vAgencyModeFkInventory
AND ref = 'inventario' AND ref = 'inventario'
LIMIT 1; LIMIT 1;
IF NOT vTravelFK THEN IF vTravelFk IS NULL THEN
INSERT INTO travel
INSERT INTO travel SET SET warehouseOutFk = vWarehouseOutFkInventory,
warehouseOutFk = vWarehouseOutFkInventory, warehouseInFk = vWarehouseFk,
warehouseInFk = vWh, shipped = vInventoryDate,
shipped = vDate, landed = vInventoryDate,
landed = vDate,
agencyModeFk = vAgencyModeFkInventory, agencyModeFk = vAgencyModeFkInventory,
ref = 'inventario', ref = 'inventario',
isDelivered = TRUE, isDelivered = TRUE,
isReceived = TRUE; isReceived = TRUE;
SELECT LAST_INSERT_ID() INTO vTravelFk; SELECT LAST_INSERT_ID() INTO vTravelFk;
END IF; END IF;
-- Generamos entrada si no existe, o la vaciamos. -- Generate an entry if it does not exist, or we empty it
SET vEntryFk = 0;
SELECT id INTO vEntryFk SELECT id INTO vEntryFk
FROM entry FROM entry
WHERE supplierFk = vInventorySupplierFk WHERE supplierFk = vInventorySupplierFk
AND travelFk = vTravelFk; AND travelFk = vTravelFk;
IF NOT vEntryFk THEN IF vEntryFk IS NULL THEN
INSERT INTO entry
INSERT INTO entry SET SET supplierFk = vInventorySupplierFk,
supplierFk = vInventorySupplierFk,
isConfirmed = TRUE, isConfirmed = TRUE,
isOrdered = TRUE, isOrdered = TRUE,
travelFk = vTravelFk; travelFk = vTravelFk;
SELECT LAST_INSERT_ID() INTO vEntryFk; SELECT LAST_INSERT_ID() INTO vEntryFk;
ELSE ELSE
DELETE FROM buy WHERE entryFk = vEntryFk; DELETE FROM buy WHERE entryFk = vEntryFk;
END IF; END IF;
-- Preparamos tabla auxilar -- Prepare the auxiliary table
CREATE OR REPLACE TEMPORARY TABLE tmp.inventory ( CREATE OR REPLACE TEMPORARY TABLE tInventory (
itemFk INT(11) NOT NULL PRIMARY KEY, itemFk INT(11) NOT NULL PRIMARY KEY,
quantity int(11) DEFAULT '0', quantity int(11) DEFAULT '0',
buyingValue decimal(10,4) DEFAULT '0.0000', buyingValue decimal(10,4) DEFAULT '0.0000',
@ -130,53 +125,51 @@ proc: BEGIN
price3 decimal(10,2) DEFAULT '0.00', price3 decimal(10,2) DEFAULT '0.00',
minPrice decimal(10,2) DEFAULT '0.00', minPrice decimal(10,2) DEFAULT '0.00',
producer varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, producer varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
INDEX (itemFK)) ENGINE = MEMORY; INDEX (itemFK)
) ENGINE = MEMORY;
-- Compras -- Buys
INSERT INTO tmp.inventory(itemFk,quantity) INSERT INTO tInventory(itemFk, quantity)
SELECT b.itemFk, SUM(b.quantity) SELECT b.itemFk, SUM(b.quantity)
FROM buy b FROM buy b
JOIN entry e ON e.id = b.entryFk JOIN entry e ON e.id = b.entryFk
JOIN travel tr ON tr.id = e.travelFk JOIN travel tr ON tr.id = e.travelFk
WHERE tr.warehouseInFk = vWh WHERE tr.warehouseInFk = vWarehouseFk
AND tr.landed BETWEEN vDateLastInventory AND tr.landed BETWEEN vDateLastInventory AND vDateYesterday
AND vDateYesterday
AND NOT isRaid AND NOT isRaid
GROUP BY b.itemFk; GROUP BY b.itemFk;
SELECT vDateLastInventory , vDateYesterday;
-- Traslados -- Transfers
INSERT INTO tmp.inventory(itemFk, quantity) INSERT INTO tInventory(itemFk, quantity)
SELECT itemFk, quantityOut SELECT itemFk, quantityOut
FROM ( FROM (
SELECT b.itemFk,- SUM(b.quantity) quantityOut SELECT b.itemFk,- SUM(b.quantity) quantityOut
FROM buy b FROM buy b
JOIN entry e ON e.id = b.entryFk JOIN entry e ON e.id = b.entryFk
JOIN travel tr ON tr.id = e.travelFk JOIN travel tr ON tr.id = e.travelFk
WHERE tr.warehouseOutFk = vWh WHERE tr.warehouseOutFk = vWarehouseFk
AND tr.shipped BETWEEN vDateLastInventory AND tr.shipped BETWEEN vDateLastInventory AND vDateYesterday
AND vDateYesterday
AND NOT isRaid AND NOT isRaid
GROUP BY b.itemFk GROUP BY b.itemFk
) sub ) sub
ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity, 0) + sub.quantityOut; ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity, 0) + sub.quantityOut;
-- Ventas -- Sales
INSERT INTO tmp.inventory(itemFk,quantity) INSERT INTO tInventory(itemFk, quantity)
SELECT itemFk, saleOut SELECT itemFk, saleOut
FROM ( FROM (
SELECT s.itemFk, - SUM(s.quantity) saleOut SELECT s.itemFk, - SUM(s.quantity) saleOut
FROM sale s FROM sale s
JOIN ticket t ON t.id = s.ticketFk JOIN ticket t ON t.id = s.ticketFk
WHERE t.warehouseFk = vWh WHERE t.warehouseFk = vWarehouseFk
AND t.shipped BETWEEN vDateLastInventory AND vDateYesterday AND t.shipped BETWEEN vDateLastInventory AND vDateYesterday
GROUP BY s.itemFk GROUP BY s.itemFk
) sub ) sub
ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity,0) + sub.saleOut; ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity,0) + sub.saleOut;
-- Actualiza valores de la ultima compra -- Update values of the last purchase
UPDATE tmp.inventory inv UPDATE tInventory inv
JOIN cache.last_buy lb ON lb.item_id = inv.itemFk AND lb.warehouse_id = vWh JOIN cache.last_buy lb ON lb.item_id = inv.itemFk AND lb.warehouse_id = vWarehouseFk
JOIN buy b ON b.id = lb.buy_id JOIN buy b ON b.id = lb.buy_id
JOIN item i ON i.id = b.itemFk JOIN item i ON i.id = b.itemFk
LEFT JOIN producer p ON p.id = i.producerFk LEFT JOIN producer p ON p.id = i.producerFk
@ -194,7 +187,7 @@ proc: BEGIN
inv.minPrice = b.minPrice, inv.minPrice = b.minPrice,
inv.producer = p.name; inv.producer = p.name;
INSERT INTO buy( itemFk, INSERT INTO buy(itemFk,
quantity, quantity,
buyingValue, buyingValue,
freightValue, freightValue,
@ -224,42 +217,53 @@ proc: BEGIN
price3, price3,
minPrice, minPrice,
vEntryFk vEntryFk
FROM tmp.inventory; FROM tInventory;
SELECT vWh, COUNT(*), util.VN_NOW() FROM tmp.inventory; -- Update the 'lastUsed' field of the item
-- Actualizamos el campo lastUsed de item
UPDATE item i UPDATE item i
JOIN tmp.inventory i2 ON i2.itemFk = i.id JOIN tInventory i2 ON i2.itemFk = i.id
SET i.lastUsed = NOW() SET i.lastUsed = NOW()
WHERE i2.quantity; WHERE i2.quantity;
-- DROP TEMPORARY TABLE tmp.inventory; DROP TEMPORARY TABLE tInventory;
END LOOP; END LOOP;
CLOSE cWarehouses; CLOSE cWarehouses;
UPDATE config SET inventoried = vDate; UPDATE config SET inventoried = vInventoryDate;
SET @isModeInventory := FALSE; SET @isModeInventory := FALSE;
DROP TEMPORARY TABLE IF EXISTS tmp.entryToDelete; CREATE OR REPLACE TEMPORARY TABLE tEntryToDelete
CREATE TEMPORARY TABLE tmp.entryToDelete (INDEX(entryId)) ENGINE = MEMORY
(INDEX(entryId) USING BTREE) ENGINE = MEMORY SELECT e.id entryId,
SELECT e.id as entryId, t.id travelId
t.id as travelId FROM travel t
JOIN `entry` e ON e.travelFk = t.id
JOIN (
SELECT t.shipped
FROM travel t FROM travel t
JOIN `entry` e ON e.travelFk = t.id JOIN `entry` e ON e.travelFk = t.id
WHERE e.supplierFk = vInventorySupplierFk WHERE e.supplierFk = vInventorySupplierFk
AND t.shipped <= util.VN_CURDATE() - INTERVAL 12 DAY AND t.shipped <= vInventoryDate
AND (DAY(t.shipped) <> 1 OR shipped < util.VN_CURDATE() - INTERVAL 12 DAY); GROUP BY t.shipped
ORDER BY t.shipped DESC
OFFSET vMaxRecentInventories ROWS
) sub
WHERE e.supplierFk = vInventorySupplierFk
AND t.shipped IN (sub.shipped);
DELETE e DELETE e
FROM `entry` e FROM `entry` e
JOIN tmp.entryToDelete tmp ON tmp.entryId = e.id; JOIN tEntryToDelete tmp ON tmp.entryId = e.id;
DELETE IGNORE t DELETE IGNORE t
FROM travel t FROM travel t
JOIN tmp.entryToDelete tmp ON tmp.travelId = t.id; JOIN tEntryToDelete tmp ON tmp.travelId = t.id;
DROP TEMPORARY TABLE IF EXISTS tEntryToDelete;
COMMIT;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -2,10 +2,11 @@ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`inventoryMakeLauncher`() CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`inventoryMakeLauncher`()
BEGIN BEGIN
/** /**
* Recalcula los inventarios de todos los almacenes. * Recalculate the inventories of all warehouses
*/ */
CALL inventoryMake(
call vn.inventoryMake(TIMESTAMPADD(DAY, -10, util.VN_CURDATE()), 0); util.VN_CURDATE() -
INTERVAL (SELECT daysInPastForInventory FROM inventoryConfig LIMIT 1) DAY
);
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,32 +1,35 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTaxMakeByDua`(vDuaFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTaxMakeByDua`(vDuaFk INT)
BEGIN BEGIN
/**
DECLARE done BOOL DEFAULT FALSE; * Borra los valores de duaTax y sus vctos. y los vuelve a crear en base a la tabla duaEntry
*
* @param vDuaFk Id del dua a recalcular
*/
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vInvoiceInFk INT; DECLARE vInvoiceInFk INT;
DECLARE rs CURSOR FOR DECLARE vInvoices CURSOR FOR
SELECT invoiceInFk SELECT DISTINCT invoiceInFk
FROM entry e FROM entry e
JOIN duaEntry de ON de.entryFk = e.id JOIN duaEntry de ON de.entryFk = e.id
WHERE de.duaFk = vDuaFk; WHERE de.duaFk = vDuaFk;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
OPEN rs; OPEN vInvoices;
l: LOOP
SET vDone = FALSE;
FETCH vInvoices INTO vInvoiceInFk;
FETCH rs INTO vInvoiceInFk; IF vDone THEN
LEAVE l;
WHILE NOT done DO END IF;
CALL vn2008.recibidaIvaInsert(vInvoiceInFk); CALL vn2008.recibidaIvaInsert(vInvoiceInFk);
CALL invoiceInDueDay_recalc(vInvoiceInFk); CALL invoiceInDueDay_recalc(vInvoiceInFk);
FETCH rs INTO vInvoiceInFk; END LOOP;
CLOSE vInvoices;
END WHILE;
CLOSE rs;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,32 +1,35 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTax_getFromDua`(vDuaFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTax_getFromDua`(vDuaFk INT)
BEGIN BEGIN
/**
DECLARE done BOOL DEFAULT FALSE; * Borra los valores de duaTax y sus vctos. y los vuelve a crear en base a la tabla duaEntry
*
* @param vDuaFk Id del dua a recalcular
*/
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vInvoiceInFk INT; DECLARE vInvoiceInFk INT;
DECLARE rs CURSOR FOR DECLARE vInvoices CURSOR FOR
SELECT invoiceInFk SELECT DISTINCT invoiceInFk
FROM entry e FROM entry e
JOIN duaEntry de ON de.entryFk = e.id JOIN duaEntry de ON de.entryFk = e.id
WHERE de.duaFk = vDuaFk; WHERE de.duaFk = vDuaFk;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
OPEN rs; OPEN vInvoices;
l: LOOP
SET vDone = FALSE;
FETCH vInvoices INTO vInvoiceInFk;
FETCH rs INTO vInvoiceInFk; IF vDone THEN
LEAVE l;
WHILE NOT done DO END IF;
CALL invoiceInTax_getFromEntries(vInvoiceInFk); CALL invoiceInTax_getFromEntries(vInvoiceInFk);
CALL invoiceInDueDay_calculate(vInvoiceInFk); CALL invoiceInDueDay_calculate(vInvoiceInFk);
FETCH rs INTO vInvoiceInFk; END LOOP;
CLOSE vInvoices;
END WHILE;
CLOSE rs;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,13 +1,22 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTax_getFromEntries`(IN vId INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTax_getFromEntries`(IN vInvoiceInFk INT)
BEGIN BEGIN
DECLARE vRate DOUBLE DEFAULT 1; DECLARE vRate DOUBLE DEFAULT 1;
DECLARE vDated DATE; DECLARE vDated DATE;
DECLARE vExpenseFk VARCHAR(10); DECLARE vExpenseFk VARCHAR(10);
DECLARE vIsBooked BOOLEAN DEFAULT FALSE;
SELECT isBooked INTO vIsBooked
FROM invoiceIn ii
WHERE id = vInvoiceInFk;
IF vIsBooked THEN
CALL util.throw('A booked invoice cannot be modified');
END IF;
SELECT MAX(rr.dated) INTO vDated SELECT MAX(rr.dated) INTO vDated
FROM referenceRate rr FROM referenceRate rr
JOIN invoiceIn ii ON ii.id = vId JOIN invoiceIn ii ON ii.id = vInvoiceInFk
WHERE rr.dated <= ii.issued WHERE rr.dated <= ii.issued
AND rr.currencyFk = ii.currencyFk ; AND rr.currencyFk = ii.currencyFk ;
@ -24,7 +33,7 @@ BEGIN
LIMIT 1; LIMIT 1;
DELETE FROM invoiceInTax DELETE FROM invoiceInTax
WHERE invoiceInFk = vId; WHERE invoiceInFk = vInvoiceInFk;
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenseFk, foreignValue, taxTypeSageFk, transactionTypeSageFk) INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenseFk, foreignValue, taxTypeSageFk, transactionTypeSageFk)
SELECT ii.id, SELECT ii.id,
@ -39,7 +48,7 @@ BEGIN
JOIN buy b ON b.entryFk = e.id JOIN buy b ON b.entryFk = e.id
LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk
AND rr.dated = ii.issued AND rr.dated = ii.issued
WHERE ii.id = vId WHERE ii.id = vInvoiceInFk
HAVING taxableBase IS NOT NULL; HAVING taxableBase IS NOT NULL;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,70 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemProposal_Add`(vSaleFk INT, vMateFk INT, vQuantity INT)
BEGIN
/**
* Añade un nuevo articulo para sustituir a otro, y actualiza la memoria de sustituciones.
*
* @param vSaleFk id de la tabla sale
* @param vMateFk articulo sustituto
* @ param vQuantity cantidad que se va a sustituir
*/
DECLARE vTicketFk INT;
DECLARE vItemFk INT;
DECLARE vWarehouseFk SMALLINT;
DECLARE vDate DATE;
DECLARE vGrouping INT;
DECLARE vBox INT;
DECLARE vPacking INT;
DECLARE vRoundQuantity INT DEFAULT 1;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
RESIGNAL;
END;
SELECT s.ticketFk, LEAST(s.quantity, vQuantity), s.itemFk,t.shipped,t.warehouseFk
INTO vTicketFk, vQuantity, vItemFk,vDate,vWarehouseFk
FROM sale s
JOIN ticket t ON t.id = s.ticketFk
WHERE s.id = vSaleFk;
CALL buyUltimate(vWarehouseFk, vDate);
SELECT `grouping`, groupingMode, packing INTO vGrouping, vBox, vPacking
FROM buy b
JOIN tmp.buyUltimate tmp ON b.id = tmp.buyFk
WHERE tmp.itemFk = vMateFk AND tmp.WarehouseFk = vWarehouseFk;
IF vBox = 2 AND vPacking > 0 THEN
SET vRoundQuantity = vPacking;
END IF;
IF vBox = 1 AND vGrouping > 0 THEN
SET vRoundQuantity = vGrouping;
END IF;
START TRANSACTION;
UPDATE sale
SET quantity = quantity - vQuantity
WHERE id = vSaleFk;
INSERT INTO sale(ticketFk, itemFk, quantity, concept)
SELECT vTicketFk,
vMateFk,
CEIL(vQuantity / vRoundQuantity) * vRoundQuantity,
CONCAT('+ ',i.longName)
FROM item i
WHERE id = vMateFk;
SELECT LAST_INSERT_ID() INTO vSaleFk;
CALL sale_calculateComponent(vSaleFk, NULL);
INSERT INTO itemProposal(itemFk, mateFk, counter)
VALUES(vItemFk, vMateFk, 1)
ON DUPLICATE KEY UPDATE counter = counter + 1;
COMMIT;
END$$
DELIMITER ;

View File

@ -20,6 +20,10 @@ BEGIN
SELECT barcodeToItem(vBarcode) INTO vItemFk; SELECT barcodeToItem(vBarcode) INTO vItemFk;
SET vPacking = COALESCE(vPacking, GREATEST(vn.itemPacking(vBarcode,vWarehouseFk), 1));
SET vQuantity = vQuantity * vPacking;
IF (SELECT COUNT(*) FROM shelving WHERE code = vShelvingFk COLLATE utf8_unicode_ci) = 0 THEN IF (SELECT COUNT(*) FROM shelving WHERE code = vShelvingFk COLLATE utf8_unicode_ci) = 0 THEN
INSERT IGNORE INTO parking(code) VALUES(vShelvingFk); INSERT IGNORE INTO parking(code) VALUES(vShelvingFk);

View File

@ -20,20 +20,23 @@ BEGIN
DECLARE vCompanyFk INT; DECLARE vCompanyFk INT;
DECLARE vAgencyModeFk INT; DECLARE vAgencyModeFk INT;
DECLARE vItemShelvingFk INT; DECLARE vItemShelvingFk INT;
DECLARE vAddressFk INT;
SELECT c.id, SELECT c.id,
pc.clientSelfConsumptionFk, pc.clientSelfConsumptionFk,
s.warehouseFk s.warehouseFk,
pc.addressSelfConsumptionFk
INTO vCompanyFk, INTO vCompanyFk,
vClientFk, vClientFk,
vWarehouseFk vWarehouseFk,
vAddressFk
FROM company c FROM company c
JOIN address a ON a.clientFk = c.clientFk JOIN address a ON a.clientFk = c.clientFk
JOIN warehouse w ON w.addressFk = a.id JOIN warehouse w ON w.addressFk = a.id
JOIN sector s ON s.warehouseFk = w.id JOIN sector s ON s.warehouseFk = w.id
JOIN parking p ON p.sectorFk = s.id JOIN parking p ON p.sectorFk = s.id
JOIN shelving s2 ON s2.parkingFk = p.id JOIN shelving s2 ON s2.parkingFk = p.id
JOIN productionConfig pc ON TRUE JOIN productionConfig pc
WHERE s2.code = vShelvingFk; WHERE s2.code = vShelvingFk;
IF vClientFk IS NULL THEN IF vClientFk IS NULL THEN
@ -65,7 +68,7 @@ BEGIN
vClientFk, vClientFk,
vWarehouseFk, vWarehouseFk,
CURDATE(), CURDATE(),
NULL, vAddressFk,
vCompanyFk, vCompanyFk,
NULL, NULL,
vTicketFk vTicketFk

View File

@ -17,7 +17,6 @@ BEGIN
CALL productionControl(vWarehouseFk, 0); CALL productionControl(vWarehouseFk, 0);
-- Products with vn.item.isBoxPickingMode = TRUE, pay atention to vn.itemShelving.packing
CREATE OR REPLACE TEMPORARY TABLE tmp.sale CREATE OR REPLACE TEMPORARY TABLE tmp.sale
(saleFk INT PRIMARY KEY) (saleFk INT PRIMARY KEY)
SELECT SELECT
@ -29,7 +28,7 @@ BEGIN
MAKETIME(pb.HH,pb.mm,0) etd, MAKETIME(pb.HH,pb.mm,0) etd,
pb.routeFk, pb.routeFk,
FLOOR(s.quantity / ish.packing) stickers, FLOOR(s.quantity / ish.packing) stickers,
ish.packing, IF(i.isBoxPickingMode, ish.packing, i.packingOut) packing,
b.packagingFk b.packagingFk
FROM sale s FROM sale s
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
@ -52,8 +51,8 @@ BEGIN
LEFT JOIN ticketState ts ON ts.ticketFk = s.ticketFk LEFT JOIN ticketState ts ON ts.ticketFk = s.ticketFk
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = vWarehouseFk LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = vWarehouseFk
LEFT JOIN buy b ON b.id = lb.buy_id LEFT JOIN buy b ON b.id = lb.buy_id
WHERE s.quantity BETWEEN ish.packing AND (ish.visible - IFNULL(tISS.reserve,0)) WHERE IF(i.isBoxPickingMode, ish.packing, i.packingOut)
AND i.isBoxPickingMode <= LEAST(s.quantity, ish.visible - IFNULL(tISS.reserve,0))
AND NOT pb.problem AND NOT pb.problem
AND sgd.saleFk IS NULL AND sgd.saleFk IS NULL
AND p.sectorFk = vSectorFk AND p.sectorFk = vSectorFk
@ -64,47 +63,13 @@ BEGIN
GROUP BY s.id GROUP BY s.id
ORDER BY etd; ORDER BY etd;
-- Remaining products, vn.item.packingOut SELECT *
INSERT IGNORE INTO tmp.sale FROM tmp.sale
SELECT WHERE stickers;
s.ticketFk,
s.id saleFk,
s.itemFk,
s.concept,
s.quantity,
MAKETIME(pb.HH,pb.mm,0) etd,
pb.routeFk,
s.quantity / i.packingOut stickers,
i.packingOut,
pc.defaultBigPackageFk
FROM sale s
JOIN item i ON i.id = s.itemFk
JOIN itemShelving ish ON ish.itemFk = s.itemFk
JOIN shelving sh ON sh.code = ish.shelvingFk
JOIN parking p ON p.id = sh.parkingFk
JOIN tmp.productionBuffer pb ON pb.ticketFk = s.ticketFk
JOIN agencyMode am ON am.id = pb.agencyModeFk
JOIN packagingConfig pc
LEFT JOIN routesMonitor rm ON rm.routeFk = pb.routeFk
LEFT JOIN itemShelvingStock iss ON iss.itemFk = s.itemFk AND iss.sectorFk = p.sectorFk
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
LEFT JOIN ticketState ts ON ts.ticketFk = s.ticketFk
WHERE s.quantity >= i.packingOut
AND NOT pb.problem
AND s.quantity > 0
AND sgd.saleFk IS NULL
AND p.sectorFk = vSectorFk
AND ts.isPreviousPreparable
AND iss.visible >= s.quantity
AND ((rm.bufferFk AND rm.isPickingAllowed)
OR am.code = 'REC_ALG')
AND pb.shipped = vDated
GROUP BY s.id
ORDER BY etd;
SELECT * FROM tmp.sale;
DROP TEMPORARY TABLE tmp.productionBuffer; DROP TEMPORARY TABLE tmp.productionBuffer;
DROP TEMPORARY TABLE tmp.sale; DROP TEMPORARY TABLE tmp.sale;
END$$ END$$
DELIMITER ; DELIMITER ;
CALL `vn`.`sale_getBoxPickingList`(1, curdate());

View File

@ -1,13 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sector_get`()
BEGIN
/**
* Obtiene los sectores
*/
SELECT s.id,s.description,s.warehouseFk
FROM vn.sector s;
END$$
DELIMITER ;

View File

@ -1,6 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`test`()
BEGIN
select 'procedimiento ejecutado con éxito';
END$$
DELIMITER ;

View File

@ -1,24 +1,33 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getMovable`(vTicketFk INT, vDatedNew DATETIME, vWarehouseFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getMovable`(
vTicketFk INT,
vNewShipped DATETIME,
vWarehouseFk INT
)
BEGIN BEGIN
/** /**
* Cálcula el stock movible para los artículos de un ticket * Cálcula el stock movible para los artículos de un ticket
* vDatedNew debe ser menor que vDatedOld, en los otros casos se * vNewShipped debe ser menor que vOldShipped, en los otros casos se
* asume que siempre es posible * asume que siempre es posible
* *
* @param vTicketFk -> Ticket * @param vTicketFk -> Ticket
* @param vDatedNew -> Nueva fecha * @param vNewShipped -> Nueva fecha
* @return Sales con Movible * @return Sales con Movible
*/ */
DECLARE vDatedOld DATETIME; DECLARE vOldShipped DATETIME;
SET vDatedNew = DATE_ADD(vDatedNew, INTERVAL 1 DAY);
SELECT t.shipped INTO vDatedOld SELECT t.shipped INTO vOldShipped
FROM ticket t FROM ticket t
WHERE t.id = vTicketFk; WHERE t.id = vTicketFk;
CALL item_getStock(vWarehouseFk, vDatedNew, NULL); -- Añadimos un dia más para calcular el stock hasta vNewShipped inclusive
CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(DATE_SUB(vDatedOld, INTERVAL 1 DAY), vDatedNew), NULL); CALL item_getStock(vWarehouseFk, DATE_ADD(vNewShipped, INTERVAL 1 DAY), NULL);
CALL item_getMinacum(
vWarehouseFk,
vNewShipped,
DATEDIFF(DATE_SUB(vOldShipped, INTERVAL 1 DAY), vNewShipped),
NULL
);
SELECT s.id, SELECT s.id,
s.itemFk, s.itemFk,
@ -33,12 +42,14 @@ BEGIN
FROM ticket t FROM ticket t
JOIN sale s ON s.ticketFk = t.id JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
LEFT JOIN tmp.itemMinacum im ON im.itemFk = s.itemFk AND im.warehouseFk = vWarehouseFk LEFT JOIN tmp.itemMinacum im ON im.itemFk = s.itemFk
AND im.warehouseFk = vWarehouseFk
LEFT JOIN tmp.itemList il ON il.itemFk = s.itemFk LEFT JOIN tmp.itemList il ON il.itemFk = s.itemFk
WHERE t.id = vTicketFk; WHERE t.id = vTicketFk;
DROP TEMPORARY TABLE IF EXISTS tmp.itemList; DROP TEMPORARY TABLE IF EXISTS
DROP TEMPORARY TABLE IF EXISTS tmp.itemMinacum; tmp.itemList,
tmp.itemMinacum;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -9,6 +9,8 @@ BEGIN
* @return tmp.ticketAmount (ticketFk, taxableBase, tax, code) * @return tmp.ticketAmount (ticketFk, taxableBase, tax, code)
* @return tmp.ticketTax (ticketFk, pgcFk, taxableBase, rate, code) Impuesto desglosado para cada ticket. * @return tmp.ticketTax (ticketFk, pgcFk, taxableBase, rate, code) Impuesto desglosado para cada ticket.
*/ */
-- Mantengo el drop porque si no da error en los tests de back de salix
-- Table 'addressCompany' was locked with a READ lock and can't be updated'
DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany;
CREATE TEMPORARY TABLE tmp.addressCompany CREATE TEMPORARY TABLE tmp.addressCompany
(INDEX (addressFk, companyFk)) (INDEX (addressFk, companyFk))
@ -17,24 +19,24 @@ BEGIN
FROM tmp.ticket tmpTicket FROM tmp.ticket tmpTicket
JOIN ticket t ON t.id = tmpTicket.ticketFk; JOIN ticket t ON t.id = tmpTicket.ticketFk;
CALL addressTaxArea (); CALL addressTaxArea();
IF vTaxArea IS NOT NULL THEN IF vTaxArea IS NOT NULL THEN
UPDATE tmp.addressTaxArea UPDATE tmp.addressTaxArea
SET areaFk = vTaxArea; SET areaFk = vTaxArea;
END IF; END IF;
/* Solo se calcula la base imponible (taxableBase) y el impuesto se calculará posteriormente -- Solo se calcula la base imponible (taxableBase) y
* No se debería cambiar el sistema por problemas con los decimales -- 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 CREATE OR REPLACE TEMPORARY TABLE tmp.ticketTax
(PRIMARY KEY (ticketFk, code, rate)) (PRIMARY KEY (ticketFk, code, rate))
ENGINE = MEMORY ENGINE = MEMORY
SELECT * FROM ( SELECT * FROM (
SELECT tmpTicket.ticketFk, SELECT tmpTicket.ticketFk,
bp.pgcFk, bp.pgcFk,
SUM(s.quantity * s.price * (100 - s.discount)/100 ) taxableBase, SUM(s.quantity * s.price * (100 - s.discount) / 100 ) taxableBase,
pgc.rate, pgc.rate,
tc.code, tc.code,
bp.priority bp.priority
@ -43,22 +45,21 @@ BEGIN
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
JOIN ticket t ON t.id = tmpTicket.ticketFk JOIN ticket t ON t.id = tmpTicket.ticketFk
JOIN supplier su ON su.id = t.companyFk JOIN supplier su ON su.id = t.companyFk
JOIN tmp.addressTaxArea ata JOIN tmp.addressTaxArea ata ON ata.addressFk = t.addressFk
ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk AND ata.companyFk = t.companyFk
JOIN itemTaxCountry itc JOIN itemTaxCountry itc ON itc.itemFk = i.id
ON itc.itemFk = i.id AND itc.countryFk = su.countryFk AND itc.countryFk = su.countryFk
JOIN bookingPlanner bp JOIN bookingPlanner bp ON bp.countryFk = su.countryFk
ON bp.countryFk = su.countryFk
AND bp.taxAreaFk = ata.areaFk AND bp.taxAreaFk = ata.areaFk
AND bp.taxClassFk = itc.taxClassFk AND bp.taxClassFk = itc.taxClassFk
JOIN pgc ON pgc.code = bp.pgcFk JOIN pgc ON pgc.code = bp.pgcFk
JOIN taxClass tc ON tc.id = bp.taxClassFk JOIN taxClass tc ON tc.id = bp.taxClassFk
GROUP BY tmpTicket.ticketFk, pgc.code, pgc.rate GROUP BY tmpTicket.ticketFk, pgc.code, pgc.rate
HAVING taxableBase <> 0) t3 HAVING taxableBase
) t3
ORDER BY priority; ORDER BY priority;
DROP TEMPORARY TABLE IF EXISTS tmp.ticketServiceTax; CREATE OR REPLACE TEMPORARY TABLE tmp.ticketServiceTax
CREATE TEMPORARY TABLE tmp.ticketServiceTax
(PRIMARY KEY (ticketFk, code, rate)) (PRIMARY KEY (ticketFk, code, rate))
ENGINE = MEMORY ENGINE = MEMORY
SELECT tt.ticketFk, SELECT tt.ticketFk,
@ -70,24 +71,22 @@ BEGIN
JOIN ticketService ts ON ts.ticketFk = tt.ticketFk JOIN ticketService ts ON ts.ticketFk = tt.ticketFk
JOIN ticket t ON t.id = tt.ticketFk JOIN ticket t ON t.id = tt.ticketFk
JOIN supplier su ON su.id = t.companyFk JOIN supplier su ON su.id = t.companyFk
JOIN tmp.addressTaxArea ata JOIN tmp.addressTaxArea ata ON ata.addressFk = t.addressFk
ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk AND ata.companyFk = t.companyFk
JOIN bookingPlanner bp JOIN bookingPlanner bp ON bp.countryFk = su.countryFk
ON bp.countryFk = su.countryFk
AND bp.taxAreaFk = ata.areaFk AND bp.taxAreaFk = ata.areaFk
AND bp.taxClassFk = ts.taxClassFk AND bp.taxClassFk = ts.taxClassFk
JOIN pgc ON pgc.code = bp.pgcFk JOIN pgc ON pgc.code = bp.pgcFk
JOIN taxClass tc ON tc.id = bp.taxClassFk JOIN taxClass tc ON tc.id = bp.taxClassFk
GROUP BY tt.ticketFk, pgc.code GROUP BY tt.ticketFk, pgc.code
HAVING taxableBase <> 0; HAVING taxableBase;
INSERT INTO tmp.ticketTax (ticketFk, pgcFk, taxableBase, rate, code) INSERT INTO tmp.ticketTax (ticketFk, pgcFk, taxableBase, rate, code)
SELECT ts.ticketFk, ts.pgcFk, ts.taxableBase, ts.rate, ts.code SELECT ts.ticketFk, ts.pgcFk, ts.taxableBase, ts.rate, ts.code
FROM tmp.ticketServiceTax ts FROM tmp.ticketServiceTax ts
ON DUPLICATE KEY UPDATE ticketTax.taxableBase = VALUES (taxableBase) + ticketTax.taxableBase ; ON DUPLICATE KEY UPDATE ticketTax.taxableBase = VALUES (taxableBase) + ticketTax.taxableBase ;
DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount; CREATE OR REPLACE TEMPORARY TABLE tmp.ticketAmount
CREATE TEMPORARY TABLE tmp.ticketAmount
(INDEX (ticketFk)) (INDEX (ticketFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT ticketFk, SELECT ticketFk,
@ -97,7 +96,8 @@ BEGIN
FROM tmp.ticketTax FROM tmp.ticketTax
GROUP BY ticketFk, code; GROUP BY ticketFk, code;
DROP TEMPORARY TABLE tmp.addressCompany; DROP TEMPORARY TABLE
DROP TEMPORARY TABLE tmp.addressTaxArea; tmp.addressCompany,
tmp.addressTaxArea;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -11,11 +11,10 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`travel_cloneWithEnt
BEGIN BEGIN
/** /**
* Clona un travel junto con sus entradas y compras * Clona un travel junto con sus entradas y compras
*
* @param vTravelFk travel plantilla a clonar * @param vTravelFk travel plantilla a clonar
* @param vDateStart fecha del shipment del nuevo travel * @param vDateStart fecha del shipment del nuevo travel
* @param vDateEnd fecha del landing del nuevo travel * @param vDateEnd fecha del landing del nuevo travel
* @param vWarehouseOutFk fecha del salida del nuevo travel * @param vWarehouseOutFk warehouse del salida del nuevo travel
* @param vWarehouseInFk warehouse de landing del nuevo travel * @param vWarehouseInFk warehouse de landing del nuevo travel
* @param vRef referencia del nuevo travel * @param vRef referencia del nuevo travel
* @param vAgencyModeFk del nuevo travel * @param vAgencyModeFk del nuevo travel
@ -25,6 +24,7 @@ BEGIN
DECLARE vEvaNotes VARCHAR(255); DECLARE vEvaNotes VARCHAR(255);
DECLARE vDone BOOL; DECLARE vDone BOOL;
DECLARE vAuxEntryFk INT; DECLARE vAuxEntryFk INT;
DECLARE vTx BOOLEAN DEFAULT @@in_transaction;
DECLARE vRsEntry CURSOR FOR DECLARE vRsEntry CURSOR FOR
SELECT e.id SELECT e.id
FROM entry e FROM entry e
@ -35,11 +35,11 @@ BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN BEGIN
ROLLBACK; CALL util.tx_rollback(vTx);
RESIGNAL; RESIGNAL;
END; END;
START TRANSACTION; CALL util.tx_start(vTx);
INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg,clonedFrom) INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg,clonedFrom)
SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg,vTravelFk SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg,vTravelFk
@ -76,6 +76,6 @@ BEGIN
SET @isModeInventory = FALSE; SET @isModeInventory = FALSE;
CLOSE vRsEntry; CLOSE vRsEntry;
COMMIT; CALL util.tx_commit(vTx);
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -4,7 +4,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`ticket_beforeUpdate`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
DECLARE vNewTime TIME; DECLARE vNewTime TIME;
DECLARE vHasTicketRefund BOOL;
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
@ -64,14 +63,5 @@ BEGIN
CALL vn.routeUpdateM3(NEW.routeFk); CALL vn.routeUpdateM3(NEW.routeFk);
END IF; END IF;
SELECT COUNT(*) INTO vHasTicketRefund
FROM ticketRefund
WHERE originalTicketFk = NEW.id
OR refundTicketFk = NEW.id;
IF vHasTicketRefund AND NEW.clientFk <> OLD.clientFk THEN
CALL util.throw('The ticket has a refund associated');
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,7 +0,0 @@
CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`__coolerPathDetail`
AS SELECT `c`.`cooler_path_detail_id` AS `id`,
`c`.`cooler_path_id` AS `coolerPathFk`,
`c`.`pasillo` AS `hallway`
FROM `vn2008`.`cooler_path_detail` `c`

View File

@ -28,4 +28,4 @@ FROM (
JOIN `vn`.`volumeConfig` `vc` JOIN `vn`.`volumeConfig` `vc`
) )
WHERE `t`.`shipped` > makedate(year(`util`.`VN_CURDATE`()) - 1, 1) WHERE `t`.`shipped` > makedate(year(`util`.`VN_CURDATE`()) - 1, 1)
AND t.awbFk AND `t`.`awbFk` <> 0

View File

@ -9,7 +9,7 @@ AS SELECT `et2`.`description` AS `truck`,
`et`.`id` <=> `rm`.`expeditionTruckFk` AS `isMatch`, `et`.`id` <=> `rm`.`expeditionTruckFk` AS `isMatch`,
`t`.`warehouseFk` AS `warehouseFk`, `t`.`warehouseFk` AS `warehouseFk`,
IF( IF(
`r`.`created` > util.VN_CURDATE() + INTERVAL 1 DAY, `r`.`created` > `util`.`VN_CURDATE`() + INTERVAL 1 DAY,
ucase(dayname(`r`.`created`)), ucase(dayname(`r`.`created`)),
NULL NULL
) AS `nombreDia` ) AS `nombreDia`

View File

@ -1,7 +1,7 @@
CREATE OR REPLACE DEFINER=`root`@`localhost` CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `vn`.`itemShelvingAvailable` VIEW `vn`.`itemShelvingAvailable`
AS SELECT `s`.`id` `saleFk`, AS SELECT `s`.`id` AS `saleFk`,
`tst`.`updated` AS `Modificado`, `tst`.`updated` AS `Modificado`,
`s`.`ticketFk` AS `ticketFk`, `s`.`ticketFk` AS `ticketFk`,
0 AS `isPicked`, 0 AS `isPicked`,

View File

@ -1,8 +1,7 @@
CREATE OR REPLACE DEFINER=`root`@`localhost` CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `vn`.`ticketStateToday` VIEW `vn`.`ticketStateToday`
AS SELECT AS SELECT `ts`.`ticketFk` AS `ticketFk`,
`ts`.`ticketFk` AS `ticketFk`,
`ts`.`state` AS `state`, `ts`.`state` AS `state`,
`ts`.`productionOrder` AS `productionOrder`, `ts`.`productionOrder` AS `productionOrder`,
`ts`.`alertLevel` AS `alertLevel`, `ts`.`alertLevel` AS `alertLevel`,
@ -10,6 +9,8 @@ AS SELECT
`ts`.`code` AS `code`, `ts`.`code` AS `code`,
`ts`.`updated` AS `updated`, `ts`.`updated` AS `updated`,
`ts`.`isPicked` AS `isPicked` `ts`.`isPicked` AS `isPicked`
FROM `ticketState` `ts` FROM (
JOIN `ticket` `t` ON `t`.`id` = `ts`.`ticketFk` `vn`.`ticketState` `ts`
WHERE `t`.`shipped` BETWEEN `util`.`VN_CURDATE`() AND `MIDNIGHT`(`util`.`VN_CURDATE`()); JOIN `vn`.`ticket` `t` ON(`t`.`id` = `ts`.`ticketFk`)
)
WHERE `t`.`shipped` BETWEEN `util`.`VN_CURDATE`() AND `MIDNIGHT`(`util`.`VN_CURDATE`())

View File

@ -1,24 +1,45 @@
CREATE OR REPLACE DEFINER=`root`@`localhost` CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `vn`.`zoneEstimatedDelivery` VIEW `vn`.`zoneEstimatedDelivery`
AS SELECT t.zoneFk, AS SELECT `t`.`zoneFk` AS `zoneFk`,
zc.`hour` zoneClosureHour, `zc`.`hour` AS `zoneClosureHour`,
z.`hour` zoneHour, `z`.`hour` AS `zoneHour`,
sv.volume volume, `sv`.`volume` AS `volume`,
al.hasToRecalcPrice, `al`.`hasToRecalcPrice` AS `hasToRecalcPrice`,
lhp.m3, `lhp`.`m3` AS `m3`,
dl.minSpeed `dl`.`minSpeed` AS `minSpeed`
FROM ticket t FROM (
JOIN ticketStateToday tst ON tst.ticketFk = t.id (
JOIN state s ON s.id = tst.state (
JOIN saleVolume sv ON sv.ticketFk = t.id (
LEFT JOIN lastHourProduction lhp ON lhp.warehouseFk = t.warehouseFk (
JOIN warehouse w ON w.id = t.warehouseFk (
STRAIGHT_JOIN `zone` z ON z.id = t.zoneFk (
LEFT JOIN 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 `vn`.`ticket` `t`
AND dl.fecha = util.VN_CURDATE() JOIN `vn`.`ticketStateToday` `tst` ON(`tst`.`ticketFk` = `t`.`id`)
JOIN alertLevel al ON al.id = s.alertLevel )
WHERE w.hasProduction JOIN `vn`.`state` `s` ON(`s`.`id` = `tst`.`state`)
AND DATE(t.shipped) = util.VN_CURDATE() )
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`)
)
) 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`()
)
)
JOIN `vn`.`alertLevel` `al` ON(`al`.`id` = `s`.`alertLevel`)
WHERE `w`.`hasProduction` <> 0
AND cast(`t`.`shipped` AS date) = `util`.`VN_CURDATE`()

View File

@ -27,7 +27,7 @@ BEGIN
DECLARE vEvaNotes VARCHAR(255); DECLARE vEvaNotes VARCHAR(255);
DECLARE vDone BOOL; DECLARE vDone BOOL;
DECLARE vAuxEntryFk INT; DECLARE vAuxEntryFk INT;
DECLARE vTx BOOLEAN DEFAULT !@@in_transaction; DECLARE vTx BOOLEAN DEFAULT @@in_transaction;
DECLARE vRsEntry CURSOR FOR DECLARE vRsEntry CURSOR FOR
SELECT e.id SELECT e.id
FROM entry e FROM entry e

View File

@ -1,4 +1,4 @@
DROP TRIGGER IF EXISTS vn2008.account_conciliacion_BEFORE_INSERT; DROP TRIGGER IF EXISTS vn2008.account_conciliacion_beforeInsert;
ALTER TABLE IF EXISTS `vn2008`.`account_conciliacion` RENAME `vn`.`accountReconciliation`; ALTER TABLE IF EXISTS `vn2008`.`account_conciliacion` RENAME `vn`.`accountReconciliation`;

View File

@ -1,4 +1,4 @@
DROP TRIGGER IF EXISTS vn2008.awb_recibida_ad; DROP TRIGGER IF EXISTS vn2008.awb_recibida_afterDelete;
ALTER TABLE IF EXISTS `vn2008`.`awb_recibida` RENAME `vn`.`awbInvoiceIn`; ALTER TABLE IF EXISTS `vn2008`.`awb_recibida` RENAME `vn`.`awbInvoiceIn`;

View File

@ -0,0 +1,3 @@
USE vn;
ALTER TABLE vn.agencyTermConfig
ADD CONSTRAINT agencyTermConfig_expense_FK FOREIGN KEY (expenseFk) REFERENCES vn.expense(id) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,11 @@
USE vn;
ALTER TABLE vn2008.gastos_resumen MODIFY COLUMN Id_Gasto varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL;
DELETE gr.*
FROM vn2008.gastos_resumen gr LEFT JOIN vn.expense e ON gr.Id_Gasto = e.id
WHERE e.id IS NULL;
ALTER TABLE vn2008.gastos_resumen
ADD CONSTRAINT gastos_resumen_expense_FK
FOREIGN KEY (Id_Gasto) REFERENCES vn.expense(id) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,5 @@
USE vn;
ALTER TABLE vn.invoiceOutTaxConfig MODIFY COLUMN expenseFk varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;
ALTER TABLE vn.invoiceOutTaxConfig
ADD CONSTRAINT invoiceOutTaxConfig_expense_FK FOREIGN KEY (expenseFk) REFERENCES vn.expense(id) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,5 @@
USE edi;
ALTER TABLE edi.item_groupToOffer MODIFY COLUMN expenseFk varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '7001000000' NULL;
ALTER TABLE edi.item_groupToOffer
ADD CONSTRAINT item_groupToOffer_expense_FK FOREIGN KEY (expenseFk) REFERENCES vn.expense(id) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,14 @@
USE vn;
-- Eliminar la clave primaria actual
ALTER TABLE bs.ventas_contables DROP PRIMARY KEY;
-- Agregar la nueva clave primaria incluyendo el campo `gasto`
ALTER TABLE bs.ventas_contables ADD PRIMARY KEY (`year`, `month`, `grupo`, `reino_id`, `tipo_id`, `empresa_id`, `gasto`);
DELETE vc.* FROM bs.ventas_contables vc LEFT JOIN vn.expense e ON e.id = vc.gasto WHERE e.id IS NULL;
ALTER TABLE bs.ventas_contables
MODIFY COLUMN gasto VARCHAR(10)
CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL;
ALTER TABLE bs.ventas_contables ADD CONSTRAINT ventas_contables_expense_FK FOREIGN KEY (gasto) REFERENCES vn.expense(id) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,8 @@
DELETE FROM vn.expense
WHERE id ='' AND id IS NULL AND isWithheld = FALSE;
UPDATE vn.expense
SET id='7002090000'
WHERE id='7002009000';
UPDATE vn.expense
SET id='7001090000'
WHERE id='7001009000';

View File

@ -0,0 +1,44 @@
UPDATE vn.expense
SET id = CASE id
WHEN 7000010000 THEN 7001001000
WHEN 7000020000 THEN 7001002000
WHEN 7000030000 THEN 7001003000
WHEN 7000040000 THEN 7001004000
WHEN 7000050000 THEN 7001005000
WHEN 7000060000 THEN 7001006000
WHEN 7000070000 THEN 7001007000
WHEN 7002060000 THEN 7001206000
WHEN 7002070000 THEN 7001207000
WHEN 7002030000 THEN 7001203000
WHEN 7002040000 THEN 7001204000
WHEN 7002050000 THEN 7001205000
WHEN 7002020000 THEN 7001202000
WHEN 7002010000 THEN 7001201000
WHEN 7001060000 THEN 7001106000
WHEN 7001070000 THEN 7001107000
WHEN 7001030000 THEN 7001103000
WHEN 7001040000 THEN 7001104000
WHEN 7001050000 THEN 7001105000
WHEN 7001020000 THEN 7001102000
WHEN 7001010000 THEN 7001101000
WHEN 7000080000 THEN 7040008000
WHEN 7001080000 THEN 7000108000
WHEN 7002080000 THEN 7001208000
WHEN 7000090000 THEN 7001009000
WHEN 7002090000 THEN 7001209000
WHEN 7002100000 THEN 7001210000
WHEN 7001090000 THEN 7001109000
WHEN 7001100000 THEN 7001110000
WHEN 7000120000 THEN 7001012000
WHEN 7002120000 THEN 7001212000
WHEN 7000130000 THEN 7001013000
WHEN 7000140000 THEN 7001014000
ELSE id
END
WHERE id IN (7000010000, 7000020000, 7000030000, 7000040000, 7000050000,
7000060000, 7000070000, 7002060000, 7002070000, 7002030000,
7002040000, 7002050000, 7002020000, 7002010000, 7001060000,
7001070000, 7001030000, 7001040000, 7001050000, 7001020000,
7001010000, 7000080000, 7001080000, 7002080000, 7000090000,
7002090000, 7002100000, 7001090000, 7001100000,
7000120000, 7002120000, 7000130000, 7000140000);

View File

@ -0,0 +1,6 @@
UPDATE vn.expense
SET id = CASE id
WHEN 7000100000 THEN 7001010000
ELSE id
END
WHERE id IN (7000100000);

View File

@ -0,0 +1,37 @@
REVOKE UPDATE ON vn.ticket FROM employee;
GRANT UPDATE (id,
warehouseFk,
shipped,
nickname,
refFk,
addressFk,
workerFk,
observations,
isSigned,
isLabeled,
isPrinted,
packages,
location,
hour,
created,
isBlocked,
solution,
routeFk,
priority,
hasPriority,
companyFk,
agencyModeFk,
landed,
isBoxed,
isDeleted,
zoneFk,
zonePrice,
zoneBonus,
totalWithVat,
totalWithoutVat,
weight,
clonedFrom,
cmrFk,
editorFk)
ON vn.ticket TO employee;

View File

@ -0,0 +1,3 @@
-- Place your SQL code here
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES( 'Ticket', 'myLastModified', '*', 'ALLOW', 'ROLE', 'production');

View File

@ -256,7 +256,7 @@ async function dockerStart() {
await myt.run(Start); await myt.run(Start);
await myt.deinit(); await myt.deinit();
} }
dockerStart.description = `Starts the salix-db container`; dockerStart.description = `Starts the DB container`;
async function docker() { async function docker() {
const myt = new Myt(); const myt = new Myt();
@ -264,7 +264,7 @@ async function docker() {
await myt.run(Run); await myt.run(Run);
await myt.deinit(); await myt.deinit();
} }
docker.description = `Runs the salix-db container`; docker.description = `Builds and starts the DB container`;
module.exports = { module.exports = {
default: defaultTask, default: defaultTask,

View File

@ -207,5 +207,7 @@
"The notification subscription of this worker cant be modified": "The notification subscription of this worker cant be modified", "The notification subscription of this worker cant be modified": "The notification subscription of this worker cant be modified",
"Name should be uppercase": "Name should be uppercase", "Name should be uppercase": "Name should be uppercase",
"You cannot update these fields": "You cannot update these fields", "You cannot update these fields": "You cannot update these fields",
"CountryFK cannot be empty": "Country cannot be empty" "CountryFK cannot be empty": "Country cannot be empty",
"You are not allowed to modify the alias": "You are not allowed to modify the alias",
"You already have the mailAlias": "You already have the mailAlias"
} }

View File

@ -139,7 +139,7 @@
"Claim state has changed to": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *{{newState}}*", "Claim state has changed to": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *{{newState}}*",
"Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}", "Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}",
"ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto", "ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto",
"Distance must be lesser than 1000": "La distancia debe ser inferior a 1000", "Distance must be lesser than 4000": "La distancia debe ser inferior a 4000",
"This ticket is deleted": "Este ticket está eliminado", "This ticket is deleted": "Este ticket está eliminado",
"Unable to clone this travel": "No ha sido posible clonar este travel", "Unable to clone this travel": "No ha sido posible clonar este travel",
"This thermograph id already exists": "La id del termógrafo ya existe", "This thermograph id already exists": "La id del termógrafo ya existe",
@ -336,12 +336,13 @@
"Incorrect pin": "Pin incorrecto", "Incorrect pin": "Pin incorrecto",
"You already have the mailAlias": "Ya tienes este alias de correo", "You already have the mailAlias": "Ya tienes este alias de correo",
"The alias cant be modified": "Este alias de correo no puede ser modificado", "The alias cant be modified": "Este alias de correo no puede ser modificado",
"No tickets to invoice": "No hay tickets para facturar",
"This ticket already has a cmr saved": "Este ticket ya tiene un cmr guardado", "This ticket already has a cmr saved": "Este ticket ya tiene un cmr guardado",
"Name should be uppercase": "El nombre debe ir en mayúscula", "Name should be uppercase": "El nombre debe ir en mayúscula",
"Bank entity must be specified": "La entidad bancaria es obligatoria", "Bank entity must be specified": "La entidad bancaria es obligatoria",
"An email is necessary": "Es necesario un email", "An email is necessary": "Es necesario un email",
"You cannot update these fields": "No puedes actualizar estos campos", "You cannot update these fields": "No puedes actualizar estos campos",
"CountryFK cannot be empty": "El país no puede estar vacío", "CountryFK cannot be empty": "El país no puede estar vacío",
"Cmr file does not exist": "El archivo del cmr no existe" "Cmr file does not exist": "El archivo del cmr no existe",
"You are not allowed to modify the alias": "No estás autorizado a modificar el alias",
"No tickets to invoice": "No hay tickets para facturar"
} }

View File

@ -1,5 +1,5 @@
const UserError = require('vn-loopback/util/user-error'); const ForbiddenError = require('vn-loopback/util/forbiddenError');
module.exports = Self => { module.exports = Self => {
Self.rewriteDbError(function(err) { Self.rewriteDbError(function(err) {
@ -8,38 +8,38 @@ module.exports = Self => {
return err; return err;
}); });
Self.observe('before save', async ctx => { Self.beforeRemote('create', async function(ctx) {
const changes = ctx.currentInstance || ctx.instance; const mailAlias = ctx.args.data?.mailAlias;
if (!mailAlias) return;
await checkModifyPermission(ctx, changes.mailAlias); await checkModifyPermission(ctx, mailAlias);
}); });
Self.beforeRemote('deleteById', async function(ctx) {
Self.observe('before delete', async ctx => { const instance = await Self.findById(ctx.args.id,
const mailAliasAccount = await Self.findById(ctx.where.id); {fields: ['mailAlias']}
);
await checkModifyPermission(ctx, mailAliasAccount.mailAlias); await checkModifyPermission(ctx, instance.mailAlias);
}); });
async function checkModifyPermission(ctx, mailAliasFk) { async function checkModifyPermission(ctx, mailAliasFk) {
const userId = ctx.options.accessToken.userId;
const models = Self.app.models; const models = Self.app.models;
const userId = ctx.req.accessToken.userId;
const roles = await models.RoleMapping.find({ const canEditAlias = await models.ACL.checkAccessAcl(ctx,
fields: ['roleId'], 'MailAliasAccount', 'canEditAlias', 'WRITE');
where: {principalId: userId} if (canEditAlias) return;
const allowedRoles = await models.MailAliasAcl.find({
fields: ['roleFk'],
where: {mailAliasFk}
});
const nRoles = allowedRoles.length &&
await models.RoleMapping.count({
principalId: userId,
principalType: 'USER',
roleId: {inq: allowedRoles.map(x => x.roleFk)}
}); });
const availableMailAlias = await models.MailAliasAcl.findOne({ if (!nRoles)
fields: ['mailAliasFk'], throw new ForbiddenError('You are not allowed to modify the alias');
include: {relation: 'mailAlias'},
where: {
roleFk: {
inq: roles.map(role => role.roleId),
},
mailAliasFk
}
});
if (!availableMailAlias) throw new UserError('The alias cant be modified');
} }
}; };

View File

@ -71,7 +71,7 @@ class Controller extends Descriptor {
const params = {newPassword: this.newPassword}; const params = {newPassword: this.newPassword};
if (this.askOldPass) { if (this.askOldPass) {
method = 'changePassword'; method = 'change-password';
params.oldPassword = this.oldPassword; params.oldPassword = this.oldPassword;
} else } else
method = 'setPassword'; method = 'setPassword';

View File

@ -46,23 +46,19 @@ module.exports = Self => {
const stmts = []; const stmts = [];
let stmt; let stmt;
stmts.push(`DROP TEMPORARY TABLE IF EXISTS tmp.ticket`);
stmts.push(new ParameterizedSQL( stmts.push(new ParameterizedSQL(
`CREATE TEMPORARY TABLE tmp.ticket `CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
(KEY (ticketFk)) (KEY (ticketFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT id ticketFk SELECT id ticketFk
FROM ticket t FROM ticket t
WHERE shipped BETWEEN ? AND ? WHERE shipped BETWEEN ? AND util.dayEnd(?)
AND refFk IS NULL`, [args.from, args.to])); AND refFk IS NULL`, [args.from, args.to]));
stmts.push(`CALL vn.ticket_getTax(NULL)`); stmts.push(`CALL vn.ticket_getTax(NULL)`);
stmts.push(`DROP TEMPORARY TABLE IF EXISTS tmp.filter`);
stmts.push(new ParameterizedSQL( stmts.push(new ParameterizedSQL(
`CREATE TEMPORARY TABLE tmp.filter `CREATE OR REPLACE TEMPORARY TABLE tmp.filter
ENGINE = MEMORY ENGINE = MEMORY
SELECT SELECT co.code company,
co.code company,
cou.country, cou.country,
c.id clientId, c.id clientId,
c.socialName clientSocialName, c.socialName clientSocialName,
@ -88,15 +84,13 @@ module.exports = Self => {
GROUP BY ticketFk GROUP BY ticketFk
HAVING taxableBase < 0 HAVING taxableBase < 0
) negativeBase ON negativeBase.ticketFk = t.id ) negativeBase ON negativeBase.ticketFk = t.id
WHERE t.shipped BETWEEN ? AND ? WHERE t.shipped BETWEEN ? AND util.dayEnd(?)
AND t.refFk IS NULL AND t.refFk IS NULL
AND c.typeFk IN ('normal','trust') AND c.typeFk IN ('normal','trust')
GROUP BY t.clientFk, negativeBase.taxableBase GROUP BY t.clientFk, negativeBase.taxableBase
HAVING amount < 0`, [args.from, args.to])); HAVING amount < 0`, [args.from, args.to]));
stmt = new ParameterizedSQL(` stmt = new ParameterizedSQL(`SELECT * FROM tmp.filter`);
SELECT f.*
FROM tmp.filter f`);
if (args.filter) { if (args.filter) {
stmt.merge(conn.makeWhere(args.filter.where)); stmt.merge(conn.makeWhere(args.filter.where));

View File

@ -0,0 +1,55 @@
const {models} = require('vn-loopback/server/server');
const LoopBackContext = require('loopback-context');
describe('ItemShelving upsertItem()', () => {
const warehouseFk = 1;
let ctx;
let options;
let tx;
beforeEach(async() => {
ctx = {
req: {
accessToken: {userId: 9},
headers: {origin: 'http://localhost'}
},
args: {}
};
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: ctx.req
});
options = {transaction: tx};
tx = await models.ItemShelving.beginTransaction({});
options.transaction = tx;
});
afterEach(async() => {
await tx.rollback();
});
it('should add two new records', async() => {
const shelvingFk = 'ZPP';
const items = [1, 1, 1, 2];
await models.ItemShelving.upsertItem(ctx, shelvingFk, items, warehouseFk, options);
const itemShelvings = await models.ItemShelving.find({where: {shelvingFk}}, options);
expect(itemShelvings.length).toEqual(2);
});
it('should update the visible items', async() => {
const shelvingFk = 'GVC';
const items = [2, 2];
const {visible: itemsBefore} = await models.ItemShelving.findOne({
where: {shelvingFk, itemFk: items[0]}
}, options);
await models.ItemShelving.upsertItem(ctx, shelvingFk, items, warehouseFk, options);
const {visible: itemsAfter} = await models.ItemShelving.findOne({
where: {shelvingFk, itemFk: items[0]}
}, options);
expect(itemsAfter).toEqual(itemsBefore + 2);
});
});

View File

@ -0,0 +1,64 @@
module.exports = Self => {
Self.remoteMethodCtx('upsertItem', {
description: 'Add a record or update it if it already exists.',
accessType: 'WRITE',
accepts: [{
arg: 'shelvingFk',
type: 'string',
required: true,
},
{
arg: 'items',
type: ['number'],
required: true,
description: 'array of item foreign keys'
},
{
arg: 'warehouseFk',
type: 'number',
required: true
}],
http: {
path: `/upsertItem`,
verb: 'POST'
}
});
Self.upsertItem = async(ctx, shelvingFk, items, warehouseFk, options) => {
const myOptions = {userId: ctx.req.accessToken.userId};
let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
const discardItems = new Set();
const itemCounts = items.reduce((acc, item) => {
acc[item] = (acc[item] || 0) + 1;
return acc;
}, {});
try {
for (let item of items) {
if (!discardItems.has(item)) {
let quantity = itemCounts[item];
discardItems.add(item);
await Self.rawSql('CALL vn.itemShelving_add(?, ?, ?, NULL, NULL, NULL, ?)',
[shelvingFk, item, quantity, warehouseFk], myOptions
);
}
}
if (tx) await tx.commit();
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};

View File

@ -1,4 +1,5 @@
module.exports = Self => { module.exports = Self => {
require('../methods/item-shelving/deleteItemShelvings')(Self); require('../methods/item-shelving/deleteItemShelvings')(Self);
require('../methods/item-shelving/upsertItem')(Self);
require('../methods/item-shelving/getInventory')(Self); require('../methods/item-shelving/getInventory')(Self);
}; };

View File

@ -22,16 +22,16 @@ module.exports = Self => {
require('../methods/route/getByWorker')(Self); require('../methods/route/getByWorker')(Self);
Self.validate('kmStart', validateDistance, { Self.validate('kmStart', validateDistance, {
message: 'Distance must be lesser than 1000' message: 'Distance must be lesser than 4000'
}); });
Self.validate('kmEnd', validateDistance, { Self.validate('kmEnd', validateDistance, {
message: 'Distance must be lesser than 1000' message: 'Distance must be lesser than 4000'
}); });
function validateDistance(err) { function validateDistance(err) {
const routeTotalKm = this.kmEnd - this.kmStart; const routeTotalKm = this.kmEnd - this.kmStart;
const routeMaxKm = 1000; const routeMaxKm = 4000;
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd) if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
err(); err();
} }

View File

@ -22,7 +22,6 @@
label="Vehicle" label="Vehicle"
ng-model="$ctrl.route.vehicleFk" ng-model="$ctrl.route.vehicleFk"
url="Vehicles" url="Vehicles"
where="{warehouseFk: $ctrl.vnConfig.warehouseFk}"
show-field="numberPlate"> show-field="numberPlate">
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete

View File

@ -0,0 +1,25 @@
module.exports = Self => {
Self.remoteMethodCtx('myLastModified', {
description: 'Get list of last tickets which user has modified',
accessType: 'READ',
returns: {
type: 'object',
root: true
},
http: {
path: `/myLastModified`,
verb: 'GET'
}
});
Self.myLastModified = async ctx => {
const userId = ctx.req.accessToken.userId;
const query =
`SELECT ticketFk, MAX(created) created
FROM ticketTracking tt
WHERE tt.userFk = ?
GROUP BY ticketFk
LIMIT 5;`;
return await Self.rawSql(query, [userId]);
};
};

View File

@ -0,0 +1,10 @@
const {models} = require('vn-loopback/server/server');
describe('myLastModified()', () => {
it('return list of last tickets which user has modified', async() => {
let ctx = {req: {accessToken: {userId: 100}}};
let response = await models.Ticket.myLastModified(ctx);
expect(response.length).toBeGreaterThan(0);
});
});

View File

@ -1,49 +1,60 @@
const models = require('vn-loopback/server/server').models; const models = require('vn-loopback/server/server').models;
describe('Ticket transferClient()', () => { describe('Ticket transferClient()', () => {
const userId = 9; const originalTicketId = 8;
const activeCtx = { const refundTicketId = 24;
accessToken: {userId: userId}, const clientId = 1;
let ctx;
let options;
let tx;
beforeEach(async() => {
ctx = {
req: {
accessToken: {userId: 9},
headers: {origin: 'http://localhost'}
},
args: {}
}; };
const ctx = {req: activeCtx};
options = {transaction: tx};
tx = await models.Ticket.beginTransaction({});
options.transaction = tx;
});
afterEach(async() => {
await tx.rollback();
});
it('should throw an error as the ticket is not editable', async() => { it('should throw an error as the ticket is not editable', async() => {
const tx = await models.Ticket.beginTransaction({});
let error;
try { try {
const options = {transaction: tx};
const ticketId = 4; const ticketId = 4;
const clientId = 1; const clientId = 1;
await models.Ticket.transferClient(ctx, ticketId, clientId, options); await models.Ticket.transferClient(ctx, ticketId, clientId, options);
await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); expect(e.message).toEqual(`This ticket is locked`);
error = e;
} }
expect(error.message).toEqual(`This ticket is locked`);
}); });
it('should be assigned a different clientFk', async() => { it('should be assigned a different clientFk in the original ticket', async() => {
const tx = await models.Ticket.beginTransaction({}); await models.Ticket.transferClient(ctx, 2, clientId, options);
let updatedTicket; const afterTransfer = await models.Ticket.findById(2, null, options);
const ticketId = 10;
const clientId = 1;
try { expect(afterTransfer.clientFk).toEqual(clientId);
const options = {transaction: tx}; });
await models.Ticket.transferClient(ctx, ticketId, clientId, options); it('should be assigned a different clientFk in the original and refund ticket and claim', async() => {
updatedTicket = await models.Ticket.findById(ticketId, {fields: ['clientFk']}, options); await models.Ticket.transferClient(ctx, originalTicketId, clientId, options);
await tx.rollback(); const [originalTicket, refundTicket] = await models.Ticket.find({
} catch (e) { where: {id: {inq: [originalTicketId, refundTicketId]}}
await tx.rollback(); }, options);
throw e;
}
expect(updatedTicket.clientFk).toEqual(clientId); const claim = await models.Claim.findOne({
where: {ticketFk: originalTicketId}
}, options);
expect(originalTicket.clientFk).toEqual(clientId);
expect(refundTicket.clientFk).toEqual(clientId);
expect(claim.clientFk).toEqual(clientId);
}); });
}); });

View File

@ -2,20 +2,17 @@ module.exports = Self => {
Self.remoteMethodCtx('transferClient', { Self.remoteMethodCtx('transferClient', {
description: 'Transfering ticket to another client', description: 'Transfering ticket to another client',
accessType: 'WRITE', accessType: 'WRITE',
accepts: [ accepts: [{
{
arg: 'id', arg: 'id',
type: 'number', type: 'number',
required: true, required: true,
description: 'the ticket id', description: 'the ticket id',
http: {source: 'path'} http: {source: 'path'}
}, }, {
{
arg: 'clientFk', arg: 'clientFk',
type: 'number', type: 'number',
required: true, required: true,
}, }],
],
http: { http: {
path: `/:id/transferClient`, path: `/:id/transferClient`,
verb: 'PATCH' verb: 'PATCH'
@ -25,21 +22,51 @@ module.exports = Self => {
Self.transferClient = async(ctx, id, clientFk, options) => { Self.transferClient = async(ctx, id, clientFk, options) => {
const models = Self.app.models; const models = Self.app.models;
const myOptions = {}; const myOptions = {};
let tx;
if (typeof options == 'object') if (typeof options == 'object')
Object.assign(myOptions, options); Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
await Self.isEditableOrThrow(ctx, id, myOptions); await Self.isEditableOrThrow(ctx, id, myOptions);
const ticket = await models.Ticket.findById( const ticketRefund = await models.TicketRefund.findOne({
id, where: {or: [{originalTicketFk: id}, {refundTicketFk: id}]},
{fields: ['id', 'shipped', 'clientFk', 'addressFk']}, include: [{relation: 'refundTicket'}, {relation: 'originalTicket'}]
myOptions }, myOptions);
);
const client = await models.Client.findById(clientFk, {fields: ['id', 'defaultAddressFk']}, myOptions);
await ticket.updateAttributes({ const {defaultAddressFk: addressFk} = await models.Client.findById(clientFk,
clientFk, {fields: ['id', 'defaultAddressFk']}, myOptions);
addressFk: client.defaultAddressFk,
}); const attributes = {clientFk, addressFk};
const tickets = [];
const ticketIds = [];
if (ticketRefund) {
const {refundTicket, originalTicket} = ticketRefund;
tickets.push(refundTicket(), originalTicket());
for (const ticket of tickets) {
await ticket.updateAttributes(attributes, myOptions);
ticketIds.push(ticket.id);
}
} else {
await Self.updateAll({id}, attributes, myOptions);
ticketIds.push(id);
}
await models.Claim.updateAll({ticketFk: {inq: ticketIds}}, {clientFk}, myOptions);
if (tx) await tx.commit();
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
}; };
}; };

View File

@ -45,4 +45,5 @@ module.exports = function(Self) {
require('../methods/ticket/invoiceTickets')(Self); require('../methods/ticket/invoiceTickets')(Self);
require('../methods/ticket/invoiceTicketsAndPdf')(Self); require('../methods/ticket/invoiceTicketsAndPdf')(Self);
require('../methods/ticket/docuwareDownload')(Self); require('../methods/ticket/docuwareDownload')(Self);
require('../methods/ticket/myLastModified')(Self);
}; };

View File

@ -27,7 +27,10 @@ describe('Travel cloneWithEntries()', () => {
expect(newTravel.warehouseOutFk).toEqual(warehouseThree); expect(newTravel.warehouseOutFk).toEqual(warehouseThree);
expect(newTravel.agencyModeFk).toEqual(agencyModeOne); expect(newTravel.agencyModeFk).toEqual(agencyModeOne);
expect(travelEntries.length).toBeGreaterThan(0); expect(travelEntries.length).toBeGreaterThan(0);
await models.Entry.destroyAll({
travelFk: newTravelId
}, options);
await models.Travel.destroyById(newTravelId, options);
await tx.rollback(); await tx.rollback();
const travelRemoved = await models.Travel.findById(newTravelId, options); const travelRemoved = await models.Travel.findById(newTravelId, options);

View File

@ -44,7 +44,6 @@ fixtures:
- module - module
- defaultViewConfig - defaultViewConfig
vn: vn:
- agencyTermConfig
- alertLevel - alertLevel
- bookingPlanner - bookingPlanner
- businessType - businessType

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-back", "name": "salix-back",
"version": "24.8.0", "version": "24.10.0",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "Salix backend", "description": "Salix backend",
"license": "GPL-3.0", "license": "GPL-3.0",
@ -42,7 +42,8 @@
"mysql": "2.18.1", "mysql": "2.18.1",
"node-ssh": "^11.0.0", "node-ssh": "^11.0.0",
"object.pick": "^1.3.0", "object.pick": "^1.3.0",
"puppeteer": "^21.10.0", "puppeteer": "^21.11.0",
"read-chunk": "^3.2.0",
"require-yaml": "0.0.1", "require-yaml": "0.0.1",
"smbhash": "0.0.1", "smbhash": "0.0.1",
"strong-error-handler": "^2.3.2", "strong-error-handler": "^2.3.2",
@ -55,7 +56,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/preset-env": "^7.11.0", "@babel/preset-env": "^7.11.0",
"@babel/register": "^7.7.7", "@babel/register": "^7.7.7",
"@verdnatura/myt": "^1.6.6", "@verdnatura/myt": "^1.6.7",
"angular-mocks": "^1.7.9", "angular-mocks": "^1.7.9",
"babel-jest": "^26.0.1", "babel-jest": "^26.0.1",
"babel-loader": "^8.2.4", "babel-loader": "^8.2.4",

View File

@ -93,8 +93,11 @@ dependencies:
specifier: ^1.3.0 specifier: ^1.3.0
version: 1.3.0 version: 1.3.0
puppeteer: puppeteer:
specifier: ^21.10.0 specifier: ^21.11.0
version: 21.10.0 version: 21.11.0
read-chunk:
specifier: ^3.2.0
version: 3.2.0
require-yaml: require-yaml:
specifier: 0.0.1 specifier: 0.0.1
version: 0.0.1 version: 0.0.1
@ -128,8 +131,8 @@ devDependencies:
specifier: ^7.7.7 specifier: ^7.7.7
version: 7.23.7(@babel/core@7.23.9) version: 7.23.7(@babel/core@7.23.9)
'@verdnatura/myt': '@verdnatura/myt':
specifier: ^1.6.6 specifier: ^1.6.7
version: 1.6.6 version: 1.6.7
angular-mocks: angular-mocks:
specifier: ^1.7.9 specifier: ^1.7.9
version: 1.8.3 version: 1.8.3
@ -2630,8 +2633,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@verdnatura/myt@1.6.6: /@verdnatura/myt@1.6.7:
resolution: {integrity: sha512-5KHi9w1baEQ6Oe/pAR8pl0oD5yyJJuPirE+ZhygreUGGURfig4VekjhlGE3WEbWquDiIAMi89J1VQ+1Ba0+jQw==} resolution: {integrity: sha512-t/Q1T3QzHpZFdxwIyQL/CV5g+HJvWE6Q65VeA9k0svZdX/vezgnQ21nkI+wuvIurIl6BXqq2Arx7EWYkAhGNNA==}
hasBin: true hasBin: true
dependencies: dependencies:
'@sqltools/formatter': 1.2.5 '@sqltools/formatter': 1.2.5
@ -4057,8 +4060,8 @@ packages:
engines: {node: '>=6.0'} engines: {node: '>=6.0'}
dev: true dev: true
/chromium-bidi@0.5.6(devtools-protocol@0.0.1232444): /chromium-bidi@0.5.8(devtools-protocol@0.0.1232444):
resolution: {integrity: sha512-ber8smgoAs4EqSUHRb0I8fpx371ZmvsdQav8HRM9oO4fk5Ox16vQiNYXlsZkRj4FfvVL2dCef+zBFQixp+79CA==} resolution: {integrity: sha512-blqh+1cEQbHBKmok3rVJkBlBxt9beKBgOsxbFgs7UJcoVbbeZ+K7+6liAsjgpc8l1Xd55cQUy14fXZdGSb4zIw==}
peerDependencies: peerDependencies:
devtools-protocol: '*' devtools-protocol: '*'
dependencies: dependencies:
@ -10680,7 +10683,6 @@ packages:
/p-try@2.2.0: /p-try@2.2.0:
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
engines: {node: '>=6'} engines: {node: '>=6'}
dev: true
/pac-proxy-agent@7.0.1: /pac-proxy-agent@7.0.1:
resolution: {integrity: sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==} resolution: {integrity: sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==}
@ -11220,12 +11222,12 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'} engines: {node: '>=6'}
/puppeteer-core@21.10.0: /puppeteer-core@21.11.0:
resolution: {integrity: sha512-NVaqO3K462qwMuLO4Gurs/Mau1Wss+08QgNYzF0dIqZWMvpskrt/TbxbmHU+7zMTUOvPEq/lR4BLJmjMBgBGfQ==} resolution: {integrity: sha512-ArbnyA3U5SGHokEvkfWjW+O8hOxV1RSJxOgriX/3A4xZRqixt9ZFHD0yPgZQF05Qj0oAqi8H/7stDorjoHY90Q==}
engines: {node: '>=16.13.2'} engines: {node: '>=16.13.2'}
dependencies: dependencies:
'@puppeteer/browsers': 1.9.1 '@puppeteer/browsers': 1.9.1
chromium-bidi: 0.5.6(devtools-protocol@0.0.1232444) chromium-bidi: 0.5.8(devtools-protocol@0.0.1232444)
cross-fetch: 4.0.0 cross-fetch: 4.0.0
debug: 4.3.4(supports-color@6.1.0) debug: 4.3.4(supports-color@6.1.0)
devtools-protocol: 0.0.1232444 devtools-protocol: 0.0.1232444
@ -11237,15 +11239,15 @@ packages:
- utf-8-validate - utf-8-validate
dev: false dev: false
/puppeteer@21.10.0: /puppeteer@21.11.0:
resolution: {integrity: sha512-Y1yQjcLE00hHTDAmv3M3A6hhW0Ytjdp6xr6nyjl7FZ7E7hzp/6Rsw80FbaTJzJHFCplBNi082wrgynbmD7RlYw==} resolution: {integrity: sha512-9jTHuYe22TD3sNxy0nEIzC7ZrlRnDgeX3xPkbS7PnbdwYjl2o/z/YuCrRBwezdKpbTDTJ4VqIggzNyeRcKq3cg==}
engines: {node: '>=16.13.2'} engines: {node: '>=16.13.2'}
hasBin: true hasBin: true
requiresBuild: true requiresBuild: true
dependencies: dependencies:
'@puppeteer/browsers': 1.9.1 '@puppeteer/browsers': 1.9.1
cosmiconfig: 9.0.0 cosmiconfig: 9.0.0
puppeteer-core: 21.10.0 puppeteer-core: 21.11.0
transitivePeerDependencies: transitivePeerDependencies:
- bufferutil - bufferutil
- encoding - encoding
@ -11367,6 +11369,14 @@ packages:
resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
dev: true dev: true
/read-chunk@3.2.0:
resolution: {integrity: sha512-CEjy9LCzhmD7nUpJ1oVOE6s/hBkejlcJEgLQHVnQznOSilOPb+kpKktlLfFDK3/WP43+F80xkUTM2VOkYoSYvQ==}
engines: {node: '>=6'}
dependencies:
pify: 4.0.1
with-open-file: 0.1.7
dev: false
/read-pkg-up@1.0.1: /read-pkg-up@1.0.1:
resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==} resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -14119,6 +14129,15 @@ packages:
resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==}
dev: true dev: true
/with-open-file@0.1.7:
resolution: {integrity: sha512-ecJS2/oHtESJ1t3ZfMI3B7KIDKyfN0O16miWxdn30zdh66Yd3LsRFebXZXq6GU4xfxLf6nVxp9kIqElb5fqczA==}
engines: {node: '>=6'}
dependencies:
p-finally: 1.0.0
p-try: 2.2.0
pify: 4.0.1
dev: false
/word-count@0.2.2: /word-count@0.2.2:
resolution: {integrity: sha512-tPRTbQ+nTCPY3F0z1f/y0PX22ScE6l/4/8j9KqA3h77JhlZ/w6cbVS8LIO5Pq/aV96SWBOoiE2IEgzxF0Cn+kA==} resolution: {integrity: sha512-tPRTbQ+nTCPY3F0z1f/y0PX22ScE6l/4/8j9KqA3h77JhlZ/w6cbVS8LIO5Pq/aV96SWBOoiE2IEgzxF0Cn+kA==}
dev: false dev: false

View File

@ -6,7 +6,7 @@ module.exports = {
init() { init() {
if (this.pool) return; if (this.pool) return;
Cluster.launch({ Cluster.launch({
concurrency: Cluster.CONCURRENCY_CONTEXT, concurrency: Cluster.CONCURRENCY_PAGE,
maxConcurrency: cpus().length, maxConcurrency: cpus().length,
puppeteerOptions: { puppeteerOptions: {
headless: 'new', headless: 'new',

View File

@ -46,6 +46,9 @@ section.text-area {
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;
background-color: #e5e5e5; background-color: #e5e5e5;
& > p {
word-break: break-all;
}
} }
.route-block { .route-block {

View File

@ -5,7 +5,6 @@ module.exports = {
mixins: [vnReport], mixins: [vnReport],
async serverPrefetch() { async serverPrefetch() {
let ids = this.id; let ids = this.id;
const hasMultipleRoutes = String(this.id).includes(','); const hasMultipleRoutes = String(this.id).includes(',');
if (hasMultipleRoutes) if (hasMultipleRoutes)
ids = this.id.split(','); ids = this.id.split(',');
@ -30,7 +29,7 @@ module.exports = {
}, },
props: { props: {
id: { id: {
type: Number, type: String,
required: true, required: true,
description: 'The route id' description: 'The route id'
} }