Merge branch 'dev' into 7116-agencyIncoming
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
5bfabee6e3
81
CHANGELOG.md
81
CHANGELOG.md
|
@ -1,3 +1,83 @@
|
|||
# Version 24.28 - 2024-07-09
|
||||
|
||||
### Added 🆕
|
||||
|
||||
- feat boxPicking refs #7357 by:sergiodt
|
||||
- feat boxPicking refs #7357 (origin/7357_dipole_review) by:sergiodt
|
||||
- feat:concurrency issue refs #6861 by:Carlos Andrés
|
||||
- feat expeditionPalletPrint refs #5210 by:sergiodt
|
||||
- feat front-reservas refs #6861 (origin/6861-Reservas-front) by:sergiodt
|
||||
- feat itemShelving_filterBuyer refs #7023 by:sergiodt
|
||||
- feat itemShelvingLog refs #7168 by:sergiodt
|
||||
- feat itemShelvingSale refs #6861 by:sergiodt
|
||||
- feat: previas con reserva refs #6861 by:Carlos Andrés
|
||||
- feat: previas con sitema de reservas refs #6861 by:Carlos Andrés
|
||||
- feat: previas con sitema de reservas refs #6861 (origin/6861-Pasar-modo-trabajo-de-previa-a-reservas) by:Carlos Andrés
|
||||
- feat refactor setParking REGEXP refs #7575 (origin/7575_setParking_regExp) by:sergiodt
|
||||
- feat: refs #6238 add travelKgPercentage table and model (origin/6238-addPercentage) by:jorgep
|
||||
- feat: refs #6286 check if is teamBoss (origin/6286-setRightWorkerTimeControlAcls) by:jorgep
|
||||
- feat: refs #6701 Fix error by:guillermo
|
||||
- feat: refs #6861 trigger by:sergiodt
|
||||
- feat: refs #7027 mailError managed by:jgallego
|
||||
- feat: refs #7168 Added vRecords param in proc by:guillermo
|
||||
- feat: refs #7168 Minor change by:guillermo
|
||||
- feat: refs #7216 logUnpaid (origin/7216-clientUnpaid) by:jgallego
|
||||
- feat: refs #7216 triggers by:jgallego
|
||||
- feat: refs #7296 by:robert
|
||||
- feat: refs #7296 drop column expeditionTruckFk by:robert
|
||||
- feat: refs #7490 Changes (origin/7490-duaInvoiceInBooking) by:guillermo
|
||||
- feat: refs #7545 Deleted hasIncoterms client column (origin/7545-hasIncoterms) by:guillermo
|
||||
- feat: refs #7555 remove account.password__ by:alexm
|
||||
- feat: return sql check error by:alexm
|
||||
- feat roadmap refs #7195 by:sergiodt
|
||||
- #refs 5890 feat:add assignCollection by:sergiodt
|
||||
- refs#5890 feat: delete trigger and modify getTickets by:sergiodt
|
||||
- refs #5890 feat:itemShelving_add by:sergiodt
|
||||
- refs #5890 feat:reserves by:sergiodt
|
||||
- refs #5890 feat:trigger by:sergiodt
|
||||
- refs #5890 feat: triggers by:sergiodt
|
||||
- refs #6861 feat: getLock by:sergiodt
|
||||
- refs #6861 feat: obsrevation by:sergiodt
|
||||
- refs #6861 feat: previas a reservas by:sergiodt
|
||||
- refs #6861 feat:reserve previos by:sergiodt
|
||||
- refs #6861 feat: reservePrevious by:sergiodt
|
||||
- refs #6861 feat:reserveWithReservation by:sergiodt
|
||||
- refs #6861 feat:sectoCollection reserve by:sergiodt
|
||||
- refs #6861 feat: skipTest by:sergiodt
|
||||
- refs #6861 feat: trigger by:sergiodt
|
||||
|
||||
### Changed 📦
|
||||
|
||||
- feat refactor setParking REGEXP refs #7575 (origin/7575_setParking_regExp) by:sergiodt
|
||||
- refactor: refs #5447 changed models by:Jon
|
||||
- refactor: refs #6238 drop useless round by:jorgep
|
||||
- refactor: refs #6286 replace name by:jorgep
|
||||
- refactor: refs #6701 Refactor claim_ratio_routine by:guillermo
|
||||
- refactor: refs #7490 Added final update by:guillermo
|
||||
- refactor: refs #7490 Deleted update duaInvoiceInBooking by:guillermo
|
||||
- refactor: refs #7490 Minor changes by:guillermo
|
||||
- refactor: refs #7519 Minor change by:guillermo
|
||||
|
||||
### Fixed 🛠️
|
||||
|
||||
- acls, fixtures, models by:carlossa
|
||||
- fix: refs #6238 delete unused SQL script by:jorgep
|
||||
- fix: refs #6238 insert ignore by:jorgep
|
||||
- fix: refs #6238 use scheme by:jorgep
|
||||
- fix: refs #6286 replace id for reason by:jorgep
|
||||
- fix: refs #6286 update WorkerTimeControl permissions by:jorgep
|
||||
- fix(WorkerIncome): refs #7409 fix models by:alexm
|
||||
- refs #5890 fix: dev by:sergiodt
|
||||
- refs #6897 fix entry Salix by:carlossa
|
||||
- refs #6897 fix es.yml by:carlossa
|
||||
- refs #6897 fix redirection by:carlossa
|
||||
- refs #6897 fix remove by:carlossa
|
||||
- refs #7406 fix back by:carlossa
|
||||
- refs #7406 fix pr by:carlossa
|
||||
- refs #7409 fix acls by:carlossa
|
||||
- refs #7409 fix back (origin/7409-workerIncome) by:carlossa
|
||||
- refs #7409 fix pr by:carlossa
|
||||
|
||||
# Version 24.24 - 2024-06-11
|
||||
|
||||
### Added 🆕
|
||||
|
@ -22,6 +102,7 @@
|
|||
- feat: refs #7438 Added volume to item_valuateInventory by:guillermo
|
||||
- feat: refs #7438 Requested changes and little changes by:guillermo
|
||||
- refs #6281 feat:buyFk in itemShelving by:sergiodt
|
||||
- feat: refs #6449 item ID is displayed in the sale line by:jorgep
|
||||
|
||||
### Changed 📦
|
||||
|
||||
|
|
|
@ -60,15 +60,17 @@ module.exports = Self => {
|
|||
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
|
||||
|
||||
for (let ticket of tickets) {
|
||||
let observations = ticket.observaciones.split(' ');
|
||||
if (ticket.observaciones) {
|
||||
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})
|
||||
);
|
||||
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})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,15 +4,7 @@ describe('collection getSales()', () => {
|
|||
const collectionOrTicketFk = 999999;
|
||||
const print = true;
|
||||
const source = 'CHECKER';
|
||||
|
||||
beforeAll(() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 9},
|
||||
headers: {origin: 'http://localhost'},
|
||||
}
|
||||
};
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should return a collection with tickets, placements and barcodes settled correctly', async() => {
|
||||
const tx = await models.Collection.beginTransaction({});
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('collection getTickets()', () => {
|
||||
let ctx;
|
||||
beforeAll(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 9},
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
};
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should get tickets, sales and barcodes from collection', async() => {
|
||||
const tx = await models.Collection.beginTransaction({});
|
||||
|
|
|
@ -1,20 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('setSaleQuantity()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should change quantity sale', async() => {
|
||||
const tx = await models.Ticket.beginTransaction({});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<soap:Header>
|
||||
<mrw:AuthInfo>
|
||||
<mrw:CodigoFranquicia><%= mrw.franchiseCode %></mrw:CodigoFranquicia>
|
||||
<mrw:CodigoAbonado><%= mrw.subscriberCode %></mrw:CodigoAbonado>
|
||||
<mrw:CodigoAbonado><%= expeditionData.clientType %></mrw:CodigoAbonado>
|
||||
<mrw:CodigoDepartamento/>
|
||||
<mrw:UserName><%= mrw.user %></mrw:UserName>
|
||||
<mrw:Password><%= mrw.password %></mrw:Password>
|
||||
|
|
|
@ -50,9 +50,10 @@ module.exports = Self => {
|
|||
DATE_FORMAT(t.shipped, '%d/%m/%Y') created,
|
||||
t.shipped,
|
||||
CONCAT( e.ticketFk, LPAD(e.counter, mc.counterWidth, '0')) reference,
|
||||
LPAD(IF(mw.serviceType IS NULL, ms.serviceType, mw.serviceType), mc.serviceTypeWidth,'0') serviceType,
|
||||
LPAD(IF(mw.serviceType IS NULL, ms.serviceType, mw.serviceType), mc.serviceTypeWidth, '0') serviceType,
|
||||
IF(mw.weekdays, 'S', 'N') weekDays,
|
||||
oa.description deliveryObservation
|
||||
oa.description deliveryObservation,
|
||||
LPAD(ms.clientType, mc.clientTypeWidth, '0') clientType
|
||||
FROM expedition e
|
||||
JOIN ticket t ON e.ticketFk = t.id
|
||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
|
|
|
@ -1,22 +1,7 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('getStarredModules()', () => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
const ctx = {req: activeCtx};
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it(`should return the starred modules for a given user`, async() => {
|
||||
const newStarred = await models.StarredModule.create({workerFk: 9, moduleFk: 'customer', position: 1});
|
||||
|
|
|
@ -1,24 +1,8 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('setPosition()', () => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
const ctx = {
|
||||
req: activeCtx
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should increase the orders module position by replacing it with clients and vice versa', async() => {
|
||||
const tx = await models.StarredModule.beginTransaction({});
|
||||
|
|
|
@ -1,24 +1,7 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('toggleStarredModule()', () => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
const ctx = {
|
||||
req: activeCtx
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should create a new starred module and then remove it by calling the method again with same args', async() => {
|
||||
const starredModule = await models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||
|
@ -26,7 +9,7 @@ describe('toggleStarredModule()', () => {
|
|||
|
||||
expect(starredModules.length).toEqual(1);
|
||||
expect(starredModule.moduleFk).toEqual('order');
|
||||
expect(starredModule.workerFk).toEqual(activeCtx.accessToken.userId);
|
||||
expect(starredModule.workerFk).toEqual(ctx.req.accessToken.userId);
|
||||
expect(starredModule.position).toEqual(starredModules.length);
|
||||
|
||||
await models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('userConfig getUserConfig()', () => {
|
||||
const ctx = beforeAll.getCtx();
|
||||
it(`should return the configuration data of a given user`, async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const result = await models.UserConfig.getUserConfig(ctx, options);
|
||||
|
||||
expect(result.warehouseFk).toEqual(1);
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('loopback model MailAliasAccount', () => {
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should add a mail Alias', async() => {
|
||||
const tx = await models.MailAliasAccount.beginTransaction({});
|
||||
let error;
|
||||
|
||||
try {
|
||||
const options = {transaction: tx, accessToken: {userId: 9}};
|
||||
const options = {transaction: tx, ctx};
|
||||
await models.MailAliasAccount.create({mailAlias: 2, account: 5}, options);
|
||||
|
||||
await tx.rollback();
|
||||
|
@ -23,7 +24,7 @@ describe('loopback model MailAliasAccount', () => {
|
|||
let error;
|
||||
|
||||
try {
|
||||
const options = {transaction: tx, accessToken: {userId: 9}};
|
||||
const options = {transaction: tx, ctx};
|
||||
await models.MailAliasAccount.create({mailAlias: 3, account: 5}, options);
|
||||
|
||||
await tx.rollback();
|
||||
|
|
|
@ -9,24 +9,24 @@
|
|||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"forceId": false
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"forceId": false
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"type": "string"
|
||||
"type": "string"
|
||||
},
|
||||
"isInventory": {
|
||||
"type": "number"
|
||||
"type": "number"
|
||||
},
|
||||
"isManaged":{
|
||||
"type": "boolean"
|
||||
"isManaged": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"countryFk": {
|
||||
"type": "number"
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
@ -34,6 +34,11 @@
|
|||
"type": "belongsTo",
|
||||
"model": "Country",
|
||||
"foreignKey": "countryFk"
|
||||
},
|
||||
"address": {
|
||||
"type": "belongsTo",
|
||||
"model": "Address",
|
||||
"foreignKey": "addressFk"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
@ -44,5 +49,11 @@
|
|||
"permission": "ALLOW"
|
||||
}
|
||||
],
|
||||
"scope" : {"where": {"isForTicket": {"neq": 0}}}
|
||||
"scope": {
|
||||
"where": {
|
||||
"isForTicket": {
|
||||
"neq": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ async function init() {
|
|||
host: process.env.DB_HOST,
|
||||
port: process.env.DB_PORT
|
||||
});
|
||||
|
||||
const bootOptions = {dataSources};
|
||||
await new Promise((resolve, reject) => {
|
||||
app.boot(bootOptions,
|
||||
|
@ -33,3 +32,4 @@ module.exports = {
|
|||
|
||||
if (require.main === module)
|
||||
init();
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ async function test() {
|
|||
'loopback/**/*[sS]pec.js',
|
||||
'modules/*/back/**/*.[sS]pec.js'
|
||||
],
|
||||
helpers: []
|
||||
helpers: [`back/vn-jasmine.js`],
|
||||
};
|
||||
|
||||
if (PARALLEL) {
|
||||
|
@ -114,7 +114,6 @@ async function test() {
|
|||
if (opts.ci)
|
||||
runner.jasmine.DEFAULT_TIMEOUT_INTERVAL = SPEC_TIMEOUT;
|
||||
|
||||
// runner.loadConfigFile('back/jasmine.json');
|
||||
runner.loadConfig(config);
|
||||
process.env.SPEC_IS_RUNNING = true;
|
||||
await runner.execute();
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
const LoopBackContext = require('loopback-context');
|
||||
const getAccessToken = (userId = 9) => {
|
||||
return {accessToken: {userId}};
|
||||
};
|
||||
const DEFAULT_HEADERS = {headers: {origin: 'http://localhost'}};
|
||||
const default_before_all = userId => {
|
||||
return {
|
||||
req: {
|
||||
...getAccessToken(userId),
|
||||
...DEFAULT_HEADERS,
|
||||
...{__: value => value}
|
||||
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
};
|
||||
const default_loopback_ctx = userId => {
|
||||
return {
|
||||
...getAccessToken(userId),
|
||||
...default_before_all(userId),
|
||||
http: {
|
||||
...default_before_all(userId)
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
};
|
||||
|
||||
function vnBeforeAll() {
|
||||
Object.assign(beforeAll, {getCtx: default_before_all, mockLoopBackContext});
|
||||
}
|
||||
|
||||
const mockLoopBackContext = userId => {
|
||||
const activeCtx = default_loopback_ctx(userId);
|
||||
beforeAll(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
return activeCtx;
|
||||
};
|
||||
module.exports = {
|
||||
mockLoopBackContext
|
||||
};
|
||||
|
||||
(function init() {
|
||||
vnBeforeAll();
|
||||
})();
|
|
@ -3,7 +3,7 @@ USE `util`;
|
|||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
INSERT INTO `version` VALUES ('vn-database','11114','cf0f80142fed798c3307565a69158d7dba9276c4','2024-06-25 09:25:54','11115');
|
||||
INSERT INTO `version` VALUES ('vn-database','11117','5558e69e648c3819d4a1edf86f8df4b94d36e71a','2024-07-09 07:39:39','11141');
|
||||
|
||||
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);
|
||||
|
@ -644,6 +644,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10849','15-invoiceInLog.sql','je
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','10849','16-travelLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10849','17-packingSiteDeviceLog.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10851','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-01-30 13:31:15',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10852','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:37',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10853','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:46:05',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10853','00-secondScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:46:06',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10854','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-30 16:20:34',NULL,NULL);
|
||||
|
@ -776,6 +777,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10975','01-expeditionFk.sql','je
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','10976','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-18 07:40:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10977','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-18 07:40:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10978','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:33',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10983','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:37',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10984','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:31:59',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10988','00-pbx_prefix.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-04-11 17:00:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10990','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:31:59',NULL,NULL);
|
||||
|
@ -844,24 +846,39 @@ INSERT INTO `versionLog` VALUES ('vn-database','11068','00-firstScript.sql','jen
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','11069','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11070','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11071','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:48',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11073','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11074','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11075','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-28 12:54:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11078','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11079','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-31 08:22:10',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11080','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-31 12:01:58',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11081','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11082','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11083','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-03 10:46:36',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11084','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11086','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-27 10:02:02',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11087','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11089','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11090','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11092','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-07 08:21:23',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11093','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11096','00-addBuyerAcl.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 12:48:51',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11099','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11100','00-modifyTimeControlAcls.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11101','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11102','00-createTravelKgPercentage.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11103','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11104','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11105','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-20 15:36:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11106','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:49',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11109','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-18 19:09:56',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11110','00-clientUnpaid.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11111','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11114','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:49',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11116','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11117','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-07-09 07:39:38',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11134','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-07-05 11:02:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11139','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-07-08 10:58:01',NULL,NULL);
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
|
@ -958,6 +975,7 @@ INSERT INTO `role` VALUES (126,'greenhouseBoss','Jefe de invernadero',1,'2023-11
|
|||
INSERT INTO `role` VALUES (127,'timeControl','Tablet para fichar',1,'2024-01-09 16:36:56','2024-01-09 16:36:56',NULL);
|
||||
INSERT INTO `role` VALUES (129,'buyerAssistant','Comprador que tienes mas permisos para ayudar al buyerBoss en algunas tareas',1,'2024-02-06 06:59:12','2024-02-06 06:59:12',783);
|
||||
INSERT INTO `role` VALUES (130,'reviewer','Revisor de producción',1,'2024-06-11 00:00:00','2024-06-11 00:00:00',10578);
|
||||
INSERT INTO `role` VALUES (131,'supplier','Privilegios básicos de un proveedor',1,'2024-07-05 10:18:58','2024-07-05 10:18:58',19295);
|
||||
|
||||
INSERT INTO `roleInherit` VALUES (1,1,2,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (2,1,3,NULL);
|
||||
|
@ -1228,6 +1246,8 @@ INSERT INTO `roleInherit` VALUES (368,130,49,10578);
|
|||
INSERT INTO `roleInherit` VALUES (369,50,130,10578);
|
||||
INSERT INTO `roleInherit` VALUES (370,72,130,10578);
|
||||
INSERT INTO `roleInherit` VALUES (371,36,35,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (372,126,13,19295);
|
||||
INSERT INTO `roleInherit` VALUES (373,131,2,19295);
|
||||
|
||||
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
|
||||
|
||||
|
@ -1886,12 +1906,12 @@ INSERT INTO `ACL` VALUES (772,'Route','getExpeditionSummary','READ','ALLOW','ROL
|
|||
INSERT INTO `ACL` VALUES (773,'WorkerTimeControl','login','READ','ALLOW','ROLE','timeControl');
|
||||
INSERT INTO `ACL` VALUES (774,'WorkerTimeControl','getClockIn','READ','ALLOW','ROLE','timeControl');
|
||||
INSERT INTO `ACL` VALUES (775,'WorkerTimeControl','clockIn','WRITE','ALLOW','ROLE','timeControl');
|
||||
INSERT INTO `ACL` VALUES (776,'WorkerTimeControl','addTimeEntry','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (777,'WorkerTimeControl','deleteTimeEntry','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (778,'WorkerTimeControl','updateTimeEntry','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (779,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (780,'WorkerTimeControl','updateWorkerTimeControlMail','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (781,'WorkerTimeControl','weeklyHourRecordEmail','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (776,'WorkerTimeControl','addTimeEntry','WRITE','ALLOW','ROLE','teamBoss');
|
||||
INSERT INTO `ACL` VALUES (777,'WorkerTimeControl','deleteTimeEntry','WRITE','ALLOW','ROLE','teamBoss');
|
||||
INSERT INTO `ACL` VALUES (778,'WorkerTimeControl','updateTimeEntry','WRITE','ALLOW','ROLE','teamBoss');
|
||||
INSERT INTO `ACL` VALUES (779,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','developer');
|
||||
INSERT INTO `ACL` VALUES (780,'WorkerTimeControl','updateMailState','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (781,'WorkerTimeControl','weeklyHourRecordEmail','WRITE','ALLOW','ROLE','teamBoss');
|
||||
INSERT INTO `ACL` VALUES (782,'WorkerTimeControl','getMailStates','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (783,'WorkerTimeControl','resendWeeklyHourEmail','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (784,'VnRole','*','READ','ALLOW','ROLE','employee');
|
||||
|
@ -1941,7 +1961,6 @@ INSERT INTO `ACL` VALUES (830,'InvoiceIn','*','READ','ALLOW','ROLE','deliveryBos
|
|||
INSERT INTO `ACL` VALUES (831,'InvoiceIn','exchangeRateUpdate','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (832,'AgencyLog','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (833,'AgencyWorkCenter','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (834,'AgencyMode','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (835,'Agency','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (836,'Agency','*','WRITE','ALLOW','ROLE','deliveryAssistant');
|
||||
INSERT INTO `ACL` VALUES (837,'AgencyWorkCenter','*','WRITE','ALLOW','ROLE','deliveryAssistant');
|
||||
|
@ -1983,6 +2002,24 @@ INSERT INTO `ACL` VALUES (874,'Roadmap','*','READ','ALLOW','ROLE','production');
|
|||
INSERT INTO `ACL` VALUES (875,'RoadmapStop','*','WRITE','ALLOW','ROLE','palletizerBoss');
|
||||
INSERT INTO `ACL` VALUES (876,'RoadmapStop','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (877,'TravelKgPercentage','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (878,'MrwConfig','getLabel','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (879,'AgencyMode','*','*','ALLOW','ROLE','deliveryAssistant');
|
||||
INSERT INTO `ACL` VALUES (880,'Collection','assignCollection','WRITE','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (881,'TrainingCourse','*','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (882,'TrainingCourseType','*','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (883,'TrainingCenter','*','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (884,'Worker','__get__trainingCourse','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (885,'WorkerTimeControl','addTimeEntry','WRITE','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (886,'WorkerTimeControl','deleteTimeEntry','WRITE','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (887,'WorkerTimeControl','updateTimeEntry','WRITE','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (888,'WorkerTimeControl','weeklyHourRecordEmail','WRITE','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (889,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (890,'WorkerTimeControl','updateMailState','WRITE','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (891,'TravelKgPercentage','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (892,'WorkerIncome','*','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (893,'PayrollComponent','*','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (894,'Worker','__get__incomes','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (895,'ItemShelvingLog','*','READ','ALLOW','ROLE','production');
|
||||
|
||||
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
|
||||
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
||||
|
|
|
@ -259,7 +259,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran'
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','salesPerson','inter','alexm@%','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','albaran_state','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Articles','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Articles','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','awb','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','awb','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_component','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
|
@ -281,8 +281,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vncontrol','employee','inter','ale
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb_gestdoc','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','awb','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','agency','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','buySource','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','buy_edi','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','buy_edi_k04','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k03','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi_k04','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -313,7 +311,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Cajas','
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','cmrConfig','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','awb_recibida','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','awb','juan@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Compres','alexm@%','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','buy_edi','alexm@%','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','ACL','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Vehiculos_consumo','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -348,7 +345,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','empresa','alex
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','sectorType','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Tintas','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','Movimientos','juan@%','0000-00-00 00:00:00','Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Entradas','guillermo@10.5.1.3','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Compres','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','ticket_observation','juan@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Entradas_dits','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','sale','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -364,7 +361,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','tickets_
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','tickets_gestdoc','alexm@%','0000-00-00 00:00:00','Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','tickets_gestdoc','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Tickets','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Entradas','alexm@%','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Entradas','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Tintas','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','filtros','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas_kop','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -372,9 +369,9 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','flight','jenki
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','warehouse_pickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','zones','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','warehouse_pickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','businessReasonEnd','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','businessCalendar','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','business','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Entradas','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','buy','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','buySource','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','budgetNotes','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','packager','specialLabels','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','budgetDms','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
|
@ -383,7 +380,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','edi','grafana','offerList','juan@d
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','bookingPlanner','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','budgetInvoiceIn','juan@10.5.1.2','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','beach','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','business','alexm@%','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','business','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Movimientos_revisar','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Movimientos_mark','alexm@%','0000-00-00 00:00:00','Select,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Movimientos_componentes','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
|
@ -414,7 +411,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Movimientos
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','handmadeBoss','Reservas','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerBoss','bankEntity','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Ordenes','alexm@%','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','awb','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Origen','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','pago','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','awb','alexm@%','0000-00-00 00:00:00','Update','');
|
||||
|
@ -485,7 +481,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','absenceType','alexm@%','
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','artificialBoss','Entradas_Auto','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','productionAssi','Vehiculos_consumo','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','tblContadores','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','buyMark','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','calendar','juan@10.5.1.2','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','calendarHolidays','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','claim','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -638,7 +633,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ppeGroup','a
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','floramondoNotOfferDay__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','fuelType','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ppeDMS','alexm@%','0000-00-00 00:00:00','Select,Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','manager','genericAllocation','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ppeComponent','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ppe','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','glsExpedition__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
|
@ -744,7 +738,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','mrw','guille
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','mrwService','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ppePlan','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','accountingConfig','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','buy','alexm@%','0000-00-00 00:00:00','Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','buy','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','buy','alexm@%','0000-00-00 00:00:00','Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','saleGoal','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','packager','packingSiteLog','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert','');
|
||||
|
@ -759,9 +753,8 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','moving','guill
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','machineDetail','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','machineDms','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','vehicle','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','awb','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','awb','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','machine','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','buy','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas_dits','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerTimeControlMail','alexm@%','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','coolerBoss','rotacion','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -909,7 +902,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminBoss','ticketService','a
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminBoss','ticketServiceType','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticketState','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','ticketStateToday','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','employee','claims_ratio','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','greugeType','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','time','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticketWeekly','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1404,6 +1396,12 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','roadmapStop','guill
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','roadmapStop','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','agencyWorkCenter','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','roadmapStop','guillermo@10.5.1.3','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','greenhouseBoss','business','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','teamBoss','business','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ticketServiceType','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','business','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','','Select');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','supplierAgencyTerm','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','clientRate','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','entryEditor','Entradas','guillermo@10.5.1.3','0000-00-00 00:00:00','Insert','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','clientInforma','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','solunionCAP','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1422,6 +1420,17 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','expedition
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','failureLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','movingLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','sorterLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','genericAllocation','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','businessReasonEnd','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buySource','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','salesPerson','claims_ratio','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryBoss','albaran','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryBoss','albaran_gestdoc','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryBoss','albaran_state','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryBoss','deliveryNote','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryBoss','deliveryNoteDms','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryBoss','deliveryNoteState','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
|
||||
|
||||
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
|
||||
|
@ -1481,6 +1490,10 @@ INSERT IGNORE INTO `columns_priv` VALUES ('','pbx','grafana','sip','user_id','0
|
|||
INSERT IGNORE INTO `columns_priv` VALUES ('','pbx','grafana','sip','extension','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','account','grafana','user','name','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','account','grafana','user','active','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','business','workerFk','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','business','id','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','business','departmentFk','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','business','companyCodeFk','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','routesMonitor','routeFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','routesMonitor','name','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','routesMonitor','beachFk','0000-00-00 00:00:00','Update');
|
||||
|
@ -2018,7 +2031,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','account','developer','user_hasrouti
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','account','grafana','user_hasRole','FUNCTION','jgallego@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','time_generate','PROCEDURE','jenkins@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemshelving_addbyclaim','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemshelvingtransfer','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemshelving_addlist','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemshelving_selfconsumption','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','item_getsimilar','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2070,7 +2082,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemshelving_add','
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemshelving_getsaledate','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemshelving_filterbuyer','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemshelving_addbyclaim','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemshelvingtransfer','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemshelving_addlist','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemshelving_selfconsumption','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','item_getsimilar','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2185,7 +2196,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','financial','{\"access\": 0, \"vers
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','financialBoss','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','floranet','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','grafana','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','greenhouseBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','greenhouseBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','guest','{\"access\": 0, \"max_questions\": 40000, \"max_updates\": 1000, \"max_connections\": 150000, \"max_user_connections\": 200, \"max_statement_time\": 0.000000, \"is_role\": true, \"version_id\": 101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','handmadeBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','hedera-web','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
|
@ -2201,7 +2212,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','logisticBoss','{\"access\":0,\"ver
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenance','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBos','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBoss','{\"access\":0,\"version_id\":101106,\"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\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','marketing','{\"access\": 0, \"is_role\": true,\"version_id\":101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','marketingBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','officeBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
|
@ -2220,6 +2231,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','salesPerson','{\"access\": 0, \"is
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','salesTeamBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','salix','{\"access\":33555456,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','sysadmin','{\"access\": 201326592, \"is_role\": true, \"version_id\": 100707}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','teamBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
/*!40000 ALTER TABLE `global_priv` ENABLE KEYS */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3616,6 +3616,46 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`clientUnpaid_beforeInsert`
|
||||
BEFORE INSERT ON `clientUnpaid`
|
||||
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`.`clientUnpaid_beforeUpdate`
|
||||
BEFORE UPDATE ON `clientUnpaid`
|
||||
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`.`cmr_beforeDelete`
|
||||
BEFORE DELETE ON `cmr`
|
||||
FOR EACH ROW
|
||||
|
@ -4671,11 +4711,9 @@ BEGIN
|
|||
IF NEW.isBooked = OLD.isBooked AND (
|
||||
NOT (NEW.supplierFk <=> OLD.supplierFk) OR
|
||||
NOT (NEW.dated <=> OLD.dated) OR
|
||||
NOT (NEW.invoiceNumber <=> OLD.invoiceNumber) OR
|
||||
NOT (NEW.travelFk <=> OLD.travelFk) OR
|
||||
NOT (NEW.companyFk <=> OLD.companyFk) OR
|
||||
NOT (NEW.invoiceInFk <=> OLD.invoiceInFk) OR
|
||||
NOT (NEW.invoiceAmount <=> OLD.invoiceAmount) OR
|
||||
NOT (NEW.typeFk <=> OLD.typeFk)
|
||||
) THEN
|
||||
|
||||
|
@ -6144,6 +6182,7 @@ DELIMITER ;;
|
|||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
SET NEW.userFk = account.myUser_getId();
|
||||
SET NEW.available = NEW.visible;
|
||||
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -6160,48 +6199,20 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_afterInsert`
|
||||
AFTER INSERT ON `itemShelving`
|
||||
FOR EACH ROW
|
||||
INSERT INTO vn.itemShelvingLog( itemShelvingFk,
|
||||
workerFk,
|
||||
accion,
|
||||
itemFk,
|
||||
shelvingFk,
|
||||
visible,
|
||||
`grouping`,
|
||||
packing)
|
||||
VALUES( NEW.id,
|
||||
NEW.userFk,
|
||||
'CREA REGISTRO',
|
||||
NEW.itemFk,
|
||||
NEW.shelvingFk,
|
||||
NEW.visible,
|
||||
NEW.`grouping`,
|
||||
NEW.packing
|
||||
) */;;
|
||||
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`.`itemShelving_beforeUpdate`
|
||||
BEFORE UPDATE ON `itemShelving`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
IF NEW.userFk IS NULL THEN
|
||||
SET NEW.userFk = account.myUser_getId();
|
||||
END IF;
|
||||
|
||||
IF (NEW.visible <> OLD.visible) THEN
|
||||
SET NEW.available = GREATEST(NEW.available + NEW.visible - OLD.visible, 0);
|
||||
END IF;
|
||||
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -6220,7 +6231,8 @@ DELIMITER ;;
|
|||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_afterUpdate`
|
||||
AFTER UPDATE ON `itemShelving`
|
||||
FOR EACH ROW
|
||||
INSERT INTO itemShelvingLog
|
||||
BEGIN
|
||||
INSERT INTO itemShelvingLog
|
||||
SET itemShelvingFk = NEW.id,
|
||||
workerFk = account.myUser_getId(),
|
||||
accion = 'CAMBIO',
|
||||
|
@ -6228,7 +6240,10 @@ INSERT INTO itemShelvingLog
|
|||
shelvingFk = NEW.shelvingFk,
|
||||
visible = NEW.visible,
|
||||
`grouping` = NEW.`grouping`,
|
||||
packing = NEW.packing */;;
|
||||
packing = NEW.packing,
|
||||
available = NEW.available;
|
||||
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
|
@ -6297,12 +6312,12 @@ DELIMITER ;;
|
|||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelvingSale_afterInsert`
|
||||
AFTER INSERT ON `itemShelvingSale`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
UPDATE vn.sale
|
||||
SET isPicked = TRUE
|
||||
WHERE id = NEW.saleFk;
|
||||
|
||||
BEGIN
|
||||
|
||||
UPDATE sale s
|
||||
JOIN operator o ON o.workerFk = account.myUser_getId()
|
||||
SET s.isPicked = IF(o.isOnReservationMode, s.isPicked, TRUE)
|
||||
WHERE id = NEW.saleFk;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -10924,4 +10939,4 @@ USE `vn2008`;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2024-06-25 7:27:06
|
||||
-- Dump completed on 2024-07-09 5:48:24
|
||||
|
|
|
@ -528,7 +528,8 @@ INSERT INTO `vn`.`observationType`(`id`,`description`, `code`)
|
|||
(5, 'Administrative', 'administrative'),
|
||||
(6, 'Weight', 'weight'),
|
||||
(7, 'InvoiceOut', 'invoiceOut'),
|
||||
(8, 'DropOff', 'dropOff');
|
||||
(8, 'DropOff', 'dropOff'),
|
||||
(9, 'Sustitución', 'substitution');
|
||||
|
||||
INSERT INTO `vn`.`addressObservation`(`id`,`addressFk`,`observationTypeFk`,`description`)
|
||||
VALUES
|
||||
|
@ -3912,3 +3913,18 @@ INSERT INTO dipole.expedition_PrintOut (expeditionFk, ticketFk, addressFk, stree
|
|||
truckName, clientFk, phone, province, agency, m3, workerCode, itemFk, quantity, longName, shelvingFk, comments)
|
||||
VALUES(1, 1, 0, ' ', ' ', ' ', ' ', 0, '2001-01-01 00:00:00', 1, 0, ' ', ' ', 0, NULL, '', NULL, 0.000, NULL, 10, NULL, NULL, 'NCC', NULL);
|
||||
|
||||
INSERT INTO vn.accountDetail
|
||||
(id, value, accountDetailTypeFk, supplierAccountFk)
|
||||
VALUES
|
||||
(21, 'ES12345B12345678', 3, 241),
|
||||
(35, 'ES12346B12345679', 3, 241);
|
||||
|
||||
INSERT INTO vn.accountDetailType
|
||||
(id, description)
|
||||
VALUES
|
||||
(1, 'IBAN'),
|
||||
(2, 'SWIFT'),
|
||||
(3, 'Referencia Remesas'),
|
||||
(4, 'Referencia Transferencias'),
|
||||
(5, 'Referencia Nominas'),
|
||||
(6, 'ABA');
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`visible_refresh`(OUT v_calc INT, v_refresh BOOL, v_warehouse INT)
|
||||
proc: BEGIN
|
||||
proc:BEGIN
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
CALL cache_calc_unlock (v_calc);
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
CALL cache_calc_start (v_calc, v_refresh, 'visible', v_warehouse);
|
||||
CALL cache_calc_start (v_calc, v_refresh, 'visible', v_warehouse);
|
||||
|
||||
IF !v_refresh THEN
|
||||
LEAVE proc;
|
||||
|
@ -15,22 +15,23 @@ proc: BEGIN
|
|||
|
||||
-- Calculamos el stock hasta ayer
|
||||
|
||||
CALL `cache`.stock_refresh(false);
|
||||
CALL cache.stock_refresh(false);
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.itemVisible
|
||||
(PRIMARY KEY (item_id))
|
||||
ENGINE = MEMORY
|
||||
SELECT item_id, amount stock, amount visible FROM `cache`.stock
|
||||
SELECT item_id, amount stock, amount visible
|
||||
FROM cache.stock
|
||||
WHERE warehouse_id = v_warehouse;
|
||||
|
||||
-- Calculamos los movimientos confirmados de hoy
|
||||
CALL vn.item_GetVisible(v_warehouse, NULL);
|
||||
CALL vn.item_calcVisible(NULL, v_warehouse);
|
||||
DELETE FROM visible WHERE calc_id = v_calc;
|
||||
|
||||
INSERT INTO visible (calc_id, item_id,visible)
|
||||
SELECT v_calc, item_id, visible FROM tmp.itemVisible;
|
||||
|
||||
CALL cache_calc_end (v_calc);
|
||||
CALL cache_calc_end (v_calc);
|
||||
|
||||
DROP TEMPORARY TABLE tmp.itemVisible;
|
||||
END$$
|
||||
|
|
|
@ -26,16 +26,16 @@ BEGIN
|
|||
vErrorNumber = MYSQL_ERRNO,
|
||||
vErrorMsg = MESSAGE_TEXT;
|
||||
|
||||
CALL util.debugAdd('collection_assign', JSON_OBJECT(
|
||||
'errorNumber', vErrorNumber,
|
||||
'errorMsg', vErrorMsg,
|
||||
'lockName', vLockName,
|
||||
'userFk', vUserFk
|
||||
)); -- Tmp
|
||||
|
||||
IF vLockName IS NOT NULL THEN
|
||||
DO RELEASE_LOCK(vLockName);
|
||||
CALL util.debugAdd('collection_assign', JSON_OBJECT(
|
||||
'errorNumber', vErrorNumber,
|
||||
'errorMsg', vErrorMsg,
|
||||
'lockName', vLockName,
|
||||
'userFk', vUserFk
|
||||
)); -- Tmp
|
||||
END IF;
|
||||
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
|
@ -47,9 +47,9 @@ BEGIN
|
|||
INTO vHasTooMuchCollections,
|
||||
vLockName
|
||||
FROM productionConfig pc
|
||||
LEFT JOIN tCollection ON TRUE;
|
||||
LEFT JOIN tmp.collection ON TRUE;
|
||||
|
||||
DROP TEMPORARY TABLE tCollection;
|
||||
DROP TEMPORARY TABLE tmp.collection;
|
||||
|
||||
IF vHasTooMuchCollections THEN
|
||||
CALL util.throw('Hay colecciones pendientes');
|
||||
|
|
|
@ -7,27 +7,32 @@ BEGIN
|
|||
* @param vWorkerFk id del worker.
|
||||
* @table Devuelve tabla temporal con las colecciones pendientes
|
||||
*/
|
||||
DROP TEMPORARY TABLE IF EXISTS tCollection;
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
CREATE TEMPORARY TABLE tCollection
|
||||
SELECT c.id collectionFk,
|
||||
date(c.created) created,
|
||||
COUNT(DISTINCT tc.ticketFk) ticketTotalCount
|
||||
FROM collection c
|
||||
JOIN ticketCollection tc ON tc.collectionFk = c.id
|
||||
JOIN sale s ON s.ticketFk = tc.ticketFk
|
||||
JOIN ticketState ts ON ts.ticketFk = tc.ticketFk
|
||||
JOIN state s2 ON s2.id = ts.stateFk
|
||||
JOIN productionConfig pc
|
||||
JOIN vn.state ss on ss.code = 'PREPARED'
|
||||
LEFT JOIN vn.saleTracking st on st.saleFk = s.id AND st.stateFk = ss.id
|
||||
WHERE c.workerFk = vWorkerFk
|
||||
AND TIMESTAMPDIFF(HOUR, c.created , util.VN_NOW()) < pc.pendingCollectionsAge
|
||||
AND s.quantity != 0
|
||||
AND s2.order < pc.pendingCollectionsOrder
|
||||
GROUP BY c.id
|
||||
HAVING COUNT(*) > COUNT(DISTINCT st.id);
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.collection
|
||||
ENGINE = MEMORY
|
||||
SELECT c.id collectionFk,
|
||||
DATE(c.created) created,
|
||||
COUNT(DISTINCT tc.ticketFk) ticketTotalCount
|
||||
FROM collection c
|
||||
JOIN ticketCollection tc ON tc.collectionFk = c.id
|
||||
JOIN sale s ON s.ticketFk = tc.ticketFk
|
||||
JOIN ticketState ts ON ts.ticketFk = tc.ticketFk
|
||||
JOIN state s2 ON s2.id = ts.stateFk
|
||||
JOIN productionConfig pc
|
||||
JOIN vn.state ss ON ss.code = 'PREPARED'
|
||||
LEFT JOIN vn.saleTracking st ON st.saleFk = s.id
|
||||
AND st.stateFk = ss.id
|
||||
WHERE c.workerFk = vWorkerFk
|
||||
AND TIMESTAMPDIFF(HOUR, c.created , util.VN_NOW()) < pc.pendingCollectionsAge
|
||||
AND s.quantity
|
||||
AND s2.order < pc.pendingCollectionsOrder
|
||||
GROUP BY c.id
|
||||
HAVING COUNT(*) > COUNT(DISTINCT st.id);
|
||||
|
||||
SELECT * FROM tCollection;
|
||||
SELECT * FROM tmp.collection;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -34,10 +34,10 @@ BEGIN
|
|||
pc.collection_assign_lockname
|
||||
INTO vHasTooMuchCollections,
|
||||
vLockName
|
||||
FROM tCollection tc
|
||||
FROM tmp.collection c
|
||||
JOIN productionConfig pc;
|
||||
|
||||
DROP TEMPORARY TABLE tCollection;
|
||||
DROP TEMPORARY TABLE tmp.collection;
|
||||
|
||||
IF vHasTooMuchCollections THEN
|
||||
CALL util.throw('There are pending collections');
|
||||
|
|
|
@ -53,17 +53,17 @@ BEGIN
|
|||
vErrorNumber = MYSQL_ERRNO,
|
||||
vErrorMsg = MESSAGE_TEXT;
|
||||
|
||||
CALL util.debugAdd('collection_new', JSON_OBJECT(
|
||||
'errorNumber', vErrorNumber,
|
||||
'errorMsg', vErrorMsg,
|
||||
'lockName', vLockName,
|
||||
'userFk', vUserFk,
|
||||
'ticketFk', vTicketFk
|
||||
)); -- Tmp
|
||||
|
||||
IF vLockName IS NOT NULL THEN
|
||||
DO RELEASE_LOCK(vLockName);
|
||||
CALL util.debugAdd('collection_new', JSON_OBJECT(
|
||||
'errorNumber', vErrorNumber,
|
||||
'errorMsg', vErrorMsg,
|
||||
'lockName', vLockName,
|
||||
'userFk', vUserFk,
|
||||
'ticketFk', vTicketFk
|
||||
)); -- Tmp
|
||||
END IF;
|
||||
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ BEGIN
|
|||
AND (NOT e.isBooked OR NOT e.isConfirmed)
|
||||
),
|
||||
notBookedEntries AS (
|
||||
SELECT e.id
|
||||
SELECT entryFk
|
||||
FROM vn.duaEntry
|
||||
WHERE duaFk = vDuaFk
|
||||
AND NOT customsValue
|
||||
|
|
|
@ -18,7 +18,7 @@ BEGIN
|
|||
AND e.id = vSelf;
|
||||
|
||||
IF vIsEditable AND NOT IFNULL(@isModeInventory, FALSE) THEN
|
||||
CALL util.throw('Entry is not editable');
|
||||
CALL util.throw(CONCAT('Entry ', vSelf, ' is not editable'));
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -13,60 +13,45 @@ BEGIN
|
|||
DECLARE vBuyStickers INT;
|
||||
DECLARE vDone BOOLEAN DEFAULT FALSE;
|
||||
|
||||
DECLARE cur CURSOR FOR
|
||||
DECLARE cur CURSOR FOR
|
||||
SELECT bb.id buyFk,
|
||||
FLOOR(ish.visible / ish.packing) ishStickers,
|
||||
bb.stickers buyStickers
|
||||
FROM vn.itemShelving ish
|
||||
FROM itemShelving ish
|
||||
JOIN (SELECT b.id, b.itemFk, b.stickers
|
||||
FROM vn.buy b
|
||||
WHERE b.entryFk = vFromEntryFk
|
||||
ORDER BY b.stickers DESC
|
||||
LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk
|
||||
AND bb.stickers >= FLOOR(ish.visible / ish.packing)
|
||||
WHERE shelvingFk = vShelvingFk COLLATE utf8_general_ci
|
||||
GROUP BY ish.id;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
-- Cantidades de la matrícula que exceden la de las entradas
|
||||
SELECT ish.itemFk,
|
||||
i.longName,
|
||||
FLOOR(ish.visible / ish.packing) AS etiEnMatricula,
|
||||
bb.stickers etiEnEntrada
|
||||
FROM vn.itemShelving ish
|
||||
JOIN vn.item i ON i.id = ish.itemFk
|
||||
LEFT JOIN (SELECT b.id, b.itemFk, b.stickers
|
||||
FROM vn.buy b
|
||||
FROM buy b
|
||||
WHERE b.entryFk = vFromEntryFk
|
||||
ORDER BY b.stickers DESC
|
||||
LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk
|
||||
WHERE shelvingFk = vShelvingFk COLLATE utf8_general_ci
|
||||
AND IFNULL(bb.stickers,0) < FLOOR(ish.visible / ish.packing)
|
||||
AND bb.stickers >= FLOOR(ish.visible / ish.packing)
|
||||
WHERE ish.shelvingFk = vShelvingFk COLLATE utf8_general_ci
|
||||
AND NOT ish.isSplit
|
||||
GROUP BY ish.id;
|
||||
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
OPEN cur;
|
||||
|
||||
read_loop: LOOP
|
||||
SET vDone = FALSE;
|
||||
|
||||
FETCH cur INTO vBuyFk, vIshStickers, vBuyStickers;
|
||||
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE read_loop;
|
||||
END IF;
|
||||
|
||||
|
||||
IF vIshStickers = vBuyStickers THEN
|
||||
UPDATE vn.buy
|
||||
UPDATE buy
|
||||
SET entryFk = vToEntryFk
|
||||
WHERE id = vBuyFk;
|
||||
ELSE
|
||||
UPDATE vn.buy
|
||||
UPDATE buy
|
||||
SET stickers = stickers - vIshStickers,
|
||||
quantity = stickers * packing
|
||||
WHERE id = vBuyFk;
|
||||
|
||||
INSERT INTO vn.buy(entryFk,
|
||||
|
||||
INSERT INTO buy(entryFk,
|
||||
itemFk,
|
||||
quantity,
|
||||
buyingValue,
|
||||
|
@ -117,13 +102,16 @@ BEGIN
|
|||
weight,
|
||||
deliveryFk,
|
||||
itemOriginalFk
|
||||
FROM vn.buy
|
||||
FROM buy
|
||||
WHERE id = vBuyFk;
|
||||
|
||||
UPDATE buy SET printedStickers = vIshStickers WHERE id = LAST_INSERT_ID();
|
||||
END IF;
|
||||
END LOOP;
|
||||
|
||||
UPDATE itemShelving
|
||||
SET isSplit = TRUE
|
||||
WHERE shelvingFk = vShelvingFk;
|
||||
END LOOP;
|
||||
CLOSE cur;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -13,20 +13,32 @@ BEGIN
|
|||
* @param vBookEntry Id de asiento, si es NULL se genera uno nuevo
|
||||
*/
|
||||
DECLARE vFiscalYear INT;
|
||||
DECLARE vHasDistinctTransactions INT;
|
||||
DECLARE vDistinctTransactions INT;
|
||||
DECLARE vHasRepeatedTransactions BOOL;
|
||||
|
||||
SELECT COUNT(DISTINCT transactionTypeSageFk) INTO vHasDistinctTransactions
|
||||
SELECT COUNT(DISTINCT iit.transactionTypeSageFk) INTO vDistinctTransactions
|
||||
FROM invoiceIn ii
|
||||
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
|
||||
JOIN invoiceInSerial iis ON iis.code = ii.serial
|
||||
WHERE ii.id = vSelf
|
||||
WHERE iit.invoiceInFk = vSelf
|
||||
AND iis.taxAreaFk = 'CEE'
|
||||
AND transactionTypeSageFk;
|
||||
AND iit.transactionTypeSageFk;
|
||||
|
||||
IF vHasDistinctTransactions > 1 THEN
|
||||
IF vDistinctTransactions > 1 THEN
|
||||
CALL util.throw ('This invoice does not allow different types of transactions');
|
||||
END IF;
|
||||
|
||||
SELECT TRUE INTO vHasRepeatedTransactions
|
||||
FROM invoiceInTax
|
||||
WHERE invoiceInFk = vSelf
|
||||
GROUP BY transactionTypeSageFk
|
||||
HAVING COUNT(transactionTypeSageFk) > 1
|
||||
LIMIT 1;
|
||||
|
||||
IF vHasRepeatedTransactions THEN
|
||||
CALL util.throw ('This invoice contains repeated types of transactions');
|
||||
END IF;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tInvoiceIn
|
||||
ENGINE = MEMORY
|
||||
SELECT ii.bookEntried,
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_GetVisible`(vWarehouse SMALLINT, vItem INT)
|
||||
BEGIN
|
||||
DECLARE vTomorrow DATETIME DEFAULT TIMESTAMPADD(DAY, 1, util.VN_CURDATE());
|
||||
|
||||
INSERT INTO tmp.itemVisible (item_id, visible)
|
||||
SELECT item_id, SUM(amount) amount
|
||||
FROM (
|
||||
SELECT i.itemFk AS item_id, quantity AS amount
|
||||
FROM itemTicketOut i
|
||||
LEFT JOIN ticketState ts ON ts.ticketFk = i.ticketFk
|
||||
JOIN state s ON s.id = ts.stateFk
|
||||
LEFT JOIN (SELECT DISTINCT saleFk
|
||||
FROM saleTracking st
|
||||
JOIN state s ON s.id = st.stateFk
|
||||
WHERE st.created > util.VN_CURDATE()
|
||||
AND (s.isPicked OR st.isChecked)
|
||||
) stPrevious ON `stPrevious`.`saleFk` = i.saleFk
|
||||
WHERE i.warehouseFk = vWarehouse
|
||||
AND (vItem IS NULL OR i.itemFk = vItem)
|
||||
AND (s.isPicked OR i.reserved OR stPrevious.saleFk )
|
||||
AND i.shipped >= util.VN_CURDATE() AND i.shipped < vTomorrow
|
||||
UNION ALL
|
||||
SELECT iei.itemFk, quantity
|
||||
FROM itemEntryIn iei
|
||||
WHERE (iei.isReceived != FALSE /*OR ip.modificationDate > util.VN_CURDATE()*/)
|
||||
AND iei.landed >= util.VN_CURDATE() AND iei.landed < vTomorrow
|
||||
AND iei.warehouseInFk = vWarehouse
|
||||
AND (vItem IS NULL OR iei.itemFk = vItem)
|
||||
AND iei.isVirtualStock is FALSE
|
||||
UNION ALL
|
||||
SELECT itemFk, quantity
|
||||
FROM itemEntryOut
|
||||
WHERE isDelivered != FALSE
|
||||
AND shipped >= util.VN_CURDATE() AND shipped < vTomorrow
|
||||
AND warehouseOutFk = vWarehouse
|
||||
AND (vItem IS NULL OR itemFk = vItem)
|
||||
) t
|
||||
GROUP BY item_id
|
||||
ON DUPLICATE KEY UPDATE
|
||||
visible = IFNULL(stock,0) + VALUES(visible);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,56 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_calcVisible`(
|
||||
vSelf INT,
|
||||
vWarehouseFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Calcula el visible de un artículo o de todos.
|
||||
*
|
||||
* @param vWarehouse Warehouse id
|
||||
* @param vSelf Item id
|
||||
* @param tmp.itemVisible(item_id, stock, visible)
|
||||
*/
|
||||
DECLARE vDated DATE DEFAULT util.VN_CURDATE();
|
||||
DECLARE vTomorrow DATETIME DEFAULT util.tomorrow();
|
||||
|
||||
INSERT INTO tmp.itemVisible(item_id, visible)
|
||||
SELECT itemFk, SUM(quantity)
|
||||
FROM (
|
||||
SELECT i.itemFk, i.quantity
|
||||
FROM itemTicketOut i
|
||||
LEFT JOIN ticketState ts ON ts.ticketFk = i.ticketFk
|
||||
JOIN `state` s ON s.id = ts.stateFk
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT st.saleFk
|
||||
FROM saleTracking st
|
||||
JOIN state s ON s.id = st.stateFk
|
||||
WHERE st.created > vDated
|
||||
AND (s.isPicked OR st.isChecked)
|
||||
) stPrevious ON `stPrevious`.`saleFk` = i.saleFk
|
||||
WHERE IFNULL(vWarehouseFk, i.warehouseFk) = i.warehouseFk
|
||||
AND (vSelf IS NULL OR i.itemFk = vSelf)
|
||||
AND (s.isPicked OR i.reserved OR stPrevious.saleFk)
|
||||
AND i.shipped >= vDated AND i.shipped < vTomorrow
|
||||
UNION ALL
|
||||
SELECT itemFk, quantity
|
||||
FROM itemEntryIn
|
||||
WHERE isReceived
|
||||
AND landed >= vDated AND landed < vTomorrow
|
||||
AND IFNULL(vWarehouseFk, warehouseInFk) = warehouseInFk
|
||||
AND (vSelf IS NULL OR itemFk = vSelf)
|
||||
AND NOT isVirtualStock
|
||||
UNION ALL
|
||||
SELECT itemFk, quantity
|
||||
FROM itemEntryOut
|
||||
WHERE isDelivered
|
||||
AND shipped >= vDated
|
||||
AND shipped < vTomorrow
|
||||
AND IFNULL(vWarehouseFk, warehouseOutFk) = warehouseOutFk
|
||||
AND (vSelf IS NULL OR itemFk = vSelf)
|
||||
) t
|
||||
GROUP BY itemFk
|
||||
ON DUPLICATE KEY UPDATE
|
||||
visible = IFNULL(stock, 0) + VALUES(visible);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -6,7 +6,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_setVisibleDisc
|
|||
vAddressFk INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Procedimiento para dar dar de baja/alta un item, si vAddressFk es NULL se entiende que se da de alta y se toma el addressFk de la configuración
|
||||
* Procedimiento para dar dar de baja/alta un item, si vAdressFk es NULL
|
||||
* se entiende que se da de alta y se toma el addressFk de la configuración
|
||||
*
|
||||
* @param vItemFk Identificador del ítem
|
||||
* @param vWarehouseFk id del warehouse
|
||||
|
|
|
@ -10,6 +10,7 @@ proc: BEGIN
|
|||
DECLARE vDateTo DATETIME;
|
||||
DECLARE vDateToTomorrow DATETIME;
|
||||
DECLARE vDefaultDayRange INT;
|
||||
DECLARE vCalcFk INT;
|
||||
|
||||
IF vDate < util.VN_CURDATE() THEN
|
||||
LEAVE proc;
|
||||
|
@ -40,8 +41,7 @@ proc: BEGIN
|
|||
(PRIMARY KEY (itemFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT itemFk,
|
||||
SUM(quantity) quantity,
|
||||
SUM(quantity) visible
|
||||
SUM(quantity) quantity
|
||||
FROM (
|
||||
SELECT s.itemFk, - s.quantity quantity
|
||||
FROM sale s
|
||||
|
@ -75,56 +75,27 @@ proc: BEGIN
|
|||
) sub
|
||||
GROUP BY itemFk;
|
||||
|
||||
-- Cálculo del visible
|
||||
UPDATE tItemInventoryCalc iic
|
||||
JOIN (
|
||||
SELECT itemFk, SUM(quantity) visible
|
||||
FROM (
|
||||
SELECT s.itemFk, s.quantity
|
||||
FROM sale s
|
||||
JOIN ticket t ON t.id = s.ticketFk
|
||||
JOIN warehouse w ON w.id = t.warehouseFk
|
||||
WHERE t.shipped >= vDate
|
||||
AND t.shipped < vDateTomorrow
|
||||
AND (NOT isPicked AND NOT t.isLabeled AND t.refFk IS NULL)
|
||||
AND IFNULL(vWarehouseFk, t.warehouseFk) = t.warehouseFk
|
||||
AND w.isComparative
|
||||
UNION ALL
|
||||
SELECT b.itemFk, - b.quantity
|
||||
FROM buy b
|
||||
JOIN entry e ON e.id = b.entryFk
|
||||
JOIN travel t ON t.id = e.travelFk
|
||||
JOIN warehouse w ON w.id = t.warehouseInFk
|
||||
WHERE t.landed = vDate
|
||||
AND NOT t.isReceived
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT e.isRaid
|
||||
AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk
|
||||
AND w.isComparative
|
||||
UNION ALL
|
||||
SELECT b.itemFk, b.quantity
|
||||
FROM buy b
|
||||
JOIN entry e ON e.id = b.entryFk
|
||||
JOIN travel t ON t.id = e.travelFk
|
||||
JOIN warehouse w ON w.id = t.warehouseOutFk
|
||||
WHERE t.shipped = vDate
|
||||
AND NOT t.isReceived
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT e.isRaid
|
||||
AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk
|
||||
AND w.isComparative
|
||||
) sub2
|
||||
GROUP BY itemFk
|
||||
) sub ON sub.itemFk = iic.itemFk
|
||||
SET iic.visible = iic.visible + sub.visible;
|
||||
|
||||
UPDATE tmp.itemInventory ai
|
||||
JOIN tItemInventoryCalc iic ON iic.itemFk = ai.id
|
||||
SET ai.inventory = iic.quantity,
|
||||
ai.visible = iic.visible,
|
||||
ai.visible = iic.quantity,
|
||||
ai.avalaible = iic.quantity,
|
||||
ai.sd = iic.quantity;
|
||||
|
||||
-- Cálculo del visible
|
||||
CALL cache.visible_refresh(vCalcFk, FALSE, vWarehouseFk);
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tItemVisibleCalc
|
||||
(PRIMARY KEY (item_id))
|
||||
ENGINE = MEMORY
|
||||
SELECT item_id, visible
|
||||
FROM cache.visible
|
||||
WHERE calc_id = vCalcFk;
|
||||
|
||||
UPDATE tmp.itemInventory it
|
||||
JOIN tItemVisibleCalc ivc ON ivc.item_id = it.id
|
||||
SET it.visible = it.visible + ivc.visible;
|
||||
|
||||
-- Calculo del disponible
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.itemCalc
|
||||
(INDEX (itemFk, warehouseFk))
|
||||
|
@ -194,7 +165,8 @@ proc: BEGIN
|
|||
DROP TEMPORARY TABLE
|
||||
tmp.itemTravel,
|
||||
tmp.itemCalc,
|
||||
tmp.itemAtp,
|
||||
tItemInventoryCalc,
|
||||
tmp.itemAtp;
|
||||
tItemVisibleCalc;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -15,6 +15,11 @@ proc: BEGIN
|
|||
DECLARE vEndingDate DATETIME;
|
||||
DECLARE vIsTodayRelative BOOLEAN;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
SELECT util.dayEnd(util.VN_CURDATE()) + INTERVAL LEAST(vScopeDays, maxProductionScopeDays) DAY
|
||||
INTO vEndingDate
|
||||
FROM productionConfig;
|
||||
|
@ -31,7 +36,8 @@ proc: BEGIN
|
|||
CALL prepareClientList();
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_getProblems
|
||||
(INDEX (ticketFk)) ENGINE = MEMORY
|
||||
(INDEX (ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT tt.ticketFk, tt.clientFk, t.warehouseFk, t.shipped
|
||||
FROM tmp.productionTicket tt
|
||||
JOIN ticket t ON t.id = tt.ticketFk;
|
||||
|
|
|
@ -278,12 +278,11 @@ BEGIN
|
|||
-- Redondeo: Cantidad pedida incorrecta en al grouping de la última compra
|
||||
CALL buyUltimate(vWarehouseFk, vDate);
|
||||
INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
|
||||
SELECT ticketFk, problem, saleFk
|
||||
SELECT ticketFk, problem ,saleFk
|
||||
FROM (
|
||||
SELECT tl.ticketFk,
|
||||
s.id saleFk ,
|
||||
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,''), ' '), 250) problem,
|
||||
MOD(s.quantity, b.`grouping`) hasRounding
|
||||
s.id saleFk,
|
||||
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
|
||||
FROM tmp.ticket_list tl
|
||||
JOIN ticket t ON t.id = tl.ticketFk
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
|
@ -291,9 +290,9 @@ BEGIN
|
|||
JOIN item i ON i.id = s.itemFk
|
||||
JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
|
||||
JOIN buy b ON b.id = bu.buyFk
|
||||
WHERE MOD(s.quantity, b.`grouping`)
|
||||
GROUP BY tl.ticketFk
|
||||
HAVING hasRounding
|
||||
) sub
|
||||
)sub
|
||||
ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
|
||||
END LOOP;
|
||||
CLOSE vCursor;
|
||||
|
|
|
@ -9,6 +9,11 @@ BEGIN
|
|||
*/
|
||||
DECLARE vStateFk INT;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
INSERT INTO ticket (
|
||||
clientFk,
|
||||
shipped,
|
||||
|
|
|
@ -1,59 +1,79 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_splitItemPackingType`(
|
||||
vTicketFk INT,
|
||||
vOriginalItemPackingTypeFk VARCHAR(1)
|
||||
vSelf INT,
|
||||
vItemPackingTypeFk VARCHAR(1)
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Clona y reparte las ventas de un ticket en funcion del tipo de empaquetado.
|
||||
* Respeta el id inicial para el tipo propuesto.
|
||||
*
|
||||
* @param vTicketFk Identificador de vn.ticket
|
||||
* @param vOriginalItemPackingTypeFk Tipo para el que se reserva el número de ticket original
|
||||
* @param vSelf Id ticket
|
||||
* @param vItemPackingTypeFk Tipo para el que se reserva el número de ticket original
|
||||
* @return table tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
*/
|
||||
DECLARE vItemPackingTypeFk VARCHAR(1) DEFAULT 'H';
|
||||
DECLARE vNewTicketFk INT;
|
||||
DECLARE vPackingTypesToSplit INT;
|
||||
DECLARE vDone INT DEFAULT FALSE;
|
||||
DECLARE vErrorNumber INT;
|
||||
DECLARE vErrorMsg TEXT;
|
||||
|
||||
DECLARE cur1 CURSOR FOR
|
||||
DECLARE vSaleGroup CURSOR FOR
|
||||
SELECT itemPackingTypeFk
|
||||
FROM tmp.saleGroup
|
||||
FROM tSaleGroup
|
||||
WHERE itemPackingTypeFk IS NOT NULL
|
||||
ORDER BY (itemPackingTypeFk = vOriginalItemPackingTypeFk) DESC;
|
||||
ORDER BY (itemPackingTypeFk = vItemPackingTypeFk) DESC;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
GET DIAGNOSTICS CONDITION 1
|
||||
vErrorNumber = MYSQL_ERRNO,
|
||||
vErrorMsg = MESSAGE_TEXT;
|
||||
|
||||
CALL util.debugAdd('ticket_splitItemPackingType', JSON_OBJECT(
|
||||
'errorNumber', vErrorNumber,
|
||||
'errorMsg', vErrorMsg,
|
||||
'ticketFk', vSelf
|
||||
)); -- Tmp
|
||||
ROLLBACK;
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
DELETE FROM vn.sale
|
||||
WHERE quantity = 0
|
||||
AND ticketFk = vTicketFk;
|
||||
START TRANSACTION;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.sale
|
||||
SELECT id
|
||||
FROM sale
|
||||
WHERE ticketFk = vSelf
|
||||
AND NOT quantity
|
||||
FOR UPDATE;
|
||||
|
||||
DELETE FROM sale
|
||||
WHERE NOT quantity
|
||||
AND ticketFk = vSelf;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSale
|
||||
(PRIMARY KEY (id))
|
||||
ENGINE = MEMORY
|
||||
SELECT s.id, i.itemPackingTypeFk , IFNULL(sv.litros, 0) litros
|
||||
FROM vn.sale s
|
||||
JOIN vn.item i ON i.id = s.itemFk
|
||||
LEFT JOIN vn.saleVolume sv ON sv.saleFk = s.id
|
||||
WHERE s.ticketFk = vTicketFk;
|
||||
SELECT s.id, i.itemPackingTypeFk, IFNULL(sv.litros, 0) litros
|
||||
FROM sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
LEFT JOIN saleVolume sv ON sv.saleFk = s.id
|
||||
WHERE s.ticketFk = vSelf;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.saleGroup
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSaleGroup
|
||||
ENGINE = MEMORY
|
||||
SELECT itemPackingTypeFk, SUM(litros) totalLitros
|
||||
FROM tmp.sale
|
||||
FROM tSale
|
||||
GROUP BY itemPackingTypeFk;
|
||||
|
||||
SELECT COUNT(*) INTO vPackingTypesToSplit
|
||||
FROM tmp.saleGroup
|
||||
FROM tSaleGroup
|
||||
WHERE itemPackingTypeFk IS NOT NULL;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT (
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT(
|
||||
ticketFk INT,
|
||||
itemPackingTypeFk VARCHAR(1)
|
||||
) ENGINE = MEMORY;
|
||||
|
@ -61,55 +81,63 @@ BEGIN
|
|||
CASE vPackingTypesToSplit
|
||||
WHEN 0 THEN
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
VALUES(vTicketFk, vItemPackingTypeFk);
|
||||
VALUES(vSelf, vItemPackingTypeFk);
|
||||
WHEN 1 THEN
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
SELECT vTicketFk, itemPackingTypeFk
|
||||
FROM tmp.saleGroup
|
||||
SELECT vSelf, itemPackingTypeFk
|
||||
FROM tSaleGroup
|
||||
WHERE itemPackingTypeFk IS NOT NULL;
|
||||
ELSE
|
||||
OPEN cur1;
|
||||
|
||||
FETCH cur1 INTO vItemPackingTypeFk;
|
||||
OPEN vSaleGroup;
|
||||
FETCH vSaleGroup INTO vItemPackingTypeFk;
|
||||
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
VALUES(vTicketFk, vItemPackingTypeFk);
|
||||
VALUES(vSelf, vItemPackingTypeFk);
|
||||
|
||||
read_loop: LOOP
|
||||
FETCH cur1 INTO vItemPackingTypeFk;
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH vSaleGroup INTO vItemPackingTypeFk;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE read_loop;
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
CALL vn.ticket_Clone(vTicketFk, vNewTicketFk);
|
||||
CALL ticket_Clone(vSelf, vNewTicketFk);
|
||||
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
VALUES(vNewTicketFk, vItemPackingTypeFk);
|
||||
END LOOP;
|
||||
|
||||
CLOSE cur1;
|
||||
CLOSE vSaleGroup;
|
||||
|
||||
UPDATE vn.sale s
|
||||
JOIN tmp.sale ts ON ts.id = s.id
|
||||
SELECT s.id
|
||||
FROM sale s
|
||||
JOIN tSale ts ON ts.id = s.id
|
||||
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
|
||||
FOR UPDATE;
|
||||
|
||||
UPDATE sale s
|
||||
JOIN tSale ts ON ts.id = s.id
|
||||
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
|
||||
SET s.ticketFk = t.ticketFk;
|
||||
|
||||
SELECT itemPackingTypeFk INTO vItemPackingTypeFk
|
||||
FROM tmp.saleGroup sg
|
||||
FROM tSaleGroup sg
|
||||
WHERE sg.itemPackingTypeFk IS NOT NULL
|
||||
ORDER BY sg.itemPackingTypeFk
|
||||
LIMIT 1;
|
||||
|
||||
UPDATE vn.sale s
|
||||
JOIN tmp.sale ts ON ts.id = s.id
|
||||
UPDATE sale s
|
||||
JOIN tSale ts ON ts.id = s.id
|
||||
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = vItemPackingTypeFk
|
||||
SET s.ticketFk = t.ticketFk
|
||||
WHERE ts.itemPackingTypeFk IS NULL;
|
||||
END CASE;
|
||||
|
||||
COMMIT;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.sale,
|
||||
tmp.saleGroup;
|
||||
tSale,
|
||||
tSaleGroup;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -9,6 +9,8 @@ BEGIN
|
|||
*/
|
||||
DECLARE vLastIn DATETIME ;
|
||||
DECLARE vIsMiddleOdd BOOLEAN ;
|
||||
DECLARE vMailTo VARCHAR(50) DEFAULT NULL;
|
||||
DECLARE vUserName VARCHAR(50) DEFAULT NULL;
|
||||
|
||||
IF (vTimed IS NULL) THEN
|
||||
SET vTimed = util.VN_NOW();
|
||||
|
@ -57,5 +59,18 @@ BEGIN
|
|||
VALUES('in', NULL);
|
||||
END IF;
|
||||
|
||||
IF (SELECT option1 IS NULL AND option2 IS NULL FROM tmp.workerTimeControlDirection) THEN
|
||||
SELECT CONCAT(u.name, '@verdnatura.es'), CONCAT(w.firstName, ' ', w.lastName)
|
||||
INTO vMailTo, vUserName
|
||||
FROM account.user u
|
||||
JOIN worker w ON w.bossFk = u.id
|
||||
WHERE w.id = vWorkerFk;
|
||||
|
||||
CALL mail_insert(
|
||||
vMailTo,
|
||||
vMailTo,
|
||||
'Error al fichar',
|
||||
CONCAT(vUserName, ' tiene problemas para fichar'));
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -11,11 +11,9 @@ BEGIN
|
|||
IF NEW.isBooked = OLD.isBooked AND (
|
||||
NOT (NEW.supplierFk <=> OLD.supplierFk) OR
|
||||
NOT (NEW.dated <=> OLD.dated) OR
|
||||
NOT (NEW.invoiceNumber <=> OLD.invoiceNumber) OR
|
||||
NOT (NEW.travelFk <=> OLD.travelFk) OR
|
||||
NOT (NEW.companyFk <=> OLD.companyFk) OR
|
||||
NOT (NEW.invoiceInFk <=> OLD.invoiceInFk) OR
|
||||
NOT (NEW.invoiceAmount <=> OLD.invoiceAmount) OR
|
||||
NOT (NEW.typeFk <=> OLD.typeFk)
|
||||
) THEN
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
ALTER TABLE vn.claimLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.clientLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.deviceProductionLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.entryLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.invoiceInLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.itemLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.packingSiteDeviceLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.parkingLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.rateLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.routeLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.shelvingLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.supplierLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.ticketLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.travelLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.userLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.workerLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE vn.zoneLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
|
||||
ALTER TABLE account.userLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE account.signInLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE account.roleLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
||||
ALTER TABLE account.accountLog ADD COLUMN IF NOT EXISTS summaryId varchar(30);
|
|
@ -0,0 +1,8 @@
|
|||
-- Place your SQL code here
|
||||
|
||||
USE vn;
|
||||
|
||||
ALTER TABLE vn.roadmap ADD kmStart mediumint(9) DEFAULT NULL NULL;
|
||||
ALTER TABLE vn.roadmap ADD kmEnd mediumint(9) DEFAULT NULL NULL;
|
||||
ALTER TABLE vn.roadmap ADD started DATETIME NULL;
|
||||
ALTER TABLE vn.roadmap ADD finished DATETIME NULL;
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
INSERT IGNORE INTO salix.ACL (`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`)
|
||||
VALUES ('Entry','filter','READ','ALLOW','ROLE','supplier');
|
||||
|
||||
INSERT IGNORE INTO salix.ACL (`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`)
|
||||
VALUES ('Entry','getBuys','READ','ALLOW','ROLE','supplier');
|
||||
|
||||
INSERT IGNORE INTO salix.ACL (`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`)
|
||||
VALUES ('Entry','buyLabel','READ','ALLOW','ROLE','supplier');
|
||||
|
||||
INSERT IGNORE INTO `account`.`role` (`name`,`description`,`hasLogin`,`created`,`modified`)
|
||||
VALUES ('supplier','Proveedores',1,'2017-10-10 14:58:58.000','2017-10-10 14:59:20.000');
|
||||
SET @supplierFk =LAST_INSERT_ID();
|
||||
INSERT IGNORE INTO account.roleInherit (`role`,`inheritsFrom`)
|
||||
VALUES (@supplierFk,2);
|
||||
|
||||
UPDATE salix.ACL
|
||||
SET principalId='$authenticated'
|
||||
WHERE id=264;
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.calendar ADD created timestamp DEFAULT current_timestamp() NOT NULL AFTER dated;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.greuge CHANGE Id id int(10) unsigned auto_increment NOT NULL;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.itemShelving ADD isSplit tinyint(1) NULL COMMENT 'Este valor cambia al splitar un carro que se ha quedado en holanda';
|
|
@ -0,0 +1,2 @@
|
|||
INSERT IGNORE INTO vn.observationType (`description`,code)
|
||||
VALUES ('Sustitución','substitution');
|
|
@ -0,0 +1,42 @@
|
|||
USE `vn`;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS vn.`tillSerial` (
|
||||
`code` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL,
|
||||
`description` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
||||
`account` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (`code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES(' S', 'Saldos final / inicial', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('A', 'Factura cliente', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('B', 'Factura cliente', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('C', 'Facturas Contado', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('CC', 'Cuadre caja', '6780000000');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('CD', 'Cuenta Director Comercial', '5510000002');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('CH', 'Cheques', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('CM', 'Cambio', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('CR', 'Ingreso/Reintegro Caja Rural', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('CT', 'Correos y telégrafos', '6290000005');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('DC', 'Dietas conductores', '6290000010');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('DH', 'Deudas Holland', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('DT', 'Dietas', '6290000011');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('E', 'Entrada mercancia', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('EN', 'Enric Martinez', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('GC', 'Cuenta con dto. Comercial', '5510000003');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('GP', 'Gastos de personal', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('GR', 'Gastos RRPP dpto comercial', '6290001002');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('GS', 'Gasoil', '6280000002');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('GV', 'Gastos viaje', '6290001000');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('JV', 'Juanvi', '6290000553');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('MB', 'Movimiento bancario', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('MP', 'Materias Primas', '6000000000');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('OG', 'Otros gastos', '6290000000');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('PM', 'Pequeño material', '6290000007');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('R', 'Factura proveedor', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('RC', 'Ingreso/Reintegro Ruralcaja', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('RN', 'Reparación nave', '6220000004');
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('SS', 'Gastos Silla', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('T', 'Ticket', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('TA', 'Factura rapida', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('TC', 'Ticket contado', NULL);
|
||||
INSERT IGNORE vn.tillSerial (code, `description`, account) VALUES('TR', 'Traspaso', NULL);
|
|
@ -0,0 +1,6 @@
|
|||
RENAME TABLE vn.addressShortage TO vn.addressWaste;
|
||||
ALTER TABLE vn.addressWaste ADD `type` ENUM('internal', 'external') NOT NULL;
|
||||
INSERT IGNORE INTO vn.addressWaste (addressFk,`type`) VALUES
|
||||
(2230,'external'),
|
||||
(5986,'external'),
|
||||
(7475,'external');
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE vn.expeditionState
|
||||
MODIFY COLUMN userFk INT(10) UNSIGNED,
|
||||
ADD CONSTRAINT expeditionState_userFk FOREIGN KEY (userFk)
|
||||
REFERENCES account.`user`(id);
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE `vn`.`claimDestination`
|
||||
ADD COLUMN `code` varchar(45) DEFAULT NULL;
|
||||
|
||||
UPDATE IGNORE vn.claimDestination SET code='Good' WHERE description= 'Bueno';
|
||||
UPDATE IGNORE vn.claimDestination SET code='Garbage/Loss' WHERE description = 'Basura/Perd.';
|
||||
UPDATE IGNORE vn.claimDestination SET code='Manufacturing' WHERE description = 'Confeccion';
|
||||
UPDATE IGNORE vn.claimDestination SET code='Claim' WHERE description = 'Reclam.PRAG';
|
||||
UPDATE IGNORE vn.claimDestination SET code='Corrected' WHERE description = 'Corregido';
|
|
@ -0,0 +1,6 @@
|
|||
-- Place your SQL code here
|
||||
ALTER TABLE vn.mrwConfig ADD IF NOT EXISTS clientTypeWidth int(10) unsigned NULL
|
||||
COMMENT 'If it does not reach the required value, it will be padded with zeros on the left to meet the specified length.';
|
||||
|
||||
UPDATE vn.mrwConfig
|
||||
SET clientTypeWidth = 6;
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE vn.payrollWorker CHANGE grupotarifa__ grupotarifa int(10) NOT NULL;
|
||||
ALTER TABLE vn.payrollWorker MODIFY COLUMN grupotarifa int(10) NOT NULL;
|
|
@ -2,18 +2,9 @@ const models = require('vn-loopback/server/server').models;
|
|||
|
||||
describe('Application execute()/executeProc()/executeFunc()', () => {
|
||||
const userWithoutPrivileges = 1;
|
||||
const userWithPrivileges = 9;
|
||||
const userWithInheritedPrivileges = 120;
|
||||
let tx;
|
||||
|
||||
function getCtx(userId) {
|
||||
return {
|
||||
req: {
|
||||
accessToken: {userId},
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
};
|
||||
}
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
beforeEach(async() => {
|
||||
tx = await models.Application.beginTransaction({});
|
||||
|
@ -42,7 +33,7 @@ describe('Application execute()/executeProc()/executeFunc()', () => {
|
|||
});
|
||||
|
||||
it('should throw error when execute procedure and not have privileges', async() => {
|
||||
const ctx = getCtx(userWithoutPrivileges);
|
||||
const ctx = {req: {accessToken: {userId: userWithoutPrivileges}}};
|
||||
|
||||
let error;
|
||||
try {
|
||||
|
@ -66,7 +57,6 @@ describe('Application execute()/executeProc()/executeFunc()', () => {
|
|||
});
|
||||
|
||||
it('should execute procedure and get data', async() => {
|
||||
const ctx = getCtx(userWithPrivileges);
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
|
@ -90,7 +80,6 @@ describe('Application execute()/executeProc()/executeFunc()', () => {
|
|||
|
||||
describe('Application executeProc()', () => {
|
||||
it('should execute procedure and get data (executeProc)', async() => {
|
||||
const ctx = getCtx(userWithPrivileges);
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
|
@ -115,7 +104,6 @@ describe('Application execute()/executeProc()/executeFunc()', () => {
|
|||
|
||||
describe('Application executeFunc()', () => {
|
||||
it('should execute function and get data', async() => {
|
||||
const ctx = getCtx(userWithPrivileges);
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
|
@ -137,7 +125,7 @@ describe('Application execute()/executeProc()/executeFunc()', () => {
|
|||
});
|
||||
|
||||
it('should execute function and get data with user with inherited privileges', async() => {
|
||||
const ctx = getCtx(userWithInheritedPrivileges);
|
||||
const ctx = {req: {accessToken: {userId: userWithInheritedPrivileges}}};
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ module.exports = Self => {
|
|||
const locale = modelLocale && modelLocale.get(lang);
|
||||
|
||||
json[modelName] = {
|
||||
http: model.sharedClass.http.path,
|
||||
properties: model.definition.rawProperties,
|
||||
validations: jsonValidations,
|
||||
locale
|
||||
|
|
|
@ -1,20 +1,7 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Model crud()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
let insertId;
|
||||
const barcodeModel = app.models.ItemBarcode;
|
||||
|
||||
|
|
|
@ -1,20 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Model rewriteDbError()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should extend rewriteDbError properties to any model passed', () => {
|
||||
const exampleModel = models.ItemTag;
|
||||
|
|
|
@ -2,15 +2,7 @@ const app = require('vn-loopback/server/server');
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('claim filter()', () => {
|
||||
let ctx;
|
||||
beforeEach(() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 9},
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
};
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should return 1 result filtering by id', async() => {
|
||||
const tx = await app.models.Claim.beginTransaction({});
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('claim regularizeClaim()', () => {
|
||||
const userId = 18;
|
||||
const ctx = {
|
||||
req: {
|
||||
accessToken: {userId: userId},
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
};
|
||||
const ctx = beforeAll.mockLoopBackContext(userId);
|
||||
ctx.req.__ = (value, params) => {
|
||||
return params.nickname;
|
||||
};
|
||||
|
||||
const chatModel = models.Chat;
|
||||
const claimId = 1;
|
||||
const ticketId = 1;
|
||||
|
@ -40,20 +33,6 @@ describe('claim regularizeClaim()', () => {
|
|||
return await models.ClaimEnd.create(claimEnds, options);
|
||||
}
|
||||
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
|
||||
it('should send a chat message with value "Trash" and then change claim state to resolved', async() => {
|
||||
const tx = await models.Claim.beginTransaction({});
|
||||
|
||||
|
|
|
@ -1,22 +1,10 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
const i18n = require('i18n');
|
||||
describe('Update Claim', () => {
|
||||
let url;
|
||||
let claimStatesMap = {};
|
||||
beforeAll.mockLoopBackContext();
|
||||
beforeAll(async() => {
|
||||
url = await app.models.Url.getUrl();
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
const claimStates = await app.models.ClaimState.find();
|
||||
claimStatesMap = claimStates.reduce((acc, state) => ({...acc, [state.code]: state.id}), {});
|
||||
});
|
||||
|
|
|
@ -1,20 +1,7 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Update Claim', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
const newDate = Date.vnNew();
|
||||
const original = {
|
||||
ticketFk: 3,
|
||||
|
|
|
@ -1,23 +1,10 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Client addressesPropagateRe', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
|
||||
it('should propagate the isEqualizated on both addresses of Mr Wayne and set hasToInvoiceByAddress to false', async() => {
|
||||
it('should propagate the isEqualizated on both addresses of Mr Wayne' +
|
||||
' and set hasToInvoiceByAddress to false', async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
||||
try {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Address createAddress', () => {
|
||||
const clientFk = 1101;
|
||||
|
@ -7,20 +6,7 @@ describe('Address createAddress', () => {
|
|||
const incotermsFk = 'FAS';
|
||||
const customAgentOneId = 1;
|
||||
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should throw a non uee member error if no incoterms is defined', async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Client Create', () => {
|
||||
const newAccount = {
|
||||
userName: 'deadpool',
|
||||
|
@ -16,20 +14,7 @@ describe('Client Create', () => {
|
|||
const newAccountWithoutEmail = JSON.parse(JSON.stringify(newAccount));
|
||||
delete newAccountWithoutEmail.email;
|
||||
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it(`should not find deadpool as he's not created yet`, async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('Client getCard()', () => {
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should receive a formated card of Bruce Wayne', async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
||||
try {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const options = {transaction: tx};
|
||||
|
||||
const id = 1101;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('client getDebt()', () => {
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should return the client debt', async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('client sendSms()', () => {
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should now send a message and log it', async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const id = 1101;
|
||||
const destination = 222222222;
|
||||
const message = 'this is the message created in a test';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('client summary()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should return a summary object containing data', async() => {
|
||||
const clientId = 1101;
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Address updateAddress', () => {
|
||||
const clientId = 1101;
|
||||
const addressId = 1;
|
||||
|
@ -14,20 +12,7 @@ describe('Address updateAddress', () => {
|
|||
}
|
||||
};
|
||||
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should throw the non uee member error if no incoterms is defined', async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"AddressObservation": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"AddressShortage": {
|
||||
"AddressWaste": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"BankEntity": {
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
{
|
||||
"name": "AddressShortage",
|
||||
"name": "AddressWaste",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "addressShortage"
|
||||
"table": "addressWaste"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"addressFk": {
|
||||
"type": "number",
|
||||
"id": true
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"id": true
|
||||
}
|
||||
},
|
||||
"relations": {
|
|
@ -1,24 +1,10 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('loopback model address', () => {
|
||||
let createdAddressId;
|
||||
const clientId = 1101;
|
||||
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
afterAll(async() => {
|
||||
const client = await models.Client.findById(clientId);
|
||||
|
|
|
@ -29,7 +29,8 @@ module.exports = Self => {
|
|||
http: {
|
||||
path: '/:id/buy-label',
|
||||
verb: 'GET'
|
||||
}
|
||||
},
|
||||
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||
});
|
||||
|
||||
Self.buyLabel = (ctx, id) => Self.printReport(ctx, id, 'buy-label');
|
||||
|
|
|
@ -112,7 +112,6 @@ module.exports = Self => {
|
|||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
const conn = Self.dataSource.connector;
|
||||
const where = buildFilter(ctx.args, (param, value) => {
|
||||
switch (param) {
|
||||
|
@ -146,7 +145,13 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
filter = mergeFilters(ctx.args.filter, {where});
|
||||
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const client = await Self.app.models.Client.findById(userId, myOptions);
|
||||
const supplier = await Self.app.models.Supplier.findOne({where: {nif: client.fi}}, myOptions);
|
||||
if (supplier) {
|
||||
if (!filter.where) filter.where = {};
|
||||
filter.where[`e.supplierFk`] = supplier.id;
|
||||
}
|
||||
const stmts = [];
|
||||
let stmt;
|
||||
stmt = new ParameterizedSQL(
|
||||
|
@ -158,7 +163,7 @@ module.exports = Self => {
|
|||
e.invoiceNumber,
|
||||
e.isBooked,
|
||||
e.isExcludedFromAvailable,
|
||||
e.evaNotes AS observation,
|
||||
e.evaNotes observation,
|
||||
e.isConfirmed,
|
||||
e.isOrdered,
|
||||
e.isRaid,
|
||||
|
@ -170,13 +175,19 @@ module.exports = Self => {
|
|||
e.gestDocFk,
|
||||
e.invoiceInFk,
|
||||
t.landed,
|
||||
s.name AS supplierName,
|
||||
s.nickname AS supplierAlias,
|
||||
co.code AS companyCode,
|
||||
cu.code AS currencyCode
|
||||
s.name supplierName,
|
||||
s.nickname supplierAlias,
|
||||
co.code companyCode,
|
||||
cu.code currencyCode,
|
||||
t.shipped,
|
||||
t.landed,
|
||||
t.ref AS travelRef,
|
||||
t.warehouseInFk,
|
||||
w.name warehouseInName
|
||||
FROM vn.entry e
|
||||
JOIN vn.supplier s ON s.id = e.supplierFk
|
||||
JOIN vn.travel t ON t.id = e.travelFk
|
||||
JOIN vn.warehouse w ON w.id = t.warehouseInFk
|
||||
JOIN vn.company co ON co.id = e.companyFk
|
||||
JOIN vn.currency cu ON cu.id = e.currencyFk`
|
||||
);
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
const mergeFilters = require('vn-loopback/util/filter').mergeFilters;
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('getBuys', {
|
||||
Self.remoteMethodCtx('getBuys', {
|
||||
description: 'Returns buys for one entry',
|
||||
accessType: 'READ',
|
||||
accepts: [{
|
||||
|
@ -27,13 +29,20 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.getBuys = async(id, filter, options) => {
|
||||
Self.getBuys = async(ctx, id, filter, options) => {
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
const client = await Self.app.models.Client.findById(userId, myOptions);
|
||||
const supplier = await Self.app.models.Supplier.findOne({where: {nif: client.fi}}, myOptions);
|
||||
if (supplier) {
|
||||
const isEntryOwner = (await Self.findById(id)).supplierFk === supplier.id;
|
||||
|
||||
if (!isEntryOwner) throw new UserError('Access Denied');
|
||||
}
|
||||
let defaultFilter = {
|
||||
where: {entryFk: id},
|
||||
fields: [
|
||||
|
@ -49,9 +58,23 @@ module.exports = Self => {
|
|||
'buyingValue',
|
||||
'price2',
|
||||
'price3',
|
||||
'printedStickers'
|
||||
'printedStickers',
|
||||
'entryFk'
|
||||
],
|
||||
include: {
|
||||
include: [{
|
||||
relation: 'entry',
|
||||
scope: {
|
||||
fields: [
|
||||
'id', 'supplierFk'
|
||||
],
|
||||
include: {
|
||||
relation: 'supplier', scope: {
|
||||
fields: ['id']
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
relation: 'item',
|
||||
scope: {
|
||||
fields: [
|
||||
|
@ -82,9 +105,8 @@ module.exports = Self => {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
defaultFilter = mergeFilters(defaultFilter, filter);
|
||||
|
||||
return models.Buy.find(defaultFilter, myOptions);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('entry addFromPackaging()', () => {
|
||||
const supplier = 442;
|
||||
|
@ -7,22 +6,10 @@ describe('entry addFromPackaging()', () => {
|
|||
const yesterday = new Date(today);
|
||||
yesterday.setDate(today.getDate() - 1);
|
||||
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 49},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'},
|
||||
},
|
||||
},
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx,
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should create an incoming travel', async() => {
|
||||
const ctx = {args: {isTravelReception: true, supplier}};
|
||||
const ctx = {accessToken: {userId: 49}, args: {isTravelReception: true, supplier}};
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Buy editLatestsBuys()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should change the value of a given column for the selected buys', async() => {
|
||||
const tx = await models.Buy.beginTransaction({});
|
||||
|
|
|
@ -9,7 +9,8 @@ describe('Entry filter()', () => {
|
|||
const ctx = {
|
||||
args: {
|
||||
search: 1
|
||||
}
|
||||
},
|
||||
req: {accessToken: {userId: 9}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
@ -32,7 +33,8 @@ describe('Entry filter()', () => {
|
|||
const ctx = {
|
||||
args: {
|
||||
currencyFk: 1
|
||||
}
|
||||
},
|
||||
req: {accessToken: {userId: 9}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
@ -46,26 +48,73 @@ describe('Entry filter()', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it('should return the entry matching the supplier', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
describe('should return the entry matching the supplier', () => {
|
||||
it('when userId is supplier ', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
supplierFk: 2
|
||||
}
|
||||
};
|
||||
try {
|
||||
const ctx = {
|
||||
args: {},
|
||||
req: {accessToken: {userId: 1102}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
||||
expect(result.length).toEqual(6);
|
||||
expect(result.length).toEqual(6);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('when userId is supplier fetching other supplier', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
supplierFk: 1
|
||||
},
|
||||
req: {accessToken: {userId: 1102}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
||||
expect(result.length).toEqual(6);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('when userId is not supplier', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
supplierFk: 2
|
||||
},
|
||||
req: {accessToken: {userId: 9}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
||||
expect(result.length).toEqual(6);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('should return the entry matching the company', async() => {
|
||||
|
@ -76,7 +125,8 @@ describe('Entry filter()', () => {
|
|||
const ctx = {
|
||||
args: {
|
||||
companyFk: 442
|
||||
}
|
||||
},
|
||||
req: {accessToken: {userId: 9}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
@ -98,7 +148,8 @@ describe('Entry filter()', () => {
|
|||
const ctx = {
|
||||
args: {
|
||||
isBooked: true,
|
||||
}
|
||||
},
|
||||
req: {accessToken: {userId: 9}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
@ -121,7 +172,8 @@ describe('Entry filter()', () => {
|
|||
args: {
|
||||
reference: 'movement',
|
||||
travelFk: '2'
|
||||
}
|
||||
},
|
||||
req: {accessToken: {userId: 9}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.filter(ctx, options);
|
||||
|
|
|
@ -1,24 +1,82 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('entry getBuys()', () => {
|
||||
const entryId = 4;
|
||||
it('should get the buys and items of an entry', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
describe('should get the buys and items of an entry ', () => {
|
||||
it('when is supplier and entry owner', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const result = await models.Entry.getBuys(entryId, options);
|
||||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
search: 1
|
||||
},
|
||||
req: {accessToken: {userId: 2}}
|
||||
};
|
||||
|
||||
const length = result.length;
|
||||
const anyResult = result[Math.floor(Math.random() * Math.floor(length))];
|
||||
const result = await models.Entry.getBuys(ctx, entryId, options);
|
||||
|
||||
expect(result.length).toEqual(4);
|
||||
expect(anyResult.item).toBeDefined();
|
||||
const length = result.length;
|
||||
const anyResult = result[Math.floor(Math.random() * Math.floor(length))];
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
expect(result.length).toEqual(4);
|
||||
expect(anyResult.item).toBeDefined();
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('when is supplier but not entry owner', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
const entryId = 1;
|
||||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
search: 1
|
||||
},
|
||||
req: {accessToken: {userId: 1102}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.getBuys(ctx, entryId, options);
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
} catch (error) {
|
||||
expect(error).toBeInstanceOf(UserError);
|
||||
expect(error.message).toBe('Access Denied');
|
||||
}
|
||||
});
|
||||
|
||||
it('when is not supplier', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
search: 1
|
||||
},
|
||||
req: {accessToken: {userId: 9}}
|
||||
};
|
||||
|
||||
const result = await models.Entry.getBuys(ctx, entryId, options);
|
||||
|
||||
const length = result.length;
|
||||
const anyResult = result[Math.floor(Math.random() * Math.floor(length))];
|
||||
|
||||
expect(result.length).toEqual(4);
|
||||
expect(anyResult.item).toBeDefined();
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
const activeCtx = {accessToken: {userId: 9}};
|
||||
|
||||
describe('entry importBuysPreview()', () => {
|
||||
const entryId = 1;
|
||||
beforeAll(async() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should return the buys with the calculated packagingFk', async() => {
|
||||
const tx = await models.Entry.beginTransaction({});
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
const LoopBackContext = require('loopback-context');
|
||||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('invoiceInDueDay new()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should correctly create a new due day', async() => {
|
||||
const userId = 9;
|
||||
|
|
|
@ -1,24 +1,11 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('invoiceIn clone()', () => {
|
||||
let ctx;
|
||||
const ctx = beforeAll.getCtx();
|
||||
let options;
|
||||
let tx;
|
||||
|
||||
beforeEach(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 1},
|
||||
headers: {origin: 'http://localhost'}
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: ctx.req
|
||||
});
|
||||
|
||||
options = {transaction: tx};
|
||||
tx = await models.Sale.beginTransaction({});
|
||||
options.transaction = tx;
|
||||
|
@ -28,7 +15,8 @@ describe('invoiceIn clone()', () => {
|
|||
await tx.rollback();
|
||||
});
|
||||
|
||||
it('should return the cloned invoiceIn and also clone invoiceInDueDays and invoiceInTaxes if there are any referencing the invoiceIn', async() => {
|
||||
it('should return the cloned invoiceIn and also clone invoiceInDueDays ' +
|
||||
'and invoiceInTaxes if there are any referencing the invoiceIn', async() => {
|
||||
const clone = await models.InvoiceIn.clone(ctx, 1, false, options);
|
||||
|
||||
expect(clone.supplierRef).toEqual('1234(2)');
|
||||
|
@ -51,7 +39,8 @@ describe('invoiceIn clone()', () => {
|
|||
expect(invoiceInDueDay.length).toEqual(2);
|
||||
});
|
||||
|
||||
it('should return the cloned invoiceIn and also clone invoiceInIntrastat and invoiceInTaxes if it is rectificative', async() => {
|
||||
it('should return the cloned invoiceIn and also clone invoiceInIntrastat ' +
|
||||
'and invoiceInTaxes if it is rectificative', async() => {
|
||||
const clone = await models.InvoiceIn.clone(ctx, 1, true, options);
|
||||
|
||||
expect(clone.supplierRef).toEqual('1234(2)');
|
||||
|
|
|
@ -1,24 +1,11 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('invoiceIn corrective()', () => {
|
||||
let ctx;
|
||||
const ctx = beforeAll.getCtx();
|
||||
let options;
|
||||
let tx;
|
||||
|
||||
beforeEach(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 9},
|
||||
headers: {origin: 'http://localhost'}
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: ctx.req
|
||||
});
|
||||
|
||||
options = {transaction: tx};
|
||||
tx = await models.Sale.beginTransaction({});
|
||||
options.transaction = tx;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('invoiceOut book()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const ctx = beforeAll.getCtx();
|
||||
const invoiceOutId = 5;
|
||||
|
||||
it('should update the booked property', async() => {
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('upsertFixedPrice()', () => {
|
||||
const now = Date.vnNew();
|
||||
const fixedPriceId = 1;
|
||||
let originalFixedPrice;
|
||||
|
||||
beforeAll.mockLoopBackContext();
|
||||
beforeAll(async() => {
|
||||
originalFixedPrice = await models.FixedPrice.findById(fixedPriceId);
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
|
||||
it(`should toggle the hasMinPrice boolean if there's a minPrice and update the rest of the data`, async() => {
|
||||
|
|
|
@ -63,7 +63,7 @@ module.exports = Self => {
|
|||
FROM tItemShelving ti
|
||||
JOIN tItemInSector tis ON tis.itemFk = ti.itemFk
|
||||
JOIN vn.productionConfig pc
|
||||
WHERE ti.created > tis.created + INTERVAL pc.itemOlderReviewHours HOUR;`,
|
||||
WHERE ti.created + INTERVAL pc.itemOlderReviewHours HOUR < tis.created ;`,
|
||||
[shelvingFk, shelvingFk], myOptions);
|
||||
return result;
|
||||
};
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
|
||||
describe('itemShelving getAlternative()', () => {
|
||||
beforeAll(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'},
|
||||
}
|
||||
};
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should return a list of items without alternatives', async() => {
|
||||
const shelvingFk = 'HEJ';
|
||||
|
|
|
@ -3,29 +3,16 @@ const {models} = require('vn-loopback/server/server');
|
|||
|
||||
describe('itemShelving getListItemNewer()', () => {
|
||||
it('should return true because there is an older item', async() => {
|
||||
const shelving = 'NCC';
|
||||
const parking = 'A-47-1';
|
||||
const shelving = 'NBB';
|
||||
const parking = '700-01';
|
||||
|
||||
const sectorCamHighCode = 'CAMARA SECTOR D';
|
||||
const sectorCamCode = 'NAVE ALGEMESI';
|
||||
|
||||
const sectorCamCodeHighId = 1;
|
||||
const sectorCamCodeId = 9991;
|
||||
const sectorCamHighCode = 'FIRST';
|
||||
const sectorCamCode = 'NS';
|
||||
|
||||
const tx = await models.Sector.beginTransaction({});
|
||||
const myOptions = {transaction: tx};
|
||||
|
||||
try {
|
||||
const sectorHighCam = await models.Sector.findById(sectorCamCodeHighId, null, myOptions);
|
||||
await sectorHighCam.updateAttributes({
|
||||
code: sectorCamHighCode
|
||||
});
|
||||
|
||||
const sectorCam = await models.Sector.findById(sectorCamCodeId, null, myOptions);
|
||||
await sectorCam.updateAttributes({
|
||||
code: sectorCamCode
|
||||
});
|
||||
|
||||
const config = await models.ProductionConfig.findOne();
|
||||
|
||||
await config.updateAttributes({
|
||||
|
@ -35,7 +22,7 @@ describe('itemShelving getListItemNewer()', () => {
|
|||
|
||||
const result = await models.ItemShelving.getListItemNewer(shelving, parking, myOptions);
|
||||
|
||||
expect(result.length).toEqual(2);
|
||||
expect(result.length).toEqual(3);
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
|
|
|
@ -1,25 +1,13 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('ItemShelving upsertItem()', () => {
|
||||
const warehouseFk = 1;
|
||||
let ctx;
|
||||
|
||||
const ctx = beforeAll.getCtx();
|
||||
let options;
|
||||
let tx;
|
||||
|
||||
beforeEach(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 9},
|
||||
headers: {origin: 'http://localhost'}
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: ctx.req
|
||||
});
|
||||
|
||||
options = {transaction: tx};
|
||||
tx = await models.ItemShelving.beginTransaction({});
|
||||
options.transaction = tx;
|
||||
|
|
|
@ -1,21 +1,8 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('item clone()', () => {
|
||||
let nextItemId;
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
beforeEach(async() => {
|
||||
let query = `SELECT i1.id + 1 as id FROM vn.item i1
|
||||
|
|
|
@ -2,17 +2,14 @@ const models = require('vn-loopback/server/server').models;
|
|||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('item getBalance()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should return the balance lines of a client type loses in which one has highlighted true', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
active: ctx
|
||||
});
|
||||
const losesClientId = 1111;
|
||||
const ticket = await models.Ticket.findById(7, null, options);
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('item new()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should create a new item, adding the name as a tag', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
|
|
|
@ -1,27 +1,13 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('regularize()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 18},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.mockLoopBackContext(18);
|
||||
|
||||
it('should create a new ticket and add a line', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const ctx = {req: {accessToken: {userId: 18}}};
|
||||
const itemId = 1;
|
||||
const warehouseId = 1;
|
||||
const quantity = 11;
|
||||
|
|
|
@ -1,20 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('item updateTaxes()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should throw an error if the taxClassFk is blank', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
|
|
|
@ -1,20 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('tag onSubmit()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should delete a tag', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('order addToOrder()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const ctx = beforeAll.getCtx();
|
||||
const orderId = 8;
|
||||
it('should add a row to a given order', async() => {
|
||||
const tx = await models.Order.beginTransaction({});
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('order filter()', () => {
|
||||
const ctx = {
|
||||
req: {accessToken: {userId: 9}},
|
||||
args: {},
|
||||
params: {}
|
||||
};
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should call the filter method with a basic search', async() => {
|
||||
const myCtx = Object.assign({}, ctx);
|
||||
|
|
|
@ -2,7 +2,7 @@ const models = require('vn-loopback/server/server').models;
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
describe('order new()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should throw an error if the client isnt active', async() => {
|
||||
const tx = await models.Order.beginTransaction({});
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('order newFromTicket()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should create a new order from an existing ticket', async() => {
|
||||
const tx = await models.Order.beginTransaction({});
|
||||
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('AgencyTerm createInvoiceIn()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
const rows = [
|
||||
{
|
||||
routeFk: 2,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue