Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6822-entryTransfer
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
b5f8ad77f1
79
CHANGELOG.md
79
CHANGELOG.md
|
@ -1,3 +1,82 @@
|
|||
# Version 24.24 - 2024-06-11
|
||||
|
||||
### Added 🆕
|
||||
|
||||
- 6281 feat:buyFk in itemShekving by:sergiodt
|
||||
- 6281 feat:buyFk in itemShelving by:sergiodt
|
||||
- feat: #6408 tests by:jgallego
|
||||
- feat: packaging refs #4021 (origin/4021_packaging) by:sergiodt
|
||||
- feat: refs #6021 add new field by:pablone
|
||||
- feat: refs #6281 change fixtures by:robert
|
||||
- feat: refs # 6408 test ok (origin/6408-rocketChat) by:jgallego
|
||||
- feat: refs #6477 productionConfig add column by:robert
|
||||
- feat: refs #6600 add column (origin/6600-createItemPhotoComment) by:jorgep
|
||||
- feat: refs #6600 Add photoMotivation column to item table and create itemPhotoComment table by:jorgep
|
||||
- feat: refs #6889 add back tests by:jorgep
|
||||
- feat: refs #6889 fixtures & models by:jorgep
|
||||
- feat : refs #6889 wip: check if is productionReviewer or owner by:jorgep
|
||||
- feat: refs #6942 set false isBooed & ledger by:jorgep
|
||||
- feat: refs #6942 toUnbook by:jorgep
|
||||
- feat: refs #6942 xdiario fixtures by:jorgep
|
||||
- feat: refs #7398 Change by:guillermo
|
||||
- feat: refs #7438 Added volume to item_valuateInventory by:guillermo
|
||||
- feat: refs #7438 Requested changes and little changes by:guillermo
|
||||
- refs #6281 feat:buyFk in itemShelving by:sergiodt
|
||||
|
||||
### Changed 📦
|
||||
|
||||
- refactor: refs #6600 add space by:jorgep
|
||||
- refactor: refs #6889 improve file loading logic by:jorgep
|
||||
- refactor: refs #6889 sale tests e2e by:jorgep
|
||||
- refactor: refs #6889 script sql (origin/6889-dropAddSaleByCode) by:jorgep
|
||||
- refactor: refs #6889 use addSale by:jorgep
|
||||
- refactor: refs #6942 toUnbook & drop buyer acls by:jorgep
|
||||
- refactor: refs #7398 Refactor and change ekt_scan (origin/7398-ektScan) by:guillermo
|
||||
- refactor: refs #7486 Optimized procs by:guillermo
|
||||
|
||||
### Fixed 🛠️
|
||||
|
||||
- feat: refs #6281 change fixtures by:robert
|
||||
- feat: refs #6889 fixtures & models by:jorgep
|
||||
- feat: refs #6942 xdiario fixtures by:jorgep
|
||||
- fix: checking process.env.NODE_ENV by:alexm
|
||||
- fix: en translations by:alexm
|
||||
- fix: move to boot (origin/7421-fix_checking_NODE_ENV, 7421-fix_checking_NODE_ENV) by:alexm
|
||||
- fix: refs #6095 filter by refFk null by:pablone
|
||||
- fix: refs #6600 rollback by:jorgep
|
||||
- fix: refs #6889 allocate 'productionReviewer' role to revision dep. workers & check if is owner or reviewer by:jorgep
|
||||
- fix: refs #6889 check if has collection or sectorCollection by:jorgep
|
||||
- fix: refs #6889 e2e tests by:jorgep
|
||||
- fix: refs #6889 fix back tests by:jorgep
|
||||
- fix: refs #6889 modify fixtures by:jorgep
|
||||
- fix: refs #6889 rollback by:jorgep
|
||||
- fix: refs #6942 acls & back by:jorgep
|
||||
- fix: refs #6942 add deleteById acl by:jorgep
|
||||
- fix: refs #6942 add test & change column name by:jorgep
|
||||
- fix: refs #6942 create invoiceIn acl by:jorgep
|
||||
- fix: refs #6942 delete by:jorgep
|
||||
- fix: refs #6942 drop quotes by:jorgep
|
||||
- fix : refs #6942 remove grafana update priv by:jorgep
|
||||
- fix: refs #6942 revoke update isBooked by:jorgep
|
||||
- fix: refs #6942 toBook/toUnbook by:jorgep
|
||||
- fix: refs #7442 Fix kubernetes deploy by:Juan Ferrer Toribio
|
||||
- fix(salix): refs #7272 #7272 Add aclService in routes.js by:Javier Segarra
|
||||
- fix(salix): refs #7272 #7272 Back validateToken endpoint by:Javier Segarra
|
||||
- fix(salix): refs #7272 #7272 Bug when acl not loaded by:Javier Segarra
|
||||
- fix(salix): refs #7272 #7272 Call validateToken by:Javier Segarra
|
||||
- fix(salix): refs #7272 #7272 Errors when Token not exists by:Javier Segarra
|
||||
- fix(salix): refs #7272 #7272 Front retry calls by:Javier Segarra
|
||||
- fix(salix): refs #7272 #7272 i18n Error by:Javier Segarra
|
||||
- fix(salix): refs #7272 #7272 Remove aclService from auth.js by:Javier Segarra
|
||||
- fix: simplify by:alexm
|
||||
- fix traduction & e2e by:carlossa
|
||||
- refs #6820 fix back by:carlossa
|
||||
- refs #6820 fix pr by:carlossa
|
||||
- refs #6832 fix: ToItem (origin/6832_refactorBackToItem) by:Sergio De la torre
|
||||
- refs #7292 fix tback by:carlossa
|
||||
- refs #7296 fix pr errors, trad by:carlossa
|
||||
- test(salix): refs #7272 #7272 fix renew-token.spec by:Javier Segarra
|
||||
|
||||
|
||||
# Changelog
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ node {
|
|||
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
|
||||
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
|
||||
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
|
||||
|
||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||
|
@ -59,7 +60,6 @@ pipeline {
|
|||
}
|
||||
environment {
|
||||
PROJECT_NAME = 'salix'
|
||||
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
|
||||
}
|
||||
stages {
|
||||
stage('Install') {
|
||||
|
@ -103,7 +103,7 @@ pipeline {
|
|||
NODE_ENV = ''
|
||||
}
|
||||
steps {
|
||||
sh 'node back/tests.js --ci --junit --network jenkins'
|
||||
sh 'node back/tests.js --junit'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
@ -121,7 +121,7 @@ pipeline {
|
|||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = packageJson.version
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
}
|
||||
sh 'docker-compose build back'
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ pipeline {
|
|||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = packageJson.version
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
}
|
||||
sh 'gulp build'
|
||||
sh 'docker-compose build front'
|
||||
|
@ -179,7 +179,7 @@ pipeline {
|
|||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = packageJson.version
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
}
|
||||
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
|
||||
sh 'docker-compose push'
|
||||
|
@ -203,19 +203,23 @@ pipeline {
|
|||
sh 'npx myt push $NODE_ENV --force --commit'
|
||||
}
|
||||
}
|
||||
stage('Docker') {
|
||||
stage('Kubernetes') {
|
||||
when {
|
||||
expression { FROM_GIT }
|
||||
}
|
||||
environment {
|
||||
DOCKER_HOST = "${env.SWARM_HOST}"
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = packageJson.version
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
}
|
||||
withKubeConfig([
|
||||
serverUrl: "$KUBERNETES_API",
|
||||
credentialsId: 'kubernetes',
|
||||
namespace: 'salix'
|
||||
]) {
|
||||
sh 'kubectl set image deployment/salix-back-$BRANCH_NAME salix-back-$BRANCH_NAME=$REGISTRY/salix-back:$VERSION'
|
||||
sh 'kubectl set image deployment/salix-front-$BRANCH_NAME salix-front-$BRANCH_NAME=$REGISTRY/salix-front:$VERSION'
|
||||
}
|
||||
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.STACK_NAME}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,16 @@ Required applications.
|
|||
* Node.js
|
||||
* Docker
|
||||
* Git
|
||||
* MYT
|
||||
|
||||
You will need to install globally the following items.
|
||||
```
|
||||
$ sudo npm install -g jest gulp-cli
|
||||
```
|
||||
After installing MYT you will need the following item.
|
||||
```
|
||||
$ apt install libkrb5-dev libssl-dev
|
||||
```
|
||||
|
||||
## Installing dependencies and launching
|
||||
|
||||
|
@ -23,7 +28,7 @@ Pull from repository.
|
|||
|
||||
Run this commands on project root directory to install Node dependencies.
|
||||
```
|
||||
$ npm install
|
||||
$ pnpm install
|
||||
$ gulp install
|
||||
```
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('assignCollection', {
|
||||
description: 'Assign a collection',
|
||||
accessType: 'WRITE',
|
||||
http: {
|
||||
path: `/assignCollection`,
|
||||
verb: 'POST'
|
||||
},
|
||||
returns: {
|
||||
type: ['object'],
|
||||
root: true
|
||||
},
|
||||
});
|
||||
|
||||
Self.assignCollection = async(ctx, options) => {
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const myOptions = {userId};
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
const [info, info2, [{'@vCollectionFk': collectionFk}]] = await Self.rawSql(
|
||||
'CALL vn.collection_getAssigned(?, @vCollectionFk);SELECT @vCollectionFk', [userId], myOptions);
|
||||
if (!collectionFk) throw new UserError('There are not picking tickets');
|
||||
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
|
||||
|
||||
return collectionFk;
|
||||
};
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('getSales', {
|
||||
description: 'Get sales from ticket or collection',
|
||||
description: 'Get sales from ticket, collection or sectorCollection',
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@ module.exports = Self => {
|
|||
|
||||
const promises = [];
|
||||
const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [id], myOptions);
|
||||
|
||||
const sales = await Self.rawSql(`
|
||||
SELECT s.ticketFk,
|
||||
sgd.saleGroupFk,
|
||||
|
@ -68,7 +69,7 @@ module.exports = Self => {
|
|||
LEFT JOIN saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||
LEFT JOIN parking p2 ON p2.id = sg.parkingFk
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
LEFT JOIN itemShelvingSale iss ON iss.saleFk = s.id
|
||||
JOIN itemShelvingSale iss ON iss.saleFk = s.id
|
||||
LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||
LEFT JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||
LEFT JOIN parking p ON p.id = sh.parkingFk
|
||||
|
@ -76,17 +77,56 @@ module.exports = Self => {
|
|||
LEFT JOIN origin o ON o.id = i.originFk
|
||||
WHERE tc.collectionFk = ?
|
||||
GROUP BY s.id, ish.id, p.code, p2.code
|
||||
ORDER BY pickingOrder;`, [id], myOptions);
|
||||
|
||||
UNION ALL
|
||||
SELECT s.ticketFk,
|
||||
sgd.saleGroupFk,
|
||||
s.id saleFk,
|
||||
s.itemFk,
|
||||
i.longName,
|
||||
i.size,
|
||||
ic.color,
|
||||
o.code origin,
|
||||
ish.packing,
|
||||
ish.grouping,
|
||||
s.isAdded,
|
||||
s.originalQuantity,
|
||||
s.quantity,
|
||||
iss.quantity,
|
||||
SUM(iss.quantity) OVER (PARTITION BY s.id ORDER BY ish.id),
|
||||
ROW_NUMBER () OVER (PARTITION BY s.id ORDER BY p.pickingOrder),
|
||||
COUNT(*) OVER (PARTITION BY s.id ORDER BY s.id) ,
|
||||
sh.code,
|
||||
IFNULL(p2.code, p.code),
|
||||
IFNULL(p2.pickingOrder, p.pickingOrder),
|
||||
iss.id itemShelvingSaleFk,
|
||||
iss.isPicked
|
||||
FROM sectorCollection sc
|
||||
JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id
|
||||
JOIN saleGroup sg ON sg.id = ss.saleGroupFk
|
||||
JOIN ticket t ON t.id = sg.ticketFk
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
LEFT JOIN parking p2 ON p2.id = sg.parkingFk
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
JOIN itemShelvingSale iss ON iss.saleFk = s.id
|
||||
LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||
LEFT JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||
LEFT JOIN parking p ON p.id = sh.parkingFk
|
||||
LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk
|
||||
LEFT JOIN origin o ON o.id = i.originFk
|
||||
WHERE sc.id = ?
|
||||
AND sgd.saleGroupFk
|
||||
GROUP BY s.id, ish.id, p.code, p2.code`, [id, id], myOptions);
|
||||
if (print)
|
||||
await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [id, null], myOptions);
|
||||
|
||||
const collection = {collectionFk: id, tickets: []};
|
||||
|
||||
if (tickets && tickets.length) {
|
||||
for (const ticket of tickets) {
|
||||
const ticketId = ticket.ticketFk;
|
||||
if (ticket.observaciones != '') {
|
||||
for (observation of ticket.observaciones.split(' ')) {
|
||||
if (ticket.observation) {
|
||||
for (observation of ticket.observation?.split(' ')) {
|
||||
if (['#', '@'].includes(observation.charAt(0))) {
|
||||
promises.push(Self.app.models.Chat.send(ctx, observation,
|
||||
$t('The ticket is in preparation', {
|
||||
|
@ -100,11 +140,11 @@ module.exports = Self => {
|
|||
if (sales && sales.length) {
|
||||
const barcodes = await Self.rawSql(`
|
||||
SELECT s.id saleFk, b.code, c.id
|
||||
FROM vn.sale s
|
||||
LEFT JOIN vn.itemBarcode b ON b.itemFk = s.itemFk
|
||||
LEFT JOIN vn.buy c ON c.itemFk = s.itemFk
|
||||
LEFT JOIN vn.entry e ON e.id = c.entryFk
|
||||
LEFT JOIN vn.travel tr ON tr.id = e.travelFk
|
||||
FROM sale s
|
||||
LEFT JOIN itemBarcode b ON b.itemFk = s.itemFk
|
||||
LEFT JOIN buy c ON c.itemFk = s.itemFk
|
||||
LEFT JOIN entry e ON e.id = c.entryFk
|
||||
LEFT JOIN travel tr ON tr.id = e.travelFk
|
||||
WHERE s.ticketFk = ?
|
||||
AND tr.landed >= util.VN_CURDATE() - INTERVAL 1 YEAR`,
|
||||
[ticketId], myOptions);
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('ticket assignCollection()', () => {
|
||||
let ctx;
|
||||
let options;
|
||||
let tx;
|
||||
beforeEach(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 1106},
|
||||
headers: {origin: 'http://localhost'},
|
||||
__: value => value
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: ctx.req
|
||||
});
|
||||
|
||||
options = {transaction: tx};
|
||||
tx = await models.Sale.beginTransaction({});
|
||||
options.transaction = tx;
|
||||
});
|
||||
|
||||
afterEach(async() => {
|
||||
await tx.rollback();
|
||||
});
|
||||
|
||||
it('should throw an error when there is not picking tickets', async() => {
|
||||
try {
|
||||
await models.Collection.assignCollection(ctx, options);
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual('There are not picking tickets');
|
||||
}
|
||||
});
|
||||
});
|
|
@ -4,15 +4,7 @@ describe('collection getSales()', () => {
|
|||
const collectionOrTicketFk = 999999;
|
||||
const print = true;
|
||||
const source = 'CHECKER';
|
||||
|
||||
beforeAll(() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 9},
|
||||
headers: {origin: 'http://localhost'},
|
||||
}
|
||||
};
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should return a collection with tickets, placements and barcodes settled correctly', async() => {
|
||||
const tx = await models.Collection.beginTransaction({});
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('collection getTickets()', () => {
|
||||
let ctx;
|
||||
beforeAll(async() => {
|
||||
ctx = {
|
||||
req: {
|
||||
accessToken: {userId: 9},
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
};
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should get tickets, sales and barcodes from collection', async() => {
|
||||
const tx = await models.Collection.beginTransaction({});
|
||||
|
@ -26,8 +18,8 @@ describe('collection getTickets()', () => {
|
|||
expect(collectionTickets.tickets[1].ticketFk).toEqual(2);
|
||||
expect(collectionTickets.tickets[2].ticketFk).toEqual(23);
|
||||
expect(collectionTickets.tickets[0].sales[0].ticketFk).toEqual(1);
|
||||
expect(collectionTickets.tickets[0].sales[1].ticketFk).toEqual(1);
|
||||
expect(collectionTickets.tickets[0].sales[2].ticketFk).toEqual(1);
|
||||
expect(collectionTickets.tickets[1].sales.length).toEqual(0);
|
||||
expect(collectionTickets.tickets[2].sales.length).toEqual(0);
|
||||
expect(collectionTickets.tickets[0].sales[0].Barcodes.length).toBeTruthy();
|
||||
|
||||
await tx.rollback();
|
||||
|
|
|
@ -1,20 +1,7 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('setSaleQuantity()', () => {
|
||||
beforeAll(async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should change quantity sale', async() => {
|
||||
const tx = await models.Ticket.beginTransaction({});
|
||||
|
|
|
@ -26,16 +26,24 @@
|
|||
<mrw:Nif><%= expeditionData.fi %></mrw:Nif>
|
||||
<mrw:Nombre><%= expeditionData.clientName %></mrw:Nombre>
|
||||
<mrw:Telefono><%= expeditionData.phone %></mrw:Telefono>
|
||||
<mrw:Observaciones><%= expeditionData.deliveryObservation %></mrw:Observaciones>
|
||||
</mrw:DatosEntrega>
|
||||
<mrw:DatosServicio>
|
||||
<mrw:Fecha><%= expeditionData.created %></mrw:Fecha>
|
||||
<mrw:Referencia><%= expeditionData.expeditionDataId %></mrw:Referencia>
|
||||
<mrw:Referencia><%= expeditionData.reference %></mrw:Referencia>
|
||||
<mrw:CodigoServicio><%= expeditionData.serviceType %></mrw:CodigoServicio>
|
||||
<mrw:NumeroBultos>1</mrw:NumeroBultos>
|
||||
<mrw:EntregaSabado><%= expeditionData.weekDays %></mrw:EntregaSabado>
|
||||
<mrw:Peso><%= expeditionData.kg %></mrw:Peso>
|
||||
<mrw:Reembolso/>
|
||||
<mrw:ImporteReembolso/>
|
||||
<mrw:Bultos>
|
||||
<mrw:BultoRequest>
|
||||
<mrw:Alto><%= mrw.defaultHeight %></mrw:Alto>
|
||||
<mrw:Largo><%= mrw.defaultLength %></mrw:Largo>
|
||||
<mrw:Ancho><%= mrw.defaultWidth %></mrw:Ancho>
|
||||
<mrw:Peso><%= mrw.defaultWeight %></mrw:Peso>
|
||||
</mrw:BultoRequest>
|
||||
</mrw:Bultos>
|
||||
</mrw:DatosServicio>
|
||||
</mrw:request>
|
||||
</mrw:TransmEnvio>
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
const axios = require('axios');
|
||||
const {DOMParser} = require('xmldom');
|
||||
const fs = require('fs');
|
||||
const ejs = require('ejs');
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
|
@ -23,29 +19,26 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.createShipment = async(expeditionFk, options) => {
|
||||
const myOptions = {};
|
||||
let tx;
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
if (!myOptions.transaction) {
|
||||
tx = await Self.beginTransaction({});
|
||||
myOptions.transaction = tx;
|
||||
}
|
||||
|
||||
Self.createShipment = async expeditionFk => {
|
||||
const models = Self.app.models;
|
||||
const mrw = await models.MrwConfig.findOne(null, myOptions);
|
||||
const mrw = await Self.getConfig();
|
||||
|
||||
if (!mrw)
|
||||
throw new UserError(`Some mrwConfig parameters are not set`);
|
||||
const today = Date.vnNew();
|
||||
const [hours, minutes] = mrw?.expeditionDeadLine ? mrw.expeditionDeadLine.split(':').map(Number) : [0, 0];
|
||||
|
||||
const deadLine = Date.vnNew();
|
||||
deadLine.setHours(hours, minutes, 0);
|
||||
|
||||
if (today > deadLine && (!mrw.notified || mrw.notified.setHours(0, 0, 0, 0) !== today.setHours(0, 0, 0, 0))) {
|
||||
await models.NotificationQueue.create({notificationFk: 'mrw-deadline'});
|
||||
await mrw.updateAttributes({notified: Date.vnNow()});
|
||||
}
|
||||
|
||||
const query =
|
||||
`SELECT
|
||||
CASE co.code
|
||||
WHEN 'ES' THEN a.postalCode
|
||||
WHEN 'PT' THEN LEFT(a.postalCode, 4)
|
||||
WHEN 'PT' THEN LEFT(a.postalCode, mc.portugalPostCodeTrim)
|
||||
WHEN 'AD' THEN REPLACE(a.postalCode, 'AD', '00')
|
||||
END postalCode,
|
||||
a.city,
|
||||
|
@ -56,59 +49,46 @@ module.exports = Self => {
|
|||
c.phone,
|
||||
DATE_FORMAT(t.shipped, '%d/%m/%Y') created,
|
||||
t.shipped,
|
||||
e.id expeditionId,
|
||||
LPAD(IF(mw.params IS NULL, ms.serviceType, mw.serviceType), 4 ,'0') serviceType,
|
||||
IF(mw.weekdays, 'S', 'N') weekDays
|
||||
CONCAT( e.ticketFk, LPAD(e.counter, mc.counterWidth, '0')) reference,
|
||||
LPAD(IF(mw.serviceType IS NULL, ms.serviceType, mw.serviceType), mc.serviceTypeWidth,'0') serviceType,
|
||||
IF(mw.weekdays, 'S', 'N') weekDays,
|
||||
oa.description deliveryObservation
|
||||
FROM expedition e
|
||||
JOIN ticket t ON e.ticketFk = t.id
|
||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
JOIN mrwService ms ON ms.agencyModeCodeFk = am.code
|
||||
LEFT JOIN mrwServiceWeekday mw ON mw.weekdays = DATE_FORMAT(t.shipped, '%a')
|
||||
LEFT JOIN mrwServiceWeekday mw ON mw.agencyModeCodeFk = am.code
|
||||
AND mw.weekDays & (1 << WEEKDAY(t.landed))
|
||||
JOIN client c ON t.clientFk = c.id
|
||||
JOIN address a ON t.addressFk = a.id
|
||||
LEFT JOIN addressObservation oa ON oa.addressFk = a.id
|
||||
LEFT JOIN observationType ot ON ot.id = oa.observationTypeFk
|
||||
AND ot.code = 'delivery'
|
||||
JOIN province p ON a.provinceFk = p.id
|
||||
JOIN country co ON co.id = p.countryFk
|
||||
JOIN mrwConfig mc
|
||||
WHERE e.id = ?
|
||||
LIMIT 1`;
|
||||
|
||||
const [expeditionData] = await Self.rawSql(query, [expeditionFk], myOptions);
|
||||
const [expeditionData] = await Self.rawSql(query, [expeditionFk]);
|
||||
|
||||
if (!expeditionData)
|
||||
throw new UserError(`This expedition is not a MRW shipment`);
|
||||
|
||||
const today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
if (expeditionData?.shipped.setHours(0, 0, 0, 0) < today)
|
||||
if (expeditionData?.shipped.setHours(0, 0, 0, 0) < today.setHours(0, 0, 0, 0))
|
||||
throw new UserError(`This ticket has a shipped date earlier than today`);
|
||||
|
||||
const shipmentResponse = await sendXmlDoc('createShipment', {mrw, expeditionData}, 'application/soap+xml');
|
||||
const shipmentId = getTextByTag(shipmentResponse, 'NumeroEnvio');
|
||||
const shipmentResponse = await Self.sendXmlDoc(
|
||||
__dirname + `/createShipment.ejs`,
|
||||
{mrw, expeditionData},
|
||||
'application/soap+xml'
|
||||
);
|
||||
const shipmentId = Self.getTextByTag(shipmentResponse, 'NumeroEnvio');
|
||||
|
||||
if (!shipmentId)
|
||||
throw new UserError(getTextByTag(shipmentResponse, 'Mensaje'));
|
||||
if (!shipmentId) throw new UserError(Self.getTextByTag(shipmentResponse, 'Mensaje'));
|
||||
|
||||
const getLabelResponse = await sendXmlDoc('getLabel', {mrw, shipmentId}, 'text/xml');
|
||||
const file = getTextByTag(getLabelResponse, 'EtiquetaFile');
|
||||
|
||||
if (tx) await tx.commit();
|
||||
const file = await models.MrwConfig.getLabel(shipmentId);
|
||||
|
||||
return {shipmentId, file};
|
||||
};
|
||||
|
||||
function getTextByTag(xmlDoc, tag) {
|
||||
return xmlDoc?.getElementsByTagName(tag)[0]?.textContent;
|
||||
}
|
||||
|
||||
async function sendXmlDoc(xmlDock, params, contentType) {
|
||||
const parser = new DOMParser();
|
||||
|
||||
const xmlTemplate = fs.readFileSync(__dirname + `/${xmlDock}.ejs`, 'utf-8');
|
||||
const renderedTemplate = ejs.render(xmlTemplate, params);
|
||||
const data = await axios.post(params.mrw.url, renderedTemplate, {
|
||||
headers: {
|
||||
'Content-Type': `${contentType}; charset=utf-8`
|
||||
}
|
||||
});
|
||||
return parser.parseFromString(data.data, 'text/xml');
|
||||
}
|
||||
};
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethod('getLabel', {
|
||||
description: 'Return a base64Binary label from de MRW WebService',
|
||||
accessType: 'READ',
|
||||
accepts: [{
|
||||
arg: 'shipmentId',
|
||||
type: 'string',
|
||||
required: true
|
||||
}],
|
||||
returns: {
|
||||
type: 'string',
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/getLabel`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.getLabel = async shipmentId => {
|
||||
const mrw = await Self.getConfig();
|
||||
|
||||
const getLabelResponse = await Self.sendXmlDoc(__dirname + `/getLabel.ejs`, {mrw, shipmentId}, 'text/xml');
|
||||
|
||||
return Self.getTextByTag(getLabelResponse, 'EtiquetaFile');
|
||||
};
|
||||
};
|
|
@ -2,6 +2,7 @@ const models = require('vn-loopback/server/server').models;
|
|||
const axios = require('axios');
|
||||
const fs = require('fs');
|
||||
|
||||
const filter = {notificationFk: 'mrw-deadline'};
|
||||
const mockBase64Binary = 'base64BinaryString';
|
||||
const ticket1 = {
|
||||
'id': '44',
|
||||
|
@ -28,25 +29,52 @@ const expedition1 = {
|
|||
'editorFk': 100
|
||||
};
|
||||
|
||||
let tx;
|
||||
let options;
|
||||
|
||||
describe('MRWConfig createShipment()', () => {
|
||||
beforeEach(async() => {
|
||||
options = tx = undefined;
|
||||
tx = await models.MrwConfig.beginTransaction({});
|
||||
options = {transaction: tx};
|
||||
|
||||
beforeAll(async() => {
|
||||
await models.Agency.create(
|
||||
{'id': 999, 'name': 'mrw'},
|
||||
options
|
||||
{'id': 999, 'name': 'mrw'}
|
||||
);
|
||||
|
||||
await models.AgencyMode.create(
|
||||
{'id': 999, 'name': 'mrw', 'agencyFk': 999, 'code': 'mrw'},
|
||||
options
|
||||
{'id': 999, 'name': 'mrw', 'agencyFk': 999, 'code': 'mrw'}
|
||||
|
||||
);
|
||||
|
||||
await createMrwConfig();
|
||||
|
||||
await models.Application.rawSql(
|
||||
`INSERT INTO vn.mrwService
|
||||
SET agencyModeCodeFk = 'mrw',
|
||||
clientType = 1,
|
||||
serviceType = 1,
|
||||
kg = 1`, null
|
||||
);
|
||||
await models.Ticket.create(ticket1);
|
||||
await models.Expedition.create(expedition1);
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await cleanFixtures();
|
||||
await models.Ticket.destroyAll(ticket1);
|
||||
await models.Expedition.destroyAll(ticket1);
|
||||
});
|
||||
|
||||
beforeEach(async() => {
|
||||
const mockPostResponses = [
|
||||
{data: fs.readFileSync(__dirname + '/mockGetLabel.xml', 'utf-8')},
|
||||
{data: fs.readFileSync(__dirname + '/mockCreateShipment.xml', 'utf-8')}
|
||||
];
|
||||
|
||||
spyOn(axios, 'post').and.callFake(() => Promise.resolve(mockPostResponses.pop()));
|
||||
await cleanFixtures();
|
||||
});
|
||||
|
||||
async function cleanFixtures() {
|
||||
await models.NotificationQueue.destroyAll(filter);
|
||||
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: null, notified: null});
|
||||
}
|
||||
|
||||
async function createMrwConfig() {
|
||||
await models.MrwConfig.create(
|
||||
{
|
||||
'id': 1,
|
||||
|
@ -55,67 +83,80 @@ describe('MRWConfig createShipment()', () => {
|
|||
'password': 'password',
|
||||
'franchiseCode': 'franchiseCode',
|
||||
'subscriberCode': 'subscriberCode'
|
||||
}, options
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
await models.Application.rawSql(
|
||||
`INSERT INTO vn.mrwService
|
||||
SET agencyModeCodeFk = 'mrw',
|
||||
clientType = 1,
|
||||
serviceType = 1,
|
||||
kg = 1`, null, options
|
||||
);
|
||||
await models.Ticket.create(ticket1, options);
|
||||
await models.Expedition.create(expedition1, options);
|
||||
});
|
||||
|
||||
afterEach(async() => {
|
||||
await tx.rollback();
|
||||
});
|
||||
async function getLastNotification() {
|
||||
return models.NotificationQueue.findOne({
|
||||
order: 'id DESC',
|
||||
where: filter
|
||||
});
|
||||
}
|
||||
|
||||
it('should create a shipment and return a base64Binary label', async() => {
|
||||
const mockPostResponses = [
|
||||
{data: fs.readFileSync(__dirname + '/mockGetLabel.xml', 'utf-8')},
|
||||
{data: fs.readFileSync(__dirname + '/mockCreateShipment.xml', 'utf-8')}
|
||||
];
|
||||
|
||||
spyOn(axios, 'post').and.callFake(() => Promise.resolve(mockPostResponses.pop()));
|
||||
|
||||
const {file} = await models.MrwConfig.createShipment(expedition1.id, options);
|
||||
const {file} = await models.MrwConfig.createShipment(expedition1.id);
|
||||
|
||||
expect(file).toEqual(mockBase64Binary);
|
||||
});
|
||||
|
||||
it('should fail if mrwConfig has no data', async() => {
|
||||
let error;
|
||||
await models.MrwConfig.destroyAll();
|
||||
await models.MrwConfig.createShipment(expedition1.id).catch(e => {
|
||||
error = e;
|
||||
}).finally(async() => {
|
||||
expect(error.message).toEqual(`Some mrwConfig parameters are not set`);
|
||||
expect(error.message).toEqual(`MRW service is not configured`);
|
||||
});
|
||||
await createMrwConfig();
|
||||
|
||||
expect(error).toBeDefined();
|
||||
});
|
||||
|
||||
it('should fail if expeditionFk is not a MrwExpedition', async() => {
|
||||
let error;
|
||||
await models.MrwConfig.createShipment(undefined, options).catch(e => {
|
||||
await models.MrwConfig.createShipment(undefined).catch(e => {
|
||||
error = e;
|
||||
}).finally(async() => {
|
||||
expect(error.message).toEqual(`This expedition is not a MRW shipment`);
|
||||
});
|
||||
});
|
||||
|
||||
it(' should fail if the creation date of this ticket is before the current date it', async() => {
|
||||
it('should fail if the creation date of this ticket is before the current date', async() => {
|
||||
let error;
|
||||
const yesterday = Date.vnNew();
|
||||
|
||||
yesterday.setDate(yesterday.getDate() - 1);
|
||||
await models.Ticket.updateAll({id: ticket1.id}, {shipped: yesterday}, options);
|
||||
await models.MrwConfig.createShipment(expedition1.id, options).catch(e => {
|
||||
|
||||
await models.Ticket.updateAll({id: ticket1.id}, {shipped: yesterday});
|
||||
await models.MrwConfig.createShipment(expedition1.id).catch(e => {
|
||||
error = e;
|
||||
}).finally(async() => {
|
||||
expect(error.message).toEqual(`This ticket has a shipped date earlier than today`);
|
||||
});
|
||||
await models.Ticket.updateAll({id: ticket1.id}, {shipped: Date.vnNew()});
|
||||
});
|
||||
|
||||
it('should send mail if you are past the dead line and is not notified today', async() => {
|
||||
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: '10:00:00', notified: null});
|
||||
await models.MrwConfig.createShipment(expedition1.id);
|
||||
const notification = await getLastNotification();
|
||||
|
||||
expect(notification.notificationFk).toEqual(filter.notificationFk);
|
||||
});
|
||||
|
||||
it('should send mail if you are past the dead line and it is notified from another day', async() => {
|
||||
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: '10:00:00', notified: new Date()});
|
||||
await models.MrwConfig.createShipment(expedition1.id);
|
||||
const notification = await getLastNotification();
|
||||
|
||||
expect(notification.notificationFk).toEqual(filter.notificationFk);
|
||||
});
|
||||
|
||||
it('should not send mail if you are past the dead line and it is notified', async() => {
|
||||
await models.MrwConfig.updateAll({id: 1}, {expeditionDeadLine: '10:00:00', notified: Date.vnNew()});
|
||||
await models.MrwConfig.createShipment(expedition1.id);
|
||||
const notification = await getLastNotification();
|
||||
|
||||
expect(notification).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,22 +1,7 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('getStarredModules()', () => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
const ctx = {req: activeCtx};
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it(`should return the starred modules for a given user`, async() => {
|
||||
const newStarred = await models.StarredModule.create({workerFk: 9, moduleFk: 'customer', position: 1});
|
||||
|
|
|
@ -1,24 +1,8 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('setPosition()', () => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
const ctx = {
|
||||
req: activeCtx
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
beforeAll.mockLoopBackContext();
|
||||
|
||||
it('should increase the orders module position by replacing it with clients and vice versa', async() => {
|
||||
const tx = await models.StarredModule.beginTransaction({});
|
||||
|
|
|
@ -1,24 +1,7 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('toggleStarredModule()', () => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 9},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
const ctx = {
|
||||
req: activeCtx
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
const ctx = beforeAll.getCtx();
|
||||
|
||||
it('should create a new starred module and then remove it by calling the method again with same args', async() => {
|
||||
const starredModule = await models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||
|
@ -26,7 +9,7 @@ describe('toggleStarredModule()', () => {
|
|||
|
||||
expect(starredModules.length).toEqual(1);
|
||||
expect(starredModule.moduleFk).toEqual('order');
|
||||
expect(starredModule.workerFk).toEqual(activeCtx.accessToken.userId);
|
||||
expect(starredModule.workerFk).toEqual(ctx.req.accessToken.userId);
|
||||
expect(starredModule.position).toEqual(starredModules.length);
|
||||
|
||||
await models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||
|
|
|
@ -22,7 +22,7 @@ module.exports = Self => {
|
|||
const url = await Self.app.models.Url.findOne({
|
||||
where: {
|
||||
appName,
|
||||
environment: process.env.NODE_ENV || 'development'
|
||||
environment: process.env.NODE_ENV || 'dev'
|
||||
}
|
||||
});
|
||||
return url?.url;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('userConfig getUserConfig()', () => {
|
||||
const ctx = beforeAll.getCtx();
|
||||
it(`should return the configuration data of a given user`, async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const ctx = {req: {accessToken: {userId: 9}}};
|
||||
const result = await models.UserConfig.getUserConfig(ctx, options);
|
||||
|
||||
expect(result.warehouseFk).toEqual(1);
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('acls', {
|
||||
description: 'Get all of the current user acls',
|
||||
returns: {
|
||||
type: 'Object',
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: '/acls',
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
const staticAcls = new Map();
|
||||
const app = require('vn-loopback/server/server');
|
||||
app.on('started', function() {
|
||||
for (const model of app.models()) {
|
||||
for (const acl of model.settings.acls) {
|
||||
if (acl.principalType == 'ROLE' && acl.permission == 'ALLOW') {
|
||||
const staticAcl = {
|
||||
model: model.name,
|
||||
property: '*',
|
||||
accessType: acl.accessType,
|
||||
permission: acl.permission,
|
||||
principalType: acl.principalType,
|
||||
principalId: acl.principalId,
|
||||
};
|
||||
if (staticAcls.has(acl.principalId))
|
||||
staticAcls.get(acl.principalId).push(staticAcl);
|
||||
else
|
||||
staticAcls.set(acl.principalId, [staticAcl]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Self.acls = async function(ctx) {
|
||||
const models = Self.app.models;
|
||||
const acls = [];
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
if (userId) {
|
||||
const roleMapping = await models.RoleMapping.find({
|
||||
where: {
|
||||
principalId: userId
|
||||
},
|
||||
include: [
|
||||
{
|
||||
relation: 'role',
|
||||
scope: {
|
||||
fields: [
|
||||
'name'
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
const dynamicAcls = await models.ACL.find({
|
||||
where: {
|
||||
principalId: {
|
||||
inq: roleMapping.map(rm => rm.role().name)
|
||||
}
|
||||
}
|
||||
});
|
||||
dynamicAcls.forEach(acl => acls.push(acl));
|
||||
staticAcls.get('$authenticated').forEach(acl => acls.push(acl));
|
||||
} else
|
||||
staticAcls.get('$unauthenticated').forEach(acl => acls.push(acl));
|
||||
|
||||
staticAcls.get('$everyone').forEach(acl => acls.push(acl));
|
||||
return acls;
|
||||
};
|
||||
};
|
|
@ -16,41 +16,51 @@ module.exports = Self => {
|
|||
accessScopes: ['DEFAULT', 'read:multimedia']});
|
||||
|
||||
Self.renewToken = async function(ctx) {
|
||||
const {accessToken: token} = ctx.req;
|
||||
|
||||
// Check if current token is valid
|
||||
|
||||
const {renewPeriod, courtesyTime} = await models.AccessTokenConfig.findOne({
|
||||
fields: ['renewPeriod', 'courtesyTime']
|
||||
});
|
||||
const now = Date.now();
|
||||
const differenceMilliseconds = now - token.created;
|
||||
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
||||
const isNotExceeded = differenceSeconds < renewPeriod - courtesyTime;
|
||||
if (isNotExceeded)
|
||||
return token;
|
||||
|
||||
// Schedule to remove current token
|
||||
setTimeout(async() => {
|
||||
try {
|
||||
const exists = await models.AccessToken.findById(token.id);
|
||||
exists && await Self.logout(token.id);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
}
|
||||
}, courtesyTime * 1000);
|
||||
|
||||
// Get scopes
|
||||
|
||||
let createTokenOptions = {};
|
||||
const {scopes} = token;
|
||||
if (scopes)
|
||||
createTokenOptions = {scopes: [scopes[0]]};
|
||||
// Create new accessToken
|
||||
const user = await Self.findById(token.userId);
|
||||
const accessToken = await user.accessTokens.create(createTokenOptions);
|
||||
let token; let isNotExceeded;
|
||||
try {
|
||||
token = ctx.req.accessToken;
|
||||
|
||||
return {id: accessToken.id, ttl: accessToken.ttl};
|
||||
const {courtesyTime} = await models.AccessTokenConfig.findOne({
|
||||
fields: ['courtesyTime']
|
||||
});
|
||||
isNotExceeded = await Self.validateToken(ctx);
|
||||
if (isNotExceeded)
|
||||
return token;
|
||||
|
||||
// Schedule to remove current token
|
||||
setTimeout(async() => {
|
||||
let exists;
|
||||
try {
|
||||
exists = await models.AccessToken.findById(token.id);
|
||||
exists && await Self.logout(token.id);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error);
|
||||
const body = {error: error.message, now: Date.now(), userId: token?.userId ?? null, exists};
|
||||
await handleError(body);
|
||||
throw new Error(error);
|
||||
}
|
||||
}, courtesyTime * 1000);
|
||||
|
||||
// Get scopes
|
||||
const {scopes} = token;
|
||||
if (scopes)
|
||||
createTokenOptions = {scopes: [scopes[0]]};
|
||||
// Create new accessToken
|
||||
const user = await Self.findById(token.userId);
|
||||
const accessToken = await user.accessTokens.create(createTokenOptions);
|
||||
|
||||
return {id: accessToken.id, ttl: accessToken.ttl};
|
||||
} catch (error) {
|
||||
const body = {error: error.message, now: Date.now(), userId: token?.userId ?? null, createTokenOptions, isNotExceeded};
|
||||
await handleError(body);
|
||||
throw new Error(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
async function handleError(body, tag = 'renewToken') {
|
||||
body = JSON.stringify(body);
|
||||
await models.Application.rawSql('CALL util.debugAdd(?,?);', [tag, body]);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const id = {administrative: 5, employee: 1, productionBoss: 50};
|
||||
|
||||
describe('VnUser acls()', () => {
|
||||
it('should get its owns acls', async() => {
|
||||
expect(await hasAcl('administrative', id.administrative)).toBeTruthy();
|
||||
expect(await hasAcl('productionBoss', id.productionBoss)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should not get administrative acls', async() => {
|
||||
expect(await hasAcl('administrative', id.employee)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should get the $authenticated acls', async() => {
|
||||
expect(await hasAcl('$authenticated', id.employee)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should get the $everyone acls', async() => {
|
||||
expect(await hasAcl('$everyone', id.employee)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
const hasAcl = async(role, userId) => {
|
||||
const ctx = {req: {accessToken: {userId}, headers: {origin: 'http://localhost'}}};
|
||||
const acls = await models.VnUser.acls(ctx);
|
||||
return Object.values(acls).some(acl => acl.principalId === role);
|
||||
};
|
|
@ -61,4 +61,21 @@ describe('Renew Token', () => {
|
|||
expect(error).toBeUndefined();
|
||||
expect(response.id).toEqual(ctx.req.accessToken.id);
|
||||
});
|
||||
|
||||
it('throw error', async() => {
|
||||
let error;
|
||||
|
||||
try {
|
||||
await models.VnUser.renewToken({req: {token: null}});
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toBeDefined();
|
||||
const query = 'SELECT * FROM util.debug';
|
||||
|
||||
const debugLog = await models.Application.rawSql(query, null);
|
||||
|
||||
expect(debugLog.length).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('validateToken', {
|
||||
description: 'Validates the current logged user token',
|
||||
accepts: [],
|
||||
accessType: 'READ',
|
||||
returns: {
|
||||
type: 'Boolean',
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/validateToken`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.validateToken = async function(ctx) {
|
||||
const {accessToken: token} = ctx.req;
|
||||
|
||||
// Check if current token is valid
|
||||
const {renewPeriod, courtesyTime} = await models.AccessTokenConfig.findOne({
|
||||
fields: ['renewPeriod', 'courtesyTime']
|
||||
});
|
||||
const now = Date.now();
|
||||
const differenceMilliseconds = now - token.created;
|
||||
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
||||
const isNotExceeded = differenceSeconds < renewPeriod - courtesyTime;
|
||||
return isNotExceeded;
|
||||
};
|
||||
};
|
|
@ -64,6 +64,9 @@
|
|||
"EmailUser": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Expedition_PrintOut": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Image": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
@ -190,4 +193,4 @@
|
|||
"RouteConfig": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ module.exports = Self => {
|
|||
require('../methods/collection/setSaleQuantity')(Self);
|
||||
require('../methods/collection/previousLabel')(Self);
|
||||
require('../methods/collection/getTickets')(Self);
|
||||
require('../methods/collection/assignCollection')(Self);
|
||||
require('../methods/collection/assign')(Self);
|
||||
require('../methods/collection/getSales')(Self);
|
||||
};
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
{
|
||||
"name": "Collection",
|
||||
"base": "VnModel",
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"required": true
|
||||
},
|
||||
"workerFk": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "collection"
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
},
|
||||
"isSocialNameUnique": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"continentFk": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
@ -32,6 +35,11 @@
|
|||
"type": "belongsTo",
|
||||
"model": "Currency",
|
||||
"foreignKey": "currencyFk"
|
||||
},
|
||||
"continent": {
|
||||
"type": "belongsTo",
|
||||
"model": "Continent",
|
||||
"foreignKey": "continentFk"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "Expedition_PrintOut",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "dipole.expedition_PrintOut"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"expeditionFk": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"description": "id expeditionFk"
|
||||
},
|
||||
"itemFk": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,35 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/mrw-config/createShipment')(Self);
|
||||
require('../methods/mrw-config/getLabel')(Self);
|
||||
require('../methods/mrw-config/cancelShipment')(Self);
|
||||
|
||||
const fs = require('fs');
|
||||
const ejs = require('ejs');
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
const {DOMParser} = require('xmldom');
|
||||
const axios = require('axios');
|
||||
|
||||
Self.getConfig = async function() {
|
||||
const mrw = await Self.app.models.MrwConfig.findOne(null);
|
||||
if (!mrw) throw new UserError(`MRW service is not configured`);
|
||||
return mrw;
|
||||
};
|
||||
|
||||
Self.getTextByTag = function(xmlDoc, tag) {
|
||||
return xmlDoc?.getElementsByTagName(tag)[0]?.textContent;
|
||||
};
|
||||
|
||||
Self.sendXmlDoc = async function(path, params, contentType) {
|
||||
const parser = new DOMParser();
|
||||
|
||||
const xmlTemplate = fs.readFileSync(path, 'utf-8');
|
||||
const renderedTemplate = ejs.render(xmlTemplate, params);
|
||||
const data = await axios.post(params.mrw.url, renderedTemplate, {
|
||||
headers: {
|
||||
'Content-Type': `${contentType}; charset=utf-8`
|
||||
}
|
||||
});
|
||||
return parser.parseFromString(data.data, 'text/xml');
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -27,6 +27,24 @@
|
|||
},
|
||||
"subscriberCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultHeight": {
|
||||
"type": "number"
|
||||
},
|
||||
"defaultLength": {
|
||||
"type": "number"
|
||||
},
|
||||
"defaultWidth": {
|
||||
"type": "number"
|
||||
},
|
||||
"defaultWeight": {
|
||||
"type": "number"
|
||||
},
|
||||
"expeditionDeadLine": {
|
||||
"type": "string"
|
||||
},
|
||||
"notified":{
|
||||
"type": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,17 +3,23 @@
|
|||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "productionConfig"
|
||||
"table": "productionConfig"
|
||||
}
|
||||
},
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"id": true
|
||||
},
|
||||
"sectorFromCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"sectorToCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"backupPrinterNotificationDelay": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +1,13 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('loopback model MailAliasAccount', () => {
|
||||
const ctx = beforeAll.getCtx();
|
||||
it('should add a mail Alias', async() => {
|
||||
const tx = await models.MailAliasAccount.beginTransaction({});
|
||||
let error;
|
||||
|
||||
try {
|
||||
const options = {transaction: tx, accessToken: {userId: 9}};
|
||||
const options = {transaction: tx, ctx};
|
||||
await models.MailAliasAccount.create({mailAlias: 2, account: 5}, options);
|
||||
|
||||
await tx.rollback();
|
||||
|
@ -23,7 +24,7 @@ describe('loopback model MailAliasAccount', () => {
|
|||
let error;
|
||||
|
||||
try {
|
||||
const options = {transaction: tx, accessToken: {userId: 9}};
|
||||
const options = {transaction: tx, ctx};
|
||||
await models.MailAliasAccount.create({mailAlias: 3, account: 5}, options);
|
||||
|
||||
await tx.rollback();
|
||||
|
|
|
@ -15,6 +15,8 @@ module.exports = function(Self) {
|
|||
require('../methods/vn-user/renew-token')(Self);
|
||||
require('../methods/vn-user/share-token')(Self);
|
||||
require('../methods/vn-user/update-user')(Self);
|
||||
require('../methods/vn-user/validate-token')(Self);
|
||||
require('../methods/vn-user/acls')(Self);
|
||||
|
||||
Self.definition.settings.acls = Self.definition.settings.acls.filter(acl => acl.property !== 'create');
|
||||
|
||||
|
|
|
@ -113,6 +113,13 @@
|
|||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
},
|
||||
{
|
||||
"property": "validateToken",
|
||||
"accessType": "EXECUTE",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$authenticated",
|
||||
"permission": "ALLOW"
|
||||
},
|
||||
{
|
||||
"property": "privileges",
|
||||
"accessType": "*",
|
||||
|
@ -133,6 +140,13 @@
|
|||
"principalType": "ROLE",
|
||||
"principalId": "$authenticated",
|
||||
"permission": "ALLOW"
|
||||
},
|
||||
{
|
||||
"property": "acls",
|
||||
"accessType": "*",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
],
|
||||
"scopes": {
|
||||
|
|
|
@ -9,21 +9,36 @@
|
|||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"forceId": false
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"forceId": false
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"type": "string"
|
||||
"type": "string"
|
||||
},
|
||||
"isInventory": {
|
||||
"type": "number"
|
||||
"type": "number"
|
||||
},
|
||||
"isManaged":{
|
||||
"type": "boolean"
|
||||
"isManaged": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"countryFk": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"country": {
|
||||
"type": "belongsTo",
|
||||
"model": "Country",
|
||||
"foreignKey": "countryFk"
|
||||
},
|
||||
"address": {
|
||||
"type": "belongsTo",
|
||||
"model": "Address",
|
||||
"foreignKey": "addressFk"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
@ -34,5 +49,11 @@
|
|||
"permission": "ALLOW"
|
||||
}
|
||||
],
|
||||
"scope" : {"where": {"isForTicket": {"neq": 0}}}
|
||||
"scope": {
|
||||
"where": {
|
||||
"isForTicket": {
|
||||
"neq": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
"modules/worker/front/**/*",
|
||||
"modules/zone/front/**/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,13 +10,13 @@ async function init() {
|
|||
host: process.env.DB_HOST,
|
||||
port: process.env.DB_PORT
|
||||
});
|
||||
|
||||
const bootOptions = {dataSources};
|
||||
await new Promise((resolve, reject) => {
|
||||
app.boot(bootOptions,
|
||||
err => err ? reject(err) : resolve());
|
||||
});
|
||||
// FIXME: Workaround to wait for loopback to be ready
|
||||
app.emit('started');
|
||||
await app.models.Application.status();
|
||||
}
|
||||
|
||||
|
@ -32,3 +32,4 @@ module.exports = {
|
|||
|
||||
if (require.main === module)
|
||||
init();
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ async function test() {
|
|||
'loopback/**/*[sS]pec.js',
|
||||
'modules/*/back/**/*.[sS]pec.js'
|
||||
],
|
||||
helpers: []
|
||||
helpers: [`back/vn-jasmine.js`],
|
||||
};
|
||||
|
||||
if (PARALLEL) {
|
||||
|
@ -114,7 +114,6 @@ async function test() {
|
|||
if (opts.ci)
|
||||
runner.jasmine.DEFAULT_TIMEOUT_INTERVAL = SPEC_TIMEOUT;
|
||||
|
||||
// runner.loadConfigFile('back/jasmine.json');
|
||||
runner.loadConfig(config);
|
||||
process.env.SPEC_IS_RUNNING = true;
|
||||
await runner.execute();
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
const LoopBackContext = require('loopback-context');
|
||||
const getAccessToken = (userId = 9) => {
|
||||
return {accessToken: {userId}};
|
||||
};
|
||||
const DEFAULT_HEADERS = {headers: {origin: 'http://localhost'}};
|
||||
const default_before_all = userId => {
|
||||
return {
|
||||
req: {
|
||||
...getAccessToken(userId),
|
||||
...DEFAULT_HEADERS,
|
||||
...{__: value => value}
|
||||
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
};
|
||||
const default_loopback_ctx = userId => {
|
||||
return {
|
||||
...getAccessToken(userId),
|
||||
...default_before_all(userId),
|
||||
http: {
|
||||
...default_before_all(userId)
|
||||
},
|
||||
args: {}
|
||||
};
|
||||
};
|
||||
|
||||
function vnBeforeAll() {
|
||||
Object.assign(beforeAll, {getCtx: default_before_all, mockLoopBackContext});
|
||||
}
|
||||
|
||||
const mockLoopBackContext = userId => {
|
||||
const activeCtx = default_loopback_ctx(userId);
|
||||
beforeAll(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
return activeCtx;
|
||||
};
|
||||
module.exports = {
|
||||
mockLoopBackContext
|
||||
};
|
||||
|
||||
(function init() {
|
||||
vnBeforeAll();
|
||||
})();
|
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"vn": {
|
||||
"view": {
|
||||
"expeditionPallet_Print": "06613719475fcdba8309607c38cc78efc2e348cca7bc96b48dc3ae3c12426f54"
|
||||
"expeditionPallet_Print": "ced2b84a114fcb99fce05f0c34f4fc03f3fa387bef92621be1bc306608a84345"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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','11031','12f36dc825b6660062e2c86fde9c6b451cb58f0d','2024-05-14 08:25:58','11048');
|
||||
INSERT INTO `version` VALUES ('vn-database','11114','cf0f80142fed798c3307565a69158d7dba9276c4','2024-06-25 09:25:54','11115');
|
||||
|
||||
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);
|
||||
|
@ -759,6 +759,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10953','06-srt.sql','jenkins@db-
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','10953','07-util.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-04 07:34:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10953','08-vn.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-04 07:34:56',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10953','08-vn2.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-04 07:34:58',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10955','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10956','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-04 07:34:58',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10957','00-aclTicketClone.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-04 07:34:58',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);
|
||||
|
@ -774,6 +775,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','10975','00-action.sql','jenkins@
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','10975','01-expeditionFk.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-03 12:04:52',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10976','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-18 07:40:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10977','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-18 07:40:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10978','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:33',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10984','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:31:59',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10988','00-pbx_prefix.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-04-11 17:00:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10990','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:31:59',NULL,NULL);
|
||||
|
@ -788,22 +790,78 @@ INSERT INTO `versionLog` VALUES ('vn-database','10996','00-dropOrderRecalc.sql',
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','10996','01-dropTicketRecalc.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:31:59',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10996','02-dropTravelRecalc.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:31:59',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10997','00-groupingMode.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:34:21',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11000','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11001','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:26',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11002','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:26',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11003','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:34:21',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11006','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11007','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:34:21',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11008','00-alter.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11010','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11012','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11013','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11014','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11015','00-photoMotivation.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11016','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-27 13:16:09',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11018','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-07 07:34:21',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11019','00-locker.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11019','01-aclLocker.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11021','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-04-30 09:07:56',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11022','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11026','00-entryAlter.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11026','01-entryUpdate.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11026','02-entryInternal.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11030','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11031','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-14 07:45:27',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11033','00-rollbackAcls.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-07 12:45:45',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11034','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11037','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11038','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:17',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11040','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:31',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11044','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:31',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11045','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-10 14:53:29',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11046','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:46',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11050','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11050','01-elementFilter.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11051','00-sipConfig_callLimit.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-14 14:31:10',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11054','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:46',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11055','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:46',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11057','00-part.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:46',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11057','01-part.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:47',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11057','02-part.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:47',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11057','03-part.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:48',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11058','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:48',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11059','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11060','00-createRoleReviewer.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11061','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:48',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11063','00-roadmapAddress.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11063','01-roadmapStop.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11063','02-roadmapStopGrants.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11064','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11065','00-modifyInvoiceInPrivileges.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11065','01-modifyInvoiceInAcls.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11068','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11069','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11070','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11071','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-28 07:32:48',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11074','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11075','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-05-28 12:54:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11078','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11079','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-31 08:22:10',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11080','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-05-31 12:01:58',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11082','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11083','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-03 10:46:36',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11084','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11087','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:38:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11089','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11090','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 08:32:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11092','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-07 08:21:23',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11093','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11096','00-addBuyerAcl.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-11 12:48:51',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11105','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-06-20 15:36:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11106','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:49',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11109','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-18 19:09:56',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11114','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-06-25 08:39:49',NULL,NULL);
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
|
@ -887,7 +945,7 @@ INSERT INTO `role` VALUES (109,'salesTeamBoss','Jefe de equipo de comerciales',1
|
|||
INSERT INTO `role` VALUES (110,'palletizer','Paletizadores',1,'2022-12-02 13:56:22','2022-12-02 13:56:30',NULL);
|
||||
INSERT INTO `role` VALUES (111,'entryEditor','Entry editor',1,'2023-01-13 12:21:55','2023-01-13 12:21:55',NULL);
|
||||
INSERT INTO `role` VALUES (112,'maintenance','Personal de mantenimiento',1,'2023-01-19 07:23:35','2023-01-19 07:23:35',NULL);
|
||||
INSERT INTO `role` VALUES (114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 07:31:16','2023-05-17 13:07:21',NULL);
|
||||
INSERT INTO `role` VALUES (114,'maintenanceBoss','Jefe de mantenimiento',1,'2023-01-19 07:31:16','2024-06-14 08:56:41',19295);
|
||||
INSERT INTO `role` VALUES (115,'itManagement','TI management',1,'2023-03-29 09:27:55','2023-03-29 09:28:04',NULL);
|
||||
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);
|
||||
|
@ -899,6 +957,7 @@ INSERT INTO `role` VALUES (125,'claimViewer','Trabajadores que consulta las recl
|
|||
INSERT INTO `role` VALUES (126,'greenhouseBoss','Jefe de invernadero',1,'2023-11-16 14:32:13','2023-11-16 14:32:13',NULL);
|
||||
INSERT INTO `role` VALUES (127,'timeControl','Tablet para fichar',1,'2024-01-09 16:36:56','2024-01-09 16:36:56',NULL);
|
||||
INSERT INTO `role` VALUES (129,'buyerAssistant','Comprador que tienes mas permisos para ayudar al buyerBoss en algunas tareas',1,'2024-02-06 06:59:12','2024-02-06 06:59:12',783);
|
||||
INSERT INTO `role` VALUES (130,'reviewer','Revisor de producción',1,'2024-06-11 00:00:00','2024-06-11 00:00:00',10578);
|
||||
|
||||
INSERT INTO `roleInherit` VALUES (1,1,2,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (2,1,3,NULL);
|
||||
|
@ -925,7 +984,6 @@ INSERT INTO `roleInherit` VALUES (27,21,53,NULL);
|
|||
INSERT INTO `roleInherit` VALUES (28,22,13,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (29,22,21,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (30,30,5,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (31,30,20,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (32,30,22,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (33,30,53,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (34,30,64,NULL);
|
||||
|
@ -1090,7 +1148,6 @@ INSERT INTO `roleInherit` VALUES (249,109,18,NULL);
|
|||
INSERT INTO `roleInherit` VALUES (250,109,13,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (251,51,21,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (253,48,49,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (254,110,1,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (255,110,76,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (256,48,69,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (257,47,111,NULL);
|
||||
|
@ -1158,13 +1215,19 @@ INSERT INTO `roleInherit` VALUES (353,110,49,NULL);
|
|||
INSERT INTO `roleInherit` VALUES (354,103,119,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (355,127,11,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (356,123,125,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (357,36,35,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (358,36,49,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (359,129,35,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (360,101,129,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (361,50,112,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (362,122,15,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (364,35,18,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (365,123,119,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (366,30,37,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (367,30,73,NULL);
|
||||
INSERT INTO `roleInherit` VALUES (368,130,49,10578);
|
||||
INSERT INTO `roleInherit` VALUES (369,50,130,10578);
|
||||
INSERT INTO `roleInherit` VALUES (370,72,130,10578);
|
||||
INSERT INTO `roleInherit` VALUES (371,36,35,NULL);
|
||||
|
||||
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
|
||||
|
||||
|
@ -1348,7 +1411,7 @@ INSERT INTO `ACL` VALUES (213,'TravelThermograph','*','WRITE','ALLOW','ROLE','bu
|
|||
INSERT INTO `ACL` VALUES (214,'Entry','*','*','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (216,'TravelThermograph','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (218,'Intrastat','*','*','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account');
|
||||
INSERT INTO `ACL` VALUES (221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','guest');
|
||||
INSERT INTO `ACL` VALUES (226,'ClientObservation','*','READ','ALLOW','ROLE','trainee');
|
||||
INSERT INTO `ACL` VALUES (227,'Address','*','READ','ALLOW','ROLE','trainee');
|
||||
INSERT INTO `ACL` VALUES (228,'AddressObservation','*','READ','ALLOW','ROLE','trainee');
|
||||
|
@ -1377,7 +1440,7 @@ INSERT INTO `ACL` VALUES (259,'Client','createReceipt','*','ALLOW','ROLE','sales
|
|||
INSERT INTO `ACL` VALUES (260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (261,'SupplierAccount','*','*','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (262,'Entry','*','*','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (263,'InvoiceIn','*','*','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (263,'InvoiceIn','*','READ','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (264,'StarredModule','*','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss');
|
||||
INSERT INTO `ACL` VALUES (266,'ZoneLog','*','READ','ALLOW','ROLE','employee');
|
||||
|
@ -1444,7 +1507,6 @@ INSERT INTO `ACL` VALUES (338,'Shelving','*','*','ALLOW','ROLE','employee');
|
|||
INSERT INTO `ACL` VALUES (339,'OsTicket','*','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (340,'OsTicketConfig','*','*','ALLOW','ROLE','it');
|
||||
INSERT INTO `ACL` VALUES (341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (345,'Ticket','deliveryNoteCsvEmail','READ','ALLOW','ROLE','employee');
|
||||
|
@ -1489,7 +1551,7 @@ INSERT INTO `ACL` VALUES (383,'Sector','*','READ','ALLOW','ROLE','employee');
|
|||
INSERT INTO `ACL` VALUES (384,'Sector','*','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee');
|
||||
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 (387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','$owner');
|
||||
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');
|
||||
|
@ -1619,7 +1681,7 @@ INSERT INTO `ACL` VALUES (522,'Client','replaceOrCreate','*','ALLOW','ROLE','emp
|
|||
INSERT INTO `ACL` VALUES (523,'Client','updateAll','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (524,'Client','upsertWithWhere','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (525,'Defaulter','observationEmail','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (527,'VnUser','acl','READ','ALLOW','ROLE','account');
|
||||
INSERT INTO `ACL` VALUES (527,'VnUser','acl','READ','ALLOW','ROLE','guest');
|
||||
INSERT INTO `ACL` VALUES (528,'VnUser','getCurrentUserData','READ','ALLOW','ROLE','account');
|
||||
INSERT INTO `ACL` VALUES (530,'Account','exists','READ','ALLOW','ROLE','account');
|
||||
INSERT INTO `ACL` VALUES (531,'Account','exists','READ','ALLOW','ROLE','account');
|
||||
|
@ -1665,7 +1727,7 @@ INSERT INTO `ACL` VALUES (570,'InvoiceOut','canCreatePdf','WRITE','ALLOW','ROLE'
|
|||
INSERT INTO `ACL` VALUES (571,'Supplier','editPayMethodCheck','WRITE','ALLOW','ROLE','financial');
|
||||
INSERT INTO `ACL` VALUES (572,'Worker','isTeamBoss','WRITE','ALLOW','ROLE','teamBoss');
|
||||
INSERT INTO `ACL` VALUES (573,'Worker','forceIsSubordinate','READ','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (574,'Claim','editState','WRITE','ALLOW','ROLE','claimManager');
|
||||
INSERT INTO `ACL` VALUES (574,'Claim','editPickup','WRITE','ALLOW','ROLE','claimManager');
|
||||
INSERT INTO `ACL` VALUES (577,'Claim','findOne','READ','ALLOW','ROLE','salesPerson');
|
||||
INSERT INTO `ACL` VALUES (579,'Claim','updateClaim','WRITE','ALLOW','ROLE','salesPerson');
|
||||
INSERT INTO `ACL` VALUES (580,'Claim','regularizeClaim','WRITE','ALLOW','ROLE','claimManager');
|
||||
|
@ -1745,10 +1807,6 @@ INSERT INTO `ACL` VALUES (686,'MailForward','*','*','ALLOW','ROLE','hr');
|
|||
INSERT INTO `ACL` VALUES (687,'ClientSms','find','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (688,'ClientSms','create','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (689,'Vehicle','sorted','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (690,'Roadmap','*','*','ALLOW','ROLE','palletizerBoss');
|
||||
INSERT INTO `ACL` VALUES (691,'Roadmap','*','*','ALLOW','ROLE','productionBoss');
|
||||
INSERT INTO `ACL` VALUES (692,'ExpeditionTruck','*','*','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (693,'ExpeditionTruck','*','*','ALLOW','ROLE','productionBoss');
|
||||
INSERT INTO `ACL` VALUES (695,'ViaexpressConfig','internationalExpedition','WRITE','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (696,'ViaexpressConfig','renderer','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (697,'Ticket','transferClient','WRITE','ALLOW','ROLE','administrative');
|
||||
|
@ -1784,7 +1842,7 @@ INSERT INTO `ACL` VALUES (727,'Account','find','READ','ALLOW','ROLE','employee')
|
|||
INSERT INTO `ACL` VALUES (728,'Account','exists','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (729,'Sale','clone','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (730,'Ticket','setDeleted','WRITE','ALLOW','ROLE','deliveryAssistant');
|
||||
INSERT INTO `ACL` VALUES (732,'Sale','isInPreparing','*','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (732,'Sale','isInPreparing','*','ALLOW','ROLE','reviewer');
|
||||
INSERT INTO `ACL` VALUES (733,'Train','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (734,'WorkerDepartment','*','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (735,'VnUser','higherPrivileges','*','ALLOW','ROLE','itManagement');
|
||||
|
@ -1817,7 +1875,7 @@ INSERT INTO `ACL` VALUES (761,'Route','downloadZip','READ','ALLOW','ROLE','emplo
|
|||
INSERT INTO `ACL` VALUES (762,'Route','filter','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (763,'Route','getByWorker','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (764,'Route','getDeliveryPoint','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (765,'Route','getExternalCmrs','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (765,'Route','cmrs','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (766,'Route','getSuggestedTickets','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (767,'Route','getTickets','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (768,'Route','guessPriority','WRITE','ALLOW','ROLE','employee');
|
||||
|
@ -1841,7 +1899,7 @@ INSERT INTO `ACL` VALUES (785,'VnRole','*','WRITE','ALLOW','ROLE','it');
|
|||
INSERT INTO `ACL` VALUES (786,'State','isAllEditable','READ','ALLOW','ROLE','delivery');
|
||||
INSERT INTO `ACL` VALUES (787,'Ticket','makePdfList','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (788,'Ticket','invoiceTicketsAndPdf','*','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (789,'InvoiceIn','*','*','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (789,'InvoiceIn','*','READ','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (790,'InvoiceIn','getSerial','READ','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (791,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (792,'InvoiceInCorrection','*','*','ALLOW','ROLE','administrative');
|
||||
|
@ -1887,6 +1945,44 @@ INSERT INTO `ACL` VALUES (834,'AgencyMode','*','READ','ALLOW','ROLE','employee')
|
|||
INSERT INTO `ACL` VALUES (835,'Agency','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (836,'Agency','*','WRITE','ALLOW','ROLE','deliveryAssistant');
|
||||
INSERT INTO `ACL` VALUES (837,'AgencyWorkCenter','*','WRITE','ALLOW','ROLE','deliveryAssistant');
|
||||
INSERT INTO `ACL` VALUES (838,'Worker','getAvailablePda','READ','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (839,'Locker','__get__codes','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (840,'Locker','*','*','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (841,'Locker','*','*','ALLOW','ROLE','productionBoss');
|
||||
INSERT INTO `ACL` VALUES (842,'Worker','__get__locker','READ','ALLOW','ROLE','hr');
|
||||
INSERT INTO `ACL` VALUES (843,'Worker','__get__locker','READ','ALLOW','ROLE','productionBoss');
|
||||
INSERT INTO `ACL` VALUES (846,'Ticket','refund','WRITE','ALLOW','ROLE','logistic');
|
||||
INSERT INTO `ACL` VALUES (847,'RouteConfig','*','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (848,'InvoiceIn','updateInvoiceIn','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (849,'InvoiceIn','clone','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (850,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (851,'InvoiceIn','exchangeRateUpdate','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (852,'InvoiceIn','invoiceInEmail','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (853,'InvoiceIn','toBook','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (854,'InvoiceIn','toUnbook','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (855,'InvoiceIn','deleteById','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (856,'InvoiceIn','updateInvoiceIn','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (857,'InvoiceIn','clone','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (858,'InvoiceIn','corrective','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (859,'InvoiceIn','exchangeRateUpdate','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (860,'InvoiceIn','invoiceInEmail','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (861,'InvoiceIn','toBook','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (862,'InvoiceIn','deleteById','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (863,'InvoiceIn','create','WRITE','ALLOW','ROLE','administrative');
|
||||
INSERT INTO `ACL` VALUES (864,'InvoiceIn','create','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (865,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `ACL` VALUES (866,'InvoiceOut','download','READ','ALLOW','ROLE','$owner');
|
||||
INSERT INTO `ACL` VALUES (867,'InvoiceIn','*','READ','ALLOW','ROLE','maintenanceBoss');
|
||||
INSERT INTO `ACL` VALUES (868,'InvoiceIn','*','READ','ALLOW','ROLE','maintenanceBos');
|
||||
INSERT INTO `ACL` VALUES (869,'Ticket','editZone','WRITE','ALLOW','ROLE','buyer');
|
||||
INSERT INTO `ACL` VALUES (870,'Entry','find','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (871,'RoadmapAddress','*','WRITE','ALLOW','ROLE','palletizerBoss');
|
||||
INSERT INTO `ACL` VALUES (872,'RoadmapAddress','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (873,'Roadmap','*','WRITE','ALLOW','ROLE','palletizerBoss');
|
||||
INSERT INTO `ACL` VALUES (874,'Roadmap','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (875,'RoadmapStop','*','WRITE','ALLOW','ROLE','palletizerBoss');
|
||||
INSERT INTO `ACL` VALUES (876,'RoadmapStop','*','READ','ALLOW','ROLE','production');
|
||||
INSERT INTO `ACL` VALUES (877,'TravelKgPercentage','*','READ','ALLOW','ROLE','employee');
|
||||
|
||||
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
|
||||
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
||||
|
@ -1975,6 +2071,7 @@ INSERT INTO `defaultViewConfig` VALUES ('itemsIndex','{\"intrastat\":false,\"ste
|
|||
INSERT INTO `defaultViewConfig` VALUES ('latestBuys','{\"intrastat\":false,\"description\":false,\"density\":false,\"isActive\":false,\n \"freightValue\":false,\"packageValue\":false,\"isIgnored\":false,\"price2\":false,\"ektFk\":false,\"weight\":false,\n \"size\":false,\"comissionValue\":false,\"landing\":false}');
|
||||
INSERT INTO `defaultViewConfig` VALUES ('ticketsMonitor','{\"id\":false}');
|
||||
INSERT INTO `defaultViewConfig` VALUES ('clientsDetail','{\"id\":true,\"phone\":true,\"city\":true,\"socialName\":true,\"salesPersonFk\":true,\"email\":true,\"name\":false,\"fi\":false,\"credit\":false,\"creditInsurance\":false,\"mobile\":false,\"street\":false,\"countryFk\":false,\"provinceFk\":false,\"postcode\":false,\"created\":false,\"businessTypeFk\":false,\"payMethodFk\":false,\"sageTaxTypeFk\":false,\"sageTransactionTypeFk\":false,\"isActive\":false,\"isVies\":false,\"isTaxDataChecked\":false,\"isEqualizated\":false,\"isFreezed\":false,\"hasToInvoice\":false,\"hasToInvoiceByAddress\":false,\"isToBeMailed\":false,\"hasLcr\":false,\"hasCoreVnl\":false,\"hasSepaVnl\":false}');
|
||||
INSERT INTO `defaultViewConfig` VALUES ('routesList','{\"ID\":true,\"worker\":true,\"agency\":true,\"vehicle\":true,\"date\":true,\"volume\":true,\"description\":true,\"started\":true,\"finished\":true,\"actions\":true}');
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
|
@ -2207,7 +2304,7 @@ 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,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 (22,'shopping','COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,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);
|
||||
|
@ -2219,7 +2316,7 @@ INSERT INTO `department` VALUES (39,'packing','ENCAJADO',17,18,NULL,72,1,0,2,0,3
|
|||
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 (45,'logistic','LOGISTICA',72,73,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,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);
|
||||
|
@ -2235,19 +2332,19 @@ INSERT INTO `department` VALUES (61,NULL,'VNH',90,93,NULL,73,0,0,1,1,1,'/1/',NUL
|
|||
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 ESPAÑA 5',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 (80,'spainTeam5','EQUIPO ESPAÑA 5',43,44,4250,0,0,0,2,0,43,'/1/43/','es5_equipo',1,'es5@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,'spainTeam2','EQUIPO ESPAÑA 2',47,48,3797,0,0,0,2,0,43,'/1/43/','es2_equipo',0,'es2@verdnatura.es',0,0,0,0,NULL,NULL,'5100',NULL);
|
||||
INSERT INTO `department` VALUES (95,'spainTeam1','EQUIPO ESPAÑA 1',49,50,24065,0,0,0,2,0,43,'/1/43/','es1_equipo',0,'es1@verdnatura.es',0,0,0,0,NULL,NULL,'5000',NULL);
|
||||
INSERT INTO `department` VALUES (94,'spainTeam2','EQUIPO ESPAÑA 2',47,48,3797,0,0,0,2,0,43,'/1/43/','es2_equipo',1,'es2@verdnatura.es',0,0,0,0,NULL,NULL,'5100',NULL);
|
||||
INSERT INTO `department` VALUES (95,'spainTeam1','EQUIPO ESPAÑA 1',49,50,24065,0,0,0,2,0,43,'/1/43/','es1_equipo',1,'es1@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 ESPAÑA 3',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 (125,'spainTeam3','EQUIPO ESPAÑA 3',57,58,1118,0,0,0,2,0,43,'/1/43/','es3_equipo',1,'es3@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,1,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,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,NULL);
|
||||
|
@ -2258,8 +2355,8 @@ INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',63,64,6264
|
|||
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 ESPAÑA 4',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,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (139,'spainTeam4','EQUIPO ESPAÑA 4',65,66,3803,0,0,0,2,0,43,'/1/43/','es4_equipo',1,'es4@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,NULL,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);
|
||||
|
|
|
@ -303,7 +303,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','jerarquia'
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerBusinessAgreement','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','tarifa_componentes','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','tarifa_componentes_series','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','Entradas','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemType','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','cl_main','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','cl_main','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -349,7 +348,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','empresa','alex
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','sectorType','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Tintas','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','claimManager','Movimientos','juan@%','0000-00-00 00:00:00','Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Entradas','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Entradas','guillermo@10.5.1.3','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','salesPerson','ticket_observation','juan@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Entradas_dits','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','sale','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -365,9 +364,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','tickets_
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hrBoss','tickets_gestdoc','alexm@%','0000-00-00 00:00:00','Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','tickets_gestdoc','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','employee','Tickets','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Entradas','root@localhost','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','Entradas','alexm@%','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas','alexm@%','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','Tintas','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','filtros','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','Entradas_kop','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -600,7 +597,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','ektEntryAssign','a
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionBoss','itemShelving','root@localhost','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','propertyDms','juan@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerTimeControlConfig','juan@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','entry','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','entry','guillermo@10.5.1.3','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','businessType','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','entryLog','juan@10.5.1.2','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','projectState','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -627,7 +624,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','wks','alexm@%'
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','entryObservation','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','itemShelvingList','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','cmrConfig','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','expeditionTruck','alexm@%','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','expeditionTruck','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','alertLevel','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','expeditionSticker','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','artificialBoss','entryObservation','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -650,9 +647,9 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','pgcMaster','
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','itemBarcode','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','host','alexm@%','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ticket','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceIn','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','invoiceIn','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','invoiceIn','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceIn','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hrBoss','invoiceIn','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','invoiceIn','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','inventoryFailure','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesPerson','intrastat','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','inventoryFailure','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -660,7 +657,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','inventoryFailureCause
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesPerson','invoiceCorrection','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceCorrectionDataSource','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesPerson','invoiceCorrectionType','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','invoiceIn','alexm@%','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logistic','invoiceIn','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceInDueDay','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','invoiceInDueDay','alexm@%','0000-00-00 00:00:00','Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','invoiceInIntrastat__','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
|
@ -751,7 +748,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 ('','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','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesAssistant','clientProtected','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
|
@ -773,7 +769,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','logistic','PreciosEspecia
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','movingState','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','bufferType','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','bufferState','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','buffer','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','buffer','guillermo@10.5.1.3','0000-00-00 00:00:00','Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','bufferGroup','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenance','lastRFID','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','person__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
|
@ -788,7 +784,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','vehicleState
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','vehicleEvent','alexm@%','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','cooler','Tintas','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','itemBotanical','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','cooler','Entradas','alexm@%','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','account','developer','signInLog','juan@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','ticketTracking','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','deviceProductionState','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -987,7 +982,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceCorre
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ink','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','zone','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','XDiario','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','XDiario','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','XDiario','jgallego@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesAssistant','workerTimeControlMail','alexm@%','0000-00-00 00:00:00','Select,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','workerTimeControl','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','financial','Greuge_Evolution','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1053,7 +1048,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','grafana','userSession','j
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','receipt','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','buy','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','calendarHolidays','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','parking','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','parking','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','role','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','errorLogApp','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','continent','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1190,7 +1185,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','businessCalendar','
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','edi','employee','item','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','vehicleNotes','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','vehicleDms','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','palletizerBoss','expeditionTruck','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','invoiceInConfig','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','palletizerBoss','zoneEvent','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','palletizerBoss','routesMonitor','alexm@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','propertyNotes','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
|
@ -1224,7 +1219,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','module','juan@
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','printConfig','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','url','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','salix','developer','userConfigView','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','claimRedelivery','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','claimRedelivery','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','clientRisk','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','supplierDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','buyer','sale','guillermo@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1252,7 +1247,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','expeditio
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','expeditionScan','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','expeditionPallet','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','province','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','expeditionTruck','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','grafana','visitAccess','root@localhost','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','v_botanic_export','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','itemCost','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','deliveryAssistant','m3','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1300,15 +1295,16 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','claimState','juan@d
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','company','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','grafana','buffer','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','greuge','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','item','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','','Select,Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','item','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','','Select,Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerBoss','itemShelving','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','negativeOrigin','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryBoss','Vehiculos_consumo','carlosap@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','entryOrder','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBos','project','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','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','buyer','ink','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','supplierDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','supplierDms','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','grafana','visitAgent','root@localhost','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','remittance','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','vehicleConsumption','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','vehicleConsumption','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
|
@ -1354,7 +1350,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','warehouse
|
|||
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','grafana','priceFixed','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
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','');
|
||||
|
@ -1365,7 +1361,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','sale_freight
|
|||
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','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ticketRequest','guillermo@10.5.1.3','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryBoss','vehicleState','jgallego@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','grafana','expeditionState','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','specialPrice','jgallego@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
|
@ -1388,6 +1384,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','professionalCategor
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','ticketObservation','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','deliveryNoteState','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','deliveryNote','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','comparative','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','invoiceOutExpense','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','delivery','carlosap@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','entry','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
|
@ -1398,8 +1395,33 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','farmingDeliv
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','sage','grafana','TiposIva','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','buyer','waste','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','clientObservation','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceInConfig','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','grafana','visit','root@localhost','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','workerActivity','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','bankPolicy','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','bankPolicyDetail','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financial','bankPolicyReview','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','roadmapStop','guillermo@10.5.1.3','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','roadmapStop','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','agencyWorkCenter','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','roadmapStop','guillermo@10.5.1.3','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','entryEditor','Entradas','guillermo@10.5.1.3','0000-00-00 00:00:00','Insert','Update');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','clientInforma','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','solunionCAP','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','clientUnpaid','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','pay_dem','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','invoiceOut','guillermo@10.5.1.3','0000-00-00 00:00:00','Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financialBoss','invoiceOut','guillermo@10.5.1.3','0000-00-00 00:00:00','Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financialBoss','accountDetail','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','accountDetail','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','project','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','machineDetail','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','antenna','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','bufferPool','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','enteringLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','expeditionLoading','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','failureLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','movingLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','sorterLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
|
||||
|
||||
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
|
||||
|
@ -1459,35 +1481,6 @@ INSERT IGNORE INTO `columns_priv` VALUES ('','pbx','grafana','sip','user_id','0
|
|||
INSERT IGNORE INTO `columns_priv` VALUES ('','pbx','grafana','sip','extension','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','account','grafana','user','name','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','account','grafana','user','active','0000-00-00 00:00:00','Select');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','supplierFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','dated','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','invoiceNumber','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','isExcludedFromAvailable','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','notes','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','isConfirmed','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','isOrdered','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','isRaid','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','commission','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','created','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','evaNotes','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','travelFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','currencyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','companyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','gestDocFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','invoiceInFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','isBlocked','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','loadPriority','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','kop','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','sub','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','pro','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','auction','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','invoiceAmount','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','buyerFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','typeFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','reference','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','observationEditorFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','entry','clonedFrom','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','routesMonitor','routeFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','routesMonitor','name','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','routesMonitor','beachFk','0000-00-00 00:00:00','Update');
|
||||
|
@ -1595,10 +1588,10 @@ INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','item','editorFk',
|
|||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','item','recycledPlastic','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','item','nonRecycledPlastic','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','item','minQuantity','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','size','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Id_Entrada','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','originFk','0000-00-00 00:00:00','Select,Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','longName','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','item','name','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Id_Proveedor','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Fecha','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','warehouseFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','employee','ticket','shipped','0000-00-00 00:00:00','Update');
|
||||
|
@ -1665,6 +1658,93 @@ INSERT IGNORE INTO `columns_priv` VALUES ('','vn','entryEditor','entry','cloned
|
|||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','entryEditor','entry','editorFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','entryEditor','entry','lockerUserFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','entryEditor','entry','locked','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Referencia','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Inventario','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Confirmada','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Pedida','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Redada','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','comision','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','odbc_date','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Notas_Eva','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','travel_id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','Id_Moneda','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','empresa_id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','gestdoc_id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','recibida_id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','loadPriority','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','kop','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','sub','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','pro','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','invoiceAmount','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','buyerFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','typeFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn2008','entryEditor','Entradas','reference','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','serialNumber','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','serial','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','supplierFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','issued','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','supplierRef','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','currencyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','created','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','companyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','docFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','booked','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','operated','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','siiTypeInvoiceInFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','cplusRectificationTypeFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','cplusSubjectOpFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','cplusTaxBreakFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','siiTrascendencyInvoiceInFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','bookEntried','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','isVatDeductible','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','withholdingSageFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','expenseFkDeductible','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','hrBoss','invoiceIn','editorFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','serialNumber','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','serial','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','supplierFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','issued','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','supplierRef','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','currencyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','created','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','companyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','docFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','booked','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','operated','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','siiTypeInvoiceInFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','cplusRectificationTypeFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','cplusSubjectOpFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','cplusTaxBreakFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','siiTrascendencyInvoiceInFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','bookEntried','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','isVatDeductible','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','withholdingSageFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','expenseFkDeductible','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','buyer','invoiceIn','editorFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','id','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','serialNumber','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','serial','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','supplierFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','issued','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','supplierRef','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','currencyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','created','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','companyFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','docFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','booked','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','operated','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','siiTypeInvoiceInFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','cplusRectificationTypeFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','cplusSubjectOpFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','cplusTaxBreakFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','siiTrascendencyInvoiceInFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','bookEntried','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','isVatDeductible','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','withholdingSageFk','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','expenseFkDeductible','0000-00-00 00:00:00','Update');
|
||||
INSERT IGNORE INTO `columns_priv` VALUES ('','vn','logistic','invoiceIn','editorFk','0000-00-00 00:00:00','Update');
|
||||
/*!40000 ALTER TABLE `columns_priv` ENABLE KEYS */;
|
||||
|
||||
/*!40000 ALTER TABLE `procs_priv` DISABLE KEYS */;
|
||||
|
@ -1729,8 +1809,10 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','barcodeToItem','FUN
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','ticket_splititempackingtype','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','entry_getCommission','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','deliveryAssistant','expeditionstate_addbypallet','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','ledger_nextTx','PROCEDURE','guillermo@10.5.1.3','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','mail_insert','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
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 ('','vn','financial','entry_updateComission','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','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 ('','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');
|
||||
|
@ -1758,7 +1840,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','manager','collection_make','PR
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','android','debugadd','PROCEDURE','jenkins@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','copyComponentsFromSaleList','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','duaEntryValueUpdate','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','duaInvoiceInBooking','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','duaInvoiceInBooking','PROCEDURE','carlosap@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemshelvinglog_get','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','expedition_getstate','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','srt','production','expedition_scan','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1807,7 +1889,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','invoiceoutboo
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','ticket_gettax','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','productionAssi','midnight','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','dipole','employee','expedition_add','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','ticketstateupdate','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','coolerBoss','itempacking','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesPerson','ticket_clone','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','cache','employee','available_refresh','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1858,7 +1939,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','workercalendar_calculateb
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','ticketparking_findskipped','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','ticketcollection_getnopacked','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','supplier_checkbalance','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','item_valuateinventory','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','ledger_docompensation','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','ledger_next','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','invoicein_booking','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1873,7 +1953,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','duaParcialMak
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','palletizerBoss','packingsite_startcollection','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','sale_calculatecomponent','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesPerson','manaspellersrequery','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','adminBoss','packageinvoicing','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','packinglistswitch','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','previoussticker_get','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','productioncontrol','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1976,7 +2055,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','expeditionscan_ad
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','expeditionscan_list','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','expeditionscan_put','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','cmrpallet_add','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemtrash','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','item_getbalance','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','expedition_checkroute','FUNCTION','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','addnotefromdelivery','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2029,7 +2107,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','expeditionscan_add'
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','expeditionscan_list','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','expeditionscan_put','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','cmrpallet_add','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemtrash','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','item_getbalance','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','expedition_checkroute','FUNCTION','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','addnotefromdelivery','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2055,10 +2132,10 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','entry_getTransf
|
|||
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');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','remittance_calc','PROCEDURE','alexm@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','developer','connection_kill','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financial','client_getRisk','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','grafana','item_ValuateInventory','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','account','developer','user_hasRole','FUNCTION','root@localhost','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financialBoss','balance_create','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hrBoss','balance_create','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','buy_recalcPricesByEntry','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2066,6 +2143,8 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','buy_recalcPricesByE
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','entryEditor','buy_recalcPricesByBuy','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','buy_recalcPricesByBuy','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','buy_recalcPricesByBuy','PROCEDURE','jenkins@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','ledger_nextTx','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','ledger_docompensation','PROCEDURE','guillermo@db-proxy2.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 */;
|
||||
|
@ -2090,7 +2169,7 @@ INSERT IGNORE INTO `global_priv` VALUES ('','buyer','{\"access\": 0, \"version_
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','buyerAssistant','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','buyerBoss','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','claimManager','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','cooler','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','cooler','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','coolerAssist','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','coolerBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','customer','{\"access\": 0, \"max_questions\": 0, \"max_updates\": 30000, \"max_connections\": 300000, \"max_user_connections\": 400, \"max_statement_time\": 0.000000, \"is_role\": true,\"version_id\":100707}');
|
||||
|
@ -2121,14 +2200,14 @@ INSERT IGNORE INTO `global_priv` VALUES ('','logisticAssist','{\"access\":0,\"v
|
|||
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}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBoss','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','maintenanceBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','manager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','marketing','{\"access\": 0, \"is_role\": true,\"version_id\":101106}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','marketingBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','officeBoss','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','packager','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','palletizer','{\"access\":0,\"version_id\":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 ('','palletizerBoss','{\"access\":0,\"version_id\":101106,\"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\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','productionAssi','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2140,24 +2140,22 @@ BEGIN
|
|||
END IF;
|
||||
|
||||
IF !(OLD.started <=> NEW.started AND OLD.ended <=> NEW.ended) THEN
|
||||
|
||||
SELECT COUNT(*) > 0 INTO isOverlapping
|
||||
FROM business b
|
||||
WHERE (util.hasDateOverlapped(
|
||||
NEW.started,
|
||||
IFNULL(NEW.ended, b.started),
|
||||
b.started,
|
||||
IFNULL(b.ended, NEW.started))
|
||||
OR (NEW.ended <=> NULL AND b.ended <=> NULL))
|
||||
AND b.id <> OLD.id
|
||||
AND workerFk = OLD.workerFk;
|
||||
SELECT util.hasDateOverlapped(
|
||||
started,
|
||||
ended,
|
||||
NEW.started,
|
||||
IFNULL(NEW.ended, b.started)
|
||||
) isOverlapped INTO isOverlapping
|
||||
FROM vn.business b
|
||||
WHERE workerFk = NEW.workerFK
|
||||
AND b.id <> NEW.id
|
||||
ORDER BY isOverlapped DESC
|
||||
LIMIT 1;
|
||||
|
||||
IF isOverlapping THEN
|
||||
CALL util.throw ('IS_OVERLAPPING');
|
||||
END IF;
|
||||
|
||||
END IF;
|
||||
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -2239,7 +2237,7 @@ trig: BEGIN
|
|||
LEAVE trig;
|
||||
END IF;
|
||||
|
||||
CALL entry_checkBooked(NEW.entryFk);
|
||||
CALL entry_isEditable(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;
|
||||
|
@ -2366,7 +2364,15 @@ trig:BEGIN
|
|||
LEAVE trig;
|
||||
END IF;
|
||||
|
||||
CALL entry_checkBooked(OLD.entryFk);
|
||||
IF NOT (NEW.entryFk <=> OLD.entryFk) OR
|
||||
NOT (NEW.quantity <=> OLD.quantity) OR
|
||||
NOT (NEW.buyingValue <=> OLD.buyingValue) OR
|
||||
NOT (NEW.packing <=> OLD.packing)
|
||||
THEN
|
||||
|
||||
CALL entry_isEditable(OLD.entryFk);
|
||||
END IF;
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
SELECT defaultEntry INTO vDefaultEntry
|
||||
|
@ -2515,7 +2521,7 @@ DELIMITER ;;
|
|||
BEFORE DELETE ON `buy`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
CALL entry_checkBooked(OLD.entryFk);
|
||||
CALL entry_isEditable(OLD.entryFk);
|
||||
IF OLD.printedStickers <> 0 THEN
|
||||
CALL util.throw("it is not possible to delete buys with printed labels ");
|
||||
END IF;
|
||||
|
@ -3010,6 +3016,52 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`claimRatio_afterInsert`
|
||||
AFTER INSERT ON `claimRatio`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO clientRate(clientFk, `value`)
|
||||
VALUES(NEW.clientFk, NEW.priceIncreasing)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`value` = VALUES(`value`);
|
||||
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`.`claimRatio_afterUpdate`
|
||||
AFTER UPDATE ON `claimRatio`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO clientRate(clientFk, `value`)
|
||||
VALUES(NEW.clientFk, NEW.priceIncreasing)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`value` = VALUES(`value`);
|
||||
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`.`claimState_beforeInsert`
|
||||
BEFORE INSERT ON `claimState`
|
||||
FOR EACH ROW
|
||||
|
@ -3198,11 +3250,11 @@ BEGIN
|
|||
END IF;
|
||||
END IF;
|
||||
|
||||
IF !(NEW.salesPersonFk <=> OLD.salesPersonFk) THEN
|
||||
IF NOT (NEW.salesPersonFk <=> OLD.salesPersonFk) THEN
|
||||
SET NEW.lastSalesPersonFk = IFNULL(NEW.salesPersonFk, OLD.salesPersonFk);
|
||||
END IF;
|
||||
|
||||
IF !(NEW.businessTypeFk <=> OLD.businessTypeFk) AND (NEW.businessTypeFk = 'individual' OR OLD.businessTypeFk = 'individual') THEN
|
||||
IF NOT (NEW.businessTypeFk <=> OLD.businessTypeFk) AND (NEW.businessTypeFk = 'individual' OR OLD.businessTypeFk = 'individual') THEN
|
||||
SET NEW.isTaxDataChecked = 0;
|
||||
END IF;
|
||||
END */;;
|
||||
|
@ -3224,13 +3276,36 @@ DELIMITER ;;
|
|||
AFTER UPDATE ON `client`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF !(NEW.defaultAddressFk <=> OLD.defaultAddressFk) THEN
|
||||
IF NOT (NEW.defaultAddressFk <=> OLD.defaultAddressFk) THEN
|
||||
UPDATE `address` SET isDefaultAddress = FALSE
|
||||
WHERE clientFk = NEW.id;
|
||||
|
||||
UPDATE `address` SET isDefaultAddress = TRUE
|
||||
WHERE id = NEW.defaultAddressFk;
|
||||
END IF;
|
||||
|
||||
IF NEW.id <> OLD.id
|
||||
OR NOT (NEW.provinceFk <=> OLD.provinceFk)
|
||||
OR NOT (NEW.socialName <=> OLD.socialName)
|
||||
OR NOT (NEW.street <=> OLD.street)
|
||||
OR NOT (NEW.accountingAccount <=> OLD.accountingAccount)
|
||||
OR NOT (NEW.isVies <=> OLD.isVies)
|
||||
OR NOT (NEW.fi <=> OLD.fi)
|
||||
OR NOT (NEW.postcode <=> OLD.postcode)
|
||||
OR NOT (NEW.city <=> OLD.city)
|
||||
OR NOT (NEW.countryFk <=> OLD.countryFk)
|
||||
OR NOT (NEW.taxTypeSageFk <=> OLD.taxTypeSageFk)
|
||||
OR NOT (NEW.transactionTypeSageFk <=> OLD.transactionTypeSageFk)
|
||||
OR NOT (NEW.email <=> OLD.email)
|
||||
OR NOT (NEW.iban <=> OLD.iban)
|
||||
OR NOT (NEW.phone <=> OLD.phone)
|
||||
OR NOT (NEW.mobile <=> OLD.mobile) THEN
|
||||
|
||||
UPDATE sage.clientSupplier
|
||||
SET isSync = FALSE
|
||||
WHERE idClientSupplier IN (NEW.id, OLD.id)
|
||||
AND `type` = 'C';
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -3789,7 +3864,7 @@ DELIMITER ;;
|
|||
BEFORE INSERT ON `country`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.geoFk = zoneGeo_new('country', NEW.country, NULL);
|
||||
SET NEW.geoFk = zoneGeo_new('country', NEW.name, NULL);
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -3811,14 +3886,17 @@ DELIMITER ;;
|
|||
BEGIN
|
||||
UPDATE sage.Naciones
|
||||
SET countryFk = NEW.id
|
||||
WHERE Nacion = NEW.country;
|
||||
WHERE Nacion = NEW.name;
|
||||
|
||||
IF ROW_COUNT() = 0 THEN
|
||||
CALL mail_insert(
|
||||
'cau@verdnatura.es',
|
||||
NULL,
|
||||
'Actualizar tabla sage.Naciones',
|
||||
CONCAT('Se ha insertado un nuevo país en la tabla vn.conuntry. Para el correcto funcionamiento del sistema \n\t\t\t\tde contabilidad es necesario actualizar la columna sage.Naciones.countryFk con el valor del nuevo país. \n\t\t\t Hay que buscar el nuevo país: ', NEW.country, ' en la tabla sage.Naciones y actualizar el campo sage.Naciones.countryFk con el valor ', NEW.id)
|
||||
CONCAT('Se ha insertado un nuevo país en la tabla vn.conuntry.
|
||||
Para el correcto funcionamiento del sistema \n\t\t\t\tde contabilidad es necesario actualizar la columna
|
||||
sage.Naciones.countryFk con el valor del nuevo país. \n\t\t\t Hay que buscar el nuevo país: ', NEW.name,
|
||||
' en la tabla sage.Naciones y actualizar el campo sage.Naciones.countryFk con el valor ', NEW.id)
|
||||
);
|
||||
END IF;
|
||||
END */;;
|
||||
|
@ -3862,8 +3940,8 @@ DELIMITER ;;
|
|||
AFTER UPDATE ON `country`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF !(OLD.country <=> NEW.country) THEN
|
||||
UPDATE zoneGeo SET `name` = NEW.country
|
||||
IF !(OLD.name <=> NEW.name) THEN
|
||||
UPDATE zoneGeo SET `name` = NEW.name
|
||||
WHERE id = NEW.geoFk;
|
||||
END IF;
|
||||
END */;;
|
||||
|
@ -4200,31 +4278,6 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`deviceProductionConfig_afterUpdate`
|
||||
AFTER UPDATE ON `deviceProductionConfig`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF NEW.isAllUsersAllowed = 1 OR NEW.isAllUsersAllowed = -1 THEN
|
||||
SET @username := (SELECT account.myUser_getName());
|
||||
INSERT INTO vn.mail (receiver, subject, body)
|
||||
VALUES ('cau@verdnatura.es', 'Se ha activado la autenticación sin restricciones en la app',
|
||||
CONCAT('El usuario ', @username,' ha habilitado la opción para que todos los usuarios puedan acceder a la app sin restricciones'));
|
||||
END IF;
|
||||
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`.`deviceProductionModels_beforeInsert`
|
||||
BEFORE INSERT ON `deviceProductionModels`
|
||||
FOR EACH ROW
|
||||
|
@ -4325,10 +4378,32 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`deviceProductionUser_afterInsert`
|
||||
AFTER INSERT ON `deviceProductionUser`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
CALL worker_checkMultipleDevice(NEW.userFk);
|
||||
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`.`deviceProductionUser_beforeUpdate`
|
||||
BEFORE UPDATE ON `deviceProductionUser`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
CALL worker_checkMultipleDevice(NEW.userFk);
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -4566,8 +4641,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');
|
||||
IF NEW.travelFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.travelFk);
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -4592,10 +4667,21 @@ BEGIN
|
|||
DECLARE vPrintedCount INT;
|
||||
DECLARE vHasDistinctWarehouses BOOL;
|
||||
DECLARE vTotalBuy INT;
|
||||
|
||||
IF NEW.isBooked = OLD.isBooked THEN
|
||||
CALL entry_checkBooked(OLD.id);
|
||||
|
||||
IF NEW.isBooked = OLD.isBooked AND (
|
||||
NOT (NEW.supplierFk <=> OLD.supplierFk) OR
|
||||
NOT (NEW.dated <=> OLD.dated) OR
|
||||
NOT (NEW.invoiceNumber <=> OLD.invoiceNumber) OR
|
||||
NOT (NEW.travelFk <=> OLD.travelFk) OR
|
||||
NOT (NEW.companyFk <=> OLD.companyFk) OR
|
||||
NOT (NEW.invoiceInFk <=> OLD.invoiceInFk) OR
|
||||
NOT (NEW.invoiceAmount <=> OLD.invoiceAmount) OR
|
||||
NOT (NEW.typeFk <=> OLD.typeFk)
|
||||
) THEN
|
||||
|
||||
CALL entry_isEditable(OLD.id);
|
||||
ELSE
|
||||
|
||||
IF NEW.isBooked THEN
|
||||
SELECT COUNT(*) INTO vTotalBuy
|
||||
FROM buy
|
||||
|
@ -4610,8 +4696,8 @@ BEGIN
|
|||
|
||||
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');
|
||||
IF NEW.travelFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.travelFk);
|
||||
END IF;
|
||||
|
||||
SELECT COUNT(*) > 0 INTO vIsVirtual
|
||||
|
@ -4696,7 +4782,7 @@ DELIMITER ;;
|
|||
BEFORE DELETE ON `entry`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
CALL entry_checkBooked(OLD.id);
|
||||
CALL entry_isEditable(OLD.id);
|
||||
DELETE FROM buy WHERE entryFk = OLD.id;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -4869,25 +4955,25 @@ DELIMITER ;;
|
|||
BEFORE INSERT ON `expedition`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
DECLARE intcounter INT;
|
||||
DECLARE vShipFk INT;
|
||||
DECLARE vMaxCounter INT;
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF NEW.freightItemFk IS NOT NULL THEN
|
||||
IF NEW.freightItemFk IS NOT NULL THEN
|
||||
|
||||
UPDATE ticket SET packages = IFNULL(packages, 0) + 1 WHERE id = NEW.ticketFk;
|
||||
|
||||
SELECT IFNULL(MAX(counter),0) +1 INTO intcounter
|
||||
FROM expedition e
|
||||
INNER JOIN ticket t1 ON e.ticketFk = t1.id
|
||||
SELECT IFNULL(MAX(counter),0) + 1 INTO vMaxCounter
|
||||
FROM expedition e
|
||||
JOIN alertLevel al ON al.code = 'DELIVERED'
|
||||
JOIN ticket t1 ON e.ticketFk = t1.id
|
||||
LEFT JOIN ticketState ts ON ts.ticketFk = t1.id
|
||||
INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped)
|
||||
JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped)
|
||||
AND t1.warehouseFk = t2.warehouseFk
|
||||
WHERE t2.id = NEW.ticketFk AND ts.alertLevel < 3 AND t1.companyFk = t2.companyFk
|
||||
WHERE t2.id = NEW.ticketFk AND ts.alertLevel < al.id AND t1.companyFk = t2.companyFk
|
||||
AND t1.agencyModeFk = t2.agencyModeFk;
|
||||
|
||||
SET NEW.`counter` = intcounter;
|
||||
SET NEW.`counter` = vMaxCounter;
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -5060,50 +5146,6 @@ BEGIN
|
|||
SET e.stateTypeFk = NEW.typeFk
|
||||
WHERE e.id = NEW.expeditionFk;
|
||||
|
||||
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`.`expeditionTruck_beforeInsert`
|
||||
BEFORE INSERT ON `expeditionTruck`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.description = UCASE(NEW.description);
|
||||
|
||||
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`.`expeditionTruck_beforeUpdate`
|
||||
BEFORE UPDATE ON `expeditionTruck`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.description = UCASE(NEW.description);
|
||||
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -6796,94 +6838,94 @@ DELIMITER ;;
|
|||
BEFORE INSERT ON `payment`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
DECLARE cuenta_banco,cuenta_proveedor DOUBLE;
|
||||
DECLARE vNewBookEntry INT;
|
||||
DECLARE bolCASH BOOLEAN;
|
||||
DECLARE isSupplierActive BOOLEAN;
|
||||
DECLARE vBankAccount DOUBLE;
|
||||
DECLARE vSupplierAccount DOUBLE;
|
||||
DECLARE vNewBookEntry INT;
|
||||
DECLARE vIsCash BOOLEAN;
|
||||
DECLARE vIsSupplierActive BOOLEAN;
|
||||
|
||||
-- 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 accounting a
|
||||
JOIN accountingType at2 ON at2.id = a.accountingTypeFk
|
||||
WHERE a.id = NEW.bankFk;
|
||||
SELECT (at2.code = 'cash') INTO vIsCash
|
||||
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 accounting
|
||||
WHERE id = NEW.bankFk;
|
||||
|
||||
SELECT account INTO cuenta_proveedor
|
||||
FROM supplier
|
||||
WHERE id = NEW.supplierFk;
|
||||
IF vIsCash THEN
|
||||
SELECT account INTO vBankAccount
|
||||
FROM accounting
|
||||
WHERE id = NEW.bankFk;
|
||||
|
||||
CALL ledger_next(vNewBookEntry);
|
||||
|
||||
INSERT INTO XDiario ( ASIEN,
|
||||
FECHA,
|
||||
SUBCTA,
|
||||
CONTRA,
|
||||
CONCEPTO,
|
||||
EURODEBE,
|
||||
EUROHABER,
|
||||
empresa_id)
|
||||
SELECT vNewBookEntry,
|
||||
NEW.received,
|
||||
SUBCTA,
|
||||
CONTRA,
|
||||
NEW.concept,
|
||||
EURODEBE,
|
||||
EUROHABER,
|
||||
NEW.companyFk
|
||||
FROM ( SELECT cuenta_banco SUBCTA,
|
||||
cuenta_proveedor CONTRA,
|
||||
0 EURODEBE,
|
||||
NEW.amount + NEW.bankingFees EUROHABER
|
||||
UNION ALL
|
||||
SELECT cuenta_proveedor SUBCTA,
|
||||
cuenta_banco CONTRA,
|
||||
NEW.amount EURODEBE,
|
||||
0 EUROHABER) gf;
|
||||
|
||||
IF NEW.bankingFees <> 0 THEN
|
||||
INSERT INTO XDiario ( ASIEN,
|
||||
FECHA,
|
||||
SUBCTA,
|
||||
CONTRA,
|
||||
CONCEPTO,
|
||||
EURODEBE,
|
||||
EUROHABER,
|
||||
empresa_id)
|
||||
SELECT vNewBookEntry,
|
||||
NEW.received,
|
||||
IF(c.id = 1,6260000002,
|
||||
IF(CEE = 1,6260000003,6260000004)),
|
||||
cuenta_banco,
|
||||
NEW.concept,
|
||||
NEW.bankingFees,
|
||||
0,
|
||||
NEW.companyFk
|
||||
FROM supplier s
|
||||
JOIN country c ON s.countryFk = c.id
|
||||
WHERE s.id = NEW.supplierFk;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
SET NEW.dueDated = IFNULL(NEW.dueDated, NEW.received);
|
||||
|
||||
SELECT isActive INTO isSupplierActive
|
||||
SELECT account INTO vSupplierAccount
|
||||
FROM supplier
|
||||
WHERE id = NEW.supplierFk;
|
||||
|
||||
IF isSupplierActive = FALSE THEN
|
||||
CALL util.throw('SUPPLIER_INACTIVE');
|
||||
END IF;
|
||||
|
||||
IF ISNULL(NEW.workerFk) THEN
|
||||
SET NEW.workerFk = account.myUser_getId();
|
||||
END IF;
|
||||
|
||||
END */;;
|
||||
|
||||
CALL ledger_next(YEAR(NEW.received), vNewBookEntry);
|
||||
|
||||
INSERT INTO XDiario (
|
||||
ASIEN,
|
||||
FECHA,
|
||||
SUBCTA,
|
||||
CONTRA,
|
||||
CONCEPTO,
|
||||
EURODEBE,
|
||||
EUROHABER,
|
||||
empresa_id)
|
||||
SELECT vNewBookEntry,
|
||||
NEW.received,
|
||||
SUBCTA,
|
||||
CONTRA,
|
||||
NEW.concept,
|
||||
EURODEBE,
|
||||
EUROHABER,
|
||||
NEW.companyFk
|
||||
FROM (SELECT vBankAccount SUBCTA,
|
||||
vSupplierAccount CONTRA,
|
||||
0 EURODEBE,
|
||||
NEW.amount + NEW.bankingFees EUROHABER
|
||||
UNION ALL
|
||||
SELECT vSupplierAccount SUBCTA,
|
||||
vBankAccount CONTRA,
|
||||
NEW.amount EURODEBE,
|
||||
0 EUROHABER) gf;
|
||||
|
||||
IF NEW.bankingFees <> 0 THEN
|
||||
INSERT INTO XDiario (
|
||||
ASIEN,
|
||||
FECHA,
|
||||
SUBCTA,
|
||||
CONTRA,
|
||||
CONCEPTO,
|
||||
EURODEBE,
|
||||
EUROHABER,
|
||||
empresa_id)
|
||||
SELECT vNewBookEntry,
|
||||
NEW.received,
|
||||
IF(c.id = 1,6260000002,
|
||||
IF(CEE = 1,6260000003,6260000004)),
|
||||
vBankAccount,
|
||||
NEW.concept,
|
||||
NEW.bankingFees,
|
||||
0,
|
||||
NEW.companyFk
|
||||
FROM supplier s
|
||||
JOIN country c ON s.countryFk = c.id
|
||||
WHERE s.id = NEW.supplierFk;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
SET NEW.dueDated = IFNULL(NEW.dueDated, NEW.received);
|
||||
|
||||
SELECT isActive INTO vIsSupplierActive
|
||||
FROM supplier
|
||||
WHERE id = NEW.supplierFk;
|
||||
|
||||
IF vIsSupplierActive = FALSE THEN
|
||||
CALL util.throw('SUPPLIER_INACTIVE');
|
||||
END IF;
|
||||
|
||||
IF ISNULL(NEW.workerFk) THEN
|
||||
SET NEW.workerFk = account.myUser_getId();
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
|
@ -7472,6 +7514,48 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`expeditionTruck_beforeInsert`
|
||||
BEFORE INSERT ON `roadmapStop` FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.description = UCASE(NEW.description);
|
||||
|
||||
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`.`expeditionTruck_beforeUpdate`
|
||||
BEFORE UPDATE ON `roadmapStop` FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.description = UCASE(NEW.description);
|
||||
|
||||
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`.`route_beforeInsert`
|
||||
BEFORE INSERT ON `route`
|
||||
FOR EACH ROW
|
||||
|
@ -8502,6 +8586,44 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplier_afterUpdate`
|
||||
BEFORE UPDATE ON `supplier`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF NEW.id <> OLD.id
|
||||
OR NOT (NEW.name <=> OLD.name)
|
||||
OR NOT (NEW.street <=> OLD.street)
|
||||
OR NOT (NEW.account <=> OLD.account)
|
||||
OR NOT (NEW.nif <=> OLD.nif)
|
||||
OR NOT (NEW.isVies <=> OLD.isVies)
|
||||
OR NOT (NEW.provinceFk <=> OLD.provinceFk)
|
||||
OR NOT (NEW.countryFk <=> OLD.countryFk)
|
||||
OR NOT (NEW.postCode <=> OLD.postCode)
|
||||
OR NOT (NEW.city <=> OLD.city)
|
||||
OR NOT (NEW.taxTypeSageFk <=> OLD.taxTypeSageFk)
|
||||
OR NOT (NEW.transactionTypeSageFk <=> OLD.transactionTypeSageFk)
|
||||
OR NOT (NEW.withholdingSageFk <=> OLD.withholdingSageFk) THEN
|
||||
|
||||
UPDATE sage.clientSupplier
|
||||
SET isSync = FALSE
|
||||
WHERE idClientSupplier IN (NEW.id, OLD.id)
|
||||
AND `type` = 'P';
|
||||
END IF;
|
||||
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`.`supplier_afterDelete`
|
||||
AFTER DELETE ON `supplier`
|
||||
FOR EACH ROW
|
||||
|
@ -8961,6 +9083,10 @@ BEGIN
|
|||
UPDATE expedition
|
||||
SET hasNewRoute = TRUE
|
||||
WHERE ticketFk = NEW.id;
|
||||
|
||||
IF NEW.cmrFk THEN
|
||||
CALL ticket_doCmr(NEW.id);
|
||||
END IF;
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -9318,7 +9444,6 @@ DELIMITER ;;
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
CALL ticketRefund_beforeUpsert(NEW.refundTicketFk, NEW.originalTicketFk);
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -9339,7 +9464,6 @@ DELIMITER ;;
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
CALL ticketRefund_beforeUpsert(NEW.refundTicketFk, NEW.originalTicketFk);
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -9655,11 +9779,6 @@ BEGIN
|
|||
`changedModel` = 'TicketTracking',
|
||||
`changedModelId` = OLD.id,
|
||||
`userFk` = account.myUser_getId();
|
||||
|
||||
CALL util.debugAdd('deletedState',
|
||||
CONCAT('interFk: ', OLD.id,
|
||||
' ticketFk: ', OLD.ticketFk,
|
||||
' stateFk: ', OLD.stateFk));
|
||||
|
||||
SELECT i.ticketFk, i.id, s.`name`
|
||||
INTO vTicketFk, vTicketTrackingFk, vStateName
|
||||
|
@ -9878,8 +9997,8 @@ BEGIN
|
|||
|
||||
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');
|
||||
IF NEW.awbFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.id);
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -9930,8 +10049,8 @@ BEGIN
|
|||
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');
|
||||
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.id);
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
|
@ -10805,4 +10924,4 @@ USE `vn2008`;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2024-05-14 6:26:46
|
||||
-- Dump completed on 2024-06-25 7:27:06
|
||||
|
|
|
@ -129,7 +129,7 @@ INSERT INTO vn.itemShelving (id,itemFk,visible,shelvingFk,`grouping`,packing,pac
|
|||
INSERT INTO vn.beach (code,warehouseFk) VALUES
|
||||
('TEST',1);
|
||||
|
||||
INSERT INTO vn.routesMonitor (routeFk,name,beachFk,m3,expeditionTruckFk) VALUES
|
||||
INSERT INTO vn.routesMonitor (routeFk,name,beachFk,m3,roadmapStopFk) VALUES
|
||||
(1,'TEST','TEST',1.0,1);
|
||||
/* #5483
|
||||
INSERT INTO vn.ticket (clientFk, warehouseFk, shipped, nickname, refFk, addressFk, workerFk, observations, isSigned, isLabeled, isPrinted, packages, location, `hour`, created, isBlocked, solution, routeFk, priority, hasPriority, companyFk, agencyModeFk, landed, isBoxed, isDeleted, zoneFk, zonePrice, zoneBonus, totalWithVat, totalWithoutVat, weight)
|
||||
|
|
|
@ -762,7 +762,12 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF
|
|||
(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),
|
||||
(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);
|
||||
(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),
|
||||
(34, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1103, 'BEJAR', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL),
|
||||
(35, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Somewhere in Philippines', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL),
|
||||
(36, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1102, 'Ant-Man Adventure', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL),
|
||||
(37, 1, 1, 1, 3, util.VN_CURDATE(), util.VN_CURDATE(), 1110, 'Deadpool swords', 123, NULL, 0, 1, 16, 0, util.VN_CURDATE(), NULL, NULL);
|
||||
|
||||
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
|
||||
VALUES
|
||||
(1, 11, 1, 'ready'),
|
||||
|
@ -808,7 +813,10 @@ INSERT INTO `vn`.`ticketTracking`(`ticketFk`, `stateFk`, `userFk`, `created`)
|
|||
(21, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
||||
(22, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)),
|
||||
(23, 16, 21, util.VN_NOW()),
|
||||
(24, 16, 21, util.VN_NOW());
|
||||
(24, 16, 21, util.VN_NOW()),
|
||||
(34, 14, 49, util.VN_NOW()),
|
||||
(35, 14, 18, util.VN_NOW()),
|
||||
(36, 14, 18, util.VN_NOW());
|
||||
|
||||
INSERT INTO `vn`.`deliveryPoint` (`id`, `name`, `ubication`)
|
||||
VALUES
|
||||
|
@ -831,9 +839,9 @@ INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`,
|
|||
INSERT INTO `vn`.`greugeType`(`id`, `name`, `code`)
|
||||
VALUES
|
||||
(1, 'Diff', 'diff'),
|
||||
(2, 'Recover', 'recover'),
|
||||
(2, 'Recovery', 'recovery'),
|
||||
(3, 'Mana', 'mana'),
|
||||
(4, 'Reclaim', 'reclaim'),
|
||||
(4, 'Claim', 'claim'),
|
||||
(5, 'Heritage', 'heritage'),
|
||||
(6, 'Miscellaneous', 'miscellaneous'),
|
||||
(7, 'Freight Pickup', 'freightPickUp');
|
||||
|
@ -1068,7 +1076,10 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
|
|||
(37, 4, 31, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(36, 4, 30, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
||||
(39, 1, 32, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE());
|
||||
(39, 1, 32, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(40, 2, 34, 'Melee weapon combat fist 15cm', 10.00, 3.91, 0, 0, 0, util.VN_CURDATE()),
|
||||
(41, 2, 35, 'Melee weapon combat fist 15cm', 8.00, 3.01, 0, 0, 0, util.VN_CURDATE()),
|
||||
(42, 2, 36, 'Melee weapon combat fist 15cm', 6.00, 2.50, 0, 0, 0, util.VN_CURDATE());
|
||||
|
||||
INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
||||
VALUES
|
||||
|
@ -1205,11 +1216,11 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
|||
(32, 36, -92.324),
|
||||
(32, 39, 0.994);
|
||||
|
||||
INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `visible`, `grouping`, `packing`, `userFk`)
|
||||
INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `visible`, `grouping`, `packing`,`buyFk`, `userFk`)
|
||||
VALUES
|
||||
(2, 'GVC', 1, 1, 1, 1106),
|
||||
(4, 'HEJ', 1, 1, 1, 1106),
|
||||
(1, 'UXN', 2, 12, 12, 1106);
|
||||
(2, 'GVC', 1, 1, 1, 2,1106),
|
||||
(4, 'HEJ', 1, 1, 1, NULL,1106),
|
||||
(1, 'UXN', 2, 12, 12, NULL,1106);
|
||||
|
||||
INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `created`, `userFk`)
|
||||
VALUES
|
||||
|
@ -1247,14 +1258,20 @@ INSERT INTO `vn`.`operator` (`workerFk`, `numberOfWagons`, `trainFk`, `itemPacki
|
|||
INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`)
|
||||
VALUES
|
||||
(1, 1106, 5, DATE_ADD(util.VN_CURDATE(),INTERVAL +1 DAY), 1),
|
||||
(2, 1106, 14, util.VN_CURDATE(), 1);
|
||||
(2, 1106, 14, util.VN_CURDATE(), 1),
|
||||
(4, 49, 5, util.VN_CURDATE(), 1),
|
||||
(5, 18, 5, util.VN_CURDATE(), 1),
|
||||
(6, 18, 5, util.VN_CURDATE(), 1);
|
||||
|
||||
INSERT INTO `vn`.`ticketCollection`(`ticketFk`, `collectionFk`, `level`)
|
||||
VALUES
|
||||
(1, 1, 1),
|
||||
(2, 1, NULL),
|
||||
(3, 2, NULL),
|
||||
(23, 1, NULL);
|
||||
(23, 1, NULL),
|
||||
(34, 4, 1),
|
||||
(35, 5, 1),
|
||||
(8, 6, 1);
|
||||
|
||||
INSERT INTO `vn`.`genus`(`id`, `name`)
|
||||
VALUES
|
||||
|
@ -1868,9 +1885,9 @@ INSERT INTO `vn`.`claimEnd`(`id`, `saleFk`, `claimFk`, `workerFk`, `claimDestina
|
|||
(1, 31, 4, 21, 2),
|
||||
(2, 32, 3, 21, 3);
|
||||
|
||||
INSERT INTO `vn`.`claimConfig`(`id`, `maxResponsibility`)
|
||||
INSERT INTO `vn`.`claimConfig`(`id`, `maxResponsibility`, `monthsToRefund`, `minShipped`)
|
||||
VALUES
|
||||
(1, 50);
|
||||
(1, 5, 4, '2016-10-01');
|
||||
|
||||
INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`)
|
||||
VALUES
|
||||
|
@ -2549,18 +2566,18 @@ INSERT INTO `vn`.`duaEntry` (`duaFk`, `entryFk`, `value`, `customsValue`, `euroV
|
|||
(7, 7, 1.00, 1.00, 1.00),
|
||||
(8, 8, 1.00, 1.00, 1.00);
|
||||
|
||||
REPLACE INTO `vn`.`invoiceIn`(`id`, `serialNumber`,`serial`, `supplierFk`, `issued`, `created`, `supplierRef`, `isBooked`, `companyFk`, `docFk`)
|
||||
REPLACE INTO `vn`.`invoiceIn`(`id`, `serialNumber`,`serial`, `supplierFk`, `issued`, `created`, `supplierRef`, `isBooked`, `companyFk`, `docFk`, `bookEntried`)
|
||||
VALUES
|
||||
(1, 1001, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1234, 0, 442, 1),
|
||||
(2, 1002, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1235, 0, 442, 1),
|
||||
(3, 1003, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1236, 0, 442, 1),
|
||||
(4, 1004, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1237, 0, 442, 1),
|
||||
(5, 1005, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1238, 0, 442, 1),
|
||||
(6, 1006, 'R', 2, util.VN_CURDATE(), util.VN_CURDATE(), 1239, 0, 442, 1),
|
||||
(7, 1007, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1240, 0, 442, 1),
|
||||
(8, 1008, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1241, 0, 442, 1),
|
||||
(9, 1009, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1242, 0, 442, 1),
|
||||
(10, 1010, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1243, 0, 442, 1);
|
||||
(1, 1001, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1234, 0, 442, 1,util.VN_CURDATE()),
|
||||
(2, 1002, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1235, 0, 442, 1,util.VN_CURDATE()),
|
||||
(3, 1003, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1236, 0, 442, 1,util.VN_CURDATE()),
|
||||
(4, 1004, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1237, 0, 442, 1,util.VN_CURDATE()),
|
||||
(5, 1005, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1238, 0, 442, 1,util.VN_CURDATE()),
|
||||
(6, 1006, 'R', 2, util.VN_CURDATE(), util.VN_CURDATE(), 1239, 0, 442, 1,util.VN_CURDATE()),
|
||||
(7, 1007, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1240, 0, 442, 1,util.VN_CURDATE()),
|
||||
(8, 1008, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1241, 0, 442, 1,util.VN_CURDATE()),
|
||||
(9, 1009, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1242, 0, 442, 1,util.VN_CURDATE()),
|
||||
(10, 1010, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1243, 0, 442, 1,util.VN_CURDATE());
|
||||
|
||||
INSERT INTO `vn`.`invoiceInConfig` (`id`, `retentionRate`, `retentionName`, `sageFarmerWithholdingFk`, `daysAgo`)
|
||||
VALUES
|
||||
|
@ -2670,13 +2687,20 @@ INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`)
|
|||
(3, 6, 5),
|
||||
(4, 7, 1);
|
||||
|
||||
INSERT INTO `vn`.`roadmapAddress` (`addressFk`)
|
||||
VALUES
|
||||
(1),
|
||||
(2),
|
||||
(3),
|
||||
(4);
|
||||
|
||||
INSERT INTO `vn`.`roadmap` (`id`, `name`, `tractorPlate`, `trailerPlate`, `phone`, `supplierFk`, `etd`, `observations`, `userFk`, `price`, `driverName`)
|
||||
VALUES
|
||||
(1, 'val-algemesi', 'RE-001', 'PO-001', '111111111', 1, util.VN_NOW(), 'this is test observation', 1, 15, 'Batman'),
|
||||
(2, 'alg-valencia', 'RE-002', 'PO-002', '111111111', 1, util.VN_NOW(), 'test observation', 1, 20, 'Robin'),
|
||||
(3, 'alz-algemesi', 'RE-003', 'PO-003', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 2 DAY), 'observations...', 2, 25, 'Driverman');
|
||||
(1, 'val-algemesi', '1234-BCD', '9876-BCD', '111111111', 1, util.VN_NOW(), 'this is test observation', 1, 15, 'Batman'),
|
||||
(2, 'alg-valencia', '2345-CDF', '8765-BCD', '111111111', 1, util.VN_NOW(), 'test observation', 1, 20, 'Robin'),
|
||||
(3, 'alz-algemesi', '3456-DFG', '7654-BCD', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 2 DAY), 'observations...', 2, 25, 'Driverman');
|
||||
|
||||
INSERT INTO `vn`.`expeditionTruck` (`id`, `roadmapFk`, `warehouseFk`, `eta`, `description`, `userFk`)
|
||||
INSERT INTO `vn`.`roadmapStop` (`id`, `roadmapFk`, `addressFk`, `eta`, `description`, `userFk`)
|
||||
VALUES
|
||||
(1, 1, 1, DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY), 'Best truck in fleet', 1),
|
||||
(2, 1, 2, DATE_ADD(util.VN_NOW(), INTERVAL '1 2' DAY_HOUR), 'Second truck in fleet', 1),
|
||||
|
@ -2844,7 +2868,8 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
|||
(5, 'modified-entry', 'An entry has been modified'),
|
||||
(6, 'book-entry-deleted', 'accounting entries deleted'),
|
||||
(7, 'zone-included','An email to notify zoneCollisions'),
|
||||
(8, 'backup-printer-selected','A backup printer has been selected');
|
||||
(8, 'backup-printer-selected','A backup printer has been selected'),
|
||||
(9, 'mrw-deadline','The MRW deadline has passed');
|
||||
|
||||
TRUNCATE `util`.`notificationAcl`;
|
||||
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
||||
|
@ -2857,7 +2882,8 @@ INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
|||
(5, 9),
|
||||
(6, 9),
|
||||
(7, 9),
|
||||
(8, 66);
|
||||
(8, 66),
|
||||
(9, 56);
|
||||
|
||||
TRUNCATE `util`.`notificationQueue`;
|
||||
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
|
||||
|
@ -3102,6 +3128,18 @@ INSERT INTO `vn`.`entryDms`(`entryFk`, `dmsFk`, `editorFk`)
|
|||
VALUES
|
||||
(1, 9, 9);
|
||||
|
||||
INSERT INTO vn.entryType (code,description,isInformal)
|
||||
VALUES ('devaluation','Devaluation',0),
|
||||
('internal','Internal',1),
|
||||
('inventory','Inventory',1),
|
||||
('life','Life',1),
|
||||
('packaging','Packaging',0),
|
||||
('payment','Refund',0),
|
||||
('product','Product',0),
|
||||
('regularization','Regularization',1),
|
||||
('return','Return',0),
|
||||
('transport','Delivery',0);
|
||||
|
||||
INSERT INTO `vn`.`cmr` (id,truckPlate,observations,senderInstruccions,paymentInstruccions,specialAgreements,companyFk,addressToFk,addressFromFk,supplierFk,packagesList,merchandiseDetail,state)
|
||||
VALUES (1,'123456A','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',442,1,2,1,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
||||
(2,'123456N','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',69,3,4,2,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
||||
|
@ -3194,7 +3232,6 @@ INSERT IGNORE INTO vn.itemType
|
|||
workerFk = 103,
|
||||
isInventory = TRUE,
|
||||
life = 10,
|
||||
density = 250,
|
||||
itemPackingTypeFk = NULL,
|
||||
temperatureFk = 'warm';
|
||||
|
||||
|
@ -3705,7 +3742,8 @@ INSERT IGNORE INTO vn.saleGroup
|
|||
SET id = 4,
|
||||
userFk = 1,
|
||||
parkingFk = 9,
|
||||
sectorFk = 9992;
|
||||
sectorFk = 9992,
|
||||
ticketFk = 36;
|
||||
|
||||
INSERT IGNORE INTO vn.sectorCollectionSaleGroup
|
||||
SET id = 9999,
|
||||
|
@ -3788,7 +3826,88 @@ INSERT INTO vn.workerTeam(id, team, workerFk)
|
|||
VALUES
|
||||
(8, 1, 19);
|
||||
|
||||
INSERT INTO vn.workCenter (id, name, payrollCenterFk, counter, warehouseFk, street, geoFk, deliveryManAdjustment)
|
||||
INSERT INTO vn.workCenter (id, name, payrollCenterFk, counter, warehouseFk, street, geoFk, deliveryManAdjustment)
|
||||
VALUES(100, 'workCenterOne', 1, NULL, 1, 'gotham', NULL, NULL);
|
||||
|
||||
UPDATE vn.locker SET workerFk = 1110 WHERE id = 147;
|
||||
INSERT INTO `vn`.`locker` (code, gender, workerFk) VALUES
|
||||
('1M', 'M', 1),
|
||||
('2M', 'M', 9),
|
||||
('3M', 'M', NULL),
|
||||
('4M', 'M', NULL),
|
||||
('1F', 'F', 1110),
|
||||
('2F', 'F', NULL),
|
||||
('3F', 'F', NULL),
|
||||
('4F', 'F', NULL);
|
||||
|
||||
INSERT INTO `vn`.`ledgerCompany` SET
|
||||
fiscalYear = YEAR(util.VN_CURDATE()),
|
||||
bookEntry = 2;
|
||||
|
||||
INSERT INTO `vn`.`ledgerConfig` SET
|
||||
maxTolerance = 0.01;
|
||||
|
||||
|
||||
INSERT INTO vn.trainingCourse (workerFk,trainingCourseTypeFk,centerFk,started,ended,hasDiscount,hasDiploma)
|
||||
VALUES
|
||||
(9,2,1,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',0,1),
|
||||
(9,1,2,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',1,0),
|
||||
(9,2,2,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',1,1);
|
||||
|
||||
INSERT INTO vn.sectorCollection
|
||||
SET id = 2,
|
||||
userFk = 18,
|
||||
sectorFk = 1;
|
||||
|
||||
INSERT INTO vn.sectorCollectionSaleGroup
|
||||
SET id = 8,
|
||||
sectorCollectionFk = 2,
|
||||
saleGroupFk = 4;
|
||||
|
||||
INSERT INTO vn.saleGroup (userFk, parkingFk, sectorFk, ticketFk)
|
||||
VALUES
|
||||
(1, 1, 1, 37);
|
||||
|
||||
INSERT INTO vn.sectorCollection
|
||||
SET id = 3,
|
||||
userFk = 18,
|
||||
sectorFk = 1;
|
||||
|
||||
INSERT INTO vn.sectorCollectionSaleGroup
|
||||
SET id = 9,
|
||||
sectorCollectionFk = 3,
|
||||
saleGroupFk = 6;
|
||||
|
||||
|
||||
INSERT INTO `vn`.`calendarHolidays` (calendarHolidaysTypeFk, dated, calendarHolidaysNameFk, workCenterFk)
|
||||
VALUES
|
||||
(1, '2001-05-08', 1, 1),
|
||||
(1, '2001-05-09', 1, 1),
|
||||
(1, '2001-05-10', 1, 1),
|
||||
(1, '2001-05-11', 1, 1),
|
||||
(1, '2001-05-14', 1, 5),
|
||||
(1, '2001-05-15', 1, 5),
|
||||
(1, '2001-05-16', 1, 5),
|
||||
(1, '2001-05-17', 1, 5),
|
||||
(1, '2001-05-18', 1, 5);
|
||||
|
||||
INSERT INTO vn.payrollComponent
|
||||
(id, name, isSalaryAgreed, isVariable, isException)
|
||||
VALUES
|
||||
(1, 'Salario1', 1, 0, 0),
|
||||
(2, 'Salario2', 1, 1, 0),
|
||||
(3, 'Salario3', 1, 0, 1);
|
||||
|
||||
|
||||
INSERT INTO vn.workerIncome
|
||||
(debit, credit, incomeTypeFk, paymentDate, workerFk, concept)
|
||||
VALUES
|
||||
(1000.00, 900.00, 2, '2000-01-01', 1106, NULL),
|
||||
(1001.00, 800.00, 2, '2000-01-01', 1106, NULL);
|
||||
|
||||
|
||||
INSERT INTO dipole.printer (id, description)
|
||||
VALUES(1, '');
|
||||
|
||||
INSERT INTO dipole.expedition_PrintOut (expeditionFk, ticketFk, addressFk, street, postalCode, city, shopName, isPrinted, created, printerFk, routeFk, parkingCode,
|
||||
truckName, clientFk, phone, province, agency, m3, workerCode, itemFk, quantity, longName, shelvingFk, comments)
|
||||
VALUES(1, 1, 0, ' ', ' ', ' ', ' ', 0, '2001-01-01 00:00:00', 1, 0, ' ', ' ', 0, NULL, '', NULL, 0.000, NULL, 10, NULL, NULL, 'NCC', NULL);
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_afterDelete`
|
||||
AFTER DELETE ON `mailAliasAccount`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO userLog
|
||||
SET `action` = 'delete',
|
||||
`changedModel` = 'MailAliasAccount',
|
||||
`changedModelId` = OLD.id,
|
||||
`userFk` = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeInsert`
|
||||
BEFORE INSERT ON `mailAliasAccount`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeUpdate`
|
||||
BEFORE UPDATE ON `mailAliasAccount`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,166 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bi`.`claim_ratio_routine`()
|
||||
BEGIN
|
||||
DECLARE vMonthToRefund INT DEFAULT 4;
|
||||
|
||||
/*
|
||||
* PAK 2015-11-20
|
||||
* Se trata de añadir a la tabla Greuges todos los
|
||||
* cargos que luego vamos a utilizar para calcular el recobro
|
||||
*/
|
||||
|
||||
-- Reclamaciones demasiado sensibles
|
||||
|
||||
INSERT INTO vn.greuge(shipped, clientFk, description,
|
||||
amount, greugeTypeFk, ticketFk)
|
||||
SELECT c.ticketCreated
|
||||
, c.clientFk
|
||||
, concat('Claim ', c.id,' : ', s.concept)
|
||||
,round( -1 * ((c.responsibility -1)/4) * s.quantity *
|
||||
s.price * (100 - s.discount) / 100, 2)
|
||||
, 4
|
||||
, s.ticketFk
|
||||
FROM vn.sale s
|
||||
JOIN vn.claimEnd ce ON ce.saleFk = s.id
|
||||
JOIN vn.claim c ON c.id = ce.claimFk
|
||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
||||
AND NOT ce.isGreuge
|
||||
AND c.claimStateFk = 3;
|
||||
|
||||
-- Reclamaciones que pasan a Maná
|
||||
|
||||
INSERT INTO vn.greuge(shipped, clientFk, description,
|
||||
amount, greugeTypeFk, ticketFk)
|
||||
SELECT c.ticketCreated
|
||||
, c.clientFk
|
||||
, concat('Claim_mana ',c.id,' : ', s.concept)
|
||||
,round( ((c.responsibility -1)/4) * s.quantity * s.price * (100 - s.discount) / 100, 2)
|
||||
,3
|
||||
,s.ticketFk
|
||||
FROM vn.sale s
|
||||
JOIN vn.claimEnd ce ON ce.saleFk = s.id
|
||||
JOIN vn.claim c ON c.id = ce.claimFk
|
||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
||||
AND NOT ce.isGreuge
|
||||
AND c.claimStateFk = 3
|
||||
AND c.isChargedToMana;
|
||||
|
||||
-- Marcamos para no repetir
|
||||
UPDATE vn.claimEnd ce
|
||||
JOIN vn.claim c ON c.id = ce.claimFk
|
||||
SET c.isChargedToMana = TRUE
|
||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
||||
AND NOT ce.isGreuge
|
||||
AND c.claimStateFk = 3;
|
||||
|
||||
-- Recobros
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list;
|
||||
CREATE TEMPORARY TABLE tmp.ticket_list
|
||||
(PRIMARY KEY (Id_Ticket))
|
||||
SELECT DISTINCT t.id Id_Ticket
|
||||
FROM vn.saleComponent sc
|
||||
JOIN vn.sale s ON sc.saleFk = s.id
|
||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||
JOIN vn.ticketLastState ts ON ts.ticketFk = t.id
|
||||
JOIN vn.ticketTracking tt ON tt.id = ts.ticketTrackingFk
|
||||
JOIN vn.state st ON st.id = tt.stateFk
|
||||
WHERE sc.componentFk = 17
|
||||
AND sc.isGreuge = 0
|
||||
AND t.shipped >= '2016-10-01'
|
||||
AND t.shipped < util.VN_CURDATE()
|
||||
AND st.alertLevel >= 3;
|
||||
|
||||
DELETE g.*
|
||||
FROM vn.greuge g
|
||||
JOIN tmp.ticket_list t ON g.ticketFk = t.Id_Ticket
|
||||
WHERE g.greugeTypeFk = 2;
|
||||
|
||||
INSERT INTO vn.greuge(clientFk, description, amount,shipped,
|
||||
greugeTypeFk, ticketFk)
|
||||
SELECT t.clientFk
|
||||
,concat('recobro ', s.ticketFk), - round(SUM(sc.value*s.quantity),2)
|
||||
AS dif,
|
||||
date(t.shipped)
|
||||
, 2
|
||||
,tt.Id_Ticket
|
||||
FROM vn.sale s
|
||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||
JOIN tmp.ticket_list tt ON tt.Id_Ticket = t.id
|
||||
JOIN vn.saleComponent sc
|
||||
ON sc.saleFk = s.id AND sc.componentFk = 17
|
||||
GROUP BY t.id
|
||||
HAVING ABS(dif) > 1;
|
||||
|
||||
UPDATE vn.saleComponent sc
|
||||
JOIN vn.sale s ON s.id = sc.saleFk
|
||||
JOIN tmp.ticket_list tt ON tt.Id_Ticket = s.ticketFk
|
||||
SET sc.isGreuge = 1
|
||||
WHERE sc.componentFk = 17;
|
||||
|
||||
/*
|
||||
* Recalculamos la ratio de las reclamaciones, que luego
|
||||
* se va a utilizar en el recobro
|
||||
*/
|
||||
|
||||
REPLACE bi.claims_ratio(Id_Cliente, Consumo, Reclamaciones, Ratio, recobro)
|
||||
SELECT id, 0,0,0,0
|
||||
FROM vn.client;
|
||||
|
||||
REPLACE bi.claims_ratio(Id_Cliente, Consumo, Reclamaciones, Ratio, recobro)
|
||||
SELECT fm.Id_Cliente, 12 * fm.Consumo, Reclamaciones,
|
||||
round(Reclamaciones / (12*fm.Consumo),4), 0
|
||||
FROM bi.facturacion_media_anual fm
|
||||
LEFT JOIN(
|
||||
SELECT c.clientFk, round(sum(-1 * ((c.responsibility -1)/4) *
|
||||
s.quantity * s.price * (100 - s.discount) / 100))
|
||||
AS Reclamaciones
|
||||
FROM vn.sale s
|
||||
JOIN vn.claimEnd ce ON ce.saleFk = s.id
|
||||
JOIN vn.claim c ON c.id = ce.claimFk
|
||||
WHERE ce.claimDestinationFk NOT IN (1,5)
|
||||
AND c.claimStateFk = 3
|
||||
AND c.ticketCreated >= TIMESTAMPADD(YEAR, -1, util.VN_CURDATE())
|
||||
GROUP BY c.clientFk
|
||||
) claims ON claims.clientFk = fm.Id_Cliente;
|
||||
|
||||
|
||||
-- Calculamos el porcentaje del recobro para añadirlo al precio de venta
|
||||
UPDATE bi.claims_ratio cr
|
||||
JOIN (
|
||||
SELECT clientFk Id_Cliente, IFNULL(SUM(amount), 0) AS Greuge
|
||||
FROM vn.greuge
|
||||
WHERE shipped <= util.VN_CURDATE()
|
||||
GROUP BY clientFk
|
||||
) g ON g.Id_Cliente = cr.Id_Cliente
|
||||
SET recobro = GREATEST(0,round(IFNULL(Greuge, 0) /
|
||||
(IFNULL(Consumo, 0) * vMonthToRefund / 12 ) ,3));
|
||||
|
||||
-- Protección neonatos
|
||||
UPDATE bi.claims_ratio cr
|
||||
JOIN vn.firstTicketShipped fts ON fts.clientFk = cr.Id_Cliente
|
||||
SET recobro = 0, Ratio = 0
|
||||
WHERE fts.shipped > TIMESTAMPADD(MONTH,-1,util.VN_CURDATE());
|
||||
|
||||
-- CLIENTE 7983, JULIAN SUAU
|
||||
UPDATE bi.claims_ratio SET recobro = LEAST(0.05, recobro) WHERE Id_Cliente = 7983;
|
||||
|
||||
-- CLIENTE 4358
|
||||
UPDATE bi.claims_ratio SET recobro = GREATEST(0.05, recobro) WHERE Id_Cliente = 4358;
|
||||
|
||||
-- CLIENTE 5523, VERDECORA
|
||||
UPDATE bi.claims_ratio SET recobro = GREATEST(0.12, recobro) WHERE Id_Cliente = 5523;
|
||||
|
||||
-- CLIENTE 15979, SERVEIS VETERINARIS
|
||||
UPDATE bi.claims_ratio SET recobro = GREATEST(0.05, recobro) WHERE Id_Cliente = 15979;
|
||||
|
||||
-- CLIENTE 5189 i 8942, son de CSR i son el mateix client
|
||||
UPDATE bi.claims_ratio cr
|
||||
JOIN (SELECT sum(Consumo * recobro)/sum(Consumo) as recobro
|
||||
FROM bi.claims_ratio
|
||||
WHERE Id_Cliente IN ( 5189,8942)
|
||||
) sub
|
||||
SET cr.recobro = sub.recobro
|
||||
WHERE Id_Cliente IN ( 5189,8942);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -59,7 +59,7 @@ BEGIN
|
|||
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
||||
JOIN vn.component c ON c.id = sc.componentFk
|
||||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||
WHERE ct.code = 'FREIGHT'
|
||||
WHERE ct.code = 'freight'
|
||||
AND r.created BETWEEN vDatedFrom AND vDatedTo
|
||||
GROUP BY r.id
|
||||
) sub ON sub.routeFk = r.Id_Ruta
|
||||
|
|
|
@ -2,7 +2,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|||
SQL SECURITY DEFINER
|
||||
VIEW `bi`.`tarifa_componentes_series`
|
||||
AS SELECT `ct`.`id` AS `tarifa_componentes_series_id`,
|
||||
`ct`.`type` AS `Serie`,
|
||||
`ct`.`name` AS `Serie`,
|
||||
`ct`.`isBase` AS `base`,
|
||||
`ct`.`isMargin` AS `margen`
|
||||
FROM `vn`.`componentType` `ct`
|
||||
|
|
|
@ -117,7 +117,7 @@ proc: BEGIN
|
|||
)sub
|
||||
GROUP BY sub.itemFk;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, tItemRange;
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, tItemRange, tmp.itemList;
|
||||
CALL cache_calc_end (vCalc);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -121,7 +121,7 @@ proc: BEGIN
|
|||
)sub
|
||||
GROUP BY sub.itemFk;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, itemRange;
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, itemRange, tmp.itemList;
|
||||
CALL cache_calc_end (vCalc);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -46,7 +46,7 @@ BEGIN
|
|||
JOIN vn.address a ON a.id = t.addressFk
|
||||
JOIN vn.province p ON p.id = a.provinceFk
|
||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
||||
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.roadmapStopFk
|
||||
LEFT JOIN vn.beach b ON b.code = rm.beachFk
|
||||
LEFT JOIN vn.`zone`z ON z.id = t.zoneFk
|
||||
JOIN vn.agencyMode am ON t.agencyModeFk = am.id
|
||||
|
|
|
@ -7,7 +7,6 @@ BEGIN
|
|||
*/
|
||||
DECLARE vRewriteKop INT DEFAULT NULL;
|
||||
DECLARE vTruncatePutOrder INT DEFAULT NULL;
|
||||
DECLARE vBarcode CHAR(15) DEFAULT NULL;
|
||||
DECLARE vKop INT;
|
||||
DECLARE vPutOrderFk BIGINT;
|
||||
|
||||
|
@ -16,17 +15,6 @@ BEGIN
|
|||
FROM ekt
|
||||
WHERE id = vSelf;
|
||||
|
||||
-- Generates the barcode
|
||||
|
||||
SELECT CONCAT(
|
||||
LPAD(IFNULL(auction,0), 3, 0),
|
||||
LPAD(IFNULL(klo, 99), 2, 0),
|
||||
LPAD(DAYOFYEAR(fec), 3, 0),
|
||||
COALESCE(agj, RIGHT(batchNumber,7), id))
|
||||
INTO vBarcode
|
||||
FROM ekt
|
||||
WHERE id = vSelf;
|
||||
|
||||
-- Rewrites the kop parameter
|
||||
|
||||
IF vKop IS NULL THEN
|
||||
|
@ -46,10 +34,9 @@ BEGIN
|
|||
|
||||
-- Refresh EKT
|
||||
|
||||
UPDATE ekt SET
|
||||
barcode = vBarcode
|
||||
,kop = vKop
|
||||
,putOrderFk = vTruncatePutOrder
|
||||
UPDATE ekt
|
||||
SET kop = vKop,
|
||||
putOrderFk = vTruncatePutOrder
|
||||
WHERE id = vSelf;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -2,7 +2,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|||
SQL SECURITY DEFINER
|
||||
VIEW `edi`.`ektRecent`
|
||||
AS SELECT `e`.`id` AS `id`,
|
||||
`e`.`barcode` AS `barcode`,
|
||||
`e`.`entryYear` AS `entryYear`,
|
||||
`e`.`batchNumber` AS `batchNumber`,
|
||||
`e`.`deliveryNumber` AS `deliveryNumber`,
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
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 ;
|
|
@ -1,16 +1,15 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.catalogue_get;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.catalogue_get(vLanded DATE, vPostalCode VARCHAR(15))
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE floranet.catalogue_get(vLanded DATE, vPostalCode VARCHAR(15))
|
||||
READS SQL DATA
|
||||
proc:BEGIN
|
||||
/**
|
||||
* Returns list, price and all the stuff regarding the floranet items.
|
||||
* Returns list, price and all the stuff regarding the floranet items, for the designed shop
|
||||
*
|
||||
* @param vLanded Delivery date
|
||||
* @param vPostalCode Delivery address postal code
|
||||
*/
|
||||
DECLARE vAddressFk INT;
|
||||
DECLARE vLastCatalogueFk INT;
|
||||
DECLARE vLockName VARCHAR(20);
|
||||
DECLARE vLockTime INT;
|
||||
|
@ -21,7 +20,7 @@ proc:BEGIN
|
|||
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
|
||||
SET vLockName = 'catalogue_get';
|
||||
SET vLockTime = 15;
|
||||
|
||||
|
@ -32,6 +31,15 @@ proc:BEGIN
|
|||
SELECT MAX(id) INTO vLastCatalogueFk
|
||||
FROM catalogue;
|
||||
|
||||
SELECT addressFk
|
||||
INTO vAddressFk
|
||||
FROM addressPostCode apc
|
||||
WHERE apc.dayOfWeek = dayOfWeek(vLanded)
|
||||
AND NOW() < vLanded - INTERVAL apc.hoursInAdvance HOUR
|
||||
AND apc.postCode = vPostalCode
|
||||
-- Aquí hay que incluir los criterios de selección de tienda
|
||||
LIMIT 1;
|
||||
|
||||
INSERT INTO catalogue(
|
||||
name,
|
||||
price,
|
||||
|
@ -40,19 +48,25 @@ proc:BEGIN
|
|||
postalCode,
|
||||
`type`,
|
||||
image,
|
||||
description
|
||||
description,
|
||||
addressFk
|
||||
)
|
||||
SELECT i.name,
|
||||
i.`size`,
|
||||
i.id,
|
||||
SELECT CONCAT(i.name, ' by ',a.nickname),
|
||||
r.price + apc.deliveryCost,
|
||||
r.itemFk,
|
||||
vLanded,
|
||||
vPostalCode,
|
||||
it.name,
|
||||
CONCAT('https://cdn.verdnatura.es/image/catalog/1600x900/', i.image),
|
||||
i.description
|
||||
i.description,
|
||||
vAddressFk
|
||||
FROM vn.item i
|
||||
JOIN (SELECT itemFk, SUM(quantity * cost) price
|
||||
FROM recipe
|
||||
GROUP BY itemFk) r ON r.itemFk = i.id
|
||||
JOIN vn.itemType it ON it.id = i.typeFk
|
||||
WHERE it.code IN ('FNR','FNP');
|
||||
JOIN addressPostCode apc ON addressFk = vAddressFk
|
||||
JOIN vn.address a ON a.id = vAddressFk;
|
||||
|
||||
SELECT *
|
||||
FROM catalogue
|
||||
|
|
|
@ -13,8 +13,17 @@ BEGIN
|
|||
/**
|
||||
* Set actions for contact request
|
||||
*
|
||||
* @param vPostalCode Delivery address postal code
|
||||
* @param vName Name
|
||||
* @param vPhone Phone number
|
||||
* @param vEmail e-mail
|
||||
* @param vMessage text of the message
|
||||
*/
|
||||
|
||||
|
||||
CALL vn.mail_insert(
|
||||
'floranet@verdnatura.es',
|
||||
vEmail,
|
||||
'Contact request',
|
||||
CONCAT('Phone: ',vPhone, ' Message: ', vMessage)
|
||||
);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,8 +1,6 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.deliveryDate_get;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `floranet`.`deliveryDate_get`(vPostalCode VARCHAR(15))
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `floranet`.`deliveryDate_get`(vPostalCode VARCHAR(15))
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
|
@ -21,7 +19,7 @@ BEGIN
|
|||
apc.dayOfWeek - vCurrentDayOfWeek,
|
||||
7 - apc.dayOfWeek
|
||||
) DAY nextDay,
|
||||
NOW() + INTERVAL apc.hoursInAdvance - 12 HOUR minDeliveryTime
|
||||
NOW() + INTERVAL apc.hoursInAdvance HOUR minDeliveryTime
|
||||
FROM addressPostCode apc
|
||||
WHERE apc.postCode = vPostalCode
|
||||
HAVING nextDay > minDeliveryTime) sub;
|
||||
|
|
|
@ -1,25 +1,167 @@
|
|||
DROP PROCEDURE IF EXISTS floranet.order_confirm;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
|
||||
CREATE DEFINER=`root`@`localhost`PROCEDURE floranet.order_confirm(vCatalogueFk INT)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost`PROCEDURE floranet.order_confirm(vCatalogueFk INT)
|
||||
READS SQL DATA
|
||||
|
||||
BEGIN
|
||||
/** Update order.isPaid field.
|
||||
proc:BEGIN
|
||||
/** Update order.isPaid field, and makes the ticket
|
||||
*
|
||||
* @param vCatalogueFk floranet.catalogue.id
|
||||
*
|
||||
* @returns floranet.order.isPaid
|
||||
*/
|
||||
DECLARE vNewTicketFk INT;
|
||||
DECLARE vCustomerEmail VARCHAR(255);
|
||||
DECLARE vFloranetEmail VARCHAR(255);
|
||||
DECLARE vSubjectEmail VARCHAR(100);
|
||||
DECLARE vBodyEmail TEXT;
|
||||
DECLARE vZoneFk INT;
|
||||
|
||||
DECLARE exit handler FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
ROLLBACK;
|
||||
|
||||
GET DIAGNOSTICS CONDITION 2 @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
|
||||
|
||||
SELECT CONCAT('ERROR ', IFNULL(@errno,0), ': ', ifnull(@text,'texto')) AS `SQLEXCEPTION`;
|
||||
|
||||
CALL vn.mail_insert(
|
||||
'floranet@verdnatura.es,pako@verdnatura.es',
|
||||
'noreply@verdnatura.es',
|
||||
'Floranet.order_confirm failure',
|
||||
CONCAT('CatalogueFk: ', vCatalogueFk, '\n','ERROR ', IFNULL(@errno, 0), ': ', ifnull(@text, 'texto'))
|
||||
);
|
||||
END;
|
||||
|
||||
IF (SELECT isPaid FROM `order` WHERE catalogueFk = vCatalogueFk) THEN
|
||||
SELECT CONCAT('CatalogueFk: ', vCatalogueFk, ' Esta orden ya está confirmada') AS `ERROR`;
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
UPDATE `order`
|
||||
SET isPaid = TRUE,
|
||||
payed = NOW()
|
||||
WHERE catalogueFk = vCatalogueFk;
|
||||
|
||||
SELECT isPaid
|
||||
SELECT zoneFk
|
||||
INTO vZoneFk
|
||||
FROM (
|
||||
SELECT zoneFk, COUNT(*) totalCount
|
||||
FROM vn.ticket t
|
||||
JOIN catalogue c ON c.id = vCatalogueFk
|
||||
WHERE t.shipped > util.VN_CURDATE() - INTERVAL 1 YEAR
|
||||
AND t.addressFk = c.addressFk
|
||||
GROUP BY zoneFk
|
||||
ORDER BY totalCount DESC
|
||||
LIMIT 10000000000000000000
|
||||
) sub
|
||||
LIMIT 1;
|
||||
|
||||
INSERT INTO vn.ticket (
|
||||
clientFk,
|
||||
shipped,
|
||||
addressFk,
|
||||
agencyModeFk,
|
||||
nickname,
|
||||
warehouseFk,
|
||||
routeFk,
|
||||
companyFk,
|
||||
landed,
|
||||
zoneFk
|
||||
)
|
||||
SELECT a.clientFk,
|
||||
c.dated - INTERVAL 1 DAY,
|
||||
c.addressFk,
|
||||
a.agencyModeFk,
|
||||
a.nickname,
|
||||
ag.warehouseFk,
|
||||
NULL,
|
||||
co.id,
|
||||
c.dated,
|
||||
vZoneFk
|
||||
FROM vn.address a
|
||||
JOIN vn.agencyMode am ON am.id = a.agencyModeFk
|
||||
JOIN vn.agency ag ON ag.id = am.agencyFk
|
||||
JOIN catalogue c ON c.addressFk = a.id
|
||||
JOIN vn.company co ON co.code = 'VNL'
|
||||
WHERE c.id = vCatalogueFk;
|
||||
|
||||
SET vNewTicketFk = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO vn.sale(
|
||||
ticketFk,
|
||||
itemFk,
|
||||
concept,
|
||||
price,
|
||||
quantity)
|
||||
SELECT
|
||||
vNewTicketFk,
|
||||
c.itemFk,
|
||||
CONCAT('Entrega: ',c.name),
|
||||
- apc.deliveryCost,
|
||||
1
|
||||
FROM catalogue c
|
||||
JOIN addressPostCode apc
|
||||
ON apc.addressFk = c.addressFk
|
||||
AND apc.dayOfWeek = dayOfWeek(c.dated)
|
||||
WHERE c.id = vCatalogueFk;
|
||||
|
||||
INSERT INTO vn.sale(
|
||||
ticketFk,
|
||||
itemFk,
|
||||
concept,
|
||||
price,
|
||||
quantity)
|
||||
SELECT
|
||||
vNewTicketFk,
|
||||
r.elementFk,
|
||||
i.longName,
|
||||
0,
|
||||
r.quantity
|
||||
FROM catalogue c
|
||||
JOIN recipe r ON r.itemFk = c.itemFk
|
||||
JOIN vn.item i ON i.id = r.elementFk
|
||||
WHERE c.id = vCatalogueFk;
|
||||
|
||||
SELECT cl.email,
|
||||
cf.email,
|
||||
CONCAT('Nuevo pedido FLORANET para entrega el ',c.dated),
|
||||
CONCAT_WS('\n',
|
||||
CONCAT('Producto: ', c.name),
|
||||
CONCAT('Fecha de entrega: ',c.dated),
|
||||
CONCAT('Destinatario: ', o.deliveryName),
|
||||
CONCAT('Dirección: ', o.address),
|
||||
CONCAT('CP: ', c.postalCode),
|
||||
CONCAT('Foto: ', c.image),
|
||||
CONCAT('Mensaje: ', IFNULL(o.message,"Ninguno.")),
|
||||
CONCAT('Teléfono: ',IFNULL(o.deliveryPhone,"--")),
|
||||
CONCAT('Observaciones: ', IFNULL(o.observations,"No hay."))
|
||||
)
|
||||
INTO vCustomerEmail,
|
||||
vFloranetEmail,
|
||||
vSubjectEmail,
|
||||
vBodyEmail
|
||||
FROM vn.client cl
|
||||
JOIN vn.address a ON a.clientFk = cl.id
|
||||
JOIN catalogue c ON c.addressFk = a.id
|
||||
JOIN `order` o ON o.catalogueFk = c.id
|
||||
JOIN config cf
|
||||
WHERE c.id = vCatalogueFk;
|
||||
|
||||
CALL vn.mail_insert(
|
||||
vCustomerEmail,
|
||||
vFloranetEmail,
|
||||
vSubjectEmail,
|
||||
vBodyEmail);
|
||||
|
||||
SELECT isPaid, vNewTicketFk
|
||||
FROM `order`
|
||||
WHERE catalogueFk = vCatalogueFk;
|
||||
|
||||
COMMIT;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -7,7 +7,7 @@ BEGIN
|
|||
*
|
||||
* @param vJsonData The order data in json format
|
||||
*/
|
||||
INSERT INTO `order`
|
||||
REPLACE `order`
|
||||
SET catalogueFk = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.products[0].id')),
|
||||
customerName = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.customerName')),
|
||||
email = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.email')),
|
||||
|
@ -15,7 +15,8 @@ BEGIN
|
|||
message= JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.message')),
|
||||
deliveryName = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.deliveryName')),
|
||||
address = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.address')),
|
||||
deliveryPhone = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.deliveryPhone'));
|
||||
deliveryPhone = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.deliveryPhone')),
|
||||
observations = JSON_UNQUOTE(JSON_EXTRACT(vJsonData, '$.customer.customerData.observations'));
|
||||
|
||||
SELECT LAST_INSERT_ID() orderFk;
|
||||
END$$
|
||||
|
|
|
@ -9,12 +9,11 @@ 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')
|
||||
LIMIT 3;
|
||||
|
||||
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')
|
||||
LIMIT 3;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -30,6 +30,7 @@ BEGIN
|
|||
tmp.ticketComponentPrice,
|
||||
tmp.ticketComponent,
|
||||
tmp.ticketLot,
|
||||
tmp.zoneGetShipped;
|
||||
tmp.zoneGetShipped,
|
||||
tmp.item;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `hedera`.`item_getVisible
|
|||
vType INT,
|
||||
vPrefix VARCHAR(255))
|
||||
BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* Gets visible items of the specified type at specified date.
|
||||
*
|
||||
|
@ -14,7 +14,7 @@ BEGIN
|
|||
* @param vType The type id
|
||||
* @param vPrefix The article prefix to filter or %NULL for all
|
||||
* @return tmp.itemVisible Visible items
|
||||
*/
|
||||
*/
|
||||
DECLARE vPrefixLen SMALLINT;
|
||||
DECLARE vFilter VARCHAR(255) DEFAULT NULL;
|
||||
DECLARE vDateInv DATE DEFAULT vn.getInventoryDate();
|
||||
|
@ -23,13 +23,13 @@ BEGIN
|
|||
GET DIAGNOSTICS CONDITION 1
|
||||
@message = MESSAGE_TEXT;
|
||||
CALL vn.mail_insert(
|
||||
'cau@verdnatura.es',
|
||||
NULL,
|
||||
'cau@verdnatura.es',
|
||||
NULL,
|
||||
CONCAT('hedera.item_getVisible error: ', @message),
|
||||
CONCAT(
|
||||
'warehouse: ', IFNULL(vWarehouse, ''),
|
||||
', Fecha:', IFNULL(vDate, ''),
|
||||
', tipo: ', IFNULL(vType,''),
|
||||
'warehouse: ', IFNULL(vWarehouse, ''),
|
||||
', Fecha:', IFNULL(vDate, ''),
|
||||
', tipo: ', IFNULL(vType,''),
|
||||
', prefijo: ', IFNULL(vPrefix,'')));
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
@ -74,9 +74,10 @@ BEGIN
|
|||
FROM vn.sale m
|
||||
JOIN vn.ticket t ON t.id = m.ticketFk
|
||||
JOIN vn.ticketState s ON s.ticketFk = t.id
|
||||
JOIN vn.alertLevel al ON al.code = 'DELIVERED'
|
||||
WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE()
|
||||
AND t.warehouseFk = vWarehouse
|
||||
AND s.alertLevel = 3
|
||||
AND s.alertLevel = al.id
|
||||
) t
|
||||
GROUP BY itemFk
|
||||
HAVING quantity > 0;
|
||||
|
@ -108,7 +109,7 @@ BEGIN
|
|||
IF(p.depth > 0, p.depth, 0) depth, p.width, p.height,
|
||||
CEIL(s.quantity / t.packing) etiquetas
|
||||
FROM vn.item i
|
||||
JOIN `filter` f ON f.itemFk = i.id
|
||||
JOIN `filter` f ON f.itemFk = i.id
|
||||
JOIN currentStock s ON s.itemFk = i.id
|
||||
LEFT JOIN tmp t ON t.itemFk = i.id
|
||||
LEFT JOIN vn.packaging p ON p.id = t.packagingFk
|
||||
|
|
|
@ -62,7 +62,7 @@ BEGIN
|
|||
END;
|
||||
|
||||
-- Carga los datos del pedido
|
||||
SELECT o.date_send, o.address_id, o.note, a.clientFk,
|
||||
SELECT o.date_send, o.address_id, o.note, a.clientFk,
|
||||
o.company_id, o.agency_id, c.isTaxDataChecked
|
||||
INTO vDelivery, vAddress, vNotes, vClientId,
|
||||
vCompanyId, vAgencyModeId, vIsTaxDataChecked
|
||||
|
@ -121,6 +121,7 @@ BEGIN
|
|||
)
|
||||
SELECT t.id INTO vTicket
|
||||
FROM vn.ticket t
|
||||
JOIN vn.alertLevel al ON al.code = 'FREE'
|
||||
LEFT JOIN tPrevia tp ON tp.ticketFk = t.id
|
||||
LEFT JOIN vn.ticketState tls on tls.ticketFk = t.id
|
||||
JOIN hedera.`order` o
|
||||
|
@ -131,7 +132,7 @@ BEGIN
|
|||
WHERE o.id = vSelf
|
||||
AND t.refFk IS NULL
|
||||
AND tp.ticketFk IS NULL
|
||||
AND IFNULL(tls.alertLevel,0) = 0
|
||||
AND (tls.alertLevel IS NULL OR tls.alertLevel = al.id)
|
||||
LIMIT 1;
|
||||
|
||||
-- Crea el ticket en el caso de no existir uno adecuado
|
||||
|
|
|
@ -81,7 +81,7 @@ BEGIN
|
|||
|
||||
-- Código redundante
|
||||
|
||||
DO vn.till_new(
|
||||
CALL vn.till_new(
|
||||
vCustomer
|
||||
,vBank
|
||||
,vAmount / 100
|
||||
|
|
|
@ -21,7 +21,8 @@ BEGIN
|
|||
DECLARE vTransactionExportTaxFreeFk INT;
|
||||
DECLARE vSerialDua VARCHAR(1) DEFAULT 'D';
|
||||
DECLARE vInvoiceTypeInformativeCode VARCHAR(1);
|
||||
DECLARE vCountryCanariasCode, vCountryCeutaMelillaCode VARCHAR(2) ;
|
||||
DECLARE vCountryCanariasCode, vCountryCeutaMelillaCode VARCHAR(2);
|
||||
DECLARE vCompanyCode INT;
|
||||
|
||||
SELECT SiglaNacion INTO vCountryCanariasCode
|
||||
FROM Naciones
|
||||
|
@ -31,9 +32,6 @@ BEGIN
|
|||
FROM Naciones
|
||||
WHERE Nacion ='CEUTA Y MELILLA';
|
||||
|
||||
SELECT pendingServiceTransactionTypeFk INTO vDuaTransactionFk
|
||||
FROM config;
|
||||
|
||||
SELECT id INTO vTaxImportFk
|
||||
FROM taxType
|
||||
WHERE code = 'import21';
|
||||
|
@ -46,10 +44,14 @@ BEGIN
|
|||
FROM taxType
|
||||
WHERE code = 'import4';
|
||||
|
||||
SELECT definitiveExportTransactionTypeFk INTO vTransactionExportFk
|
||||
FROM config;
|
||||
|
||||
SELECT shipmentTransactionTypeFk INTO vTransactionExportTaxFreeFk
|
||||
SELECT shipmentTransactionTypeFk,
|
||||
definitiveExportTransactionTypeFk,
|
||||
pendingServiceTransactionTypeFk,
|
||||
company_getCode(vCompanyFk)
|
||||
INTO vTransactionExportTaxFreeFk,
|
||||
vTransactionExportFk,
|
||||
vDuaTransactionFk,
|
||||
vCompanyCode
|
||||
FROM config;
|
||||
|
||||
SELECT codeSage INTO vInvoiceTypeInformativeCode
|
||||
|
@ -64,8 +66,6 @@ BEGIN
|
|||
WHERE enlazadoSage = FALSE
|
||||
AND Asiento <> 1 ;
|
||||
|
||||
CALL clientSupplier_add(vCompanyFk);
|
||||
CALL pgc_add(vCompanyFk);
|
||||
CALL invoiceOut_manager(vYear, vCompanyFk);
|
||||
CALL invoiceIn_manager(vYear, vCompanyFk);
|
||||
|
||||
|
@ -158,7 +158,7 @@ BEGIN
|
|||
)
|
||||
SELECT 'EN' TipoEntrada,
|
||||
YEAR(x.FECHA) Ejercicio,
|
||||
company_getCode(vCompanyFk) AS CodigoEmpresa,
|
||||
vCompanyCode CodigoEmpresa,
|
||||
x.ASIEN Asiento,
|
||||
IF(EURODEBE <> 0 OR (EURODEBE = 0 AND EUROHABER IS NULL),
|
||||
'D', 'H') CargoAbono,
|
||||
|
@ -291,20 +291,6 @@ BEGIN
|
|||
WHERE m.CargoAbono = 'D'
|
||||
AND m.enlazadoSage = FALSE;
|
||||
|
||||
-- Elimina cuentas de cliente/proveedor que no se utilizarán en la importación
|
||||
DELETE cp
|
||||
FROM clientesProveedores cp
|
||||
LEFT JOIN movConta mc ON mc.codigoCuenta = cp.codigoCuenta
|
||||
AND mc.enlazadoSage = FALSE
|
||||
WHERE mc.codigoCuenta IS NULL;
|
||||
|
||||
-- Elimina cuentas contables que no se utilizarán en la importación
|
||||
DELETE pc
|
||||
FROM planCuentasPGC pc
|
||||
LEFT JOIN movConta mc ON mc.codigoCuenta = pc.codigoCuenta
|
||||
AND mc.enlazadoSage = FALSE
|
||||
WHERE mc.codigoCuenta IS NULL;
|
||||
|
||||
-- DUAS
|
||||
UPDATE movConta mci
|
||||
JOIN vn.XDiario x ON x.ASIEN = mci.Asiento
|
||||
|
@ -411,5 +397,55 @@ BEGIN
|
|||
AND importeDivisa > 0
|
||||
AND ImporteAsiento < 0;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.clientSupplier
|
||||
(INDEX(idClientSupplier, `type`))
|
||||
ENGINE = MEMORY
|
||||
WITH client AS(
|
||||
SELECT DISTINCT c.id
|
||||
FROM sage.movConta mc
|
||||
JOIN vn.client c ON c.accountingAccount = mc.CodigoCuenta
|
||||
WHERE NOT enlazadoSage
|
||||
),supplier AS(
|
||||
SELECT DISTINCT s.id
|
||||
FROM sage.movConta mc
|
||||
JOIN vn.supplier s ON s.account = mc.CodigoCuenta
|
||||
WHERE NOT enlazadoSage
|
||||
),clientSupplierSync AS(
|
||||
SELECT idClientSupplier, `type`
|
||||
FROM sage.clientSupplier cs
|
||||
WHERE isSync
|
||||
)
|
||||
SELECT idClientSupplier, `type`
|
||||
FROM sage.clientSupplier cs
|
||||
WHERE NOT isSync
|
||||
UNION
|
||||
SELECT id, 'C'
|
||||
FROM client c
|
||||
LEFT JOIN clientSupplierSync cs ON cs.idClientSupplier = c.id
|
||||
AND cs.Type ='C'
|
||||
WHERE cs.idClientSupplier IS NULL
|
||||
UNION
|
||||
SELECT id, 'P'
|
||||
FROM supplier s
|
||||
LEFT JOIN clientSupplierSync cs ON cs.idClientSupplier = s.id
|
||||
AND cs.Type ='P'
|
||||
WHERE cs.idClientSupplier IS NULL;
|
||||
|
||||
CALL clientSupplier_add(vCompanyFk);
|
||||
|
||||
INSERT IGNORE INTO sage.clientSupplier (companyFk, `type`, idClientSupplier, isSync)
|
||||
SELECT vCompanyCode, `type`, idClientSupplier, FALSE
|
||||
FROM tmp.clientSupplier;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.clientSupplier;
|
||||
|
||||
CALL pgc_add(vCompanyFk);
|
||||
-- Elimina cuentas contables que no se utilizarán en la importación
|
||||
DELETE pc
|
||||
FROM planCuentasPGC pc
|
||||
LEFT JOIN movConta mc ON mc.codigoCuenta = pc.codigoCuenta
|
||||
AND mc.enlazadoSage = FALSE
|
||||
WHERE mc.codigoCuenta IS NULL;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `sage`.`clientSupplier_add`(vCompanyFk INT)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `sage`.`clientSupplier_add`(
|
||||
vCompanyFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Prepara los datos de clientes y proveedores para exportarlos a Sage
|
||||
* @vCompanyFk Empresa dela que se quiere trasladar datos
|
||||
* Inserta en la tabla sage.clientesProveedores los datos de clientes y proveedores
|
||||
* que se actualizaran o se daran de alta en Sage
|
||||
* @vCompanyFk Id de empresa
|
||||
* @table tmp.clientSupplier(idClientSupplier, `type`)
|
||||
*/
|
||||
DECLARE vCountryCeutaMelillaFk INT;
|
||||
DECLARE vCompanyCode INT DEFAULT company_getCode(vCompanyFk);
|
||||
DECLARE vCountryCanariasCode, vCountryCeutaMelillaCode VARCHAR(2);
|
||||
|
||||
SELECT SiglaNacion INTO vCountryCanariasCode
|
||||
|
@ -45,7 +50,7 @@ BEGIN
|
|||
Email1,
|
||||
iban)
|
||||
SELECT
|
||||
company_getCode(vCompanyFk),
|
||||
vCompanyCode,
|
||||
'C',
|
||||
c.id,
|
||||
c.socialName,
|
||||
|
@ -53,7 +58,7 @@ BEGIN
|
|||
IFNULL(c.street, ''),
|
||||
c.accountingAccount,
|
||||
@fi := IF(cu.code = LEFT(TRIM(c.fi), 2) AND c.isVies, MID(TRIM(c.fi), 3, LENGTH(TRIM(c.fi))-1), TRIM(c.fi)),
|
||||
IF(c.isVies, CONCAT(IFNULL(cu.viesCode,cu.code), @fi ), TRIM(c.fi)),
|
||||
IF(c.isVies, CONCAT(IFNULL(cu.viesCode,cu.code), @fi ), TRIM(c.fi)),
|
||||
IFNULL(c.postcode, ''),
|
||||
IFNULL(c.city, ''),
|
||||
IFNULL(pr.CodigoProvincia, ''),
|
||||
|
@ -75,15 +80,14 @@ BEGIN
|
|||
IFNULL(SUBSTR(c.email, 1, LOCATE(',', CONCAT(c.email, ','))-1), ''),
|
||||
IFNULL(c.iban, '')
|
||||
FROM vn.`client` c
|
||||
JOIN clientLastTwoMonths clm ON clm.clientFk = c.id
|
||||
JOIN tmp.clientSupplier cs ON cs.idClientSupplier = c.id
|
||||
LEFT JOIN vn.country cu ON cu.id = c.countryFk
|
||||
LEFT JOIN Naciones n ON n.countryFk = cu.id
|
||||
LEFT JOIN vn.province p ON p.id = c.provinceFk
|
||||
LEFT JOIN Provincias pr ON pr.provinceFk = p.id
|
||||
WHERE c.isRelevant
|
||||
AND clm.companyFk = vCompanyFk
|
||||
WHERE cs.type = 'C'
|
||||
UNION ALL
|
||||
SELECT company_getCode(vCompanyFk),
|
||||
SELECT vCompanyCode,
|
||||
'P',
|
||||
s.id,
|
||||
s.name,
|
||||
|
@ -107,18 +111,16 @@ BEGIN
|
|||
IFNULL(s.transactionTypeSageFk, 0),
|
||||
IFNULL(s.withholdingSageFk, '0'),
|
||||
IFNULL(SUBSTR(sc.email, 1, (COALESCE(NULLIF(LOCATE(',', sc.email), 0), 99) - 1)), ''),
|
||||
IFNULL(iban, '')
|
||||
IFNULL(sa.iban, '')
|
||||
FROM vn.supplier s
|
||||
JOIN supplierLastThreeMonths pl ON pl.supplierFk = s.id
|
||||
JOIN tmp.clientSupplier cs ON cs.idClientSupplier = s.id
|
||||
LEFT JOIN vn.country co ON co.id = s.countryFk
|
||||
LEFT JOIN Naciones n ON n.countryFk = co.id
|
||||
LEFT JOIN vn.province p ON p.id = s.provinceFk
|
||||
LEFT JOIN Provincias pr ON pr.provinceFk = p.id
|
||||
LEFT JOIN vn.supplierContact sc ON sc.supplierFk = s.id
|
||||
LEFT JOIN vn.supplierAccount sa ON sa.supplierFk = s.id
|
||||
WHERE pl.companyFk = vCompanyFk AND
|
||||
s.isActive AND
|
||||
s.nif <> ''
|
||||
GROUP BY pl.supplierFk, pl.companyFk;
|
||||
WHERE cs.type = 'P'
|
||||
GROUP BY s.id;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -22,7 +22,7 @@ BEGIN
|
|||
LEFT JOIN vn.route r ON r.id = t.routeFk
|
||||
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
||||
LEFT JOIN vn.routesMonitor rm ON t.routeFk = rm.routeFk
|
||||
LEFT JOIN vn.roadmapStop rs ON rm.expeditionTruckFk = rs.id
|
||||
LEFT JOIN vn.roadmapStop rs ON rm.roadmapStopFk = rs.id
|
||||
WHERE e.id = vExpeditionFk;
|
||||
|
||||
RETURN vDayMinute;
|
||||
|
|
|
@ -34,7 +34,7 @@ FROM (
|
|||
)
|
||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
||||
)
|
||||
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`expeditionTruckFk` = `rs`.`id`)
|
||||
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`roadmapStopFk` = `rs`.`id`)
|
||||
)
|
||||
LEFT JOIN `vn`.`zone` `z` ON(`z`.`id` = `t`.`zoneFk`)
|
||||
)
|
||||
|
|
|
@ -45,7 +45,7 @@ FROM (
|
|||
)
|
||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
||||
)
|
||||
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`expeditionTruckFk` = `rs`.`id`)
|
||||
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`roadmapStopFk` = `rs`.`id`)
|
||||
)
|
||||
JOIN `srt`.`config` `c`
|
||||
)
|
||||
|
|
|
@ -32,7 +32,7 @@ FROM (
|
|||
)
|
||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
||||
)
|
||||
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`expeditionTruckFk` = `rs`.`id`)
|
||||
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`roadmapStopFk` = `rs`.`id`)
|
||||
)
|
||||
JOIN `dipole`.`expedition_PrintOut` `epo` ON(`epo`.`expeditionFk` = `e`.`id`)
|
||||
)
|
||||
|
|
|
@ -16,12 +16,13 @@ BEGIN
|
|||
m.created,
|
||||
TIMESTAMPADD(DAY, tp.life, t.shipped) expired,
|
||||
m.quantity < 0 isIn,
|
||||
m.isPicked OR s.alertLevel > 1 isPicked
|
||||
m.isPicked OR s.alertLevel > al.id isPicked
|
||||
FROM vn.sale m
|
||||
JOIN vn.ticket t ON t.id = m.ticketFk
|
||||
JOIN vn.ticketState s ON s.ticketFk = t.id
|
||||
JOIN vn.item i ON i.id = m.itemFk
|
||||
JOIN vn.itemType tp ON tp.id = i.typeFk
|
||||
JOIN vn.alertLevel al ON al.code = 'ON_PREPARATION'
|
||||
WHERE (
|
||||
vTableId IS NULL
|
||||
OR (vTableName = 'ticket' AND t.id = vTableId)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`midnight`()
|
||||
RETURNS datetime
|
||||
NOT DETERMINISTIC
|
||||
DETERMINISTIC
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`debugAdd`(vVariable VARCHAR(255), vValue VARCHAR(255))
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`debugAdd`(
|
||||
vVariable VARCHAR(255),
|
||||
vValue TEXT
|
||||
)
|
||||
MODIFIES SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_commit`(isTx BOOL)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_commit`(vIsTx BOOL)
|
||||
BEGIN
|
||||
/**
|
||||
* Confirma los cambios asociados a una transacción.
|
||||
*
|
||||
* @param isTx es true si existe transacción asociada
|
||||
* @param vIsTx es true si existe transacción asociada
|
||||
*/
|
||||
IF isTx THEN
|
||||
IF vIsTx THEN
|
||||
COMMIT;
|
||||
END IF;
|
||||
END$$
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_rollback`(isTx BOOL)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_rollback`(vIsTx BOOL)
|
||||
BEGIN
|
||||
/**
|
||||
* Deshace los cambios asociados a una transacción.
|
||||
*
|
||||
* @param isTx es true si existe transacción asociada
|
||||
* @param vIsTx es true si existe transacción asociada
|
||||
*/
|
||||
IF isTx THEN
|
||||
IF vIsTx THEN
|
||||
ROLLBACK;
|
||||
END IF;
|
||||
END$$
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_start`(isTx BOOL)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_start`(vIsTx BOOL)
|
||||
BEGIN
|
||||
/**
|
||||
* Inicia una transacción.
|
||||
*
|
||||
* @param isTx es true si existe transacción asociada
|
||||
* @param vIsTx es true si existe transacción asociada
|
||||
*/
|
||||
IF isTx THEN
|
||||
IF vIsTx THEN
|
||||
START TRANSACTION;
|
||||
END IF;
|
||||
END$$
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`itemShelvingSale_doReserve`
|
||||
ON SCHEDULE EVERY 15 SECOND
|
||||
STARTS '2023-10-16 00:00:00'
|
||||
ON COMPLETION PRESERVE
|
||||
ENABLE
|
||||
DO CALL vn.itemShelvingSale_doReserve$$
|
||||
DELIMITER ;
|
|
@ -11,10 +11,7 @@ BEGIN
|
|||
*/
|
||||
DECLARE vClient INT DEFAULT NULL;
|
||||
|
||||
-- SET vPhone = vPhone COLLATE 'utf8_unicode_ci';
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tClient;
|
||||
CREATE TEMPORARY TABLE tClient
|
||||
CREATE OR REPLACE TEMPORARY TABLE tClient
|
||||
ENGINE = MEMORY
|
||||
SELECT id clientFk
|
||||
FROM `client`
|
||||
|
@ -27,13 +24,14 @@ BEGIN
|
|||
OR mobile = vPhone
|
||||
UNION
|
||||
SELECT clientFk
|
||||
FROM vn.clientContact
|
||||
FROM clientContact
|
||||
WHERE phone = vPhone;
|
||||
|
||||
SELECT t.clientFk INTO vClient
|
||||
FROM tClient t
|
||||
JOIN `client` c ON c.id = t.clientFk
|
||||
WHERE c.isActive
|
||||
AND c.salesPersonFk
|
||||
LIMIT 1;
|
||||
|
||||
DROP TEMPORARY TABLE tClient;
|
||||
|
|
|
@ -1,64 +1,44 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`ticket_get`(vParamFk INT)
|
||||
RETURNS int(11)
|
||||
RETURNS INT(11)
|
||||
NOT DETERMINISTIC
|
||||
READS SQL DATA
|
||||
proc:BEGIN
|
||||
|
||||
/* Devuelve el número de ticket o collection consultando en varias tablas posibles
|
||||
*
|
||||
* @param vParamFk Número a validar
|
||||
* @return vValidFk Identificador validado
|
||||
*/
|
||||
|
||||
DECLARE vValidFk INT;
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve el número de ticket / collection / sectorCollection consultando
|
||||
* en que tabla se encuantra en la última semana
|
||||
*
|
||||
* @param vParamFk Número a validar
|
||||
* @return vReturn Identificador validado
|
||||
*/
|
||||
DECLARE vReturn INT DEFAULT NULL;
|
||||
DECLARE vDated DATE;
|
||||
|
||||
-- Tabla vn.saleGroup
|
||||
SELECT s.ticketFk INTO vValidFk
|
||||
FROM vn.sale s
|
||||
JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||
WHERE sg.id = vParamFk
|
||||
AND sg.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE())
|
||||
LIMIT 1;
|
||||
|
||||
IF vValidFk THEN
|
||||
|
||||
RETURN vValidFk;
|
||||
|
||||
LEAVE proc;
|
||||
|
||||
END IF;
|
||||
SET vDated = util.VN_CURDATE() - INTERVAL 1 WEEK;
|
||||
|
||||
-- Tabla vn.collection
|
||||
SELECT c.id INTO vValidFk
|
||||
FROM vn.collection c
|
||||
WHERE c.id = vParamFk
|
||||
AND c.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE());
|
||||
|
||||
IF vValidFk THEN
|
||||
|
||||
RETURN vValidFk;
|
||||
|
||||
LEAVE proc;
|
||||
|
||||
END IF;
|
||||
SELECT COALESCE(
|
||||
(SELECT s.ticketFk
|
||||
FROM sale s
|
||||
JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
JOIN saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||
WHERE sg.id = vParamFk
|
||||
AND sg.created > vDated
|
||||
LIMIT 1),
|
||||
(SELECT c.id
|
||||
FROM collection c
|
||||
WHERE c.id = vParamFk
|
||||
AND c.created > vDated),
|
||||
(SELECT id
|
||||
FROM ticket
|
||||
WHERE id = vParamFk
|
||||
AND shipped > vDated),
|
||||
(SELECT id
|
||||
FROM sectorCollection
|
||||
WHERE id = vParamFk
|
||||
AND created > vDated)
|
||||
) INTO vReturn;
|
||||
|
||||
-- Tabla vn.ticket
|
||||
SELECT t.id INTO vValidFk
|
||||
FROM vn.ticket t
|
||||
WHERE t.id = vParamFk
|
||||
AND t.shipped > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE());
|
||||
|
||||
IF vValidFk THEN
|
||||
|
||||
RETURN vValidFk;
|
||||
|
||||
LEAVE proc;
|
||||
|
||||
END IF;
|
||||
|
||||
RETURN NULL;
|
||||
RETURN vReturn;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -14,7 +14,7 @@ BEGIN
|
|||
DECLARE vIsTooLittle TINYINT(1);
|
||||
|
||||
SELECT (SUM(IFNULL(sv.litros, 0)) < vc.minTicketVolume
|
||||
OR IFNULL(t.totalWithoutVat, 0) < vc.minTicketValue) INTO vIsTooLittle
|
||||
AND IFNULL(t.totalWithoutVat, 0) < vc.minTicketValue) INTO vIsTooLittle
|
||||
FROM ticket t
|
||||
LEFT JOIN saleVolume sv ON sv.ticketFk = t.id
|
||||
JOIN volumeConfig vc
|
||||
|
|
|
@ -1,79 +1,73 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`till_new`(vClient INT
|
||||
,vBank INT
|
||||
,vAmount DOUBLE
|
||||
,vConcept VARCHAR(25)
|
||||
,vDated DATE
|
||||
,vSerie CHAR(1)
|
||||
,vBatch TINYINT
|
||||
,vNumber INT
|
||||
,vCompany SMALLINT
|
||||
,vWorker INT
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`till_new`(
|
||||
vClient INT,
|
||||
vBank INT,
|
||||
vAmount DOUBLE,
|
||||
vConcept VARCHAR(25),
|
||||
vDated DATE,
|
||||
vSerie CHAR(1),
|
||||
vBatch TINYINT,
|
||||
vNumber INT,
|
||||
vCompany SMALLINT,
|
||||
vWorker INT
|
||||
)
|
||||
RETURNS int(11)
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
DECLARE vAccount VARCHAR(12);
|
||||
DECLARE vSubaccount VARCHAR(12);
|
||||
DECLARE vAsiento INT DEFAULT NULL;
|
||||
|
||||
-- Inserta el registro en cajas
|
||||
|
||||
INSERT INTO till
|
||||
SET
|
||||
workerFk = vWorker
|
||||
,bankFk = vBank
|
||||
,`in` = vAmount
|
||||
,concept = vConcept
|
||||
,dated = vDated
|
||||
,serie = vSerie
|
||||
,isAccountable = vBatch
|
||||
,`number` = vNumber
|
||||
,companyFk = vCompany;
|
||||
workerFk = vWorker,
|
||||
bankFk = vBank,
|
||||
`in` = vAmount,
|
||||
concept = vConcept,
|
||||
dated = vDated,
|
||||
serie = vSerie,
|
||||
isAccountable = vBatch,
|
||||
`number` = vNumber,
|
||||
companyFk = vCompany;
|
||||
|
||||
-- Inserta los asientos contables
|
||||
|
||||
SELECT account INTO vAccount
|
||||
FROM accounting WHERE id = vBank;
|
||||
|
||||
SELECT accountingAccount INTO vSubaccount
|
||||
FROM `client` WHERE id = vClient;
|
||||
|
||||
SET vAsiento = xdiario_new
|
||||
(
|
||||
vAsiento
|
||||
,vDated
|
||||
,vAccount
|
||||
,vSubaccount
|
||||
,vConcept
|
||||
,vAmount
|
||||
,0
|
||||
,0
|
||||
,NULL -- Serie
|
||||
,NULL -- Factura
|
||||
,NULL -- IVA
|
||||
,NULL -- Recargo
|
||||
,FALSE -- Auxiliar
|
||||
,vCompany
|
||||
);
|
||||
DO xdiario_new
|
||||
(
|
||||
vAsiento
|
||||
,vDated
|
||||
,vSubaccount
|
||||
,vAccount
|
||||
,vConcept
|
||||
,0
|
||||
,vAmount
|
||||
,0
|
||||
,NULL -- Serie
|
||||
,NULL -- Factura
|
||||
,NULL -- IVA
|
||||
,NULL -- Recargo
|
||||
,FALSE -- Auxiliar
|
||||
,vCompany
|
||||
);
|
||||
CALL xdiario_new(
|
||||
vAsiento,
|
||||
vDated,
|
||||
vAccount,
|
||||
vSubaccount,
|
||||
vConcept,
|
||||
vAmount,
|
||||
0,
|
||||
0,
|
||||
NULL, -- Serie
|
||||
NULL, -- Factura
|
||||
NULL, -- IVA
|
||||
NULL, -- Recargo
|
||||
FALSE, -- Auxiliar
|
||||
vCompany,
|
||||
vAsiento);
|
||||
|
||||
RETURN NULL;
|
||||
CALL xdiario_new(
|
||||
vAsiento,
|
||||
vDated,
|
||||
vSubaccount,
|
||||
vAccount,
|
||||
vConcept,
|
||||
0,
|
||||
vAmount,
|
||||
0,
|
||||
NULL, -- Serie
|
||||
NULL, -- Factura
|
||||
NULL, -- IVA
|
||||
NULL, -- Recargo
|
||||
FALSE, -- Auxiliar
|
||||
vCompany,
|
||||
vAsiento);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`xdiario_new`(
|
||||
vBookNumber INT,
|
||||
vDated DATE,
|
||||
vSubaccount VARCHAR(12),
|
||||
vAccount VARCHAR(12),
|
||||
vConcept VARCHAR(25),
|
||||
vDebit DOUBLE,
|
||||
vCredit DOUBLE,
|
||||
vEuro DOUBLE,
|
||||
vSerie CHAR(1),
|
||||
vInvoice VARCHAR(8),
|
||||
vVat DOUBLE,
|
||||
vRe DOUBLE,
|
||||
vAux TINYINT,
|
||||
vCompanyFk INT
|
||||
)
|
||||
RETURNS int(11)
|
||||
NOT DETERMINISTIC
|
||||
NO SQL
|
||||
BEGIN
|
||||
IF vBookNumber IS NULL THEN
|
||||
CALL ledger_next(YEAR(vDated), vBookNumber);
|
||||
END IF;
|
||||
|
||||
INSERT INTO XDiario
|
||||
SET ASIEN = vBookNumber,
|
||||
FECHA = vDated,
|
||||
SUBCTA = vSubaccount,
|
||||
CONTRA = vAccount,
|
||||
CONCEPTO = vConcept,
|
||||
EURODEBE = vDebit,
|
||||
EUROHABER = vCredit,
|
||||
BASEEURO = vEuro,
|
||||
SERIE = vSerie,
|
||||
FACTURA = vInvoice,
|
||||
IVA = vVat,
|
||||
RECEQUIV = vRe,
|
||||
AUXILIAR = IF(vAux = FALSE, NULL, '*'),
|
||||
MONEDAUSO = 2,
|
||||
empresa_id = vCompanyFk;
|
||||
|
||||
RETURN vBookNumber;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -6,19 +6,6 @@ BEGIN
|
|||
* identificando y notificando los asientos descuadrados
|
||||
* y ajustando los saldos en caso necesario.
|
||||
*/
|
||||
INSERT INTO mail (receiver, subject, body)
|
||||
SELECT 'cau@verdnatura.es',
|
||||
'Asientos descuadrados',
|
||||
GROUP_CONCAT(CONCAT(' Asiento: ', ASIEN, ' - Importe:', recon) SEPARATOR ' | \n')
|
||||
FROM (
|
||||
SELECT ASIEN,
|
||||
SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) recon
|
||||
FROM XDiario
|
||||
WHERE NOT enlazado
|
||||
GROUP BY ASIEN
|
||||
HAVING ABS(SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0))) > 0.01
|
||||
) sub
|
||||
HAVING COUNT(*);
|
||||
|
||||
UPDATE XDiario xd
|
||||
JOIN (
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buy_afterUpsert`(vSelf INT)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buy_afterUpsert`(
|
||||
vSelf INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Triggered actions when a buy is updated or inserted.
|
||||
|
@ -16,7 +18,7 @@ BEGIN
|
|||
DECLARE vIsFeedStock BOOL;
|
||||
DECLARE vWeight DECIMAL(10,2);
|
||||
DECLARE vPacking INT;
|
||||
|
||||
|
||||
SELECT b.entryFk,
|
||||
b.itemFk,
|
||||
i.packingOut,
|
||||
|
@ -47,8 +49,11 @@ BEGIN
|
|||
WHERE e.id = vEntryFk;
|
||||
|
||||
IF vIsMerchandise THEN
|
||||
IF vWarehouse IS NULL THEN
|
||||
CALL util.throw('The entry does not have travel');
|
||||
END IF;
|
||||
|
||||
REPLACE itemCost SET
|
||||
REPLACE itemCost SET
|
||||
itemFk = vItemFk,
|
||||
warehouseFk = vWarehouse,
|
||||
cm3 = buy_getUnitVolume(vSelf),
|
||||
|
@ -74,7 +79,7 @@ BEGIN
|
|||
WHERE b.id = vSelf;
|
||||
|
||||
END IF;
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.buysToCheck
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.buysToCheck
|
||||
SELECT vSelf id;
|
||||
CALL buy_checkItem();
|
||||
END$$
|
||||
|
|
|
@ -0,0 +1,190 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`claimRatio_add`()
|
||||
BEGIN
|
||||
/*
|
||||
* Añade a la tabla greuges todos los cargos necesario y
|
||||
* que luego lo utilizamos para calcular el recobro.
|
||||
*/
|
||||
DECLARE vMonthToRefund INT
|
||||
DEFAULT (SELECT monthsToRefund FROM claimConfig);
|
||||
DECLARE vRecoveryGreugeType INT
|
||||
DEFAULT (SELECT id FROM greugeType WHERE code = 'recovery');
|
||||
DECLARE vManaGreugeType INT
|
||||
DEFAULT (SELECT id FROM greugeType WHERE code = 'mana');
|
||||
DECLARE vClaimGreugeType INT
|
||||
DEFAULT (SELECT id FROM greugeType WHERE code = 'claim');
|
||||
DECLARE vDebtComponentType INT
|
||||
DEFAULT (SELECT id FROM component WHERE code = 'debtCollection');
|
||||
|
||||
IF vMonthToRefund IS NULL
|
||||
OR vRecoveryGreugeType IS NULL
|
||||
OR vManaGreugeType IS NULL
|
||||
OR vClaimGreugeType IS NULL
|
||||
OR vDebtComponentType IS NULL THEN
|
||||
|
||||
CALL util.throw('Required variables not found');
|
||||
END IF;
|
||||
|
||||
-- Reclamaciones demasiado sensibles
|
||||
INSERT INTO greuge(
|
||||
shipped,
|
||||
clientFk,
|
||||
`description`,
|
||||
amount,
|
||||
greugeTypeFk,
|
||||
ticketFk
|
||||
)
|
||||
SELECT c.ticketCreated,
|
||||
c.clientFk,
|
||||
CONCAT('Claim ', c.id,' : ', s.concept),
|
||||
ROUND(-1 * ((c.responsibility - 1) / 4) * s.quantity *
|
||||
s.price * (100 - s.discount) / 100, 2),
|
||||
vClaimGreugeType,
|
||||
s.ticketFk
|
||||
FROM sale s
|
||||
JOIN claimEnd ce ON ce.saleFk = s.id
|
||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||
JOIN claim c ON c.id = ce.claimFk
|
||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
||||
AND NOT ce.isGreuge
|
||||
AND cs.code = 'resolved';
|
||||
|
||||
-- Reclamaciones que pasan a Maná
|
||||
INSERT INTO greuge(
|
||||
shipped,
|
||||
clientFk,
|
||||
`description`,
|
||||
amount,
|
||||
greugeTypeFk,
|
||||
ticketFk
|
||||
)
|
||||
SELECT c.ticketCreated,
|
||||
c.clientFk,
|
||||
CONCAT('Claim_mana ', c.id,' : ', s.concept),
|
||||
ROUND(((c.responsibility - 1) / 4) * s.quantity *
|
||||
s.price * (100 - s.discount) / 100, 2),
|
||||
vManaGreugeType,
|
||||
s.ticketFk
|
||||
FROM sale s
|
||||
JOIN claimEnd ce ON ce.saleFk = s.id
|
||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||
JOIN claim c ON c.id = ce.claimFk
|
||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
||||
AND NOT ce.isGreuge
|
||||
AND cs.code = 'resolved'
|
||||
AND c.isChargedToMana;
|
||||
|
||||
-- Marcamos para no repetir
|
||||
UPDATE claimEnd ce
|
||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||
JOIN claim c ON c.id = ce.claimFk
|
||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||
SET ce.isGreuge = TRUE
|
||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
||||
AND NOT ce.isGreuge
|
||||
AND cs.code = 'resolved';
|
||||
|
||||
-- Recobros
|
||||
CREATE OR REPLACE TEMPORARY TABLE tTicketList
|
||||
(PRIMARY KEY (ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT DISTINCT s.ticketFk
|
||||
FROM saleComponent sc
|
||||
JOIN sale s ON sc.saleFk = s.id
|
||||
JOIN ticket t ON t.id = s.ticketFk
|
||||
JOIN ticketLastState ts ON ts.ticketFk = t.id
|
||||
JOIN ticketTracking tt ON tt.id = ts.ticketTrackingFk
|
||||
JOIN state st ON st.id = tt.stateFk
|
||||
JOIN alertLevel al ON al.id = st.alertLevel
|
||||
WHERE sc.componentFk = vDebtComponentType
|
||||
AND NOT sc.isGreuge
|
||||
AND t.shipped >= (SELECT minShipped FROM claimConfig)
|
||||
AND t.shipped < util.VN_CURDATE()
|
||||
AND al.code = 'DELIVERED';
|
||||
|
||||
DELETE g.*
|
||||
FROM greuge g
|
||||
JOIN tTicketList t ON t.ticketFk = g.ticketFk
|
||||
WHERE g.greugeTypeFk = vRecoveryGreugeType;
|
||||
|
||||
INSERT INTO greuge(
|
||||
clientFk,
|
||||
`description`,
|
||||
amount,
|
||||
shipped,
|
||||
greugeTypeFk,
|
||||
ticketFk
|
||||
)
|
||||
SELECT t.clientFk,
|
||||
'Recobro',
|
||||
- ROUND(SUM(sc.value * s.quantity), 2) dif,
|
||||
DATE(t.shipped),
|
||||
vRecoveryGreugeType,
|
||||
tl.ticketFk
|
||||
FROM sale s
|
||||
JOIN ticket t ON t.id = s.ticketFk
|
||||
JOIN tTicketList tl ON tl.ticketFk = t.id
|
||||
JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
AND sc.componentFk = vDebtComponentType
|
||||
GROUP BY t.id
|
||||
HAVING ABS(dif) > 1;
|
||||
|
||||
UPDATE saleComponent sc
|
||||
JOIN sale s ON s.id = sc.saleFk
|
||||
JOIN tTicketList tl ON tl.ticketFk = s.ticketFk
|
||||
SET sc.isGreuge = TRUE
|
||||
WHERE sc.componentFk = vDebtComponentType;
|
||||
|
||||
REPLACE claimRatio(
|
||||
clientFk,
|
||||
yearSale,
|
||||
claimAmount,
|
||||
claimingRate,
|
||||
priceIncreasing
|
||||
)
|
||||
SELECT c.id,
|
||||
12 * cac.invoiced,
|
||||
totalClaims,
|
||||
ROUND(totalClaims / (12 * cac.invoiced), 4),
|
||||
0
|
||||
FROM client c
|
||||
LEFT JOIN bs.clientAnnualConsumption cac ON cac.clientFk = c.id
|
||||
LEFT JOIN (
|
||||
SELECT c.clientFk,
|
||||
ROUND(SUM(-1 * ((c.responsibility - 1) / 4) *
|
||||
s.quantity * s.price * (100 - s.discount)
|
||||
/ 100)) totalClaims
|
||||
FROM sale s
|
||||
JOIN claimEnd ce ON ce.saleFk = s.id
|
||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||
JOIN claim c ON c.id = ce.claimFk
|
||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
||||
AND cs.code = 'resolved'
|
||||
AND c.ticketCreated >= util.VN_CURDATE() - INTERVAL 1 YEAR
|
||||
GROUP BY c.clientFk
|
||||
) sub ON sub.clientFk = c.id;
|
||||
|
||||
-- Calculamos el porcentaje del recobro para añadirlo al precio de venta
|
||||
UPDATE claimRatio cr
|
||||
JOIN (
|
||||
SELECT clientFk, IFNULL(SUM(amount), 0) greuge
|
||||
FROM greuge
|
||||
WHERE shipped <= util.VN_CURDATE()
|
||||
GROUP BY clientFk
|
||||
) sub ON sub.clientFk = cr.clientFk
|
||||
SET cr.priceIncreasing = GREATEST(0, ROUND(IFNULL(sub.greuge, 0) /
|
||||
(IFNULL(cr.yearSale, 0) * vMonthToRefund / 12 ), 3));
|
||||
|
||||
-- Protección neonatos
|
||||
UPDATE claimRatio cr
|
||||
JOIN firstTicketShipped fts ON fts.clientFk = cr.clientFk
|
||||
SET cr.priceIncreasing = 0,
|
||||
cr.claimingRate = 0
|
||||
WHERE fts.shipped > util.VN_CURDATE() - INTERVAL 1 MONTH;
|
||||
|
||||
DROP TEMPORARY TABLE tTicketList;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -26,6 +26,7 @@ BEGIN
|
|||
JOIN province p ON p.id = c.provinceFk
|
||||
LEFT JOIN autonomy a ON a.id = p.autonomyFk
|
||||
JOIN country co ON co.id = p.countryFk
|
||||
JOIN bs.clientDiedPeriod cdp ON cdp.countryFk = co.id
|
||||
WHERE cd.warning = 'third'
|
||||
AND cp.clientFk IS NULL
|
||||
AND sp.salesPersonFk IS NULL
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_addWithReservation`(
|
||||
vItemFk INT,
|
||||
vQuantity INT,
|
||||
vTicketFk INT,
|
||||
vSaleGroupFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* En el ámbito de las colecciones se añade una línea de sale a un ticket
|
||||
* de una colección en caso de tener disponible y se realiza la reserva.
|
||||
*
|
||||
* @param vItemFk id of item
|
||||
* @param vQuantity quantity to be added to the ticket
|
||||
* @param vTicketFk ticket to which the sales line is added
|
||||
* @param vSaleGroupFk saleGroupFk id to add saleGroupDetail
|
||||
*/
|
||||
|
||||
DECLARE vWarehouseFk INT;
|
||||
DECLARE vCacheAvailableFk INT;
|
||||
DECLARE vAvailable INT;
|
||||
DECLARE vSaleFk INT;
|
||||
DECLARE vConcept VARCHAR(50);
|
||||
DECLARE vItemName VARCHAR(50);
|
||||
DECLARE vHasThrow BOOLEAN DEFAULT FALSE;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
ROLLBACK;
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
SELECT t.warehouseFk INTO vWarehouseFk
|
||||
FROM ticket t
|
||||
JOIN ticketCollection tc ON tc.ticketFk = t.id
|
||||
WHERE t.id = vTicketFk;
|
||||
|
||||
CALL cache.available_refresh(
|
||||
vCacheAvailableFk,
|
||||
FALSE,
|
||||
vWarehouseFk,
|
||||
util.VN_CURDATE());
|
||||
|
||||
SELECT available INTO vAvailable
|
||||
FROM cache.available
|
||||
WHERE calc_id = vCacheAvailableFk
|
||||
AND item_id = vItemFk;
|
||||
|
||||
IF vAvailable < vQuantity THEN
|
||||
SET vHasThrow = TRUE;
|
||||
ELSE
|
||||
SELECT `name`,
|
||||
CONCAT(getUser(), ' ', DATE_FORMAT(util.VN_NOW(), '%H:%i'), ' ', name)
|
||||
INTO vItemName, vConcept
|
||||
FROM item
|
||||
WHERE id = vItemFk;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
INSERT INTO sale
|
||||
SET itemFk = vItemFk,
|
||||
ticketFk = vTicketFk,
|
||||
concept = vConcept,
|
||||
quantity = vQuantity,
|
||||
isAdded = TRUE;
|
||||
|
||||
SELECT LAST_INSERT_ID() INTO vSaleFk;
|
||||
|
||||
CALL sale_calculateComponent(vSaleFk, NULL);
|
||||
CALL itemShelvingSale_addBySale(vSaleFk);
|
||||
|
||||
IF NOT EXISTS (SELECT TRUE FROM itemShelvingSale WHERE saleFk = vSaleFk LIMIT 1) THEN
|
||||
SET vHasThrow = TRUE;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
IF vHasThrow THEN
|
||||
CALL util.throw("There is no available for the selected item");
|
||||
END IF;
|
||||
|
||||
IF vSaleGroupFk THEN
|
||||
INSERT INTO saleGroupDetail
|
||||
SET saleFk = vSaleFk,
|
||||
saleGroupFk = vSaleGroupFk;
|
||||
END IF;
|
||||
|
||||
COMMIT;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -17,11 +17,23 @@ BEGIN
|
|||
DECLARE vWarehouseFk INT;
|
||||
DECLARE vLockName VARCHAR(215);
|
||||
DECLARE vLockTime INT DEFAULT 30;
|
||||
DECLARE vErrorNumber INT;
|
||||
DECLARE vErrorMsg TEXT;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
GET DIAGNOSTICS CONDITION 1
|
||||
vErrorNumber = MYSQL_ERRNO,
|
||||
vErrorMsg = MESSAGE_TEXT;
|
||||
|
||||
IF vLockName IS NOT NULL THEN
|
||||
DO RELEASE_LOCK(vLockName);
|
||||
CALL util.debugAdd('collection_assign', JSON_OBJECT(
|
||||
'errorNumber', vErrorNumber,
|
||||
'errorMsg', vErrorMsg,
|
||||
'lockName', vLockName,
|
||||
'userFk', vUserFk
|
||||
)); -- Tmp
|
||||
END IF;
|
||||
|
||||
RESIGNAL;
|
||||
|
@ -79,8 +91,7 @@ BEGIN
|
|||
VALUES(vUserFk);
|
||||
|
||||
-- Comprueba si hay colecciones disponibles que se ajustan a su configuracion
|
||||
SELECT MIN(c.id)
|
||||
INTO vCollectionFk
|
||||
SELECT MIN(c.id) INTO vCollectionFk
|
||||
FROM `collection` c
|
||||
JOIN operator o
|
||||
ON (o.itemPackingTypeFk = c.itemPackingTypeFk OR c.itemPackingTypeFk IS NULL)
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_getAssigned`(
|
||||
vUserFk INT,
|
||||
OUT vCollectionFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Comprueba si existen colecciones libres que se ajustan al perfil del usuario
|
||||
* y le asigna la más antigua.
|
||||
* Añade un registro al semillero de colecciones y hace la reserva para la colección
|
||||
*
|
||||
* @param vUserFk Id de usuario
|
||||
* @param vCollectionFk Id de colección
|
||||
*/
|
||||
DECLARE vHasTooMuchCollections BOOL;
|
||||
DECLARE vItemPackingTypeFk VARCHAR(1);
|
||||
DECLARE vWarehouseFk INT;
|
||||
DECLARE vLockName VARCHAR(215);
|
||||
DECLARE vLockTime INT DEFAULT 30;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
IF vLockName IS NOT NULL THEN
|
||||
DO RELEASE_LOCK(vLockName);
|
||||
END IF;
|
||||
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
-- Si hay colecciones sin terminar, sale del proceso
|
||||
CALL collection_get(vUserFk);
|
||||
|
||||
SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0,
|
||||
pc.collection_assign_lockname
|
||||
INTO vHasTooMuchCollections,
|
||||
vLockName
|
||||
FROM tCollection tc
|
||||
JOIN productionConfig pc;
|
||||
|
||||
DROP TEMPORARY TABLE tCollection;
|
||||
|
||||
IF vHasTooMuchCollections THEN
|
||||
CALL util.throw('There are pending collections');
|
||||
END IF;
|
||||
|
||||
SELECT warehouseFk, itemPackingTypeFk
|
||||
INTO vWarehouseFk, vItemPackingTypeFk
|
||||
FROM operator
|
||||
WHERE workerFk = vUserFk;
|
||||
|
||||
SET vLockName = CONCAT_WS('/',
|
||||
vLockName,
|
||||
vWarehouseFk,
|
||||
vItemPackingTypeFk
|
||||
);
|
||||
|
||||
IF NOT GET_LOCK(vLockName, vLockTime) THEN
|
||||
CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
|
||||
END IF;
|
||||
|
||||
-- Se eliminan las colecciones sin asignar que estan obsoletas
|
||||
INSERT INTO ticketTracking(stateFk, ticketFk)
|
||||
SELECT s.id, tc.ticketFk
|
||||
FROM collection c
|
||||
JOIN ticketCollection tc ON tc.collectionFk = c.id
|
||||
JOIN state s ON s.code = 'PRINTED_AUTO'
|
||||
JOIN productionConfig pc
|
||||
WHERE c.workerFk IS NULL
|
||||
AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime;
|
||||
|
||||
DELETE c
|
||||
FROM collection c
|
||||
JOIN productionConfig pc
|
||||
WHERE c.workerFk IS NULL
|
||||
AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime;
|
||||
|
||||
-- Se añade registro al semillero
|
||||
INSERT INTO collectionHotbed
|
||||
SET userFk = vUserFk;
|
||||
|
||||
-- Comprueba si hay colecciones disponibles que se ajustan a su configuracion
|
||||
SELECT MIN(c.id) INTO vCollectionFk
|
||||
FROM collection c
|
||||
JOIN operator o ON (o.itemPackingTypeFk = c.itemPackingTypeFk
|
||||
OR c.itemPackingTypeFk IS NULL)
|
||||
AND o.numberOfWagons = c.wagons
|
||||
AND o.trainFk = c.trainFk
|
||||
AND o.warehouseFk = c.warehouseFk
|
||||
AND c.workerFk IS NULL
|
||||
WHERE o.workerFk = vUserFk;
|
||||
|
||||
IF vCollectionFk IS NULL THEN
|
||||
CALL collection_new(vUserFk, vCollectionFk);
|
||||
END IF;
|
||||
|
||||
UPDATE collection
|
||||
SET workerFk = vUserFk
|
||||
WHERE id = vCollectionFk;
|
||||
|
||||
CALL itemShelvingSale_addByCollection(vCollectionFk);
|
||||
|
||||
DO RELEASE_LOCK(vLockName);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -2,61 +2,88 @@ DELIMITER $$
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_getTickets`(vParamFk INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Selecciona los tickets de una colección/ticket
|
||||
* @param vParamFk ticketFk/collectionFk
|
||||
* @return Retorna ticketFk, level, agencyName, warehouseFk, salesPersonFk, observaciones
|
||||
* Selecciona los tickets de una colección/ticket/sectorCollection
|
||||
* @param vParamFk ticketFk/collectionFk/sectorCollection
|
||||
* @return Retorna ticketFk, level, agencyName, warehouseFk, salesPersonFk, observation
|
||||
*/
|
||||
DECLARE vItemPackingTypeFk VARCHAR(1);
|
||||
DECLARE vYesterday DATE;
|
||||
|
||||
-- Si los sacadores son los de pruebas, pinta los colores
|
||||
SELECT itemPackingTypeFk INTO vItemPackingTypeFk
|
||||
FROM vn.collection
|
||||
SELECT itemPackingTypeFk
|
||||
INTO vItemPackingTypeFk
|
||||
FROM collection
|
||||
WHERE id = vParamFk;
|
||||
|
||||
SET vYesterday = util.yesterday();
|
||||
|
||||
SELECT t.id ticketFk,
|
||||
IF (!(vItemPackingTypeFk <=> 'V'), cc.code,CONCAT(SUBSTRING('ABCDEFGH',tc.wagon, 1),'-',tc.`level` )) `level`,
|
||||
am.name agencyName,
|
||||
t.warehouseFk,
|
||||
w.id salesPersonFk,
|
||||
IFNULL(tob.description,'') observaciones,
|
||||
cc.rgb
|
||||
FROM vn.ticket t
|
||||
LEFT JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
||||
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk -- PAK 23/12/21
|
||||
LEFT JOIN vn.collectionColors cc
|
||||
ON cc.wagon = tc.wagon
|
||||
AND cc.shelve = tc.`level`
|
||||
AND cc.trainFk = c2.trainFk -- PAK 23/12/21
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
||||
LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id
|
||||
AND tob.observationTypeFk = 1
|
||||
WHERE t.id = vParamFk
|
||||
AND t.shipped >= util.yesterday()
|
||||
UNION ALL
|
||||
WITH observation AS (
|
||||
SELECT tob.ticketFk, tob.description
|
||||
FROM vn.ticketObservation tob
|
||||
JOIN vn.ticketCollection tc ON tc.ticketFk = tob.ticketFk
|
||||
LEFT JOIN vn.observationType ot ON ot.id = tob.observationTypeFk
|
||||
WHERE ot.`code` = 'itemPicker'
|
||||
AND tc.collectionFk = vParamFk
|
||||
)
|
||||
SELECT t.id ticketFk,
|
||||
IF(!(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`,
|
||||
am.name agencyName,
|
||||
t.warehouseFk,
|
||||
w.id salesPersonFk,
|
||||
IFNULL(tob.description, '') observaciones,
|
||||
IF(!(vItemPackingTypeFk <=> 'V'), cc.rgb, NULL) `rgb`
|
||||
w.id salesPersonFk,
|
||||
IFNULL(ob.description,'') observaciones,
|
||||
cc.rgb
|
||||
FROM vn.ticket t
|
||||
JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
||||
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk -- PAK 23/12/21
|
||||
LEFT JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
||||
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
|
||||
LEFT JOIN vn.collectionColors cc
|
||||
ON cc.wagon = tc.wagon
|
||||
AND cc.shelve = tc.`level`
|
||||
AND cc.trainFk = c2.trainFk -- PAK 23/12/21
|
||||
AND cc.shelve = tc.`level`
|
||||
AND cc.trainFk = c2.trainFk
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
||||
LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id
|
||||
AND tob.observationTypeFk = 1
|
||||
WHERE tc.collectionFk = vParamFk;
|
||||
|
||||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||
WHERE t.id = vParamFk
|
||||
AND t.shipped >= vYesterday
|
||||
UNION ALL
|
||||
SELECT t.id ticketFk,
|
||||
IF(NOT(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`,
|
||||
am.name agencyName,
|
||||
t.warehouseFk,
|
||||
w.id salesPersonFk,
|
||||
ob.description,
|
||||
IF(NOT (vItemPackingTypeFk <=> 'V'), cc.rgb, NULL) `rgb`
|
||||
FROM vn.ticket t
|
||||
JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
||||
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
|
||||
LEFT JOIN vn.collectionColors cc
|
||||
ON cc.wagon = tc.wagon
|
||||
AND cc.shelve = tc.`level`
|
||||
AND cc.trainFk = c2.trainFk
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
||||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||
WHERE tc.collectionFk = vParamFk
|
||||
UNION ALL
|
||||
SELECT sg.ticketFk,
|
||||
NULL `level`,
|
||||
am.name agencyName,
|
||||
t.warehouseFk,
|
||||
c.salesPersonFk,
|
||||
ob.description,
|
||||
NULL `rgb`
|
||||
FROM vn.sectorCollection sc
|
||||
JOIN vn.sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id
|
||||
JOIN vn.saleGroup sg ON sg.id = ss.saleGroupFk
|
||||
JOIN vn.ticket t ON t.id = sg.ticketFk
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||
WHERE sc.id = vParamFk
|
||||
AND t.shipped >= vYesterday;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -28,6 +28,8 @@ BEGIN
|
|||
DECLARE vLockName VARCHAR(215);
|
||||
DECLARE vLockTime INT DEFAULT 30;
|
||||
DECLARE vFreeWagonFk INT;
|
||||
DECLARE vErrorNumber INT;
|
||||
DECLARE vErrorMsg TEXT;
|
||||
|
||||
DECLARE c1 CURSOR FOR
|
||||
SELECT ticketFk, `lines`, m3
|
||||
|
@ -47,8 +49,19 @@ BEGIN
|
|||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
GET DIAGNOSTICS CONDITION 1
|
||||
vErrorNumber = MYSQL_ERRNO,
|
||||
vErrorMsg = MESSAGE_TEXT;
|
||||
|
||||
IF vLockName IS NOT NULL THEN
|
||||
DO RELEASE_LOCK(vLockName);
|
||||
CALL util.debugAdd('collection_new', JSON_OBJECT(
|
||||
'errorNumber', vErrorNumber,
|
||||
'errorMsg', vErrorMsg,
|
||||
'lockName', vLockName,
|
||||
'userFk', vUserFk,
|
||||
'ticketFk', vTicketFk
|
||||
)); -- Tmp
|
||||
END IF;
|
||||
|
||||
RESIGNAL;
|
||||
|
|
|
@ -34,7 +34,7 @@ BEGIN
|
|||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||
LEFT JOIN vn.agency a ON a.id = am.agencyFk
|
||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
||||
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.roadmapStopFk
|
||||
JOIN vn.packagingConfig pc
|
||||
WHERE t.warehouseFk IN (60,1,44)
|
||||
AND e.created BETWEEN vStarted AND vEnded
|
||||
|
|
|
@ -16,9 +16,9 @@ BEGIN
|
|||
|
||||
SET @order = 0;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.newSaleList;
|
||||
DROP TEMPORARY TABLE IF EXISTS tNewSaleList;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp.newSaleList
|
||||
CREATE TEMPORARY TABLE tNewSaleList
|
||||
SELECT id as saleFk, @order := @order + 1 as orden
|
||||
FROM vn.sale
|
||||
WHERE ticketFk = vTargetTicketFk
|
||||
|
@ -28,7 +28,8 @@ BEGIN
|
|||
SELECT ns.saleFk, sc.componentFk, sc.value
|
||||
FROM vn.saleComponent sc
|
||||
JOIN tmp.saleList s ON s.saleFk = sc.saleFk
|
||||
JOIN tmp.newSaleList ns ON ns.orden = s.orden;
|
||||
JOIN tNewSaleList ns ON ns.orden = s.orden;
|
||||
|
||||
DROP TEMPORARY TABLE tNewSaleList;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`duaInvoiceInBooking`(vDuaFk INT)
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`duaInvoiceInBooking`(
|
||||
vDuaFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Genera el asiento de un DUA y marca las entradas como confirmadas
|
||||
*
|
||||
* @param vDuaFk Id del dua a recalcular
|
||||
*/
|
||||
DECLARE done BOOL DEFAULT FALSE;
|
||||
DECLARE vDone BOOL DEFAULT FALSE;
|
||||
DECLARE vInvoiceFk INT;
|
||||
DECLARE vASIEN BIGINT DEFAULT 0;
|
||||
DECLARE vCounter INT DEFAULT 0;
|
||||
DECLARE vBookEntry INT;
|
||||
DECLARE vFiscalYear INT;
|
||||
|
||||
DECLARE rs CURSOR FOR
|
||||
DECLARE vInvoicesIn CURSOR FOR
|
||||
SELECT DISTINCT e.invoiceInFk
|
||||
FROM entry e
|
||||
JOIN duaEntry de ON de.entryFk = e.id
|
||||
|
@ -20,9 +22,7 @@ BEGIN
|
|||
AND de.customsValue
|
||||
AND ii.isBooked = FALSE;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
|
||||
|
||||
OPEN rs;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
UPDATE invoiceIn ii
|
||||
JOIN entry e ON e.invoiceInFk = ii.id
|
||||
|
@ -31,48 +31,67 @@ BEGIN
|
|||
SET ii.booked = IFNULL(ii.booked, d.booked),
|
||||
ii.operated = IFNULL(ii.operated, d.operated),
|
||||
ii.issued = IFNULL(ii.issued, d.issued),
|
||||
ii.bookEntried = IFNULL(ii.bookEntried, d.bookEntried),
|
||||
e.isBooked = TRUE,
|
||||
e.isConfirmed = TRUE
|
||||
ii.bookEntried = IFNULL(ii.bookEntried, d.bookEntried)
|
||||
WHERE d.id = vDuaFk;
|
||||
|
||||
SELECT IFNULL(ASIEN,0) INTO vASIEN
|
||||
FROM dua
|
||||
WHERE id = vDuaFk;
|
||||
SELECT ASIEN INTO vBookEntry FROM dua WHERE id = vDuaFk;
|
||||
|
||||
FETCH rs INTO vInvoiceFk;
|
||||
IF vBookEntry IS NULL THEN
|
||||
SELECT YEAR(IFNULL(ii.bookEntried, d.bookEntried)) INTO vFiscalYear
|
||||
FROM invoiceIn ii
|
||||
JOIN `entry` e ON e.invoiceInFk = ii.id
|
||||
JOIN duaEntry de ON de.entryFk = e.id
|
||||
JOIN dua d ON d.id = de.duaFk
|
||||
WHERE d.id = vDuaFk
|
||||
LIMIT 1;
|
||||
CALL ledger_nextTx(vFiscalYear, vBookEntry);
|
||||
END IF;
|
||||
|
||||
WHILE NOT done DO
|
||||
OPEN vInvoicesIn;
|
||||
|
||||
CALL invoiceIn_booking(vInvoiceFk);
|
||||
|
||||
IF vCounter > 0 OR vASIEN > 0 THEN
|
||||
|
||||
UPDATE XDiario x
|
||||
JOIN ledgerConfig lc ON lc.lastBookEntry = x.ASIEN
|
||||
SET x.ASIEN = vASIEN;
|
||||
|
||||
ELSE
|
||||
|
||||
SELECT lastBookEntry INTO vASIEN FROM ledgerConfig;
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH vInvoicesIn INTO vInvoiceFk;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
SET vCounter = vCounter + 1;
|
||||
CALL invoiceIn_booking(vInvoiceFk, vBookEntry);
|
||||
END LOOP;
|
||||
|
||||
FETCH rs INTO vInvoiceFk;
|
||||
|
||||
END WHILE;
|
||||
|
||||
CLOSE rs;
|
||||
CLOSE vInvoicesIn;
|
||||
|
||||
UPDATE dua
|
||||
SET ASIEN = vASIEN
|
||||
SET ASIEN = vBookEntry
|
||||
WHERE id = vDuaFk;
|
||||
|
||||
UPDATE invoiceIn ii
|
||||
JOIN duaInvoiceIn dii ON dii.invoiceInFk = ii.id
|
||||
SET ii.isBooked = TRUE
|
||||
WHERE dii.duaFk = vDuaFk;
|
||||
|
||||
UPDATE `entry` e
|
||||
JOIN (
|
||||
WITH entries AS (
|
||||
SELECT e.id, de.duaFk
|
||||
FROM vn.`entry` e
|
||||
JOIN vn.duaEntry de ON de.entryFk = e.id
|
||||
WHERE de.duaFk = vDuaFk
|
||||
AND (NOT e.isBooked OR NOT e.isConfirmed)
|
||||
),
|
||||
notBookedEntries AS (
|
||||
SELECT e.id
|
||||
FROM vn.duaEntry
|
||||
WHERE duaFk = vDuaFk
|
||||
AND NOT customsValue
|
||||
)
|
||||
SELECT e.id
|
||||
FROM entries e
|
||||
LEFT JOIN notBookedEntries nbe ON nbe.entryFk = e.id
|
||||
WHERE nbe.entryFk IS NULL
|
||||
) sub ON sub.id = e.id
|
||||
SET e.isBooked = TRUE,
|
||||
e.isConfirmed = TRUE;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -12,7 +12,7 @@ BEGIN
|
|||
WHERE id = vDuaFk;
|
||||
|
||||
IF vBookNumber IS NULL OR NOT vBookNumber THEN
|
||||
CALL ledger_next(YEAR(vBookDated), vBookNumber);
|
||||
CALL ledger_nextTx(YEAR(vBookDated), vBookNumber);
|
||||
END IF;
|
||||
|
||||
-- Apunte de la aduana
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue