Merge branch 'dev' into 6875-packingNotNull
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Guillermo Bonet 2024-03-13 10:56:17 +00:00
commit cbaa48a933
448 changed files with 13250 additions and 12242 deletions

5
Jenkinsfile vendored
View File

@ -103,7 +103,7 @@ pipeline {
NODE_ENV = ''
}
steps {
sh 'npm run test:back:ci'
sh 'node back/tests.js --ci --junit --network jenkins'
}
post {
always {
@ -235,11 +235,12 @@ pipeline {
if (index != -1)
message = message.substring(0, index)
setEnv()
rocketSend(
channel: 'vn-database',
message: "*DB version uploaded:* ${message}"
+"\n$COMMITTER_EMAIL ($BRANCH_NAME)"
+"\n$GIT_URL/commit/$GIT_COMMIT",
+"\n$RUN_DISPLAY_URL",
rawMessage: true
)
}

View File

@ -0,0 +1,31 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethodCtx('assign', {
description: 'Assign a collection',
accessType: 'WRITE',
http: {
path: `/assign`,
verb: 'POST'
},
returns: {
type: ['object'],
root: true
},
});
Self.assign = async(ctx, options) => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
if (typeof options == 'object')
Object.assign(myOptions, options);
const [,, {collectionFk}] = await Self.rawSql('CALL vn.collection_assign(?, @vCollectionFk); SELECT @vCollectionFk collectionFk',
[userId], myOptions);
if (!collectionFk) throw new UserError('There are not picking tickets');
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
return collectionFk;
};
};

View File

@ -0,0 +1,157 @@
module.exports = Self => {
Self.remoteMethodCtx('getSales', {
description: 'Get sales from ticket or collection',
accessType: 'READ',
accepts: [
{
arg: 'collectionOrTicketFk',
type: 'number',
required: true
}, {
arg: 'print',
type: 'boolean',
required: true
}, {
arg: 'source',
type: 'string',
required: true
},
],
returns: {
type: 'Object',
root: true
},
http: {
path: `/getSales`,
verb: 'GET'
},
});
Self.getSales = async(ctx, collectionOrTicketFk, print, source, options) => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
const $t = ctx.req.__;
if (typeof options == 'object')
Object.assign(myOptions, options);
const [{id}] = await Self.rawSql('SELECT vn.ticket_get(?) as id',
[collectionOrTicketFk],
myOptions);
const [tickets] = await Self.rawSql('CALL vn.collection_getTickets(?)', [id], myOptions);
if (source) {
await Self.rawSql(
'CALL vn.ticketStateToday_setState(?,?)', [id, source], myOptions
);
}
const [sales] = await Self.rawSql('CALL vn.sale_getFromTicketOrCollection(?)',
[id], myOptions);
const isPicker = source != 'CHECKER';
const [placements] = await Self.rawSql('CALL vn.collectionPlacement_get(?, ?)',
[id, isPicker], myOptions
);
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
for (let ticket of tickets) {
let observations = ticket.observaciones.split(' ');
for (let observation of observations) {
const salesPerson = ticket.salesPersonFk;
if (observation.startsWith('#') || observation.startsWith('@')) {
await models.Chat.send(ctx,
observation,
$t('ticketCommercial', {ticket: ticket.ticketFk, salesPerson})
);
}
}
}
return getCollection(id, tickets, sales, placements, myOptions);
};
async function getCollection(id, tickets, sales, placements, options) {
const collection = {
collectionFk: id,
tickets: [],
};
for (let ticket of tickets) {
const {ticketFk} = ticket;
ticket.sales = [];
const barcodes = await getBarcodes(ticketFk, options);
await Self.rawSql(
'CALL util.log_add(?, ?, ?, ?, ?, ?, ?, ?)',
['vn', 'ticket', 'Ticket', ticketFk, ticketFk, 'select', null, null],
options
);
for (let sale of sales) {
if (sale.ticketFk == ticketFk) {
sale.placements = [];
for (const salePlacement of placements) {
if (salePlacement.saleFk == sale.saleFk && salePlacement.order) {
const placement = {
saleFk: salePlacement.saleFk,
itemFk: salePlacement.itemFk,
placement: salePlacement.placement,
shelving: salePlacement.shelving,
created: salePlacement.created,
visible: salePlacement.visible,
order: salePlacement.order,
grouping: salePlacement.grouping,
priority: salePlacement.priority,
saleOrder: salePlacement.saleOrder,
isPreviousPrepared: salePlacement.isPreviousPrepared,
itemShelvingSaleFk: salePlacement.itemShelvingSaleFk,
ticketFk: salePlacement.ticketFk,
id: salePlacement.id
};
sale.placements.push(placement);
}
}
sale.barcodes = [];
for (const barcode of barcodes) {
if (barcode.movementId == sale.saleFk) {
if (barcode.code) {
sale.barcodes.push(barcode.code);
sale.barcodes.push(`0 ${barcode.code}`);
}
if (barcode.id) {
sale.barcodes.push(barcode.id);
sale.barcodes.push(`0 ${barcode.id}`);
}
}
}
ticket.sales.push(sale);
}
}
collection.tickets.push(ticket);
}
return collection;
}
async function getBarcodes(ticketId, options) {
const query =
`SELECT s.id movementId,
b.code,
c.id
FROM vn.sale s
LEFT JOIN vn.itemBarcode b ON b.itemFk = s.itemFk
LEFT JOIN vn.buy c ON c.itemFk = s.itemFk
LEFT JOIN vn.entry e ON e.id = c.entryFk
LEFT JOIN vn.travel tr ON tr.id = e.travelFk
WHERE s.ticketFk = ?
AND tr.landed >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR)`;
return Self.rawSql(query, [ticketId], options);
}
};

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

@ -0,0 +1,38 @@
const models = require('vn-loopback/server/server').models;
const LoopBackContext = require('loopback-context');
describe('ticket assign()', () => {
let ctx;
let options;
let tx;
beforeEach(async() => {
ctx = {
req: {
accessToken: {userId: 1106},
headers: {origin: 'http://localhost'},
__: value => value
},
args: {}
};
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: ctx.req
});
options = {transaction: tx};
tx = await models.Sale.beginTransaction({});
options.transaction = tx;
});
afterEach(async() => {
await tx.rollback();
});
it('should throw an error when there is not picking tickets', async() => {
try {
await models.Collection.assign(ctx, options);
} catch (e) {
expect(e.message).toEqual('There are not picking tickets');
}
});
});

View File

@ -0,0 +1,62 @@
const {models} = require('vn-loopback/server/server');
describe('collection getSales()', () => {
const collectionOrTicketFk = 999999;
const print = true;
const source = 'CHECKER';
beforeAll(() => {
ctx = {
req: {
accessToken: {userId: 9},
headers: {origin: 'http://localhost'},
}
};
});
it('should return a collection with tickets, placements and barcodes settled correctly', async() => {
const tx = await models.Collection.beginTransaction({});
const options = {transaction: tx};
try {
const collection = await models.Collection.getSales(ctx,
collectionOrTicketFk, print, source, options);
const [firstTicket] = collection.tickets;
const [firstSale] = firstTicket.sales;
const [firstPlacement] = firstSale.placements;
expect(collection.tickets.length).toBeTruthy();
expect(collection.collectionFk).toEqual(firstTicket.ticketFk);
expect(firstSale.ticketFk).toEqual(firstTicket.ticketFk);
expect(firstSale.placements.length).toBeTruthy();
expect(firstSale.barcodes.length).toBeTruthy();
expect(firstSale.saleFk).toEqual(firstPlacement.saleFk);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
it('should print a sticker', async() => {
const tx = await models.Collection.beginTransaction({});
const options = {transaction: tx};
const query = 'SELECT * FROM printQueue pq JOIN printQueueArgs pqa ON pqa.printQueueFk = pq.id';
try {
const printQueueBefore = await models.Collection.rawSql(
query, [], options);
await models.Collection.getSales(ctx,
collectionOrTicketFk, true, source, options);
const printQueueAfter = await models.Collection.rawSql(
query, [], options);
expect(printQueueAfter.length).toEqual(printQueueBefore.length + 1);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});

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

@ -49,7 +49,6 @@ module.exports = Self => {
Self.uploadFile = async(ctx, options) => {
const models = Self.app.models;
const TempContainer = models.TempContainer;
const DmsContainer = models.DmsContainer;
const fileOptions = {};
const args = ctx.args;
@ -79,19 +78,21 @@ module.exports = Self => {
const addedDms = [];
for (const uploadedFile of files) {
const newDms = await createDms(ctx, uploadedFile, myOptions);
const pathHash = DmsContainer.getHash(newDms.id);
const file = await TempContainer.getFile(tempContainer.name, uploadedFile.name);
srcFile = path.join(file.client.root, file.container, file.name);
const dmsContainer = await DmsContainer.container(pathHash);
const dstFile = path.join(dmsContainer.client.root, pathHash, newDms.file);
await fs.move(srcFile, dstFile, {
overwrite: true
});
const data = {
workerFk: ctx.req.accessToken.userId,
dmsTypeFk: args.dmsTypeId,
companyFk: args.companyId,
warehouseFk: args.warehouseId,
reference: args.reference,
description: args.description,
contentType: uploadedFile.type,
hasFile: args.hasFile
};
const extension = await models.DmsContainer.getFileExtension(uploadedFile.name);
const newDms = await Self.createFromFile(data, extension, srcFile, myOptions);
addedDms.push(newDms);
}
@ -107,27 +108,4 @@ module.exports = Self => {
throw e;
}
};
async function createDms(ctx, file, myOptions) {
const models = Self.app.models;
const myUserId = ctx.req.accessToken.userId;
const args = ctx.args;
const newDms = await Self.create({
workerFk: myUserId,
dmsTypeFk: args.dmsTypeId,
companyFk: args.companyId,
warehouseFk: args.warehouseId,
reference: args.reference,
description: args.description,
contentType: file.type,
hasFile: args.hasFile
}, myOptions);
let fileName = file.name;
const extension = models.DmsContainer.getFileExtension(fileName);
fileName = `${newDms.id}.${extension}`;
return newDms.updateAttribute('file', fileName, myOptions);
}
};

View File

@ -87,6 +87,6 @@ module.exports = Self => {
await fs.access(file.path);
const stream = fs.createReadStream(file.path);
return [stream, file.contentType, `filename="${file.name}"`];
return [stream, file.contentType, `filename="${fileName}"`];
};
};

View File

@ -0,0 +1,132 @@
const {models} = require('vn-loopback/server/server');
describe('machineWorker updateInTime()', () => {
const itBoss = 104;
const davidCharles = 1106;
beforeAll(async() => {
ctx = {
req: {
accessToken: {},
headers: {origin: 'http://localhost'},
__: value => value
}
};
});
it('should throw an error if the plate does not exist', async() => {
const tx = await models.MachineWorker.beginTransaction({});
const options = {transaction: tx};
const plate = 'RE-123';
ctx.req.accessToken.userId = 1106;
try {
await models.MachineWorker.updateInTime(ctx, plate, options);
await tx.rollback();
} catch (e) {
const error = e;
expect(error.message).toContain('the plate does not exist');
await tx.rollback();
}
});
it('should grab a machine where is not in use', async() => {
const tx = await models.MachineWorker.beginTransaction({});
const options = {transaction: tx};
const plate = 'RE-003';
ctx.req.accessToken.userId = 1107;
try {
const totalBefore = await models.MachineWorker.find(null, options);
await models.MachineWorker.updateInTime(ctx, plate, options);
const totalAfter = await models.MachineWorker.find(null, options);
expect(totalAfter.length).toEqual(totalBefore.length + 1);
await tx.rollback();
} catch (e) {
await tx.rollback();
}
});
describe('less than 12h', () => {
const plate = 'RE-001';
it('should trow an error if it is not himself', async() => {
const tx = await models.MachineWorker.beginTransaction({});
const options = {transaction: tx};
ctx.req.accessToken.userId = davidCharles;
try {
await models.MachineWorker.updateInTime(ctx, plate, options);
await tx.rollback();
} catch (e) {
const error = e;
expect(error.message).toContain('This machine is already in use');
await tx.rollback();
}
});
it('should throw an error if it is himself with a different machine', async() => {
const tx = await models.MachineWorker.beginTransaction({});
const options = {transaction: tx};
ctx.req.accessToken.userId = itBoss;
const plate = 'RE-003';
try {
await models.MachineWorker.updateInTime(ctx, plate, options);
await tx.rollback();
} catch (e) {
const error = e;
expect(error.message).toEqual('You are already using a machine');
await tx.rollback();
}
});
it('should set the out time if it is himself', async() => {
const tx = await models.MachineWorker.beginTransaction({});
const options = {transaction: tx};
ctx.req.accessToken.userId = itBoss;
try {
const isNotParked = await models.MachineWorker.findOne({
where: {workerFk: itBoss}
}, options);
await models.MachineWorker.updateInTime(ctx, plate, options);
const isParked = await models.MachineWorker.findOne({
where: {workerFk: itBoss}
}, options);
expect(isNotParked.outTime).toBeNull();
expect(isParked.outTime).toBeDefined();
await tx.rollback();
} catch (e) {
await tx.rollback();
}
});
});
describe('equal or more than 12h', () => {
const plate = 'RE-002';
it('should set the out time and grab the machine', async() => {
const tx = await models.MachineWorker.beginTransaction({});
const options = {transaction: tx};
ctx.req.accessToken.userId = davidCharles;
const filter = {
where: {workerFk: davidCharles, machineFk: 2}
};
try {
const isNotParked = await models.MachineWorker.findOne(filter, options);
const totalBefore = await models.MachineWorker.find(null, options);
await models.MachineWorker.updateInTime(ctx, plate, options);
const isParked = await models.MachineWorker.findOne(filter, options);
const totalAfter = await models.MachineWorker.find(null, options);
expect(isNotParked.outTime).toBeNull();
expect(isParked.outTime).toBeDefined();
expect(totalAfter.length).toEqual(totalBefore.length + 1);
await tx.rollback();
} catch (e) {
await tx.rollback();
}
});
});
});

View File

@ -0,0 +1,77 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethodCtx('updateInTime', {
description: 'Updates the corresponding registry if the worker has been registered in the last few hours',
accessType: 'WRITE',
accepts: [
{
arg: 'plate',
type: 'string',
}
],
http: {
path: `/updateInTime`,
verb: 'POST'
}
});
Self.updateInTime = async(ctx, plate, options) => {
const models = Self.app.models;
const userId = ctx.req.accessToken.userId;
const $t = ctx.req.__;
let tx;
const myOptions = {};
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
const machine = await models.Machine.findOne({
fields: ['id', 'plate'],
where: {plate}
}, myOptions);
if (!machine)
throw new Error($t('the plate does not exist', {plate}));
const machineWorker = await Self.findOne({
where: {
or: [{machineFk: machine.id}, {workerFk: userId}],
outTime: null,
}
}, myOptions);
const {maxHours} = await models.MachineWorkerConfig.findOne({fields: ['maxHours']}, myOptions);
const hoursDifference = (Date.vnNow() - machineWorker.inTime.getTime()) / (60 * 60 * 1000);
if (machineWorker) {
const isHimself = userId == machineWorker.workerFk;
const isSameMachine = machine.id == machineWorker.machineFk;
if (hoursDifference < maxHours && !isHimself)
throw new UserError($t('This machine is already in use.'));
if (hoursDifference < maxHours && isHimself && !isSameMachine)
throw new UserError($t('You are already using a machine'));
await machineWorker.updateAttributes({
outTime: Date.vnNew()
}, myOptions);
}
if (!machineWorker || hoursDifference >= maxHours)
await models.MachineWorker.create({machineFk: machine.id, workerFk: userId}, myOptions);
if (tx) await tx.commit();
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};

View File

@ -0,0 +1,45 @@
module.exports = Self => {
Self.remoteMethodCtx('getVersion', {
description: 'gets app version data',
accessType: 'READ',
accepts: [{
arg: 'app',
type: 'string',
required: true
}],
returns: {
type: ['object'],
root: true
},
http: {
path: `/getVersion`,
verb: 'GET'
}
});
Self.getVersion = async(ctx, app) => {
const {models} = Self.app;
const userId = ctx.req.accessToken.userId;
const workerFk = await models.WorkerAppTester.findOne({
where: {
workerFk: userId
}
});
let fields = ['id', 'appName'];
if (workerFk)
fields = fields.concat(['isVersionBetaCritical', 'versionBeta', 'urlBeta']);
else
fields = fields.concat(['isVersionCritical', 'version', 'urlProduction']);
const filter = {
where: {
appName: app
},
fields,
};
return Self.findOne(filter);
};
};

View File

@ -0,0 +1,29 @@
const {models} = require('vn-loopback/server/server');
describe('mobileAppVersionControl getVersion()', () => {
const appName = 'delivery';
beforeAll(async() => {
ctx = {
req: {
accessToken: {},
headers: {origin: 'http://localhost'},
}
};
});
it('should get the version app', async() => {
ctx.req.accessToken.userId = 9;
const {version, versionBeta} = await models.MobileAppVersionControl.getVersion(ctx, appName);
expect(version).toEqual('9.2');
expect(versionBeta).toBeUndefined();
});
it('should get the beta version app', async() => {
ctx.req.accessToken.userId = 66;
const {version, versionBeta} = await models.MobileAppVersionControl.getVersion(ctx, appName);
expect(versionBeta).toBeDefined();
expect(version).toBeUndefined();
});
});

View File

@ -0,0 +1,20 @@
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:mrw="http://www.mrw.es/">
<soap:Header>
<mrw:AuthInfo>
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
<mrw:CodigoAbonado><%= mrw.subscriberCode %></mrw:CodigoAbonado>
<mrw:CodigoDepartamento/>
<mrw:UserName><%= mrw.user %></mrw:UserName>
<mrw:Password><%= mrw.password %></mrw:Password>
</mrw:AuthInfo>
</soap:Header>
<soap:Body>
<mrw:CancelarEnvio>
<mrw:request>
<mrw:CancelaEnvio>
<mrw:NumeroEnvioOriginal><%= externalId %></mrw:NumeroEnvioOriginal>
</mrw:CancelaEnvio>
</mrw:request>
</mrw:CancelarEnvio>
</soap:Body>
</soap:Envelope>

View File

@ -0,0 +1,46 @@
const axios = require('axios');
const fs = require('fs');
const ejs = require('ejs');
const {DOMParser} = require('xmldom');
module.exports = Self => {
Self.remoteMethod('cancelShipment', {
description: 'Cancel a shipment by providing the expedition ID, interacting with MRW WebService',
accessType: 'WRITE',
accepts: [{
arg: 'expeditionFk',
type: 'number',
required: true
}],
returns: {
type: ['object'],
root: true
},
http: {
path: `/cancelShipment`,
verb: 'POST'
}
});
Self.cancelShipment = async expeditionFk => {
const models = Self.app.models;
const mrw = await models.MrwConfig.findOne();
const {externalId} = await models.Expedition.findById(expeditionFk);
const template = fs.readFileSync(__dirname + '/cancelShipment.ejs', 'utf-8');
const renderedXml = ejs.render(template, {mrw, externalId});
const response = await axios.post(mrw.url, renderedXml, {
headers: {
'Content-Type': 'application/soap+xml; charset=utf-8'
}
});
const xmlString = response.data;
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
const [resultElement] = xmlDoc.getElementsByTagName('Mensaje');
return resultElement.textContent;
};
};

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:mrw="http://www.mrw.es/">
<soap:Header>
<mrw:AuthInfo>
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
<mrw:CodigoAbonado><%= mrw.subscriberCode %></mrw:CodigoAbonado>
<mrw:CodigoDepartamento/>
<mrw:UserName><%= mrw.user %></mrw:UserName>
<mrw:Password><%= mrw.password %></mrw:Password>
</mrw:AuthInfo>
</soap:Header>
<soap:Body>
<mrw:TransmEnvio>
<mrw:request>
<mrw:DatosEntrega>
<mrw:Direccion>
<mrw:CodigoTipoVia/>
<mrw:Via><%= expeditionData.street %></mrw:Via>
<mrw:Numero/>
<mrw:Resto/>
<mrw:CodigoPostal><%= expeditionData.postalCode %></mrw:CodigoPostal>
<mrw:Poblacion><%= expeditionData.city %></mrw:Poblacion>
<mrw:Provincia/>
<mrw:CodigoPais/>
</mrw:Direccion>
<mrw:Nif><%= expeditionData.fi %></mrw:Nif>
<mrw:Nombre><%= expeditionData.clientName %></mrw:Nombre>
<mrw:Telefono><%= expeditionData.phone %></mrw:Telefono>
</mrw:DatosEntrega>
<mrw:DatosServicio>
<mrw:Fecha><%= expeditionData.created %></mrw:Fecha>
<mrw:Referencia><%= expeditionData.expeditionDataId %></mrw:Referencia>
<mrw:CodigoServicio><%= expeditionData.serviceType %></mrw:CodigoServicio>
<mrw:NumeroBultos>1</mrw:NumeroBultos>
<mrw:EntregaSabado><%= expeditionData.weekDays %></mrw:EntregaSabado>
<mrw:Peso><%= expeditionData.kg %></mrw:Peso>
<mrw:Reembolso/>
<mrw:ImporteReembolso/>
</mrw:DatosServicio>
</mrw:request>
</mrw:TransmEnvio>
</soap:Body>
</soap:Envelope>

View File

@ -0,0 +1,118 @@
const axios = require('axios');
const {DOMParser} = require('xmldom');
const fs = require('fs');
const ejs = require('ejs');
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethod('createShipment', {
description: 'Create an expedition and return a base64Binary label from de MRW WebService',
accessType: 'WRITE',
accepts: [{
arg: 'expeditionFk',
type: 'number',
required: true
}],
returns: {
type: ['object'],
root: true
},
http: {
path: `/createShipment`,
verb: 'POST'
}
});
Self.createShipment = async(expeditionFk, options) => {
const myOptions = {};
let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
const models = Self.app.models;
const mrw = await models.MrwConfig.findOne(null, myOptions);
if (!mrw)
throw new UserError(`Some mrwConfig parameters are not set`);
const query =
`SELECT CASE co.code
WHEN 'ES' THEN a.postalCode
WHEN 'PT' THEN LEFT(a.postalCode, 4)
WHEN 'AD' THEN REPLACE(a.postalCode, 'AD', '00')
END postalCode,
a.city,
a.street,
co.code countryCode,
c.fi,
c.name clientName,
c.phone,
DATE_FORMAT(t.shipped, '%d/%m/%Y') created,
t.shipped,
e.id expeditionId,
LPAD(IF(mw.params IS NULL, ms.serviceType, mw.serviceType), 4 ,'0') serviceType,
IF(mw.weekdays, 'S', 'N') weekDays
FROM expedition e
JOIN ticket t ON e.ticketFk = t.id
JOIN agencyMode am ON am.id = t.agencyModeFk
JOIN mrwService ms ON ms.agencyModeCodeFk = am.code
LEFT JOIN mrwServiceWeekday mw ON mw.weekdays = DATE_FORMAT(t.shipped, '%a')
JOIN client c ON t.clientFk = c.id
JOIN address a ON t.addressFk = a.id
JOIN province p ON a.provinceFk = p.id
JOIN country co ON co.id = p.countryFk
WHERE e.id = ?
LIMIT 1`;
const [expeditionData] = await Self.rawSql(query, [expeditionFk], myOptions);
if (!expeditionData)
throw new UserError(`This expedition is not a MRW shipment`);
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
if (expeditionData?.shipped.setHours(0, 0, 0, 0) < today)
throw new UserError(`This ticket has a shipped date earlier than today`);
const shipmentResponse = await sendXmlDoc('createShipment', {mrw, expeditionData}, 'application/soap+xml');
const shipmentId = getTextByTag(shipmentResponse, 'NumeroEnvio');
if (!shipmentId)
throw new UserError(getTextByTag(shipmentResponse, 'Mensaje'));
const getLabelResponse = await sendXmlDoc('getLabel', {mrw, shipmentId}, 'text/xml');
const file = getTextByTag(getLabelResponse, 'EtiquetaFile');
try {
await models.Expedition.updateAll({id: expeditionFk}, {externalId: shipmentId}, myOptions);
if (tx) await tx.commit();
} catch (error) {
if (tx) await tx.rollback();
throw error;
}
return file;
};
function getTextByTag(xmlDoc, tag) {
return xmlDoc?.getElementsByTagName(tag)[0]?.textContent;
}
async function sendXmlDoc(xmlDock, params, contentType) {
const parser = new DOMParser();
const xmlTemplate = fs.readFileSync(__dirname + `/${xmlDock}.ejs`, 'utf-8');
const renderedTemplate = ejs.render(xmlTemplate, params);
const data = await axios.post(params.mrw.url, renderedTemplate, {
headers: {
'Content-Type': `${contentType}; charset=utf-8`
}
});
return parser.parseFromString(data.data, 'text/xml');
}
};

View File

@ -0,0 +1,25 @@
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mrw="http://www.mrw.es/">
<soapenv:Header>
<mrw:AuthInfo>
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
<mrw:CodigoAbonado><%= mrw.subscriberCode %></mrw:CodigoAbonado>
<mrw:CodigoDepartamento/>
<mrw:UserName><%= mrw.user %></mrw:UserName>
<mrw:Password><%= mrw.password %></mrw:Password>
</mrw:AuthInfo>
</soapenv:Header>
<soapenv:Body>
<mrw:GetEtiquetaEnvio>
<mrw:request>
<mrw:NumeroEnvio><%= shipmentId %></mrw:NumeroEnvio>
<mrw:NumerosEtiqueta>1</mrw:NumerosEtiqueta>
<mrw:SeparadorNumerosEnvio></mrw:SeparadorNumerosEnvio>
<mrw:FechaInicioEnvio></mrw:FechaInicioEnvio>
<mrw:FechaFinEnvio></mrw:FechaFinEnvio>
<mrw:TipoEtiquetaEnvio>0</mrw:TipoEtiquetaEnvio>
<mrw:ReportTopMargin>0</mrw:ReportTopMargin>
<mrw:ReportLeftMargin>0</mrw:ReportLeftMargin>
</mrw:request>
</mrw:GetEtiquetaEnvio>
</soapenv:Body>
</soapenv:Envelope>

View File

@ -0,0 +1,120 @@
const models = require('vn-loopback/server/server').models;
const axios = require('axios');
const fs = require('fs');
const mockBase64Binary = 'base64BinaryString';
const ticket1 = {
'id': '44',
'clientFk': 1101,
'shipped': Date.vnNew(),
'nickname': 'MRW',
'addressFk': 1,
'agencyModeFk': 999
};
const expedition1 = {
'id': 17,
'agencyModeFk': 999,
'ticketFk': 44,
'freightItemFk': 71,
'created': '2001-01-01',
'counter': 1,
'workerFk': 18,
'packagingFk': '94',
'hostFk': '',
'stateTypeFk': 3,
'hasNewRoute': 0,
'isBox': 71,
'editorFk': 100
};
let tx;
let options;
describe('MRWConfig createShipment()', () => {
beforeEach(async() => {
options = tx = undefined;
tx = await models.MrwConfig.beginTransaction({});
options = {transaction: tx};
await models.Agency.create(
{'id': 999, 'name': 'mrw'},
options
);
await models.AgencyMode.create(
{'id': 999, 'name': 'mrw', 'agencyFk': 999, 'code': 'mrw'},
options
);
await models.MrwConfig.create(
{
'url': 'https://url.com',
'user': 'user',
'password': 'password',
'franchiseCode': 'franchiseCode',
'subscriberCode': 'subscriberCode'
}, options
);
await models.Application.rawSql(
`INSERT INTO vn.mrwService
SET agencyModeCodeFk = 'mrw',
clientType = 1,
serviceType = 1,
kg = 1`, null, options
);
await models.Ticket.create(ticket1, options);
await models.Expedition.create(expedition1, options);
});
afterEach(async() => {
await tx.rollback();
});
it('should create a shipment and return a base64Binary label', async() => {
const mockPostResponses = [
{data: fs.readFileSync(__dirname + '/mockGetLabel.xml', 'utf-8')},
{data: fs.readFileSync(__dirname + '/mockCreateShipment.xml', 'utf-8')}
];
spyOn(axios, 'post').and.callFake(() => Promise.resolve(mockPostResponses.pop()));
const base64Binary = await models.MrwConfig.createShipment(expedition1.id, options);
expect(base64Binary).toEqual(mockBase64Binary);
});
it('should fail if mrwConfig has no data', async() => {
let error;
await models.MrwConfig.createShipment(expedition1.id).catch(e => {
error = e;
}).finally(async() => {
expect(error.message).toEqual(`Some mrwConfig parameters are not set`);
});
expect(error).toBeDefined();
});
it('should fail if expeditionFk is not a MrwExpedition', async() => {
let error;
await models.MrwConfig.createShipment(undefined, options).catch(e => {
error = e;
}).finally(async() => {
expect(error.message).toEqual(`This expedition is not a MRW shipment`);
});
});
it(' should fail if the creation date of this ticket is before the current date it', async() => {
let error;
const yesterday = Date.vnNew();
yesterday.setDate(yesterday.getDate() - 1);
await models.Ticket.updateAll({id: ticket1.id}, {shipped: yesterday}, options);
await models.MrwConfig.createShipment(expedition1.id, options).catch(e => {
error = e;
}).finally(async() => {
expect(error.message).toEqual(`This ticket has a shipped date earlier than today`);
});
});
});

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<TransmEnvioResponse xmlns="http://www.mrw.es/">
<TransmEnvioResult>
<Estado>1</Estado>
<Mensaje />
<NumeroSolicitud>1</NumeroSolicitud>
<NumeroEnvio>1</NumeroEnvio>
<Url>http://url.com</Url>
</TransmEnvioResult>
</TransmEnvioResponse>
</soap:Body>
</soap:Envelope>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetEtiquetaEnvioResponse xmlns="http://www.mrw.es/">
<GetEtiquetaEnvioResult>
<Estado>1</Estado>
<Mensaje />
<EtiquetaFile>base64BinaryString</EtiquetaFile>
</GetEtiquetaEnvioResult>
</GetEtiquetaEnvioResponse>
</soap:Body>
</soap:Envelope>

View File

@ -22,7 +22,7 @@ module.exports = Self => {
const {url} = await Self.app.models.Url.findOne({
where: {
appName,
enviroment: process.env.NODE_ENV || 'development'
environment: process.env.NODE_ENV || 'development'
}
});
return url;

View File

@ -13,7 +13,7 @@
"AuthCode": {
"dataSource": "vn"
},
"Bank": {
"Accounting": {
"dataSource": "vn"
},
"Buyer": {
@ -79,9 +79,15 @@
"Language": {
"dataSource": "vn"
},
"Machine": {
"dataSource": "vn"
},
"MachineWorker": {
"dataSource": "vn"
},
"MachineWorkerConfig": {
"dataSource": "vn"
},
"MobileAppVersionControl": {
"dataSource": "vn"
},
@ -159,6 +165,9 @@
},
"VnRole": {
"dataSource": "vn"
},
"MrwConfig": {
"dataSource": "vn"
}
}

View File

@ -1,9 +1,9 @@
{
"name": "Bank",
"name": "Accounting",
"base": "VnModel",
"options": {
"mysql": {
"table": "bank"
"table": "accounting"
}
},
"properties": {
@ -22,10 +22,7 @@
},
"accountingTypeFk": {
"type": "number",
"required": true,
"mysql": {
"columnName": "cash"
}
"required": true
},
"entityFk": {
"type": "number",

View File

@ -1,7 +1,8 @@
module.exports = Self => {
require('../methods/collection/getCollection')(Self);
require('../methods/collection/getSectors')(Self);
require('../methods/collection/setSaleQuantity')(Self);
require('../methods/collection/previousLabel')(Self);
require('../methods/collection/getTickets')(Self);
require('../methods/collection/assign')(Self);
require('../methods/collection/getSales')(Self);
};

View File

@ -1,4 +1,6 @@
const UserError = require('vn-loopback/util/user-error');
const fs = require('fs-extra');
const path = require('path');
module.exports = Self => {
require('../methods/dms/downloadFile')(Self);
@ -35,4 +37,32 @@ module.exports = Self => {
return [stream, dms.contentType, `filename="${dms.file}"`];
};
Self.getPath = async function(dms) {
const models = Self.app.models;
const pathHash = await models.DmsContainer.getHash(dms.id);
const dmsContainer = await models.DmsContainer.container(pathHash);
const dstFile = path.join(dmsContainer.client.root, pathHash, dms.file);
return dstFile;
};
Self.createWithExtension = async function(data, extension, options) {
const newDms = await Self.create(data, options);
return newDms.updateAttribute('file', `${newDms.id}.${extension}`, options);
};
Self.createFromFile = async function(data, extension, srcFile, options) {
const dms = await Self.createWithExtension(data, extension, options);
const dstFile = await Self.getPath(dms);
await fs.move(srcFile, dstFile, {overwrite: true});
return dms;
};
Self.createFromStream = async function(data, extension, stream, options) {
const dms = await Self.createWithExtension(data, extension, options);
const dstFile = await Self.getPath(dms);
const writeStream = await fs.createWriteStream(dstFile);
await stream.pipe(writeStream);
return dms;
};
};

View File

@ -0,0 +1,18 @@
{
"name": "MachineWorkerConfig",
"base": "VnModel",
"options": {
"mysql": {
"table": "vn.machineWorkerConfig"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"maxHours": {
"type": "number"
}
}
}

View File

@ -0,0 +1,3 @@
module.exports = Self => {
require('../methods/machine-worker/updateInTime')(Self);
};

18
back/models/machine.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "Machine",
"base": "VnModel",
"options": {
"mysql": {
"table": "vn.machine"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"plate": {
"type": "string"
}
}
}

View File

@ -0,0 +1,3 @@
module.exports = Self => {
require('../methods/mobile-app-version-control/getVersion')(Self);
};

View File

@ -0,0 +1,39 @@
{
"name": "MobileAppVersionControl",
"base": "VnModel",
"options": {
"mysql": {
"table": "vn.mobileAppVersionControl"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"appName": {
"type": "string"
},
"version": {
"type": "string"
},
"isVersionCritical": {
"type": "boolean"
},
"urlProduction": {
"type": "string"
},
"urlBeta": {
"type": "string"
},
"versionBeta": {
"type": "string"
},
"isVersionBetaCritical": {
"type": "boolean"
}
}
}

View File

@ -0,0 +1,4 @@
module.exports = Self => {
require('../methods/mrw-config/createShipment')(Self);
require('../methods/mrw-config/cancelShipment')(Self);
};

View File

@ -0,0 +1,31 @@
{
"name": "MrwConfig",
"base": "VnModel",
"options": {
"mysql": {
"table": "mrwConfig"
}
},
"properties": {
"id": {
"type": "number",
"required": true
},
"url": {
"type": "string",
"required": true
},
"user": {
"type": "string"
},
"password": {
"type": "string"
},
"franchiseCode": {
"type": "string"
},
"subscriberCode": {
"type": "string"
}
}
}

View File

@ -47,7 +47,7 @@
},
"bank": {
"type": "belongsTo",
"model": "Bank",
"model": "Accounting",
"foreignKey": "bankFk"
},
"payMethod": {

View File

@ -1,23 +1,6 @@
const models = require('vn-loopback/server/server').models;
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() => {
const tx = await models.MailAliasAccount.beginTransaction({});
let error;

View File

@ -17,7 +17,8 @@ const opts = getopts(process.argv.slice(2), {
let server;
const PARALLEL = false;
const TIMEOUT = 900000;
const SETUP_TIMEOUT = 15 * 60 * 1000;
const SPEC_TIMEOUT = 30 * 1000;
process.on('exit', teardown);
process.on('uncaughtException', onError);
@ -74,9 +75,9 @@ async function test() {
let runner;
const config = {
globalSetup: setup,
globalSetupTimeout: TIMEOUT,
globalSetupTimeout: SETUP_TIMEOUT,
globalTeardown: teardown,
globalTeardownTimeout: TIMEOUT,
globalTeardownTimeout: SETUP_TIMEOUT,
spec_dir: '.',
spec_files: [
'back/**/*[sS]pec.js',
@ -111,10 +112,11 @@ async function test() {
runner.addReporter(new JunitReporter.JUnitXmlReporter());
}
if (opts.ci)
runner.jasmine.DEFAULT_TIMEOUT_INTERVAL = TIMEOUT;
runner.jasmine.DEFAULT_TIMEOUT_INTERVAL = SPEC_TIMEOUT;
// runner.loadConfigFile('back/jasmine.json');
runner.loadConfig(config);
process.env.SPEC_IS_RUNNING = true;
await runner.execute();
}

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' */;
/*!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','10818','b7edbbe12f35d0cbc3e6b83e54977ac1c8acfc74','2024-01-25 10:00:48','10831');
INSERT INTO `version` VALUES ('vn-database','10943','fbdebad12c9b306004dee3fba252c1fc4613584e','2024-03-07 10:29:57','10943');
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);
@ -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','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','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','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);
@ -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','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','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','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);
@ -574,7 +575,137 @@ 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','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','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','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','10835','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:52',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','01-Bancos_poliza.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:52',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','03-Entradas_orden.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','04-Pagares.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','05-Proveedores_gestdoc.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','06-Remesas.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','07-Saldos_Prevision.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','08-Series.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','09-Split_lines.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','10-Split.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','11-Vehiculos_consumo.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','12-account_conciliacion.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','13-account_detail.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','14-account_detail_type.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','15-agencia_descuadre.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','16-airline.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','17-airport.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','18-albaran.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','19-albaran_gestdoc.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','20-albaran_state.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','21-awb_component.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','22-awb_component_template.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','23-awb_component_type.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','24-awb_gestdoc.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','25-awb_recibida.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','26-awb_role.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','27-awb_unit.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','28-balance_nest_tree.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','29-buy_edi_k012.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','30-buy_edi_k03.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','31-buy_edi_k04.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','32-definitivo.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','33-dropTables.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10835','34-permisos.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:57',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','10841','00-entryDms.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:55',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','10856','00-cloneAcl.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10857','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:57',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);
INSERT INTO `versionLog` VALUES ('vn-database','10862','00-alterAgencyTermConfig.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10862','00-alterGastosResumen.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10862','00-alterInvoiceOutTaxConfig.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10862','00-alterItemGroupToOffer.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10862','01-ventasContablesPk.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10862','02-updateExpenseRegularize.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10862','03-updateExpense.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10862','04-updateExpenseConflict.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10863','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:59',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10865','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:59',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10867','00-createAclInvoiceIn.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:59',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10867','01-createInvoiceInCorrection.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10868','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10869','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10871','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10872','00-aclUpdateFiscalData.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10873','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10874','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10876','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10878','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10879','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10882','00-vehicle.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10883','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10884','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10885','00-revokeUpdateClient.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10888','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-16 07:39:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10889','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-23 09:55:56',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10890','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:33:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10891','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:58',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','01-financialProductType.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:58',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','02-flight.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:12:58',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','03-gastos_resumen.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:00',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','04-integra2.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','05-integra2_province.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','06-intervalos__delete.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','10-mail_templates__delete.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','12-ticket_location__delete.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','13-turn__delete.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','14-movement_label.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','15-pago_sdc.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','25-warehouse_pickup.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','29-kk.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:03',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10896','30-permissions.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:03',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10898','00-table.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:03',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10903','00-professionalCategoryAddCode.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-23 08:38:28',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10906','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:04',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10908','00-createSupplierDms.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:24',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10909','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-26 11:07:35',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10912','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:25',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10914','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-28 11:52:54',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10922','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-29 13:44:58',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10940','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-03-06 16:48:18',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10941','00-restoreVn2008Jerarquia.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-03-07 09:36:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10942','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 10:24:45',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10943','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-03-07 10:29:57',NULL,NULL);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@ -631,7 +762,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 (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 (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 (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);
@ -669,6 +800,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 (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 (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 (2,1,3,NULL);
@ -781,7 +913,6 @@ INSERT INTO `roleInherit` VALUES (142,35,75,NULL);
INSERT INTO `roleInherit` VALUES (143,15,49,NULL);
INSERT INTO `roleInherit` VALUES (145,17,67,NULL);
INSERT INTO `roleInherit` VALUES (146,38,13,NULL);
INSERT INTO `roleInherit` VALUES (147,101,35,NULL);
INSERT INTO `roleInherit` VALUES (148,101,13,NULL);
INSERT INTO `roleInherit` VALUES (150,15,56,NULL);
INSERT INTO `roleInherit` VALUES (152,69,47,NULL);
@ -932,6 +1063,9 @@ INSERT INTO `roleInherit` VALUES (355,127,11,NULL);
INSERT INTO `roleInherit` VALUES (356,123,125,NULL);
INSERT INTO `roleInherit` VALUES (357,36,35,NULL);
INSERT INTO `roleInherit` VALUES (358,36,49,NULL);
INSERT INTO `roleInherit` VALUES (359,129,35,NULL);
INSERT INTO `roleInherit` VALUES (360,101,129,NULL);
INSERT INTO `roleInherit` VALUES (361,50,112,NULL);
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
@ -1170,7 +1304,7 @@ INSERT INTO `ACL` VALUES (293,'RoleInherit','*','*','ALLOW','ROLE','it');
INSERT INTO `ACL` VALUES (294,'RoleRole','*','*','ALLOW','ROLE','it');
INSERT INTO `ACL` VALUES (295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin');
INSERT INTO `ACL` VALUES (296,'Collection','*','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing');
INSERT INTO `ACL` VALUES (297,'Sale','clone','WRITE','ALLOW','ROLE','invoicing');
INSERT INTO `ACL` VALUES (298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative');
INSERT INTO `ACL` VALUES (299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (302,'AgencyTerm','*','*','ALLOW','ROLE','administrative');
@ -1197,8 +1331,8 @@ INSERT INTO `ACL` VALUES (323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','clai
INSERT INTO `ACL` VALUES (324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing');
INSERT INTO `ACL` VALUES (325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant');
INSERT INTO `ACL` VALUES (326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager');
INSERT INTO `ACL` VALUES (327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant');
INSERT INTO `ACL` VALUES (328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager');
INSERT INTO `ACL` VALUES (327,'Sale','clone','WRITE','ALLOW','ROLE','salesAssistant');
INSERT INTO `ACL` VALUES (328,'Sale','clone','WRITE','ALLOW','ROLE','claimManager');
INSERT INTO `ACL` VALUES (329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing');
INSERT INTO `ACL` VALUES (330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson');
INSERT INTO `ACL` VALUES (331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson');
@ -1259,8 +1393,6 @@ INSERT INTO `ACL` VALUES (385,'Route','driverRoutePdf','READ','ALLOW','ROLE','em
INSERT INTO `ACL` VALUES (386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer');
INSERT INTO `ACL` VALUES (388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative');
INSERT INTO `ACL` VALUES (389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager');
INSERT INTO `ACL` VALUES (390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager');
INSERT INTO `ACL` VALUES (391,'Notification','*','WRITE','ALLOW','ROLE','system');
INSERT INTO `ACL` VALUES (392,'Boxing','*','*','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (393,'Url','*','READ','ALLOW','ROLE','employee');
@ -1506,9 +1638,7 @@ INSERT INTO `ACL` VALUES (673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','R
INSERT INTO `ACL` VALUES (674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing');
INSERT INTO `ACL` VALUES (676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (681,'MailAliasAccount','create','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 (685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement');
INSERT INTO `ACL` VALUES (686,'MailForward','*','*','ALLOW','ROLE','hr');
@ -1519,7 +1649,6 @@ INSERT INTO `ACL` VALUES (690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss')
INSERT INTO `ACL` VALUES (691,'Roadmap','*','*','ALLOW','ROLE','productionBoss');
INSERT INTO `ACL` VALUES (692,'ExpeditionTruck','*','*','ALLOW','ROLE','production');
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 (696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative');
@ -1553,7 +1682,7 @@ INSERT INTO `ACL` VALUES (725,'Account','findOne','READ','ALLOW','ROLE','employe
INSERT INTO `ACL` VALUES (726,'Account','findById','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (727,'Account','find','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (728,'Account','exists','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (729,'Sale','refund','WRITE','ALLOW','ROLE','buyer');
INSERT INTO `ACL` VALUES (729,'Sale','clone','WRITE','ALLOW','ROLE','buyer');
INSERT INTO `ACL` VALUES (730,'Ticket','setDeleted','WRITE','ALLOW','ROLE','deliveryAssistant');
INSERT INTO `ACL` VALUES (732,'Sale','isInPreparing','*','ALLOW','ROLE','production');
INSERT INTO `ACL` VALUES (733,'Train','*','READ','ALLOW','ROLE','production');
@ -1610,6 +1739,20 @@ INSERT INTO `ACL` VALUES (783,'WorkerTimeControl','resendWeeklyHourEmail','WRITE
INSERT INTO `ACL` VALUES (784,'VnRole','*','READ','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (785,'VnRole','*','WRITE','ALLOW','ROLE','it');
INSERT INTO `ACL` VALUES (786,'State','isAllEditable','READ','ALLOW','ROLE','delivery');
INSERT INTO `ACL` VALUES (787,'Ticket','makePdfList','*','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (788,'Ticket','invoiceTicketsAndPdf','*','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (789,'InvoiceIn','*','*','ALLOW','ROLE','buyer');
INSERT INTO `ACL` VALUES (790,'InvoiceIn','getSerial','READ','ALLOW','ROLE','buyer');
INSERT INTO `ACL` VALUES (791,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','administrative');
INSERT INTO `ACL` VALUES (792,'InvoiceInCorrection','*','*','ALLOW','ROLE','administrative');
INSERT INTO `ACL` VALUES (793,'Supplier','updateAllFiscalData','WRITE','ALLOW','ROLE','administrative');
INSERT INTO `ACL` VALUES (794,'Supplier','updateFiscalData','WRITE','ALLOW','ROLE','buyer');
INSERT INTO `ACL` VALUES (795,'Ticket','myLastModified','*','ALLOW','ROLE','production');
INSERT INTO `ACL` VALUES (796,'MrwConfig','cancelShipment','WRITE','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (797,'MrwConfig','createShipment','WRITE','ALLOW','ROLE','employee');
INSERT INTO `ACL` VALUES (798,'MailAliasAccount','*','*','ALLOW','ROLE','itManagement');
INSERT INTO `ACL` VALUES (799,'Ticket','saveCmr','*','ALLOW','ROLE','developer');
INSERT INTO `ACL` VALUES (800,'EntryDms','*','*','ALLOW','ROLE','employee');
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
@ -1708,8 +1851,6 @@ USE `vn`;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
INSERT INTO `agencyTermConfig` VALUES ('6240000000','4721000015',21.0000000000,'Adquisiciones intracomunitarias de servicios');
INSERT INTO `alertLevel` VALUES ('FREE',0,1);
INSERT INTO `alertLevel` VALUES ('ON_PREPARATION',1,1);
INSERT INTO `alertLevel` VALUES ('PACKED',2,0);
@ -1909,6 +2050,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 (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 (49,'sustitución',4,NULL,NULL,1,'substitution',0);
INSERT INTO `componentType` VALUES (1,'coste',1,0,'COST');
INSERT INTO `componentType` VALUES (2,'com ventas',1,1,NULL);
@ -1929,59 +2071,61 @@ INSERT INTO `continent` VALUES (3,'África','AF');
INSERT INTO `continent` VALUES (4,'Europa','EU');
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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (1,'VN','VERDNATURA',1,110,763,0,0,0,0,27,NULL,'/',NULL,0,NULL,0,0,0,0,NULL,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,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,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,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,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,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,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,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,1,NULL,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,1,NULL,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,NULL);
INSERT INTO `department` VALUES (43,'VT','VENTAS',38,67,NULL,0,0,0,1,14,1,'/1/',NULL,1,'',1,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (44,'management','GERENCIA',68,69,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',70,71,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (46,'delivery','REPARTO',72,73,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (48,'storage','ALMACENAJE',74,75,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (49,NULL,'PROPIEDAD',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (52,NULL,'CARGA AEREA',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (53,'marketing','MARKETING Y COMUNICACIÓN',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (54,NULL,'ORNAMENTALES',82,83,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,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,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,NULL);
INSERT INTO `department` VALUES (58,'CMP','CAMPOS',84,87,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',88,89,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',39,40,NULL,72,0,0,2,0,43,'/1/43/',NULL,1,NULL,1,1,0,0,NULL,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,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,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,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,NULL);
INSERT INTO `department` VALUES (80,NULL,'EQUIPO J VALLES',41,42,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'equipojvalles@verdnatura.es',0,0,0,0,NULL,NULL,'5300');
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,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,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,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,NULL);
INSERT INTO `department` VALUES (92,NULL,'EQUIPO SILVERIO',43,44,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (94,NULL,'EQUIPO J BROCAL',45,46,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',0,'equipojbrocal@verdnatura.es',0,0,0,0,NULL,NULL,'5100');
INSERT INTO `department` VALUES (95,NULL,'EQUIPO C ZAMBRANO',47,48,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',0,'equipoczambrano@verdnatura.es',0,0,0,0,NULL,NULL,'5000');
INSERT INTO `department` VALUES (96,NULL,'EQUIPO C LOPEZ',49,50,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (115,NULL,'EQUIPO CLAUDI',51,52,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (123,NULL,'EQUIPO ELENA BASCUÑANA',53,54,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,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,NULL);
INSERT INTO `department` VALUES (125,NULL,'EQUIPO MIRIAM MAR',55,56,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',0,'equipomirgir@verdnatura.es',0,0,0,0,NULL,NULL,'5200');
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,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,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,1,NULL,NULL,NULL);
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',85,86,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',57,58,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',59,60,1731,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'francia@verdnatura.es',0,0,0,0,NULL,NULL,'3300');
INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',61,62,6264,0,0,0,2,0,43,'/1/43/','pt_equipo',1,'portugal@verdnatura.es',0,0,0,0,NULL,NULL,'3500');
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,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,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,NULL);
INSERT INTO `department` VALUES (139,NULL,'EQUIPO J SORIA ',63,64,3803,0,0,0,2,0,43,'/1/43/','jss_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,'5400');
INSERT INTO `department` VALUES (140,'hollandTeam','EQUIPO HOLANDA',65,66,NULL,0,0,0,2,0,43,'/1/43/','nl_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
INSERT INTO `department` VALUES (141,NULL,'PREVIA',33,34,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,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);

View File

@ -76,6 +76,7 @@ INSERT IGNORE INTO `db` VALUES ('','bs','developer','Y','Y','Y','Y','N','N','N'
INSERT IGNORE INTO `db` VALUES ('','bi','developer','Y','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N');
INSERT IGNORE INTO `db` VALUES ('','util','grafana','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N');
INSERT IGNORE INTO `db` VALUES ('','mysql','developerBoss','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N');
INSERT IGNORE INTO `db` VALUES ('','rfid','developerBoss','Y','Y','Y','Y','N','N','Y','N','N','N','N','N','N','N','N','N','Y','N','N','N');
/*!40000 ALTER TABLE `db` ENABLE KEYS */;
/*!40000 ALTER TABLE `tables_priv` DISABLE KEYS */;
@ -101,19 +102,17 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','edi','buyer','value','alexm@%','00
INSERT IGNORE INTO `tables_priv` VALUES ('','mysql','developerBoss','general_log','juan@10.5.1.1','0000-00-00 00:00:00','Select,Drop','');
INSERT IGNORE INTO `tables_priv` VALUES ('','dipole','employee','expedition_PrintOut','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','logistic','marketPlace','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','definitivo','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','definitivo','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','manager','item_group','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','administrative','item_feature','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','buyer','item_feature','alexm@%','0000-00-00 00:00:00','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 ('','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','financialBoss','credit','jenkins@db-proxy1.servers.dc.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','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 ('','vn2008','employee','province','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','versiones','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','mistakeType','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','warehouse','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','account','itemTaxCountry','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
@ -166,8 +165,8 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','guest','location','root@p
INSERT IGNORE INTO `tables_priv` VALUES ('','account','hr','mailAliasAccount','$itBoss@10.0.2.69','2022-08-03 23:44:43','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','tag','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','guest','news','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k012','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','buy_edi_k012','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k012','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','buy_edi_k012','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','guest','myMenu','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','guest','myBasket','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','guest','message','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
@ -178,7 +177,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','account','hr','account','$itBoss@1
INSERT IGNORE INTO `tables_priv` VALUES ('','salix','android','AccessToken','jenkins@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerBoss','itemTag','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','itemTag','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','buy_edi_k03','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','buy_edi_k03','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','psico','hr','examQuestion','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','psico','hr','exam','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','manager','exchange','alexm@%','0000-00-00 00:00:00','Select','');
@ -222,7 +221,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','edi','salesPerson','item_groupToOf
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','account','myTicketService','root@10.2.3.180','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','sage','administrative','movConta','carlosap@172.16.5.232','2022-08-03 23:44:43','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','employee','mailConfig','jgallego@81.202.38.190','2022-08-03 23:44:43','','Select');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','account_conciliacion','alexm@%','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','account_conciliacion','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','accion_dits','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','config','juan@%','0000-00-00 00:00:00','','Select');
INSERT IGNORE INTO `tables_priv` VALUES ('','util','account','config','$itBoss@10.0.2.69','2022-08-03 23:44:43','Select','');
@ -244,49 +243,47 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','time','guillermo@db-p
INSERT IGNORE INTO `tables_priv` VALUES ('','mysql','developer','slow_log','$itBoss@10.0.2.68','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','mysql','developer','user','$itBoss@10.0.2.68','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','mysql','developer','proc','$itBoss@10.0.2.68','2022-08-03 23:44:43','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','account_detail','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','account_detail_type','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','account_detail','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','account_detail_type','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','entryEditor','Compres','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Agencias','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','awb_component','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','awb_component','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','account','developer','emailUser','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','agencia_descuadre','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','airline','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','airline','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','airline','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','airline','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','agency_warehouse','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','salesPerson','inter','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Articles_botanical','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran_gestdoc','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran_state','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran_state','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Articles','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Articles_botanical','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','awb','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_component','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component_template','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_component_type','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','awb_gestdoc','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_gestdoc','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_recibida','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_role','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_unit','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financialBoss','balance_nest_tree','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_component','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component_template','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_component_type','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','awb_gestdoc','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb_recibida','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_role','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_unit','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financialBoss','balance_nest_tree','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','deliveryBoss','inter','juan@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Bancos','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','barcodes','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','barcodes','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','buyer','inter','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','employee','inter','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_gestdoc','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','agency','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','buySource','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','buy_edi','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','buy_edi_k04','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k03','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k04','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','buy_edi_k04','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k03','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k04','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesAssistant','Clientes','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','v_empresa','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','v_empresa','alexm@%','0000-00-00 00:00:00','Select','');
@ -294,18 +291,15 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','chanel','al
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','v_empresa','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Clientes','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','V_edi_item_track','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','v_compres','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionPlus','v_botanic_export','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','manager','v_botanic_export','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','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','buyer','recibida_vencimiento','jgallego@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
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 ('','vn','hr','workerBusinessAgreement','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','tarifa_componentes','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','officeBoss','Vehiculos','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','tarifa_componentes_series','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','Entradas','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemType','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
@ -316,32 +310,30 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','producer','alexm@
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','officeBoss','ticket_observation','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Cajas','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','cmrConfig','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','awb_recibida','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','awb_recibida','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','awb','juan@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Compres','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','workerDocument','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','buy_edi','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','ACL','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Vehiculos_consumo','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Vehiculos_consumo','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','palletizer','cmr','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Colores','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','state','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Consignatarios','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','artificialBoss','travel','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','price_fixed','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','Vehiculos','juan@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','printQueue','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','preservedBoss','travel','alexm@%','0000-00-00 00:00:00','Insert,Delete','');
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','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
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','financialBoss','credit','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerAssistant','itemType','jgallego@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
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','buyerBoss','Cubos_Retorno','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','artificialBoss','state','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','travel','alexm@%','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Bancos_poliza','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Bancos_poliza','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','cmr','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','edi_bucket_type','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','edi_bucket','alexm@%','0000-00-00 00:00:00','Select','');
@ -365,7 +357,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Entradas','ale
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','ticket_observation','juan@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Entradas_dits','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','sale','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Entradas_orden','alexm@%','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Entradas_orden','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','ticket_observation','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas_turno','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','entrySource','alexm@%','0000-00-00 00:00:00','Select','');
@ -378,18 +370,15 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','tickets_gestdoc'
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','tickets_gestdoc','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Tickets','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Entradas','root@localhost','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','expeditions','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Entradas','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Facturas','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Facturas','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Tintas','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','filtros','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas_kop','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','flight','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','warehouse_pickup','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','flight','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','warehouse_pickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','zones','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','warehouse_pickup','juan@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','warehouse_pickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','businessReasonEnd','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','businessCalendar','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','business','alexm@%','0000-00-00 00:00:00','Select','');
@ -416,17 +405,15 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','calendarHolidays'
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','mandato','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','mandato','alexm@%','0000-00-00 00:00:00','Select,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','iva_group','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','invoiceCorrection','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','intrastat_data','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','intrastat_data','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','greugeType','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceInIntrastat','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','greuge','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Intrastat','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Intrastat','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','integra2_province','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','integra2_province','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Grupos','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Greuges','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','gesttip','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','gestdoc','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Gastos','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','dms','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','continent','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','artificialBoss','Movimientos_componentes','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Movimientos_componentes','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Movimientos_mark','alexm@%','0000-00-00 00:00:00','Delete','');
@ -442,7 +429,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','pago','a
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','awb','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Paises','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','salesAssistant','clientDied','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','warehouse_pickup','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','warehouse_pickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','payroll_categorias','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','payroll_centros','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','payroll_conceptos','alexm@%','0000-00-00 00:00:00','Select,Update','');
@ -464,16 +451,14 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Proveedo
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','PreciosEspeciales','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','agencia_descuadre','alexm@%','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','price_fixed','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','gestdoc','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','iva_tipo','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','iva_codigo','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','pago','alexm@%','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Proveedores','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Proveedores_cargueras','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Proveedores_gestdoc','juan@%','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','palletizer','Facturas','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Proveedores_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','expedition','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Proveedores_gestdoc','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Proveedores_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','recibida','juan@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','recibida','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','adminOfficer','recibida_iva','alexm@%','0000-00-00 00:00:00','Delete','');
@ -484,16 +469,14 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Recibos','a
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','officeBoss','bankEntity','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','agency','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','bankEntity','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','reference_min','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','versiones','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','reference_rate','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','saleComponent','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','Remesas','juan@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','Remesas','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','Reservas','alexm@%','0000-00-00 00:00:00','Select,Insert,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 ('','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','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','');
@ -509,9 +492,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','srt','grafana','bufferState','juan
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','coolerAssist','state','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','absenceType','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','artificialBoss','Entradas_Auto','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','XDiario','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','Vehiculos_consumo','alexm@%','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','XDiario','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','Vehiculos_consumo','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','tblContadores','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','buyMark','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','calendar','juan@10.5.1.2','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
@ -563,7 +544,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionBoss','sale','alexm
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','packingSite','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionPlus','province','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionPlus','province','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','property','juan@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','pbx','grafana','sip','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','','Select');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesAssistant','clientCredit','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','artificialBoss','saleTracking','alexm@%','0000-00-00 00:00:00','Delete','');
@ -573,8 +553,8 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','saleTracking','ale
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','client','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','client','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','saleVolume','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Proveedores_gestdoc','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','awb_gestdoc','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Proveedores_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','awb_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Cubos','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','routesMonitor','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','Update');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminBoss','sale','alexm@%','0000-00-00 00:00:00','Insert','');
@ -587,8 +567,8 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','saleComponent'
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','marketingBoss','saleGoal','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
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 ('','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','hr','account_detail','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component_type','jenkins@db-proxy1.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 ('','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','');
@ -597,12 +577,11 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','currency','a
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','creditClassification','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','creditInsurance','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','currency','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','dms','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','workerTimeControl','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','defaulter','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','deliveryMethod','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','deliveryMethod','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','dms','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','v_compres','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','deviceProductionUser','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','department','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','deviceProductionConfig','alexm@%','0000-00-00 00:00:00','Select','');
@ -612,7 +591,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionBoss','absenceType'
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','deviceProductionConfig','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','deviceProductionUser','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','disabilityGrade','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','dms','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','duaInvoiceIn','alexm@%','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','dmsType','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','duaEntry','alexm@%','0000-00-00 00:00:00','Insert,Delete','');
@ -662,7 +640,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','artificialBoss','entryObserva
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','dock','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','expeditionTruck','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','expeditionPallet','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','expense','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','expense','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','expeditionScan','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerBoss','entryObservation','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ppeGroup','alexm@%','0000-00-00 00:00:00','Select','');
@ -677,7 +655,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','postCode','alexm@%','000
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','pgcMaster','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','itemBarcode','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','host','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Facturas','guillermo@10.5.1.4','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ticket','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceIn','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','invoiceIn','alexm@%','0000-00-00 00:00:00','Select','');
@ -692,7 +669,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesPerson','invoiceCorrecti
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','invoiceIn','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceInDueDay','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','invoiceInDueDay','alexm@%','0000-00-00 00:00:00','Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','invoiceInIntrastat__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','invoiceInIntrastat__','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','invoiceInTax','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceInSage','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','invoiceInTax','alexm@%','0000-00-00 00:00:00','Select','');
@ -733,8 +710,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','itemShelving','ale
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerBoss','itemShelvingLog','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ticketWeekly','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerAssist','itemShelvingLog','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','airport','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','XDiario','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','airport','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','itemShelvingSale','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','Tickets','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','claimEnd','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
@ -790,7 +766,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesAssistant','invoiceOut',
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','dua','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','duaEntry','alexm@%','0000-00-00 00:00:00','Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','expeditionTruck','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','moving','alexm@%','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','moving','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','machineDetail','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','machineDms','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','vehicle','alexm@%','0000-00-00 00:00:00','Select','');
@ -806,7 +782,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','bufferType','a
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','bufferState','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','vehicle','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','buffer','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','bufferGroup','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','bufferGroup','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','lastRFID','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','person__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','config','alexm@%','0000-00-00 00:00:00','Select','');
@ -831,7 +807,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 ('','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 ('','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 ('','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','');
@ -845,7 +820,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','recovery','al
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','employee','photocell','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','grafana','supplyResponse','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','cache','customer','last_buy','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','financial','Greuges_type','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesAssistant','client','carlosap@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','invoiceInTax','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesAssistant','workerTeam','juan@10.5.1.2','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','postgresql','hr','profile_type','alexm@%','0000-00-00 00:00:00','Select','');
@ -877,12 +852,11 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','bi','salesPerson','tarifa_componen
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','employee','expeditionLog','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','salesPerson','clientNewBorn','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','saleItemShelving__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','XDiario','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesBoss','workerTeam','juan@10.5.1.2','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','employee','expedition','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemShelvingStock','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','saleParking__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','property','juan@10.5.1.1','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','property','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','employee','config','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','vehicleEvent','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','vehicle','alexm@%','0000-00-00 00:00:00','Insert,Update','');
@ -924,7 +898,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','taxCode','alexm@%','
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','grafana','salesPersonEvolution','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','postgresql','hr','calendar_employee','juan@10.5.1.2','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','ticket','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticket','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticket','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','Update');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticketCollection','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminBoss','ticketDms','alexm@%','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ticketDocumentation','alexm@%','0000-00-00 00:00:00','Select,Insert','');
@ -969,7 +943,7 @@ 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 ('','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 ('','vn2008','buyerBoss','tarifas','alexm@%','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','bankPolicy','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
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','till','juan@%','0000-00-00 00:00:00','Select','');
@ -1020,7 +994,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerRelatives','guille
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','ticketPackagingStartingStock','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','supplierPackaging','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerDocument','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','gestdoc','alexm@%','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceCorrection','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ink','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','zone','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','XDiario','alexm@%','0000-00-00 00:00:00','Select','');
@ -1035,7 +1009,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','zonePromo__','alex
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','accountingConfig','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','accountingType','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','agencyMode','alexm@%','0000-00-00 00:00:00','Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','XDiario','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','cache','employee','visible','juan@10.5.1.2','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerAssist','productionConfig','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','cache','employee','available','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
@ -1188,8 +1161,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','packager','glsExpedition','ju
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','clientType','juan@10.5.1.2','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','expeditionMistake','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','deviceProductionLog','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesAssistant','workerTeam','juan@10.5.1.2','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesBoss','workerTeam','juan@10.5.1.2','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','integra2Province','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','vehicleState','juan@10.5.1.1','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','machineDetail','juan@10.5.1.1','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','machineDms','juan@10.5.1.1','0000-00-00 00:00:00','Select','');
@ -1210,7 +1182,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','packager','chronopostExpediti
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','sectorCollection','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','packager','sendingService','jenkins@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','adminOfficer','tickets_gestdoc','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBos','moving','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','flight','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','routeAction','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','bankErrorCode','jgallego@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','farming','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
@ -1265,13 +1237,13 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','url','juan@db-
INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','userConfigView','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','claimRedelivery','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','clientRisk','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerBoss','itemType','carlosap@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','supplierDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','buyer','sale','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','chain','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','routesMonitor','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','warehouse_pickup','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','warehouse_pickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','cl_main','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','Vehiculos','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','company','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','routeAction','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','ticket_observation','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','Tickets_turno','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
@ -1340,6 +1312,56 @@ 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 ('','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','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','buyer','entryOrder','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,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','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','supplierDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','supplierDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','remittance','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','vehicleConsumption','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','vehicleConsumption','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','accountReconciliation','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','accountDetail','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','accountDetail','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','accountDetailType','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','airline','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','airline','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','airport','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','deliveryNote','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','deliveryNoteDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','deliveryNoteState','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','awbComponent','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','awbComponent','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','awbComponent','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','awbComponentTemplate','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','awbComponentType','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','awbComponentType','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','awbDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','awbDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','awbDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','awbDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','awbInvoiceIn','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','awbInvoiceIn','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','awbRole','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','awbUnit','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financialBoss','balanceNestTree','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','buyer','ektK1','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','administrative','ektK1','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','buyer','ektK2','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','administrative','ektK2','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','buyer','ektK3','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','administrative','ektK3','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','buyer','ektK4','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','administrative','ektK4','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','dmsStorageBox','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','company','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','warehousePickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','warehousePickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','warehousePickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','warehousePickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
@ -1539,6 +1561,40 @@ INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','size','0000-0
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','originFk','0000-00-00 00:00:00','Select,Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','longName','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','name','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','id','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','warehouseFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','shipped','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','nickname','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','refFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','addressFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','workerFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','observations','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','isSigned','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','isLabeled','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','isPrinted','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','packages','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','location','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','hour','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','created','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','isBlocked','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','solution','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','routeFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','priority','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','hasPriority','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','companyFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','agencyModeFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','landed','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','isBoxed','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','isDeleted','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','zoneFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','zonePrice','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','zoneBonus','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','totalWithVat','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','totalWithoutVat','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','weight','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','clonedFrom','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','cmrFk','0000-00-00 00:00:00','Update');
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','editorFk','0000-00-00 00:00:00','Update');
/*!40000 ALTER TABLE `columns_priv` ENABLE KEYS */;
/*!40000 ALTER TABLE `procs_priv` DISABLE KEYS */;
@ -1615,26 +1671,14 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','entry_fixMisfit','P
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','employee','buy_tarifas_entry','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_CURDATE','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','financial','calculoremesas','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','hr','cc_to_iban','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','financial','cc_to_iban','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','marketingBoss','clientTaxArea','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','clientTaxArea','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','client_checkBalance','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','addressTaxArea','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesPerson','client_getSalesPersonByTicket','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','handmadeBoss','confection_control_source','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','buyer','travelDetail','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','claimManager','traslado','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','buyer','traslado','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','administrative','supplierStatement','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','buyer','supplierStatement','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','hrBoss','supplierStatement','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','hrBoss','red','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','salesPerson','red','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','administrative','intrastat_neto','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','productionAssi','confection_control_source','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','artificialBoss','confection_control_source','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','logistic','nz','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','deliveryAssistant','preordenarruta','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','financial','pay','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','bi','salesAssistant','defaultersFromDate','PROCEDURE','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
@ -1659,10 +1703,10 @@ 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_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 ('','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 ('','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 ('','vn','officeBoss','fustcontrol','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','claimManager','dayend','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','employee','log_add','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','srt','employee','moving_between','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
@ -1712,7 +1756,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','cache','employee','available_refres
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','logistic','ticket_clone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','coolerBoss','ticket_clone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','itemproposal','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','itemproposal_add','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','timebusiness_calculatebyuser','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','itemsale_byweek','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','itemsale_byweek','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
@ -1812,13 +1855,11 @@ 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','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','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','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 ('','bi','productionAssi','rutasanalyze','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','productionPlus','workerCreateExternal','PROCEDURE','juan@10.5.1.2','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','adminBoss','XDiario_Quadrator','PROCEDURE','juan@10.5.1.2','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_NOW','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_UNIX_TIMESTAMP','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_UTC_DATE','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
@ -1940,7 +1981,22 @@ 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','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','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');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','hr','accountNumberToIban','FUNCTION','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','util','financial','accountNumberToIban','FUNCTION','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','supplier_statement','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','supplier_statement','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hrBoss','supplier_statement','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','adminBoss','XDiario_check','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','travel_getDetailFromContinent','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','entry_getTransfer','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','entry_getTransfer','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','intrastat_estimateNet','FUNCTION','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
/*!40000 ALTER TABLE `procs_priv` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@ -1954,52 +2010,53 @@ USE `mysql`;
/*!40000 ALTER TABLE `global_priv` DISABLE KEYS */;
INSERT IGNORE INTO `global_priv` VALUES ('','account','{\"access\": 0, \"is_role\": true,\"version_id\":100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','adminBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','adminOfficer','{\"access\": 0, \"version_id\": 100707, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','administrative','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','adminBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','adminOfficer','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','administrative','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
INSERT IGNORE INTO `global_priv` VALUES ('','agency','{\"access\": 0, \"max_questions\": 40000, \"max_updates\": 1000, \"max_connections\": 20000, \"max_user_connections\": 50, \"max_statement_time\": 0.000000, \"is_role\": true,\"version_id\":100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','android','{\"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 ('','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 ('','claimManager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','buyerAssistant','{\"access\":0,\"version_id\":101106,\"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\":101106,\"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 ('','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 ('','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 ('','deliveryBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','deliveryAssistant','{\"access\":0,\"version_id\":101106,\"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 ('','developerBoss','{\"access\":33554432,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','developerBoss','{\"access\":33554432,\"version_id\":101106,\"is_role\":true}');
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 ('','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 ('','financialBoss','{\"access\": 0, \"version_id\": 100707, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','grafana','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','financial','{\"access\": 0, \"version_id\": 101106, \"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\":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 ('','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 ('','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 ('','hrBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','hr','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
INSERT IGNORE INTO `global_priv` VALUES ('','hrBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','invoicing','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
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 ('','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 ('','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 ('','maintenance','{\"access\":0,\"version_id\":101106,\"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 ('','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 ('','marketingBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','officeBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','officeBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','packager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','palletizer','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','palletizer','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','palletizerBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','preservedBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','production','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
@ -2007,9 +2064,9 @@ INSERT IGNORE INTO `global_priv` VALUES ('','productionAssi','{\"access\": 0, \
INSERT IGNORE INTO `global_priv` VALUES ('','productionBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','productionPlus','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','root','{\"access\": 549755781119, \"version_id\": 100705, \"is_role\": true}');
INSERT IGNORE INTO `global_priv` VALUES ('','salesAssistant','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','salesBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','salesPerson','{\"access\": 0, \"is_role\": true,\"version_id\":100707}');
INSERT IGNORE INTO `global_priv` VALUES ('','salesAssistant','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','salesBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','salesPerson','{\"access\": 0, \"is_role\": true,\"version_id\":101106}');
INSERT IGNORE INTO `global_priv` VALUES ('','salesTeamBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','salix','{\"access\":33555456,\"version_id\":100707,\"is_role\":true}');
INSERT IGNORE INTO `global_priv` VALUES ('','sysadmin','{\"access\": 201326592, \"is_role\": true, \"version_id\": 100707}');

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -66,9 +66,6 @@ UPDATE vn.supplier
SET isTrucker = 1
WHERE id = 2;
INSERT INTO vn.cmr (id, truckPlate, observations, senderInstruccions, paymentInstruccions, specialAgreements, created, companyFk, addressToFk, addressFromFk, supplierFk, packagesList, merchandiseDetail, state, landed, ead)
VALUES (2, NULL, NULL, NULL, 'Carriage paid', NULL, '2022-06-27 13:31:11.000', 442, 3, 2, 2, NULL, NULL, NULL, NULL, NULL);
-- XXX: tpv
UPDATE `vn`.`claimRatio` SET `claimAmount` = '10' WHERE (`clientFk` = '1101');
@ -140,9 +137,6 @@ INSERT INTO vn.ticket (clientFk, warehouseFk, shipped, nickname, refFk, addressF
INSERT INTO vn.sale (itemFk, ticketFk, concept, quantity, originalQuantity, price, discount, priceFixed, reserved, isPicked, isPriceFixed, created, isAdded)
VALUES (1, 24, 'Ranged weapon longbow 2m', 1.00, NULL, 8.07, 0, 0.00, 0, 0, 0, '2022-07-06 00:00:00', 0);
*/
INSERT INTO vn2008.zones (zone_id,name,printingOrder)
VALUES (1,'zone Test',1);
-- XXX: lab
INSERT INTO `vn`.`businessReasonEnd` (`id`, `reason`)

View File

@ -352,12 +352,12 @@ INSERT INTO `vn`.`postCode`(`code`, `townFk`, `geoFk`)
('46600', 4, 7),
('EC170150', 5, 8);
INSERT INTO `vn`.`clientType`(`id`, `code`, `type`)
INSERT INTO `vn`.`clientType`(`code`, `type`)
VALUES
(1, 'normal', 'Normal'),
(2, 'internalUse', 'Autoconsumo'),
(3, 'handMaking', 'Confección'),
(4, 'loses', 'Mermas');
('normal', 'Normal'),
('internalUse', 'Autoconsumo'),
('handMaking', 'Confección'),
('loses', 'Mermas');
INSERT INTO `vn`.`cplusTerIdNif`(`id`, `description`)
VALUES
@ -371,23 +371,23 @@ INSERT INTO `vn`.`contactChannel`(`id`, `name`)
(4, 'GCN Channel'),
(5, 'The Newspaper');
INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`,`clientTypeFk`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`, `businessTypeFk`,`typeFk`)
INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`, `businessTypeFk`,`typeFk`)
VALUES
(1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
(1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
(1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 5, 1, 300, 13, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
(1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist','normal'),
(1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist','normal'),
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','loses'),
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','loses');
(1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
(1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
(1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
(1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 5, 1, 300, 13, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
(1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist','normal'),
(1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist','normal'),
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','loses'),
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','loses');
INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`)
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), UPPER(CONCAT(name, 'Social')), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1
FROM `account`.`role` `r`
WHERE `r`.`hasLogin` = 1;
@ -564,13 +564,13 @@ INSERT INTO `vn`.`supplierActivity`(`code`, `name`)
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`, `healthRegister`)
VALUES
(1, 'PLANTS SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(2, 'FARMER KING', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
(1, 'PLANTS SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'GOTHAM', 1, 46000, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(2, 'FARMER KING', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 46000, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
(69, 'PACKAGING', 'Packaging nick', 4100000069, 1, '94935005K', 0, util.VN_CURDATE(), 1, 'supplier address 5', 'ASGARD', 3, 46600, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(442, 'VERDNATURA LEVANTE SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
(442, 'VERDNATURA LEVANTE SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 46000, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
(567, 'HOLLAND', 'Holland nick', 4000020567, 1, '14364089Z', 0, util.VN_CURDATE(), 1, 'supplier address 6', 'ASGARD', 3, 46600, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
(791, 'BROS SL', 'Bros nick', 5115000791, 1, '37718083S', 0, util.VN_CURDATE(), 1, 'supplier address 7', 'ASGARD', 3, 46600, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
(1381, 'ORNAMENTALES', 'Ornamentales', 7185001381, 1, '07972486L', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
(1381, 'ORNAMENTALES', 'Ornamentales', 7185001381, 1, '07972486L', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 46000, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `provinceFk`, `postalCode`, `city`, `phone`, `mobile`)
VALUES
@ -653,6 +653,7 @@ INSERT INTO `vn`.`expense`(`id`, `name`, `isWithheld`)
(7001000000, 'Mercaderia', 0),
(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`)
VALUES
@ -725,40 +726,40 @@ INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agen
(6, NULL, 57, util.VN_CURDATE(), 5, 7, 'sixth route', 1.7, 60, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 3),
(7, NULL, 57, util.VN_CURDATE(), 6, 8, 'seventh route', 0, 70, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 5);
INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`)
INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`, `cmrFk`)
VALUES
(1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1),
(2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 1, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2),
(3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL),
(4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL),
(5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL),
(6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL),
(7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL),
(15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL),
(18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL),
(19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL),
(20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL),
(21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL),
(22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL),
(23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL),
(24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL),
(25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL),
(32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL);
(1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1),
(2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 1, NULL, 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2),
(3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 3),
(4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, NULL),
(5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, NULL),
(6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, NULL),
(7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL, NULL),
(15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL),
(18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL, NULL),
(19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL, NULL),
(20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
(21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
(22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL, NULL),
(23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL),
(24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL, NULL),
(25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
(32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL);
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
VALUES
@ -1238,6 +1239,7 @@ INSERT INTO `vn`.`train`(`id`, `name`)
INSERT INTO `vn`.`operator` (`workerFk`, `numberOfWagons`, `trainFk`, `itemPackingTypeFk`, `warehouseFk`, `sectorFk`, `labelerFk`)
VALUES
('1106', '1', '1', 'H', '1', '1', '1'),
('9', '2', '1', 'H', '1', '1', '1'),
('1107', '1', '1', 'V', '1', '1', '1');
INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`)
@ -1818,19 +1820,16 @@ INSERT INTO `vn`.`clientSample`(`id`, `clientFk`, `typeFk`, `created`, `workerFk
INSERT INTO `vn`.`claimState`(`id`, `code`, `description`, `roleFk`, `priority`, `hasToNotify`)
VALUES
( 1, 'pending', 'Pendiente', 1, 1, 0),
( 2, 'managed', 'Gestionado', 72, 5, 0),
( 3, 'resolved', 'Resuelto', 72, 7, 0),
( 4, 'canceled', 'Anulado', 72, 6, 1),
( 5, 'incomplete', 'Incompleta', 1, 3, 1),
( 6, 'mana', 'Mana', 72, 4, 0),
( 7, 'lack', 'Faltas', 72, 2, 0);
( 5, 'incomplete', 'Incompleta', 1, 3, 1);
INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created`, `packages`, `rma`, `ticketFk`)
INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created`, `packages`, `ticketFk`)
VALUES
(1, util.VN_CURDATE(), 1, 1101, 18, 3, 0, util.VN_CURDATE(), 0, '02676A049183', 11),
(2, util.VN_CURDATE(), 2, 1101, 18, 3, 0, util.VN_CURDATE(), 1, NULL, 16),
(3, util.VN_CURDATE(), 3, 1101, 18, 1, 1, util.VN_CURDATE(), 5, NULL, 7),
(4, util.VN_CURDATE(), 3, 1104, 18, 5, 0, util.VN_CURDATE(), 10, NULL, 8);
(1, util.VN_CURDATE(), 1, 1101, 18, 3, 0, util.VN_CURDATE(), 0, 11),
(2, util.VN_CURDATE(), 4, 1101, 18, 3, 0, util.VN_CURDATE(), 1, 16),
(3, util.VN_CURDATE(), 3, 1101, 18, 1, 1, util.VN_CURDATE(), 5, 7),
(4, util.VN_CURDATE(), 3, 1104, 18, 5, 0, util.VN_CURDATE(), 10, 8);
INSERT INTO `vn`.`claimObservation` (`claimFk`, `workerFk`, `text`, `created`)
VALUES
@ -1879,14 +1878,6 @@ INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRa
(1103, 2000, 0.00, 0.00, 0.02, 1.00),
(1104, 2500, 150.00, 0.02, 0.10, 1.00);
INSERT INTO vn.claimRma (`id`, `code`, `created`, `workerFk`)
VALUES
(1, '02676A049183', DEFAULT, 1106),
(2, '02676A049183', DEFAULT, 1106),
(3, '02676A049183', DEFAULT, 1107),
(4, '02676A049183', DEFAULT, 1107),
(5, '01837B023653', DEFAULT, 1106);
INSERT INTO `vn`.`claimLog` (`originFk`, userFk, `action`, changedModel, oldInstance, newInstance, changedModelId, `description`)
VALUES
(1, 18, 'update', 'Claim', '{"hasToPickUp":false}', '{"hasToPickUp":true}', 1, NULL),
@ -2405,10 +2396,11 @@ INSERT INTO `vn`.`dmsType`(`id`, `name`, `readRoleFk`, `writeRoleFk`, `code`)
(14, 'Ticket', 1, 1, 'ticket'),
(15, 'Presupuestos', NULL, NULL, 'budgets'),
(16, 'Logistica', NULL, NULL, 'logistics'),
(17, 'cmr', NULL, NULL, 'cmr'),
(17, 'cmr', 1, 1, 'cmr'),
(18, 'dua', NULL, NULL, 'dua'),
(19, 'inmovilizado', NULL, NULL, 'fixedAssets'),
(20, 'Reclamación', 1, 1, 'claim');
(20, 'Reclamación', 1, 1, 'claim'),
(21, 'Entrada', 1, 1, 'entry');
INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`)
VALUES
@ -2419,7 +2411,8 @@ INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `wa
(5, 5, '5.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'travel: 1', 'dmsForThermograph', util.VN_CURDATE()),
(6, 5, '6.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'NotExists', 'DoesNotExists', util.VN_CURDATE()),
(7, 20, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
(8, 20, '8.mp4', 'video/mp4', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE());
(8, 20, '8.mp4', 'video/mp4', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
(9, 21, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'ENTRADA ID 1', util.VN_CURDATE());
INSERT INTO `vn`.`claimDms`(`claimFk`, `dmsFk`)
VALUES
@ -2734,10 +2727,10 @@ INSERT INTO `vn`.`chat` (`senderFk`, `recipient`, `dated`, `checkUserStatus`, `m
(1101, '@PetterParker', util.VN_CURDATE(), 0, 'Second test message', 0, 'pending');
INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `isVersionCritical`)
INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `isVersionCritical`,`versionBeta`)
VALUES
('delivery', '9.2', 0),
('warehouse', '8.1', 0);
('delivery', '9.2', 0,'9.7'),
('warehouse', '8.1', 0,'8.3');
INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`)
VALUES
@ -3062,3 +3055,681 @@ INSERT INTO `vn`.`clientSms` (`id`, `clientFk`, `smsFk`, `ticketFk`)
(4, 1103, 4, 32),
(13, 1101, 1, NULL),
(14, 1101, 4, 27);
INSERT INTO `vn`.`entryDms`(`entryFk`, `dmsFk`, `editorFk`)
VALUES
(1, 9, 9);
INSERT INTO `vn`.`cmr` (id,truckPlate,observations,senderInstruccions,paymentInstruccions,specialAgreements,companyFk,addressToFk,addressFromFk,supplierFk,packagesList,merchandiseDetail,state)
VALUES (1,'123456A','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',442,1,2,1,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
(2,'123456N','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',69,3,4,2,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
(3,'123456B','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',567,5,6,69,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet');
UPDATE vn.department
SET workerFk = null;
-- NEW WAREHOUSE
INSERT INTO vn.packaging
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0);
INSERT IGNORE INTO vn.intrastat
SET id = 44219999,
description = 'Manufacturas de madera',
taxClassFk = 1,
taxCodeFk = 1;
INSERT IGNORE INTO vn.warehouse
SET id = 999,
name = 'TestingWarehouse',
hasAvailable = TRUE,
isForTicket = TRUE,
isInventory = TRUE,
hasUbications = TRUE,
hasProduction = TRUE;
INSERT IGNORE INTO vn.sector
SET id = 9991,
description = 'NormalSector',
warehouseFk = 999,
code = 'NS',
isPackagingArea = FALSE,
sonFk = NULL,
isMain = TRUE,
itemPackingTypeFk = NULL;
INSERT IGNORE INTO vn.sector
SET id = 9992,
description = 'PreviousSector',
warehouseFk = 999,
code = 'PS',
isPackagingArea = FALSE,
sonFk = NULL,
isMain = TRUE,
itemPackingTypeFk = NULL;
INSERT IGNORE INTO vn.sector
SET id = 9993,
description = 'MezaninneSector',
warehouseFk = 999,
code = 'MS',
isPackagingArea = FALSE,
sonFk = 9991,
isMain = TRUE,
itemPackingTypeFk = NULL;
INSERT INTO vn.parking (id,sectorFk, code, pickingOrder)
VALUES (4,9991, 'A-01-1', 1),
(5,9991, 'A-02-2', 2),
(6,9991, 'A-03-3', 3),
(7,9991, 'A-04-4', 4),
(8,9991, 'A-05-5', 5),
(9,9992, 'P-01-1', 6),
(10,9992, 'P-02-2', 7),
(11,9992, 'P-03-3', 8),
(12,9993, 'M-01-1', 9),
(13,9993, 'M-02-2', 10),
(14,9993, 'M-03-3', 11);
INSERT INTO vn.shelving (code, parkingFk, priority)
VALUES ('NAA', 4, 1),
('NBB', 5, 1),
('NCC', 6, 1),
('NDD', 7, 1),
('NEE', 8, 1),
('PAA', 9, 1),
('PBB', 10, 1),
('PCC', 11, 1),
('MAA', 12, 1),
('MBB', 13, 1),
('MCC', 14, 1);
INSERT IGNORE INTO vn.itemType
SET id = 999,
code = 'WOO',
name = 'Wood Objects',
categoryFk = 3,
workerFk = 103,
isInventory = TRUE,
life = 10,
density = 250,
itemPackingTypeFk = NULL,
temperatureFk = 'warm';
INSERT IGNORE INTO vn.travel
SET id = 99,
shipped = CURDATE(),
landed = CURDATE(),
warehouseInFk = 999,
warehouseOutFk = 1,
isReceived = TRUE;
INSERT INTO vn.entry
SET id = 999,
supplierFk = 791,
isConfirmed = TRUE,
dated = CURDATE(),
travelFk = 99,
companyFk = 442;
INSERT INTO vn.ticket
SET id = 999999,
clientFk = 2,
warehouseFk = 999,
shipped = CURDATE(),
nickname = 'Cliente',
addressFk = 1,
companyFk = 442,
agencyModeFk = 10,
landed = CURDATE();
INSERT INTO vn.collection
SET id = 10101010,
workerFk = 9;
INSERT IGNORE INTO vn.ticketCollection
SET id = 10101010,
ticketFk = 999999,
collectionFk = 10101010;
INSERT INTO vn.item
SET id = 999991,
name = 'Palito para pinchos',
`size` = 25,
stems = NULL,
category = 'EXT',
typeFk = 999,
longName = 'Palito para pinchos',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 6,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 9999991,
entryFk = 999,
itemFk = 999991,
quantity = 8,
buyingValue = 0.61,
stickers = 1,
packing = 20,
`grouping` = 1,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 50;
INSERT INTO vn.sale
SET id = 99991,
itemFk = 999991,
ticketFk = 999999,
concept = 'Palito para pinchos',
quantity = 3,
price = 1,
discount = 0;
INSERT INTO vn.item
SET id = 999992,
name = 'Madera verde',
`size` = 10,
stems = NULL,
category = 'EXT',
typeFk = 999,
longName = 'Madera verde',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 50,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 9999992,
entryFk = 999,
itemFk = 999992,
quantity = 40,
buyingValue = 0.62,
stickers = 1,
packing = 40,
`grouping` = 5,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 25;
INSERT INTO vn.sale
SET id = 99992,
itemFk = 999992,
ticketFk = 999999,
concept = 'Madera Verde',
quantity = 10,
price = 1,
discount = 0;
INSERT INTO vn.item
SET id = 999993,
name = 'Madera Roja/Morada',
`size` = 12,
stems = 2,
category = 'EXT',
typeFk = 999,
longName = 'Madera Roja/Morada',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 35,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 9999993,
entryFk = 999,
itemFk = 999993,
quantity = 20,
buyingValue = 0.63,
stickers = 2,
packing = 10,
`grouping` = 5,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 25;
INSERT INTO vn.itemShelving
SET id = 9931,
itemFk = 999993,
shelvingFk = 'NCC',
visible = 10,
`grouping` = 5,
packing = 10;
INSERT INTO vn.sale
SET id = 99993,
itemFk = 999993,
ticketFk = 999999,
concept = 'Madera Roja/Morada',
quantity = 15,
price = 1,
discount = 0;
INSERT INTO vn.item
SET id = 999994,
name = 'Madera Naranja',
`size` = 18,
stems = 1,
category = 'EXT',
typeFk = 999,
longName = 'Madera Naranja',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 160,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 9999994,
entryFk = 999,
itemFk = 999994,
quantity = 20,
buyingValue = 0.64,
stickers = 1,
packing = 20,
`grouping` = 4,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 25;
INSERT INTO vn.sale
SET id = 99994,
itemFk = 999994,
ticketFk = 999999,
concept = 'Madera Naranja',
quantity = 4,
price = 1,
discount = 0;
INSERT INTO vn.item
SET id = 999995,
name = 'Madera Amarilla',
`size` = 11,
stems = 5,
category = 'EXT',
typeFk = 999,
longName = 'Madera Amarilla',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 78,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 9999995,
entryFk = 999,
itemFk = 999995,
quantity = 4,
buyingValue = 0.65,
stickers = 1,
packing = 20,
`grouping` = 1,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 35;
INSERT INTO vn.sale
SET id = 99995,
itemFk = 999995,
ticketFk = 999999,
concept = 'Madera Amarilla',
quantity = 5,
price = 1,
discount = 0;
-- Palito naranja
INSERT INTO vn.item
SET id = 999998,
name = 'Palito naranja',
`size` = 11,
stems = 1,
category = 'EXT',
typeFk = 999,
longName = 'Palito naranja',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 78,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 9999998,
entryFk = 999,
itemFk = 999998,
quantity = 80,
buyingValue = 0.65,
stickers = 1,
packing = 200,
`grouping` = 30,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 35;
INSERT INTO vn.sale
SET id = 99998,
itemFk = 999998,
ticketFk = 999999,
concept = 'Palito naranja',
quantity = 60,
price = 1,
discount = 0;
-- Palito amarillo
INSERT INTO vn.item
SET id = 999999,
name = 'Palito amarillo',
`size` = 11,
stems = 1,
category = 'EXT',
typeFk = 999,
longName = 'Palito amarillo',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 78,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 9999999,
entryFk = 999,
itemFk = 999999,
quantity = 70,
buyingValue = 0.65,
stickers = 1,
packing = 500,
`grouping` = 10,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 35;
INSERT INTO vn.sale
SET id = 99999,
itemFk = 999999,
ticketFk = 999999,
concept = 'Palito amarillo',
quantity = 50,
price = 1,
discount = 0;
-- Palito azul
INSERT INTO vn.item
SET id = 1000000,
name = 'Palito azul',
`size` = 10,
stems = 1,
category = 'EXT',
typeFk = 999,
longName = 'Palito azul',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 78,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 10000000,
entryFk = 999,
itemFk = 1000000,
quantity = 75,
buyingValue = 0.65,
stickers = 2,
packing = 300,
`grouping` = 50,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 35;
INSERT INTO vn.sale
SET id = 100000,
itemFk = 1000000,
ticketFk = 999999,
concept = 'Palito azul',
quantity = 50,
price = 1,
discount = 0;
-- Palito rojo
INSERT INTO vn.item
SET id = 1000001,
name = 'Palito rojo',
`size` = 10,
stems = NULL,
category = 'EXT',
typeFk = 999,
longName = 'Palito rojo',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 78,
intrastatFk = 44219999;
INSERT INTO vn.buy
SET id = 10000001,
entryFk = 999,
itemFk = 1000001,
quantity = 12,
buyingValue = 0.65,
stickers = 2,
packing = 50,
`grouping` = 5,
groupingMode = 1,
packageFk = 94,
price1 = 1,
price2 = 1,
price3 = 1,
minPrice = 1,
weight = 35;
INSERT INTO vn.sale
SET id = 100001,
itemFk = 1000001,
ticketFk = 999999,
concept = 'Palito rojo',
quantity = 10,
price = 1,
discount = 0;
-- Previa
INSERT IGNORE INTO vn.item
SET id = 999996,
name = 'Bolas de madera',
`size` = 2,
stems = 4,
category = 'EXT',
typeFk = 999,
longName = 'Bolas de madera',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 20,
intrastatFk = 44219999;
INSERT vn.buy
SET id = 9999996,
entryFk = 999,
itemFk = 999996,
quantity = 5,
buyingValue = 3,
stickers = 1,
packing = 5,
`grouping` = 2,
groupingMode = 1,
packageFk = 94,
price1 = 7,
price2 = 7,
price3 = 7,
minPrice = 7,
weight = 80;
INSERT vn.sale
SET id = 99996,
itemFk = 999996,
ticketFk = 999999,
concept = 'Bolas de madera',
quantity = 4,
price = 7,
discount = 0,
isPicked = TRUE;
INSERT IGNORE INTO vn.item
SET id = 999997,
name = 'Palitos de polo MIX',
`size` = 14,
stems = NULL,
category = 'EXT',
typeFk = 999,
longName = 'Palitos de polo MIX',
itemPackingTypeFk = NULL,
originFk = 1,
weightByPiece = 20,
intrastatFk = 44219999;
INSERT vn.buy
SET id = 9999997,
entryFk = 999,
itemFk = 999997,
quantity = 100,
buyingValue = 3.2,
stickers = 1,
packing = 100,
`grouping` = 5,
groupingMode = 1,
packageFk = 94,
price1 = 7,
price2 = 7,
price3 = 7,
minPrice = 7,
weight = 80;
INSERT vn.sale
SET id = 99997,
itemFk = 999997,
ticketFk = 999999,
concept = 'Palitos de polo MIX',
quantity = 5,
price = 7,
discount = 0;
USE vn;
DELETE ish.* FROM vn.itemShelving ish
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
JOIN vn.parking p ON p.id = sh.parkingFk
JOIN vn.sector s ON s.id = p.sectorFk
JOIN vn.warehouse w ON w.id = s.warehouseFk
WHERE w.name = 'TestingWarehouse';
INSERT INTO vn.itemShelving
(itemFk, shelvingFk, visible, created, `grouping`, packing, packagingFk, userFk, isChecked)
VALUES
(999991, 'NAA', 8, '2023-09-20', 1, 20, NULL, 103, NULL),
(999998, 'NAA', 80, '2023-09-20', 10, 30, NULL, 103, NULL),
(1000001, 'NAA', 6, '2023-09-20', 3, 50, NULL, 103, NULL),
(1000000, 'NBB', 50, '2023-09-18', 25, 500, NULL, 103, NULL),
(999993, 'NBB', 25, '2023-09-18', NULL, 10, NULL, 103, NULL),
(999999, 'NBB', 30, '2023-09-18', 10, 500, NULL, 103, NULL),
(999993, 'NCC', 25, '2023-09-20', 5, 10, NULL, 103, NULL),
(999997, 'NCC', 10, '2023-09-20', NULL, 100, NULL, 103, NULL),
(999999, 'NCC', 40, '2023-09-20', 10, 500, NULL, 103, NULL),
(999995, 'NDD', 10, '2023-09-19', NULL, 20, NULL, 103, NULL),
(999994, 'NDD', 48, '2023-09-19', 4, 20, NULL, 103, NULL),
(1000001, 'NEE', 6, '2023-09-21', 3, 50, NULL, 103, NULL),
(999992, 'NEE', 50, '2023-09-21', NULL, 1, NULL, 103, NULL),
(1000000, 'NEE', 25, '2023-09-21', 25, 500, NULL, 103, NULL),
(999996, 'PAA', 5, '2023-09-27', 1, 5, NULL, 103, NULL),
(999997, 'PCC', 10, '2023-09-27', 5, 100, NULL, 103, NULL);
-- Previous for Bolas de madera
INSERT IGNORE INTO vn.sectorCollection
SET id = 99,
userFk = 1,
sectorFk = 9992;
INSERT IGNORE INTO vn.saleGroup
SET id = 4,
userFk = 1,
parkingFk = 9,
sectorFk = 9992;
INSERT IGNORE INTO vn.sectorCollectionSaleGroup
SET id = 9999,
sectorCollectionFk = 99,
saleGroupFk = 999;
INSERT vn.saleGroupDetail
SET id = 99991,
saleFk = 99996,
saleGroupFk = 999;
INSERT INTO vn.saleTracking
SET id = 7,
saleFk = 99996,
isChecked = TRUE,
workerFk = 103,
stateFk = 28;
INSERT IGNORE INTO vn.itemShelvingSale
SET id = 991,
itemShelvingFk = 9962,
saleFk = 99996,
quantity = 5,
userFk = 1;
UPDATE vn.ticket
SET zoneFk=1
WHERE id=999999;
UPDATE vn.collection
SET workerFk=9
WHERE id=10101010;
UPDATE vn.sale
SET isPicked =FALSE;
INSERT INTO vn.machineWorkerConfig(maxHours)
VALUES(12);
INSERT INTO vn.workerAppTester(workerFk) VALUES(66);
INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`)
VALUES
('RE-003', 'IRON', 'JPH-24', 60, 23, 'ELECTRIC TOW', 'Drag cars', 2020, 103, 442);
INSERT INTO vn.machineWorker(workerFk,machineFk,inTimed) VALUES (104,1,'2001-01-01 10:00:00.00.000');
UPDATE vn.buy SET itemOriginalFk = 1 WHERE id = 1;
UPDATE vn.saleTracking SET stateFk = 26 WHERE id = 5;
INSERT INTO vn.report (name) VALUES ('LabelCollection');
INSERT INTO vn.parkingLog(originFk, userFk, `action`, creationDate, description, changedModel,oldInstance, newInstance, changedModelId, changedModelValue)
VALUES(1, 18, 'update', util.VN_CURDATE(), NULL, 'SaleGroup', '{"parkingFk":null}', '{"parkingFk":1}', 1, NULL);

View File

@ -1,16 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `bi`.`nz`(vData DOUBLE)
RETURNS double
DETERMINISTIC
BEGIN
/**
* Devuelve 0, si el parámetro es NULL:
*/
DECLARE vResult DOUBLE;
SET vResult = IFNULL(vData,0);
RETURN vResult;
END$$
DELIMITER ;

View File

@ -42,9 +42,9 @@ BEGIN
CREATE TEMPORARY TABLE maxInvoice
(PRIMARY KEY (Id_Cliente))
ENGINE = MEMORY
SELECT DISTINCT Id_Cliente, max(Fecha) as maxFecha
FROM vn2008.Facturas
GROUP BY Id_Cliente
SELECT DISTINCT clientFk Id_Cliente, max(issued) as maxFecha
FROM vn.invoiceOut
GROUP BY clientFk
HAVING maxFecha < timestampadd(month,-2,datFEC);
WHILE datFEC < util.VN_CURDATE() DO
@ -53,10 +53,10 @@ BEGIN
SELECT Id_Cliente, datFEC as Fecha, Greuge, Ventas, 0
FROM (
SELECT Id_Cliente, sum(Importe) as Greuge
FROM vn2008.Greuges
where Fecha <= datFEC
group by Id_Cliente
SELECT clientFk Id_Cliente, sum(amount) as Greuge
FROM vn.greuge
where shipped <= datFEC
group by clientFk
) sub
RIGHT JOIN

View File

@ -1,5 +1,5 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`analisis_ventas_update`()
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`analisis_ventas_update`()
BEGIN
DECLARE vLastMonth DATE;
@ -49,5 +49,5 @@ BEGIN
LEFT JOIN vn2008.province p ON p.province_id = cs.province_id
LEFT JOIN vn.warehouse w ON w.id = t.warehouse_id
WHERE bt.fecha >= vLastMonth AND r.mercancia;
END$$
DELIMITER ;
END$$
DELIMITER ;

View File

@ -11,8 +11,8 @@ BEGIN
-- Reclamaciones demasiado sensibles
INSERT INTO vn2008.Greuges(Fecha, Id_Cliente, Comentario,
Importe, Greuges_type_id,Id_Ticket)
INSERT INTO vn.greuge(shipped, clientFk, description,
amount, greugeTypeFk, ticketFk)
SELECT cm.Fecha
, cm.Id_Cliente
, concat('Claim ',cm.id,' : ', m.Concepte)
@ -29,8 +29,8 @@ BEGIN
-- Reclamaciones que pasan a Maná
INSERT INTO vn2008.Greuges(Fecha, Id_Cliente, Comentario,
Importe , Greuges_type_id,Id_Ticket)
INSERT INTO vn.greuge(shipped, clientFk, description,
amount, greugeTypeFk, ticketFk)
SELECT cm.Fecha
, cm.Id_Cliente
, concat('Claim_mana ',cm.id,' : ', m.Concepte)
@ -73,12 +73,12 @@ BEGIN
AND s.alert_level >= 3;
DELETE g.*
FROM vn2008.Greuges g
JOIN tmp.ticket_list t ON g.Id_Ticket = t.Id_Ticket
WHERE Greuges_type_id = 2;
FROM vn.greuge g
JOIN tmp.ticket_list t ON g.ticketFk = t.Id_Ticket
WHERE g.greugeTypeFk = 2;
INSERT INTO vn2008.Greuges (Id_Cliente,Comentario,Importe,Fecha,
Greuges_type_id, Id_Ticket)
INSERT INTO vn.greuge(clientFk, description, amount,shipped,
greugeTypeFk, ticketFk)
SELECT Id_Cliente
,concat('recobro ', m.Id_Ticket), - round(SUM(mc.Valor*Cantidad),2)
AS dif
@ -130,13 +130,13 @@ BEGIN
-- Calculamos el porcentaje del recobro para añadirlo al precio de venta
UPDATE bi.claims_ratio cr
JOIN (
SELECT Id_Cliente, nz(SUM(Importe)) AS Greuge
FROM vn2008.Greuges
WHERE Fecha <= util.VN_CURDATE()
GROUP BY Id_Cliente
SELECT clientFk Id_Cliente, IFNULL(SUM(amount), 0) AS Greuge
FROM vn.greuge
WHERE shipped <= util.VN_CURDATE()
GROUP BY clientFk
) g ON g.Id_Cliente = cr.Id_Cliente
SET recobro = GREATEST(0,round(nz(Greuge) /
(nz(Consumo) * vMonthToRefund / 12 ) ,3));
SET recobro = GREATEST(0,round(IFNULL(Greuge, 0) /
(IFNULL(Consumo, 0) * vMonthToRefund / 12 ) ,3));
-- Protección neonatos
UPDATE bi.claims_ratio cr

View File

@ -14,8 +14,8 @@ BEGIN
WHERE hasChanged AND date = vDate;
DECLARE invoices CURSOR FOR
SELECT Vencimiento, importe FROM vn2008.Facturas f
WHERE f.Fecha >= '2016-01-01' AND f.Id_Cliente = vClient ORDER BY f.Fecha DESC;
SELECT dued Vencimiento, amount importe FROM vn.invoiceOut
WHERE issued >= '2016-01-01' AND clientFk = vClient ORDER BY issued DESC;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;

View File

@ -19,8 +19,8 @@ BEGIN
FROM
vn.ticket t
JOIN vn2008.Clientes cli ON cli.Id_cliente = t.clientFk
LEFT JOIN vn2008.expeditions e ON e.ticket_id = t.id
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.EsBulto
LEFT JOIN vn.expedition e ON e.ticketFk = t.id
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk
JOIN vn.zone z ON t.zoneFk = z.id
WHERE
t.shipped between datSTART AND datEND
@ -64,17 +64,17 @@ BEGIN
CREATE TEMPORARY TABLE tmp.dp_aux
(PRIMARY KEY (ticketFk))
ENGINE = MEMORY
SELECT dp.ticketFk, sum(Importe) Importe
SELECT dp.ticketFk, sum(g.amount) Importe
FROM tmp.dp
JOIN vn2008.Greuges g ON g.Id_Ticket = dp.ticketFk
WHERE Greuges_type_id = 1 -- dif_porte
JOIN vn.greuge g ON g.ticketFk = dp.ticketFk
WHERE g.greugeTypeFk = 1 -- dif_porte
GROUP BY dp.ticketFk;
UPDATE tmp.dp
JOIN tmp.dp_aux USING(ticketFk)
SET greuge = IFNULL(Importe,0);
INSERT INTO vn2008.Greuges (Id_Cliente,Comentario,Importe,Fecha, Greuges_type_id, Id_Ticket)
INSERT INTO vn.greuge (clientFk,description,amount,shipped,greugeTypeFk,ticketFk)
SELECT dp.clientFk
, concat('dif_porte ', dp.ticketFk)
, round(IFNULL(dp.teorico,0) - IFNULL(dp.practico,0) - IFNULL(dp.greuge,0),2) as Importe

View File

@ -1,7 +1,7 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`rutasAnalyze`(
vYear INT,
vMonth INT
vDatedFrom DATE,
vDatedTo DATE
)
BEGIN
/**
@ -9,8 +9,7 @@ BEGIN
* y lo almacena en la tabla bi.rutasBoard
*/
DELETE FROM rutasBoard
WHERE YEAR(Fecha) = vYear
AND MONTH(Fecha) = vMonth;
WHERE Fecha BETWEEN vDatedFrom AND vDatedTo;
-- Rellenamos la tabla con los datos de las rutas VOLUMETRICAS, especialmente con los bultos "virtuales"
INSERT INTO rutasBoard(
@ -27,7 +26,7 @@ BEGIN
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
JOIN vn.saleVolume sv ON sv.ticketFk = t.id
JOIN vn.expeditionBoxVol ebv ON ebv.code = 'transportBox'
WHERE YEAR(r.created) = vYear AND MONTH(r.created) = vMonth
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
AND z.isVolumetric
GROUP BY r.id;
@ -44,8 +43,7 @@ BEGIN
FROM vn.route r
JOIN vn.ticket t ON t.routeFk = r.id
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
WHERE YEAR(r.created) = vYear
AND MONTH(r.created) = vMonth
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
AND NOT z.isVolumetric
GROUP BY r.id
ON DUPLICATE KEY UPDATE Bultos = Bultos + VALUES(Bultos);
@ -56,15 +54,13 @@ BEGIN
SELECT t.routeFk,
SUM(s.quantity * sc.value) totalPractice
FROM vn.route r
JOIN vn.`time` tm ON tm.dated = r.created
JOIN vn.ticket t ON t.routeFk = r.id
JOIN vn.sale s ON s.ticketFk = t.id
JOIN vn.saleComponent sc ON sc.saleFk = s.id
JOIN vn.component c ON c.id = sc.componentFk
JOIN vn.componentType ct ON ct.id = c.typeFk
WHERE ct.code = 'FREIGHT'
AND tm.`year` = vYear
AND tm.`month` = vMonth
AND r.created BETWEEN vDatedFrom AND vDatedTo
GROUP BY r.id
) sub ON sub.routeFk = r.Id_Ruta
SET r.practico = IFNULL(sub.totalPractice / r.Bultos, 0);
@ -76,14 +72,12 @@ BEGIN
SUM(t.zonePrice/ ebv.ratio) / COUNT(*) averageTheoreticalVolume
FROM vn.ticket t
JOIN vn.route r ON r.id = t.routeFk
JOIN vn.`time` tm ON tm.dated = r.created
JOIN vn.expedition e ON e.ticketFk = t.id
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk
JOIN vn.address ad ON ad.id = t.addressFk
JOIN vn.client c ON c.id = ad.clientFk
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
WHERE tm.`year` = vYear
AND tm.`month` = vMonth
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
AND NOT z.isVolumetric
GROUP BY t.routeFk
) sub ON r.Id_Ruta = sub.routeFk
@ -96,12 +90,10 @@ BEGIN
SUM(freight) averageTheoreticalVolume
FROM vn.ticket t
JOIN vn.route r ON r.id = t.routeFk
JOIN vn.`time` tm ON tm.dated = r.created
JOIN vn.saleVolume sf ON sf.ticketFk = t.id
JOIN vn.client c ON c.id = t.clientFk
JOIN vn.`zone` z ON z.id = t.zoneFk
WHERE tm.`year` = vYear
AND tm.`month` = vMonth
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
AND z.isVolumetric
GROUP BY t.routeFk
) sub ON r.Id_Ruta = sub.routeFk
@ -114,11 +106,9 @@ BEGIN
SUM(g.amount) greuge
FROM vn.ticket t
JOIN vn.route r ON r.id = t.routeFk
JOIN vn.`time` tm ON tm.dated = r.created
JOIN vn.greuge g ON g.ticketFk = t.id
JOIN vn.greugeType gt ON gt.id = g.greugeTypeFk
WHERE tm.`year` = vYear
AND tm.`month` = vMonth
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
AND gt.code = 'freightDifference'
GROUP BY t.routeFk
) sub ON r.Id_Ruta = sub.routeFk

View File

@ -4,6 +4,6 @@ BEGIN
/**
* Call rutasAnalyze
*/
CALL rutasAnalyze(YEAR(util.VN_CURDATE()), MONTH(util.VN_CURDATE()));
CALL rutasAnalyze(util.VN_CURDATE() - INTERVAL 30 DAY , util.VN_CURDATE());
END$$
DELIMITER ;

View File

@ -1,21 +0,0 @@
CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `bi`.`v_clientes_jerarquia`
AS SELECT `c`.`id_cliente` AS `Id_Cliente`,
`c`.`cliente` AS `Cliente`,
`t`.`CodigoTrabajador` AS `Comercial`,
`tj`.`CodigoTrabajador` AS `Jefe`
FROM (
(
(
`vn2008`.`Clientes` `c`
JOIN `vn2008`.`Trabajadores` `t` ON(`t`.`Id_Trabajador` = `c`.`Id_Trabajador`)
)
JOIN `vn2008`.`jerarquia` ON(
`vn2008`.`jerarquia`.`worker_id` = `c`.`Id_Trabajador`
)
)
JOIN `vn2008`.`Trabajadores` `tj` ON(
`tj`.`Id_Trabajador` = `vn2008`.`jerarquia`.`boss_id`
)
)

View File

@ -37,9 +37,9 @@ BEGIN
FROM
vn2008.Clientes c
LEFT JOIN
(SELECT g.Id_Cliente, CAST( SUM(Importe) as DECIMAL(12,2)) AS Greuge
FROM vn2008.Greuges g
JOIN vn.`client` c ON c.id = g.Id_Cliente
(SELECT g.clientFk Id_Cliente, CAST( SUM(g.amount) as DECIMAL(12,2)) AS Greuge
FROM vn.greuge g
JOIN vn.`client` c ON c.id = g.clientFk
LEFT JOIN vn.worker w ON c.salesPersonFk = w.id
WHERE (c.salesPersonFk = vWorker OR w.bossFk = vWorker)
GROUP BY Id_Cliente
@ -98,9 +98,9 @@ BEGIN
GROUP BY c.Id_Cliente) CmLy ON CmLy.Id_Cliente = c.Id_Cliente
LEFT JOIN
(SELECT c.Id_Cliente,
IF(MAX(Fecha) < DATE_FORMAT(TIMESTAMPADD(MONTH, - 1, vDate), '%Y- %m-01'), TRUE, FALSE) muerto
FROM vn2008.Facturas f
JOIN vn2008.Clientes c ON c.Id_cliente = f.Id_Cliente
IF(MAX(io.issued) < DATE_FORMAT(TIMESTAMPADD(MONTH, - 1, vDate), '%Y- %m-01'), TRUE, FALSE) muerto
FROM vn.invoiceOut io
JOIN vn2008.Clientes c ON c.Id_cliente = io.clientFk
LEFT JOIN vn2008.Trabajadores tr ON c.Id_Trabajador = tr.Id_Trabajador
WHERE (c.Id_Trabajador = vWorker OR tr.boss = vWorker)
GROUP BY Id_Cliente) dead ON dead.Id_Cliente = c.Id_Cliente

View File

@ -22,7 +22,7 @@ BEGIN
FROM vn.component WHERE code = 'manaClaim';
SELECT id INTO vManaBankId
FROM vn.bank WHERE code = 'mana';
FROM vn.accounting WHERE code = 'mana';
SELECT id INTO vManaGreugeTypeId
FROM vn.greugeType WHERE code = 'mana';
@ -82,11 +82,11 @@ BEGIN
AND Fechacobro > vFromDated
AND Fechacobro <= vToDated
UNION ALL
SELECT g.Id_Cliente, g.Importe
FROM vn2008.Greuges g
WHERE Greuges_type_id = vManaGreugeTypeId
AND Fecha > vFromDated
AND Fecha <= vToDated
SELECT clientFk, amount
FROM vn.greuge
WHERE greugeTypeFk = vManaGreugeTypeId
AND shipped > vFromDated
AND shipped <= vToDated
UNION ALL
SELECT clientFk, mana
FROM vn.clientManaCache

View File

@ -1,7 +1,7 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`ventas_contables_add`(IN vYear INT, IN vMonth INT)
BEGIN
/**
* Reemplaza las ventas contables del último año.
* Es el origen de datos para el balance de Entradas
@ -13,8 +13,8 @@ BEGIN
DECLARE TIPO_PATRIMONIAL INT DEFAULT 188;
DELETE FROM bs.ventas_contables
WHERE year = vYear
DELETE FROM bs.ventas_contables
WHERE year = vYear
AND month = vMonth;
DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list;
@ -23,9 +23,9 @@ BEGIN
ENGINE = MEMORY
SELECT Id_Ticket
FROM vn2008.Tickets t
JOIN vn2008.Facturas f ON f.Id_Factura = t.Factura
WHERE year(f.Fecha) = vYear
AND month(f.Fecha) = vMonth;
JOIN vn.invoiceOut io ON io.id = t.Factura
WHERE year(io.issued) = vYear
AND month(io.issued) = vMonth;
INSERT INTO bs.ventas_contables(year
, month
@ -35,7 +35,7 @@ BEGIN
, tipo_id
, empresa_id
, gasto)
SELECT vYear
, vMonth
, round(sum(Cantidad * Preu * (100 - m.Descuento)/100))
@ -47,13 +47,13 @@ BEGIN
, tp.reino_id
, a.tipo_id
, t.empresa_id
, 7000000000
, a.expenseFk
+ IF(e.empresa_grupo = e2.empresa_grupo
,1
,IF(e2.empresa_grupo,2,0)
) * 1000000
+ tp.reino_id * 10000 as Gasto
FROM vn2008.Movimientos m
) * 100000
+ tp.reino_id * 1000 as Gasto
FROM vn2008.Movimientos m
JOIN vn2008.Tickets t on t.Id_Ticket = m.Id_Ticket
JOIN vn2008.Consignatarios cs on cs.Id_Consigna = t.Id_Consigna
JOIN vn2008.Clientes c on c.Id_Cliente = cs.Id_Cliente
@ -67,7 +67,7 @@ BEGIN
AND m.Descuento <> 100
AND a.tipo_id != TIPO_PATRIMONIAL
GROUP BY grupo, reino_id, tipo_id, empresa_id, Gasto;
INSERT INTO bs.ventas_contables(year
, month
, venta
@ -86,17 +86,17 @@ BEGIN
) as grupo
, NULL
, NULL
, t.companyFk
, t.companyFk
, 7050000000
FROM vn.ticketService ts
FROM vn.ticketService ts
JOIN vn.ticket t ON ts.ticketFk = t.id
JOIN vn.address a on a.id = t.addressFk
JOIN vn.client cl on cl.id = a.clientFk
JOIN vn.address a on a.id = t.addressFk
JOIN vn.client cl on cl.id = a.clientFk
JOIN tmp.ticket_list tt on tt.Id_Ticket = t.id
JOIN vn.company c on c.id = t.companyFk
JOIN vn.company c on c.id = t.companyFk
LEFT JOIN vn.company c2 on c2.clientFk = cl.id
GROUP BY grupo, t.companyFk ;
GROUP BY grupo, t.companyFk ;
DROP TEMPORARY TABLE tmp.ticket_list;
END$$
DELIMITER ;

View File

@ -13,9 +13,9 @@ BEGIN
(PRIMARY KEY (Id_Ticket))
SELECT Id_Ticket
FROM vn2008.Tickets t
JOIN vn2008.Facturas f ON f.Id_Factura = t.Factura
WHERE year(f.Fecha) = vYear
AND month(f.Fecha) = vMonth;
JOIN vn.invoiceOut io ON io.id = t.Factura
WHERE year(io.issued) = vYear
AND month(io.issued) = vMonth;
SELECT vYear Año,
vMonth Mes,

View File

@ -24,20 +24,20 @@ BEGIN
WHERE date BETWEEN @datSTART
AND @datEND ) tm
LEFT JOIN
(SELECT DISTINCT tm.yearMonth, f.Id_Cliente , 1 as Compra
FROM vn2008.Facturas f
JOIN vn2008.time tm ON tm.date = f.Fecha
WHERE Fecha BETWEEN @datSTART
(SELECT DISTINCT tm.yearMonth, io.clientFk Id_Cliente , 1 as Compra
FROM vn.invoiceOut io
JOIN vn2008.time tm ON tm.date = io.issued
WHERE io.issued BETWEEN @datSTART
AND @datEND) f ON f.yearMonth = tm.yearMonth
AND f.Id_Cliente = c.Id_Cliente;
UPDATE tmp.VivosMuertos vm
JOIN
(SELECT MIN(tm.yearMonth) firstMonth, f.Id_Cliente
FROM vn2008.Facturas f
JOIN vn2008.time tm ON tm.date = f.Fecha
WHERE Fecha BETWEEN @datSTART AND @datEND
GROUP BY f.Id_Cliente ) fm ON fm.firstMonth = vm.yearMonth
(SELECT MIN(tm.yearMonth) firstMonth, io.clientFk Id_Cliente
FROM vn.invoiceOut io
JOIN vn2008.time tm ON tm.date = io.issued
WHERE io.issued BETWEEN @datSTART AND @datEND
GROUP BY io.clientFk) fm ON fm.firstMonth = vm.yearMonth
AND fm.Id_Cliente = vm.Id_Cliente
SET Nuevo = 1;
@ -46,11 +46,11 @@ BEGIN
UPDATE tmp.VivosMuertos vm
JOIN (
SELECT MAX(tm.yearMonth) firstMonth, f.Id_Cliente
FROM vn2008.Facturas f
JOIN vn2008.time tm ON tm.date = f.Fecha
WHERE Fecha BETWEEN @datSTART AND @datEND
GROUP BY f.Id_Cliente ) fm ON fm.firstMonth = vm.yearMonth
SELECT MAX(tm.yearMonth) firstMonth, io.clientFk Id_Cliente
FROM vn.invoiceOut io
JOIN vn2008.time tm ON tm.date = io.issued
WHERE io.issued BETWEEN @datSTART AND @datEND
GROUP BY io.clientFk) fm ON fm.firstMonth = vm.yearMonth
AND fm.Id_Cliente = vm.Id_Cliente
SET Muerto = 1

View File

@ -19,7 +19,7 @@ BEGIN
itemFk,
itemTypeFk,
floor(sum(value)) as total,
floor(sum(IF(clientTypeFk = 'loses', value, 0))) as mermas
floor(sum(IF(typeFk = 'loses', value, 0))) as mermas
FROM vn.saleValue
where year = vYear and week = vWeek

View File

@ -1,10 +1,6 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`clean`()
BEGIN
DECLARE vDateShort DATETIME;
SET vDateShort = TIMESTAMPADD(MONTH, -1, util.VN_CURDATE());
DELETE FROM cache.departure_limit WHERE Fecha < vDateShort;
DELETE FROM cache.departure_limit WHERE Fecha < util.VN_CURDATE() - INTERVAL 1 MONTH;
END$$
DELIMITER ;

View File

@ -54,7 +54,7 @@ p: BEGIN
FROM vn.`client` WHERE id = vCustomer;
SELECT account INTO vAccount
FROM vn.bank WHERE id = vBank;
FROM vn.accounting WHERE id = vBank;
DELETE FROM vn.XDiario
WHERE SUBCTA = vSubaccount

View File

@ -253,9 +253,9 @@ BEGIN
LIMIT 10000000000000000000
) sub GROUP BY ASIEN
)sub2 ON sub2.ASIEN = x.ASIEN
LEFT JOIN ( SELECT DISTINCT(account),cu.code
FROM vn.bank b
JOIN vn.currency cu ON cu.id = b.currencyFk
LEFT JOIN ( SELECT DISTINCT(a.account),cu.code
FROM vn.accounting a
JOIN vn.currency cu ON cu.id = a.currencyFk
WHERE cu.code <> 'EUR' -- no se informa cuando la divisa en EUR
)sub3 ON sub3.account = x.SUBCTA
WHERE x.enlazadoSage = FALSE

View File

@ -17,15 +17,15 @@ BEGIN
e.id accountFk,
UCASE(e.name),
''
FROM vn.expense e
FROM expense e
UNION
SELECT company_getCode(vCompanyFk),
b.account,
UCASE(b.bank),
a.account,
UCASE(a.bank),
''
FROM vn.bank b
WHERE b.isActive
AND b.`account`
FROM accounting a
WHERE a.isActive
AND a.`account`
UNION
SELECT CodigoEmpresa,
CodigoCuenta,

View File

@ -0,0 +1,15 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`checkPrintableChars`(
vString VARCHAR(255)
) RETURNS tinyint(1)
DETERMINISTIC
BEGIN
/**
* Validates whether the input string contains only printable characters
* and Spanish special characters (such as ¡, ÿ, etc.).
*
* @vString string to check
*/
RETURN vString REGEXP '^[ -~¡-ÿ]*$';
END$$
DELIMITER ;

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

@ -1,8 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`sale_checkWithoutComponents`
ON SCHEDULE EVERY 10 MINUTE
STARTS '2020-05-04 11:56:23.000'
ON COMPLETION PRESERVE
ENABLE
DO call sale_checkNoComponents(DATE_ADD(util.VN_NOW(), INTERVAL -10 MINUTE),DATE_ADD(util.VN_NOW(), INTERVAL -1 MINUTE))$$
DELIMITER ;

View File

@ -4,32 +4,25 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`hasAnyNegativeBase`(
DETERMINISTIC
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
*/
DECLARE hasAnyNegativeBase BOOLEAN;
DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
CREATE TEMPORARY TABLE tmp.ticket
(KEY (ticketFk))
ENGINE = MEMORY
SELECT id ticketFk
FROM tmp.ticketToInvoice;
CALL getTaxBases();
CALL ticket_getTax(NULL);
SELECT negative INTO hasAnyNegativeBase
FROM tmp.taxBases
LIMIT 1;
SELECT COUNT(*) INTO hasAnyNegativeBase
FROM(
SELECT SUM(taxableBase) as taxableBase
FROM tmp.ticketTax
GROUP BY pgcFk
HAVING taxableBase < 0
) t;
DROP TEMPORARY TABLE tmp.ticketTax;
DROP TEMPORARY TABLE tmp.ticket;
DROP TEMPORARY TABLE
tmp.ticketTax,
tmp.ticket,
tmp.taxBases;
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

@ -1,27 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`isPalletHomogeneus`(vExpedition INT)
RETURNS tinyint(1)
NOT DETERMINISTIC
READS SQL DATA
BEGIN
DECLARE vScanId INT;
DECLARE vDistinctRoutesInThePallet INT;
SELECT scan_id INTO vScanId
FROM vn2008.scan_line
WHERE code = vExpedition
LIMIT 1;
SELECT COUNT(*) INTO vDistinctRoutesInThePallet
FROM (
SELECT DISTINCT t.Id_Ruta
FROM vn2008.scan_line sl
JOIN vn2008.expeditions e ON e.expeditions_id = sl.code
JOIN vn2008.Tickets t ON t.Id_Ticket = e.ticket_id
WHERE sl.scan_id = vScanId
AND t.Id_Ruta
) t1;
RETURN vDistinctRoutesInThePallet = 1;
END$$
DELIMITER ;

View File

@ -1,14 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`nz`(vQuantity DOUBLE)
RETURNS double
DETERMINISTIC
BEGIN
DECLARE vResult DOUBLE;
SET vResult = IFNULL(vQuantity,0);
RETURN vResult;
END$$
DELIMITER ;

View File

@ -34,7 +34,7 @@ BEGIN
-- Inserta los asientos contables
SELECT account INTO vAccount
FROM bank WHERE id = vBank;
FROM accounting WHERE id = vBank;
SELECT accountingAccount INTO vSubaccount
FROM `client` WHERE id = vClient;

View File

@ -0,0 +1,41 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`XDiario_check`()
BEGIN
/**
* Realiza la revisión diaria de los asientos contables,
* identificando y notificando los asientos descuadrados
* y ajustando los saldos en caso necesario.
*/
INSERT INTO mail (receiver, subject, body)
SELECT 'cau@verdnatura.es',
'Asientos descuadrados',
GROUP_CONCAT(CONCAT(' Asiento: ', ASIEN, ' - Importe:', recon) SEPARATOR ' | \n')
FROM (
SELECT ASIEN,
SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) recon
FROM XDiario
WHERE NOT enlazado
GROUP BY ASIEN
HAVING ABS(SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0))) > 0.01
) sub
HAVING COUNT(*);
UPDATE XDiario xd
JOIN (
SELECT xd.id, SUBCTA, recon
FROM XDiario xd
JOIN (
SELECT ASIEN,
SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) recon
FROM XDiario
WHERE NOT enlazado
GROUP BY ASIEN
HAVING recon
) sub ON sub.ASIEN = xd.ASIEN
WHERE xd.SUBCTA > '5999999999'
GROUP BY xd.ASIEN
) sub ON sub.id = xd.id
SET xd.Eurohaber = IF(IFNULL(xd.Eurohaber, 0) = 0, xd.Eurohaber, xd.Eurohaber + sub.recon),
xd.Eurodebe = IF(IFNULL(xd.Eurodebe, 0) = 0, xd.Eurodebe, xd.Eurodebe - sub.recon);
END$$
DELIMITER ;

View File

@ -0,0 +1,52 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`balanceNestTree_addChild`(
vSelf INT,
vName VARCHAR(45)
)
BEGIN
/**
* Agrega un nuevo nodo hijo a un nodo existente dentro de la estructura
* de árbol de vn.balanceNestTree.
*
* @param vSelf Identificador del nodo
* @param vName Nombre del nuevo nodo hijo
*/
DECLARE vTable VARCHAR(45) DEFAULT util.quoteIdentifier('balanceNestTree');
DECLARE vLeft INT;
CREATE OR REPLACE TEMPORARY TABLE tAux
SELECT 0 lft;
EXECUTE IMMEDIATE CONCAT(
'UPDATE tAux
SET lft = (SELECT lft
FROM ', vTable,
' WHERE id = ?)')
USING vSelf;
SELECT lft INTO vLeft FROM tAux;
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable, '
SET rgt = rgt + 2
WHERE rgt > ?
ORDER BY rgt DESC')
USING vLeft;
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable, '
SET lft = lft + 2
WHERE lft > ?
ORDER BY lft DESC')
USING vLeft;
EXECUTE IMMEDIATE CONCAT(
'INSERT INTO ', vTable, ' (name, lft, rgt)
VALUES(?, ? + 1, ? + 2)')
USING vName,
vLeft,
vLeft;
DROP TEMPORARY TABLE tAux;
END$$
DELIMITER ;

View File

@ -0,0 +1,53 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`balanceNestTree_delete`(
vSelf INT
)
BEGIN
/**
* Elimina un nodo dentro de la estructura de árbol de vn.balanceNestTree.
*
* @param vSelf Identificador del nodo
*/
DECLARE vTable VARCHAR(45) DEFAULT util.quoteIdentifier('balanceNestTree');
DECLARE vRight INT;
DECLARE vLeft INT;
DECLARE vWidth INT;
CREATE OR REPLACE TEMPORARY TABLE tAux
SELECT 0 rgt, 0 lft, 0 wdt;
EXECUTE IMMEDIATE CONCAT(
'UPDATE tAux a
JOIN ', vTable, ' t
SET a.rgt = t.rgt,
a.lft = t.lft,
a.wdt = t.rgt - t.lft + 1
WHERE t.id = ?')
USING vSelf;
SELECT rgt, lft, wdt
INTO vRight, vLeft, vWidth
FROM tAux;
EXECUTE IMMEDIATE CONCAT(
'DELETE FROM ', vTable,
' WHERE lft BETWEEN ? AND ?')
USING vLeft, vRight;
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
' SET rgt = rgt - ?
WHERE rgt > ?
ORDER BY rgt')
USING vWidth,vRight;
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
' SET lft = lft - ?
WHERE lft > ?
ORDER BY lft')
USING vWidth, vRight;
DROP TEMPORARY TABLE tAux;
END$$
DELIMITER ;

View File

@ -0,0 +1,117 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`balanceNestTree_move`(
vSelf INT,
vFather INT
)
BEGIN
/**
* Mueve un nodo dentro de la estructura de árbol de vn.balanceNestTree.
*
* @param vSelf Identificador del nodo
* @param vFather Identificador del nuevo padre del nodo
*/
DECLARE vTable VARCHAR(45) DEFAULT util.quoteIdentifier('balanceNestTree');
DECLARE vRight INT;
DECLARE vLeft INT;
DECLARE vWidth INT;
DECLARE vFatherRight INT;
DECLARE vFatherLeft INT;
DECLARE vGap INT;
CREATE OR REPLACE TEMPORARY TABLE tAux
SELECT 0 rgt, 0 lft, 0 wdt, 0 frg, 0 flf;
-- Averiguamos el ancho de la rama
EXECUTE IMMEDIATE CONCAT(
'UPDATE tAux a
JOIN ', vTable, ' t
SET a.wdt = t.rgt - t.lft + 1
WHERE t.id = ?')
USING vSelf;
-- Averiguamos la posicion del nuevo padre
EXECUTE IMMEDIATE CONCAT(
'UPDATE tAux a
JOIN ', vTable, ' t
SET a.frg = t.rgt,
a.flf = t.lft
WHERE t.id = ?')
USING vFather;
SELECT wdt, frg, flf
INTO vWidth, vFatherRight, vFatherLeft
FROM tAux;
-- 1º Incrementamos los valores de todos los nodos a la derecha
-- del punto de inserción (vFatherRight) , para hacer sitio
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
'SET rgt = rgt + ?
WHERE rgt >= ?
ORDER BY rgt DESC')
USING vWidth,
vFatherRight;
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
'SET lft = lft + ?
WHERE lft >= ?
ORDER BY lft DESC')
USING vWidth,
vFatherRight;
-- Es preciso recalcular los valores del nodo en el
-- caso de que estuviera a la derecha del nuevo padre
EXECUTE IMMEDIATE CONCAT(
'UPDATE tAux a
JOIN ', vTable, ' t
SET a.rgt = t.rgt,
a.lft = t.lft
WHERE t.id = ?')
USING vSelf;
SELECT lft, rgt, frg - lft
INTO vLeft, vRight, vGap
FROM tAux;
-- 2º Incrementamos el valor de todos los nodos a
-- trasladar hasta alcanzar su nueva posicion
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
'SET lft = lft + ?
WHERE lft BETWEEN ? AND ?
ORDER BY lft DESC')
USING vGap,
vLeft,
vRight;
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
'SET rgt = rgt + ?
WHERE rgt BETWEEN ? AND ?
ORDER BY rgt DESC')
USING vGap,
vLeft,
vRight;
-- 3º Restaremos a todos los nodos resultantes, a la derecha
-- de la posicion arrancada el ancho de la rama escindida
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
'SET lft = lft - ?
WHERE lft > ?
ORDER BY lft')
USING vWidth,
vLeft;
EXECUTE IMMEDIATE CONCAT(
'UPDATE ', vTable,
'SET rgt = rgt - ?
WHERE rgt > ?
ORDER BY rgt')
USING vWidth,
vRight;
DROP TEMPORARY TABLE tAux;
END$$
DELIMITER ;

View File

@ -10,13 +10,11 @@ BEGIN
INSERT INTO mail (receiver,replyTo,subject,body)
SELECT 'administracion@verdnatura.es' receiver,
'noreply@verdnatura.es' replyTo,
CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') subject,
CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') body
FROM vn.bankPolicy bp
LEFT JOIN vn.supplier s
ON s.id = bp.supplierFk
LEFT JOIN vn.bank b
ON b.id = bp.bankFk
CONCAT('El seguro de la poliza ',a.id,' ',a.bank,' ha finalizado.') subject,
CONCAT('El seguro de la poliza ',a.id,' ',a.bank,' ha finalizado.') body
FROM bankPolicy bp
LEFT JOIN supplier s ON s.id = bp.supplierFk
LEFT JOIN accounting a ON a.id = bp.accountingFk
WHERE bp.insuranceExpired = util.VN_CURDATE();
END$$
DELIMITER ;

View File

@ -39,11 +39,11 @@ BEGIN
WHERE t.landed BETWEEN vStarted AND vEnded
AND (vWarehouseFk IS NULL OR t.warehouseInFk = vWarehouseFk)
AND b.price2 > 0
AND b.quantity > 0
ORDER BY NOT b.isIgnored DESC, t.landed DESC, b.id DESC
LIMIT 10000000000000000000) sub
GROUP BY itemFk, warehouseFk;
INSERT IGNORE INTO tmp.buyUltimateFromInterval(itemFk, warehouseFk, buyFk, landed, isIgnored)
SELECT
b.itemFk,

View File

@ -1,44 +1,42 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`clean`()
BEGIN
DECLARE vDateShort DATETIME;
DECLARE vOneYearAgo DATE;
DECLARE vFourYearsAgo DATE;
DECLARE vFiveYearsAgo DATE;
DECLARE v18Month DATE;
DECLARE v26Month DATE;
DECLARE v3Month DATE;
/**
* Purges outdated data to optimize performance.
* Exercise caution when executing.
*/
DECLARE v2Months DATE DEFAULT util.VN_CURDATE() - INTERVAL 2 MONTH;
DECLARE v3Months DATE DEFAULT util.VN_CURDATE() - INTERVAL 3 MONTH;
DECLARE v18Months DATE DEFAULT util.VN_CURDATE() - INTERVAL 18 MONTH;
DECLARE v26Months DATE DEFAULT util.VN_CURDATE() - INTERVAL 26 MONTH;
DECLARE v1Years DATE DEFAULT util.VN_CURDATE() - INTERVAL 1 YEAR;
DECLARE v2Years DATE DEFAULT util.VN_CURDATE() - INTERVAL 2 YEAR;
DECLARE v4Years DATE DEFAULT util.VN_CURDATE() - INTERVAL 4 YEAR;
DECLARE v5Years DATE DEFAULT util.VN_CURDATE() - INTERVAL 5 YEAR;
DECLARE vTrashId VARCHAR(15);
DECLARE v5Years DATE;
DECLARE vCompanyBlk INT;
SET vDateShort = util.VN_CURDATE() - INTERVAL 2 MONTH;
SET vOneYearAgo = util.VN_CURDATE() - INTERVAL 1 YEAR;
SET vFourYearsAgo = util.VN_CURDATE() - INTERVAL 4 YEAR;
SET vFiveYearsAgo = util.VN_CURDATE() - INTERVAL 5 YEAR;
SET v18Month = util.VN_CURDATE() - INTERVAL 18 MONTH;
SET v26Month = util.VN_CURDATE() - INTERVAL 26 MONTH;
SET v3Month = util.VN_CURDATE() - INTERVAL 3 MONTH;
SET v5Years = util.VN_CURDATE() - INTERVAL 5 YEAR;
DELETE FROM ticketParking WHERE created < vDateShort;
DELETE FROM routesMonitor WHERE dated < vDateShort;
DELETE FROM workerTimeControlLog WHERE created < vDateShort;
DELETE FROM `message` WHERE sendDate < vDateShort;
DELETE FROM messageInbox WHERE sendDate < vDateShort;
DELETE FROM messageInbox WHERE sendDate < vDateShort;
DELETE FROM workerTimeControl WHERE timed < vFourYearsAgo;
DELETE FROM workerActivity WHERE created < v2Years;
DELETE FROM ticketParking WHERE created < v2Months;
DELETE FROM routesMonitor WHERE dated < v2Months;
DELETE FROM workerTimeControlLog WHERE created < v2Months;
DELETE FROM `message` WHERE sendDate < v2Months;
DELETE FROM messageInbox WHERE sendDate < v2Months;
DELETE FROM messageInbox WHERE sendDate < v2Months;
DELETE FROM workerTimeControl WHERE timed < v4Years;
DELETE FROM itemShelving WHERE created < util.VN_CURDATE() AND visible = 0;
DELETE FROM ticketDown WHERE created < TIMESTAMPADD(DAY,-1,util.VN_CURDATE());
DELETE FROM entryLog WHERE creationDate < vDateShort;
DELETE IGNORE FROM expedition WHERE created < v26Month;
DELETE FROM sms WHERE created < v18Month;
DELETE FROM saleTracking WHERE created < vOneYearAgo;
DELETE FROM ticketTracking WHERE created < v18Month;
DELETE FROM ticketDown WHERE created < util.yesterday();
DELETE FROM entryLog WHERE creationDate < v2Months;
DELETE IGNORE FROM expedition WHERE created < v26Months;
DELETE FROM sms WHERE created < v18Months;
DELETE FROM saleTracking WHERE created < v1Years;
DELETE FROM ticketTracking WHERE created < v18Months;
DELETE tobs FROM ticketObservation tobs
JOIN ticket t ON tobs.ticketFk = t.id WHERE t.shipped < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE());
DELETE sc.* FROM saleCloned sc JOIN sale s ON s.id = sc.saleClonedFk JOIN ticket t ON t.id = s.ticketFk WHERE t.shipped < vOneYearAgo;
DELETE FROM sharingCart where ended < vDateShort;
DELETE FROM sharingClient where ended < vDateShort;
JOIN ticket t ON tobs.ticketFk = t.id
WHERE t.shipped < v5Years;
DELETE sc.* FROM saleCloned sc JOIN sale s ON s.id = sc.saleClonedFk JOIN ticket t ON t.id = s.ticketFk WHERE t.shipped < v1Years;
DELETE FROM sharingCart where ended < v2Months;
DELETE FROM sharingClient where ended < v2Months;
DELETE tw.* FROM ticketWeekly tw
LEFT JOIN sale s ON s.ticketFk = tw.ticketFk
LEFT JOIN ticketRequest tr ON tr.ticketFk = tw.ticketFk
@ -46,140 +44,182 @@ BEGIN
WHERE s.id IS NULL
AND tr.id IS NULL
AND ts.id IS NULL;
DELETE FROM claim WHERE ticketCreated < vFourYearsAgo;
DELETE FROM message WHERE sendDate < vDateShort;
-- Robert ubicacion anterior de trevelLog comentario para debug
DELETE FROM zoneEvent WHERE `type` = 'day' AND dated < v3Month;
DELETE FROM claim WHERE ticketCreated < v4Years;
-- Robert ubicacion anterior de travelLog comentario para debug
DELETE FROM zoneEvent WHERE `type` = 'day' AND dated < v3Months;
DELETE bm
FROM buyMark bm
JOIN buy b ON b.id = bm.id
JOIN entry e ON e.id = b.entryFk
JOIN travel t ON t.id = e.travelFk
WHERE t.landed <= vDateShort;
DELETE b FROM vn.buy b
JOIN vn.entryConfig e ON e.defaultEntry = b.entryFk
WHERE b.created < vDateShort;
DELETE FROM vn.itemShelvingLog WHERE created < vDateShort;
DELETE FROM vn.stockBuyed WHERE creationDate < vDateShort;
DELETE FROM vn.itemCleanLog WHERE created < util.VN_NOW() - INTERVAL 1 YEAR;
DELETE FROM printQueue WHERE statusCode = 'printed' AND created < vDateShort;
DELETE FROM ticketLog WHERE creationDate <= vFiveYearsAgo;
WHERE t.landed <= v2Months;
DELETE b FROM buy b
JOIN entryConfig e ON e.defaultEntry = b.entryFk
WHERE b.created < v2Months;
DELETE FROM itemShelvingLog WHERE created < v2Months;
DELETE FROM stockBuyed WHERE creationDate < v2Months;
DELETE FROM itemCleanLog WHERE created < util.VN_NOW() - INTERVAL 1 YEAR;
DELETE FROM printQueue WHERE statusCode = 'printed' AND created < v2Months;
DELETE FROM ticketLog WHERE creationDate <= v5Years;
-- Equipos duplicados
DELETE w.*
FROM workerTeam w
JOIN (SELECT id, team, workerFk, COUNT(*) - 1 as duplicated
JOIN (
SELECT id, team, workerFk, COUNT(*) - 1 duplicated
FROM workerTeam
GROUP BY team,workerFk
HAVING duplicated
) d ON d.team = w.team AND d.workerFk = w.workerFk AND d.id != w.id;
) d ON d.team = w.team
AND d.workerFk = w.workerFk
AND d.id <> w.id;
DELETE sc
FROM saleComponent sc
JOIN sale s ON s.id= sc.saleFk
JOIN ticket t ON t.id= s.ticketFk
WHERE t.shipped < v18Month;
WHERE t.shipped < v18Months;
DELETE c
FROM vn.claim c
JOIN vn.claimState cs ON cs.id = c.claimStateFk
WHERE cs.description = "Anulado" AND
c.created < vDateShort;
DELETE
FROM vn.expeditionTruck
WHERE eta < v3Month;
FROM claim c
JOIN claimState cs ON cs.id = c.claimStateFk
WHERE cs.description = 'Anulado'
AND c.created < v2Months;
DELETE FROM XDiario WHERE FECHA < v3Month OR FECHA IS NULL;
-- borrar travels sin entradas
DROP TEMPORARY TABLE IF EXISTS tmp.thermographToDelete;
CREATE TEMPORARY TABLE tmp.thermographToDelete
DELETE FROM expeditionTruck WHERE eta < v3Months;
DELETE FROM XDiario WHERE FECHA < v3Months OR FECHA IS NULL;
-- Borrar travels sin entradas
CREATE OR REPLACE TEMPORARY TABLE tThermographToDelete
SELECT th.id,th.dmsFk
FROM vn.travel t
LEFT JOIN vn.entry e ON e.travelFk = t.id
JOIN vn.travelThermograph th ON th.travelFk = t.id
WHERE t.shipped < TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()) AND e.travelFk IS NULL;
FROM travel t
LEFT JOIN entry e ON e.travelFk = t.id
JOIN travelThermograph th ON th.travelFk = t.id
WHERE t.shipped < v3Months
AND e.travelFk IS NULL;
SELECT dt.id INTO vTrashId
FROM vn.dmsType dt
FROM dmsType dt
WHERE dt.code = 'trash';
UPDATE tmp.thermographToDelete th
JOIN vn.dms d ON d.id = th.dmsFk
UPDATE tThermographToDelete th
JOIN dms d ON d.id = th.dmsFk
SET d.dmsTypeFk = vTrashId;
DELETE th
FROM tmp.thermographToDelete tmp
JOIN vn.travelThermograph th ON th.id = tmp.id;
FROM tThermographToDelete tmp
JOIN travelThermograph th ON th.id = tmp.id;
DELETE t
FROM vn.travel t
LEFT JOIN vn.entry e ON e.travelFk = t.id
WHERE t.shipped < TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()) AND e.travelFk IS NULL;
FROM travel t
LEFT JOIN entry e ON e.travelFk = t.id
WHERE t.shipped < v3Months AND e.travelFk IS NULL;
UPDATE dms d
JOIN dmsType dt ON dt.id = d.dmsTypeFk
SET d.dmsTypeFk = vTrashId
WHERE created < TIMESTAMPADD(MONTH, -dt.monthToDelete, util.VN_CURDATE());
WHERE created < util.VN_CURDATE() - INTERVAL dt.monthToDelete MONTH;
-- borrar entradas sin compras
DROP TEMPORARY TABLE IF EXISTS tmp.entryToDelete;
CREATE TEMPORARY TABLE tmp.entryToDelete
CREATE OR REPLACE TEMPORARY TABLE tEntryToDelete
SELECT e.*
FROM vn.entry e
LEFT JOIN vn.buy b ON b.entryFk = e.id
JOIN vn.entryConfig ec ON e.id != ec.defaultEntry
WHERE e.dated < TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()) AND b.entryFK IS NULL;
FROM entry e
LEFT JOIN buy b ON b.entryFk = e.id
JOIN entryConfig ec ON e.id <> ec.defaultEntry
WHERE e.dated < v3Months
AND b.entryFK IS NULL;
DELETE e
FROM vn.entry e
JOIN tmp.entryToDelete tmp ON tmp.id = e.id;
FROM entry e
JOIN tEntryToDelete tmp ON tmp.id = e.id;
-- borrar de route registros menores a 4 años
DROP TEMPORARY TABLE IF EXISTS tmp.routeToDelete;
CREATE TEMPORARY TABLE tmp.routeToDelete
CREATE OR REPLACE TEMPORARY TABLE tRouteToDelete
SELECT *
FROM vn.route r
WHERE created < TIMESTAMPADD(YEAR,-4,util.VN_CURDATE());
FROM route r
WHERE created < v4Years;
UPDATE tmp.routeToDelete tmp
JOIN vn.dms d ON d.id = tmp.gestdocFk
UPDATE tRouteToDelete tmp
JOIN dms d ON d.id = tmp.gestdocFk
SET d.dmsTypeFk = vTrashId;
DELETE r
FROM tmp.routeToDelete tmp
JOIN vn.route r ON r.id = tmp.id;
FROM tRouteToDelete tmp
JOIN route r ON r.id = tmp.id;
-- borrar registros de dua y awb menores a 2 años
DROP TEMPORARY TABLE IF EXISTS tmp.duaToDelete;
CREATE TEMPORARY TABLE tmp.duaToDelete
CREATE OR REPLACE TEMPORARY TABLE tDuaToDelete
SELECT *
FROM vn.dua
WHERE operated < TIMESTAMPADD(YEAR,-2,CURDATE());
FROM dua
WHERE operated < v2Years;
UPDATE tmp.duaToDelete tm
JOIN vn.dms d ON d.id = tm.gestdocFk
UPDATE tDuaToDelete tm
JOIN dms d ON d.id = tm.gestdocFk
SET d.dmsTypeFk = vTrashId;
DELETE d
FROM tmp.duaToDelete tmp
JOIN vn.dua d ON d.id = tmp.id;
FROM tDuaToDelete tmp
JOIN dua d ON d.id = tmp.id;
DELETE FROM vn.awb WHERE created < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE());
DELETE a
FROM awb a
LEFT JOIN travel t ON t.awbFk = a.id
WHERE a.created < v2Years
AND t.id IS NULL;
-- Borra los registros de collection y ticketcollection
DELETE FROM vn.collection WHERE created < vDateShort;
DELETE FROM collection WHERE created < v2Months;
DELETE FROM travelLog WHERE creationDate < v3Months;
DROP TEMPORARY TABLE IF EXISTS tmp.thermographToDelete;
DROP TEMPORARY TABLE IF EXISTS tmp.entryToDelete;
DROP TEMPORARY TABLE IF EXISTS tmp.duaToDelete;
DELETE FROM travelLog WHERE creationDate < v3Month;
CALL shelving_clean;
CALL shelving_clean();
DELETE FROM chat WHERE dated < v5Years;
DELETE tt FROM ticketTracking tt
JOIN ticket t ON tt.ticketFk = t.id
WHERE t.shipped <= v2Months;
DELETE tt FROM ticketTracking tt JOIN vn.ticket t ON tt.ticketFk = t.id
WHERE t.shipped <= vDateShort;
DELETE FROM mail WHERE creationDate < v2Months;
DELETE FROM split WHERE dated < v18Months;
DELETE FROM remittance WHERE dated < v18Months;
CREATE OR REPLACE TEMPORARY TABLE tTicketDelete
SELECT DISTINCT tl.originFk ticketFk
FROM ticketLog tl
JOIN (
SELECT MAX(tl.id)ids
FROM ticket t
JOIN ticketLog tl ON tl.originFk = t.id
LEFT JOIN ticketWeekly tw ON tw.ticketFk = t.id
WHERE t.shipped BETWEEN '2000-01-01' AND '2000-12-31'
AND t.isDeleted
AND tw.ticketFk IS NULL
GROUP BY t.id
) sub ON sub.ids = tl.id
WHERE tl.creationDate <= v2Months;
DELETE t
FROM ticket t
JOIN tTicketDelete tmp ON tmp.ticketFk = t.id;
DELETE sl
FROM saleLabel sl
JOIN sale s ON s.id = sl.saleFk
JOIN ticket t ON t.id = s.ticketFk
WHERE t.shipped < v2Months;
-- Tickets Nulos PAK 11/10/2016
SELECT id INTO vCompanyBlk FROM company WHERE code = 'BLK';
UPDATE ticket
SET companyFk = vCompanyBlk
WHERE clientFk = (SELECT id FROM client WHERE name = 'AUTOCONSUMO')
AND companyFk <> vCompanyBlk;
DROP TEMPORARY TABLE tTicketDelete,
tThermographToDelete,
tEntryToDelete,
tDuaToDelete,
tRouteToDelete;
-- Other schemas
DELETE FROM hedera.`order` WHERE date_send < v18Months;
DELETE FROM pbx.cdr WHERE call_date < v18Months;
END$$
DELIMITER ;

View File

@ -48,7 +48,7 @@ BEGIN
SELECT lc.companyFk,
c.id,
0,
- (NZ(lc.credit) - NZ(lc.debit))
- (IFNULL(lc.credit, 0) - IFNULL(lc.debit, 0))
FROM tmp.ledgerComparative lc
JOIN client c ON c.accountingAccount = lc.account
WHERE lc.`date` BETWEEN vDateFrom AND vDateTo

View File

@ -39,7 +39,8 @@ BEGIN
FROM receipt r
JOIN `client` c ON c.id = r.clientFk
JOIN tmp.client tc ON tc.id = c.id
JOIN bank b ON r.bankFk = b.id AND b.code = 'mana'
JOIN accounting a ON r.bankFk = a.id
AND a.code = 'mana'
WHERE r.payed > vFromDated
AND r.payed <= util.VN_CURDATE()
UNION ALL

View File

@ -1,8 +1,8 @@
DELIMITER $$
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_assign`(
vUserFk INT,
OUT vCollectionFk INT
)
)
proc:BEGIN
/**
* Comprueba si existen colecciones libres que se ajustan
@ -84,5 +84,5 @@ proc:BEGIN
WHERE id = vCollectionFk;
DO RELEASE_LOCK('collection_assign');
END$$
DELIMITER ;
END$$
DELIMITER ;

View File

@ -47,12 +47,11 @@ BEGIN
JOIN itemCategory ic ON ic.id = tp.categoryFk
JOIN ticket t ON t.id = s.ticketFk
JOIN client c ON c.id = t.clientFk
JOIN clientType ct ON ct.id = c.clientTypeFk
JOIN warehouse w ON w.id = t.warehouseFk
JOIN address ad ON ad.id = t.addressFk
LEFT JOIN province p ON p.id = ad.provinceFk
WHERE tm.period BETWEEN vMaxPeriod AND vPeriod
AND ct.code <> 'loses'
AND c.typeFk <> 'loses'
AND NOT w.code = 'inv'
GROUP BY p.countryFk, s.itemFk, tm.period, t.warehouseFk;
END IF;

View File

@ -0,0 +1,103 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`confection_controlSource`(
vDated DATE,
vScopeDays INT,
vMaxAlertLevel INT,
vWarehouseFk INT
)
BEGIN
/**
* Obtiene la información para el control de confección,
* ya sean tickets y/o entradas.
*
* @param vDated Fecha a calcular
* @param vScopeDays Número de días desde hoy en adelante que entran en el cálculo.
* @param vMaxAlertLevel Id nivel de alerta
* @param vWarehouseFk Id de almacén
*/
DECLARE vEndingDate DATETIME DEFAULT util.dayEnd(vDated) + INTERVAL vScopeDays DAY;
SELECT t.shipped,
t.id ticketFk,
s.id saleFk,
s.quantity,
s.concept,
ABS(s.reserved) isReserved,
i.category,
it.name itemType,
t.nickname,
wh.name warehouse,
t.warehouseFk warehouseFk,
a.provinceFk,
am.agencyFk,
ct.description,
stock.visible,
stock.available
FROM ticket t
JOIN agencyMode am ON am.id = t.agencyModeFk
JOIN warehouse wh ON wh.id = t.warehouseFk
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk
JOIN itemType it ON it.id = i.typeFk
JOIN confectionType ct ON ct.id = it.making
JOIN `address` a on a.id = t.addressFk
LEFT JOIN ticketState tls on tls.ticketFk = t.id
LEFT JOIN
(
SELECT item_id,
SUM(visible) visible,
SUM(available) available
FROM (
SELECT a.item_id,
0 visible,
a.available
FROM cache.cache_calc cc
LEFT JOIN cache.available a ON a.calc_id = cc.id
WHERE cc.cache_id IN ('visible', 'available')
AND cc.params = CONCAT(vWarehouseFk, "/", util.VN_CURDATE())
UNION ALL
SELECT v.item_id,
v.visible,
0
FROM cache.cache_calc cc
LEFT JOIN cache.visible v ON v.calc_id = cc.id
WHERE cc.cacheName IN ('visible', 'available')
AND cc.params = vWarehouseFk
) sub
GROUP BY item_id
) stock ON stock.item_id = s.itemFk
WHERE it.making
AND tls.alertLevel < vMaxAlertLevel
AND wh.hasConfectionTeam
AND t.shipped BETWEEN vDated AND vEndingDate
AND s.quantity > 0
UNION ALL
SELECT tr.shipped,
e.id,
NULL,
b.quantity,
i.name,
NULL,
i.category,
NULL,
whi.name,
who.name,
NULL,
NULL,
NULL,
ct.description,
NULL,
NULL
FROM buy b
JOIN `entry` e ON e.id = b.entryFk
JOIN travel tr ON tr.id = e.travelFk
JOIN warehouse whi ON whi.id = tr.warehouseInFk
JOIN warehouse who ON who.id = tr.warehouseOutFk
JOIN item i ON i.id = b.itemFk
JOIN itemType it ON it.id = i.typeFk
JOIN confectionType ct ON ct.id = it.making
WHERE who.hasConfectionTeam
AND it.making
AND tr.shipped BETWEEN vDated AND vEndingDate;
END$$
DELIMITER ;

View File

@ -1,70 +1,74 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`duaInvoiceInBooking`(vDuaFk INT)
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 vInvoiceFk INT;
DECLARE vASIEN BIGINT DEFAULT 0;
DECLARE vCounter INT DEFAULT 0;
DECLARE vASIEN BIGINT DEFAULT 0;
DECLARE vCounter INT DEFAULT 0;
DECLARE rs CURSOR FOR
SELECT e.invoiceInFk
SELECT DISTINCT e.invoiceInFk
FROM entry e
JOIN duaEntry de ON de.entryFk = e.id
JOIN invoiceIn ii ON ii.id = e.invoiceInFk
WHERE de.duaFk = vDuaFk
JOIN invoiceIn ii ON ii.id = e.invoiceInFk
WHERE de.duaFk = vDuaFk
AND de.customsValue
AND ii.isBooked = FALSE;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN rs;
UPDATE invoiceIn ii
JOIN entry e ON e.invoiceInFk = ii.id
JOIN duaEntry de ON de.entryFk = e.id
JOIN dua d ON d.id = de.duaFk
JOIN duaEntry de ON de.entryFk = e.id
JOIN dua d ON d.id = de.duaFk
SET ii.isBooked = TRUE,
ii.booked = IFNULL(ii.booked,d.booked),
ii.operated = IFNULL(ii.operated,d.operated),
ii.issued = IFNULL(ii.issued,d.issued),
ii.bookEntried = IFNULL(ii.bookEntried,d.bookEntried),
e.isConfirmed = TRUE
ii.issued = IFNULL(ii.issued,d.issued),
ii.bookEntried = IFNULL(ii.bookEntried,d.bookEntried),
e.isConfirmed = TRUE
WHERE d.id = vDuaFk;
SELECT IFNULL(ASIEN,0) INTO vASIEN
SELECT IFNULL(ASIEN,0) INTO vASIEN
FROM dua
WHERE id = vDuaFk;
FETCH rs INTO vInvoiceFk;
WHILE NOT done DO
CALL invoiceIn_booking(vInvoiceFk);
IF vCounter > 0 OR vASIEN > 0 THEN
UPDATE vn.XDiario x
JOIN vn.ledgerConfig lc ON lc.lastBookEntry = x.ASIEN
SET x.ASIEN = vASIEN;
ELSE
SELECT lastBookEntry INTO vASIEN FROM vn.ledgerConfig;
IF vCounter > 0 OR vASIEN > 0 THEN
UPDATE XDiario x
JOIN ledgerConfig lc ON lc.lastBookEntry = x.ASIEN
SET x.ASIEN = vASIEN;
ELSE
SELECT lastBookEntry INTO vASIEN FROM ledgerConfig;
END IF;
SET vCounter = vCounter + 1;
SET vCounter = vCounter + 1;
FETCH rs INTO vInvoiceFk;
END WHILE;
CLOSE rs;
UPDATE dua
SET ASIEN = vASIEN
WHERE id = vDuaFk;
CLOSE rs;
UPDATE dua
SET ASIEN = vASIEN
WHERE id = vDuaFk;
END$$
DELIMITER ;

View File

@ -0,0 +1,206 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_getTransfer`(
vSelf INT
)
BEGIN
/**
* Retorna los artículos trasladables a partir de una entrada.
*
* @param vSelf Id de entrada
*/
DECLARE vDateShipped DATE;
DECLARE vDateLanded DATE;
DECLARE vWarehouseIn INT;
DECLARE vWarehouseOut INT;
DECLARE vCalcVisible INT;
DECLARE vInventoryDate DATE DEFAULT getInventoryDate();
SELECT shipped, landed, warehouseInFk, warehouseOutFk
INTO vDateShipped, vDateLanded, vWarehouseIn, vWarehouseOut
FROM travel t
JOIN entry e ON e.travelFk = t.id
WHERE e.id = vSelf;
CALL rate_getPrices(vDateShipped, vWarehouseIn);
-- Traslado en almacen origen
CREATE OR REPLACE TEMPORARY TABLE tBuy
(PRIMARY KEY (itemFk), INDEX(buyFk))
ENGINE = MEMORY
SELECT *
FROM (
SELECT b.itemFk, b.id buyFk
FROM buy b
JOIN entry e ON e.id = b.entryFk
JOIN travel t ON t.id = e.travelFk
WHERE t.landed BETWEEN vInventoryDate AND vDateShipped
AND NOT b.isIgnored
AND b.price2 >= 0
ORDER BY (vWarehouseOut = t.warehouseInFk) DESC, t.landed DESC
LIMIT 10000000000000000000
) sub
GROUP BY itemFk;
IF vDateShipped >= util.VN_CURDATE() THEN
CALL `cache`.visible_refresh(vCalcVisible, TRUE, vWarehouseOut);
CREATE OR REPLACE TEMPORARY TABLE tItem (
`itemFk` int(10) unsigned NOT NULL,
`visible` int(11) NOT NULL DEFAULT 0,
`available` int(11) NOT NULL DEFAULT 0,
`visibleLanding` int(11) NOT NULL DEFAULT 0,
`availableLanding` int(11) NOT NULL DEFAULT 0,
UNIQUE INDEX i USING HASH (itemFk)
) ENGINE = MEMORY;
INSERT INTO tItem(itemFk, visible)
SELECT item_id itemFk, visible
FROM `cache`.visible
WHERE calc_id = vCalcVisible
AND visible;
CALL `cache`.visible_refresh(vCalcVisible, TRUE, vWarehouseIn);
INSERT INTO tItem(itemFk, visibleLanding)
SELECT item_id, `visible`
FROM `cache`.`visible` v
WHERE v.calc_id = vCalcVisible
AND v.`visible`
ON DUPLICATE KEY UPDATE visibleLanding = v.`visible`;
CALL vn2008.availableTraslate(vWarehouseOut, vDateShipped, NULL);
INSERT INTO tItem(itemFk, available)
SELECT a.item_id, a.available
FROM vn2008.availableTraslate a
WHERE a.available
ON DUPLICATE KEY UPDATE available = a.available;
CALL vn2008.availableTraslate(vWarehouseIn, vDateLanded, vWarehouseOut);
INSERT INTO tItem(itemFk, availableLanding)
SELECT a.item_id, a.available
FROM vn2008.availableTraslate a
WHERE a.available
ON DUPLICATE KEY UPDATE availableLanding = a.available;
ELSE
CALL item_getStock(vWarehouseOut, vDateShipped, NULL);
CREATE OR REPLACE TEMPORARY TABLE tItem
(UNIQUE INDEX i USING HASH (itemFk))
ENGINE = MEMORY
SELECT itemFk,
`visible`,
available,
0 visibleLanding,
0 availableLanding
FROM tmp.itemList;
END IF;
CALL buyUltimateFromInterval(vWarehouseIn,vInventoryDate, vDateLanded);
CREATE OR REPLACE TEMPORARY TABLE tTransfer
ENGINE = MEMORY
SELECT it.code `type`,
it.categoryFk,
i.typeFk,
i.id itemFk,
i.name item,
i.`size`,
i.category,
i.inkFk,
o.code originCode,
b2.quantity,
i.stems,
CAST(ti.visible AS DECIMAL(10,0)) vis1,
CAST(ti.available AS DECIMAL(10,0)) ava1,
CAST(ti.visibleLanding AS DECIMAL(10,0)) vis2,
CAST(ti.availableLanding AS DECIMAL(10,0)) ava2,
COALESCE(b2.`grouping`, b.`grouping`) `grouping`,
COALESCE(b2.packing, b.packing) packing,
COALESCE(b3.groupingMode, b2.groupingMode, b.groupingMode) package,
IFNULL(p.name, s.nickname) productor,
TRUE tinta,
b.packagingFk,
b2.id buyFk,
b2.stickers,
b.ektFk,
it.workerFk,
pa.volume,
IFNULL(pa.width, 0) width,
IFNULL(pa.`depth`, 0) `depth`,
IFNULL(pa.height, 0) height,
IFNULL(b.buyingValue, 0) buyingValue,
IFNULL(b.comissionValue, 0) comissionValue,
IFNULL(b.freightValue, 0) freightValue,
am.m3,
e.commission,
pa.isPackageReturnable,
IFNULL(pa2.value, pa.value) `value`,
r.rate3 r3,
r.rate2 r2,
it.promo,
b.`grouping` groupingOrigin,
b.packing packingOrigin,
b.id buyFkOrigin,
pa.returnCost,
b.weight
FROM item i
JOIN tItem ti ON ti.itemFk = i.id
LEFT JOIN producer p ON p.id = i.producerFk
LEFT JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN origin o ON o.id = i.originFk
LEFT JOIN tBuy lb ON lb.itemFk = i.id
LEFT JOIN buy b ON b.id = lb.buyFk
LEFT JOIN packaging pa ON pa.id = b.packagingFk
LEFT JOIN entry e2 ON e2.id = b.entryFk
LEFT JOIN supplier s ON s.id = e2.supplierFk
LEFT JOIN entry e ON e.id = vSelf
LEFT JOIN travel tr ON tr.id = e.travelFk
LEFT JOIN agencyMode am ON am.id = tr.agencyModeFk
LEFT JOIN buy b2 ON b2.itemFk = i.id
AND b2.entryFk = vSelf
LEFT JOIN packaging pa2 ON pa2.id = b.packagingFk
LEFT JOIN tmp.rate r ON TRUE
LEFT JOIN tmp.buyUltimateFromInterval bufi ON bufi.itemFk = i.id
LEFT JOIN buy b3 ON b3.id = bufi.buyFk
WHERE ic.display
AND NOT e.isRaid
AND (ti.visible OR ti.available)
ORDER BY i.typeFk, i.name, i.id, i.size, i.category, o.name;
CREATE INDEX tIndex USING HASH ON tTransfer (itemFk);
SELECT *,
quantity - MOD(quantity , `grouping`) subQuantity,
MOD(quantity, `grouping`) soll,
ROUND((IF(volume > 0,volume, width * `depth` *
IF(height = 0, `size` + 10, height))) /
packing, 0) cm3,
buyingValue + comissionValue + freightValue cost,
@carriage := ROUND((IF(volume > 0, volume, width * `depth` *
IF(height = 0, `size` + 10, height))) *
m3 / 1000000 / Packing, 3) carriage,
@comission := ROUND((buyingValue + comissionValue + freightValue) *
commission / 100, 3) commission,
ROUND(@packaging := (returnCost + IF(isPackageReturnable, 0, value))
/ packing, 3) packaging,
@cost := IFNULL((buyingValue + comissionValue + freightValue), 0) +
IFNULL(@packaging, 0) +
IFNULL(@carriage, 0) +
IFNULL(@comission, 0) expense,
@rate3 := ROUND(@cost / ( (100 - r3 - promo) / 100), 2) rate3,
ROUND(@rate3 * (1 + ((r2 - r3)/100)), 2) rate2,
FALSE selected
FROM tTransfer;
DROP TEMPORARY TABLE IF EXISTS
tTransfer,
tItem,
tBuy,
tmp.buyUltimateFromInterval,
tmp.rate,
tmp.itemList;
END$$
DELIMITER ;

View File

@ -3,13 +3,13 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`getDayExpeditions`(
BEGIN
SELECT
e.expeditions_id as expeditionFk,
date_format(e.odbc_date,'%Y-%m-%d') as expeditionDate,
e.ticket_id as ticketFk,
e.id as expeditionFk,
date_format(e.created,'%Y-%m-%d') as expeditionDate,
e.ticketFk,
t.routeFk as routeFk
FROM vn2008.expeditions e
INNER JOIN vn.ticket t ON t.id = e.ticket_id
WHERE DATE(odbc_date) = util.VN_CURDATE();
FROM expedition e
INNER JOIN ticket t ON t.id = e.ticketFk
WHERE DATE(e.created) = util.VN_CURDATE();
END$$
DELIMITER ;

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

View File

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

View File

@ -1,32 +1,35 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTaxMakeByDua`(vDuaFk INT)
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 rs CURSOR FOR
SELECT invoiceInFk
FROM entry e
JOIN duaEntry de ON de.entryFk = e.id
WHERE de.duaFk = vDuaFk;
DECLARE vInvoices CURSOR FOR
SELECT DISTINCT invoiceInFk
FROM entry e
JOIN duaEntry de ON de.entryFk = e.id
WHERE de.duaFk = vDuaFk;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
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;
WHILE NOT done DO
IF vDone THEN
LEAVE l;
END IF;
CALL vn2008.recibidaIvaInsert(vInvoiceInFk);
CALL invoiceInDueDay_recalc(vInvoiceInFk);
FETCH rs INTO vInvoiceInFk;
END WHILE;
CLOSE rs;
END LOOP;
CLOSE vInvoices;
END$$
DELIMITER ;

View File

@ -8,6 +8,7 @@ BEGIN
*/
DECLARE vTaxRowLimit INT;
DECLARE vLines INT;
DECLARE vHasDistinctTransactions INT;
SELECT taxRowLimit INTO vTaxRowLimit FROM invoiceInConfig;
@ -18,6 +19,18 @@ BEGIN
IF vLines >= vTaxRowLimit THEN
CALL util.throw (CONCAT('The maximum number of lines is ', vTaxRowLimit));
END IF;
END IF;
SELECT COUNT(DISTINCT transactionTypeSageFk) INTO vHasDistinctTransactions
FROM invoiceIn ii
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
JOIN invoiceInSerial iis ON iis.code = ii.serial
WHERE ii.id = vInvoiceInFk
AND iis.taxAreaFk = 'CEE'
AND transactionTypeSageFk;
IF vHasDistinctTransactions > 1 THEN
CALL util.throw ('This invoice does not allow different types of transactions');
END IF;
END$$
DELIMITER ;

View File

@ -1,32 +1,35 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTax_getFromDua`(vDuaFk INT)
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 rs CURSOR FOR
SELECT invoiceInFk
DECLARE vInvoices CURSOR FOR
SELECT DISTINCT invoiceInFk
FROM entry e
JOIN duaEntry de ON de.entryFk = e.id
WHERE de.duaFk = vDuaFk;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
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;
WHILE NOT done DO
IF vDone THEN
LEAVE l;
END IF;
CALL invoiceInTax_getFromEntries(vInvoiceInFk);
CALL invoiceInDueDay_calculate(vInvoiceInFk);
FETCH rs INTO vInvoiceInFk;
END WHILE;
CLOSE rs;
END LOOP;
CLOSE vInvoices;
END$$
DELIMITER ;

View File

@ -1,13 +1,22 @@
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
DECLARE vRate DOUBLE DEFAULT 1;
DECLARE vDated DATE;
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
FROM referenceRate rr
JOIN invoiceIn ii ON ii.id = vId
JOIN invoiceIn ii ON ii.id = vInvoiceInFk
WHERE rr.dated <= ii.issued
AND rr.currencyFk = ii.currencyFk ;
@ -24,7 +33,7 @@ BEGIN
LIMIT 1;
DELETE FROM invoiceInTax
WHERE invoiceInFk = vId;
WHERE invoiceInFk = vInvoiceInFk;
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenseFk, foreignValue, taxTypeSageFk, transactionTypeSageFk)
SELECT ii.id,
@ -39,7 +48,7 @@ BEGIN
JOIN buy b ON b.entryFk = e.id
LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk
AND rr.dated = ii.issued
WHERE ii.id = vId
WHERE ii.id = vInvoiceInFk
HAVING taxableBase IS NOT NULL;
END$$
DELIMITER ;

View File

@ -50,31 +50,30 @@ BEGIN
) alb ON alb.itemFk = i.id
LEFT JOIN cache.stock v ON i.id = v.item_id AND v.warehouse_id = vWarehouseFk
LEFT JOIN (
SELECT item_id, CAST(sum(amount)AS DECIMAL(10,0)) as venta
FROM vn2008.item_out
WHERE dat BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY,vDaysInFuture , util.dayend(util.VN_CURDATE()))
AND warehouse_id = vWarehouseFk
GROUP BY item_id
SELECT itemFk item_id, CAST(sum(quantity)AS DECIMAL(10,0)) as venta
FROM itemTicketOut
WHERE shipped BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY,vDaysInFuture , util.dayend(util.VN_CURDATE()))
AND warehouseFk = vWarehouseFk
GROUP BY itemFk
) sale ON sale.item_id = i.id
LEFT JOIN (
SELECT item_id, CAST(sum(amount)AS DECIMAL(10,0)) as compra
FROM vn2008.item_entry_in
WHERE dat BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY,vDaysInFuture , util.dayend(util.VN_CURDATE()))
AND warehouse_id = vWarehouseFk
SELECT itemFk item_id, CAST(sum(quantity)AS DECIMAL(10,0)) as compra
FROM itemEntryIn
WHERE landed BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY,vDaysInFuture , util.dayend(util.VN_CURDATE()))
AND warehouseInFk = vWarehouseFk
AND isVirtualStock = FALSE
GROUP BY item_id
GROUP BY itemFk
) buy ON buy.item_id = i.id
LEFT JOIN (
SELECT item_id, CAST(sum(amount)AS DECIMAL(10,0)) as traslado
FROM vn2008.item_entry_out
WHERE dat BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY,vDaysInFuture , util.dayend(util.VN_CURDATE()))
AND warehouse_id = vWarehouseFk
GROUP BY item_id
SELECT itemFk item_id, CAST(sum(quantity)AS DECIMAL(10,0)) as traslado
FROM itemEntryOut
WHERE shipped BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY,vDaysInFuture , util.dayend(util.VN_CURDATE()))
AND warehouseOutFk = vWarehouseFk
GROUP BY itemFk
) mov ON mov.item_id = i.id
WHERE (v.amount OR fue.Fuentes OR alb.Albenfruit)
AND i.itemPackingTypeFk = 'H'
AND ic.shortLife
;
AND ic.shortLife;
END$$
DELIMITER ;

View File

@ -1,87 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemProposal`(vItemFk INT, vTicketFk INT,vShowType BOOL)
BEGIN
/**
* Propone articulos disponible ordenado, con la cantidad de veces usado y segun sus caracteristicas
*
* @param vItemFk item id
* @param vTicketFk ticket id
* @param vShowType mostrar tipos
*/
DECLARE vWarehouseFk INT;
DECLARE vShipped DATE;
DECLARE vCalcFk INT;
DECLARE vTypeFk INT;
DECLARE vTag1 VARCHAR(25);
DECLARE vTag5 VARCHAR(25);
DECLARE vTag6 VARCHAR(25);
DECLARE vTag7 VARCHAR(25);
DECLARE vTag8 VARCHAR(25);
DECLARE vValue1 VARCHAR(50);
DECLARE vValue5 VARCHAR(50);
DECLARE vValue6 VARCHAR(50);
DECLARE vValue7 VARCHAR(50);
DECLARE vValue8 VARCHAR(50);
SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped
FROM vn.ticket
WHERE id = vTicketFk;
SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value
INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1
FROM vn.item i
LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk
WHERE i.id = vItemFk;
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vShipped);
SELECT i.id itemFk,
i.longName,
i.subName,
i.tag5,
i.value5,
(i.value5 <=> vValue5 COLLATE utf8_general_ci) match5,
i.tag6,
i.value6,
(i.value6 <=> vValue6 COLLATE utf8_general_ci) match6,
i.tag7,
i.value7,
(i.value7 <=> vValue7 COLLATE utf8_general_ci) match7,
i.tag8,
i.value8,
(i.value8 <=> vValue8 COLLATE utf8_general_ci) match8,
a.available,
IFNULL(ip.counter,0) counter,
IF(b.groupingMode = 1, b.grouping, b.packing) as minQuantity,
iss.visible located
FROM item i
JOIN cache.available a ON a.item_id = i.id
LEFT JOIN itemProposal ip ON ip.mateFk = i.id AND ip.itemFk = vItemFk
LEFT JOIN itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
LEFT JOIN tag t1 ON t1.id = it1.tagFk
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 itemShelvingStock iss ON iss.itemFk = i.id AND iss.warehouseFk = vWarehouseFk
WHERE a.calc_id = vCalcFk
AND available > 0
AND IF(vShowType,i.typeFk = vTypeFk,true)
AND i.id != vItemFk
ORDER BY counter DESC,
(t1.name = vTag1 COLLATE utf8_general_ci) DESC,
(it1.value = vValue1 COLLATE utf8_general_ci) DESC,
(i.tag5 = vTag5 COLLATE utf8_general_ci) DESC,
(i.value5 = vValue5 COLLATE utf8_general_ci) DESC,
(i.tag6 = vTag6 COLLATE utf8_general_ci) DESC,
(i.value6 = vValue6 COLLATE utf8_general_ci) DESC,
(i.tag7 = vTag7 COLLATE utf8_general_ci) DESC,
(i.value7 = vValue7 COLLATE utf8_general_ci) DESC,
(i.tag8 = vTag8 COLLATE utf8_general_ci) DESC,
(i.value8 = vValue8 COLLATE utf8_general_ci) DESC;
END$$
DELIMITER ;

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

@ -1,76 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemProposal_beta`(vItemFk INT, vTicketFk INT)
BEGIN
DECLARE vWarehouseFk INT;
DECLARE vShipped DATE;
DECLARE vCalcFk INT;
DECLARE vTypeFk INT;
DECLARE vResultsMax INT DEFAULT 10;
DECLARE vTag1 VARCHAR(25);
DECLARE vTag5 VARCHAR(25);
DECLARE vTag6 VARCHAR(25);
DECLARE vTag7 VARCHAR(25);
DECLARE vTag8 VARCHAR(25);
DECLARE vValue1 VARCHAR(50);
DECLARE vValue5 VARCHAR(50);
DECLARE vValue6 VARCHAR(50);
DECLARE vValue7 VARCHAR(50);
DECLARE vValue8 VARCHAR(50);
SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped
FROM vn.ticket
WHERE id = vTicketFk;
SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value
INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1
FROM vn.item i
LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk
WHERE i.id = vItemFk;
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vShipped);
SELECT i.id itemFk,
i.longName,
i.subName,
i.tag5,
i.value5,
(i.value5 <=> vValue5 COLLATE utf8_general_ci) match5,
i.tag6,
i.value6,
(i.value6 <=> vValue6 COLLATE utf8_general_ci) match6,
i.tag7,
i.value7,
(i.value7 <=> vValue7 COLLATE utf8_general_ci) match7,
i.tag8,
i.value8,
(i.value8 <=> vValue8 COLLATE utf8_general_ci) match8,
a.available,
IFNULL(ip.counter,0) counter
FROM vn.item i
JOIN cache.available a ON a.item_id = i.id
LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id AND ip.itemFk = vItemFk
LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1
LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk
WHERE a.calc_id = vCalcFk
AND available > 0
AND i.typeFk = vTypeFk
AND i.id != vItemFk
ORDER BY counter DESC,
(t1.name = vTag1 COLLATE utf8_general_ci) DESC,
(it1.value = vValue1 COLLATE utf8_general_ci) DESC,
(i.tag5 = vTag5 COLLATE utf8_general_ci) DESC,
(i.value5 = vValue5 COLLATE utf8_general_ci) DESC,
(i.tag6 = vTag6 COLLATE utf8_general_ci) DESC,
(i.value6 = vValue6 COLLATE utf8_general_ci) DESC,
(i.tag7 = vTag7 COLLATE utf8_general_ci) DESC,
(i.value7 = vValue7 COLLATE utf8_general_ci) DESC,
(i.tag8 = vTag8 COLLATE utf8_general_ci) DESC,
(i.value8 = vValue8 COLLATE utf8_general_ci) DESC
LIMIT vResultsMax;
END$$
DELIMITER ;

View File

@ -143,12 +143,12 @@ proc:BEGIN
CREATE TEMPORARY TABLE tmp.itemOutTime
SELECT *,SUM(amount) quantity
FROM
(SELECT item_id itemFk,
amount,
(SELECT io.itemFk,
io.quantity amount,
IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) as hours,
IF(MINUTE(t.shipped), MINUTE(t.shipped), MINUTE(z.`hour`)) as minutes
FROM vn2008.item_out io
JOIN tmp.itemShelvingRadar isr ON isr.itemFk = io.item_id
FROM itemTicketOut io
JOIN tmp.itemShelvingRadar isr ON isr.itemFk = io.itemFk
JOIN vn.ticket t on t.id= io.ticketFk
JOIN vn.ticketState ts on ts.ticketFk = io.ticketFk
JOIN vn.state s ON s.id = ts.stateFk
@ -160,10 +160,10 @@ proc:BEGIN
) stPrevious ON `stPrevious`.`saleFk` = io.saleFk
WHERE t.warehouseFk = vWarehouseFk
AND s.isPicked = 0
AND NOT io.Reservado
AND NOT io.reserved
AND stPrevious.saleFk IS NULL
AND io.dat >= util.VN_CURDATE()
AND io.dat < util.VN_CURDATE() + INTERVAL 1 DAY
AND io.shipped >= util.VN_CURDATE()
AND io.shipped < util.VN_CURDATE() + INTERVAL 1 DAY
) sub
GROUP BY itemFk, hours, minutes;

Some files were not shown because too many files have changed in this diff Show More