Compare commits
307 Commits
194947dc9a
...
1d434da539
Author | SHA1 | Date |
---|---|---|
Robert Ferrús | 1d434da539 | |
Sergio De la torre | 1a2bda7e18 | |
Sergio De la torre | b4fe00a028 | |
Guillermo Bonet | b5f3753253 | |
Guillermo Bonet | 2a38249131 | |
Guillermo Bonet | 319bf314b3 | |
Sergio De la torre | 9d94259d67 | |
Sergio De la torre | 375b690063 | |
Guillermo Bonet | 819bc7a56d | |
Guillermo Bonet | adafab5847 | |
Guillermo Bonet | 552a1a33c2 | |
Guillermo Bonet | a34be6ca02 | |
Guillermo Bonet | 03e9f167a6 | |
Robert Ferrús | 4d1b02b793 | |
Robert Ferrús | 9910ae5c64 | |
Jorge Penadés | 47c7985233 | |
Jorge Penadés | e5387b0b65 | |
Jorge Penadés | 4e8e7d3f4b | |
Alex Moreno | 99fccd1cd2 | |
Alex Moreno | dcdad9c469 | |
Robert Ferrús | e7a6d0109c | |
Robert Ferrús | b6af349d89 | |
Robert Ferrús | b1e90fabb2 | |
Guillermo Bonet | 1027ef6479 | |
Javier Segarra | 82c9bd4ea7 | |
Robert Ferrús | 05b60150a0 | |
Robert Ferrús | cdb9f372cf | |
Jorge Penadés | 76c5595a58 | |
Javier Segarra | faeba92548 | |
Guillermo Bonet | 825818fc85 | |
Guillermo Bonet | 74c199384c | |
Guillermo Bonet | 2be79a708f | |
Javier Segarra | a8420cd650 | |
Javier Segarra | 238099311b | |
Guillermo Bonet | 37e8518242 | |
Jorge Penadés | ea18d3ef6f | |
Alex Moreno | 89c55d23a4 | |
Alex Moreno | 3df4d3c86b | |
David Domenech | b3115d2efd | |
Alex Moreno | 8cda12a9da | |
Alex Moreno | c2ecedca71 | |
David Domenech | 60c50337ff | |
David Domenech | 014914e1d9 | |
Jorge Penadés | 1e3967a4fe | |
Alex Moreno | 2f2aba1cc8 | |
Alex Moreno | dbbebbe73c | |
Alex Moreno | 951e0a7798 | |
Alex Moreno | 01cd2709cc | |
Alex Moreno | ed39ede6cc | |
Alex Moreno | a7662194b3 | |
Alex Moreno | f29212cb65 | |
Alex Moreno | fbdebad12c | |
Alex Moreno | 00355aba3a | |
Alex Moreno | 3bfaa97ddd | |
Alex Moreno | 62de03e630 | |
Alex Moreno | 463714de14 | |
Alex Moreno | 99c9ad77d2 | |
Alex Moreno | 06e4477a52 | |
Alex Moreno | 572a09f704 | |
Alex Moreno | 625abbb804 | |
Alex Moreno | b8f09f363f | |
Robert Ferrús | 1d684d171e | |
Alex Moreno | b9d1964d19 | |
Alex Moreno | 24d1f63003 | |
Robert Ferrús | bf9842d5fd | |
Alex Moreno | 4f68b336bc | |
Sergio De la torre | dd732297c4 | |
Alex Moreno | 702792ace0 | |
Alex Moreno | e127457ed6 | |
Alex Moreno | a59d45b28c | |
Alex Moreno | a8c2779ee7 | |
Guillermo Bonet | 134a8e43ab | |
Sergio De la torre | 69ad44c0bd | |
Guillermo Bonet | 39b4e5db28 | |
Guillermo Bonet | ee08502f33 | |
Guillermo Bonet | cd40bd47e5 | |
Robert Ferrús | 29926db45f | |
Carlos Andrés | f1654609df | |
Carlos Andrés | fc3c9332b3 | |
Sergio De la torre | 6df84b9840 | |
Sergio De la torre | dc6cfafd05 | |
Sergio De la torre | 28de7bd402 | |
Juan Ferrer | f63dfb9a46 | |
Carlos Andrés | c81749da78 | |
Alex Moreno | 9ab0228714 | |
Ivan Mas | 19cba0e72a | |
Ivan Mas | 492c6f4dd6 | |
Sergio De la torre | 49800a5cab | |
Sergio De la torre | 010f585ed4 | |
Jorge Penadés | 9c3facb072 | |
Robert Ferrús | 78c88eb783 | |
Robert Ferrús | 564a48dd92 | |
Jorge Penadés | 50a1d5b5ab | |
Guillermo Bonet | 094c00aabd | |
Ivan Mas | 3cb45dd57b | |
Jorge Penadés | 77f9012938 | |
Jorge Penadés | f600a99708 | |
Sergio De la torre | 5e6c4b21ba | |
Sergio De la torre | 922d106bbd | |
Alex Moreno | 4f3678d7df | |
Alex Moreno | 71744fc4c9 | |
Alex Moreno | 51829f32ed | |
Alex Moreno | 322042086e | |
Alex Moreno | 40cf16cd0a | |
Alex Moreno | 6bdce1cc5d | |
Alex Moreno | 362722dd46 | |
Alex Moreno | 237ffd60d0 | |
Alex Moreno | 37ddf35420 | |
Alex Moreno | e7683b009c | |
Alex Moreno | 8326bfa75c | |
Alex Moreno | f055293d8a | |
Alex Moreno | 8e612aaddc | |
Alex Moreno | 0d7a03f655 | |
Alex Moreno | 7ac4617f48 | |
Alex Moreno | b80f2e305f | |
Sergio De la torre | 34572112ec | |
Sergio De la torre | 2d5aae3b40 | |
Sergio De la torre | d397980efb | |
Guillermo Bonet | f601c12468 | |
Alex Moreno | e248f5d0e8 | |
Alex Moreno | 03b7628eba | |
Robert Ferrús | 9992a8b4ff | |
Sergio De la torre | cf181521d6 | |
Sergio De la torre | 726558d5a7 | |
Guillermo Bonet | 55ba315858 | |
Guillermo Bonet | e0732835d0 | |
Jorge Penadés | 0aa4add71b | |
Jorge Penadés | fc08adc064 | |
Guillermo Bonet | ab4d1a0437 | |
Guillermo Bonet | 619ac4e053 | |
Alex Moreno | 6db24580be | |
Alex Moreno | 40d91aeb28 | |
Robert Ferrús | c9b6cbf67b | |
Robert Ferrús | 5175c91b2d | |
Jorge Penadés | 9cff06ae3d | |
Jorge Penadés | 854a9b62af | |
Ivan Mas | bd5d88f5ef | |
Robert Ferrús | 31bd88e856 | |
Guillermo Bonet | 216f6f1db3 | |
Jorge Penadés | 026c3c80a4 | |
Jorge Penadés | 97f76c64ff | |
Robert Ferrús | 5e2f9dd3d0 | |
Robert Ferrús | 19f8d1bb81 | |
Robert Ferrús | 87799fbc64 | |
Jorge Penadés | 7d8d31022b | |
Jorge Penadés | 3caed386e9 | |
Jorge Penadés | 657430d28b | |
Jorge Penadés | d32668886b | |
Guillermo Bonet | a439d07245 | |
Guillermo Bonet | 3dd4d48557 | |
Jorge Penadés | 7b0bed209e | |
Jorge Penadés | 1927878184 | |
Guillermo Bonet | 5c8b4b17c6 | |
Jorge Penadés | c54c9ce913 | |
Guillermo Bonet | 01fb865a76 | |
Guillermo Bonet | f5f2179ac6 | |
Jorge Penadés | f95a4f3530 | |
Jorge Penadés | cbb7bd0028 | |
Jorge Penadés | b86110c898 | |
Jorge Penadés | c875abf5e3 | |
Sergio De la torre | 96abdd4630 | |
Alex Moreno | b1a8fcf968 | |
Jorge Penadés | 7fdfd4fcb4 | |
Jorge Penadés | 70c400c5f9 | |
Sergio De la torre | 08b109140d | |
Sergio De la torre | 131ae6b522 | |
Jorge Penadés | 9ce162da71 | |
Jorge Penadés | 55b490160b | |
Jorge Penadés | 072280cc9c | |
Jorge Penadés | 9b5823384a | |
Jorge Penadés | e9f7fbed86 | |
Jorge Penadés | d5a3413307 | |
Jorge Penadés | 8d1dea8a00 | |
Jorge Penadés | 030f42d03f | |
Jorge Penadés | 1767ce426a | |
Jorge Penadés | 89970e39d0 | |
Jorge Penadés | 63c615655b | |
Jorge Penadés | 2fb68e81c9 | |
Jorge Penadés | 4aeb88229d | |
Jorge Penadés | c2fffd1eda | |
Jorge Penadés | 33cca9bfe8 | |
Jorge Penadés | d1ea1aafff | |
Jorge Penadés | 8ad69a62b9 | |
Jorge Penadés | 2940c68516 | |
Jorge Penadés | 9f194f4f63 | |
Jorge Penadés | 75f6f89506 | |
Jorge Penadés | 21cf05ddd0 | |
Jorge Penadés | 9f9d953b86 | |
Jorge Penadés | bda23a2139 | |
Jorge Penadés | ec7a88c6dd | |
Jorge Penadés | e23bd0489d | |
Jorge Penadés | c4161eec97 | |
Jorge Penadés | 8f5a5d9cba | |
Jorge Penadés | 2c1b8bd9db | |
Jorge Penadés | 0f98de60a0 | |
Jorge Penadés | 2a6abffef9 | |
Jorge Penadés | e17fc91415 | |
Jorge Penadés | 88dfdb157f | |
Jorge Penadés | 293bbd3da3 | |
Jorge Penadés | 72e5050d93 | |
Jorge Penadés | e6335548ad | |
Jorge Penadés | 63fb3db8a1 | |
Jorge Penadés | 01340408c6 | |
Jorge Penadés | 02e38eb711 | |
Jorge Penadés | e527780622 | |
Jorge Penadés | e849f0b6e2 | |
Jorge Penadés | ae89d59bde | |
Jorge Penadés | 08dd37e9e4 | |
Jorge Penadés | 799237e14c | |
Jorge Penadés | dcf6232c14 | |
Jorge Penadés | efb8bc46c6 | |
Jorge Penadés | e3899b2cf7 | |
Jorge Penadés | 65e5c6dac5 | |
Jorge Penadés | ed713e762b | |
Jorge Penadés | f04724a61f | |
Jorge Penadés | 89d18e29f0 | |
Jorge Penadés | 6ee7ca79b7 | |
Jorge Penadés | f8faa958e6 | |
Jorge Penadés | d78e90687e | |
Jorge Penadés | 428da6fe00 | |
Jorge Penadés | 6e59a87f9c | |
Jorge Penadés | 817a6b1289 | |
Jorge Penadés | b7ce6cac9c | |
Jorge Penadés | 5c0425b942 | |
Jorge Penadés | 34420375cd | |
Jorge Penadés | b33594e0da | |
Jorge Penadés | 19edd7868e | |
Jorge Penadés | d41d57143f | |
Jorge Penadés | c8bfb35cf6 | |
Jorge Penadés | 6f35c62cd5 | |
Jorge Penadés | 8e5be5f5da | |
Jorge Penadés | c0398d17bf | |
Jorge Penadés | 6be2f07c22 | |
Jorge Penadés | 1fbb84ae9f | |
Jorge Penadés | bf13e85ecc | |
Jorge Penadés | e69ec2c856 | |
Jorge Penadés | 90b1e8d664 | |
Jorge Penadés | 6a78123fca | |
Jorge Penadés | 53a10dda58 | |
Jorge Penadés | 07e9b737c5 | |
Jorge Penadés | 2fbea6f9dd | |
Jorge Penadés | 4f7240b496 | |
Jorge Penadés | fafc25ed19 | |
Jorge Penadés | 9874c1414a | |
Jorge Penadés | 54192c54ad | |
Jorge Penadés | ddcecb8f22 | |
Jorge Penadés | c61f5a67b6 | |
Jorge Penadés | 7a9f2bd79c | |
Jorge Penadés | 9afc3840c7 | |
Jorge Penadés | ab1dc7af55 | |
Jorge Penadés | 8a5da43503 | |
Jorge Penadés | 7a64b57a2a | |
Jorge Penadés | ad89363db5 | |
Jorge Penadés | 2eca02d74f | |
Jorge Penadés | 3ebf0a30a9 | |
Jorge Penadés | da8057e4c7 | |
Jorge Penadés | 384d9ec803 | |
Jorge Penadés | e354de4ff5 | |
Jorge Penadés | 7d0c11e937 | |
Jorge Penadés | 6d0e1cc47c | |
Sergio De la torre | 141b549e5b | |
Sergio De la torre | 0b5ffcc81c | |
Jorge Penadés | bce8feb552 | |
Jorge Penadés | 924fe12a93 | |
Sergio De la torre | 365e05d560 | |
Jorge Penadés | 68ef193a19 | |
Jorge Penadés | 92b4908b35 | |
Jorge Penadés | 767894b128 | |
Jorge Penadés | 779cbd2c0a | |
Jorge Penadés | 5c22f51043 | |
Jorge Penadés | d70a3570d3 | |
Jorge Penadés | 1f2d475f05 | |
Jorge Penadés | 36a9b0eee4 | |
Jorge Penadés | 8d61473d4f | |
Jorge Penadés | a4c3d78e31 | |
Jorge Penadés | 64c10f3b8e | |
Jorge Penadés | 01fa0b1d36 | |
Jorge Penadés | 9e6fac9add | |
Jorge Penadés | 7b81630b85 | |
Jorge Penadés | f5ee3aff7a | |
Jorge Penadés | 3109f7722e | |
Jorge Penadés | 8acd03f115 | |
Jorge Penadés | e27bf2ef8b | |
Jorge Penadés | 1dfdd94584 | |
Jorge Penadés | 4690dca4f9 | |
Jorge Penadés | 660e77be55 | |
Jorge Penadés | 7e57640758 | |
Jorge Penadés | d2769f4c21 | |
Jorge Penadés | f2ab44bb8f | |
Jorge Penadés | 30b63f577f | |
Jorge Penadés | d5f09c2f75 | |
Jorge Penadés | 3333c83702 | |
Jorge Penadés | 40236fdb7b | |
Jorge Penadés | 25a0ffcfde | |
Jorge Penadés | 375cb1acc0 | |
Jorge Penadés | 0d558fb4f7 | |
Jorge Penadés | 27d223cbab | |
Jorge Penadés | 877c679273 | |
Jorge Penadés | 133fe1065a | |
Jorge Penadés | f862ed7d8a | |
Jorge Penadés | cf3b5efee9 | |
Jorge Penadés | a60a30128c | |
Jorge Penadés | fac6aab26c | |
Jorge Penadés | 40bbad04c9 | |
Jorge Penadés | 251578146e | |
Jorge Penadés | 67fa60ae81 | |
Jorge Penadés | d0975f0acd |
|
@ -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;
|
||||||
|
};
|
||||||
|
};
|
|
@ -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);
|
||||||
|
}
|
||||||
|
};
|
|
@ -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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
|
@ -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);
|
||||||
|
};
|
||||||
|
};
|
|
@ -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();
|
||||||
|
});
|
||||||
|
});
|
|
@ -13,10 +13,10 @@
|
||||||
"AuthCode": {
|
"AuthCode": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"Bank": {
|
"Accounting": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"Buyer": {
|
"Buyer": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"Campaign": {
|
"Campaign": {
|
||||||
|
@ -79,15 +79,24 @@
|
||||||
"Language": {
|
"Language": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"Machine": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"MachineWorker": {
|
"MachineWorker": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"MachineWorkerConfig": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"MobileAppVersionControl": {
|
"MobileAppVersionControl": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"Module": {
|
"Module": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"MrwConfig": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"Notification": {
|
"Notification": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
@ -160,10 +169,10 @@
|
||||||
"VnRole": {
|
"VnRole": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"MrwConfig": {
|
"WorkerActivity": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"WorkerActivityType": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "Bank",
|
"name": "Accounting",
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "bank"
|
"table": "accounting"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -22,10 +22,7 @@
|
||||||
},
|
},
|
||||||
"accountingTypeFk": {
|
"accountingTypeFk": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"required": true,
|
"required": true
|
||||||
"mysql": {
|
|
||||||
"columnName": "cash"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"entityFk": {
|
"entityFk": {
|
||||||
"type": "number",
|
"type": "number",
|
|
@ -3,4 +3,6 @@ module.exports = Self => {
|
||||||
require('../methods/collection/setSaleQuantity')(Self);
|
require('../methods/collection/setSaleQuantity')(Self);
|
||||||
require('../methods/collection/previousLabel')(Self);
|
require('../methods/collection/previousLabel')(Self);
|
||||||
require('../methods/collection/getTickets')(Self);
|
require('../methods/collection/getTickets')(Self);
|
||||||
|
require('../methods/collection/assign')(Self);
|
||||||
|
require('../methods/collection/getSales')(Self);
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"name": "MachineWorkerConfig",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "vn.machineWorkerConfig"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true
|
||||||
|
},
|
||||||
|
"maxHours": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
require('../methods/machine-worker/updateInTime')(Self);
|
||||||
|
};
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"name": "Machine",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "vn.machine"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true
|
||||||
|
},
|
||||||
|
"plate": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
require('../methods/mobile-app-version-control/getVersion')(Self);
|
||||||
|
};
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -47,7 +47,7 @@
|
||||||
},
|
},
|
||||||
"bank": {
|
"bank": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Bank",
|
"model": "Accounting",
|
||||||
"foreignKey": "bankFk"
|
"foreignKey": "bankFk"
|
||||||
},
|
},
|
||||||
"payMethod": {
|
"payMethod": {
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
"name": "WorkerActivity",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "workerActivity"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"id": true,
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"created": {
|
||||||
|
"type": "date"
|
||||||
|
},
|
||||||
|
"model": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"event": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"workerFk": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Worker",
|
||||||
|
"foreignKey": "workerFk"
|
||||||
|
},
|
||||||
|
"workerActivityTypeFk": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "WorkerActivityType",
|
||||||
|
"foreignKey": "workerActivityTypeFk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"name": "WorkerActivityType",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "workerActivityType"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"code": {
|
||||||
|
"id": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string",
|
||||||
|
"required": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ USE `util`;
|
||||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
|
||||||
INSERT INTO `version` VALUES ('vn-database','10889','03550573b07783c82b290df4ebaeb91c1030bc18','2024-02-23 09:55:56','10906');
|
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','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL);
|
||||||
INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL);
|
INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL);
|
||||||
|
@ -621,6 +621,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10835','32-definitivo.sql','jenk
|
||||||
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','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','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','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','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','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','00-roleLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||||
|
@ -650,6 +651,14 @@ INSERT INTO `versionLog` VALUES ('vn-database','10856','00-cloneAcl.sql','jenkin
|
||||||
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','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','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','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','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','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','00-createAclInvoiceIn.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-22 08:32:59',NULL,NULL);
|
||||||
|
@ -666,10 +675,37 @@ INSERT INTO `versionLog` VALUES ('vn-database','10879','00-firstScript.sql','jen
|
||||||
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','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','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','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','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','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','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','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 */;
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
@ -1029,6 +1065,7 @@ INSERT INTO `roleInherit` VALUES (357,36,35,NULL);
|
||||||
INSERT INTO `roleInherit` VALUES (358,36,49,NULL);
|
INSERT INTO `roleInherit` VALUES (358,36,49,NULL);
|
||||||
INSERT INTO `roleInherit` VALUES (359,129,35,NULL);
|
INSERT INTO `roleInherit` VALUES (359,129,35,NULL);
|
||||||
INSERT INTO `roleInherit` VALUES (360,101,129,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);
|
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
|
||||||
|
|
||||||
|
@ -1601,8 +1638,6 @@ INSERT INTO `ACL` VALUES (673,'InvoiceOut','makePdfAndNotify','WRITE','ALLOW','R
|
||||||
INSERT INTO `ACL` VALUES (674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing');
|
INSERT INTO `ACL` VALUES (674,'InvoiceOutConfig','*','READ','ALLOW','ROLE','invoicing');
|
||||||
INSERT INTO `ACL` VALUES (676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee');
|
INSERT INTO `ACL` VALUES (676,'Ticket','invoiceTickets','WRITE','ALLOW','ROLE','employee');
|
||||||
INSERT INTO `ACL` VALUES (680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee');
|
INSERT INTO `ACL` VALUES (680,'MailAliasAccount','*','READ','ALLOW','ROLE','employee');
|
||||||
INSERT INTO `ACL` VALUES (681,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee');
|
|
||||||
INSERT INTO `ACL` VALUES (682,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee');
|
|
||||||
INSERT INTO `ACL` VALUES (683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','developerBoss');
|
INSERT INTO `ACL` VALUES (683,'MailAliasAccount','canEditAlias','WRITE','ALLOW','ROLE','developerBoss');
|
||||||
INSERT INTO `ACL` VALUES (684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement');
|
INSERT INTO `ACL` VALUES (684,'WorkerDisableExcluded','*','READ','ALLOW','ROLE','itManagement');
|
||||||
INSERT INTO `ACL` VALUES (685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement');
|
INSERT INTO `ACL` VALUES (685,'WorkerDisableExcluded','*','WRITE','ALLOW','ROLE','itManagement');
|
||||||
|
@ -1715,6 +1750,9 @@ INSERT INTO `ACL` VALUES (794,'Supplier','updateFiscalData','WRITE','ALLOW','ROL
|
||||||
INSERT INTO `ACL` VALUES (795,'Ticket','myLastModified','*','ALLOW','ROLE','production');
|
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 (796,'MrwConfig','cancelShipment','WRITE','ALLOW','ROLE','employee');
|
||||||
INSERT INTO `ACL` VALUES (797,'MrwConfig','createShipment','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 (1,'Client','name','update','employee');
|
||||||
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
||||||
|
@ -2033,61 +2071,61 @@ INSERT INTO `continent` VALUES (3,'África','AF');
|
||||||
INSERT INTO `continent` VALUES (4,'Europa','EU');
|
INSERT INTO `continent` VALUES (4,'Europa','EU');
|
||||||
INSERT INTO `continent` VALUES (5,'Oceanía','OC');
|
INSERT INTO `continent` VALUES (5,'Oceanía','OC');
|
||||||
|
|
||||||
INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,110,763,0,0,0,0,27,NULL,'/',NULL,0,NULL,0,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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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 (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N',NULL);
|
||||||
INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL);
|
INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL);
|
||||||
|
|
|
@ -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 ('','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 ('','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 ('','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 `db` ENABLE KEYS */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `tables_priv` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `tables_priv` DISABLE KEYS */;
|
||||||
|
@ -374,10 +375,10 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas','ale
|
||||||
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','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','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','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','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','alexm@%','0000-00-00 00:00:00','Select','');
|
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','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','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','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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','business','alexm@%','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -409,7 +410,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceInInt
|
||||||
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 ('','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','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','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','Grupos','alexm@%','0000-00-00 00:00:00','Select','');
|
||||||
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','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 ('','vn','employee','continent','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -428,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 ('','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 ('','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 ('','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_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_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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','payroll_conceptos','alexm@%','0000-00-00 00:00:00','Select,Update','');
|
||||||
|
@ -765,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','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','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 ('','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','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','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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','vehicle','alexm@%','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -781,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 ('','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 ('','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','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 ('','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 ('','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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','config','alexm@%','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -897,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 ('','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 ('','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','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','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','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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ticketDocumentation','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||||
|
@ -993,6 +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','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','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 ('','vn','hr','workerDocument','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||||
|
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','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','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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','XDiario','alexm@%','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -1159,6 +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','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','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 ('','vn','grafana','deviceProductionLog','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
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','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','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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','machineDms','juan@10.5.1.1','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -1179,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','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 ('','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 ('','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','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','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','');
|
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','');
|
||||||
|
@ -1238,8 +1241,9 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','supplierDms'
|
||||||
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 ('','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','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 ('','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','cl_main','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
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 ('','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','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','');
|
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','Tickets_turno','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||||
|
@ -1353,6 +1357,11 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','edi','administrative','ektK3','jen
|
||||||
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','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 ('','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','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 `tables_priv` ENABLE KEYS */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
|
||||||
|
@ -1552,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','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','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','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 `columns_priv` ENABLE KEYS */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `procs_priv` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `procs_priv` DISABLE KEYS */;
|
||||||
|
@ -1713,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','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','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','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','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','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');
|
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','itemsale_byweek','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||||
|
@ -1987,7 +2029,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','delivery','{\"access\":0,\"version
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','deliveryAssistant','{\"access\":0,\"version_id\":101106,\"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 ('','deliveryBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','developer','{\"access\": 5909905728, \"is_role\": true, \"version_id\": 100707}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','developer','{\"access\": 5909905728, \"is_role\": true, \"version_id\": 100707}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','developerBoss','{\"access\":33554432,\"version_id\":100707,\"is_role\":true}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','developerBoss','{\"access\":33554432,\"version_id\":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 ('','employee','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','entryEditor','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','entryEditor','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','ext','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','ext','{\"access\": 0, \"is_role\": true, \"version_id\": 100707}');
|
||||||
|
@ -2006,7 +2048,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','itManagement','{\"access\":0,\"ver
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','itemPicker','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','itemPicker','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','logistic','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','logistic','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','logisticBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','logisticBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenance','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','maintenance','{\"access\":0,\"version_id\":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 ('','maintenanceBos','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||||
INSERT IGNORE INTO `global_priv` VALUES ('','manager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
INSERT IGNORE INTO `global_priv` VALUES ('','manager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4813,6 +4813,70 @@ DELIMITER ;
|
||||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
DELIMITER ;;
|
DELIMITER ;;
|
||||||
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`entryDms_beforeInsert`
|
||||||
|
BEFORE INSERT ON `entryDms`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END */;;
|
||||||
|
DELIMITER ;
|
||||||
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||||
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||||
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||||
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||||
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||||
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||||
|
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||||
|
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||||
|
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||||
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
|
DELIMITER ;;
|
||||||
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`entryDms_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `entryDms`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END */;;
|
||||||
|
DELIMITER ;
|
||||||
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||||
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||||
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||||
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||||
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||||
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||||
|
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||||
|
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||||
|
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||||
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
|
DELIMITER ;;
|
||||||
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`entryDms_afterDelete`
|
||||||
|
AFTER DELETE ON `entryDms`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO entryLog
|
||||||
|
SET `action` = 'delete',
|
||||||
|
`changedModel` = 'EntryDms',
|
||||||
|
`changedModelId` = OLD.entryFk,
|
||||||
|
`userFk` = account.myUser_getId();
|
||||||
|
END */;;
|
||||||
|
DELIMITER ;
|
||||||
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||||
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||||
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||||
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||||
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||||
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||||
|
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||||
|
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||||
|
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||||
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
|
DELIMITER ;;
|
||||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`entryObservation_beforeInsert`
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`entryObservation_beforeInsert`
|
||||||
BEFORE INSERT ON `entryObservation`
|
BEFORE INSERT ON `entryObservation`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
|
@ -5267,6 +5331,10 @@ BEGIN
|
||||||
DECLARE vActive TINYINT;
|
DECLARE vActive TINYINT;
|
||||||
DECLARE vWithholdingSageFk INT;
|
DECLARE vWithholdingSageFk INT;
|
||||||
|
|
||||||
|
IF NOT util.checkPrintableChars(NEW.supplierRef) THEN
|
||||||
|
CALL util.throw('The invoiceIn reference contains invalid characters');
|
||||||
|
END IF;
|
||||||
|
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
SELECT withholdingSageFk INTO vWithholdingSageFk
|
SELECT withholdingSageFk INTO vWithholdingSageFk
|
||||||
|
@ -5325,9 +5393,12 @@ DELIMITER ;;
|
||||||
BEFORE UPDATE ON `invoiceIn`
|
BEFORE UPDATE ON `invoiceIn`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
DECLARE vWithholdingSageFk INT;
|
DECLARE vWithholdingSageFk INT;
|
||||||
|
|
||||||
|
IF NOT (NEW.supplierRef <=> OLD.supplierRef) AND NOT util.checkPrintableChars(NEW.supplierRef) THEN
|
||||||
|
CALL util.throw('The invoiceIn reference contains invalid characters');
|
||||||
|
END IF;
|
||||||
|
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
IF (SELECT COUNT(*) FROM vn.invoiceIn
|
IF (SELECT COUNT(*) FROM vn.invoiceIn
|
||||||
|
@ -8044,6 +8115,26 @@ DELIMITER ;
|
||||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
DELIMITER ;;
|
DELIMITER ;;
|
||||||
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleLabel_afterUpdate`
|
||||||
|
AFTER UPDATE ON `vn`.`saleLabel`
|
||||||
|
FOR EACH ROW
|
||||||
|
IF NEW.stem >= (SELECT s.quantity FROM sale s WHERE s.id = NEW.saleFk) THEN
|
||||||
|
UPDATE sale s SET s.isPicked = TRUE WHERE s.id = NEW.saleFk;
|
||||||
|
END IF */;;
|
||||||
|
DELIMITER ;
|
||||||
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||||
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||||
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||||
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||||
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||||
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||||
|
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||||
|
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||||
|
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||||
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
|
DELIMITER ;;
|
||||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleTracking_afterInsert`
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleTracking_afterInsert`
|
||||||
AFTER INSERT ON `saleTracking`
|
AFTER INSERT ON `saleTracking`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
|
@ -8683,6 +8774,70 @@ DELIMITER ;
|
||||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
DELIMITER ;;
|
DELIMITER ;;
|
||||||
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierDms_beforeInsert`
|
||||||
|
BEFORE INSERT ON `supplierDms`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END */;;
|
||||||
|
DELIMITER ;
|
||||||
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||||
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||||
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||||
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||||
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||||
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||||
|
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||||
|
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||||
|
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||||
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
|
DELIMITER ;;
|
||||||
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierDms_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `supplierDms`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END */;;
|
||||||
|
DELIMITER ;
|
||||||
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||||
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||||
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||||
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||||
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||||
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||||
|
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||||
|
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||||
|
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||||
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
|
DELIMITER ;;
|
||||||
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplierDms_afterDelete`
|
||||||
|
AFTER DELETE ON `supplierDms`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO clientLog
|
||||||
|
SET `action` = 'delete',
|
||||||
|
`changedModel` = 'supplierDms',
|
||||||
|
`changedModelId` = OLD.dmsFk,
|
||||||
|
`userFk` = account.myUser_getId();
|
||||||
|
END */;;
|
||||||
|
DELIMITER ;
|
||||||
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||||
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||||
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||||
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||||
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||||
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||||
|
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||||
|
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||||
|
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||||
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||||
|
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||||
|
DELIMITER ;;
|
||||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`tag_beforeInsert`
|
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`tag_beforeInsert`
|
||||||
BEFORE INSERT ON `tag`
|
BEFORE INSERT ON `tag`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
|
@ -8780,7 +8935,6 @@ DELIMITER ;;
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE vNewTime TIME;
|
DECLARE vNewTime TIME;
|
||||||
DECLARE vHasTicketRefund BOOL;
|
|
||||||
|
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
|
@ -8840,15 +8994,6 @@ BEGIN
|
||||||
|
|
||||||
CALL vn.routeUpdateM3(NEW.routeFk);
|
CALL vn.routeUpdateM3(NEW.routeFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SELECT COUNT(*) INTO vHasTicketRefund
|
|
||||||
FROM ticketRefund
|
|
||||||
WHERE originalTicketFk = NEW.id
|
|
||||||
OR refundTicketFk = NEW.id;
|
|
||||||
|
|
||||||
IF vHasTicketRefund AND NEW.clientFk <> OLD.clientFk THEN
|
|
||||||
CALL util.throw('The ticket has a refund associated');
|
|
||||||
END IF;
|
|
||||||
END */;;
|
END */;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
@ -9877,6 +10022,8 @@ DELIMITER ;;
|
||||||
BEFORE UPDATE ON `travel`
|
BEFORE UPDATE ON `travel`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
|
DECLARE vHasAnyInvoiceBooked BOOL;
|
||||||
|
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
IF NOT (NEW.landed <=> OLD.landed)
|
IF NOT (NEW.landed <=> OLD.landed)
|
||||||
|
@ -9891,6 +10038,19 @@ BEGIN
|
||||||
IF NOT (NEW.warehouseInFk <=> OLD.warehouseInFk) THEN
|
IF NOT (NEW.warehouseInFk <=> OLD.warehouseInFk) THEN
|
||||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
IF NOT (NEW.awbFk <=> OLD.awbFk)THEN
|
||||||
|
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
||||||
|
FROM travel t
|
||||||
|
JOIN entry e ON e.travelFk = t.id
|
||||||
|
JOIN invoiceIn ii ON ii.id = e.invoiceInFk
|
||||||
|
WHERE t.id = NEW.id
|
||||||
|
AND ii.isBooked;
|
||||||
|
|
||||||
|
IF vHasAnyInvoiceBooked THEN
|
||||||
|
CALL util.throw('The travel has entries with booked invoices');
|
||||||
|
END IF;
|
||||||
|
END IF;
|
||||||
END */;;
|
END */;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||||
|
@ -10756,30 +10916,10 @@ DELIMITER ;
|
||||||
--
|
--
|
||||||
|
|
||||||
USE `vn2008`;
|
USE `vn2008`;
|
||||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
||||||
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
||||||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
|
||||||
/*!50003 SET character_set_client = utf8mb4 */ ;
|
|
||||||
/*!50003 SET character_set_results = utf8mb4 */ ;
|
|
||||||
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
|
||||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
|
||||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
|
||||||
DELIMITER ;;
|
|
||||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn2008`.`movement_label_afterUpdate`
|
|
||||||
AFTER UPDATE ON `movement_label`
|
|
||||||
FOR EACH ROW
|
|
||||||
IF NEW.stem >= (SELECT Cantidad FROM Movimientos WHERE Id_Movimiento = NEW.Id_Movimiento) THEN
|
|
||||||
UPDATE Movimientos SET OK = 1 WHERE Id_Movimiento = NEW.Id_Movimiento;
|
|
||||||
END IF */;;
|
|
||||||
DELIMITER ;
|
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
|
||||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
|
||||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
|
||||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
|
||||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2024-02-23 11:43:46
|
-- Dump completed on 2024-03-07 9:31:50
|
||||||
|
|
|
@ -1239,6 +1239,7 @@ INSERT INTO `vn`.`train`(`id`, `name`)
|
||||||
INSERT INTO `vn`.`operator` (`workerFk`, `numberOfWagons`, `trainFk`, `itemPackingTypeFk`, `warehouseFk`, `sectorFk`, `labelerFk`)
|
INSERT INTO `vn`.`operator` (`workerFk`, `numberOfWagons`, `trainFk`, `itemPackingTypeFk`, `warehouseFk`, `sectorFk`, `labelerFk`)
|
||||||
VALUES
|
VALUES
|
||||||
('1106', '1', '1', 'H', '1', '1', '1'),
|
('1106', '1', '1', 'H', '1', '1', '1'),
|
||||||
|
('9', '2', '1', 'H', '1', '1', '1'),
|
||||||
('1107', '1', '1', 'V', '1', '1', '1');
|
('1107', '1', '1', 'V', '1', '1', '1');
|
||||||
|
|
||||||
INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`)
|
INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`)
|
||||||
|
@ -2726,10 +2727,10 @@ INSERT INTO `vn`.`chat` (`senderFk`, `recipient`, `dated`, `checkUserStatus`, `m
|
||||||
(1101, '@PetterParker', util.VN_CURDATE(), 0, 'Second test message', 0, 'pending');
|
(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
|
VALUES
|
||||||
('delivery', '9.2', 0),
|
('delivery', '9.2', 0,'9.7'),
|
||||||
('warehouse', '8.1', 0);
|
('warehouse', '8.1', 0,'8.3');
|
||||||
|
|
||||||
INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`)
|
INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -3066,3 +3067,669 @@ INSERT INTO `vn`.`cmr` (id,truckPlate,observations,senderInstruccions,paymentIns
|
||||||
|
|
||||||
UPDATE vn.department
|
UPDATE vn.department
|
||||||
SET workerFk = null;
|
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);
|
|
@ -1,7 +1,7 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`rutasAnalyze`(
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`rutasAnalyze`(
|
||||||
vYear INT,
|
vDatedFrom DATE,
|
||||||
vMonth INT
|
vDatedTo DATE
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
|
@ -9,8 +9,7 @@ BEGIN
|
||||||
* y lo almacena en la tabla bi.rutasBoard
|
* y lo almacena en la tabla bi.rutasBoard
|
||||||
*/
|
*/
|
||||||
DELETE FROM rutasBoard
|
DELETE FROM rutasBoard
|
||||||
WHERE YEAR(Fecha) = vYear
|
WHERE Fecha BETWEEN vDatedFrom AND vDatedTo;
|
||||||
AND MONTH(Fecha) = vMonth;
|
|
||||||
|
|
||||||
-- Rellenamos la tabla con los datos de las rutas VOLUMETRICAS, especialmente con los bultos "virtuales"
|
-- Rellenamos la tabla con los datos de las rutas VOLUMETRICAS, especialmente con los bultos "virtuales"
|
||||||
INSERT INTO rutasBoard(
|
INSERT INTO rutasBoard(
|
||||||
|
@ -27,7 +26,7 @@ BEGIN
|
||||||
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
|
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
|
||||||
JOIN vn.saleVolume sv ON sv.ticketFk = t.id
|
JOIN vn.saleVolume sv ON sv.ticketFk = t.id
|
||||||
JOIN vn.expeditionBoxVol ebv ON ebv.code = 'transportBox'
|
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
|
AND z.isVolumetric
|
||||||
GROUP BY r.id;
|
GROUP BY r.id;
|
||||||
|
|
||||||
|
@ -44,8 +43,7 @@ BEGIN
|
||||||
FROM vn.route r
|
FROM vn.route r
|
||||||
JOIN vn.ticket t ON t.routeFk = r.id
|
JOIN vn.ticket t ON t.routeFk = r.id
|
||||||
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
|
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
|
||||||
WHERE YEAR(r.created) = vYear
|
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
|
||||||
AND MONTH(r.created) = vMonth
|
|
||||||
AND NOT z.isVolumetric
|
AND NOT z.isVolumetric
|
||||||
GROUP BY r.id
|
GROUP BY r.id
|
||||||
ON DUPLICATE KEY UPDATE Bultos = Bultos + VALUES(Bultos);
|
ON DUPLICATE KEY UPDATE Bultos = Bultos + VALUES(Bultos);
|
||||||
|
@ -56,15 +54,13 @@ BEGIN
|
||||||
SELECT t.routeFk,
|
SELECT t.routeFk,
|
||||||
SUM(s.quantity * sc.value) totalPractice
|
SUM(s.quantity * sc.value) totalPractice
|
||||||
FROM vn.route r
|
FROM vn.route r
|
||||||
JOIN vn.`time` tm ON tm.dated = r.created
|
|
||||||
JOIN vn.ticket t ON t.routeFk = r.id
|
JOIN vn.ticket t ON t.routeFk = r.id
|
||||||
JOIN vn.sale s ON s.ticketFk = t.id
|
JOIN vn.sale s ON s.ticketFk = t.id
|
||||||
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
||||||
JOIN vn.component c ON c.id = sc.componentFk
|
JOIN vn.component c ON c.id = sc.componentFk
|
||||||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||||
WHERE ct.code = 'FREIGHT'
|
WHERE ct.code = 'FREIGHT'
|
||||||
AND tm.`year` = vYear
|
AND r.created BETWEEN vDatedFrom AND vDatedTo
|
||||||
AND tm.`month` = vMonth
|
|
||||||
GROUP BY r.id
|
GROUP BY r.id
|
||||||
) sub ON sub.routeFk = r.Id_Ruta
|
) sub ON sub.routeFk = r.Id_Ruta
|
||||||
SET r.practico = IFNULL(sub.totalPractice / r.Bultos, 0);
|
SET r.practico = IFNULL(sub.totalPractice / r.Bultos, 0);
|
||||||
|
@ -76,14 +72,12 @@ BEGIN
|
||||||
SUM(t.zonePrice/ ebv.ratio) / COUNT(*) averageTheoreticalVolume
|
SUM(t.zonePrice/ ebv.ratio) / COUNT(*) averageTheoreticalVolume
|
||||||
FROM vn.ticket t
|
FROM vn.ticket t
|
||||||
JOIN vn.route r ON r.id = t.routeFk
|
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.expedition e ON e.ticketFk = t.id
|
||||||
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk
|
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk
|
||||||
JOIN vn.address ad ON ad.id = t.addressFk
|
JOIN vn.address ad ON ad.id = t.addressFk
|
||||||
JOIN vn.client c ON c.id = ad.clientFk
|
JOIN vn.client c ON c.id = ad.clientFk
|
||||||
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
|
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
|
||||||
WHERE tm.`year` = vYear
|
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
|
||||||
AND tm.`month` = vMonth
|
|
||||||
AND NOT z.isVolumetric
|
AND NOT z.isVolumetric
|
||||||
GROUP BY t.routeFk
|
GROUP BY t.routeFk
|
||||||
) sub ON r.Id_Ruta = sub.routeFk
|
) sub ON r.Id_Ruta = sub.routeFk
|
||||||
|
@ -96,12 +90,10 @@ BEGIN
|
||||||
SUM(freight) averageTheoreticalVolume
|
SUM(freight) averageTheoreticalVolume
|
||||||
FROM vn.ticket t
|
FROM vn.ticket t
|
||||||
JOIN vn.route r ON r.id = t.routeFk
|
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.saleVolume sf ON sf.ticketFk = t.id
|
||||||
JOIN vn.client c ON c.id = t.clientFk
|
JOIN vn.client c ON c.id = t.clientFk
|
||||||
JOIN vn.`zone` z ON z.id = t.zoneFk
|
JOIN vn.`zone` z ON z.id = t.zoneFk
|
||||||
WHERE tm.`year` = vYear
|
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
|
||||||
AND tm.`month` = vMonth
|
|
||||||
AND z.isVolumetric
|
AND z.isVolumetric
|
||||||
GROUP BY t.routeFk
|
GROUP BY t.routeFk
|
||||||
) sub ON r.Id_Ruta = sub.routeFk
|
) sub ON r.Id_Ruta = sub.routeFk
|
||||||
|
@ -114,11 +106,9 @@ BEGIN
|
||||||
SUM(g.amount) greuge
|
SUM(g.amount) greuge
|
||||||
FROM vn.ticket t
|
FROM vn.ticket t
|
||||||
JOIN vn.route r ON r.id = t.routeFk
|
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.greuge g ON g.ticketFk = t.id
|
||||||
JOIN vn.greugeType gt ON gt.id = g.greugeTypeFk
|
JOIN vn.greugeType gt ON gt.id = g.greugeTypeFk
|
||||||
WHERE tm.`year` = vYear
|
WHERE r.created BETWEEN vDatedFrom AND vDatedTo
|
||||||
AND tm.`month` = vMonth
|
|
||||||
AND gt.code = 'freightDifference'
|
AND gt.code = 'freightDifference'
|
||||||
GROUP BY t.routeFk
|
GROUP BY t.routeFk
|
||||||
) sub ON r.Id_Ruta = sub.routeFk
|
) sub ON r.Id_Ruta = sub.routeFk
|
||||||
|
|
|
@ -4,6 +4,6 @@ BEGIN
|
||||||
/**
|
/**
|
||||||
* Call rutasAnalyze
|
* Call rutasAnalyze
|
||||||
*/
|
*/
|
||||||
CALL rutasAnalyze(YEAR(util.VN_CURDATE()), MONTH(util.VN_CURDATE()));
|
CALL rutasAnalyze(util.VN_CURDATE() - INTERVAL 30 DAY , util.VN_CURDATE());
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -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`
|
|
||||||
)
|
|
||||||
)
|
|
|
@ -22,7 +22,7 @@ BEGIN
|
||||||
FROM vn.component WHERE code = 'manaClaim';
|
FROM vn.component WHERE code = 'manaClaim';
|
||||||
|
|
||||||
SELECT id INTO vManaBankId
|
SELECT id INTO vManaBankId
|
||||||
FROM vn.bank WHERE code = 'mana';
|
FROM vn.accounting WHERE code = 'mana';
|
||||||
|
|
||||||
SELECT id INTO vManaGreugeTypeId
|
SELECT id INTO vManaGreugeTypeId
|
||||||
FROM vn.greugeType WHERE code = 'mana';
|
FROM vn.greugeType WHERE code = 'mana';
|
||||||
|
|
|
@ -54,7 +54,7 @@ p: BEGIN
|
||||||
FROM vn.`client` WHERE id = vCustomer;
|
FROM vn.`client` WHERE id = vCustomer;
|
||||||
|
|
||||||
SELECT account INTO vAccount
|
SELECT account INTO vAccount
|
||||||
FROM vn.bank WHERE id = vBank;
|
FROM vn.accounting WHERE id = vBank;
|
||||||
|
|
||||||
DELETE FROM vn.XDiario
|
DELETE FROM vn.XDiario
|
||||||
WHERE SUBCTA = vSubaccount
|
WHERE SUBCTA = vSubaccount
|
||||||
|
|
|
@ -253,9 +253,9 @@ BEGIN
|
||||||
LIMIT 10000000000000000000
|
LIMIT 10000000000000000000
|
||||||
) sub GROUP BY ASIEN
|
) sub GROUP BY ASIEN
|
||||||
)sub2 ON sub2.ASIEN = x.ASIEN
|
)sub2 ON sub2.ASIEN = x.ASIEN
|
||||||
LEFT JOIN ( SELECT DISTINCT(account),cu.code
|
LEFT JOIN ( SELECT DISTINCT(a.account),cu.code
|
||||||
FROM vn.bank b
|
FROM vn.accounting a
|
||||||
JOIN vn.currency cu ON cu.id = b.currencyFk
|
JOIN vn.currency cu ON cu.id = a.currencyFk
|
||||||
WHERE cu.code <> 'EUR' -- no se informa cuando la divisa en EUR
|
WHERE cu.code <> 'EUR' -- no se informa cuando la divisa en EUR
|
||||||
)sub3 ON sub3.account = x.SUBCTA
|
)sub3 ON sub3.account = x.SUBCTA
|
||||||
WHERE x.enlazadoSage = FALSE
|
WHERE x.enlazadoSage = FALSE
|
||||||
|
|
|
@ -17,15 +17,15 @@ BEGIN
|
||||||
e.id accountFk,
|
e.id accountFk,
|
||||||
UCASE(e.name),
|
UCASE(e.name),
|
||||||
''
|
''
|
||||||
FROM vn.expense e
|
FROM expense e
|
||||||
UNION
|
UNION
|
||||||
SELECT company_getCode(vCompanyFk),
|
SELECT company_getCode(vCompanyFk),
|
||||||
b.account,
|
a.account,
|
||||||
UCASE(b.bank),
|
UCASE(a.bank),
|
||||||
''
|
''
|
||||||
FROM vn.bank b
|
FROM accounting a
|
||||||
WHERE b.isActive
|
WHERE a.isActive
|
||||||
AND b.`account`
|
AND a.`account`
|
||||||
UNION
|
UNION
|
||||||
SELECT CodigoEmpresa,
|
SELECT CodigoEmpresa,
|
||||||
CodigoCuenta,
|
CodigoCuenta,
|
||||||
|
|
|
@ -34,7 +34,7 @@ BEGIN
|
||||||
-- Inserta los asientos contables
|
-- Inserta los asientos contables
|
||||||
|
|
||||||
SELECT account INTO vAccount
|
SELECT account INTO vAccount
|
||||||
FROM bank WHERE id = vBank;
|
FROM accounting WHERE id = vBank;
|
||||||
|
|
||||||
SELECT accountingAccount INTO vSubaccount
|
SELECT accountingAccount INTO vSubaccount
|
||||||
FROM `client` WHERE id = vClient;
|
FROM `client` WHERE id = vClient;
|
||||||
|
|
|
@ -10,13 +10,11 @@ BEGIN
|
||||||
INSERT INTO mail (receiver,replyTo,subject,body)
|
INSERT INTO mail (receiver,replyTo,subject,body)
|
||||||
SELECT 'administracion@verdnatura.es' receiver,
|
SELECT 'administracion@verdnatura.es' receiver,
|
||||||
'noreply@verdnatura.es' replyTo,
|
'noreply@verdnatura.es' replyTo,
|
||||||
CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') subject,
|
CONCAT('El seguro de la poliza ',a.id,' ',a.bank,' ha finalizado.') subject,
|
||||||
CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') body
|
CONCAT('El seguro de la poliza ',a.id,' ',a.bank,' ha finalizado.') body
|
||||||
FROM vn.bankPolicy bp
|
FROM bankPolicy bp
|
||||||
LEFT JOIN vn.supplier s
|
LEFT JOIN supplier s ON s.id = bp.supplierFk
|
||||||
ON s.id = bp.supplierFk
|
LEFT JOIN accounting a ON a.id = bp.accountingFk
|
||||||
LEFT JOIN vn.bank b
|
|
||||||
ON b.id = bp.accountingFk
|
|
||||||
WHERE bp.insuranceExpired = util.VN_CURDATE();
|
WHERE bp.insuranceExpired = util.VN_CURDATE();
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -39,11 +39,11 @@ BEGIN
|
||||||
WHERE t.landed BETWEEN vStarted AND vEnded
|
WHERE t.landed BETWEEN vStarted AND vEnded
|
||||||
AND (vWarehouseFk IS NULL OR t.warehouseInFk = vWarehouseFk)
|
AND (vWarehouseFk IS NULL OR t.warehouseInFk = vWarehouseFk)
|
||||||
AND b.price2 > 0
|
AND b.price2 > 0
|
||||||
AND b.quantity > 0
|
|
||||||
ORDER BY NOT b.isIgnored DESC, t.landed DESC, b.id DESC
|
ORDER BY NOT b.isIgnored DESC, t.landed DESC, b.id DESC
|
||||||
LIMIT 10000000000000000000) sub
|
LIMIT 10000000000000000000) sub
|
||||||
GROUP BY itemFk, warehouseFk;
|
GROUP BY itemFk, warehouseFk;
|
||||||
|
|
||||||
|
|
||||||
INSERT IGNORE INTO tmp.buyUltimateFromInterval(itemFk, warehouseFk, buyFk, landed, isIgnored)
|
INSERT IGNORE INTO tmp.buyUltimateFromInterval(itemFk, warehouseFk, buyFk, landed, isIgnored)
|
||||||
SELECT
|
SELECT
|
||||||
b.itemFk,
|
b.itemFk,
|
||||||
|
|
|
@ -188,15 +188,23 @@ BEGIN
|
||||||
SELECT MAX(tl.id)ids
|
SELECT MAX(tl.id)ids
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN ticketLog tl ON tl.originFk = t.id
|
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'
|
WHERE t.shipped BETWEEN '2000-01-01' AND '2000-12-31'
|
||||||
AND t.isDeleted
|
AND t.isDeleted
|
||||||
|
AND tw.ticketFk IS NULL
|
||||||
GROUP BY t.id
|
GROUP BY t.id
|
||||||
) sub ON sub.ids = tl.id
|
) sub ON sub.ids = tl.id
|
||||||
WHERE tl.creationDate <= util.VN_CURDATE() - INTERVAL 60 DAY;
|
WHERE tl.creationDate <= v2Months;
|
||||||
DELETE t
|
DELETE t
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN tTicketDelete tmp ON tmp.ticketFk = t.id;
|
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
|
-- Tickets Nulos PAK 11/10/2016
|
||||||
SELECT id INTO vCompanyBlk FROM company WHERE code = 'BLK';
|
SELECT id INTO vCompanyBlk FROM company WHERE code = 'BLK';
|
||||||
UPDATE ticket
|
UPDATE ticket
|
||||||
|
|
|
@ -39,7 +39,8 @@ BEGIN
|
||||||
FROM receipt r
|
FROM receipt r
|
||||||
JOIN `client` c ON c.id = r.clientFk
|
JOIN `client` c ON c.id = r.clientFk
|
||||||
JOIN tmp.client tc ON tc.id = c.id
|
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
|
WHERE r.payed > vFromDated
|
||||||
AND r.payed <= util.VN_CURDATE()
|
AND r.payed <= util.VN_CURDATE()
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
|
@ -30,10 +30,11 @@ BEGIN
|
||||||
ish.visible,
|
ish.visible,
|
||||||
p.sectorFk,
|
p.sectorFk,
|
||||||
it.workerFk buyer,
|
it.workerFk buyer,
|
||||||
CONCAT('http:',ic.url, '/catalog/1600x900/',i.image) urlImage,
|
ic.url,
|
||||||
|
i.image,
|
||||||
ish.isChecked,
|
ish.isChecked,
|
||||||
CASE
|
CASE
|
||||||
WHEN s.notPrepared > sm.parked THEN 0
|
WHEN IFNULL (s.notPrepared, 0) > sm.parked THEN 0
|
||||||
WHEN sm.visible > sm.parked THEN 1
|
WHEN sm.visible > sm.parked THEN 1
|
||||||
ELSE 2
|
ELSE 2
|
||||||
END priority
|
END priority
|
||||||
|
@ -43,7 +44,7 @@ BEGIN
|
||||||
JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk
|
JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk
|
||||||
JOIN shelving sh ON sh.code = ish.shelvingFk
|
JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||||
JOIN parking p ON p.id = sh.parkingFk
|
JOIN parking p ON p.id = sh.parkingFk
|
||||||
JOIN (
|
LEFT JOIN (
|
||||||
SELECT s.itemFk, sum(s.quantity) notPrepared
|
SELECT s.itemFk, sum(s.quantity) notPrepared
|
||||||
FROM sale s
|
FROM sale s
|
||||||
JOIN ticket t ON t.id = s.ticketFk
|
JOIN ticket t ON t.id = s.ticketFk
|
||||||
|
|
|
@ -19,93 +19,74 @@ BEGIN
|
||||||
DECLARE vTypeFk INT;
|
DECLARE vTypeFk INT;
|
||||||
DECLARE vPriority INT DEFAULT 1;
|
DECLARE vPriority INT DEFAULT 1;
|
||||||
|
|
||||||
DECLARE vTag1 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vTag5 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vTag6 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vTag7 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vTag8 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
|
|
||||||
DECLARE vValue1 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vValue5 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vValue6 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vValue7 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
DECLARE vValue8 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
|
|
||||||
|
|
||||||
SELECT typeFk,
|
|
||||||
tag5,
|
|
||||||
value5,
|
|
||||||
tag6,
|
|
||||||
value6,
|
|
||||||
tag7,
|
|
||||||
value7,
|
|
||||||
tag8,
|
|
||||||
value8,
|
|
||||||
t.name,
|
|
||||||
it.value
|
|
||||||
INTO vTypeFk,
|
|
||||||
vTag5,
|
|
||||||
vValue5,
|
|
||||||
vTag6,
|
|
||||||
vValue6,
|
|
||||||
vTag7,
|
|
||||||
vValue7,
|
|
||||||
vTag8,
|
|
||||||
vValue8,
|
|
||||||
vTag1,
|
|
||||||
vValue1
|
|
||||||
FROM item i
|
|
||||||
LEFT JOIN itemTag it ON it.itemFk = i.id
|
|
||||||
AND it.priority = vPriority
|
|
||||||
LEFT JOIN tag t ON t.id = it.tagFk
|
|
||||||
WHERE i.id = vSelf;
|
|
||||||
|
|
||||||
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated);
|
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated);
|
||||||
|
|
||||||
|
|
||||||
|
WITH itemTags AS (
|
||||||
|
SELECT i.id,
|
||||||
|
typeFk,
|
||||||
|
tag5,
|
||||||
|
value5,
|
||||||
|
tag6,
|
||||||
|
value6,
|
||||||
|
tag7,
|
||||||
|
value7,
|
||||||
|
tag8,
|
||||||
|
value8,
|
||||||
|
t.name,
|
||||||
|
it.value
|
||||||
|
FROM vn.item i
|
||||||
|
LEFT JOIN vn.itemTag it ON it.itemFk = i.id
|
||||||
|
AND it.priority = vPriority
|
||||||
|
LEFT JOIN vn.tag t ON t.id = it.tagFk
|
||||||
|
WHERE i.id = vSelf
|
||||||
|
)
|
||||||
SELECT i.id itemFk,
|
SELECT i.id itemFk,
|
||||||
i.longName,
|
i.longName,
|
||||||
i.subName,
|
i.subName,
|
||||||
i.tag5,
|
i.tag5,
|
||||||
i.value5,
|
i.value5,
|
||||||
(i.value5 <=> vValue5) match5,
|
(i.value5 <=> its.value5) match5,
|
||||||
i.tag6,
|
i.tag6,
|
||||||
i.value6,
|
i.value6,
|
||||||
(i.value6 <=> vValue6) match6,
|
(i.value6 <=> its.value6) match6,
|
||||||
i.tag7,
|
i.tag7,
|
||||||
i.value7,
|
i.value7,
|
||||||
(i.value7 <=> vValue7) match7,
|
(i.value7 <=> its.value7) match7,
|
||||||
i.tag8,
|
i.tag8,
|
||||||
i.value8,
|
i.value8,
|
||||||
(i.value8 <=> vValue8) match8,
|
(i.value8 <=> its.value8) match8,
|
||||||
a.available,
|
a.available,
|
||||||
IFNULL(ip.counter, 0) `counter`,
|
IFNULL(ip.counter, 0) `counter`,
|
||||||
IF(b.groupingMode = 1, b.grouping, b.packing) minQuantity,
|
IF(b.groupingMode = 1, b.grouping, b.packing) minQuantity,
|
||||||
iss.visible located
|
iss.visible located
|
||||||
FROM item i
|
FROM vn.item i
|
||||||
JOIN cache.available a ON a.item_id = i.id
|
JOIN cache.available a ON a.item_id = i.id
|
||||||
LEFT JOIN itemProposal ip ON ip.mateFk = i.id
|
AND a.calc_id = vCalcFk
|
||||||
|
LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id
|
||||||
AND ip.itemFk = vSelf
|
AND ip.itemFk = vSelf
|
||||||
LEFT JOIN itemTag it ON it.itemFk = i.id
|
LEFT JOIN vn.itemTag it ON it.itemFk = i.id
|
||||||
AND it.priority = vPriority
|
AND it.priority = vPriority
|
||||||
LEFT JOIN tag t ON t.id = it.tagFk
|
LEFT JOIN vn.tag t ON t.id = it.tagFk
|
||||||
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id
|
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id
|
||||||
AND lb.warehouse_id = vWarehouseFk
|
AND lb.warehouse_id = vWarehouseFk
|
||||||
LEFT JOIN buy b ON b.id = lb.buy_id
|
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
||||||
LEFT JOIN itemShelvingStock iss ON iss.itemFk = i.id
|
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id
|
||||||
AND iss.warehouseFk = vWarehouseFk
|
AND iss.warehouseFk = vWarehouseFk
|
||||||
WHERE a.calc_id = vCalcFk
|
JOIN itemTags its
|
||||||
AND a.available > 0
|
WHERE a.available > 0
|
||||||
AND IF(vShowType, i.typeFk = vTypeFk, TRUE)
|
AND IF(vShowType, i.typeFk = its.typeFk, TRUE)
|
||||||
AND i.id <> vSelf
|
AND i.id <> vSelf
|
||||||
ORDER BY `counter` DESC,
|
ORDER BY `counter` DESC,
|
||||||
(t.name = vTag1) DESC,
|
(t.name = its.name) DESC,
|
||||||
(it.value = vValue1) DESC,
|
(it.value = its.value) DESC,
|
||||||
(i.tag5 = vTag5) DESC,
|
(i.tag5 = its.tag5) DESC,
|
||||||
match5 DESC,
|
match5 DESC,
|
||||||
(i.tag6 = vTag6) DESC,
|
(i.tag6 = its.tag6) DESC,
|
||||||
match6 DESC,
|
match6 DESC,
|
||||||
(i.tag7 = vTag7) DESC,
|
(i.tag7 = its.tag7) DESC,
|
||||||
match7 DESC,
|
match7 DESC,
|
||||||
(i.tag8 = vTag8) DESC,
|
(i.tag8 = its.tag8) DESC,
|
||||||
match8 DESC;
|
match8 DESC;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -79,7 +79,10 @@ DECLARE vIsCollection BOOL;
|
||||||
IF(SUM(iss.quantity) IS NULL, 0, SUM(iss.quantity)) pickedQuantity,
|
IF(SUM(iss.quantity) IS NULL, 0, SUM(iss.quantity)) pickedQuantity,
|
||||||
MIN(iss.created) picked,
|
MIN(iss.created) picked,
|
||||||
IF(sm.id, TRUE, FALSE) hasMistake,
|
IF(sm.id, TRUE, FALSE) hasMistake,
|
||||||
sg.sectorFk
|
sg.sectorFk,
|
||||||
|
b.packing,
|
||||||
|
b.grouping,
|
||||||
|
o.code
|
||||||
FROM tmp.ticket t
|
FROM tmp.ticket t
|
||||||
JOIN sale s ON s.ticketFk = t.id
|
JOIN sale s ON s.ticketFk = t.id
|
||||||
JOIN ticket tt ON tt.id = t.id
|
JOIN ticket tt ON tt.id = t.id
|
||||||
|
|
|
@ -94,7 +94,7 @@ BEGIN
|
||||||
'payment'
|
'payment'
|
||||||
FROM payment p
|
FROM payment p
|
||||||
LEFT JOIN currency c ON c.id = p.currencyFk
|
LEFT JOIN currency c ON c.id = p.currencyFk
|
||||||
LEFT JOIN bank b ON b.id = p.bankFk
|
LEFT JOIN accounting a ON a.id = p.bankFk
|
||||||
LEFT JOIN payMethod pm ON pm.id = p.payMethodFk
|
LEFT JOIN payMethod pm ON pm.id = p.payMethodFk
|
||||||
LEFT JOIN promissoryNote pn ON pn.paymentFk = p.id
|
LEFT JOIN promissoryNote pn ON pn.paymentFk = p.id
|
||||||
WHERE p.received > '2014-12-31'
|
WHERE p.received > '2014-12-31'
|
||||||
|
|
|
@ -18,7 +18,8 @@ BEGIN
|
||||||
WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered'))
|
WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered'))
|
||||||
AND t.id = vTicketFk
|
AND t.id = vTicketFk
|
||||||
AND t.refFk IS NULL
|
AND t.refFk IS NULL
|
||||||
GROUP BY t.id);
|
GROUP BY t.id
|
||||||
|
);
|
||||||
|
|
||||||
CALL ticket_close();
|
CALL ticket_close();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`parking_afterDelete`
|
||||||
|
AFTER DELETE ON `parking`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO parkingLog
|
||||||
|
SET `action` = 'delete',
|
||||||
|
`changedModel` = 'Parking',
|
||||||
|
`changedModelId` = OLD.id,
|
||||||
|
`userFk` = account.myUser_getId();
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`parking_beforeInsert`
|
||||||
BEFORE INSERT ON `parking`
|
BEFORE INSERT ON `parking`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
-- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ;
|
-- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`parking_beforeUpdate`
|
||||||
BEFORE UPDATE ON `parking`
|
BEFORE UPDATE ON `parking`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
-- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ;
|
-- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -10,21 +10,21 @@ BEGIN
|
||||||
|
|
||||||
-- PAK 10/02/15 No se asientan los pagos directamente, salvo en el caso de las cajas de CASH
|
-- PAK 10/02/15 No se asientan los pagos directamente, salvo en el caso de las cajas de CASH
|
||||||
SELECT (at2.code = 'cash') INTO bolCASH
|
SELECT (at2.code = 'cash') INTO bolCASH
|
||||||
FROM vn.bank b
|
FROM accounting a
|
||||||
JOIN vn.accountingType at2 ON at2.id = b.cash
|
JOIN accountingType at2 ON at2.id = a.accountingTypeFk
|
||||||
WHERE b.id = NEW.bankFk;
|
WHERE a.id = NEW.bankFk;
|
||||||
|
|
||||||
IF bolCASH THEN
|
IF bolCASH THEN
|
||||||
|
|
||||||
SELECT account INTO cuenta_banco
|
SELECT account INTO cuenta_banco
|
||||||
FROM bank
|
FROM accounting
|
||||||
WHERE id = NEW.bankFk;
|
WHERE id = NEW.bankFk;
|
||||||
|
|
||||||
SELECT account INTO cuenta_proveedor
|
SELECT account INTO cuenta_proveedor
|
||||||
FROM supplier
|
FROM supplier
|
||||||
WHERE id = NEW.supplierFk;
|
WHERE id = NEW.supplierFk;
|
||||||
|
|
||||||
CALL vn.ledger_next(vNewBookEntry);
|
CALL ledger_next(vNewBookEntry);
|
||||||
|
|
||||||
INSERT INTO XDiario ( ASIEN,
|
INSERT INTO XDiario ( ASIEN,
|
||||||
FECHA,
|
FECHA,
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`bank`
|
|
||||||
AS SELECT `a`.`id` AS `id`,
|
|
||||||
`a`.`bank` AS `bank`,
|
|
||||||
`a`.`account` AS `account`,
|
|
||||||
`a`.`accountingTypeFk` AS `cash`,
|
|
||||||
`a`.`entityFk` AS `entityFk`,
|
|
||||||
`a`.`isActive` AS `isActive`,
|
|
||||||
`a`.`currencyFk` AS `currencyFk`,
|
|
||||||
`a`.`code` AS `code`
|
|
||||||
FROM `vn`.`accounting` `a`
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
|
SQL SECURITY DEFINER
|
||||||
|
VIEW `vn`.`exchangeInsuranceInPrevious`
|
||||||
|
AS SELECT `ei`.`dueDated` AS `dated`,
|
||||||
|
`ei`.`amount` AS `amount`,
|
||||||
|
`ei`.`rate` AS `rate`
|
||||||
|
FROM `vn`.`exchangeInsurance` `ei`
|
||||||
|
WHERE `ei`.`amount` <> 0
|
||||||
|
AND `ei`.`financialProductTypefk` = 'SC'
|
|
@ -7,9 +7,9 @@ AS SELECT `p`.`received` AS `received`,
|
||||||
FROM (
|
FROM (
|
||||||
(
|
(
|
||||||
`vn`.`payment` `p`
|
`vn`.`payment` `p`
|
||||||
JOIN `vn`.`bank` `b` ON(`b`.`id` = `p`.`bankFk`)
|
JOIN `vn`.`accounting` `a` ON(`a`.`id` = `p`.`bankFk`)
|
||||||
)
|
)
|
||||||
JOIN `vn`.`accountingType` `at2` ON(`at2`.`id` = `b`.`cash`)
|
JOIN `vn`.`accountingType` `at2` ON(`at2`.`id` = `a`.`accountingTypeFk`)
|
||||||
)
|
)
|
||||||
WHERE `p`.`currencyFk` = 2
|
WHERE `p`.`currencyFk` = 2
|
||||||
AND `at2`.`code` = 'wireTransfer'
|
AND `at2`.`code` = 'wireTransfer'
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`preparationException`
|
|
||||||
AS SELECT `p`.`exception_day` AS `exceptionDay`,
|
|
||||||
`p`.`warehouse_id` AS `warehouseFk`,
|
|
||||||
`p`.`percentage` AS `percentage`
|
|
||||||
FROM `vn2008`.`preparation_exception` `p`
|
|
|
@ -1,6 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`unary`
|
|
||||||
AS SELECT `a`.`id` AS `id`,
|
|
||||||
`a`.`parent` AS `parent`
|
|
||||||
FROM `vn2008`.`unary` `a`
|
|
|
@ -1,8 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`unaryScan`
|
|
||||||
AS SELECT `u`.`unary_id` AS `unaryFk`,
|
|
||||||
`u`.`name` AS `name`,
|
|
||||||
`u`.`odbc_date` AS `created`,
|
|
||||||
`u`.`type` AS `type`
|
|
||||||
FROM `vn2008`.`unary_scan` `u`
|
|
|
@ -1,8 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`unaryScanLine`
|
|
||||||
AS SELECT `u`.`id` AS `id`,
|
|
||||||
`u`.`code` AS `code`,
|
|
||||||
`u`.`odbc_date` AS `created`,
|
|
||||||
`u`.`unary_id` AS `unaryScanFk`
|
|
||||||
FROM `vn2008`.`unary_scan_line` `u`
|
|
|
@ -1,100 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`emailYesterdayPurchasesByConsigna`(IN v_Date DATE, IN v_Client_Id INT)
|
|
||||||
BEGIN
|
|
||||||
|
|
||||||
DECLARE MyIdTicket BIGINT;
|
|
||||||
DECLARE MyAlias VARCHAR(50);
|
|
||||||
DECLARE MyDomicilio VARCHAR(255);
|
|
||||||
DECLARE MyPoblacion VARCHAR(25);
|
|
||||||
DECLARE MyImporte DOUBLE;
|
|
||||||
DECLARE MyMailTo VARCHAR(250);
|
|
||||||
DECLARE MyMailReplyTo VARCHAR(250);
|
|
||||||
DECLARE done INT DEFAULT FALSE;
|
|
||||||
DECLARE emptyList INT DEFAULT 0;
|
|
||||||
DECLARE txt TEXT;
|
|
||||||
|
|
||||||
DECLARE rs CURSOR FOR
|
|
||||||
SELECT t.Id_Ticket, Alias, cast(amount as decimal(10,2)) Importe, Domicilio, POBLACION
|
|
||||||
FROM Tickets t
|
|
||||||
JOIN Consignatarios cs ON t.Id_Consigna = cs.Id_Consigna
|
|
||||||
JOIN (
|
|
||||||
SELECT `Movimientos`.`Id_Ticket` AS `Id_Ticket`,
|
|
||||||
sum(
|
|
||||||
`Movimientos`.`Cantidad` * `Movimientos`.`Preu` * (100 - `Movimientos`.`Descuento`) / 100
|
|
||||||
) AS `amount`
|
|
||||||
FROM (
|
|
||||||
`vn2008`.`Movimientos`
|
|
||||||
JOIN `vn2008`.`Tickets` ON(
|
|
||||||
`Movimientos`.`Id_Ticket` = `Tickets`.`Id_Ticket`
|
|
||||||
)
|
|
||||||
)
|
|
||||||
WHERE `Tickets`.`Fecha` >= `util`.`VN_CURDATE`() + INTERVAL -6 MONTH
|
|
||||||
GROUP BY `Movimientos`.`Id_Ticket`
|
|
||||||
) v ON v.Id_Ticket = t.Id_Ticket
|
|
||||||
WHERE t.Fecha BETWEEN v_Date AND util.dayEnd(v_Date)
|
|
||||||
AND t.Id_Cliente = v_Client_Id;
|
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
|
||||||
|
|
||||||
SET v_Date = IFNULL(v_Date, util.yesterday());
|
|
||||||
|
|
||||||
OPEN rs;
|
|
||||||
|
|
||||||
FETCH rs INTO MyIdTicket, MyAlias, MyImporte, MyDomicilio, MyPoblacion;
|
|
||||||
|
|
||||||
SET emptyList = done;
|
|
||||||
|
|
||||||
SET txt = CONCAT('<p><font face="verdana" >',
|
|
||||||
'<h2> Relación de envíos.</h2>',
|
|
||||||
'<h3><font color="green">Dia: ', v_Date, '</font></h3>');
|
|
||||||
|
|
||||||
WHILE NOT done DO
|
|
||||||
|
|
||||||
SET txt = CONCAT(txt, '<br><br>',
|
|
||||||
'<table>
|
|
||||||
<tr>
|
|
||||||
<th> <a href = "https://shop.verdnatura.es/#!form=ecomerce/ticket&ticket=',MyIdTicket,'">
|
|
||||||
<font color="green"> Ticket ', MyIdTicket,'</font></th>
|
|
||||||
<th></th><th></th><th></th><th></th>
|
|
||||||
<th></th><th></th><th></th><th></th>
|
|
||||||
<th> <font color="orange"> ', MyImporte, ' € </a></font></th>
|
|
||||||
</tr>
|
|
||||||
</table>'
|
|
||||||
, ' ', MyAlias, '<br>'
|
|
||||||
, ' ', MyDomicilio, '(', MyPoblacion, ')');
|
|
||||||
|
|
||||||
FETCH rs INTO MyIdTicket, MyAlias, MyImporte, MyDomicilio, MyPoblacion;
|
|
||||||
|
|
||||||
END WHILE;
|
|
||||||
|
|
||||||
SET txt = CONCAT(
|
|
||||||
txt,
|
|
||||||
'<table>',
|
|
||||||
'<tr><th></th></tr>',
|
|
||||||
'</table>',
|
|
||||||
'<br><br>Puede acceder al detalle de los albaranes haciendo click sobre el número de Ticket',
|
|
||||||
'<br><h3> Muchas gracias por su confianza</h3>',
|
|
||||||
'</font></p>');
|
|
||||||
|
|
||||||
-- Envío del email
|
|
||||||
IF emptyList = 0 THEN
|
|
||||||
|
|
||||||
SELECT CONCAT(`e-mail`,',pako@verdnatura.es') INTO MyMailTo
|
|
||||||
FROM Clientes
|
|
||||||
WHERE Id_Cliente = v_Client_Id AND `e-mail`>'';
|
|
||||||
|
|
||||||
IF v_Client_Id = 7818 THEN -- LOEWE
|
|
||||||
SET MyMailTo = 'isabel@elisabethblumen.com,emunozca@loewe.es,pako@verdnatura.es';
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
CALL vn.mail_insert(
|
|
||||||
IFNULL(MyMailTo,'pako.natek@gmail.com'),
|
|
||||||
'pako@verdnatura.es',
|
|
||||||
'Resumen de pedidos preparados',
|
|
||||||
txt
|
|
||||||
);
|
|
||||||
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,27 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`emailYesterdayPurchasesLauncher`()
|
|
||||||
BEGIN
|
|
||||||
|
|
||||||
DECLARE done INT DEFAULT 0;
|
|
||||||
DECLARE vMyClientId INT;
|
|
||||||
|
|
||||||
DECLARE rs CURSOR FOR
|
|
||||||
SELECT Id_Cliente
|
|
||||||
FROM Clientes
|
|
||||||
WHERE EYPBC != 0;
|
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
|
||||||
|
|
||||||
OPEN rs;
|
|
||||||
|
|
||||||
FETCH rs INTO vMyClientId;
|
|
||||||
|
|
||||||
WHILE NOT done DO
|
|
||||||
|
|
||||||
CALL emailYesterdayPurchasesByConsigna(util.yesterday(), vMyClientId);
|
|
||||||
|
|
||||||
FETCH rs INTO vMyClientId;
|
|
||||||
|
|
||||||
END WHILE;
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,51 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`embalajes_stocks`(IN idPEOPLE INT, IN bolCLIENT BOOLEAN)
|
|
||||||
BEGIN
|
|
||||||
|
|
||||||
if bolCLIENT then
|
|
||||||
|
|
||||||
select m.Id_Article, Article, - cast(sum(m.Cantidad) as decimal) as Saldo
|
|
||||||
from Movimientos m
|
|
||||||
join Articles a on m.Id_Article = a.Id_Article
|
|
||||||
join Tipos tp on tp.tipo_id = a.tipo_id
|
|
||||||
join Tickets t using(Id_Ticket)
|
|
||||||
join Consignatarios cs using(Id_Consigna)
|
|
||||||
where cs.Id_Cliente = idPEOPLE
|
|
||||||
and Tipo = 'Contenedores'
|
|
||||||
and t.Fecha > '2010-01-01'
|
|
||||||
group by m.Id_Article;
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
select Id_Article, Article, sum(Cantidad) as Saldo
|
|
||||||
from
|
|
||||||
(select Id_Article, Cantidad
|
|
||||||
from Compres c
|
|
||||||
join Articles a using(Id_Article)
|
|
||||||
join Tipos tp using(tipo_id)
|
|
||||||
join Entradas e using(Id_Entrada)
|
|
||||||
join travel tr on tr.id = travel_id
|
|
||||||
where Id_Proveedor = idPEOPLE
|
|
||||||
and landing >= '2010-01-01'
|
|
||||||
and reino_id = 6
|
|
||||||
|
|
||||||
union all
|
|
||||||
|
|
||||||
select Id_Article, - Cantidad
|
|
||||||
from Movimientos m
|
|
||||||
join Articles a using(Id_Article)
|
|
||||||
join Tipos tp using(tipo_id)
|
|
||||||
join Tickets t using(Id_Ticket)
|
|
||||||
join Consignatarios cs using(Id_Consigna)
|
|
||||||
join proveedores_clientes pc on pc.Id_Cliente = cs.Id_Cliente
|
|
||||||
where Id_Proveedor = idPEOPLE
|
|
||||||
and reino_id = 6
|
|
||||||
and t.Fecha > '2010-01-01') mov
|
|
||||||
|
|
||||||
join Articles a using(Id_Article)
|
|
||||||
group by Id_Article;
|
|
||||||
|
|
||||||
end if;
|
|
||||||
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,78 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`embalajes_stocks_detalle`(IN idPEOPLE INT, IN idARTICLE INT, IN bolCLIENT BOOLEAN)
|
|
||||||
BEGIN
|
|
||||||
|
|
||||||
|
|
||||||
if bolCLIENT then
|
|
||||||
|
|
||||||
select m.Id_Article
|
|
||||||
, Article
|
|
||||||
, IF(Cantidad < 0, - Cantidad, NULL) as Entrada
|
|
||||||
, IF(Cantidad < 0, NULL, Cantidad) as Salida
|
|
||||||
, 'T' as Tabla
|
|
||||||
, t.Id_Ticket as Registro
|
|
||||||
, t.Fecha
|
|
||||||
, w.name as Almacen
|
|
||||||
, cast(Preu as Decimal(5,2)) Precio
|
|
||||||
, c.Cliente as Proveedor
|
|
||||||
, abbreviation as Empresa
|
|
||||||
from Movimientos m
|
|
||||||
join Articles a using(Id_Article)
|
|
||||||
join Tickets t using(Id_Ticket)
|
|
||||||
join empresa e on e.id = t.empresa_id
|
|
||||||
join warehouse w on w.id = t.warehouse_id
|
|
||||||
join Consignatarios cs using(Id_Consigna)
|
|
||||||
join Clientes c on c.Id_Cliente = cs.Id_Cliente
|
|
||||||
where cs.Id_Cliente = idPEOPLE
|
|
||||||
and m.Id_Article = idARTICLE
|
|
||||||
and t.Fecha > '2010-01-01';
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
select Id_Article, Tabla, Registro, Fecha, Article
|
|
||||||
, w.name as Almacen, Entrada, Salida, Proveedor, cast(Precio as Decimal(5,2)) Precio
|
|
||||||
|
|
||||||
from
|
|
||||||
|
|
||||||
(select Id_Article
|
|
||||||
, IF(Cantidad > 0, Cantidad, NULL) as Entrada
|
|
||||||
, IF(Cantidad > 0, NULL,- Cantidad) as Salida
|
|
||||||
, 'E' as Tabla
|
|
||||||
, Id_Entrada as Registro
|
|
||||||
, landing as Fecha
|
|
||||||
, tr.warehouse_id
|
|
||||||
, Costefijo as Precio
|
|
||||||
from Compres c
|
|
||||||
join Entradas e using(Id_Entrada)
|
|
||||||
join travel tr on tr.id = travel_id
|
|
||||||
where Id_Proveedor = idPEOPLE
|
|
||||||
and Id_Article = idARTICLE
|
|
||||||
and landing >= '2010-01-01'
|
|
||||||
|
|
||||||
union all
|
|
||||||
|
|
||||||
select Id_Article
|
|
||||||
, IF(Cantidad < 0, - Cantidad, NULL) as Entrada
|
|
||||||
, IF(Cantidad < 0, NULL, Cantidad) as Salida
|
|
||||||
, 'T'
|
|
||||||
, Id_Ticket
|
|
||||||
, Fecha
|
|
||||||
, t.warehouse_id
|
|
||||||
, Preu
|
|
||||||
from Movimientos m
|
|
||||||
join Tickets t using(Id_Ticket)
|
|
||||||
join Consignatarios cs using(Id_Consigna)
|
|
||||||
join proveedores_clientes pc on pc.Id_Cliente = cs.Id_Cliente
|
|
||||||
where Id_Proveedor = idPEOPLE
|
|
||||||
and Id_Article = idARTICLE
|
|
||||||
and t.Fecha > '2010-01-01') mov
|
|
||||||
|
|
||||||
join Articles a using(Id_Article)
|
|
||||||
join Proveedores p on Id_Proveedor = idPEOPLE
|
|
||||||
join warehouse w on w.id = mov.warehouse_id
|
|
||||||
;
|
|
||||||
|
|
||||||
end if;
|
|
||||||
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,58 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`unary_leaves`(v_top INT)
|
|
||||||
BEGIN
|
|
||||||
/**
|
|
||||||
* A partir de un nodo devuelve todos sus descendientes.
|
|
||||||
*
|
|
||||||
* @table tmp.tree Tabla con los ids de los nodos descendientes;
|
|
||||||
**/
|
|
||||||
DECLARE v_count INT;
|
|
||||||
DECLARE v_parent INT;
|
|
||||||
DECLARE v_depth INT DEFAULT 0;
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tmp.tree;
|
|
||||||
CREATE TEMPORARY TABLE tmp.tree
|
|
||||||
(INDEX (id))
|
|
||||||
ENGINE = MEMORY
|
|
||||||
SELECT v_top id, v_parent parent, v_depth depth;
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tmp.parent;
|
|
||||||
CREATE TEMPORARY TABLE tmp.parent
|
|
||||||
ENGINE = MEMORY
|
|
||||||
SELECT v_top id;
|
|
||||||
|
|
||||||
l: LOOP
|
|
||||||
|
|
||||||
SET v_depth = v_depth + 1;
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tmp.child;
|
|
||||||
CREATE TEMPORARY TABLE tmp.child
|
|
||||||
ENGINE = MEMORY
|
|
||||||
SELECT c.`id`, c.parent
|
|
||||||
FROM `unary` c
|
|
||||||
JOIN tmp.parent p ON c.`parent` = p.id;
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.parent;
|
|
||||||
CREATE TEMPORARY TABLE tmp.parent
|
|
||||||
ENGINE = MEMORY
|
|
||||||
SELECT c.id, c.parent
|
|
||||||
FROM tmp.child c
|
|
||||||
LEFT JOIN tmp.tree t ON t.id = c.id
|
|
||||||
WHERE t.id IS NULL;
|
|
||||||
|
|
||||||
INSERT INTO tmp.tree
|
|
||||||
SELECT id, parent, v_depth FROM tmp.parent;
|
|
||||||
|
|
||||||
SELECT COUNT(*) INTO v_count
|
|
||||||
FROM tmp.parent;
|
|
||||||
|
|
||||||
IF v_count = 0 THEN
|
|
||||||
LEAVE l;
|
|
||||||
END IF;
|
|
||||||
END LOOP;
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE
|
|
||||||
tmp.parent,
|
|
||||||
tmp.child;
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,19 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`unary_tops`()
|
|
||||||
BEGIN
|
|
||||||
/**
|
|
||||||
* Devuelve todos los nodos que no tienen padre.
|
|
||||||
*
|
|
||||||
* @table tmp.tree Tabla con los ids de los nodos que no tienen padre;
|
|
||||||
**/
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tmp.tree;
|
|
||||||
CREATE TEMPORARY TABLE tmp.tree
|
|
||||||
ENGINE = MEMORY
|
|
||||||
SELECT s.`unary_id` AS id, s.name, s.odbc_date, s.type
|
|
||||||
FROM `unary_scan` s
|
|
||||||
INNER JOIN `unary` u ON s.unary_id = u.id
|
|
||||||
WHERE u.parent IS NULL;
|
|
||||||
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,11 +1,11 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
SQL SECURITY DEFINER
|
SQL SECURITY DEFINER
|
||||||
VIEW `vn2008`.`Bancos`
|
VIEW `vn2008`.`Bancos`
|
||||||
AS SELECT `b`.`id` AS `Id_Banco`,
|
AS SELECT `a`.`id` AS `Id_Banco`,
|
||||||
`b`.`bank` AS `Banco`,
|
`a`.`bank` AS `Banco`,
|
||||||
`b`.`account` AS `Cuenta`,
|
`a`.`account` AS `Cuenta`,
|
||||||
`b`.`cash` AS `cash`,
|
`a`.`accountingTypeFk` AS `cash`,
|
||||||
`b`.`entityFk` AS `entity_id`,
|
`a`.`entityFk` AS `entity_id`,
|
||||||
`b`.`isActive` AS `activo`,
|
`a`.`isActive` AS `activo`,
|
||||||
`b`.`currencyFk` AS `currencyFk`
|
`a`.`currencyFk` AS `currencyFk`
|
||||||
FROM `vn`.`bank` `b`
|
FROM `vn`.`accounting` `a`
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn2008`.`v_jerarquia`
|
|
||||||
AS SELECT `vn2008`.`jerarquia`.`worker_id` AS `Id_Trabajador`,
|
|
||||||
`vn2008`.`jerarquia`.`boss_id` AS `boss_id`
|
|
||||||
FROM `vn2008`.`jerarquia`
|
|
||||||
UNION ALL
|
|
||||||
SELECT DISTINCT `vn2008`.`jerarquia`.`boss_id` AS `Id_Trabajador`,
|
|
||||||
`vn2008`.`jerarquia`.`boss_id` AS `boss_id`
|
|
||||||
FROM `vn2008`.`jerarquia`
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||||
|
VALUES
|
||||||
|
('Collection', 'assign', 'WRITE', 'ALLOW', 'ROLE', 'production'),
|
||||||
|
('ExpeditionPallet', 'getPallet', 'READ', 'ALLOW', 'ROLE', 'production'),
|
||||||
|
('MachineWorker','updateInTime','WRITE','ALLOW','ROLE','production'),
|
||||||
|
('MobileAppVersionControl','getVersion','READ','ALLOW','ROLE','production'),
|
||||||
|
('SaleTracking','delete','WRITE','ALLOW','ROLE','production'),
|
||||||
|
('SaleTracking','updateTracking','WRITE','ALLOW','ROLE','production'),
|
||||||
|
('SaleTracking','setPicked','WRITE','ALLOW','ROLE','production'),
|
||||||
|
('ExpeditionPallet', '*', 'READ', 'ALLOW', 'ROLE', 'production'),
|
||||||
|
('Sale', 'getFromSectorCollection', 'READ', 'ALLOW', 'ROLE', 'production'),
|
||||||
|
('ItemBarcode', 'delete', 'WRITE', 'ALLOW', 'ROLE', 'production');
|
|
@ -0,0 +1,36 @@
|
||||||
|
USE vn;
|
||||||
|
|
||||||
|
CREATE OR REPLACE TABLE vn.workerActivityType (
|
||||||
|
`code` varchar(20) NOT NULL,
|
||||||
|
`description` varchar(45) NOT NULL,
|
||||||
|
PRIMARY KEY (`code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
||||||
|
ALTER TABLE vn.department ADD workerActivityTypeFk varchar(20) NULL COMMENT 'Indica la actitividad que desempeña por defecto ese departamento';
|
||||||
|
ALTER TABLE vn.department ADD CONSTRAINT department_workerActivityType_FK FOREIGN KEY (workerActivityTypeFk) REFERENCES vn.workerActivityType(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_CHECKING', 'REVISION');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_CAM', 'CAMARA');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_ART', 'ARTIFICIAL');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_PREPARATION', 'SACADO');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('PACKING', 'ENCAJADO');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('FIELD', 'CAMPOS');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('DELIVERY', 'REPARTO');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('STORAGE', 'ALMACENAJE');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('PALLETIZING', 'PALETIZADO');
|
||||||
|
INSERT INTO vn.workerActivityType (code, description) VALUES('STOP', 'PARADA');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivityType', '*', 'READ', 'ALLOW', 'ROLE', 'production');
|
||||||
|
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivity', '*', '*', 'ALLOW', 'ROLE', 'production');
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE vn.workerActivity MODIFY COLUMN event enum('open','close','insert','delete','update','refresh') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL;
|
||||||
|
ALTER TABLE vn.workerActivity MODIFY COLUMN model enum('COM','ENT','TPV','ENC','LAB','ETI','APP') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE vn.workerActivity ADD workerActivityTypeFk varchar(20) NULL;
|
||||||
|
ALTER TABLE vn.workerActivity ADD CONSTRAINT workerActivity_workerActivityType_FK FOREIGN KEY (workerActivityTypeFk) REFERENCES vn.workerActivityType(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
DELETE FROM bs.nightTask
|
||||||
|
WHERE `procedure` = 'emailYesterdayPurchasesLauncher';
|
|
@ -0,0 +1,60 @@
|
||||||
|
CREATE OR REPLACE TABLE vn.parkingLog (
|
||||||
|
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
|
||||||
|
`originFk` int(11) DEFAULT NULL,
|
||||||
|
|
||||||
|
`userFk` int(10) unsigned DEFAULT NULL,
|
||||||
|
|
||||||
|
`action` set('insert','update','delete','select') NOT NULL,
|
||||||
|
|
||||||
|
`creationDate` timestamp NULL DEFAULT current_timestamp(),
|
||||||
|
|
||||||
|
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||||
|
|
||||||
|
`changedModel` enum('Parking','SaleGroup','SaleGroupDetail') NOT NULL DEFAULT 'Parking',
|
||||||
|
|
||||||
|
`oldInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldInstance`)),
|
||||||
|
|
||||||
|
`newInstance` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`newInstance`)),
|
||||||
|
|
||||||
|
`changedModelId` int(11) NOT NULL,
|
||||||
|
|
||||||
|
`changedModelValue` varchar(45) DEFAULT NULL,
|
||||||
|
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
|
||||||
|
KEY `logParkinguserFk` (`userFk`),
|
||||||
|
|
||||||
|
KEY `parkingLog_changedModel` (`changedModel`,`changedModelId`,`creationDate`),
|
||||||
|
|
||||||
|
KEY `parkingLog_originFk` (`originFk`,`creationDate`),
|
||||||
|
|
||||||
|
CONSTRAINT `parkingOriginFk` FOREIGN KEY (`originFk`) REFERENCES `parking` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
|
||||||
|
CONSTRAINT `parkingUserFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
||||||
|
ALTER TABLE vn.parking DROP COLUMN IF EXISTS editorFk;
|
||||||
|
ALTER TABLE IF EXISTS vn.parking ADD COLUMN editorFk INT;
|
||||||
|
|
||||||
|
ALTER TABLE vn.saleGroupDetail DROP COLUMN IF EXISTS editorFk;
|
||||||
|
ALTER TABLE IF EXISTS vn.saleGroupDetail ADD COLUMN editorFk INT;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE vn.ticketLog
|
||||||
|
MODIFY COLUMN changedModel ENUM(
|
||||||
|
'Ticket',
|
||||||
|
'Sale',
|
||||||
|
'TicketWeekly',
|
||||||
|
'TicketTracking',
|
||||||
|
'TicketService',
|
||||||
|
'TicketRequest',
|
||||||
|
'TicketRefund',
|
||||||
|
'TicketPackaging',
|
||||||
|
'TicketObservation',
|
||||||
|
'TicketDms',
|
||||||
|
'Expedition',
|
||||||
|
'Sms'
|
||||||
|
) NOT NULL DEFAULT 'Ticket';
|
|
@ -0,0 +1,2 @@
|
||||||
|
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
|
||||||
|
VALUES ('ParkingLog', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1,5 @@
|
||||||
|
REVOKE SELECT ON TABLE vn.bank FROM administrative, hr;
|
||||||
|
GRANT SELECT ON TABLE vn.accounting TO administrative, hr;
|
||||||
|
UPDATE salix.ACL
|
||||||
|
SET model = 'Accounting'
|
||||||
|
WHERE model = 'Bank';
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
ALTER TABLE vn.department
|
||||||
|
ADD COLUMN pbxQueue varchar(128) CHARACTER
|
||||||
|
SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;
|
||||||
|
|
||||||
|
ALTER TABLE vn.department
|
||||||
|
ADD CONSTRAINT department_queue_FK
|
||||||
|
FOREIGN KEY (pbxQueue) REFERENCES pbx.queue(name) ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE IF EXISTS vn2008.jerarquia__ RENAME vn2008.jerarquia;
|
|
@ -0,0 +1,4 @@
|
||||||
|
ALTER TABLE IF EXISTS vn2008.unary_scan RENAME vn2008.unary_scan__;
|
||||||
|
ALTER TABLE IF EXISTS vn2008.unary_scan_line RENAME vn2008.unary_scan_line__;
|
||||||
|
ALTER TABLE IF EXISTS vn2008.unary_scan_line_buy RENAME vn2008.unary_scan_line_buy__;
|
||||||
|
ALTER TABLE IF EXISTS vn2008.unary_scan_line_expedition RENAME vn2008.unary_scan_line_expedition__;
|
|
@ -58,7 +58,7 @@
|
||||||
label="Local bank"
|
label="Local bank"
|
||||||
id="localBank"
|
id="localBank"
|
||||||
ng-model="$ctrl.localBankFk"
|
ng-model="$ctrl.localBankFk"
|
||||||
url="Banks"
|
url="Accountings"
|
||||||
select-fields="['id','bank']"
|
select-fields="['id','bank']"
|
||||||
show-field="bank"
|
show-field="bank"
|
||||||
order="id"
|
order="id"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
const LoopBackContext = require('loopback-context');
|
const LoopBackContext = require('loopback-context');
|
||||||
async function handleObserve(ctx) {
|
async function handleObserve(ctx) {
|
||||||
ctx.options.httpCtx = LoopBackContext.getCurrentContext();
|
const httpCtx = LoopBackContext.getCurrentContext();
|
||||||
|
ctx.options.userId = httpCtx?.active?.accessToken?.userId;
|
||||||
}
|
}
|
||||||
module.exports = function(Self) {
|
module.exports = function(Self) {
|
||||||
let Mixin = {
|
let Mixin = {
|
||||||
|
|
|
@ -209,5 +209,16 @@
|
||||||
"You cannot update these fields": "You cannot update these fields",
|
"You cannot update these fields": "You cannot update these fields",
|
||||||
"CountryFK cannot be empty": "Country cannot be empty",
|
"CountryFK cannot be empty": "Country cannot be empty",
|
||||||
"You are not allowed to modify the alias": "You are not allowed to modify the alias",
|
"You are not allowed to modify the alias": "You are not allowed to modify the alias",
|
||||||
"You already have the mailAlias": "You already have the mailAlias"
|
"You already have the mailAlias": "You already have the mailAlias",
|
||||||
|
"This machine is already in use.": "This machine is already in use.",
|
||||||
|
"the plate does not exist": "The plate {{plate}} does not exist",
|
||||||
|
"We do not have availability for the selected item": "We do not have availability for the selected item",
|
||||||
|
"You are already using a machine": "You are already using a machine",
|
||||||
|
"this state does not exist": "This state does not exist",
|
||||||
|
"The line could not be marked": "The line could not be marked",
|
||||||
|
"The sale cannot be tracked": "The sale cannot be tracked",
|
||||||
|
"Shelving not valid": "Shelving not valid",
|
||||||
|
"printerNotExists": "The printer does not exist",
|
||||||
|
"There are not picking tickets": "There are not picking tickets",
|
||||||
|
"ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)"
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,7 +324,6 @@
|
||||||
"The response is not a PDF": "La respuesta no es un PDF",
|
"The response is not a PDF": "La respuesta no es un PDF",
|
||||||
"Booking completed": "Reserva completada",
|
"Booking completed": "Reserva completada",
|
||||||
"The ticket is in preparation": "El ticket [{{ticketId}}]({{{ticketUrl}}}) del comercial {{salesPersonId}} está en preparación",
|
"The ticket is in preparation": "El ticket [{{ticketId}}]({{{ticketUrl}}}) del comercial {{salesPersonId}} está en preparación",
|
||||||
"Incoterms data for consignee is missing": "Faltan los datos de los Incoterms para el consignatario",
|
|
||||||
"The notification subscription of this worker cant be modified": "La subscripción a la notificación de este trabajador no puede ser modificada",
|
"The notification subscription of this worker cant be modified": "La subscripción a la notificación de este trabajador no puede ser modificada",
|
||||||
"User disabled": "Usuario desactivado",
|
"User disabled": "Usuario desactivado",
|
||||||
"The amount cannot be less than the minimum": "La cantidad no puede ser menor que la cantidad mínima",
|
"The amount cannot be less than the minimum": "La cantidad no puede ser menor que la cantidad mínima",
|
||||||
|
|
|
@ -275,7 +275,7 @@ class VnMySQL extends MySQL {
|
||||||
}
|
}
|
||||||
|
|
||||||
invokeMethod(method, args, model, ctx, opts, cb) {
|
invokeMethod(method, args, model, ctx, opts, cb) {
|
||||||
if (!this.isLoggable(model))
|
if (!this.isLoggable(model) && !opts?.userId)
|
||||||
return super[method].apply(this, args);
|
return super[method].apply(this, args);
|
||||||
|
|
||||||
this.invokeMethodP(method, [...args], model, ctx, opts)
|
this.invokeMethodP(method, [...args], model, ctx, opts)
|
||||||
|
@ -287,11 +287,11 @@ class VnMySQL extends MySQL {
|
||||||
let tx;
|
let tx;
|
||||||
if (!opts.transaction) {
|
if (!opts.transaction) {
|
||||||
tx = await Transaction.begin(this, {});
|
tx = await Transaction.begin(this, {});
|
||||||
opts = Object.assign({transaction: tx, httpCtx: opts.httpCtx}, opts);
|
opts = Object.assign({transaction: tx}, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const userId = opts.httpCtx && opts.httpCtx.active?.accessToken?.userId;
|
const {userId} = opts;
|
||||||
if (userId) {
|
if (userId) {
|
||||||
const user = await Model.app.models.VnUser.findById(userId, {fields: ['name']}, opts);
|
const user = await Model.app.models.VnUser.findById(userId, {fields: ['name']}, opts);
|
||||||
await this.executeP(`CALL account.myUser_loginWithName(?)`, [user.name], opts);
|
await this.executeP(`CALL account.myUser_loginWithName(?)`, [user.name], opts);
|
||||||
|
|
|
@ -69,7 +69,7 @@ module.exports = function(Self) {
|
||||||
delete args.ctx; // Remove unwanted properties
|
delete args.ctx; // Remove unwanted properties
|
||||||
|
|
||||||
const originalClient = await models.Client.findById(args.clientFk, null, myOptions);
|
const originalClient = await models.Client.findById(args.clientFk, null, myOptions);
|
||||||
const bank = await models.Bank.findById(args.bankFk, null, myOptions);
|
const bank = await models.Accounting.findById(args.bankFk, null, myOptions);
|
||||||
const accountingType = await models.AccountingType.findById(bank.accountingTypeFk, null, myOptions);
|
const accountingType = await models.AccountingType.findById(bank.accountingTypeFk, null, myOptions);
|
||||||
|
|
||||||
if (accountingType.code == 'compensation') {
|
if (accountingType.code == 'compensation') {
|
||||||
|
|
|
@ -28,7 +28,7 @@ module.exports = Self => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const receipt = await models.Receipt.findById(id, {fields: ['clientFk', 'bankFk']});
|
const receipt = await models.Receipt.findById(id, {fields: ['clientFk', 'bankFk']});
|
||||||
|
|
||||||
const bank = await models.Bank.findById(receipt.bankFk);
|
const bank = await models.Accounting.findById(receipt.bankFk);
|
||||||
if (!bank)
|
if (!bank)
|
||||||
throw new UserError(`Receipt's bank was not found`);
|
throw new UserError(`Receipt's bank was not found`);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
},
|
},
|
||||||
"bank": {
|
"bank": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Bank",
|
"model": "Accounting",
|
||||||
"foreignKey": "bankFk"
|
"foreignKey": "bankFk"
|
||||||
},
|
},
|
||||||
"supplier": {
|
"supplier": {
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
"relations": {
|
"relations": {
|
||||||
"bank": {
|
"bank": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Bank",
|
"model": "Accounting",
|
||||||
"foreignKey": "bankFk"
|
"foreignKey": "bankFk"
|
||||||
},
|
},
|
||||||
"worker": {
|
"worker": {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
label="Bank"
|
label="Bank"
|
||||||
url="Banks"
|
url="Accountings"
|
||||||
show-field="bank"
|
show-field="bank"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
fields="['accountingTypeFk']"
|
fields="['accountingTypeFk']"
|
||||||
|
|
|
@ -37,7 +37,7 @@ describe('Entry filter()', () => {
|
||||||
|
|
||||||
const result = await models.Entry.filter(ctx, options);
|
const result = await models.Entry.filter(ctx, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(8);
|
expect(result.length).toEqual(9);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -81,7 +81,7 @@ describe('Entry filter()', () => {
|
||||||
|
|
||||||
const result = await models.Entry.filter(ctx, options);
|
const result = await models.Entry.filter(ctx, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(7);
|
expect(result.length).toEqual(8);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
"relations": {
|
"relations": {
|
||||||
"bank": {
|
"bank": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Bank",
|
"model": "Accounting",
|
||||||
"foreignKey": "bankFk"
|
"foreignKey": "bankFk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<vn-autocomplete vn-three
|
<vn-autocomplete vn-three
|
||||||
label="Bank"
|
label="Bank"
|
||||||
ng-model="invoiceInDueDay.bankFk"
|
ng-model="invoiceInDueDay.bankFk"
|
||||||
url="Banks"
|
url="Accountings"
|
||||||
show-field="bank"
|
show-field="bank"
|
||||||
select-fields="['id','bank']"
|
select-fields="['id','bank']"
|
||||||
order="id"
|
order="id"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
const print = require('vn-print');
|
const print = require('vn-print');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
require('../methods/invoiceOut/filter')(Self);
|
require('../methods/invoiceOut/filter')(Self);
|
||||||
|
@ -66,4 +67,24 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Self.getSerial = async function(clientId, companyId, addressId, type, myOptions) {
|
||||||
|
const [{serial}] = await Self.rawSql(
|
||||||
|
`SELECT vn.invoiceSerial(?, ?, ?) AS serial`,
|
||||||
|
[
|
||||||
|
clientId,
|
||||||
|
companyId,
|
||||||
|
type
|
||||||
|
],
|
||||||
|
myOptions);
|
||||||
|
|
||||||
|
const invoiceOutSerial = await Self.app.models.InvoiceOutSerial.findById(serial);
|
||||||
|
if (invoiceOutSerial?.taxAreaFk == 'WORLD') {
|
||||||
|
const address = await Self.app.models.Address.findById(addressId);
|
||||||
|
if (!address || !address.customsAgentFk || !address.incotermsFk)
|
||||||
|
throw new UserError('The address of the customer must have information about Incoterms and Customs Agent');
|
||||||
|
}
|
||||||
|
|
||||||
|
return serial;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('delete', {
|
||||||
|
description: 'Delete an ItemBarcode by itemFk and code',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [
|
||||||
|
{
|
||||||
|
arg: 'barcode',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'itemFk',
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
http: {
|
||||||
|
path: `/delete`,
|
||||||
|
verb: 'DELETE'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.delete = async(barcode, itemFk, options) => {
|
||||||
|
const myOptions = {};
|
||||||
|
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
await Self.destroyAll({
|
||||||
|
code: barcode,
|
||||||
|
itemFk
|
||||||
|
}, myOptions);
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,22 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
|
describe('itemBarcode delete()', () => {
|
||||||
|
it('should delete a record by itemFk and code', async() => {
|
||||||
|
const tx = await models.ItemBarcode.beginTransaction({});
|
||||||
|
const options = {transaction: tx};
|
||||||
|
const itemFk = 1;
|
||||||
|
const code = 1111111111;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const itemsBarcodeBefore = await models.ItemBarcode.find({}, options);
|
||||||
|
await models.ItemBarcode.delete(code, itemFk, options);
|
||||||
|
const itemsBarcodeAfter = await models.ItemBarcode.find({}, options);
|
||||||
|
|
||||||
|
expect(itemsBarcodeBefore.length).toBeGreaterThan(itemsBarcodeAfter.length);
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,64 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('getAlternative', {
|
||||||
|
description: 'Returns a list of items and possible alternative locations',
|
||||||
|
accessType: 'READ',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'shelvingFk',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
}],
|
||||||
|
returns: {
|
||||||
|
type: ['object'],
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/getAlternative`,
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.getAlternative = async(shelvingFk, options) => {
|
||||||
|
const models = Self.app.models;
|
||||||
|
const myOptions = {};
|
||||||
|
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
const filterItemShelvings = {
|
||||||
|
fields: ['id', 'visible', 'itemFk', 'shelvingFk'],
|
||||||
|
where: {shelvingFk},
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'item',
|
||||||
|
scope: {
|
||||||
|
fields: ['longName', 'name', 'size']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
let itemShelvings = await models.ItemShelving.find(filterItemShelvings, myOptions);
|
||||||
|
|
||||||
|
if (itemShelvings) {
|
||||||
|
const [alternatives] = await models.ItemShelving.rawSql('CALL vn.itemShelving_getAlternatives(?)',
|
||||||
|
[shelvingFk], myOptions
|
||||||
|
);
|
||||||
|
return itemShelvings.map(itemShelving => {
|
||||||
|
const item = itemShelving.item();
|
||||||
|
|
||||||
|
const shelvings = alternatives.filter(alternative => alternative.itemFk == itemShelving.itemFk);
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: itemShelving.id,
|
||||||
|
itemFk: itemShelving.itemFk,
|
||||||
|
name: item.name,
|
||||||
|
size: item.size,
|
||||||
|
longName: item.longName,
|
||||||
|
quantity: itemShelving.visible,
|
||||||
|
shelvings
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
|
@ -1,7 +1,8 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
const LoopBackContext = require('loopback-context');
|
const LoopBackContext = require('loopback-context');
|
||||||
|
|
||||||
describe('ItemShelving upsertItem()', () => {
|
// #6276
|
||||||
|
xdescribe('ItemShelving upsertItem()', () => {
|
||||||
const warehouseFk = 1;
|
const warehouseFk = 1;
|
||||||
let ctx;
|
let ctx;
|
||||||
let options;
|
let options;
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
|
describe('itemShelving getAlternative()', () => {
|
||||||
|
beforeAll(async() => {
|
||||||
|
ctx = {
|
||||||
|
req: {
|
||||||
|
headers: {origin: 'http://localhost'},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return a list of items without alternatives', async() => {
|
||||||
|
const shelvingFk = 'HEJ';
|
||||||
|
const itemShelvings = await models.ItemShelving.getAlternative(shelvingFk);
|
||||||
|
|
||||||
|
expect(itemShelvings[0].shelvings.length).toEqual(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return an empty list', async() => {
|
||||||
|
const shelvingFk = 'ZZP';
|
||||||
|
const itemShelvings = await models.ItemShelving.getAlternative(shelvingFk);
|
||||||
|
|
||||||
|
expect(itemShelvings.length).toEqual(0);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,22 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
|
describe('itemShelving updateFromSale()', () => {
|
||||||
|
it('should update the quantity', async() => {
|
||||||
|
const tx = await models.ItemBarcode.beginTransaction({});
|
||||||
|
const options = {transaction: tx};
|
||||||
|
const saleFk = 2;
|
||||||
|
const filter = {where: {itemFk: 4, shelvingFk: 'HEJ'}
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const {visible: visibleBefore} = await models.ItemShelving.findOne(filter, options);
|
||||||
|
await models.ItemShelving.updateFromSale(saleFk, options);
|
||||||
|
const {visible: visibleAfter} = await models.ItemShelving.findOne(filter, options);
|
||||||
|
|
||||||
|
expect(visibleAfter).toEqual(visibleBefore + 5);
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,48 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('updateFromSale', {
|
||||||
|
description: 'Update the visible items',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'saleFk',
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
}],
|
||||||
|
http: {
|
||||||
|
path: `/updateFromSale`,
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.updateFromSale = async(saleFk, options) => {
|
||||||
|
const models = Self.app.models;
|
||||||
|
const myOptions = {};
|
||||||
|
let tx;
|
||||||
|
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
if (!myOptions.transaction) {
|
||||||
|
tx = await Self.beginTransaction({});
|
||||||
|
myOptions.transaction = tx;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const itemShelvingSale = await models.ItemShelvingSale.findOne({
|
||||||
|
where: {saleFk},
|
||||||
|
include: {relation: 'itemShelving'}
|
||||||
|
}, myOptions);
|
||||||
|
|
||||||
|
const itemShelving = itemShelvingSale.itemShelving();
|
||||||
|
const quantity = itemShelving.visible + itemShelvingSale.quantity;
|
||||||
|
|
||||||
|
await itemShelving.updateAttributes(
|
||||||
|
{visible: quantity},
|
||||||
|
myOptions
|
||||||
|
);
|
||||||
|
if (tx) await tx.commit();
|
||||||
|
} catch (e) {
|
||||||
|
if (tx) await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,48 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('get', {
|
||||||
|
description: 'Get the data from an item',
|
||||||
|
accessType: 'READ',
|
||||||
|
http: {
|
||||||
|
path: `/get`,
|
||||||
|
verb: 'GET'
|
||||||
|
},
|
||||||
|
accepts: [
|
||||||
|
{
|
||||||
|
arg: 'barcode',
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'warehouseFk',
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
returns: {
|
||||||
|
type: ['object'],
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.get = async(barcode, warehouseFk, options) => {
|
||||||
|
const myOptions = {};
|
||||||
|
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
const models = Self.app.models;
|
||||||
|
|
||||||
|
const [[itemInfo]] = await Self.rawSql('CALL vn.item_getInfo(?, ?)', [barcode, warehouseFk], myOptions);
|
||||||
|
|
||||||
|
if (itemInfo) {
|
||||||
|
itemInfo.barcodes = await models.ItemBarcode.find({
|
||||||
|
fields: ['code'],
|
||||||
|
where: {
|
||||||
|
itemFk: itemInfo.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemInfo;
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,12 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
|
describe('item get()', () => {
|
||||||
|
const barcode = 1;
|
||||||
|
const warehouseFk = 1;
|
||||||
|
it('should get an item with several barcodes', async() => {
|
||||||
|
const card = await models.Item.get(barcode, warehouseFk);
|
||||||
|
|
||||||
|
expect(card).toBeDefined();
|
||||||
|
expect(card.barcodes.length).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,5 +1,6 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
require('../methods/item-barcode/toItem')(Self);
|
require('../methods/item-barcode/toItem')(Self);
|
||||||
|
require('../methods/item-barcode/delete')(Self);
|
||||||
|
|
||||||
Self.validatesUniquenessOf('code', {
|
Self.validatesUniquenessOf('code', {
|
||||||
message: `Barcode must be unique`
|
message: `Barcode must be unique`
|
||||||
|
|
|
@ -2,4 +2,6 @@ module.exports = Self => {
|
||||||
require('../methods/item-shelving/deleteItemShelvings')(Self);
|
require('../methods/item-shelving/deleteItemShelvings')(Self);
|
||||||
require('../methods/item-shelving/upsertItem')(Self);
|
require('../methods/item-shelving/upsertItem')(Self);
|
||||||
require('../methods/item-shelving/getInventory')(Self);
|
require('../methods/item-shelving/getInventory')(Self);
|
||||||
|
require('../methods/item-shelving/getAlternative')(Self);
|
||||||
|
require('../methods/item-shelving/updateFromSale')(Self);
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,7 +54,8 @@
|
||||||
"shelving": {
|
"shelving": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Shelving",
|
"model": "Shelving",
|
||||||
"foreignKey": "shelvingFk"
|
"foreignKey": "shelvingFk",
|
||||||
|
"primaryKey": "code"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ module.exports = Self => {
|
||||||
require('../methods/item/buyerWasteEmail')(Self);
|
require('../methods/item/buyerWasteEmail')(Self);
|
||||||
require('../methods/item/labelPdf')(Self);
|
require('../methods/item/labelPdf')(Self);
|
||||||
require('../methods/item/setVisibleDiscard')(Self);
|
require('../methods/item/setVisibleDiscard')(Self);
|
||||||
|
require('../methods/item/get')(Self);
|
||||||
|
|
||||||
Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'});
|
Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"ParkingLog": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"name": "ParkingLog",
|
||||||
|
"base": "Log",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "parkingLog"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
name: parking
|
||||||
|
columns:
|
||||||
|
id: id
|
||||||
|
column: column
|
||||||
|
row: row
|
||||||
|
sectorFk: sector
|
||||||
|
code: code
|
||||||
|
pickingOrder: picking order
|
||||||
|
editorFk: editor
|
|
@ -0,0 +1,10 @@
|
||||||
|
name: parking
|
||||||
|
columns:
|
||||||
|
id: id
|
||||||
|
column: columna
|
||||||
|
row: fila
|
||||||
|
sectorFk: sector
|
||||||
|
code: código
|
||||||
|
pickingOrder: orden de recogida
|
||||||
|
editorFk: editor
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue