Merge branch 'dev' into 3681-move-sign_save-to-salix
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
aa716634db
|
@ -43,6 +43,9 @@ module.exports = Self => {
|
||||||
if (!recipient)
|
if (!recipient)
|
||||||
throw new Error(`Could not send message "${message}" to worker id ${recipientId} from user ${userId}`);
|
throw new Error(`Could not send message "${message}" to worker id ${recipientId} from user ${userId}`);
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV == 'test')
|
||||||
|
message = `[Test:Environment to user ${userId}] ` + message;
|
||||||
|
|
||||||
await models.Chat.create({
|
await models.Chat.create({
|
||||||
senderFk: sender.id,
|
senderFk: sender.id,
|
||||||
recipient: `@${recipient.name}`,
|
recipient: `@${recipient.name}`,
|
||||||
|
|
|
@ -26,11 +26,30 @@ module.exports = Self => {
|
||||||
|
|
||||||
Self.setSaleQuantity = async(saleId, quantity) => {
|
Self.setSaleQuantity = async(saleId, quantity) => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
|
const myOptions = {};
|
||||||
|
let tx;
|
||||||
|
|
||||||
const sale = await models.Sale.findById(saleId);
|
if (typeof options == 'object')
|
||||||
return await sale.updateAttributes({
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
if (!myOptions.transaction) {
|
||||||
|
tx = await Self.beginTransaction({});
|
||||||
|
myOptions.transaction = tx;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const sale = await models.Sale.findById(saleId, null, myOptions);
|
||||||
|
const saleUpdated = await sale.updateAttributes({
|
||||||
originalQuantity: sale.quantity,
|
originalQuantity: sale.quantity,
|
||||||
quantity: quantity
|
quantity: quantity
|
||||||
});
|
}, myOptions);
|
||||||
|
|
||||||
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
|
return saleUpdated;
|
||||||
|
} catch (e) {
|
||||||
|
if (tx) await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,15 +2,26 @@ const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
describe('setSaleQuantity()', () => {
|
describe('setSaleQuantity()', () => {
|
||||||
it('should change quantity sale', async() => {
|
it('should change quantity sale', async() => {
|
||||||
|
const tx = await models.Ticket.beginTransaction({});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
const saleId = 30;
|
const saleId = 30;
|
||||||
const newQuantity = 10;
|
const newQuantity = 10;
|
||||||
|
|
||||||
const originalSale = await models.Sale.findById(saleId);
|
const originalSale = await models.Sale.findById(saleId, null, options);
|
||||||
|
|
||||||
await models.Collection.setSaleQuantity(saleId, newQuantity);
|
await models.Collection.setSaleQuantity(saleId, newQuantity, options);
|
||||||
const updateSale = await models.Sale.findById(saleId);
|
const updateSale = await models.Sale.findById(saleId, null, options);
|
||||||
|
|
||||||
expect(updateSale.originalQuantity).toEqual(originalSale.quantity);
|
expect(updateSale.originalQuantity).toEqual(originalSale.quantity);
|
||||||
expect(updateSale.quantity).toEqual(newQuantity);
|
expect(updateSale.quantity).toEqual(newQuantity);
|
||||||
|
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,11 +19,11 @@ describe('getStarredModules()', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should return the starred modules for a given user`, async() => {
|
it(`should return the starred modules for a given user`, async() => {
|
||||||
const newStarred = await app.models.StarredModule.create({workerFk: 9, moduleFk: 'Clients', position: 1});
|
const newStarred = await app.models.StarredModule.create({workerFk: 9, moduleFk: 'customer', position: 1});
|
||||||
const starredModules = await app.models.StarredModule.getStarredModules(ctx);
|
const starredModules = await app.models.StarredModule.getStarredModules(ctx);
|
||||||
|
|
||||||
expect(starredModules.length).toEqual(1);
|
expect(starredModules.length).toEqual(1);
|
||||||
expect(starredModules[0].moduleFk).toEqual('Clients');
|
expect(starredModules[0].moduleFk).toEqual('customer');
|
||||||
|
|
||||||
// restores
|
// restores
|
||||||
await app.models.StarredModule.destroyById(newStarred.id);
|
await app.models.StarredModule.destroyById(newStarred.id);
|
||||||
|
|
|
@ -26,29 +26,29 @@ describe('setPosition()', () => {
|
||||||
const filter = {
|
const filter = {
|
||||||
where: {
|
where: {
|
||||||
workerFk: ctx.req.accessToken.userId,
|
workerFk: ctx.req.accessToken.userId,
|
||||||
moduleFk: 'Orders'
|
moduleFk: 'order'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Orders', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'order', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Clients', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'customer', options);
|
||||||
|
|
||||||
let orders = await app.models.StarredModule.findOne(filter, options);
|
let orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
let clients = await app.models.StarredModule.findOne(filter, options);
|
let clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(orders.position).toEqual(1);
|
expect(orders.position).toEqual(1);
|
||||||
expect(clients.position).toEqual(2);
|
expect(clients.position).toEqual(2);
|
||||||
|
|
||||||
await app.models.StarredModule.setPosition(ctx, 'Clients', 'left', options);
|
await app.models.StarredModule.setPosition(ctx, 'customer', 'left', options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
clients = await app.models.StarredModule.findOne(filter, options);
|
clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Orders';
|
filter.where.moduleFk = 'order';
|
||||||
orders = await app.models.StarredModule.findOne(filter, options);
|
orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(clients.position).toEqual(1);
|
expect(clients.position).toEqual(1);
|
||||||
|
@ -67,29 +67,29 @@ describe('setPosition()', () => {
|
||||||
const filter = {
|
const filter = {
|
||||||
where: {
|
where: {
|
||||||
workerFk: ctx.req.accessToken.userId,
|
workerFk: ctx.req.accessToken.userId,
|
||||||
moduleFk: 'Orders'
|
moduleFk: 'order'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Orders', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'order', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Clients', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'customer', options);
|
||||||
|
|
||||||
let orders = await app.models.StarredModule.findOne(filter, options);
|
let orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
let clients = await app.models.StarredModule.findOne(filter, options);
|
let clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(orders.position).toEqual(1);
|
expect(orders.position).toEqual(1);
|
||||||
expect(clients.position).toEqual(2);
|
expect(clients.position).toEqual(2);
|
||||||
|
|
||||||
await app.models.StarredModule.setPosition(ctx, 'Orders', 'right', options);
|
await app.models.StarredModule.setPosition(ctx, 'order', 'right', options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Orders';
|
filter.where.moduleFk = 'order';
|
||||||
orders = await app.models.StarredModule.findOne(filter, options);
|
orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
clients = await app.models.StarredModule.findOne(filter, options);
|
clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(orders.position).toEqual(2);
|
expect(orders.position).toEqual(2);
|
||||||
|
@ -108,35 +108,35 @@ describe('setPosition()', () => {
|
||||||
const filter = {
|
const filter = {
|
||||||
where: {
|
where: {
|
||||||
workerFk: ctx.req.accessToken.userId,
|
workerFk: ctx.req.accessToken.userId,
|
||||||
moduleFk: 'Items'
|
moduleFk: 'item'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Clients', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'customer', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Orders', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'order', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Clients', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'customer', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Orders', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'order', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Items', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'item', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Claims', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'claim', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Clients', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'customer', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Orders', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'order', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Zones', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'zone', options);
|
||||||
|
|
||||||
const items = await app.models.StarredModule.findOne(filter, options);
|
const items = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Claims';
|
filter.where.moduleFk = 'claim';
|
||||||
const claims = await app.models.StarredModule.findOne(filter, options);
|
const claims = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
let clients = await app.models.StarredModule.findOne(filter, options);
|
let clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Orders';
|
filter.where.moduleFk = 'order';
|
||||||
let orders = await app.models.StarredModule.findOne(filter, options);
|
let orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Zones';
|
filter.where.moduleFk = 'zone';
|
||||||
const zones = await app.models.StarredModule.findOne(filter, options);
|
const zones = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(items.position).toEqual(1);
|
expect(items.position).toEqual(1);
|
||||||
|
@ -145,12 +145,12 @@ describe('setPosition()', () => {
|
||||||
expect(orders.position).toEqual(4);
|
expect(orders.position).toEqual(4);
|
||||||
expect(zones.position).toEqual(5);
|
expect(zones.position).toEqual(5);
|
||||||
|
|
||||||
await app.models.StarredModule.setPosition(ctx, 'Clients', 'right', options);
|
await app.models.StarredModule.setPosition(ctx, 'customer', 'right', options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Orders';
|
filter.where.moduleFk = 'order';
|
||||||
orders = await app.models.StarredModule.findOne(filter, options);
|
orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
clients = await app.models.StarredModule.findOne(filter, options);
|
clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(orders.position).toEqual(3);
|
expect(orders.position).toEqual(3);
|
||||||
|
@ -169,31 +169,31 @@ describe('setPosition()', () => {
|
||||||
const filter = {
|
const filter = {
|
||||||
where: {
|
where: {
|
||||||
workerFk: ctx.req.accessToken.userId,
|
workerFk: ctx.req.accessToken.userId,
|
||||||
moduleFk: 'Items'
|
moduleFk: 'item'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Items', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'item', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Clients', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'customer', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Claims', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'claim', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Orders', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'order', options);
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Zones', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'zone', options);
|
||||||
|
|
||||||
const items = await app.models.StarredModule.findOne(filter, options);
|
const items = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
let clients = await app.models.StarredModule.findOne(filter, options);
|
let clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Claims';
|
filter.where.moduleFk = 'claim';
|
||||||
const claims = await app.models.StarredModule.findOne(filter, options);
|
const claims = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Orders';
|
filter.where.moduleFk = 'order';
|
||||||
let orders = await app.models.StarredModule.findOne(filter, options);
|
let orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Zones';
|
filter.where.moduleFk = 'zone';
|
||||||
const zones = await app.models.StarredModule.findOne(filter, options);
|
const zones = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(items.position).toEqual(1);
|
expect(items.position).toEqual(1);
|
||||||
|
@ -202,13 +202,13 @@ describe('setPosition()', () => {
|
||||||
expect(orders.position).toEqual(4);
|
expect(orders.position).toEqual(4);
|
||||||
expect(zones.position).toEqual(5);
|
expect(zones.position).toEqual(5);
|
||||||
|
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Claims', options);
|
await app.models.StarredModule.toggleStarredModule(ctx, 'claim', options);
|
||||||
await app.models.StarredModule.setPosition(ctx, 'Clients', 'right', options);
|
await app.models.StarredModule.setPosition(ctx, 'customer', 'right', options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Clients';
|
filter.where.moduleFk = 'customer';
|
||||||
clients = await app.models.StarredModule.findOne(filter, options);
|
clients = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
filter.where.moduleFk = 'Orders';
|
filter.where.moduleFk = 'order';
|
||||||
orders = await app.models.StarredModule.findOne(filter, options);
|
orders = await app.models.StarredModule.findOne(filter, options);
|
||||||
|
|
||||||
expect(orders.position).toEqual(2);
|
expect(orders.position).toEqual(2);
|
||||||
|
|
|
@ -21,15 +21,15 @@ describe('toggleStarredModule()', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a new starred module and then remove it by calling the method again with same args', async() => {
|
it('should create a new starred module and then remove it by calling the method again with same args', async() => {
|
||||||
const starredModule = await app.models.StarredModule.toggleStarredModule(ctx, 'Orders');
|
const starredModule = await app.models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||||
let starredModules = await app.models.StarredModule.getStarredModules(ctx);
|
let starredModules = await app.models.StarredModule.getStarredModules(ctx);
|
||||||
|
|
||||||
expect(starredModules.length).toEqual(1);
|
expect(starredModules.length).toEqual(1);
|
||||||
expect(starredModule.moduleFk).toEqual('Orders');
|
expect(starredModule.moduleFk).toEqual('order');
|
||||||
expect(starredModule.workerFk).toEqual(activeCtx.accessToken.userId);
|
expect(starredModule.workerFk).toEqual(activeCtx.accessToken.userId);
|
||||||
expect(starredModule.position).toEqual(starredModules.length);
|
expect(starredModule.position).toEqual(starredModules.length);
|
||||||
|
|
||||||
await app.models.StarredModule.toggleStarredModule(ctx, 'Orders');
|
await app.models.StarredModule.toggleStarredModule(ctx, 'order');
|
||||||
starredModules = await app.models.StarredModule.getStarredModules(ctx);
|
starredModules = await app.models.StarredModule.getStarredModules(ctx);
|
||||||
|
|
||||||
expect(starredModules.length).toEqual(0);
|
expect(starredModules.length).toEqual(0);
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
ALTER TABLE `vn`.`accountingType` ADD daysInFuture INT NULL;
|
|
||||||
ALTER TABLE `vn`.`accountingType` MODIFY COLUMN daysInFuture int(11) DEFAULT 0 NULL;
|
|
||||||
UPDATE `vn`.`accountingType` SET daysInFuture=1 WHERE id=8;
|
|
|
@ -1,4 +0,0 @@
|
||||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
|
||||||
VALUES
|
|
||||||
('ItemType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
|
||||||
('ItemType', '*', 'WRITE', 'ALLOW', 'ROLE', 'buyer');
|
|
|
@ -1,14 +0,0 @@
|
||||||
CREATE TABLE IF NOT EXISTS `vn`.`mdbBranch` (
|
|
||||||
`name` VARCHAR(255),
|
|
||||||
PRIMARY KEY(`name`)
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `vn`.`mdbVersion` (
|
|
||||||
`app` VARCHAR(255) NOT NULL,
|
|
||||||
`branchFk` VARCHAR(255) NOT NULL,
|
|
||||||
`version` INT,
|
|
||||||
CONSTRAINT `mdbVersion_branchFk` FOREIGN KEY (`branchFk`) REFERENCES `vn`.`mdbBranch` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT IGNORE INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
|
||||||
VALUES(318, 'MdbVersion', '*', '*', 'ALLOW', 'ROLE', 'developer');
|
|
|
@ -1,13 +0,0 @@
|
||||||
CREATE TABLE `vn`.`chat` (
|
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`senderFk` int(10) unsigned DEFAULT NULL,
|
|
||||||
`recipient` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
||||||
`dated` date DEFAULT NULL,
|
|
||||||
`checkUserStatus` tinyint(1) DEFAULT NULL,
|
|
||||||
`message` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
||||||
`status` tinyint(1) DEFAULT NULL,
|
|
||||||
`attempts` int(1) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
KEY `chat_FK` (`senderFk`),
|
|
||||||
CONSTRAINT `chat_FK` FOREIGN KEY (`senderFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
@ -1,8 +0,0 @@
|
||||||
ALTER TABLE `vn`.`creditInsurance` ADD creditClassificationFk int(11) NULL;
|
|
||||||
|
|
||||||
UPDATE `vn`.`creditInsurance` AS `destiny`
|
|
||||||
SET `destiny`.`creditClassificationFk`= (SELECT creditClassification FROM `vn`.`creditInsurance` AS `origin` WHERE `origin`.id = `destiny`.id);
|
|
||||||
|
|
||||||
ALTER TABLE `vn`.`creditInsurance`
|
|
||||||
ADD CONSTRAINT `creditInsurance_creditClassificationFk` FOREIGN KEY (`creditClassificationFk`)
|
|
||||||
REFERENCES `vn`.`creditClassification` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
@ -1,3 +0,0 @@
|
||||||
INSERT INTO `salix`.`defaultViewConfig` (tableCode, columns)
|
|
||||||
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}');
|
|
||||||
|
|
|
@ -1,127 +0,0 @@
|
||||||
DROP PROCEDURE IF EXISTS `vn`.`ticket_doRefund`;
|
|
||||||
|
|
||||||
DELIMITER $$
|
|
||||||
$$
|
|
||||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_doRefund`(OUT vNewTicket INT)
|
|
||||||
BEGIN
|
|
||||||
/**
|
|
||||||
* Crea un ticket de abono a partir de tmp.sale y/o tmp.ticketService
|
|
||||||
*
|
|
||||||
* @return vNewTicket
|
|
||||||
*/
|
|
||||||
DECLARE vDone BIT DEFAULT 0;
|
|
||||||
DECLARE vClientFk MEDIUMINT;
|
|
||||||
DECLARE vWarehouse TINYINT;
|
|
||||||
DECLARE vCompany MEDIUMINT;
|
|
||||||
DECLARE vAddress MEDIUMINT;
|
|
||||||
DECLARE vRefundAgencyMode INT;
|
|
||||||
DECLARE vItemFk INT;
|
|
||||||
DECLARE vQuantity DECIMAL (10,2);
|
|
||||||
DECLARE vConcept VARCHAR(50);
|
|
||||||
DECLARE vPrice DECIMAL (10,2);
|
|
||||||
DECLARE vDiscount TINYINT;
|
|
||||||
DECLARE vSaleNew INT;
|
|
||||||
DECLARE vSaleMain INT;
|
|
||||||
DECLARE vZoneFk INT;
|
|
||||||
DECLARE vDescription VARCHAR(50);
|
|
||||||
DECLARE vTaxClassFk INT;
|
|
||||||
DECLARE vTicketServiceTypeFk INT;
|
|
||||||
DECLARE vOriginTicket INT;
|
|
||||||
|
|
||||||
DECLARE cSales CURSOR FOR
|
|
||||||
SELECT s.id, s.itemFk, - s.quantity, s.concept, s.price, s.discount
|
|
||||||
FROM tmp.sale s;
|
|
||||||
|
|
||||||
DECLARE cTicketServices CURSOR FOR
|
|
||||||
SELECT ts.description, - ts.quantity, ts.price, ts.taxClassFk, ts.ticketServiceTypeFk
|
|
||||||
FROM tmp.ticketService ts;
|
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
|
||||||
|
|
||||||
SELECT sub.ticketFk INTO vOriginTicket
|
|
||||||
FROM (
|
|
||||||
SELECT s.ticketFk
|
|
||||||
FROM tmp.sale s
|
|
||||||
UNION ALL
|
|
||||||
SELECT ts.ticketFk
|
|
||||||
FROM tmp.ticketService ts
|
|
||||||
) sub
|
|
||||||
LIMIT 1;
|
|
||||||
|
|
||||||
SELECT id INTO vRefundAgencyMode
|
|
||||||
FROM agencyMode WHERE `name` = 'ABONO';
|
|
||||||
|
|
||||||
SELECT clientFk, warehouseFk, companyFk, addressFk
|
|
||||||
INTO vClientFk, vWarehouse, vCompany, vAddress
|
|
||||||
FROM ticket
|
|
||||||
WHERE id = vOriginTicket;
|
|
||||||
|
|
||||||
SELECT id INTO vZoneFk
|
|
||||||
FROM zone WHERE agencyModeFk = vRefundAgencyMode
|
|
||||||
LIMIT 1;
|
|
||||||
|
|
||||||
INSERT INTO vn.ticket (
|
|
||||||
clientFk,
|
|
||||||
shipped,
|
|
||||||
addressFk,
|
|
||||||
agencyModeFk,
|
|
||||||
nickname,
|
|
||||||
warehouseFk,
|
|
||||||
companyFk,
|
|
||||||
landed,
|
|
||||||
zoneFk
|
|
||||||
)
|
|
||||||
SELECT
|
|
||||||
vClientFk,
|
|
||||||
CURDATE(),
|
|
||||||
vAddress,
|
|
||||||
vRefundAgencyMode,
|
|
||||||
a.nickname,
|
|
||||||
vWarehouse,
|
|
||||||
vCompany,
|
|
||||||
CURDATE(),
|
|
||||||
vZoneFk
|
|
||||||
FROM address a
|
|
||||||
WHERE a.id = vAddress;
|
|
||||||
|
|
||||||
SET vNewTicket = LAST_INSERT_ID();
|
|
||||||
|
|
||||||
SET vDone := FALSE;
|
|
||||||
OPEN cSales;
|
|
||||||
FETCH cSales INTO vSaleMain, vItemFk, vQuantity, vConcept, vPrice, vDiscount;
|
|
||||||
|
|
||||||
WHILE NOT vDone DO
|
|
||||||
|
|
||||||
INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price, discount)
|
|
||||||
VALUES( vNewTicket, vItemFk, vQuantity, vConcept, vPrice, vDiscount );
|
|
||||||
|
|
||||||
SET vSaleNew = LAST_INSERT_ID();
|
|
||||||
|
|
||||||
INSERT INTO vn.saleComponent(saleFk,componentFk,`value`)
|
|
||||||
SELECT vSaleNew,componentFk,`value`
|
|
||||||
FROM vn.saleComponent
|
|
||||||
WHERE saleFk = vSaleMain;
|
|
||||||
|
|
||||||
FETCH cSales INTO vSaleMain, vItemFk, vQuantity, vConcept, vPrice, vDiscount;
|
|
||||||
|
|
||||||
END WHILE;
|
|
||||||
CLOSE cSales;
|
|
||||||
|
|
||||||
SET vDone := FALSE;
|
|
||||||
OPEN cTicketServices;
|
|
||||||
FETCH cTicketServices INTO vDescription, vQuantity, vPrice, vTaxClassFk, vTicketServiceTypeFk;
|
|
||||||
|
|
||||||
WHILE NOT vDone DO
|
|
||||||
|
|
||||||
INSERT INTO vn.ticketService(description, quantity, price, taxClassFk, ticketFk, ticketServiceTypeFk)
|
|
||||||
VALUES(vDescription, vQuantity, vPrice, vTaxClassFk, vNewTicket, vTicketServiceTypeFk);
|
|
||||||
|
|
||||||
FETCH cTicketServices INTO vDescription, vQuantity, vPrice, vTaxClassFk, vTicketServiceTypeFk;
|
|
||||||
|
|
||||||
END WHILE;
|
|
||||||
CLOSE cTicketServices;
|
|
||||||
|
|
||||||
INSERT INTO vn.ticketRefund(refundTicketFk, originalTicketFk)
|
|
||||||
VALUES(vNewTicket, vOriginTicket);
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,11 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
$$
|
|
||||||
CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`creditInsurance_beforeInsert`
|
|
||||||
BEFORE INSERT ON `creditInsurance`
|
|
||||||
FOR EACH ROW
|
|
||||||
BEGIN
|
|
||||||
IF NEW.creditClassificationFk THEN
|
|
||||||
SET NEW.creditClassification = NEW.creditClassificationFk;
|
|
||||||
END IF;
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1 +0,0 @@
|
||||||
RENAME TABLE `edi`.`fileConfig` to `edi`.`tableConfig`;
|
|
|
@ -1,22 +0,0 @@
|
||||||
CREATE TABLE `edi`.`fileConfig`
|
|
||||||
(
|
|
||||||
name varchar(25) NOT NULL,
|
|
||||||
checksum text NULL,
|
|
||||||
keyValue tinyint(1) default true NOT NULL,
|
|
||||||
constraint fileConfig_pk
|
|
||||||
primary key (name)
|
|
||||||
);
|
|
||||||
|
|
||||||
create unique index fileConfig_name_uindex
|
|
||||||
on `edi`.`fileConfig` (name);
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `edi`.`fileConfig` (name, checksum, keyValue)
|
|
||||||
VALUES ('FEC010104', null, 0);
|
|
||||||
|
|
||||||
INSERT INTO `edi`.`fileConfig` (name, checksum, keyValue)
|
|
||||||
VALUES ('VBN020101', null, 1);
|
|
||||||
|
|
||||||
INSERT INTO `edi`.`fileConfig` (name, checksum, keyValue)
|
|
||||||
VALUES ('florecompc2', null, 1);
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
ALTER TABLE `vn`.`chat` MODIFY COLUMN message TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL;
|
|
||||||
ALTER TABLE `vn`.`chat` MODIFY COLUMN dated DATETIME DEFAULT NULL NULL;
|
|
||||||
ALTER TABLE `vn`.`chat` ADD error TEXT NULL;
|
|
|
@ -1,3 +0,0 @@
|
||||||
ALTER TABLE `vn`.`creditInsurance`
|
|
||||||
ADD CONSTRAINT `creditInsurance_creditClassificationFk` FOREIGN KEY (`creditClassificationFk`)
|
|
||||||
REFERENCES `vn`.`creditClassification` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
@ -1,21 +0,0 @@
|
||||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
|
||||||
VALUES
|
|
||||||
('InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),
|
|
||||||
('InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),
|
|
||||||
('InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),
|
|
||||||
('Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),
|
|
||||||
('Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),
|
|
||||||
('Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),
|
|
||||||
('Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),
|
|
||||||
('Sale','refund','WRITE','ALLOW','ROLE','claimManager'),
|
|
||||||
('TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),
|
|
||||||
('ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),
|
|
||||||
('ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),
|
|
||||||
('Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),
|
|
||||||
('Client','updateUser','WRITE','ALLOW','ROLE','salesPerson');
|
|
||||||
|
|
||||||
DELETE FROM `salix`.`ACL` WHERE id=313;
|
|
||||||
|
|
||||||
UPDATE `salix`.`ACL`
|
|
||||||
SET principalId='invoicing'
|
|
||||||
WHERE id=297;
|
|
|
@ -1,3 +0,0 @@
|
||||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
|
||||||
VALUES
|
|
||||||
('ShelvingLog','*','READ','ALLOW','ROLE','employee');
|
|
|
@ -1,4 +0,0 @@
|
||||||
INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
|
||||||
VALUES
|
|
||||||
('ZoneExclusionGeo', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
|
||||||
('ZoneExclusionGeo', '*', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss');
|
|
|
@ -1,2 +0,0 @@
|
||||||
ALTER TABLE `vn2008`.`albaran_gestdoc` DROP FOREIGN KEY fk_albaran_gestdoc_gestdoc1;
|
|
||||||
ALTER TABLE `vn2008`.`albaran_gestdoc` ADD CONSTRAINT albaran_gestdoc_FK FOREIGN KEY (gestdoc_id) REFERENCES `vn`.`dms`(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
@ -1,3 +0,0 @@
|
||||||
alter table `vn`.`client`
|
|
||||||
add hasIncoterms tinyint(1) default 0 not null comment 'Received incoterms authorization from client';
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
DROP FUNCTION `account`.`userGetId`;
|
|
||||||
DROP FUNCTION `account`.`myUserGetName`;
|
|
||||||
DROP FUNCTION `account`.`myUserGetId`;
|
|
||||||
DROP FUNCTION `account`.`myUserHasRole`;
|
|
||||||
DROP FUNCTION `account`.`myUserHasRoleId`;
|
|
||||||
DROP FUNCTION `account`.`userGetName`;
|
|
||||||
DROP FUNCTION `account`.`userHasRole`;
|
|
||||||
DROP FUNCTION `account`.`userHasRoleId`;
|
|
||||||
DROP PROCEDURE `account`.`myUserLogout`;
|
|
||||||
DROP PROCEDURE `account`.`userLogin`;
|
|
||||||
DROP PROCEDURE `account`.`userLoginWithKey`;
|
|
||||||
DROP PROCEDURE `account`.`userLoginWithName`;
|
|
||||||
DROP PROCEDURE `account`.`userSetPassword`;
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE `vn`.`item` MODIFY COLUMN description TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL;
|
|
|
@ -1,10 +0,0 @@
|
||||||
UPDATE `vn`.`route` r
|
|
||||||
JOIN(SELECT r.id, wl.workcenterFk
|
|
||||||
FROM `vn`.`route` r
|
|
||||||
JOIN `vn`.`routeLog` rl ON rl.originFk = r.id
|
|
||||||
JOIN `vn`.`workerLabour` wl ON wl.workerFk = rl.userFk
|
|
||||||
AND r.created BETWEEN wl.started AND IFNULL(wl.ended, r.created)
|
|
||||||
WHERE r.created BETWEEN '2021-12-01' AND CURDATE()
|
|
||||||
AND rl.action = 'insert'
|
|
||||||
)sub ON sub.id = r.id
|
|
||||||
SET r.commissionWorkCenterFk = sub.workcenterFk;
|
|
|
@ -1,2 +0,0 @@
|
||||||
INSERT INTO `vn`.`sample` (code, description, isVisible, hasCompany, hasPreview, datepickerEnabled)
|
|
||||||
VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 1, 1, 0);
|
|
|
@ -1,18 +0,0 @@
|
||||||
ALTER TABLE `vn`.`itemShelving` DROP FOREIGN KEY itemShelving_fk2;
|
|
||||||
ALTER TABLE `vn`.`shelvingLog` DROP FOREIGN KEY shelvingLog_FK_ibfk_1;
|
|
||||||
ALTER TABLE `vn`.`smartTag` DROP FOREIGN KEY smartTag_shelving_fk;
|
|
||||||
ALTER TABLE `vn`.`workerShelving` DROP FOREIGN KEY workerShelving_shelving_fk;
|
|
||||||
|
|
||||||
ALTER TABLE `vn`.`shelving` DROP PRIMARY KEY;
|
|
||||||
ALTER TABLE `vn`.`shelving` ADD id INT auto_increment PRIMARY KEY NULL;
|
|
||||||
ALTER TABLE `vn`.`shelving` CHANGE id id int(11) auto_increment NOT NULL FIRST;
|
|
||||||
ALTER TABLE `vn`.`shelving` ADD CONSTRAINT shelving_UN UNIQUE KEY (code);
|
|
||||||
|
|
||||||
ALTER TABLE `vn`.`itemShelving` ADD CONSTRAINT itemShelving_fk2 FOREIGN KEY (shelvingFk) REFERENCES `vn`.`shelving`(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
||||||
ALTER TABLE `vn`.`shelvingLog` ADD CONSTRAINT shelvingLog_FK_ibfk_1 FOREIGN KEY (originFk) REFERENCES `vn`.`shelving`(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
||||||
ALTER TABLE `vn`.`smartTag` ADD CONSTRAINT smartTag_FK FOREIGN KEY (shelvingFk) REFERENCES `vn`.`shelving`(code) ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
||||||
ALTER TABLE `vn`.`workerShelving` ADD CONSTRAINT workerShelving_FK_1 FOREIGN KEY (shelvingFk) REFERENCES `vn`.`shelving`(code) ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
||||||
|
|
||||||
ALTER TABLE vn.shelvingLog DROP FOREIGN KEY shelvingLog_FK_ibfk_1;
|
|
||||||
ALTER TABLE vn.shelvingLog MODIFY COLUMN originFk INT NOT NULL;
|
|
||||||
ALTER TABLE vn.shelvingLog ADD CONSTRAINT shelvingLog_FK FOREIGN KEY (originFk) REFERENCES vn.shelving(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
@ -1,21 +0,0 @@
|
||||||
DROP PROCEDURE IF EXISTS `vn`.`ticketRefund_beforeUpsert`;
|
|
||||||
|
|
||||||
DELIMITER $$
|
|
||||||
$$
|
|
||||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticketRefund_beforeUpsert`(vRefundTicketFk INT, vOriginalTicketFk INT)
|
|
||||||
BEGIN
|
|
||||||
DECLARE vAlreadyExists BOOLEAN DEFAULT FALSE;
|
|
||||||
|
|
||||||
IF vRefundTicketFk = vOriginalTicketFk THEN
|
|
||||||
CALL util.throw('Original ticket and refund ticket has same id');
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
SELECT COUNT(*) INTO vAlreadyExists
|
|
||||||
FROM ticketRefund
|
|
||||||
WHERE originalTicketFk = vOriginalTicketFk;
|
|
||||||
|
|
||||||
IF vAlreadyExists > 0 THEN
|
|
||||||
CALL util.throw('This ticket is already a refund');
|
|
||||||
END IF;
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,13 +0,0 @@
|
||||||
CREATE TABLE `vn`.`claimObservation` (
|
|
||||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
|
||||||
`claimFk` int(10) unsigned NOT NULL,
|
|
||||||
`workerFk` int(10) unsigned DEFAULT NULL,
|
|
||||||
`text` text COLLATE utf8_unicode_ci NOT NULL,
|
|
||||||
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
KEY `worker_key` (`workerFk`),
|
|
||||||
KEY `claim_key` (`claimFk`),
|
|
||||||
KEY `claimObservation_created_IDX` (`created`) USING BTREE,
|
|
||||||
CONSTRAINT `claimObservation_ibfk_1` FOREIGN KEY (`claimFk`) REFERENCES `vn`.`claim` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
||||||
CONSTRAINT `claimObservation_ibfk_2` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE
|
|
||||||
) COMMENT='Todas las observaciones referentes a una reclamación'
|
|
|
@ -1,2 +0,0 @@
|
||||||
INSERT INTO `vn`.`claimObservation` (`claimFk`, `text`, `created`)
|
|
||||||
SELECT `id`, `observation`, `created` FROM `vn`.`claim`
|
|
|
@ -1,2 +0,0 @@
|
||||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
|
||||||
VALUES ('Parking','*','*','ALLOW','ROLE','employee')
|
|
|
@ -1,2 +0,0 @@
|
||||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
|
||||||
VALUES ('Shelving','*','*','ALLOW','ROLE','employee')
|
|
|
@ -1,3 +0,0 @@
|
||||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
|
||||||
VALUES
|
|
||||||
('OsTicketConfig', '*', '*', 'ALLOW', 'ROLE', 'it');
|
|
|
@ -1,16 +0,0 @@
|
||||||
CREATE TABLE `vn`.`osTicketConfig` (
|
|
||||||
`id` int(11) NOT NULL,
|
|
||||||
`host` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`user` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`password` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`oldStatus` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`newStatusId` int(11) DEFAULT NULL,
|
|
||||||
`action` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`day` int(11) DEFAULT NULL,
|
|
||||||
`comment` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`hostDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`userDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`passwordDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
|
|
||||||
`portDb` int(11) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
|
|
@ -1 +0,0 @@
|
||||||
Delete this file
|
|
|
@ -12,14 +12,9 @@ BEGIN
|
||||||
* @param vAuthorFk The notification author or %NULL if there is no author
|
* @param vAuthorFk The notification author or %NULL if there is no author
|
||||||
* @return The notification id
|
* @return The notification id
|
||||||
*/
|
*/
|
||||||
DECLARE vNotificationFk INT;
|
|
||||||
|
|
||||||
SELECT id INTO vNotificationFk
|
|
||||||
FROM `notification`
|
|
||||||
WHERE `name` = vNotificationName;
|
|
||||||
|
|
||||||
INSERT INTO notificationQueue
|
INSERT INTO notificationQueue
|
||||||
SET notificationFk = vNotificationFk,
|
SET notificationFk = vNotificationName,
|
||||||
params = vParams,
|
params = vParams,
|
||||||
authorFk = vAuthorFk;
|
authorFk = vAuthorFk;
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
||||||
VALUES
|
VALUES
|
||||||
('OsTicket', '*', '*', 'ALLOW', 'ROLE', 'employee');
|
('TicketLog', 'getChanges', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE `vn`.`entry` DROP COLUMN `ref`;
|
|
@ -0,0 +1,12 @@
|
||||||
|
CREATE TABLE `vn`.`invoiceInConfig` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`retentionRate` int(3) NOT NULL,
|
||||||
|
`retentionName` varchar(25) NOT NULL,
|
||||||
|
`sageWithholdingFk` smallint(6) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
CONSTRAINT `invoiceInConfig_sageWithholdingFk` FOREIGN KEY (`sageWithholdingFk`) REFERENCES `sage`.`TiposRetencion`(`CodigoRetencion`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`invoiceInConfig` (`id`, `retentionRate`, `retentionName`, `sageWithholdingFk`)
|
||||||
|
VALUES
|
||||||
|
(1, -2, 'Retención 2%', 2);
|
|
@ -0,0 +1,46 @@
|
||||||
|
DROP TRIGGER IF EXISTS `vn`.`supplier_beforeUpdate`;
|
||||||
|
USE `vn`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
$$
|
||||||
|
CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`supplier_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `supplier`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
DECLARE vHasChange BOOL;
|
||||||
|
DECLARE vPayMethodChanged BOOL;
|
||||||
|
DECLARE vPayMethodHasVerified BOOL;
|
||||||
|
DECLARE vParams JSON;
|
||||||
|
DECLARE vOldPayMethodName VARCHAR(20);
|
||||||
|
DECLARE vNewPayMethodName VARCHAR(20);
|
||||||
|
|
||||||
|
SELECT hasVerified INTO vPayMethodHasVerified
|
||||||
|
FROM payMethod
|
||||||
|
WHERE id = NEW.payMethodFk;
|
||||||
|
|
||||||
|
SET vPayMethodChanged = NOT(NEW.payMethodFk <=> OLD.payMethodFk);
|
||||||
|
|
||||||
|
IF vPayMethodChanged THEN
|
||||||
|
SELECT name INTO vOldPayMethodName
|
||||||
|
FROM payMethod
|
||||||
|
WHERE id = OLD.payMethodFk;
|
||||||
|
SELECT name INTO vNewPayMethodName
|
||||||
|
FROM payMethod
|
||||||
|
WHERE id = NEW.payMethodFk;
|
||||||
|
|
||||||
|
SET vParams = JSON_OBJECT(
|
||||||
|
'name', NEW.name,
|
||||||
|
'oldPayMethod', vOldPayMethodName,
|
||||||
|
'newPayMethod', vNewPayMethodName
|
||||||
|
);
|
||||||
|
SELECT util.notification_send('supplier-pay-method-update', vParams, NULL) INTO @id;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SET vHasChange = NOT(NEW.payDemFk <=> OLD.payDemFk AND NEW.payDay <=> OLD.payDay) OR vPayMethodChanged;
|
||||||
|
|
||||||
|
IF vHasChange AND vPayMethodHasVerified THEN
|
||||||
|
SET NEW.isPayMethodChecked = FALSE;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
||||||
|
CREATE TABLE `vn`.`ticketSms` (
|
||||||
|
`smsFk` mediumint(8) unsigned NOT NULL,
|
||||||
|
`ticketFk` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`smsFk`),
|
||||||
|
KEY `ticketSms_FK_1` (`ticketFk`),
|
||||||
|
CONSTRAINT `ticketSms_FK` FOREIGN KEY (`smsFk`) REFERENCES `sms` (`id`) ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `ticketSms_FK_1` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci
|
|
@ -0,0 +1,104 @@
|
||||||
|
DROP PROCEDURE IF EXISTS `vn`.`ticket_canAdvance`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
$$
|
||||||
|
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_canAdvance`(vDateFuture DATE, vDateToAdvance DATE, vWarehouseFk INT)
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Devuelve los tickets y la cantidad de lineas de venta que se pueden adelantar.
|
||||||
|
*
|
||||||
|
* @param vDateFuture Fecha de los tickets que se quieren adelantar.
|
||||||
|
* @param vDateToAdvance Fecha a cuando se quiere adelantar.
|
||||||
|
* @param vWarehouseFk Almacén
|
||||||
|
*/
|
||||||
|
|
||||||
|
DECLARE vDateInventory DATE;
|
||||||
|
|
||||||
|
SELECT inventoried INTO vDateInventory FROM vn.config;
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp.stock;
|
||||||
|
CREATE TEMPORARY TABLE tmp.stock
|
||||||
|
(itemFk INT PRIMARY KEY,
|
||||||
|
amount INT)
|
||||||
|
ENGINE = MEMORY;
|
||||||
|
|
||||||
|
INSERT INTO tmp.stock(itemFk, amount)
|
||||||
|
SELECT itemFk, SUM(quantity) amount FROM
|
||||||
|
(
|
||||||
|
SELECT itemFk, quantity
|
||||||
|
FROM vn.itemTicketOut
|
||||||
|
WHERE shipped >= vDateInventory
|
||||||
|
AND shipped < vDateFuture
|
||||||
|
AND warehouseFk = vWarehouseFk
|
||||||
|
UNION ALL
|
||||||
|
SELECT itemFk, quantity
|
||||||
|
FROM vn.itemEntryIn
|
||||||
|
WHERE landed >= vDateInventory
|
||||||
|
AND landed < vDateFuture
|
||||||
|
AND isVirtualStock = FALSE
|
||||||
|
AND warehouseInFk = vWarehouseFk
|
||||||
|
UNION ALL
|
||||||
|
SELECT itemFk, quantity
|
||||||
|
FROM vn.itemEntryOut
|
||||||
|
WHERE shipped >= vDateInventory
|
||||||
|
AND shipped < vDateFuture
|
||||||
|
AND warehouseOutFk = vWarehouseFk
|
||||||
|
) t
|
||||||
|
GROUP BY itemFk HAVING amount != 0;
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp.filter;
|
||||||
|
CREATE TEMPORARY TABLE tmp.filter
|
||||||
|
(INDEX (id))
|
||||||
|
SELECT s.ticketFk futureId,
|
||||||
|
t2.ticketFk id,
|
||||||
|
sum((s.quantity <= IFNULL(st.amount,0))) hasStock,
|
||||||
|
count(DISTINCT s.id) saleCount,
|
||||||
|
t2.state,
|
||||||
|
t2.stateCode,
|
||||||
|
st.name futureState,
|
||||||
|
st.code futureStateCode,
|
||||||
|
GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) futureIpt,
|
||||||
|
t2.ipt,
|
||||||
|
t.workerFk,
|
||||||
|
CAST(sum(litros) AS DECIMAL(10,0)) liters,
|
||||||
|
CAST(count(*) AS DECIMAL(10,0)) `lines`,
|
||||||
|
t2.shipped,
|
||||||
|
t.shipped futureShipped,
|
||||||
|
t2.totalWithVat,
|
||||||
|
t.totalWithVat futureTotalWithVat
|
||||||
|
FROM vn.ticket t
|
||||||
|
JOIN vn.ticketState ts ON ts.ticketFk = t.id
|
||||||
|
JOIN vn.state st ON st.id = ts.stateFk
|
||||||
|
JOIN vn.saleVolume sv ON t.id = sv.ticketFk
|
||||||
|
JOIN (SELECT
|
||||||
|
t2.id ticketFk,
|
||||||
|
t2.addressFk,
|
||||||
|
st.name state,
|
||||||
|
st.code stateCode,
|
||||||
|
GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) ipt,
|
||||||
|
t2.shipped,
|
||||||
|
t2.totalWithVat
|
||||||
|
FROM vn.ticket t2
|
||||||
|
JOIN vn.sale s ON s.ticketFk = t2.id
|
||||||
|
JOIN vn.item i ON i.id = s.itemFk
|
||||||
|
JOIN vn.ticketState ts ON ts.ticketFk = t2.id
|
||||||
|
JOIN vn.state st ON st.id = ts.stateFk
|
||||||
|
LEFT JOIN vn.itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
|
||||||
|
WHERE t2.shipped BETWEEN vDateToAdvance AND util.dayend(vDateToAdvance)
|
||||||
|
AND t2.warehouseFk = vWarehouseFk
|
||||||
|
GROUP BY t2.id) t2 ON t2.addressFk = t.addressFk
|
||||||
|
JOIN vn.sale s ON s.ticketFk = t.id
|
||||||
|
JOIN vn.item i ON i.id = s.itemFk
|
||||||
|
LEFT JOIN vn.itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
|
||||||
|
LEFT JOIN tmp.stock st ON st.itemFk = s.itemFk
|
||||||
|
WHERE t.shipped BETWEEN vDateFuture AND util.dayend(vDateFuture)
|
||||||
|
AND t.warehouseFk = vWarehouseFk
|
||||||
|
GROUP BY t.id;
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE tmp.stock;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
||||||
|
|
||||||
|
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||||
|
VALUES
|
||||||
|
('Ticket', 'getTicketsAdvance', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1,73 @@
|
||||||
|
DROP PROCEDURE IF EXISTS `vn`.`ticket_canbePostponed`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
$$
|
||||||
|
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_canbePostponed`(vOriginDated DATE, vFutureDated DATE, vWarehouseFk INT)
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Devuelve un listado de tickets susceptibles de fusionarse con otros tickets en el futuro
|
||||||
|
*
|
||||||
|
* @param vOriginDated Fecha en cuestión
|
||||||
|
* @param vFutureDated Fecha en el futuro a sondear
|
||||||
|
* @param vWarehouseFk Identificador de vn.warehouse
|
||||||
|
*/
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp.filter;
|
||||||
|
CREATE TEMPORARY TABLE tmp.filter
|
||||||
|
(INDEX (id))
|
||||||
|
SELECT sv.ticketFk id,
|
||||||
|
sub2.id futureId,
|
||||||
|
GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) ipt,
|
||||||
|
CAST(sum(litros) AS DECIMAL(10,0)) liters,
|
||||||
|
CAST(count(*) AS DECIMAL(10,0)) `lines`,
|
||||||
|
st.name state,
|
||||||
|
sub2.iptd futureIpt,
|
||||||
|
sub2.state futureState,
|
||||||
|
t.clientFk,
|
||||||
|
t.warehouseFk,
|
||||||
|
ts.alertLevel,
|
||||||
|
t.shipped,
|
||||||
|
sub2.shipped futureShipped,
|
||||||
|
t.workerFk,
|
||||||
|
st.code stateCode,
|
||||||
|
sub2.code futureStateCode
|
||||||
|
FROM vn.saleVolume sv
|
||||||
|
JOIN vn.sale s ON s.id = sv.saleFk
|
||||||
|
JOIN vn.item i ON i.id = s.itemFk
|
||||||
|
JOIN vn.ticket t ON t.id = sv.ticketFk
|
||||||
|
JOIN vn.address a ON a.id = t.addressFk
|
||||||
|
JOIN vn.province p ON p.id = a.provinceFk
|
||||||
|
JOIN vn.country c ON c.id = p.countryFk
|
||||||
|
JOIN vn.ticketState ts ON ts.ticketFk = t.id
|
||||||
|
JOIN vn.state st ON st.id = ts.stateFk
|
||||||
|
JOIN vn.alertLevel al ON al.id = ts.alertLevel
|
||||||
|
LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT *
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
t.addressFk,
|
||||||
|
t.id,
|
||||||
|
t.shipped,
|
||||||
|
st.name state,
|
||||||
|
st.code code,
|
||||||
|
GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) iptd
|
||||||
|
FROM vn.ticket t
|
||||||
|
JOIN vn.ticketState ts ON ts.ticketFk = t.id
|
||||||
|
JOIN vn.state st ON st.id = ts.stateFk
|
||||||
|
JOIN vn.sale s ON s.ticketFk = t.id
|
||||||
|
JOIN vn.item i ON i.id = s.itemFk
|
||||||
|
WHERE t.shipped BETWEEN vFutureDated
|
||||||
|
AND util.dayend(vFutureDated)
|
||||||
|
AND t.warehouseFk = vWarehouseFk
|
||||||
|
GROUP BY t.id
|
||||||
|
) sub
|
||||||
|
GROUP BY sub.addressFk
|
||||||
|
) sub2 ON sub2.addressFk = t.addressFk AND t.id != sub2.id
|
||||||
|
WHERE t.shipped BETWEEN vOriginDated AND util.dayend(vOriginDated)
|
||||||
|
AND t.warehouseFk = vWarehouseFk
|
||||||
|
AND al.code = 'FREE'
|
||||||
|
AND tp.ticketFk IS NULL
|
||||||
|
GROUP BY sv.ticketFk
|
||||||
|
HAVING futureId;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,2 @@
|
||||||
|
DROP PROCEDURE IF EXISTS `ticket_split`;
|
||||||
|
DROP PROCEDURE IF EXISTS `ticket_merge`;
|
|
@ -0,0 +1,60 @@
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'supplier'
|
||||||
|
WHERE t.code LIKE 'Suppliers' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'travel'
|
||||||
|
WHERE t.code LIKE 'Travels' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'ticket'
|
||||||
|
WHERE t.code LIKE 'Tickets' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'zone'
|
||||||
|
WHERE t.code LIKE 'Zones' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'monitor'
|
||||||
|
WHERE t.code LIKE 'Monitors' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'entry'
|
||||||
|
WHERE t.code LIKE 'Entries' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'invoiceIn'
|
||||||
|
WHERE t.code LIKE 'Invoices in' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'customer'
|
||||||
|
WHERE t.code LIKE 'Clients' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'route'
|
||||||
|
WHERE t.code LIKE 'Routes' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'item'
|
||||||
|
WHERE t.code LIKE 'Items' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'claim'
|
||||||
|
WHERE t.code LIKE 'Claims' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'user'
|
||||||
|
WHERE t.code LIKE 'Users' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'invoiceOut'
|
||||||
|
WHERE t.code LIKE 'Invoices out' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'order'
|
||||||
|
WHERE t.code LIKE 'Orders' ESCAPE '#';
|
||||||
|
|
||||||
|
UPDATE salix.module t
|
||||||
|
SET t.code = 'worker'
|
||||||
|
WHERE t.code LIKE 'Workers' ESCAPE '#';
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'customer' WHERE moduleFk = 'Clients';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'ticket' WHERE moduleFk = 'Tickets';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'route' WHERE moduleFk = 'Routes';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'zone' WHERE moduleFk = 'Zones';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'order' WHERE moduleFk = 'Orders';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'claim' WHERE moduleFk = 'Claims';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'item' WHERE moduleFk = 'Items';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'worker' WHERE moduleFk = 'Workers';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'entry' WHERE moduleFk = 'Entries';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'invoiceOut' WHERE moduleFk = 'Invoices out';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'invoiceIn' WHERE moduleFk = 'Invoices in';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'monitor' WHERE moduleFk = 'Monitors';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'user' WHERE moduleFk = 'Users';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'supplier' WHERE moduleFk = 'Suppliers';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'travel' WHERE moduleFk = 'Travels';
|
||||||
|
UPDATE `vn`.starredModule SET moduleFk = 'shelving' WHERE moduleFk = 'Shelvings';
|
File diff suppressed because one or more lines are too long
|
@ -60,7 +60,7 @@ INSERT INTO `vn`.`educationLevel` (`id`, `name`)
|
||||||
|
|
||||||
INSERT INTO `vn`.`worker`(`id`,`code`, `firstName`, `lastName`, `userFk`, `bossFk`)
|
INSERT INTO `vn`.`worker`(`id`,`code`, `firstName`, `lastName`, `userFk`, `bossFk`)
|
||||||
SELECT id,UPPER(LPAD(role, 3, '0')), name, name, id, 9
|
SELECT id,UPPER(LPAD(role, 3, '0')), name, name, id, 9
|
||||||
FROM `vn`.`user`;
|
FROM `account`.`user`;
|
||||||
|
|
||||||
UPDATE `vn`.`worker` SET bossFk = NULL WHERE id = 20;
|
UPDATE `vn`.`worker` SET bossFk = NULL WHERE id = 20;
|
||||||
UPDATE `vn`.`worker` SET bossFk = 20 WHERE id = 1 OR id = 9;
|
UPDATE `vn`.`worker` SET bossFk = 20 WHERE id = 1 OR id = 9;
|
||||||
|
@ -105,20 +105,8 @@ INSERT INTO `account`.`mailForward`(`account`, `forwardTo`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'employee@domain.local');
|
(1, 'employee@domain.local');
|
||||||
|
|
||||||
INSERT INTO `vn`.`printer` (`id`, `name`, `path`, `isLabeler`)
|
|
||||||
VALUES
|
|
||||||
(1, 'printer1', 'path1', 0),
|
|
||||||
(2, 'printer2', 'path2', 1);
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk`)
|
|
||||||
VALUES
|
|
||||||
(1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106, NULL, NULL),
|
|
||||||
(1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107, NULL, 1),
|
|
||||||
(1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108, 1, NULL),
|
|
||||||
(1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109, 1, 2),
|
|
||||||
(1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110, 2, 1);
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
|
INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'EUR', 'Euro', 1),
|
(1, 'EUR', 'Euro', 1),
|
||||||
|
@ -159,6 +147,19 @@ INSERT INTO `vn`.`sector`(`id`, `description`, `warehouseFk`, `isPreviousPrepare
|
||||||
(1, 'First sector', 1, 1, 'FIRST'),
|
(1, 'First sector', 1, 1, 'FIRST'),
|
||||||
(2, 'Second sector', 2, 0, 'SECOND');
|
(2, 'Second sector', 2, 0, 'SECOND');
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`printer` (`id`, `name`, `path`, `isLabeler`, `sectorFk`)
|
||||||
|
VALUES
|
||||||
|
(1, 'printer1', 'path1', 0, 1),
|
||||||
|
(2, 'printer2', 'path2', 1, 1);
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk`)
|
||||||
|
VALUES
|
||||||
|
(1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106, NULL, NULL),
|
||||||
|
(1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107, NULL, NULL),
|
||||||
|
(1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108, 1, NULL),
|
||||||
|
(1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109, 1, NULL),
|
||||||
|
(1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110, 2, NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`)
|
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', 700, '01', 1, '700-01', 70001),
|
('1', 700, '01', 1, '700-01', 70001),
|
||||||
|
@ -216,18 +217,18 @@ INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
|
||||||
(3, 'PICKUP', 'Recogida'),
|
(3, 'PICKUP', 'Recogida'),
|
||||||
(4, 'OTHER', 'Otros');
|
(4, 'OTHER', 'Otros');
|
||||||
|
|
||||||
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `bankFk__`, `warehouseAliasFk`)
|
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `warehouseAliasFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'inhouse pickup' , 1, 1, 1),
|
(1, 'inhouse pickup' , 1, 1),
|
||||||
(2, 'Super-Man delivery' , 1, 1, 1),
|
(2, 'Super-Man delivery' , 1, 1),
|
||||||
(3, 'Teleportation device' , 1, 1, 1),
|
(3, 'Teleportation device' , 1, 1),
|
||||||
(4, 'Entanglement' , 1, 1, 1),
|
(4, 'Entanglement' , 1, 1),
|
||||||
(5, 'Quantum break device' , 1, 1, 1),
|
(5, 'Quantum break device' , 1, 1),
|
||||||
(6, 'Walking' , 1, 1, 1),
|
(6, 'Walking' , 1, 1),
|
||||||
(7, 'Gotham247' , 1, 1, 1),
|
(7, 'Gotham247' , 1, 1),
|
||||||
(8, 'Gotham247Expensive' , 1, 1, 1),
|
(8, 'Gotham247Expensive' , 1, 1),
|
||||||
(9, 'Refund' , 1, 1, 1),
|
(9, 'Refund' , 1, 1),
|
||||||
(10, 'Other agency' , 1, 1, 1);
|
(10, 'Other agency' , 1, 1);
|
||||||
|
|
||||||
UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
|
UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
|
||||||
UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
|
UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
|
||||||
|
@ -689,7 +690,8 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF
|
||||||
(27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
|
(27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
|
||||||
(28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
|
(28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
|
||||||
(29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
|
(29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()),
|
||||||
(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());
|
(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()),
|
||||||
|
(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());
|
||||||
|
|
||||||
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
|
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -921,21 +923,21 @@ INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`)
|
||||||
(3, 'Perdida', 'LOST');
|
(3, 'Perdida', 'LOST');
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `itemFk__`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
|
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 15, 1, 18, 'UR9000006041', 94, 1, 'pc1'),
|
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, 'UR9000006041', 94, 1, 'pc1'),
|
||||||
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 16, 2, 18, 'UR9000006041', 94, 1, NULL),
|
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 18, 'UR9000006041', 94, 1, NULL),
|
||||||
(3, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 3, 18, 'UR9000006041', 94, 2, NULL),
|
(3, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 18, 'UR9000006041', 94, 2, NULL),
|
||||||
(4, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 4, 18, 'UR9000006041', 94, 2, NULL),
|
(4, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 18, 'UR9000006041', 94, 2, NULL),
|
||||||
(5, 1, 2, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 18, NULL, 94, 3, NULL),
|
(5, 1, 2, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, NULL, 94, 3, NULL),
|
||||||
(6, 7, 3, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 1, 18, NULL, 94, 3, NULL),
|
(6, 7, 3, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 18, NULL, 94, 3, NULL),
|
||||||
(7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, 1, 18, NULL, 94, NULL,NULL),
|
(7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 1, 18, NULL, 94, NULL,NULL),
|
||||||
(8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, 1, 18, NULL, 94, 1, NULL),
|
(8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 1, 18, NULL, 94, 1, NULL),
|
||||||
(9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 18, NULL, 94, 2, NULL),
|
(9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, NULL, 94, 2, NULL),
|
||||||
(10, 7, 7, 71, NOW(), NULL, 1, 18, NULL, 94, 3, NULL),
|
(10, 7, 7, 71, NOW(), 1, 18, NULL, 94, 3, NULL),
|
||||||
(11, 7, 8, 71, NOW(), NULL, 1, 18, NULL, 94, 3, NULL),
|
(11, 7, 8, 71, NOW(), 1, 18, NULL, 94, 3, NULL),
|
||||||
(12, 7, 9, 71, NOW(), NULL, 1, 18, NULL, 94, 3, NULL),
|
(12, 7, 9, 71, NOW(), 1, 18, NULL, 94, 3, NULL),
|
||||||
(13, 1, 10,71, NOW(), NULL, 1, 18, NULL, 94, 3, NULL);
|
(13, 1, 10,71, NOW(), 1, 18, NULL, 94, 3, NULL);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`expeditionState`(`id`, `created`, `expeditionFk`, `typeFk`, `userFk`)
|
INSERT INTO `vn`.`expeditionState`(`id`, `created`, `expeditionFk`, `typeFk`, `userFk`)
|
||||||
|
@ -990,7 +992,8 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
|
||||||
(33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE()),
|
(33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE()),
|
||||||
(34, 4, 28, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
(34, 4, 28, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||||
(35, 4, 29, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
(35, 4, 29, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||||
(36, 4, 30, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE());
|
(36, 4, 30, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||||
|
(37, 4, 31, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE());
|
||||||
|
|
||||||
INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`)
|
INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1132,11 +1135,11 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
||||||
(32, 36, -92.324),
|
(32, 36, -92.324),
|
||||||
(32, 39, 0.994);
|
(32, 39, 0.994);
|
||||||
|
|
||||||
INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `shelve`, `visible`, `grouping`, `packing`, `userFk`)
|
INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `visible`, `grouping`, `packing`, `userFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(2, 'GVC', 'A', 1, 1, 1, 1106),
|
(2, 'GVC', 1, 1, 1, 1106),
|
||||||
(4, 'HEJ', 'A', 1, 1, 1, 1106),
|
(4, 'HEJ', 1, 1, 1, 1106),
|
||||||
(1, 'UXN', 'A', 2, 12, 12, 1106);
|
(1, 'UXN', 2, 12, 12, 1106);
|
||||||
|
|
||||||
INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `created`, `userFk`)
|
INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `created`, `userFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1377,16 +1380,16 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
|
||||||
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1),
|
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1),
|
||||||
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2);
|
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2);
|
||||||
|
|
||||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `ref`,`isExcludedFromAvailable`, `isRaid`, `notes`, `evaNotes`)
|
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `isRaid`, `notes`, `evaNotes`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'Movement 1', 0, 0, '', ''),
|
(1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 1', 0, 0, '', ''),
|
||||||
(2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
|
(2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'IN2002', 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
|
||||||
(3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
|
(3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'IN2003', 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
|
||||||
(4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
|
(4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'IN2004', 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
|
||||||
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
|
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
|
||||||
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
|
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
|
||||||
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
|
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
|
||||||
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 8', 1, 1, '', '');
|
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, 1, '', '');
|
||||||
|
|
||||||
INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`)
|
INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1406,23 +1409,23 @@ INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeF
|
||||||
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Miscellaneous Accessories', 6, 1, '186', '0', '0.0'),
|
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Miscellaneous Accessories', 6, 1, '186', '0', '0.0'),
|
||||||
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Adhesives', 7, 1, '277', '0', '0.0');
|
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Adhesives', 7, 1, '277', '0', '0.0');
|
||||||
|
|
||||||
INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packageFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`,`producer`,`printedStickers`,`isChecked`,`isIgnored`,`weight`, `created`)
|
INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packageFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`, `printedStickers`,`isChecked`,`isIgnored`,`weight`, `created`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
|
(1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
|
||||||
(2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
(2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||||
(3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 0, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, util.VN_CURDATE()),
|
(3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 0, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE()),
|
||||||
(4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, 0, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
(4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, 0, NULL, 0.00, 7.30, 7.00, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
||||||
(5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, 0, NULL, 0.00, 78.3, 75.6, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
(5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, 0, NULL, 0.00, 78.3, 75.6, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
||||||
(6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
(6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
||||||
(7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 30.50, 29.00, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
(7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 30.50, 29.00, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
||||||
(8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
(8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 2.5, util.VN_CURDATE()),
|
||||||
(9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()),
|
(9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, util.VN_CURDATE()),
|
(10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()),
|
(11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()),
|
(12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, util.VN_CURDATE()),
|
(13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 4, util.VN_CURDATE()),
|
(14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, 0, 1, 0, 4, util.VN_CURDATE()),
|
||||||
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE());
|
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE());
|
||||||
|
|
||||||
INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_id`, `agency_id`, `address_id`, `company_id`, `note`, `source_app`, `confirmed`,`total`, `date_make`, `first_row_stamp`, `confirm_date`)
|
INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_id`, `agency_id`, `address_id`, `company_id`, `note`, `source_app`, `confirmed`,`total`, `date_make`, `first_row_stamp`, `confirm_date`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1951,30 +1954,34 @@ INSERT INTO `vn`.`workerBusinessType` (`id`, `name`, `isFullTime`, `isPermanent`
|
||||||
(100, 'INDEFINIDO A TIEMPO COMPLETO', 1, 1, 1),
|
(100, 'INDEFINIDO A TIEMPO COMPLETO', 1, 1, 1),
|
||||||
(109, 'CONVERSION DE TEMPORAL EN INDEFINIDO T.COMPLETO', 1, 1, 1);
|
(109, 'CONVERSION DE TEMPORAL EN INDEFINIDO T.COMPLETO', 1, 1, 1);
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`businessCategory` (`id`, `description`, `rate`)
|
||||||
|
VALUES
|
||||||
|
(1, 'basic employee', 1);
|
||||||
|
|
||||||
UPDATE `vn`.`business` b
|
UPDATE `vn`.`business` b
|
||||||
SET `rate` = 7,
|
SET `rate` = 7,
|
||||||
`workerBusinessCategoryFk` = 12,
|
`workerBusinessCategoryFk` = 1,
|
||||||
`workerBusinessTypeFk` = 100,
|
`workerBusinessTypeFk` = 100,
|
||||||
`amount` = 900.50
|
`amount` = 900.50
|
||||||
WHERE b.id = 1;
|
WHERE b.id = 1;
|
||||||
|
|
||||||
UPDATE `vn`.`business` b
|
UPDATE `vn`.`business` b
|
||||||
SET `rate` = 7,
|
SET `rate` = 7,
|
||||||
`workerBusinessCategoryFk` = 12,
|
`workerBusinessCategoryFk` = 1,
|
||||||
`workerBusinessTypeFk` = 100,
|
`workerBusinessTypeFk` = 100,
|
||||||
`amount` = 1263.03
|
`amount` = 1263.03
|
||||||
WHERE b.id = 1106;
|
WHERE b.id = 1106;
|
||||||
|
|
||||||
UPDATE `vn`.`business` b
|
UPDATE `vn`.`business` b
|
||||||
SET `rate` = 7,
|
SET `rate` = 7,
|
||||||
`workerBusinessCategoryFk` = 12,
|
`workerBusinessCategoryFk` = 1,
|
||||||
`workerBusinessTypeFk` = 100,
|
`workerBusinessTypeFk` = 100,
|
||||||
`amount` = 2000
|
`amount` = 2000
|
||||||
WHERE b.id = 1107;
|
WHERE b.id = 1107;
|
||||||
|
|
||||||
UPDATE `vn`.`business` b
|
UPDATE `vn`.`business` b
|
||||||
SET `rate` = 7,
|
SET `rate` = 7,
|
||||||
`workerBusinessCategoryFk` = 12,
|
`workerBusinessCategoryFk` = 1,
|
||||||
`workerBusinessTypeFk` = 100,
|
`workerBusinessTypeFk` = 100,
|
||||||
`amount` = 1500
|
`amount` = 1500
|
||||||
WHERE b.id = 1108;
|
WHERE b.id = 1108;
|
||||||
|
@ -2684,7 +2691,8 @@ INSERT INTO `util`.`notificationConfig`
|
||||||
|
|
||||||
INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'print-email', 'notification fixture one');
|
(1, 'print-email', 'notification fixture one'),
|
||||||
|
(3, 'supplier-pay-method-update', 'A supplier pay method has been updated');
|
||||||
|
|
||||||
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -2725,6 +2733,14 @@ UPDATE `account`.`user`
|
||||||
SET `hasGrant` = 1
|
SET `hasGrant` = 1
|
||||||
WHERE `id` = 66;
|
WHERE `id` = 66;
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`ticketLog` (`originFk`, userFk, `action`, changedModel, oldInstance, newInstance, changedModelId, `description`)
|
||||||
|
VALUES
|
||||||
|
(7, 18, 'update', 'Sale', '{"quantity":1}', '{"quantity":10}', 1, NULL),
|
||||||
|
(7, 18, 'update', 'Ticket', '{"quantity":1,"concept":"Chest ammo box"}', '{"quantity":10,"concept":"Chest ammo box"}', 1, NULL),
|
||||||
|
(7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 1, NULL),
|
||||||
|
(7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 1x0.5m de '5' a '10'");
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`)
|
INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`)
|
||||||
VALUES
|
VALUES
|
||||||
(0, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', 'open', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all');
|
(0, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', 'open', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all');
|
||||||
|
@ -2732,3 +2748,13 @@ INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`
|
||||||
INSERT INTO `vn`.`ticketLog` (`id`, `originFk`, `userFk`, `action`, `changedModel`, `oldInstance`, `newInstance`, `changedModelId`)
|
INSERT INTO `vn`.`ticketLog` (`id`, `originFk`, `userFk`, `action`, `changedModel`, `oldInstance`, `newInstance`, `changedModelId`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 9, 'insert', 'Ticket', '{}', '{"clientFk":1, "nickname": "Bat cave"}', 1);
|
(1, 1, 9, 'insert', 'Ticket', '{}', '{"clientFk":1, "nickname": "Bat cave"}', 1);
|
||||||
|
|
||||||
|
INSERT INTO `salix`.`url` (`appName`, `environment`, `url`)
|
||||||
|
VALUES
|
||||||
|
('lilium', 'dev', 'http://localhost:8080/#/'),
|
||||||
|
('salix', 'dev', 'http://localhost:5000/#!/');
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`payDemDetail` (`id`, `detail`)
|
||||||
|
VALUES
|
||||||
|
(1, 1);
|
||||||
|
|
||||||
|
|
12697
db/dump/structure.sql
12697
db/dump/structure.sql
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue