Merge branch 'dev' into 5576-reestructurar-directorio-imagenes
This commit is contained in:
commit
2dba0b87ed
|
@ -10,3 +10,4 @@ print.*.json
|
|||
db.json
|
||||
junit.xml
|
||||
.DS_Store
|
||||
storage
|
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -5,14 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [24.16.01] - 2024-04-18
|
||||
|
||||
## [2414.01] - 2024-04-04
|
||||
|
||||
## [2408.01] - 2024-02-22
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
|
||||
## [2406.01] - 2024-02-08
|
||||
|
||||
### Added
|
||||
|
|
|
@ -20,7 +20,8 @@ module.exports = Self => {
|
|||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
const [,, {collectionFk}] = await Self.rawSql('CALL vn.collection_assign(?, @vCollectionFk); SELECT @vCollectionFk collectionFk',
|
||||
const [, , [{collectionFk}]] =
|
||||
await Self.rawSql('CALL vn.collection_assign(?, @vCollectionFk); SELECT @vCollectionFk collectionFk',
|
||||
[userId], myOptions);
|
||||
|
||||
if (!collectionFk) throw new UserError('There are not picking tickets');
|
||||
|
|
|
@ -29,7 +29,8 @@ module.exports = Self => {
|
|||
http: {
|
||||
path: `/:id/downloadFile`,
|
||||
verb: 'GET'
|
||||
}
|
||||
},
|
||||
accessScopes: ['read:multimedia']
|
||||
});
|
||||
|
||||
Self.downloadFile = async function(ctx, id) {
|
||||
|
|
|
@ -42,7 +42,8 @@ module.exports = Self => {
|
|||
http: {
|
||||
path: `/:id/download`,
|
||||
verb: 'GET'
|
||||
}
|
||||
},
|
||||
accessScopes: ['read:multimedia']
|
||||
});
|
||||
|
||||
Self.download = async function(id, fileCabinet, filter) {
|
||||
|
|
|
@ -47,7 +47,8 @@ module.exports = Self => {
|
|||
http: {
|
||||
path: `/:collection/:size/:id/download`,
|
||||
verb: 'GET'
|
||||
}
|
||||
},
|
||||
accessScopes: ['read:multimedia']
|
||||
});
|
||||
|
||||
Self.download = async function(ctx, collection, size, id) {
|
||||
|
|
|
@ -4,20 +4,21 @@ describe('image download()', () => {
|
|||
const collection = 'user';
|
||||
const size = '160x160';
|
||||
const employeeId = 1;
|
||||
const developerId = 9;
|
||||
const jessicaJonesId = 1110;
|
||||
const ctx = {req: {accessToken: {userId: employeeId}}};
|
||||
|
||||
it('should return the image content-type of the user', async() => {
|
||||
const userId = 9;
|
||||
const image = await models.Image.download(ctx, collection, size, userId);
|
||||
const image = await models.Image.download(ctx, collection, size, developerId);
|
||||
const contentType = image[1];
|
||||
|
||||
expect(contentType).toEqual('image/png');
|
||||
});
|
||||
|
||||
it(`should return false if the user doesn't have image`, async() => {
|
||||
const userId = 1110;
|
||||
const image = await models.Image.download(ctx, collection, size, userId);
|
||||
it('should return the user profile picture', async() => {
|
||||
const image = await models.Image.download(ctx, collection, size, jessicaJonesId);
|
||||
const fileName = image[2];
|
||||
|
||||
expect(image).toBeFalse();
|
||||
expect(fileName).toMatch('1110.png');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ module.exports = Self => {
|
|||
}, myOptions);
|
||||
|
||||
if (!machine)
|
||||
throw new Error($t('the plate does not exist', {plate}));
|
||||
throw new UserError($t('the plate does not exist', {plate}));
|
||||
|
||||
const machineWorker = await Self.findOne({
|
||||
where: {
|
||||
|
@ -48,7 +48,7 @@ module.exports = Self => {
|
|||
}, myOptions);
|
||||
|
||||
const {maxHours} = await models.MachineWorkerConfig.findOne({fields: ['maxHours']}, myOptions);
|
||||
const hoursDifference = (Date.vnNow() - machineWorker.inTime.getTime()) / (60 * 60 * 1000);
|
||||
const hoursDifference = (Date.vnNow() - machineWorker?.inTime?.getTime() ?? 0) / (60 * 60 * 1000);
|
||||
|
||||
if (machineWorker) {
|
||||
const isHimself = userId == machineWorker.workerFk;
|
||||
|
|
|
@ -40,6 +40,11 @@ module.exports = Self => {
|
|||
fields,
|
||||
};
|
||||
|
||||
return Self.findOne(filter);
|
||||
const result = await Self.findOne(filter);
|
||||
return {
|
||||
isVersionCritical: result?.isVersionBetaCritical ?? result?.isVersionCritical,
|
||||
version: result?.versionBeta ?? result?.version,
|
||||
url: result?.urlBeta ?? result?.urlProduction
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -2,6 +2,8 @@ const {models} = require('vn-loopback/server/server');
|
|||
|
||||
describe('mobileAppVersionControl getVersion()', () => {
|
||||
const appName = 'delivery';
|
||||
const appNameVersion = '9.2';
|
||||
const appNameVersionBeta = '9.7';
|
||||
beforeAll(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
|
@ -13,17 +15,15 @@ describe('mobileAppVersionControl getVersion()', () => {
|
|||
|
||||
it('should get the version app', async() => {
|
||||
ctx.req.accessToken.userId = 9;
|
||||
const {version, versionBeta} = await models.MobileAppVersionControl.getVersion(ctx, appName);
|
||||
const {version} = await models.MobileAppVersionControl.getVersion(ctx, appName);
|
||||
|
||||
expect(version).toEqual('9.2');
|
||||
expect(versionBeta).toBeUndefined();
|
||||
expect(version).toEqual(appNameVersion);
|
||||
});
|
||||
|
||||
it('should get the beta version app', async() => {
|
||||
ctx.req.accessToken.userId = 66;
|
||||
const {version, versionBeta} = await models.MobileAppVersionControl.getVersion(ctx, appName);
|
||||
const {version} = await models.MobileAppVersionControl.getVersion(ctx, appName);
|
||||
|
||||
expect(versionBeta).toBeDefined();
|
||||
expect(version).toBeUndefined();
|
||||
expect(version).toEqual(appNameVersionBeta);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -49,6 +49,7 @@ describe('MRWConfig createShipment()', () => {
|
|||
|
||||
await models.MrwConfig.create(
|
||||
{
|
||||
'id': 1,
|
||||
'url': 'https://url.com',
|
||||
'user': 'user',
|
||||
'password': 'password',
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('NotificationSubscription getList()', () => {
|
|||
const notifications = await models.Notification.find({});
|
||||
const totalAvailable = notifications.length - active.length;
|
||||
|
||||
expect(active.length).toEqual(2);
|
||||
expect(active.length).toEqual(3);
|
||||
expect(available.length).toEqual(totalAvailable);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('shareToken', {
|
||||
description: 'Returns token to view files or images and share it',
|
||||
accessType: 'WRITE',
|
||||
accepts: [],
|
||||
returns: {
|
||||
type: 'Object',
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/shareToken`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.shareToken = async function(ctx) {
|
||||
const {accessToken: token} = ctx.req;
|
||||
|
||||
const user = await Self.findById(token.userId);
|
||||
const multimediaToken = await user.accessTokens.create({
|
||||
scopes: ['read:multimedia']
|
||||
});
|
||||
|
||||
return {multimediaToken};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,27 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
describe('Share Token', () => {
|
||||
let ctx = null;
|
||||
beforeAll(async() => {
|
||||
const unAuthCtx = {
|
||||
req: {
|
||||
headers: {},
|
||||
connection: {
|
||||
remoteAddress: '127.0.0.1'
|
||||
},
|
||||
getLocale: () => 'en'
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
let login = await models.VnUser.signIn(unAuthCtx, 'salesAssistant', 'nightmare');
|
||||
let accessToken = await models.AccessToken.findById(login.token);
|
||||
ctx = {req: {accessToken: accessToken}};
|
||||
});
|
||||
|
||||
it('should renew token', async() => {
|
||||
const multimediaToken = await models.VnUser.shareToken(ctx);
|
||||
|
||||
expect(Object.keys(multimediaToken).length).toEqual(1);
|
||||
expect(multimediaToken.multimediaToken.userId).toEqual(ctx.req.accessToken.userId);
|
||||
expect(multimediaToken.multimediaToken.scopes[0]).toEqual('read:multimedia');
|
||||
});
|
||||
});
|
|
@ -97,6 +97,9 @@
|
|||
"Module": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"MrwConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Notification": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
@ -169,10 +172,10 @@
|
|||
"VnRole": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"MrwConfig": {
|
||||
"WorkerActivity": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerActivityType": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"required": true
|
||||
},
|
||||
"url": {
|
||||
|
|
|
@ -13,6 +13,7 @@ module.exports = function(Self) {
|
|||
require('../methods/vn-user/privileges')(Self);
|
||||
require('../methods/vn-user/validate-auth')(Self);
|
||||
require('../methods/vn-user/renew-token')(Self);
|
||||
require('../methods/vn-user/share-token')(Self);
|
||||
require('../methods/vn-user/update-user')(Self);
|
||||
|
||||
Self.definition.settings.acls = Self.definition.settings.acls.filter(acl => acl.property !== 'create');
|
||||
|
|
|
@ -98,30 +98,41 @@
|
|||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"property": "recoverPassword",
|
||||
"accessType": "EXECUTE",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"property": "validateAuth",
|
||||
"accessType": "EXECUTE",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"property": "privileges",
|
||||
"accessType": "*",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$authenticated",
|
||||
"permission": "ALLOW"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"property": "renewToken",
|
||||
"accessType": "WRITE",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$authenticated",
|
||||
"permission": "ALLOW"
|
||||
},
|
||||
{
|
||||
"property": "shareToken",
|
||||
"accessType": "WRITE",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$authenticated",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
],
|
||||
"scopes": {
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"name": "WorkerActivity",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerActivity"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number"
|
||||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"model": {
|
||||
"type": "string"
|
||||
},
|
||||
"event": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"relations": {
|
||||
"workerFk": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
},
|
||||
"workerActivityTypeFk": {
|
||||
"type": "belongsTo",
|
||||
"model": "WorkerActivityType",
|
||||
"foreignKey": "workerActivityTypeFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "WorkerActivityType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerActivityType"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"code": {
|
||||
"id": true,
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"required": false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
DELETE FROM salix.ACL
|
||||
WHERE model = 'MailAliasAccount'
|
||||
AND property = 'canEditAlias'
|
||||
AND principalType = 'ROLE'
|
||||
AND principalId = 'marketingBoss';
|
|
@ -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','10943','fbdebad12c9b306004dee3fba252c1fc4613584e','2024-03-07 10:29:57','10943');
|
||||
INSERT INTO `version` VALUES ('vn-database','10962','5411433e529d50d68b3a0675b1a0a6215ea931ca','2024-03-25 17:47:37','10969');
|
||||
|
||||
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);
|
||||
|
@ -581,6 +581,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10825','00-firstScript.sql','jen
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','10827','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-01-23 12:32:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10828','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10828','01-RevokeClientes_regalos_lista.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10832','00-newWareHouse.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:01:26',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10832','00-util_tx_commit.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10832','00-util_tx_rollback.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10832','00-util_tx_start.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-15 09:45:55',NULL,NULL);
|
||||
|
@ -696,16 +697,30 @@ INSERT INTO `versionLog` VALUES ('vn-database','10896','29-kk.sql','jenkins@db-p
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','10896','30-permissions.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:03',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10898','00-table.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:03',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10903','00-professionalCategoryAddCode.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-23 08:38:28',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10905','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:01:26',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10906','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:04',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10908','00-createSupplierDms.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:24',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10909','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-02-26 11:07:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10912','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 08:13:25',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10913','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:01:26',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10914','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-28 11:52:54',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10915','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:01:26',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10918','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:01:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10922','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-02-29 13:44:58',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10923','00-createParkingLog.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:15:51',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10923','01-aclParkingLog.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:15:51',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10924','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:15:51',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10925','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:15:51',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10926','00-refactorClaimState.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:15:51',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10928','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:15:52',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10929','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-21 07:16:19',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10940','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-03-06 16:48:18',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10941','00-restoreVn2008Jerarquia.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-03-07 09:36:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10942','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-07 10:24:45',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10943','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-03-07 10:29:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10946','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-03-08 07:56:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10959','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-18 13:32:25',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10962','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-03-25 08:27:35',NULL,NULL);
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
|
@ -794,7 +809,7 @@ INSERT INTO `role` VALUES (115,'itManagement','TI management',1,'2023-03-29 09:2
|
|||
INSERT INTO `role` VALUES (119,'palletizerBoss','Jefe de paletizadores',1,'2023-06-07 13:51:54','2023-06-07 13:51:54',NULL);
|
||||
INSERT INTO `role` VALUES (120,'developerBoss','Jefe de proyecto de desarrollo',1,'2023-06-19 09:07:21','2023-06-19 09:07:21',21709);
|
||||
INSERT INTO `role` VALUES (121,'buyerSalesAssistant','Rol para compradores que también son responsables de ventas',1,'2023-06-23 16:48:19','2023-06-23 16:48:19',NULL);
|
||||
INSERT INTO `role` VALUES (122,'logisticAssistant','Jefe auxiliar de logística',1,'2023-06-26 09:21:15','2023-06-26 09:21:15',NULL);
|
||||
INSERT INTO `role` VALUES (122,'logisticAssist','Jefe auxiliar de logística',1,'2023-06-26 09:21:15','2024-03-15 13:38:26',19295);
|
||||
INSERT INTO `role` VALUES (123,'deliveryAssistant','Jefe auxiliar repartos',1,'2023-10-05 08:47:48','2023-10-05 08:47:48',10578);
|
||||
INSERT INTO `role` VALUES (124,'hrBuyer','Recursos Humanos con Buyer',1,'2023-10-23 13:50:43','2023-10-23 13:50:43',NULL);
|
||||
INSERT INTO `role` VALUES (125,'claimViewer','Trabajadores que consulta las reclamaciones ',1,'2023-11-16 09:14:46','2023-11-16 09:14:46',10578);
|
||||
|
@ -1036,7 +1051,6 @@ INSERT INTO `roleInherit` VALUES (312,115,120,NULL);
|
|||
INSERT INTO `roleInherit` VALUES (314,43,18,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (315,121,35,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (316,121,21,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (317,122,15,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (318,16,122,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (319,37,49,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (320,37,18,NULL);
|
||||
|
@ -1066,6 +1080,7 @@ INSERT INTO `roleInherit` VALUES (358,36,49,NULL);
|
|||
INSERT INTO `roleInherit` VALUES (359,129,35,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (360,101,129,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (361,50,112,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (362,122,15,NULL);
|
||||
|
||||
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
|
||||
|
||||
|
@ -1159,7 +1174,7 @@ INSERT INTO `ACL` VALUES (105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketin
|
|||
INSERT INTO `ACL` VALUES (106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss');
|
||||
INSERT INTO `ACL` VALUES (108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss');
|
||||
INSERT INTO `ACL` VALUES (109,'UserConfig','*','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (110,'Bank','*','READ','ALLOW','ROLE','trainee');
|
||||
INSERT INTO `ACL` VALUES (110,'Accounting','*','READ','ALLOW','ROLE','trainee');
|
||||
INSERT INTO `ACL` VALUES (111,'ClientLog','*','READ','ALLOW','ROLE','trainee');
|
||||
INSERT INTO `ACL` VALUES (112,'Defaulter','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (113,'ClientRisk','*','READ','ALLOW','ROLE','trainee');
|
||||
|
@ -1393,6 +1408,8 @@ INSERT INTO `ACL` VALUES (385,'Route','driverRoutePdf','READ','ALLOW','ROLE','em
|
|||
INSERT INTO `ACL` VALUES (386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer');
|
||||
INSERT INTO `ACL` VALUES (388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager');
|
||||
INSERT INTO `ACL` VALUES (390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager');
|
||||
INSERT INTO `ACL` VALUES (391,'Notification','*','WRITE','ALLOW','ROLE','system');
|
||||
INSERT INTO `ACL` VALUES (392,'Boxing','*','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (393,'Url','*','READ','ALLOW','ROLE','employee');
|
||||
|
@ -1753,6 +1770,25 @@ INSERT INTO `ACL` VALUES (797,'MrwConfig','createShipment','WRITE','ALLOW','ROLE
|
|||
INSERT INTO `ACL` VALUES (798,'MailAliasAccount','*','*','ALLOW','ROLE','itManagement');
|
||||
INSERT INTO `ACL` VALUES (799,'Ticket','saveCmr','*','ALLOW','ROLE','developer');
|
||||
INSERT INTO `ACL` VALUES (800,'EntryDms','*','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (801,'MailAliasAccount','create','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (802,'MailAliasAccount','deleteById','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (803,'ExpeditionPallet','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (804,'DeviceProduction','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (805,'Collection','assign','WRITE','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (806,'ExpeditionPallet','getPallet','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (807,'MachineWorker','updateInTime','WRITE','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (808,'MobileAppVersionControl','getVersion','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (809,'SaleTracking','delete','WRITE','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (810,'SaleTracking','updateTracking','WRITE','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (811,'SaleTracking','setPicked','WRITE','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (812,'ExpeditionPallet','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (813,'Sale','getFromSectorCollection','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (814,'ItemBarcode','delete','WRITE','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (815,'WorkerActivityType','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (816,'WorkerActivity','*','*','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (817,'ParkingLog','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (818,'ExpeditionPallet','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (819,'Ticket','addSaleByCode','WRITE','ALLOW','ROLE','production');
|
||||
|
||||
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
|
||||
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
||||
|
@ -2071,61 +2107,61 @@ INSERT INTO `continent` VALUES (3,'África','AF');
|
|||
INSERT INTO `continent` VALUES (4,'Europa','EU');
|
||||
INSERT INTO `continent` VALUES (5,'Oceanía','OC');
|
||||
|
||||
INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,110,763,0,0,0,0,27,NULL,'/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (22,'shopping','COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (31,'it','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (35,'finance','FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (36,'labor','LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (37,'PROD','PRODUCCION',12,35,NULL,72,1,1,1,11,1,'/1/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (38,'picking','SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (39,'packing','ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',36,37,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (43,'VT','VENTAS',38,67,NULL,0,0,0,1,14,1,'/1/',NULL,1,'',1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (44,'management','GERENCIA',68,69,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',70,71,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (46,'delivery','REPARTO',72,73,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (48,'storage','ALMACENAJE',74,75,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (49,NULL,'PROPIEDAD',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (52,NULL,'CARGA AEREA',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (53,'marketing','MARKETING Y COMUNICACIÓN',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (54,NULL,'ORNAMENTALES',82,83,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (55,NULL,'TALLER NATURAL',19,20,14548,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1118,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (56,NULL,'TALLER ARTIFICIAL',21,22,8470,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1927,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (58,'CMP','CAMPOS',84,87,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',88,89,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',39,40,NULL,72,0,0,2,0,43,'/1/43/',NULL,1,NULL,1,1,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (61,NULL,'VNH',90,93,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (66,NULL,'VERDNAMADRID',94,95,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (68,NULL,'COMPLEMENTOS',23,24,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (69,NULL,'VERDNABARNA',96,97,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (80,NULL,'EQUIPO J VALLES',41,42,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'equipojvalles@verdnatura.es',0,0,0,0,NULL,NULL,'5300');
|
||||
INSERT INTO `department` VALUES (86,NULL,'LIMPIEZA',98,99,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (89,NULL,'COORDINACION',100,101,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (90,NULL,'TRAILER',91,92,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (91,'artificial','ARTIFICIAL',25,26,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (92,NULL,'EQUIPO SILVERIO',43,44,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (94,NULL,'EQUIPO J BROCAL',45,46,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',0,'equipojbrocal@verdnatura.es',0,0,0,0,NULL,NULL,'5100');
|
||||
INSERT INTO `department` VALUES (95,NULL,'EQUIPO C ZAMBRANO',47,48,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',0,'equipoczambrano@verdnatura.es',0,0,0,0,NULL,NULL,'5000');
|
||||
INSERT INTO `department` VALUES (96,NULL,'EQUIPO C LOPEZ',49,50,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (115,NULL,'EQUIPO CLAUDI',51,52,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (123,NULL,'EQUIPO ELENA BASCUÑANA',53,54,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',102,103,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (125,NULL,'EQUIPO MIRIAM MAR',55,56,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',0,'equipomirgir@verdnatura.es',0,0,0,0,NULL,NULL,'5200');
|
||||
INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',27,28,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (130,NULL,'REVISION',31,32,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',85,86,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',57,58,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',59,60,1731,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'francia@verdnatura.es',0,0,0,0,NULL,NULL,'3300');
|
||||
INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',61,62,6264,0,0,0,2,0,43,'/1/43/','pt_equipo',1,'portugal@verdnatura.es',0,0,0,0,NULL,NULL,'3500');
|
||||
INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',104,105,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',106,107,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (137,'sorter','SORTER',108,109,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (139,NULL,'EQUIPO J SORIA ',63,64,3803,0,0,0,2,0,43,'/1/43/','jss_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,'5400');
|
||||
INSERT INTO `department` VALUES (140,'hollandTeam','EQUIPO HOLANDA',65,66,NULL,0,0,0,2,0,43,'/1/43/','nl_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (141,NULL,'PREVIA',33,34,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,110,763,0,0,0,0,26,NULL,'/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (22,'shopping','COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (31,'it','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (35,'finance','FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (36,'labor','LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (37,'PROD','PRODUCCION',12,35,NULL,72,1,1,1,11,1,'/1/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (38,'picking','SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (39,'packing','ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',36,37,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (43,'VT','VENTAS',38,69,NULL,0,0,0,1,15,1,'/1/',NULL,1,'',1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (44,'management','GERENCIA',70,71,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',72,73,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (46,'delivery','REPARTO',74,75,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (48,'storage','ALMACENAJE',76,77,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (49,NULL,'PROPIEDAD',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (52,NULL,'CARGA AEREA',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (53,'marketing','MARKETING Y COMUNICACIÓN',39,40,NULL,72,0,0,2,0,43,'/1/43/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (54,NULL,'ORNAMENTALES',82,83,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (55,NULL,'TALLER NATURAL',19,20,14548,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1118,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (56,NULL,'TALLER ARTIFICIAL',21,22,8470,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1927,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (58,'CMP','CAMPOS',84,87,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',88,89,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',41,42,NULL,72,0,0,2,0,43,'/1/43/',NULL,1,NULL,1,1,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (61,NULL,'VNH',90,93,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (66,NULL,'VERDNAMADRID',94,95,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (68,NULL,'COMPLEMENTOS',23,24,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (69,NULL,'VERDNABARNA',96,97,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (80,'vallesTeam','EQUIPO J VALLES',43,44,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'equipojvalles@verdnatura.es',0,0,0,0,NULL,NULL,'5300',NULL);
|
||||
INSERT INTO `department` VALUES (86,NULL,'LIMPIEZA',98,99,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (89,NULL,'COORDINACION',100,101,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (90,NULL,'TRAILER',91,92,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (91,'artificial','ARTIFICIAL',25,26,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (92,NULL,'EQUIPO SILVERIO',45,46,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (94,'brocalTeam','EQUIPO J BROCAL',47,48,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',0,'equipojbrocal@verdnatura.es',0,0,0,0,NULL,NULL,'5100',NULL);
|
||||
INSERT INTO `department` VALUES (95,'zambranoTeam','EQUIPO C ZAMBRANO',49,50,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',0,'equipoczambrano@verdnatura.es',0,0,0,0,NULL,NULL,'5000',NULL);
|
||||
INSERT INTO `department` VALUES (96,NULL,'EQUIPO C LOPEZ',51,52,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (115,NULL,'EQUIPO CLAUDI',53,54,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (123,NULL,'EQUIPO ELENA BASCUÑANA',55,56,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',102,103,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (125,'miriamMarTeam','EQUIPO MIRIAM MAR',57,58,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',0,'equipomirgir@verdnatura.es',0,0,0,0,NULL,NULL,'5200',NULL);
|
||||
INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',27,28,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (130,NULL,'REVISION',31,32,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',85,86,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',59,60,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',61,62,1731,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'francia@verdnatura.es',0,0,0,0,NULL,NULL,'3300',NULL);
|
||||
INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',63,64,6264,0,0,0,2,0,43,'/1/43/','pt_equipo',1,'portugal@verdnatura.es',0,0,0,0,NULL,NULL,'3500',NULL);
|
||||
INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',104,105,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',106,107,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (137,'sorter','SORTER',108,109,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (139,'soriaTeam','EQUIPO J SORIA ',65,66,3803,0,0,0,2,0,43,'/1/43/','jss_equipo',1,'equipojsoria@verdnatura.es',0,0,0,0,NULL,NULL,'5400',NULL);
|
||||
INSERT INTO `department` VALUES (140,'hollandTeam','EQUIPO HOLANDA',67,68,NULL,0,0,0,2,0,43,'/1/43/','nl_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (141,NULL,'PREVIA',33,34,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL);
|
||||
|
||||
INSERT INTO `docuware` VALUES (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N',NULL);
|
||||
INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL);
|
||||
|
|
|
@ -132,7 +132,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','account','account','userPassword',
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','account','mainAccountBank','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','guest','itemCategory','root@pc-juan.dyn.verdnatura.es','2022-08-03 23:44:43','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','psico','hr','answer','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','ticketDms','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ticketDms','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','employee','ekt','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','sage','administrative','taxType','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','psico','hr','fellow','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -333,7 +333,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Cubos','ale
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Cubos_Retorno','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','artificialBoss','state','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','travel','alexm@%','0000-00-00 00:00:00','Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Bancos_poliza','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Bancos_poliza','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','cmr','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','edi_bucket_type','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','edi_bucket','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -420,9 +420,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Movimientos
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','Movimientos_revisar','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
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 ('','vn','administrative','bank','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','hr','bank','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
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','');
|
||||
|
@ -757,7 +755,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','buy','alexm@%','0000-
|
|||
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','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','component','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','Entradas','alexm@%','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','saleComponent','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','arcRead','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -900,7 +897,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','postgresql','hr','calendar_employe
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','ticket','alexm@%','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticket','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticketCollection','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminBoss','ticketDms','alexm@%','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','ticketDocumentation','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticketDms','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesPerson','ektEntryAssign','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
|
||||
|
@ -1362,6 +1358,21 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','warehousePickup','
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','warehousePickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','warehousePickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','warehousePickup','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','component','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','config','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','','Select');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','componentType','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBos','machineDms','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','itemShelvingSale','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','tagAbbreviation','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','ticketTracking','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','item','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','ticketDms','carlosap@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','agencyExtraCharge','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','sale_freightComponent','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','accounting','jgallego@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','accounting','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','workerActivity','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBos','machineDetail','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 */;
|
||||
|
@ -1595,6 +1606,8 @@ INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','weight',
|
|||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','clonedFrom','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','cmrFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','editorFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','config','truckLength','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','production','item','isBoxPickingMode','0000-00-00 00:00:00','Update');
|
||||
/*!40000 ALTER TABLE `columns_priv` ENABLE KEYS */;
|
||||
|
||||
/*!40000 ALTER TABLE `procs_priv` DISABLE KEYS */;
|
||||
|
@ -1670,22 +1683,21 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','mail_insert','PROCEDURE',
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','entry_fixMisfit','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','employee','buy_tarifas_entry','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_CURDATE','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','financial','calculoremesas','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','marketingBoss','clientTaxArea','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','clientTaxArea','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','client_checkBalance','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','addressTaxArea','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesPerson','client_getSalesPersonByTicket','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','handmadeBoss','confection_control_source','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','productionAssi','confection_control_source','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','artificialBoss','confection_control_source','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','deliveryAssistant','preordenarruta','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','financial','pay','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','pbx','developer','clientFromPhone','FUNCTION','juan@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','production','log_addWithUser','PROCEDURE','juan@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','adminBoss','balanceNestTree_addChild','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','adminBoss','balanceNestTree_delete','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','adminBoss','balanceNestTree_move','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','company_getSuppliersDebt','PROCEDURE','jgallego@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','bi','salesAssistant','defaultersFromDate','PROCEDURE','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','buy_updatepacking','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','buy_updategrouping','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','item_comparative','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','logistic','calculoremesas','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','entryEditor','item_getVolume','FUNCTION','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','clientgetmana','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','buy_scan','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1719,7 +1731,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','util','administrative','accountshor
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','logistic','raidupdate','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','grafana','lastdayofweek','FUNCTION','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','artificialBoss','raidupdate','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','adminBoss','nest_delete','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','marketingBoss','invoicefromclient','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','invoicefromclient','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','invoicefromticket','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1729,7 +1740,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','logistic','entry_splitbyshelvi
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','invoiceintaxmakebydua','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','logistic','invoiceintax_getfromentries','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','invoiceintax_getfromentries','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn2008','adminBoss','nest_child_add','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','marketingBoss','invoiceoutbooking','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','invoiceoutbooking','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','clienttaxarea','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1755,7 +1765,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesPerson','ticket_clone','P
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','cache','employee','available_refresh','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','logistic','ticket_clone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','coolerBoss','ticket_clone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','itemproposal','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','payment_add','PROCEDURE','jgallego@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','timebusiness_calculatebyuser','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','itemsale_byweek','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','itemsale_byweek','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1856,10 +1866,10 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','productionAssi','timebusiness_
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','timecontrol_geterror','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','logistic','travel_weeklyclone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_recalcPricesByBuy','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','coolerAssist','itemproposal','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','company_getsuppliersdebt','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','handmadeBoss','confection_controlSource','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','bi','productionAssi','rutasanalyze','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','productionPlus','workerCreateExternal','PROCEDURE','juan@10.5.1.2','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','productionAssi','confection_controlSource','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_NOW','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_UNIX_TIMESTAMP','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','guest','VN_UTC_DATE','FUNCTION','juan@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1997,6 +2007,8 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','travel_getDetailFromCo
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','entry_getTransfer','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','entry_getTransfer','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','intrastat_estimateNet','FUNCTION','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','artificialBoss','confection_controlSource','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','remittance_calc','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
/*!40000 ALTER TABLE `procs_priv` ENABLE KEYS */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
|
@ -2015,7 +2027,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','adminOfficer','{\"access\": 0, \"v
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','administrative','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','agency','{\"access\": 0, \"max_questions\": 40000, \"max_updates\": 1000, \"max_connections\": 20000, \"max_user_connections\": 50, \"max_statement_time\": 0.000000, \"is_role\": true,\"version_id\":100707}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','android','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','artificialBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','artificialBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','assetManager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','buyer','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','buyerAssistant','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
|
@ -2028,7 +2040,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','customer','{\"access\": 0, \"max_q
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','delivery','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','deliveryAssistant','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','deliveryBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','developer','{\"access\": 5909905728, \"is_role\": true, \"version_id\": 100707}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','developer','{\"access\": 5909905728, \"is_role\": true, \"version_id\": 101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','developerBoss','{\"access\":33554432,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','employee','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','entryEditor','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
|
@ -2038,7 +2050,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','financialBoss','{\"access\": 0, \"
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','grafana','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','greenhouseBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','guest','{\"access\": 0, \"max_questions\": 40000, \"max_updates\": 1000, \"max_connections\": 150000, \"max_user_connections\": 200, \"max_statement_time\": 0.000000, \"is_role\": true, \"version_id\": 101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','handmadeBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','handmadeBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','hedera-web','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','hr','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','hrBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
|
@ -2047,6 +2059,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','itBoss','{\"access\": 541165846527
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','itManagement','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','itemPicker','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','logistic','{\"access\": 0, \"is_role\": true, \"version_id\": 101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','logisticAssist','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','logisticBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenance','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBos','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
|
@ -2059,9 +2072,9 @@ INSERT IGNORE INTO `global_priv` VALUES ('','packager','{\"access\":0,\"version
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','palletizer','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','palletizerBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','preservedBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','production','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','production','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','productionAssi','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','productionBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','productionBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','productionPlus','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','root','{\"access\": 549755781119, \"version_id\": 100705, \"is_role\": true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','salesAssistant','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4629,7 +4629,9 @@ BEGIN
|
|||
CALL supplier_checkIsActive(NEW.supplierFk);
|
||||
SET NEW.currencyFk = entry_getCurrency(NEW.currencyFk, NEW.supplierFk);
|
||||
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk,NEW.supplierFk);
|
||||
|
||||
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
||||
CALL util.throw('The travel is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -4675,12 +4677,17 @@ BEGIN
|
|||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF !(NEW.travelFk <=> OLD.travelFk) THEN
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk) THEN
|
||||
|
||||
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
||||
CALL util.throw('The travel is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
|
||||
SELECT COUNT(*) > 0 INTO vIsVirtual
|
||||
FROM entryVirtual WHERE entryFk = NEW.id;
|
||||
|
||||
SELECT !(o.warehouseInFk <=> n.warehouseInFk)
|
||||
OR !(o.warehouseOutFk <=> n.warehouseOutFk)
|
||||
SELECT NOT (o.warehouseInFk <=> n.warehouseInFk)
|
||||
OR NOT (o.warehouseOutFk <=> n.warehouseOutFk)
|
||||
INTO vHasDistinctWarehouses
|
||||
FROM travel o, travel n
|
||||
WHERE o.id = OLD.travelFk
|
||||
|
@ -4709,8 +4716,7 @@ BEGIN
|
|||
SET NEW.currencyFk = entry_getCurrency(NEW.currencyFk, NEW.supplierFk);
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk)
|
||||
OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk) OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
|
||||
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk, NEW.supplierFk);
|
||||
END IF;
|
||||
END */;;
|
||||
|
@ -6785,7 +6791,7 @@ DELIMITER ;;
|
|||
BEFORE INSERT ON `parking`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
-- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ;
|
||||
|
||||
END */;;
|
||||
|
@ -6807,7 +6813,7 @@ DELIMITER ;;
|
|||
BEFORE UPDATE ON `parking`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
-- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ;
|
||||
|
||||
END */;;
|
||||
|
@ -6821,11 +6827,37 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
|
||||
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `payment_beforeInsert` BEFORE INSERT ON `payment` FOR EACH ROW
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`parking_afterDelete`
|
||||
AFTER DELETE ON `parking`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO parkingLog
|
||||
SET `action` = 'delete',
|
||||
`changedModel` = 'Parking',
|
||||
`changedModelId` = OLD.id,
|
||||
`userFk` = account.myUser_getId();
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!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`.`payment_beforeInsert`
|
||||
BEFORE INSERT ON `payment`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
DECLARE cuenta_banco,cuenta_proveedor DOUBLE;
|
||||
DECLARE vNewBookEntry INT;
|
||||
|
@ -6834,21 +6866,21 @@ BEGIN
|
|||
|
||||
-- PAK 10/02/15 No se asientan los pagos directamente, salvo en el caso de las cajas de CASH
|
||||
SELECT (at2.code = 'cash') INTO bolCASH
|
||||
FROM vn.bank b
|
||||
JOIN vn.accountingType at2 ON at2.id = b.cash
|
||||
WHERE b.id = NEW.bankFk;
|
||||
FROM accounting a
|
||||
JOIN accountingType at2 ON at2.id = a.accountingTypeFk
|
||||
WHERE a.id = NEW.bankFk;
|
||||
|
||||
IF bolCASH THEN
|
||||
|
||||
SELECT account INTO cuenta_banco
|
||||
FROM bank
|
||||
FROM accounting
|
||||
WHERE id = NEW.bankFk;
|
||||
|
||||
SELECT account INTO cuenta_proveedor
|
||||
FROM supplier
|
||||
WHERE id = NEW.supplierFk;
|
||||
|
||||
CALL vn.ledger_next(vNewBookEntry);
|
||||
CALL ledger_next(vNewBookEntry);
|
||||
|
||||
INSERT INTO XDiario ( ASIEN,
|
||||
FECHA,
|
||||
|
@ -10003,6 +10035,10 @@ BEGIN
|
|||
CALL travel_checkDates(NEW.shipped, NEW.landed);
|
||||
|
||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||
|
||||
IF NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
|
||||
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -10072,7 +10108,7 @@ DELIMITER ;;
|
|||
BEGIN
|
||||
CALL stock.log_add('travel', NEW.id, OLD.id);
|
||||
|
||||
IF !(NEW.shipped <=> OLD.shipped) THEN
|
||||
IF NOT(NEW.shipped <=> OLD.shipped) THEN
|
||||
UPDATE entry
|
||||
SET commission = entry_getCommission(travelFk, currencyFk,supplierFk)
|
||||
WHERE travelFk = NEW.id;
|
||||
|
@ -10090,6 +10126,10 @@ BEGIN
|
|||
CALL buy_checkItem();
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
|
||||
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -10922,4 +10962,4 @@ USE `vn2008`;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2024-03-07 9:31:50
|
||||
-- Dump completed on 2024-03-26 6:55:58
|
||||
|
|
|
@ -7,8 +7,8 @@ SET foreign_key_checks = 0;
|
|||
|
||||
-- XXX: vn-database
|
||||
|
||||
INSERT INTO util.config (environment, mockTime, mockUtcTime, mockEnabled)
|
||||
VALUES ('local', '2001-01-01 12:00:00', '2001-01-01 11:00:00', TRUE);
|
||||
INSERT INTO util.config (id, environment, mockTime, mockUtcTime, mockEnabled)
|
||||
VALUES (1, 'local', '2001-01-01 12:00:00', '2001-01-01 11:00:00', TRUE);
|
||||
/* #5483
|
||||
INSERT INTO vn.entryConfig (defaultEntry, mailToNotify, inventorySupplierFk, maxLockTime, defaultSupplierFk)
|
||||
VALUES(1, NULL, 1, 300, 1);
|
||||
|
|
|
@ -60,13 +60,13 @@ INSERT INTO `vn`.`ticketConfig` (`id`, `scopeDays`)
|
|||
VALUES
|
||||
('1', '6');
|
||||
|
||||
INSERT INTO `vn`.`bionicConfig` (`generalInflationCoeficient`, `minimumDensityVolumetricWeight`, `verdnaturaVolumeBox`, `itemCarryBox`)
|
||||
INSERT INTO `vn`.`bionicConfig` (`id`, `generalInflationCoeficient`, `minimumDensityVolumetricWeight`, `verdnaturaVolumeBox`, `itemCarryBox`)
|
||||
VALUES
|
||||
(1.30, 167.00, 138000, 71);
|
||||
(1, 1.30, 167.00, 138000, 71);
|
||||
|
||||
INSERT INTO `vn`.`chatConfig` (`host`, `api`)
|
||||
INSERT INTO `vn`.`chatConfig` (`id`, `host`, `api`)
|
||||
VALUES
|
||||
('https://chat.verdnatura.es', 'https://chat.verdnatura.es/api/v1');
|
||||
(1, 'https://chat.verdnatura.es', 'https://chat.verdnatura.es/api/v1');
|
||||
|
||||
INSERT IGNORE INTO `vn`.`greugeConfig`(`id`, `freightPickUpPrice`)
|
||||
VALUES
|
||||
|
@ -118,18 +118,18 @@ INSERT INTO `hedera`.`tpvConfig`(`id`, `currency`, `terminal`, `transactionType`
|
|||
|
||||
INSERT INTO `account`.`user`(`id`,`name`,`nickname`, `password`,`role`,`active`,`email`,`lang`, `image`)
|
||||
VALUES
|
||||
(1101, 'BruceWayne', 'Bruce Wayne', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'BruceWayne@mydomain.com', 'es', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1102, 'PetterParker', 'Petter Parker', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'PetterParker@mydomain.com', 'en', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1103, 'ClarkKent', 'Clark Kent', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'ClarkKent@mydomain.com', 'fr', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1104, 'TonyStark', 'Tony Stark', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'TonyStark@mydomain.com', 'es', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1105, 'MaxEisenhardt', 'Max Eisenhardt', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1106, 'DavidCharlesHaller', 'David Charles Haller', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'DavidCharlesHaller@mydomain.com', 'en', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1107, 'HankPym', 'Hank Pym', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'HankPym@mydomain.com', 'en', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1108, 'CharlesXavier', 'Charles Xavier', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'CharlesXavier@mydomain.com', 'en', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1109, 'BruceBanner', 'Bruce Banner', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'BruceBanner@mydomain.com', 'en', 'e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1110, 'JessicaJones', 'Jessica Jones', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'JessicaJones@mydomain.com', 'en', NULL),
|
||||
(1111, 'Missing', 'Missing', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 0, NULL, 'en', NULL),
|
||||
(1112, 'Trash', 'Trash', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 0, NULL, 'en', NULL);
|
||||
(1101, 'BruceWayne', 'Bruce Wayne', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'BruceWayne@mydomain.com', 'es','1101'),
|
||||
(1102, 'PetterParker', 'Petter Parker', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'PetterParker@mydomain.com', 'en','1102'),
|
||||
(1103, 'ClarkKent', 'Clark Kent', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'ClarkKent@mydomain.com', 'fr','1103'),
|
||||
(1104, 'TonyStark', 'Tony Stark', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'TonyStark@mydomain.com', 'es','1104'),
|
||||
(1105, 'MaxEisenhardt', 'Max Eisenhardt', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt','1105'),
|
||||
(1106, 'DavidCharlesHaller', 'David Charles Haller', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'DavidCharlesHaller@mydomain.com', 'en','1106'),
|
||||
(1107, 'HankPym', 'Hank Pym', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'HankPym@mydomain.com', 'en','1107'),
|
||||
(1108, 'CharlesXavier', 'Charles Xavier', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'CharlesXavier@mydomain.com', 'en','1108'),
|
||||
(1109, 'BruceBanner', 'Bruce Banner', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'BruceBanner@mydomain.com', 'en','1109'),
|
||||
(1110, 'JessicaJones', 'Jessica Jones', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 1, 1, 'JessicaJones@mydomain.com', 'en','1110'),
|
||||
(1111, 'Missing', 'Missing', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 0, NULL, 'en','e7723f0b24ff05b32ed09d95196f2f29'),
|
||||
(1112, 'Trash', 'Trash', '$2b$10$UzQHth.9UUQ1T5aiQJ21lOU0oVlbxoqH4PFM9V8T90KNSAcg0eEL2', 2, 0, NULL, 'en','e7723f0b24ff05b32ed09d95196f2f29');
|
||||
|
||||
UPDATE account.`user`
|
||||
SET passExpired = DATE_SUB(util.VN_CURDATE(), INTERVAL 1 YEAR)
|
||||
|
@ -592,13 +592,13 @@ INSERT INTO `vn`.`supplierAccount`(`id`, `supplierFk`, `iban`, `bankEntityFk`)
|
|||
VALUES
|
||||
(241, 442, 'ES111122333344111122221111', 128);
|
||||
|
||||
INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `sage200Company`, `expired`, `companyGroupFk`, `phytosanitary` , `clientFk`)
|
||||
INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `expired`, `companyGroupFk`, `phytosanitary` , `clientFk`)
|
||||
VALUES
|
||||
(69 , 'CCs', NULL, 30, NULL, 0, NULL, 1, NULL , NULL),
|
||||
(442 , 'VNL', 241, 30, 2 , 1, NULL, 2, 'VNL Company - Plant passport' , 1101),
|
||||
(567 , 'VNH', NULL, 30, NULL, 4, NULL, 1, 'VNH Company - Plant passport' , NULL),
|
||||
(791 , 'FTH', NULL, 30, NULL, 3, '2015-11-30', 1, NULL , NULL),
|
||||
(1381, 'ORN', NULL, 30, NULL, 7, NULL, 1, 'ORN Company - Plant passport' , NULL);
|
||||
(69 , 'CCs', NULL, 30, 0, NULL, 1, NULL , NULL),
|
||||
(442 , 'VNL', 241, 30, 1, NULL, 2, 'VNL Company - Plant passport' , 1101),
|
||||
(567 , 'VNH', NULL, 30, 4, NULL, 1, 'VNH Company - Plant passport' , NULL),
|
||||
(791 , 'FTH', NULL, 30, 3, '2015-11-30', 1, NULL , NULL),
|
||||
(1381, 'ORN', NULL, 30, 7, NULL, 1, 'ORN Company - Plant passport' , NULL);
|
||||
|
||||
INSERT INTO `vn`.`taxArea` (`code`, `claveOperacionFactura`, `CodigoTransaccion`)
|
||||
VALUES
|
||||
|
@ -608,7 +608,8 @@ INSERT INTO `vn`.`taxArea` (`code`, `claveOperacionFactura`, `CodigoTransaccion`
|
|||
('WORLD', 2, 15);
|
||||
|
||||
INSERT INTO vn.invoiceOutConfig
|
||||
SET parallelism = 8;
|
||||
SET id = 1,
|
||||
parallelism = 8;
|
||||
|
||||
INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaFk`, `isCEE`, `type`)
|
||||
VALUES
|
||||
|
@ -714,7 +715,7 @@ INSERT INTO `vn`.`zoneClosure` (`zoneFk`, `dated`, `hour`)
|
|||
(12, util.VN_CURDATE(), '23:59'),
|
||||
(13, util.VN_CURDATE(), '23:59');
|
||||
|
||||
INSERT INTO `vn`.`zoneConfig` (`scope`) VALUES ('1');
|
||||
INSERT INTO `vn`.`zoneConfig` (`id`, `scope`) VALUES (1, '1');
|
||||
|
||||
INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`, `zoneFk`)
|
||||
VALUES
|
||||
|
@ -759,8 +760,8 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF
|
|||
(29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
||||
(30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
||||
(31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
||||
(32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL);
|
||||
|
||||
(32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL, NULL),
|
||||
(33, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL, NULL);
|
||||
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
|
||||
VALUES
|
||||
(1, 11, 1, 'ready'),
|
||||
|
@ -983,9 +984,9 @@ INSERT INTO `vn`.`packaging`(`id`, `volume`, `width`, `height`, `depth`, `isPack
|
|||
('cc', 1640038.00, 56.00, 220.00, 128.00, 1, util.VN_CURDATE(), 15, 90.00),
|
||||
('pallet 100', 2745600.00, 100.00, 220.00, 120.00, 1, util.VN_CURDATE(), 16, 0.00);
|
||||
|
||||
INSERT INTO `vn`.`packagingConfig`(`upperGap`, `defaultSmallPackageFk`, `defaultBigPackageFk`)
|
||||
INSERT INTO `vn`.`packagingConfig`(`id`, `upperGap`, `defaultSmallPackageFk`, `defaultBigPackageFk`)
|
||||
VALUES
|
||||
('10', 1, 'pallet 100');
|
||||
(1, '10', 1, 'pallet 100');
|
||||
|
||||
INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`)
|
||||
VALUES
|
||||
|
@ -1491,8 +1492,8 @@ INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeF
|
|||
|
||||
INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packagingFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`, `printedStickers`,`isChecked`,`isIgnored`,`weight`, `created`)
|
||||
VALUES
|
||||
(1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
|
||||
(2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE() - INTERVAL 2 MONTH),
|
||||
(2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE() - INTERVAL 1 MONTH),
|
||||
(3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 0, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE()),
|
||||
(4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, 0, NULL, 0.00, 7.30, 7.00, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
||||
(5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, 0, NULL, 0.00, 78.3, 75.6, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
||||
|
@ -1868,8 +1869,7 @@ INSERT INTO `vn`.`claimEnd`(`id`, `saleFk`, `claimFk`, `workerFk`, `claimDestina
|
|||
|
||||
INSERT INTO `vn`.`claimConfig`(`id`, `maxResponsibility`)
|
||||
VALUES
|
||||
(1, 50),
|
||||
(2, 30);
|
||||
(1, 50);
|
||||
|
||||
INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`)
|
||||
VALUES
|
||||
|
@ -1980,10 +1980,10 @@ INSERT INTO `pbx`.`sip`(`user_id`, `extension`)
|
|||
(5, 1102),
|
||||
(9, 1201);
|
||||
|
||||
INSERT INTO `vn`.`professionalCategory` (`id`, `name`, `level`, `dayBreak`)
|
||||
INSERT INTO `vn`.`professionalCategory` (`id`, `description`)
|
||||
VALUES
|
||||
(1, 'employee', NULL, NULL),
|
||||
(2, 'florist', NULL, NULL);
|
||||
(1, 'employee'),
|
||||
(2, 'florist');
|
||||
|
||||
INSERT INTO `vn`.`calendarType` (`id`, `description`, `hoursWeek`, `isPartial`)
|
||||
VALUES
|
||||
|
@ -2400,7 +2400,8 @@ INSERT INTO `vn`.`dmsType`(`id`, `name`, `readRoleFk`, `writeRoleFk`, `code`)
|
|||
(18, 'dua', NULL, NULL, 'dua'),
|
||||
(19, 'inmovilizado', NULL, NULL, 'fixedAssets'),
|
||||
(20, 'Reclamación', 1, 1, 'claim'),
|
||||
(21, 'Entrada', 1, 1, 'entry');
|
||||
(21, 'Entrada', 1, 1, 'entry'),
|
||||
(22, 'Proveedor', 1, 1, 'supplier');
|
||||
|
||||
INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`)
|
||||
VALUES
|
||||
|
@ -2412,7 +2413,8 @@ INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `wa
|
|||
(6, 5, '6.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'NotExists', 'DoesNotExists', util.VN_CURDATE()),
|
||||
(7, 20, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
|
||||
(8, 20, '8.mp4', 'video/mp4', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()),
|
||||
(9, 21, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'ENTRADA ID 1', util.VN_CURDATE());
|
||||
(9, 21, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'ENTRADA ID 1', util.VN_CURDATE()),
|
||||
(10, 21, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'ENTRADA DE PRUEBA', util.VN_CURDATE());
|
||||
|
||||
INSERT INTO `vn`.`claimDms`(`claimFk`, `dmsFk`)
|
||||
VALUES
|
||||
|
@ -2504,9 +2506,9 @@ INSERT INTO `hedera`.`imageCollectionSize`(`id`, `collectionFk`,`width`, `height
|
|||
VALUES
|
||||
(1, 4, 160, 160);
|
||||
|
||||
INSERT INTO `vn`.`rateConfig`(`rate0`, `rate1`, `rate2`, `rate3`)
|
||||
INSERT INTO `vn`.`rateConfig`(`id`, `rate0`, `rate1`, `rate2`, `rate3`)
|
||||
VALUES
|
||||
(36, 31, 25, 21);
|
||||
(1, 36, 31, 25, 21);
|
||||
|
||||
INSERT INTO `vn`.`rate`(`dated`, `warehouseFk`, `rate0`, `rate1`, `rate2`, `rate3`)
|
||||
VALUES
|
||||
|
@ -2697,9 +2699,9 @@ INSERT INTO `bs`.`sale` (`saleFk`, `amount`, `dated`, `typeFk`, `clientFk`)
|
|||
(4, 33.8, util.VN_CURDATE(), 1, 1101),
|
||||
(30, 34.4, util.VN_CURDATE(), 1, 1108);
|
||||
|
||||
INSERT INTO `vn`.`docuwareConfig` (`url`)
|
||||
INSERT INTO `vn`.`docuwareConfig` (`id`, `url`)
|
||||
VALUES
|
||||
('http://docuware.url/');
|
||||
(1, 'http://docuware.url/');
|
||||
|
||||
INSERT INTO `vn`.`calendarHolidaysName` (`id`, `name`)
|
||||
VALUES
|
||||
|
@ -2796,12 +2798,13 @@ INSERT INTO `vn`.`packingSite` (`id`, `code`, `hostFk`, `monitorId`)
|
|||
VALUES
|
||||
(1, 'h1', 1, '');
|
||||
|
||||
INSERT INTO `vn`.`packingSiteConfig` (`shinobiUrl`, `shinobiToken`, `shinobiGroupKey`, `avgBoxingTime`)
|
||||
INSERT INTO `vn`.`packingSiteConfig` (`id`, `shinobiUrl`, `shinobiToken`, `shinobiGroupKey`, `avgBoxingTime`)
|
||||
VALUES
|
||||
('', 'SHINNOBI_TOKEN', 'GROUP_TOKEN', 6000);
|
||||
(1, '', 'SHINNOBI_TOKEN', 'GROUP_TOKEN', 6000);
|
||||
INSERT INTO `util`.`notificationConfig`
|
||||
SET `cleanDays` = 90;
|
||||
|
||||
SET `id` = 1,
|
||||
`cleanDays` = 90;
|
||||
TRUNCATE `util`.`notification`;
|
||||
INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
||||
VALUES
|
||||
(1, 'print-email', 'notification fixture one'),
|
||||
|
@ -2809,8 +2812,10 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
|||
(3, 'not-main-printer-configured', 'A printer distinct than main has been configured'),
|
||||
(4, 'supplier-pay-method-update', 'A supplier pay method has been updated'),
|
||||
(5, 'modified-entry', 'An entry has been modified'),
|
||||
(6, 'book-entry-deleted', 'accounting entries deleted');
|
||||
(6, 'book-entry-deleted', 'accounting entries deleted'),
|
||||
(7, 'zone-included','An email to notify zoneCollisions');
|
||||
|
||||
TRUNCATE `util`.`notificationAcl`;
|
||||
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
||||
VALUES
|
||||
(1, 9),
|
||||
|
@ -2819,13 +2824,16 @@ INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
|||
(3, 9),
|
||||
(4, 1),
|
||||
(5, 9),
|
||||
(6, 9);
|
||||
(6, 9),
|
||||
(7, 9);
|
||||
|
||||
TRUNCATE `util`.`notificationQueue`;
|
||||
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
|
||||
VALUES
|
||||
(1, 'print-email', '{"id": "1"}', 9, 'pending', util.VN_CURDATE()),
|
||||
(2, 'print-email', '{"id": "2"}', null, 'pending', util.VN_CURDATE()),
|
||||
(3, 'print-email', null, null, 'pending', util.VN_CURDATE());
|
||||
TRUNCATE `util`.`notificationSubscription`;
|
||||
|
||||
INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`)
|
||||
VALUES
|
||||
|
@ -2836,8 +2844,8 @@ INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`)
|
|||
(2, 1109),
|
||||
(1, 9),
|
||||
(1, 3),
|
||||
(6, 9);
|
||||
|
||||
(6, 9),
|
||||
(7, 9);
|
||||
|
||||
INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`)
|
||||
VALUES
|
||||
|
@ -2853,7 +2861,7 @@ INSERT INTO `vn`.`collection` (`id`, `created`, `workerFk`, `stateFk`, `itemPack
|
|||
|
||||
INSERT INTO `vn`.`itemConfig` (`id`, `isItemTagTriggerDisabled`, `monthToDeactivate`, `wasteRecipients`, `validPriorities`, `defaultPriority`, `defaultTag`, `warehouseFk`)
|
||||
VALUES
|
||||
(0, 0, 24, '', '[1,2,3]', 2, 56, 60);
|
||||
(1, 0, 24, '', '[1,2,3]', 2, 56, 60);
|
||||
|
||||
INSERT INTO `vn`.`ticketCollection` (`ticketFk`, `collectionFk`, `created`, `level`, `wagon`, `smartTagFk`, `usedShelves`, `itemCount`, `liters`)
|
||||
VALUES
|
||||
|
@ -2890,7 +2898,7 @@ INSERT INTO `vn`.`ticketLog` (originFk, userFk, `action`, creationDate, changedM
|
|||
(1, 18, 'insert', '1999-05-09 10:00:00', 'Ticket', 45, 'Super Man' , NULL, '{"id":45,"clientFk":8608,"warehouseFk":60,"shipped":"2023-05-16T22:00:00.000Z","nickname":"Super Man","addressFk":48637,"isSigned":true,"isLabeled":true,"isPrinted":true,"packages":0,"hour":0,"created":"2023-05-16T11:42:56.000Z","isBlocked":false,"hasPriority":false,"companyFk":442,"agencyModeFk":639,"landed":"2023-05-17T22:00:00.000Z","isBoxed":true,"isDeleted":true,"zoneFk":713,"zonePrice":13,"zoneBonus":0}', NULL);
|
||||
INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`)
|
||||
VALUES
|
||||
(0, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', '1,6', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all');
|
||||
(1, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', '1,6', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all');
|
||||
|
||||
INSERT INTO `vn`.`mdbApp` (`app`, `baselineBranchFk`, `userFk`, `locked`)
|
||||
VALUES
|
||||
|
@ -3070,8 +3078,6 @@ INSERT INTO `vn`.`cmr` (id,truckPlate,observations,senderInstruccions,paymentIns
|
|||
UPDATE vn.department
|
||||
SET workerFk = null;
|
||||
|
||||
-- NEW WAREHOUSE
|
||||
|
||||
INSERT INTO vn.packaging
|
||||
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0);
|
||||
|
||||
|
@ -3715,8 +3721,8 @@ UPDATE vn.collection
|
|||
UPDATE vn.sale
|
||||
SET isPicked =FALSE;
|
||||
|
||||
INSERT INTO vn.machineWorkerConfig(maxHours)
|
||||
VALUES(12);
|
||||
INSERT INTO vn.machineWorkerConfig(id, maxHours)
|
||||
VALUES(1, 12);
|
||||
|
||||
INSERT INTO vn.workerAppTester(workerFk) VALUES(66);
|
||||
|
||||
|
@ -3735,3 +3741,10 @@ INSERT INTO vn.report (name) VALUES ('LabelCollection');
|
|||
|
||||
INSERT INTO vn.parkingLog(originFk, userFk, `action`, creationDate, description, changedModel,oldInstance, newInstance, changedModelId, changedModelValue)
|
||||
VALUES(1, 18, 'update', util.VN_CURDATE(), NULL, 'SaleGroup', '{"parkingFk":null}', '{"parkingFk":1}', 1, NULL);
|
||||
|
||||
INSERT INTO vn.ticketLog (originFk,userFk,`action`,creationDate,changedModel,newInstance,changedModelId,changedModelValue)
|
||||
VALUES (18,9,'insert','2001-01-01 11:01:00.000','Ticket','{"isDeleted":true}',45,'Super Man');
|
||||
|
||||
INSERT INTO `vn`.`supplierDms`(`supplierFk`, `dmsFk`, `editorFk`)
|
||||
VALUES
|
||||
(1, 10, 9);
|
||||
|
|
|
@ -23,7 +23,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT Id_Ticket
|
||||
FROM vn2008.Tickets t
|
||||
JOIN vn.invoiceOut io ON io.id = t.Factura
|
||||
JOIN vn.invoiceOut io ON io.`ref` = t.Factura
|
||||
WHERE year(io.issued) = vYear
|
||||
AND month(io.issued) = vMonth;
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE
|
||||
DEFINER=`root`@`localhost`
|
||||
EVENT `floranet`.`clean`
|
||||
ON SCHEDULE EVERY 1 DAY
|
||||
STARTS '2024-01-01 23:00:00.000'
|
||||
ON COMPLETION PRESERVE
|
||||
ENABLE
|
||||
DO
|
||||
BEGIN
|
||||
DELETE
|
||||
FROM `order`
|
||||
WHERE created < CURDATE()
|
||||
AND isPaid = FALSE;
|
||||
|
||||
DELETE c.*
|
||||
FROM catalogue c
|
||||
LEFT JOIN `order` o ON o.catalogueFk = c.id
|
||||
WHERE c.created < CURDATE()
|
||||
AND o.id IS NULL;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,52 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.catalogue_get;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.catalogue_get(vLanded DATE, vPostalCode VARCHAR(15))
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Returns list, price and all the stuff regarding the floranet items
|
||||
*
|
||||
* @param vLanded Delivery date
|
||||
* @param vPostalCode Delivery address postal code
|
||||
*/
|
||||
DECLARE vLastCatalogueFk INT;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
SELECT * FROM catalogue FOR UPDATE;
|
||||
|
||||
SELECT MAX(id) INTO vLastCatalogueFk
|
||||
FROM catalogue;
|
||||
|
||||
INSERT INTO catalogue(
|
||||
name,
|
||||
price,
|
||||
itemFk,
|
||||
dated,
|
||||
postalCode,
|
||||
`type`,
|
||||
image,
|
||||
description
|
||||
)
|
||||
SELECT i.name,
|
||||
i.`size`,
|
||||
i.id,
|
||||
vLanded,
|
||||
vPostalCode,
|
||||
it.name,
|
||||
CONCAT('https://cdn.verdnatura.es/image/catalog/1600x900/', i.image),
|
||||
i.description
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType it ON it.id = i.typeFk
|
||||
WHERE it.code IN ('FNR','FNP');
|
||||
|
||||
SELECT *
|
||||
FROM catalogue
|
||||
WHERE id > IFNULL(vLastCatalogueFk,0);
|
||||
|
||||
COMMIT;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,20 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.contact_request;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost`
|
||||
PROCEDURE floranet.contact_request(
|
||||
vName VARCHAR(100),
|
||||
vPhone VARCHAR(15),
|
||||
vEmail VARCHAR(100),
|
||||
vMessage TEXT)
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Set actions for contact request.
|
||||
*
|
||||
* @param vPostalCode Delivery address postal code
|
||||
*/
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,29 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.deliveryDate_get;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `floranet`.`deliveryDate_get`(vPostalCode VARCHAR(15))
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Returns available dates for this postalCode, in the next seven days
|
||||
*
|
||||
* @param vPostalCode Delivery address postal code
|
||||
*/
|
||||
DECLARE vCurrentDayOfWeek INT;
|
||||
|
||||
SET vCurrentDayOfWeek = DAYOFWEEK(NOW());
|
||||
|
||||
SELECT DISTINCT nextDay
|
||||
FROM (
|
||||
SELECT CURDATE() + INTERVAL IF(
|
||||
apc.dayOfWeek >= vCurrentDayOfWeek,
|
||||
apc.dayOfWeek - vCurrentDayOfWeek,
|
||||
7 - apc.dayOfWeek
|
||||
) DAY nextDay,
|
||||
NOW() + INTERVAL apc.hoursInAdvance - 12 HOUR minDeliveryTime
|
||||
FROM addressPostCode apc
|
||||
WHERE apc.postCode = vPostalCode
|
||||
HAVING nextDay > minDeliveryTime) sub;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,25 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.order_confirm;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
|
||||
CREATE DEFINER=`root`@`localhost`PROCEDURE floranet.order_confirm(vCatalogueFk INT)
|
||||
READS SQL DATA
|
||||
|
||||
BEGIN
|
||||
/** Update order.isPaid field
|
||||
*
|
||||
* @param vCatalogueFk floranet.catalogue.id
|
||||
*
|
||||
* @returns floranet.order.isPaid
|
||||
*/
|
||||
UPDATE `order`
|
||||
SET isPaid = TRUE,
|
||||
payed = NOW()
|
||||
WHERE catalogueFk = vCatalogueFk;
|
||||
|
||||
SELECT isPaid
|
||||
FROM `order`
|
||||
WHERE catalogueFk = vCatalogueFk;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,42 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.order_put;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.order_put(vOrder JSON)
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Get and process an order
|
||||
*
|
||||
* @param vOrder Data of the order
|
||||
*
|
||||
* Customer data: <customerName>, <email>, <customerPhone>
|
||||
*
|
||||
* Item data: <catalogueFk>, <message>
|
||||
*
|
||||
* Delivery data: <deliveryName>, <address>, <deliveryPhone>
|
||||
*
|
||||
*/
|
||||
INSERT IGNORE INTO `order`(
|
||||
catalogueFk,
|
||||
customerName,
|
||||
email,
|
||||
customerPhone,
|
||||
message,
|
||||
deliveryName,
|
||||
address,
|
||||
deliveryPhone
|
||||
)
|
||||
VALUES (JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.catalogueFk')),
|
||||
JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.customerName')),
|
||||
JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.email')),
|
||||
JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.customerPhone')),
|
||||
JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.message')),
|
||||
JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.deliveryName')),
|
||||
JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.address')),
|
||||
JSON_UNQUOTE(JSON_EXTRACT(vOrder,'$.deliveryPhone'))
|
||||
);
|
||||
|
||||
SELECT LAST_INSERT_ID() orderFk;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,19 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.sliders_get;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.sliders_get()
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Returns list of url for sliders
|
||||
*/
|
||||
SELECT
|
||||
CONCAT('https://cdn.verdnatura.es/image/catalog/1600x900/', i.image) url,
|
||||
i.longName
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType it ON it.id = i.typeFk
|
||||
WHERE it.code IN ('FNR','FNP');
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -32,7 +32,7 @@ BEGIN
|
|||
WHERE c.available > 0
|
||||
GROUP BY c.item_id;
|
||||
|
||||
CALL vn.catalog_calculate(vDelivery, vAddress, vAgencyMode);
|
||||
CALL vn.catalog_calculate(vDelivery, vAddress, vAgencyMode, FALSE);
|
||||
|
||||
DROP TEMPORARY TABLE tmp.item;
|
||||
END$$
|
||||
|
|
|
@ -16,7 +16,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT vSelf itemFk;
|
||||
|
||||
CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
|
||||
CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, FALSE);
|
||||
|
||||
SELECT l.warehouseFk, w.name warehouse,
|
||||
p.`grouping`, p.price, p.rate, l.available
|
||||
|
|
|
@ -27,7 +27,7 @@ BEGIN
|
|||
WHERE orderFk = vSelf
|
||||
GROUP BY itemFk;
|
||||
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode);
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode, FALSE);
|
||||
|
||||
DROP TEMPORARY TABLE tmp.item;
|
||||
END$$
|
||||
|
|
|
@ -22,7 +22,7 @@ BEGIN
|
|||
FROM `order`
|
||||
WHERE id = vSelf;
|
||||
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode);
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode, FALSE);
|
||||
|
||||
IF account.myUser_getName() = 'visitor' THEN
|
||||
UPDATE tmp.ticketCalculateItem
|
||||
|
|
|
@ -7,6 +7,7 @@ BEGIN
|
|||
* @vInvoiceInFk Factura recibida
|
||||
* @vXDiarioFk Id tabla XDiario
|
||||
*/
|
||||
DECLARE vInvoiceInOriginalFk INT;
|
||||
DECLARE vDone BOOL DEFAULT FALSE;
|
||||
DECLARE vBase DOUBLE;
|
||||
DECLARE vVat DOUBLE;
|
||||
|
@ -198,5 +199,36 @@ BEGIN
|
|||
AND e.name = 'Retenciones'
|
||||
AND id.id IS NULL;
|
||||
|
||||
SELECT correctedFk INTO vInvoiceInOriginalFk
|
||||
FROM vn.invoiceInCorrection
|
||||
WHERE correctingFk = vInvoiceInFk;
|
||||
|
||||
IF vInvoiceInOriginalFk THEN
|
||||
|
||||
UPDATE movContaIVA mci
|
||||
JOIN vn.invoiceInRefund iir ON iir.invoiceInRefundFk = vInvoiceInFk
|
||||
JOIN (SELECT issued,
|
||||
SUM(sub.taxableBase) taxableBase,
|
||||
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
||||
FROM(SELECT issued,
|
||||
SUM(iit.taxableBase) taxableBase,
|
||||
ti.PorcentajeIva
|
||||
FROM vn.invoiceIn i
|
||||
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
||||
JOIN sage.TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
||||
WHERE i.id = vInvoiceInOriginalFk
|
||||
GROUP BY ti.CodigoIva)sub
|
||||
)invoiceInOriginal
|
||||
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
||||
SET mci.TipoRectificativa = iir.refundCategoryFk,
|
||||
mci.ClaseAbonoRectificativas = iir.refundType,
|
||||
mci.FechaFacturaOriginal = invoiceInOriginal.issued,
|
||||
mci.FechaOperacion = invoiceInOriginal.issued,
|
||||
mci.BaseImponibleOriginal = invoiceInOriginal.taxableBase,
|
||||
mci.CuotaIvaOriginal = invoiceInOriginal.vat,
|
||||
mci.ClaveOperacionFactura = co.ClaveOperacionFactura_
|
||||
WHERE mci.id = vXDiarioFk;
|
||||
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -17,13 +17,13 @@ BEGIN
|
|||
e.id accountFk,
|
||||
UCASE(e.name),
|
||||
''
|
||||
FROM expense e
|
||||
FROM vn.expense e
|
||||
UNION
|
||||
SELECT company_getCode(vCompanyFk),
|
||||
a.account,
|
||||
UCASE(a.bank),
|
||||
''
|
||||
FROM accounting a
|
||||
FROM vn.accounting a
|
||||
WHERE a.isActive
|
||||
AND a.`account`
|
||||
UNION
|
||||
|
|
|
@ -20,6 +20,7 @@ BEGIN
|
|||
|
||||
CALL vn.addressTaxArea();
|
||||
SELECT areaFk INTO vTaxArea FROM tmp.addressTaxArea;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.addressCompany,
|
||||
tmp.addressTaxArea;
|
||||
|
|
|
@ -14,7 +14,10 @@ BEGIN
|
|||
SELECT `value` INTO price
|
||||
FROM vn.specialPrice
|
||||
WHERE itemFk = vItemFk
|
||||
AND clientFk = vClientFk ;
|
||||
AND (clientFk = vClientFk OR clientFk IS NULL)
|
||||
AND started <= util.VN_CURDATE()
|
||||
AND (ended >= util.VN_CURDATE() OR ended IS NULL)
|
||||
ORDER BY id DESC LIMIT 1;
|
||||
RETURN price;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`travel_hasUniqueAwb`(
|
||||
vSelf INT
|
||||
)
|
||||
RETURNS BOOL
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Comprueba que el travel pasado tiene un AWB lógico,
|
||||
* no se pueden tener varios AWB asociados al mismo DUA
|
||||
*
|
||||
* @param vSelf Id del travel
|
||||
*/
|
||||
DECLARE vHasUniqueAwb BOOL DEFAULT TRUE;
|
||||
|
||||
SELECT NOT COUNT(t2.awbFk) INTO vHasUniqueAwb
|
||||
FROM entry e
|
||||
JOIN travel t ON t.id = e.travelFk
|
||||
JOIN duaEntry de ON de.entryFk = e.id
|
||||
JOIN duaEntry de2 ON de2.duaFk = de.duaFk
|
||||
JOIN entry e2 ON e2.id = de2.entryFk
|
||||
JOIN travel t2 ON t2.id = e2.travelFk
|
||||
WHERE t.id = vSelf
|
||||
AND t2.awbFk <> t.awbFk;
|
||||
|
||||
RETURN vHasUniqueAwb;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,102 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`absoluteInventoryHistory`(
|
||||
vItemFk INT,
|
||||
vWarehouseFk INT,
|
||||
vDate DATETIME
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Calcula y proporciona un historial de inventario absoluto
|
||||
* para un artículo específico en un almacén dado
|
||||
* hasta una fecha determinada.
|
||||
*
|
||||
* @param vItemFk Id de artículo
|
||||
* @param vWarehouseFk Id de almacén
|
||||
* @param vDate Fecha
|
||||
*/
|
||||
DECLARE vCalculatedInventory INT;
|
||||
DECLARE vToday DATETIME DEFAULT util.VN_CURDATE();
|
||||
DECLARE vStartDate DATE DEFAULT '2001-01-01';
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tHistoricalPast
|
||||
ENGINE = MEMORY
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT tr.landed `date`,
|
||||
b.quantity input,
|
||||
NULL `output`,
|
||||
tr.isReceived ok,
|
||||
s.name alias,
|
||||
e.invoiceNumber reference,
|
||||
e.id id,
|
||||
tr.isDelivered f5
|
||||
FROM buy b
|
||||
JOIN `entry` e ON e.id = b.entryFk
|
||||
JOIN travel tr ON tr.id = e.travelFk
|
||||
JOIN supplier s ON s.id = e.supplierFk
|
||||
WHERE tr.landed >= vStartDate
|
||||
AND s.id <> (SELECT supplierFk FROM inventoryConfig)
|
||||
AND vWarehouseFk IN (tr.warehouseInFk, 0)
|
||||
AND b.itemFk = vItemFk
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT e.isRaid
|
||||
UNION ALL
|
||||
SELECT tr.shipped,
|
||||
NULL,
|
||||
b.quantity,
|
||||
tr.isDelivered,
|
||||
s.name,
|
||||
e.invoiceNumber,
|
||||
e.id,
|
||||
tr.isDelivered
|
||||
FROM buy b
|
||||
JOIN `entry` e ON e.id = b.entryFk
|
||||
JOIN travel tr ON tr.id = e.travelFk
|
||||
JOIN supplier s ON s.id = e.supplierFk
|
||||
WHERE tr.shipped >= vStartDate
|
||||
AND vWarehouseFk = tr.warehouseOutFk
|
||||
AND s.id <> (SELECT supplierFk FROM inventoryConfig)
|
||||
AND b.itemFk = vItemFk
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT e.isRaid
|
||||
UNION ALL
|
||||
SELECT t.shipped,
|
||||
NULL,
|
||||
m.quantity,
|
||||
(m.isPicked OR t.isLabeled OR t.refFk IS NOT NULL),
|
||||
t.nickname,
|
||||
t.refFk,
|
||||
t.id,
|
||||
t.isPrinted
|
||||
FROM sale m
|
||||
JOIN ticket t ON t.id = m.ticketFk
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
WHERE t.shipped >= vStartDate
|
||||
AND m.itemFk = vItemFk
|
||||
AND vWarehouseFk IN (t.warehouseFk, 0)
|
||||
) t1
|
||||
ORDER BY `date`, input DESC, ok DESC;
|
||||
|
||||
SELECT SUM(input) - SUM(`output`) INTO vCalculatedInventory
|
||||
FROM tHistoricalPast
|
||||
WHERE `date` < vDate;
|
||||
|
||||
SELECT p1.*, NULL v_virtual
|
||||
FROM (
|
||||
SELECT vDate `date`,
|
||||
vCalculatedInventory input,
|
||||
NULL `output`,
|
||||
1 ok,
|
||||
'Inventario calculado' alias,
|
||||
'' reference,
|
||||
0 id,
|
||||
1 f5
|
||||
UNION ALL
|
||||
SELECT *
|
||||
FROM tHistoricalPast
|
||||
WHERE `date` >= vDate
|
||||
) p1;
|
||||
|
||||
DROP TEMPORARY TABLE tHistoricalPast;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,283 @@
|
|||
DELIMITER $$
|
||||
$$
|
||||
CREATE OR REPLACE PROCEDURE vn.sale_boxPickingPrint(
|
||||
IN vPrinterFk INT,
|
||||
IN vSaleFk INT,
|
||||
IN vPacking INT,
|
||||
IN vSectorFk INT,
|
||||
IN vUserFk INT,
|
||||
IN vPackagingFk INT,
|
||||
IN vPackingSiteFk INT)
|
||||
BEGIN
|
||||
/** Splits a line of sale to a different ticket and prints the transport sticker
|
||||
*/
|
||||
DECLARE vAgencyModeFk INT;
|
||||
DECLARE vConcept VARCHAR(30);
|
||||
DECLARE vExpeditionFk INT;
|
||||
DECLARE vItemFk INT;
|
||||
DECLARE vItemShelvingFk INT;
|
||||
DECLARE vItemShelvingSaleFk INT;
|
||||
DECLARE vItemShelvingSaleFk_old INT;
|
||||
DECLARE vLastExpeditionTimeStamp DATETIME;
|
||||
DECLARE vMaxPhoneLength INT DEFAULT 11;
|
||||
DECLARE vMaxStreetLength INT DEFAULT 36;
|
||||
DECLARE vNewSaleFk INT;
|
||||
DECLARE vNewTicketFk INT;
|
||||
DECLARE vParkingCode VARCHAR(10);
|
||||
DECLARE vQuantity INT;
|
||||
DECLARE vRemainder INT DEFAULT 0;
|
||||
DECLARE vRemainderSaleFk INT;
|
||||
DECLARE vShelving VARCHAR(10);
|
||||
DECLARE vTicketFk INT;
|
||||
|
||||
SELECT s.quantity,
|
||||
s.quantity MOD vPacking,
|
||||
s.ticketFk,
|
||||
s.itemFk,
|
||||
s.concept
|
||||
INTO vQuantity,
|
||||
vRemainder,
|
||||
vTicketFk,
|
||||
vItemFk,
|
||||
vConcept
|
||||
FROM sale s
|
||||
WHERE s.id = vSaleFk;
|
||||
|
||||
IF vRemainder THEN
|
||||
UPDATE sale SET quantity = quantity - vRemainder WHERE id = vSaleFk;
|
||||
|
||||
INSERT INTO sale(ticketFk, itemFk, quantity, price, discount, concept)
|
||||
SELECT ticketFk, itemFk, vRemainder, price, discount, concept
|
||||
FROM sale
|
||||
WHERE id = vSaleFk;
|
||||
|
||||
SET vRemainderSaleFk = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT vRemainderSaleFk, componentFk, value
|
||||
FROM saleComponent
|
||||
WHERE saleFk = vSaleFk;
|
||||
END IF;
|
||||
|
||||
w1: WHILE vQuantity >= vPacking DO
|
||||
|
||||
SET vItemShelvingFk = NULL;
|
||||
|
||||
SELECT sub.id
|
||||
INTO vItemShelvingFk
|
||||
FROM productionConfig pc
|
||||
JOIN (
|
||||
SELECT ish.id,
|
||||
ish.visible - IFNULL(SUM(iss.quantity),0) available,
|
||||
p.pickingOrder,
|
||||
ish.created
|
||||
FROM itemShelving ish
|
||||
JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN parking p ON p.id = sh.parkingFk
|
||||
LEFT JOIN itemShelvingSale iss
|
||||
ON iss.itemShelvingFk = ish.id
|
||||
AND iss.created >= CURDATE()
|
||||
AND iss.isPicked = FALSE
|
||||
WHERE ish.itemFk = vItemFk
|
||||
AND p.sectorFk = vSectorFk
|
||||
GROUP BY ish.id
|
||||
HAVING available >= vPacking) sub
|
||||
ORDER BY IF(pc.orderMode = 'Location',sub.pickingOrder, sub.created)
|
||||
LIMIT 1;
|
||||
|
||||
IF vItemShelvingFk THEN
|
||||
INSERT INTO itemShelvingSale
|
||||
SET itemShelvingFk = vItemShelvingFk,
|
||||
saleFk = vSaleFk,
|
||||
quantity = vPacking,
|
||||
userFk = vUserFk,
|
||||
isPicked = TRUE;
|
||||
|
||||
SET vItemShelvingSaleFk = LAST_INSERT_ID();
|
||||
|
||||
UPDATE sale SET isPicked = FALSE WHERE id = vSaleFk;
|
||||
ELSE
|
||||
LEAVE w1;
|
||||
END IF;
|
||||
|
||||
SET vNewTicketFk = NULL;
|
||||
|
||||
SELECT MAX(t.id) INTO vNewTicketFk
|
||||
FROM ticket t
|
||||
JOIN ticketLastState tls ON tls.ticketFk = t.id
|
||||
JOIN (SELECT addressFk, clientFk, date(shipped) shipped, warehouseFk
|
||||
FROM ticket
|
||||
WHERE id = vTicketFk) tt
|
||||
ON tt.addressFk = t.addressFk
|
||||
AND tt.clientFk = t.clientFk
|
||||
AND t.shipped BETWEEN tt.shipped AND util.dayend(tt.shipped)
|
||||
AND t.warehouseFk = tt.warehouseFk
|
||||
WHERE tls.name = 'Encajado' ;
|
||||
|
||||
IF ISNULL(vNewTicketFk) THEN
|
||||
INSERT INTO ticket( clientFk,
|
||||
shipped,
|
||||
addressFk,
|
||||
agencyModeFk,
|
||||
nickname,
|
||||
warehouseFk,
|
||||
companyFk,
|
||||
landed,
|
||||
zoneFk,
|
||||
zonePrice,
|
||||
zoneBonus,
|
||||
routeFk,
|
||||
priority,
|
||||
hasPriority,
|
||||
clonedFrom)
|
||||
SELECT clientFk,
|
||||
shipped,
|
||||
addressFk,
|
||||
agencyModeFk,
|
||||
nickname,
|
||||
warehouseFk,
|
||||
companyFk,
|
||||
landed,
|
||||
zoneFk,
|
||||
zonePrice,
|
||||
zoneBonus,
|
||||
routeFk,
|
||||
priority,
|
||||
hasPriority,
|
||||
id
|
||||
FROM ticket
|
||||
WHERE id = vTicketFk;
|
||||
|
||||
SET vNewTicketFk = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO ticketTracking(ticketFk, stateFk, userFk)
|
||||
SELECT vNewTicketFk, id, vUserFk
|
||||
FROM state
|
||||
WHERE code = 'PACKED';
|
||||
END IF;
|
||||
|
||||
UPDATE sale SET quantity = quantity - vPacking WHERE id = vSaleFk;
|
||||
|
||||
UPDATE itemShelving SET visible = visible - vPacking WHERE id = vItemShelvingFk;
|
||||
|
||||
SET vNewSaleFk = NULL;
|
||||
|
||||
SELECT MAX(id) INTO vNewSaleFk
|
||||
FROM sale
|
||||
WHERE ticketFk = vNewTicketFk
|
||||
AND itemFk = vItemFk;
|
||||
|
||||
IF vNewSaleFk THEN
|
||||
UPDATE sale
|
||||
SET quantity = quantity + vPacking
|
||||
WHERE id = vNewSaleFk;
|
||||
|
||||
SET vItemShelvingSaleFk_old = NULL;
|
||||
|
||||
SELECT MAX(id) INTO vItemShelvingSaleFk_old
|
||||
FROM itemShelvingSale
|
||||
WHERE itemShelvingFk = vItemShelvingFk
|
||||
AND saleFk = vNewSaleFk;
|
||||
|
||||
IF vItemShelvingSaleFk_old THEN
|
||||
UPDATE itemShelvingSale
|
||||
SET quantity = quantity + vPacking
|
||||
WHERE id = vItemShelvingSaleFk_old;
|
||||
|
||||
DELETE FROM itemShelvingSale
|
||||
WHERE id = vItemShelvingSaleFk;
|
||||
|
||||
SET vItemShelvingSaleFk = vItemShelvingSaleFk_old;
|
||||
ELSE
|
||||
UPDATE itemShelvingSale
|
||||
SET saleFk = vNewSaleFk
|
||||
WHERE id = vItemShelvingSaleFk;
|
||||
END IF;
|
||||
ELSE
|
||||
INSERT INTO sale(ticketFk, itemFk, concept, quantity, discount, price)
|
||||
SELECT vNewTicketFk, itemFk, concept, vPacking, discount, price
|
||||
FROM sale
|
||||
WHERE id = vSaleFk;
|
||||
|
||||
SET vNewSaleFk = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO saleComponent(saleFk, componentFk, value, isGreuge)
|
||||
SELECT vNewSaleFk, componentFk, value, isGreuge
|
||||
FROM saleComponent
|
||||
WHERE saleFk = vSaleFk;
|
||||
|
||||
UPDATE itemShelvingSale
|
||||
SET saleFk = vNewSaleFk
|
||||
WHERE id = vItemShelvingSaleFk;
|
||||
END IF;
|
||||
|
||||
INSERT IGNORE INTO saleTracking(saleFk, isChecked, workerFk, stateFk)
|
||||
SELECT vNewSaleFk, TRUE, vUserFk, id
|
||||
FROM state
|
||||
WHERE code = 'PREPARED';
|
||||
|
||||
SELECT agencyModeFk INTO vAgencyModeFk
|
||||
FROM ticket
|
||||
WHERE id = vNewTicketFk;
|
||||
|
||||
INSERT INTO expedition(
|
||||
agencyModeFk,
|
||||
ticketFk,
|
||||
freightItemFk,
|
||||
workerFk,
|
||||
packagingFk,
|
||||
itemPackingTypeFk,
|
||||
hostFk,
|
||||
packingSiteFk,
|
||||
monitorId,
|
||||
started,
|
||||
ended
|
||||
)
|
||||
SELECT vAgencyModeFk,
|
||||
vNewTicketFk,
|
||||
i.id,
|
||||
vUserFk,
|
||||
vPackagingFk,
|
||||
ps.code,
|
||||
h.code,
|
||||
vPackingSiteFk,
|
||||
ps.monitorId,
|
||||
IFNULL(vLastExpeditionTimeStamp, NOW()),
|
||||
NOW()
|
||||
FROM packingSite ps
|
||||
JOIN host h ON h.id = ps.hostFk
|
||||
JOIN item i ON i.name = 'Shipping cost'
|
||||
WHERE ps.id = vPackingSiteFk
|
||||
LIMIT 1;
|
||||
|
||||
SET vExpeditionFk = LAST_INSERT_ID();
|
||||
|
||||
SET vLastExpeditionTimeStamp = NOW();
|
||||
|
||||
CALL dipole.expedition_Add(vExpeditionFk,vPrinterFk, TRUE);
|
||||
|
||||
SELECT shelvingFk, p.code
|
||||
INTO vShelving, vParkingCode
|
||||
FROM itemShelving ish
|
||||
JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN parking p ON p.id = sh.parkingFk
|
||||
WHERE ish.id = vItemShelvingFk;
|
||||
|
||||
UPDATE dipole.expedition_PrintOut
|
||||
SET isPrinted = FALSE,
|
||||
itemFk = vItemFk,
|
||||
quantity = vPacking,
|
||||
longName = vConcept,
|
||||
shelvingFk = vShelving,
|
||||
parkingCode = vParkingCode,
|
||||
phone = RIGHT(phone,vMaxPhoneLength),
|
||||
street = RIGHT(street, vMAxStreetLength)
|
||||
WHERE expeditionFk = vExpeditionFk;
|
||||
|
||||
DELETE FROM sale
|
||||
WHERE quantity = 0
|
||||
AND id = vSaleFk;
|
||||
END WHILE;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -20,7 +20,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT vItemFk itemFk;
|
||||
|
||||
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
|
||||
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, TRUE);
|
||||
DROP TEMPORARY TABLE tmp.item;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`catalog_calculate`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`catalog_calculate`(
|
||||
vLanded DATE,
|
||||
vAddressFk INT,
|
||||
vAgencyModeFk INT,
|
||||
vShowExpiredZones BOOLEAN)
|
||||
BEGIN
|
||||
/**
|
||||
* Calcula los articulos disponibles y sus precios
|
||||
|
@ -25,7 +29,7 @@ BEGIN
|
|||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
CALL vn.zone_getShipped (vLanded, vAddressFk, vAgencyModeFk, FALSE);
|
||||
CALL vn.zone_getShipped (vLanded, vAddressFk, vAgencyModeFk, vShowExpiredZones);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot;
|
||||
CREATE TEMPORARY TABLE tmp.ticketLot(
|
||||
|
|
|
@ -25,6 +25,19 @@ BEGIN
|
|||
FROM address
|
||||
WHERE id = vAddressFk;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSpecialPrice
|
||||
(INDEX (itemFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT * FROM (
|
||||
SELECT *
|
||||
FROM specialPrice
|
||||
WHERE (clientFk = vClientFk OR clientFk IS NULL)
|
||||
AND started <= vShipped
|
||||
AND (ended >= vShipped OR ended IS NULL)
|
||||
ORDER BY (clientFk = vClientFk) DESC, id DESC
|
||||
LIMIT 10000000000000000000) t
|
||||
GROUP BY itemFk;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketComponentCalculate
|
||||
(PRIMARY KEY (itemFk, warehouseFk))
|
||||
ENGINE = MEMORY
|
||||
|
@ -44,8 +57,7 @@ BEGIN
|
|||
JOIN item i ON i.id = tl.itemFk
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
JOIN itemCategory ic ON ic.id = it.categoryFk
|
||||
LEFT JOIN specialPrice sp ON sp.itemFk = i.id
|
||||
AND sp.clientFk = vClientFk
|
||||
LEFT JOIN tSpecialPrice sp ON sp.itemFk = i.id
|
||||
LEFT JOIN (
|
||||
SELECT * FROM (
|
||||
SELECT pf.itemFk,
|
||||
|
@ -146,7 +158,7 @@ BEGIN
|
|||
FROM tmp.ticketComponentBase tcb
|
||||
JOIN vn.component c2 ON c2.code = 'lastUnitsDiscount'
|
||||
JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk
|
||||
LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
|
||||
LEFT JOIN tSpecialPrice sp ON sp.itemFk = tcc.itemFk
|
||||
JOIN vn.item i ON i.id = tcb.itemFk
|
||||
WHERE sp.value IS NULL
|
||||
AND i.supplyResponseFk IS NULL;
|
||||
|
@ -169,7 +181,7 @@ BEGIN
|
|||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN vn.component c2 ON c2.code = 'salePerPackage'
|
||||
JOIN buy b ON b.id = tcc.buyFk
|
||||
LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
|
||||
LEFT JOIN tSpecialPrice sp ON sp.itemFk = tcc.itemFk
|
||||
WHERE sp.value IS NULL;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.`zone` (INDEX (id))
|
||||
|
@ -208,7 +220,7 @@ BEGIN
|
|||
sp.value - SUM(tcc.cost) sumCost
|
||||
FROM tmp.ticketComponentCopy tcc
|
||||
JOIN component c ON c.id = tcc.componentFk
|
||||
JOIN specialPrice sp ON sp.clientFk = vClientFK AND sp.itemFk = tcc.itemFk
|
||||
JOIN tSpecialPrice sp ON sp.itemFk = tcc.itemFk
|
||||
JOIN vn.component c2 ON c2.code = 'specialPrices'
|
||||
WHERE c.classRate IS NULL
|
||||
AND tcc.warehouseFk = vWarehouseFk
|
||||
|
@ -289,6 +301,7 @@ BEGIN
|
|||
tmp.ticketComponentSum,
|
||||
tmp.ticketComponentBase,
|
||||
tmp.ticketComponentRate,
|
||||
tmp.ticketComponentCopy;
|
||||
tmp.ticketComponentCopy,
|
||||
tSpecialPrice;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -30,6 +30,7 @@ BEGIN
|
|||
DELETE IGNORE FROM expedition WHERE created < v26Months;
|
||||
DELETE FROM sms WHERE created < v18Months;
|
||||
DELETE FROM saleTracking WHERE created < v1Years;
|
||||
DELETE FROM productionError WHERE dated < v1Years;
|
||||
DELETE FROM ticketTracking WHERE created < v18Months;
|
||||
DELETE tobs FROM ticketObservation tobs
|
||||
JOIN ticket t ON tobs.ticketFk = t.id
|
||||
|
|
|
@ -28,6 +28,7 @@ proc:BEGIN
|
|||
DECLARE vLockName VARCHAR(215);
|
||||
DECLARE vLockTime INT DEFAULT 15;
|
||||
DECLARE vFreeWagonFk INT;
|
||||
|
||||
DECLARE c1 CURSOR FOR
|
||||
SELECT ticketFk, `lines`, m3
|
||||
FROM tmp.productionBuffer
|
||||
|
@ -44,13 +45,21 @@ proc:BEGIN
|
|||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
IF vLockName IS NOT NULL THEN
|
||||
DO RELEASE_LOCK(vLockName);
|
||||
END IF;
|
||||
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
SELECT pc.ticketTrolleyMax * o.numberOfWagons,
|
||||
pc.hasUniqueCollectionTime,
|
||||
w.code,
|
||||
o.warehouseFk,
|
||||
o.itemPackingTypeFk,
|
||||
st.code,
|
||||
CONCAT('collection_new', o.warehouseFk, ':',o.itemPackingTypeFk),
|
||||
o.numberOfWagons,
|
||||
o.trainFk,
|
||||
o.linesLimit,
|
||||
|
@ -61,7 +70,6 @@ proc:BEGIN
|
|||
vWarehouseFk,
|
||||
vItemPackingTypeFk,
|
||||
vStateFk,
|
||||
vLockName,
|
||||
vWagons,
|
||||
vTrainFk,
|
||||
vLinesLimit,
|
||||
|
@ -71,6 +79,12 @@ proc:BEGIN
|
|||
JOIN state st ON st.`code` = 'ON_PREPARATION'
|
||||
JOIN operator o ON o.workerFk = vUserFk;
|
||||
|
||||
SET vLockName = CONCAT_WS('/',
|
||||
'collection_new',
|
||||
vWarehouseFk,
|
||||
vItemPackingTypeFk
|
||||
);
|
||||
|
||||
IF NOT GET_LOCK(vLockName, vLockTime) THEN
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
|
|
@ -169,7 +169,7 @@ BEGIN
|
|||
AND vp.supplierFk = rd.supplierFk
|
||||
AND vp.companyFk = rd.companyFk
|
||||
AND vp.currencyFk = rd.currencyFk
|
||||
WHERE vp.isPayment = FALSE;
|
||||
WHERE NOT vp.isPayment;
|
||||
|
||||
SELECT vp.expirationId,
|
||||
vp.dated,
|
||||
|
@ -183,11 +183,15 @@ BEGIN
|
|||
vp.isPayment,
|
||||
vp.isReconciled,
|
||||
vp.endingBalance,
|
||||
cr.amount clientRiskAmount
|
||||
cr.amount clientRiskAmount,
|
||||
co.CEE
|
||||
FROM tPendingDuedates vp
|
||||
LEFT JOIN supplier s ON s.id = vp.supplierFk
|
||||
LEFT JOIN client c ON c.fi = s.nif
|
||||
LEFT JOIN clientRisk cr ON cr.clientFk = c.id
|
||||
LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id
|
||||
LEFT JOIN bankEntity be ON be.id = sa.bankEntityFk
|
||||
LEFT JOIN country co ON co.id = be.countryFk
|
||||
AND cr.companyFk = vp.companyFk;
|
||||
|
||||
DROP TEMPORARY TABLE tOpeningBalances;
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`creditInsurance_getRisk`()
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve el riesgo de los clientes que estan asegurados
|
||||
*/
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.client_list
|
||||
(PRIMARY KEY (Id_Cliente))
|
||||
ENGINE = MEMORY
|
||||
SELECT * FROM (
|
||||
SELECT cc.client Id_Cliente, ci.grade
|
||||
FROM creditClassification cc
|
||||
JOIN creditInsurance ci ON cc.id = ci.creditClassification
|
||||
WHERE dateEnd IS NULL
|
||||
ORDER BY ci.creationDate DESC
|
||||
LIMIT 10000000000000000000) t1
|
||||
GROUP BY Id_Cliente;
|
||||
|
||||
CALL vn2008.risk_vs_client_list(util.VN_CURDATE());
|
||||
|
||||
SELECT
|
||||
c.id,
|
||||
c.name,
|
||||
c.credit clientCredit,
|
||||
c.creditInsurance solunion,
|
||||
CAST(r.risk AS DECIMAL(10,0)) risk,
|
||||
CAST(c.creditInsurance - r.risk AS DECIMAL(10,0)) riskAlive,
|
||||
cac.invoiced billedAnnually,
|
||||
c.dueDay,
|
||||
ci.grade,
|
||||
c2.country
|
||||
FROM tmp.client_list ci
|
||||
LEFT JOIN tmp.risk r ON r.Id_Cliente = ci.Id_Cliente
|
||||
JOIN client c ON c.id = ci.Id_Cliente
|
||||
JOIN bs.clientAnnualConsumption cac ON c.id = cac.clientFk
|
||||
JOIN country c2 ON c2.id = c.countryFk
|
||||
GROUP BY c.id;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.risk;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.client_list;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,22 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_checkBooked`(
|
||||
vSelf INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Comprueba si una entrada está contabilizada,
|
||||
* y si lo está retorna un throw.
|
||||
*
|
||||
* @param vSelf Id de entrada
|
||||
*/
|
||||
DECLARE vIsBooked BOOL;
|
||||
|
||||
SELECT isBooked INTO vIsBooked
|
||||
FROM `entry`
|
||||
WHERE id = vSelf;
|
||||
|
||||
IF vIsBooked THEN
|
||||
CALL util.throw('Entry is already booked');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -37,7 +37,7 @@ BEGIN
|
|||
LEFT JOIN origin o ON o.id = i.originFk
|
||||
) ON it.id = i.typeFk
|
||||
LEFT JOIN edi.ekt ek ON b.ektFk = ek.id
|
||||
WHERE (b.packagingFk = "--" OR b.price2 = 0 OR b.packing = 0 OR b.buyingValue = 0) AND tr.landed > util.firstDayOfMonth(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())) AND s.name = 'INVENTARIO';
|
||||
WHERE (b.packagingFk = "--" OR b.price2 = 0 OR b.buyingValue = 0) AND tr.landed > util.firstDayOfMonth(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())) AND s.name = 'INVENTARIO';
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.lastEntryOk;
|
||||
CREATE TEMPORARY TABLE tmp.lastEntryOk
|
||||
|
@ -94,11 +94,6 @@ BEGIN
|
|||
JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk
|
||||
SET b.price2 = eo.price2 WHERE b.price2 = 0 ;
|
||||
|
||||
UPDATE buy b
|
||||
JOIN tmp.lastEntry lt ON lt.buyFk = b.id
|
||||
JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk
|
||||
SET b.packing = eo.packing WHERE b.packing = 0;
|
||||
|
||||
UPDATE buy b
|
||||
JOIN tmp.lastEntry lt ON lt.buyFk = b.id
|
||||
JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTaxMakeByDua`(vDuaFk INT)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTaxMakeByDua`(
|
||||
vDuaFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Borra los valores de duaTax y sus vctos. y los vuelve a crear en base a la tabla duaEntry
|
||||
* Borra los valores de duaTax y sus vctos. y los vuelve a
|
||||
* crear en base a la tabla duaEntry.
|
||||
*
|
||||
* @param vDuaFk Id del dua a recalcular
|
||||
*/
|
||||
|
@ -26,7 +29,7 @@ BEGIN
|
|||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
CALL vn2008.recibidaIvaInsert(vInvoiceInFk);
|
||||
CALL invoiceInTax_recalc(vInvoiceInFk);
|
||||
CALL invoiceInDueDay_recalc(vInvoiceInFk);
|
||||
|
||||
END LOOP;
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInTax_recalc`(
|
||||
vInvoiceInFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Recalcula y actualiza los impuestos de la factura
|
||||
* usando la última tasa de cambio y detalles de compra.
|
||||
*
|
||||
* @param vInvoiceInFk Id de factura recibida
|
||||
*/
|
||||
DECLARE vRate DOUBLE DEFAULT 1;
|
||||
DECLARE vExpenseFk VARCHAR(10);
|
||||
|
||||
SELECT `value` INTO vRate
|
||||
FROM referenceRate rr
|
||||
JOIN invoiceIn ii ON ii.id = vInvoiceInFk
|
||||
WHERE rr.dated <= ii.issued
|
||||
AND rr.currencyFk = ii.currencyFk
|
||||
ORDER BY dated DESC
|
||||
LIMIT 1;
|
||||
|
||||
DELETE FROM invoiceInTax WHERE invoiceInFk = vInvoiceInFk;
|
||||
|
||||
SELECT id INTO vExpenseFk
|
||||
FROM expense
|
||||
WHERE code = 'extraCommGoodsAcquisition';
|
||||
|
||||
IF vExpenseFk IS NULL THEN
|
||||
CALL util.throw('Expense extraCommGoodsAcquisition not exists');
|
||||
END IF;
|
||||
|
||||
INSERT INTO invoiceInTax(
|
||||
invoiceInFk,
|
||||
taxableBase,
|
||||
expenseFk,
|
||||
foreignValue,
|
||||
taxTypeSageFk,
|
||||
transactionTypeSageFk
|
||||
)
|
||||
SELECT ii.id,
|
||||
SUM(b.buyingValue * b.quantity) / vRate bi,
|
||||
vExpenseFk,
|
||||
IF(c.code = 'EUR', NULL, SUM(b.buyingValue * b.quantity)),
|
||||
s.taxTypeSageFk,
|
||||
s.transactionTypeSageFk
|
||||
FROM invoiceIn ii
|
||||
JOIN currency c ON c.id = ii.currencyFk
|
||||
JOIN `entry` e ON e.invoiceInFk = ii.id
|
||||
JOIN supplier s ON s.id = e.supplierFk
|
||||
JOIN buy b ON b.entryFk = e.id
|
||||
LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk
|
||||
AND rr.dated = ii.issued
|
||||
WHERE ii.id = vInvoiceInFk
|
||||
HAVING bi IS NOT NULL;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,234 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `sage`.`invoiceIn_add`(vInvoiceInFk INT, vXDiarioFk INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Traslada la info de contabilidad relacionada con las facturas recibidas
|
||||
*
|
||||
* @vInvoiceInFk Factura recibida
|
||||
* @vXDiarioFk Id tabla XDiario
|
||||
*/
|
||||
DECLARE vInvoiceInOriginalFk INT;
|
||||
DECLARE vDone BOOL DEFAULT FALSE;
|
||||
DECLARE vBase DOUBLE;
|
||||
DECLARE vVat DOUBLE;
|
||||
DECLARE vRate DOUBLE;
|
||||
DECLARE vTransactionCode INT;
|
||||
DECLARE vCounter INT DEFAULT 0;
|
||||
DECLARE vTransactionCodeOld INT;
|
||||
DECLARE vTaxCode INT;
|
||||
DECLARE vTaxCodeOld INT;
|
||||
DECLARE vOperationCode VARCHAR(1);
|
||||
DECLARE vIsIntracommunity BOOL DEFAULT FALSE;
|
||||
DECLARE vSerialDua VARCHAR(1) DEFAULT 'D';
|
||||
DECLARE vInvoiceTypeReceived VARCHAR(1);
|
||||
DECLARE vInvoiceTypeInformative VARCHAR(1);
|
||||
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
|
||||
|
||||
DECLARE vCursor CURSOR FOR
|
||||
SELECT it.taxableBase,
|
||||
CAST((( it.taxableBase / 100) * t.PorcentajeIva) AS DECIMAL (10,2)),
|
||||
t.PorcentajeIva,
|
||||
it.transactionTypeSageFk,
|
||||
it.taxTypeSageFk,
|
||||
tty.isIntracommunity,
|
||||
tt.ClaveOperacionDefecto
|
||||
FROM vn.invoiceIn i
|
||||
JOIN vn.invoiceInTax it ON it.InvoiceInFk = i.id
|
||||
JOIN TiposIva t ON t.CodigoIva = it.taxTypeSageFk
|
||||
JOIN taxType tty ON tty.id = t.CodigoIva
|
||||
JOIN TiposTransacciones tt ON tt.CodigoTransaccion = it.transactionTypeSageFk
|
||||
LEFT JOIN vn.dua d ON d.id = vInvoiceInFk
|
||||
WHERE i.id = vInvoiceInFk
|
||||
AND d.id IS NULL;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
DELETE FROM movContaIVA
|
||||
WHERE id = vXDiarioFk;
|
||||
|
||||
SELECT codeSage INTO vInvoiceTypeReceived
|
||||
FROM invoiceType WHERE code ='received';
|
||||
|
||||
SELECT codeSage INTO vInvoiceTypeInformative
|
||||
FROM invoiceType WHERE code ='informative';
|
||||
|
||||
INSERT INTO movContaIVA(id, LibreA1)
|
||||
VALUES (vXDiarioFk, vInvoiceInFk);
|
||||
|
||||
OPEN vCursor;
|
||||
|
||||
l: LOOP
|
||||
FETCH vCursor INTO vBase,
|
||||
vVat,
|
||||
vRate,
|
||||
vTransactionCode,
|
||||
vTaxCode,
|
||||
vIsIntracommunity,
|
||||
vOperationCode;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
SET vTransactionCodeOld = vTransactionCode;
|
||||
SET vTaxCodeOld = vTaxCode;
|
||||
|
||||
IF vOperationCode IS NOT NULL THEN
|
||||
UPDATE movContaIVA
|
||||
SET ClaveOperacionFactura = vOperationCode
|
||||
WHERE id = vXDiarioFk;
|
||||
END IF;
|
||||
|
||||
SET vCounter = vCounter + 1;
|
||||
CASE vCounter
|
||||
WHEN 1 THEN
|
||||
UPDATE movContaIVA
|
||||
SET BaseIva1 = vBase,
|
||||
PorIva1 = vRate,
|
||||
CuotaIva1 = vVat,
|
||||
CodigoTransaccion1 = vTransactionCode,
|
||||
CodigoIva1 = vTaxCode
|
||||
WHERE id = vXDiarioFk;
|
||||
|
||||
WHEN 2 THEN
|
||||
UPDATE movContaIVA
|
||||
SET BaseIva2 = vBase,
|
||||
PorIva2 = vRate,
|
||||
CuotaIva2 = vVat,
|
||||
CodigoTransaccion2 = vTransactionCode,
|
||||
CodigoIva2 = vTaxCode
|
||||
WHERE id = vXDiarioFk;
|
||||
WHEN 3 THEN
|
||||
UPDATE movContaIVA
|
||||
SET BaseIva3 = vBase,
|
||||
PorIva3 = vRate,
|
||||
CuotaIva3 = vVat,
|
||||
CodigoTransaccion3 = vTransactionCode,
|
||||
CodigoIva3 = vTaxCode
|
||||
WHERE id = vXDiarioFk;
|
||||
WHEN 4 THEN
|
||||
UPDATE movContaIVA
|
||||
SET BaseIva4 = vBase,
|
||||
PorIva4 = vRate,
|
||||
CuotaIva4 = vVat,
|
||||
CodigoTransaccion4 = vTransactionCode,
|
||||
CodigoIva4 = vTaxCode
|
||||
WHERE id = vXDiarioFk;
|
||||
ELSE
|
||||
SELECT vXDiarioFk INTO vXDiarioFk;
|
||||
END CASE;
|
||||
|
||||
IF vIsIntracommunity THEN
|
||||
UPDATE movContaIVA
|
||||
SET Intracomunitaria = TRUE
|
||||
WHERE id = vXDiarioFk;
|
||||
END IF;
|
||||
|
||||
SET vTransactionCodeOld = vTransactionCode;
|
||||
SET vTaxCodeOld = vTaxCode;
|
||||
|
||||
END LOOP;
|
||||
|
||||
CLOSE vCursor;
|
||||
|
||||
SELECT d.ASIEN AND x.ASIEN IS NULL INTO vIsInformativeExportation
|
||||
FROM vn.dua d
|
||||
LEFT JOIN vn.XDiario x ON x.ASIEN = d.ASIEN
|
||||
AND x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci
|
||||
WHERE d.ASIEN = (
|
||||
SELECT ASIEN
|
||||
FROM vn.XDiario
|
||||
WHERE id = vXDiarioFk)
|
||||
LIMIT 1;
|
||||
|
||||
UPDATE movContaIVA mci
|
||||
JOIN tmp.invoiceIn ii ON ii.id = vInvoiceInFk
|
||||
JOIN vn.XDiario x ON x.id = mci.id
|
||||
LEFT JOIN tmp.invoiceDua id ON id.id = mci.id
|
||||
JOIN vn.supplier s ON s.id = ii.supplierFk
|
||||
JOIN Naciones n ON n.countryFk = s.countryFk
|
||||
SET mci.CodigoDivisa = ii.currencyFk,
|
||||
mci.Año = YEAR(ii.issued),
|
||||
mci.Serie = ii.serial,
|
||||
mci.Factura = ii.id,
|
||||
mci.FechaFactura = ii.issued,
|
||||
mci.ImporteFactura = IFNULL(mci.BaseIva1, 0) + IFNULL(mci.CuotaIva1, 0) +
|
||||
IFNULL(mci.BaseIva2, 0) + IFNULL(mci.CuotaIva2, 0) +
|
||||
IFNULL(mci.BaseIva3, 0) + IFNULL(mci.CuotaIva3, 0) +
|
||||
IFNULL(mci.BaseIva4, 0) + IFNULL(mci.CuotaIva4, 0),
|
||||
mci.TipoFactura = IF(id.id,
|
||||
IF( ii.serial = vSerialDua COLLATE utf8mb3_unicode_ci, vInvoiceTypeReceived, vInvoiceTypeInformative),
|
||||
IF(vIsInformativeExportation,vInvoiceTypeInformative, vInvoiceTypeReceived)),
|
||||
mci.CodigoCuentaFactura = x.SUBCTA,
|
||||
mci.CifDni = IF(LEFT(TRIM(s.nif), 2) = n.SiglaNacion, SUBSTRING(TRIM(s.nif), 3), s.nif),
|
||||
mci.Nombre = s.name,
|
||||
mci.SiglaNacion = n.SiglaNacion,
|
||||
mci.EjercicioFactura = YEAR(ii.issued),
|
||||
mci.FechaOperacion = ii.issued,
|
||||
mci.MantenerAsiento = TRUE,
|
||||
mci.SuFacturaNo = ii.supplierRef,
|
||||
mci.IvaDeducible1 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva1, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
|
||||
mci.IvaDeducible2 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva2, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
|
||||
mci.IvaDeducible3 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva3, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
|
||||
mci.IvaDeducible4 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva4, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
|
||||
mci.FechaFacturaOriginal = x.FECHA_EX
|
||||
WHERE mci.id = vXDiarioFk;
|
||||
|
||||
-- RETENCIONES
|
||||
UPDATE movContaIVA mci
|
||||
JOIN vn.invoiceIn ii ON ii.id = vInvoiceInFk
|
||||
JOIN vn.XDiario x ON x.id = mci.id
|
||||
JOIN vn.supplier s ON s.id = supplierFk
|
||||
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = ii.id
|
||||
JOIN vn.expense e ON e.id = iit.expenseFk
|
||||
JOIN TiposRetencion t ON t.CodigoRetencion = ii.withholdingSageFk
|
||||
LEFT JOIN tmp.invoiceDua id ON id.id = mci.id
|
||||
JOIN (SELECT SUM(x2.BASEEURO) taxableBase, SUM(x2.EURODEBE) taxBase
|
||||
FROM vn.XDiario x1
|
||||
JOIN vn.XDiario x2 ON x1.ASIEN = x2.ASIEN
|
||||
WHERE x2.BASEEURO <> 0
|
||||
AND x1.id = vXDiarioFk
|
||||
)sub
|
||||
JOIN ClavesOperacion co ON co.Descripcion = 'Arrendamiento de locales de negocio'
|
||||
SET mci.CodigoRetencion = t.CodigoRetencion,
|
||||
mci.ClaveOperacionFactura = IF( t.Retencion = 'ARRENDAMIENTO Y SUBARRENDAMIENTO', co.ClaveOperacionFactura_, mci.ClaveOperacionFactura),
|
||||
mci.BaseRetencion = IF (t.Retencion = 'ACTIVIDADES AGRICOLAS O GANADERAS', sub.taxableBase + sub.taxBase, sub.taxableBase),
|
||||
mci.PorRetencion = t.PorcentajeRetencion,
|
||||
mci.ImporteRetencion = iit.taxableBase * - 1
|
||||
WHERE mci.id = vXDiarioFk
|
||||
AND e.name = 'Retenciones'
|
||||
AND id.id IS NULL;
|
||||
|
||||
SELECT correctedFk INTO vInvoiceInOriginalFk
|
||||
FROM vn.invoiceInCorrection
|
||||
WHERE correctingFk = vInvoiceInFk;
|
||||
|
||||
IF vInvoiceInOriginalFk THEN
|
||||
|
||||
UPDATE movContaIVA mci
|
||||
JOIN vn.invoiceInRefund iir ON iir.invoiceInRefundFk = vInvoiceInFk
|
||||
JOIN (SELECT issued,
|
||||
SUM(sub.taxableBase) taxableBase,
|
||||
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
||||
FROM(SELECT issued,
|
||||
SUM(iit.taxableBase) taxableBase,
|
||||
ti.PorcentajeIva
|
||||
FROM vn.invoiceIn i
|
||||
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
||||
JOIN sage.TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
||||
WHERE i.id = vInvoiceInOriginalFk
|
||||
GROUP BY ti.CodigoIva)sub
|
||||
)invoiceInOriginal
|
||||
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
||||
SET mci.TipoRectificativa = iir.refundCategoryFk,
|
||||
mci.ClaseAbonoRectificativas = iir.refundType,
|
||||
mci.FechaFacturaOriginal = invoiceInOriginal.issued,
|
||||
mci.FechaOperacion = invoiceInOriginal.issued,
|
||||
mci.BaseImponibleOriginal = invoiceInOriginal.taxableBase,
|
||||
mci.CuotaIvaOriginal = invoiceInOriginal.vat,
|
||||
mci.ClaveOperacionFactura = co.ClaveOperacionFactura_
|
||||
WHERE mci.id = vXDiarioFk;
|
||||
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -19,19 +19,14 @@ BEGIN
|
|||
DECLARE vTypeFk INT;
|
||||
DECLARE vPriority INT DEFAULT 1;
|
||||
|
||||
DECLARE vTag1 VARCHAR(20) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vTag5 VARCHAR(20) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vTag6 VARCHAR(20) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vTag7 VARCHAR(20) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vTag8 VARCHAR(20) COLLATE 'utf8_unicode_ci';
|
||||
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated);
|
||||
|
||||
DECLARE vValue1 VARCHAR(50) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vValue5 VARCHAR(50) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vValue6 VARCHAR(50) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vValue7 VARCHAR(50) COLLATE 'utf8_unicode_ci';
|
||||
DECLARE vValue8 VARCHAR(50) COLLATE 'utf8_unicode_ci';
|
||||
-- Añadido temporalmente para ver si ya no sucede el cuelgue de db
|
||||
SET vShowType = TRUE;
|
||||
|
||||
SELECT typeFk,
|
||||
WITH itemTags AS (
|
||||
SELECT i.id,
|
||||
typeFk,
|
||||
tag5,
|
||||
value5,
|
||||
tag6,
|
||||
|
@ -42,70 +37,59 @@ BEGIN
|
|||
value8,
|
||||
t.name,
|
||||
it.value
|
||||
INTO vTypeFk,
|
||||
vTag5,
|
||||
vValue5,
|
||||
vTag6,
|
||||
vValue6,
|
||||
vTag7,
|
||||
vValue7,
|
||||
vTag8,
|
||||
vValue8,
|
||||
vTag1,
|
||||
vValue1
|
||||
FROM item i
|
||||
LEFT JOIN itemTag it ON it.itemFk = i.id
|
||||
FROM vn.item i
|
||||
LEFT JOIN vn.itemTag it ON it.itemFk = i.id
|
||||
AND it.priority = vPriority
|
||||
LEFT JOIN tag t ON t.id = it.tagFk
|
||||
WHERE i.id = vSelf;
|
||||
|
||||
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated);
|
||||
|
||||
LEFT JOIN vn.tag t ON t.id = it.tagFk
|
||||
WHERE i.id = vSelf
|
||||
)
|
||||
SELECT i.id itemFk,
|
||||
i.longName,
|
||||
i.subName,
|
||||
i.tag5,
|
||||
i.value5,
|
||||
(i.value5 <=> vValue5) match5,
|
||||
(i.value5 <=> its.value5) match5,
|
||||
i.tag6,
|
||||
i.value6,
|
||||
(i.value6 <=> vValue6) match6,
|
||||
(i.value6 <=> its.value6) match6,
|
||||
i.tag7,
|
||||
i.value7,
|
||||
(i.value7 <=> vValue7) match7,
|
||||
(i.value7 <=> its.value7) match7,
|
||||
i.tag8,
|
||||
i.value8,
|
||||
(i.value8 <=> vValue8) match8,
|
||||
(i.value8 <=> its.value8) match8,
|
||||
a.available,
|
||||
IFNULL(ip.counter, 0) `counter`,
|
||||
IF(b.groupingMode = 1, b.grouping, b.packing) minQuantity,
|
||||
iss.visible located
|
||||
FROM item i
|
||||
STRAIGHT_JOIN cache.available a ON a.item_id = i.id
|
||||
FROM vn.item i
|
||||
JOIN cache.available a ON a.item_id = i.id
|
||||
AND a.calc_id = vCalcFk
|
||||
LEFT JOIN itemProposal ip ON ip.mateFk = i.id
|
||||
LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id
|
||||
AND ip.itemFk = vSelf
|
||||
LEFT JOIN itemTag it ON it.itemFk = i.id
|
||||
LEFT JOIN vn.itemTag it ON it.itemFk = i.id
|
||||
AND it.priority = vPriority
|
||||
LEFT JOIN tag t ON t.id = it.tagFk
|
||||
LEFT JOIN vn.tag t ON t.id = it.tagFk
|
||||
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id
|
||||
AND lb.warehouse_id = vWarehouseFk
|
||||
LEFT JOIN buy b ON b.id = lb.buy_id
|
||||
LEFT JOIN itemShelvingStock iss ON iss.itemFk = i.id
|
||||
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
||||
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id
|
||||
AND iss.warehouseFk = vWarehouseFk
|
||||
JOIN itemTags its
|
||||
WHERE a.available > 0
|
||||
AND IF(vShowType, i.typeFk = vTypeFk, TRUE)
|
||||
AND IF(vShowType, i.typeFk = its.typeFk, TRUE)
|
||||
AND i.id <> vSelf
|
||||
ORDER BY `counter` DESC,
|
||||
(t.name = vTag1) DESC,
|
||||
(it.value = vValue1) DESC,
|
||||
(i.tag5 = vTag5) DESC,
|
||||
(t.name = its.name) DESC,
|
||||
(it.value = its.value) DESC,
|
||||
(i.tag5 = its.tag5) DESC,
|
||||
match5 DESC,
|
||||
(i.tag6 = vTag6) DESC,
|
||||
(i.tag6 = its.tag6) DESC,
|
||||
match6 DESC,
|
||||
(i.tag7 = vTag7) DESC,
|
||||
(i.tag7 = its.tag7) DESC,
|
||||
match7 DESC,
|
||||
(i.tag8 = vTag8) DESC,
|
||||
match8 DESC;
|
||||
(i.tag8 = its.tag8) DESC,
|
||||
match8 DESC
|
||||
LIMIT 100;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -34,16 +34,22 @@ BEGIN
|
|||
-- Rellena la tabla tmp.errorsByChecker con fallos de revisores
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.errorsByChecker
|
||||
ENGINE = MEMORY
|
||||
SELECT st.workerFk,
|
||||
COUNT(t.id) errors
|
||||
FROM saleMistake sm
|
||||
JOIN saleTracking st ON sm.saleFk = st.saleFk
|
||||
JOIN `state` s2 ON s2.id = st.stateFk
|
||||
JOIN sale s ON s.id = sm.saleFk
|
||||
JOIN ticket t on t.id = s.ticketFk
|
||||
WHERE (t.shipped BETWEEN vDatedFrom AND vDatedTo)
|
||||
WITH rankedWorkers AS (
|
||||
SELECT sm.id,
|
||||
st.workerFk,
|
||||
ROW_NUMBER() OVER(PARTITION BY sm.id ORDER BY s2.`order`) rnk
|
||||
FROM vn.saleMistake sm
|
||||
JOIN vn.saleTracking st ON sm.saleFk = st.saleFk
|
||||
JOIN vn.`state` s2 ON s2.id = st.stateFk
|
||||
JOIN vn.sale s ON s.id = sm.saleFk
|
||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||
WHERE t.shipped BETWEEN vDatedFrom AND vDatedTo
|
||||
AND s2.code IN ('OK', 'PREVIOUS_PREPARATION', 'PREPARED', 'CHECKED')
|
||||
GROUP BY st.workerFk;
|
||||
)
|
||||
SELECT workerFk, COUNT(*) errors
|
||||
FROM rankedWorkers
|
||||
WHERE rnk = 1
|
||||
GROUP BY workerFk;
|
||||
|
||||
-- Rellena la tabla tmp.expeditionErrors con fallos de expediciones
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.expeditionErrors
|
||||
|
|
|
@ -46,6 +46,7 @@ BEGIN
|
|||
JOIN parking p ON p.id = sh.parkingFk
|
||||
JOIN tmp.productionBuffer pb ON pb.ticketFk = s.ticketFk
|
||||
JOIN agencyMode am ON am.id = pb.agencyModeFk
|
||||
JOIN agency a ON a .id = am.agencyFk
|
||||
LEFT JOIN routesMonitor rm ON rm.routeFk = pb.routeFk
|
||||
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
LEFT JOIN ticketState ts ON ts.ticketFk = s.ticketFk
|
||||
|
@ -60,6 +61,7 @@ BEGIN
|
|||
AND ((rm.bufferFk AND rm.isPickingAllowed)
|
||||
OR am.code = 'REC_ALG')
|
||||
AND pb.shipped = vDated
|
||||
AND a.isOwn
|
||||
GROUP BY s.id
|
||||
ORDER BY etd;
|
||||
|
||||
|
|
|
@ -77,7 +77,9 @@ BEGIN
|
|||
vNewItemFk);
|
||||
|
||||
SELECT price INTO vNewPrice
|
||||
FROM tmp.ticketCalculateItem;
|
||||
FROM tmp.ticketComponentPrice
|
||||
ORDER BY (vQuantity % `grouping`) ASC
|
||||
LIMIT 1;
|
||||
|
||||
IF vNewPrice IS NULL THEN
|
||||
CALL util.throw('price retrieval failed');
|
||||
|
@ -104,7 +106,7 @@ BEGIN
|
|||
price)
|
||||
SELECT vTicketFk,
|
||||
vNewItemFk,
|
||||
CEIL(vQuantity / vRoundQuantity) * vRoundQuantity, CONCAT('+ ',i.longName),
|
||||
CEIL(vQuantity / vRoundQuantity) * vRoundQuantity, CONCAT('+ ', i.name),
|
||||
vFinalPrice
|
||||
FROM vn.item i
|
||||
WHERE id = vNewItemFk;
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`solunionRiskRequest`()
|
||||
BEGIN
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.client_list;
|
||||
CREATE TEMPORARY TABLE tmp.client_list
|
||||
(PRIMARY KEY (Id_Cliente))
|
||||
ENGINE = MEMORY
|
||||
SELECT * FROM (SELECT cc.client Id_Cliente, ci.grade FROM vn.creditClassification cc
|
||||
JOIN vn.creditInsurance ci ON cc.id = ci.creditClassification
|
||||
WHERE dateEnd IS NULL
|
||||
ORDER BY ci.creationDate DESC
|
||||
LIMIT 10000000000000000000) t1 GROUP BY Id_Cliente;
|
||||
|
||||
CALL vn2008.risk_vs_client_list(util.VN_CURDATE());
|
||||
|
||||
SELECT
|
||||
c.Id_Cliente, c.Cliente, c.Credito credito_vn, c.creditInsurance solunion, cast(r.risk as DECIMAL(10,0)) riesgo_vivo,
|
||||
cast(c.creditInsurance - r.risk as decimal(10,0)) margen_vivo,
|
||||
f.Consumo consumo_anual, c.Vencimiento, ci.grade
|
||||
FROM
|
||||
vn2008.Clientes c
|
||||
JOIN tmp.risk r ON r.Id_Cliente = c.Id_Cliente
|
||||
JOIN tmp.client_list ci ON c.Id_Cliente = ci.Id_Cliente
|
||||
JOIN bi.facturacion_media_anual f ON c.Id_Cliente = f.Id_Cliente
|
||||
GROUP BY Id_cliente;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.risk;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.client_list;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
SELECT id itemFk FROM vn.item
|
||||
WHERE typeFk = vTypeFk;
|
||||
|
||||
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
|
||||
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, FALSE);
|
||||
DROP TEMPORARY TABLE tmp.item;
|
||||
DROP TEMPORARY TABLE tmp.ticketLot;
|
||||
END$$
|
||||
|
|
|
@ -2,54 +2,9 @@ DELIMITER $$
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticketClon`(vTicketFk INT, vNewShipped DATE)
|
||||
BEGIN
|
||||
|
||||
DECLARE done INT DEFAULT FALSE;
|
||||
DECLARE vNewTicketFk INT;
|
||||
DECLARE vOldSaleFk INT;
|
||||
DECLARE vNewSaleFk INT;
|
||||
|
||||
DECLARE cur1 CURSOR FOR
|
||||
SELECT id
|
||||
FROM vn.sale
|
||||
WHERE ticketFk = vTicketFk;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
|
||||
|
||||
SET vNewShipped = IFNULL(vNewShipped, util.VN_CURDATE());
|
||||
|
||||
CALL vn.ticket_Clone(vTicketFk, vNewTicketFk);
|
||||
|
||||
UPDATE vn.ticket
|
||||
SET landed = TIMESTAMPADD(DAY, DATEDIFF(vNewShipped, shipped), landed),
|
||||
shipped = vNewShipped
|
||||
WHERE id = vNewTicketFk;
|
||||
|
||||
OPEN cur1;
|
||||
|
||||
read_loop: LOOP
|
||||
|
||||
FETCH cur1 INTO vOldSaleFk;
|
||||
|
||||
IF done THEN
|
||||
LEAVE read_loop;
|
||||
END IF;
|
||||
|
||||
INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed)
|
||||
SELECT vNewTicketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed
|
||||
FROM vn.sale
|
||||
WHERE id = vOldSaleFk;
|
||||
|
||||
SELECT max(id) INTO vNewSaleFk
|
||||
FROM vn.sale
|
||||
WHERE ticketFk = vNewTicketFk;
|
||||
|
||||
INSERT INTO vn.saleComponent(saleFk, componentFk, value, isGreuge)
|
||||
SELECT vNewSaleFk, componentFk, value, isGreuge
|
||||
FROM vn.saleComponent
|
||||
WHERE saleFk = vOldSaleFk;
|
||||
|
||||
END LOOP;
|
||||
|
||||
CLOSE cur1;
|
||||
CALL ticket_cloneAll(vTicketFk, vNewShipped, TRUE, vNewTicketFk);
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_cloneAll`(vTicketFk INT, vNewShipped DATE, vWithWarehouse BOOLEAN, OUT vNewTicketFk INT)
|
||||
BEGIN
|
||||
|
||||
DECLARE vDone BOOLEAN DEFAULT FALSE;
|
||||
DECLARE vOldSaleFk INT;
|
||||
DECLARE vNewSaleFk INT;
|
||||
|
||||
DECLARE cur1 CURSOR FOR
|
||||
SELECT id
|
||||
FROM sale
|
||||
WHERE ticketFk = vTicketFk;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
SET vNewShipped = IFNULL(vNewShipped, util.VN_CURDATE());
|
||||
|
||||
CALL ticket_Clone(vTicketFk, vNewTicketFk);
|
||||
|
||||
UPDATE ticket
|
||||
SET landed = TIMESTAMPADD(DAY, DATEDIFF(vNewShipped, shipped), landed),
|
||||
shipped = vNewShipped,
|
||||
warehouseFk = IF(vWithWarehouse, warehouseFk, NULL)
|
||||
WHERE id = vNewTicketFk;
|
||||
|
||||
OPEN cur1;
|
||||
|
||||
read_loop: LOOP
|
||||
|
||||
FETCH cur1 INTO vOldSaleFk;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE read_loop;
|
||||
END IF;
|
||||
|
||||
INSERT INTO sale(ticketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed)
|
||||
SELECT vNewTicketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed
|
||||
FROM sale
|
||||
WHERE id = vOldSaleFk;
|
||||
|
||||
SELECT max(id) INTO vNewSaleFk
|
||||
FROM sale
|
||||
WHERE ticketFk = vNewTicketFk;
|
||||
|
||||
INSERT INTO saleComponent(saleFk, componentFk, value, isGreuge)
|
||||
SELECT vNewSaleFk, componentFk, value, isGreuge
|
||||
FROM saleComponent
|
||||
WHERE saleFk = vOldSaleFk;
|
||||
|
||||
END LOOP;
|
||||
|
||||
CLOSE cur1;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,4 +1,5 @@
|
|||
DELIMITER $$
|
||||
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`zone_getCollisions`()
|
||||
BEGIN
|
||||
/**
|
||||
|
@ -10,6 +11,7 @@ BEGIN
|
|||
DECLARE vZoneFk INT;
|
||||
DECLARE vIsDone INT DEFAULT FALSE;
|
||||
DECLARE vTableCollisions TEXT;
|
||||
DECLARE json_data JSON;
|
||||
DECLARE cur1 CURSOR FOR SELECT zoneFk from tmp.zoneOption;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE;
|
||||
|
@ -77,45 +79,26 @@ BEGIN
|
|||
GROUP BY z.agencyModeFk, zn.geoFk, zw.warehouseFk
|
||||
HAVING count(*) > 1;
|
||||
|
||||
SELECT '<table cellspacing="10">
|
||||
<tr>
|
||||
<th>C.Postal</th>
|
||||
<th>Número de zona</th>
|
||||
<th>Precio</th>
|
||||
<th>Zona</th>
|
||||
<th>Almacén</th>
|
||||
<th>Salix</th>
|
||||
</tr>' INTO vTableCollisions;
|
||||
|
||||
INSERT INTO mail (receiver,replyTo,subject,body)
|
||||
SELECT 'pepe@verdnatura.es' receiver,
|
||||
'noreply@verdnatura.es' replyTo,
|
||||
CONCAT('Colisiones en zonas ', util.VN_CURDATE()) subject,
|
||||
CONCAT(vTableCollisions,
|
||||
GROUP_CONCAT(sub.td SEPARATOR ''),
|
||||
'</table>') body
|
||||
FROM(SELECT
|
||||
CONCAT('<tr>
|
||||
<td>', zn.name, '</td>
|
||||
<td>', zoneFk,'</td>
|
||||
<td>', z.price,'</td>
|
||||
<td>', z.name,'</td>
|
||||
<td>', w.name, '</td>
|
||||
<td>', CONCAT('<a href="https://salix.verdnatura.es/#!/zone/',
|
||||
zoneFk,
|
||||
'/location?q=%7B%22search%22:%22',
|
||||
zn.name,
|
||||
'%22%7D">'
|
||||
'https://salix.verdnatura.es/#!/zone/',
|
||||
zoneFk,
|
||||
'/location?q=%7B%22search%22:%22',
|
||||
zn.name,
|
||||
'%22%7D</a>'),'</td>
|
||||
</tr>') td
|
||||
FROM tmp.zoneNodes zn
|
||||
-- Recojo los datos de la zona que ha dado conflicto
|
||||
SELECT JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
'zoneFk', zoneFk,
|
||||
'zn', JSON_OBJECT('name', zn.name),
|
||||
'z', JSON_OBJECT('name', z.name,'price', z.price),
|
||||
'w', JSON_OBJECT('name', w.name)
|
||||
)
|
||||
) FROM tmp.zoneNodes zn
|
||||
JOIN zone z ON z.id = zn.zoneFk
|
||||
JOIN geoCollision gc ON gc.agencyModeFk = z.agencyModeFk AND zn.geoFk = gc.geoFk
|
||||
JOIN warehouse w ON w.id = gc.warehouseFk) sub;
|
||||
JOIN warehouse w ON w.id = gc.warehouseFk
|
||||
INTO json_data;
|
||||
|
||||
-- Creo un registro de la notificacion 'zone-included' para reportar via email
|
||||
SELECT util.notification_send(
|
||||
'zone-included',
|
||||
JSON_OBJECT('zoneCollisions',json_data),
|
||||
account.myUser_getId()
|
||||
);
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
geoCollision,
|
||||
|
|
|
@ -3,6 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`buy_beforeDelete`
|
|||
BEFORE DELETE ON `buy`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
CALL entry_checkBooked(OLD.entryFk);
|
||||
IF OLD.printedStickers <> 0 THEN
|
||||
CALL util.throw("it is not possible to delete buys with printed labels ");
|
||||
END IF;
|
||||
|
|
|
@ -9,17 +9,26 @@ trig: BEGIN
|
|||
DECLARE vGroupingMode TINYINT;
|
||||
DECLARE vGenericFk INT;
|
||||
DECLARE vGenericInDate BOOL;
|
||||
DECLARE vBuyerFk INT;
|
||||
|
||||
IF @isModeInventory THEN
|
||||
LEAVE trig;
|
||||
END IF;
|
||||
|
||||
CALL entry_checkBooked(NEW.entryFk);
|
||||
IF NEW.printedStickers <> 0 THEN
|
||||
CALL util.throw('it is not possible to create buy lines with printedstickers other than 0');
|
||||
END IF;
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
SELECT it.workerFk INTO vBuyerFk
|
||||
FROM item i
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
WHERE i.id = NEW.itemFk;
|
||||
|
||||
SET NEW.buyerFk = vBuyerFk;
|
||||
|
||||
CALL buy_checkGrouping(NEW.`grouping`);
|
||||
|
||||
SELECT t.warehouseInFk, t.landed
|
||||
|
|
|
@ -7,11 +7,13 @@ trig:BEGIN
|
|||
DECLARE vGenericInDate BOOL;
|
||||
DECLARE vIsInventory BOOL;
|
||||
DECLARE vDefaultEntry INT;
|
||||
DECLARE vBuyerFk INT;
|
||||
|
||||
IF @isTriggerDisabled THEN
|
||||
LEAVE trig;
|
||||
END IF;
|
||||
|
||||
CALL entry_checkBooked(OLD.entryFk);
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
SELECT defaultEntry INTO vDefaultEntry
|
||||
|
@ -65,6 +67,15 @@ trig:BEGIN
|
|||
SET NEW.isIgnored = TRUE;
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.itemFk <=> OLD.itemFk) THEN
|
||||
SELECT it.workerFk INTO vBuyerFk
|
||||
FROM item i
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
WHERE i.id = NEW.itemFk;
|
||||
|
||||
SET NEW.buyerFk = vBuyerFk;
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.itemFk <=> OLD.itemFk) OR
|
||||
NOT (OLD.entryFk <=> NEW.entryFk) THEN
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.buysToCheck
|
||||
|
|
|
@ -3,6 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`entry_beforeDelete`
|
|||
BEFORE DELETE ON `entry`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
CALL entry_checkBooked(OLD.id);
|
||||
DELETE FROM buy WHERE entryFk = OLD.id;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -7,6 +7,8 @@ BEGIN
|
|||
CALL supplier_checkIsActive(NEW.supplierFk);
|
||||
SET NEW.currencyFk = entry_getCurrency(NEW.currencyFk, NEW.supplierFk);
|
||||
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk,NEW.supplierFk);
|
||||
|
||||
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
||||
CALL util.throw('The travel is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -7,14 +7,23 @@ BEGIN
|
|||
DECLARE vPrintedCount INT;
|
||||
DECLARE vHasDistinctWarehouses BOOL;
|
||||
|
||||
IF NEW.isBooked = OLD.isBooked THEN
|
||||
CALL entry_checkBooked(OLD.id);
|
||||
END IF;
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF !(NEW.travelFk <=> OLD.travelFk) THEN
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk) THEN
|
||||
|
||||
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
||||
CALL util.throw('The travel is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
|
||||
SELECT COUNT(*) > 0 INTO vIsVirtual
|
||||
FROM entryVirtual WHERE entryFk = NEW.id;
|
||||
|
||||
SELECT !(o.warehouseInFk <=> n.warehouseInFk)
|
||||
OR !(o.warehouseOutFk <=> n.warehouseOutFk)
|
||||
SELECT NOT (o.warehouseInFk <=> n.warehouseInFk)
|
||||
OR NOT (o.warehouseOutFk <=> n.warehouseOutFk)
|
||||
INTO vHasDistinctWarehouses
|
||||
FROM travel o, travel n
|
||||
WHERE o.id = OLD.travelFk
|
||||
|
@ -43,8 +52,7 @@ BEGIN
|
|||
SET NEW.currencyFk = entry_getCurrency(NEW.currencyFk, NEW.supplierFk);
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk)
|
||||
OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk) OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
|
||||
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk, NEW.supplierFk);
|
||||
END IF;
|
||||
END$$
|
||||
|
|
|
@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`travel_afterUpdate`
|
|||
BEGIN
|
||||
CALL stock.log_add('travel', NEW.id, OLD.id);
|
||||
|
||||
IF !(NEW.shipped <=> OLD.shipped) THEN
|
||||
IF NOT(NEW.shipped <=> OLD.shipped) THEN
|
||||
UPDATE entry
|
||||
SET commission = entry_getCommission(travelFk, currencyFk,supplierFk)
|
||||
WHERE travelFk = NEW.id;
|
||||
|
|
|
@ -8,5 +8,9 @@ BEGIN
|
|||
CALL travel_checkDates(NEW.shipped, NEW.landed);
|
||||
|
||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||
|
||||
IF NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
|
||||
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -32,5 +32,9 @@ BEGIN
|
|||
CALL util.throw('The travel has entries with booked invoices');
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
|
||||
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -8,5 +8,6 @@ BEGIN
|
|||
`changedModel` = 'zoneIncluded',
|
||||
`changedModelId` = OLD.zoneFk,
|
||||
`userFk` = account.myUser_getId();
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -4,5 +4,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`zoneIncluded_beforeIn
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -4,5 +4,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`zoneIncluded_beforeUp
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -12,5 +12,5 @@ FROM (
|
|||
`pc`.`id` = `b`.`workerBusinessProfessionalCategoryFk`
|
||||
)
|
||||
)
|
||||
WHERE `pc`.`name` = 'Aux ventas'
|
||||
WHERE `pc`.`description` = 'Aux ventas'
|
||||
GROUP BY `b`.`workerFk`
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`ListaTicketsEncajados`(IN intId_Trabajador int)
|
||||
BEGIN
|
||||
|
||||
SELECT Agencia,
|
||||
Consignatario,
|
||||
ti.Id_Ticket,
|
||||
ts.userFk Id_Trabajador,
|
||||
IFNULL(ncajas,0) AS ncajas,
|
||||
IFNULL(nbultos,0) AS nbultos,
|
||||
IFNULL(notros,0) AS notros,
|
||||
ts.code AS Estado
|
||||
FROM Tickets ti
|
||||
INNER JOIN Consignatarios ON ti.Id_Consigna = Consignatarios.Id_consigna
|
||||
INNER JOIN Agencias ON ti.Id_Agencia = Agencias.Id_Agencia
|
||||
LEFT JOIN (SELECT ticketFk,count(*) AS ncajas FROM vn.expedition WHERE packagingFk=94 GROUP BY ticketFk) sub1 ON ti.Id_Ticket=sub1.ticketFk
|
||||
LEFT JOIN (SELECT ticketFk,count(*) AS nbultos FROM vn.expedition WHERE packagingFk IS NULL GROUP BY ticketFk) sub2 ON ti.Id_Ticket=sub2.ticketFk
|
||||
LEFT JOIN (SELECT ticketFk,count(*) AS notros FROM vn.expedition WHERE packagingFk >0 GROUP BY ticketFk) sub3 ON ti.Id_Ticket=sub3.ticketFk
|
||||
INNER JOIN vn.ticketState ts ON ti.Id_ticket = ts.ticketFk
|
||||
WHERE ti.Fecha=util.VN_CURDATE() AND
|
||||
ts.userFk=intId_Trabajador
|
||||
GROUP BY ti.Id_Ticket;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,61 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`add_awb_component`(IN vAwbFk SMALLINT)
|
||||
BEGIN
|
||||
|
||||
DECLARE vShipped DATE;
|
||||
DECLARE vHasStems BOOLEAN;
|
||||
|
||||
SELECT t.shipped, IF(a.stems, TRUE, FALSE)
|
||||
INTO vShipped, vHasStems
|
||||
FROM vn.travel t
|
||||
JOIN vn.awb a ON a.id = t.awbFk
|
||||
WHERE awbFk = vAwbFk
|
||||
LIMIT 1;
|
||||
|
||||
INSERT IGNORE INTO awb_component (awb_id,Id_Proveedor,awb_component_type_id,awb_role_id,awb_unit_id,value,Id_Moneda)
|
||||
SELECT id, Id_Proveedor, awb_component_type_id, awb_role_id,awb_unit_id, LEAST(GREATEST(value1, IFNULL(min_value, value1)), IFNULL(max_value, value1)), Id_Moneda
|
||||
FROM (
|
||||
SELECT a.id,
|
||||
IFNULL(act.carguera_id,
|
||||
CASE awb_role_id
|
||||
WHEN 1 THEN a.carguera_id
|
||||
WHEN 2 THEN a.transitario_id
|
||||
WHEN 3 THEN f.airline_id
|
||||
END
|
||||
) Id_Proveedor,
|
||||
act.awb_component_type_id,
|
||||
act.awb_role_id,
|
||||
act.awb_unit_id,
|
||||
value *
|
||||
CASE awb_unit_id
|
||||
WHEN '1000Tj-20' THEN ((CAST(stems AS SIGNED) - 20000)/1000) + (min_value / value)
|
||||
WHEN '1000Tj-10' THEN ((CAST(stems AS SIGNED) - 10000)/1000) + (min_value / value)
|
||||
WHEN '100GW' THEN peso/100
|
||||
WHEN 'AWB' THEN 1 -- No action
|
||||
WHEN 'FB' THEN hb/2
|
||||
WHEN 'GW' THEN peso
|
||||
WHEN 'TW' THEN GREATEST(peso,volume_weight)
|
||||
WHEN 'PN' THEN LEAST(90, value + a.propertyNumber * 10)
|
||||
END value1,
|
||||
value,
|
||||
act.Id_Moneda,
|
||||
act.min_value,
|
||||
act.max_value
|
||||
FROM awb a
|
||||
JOIN flight f ON f.flight_id = a.flight_id
|
||||
LEFT JOIN awb_component_template act ON
|
||||
((IFNULL(act.carguera_id, a.carguera_id) = a.carguera_id AND awb_role_id = 1)
|
||||
OR (IFNULL(act.carguera_id, a.transitario_id) = a.transitario_id AND awb_role_id = 2)
|
||||
OR (IFNULL(act.airline_id, f.airline_id) = f.airline_id AND awb_role_id = 3)
|
||||
OR (awb_role_id = 4))
|
||||
AND IFNULL(act.airport_out, f.airport_out) = f.airport_out
|
||||
AND IFNULL(act.airport_in, f.airport_in) = f.airport_in
|
||||
AND IFNULL(act.airline_id, f.airline_id) = f.airline_id
|
||||
AND INSTR(IFNULL(act.days, WEEKDAY(vShipped) + 1),WEEKDAY(vShipped) + 1)
|
||||
JOIN awb_component_type acty ON acty.awb_component_type_id = act.awb_component_type_id
|
||||
WHERE a.id = vAwbFk AND Fecha <= vShipped
|
||||
AND (vHasStems = TRUE OR acty.hasStems)
|
||||
ORDER BY Fecha DESC, act.days DESC LIMIT 10000000000000000000
|
||||
) t;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,50 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`agencyModeImbalance`(vStarted DATE, vEnded DATE)
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve el valor de los precios teorico, practico de las agencias
|
||||
* y si ademas es de mrw lo compara con su fichero previamente procesado
|
||||
*
|
||||
* @param vEktFk Identificador de edi.ekt
|
||||
*/
|
||||
DECLARE vEndedDayEnd DATETIME;
|
||||
|
||||
SET vEndedDayEnd = util.dayEnd(vEnded);
|
||||
|
||||
SELECT t.id ticketFk,t.addressFk,
|
||||
CAST(v.amount AS DECIMAL (10,2)) AS VN,
|
||||
CAST(v.amount - e.shipping_charge AS DECIMAL (10,2)) AS Difer,
|
||||
CAST(mrwPrice AS DECIMAL (10,2)) mrwPrice,
|
||||
CAST(e.shipping_charge - mrwPrice AS DECIMAL (10,2)) mrwDifference,
|
||||
CAST(e.shipping_charge AS DECIMAL (10,2)) AS teorico,
|
||||
CAST(e.extraCharge AS DECIMAL (10,2)) AS extraCharge,
|
||||
t.packages, t.clientFk,
|
||||
t.zoneFk, a.provinceFk, mrwCount
|
||||
FROM vn.ticket t
|
||||
LEFT JOIN
|
||||
(SELECT ticketFk, SUM(amount) amount, fc.shipped
|
||||
FROM vn.sale_freightComponent fc
|
||||
JOIN vn.ticket t ON t.id = fc.ticketFk
|
||||
JOIN tmp.agencyMode am ON am.agencyModeFk = t.agencyModeFk
|
||||
WHERE fc.shipped BETWEEN vStarted AND vEndedDayEnd
|
||||
GROUP BY ticketFk) v ON t.id = v.ticketFk
|
||||
LEFT JOIN (SELECT t.id,
|
||||
SUM(t.zonePrice) shipping_charge,
|
||||
SUM(IFNULL(aex.price,0)) extraCharge
|
||||
FROM vn.ticket t
|
||||
LEFT JOIN vn.expedition e ON e.ticketFk = t.id
|
||||
LEFT JOIN vn.packaging p ON p.id = e.packagingFk
|
||||
JOIN tmp.agencyMode amc ON amc.agencyModeFk = t.agencyModeFk
|
||||
JOIN vn.agencyMode am ON am.id = amc.agencyModeFk
|
||||
LEFT JOIN vn.agencyExtraCharge aex ON p.width+p.depth+p.height BETWEEN aex.sizeMin AND aex.sizeMax AND aex.agencyFk = am.agencyFk
|
||||
WHERE t.shipped BETWEEN vStarted AND vEndedDayEnd
|
||||
GROUP BY t.id
|
||||
) e ON t.id = e.id
|
||||
LEFT JOIN (SELECT ticketFk, SUM(price) mrwPrice, COUNT(*) mrwCount
|
||||
FROM vn.mrw
|
||||
GROUP BY ticketFk) mrw ON mrw.ticketFk = t.id
|
||||
JOIN vn.address a ON a.id = t.addressFk
|
||||
JOIN tmp.agencyMode am ON am.agencyModeFk = t.agencyModeFk
|
||||
WHERE t.shipped BETWEEN vStarted AND vEndedDayEnd;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,49 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`customerDebtEvolution`(IN vCustomer INT)
|
||||
BEGIN
|
||||
|
||||
SELECT * FROM
|
||||
(
|
||||
SELECT day, date, @s:= round(IFNULL(Euros,0) + @s,2) as Saldo, Euros, Credito, 0 as Cero
|
||||
FROM
|
||||
(
|
||||
SELECT day, date, IFNULL(Euros,0) as Euros, Credito
|
||||
FROM time
|
||||
JOIN (SELECT @s:= 0, - Credito as Credito FROM Clientes WHERE Id_Cliente = vCustomer) c
|
||||
LEFT JOIN
|
||||
(SELECT Euros, date(Fecha) as Fecha FROM
|
||||
(
|
||||
SELECT Fechacobro as Fecha, Entregado as Euros
|
||||
FROM Recibos
|
||||
WHERE Id_Cliente = vCustomer
|
||||
AND Fechacobro >= '2017-01-01'
|
||||
UNION ALL
|
||||
SELECT vn.getDueDate(io.issued,c.Vencimiento), - io.amount
|
||||
FROM vn.invoiceOut io
|
||||
JOIN Clientes c ON io.clientFk = c.Id_Cliente
|
||||
WHERE io.clientFk = vCustomer
|
||||
AND io.issued >= '2017-01-01'
|
||||
UNION ALL
|
||||
SELECT '2016-12-31', Debt
|
||||
FROM bi.customerDebtInventory
|
||||
WHERE Id_Cliente = vCustomer
|
||||
UNION ALL
|
||||
SELECT Fecha, - SUM(Cantidad * Preu * (100 - Descuento ) * 1.10 / 100)
|
||||
FROM Tickets t
|
||||
JOIN Movimientos m on m.Id_Ticket = t.Id_Ticket
|
||||
WHERE Id_Cliente = vCustomer
|
||||
AND Factura IS NULL
|
||||
AND Fecha >= '2017-01-01'
|
||||
GROUP BY Fecha
|
||||
) sub2
|
||||
ORDER BY Fecha
|
||||
)sub ON time.date = sub.Fecha
|
||||
WHERE time.date BETWEEN '2016-12-31' AND util.VN_CURDATE()
|
||||
ORDER BY date
|
||||
) sub3
|
||||
)sub4
|
||||
;
|
||||
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,91 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`historico_absoluto`(IN idART INT, IN wh INT, IN datfecha DATETIME)
|
||||
BEGIN
|
||||
|
||||
DECLARE inv_calculado INT;
|
||||
DECLARE inv INT;
|
||||
DECLARE today DATETIME;
|
||||
DECLARE fecha_inv DATETIME;
|
||||
|
||||
SET today = util.VN_CURDATE();
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE historico_pasado
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT TR.landing Fecha,
|
||||
C.Cantidad Entrada,
|
||||
NULL Salida,
|
||||
(TR.received != FALSE) OK,
|
||||
P.Proveedor Alias,
|
||||
E.Referencia Referencia,
|
||||
E.Id_Entrada id,
|
||||
TR.delivered F5
|
||||
FROM Compres C -- mirar perque no entra en received
|
||||
INNER JOIN Entradas E USING (Id_Entrada)
|
||||
INNER JOIN travel TR ON TR.id = E.travel_id
|
||||
INNER JOIN Proveedores P USING (Id_Proveedor)
|
||||
WHERE TR.landing >= '2001-01-01'
|
||||
AND Id_proveedor <> 4
|
||||
AND wh IN (TR.warehouse_id , 0)
|
||||
AND C.Id_Article = idART
|
||||
AND E.Inventario = 0
|
||||
AND E.Redada = 0
|
||||
UNION ALL
|
||||
SELECT TR.shipment Fecha,
|
||||
NULL Entrada,
|
||||
C.Cantidad Salida,
|
||||
TR.delivered OK,
|
||||
P.Proveedor Alias,
|
||||
E.Referencia Referencia,
|
||||
E.Id_Entrada id,
|
||||
TR.delivered F5
|
||||
FROM Compres C
|
||||
INNER JOIN Entradas E USING (Id_Entrada)
|
||||
INNER JOIN travel TR ON TR.id = E.travel_id
|
||||
INNER JOIN Proveedores P USING (Id_Proveedor)
|
||||
WHERE TR.shipment >= '2001-01-01'
|
||||
AND wh = TR.warehouse_id_out
|
||||
AND Id_Proveedor <> 4
|
||||
AND C.Id_Article = idART
|
||||
AND E.Inventario = 0
|
||||
AND E.Redada = 0
|
||||
UNION ALL
|
||||
SELECT T.Fecha Fecha,
|
||||
NULL Entrada,
|
||||
M.Cantidad Salida,
|
||||
(M.OK <> 0 OR T.Etiquetasemitidas <> 0 OR T.Factura IS NOT NULL) OK,
|
||||
T.Alias Alias,
|
||||
T.Factura Referencia,
|
||||
T.Id_Ticket,
|
||||
T.PedidoImpreso
|
||||
FROM Movimientos M
|
||||
INNER JOIN Tickets T USING (Id_Ticket)
|
||||
JOIN Clientes C ON C.Id_Cliente = T.Id_Cliente
|
||||
WHERE T.Fecha >= '2001-01-01'
|
||||
AND M.Id_Article = idART
|
||||
AND wh IN (T.warehouse_id , 0)
|
||||
) t1
|
||||
ORDER BY Fecha, Entrada DESC, OK DESC;
|
||||
|
||||
SELECT sum(Entrada) - sum(Salida) INTO inv_calculado
|
||||
FROM historico_pasado
|
||||
WHERE Fecha < datfecha;
|
||||
|
||||
SELECT p1.*, NULL v_virtual
|
||||
FROM(
|
||||
SELECT datfecha Fecha,
|
||||
inv_calculado Entrada,
|
||||
NULL Salida,
|
||||
1 OK,
|
||||
'Inventario calculado' Alias,
|
||||
'' Referencia, 0 id,
|
||||
1 F5
|
||||
UNION ALL
|
||||
SELECT *
|
||||
FROM historico_pasado
|
||||
WHERE Fecha >= datfecha
|
||||
) p1;
|
||||
|
||||
DROP TEMPORARY TABLE historico_pasado;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,206 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`historico_multiple`(IN vItemFk INT)
|
||||
BEGIN
|
||||
|
||||
DECLARE vDateInventory DATETIME;
|
||||
|
||||
SELECT Fechainventario INTO vDateInventory FROM tblContadores;
|
||||
|
||||
SET @a = 0;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS hm1;
|
||||
|
||||
CREATE TEMPORARY TABLE hm1
|
||||
SELECT DATE(Fecha) as Fecha,
|
||||
Entrada,
|
||||
Salida,
|
||||
OK,
|
||||
Referencia,
|
||||
Historia.id,
|
||||
|
||||
wh,
|
||||
|
||||
`name` as wh_name
|
||||
|
||||
FROM
|
||||
|
||||
( SELECT TR.landing as Fecha,
|
||||
C.Cantidad as Entrada,
|
||||
NULL as Salida,
|
||||
|
||||
IF(warehouse_id = 44, 1, warehouse_id) as wh,
|
||||
(TR.received != FALSE) as OK,
|
||||
E.Referencia as Referencia,
|
||||
E.Id_Entrada as id
|
||||
|
||||
|
||||
|
||||
FROM Compres C
|
||||
INNER JOIN Entradas E USING (Id_Entrada)
|
||||
INNER JOIN travel TR ON TR.id = E.travel_id
|
||||
WHERE TR.landing >= vDateInventory
|
||||
AND C.Id_Article = vItemFk
|
||||
AND E.Redada = 0
|
||||
|
||||
AND C.Cantidad <> 0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT TR.shipment as Fecha,
|
||||
NULL as Entrada,
|
||||
C.Cantidad as Salida,
|
||||
warehouse_id_out as wh,
|
||||
TR.delivered as OK,
|
||||
E.Referencia as Referencia,
|
||||
E.Id_Entrada as id
|
||||
|
||||
FROM Compres C
|
||||
INNER JOIN Entradas E USING (Id_Entrada)
|
||||
INNER JOIN travel TR ON TR.id = E.travel_id
|
||||
WHERE TR.shipment >= vDateInventory
|
||||
AND C.Id_Article = vItemFk
|
||||
|
||||
AND E.Redada = 0
|
||||
|
||||
AND C.Cantidad <> 0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT T.Fecha as Fecha,
|
||||
NULL as Entrada,
|
||||
M.Cantidad as Salida,
|
||||
warehouse_id as wh,
|
||||
(M.OK <> 0 OR T.Etiquetasemitidas <> 0 OR T.Factura IS NOT NULL) as OK,
|
||||
T.Factura as Referencia,
|
||||
T.Id_Ticket as id
|
||||
|
||||
FROM Movimientos M
|
||||
INNER JOIN Tickets T USING (Id_Ticket)
|
||||
WHERE T.Fecha >= vDateInventory
|
||||
AND M.Id_Article = vItemFk
|
||||
|
||||
) AS Historia
|
||||
|
||||
INNER JOIN warehouse ON warehouse.id = Historia.wh
|
||||
ORDER BY Fecha, Entrada DESC, OK DESC;
|
||||
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS hm2;
|
||||
DROP TEMPORARY TABLE IF EXISTS hm3;
|
||||
DROP TEMPORARY TABLE IF EXISTS hm4;
|
||||
DROP TEMPORARY TABLE IF EXISTS hm5;
|
||||
DROP TEMPORARY TABLE IF EXISTS hm6;
|
||||
DROP TEMPORARY TABLE IF EXISTS hm7;
|
||||
DROP TEMPORARY TABLE IF EXISTS hm8;
|
||||
CREATE TEMPORARY TABLE hm2 SELECT * FROM hm1 WHERE wh = 19;
|
||||
CREATE TEMPORARY TABLE hm3 SELECT * FROM hm1 WHERE wh = 7;
|
||||
CREATE TEMPORARY TABLE hm4 SELECT * FROM hm1 WHERE wh = 60;
|
||||
CREATE TEMPORARY TABLE hm5 SELECT * FROM hm1 WHERE wh = 5;
|
||||
CREATE TEMPORARY TABLE hm6 SELECT * FROM hm1 WHERE wh = 17;
|
||||
CREATE TEMPORARY TABLE hm7 SELECT * FROM hm1 WHERE wh = 37;
|
||||
CREATE TEMPORARY TABLE hm8 SELECT * FROM hm1 WHERE wh = 55;
|
||||
|
||||
SELECT * FROM
|
||||
|
||||
(
|
||||
|
||||
SELECT Fecha, Entrada as BOGEntrada, Salida as BOGSalida, OK as BOGOK, Referencia as BOGReferencia, id as BOGid,
|
||||
|
||||
NULL AS VNHEntrada, NULL AS VNHSalida, NULL AS VNHOK, NULL AS VNHReferencia, NULL AS VNHid,
|
||||
|
||||
NULL AS ALGEntrada, NULL AS ALGSalida, NULL AS ALGOK, NULL AS ALGReferencia, NULL AS ALGid,
|
||||
|
||||
NULL AS MADEntrada, NULL AS MADSalida, NULL AS MADOK, NULL AS MADReferencia, NULL AS MADid,
|
||||
|
||||
NULL AS MCFEntrada, NULL AS MCFSalida, NULL AS MCFOK, NULL AS MCFReferencia, NULL AS MCFid,
|
||||
|
||||
NULL AS VILEntrada, NULL AS VILSalida, NULL AS VILOK, NULL AS VILReferencia, NULL AS VILid,
|
||||
|
||||
NULL AS BAREntrada, NULL AS BARSalida, NULL AS BAROK, NULL AS BARReferencia, NULL AS BARid
|
||||
|
||||
FROM hm2
|
||||
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT Fecha
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
,Entrada, Salida, OK, Referencia, id
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
FROM hm3
|
||||
|
||||
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT Fecha
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, Entrada, Salida, OK, Referencia, id
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
FROM hm4
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT Fecha
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, Entrada, Salida, OK, Referencia, id
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
FROM hm5
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT Fecha
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, Entrada, Salida, OK, Referencia, id
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
FROM hm6
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT Fecha
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, Entrada, Salida, OK, Referencia, id
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
|
||||
|
||||
FROM hm7
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT Fecha
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, NULL, NULL, NULL, NULL, NULL
|
||||
, Entrada, Salida, OK, Referencia, id
|
||||
|
||||
FROM hm8
|
||||
|
||||
) sub
|
||||
|
||||
ORDER BY Fecha, BOGEntrada IS NULL, VNHEntrada IS NULL, ALGEntrada IS NULL, MADEntrada IS NULL, MCFEntrada IS NULL, VILEntrada IS NULL, BAREntrada IS NULL;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,22 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`preOrdenarRuta`(IN vRutaId INT)
|
||||
BEGIN
|
||||
/* Usa los valores del ultimo año para adivinar el orden de los tickets en la ruta
|
||||
* vRutaId id ruta
|
||||
* DEPRECATED use vn.routeGressPriority
|
||||
*/
|
||||
|
||||
UPDATE Tickets mt
|
||||
JOIN (
|
||||
SELECT tt.Id_Consigna, round(ifnull(avg(t.Prioridad),0),0) as Prioridad
|
||||
from Tickets t
|
||||
JOIN Tickets tt on tt.Id_Consigna = t.Id_Consigna
|
||||
where t.Fecha > TIMESTAMPADD(YEAR,-1,util.VN_CURDATE())
|
||||
AND tt.Id_Ruta = vRutaId
|
||||
GROUP BY Id_Consigna
|
||||
) sub ON sub.Id_Consigna = mt.Id_Consigna
|
||||
SET mt.Prioridad = sub.Prioridad
|
||||
WHERE mt.Id_Ruta = vRutaId;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,22 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`prepare_ticket_list`(vStartingDate DATETIME, vEndingDate DATETIME)
|
||||
BEGIN
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list;
|
||||
CREATE TEMPORARY TABLE tmp.ticket_list
|
||||
(PRIMARY KEY (Id_Ticket))
|
||||
ENGINE = MEMORY
|
||||
SELECT t.Id_Ticket, c.Id_Cliente
|
||||
FROM Tickets t
|
||||
LEFT JOIN vn.ticketState ts ON ts.ticketFk = t.Id_Ticket
|
||||
JOIN Clientes c ON c.Id_Cliente = t.Id_Cliente
|
||||
WHERE c.typeFk IN ('normal','handMaking','internalUse')
|
||||
AND (
|
||||
Fecha BETWEEN util.today() AND vEndingDate
|
||||
OR (
|
||||
ts.alertLevel < 3
|
||||
AND t.Fecha >= vStartingDate
|
||||
AND t.Fecha < util.today()
|
||||
)
|
||||
);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,39 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`recibidaIvaInsert`(IN vId INT)
|
||||
BEGIN
|
||||
|
||||
DECLARE vRate DOUBLE DEFAULT 1;
|
||||
DECLARE vDated DATE;
|
||||
|
||||
SELECT MAX(rr.date) INTO vDated
|
||||
FROM reference_rate rr
|
||||
JOIN recibida r ON r.id = vId
|
||||
WHERE rr.date <= r.fecha
|
||||
AND rr.moneda_id = r.moneda_id ;
|
||||
|
||||
IF vDated THEN
|
||||
|
||||
SELECT rate INTO vRate
|
||||
FROM reference_rate
|
||||
WHERE `date` = vDated;
|
||||
END IF;
|
||||
|
||||
DELETE FROM recibida_iva WHERE recibida_id = vId;
|
||||
|
||||
INSERT INTO recibida_iva(recibida_id, bi, gastos_id, divisa, taxTypeSageFk, transactionTypeSageFk)
|
||||
SELECT r.id,
|
||||
SUM(Costefijo * Cantidad) / IFNULL(vRate,1) bi,
|
||||
6003000000,
|
||||
IF(r.moneda_id = 1,NULL,SUM(Costefijo * Cantidad )) divisa,
|
||||
taxTypeSageFk,
|
||||
transactionTypeSageFk
|
||||
FROM recibida r
|
||||
JOIN Entradas e ON e.recibida_id = r.id
|
||||
JOIN Proveedores p ON p.Id_Proveedor = e.Id_Proveedor
|
||||
JOIN Compres c ON c.Id_Entrada = e.Id_Entrada
|
||||
LEFT JOIN reference_rate rr ON rr.moneda_id = r.moneda_id AND rr.date = r.fecha
|
||||
WHERE r.id = vId
|
||||
HAVING bi IS NOT NULL;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -5,7 +5,6 @@ AS SELECT `c`.`id` AS `id`,
|
|||
`c`.`code` AS `abbreviation`,
|
||||
`c`.`supplierAccountFk` AS `Id_Proveedores_account`,
|
||||
`c`.`workerManagerFk` AS `gerente_id`,
|
||||
`c`.`sage200Company` AS `digito_factura`,
|
||||
`c`.`phytosanitary` AS `phytosanitary`,
|
||||
`c`.`companyCode` AS `CodigoEmpresa`,
|
||||
`c`.`companyGroupFk` AS `empresa_grupo`,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.buy ADD buyerFk int(10) unsigned DEFAULT NULL NULL;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE util.notification MODIFY COLUMN id int(11) auto_increment NOT NULL;
|
|
@ -0,0 +1,15 @@
|
|||
INSERT IGNORE INTO util.notification ( `name`,`description`)
|
||||
VALUES
|
||||
( 'zone-included','An email to notify zoneCollisions');
|
||||
|
||||
-- Change value if destionation user should be different
|
||||
SET @DESTINATION_USER = "pepe";
|
||||
|
||||
SET @MaxId = LAST_INSERT_ID();
|
||||
|
||||
INSERT IGNORE INTO util.notificationSubscription (notificationFk,userFk)
|
||||
VALUES(
|
||||
@MaxId, (SELECT id from `account`.`user` where name = @DESTINATION_USER));
|
||||
|
||||
INSERT IGNORE INTO util.notificationAcl (notificationFk,roleFk)
|
||||
SELECT @MaxId, (SELECT role from `account`.`user` where name = @DESTINATION_USER) FROM util.notification WHERE name= "zone-included";
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
CREATE SCHEMA IF NOT EXISTS `floranet`;
|
||||
|
||||
CREATE ROLE IF NOT EXISTS 'floranet' ;
|
||||
|
||||
GRANT Create temporary tables ON floranet.* TO 'floranet';
|
||||
|
||||
GRANT Execute ON floranet.* TO 'floranet';
|
||||
|
||||
GRANT Lock tables ON floranet.* TO 'floranet';
|
||||
|
||||
CREATE USER IF NOT EXISTS 'floranet'@'%';
|
||||
|
||||
GRANT floranet TO floranet@'%';
|
|
@ -0,0 +1,61 @@
|
|||
CREATE OR REPLACE TABLE floranet.`builder` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`itemFk` int(11) NOT NULL,
|
||||
`elementFk` int(11) NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `builder_FK` (`itemFk`),
|
||||
KEY `builder_FK_1` (`elementFk`),
|
||||
CONSTRAINT `builder_FK` FOREIGN KEY (`itemFk`) REFERENCES `vn`.`item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Links handmade products with their elements';
|
||||
|
||||
CREATE OR REPLACE TABLE floranet.`element` (
|
||||
`itemFk` int(11) NOT NULL,
|
||||
`typeFk` smallint(5) unsigned DEFAULT NULL,
|
||||
`size` int(11) DEFAULT NULL,
|
||||
`inkFk` char(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
||||
`originFk` tinyint(2) unsigned DEFAULT NULL,
|
||||
`name` varchar(30) DEFAULT NULL,
|
||||
`quantity` int(11) NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (`itemFk`),
|
||||
KEY `element_FK` (`itemFk`),
|
||||
KEY `element_FK_1` (`typeFk`),
|
||||
KEY `element_FK_2` (`inkFk`),
|
||||
KEY `element_FK_3` (`originFk`),
|
||||
CONSTRAINT `element_FK` FOREIGN KEY (`itemFk`) REFERENCES `vn`.`item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `element_FK_1` FOREIGN KEY (`typeFk`) REFERENCES `vn`.`itemType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `element_FK_2` FOREIGN KEY (`inkFk`) REFERENCES `vn`.`ink` (`id`) ON UPDATE CASCADE,
|
||||
CONSTRAINT `element_FK_3` FOREIGN KEY (`originFk`) REFERENCES `vn`.`origin` (`id`) ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Filtro para localizar posibles items que coincidan con la descripción';
|
||||
|
||||
ALTER TABLE floranet.builder ADD CONSTRAINT `builder_FK_1` FOREIGN KEY (`elementFk`) REFERENCES `element` (`itemFk`) ON UPDATE CASCADE;
|
||||
|
||||
CREATE OR REPLACE TABLE floranet.catalogue
|
||||
(id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(50),
|
||||
price DECIMAL(10,2) NOT NULL,
|
||||
itemFk INT NOT NULL,
|
||||
dated DATE,
|
||||
postalCode VARCHAR(12),
|
||||
`type` VARCHAR(50),
|
||||
image VARCHAR(255),
|
||||
description TEXT,
|
||||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
payed DATETIME,
|
||||
FOREIGN KEY (itemFk) REFERENCES vn.item(id) ON DELETE RESTRICT ON UPDATE CASCADE);
|
||||
|
||||
|
||||
CREATE OR REPLACE TABLE floranet.`order`
|
||||
(id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
catalogueFk INT UNIQUE,
|
||||
customerName VARCHAR(100),
|
||||
email VARCHAR(100),
|
||||
customerPhone VARCHAR(15),
|
||||
message VARCHAR(255),
|
||||
deliveryName VARCHAR(100),
|
||||
address VARCHAR(200),
|
||||
deliveryPhone VARCHAR(100),
|
||||
isPaid BOOL NOT NULL DEFAULT FALSE,
|
||||
payed DATETIME,
|
||||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (catalogueFk) REFERENCES catalogue(id) ON DELETE RESTRICT ON UPDATE CASCADE);
|
|
@ -0,0 +1,19 @@
|
|||
SET @isTriggerDisabled := TRUE;
|
||||
|
||||
UPDATE vn.buy
|
||||
SET packing = 1
|
||||
WHERE packing IS NULL
|
||||
OR packing <= 0;
|
||||
|
||||
UPDATE vn.itemShelving
|
||||
SET packing = 1
|
||||
WHERE packing IS NULL
|
||||
OR NOT packing;
|
||||
|
||||
SET @isTriggerDisabled := FALSE;
|
||||
|
||||
ALTER TABLE vn.buy MODIFY COLUMN packing int(11) NOT NULL DEFAULT 1 CHECK(packing > 0);
|
||||
ALTER TABLE vn.itemShelving MODIFY COLUMN packing int(11) NOT NULL DEFAULT 1 CHECK(packing > 0);
|
||||
|
||||
-- Antes tenia '0=sin obligar 1=groping 2=packing' (groping → grouping)
|
||||
ALTER TABLE vn.buy MODIFY COLUMN groupingMode tinyint(4) DEFAULT 0 NOT NULL COMMENT '0=sin obligar 1=grouping 2=packing';
|
|
@ -0,0 +1,73 @@
|
|||
-- Auto-generated SQL script #202403061303
|
||||
UPDATE vn.company
|
||||
SET companyCode=0
|
||||
WHERE id=69;
|
||||
UPDATE vn.company
|
||||
SET companyCode=1
|
||||
WHERE id=442;
|
||||
UPDATE vn.company
|
||||
SET companyCode=4
|
||||
WHERE id=567;
|
||||
UPDATE vn.company
|
||||
SET companyCode=2
|
||||
WHERE id=791;
|
||||
UPDATE vn.company
|
||||
SET companyCode=3
|
||||
WHERE id=792;
|
||||
UPDATE vn.company
|
||||
SET companyCode=5
|
||||
WHERE id=965;
|
||||
UPDATE vn.company
|
||||
SET companyCode=7
|
||||
WHERE id=1381;
|
||||
UPDATE vn.company
|
||||
SET companyCode=3
|
||||
WHERE id=1463;
|
||||
UPDATE vn.company
|
||||
SET companyCode=8
|
||||
WHERE id=2142;
|
||||
UPDATE vn.company
|
||||
SET companyCode=6
|
||||
WHERE id=2393;
|
||||
UPDATE vn.company
|
||||
SET companyCode=9
|
||||
WHERE id=3869;
|
||||
|
||||
-- Auto-generated SQL script #202403061311
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=69;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=442;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=567;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=791;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=792;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=965;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=1381;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=1463;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=2142;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=2393;
|
||||
UPDATE vn.company
|
||||
SET sage200Company=NULL
|
||||
WHERE id=3869;
|
||||
|
||||
|
||||
ALTER TABLE vn.company CHANGE sage200Company sage200Company__ int(2) DEFAULT NULL NULL COMMENT '@deprecated 06/03/2024';
|
||||
ALTER TABLE vn.company MODIFY COLUMN sage200Company__ int(2) DEFAULT NULL NULL COMMENT '@deprecated 06/03/2024';
|
|
@ -0,0 +1,36 @@
|
|||
USE vn;
|
||||
|
||||
CREATE OR REPLACE TABLE vn.workerActivityType (
|
||||
`code` varchar(20) NOT NULL,
|
||||
`description` varchar(45) NOT NULL,
|
||||
PRIMARY KEY (`code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
|
||||
ALTER TABLE vn.department ADD workerActivityTypeFk varchar(20) NULL COMMENT 'Indica la actitividad que desempeña por defecto ese departamento';
|
||||
ALTER TABLE vn.department ADD CONSTRAINT department_workerActivityType_FK FOREIGN KEY (workerActivityTypeFk) REFERENCES vn.workerActivityType(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
|
||||
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_CHECKING', 'REVISION');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_CAM', 'CAMARA');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_ART', 'ARTIFICIAL');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_PREPARATION', 'SACADO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PACKING', 'ENCAJADO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('FIELD', 'CAMPOS');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('DELIVERY', 'REPARTO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('STORAGE', 'ALMACENAJE');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PALLETIZING', 'PALETIZADO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('STOP', 'PARADA');
|
||||
|
||||
|
||||
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivityType', '*', 'READ', 'ALLOW', 'ROLE', 'production');
|
||||
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivity', '*', '*', 'ALLOW', 'ROLE', 'production');
|
||||
|
||||
|
||||
ALTER TABLE vn.workerActivity MODIFY COLUMN event enum('open','close','insert','delete','update','refresh') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL;
|
||||
ALTER TABLE vn.workerActivity MODIFY COLUMN model enum('COM','ENT','TPV','ENC','LAB','ETI','APP') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL;
|
||||
|
||||
|
||||
ALTER TABLE vn.workerActivity ADD workerActivityTypeFk varchar(20) NULL;
|
||||
ALTER TABLE vn.workerActivity ADD CONSTRAINT workerActivity_workerActivityType_FK FOREIGN KEY (workerActivityTypeFk) REFERENCES vn.workerActivityType(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
-- Place your SQL code here
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`multipleInventoryHistory`(
|
||||
vItemFk INT)
|
||||
BEGIN
|
||||
DECLARE vDateInventory DATETIME;
|
||||
SELECT inventoried INTO vDateInventory FROM config;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`absoluteInventoryHistory`(
|
||||
vItemFk INT, vWarehouse INT, vDate DATETIME)
|
||||
BEGIN
|
||||
DECLARE vCalculatedInventory INT;
|
||||
SET vCalculatedInventory = 0;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
GRANT EXECUTE ON PROCEDURE vn.absoluteInventoryHistory TO buyer;
|
||||
GRANT EXECUTE ON PROCEDURE vn.multipleInventoryHistory TO buyer;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue