diff --git a/back/methods/chat/send.js b/back/methods/chat/send.js
index c36178b0f..53e5da7cc 100644
--- a/back/methods/chat/send.js
+++ b/back/methods/chat/send.js
@@ -31,7 +31,9 @@ module.exports = Self => {
const recipient = to.replace('@', '');
if (sender.name != recipient)
- return sendMessage(sender, to, `@${sender.name}: ${message} `);
+ return sendMessage(sender, to, message);
+
+ return false;
};
async function sendMessage(sender, channel, message) {
@@ -42,10 +44,12 @@ module.exports = Self => {
return sendAuth(uri, {
'channel': channel,
'avatar': avatar,
+ 'alias': sender.nickname,
'text': message
}).catch(async error => {
if (error.statusCode === 401 && !this.resendAttempted) {
this.resendAttempted = true;
+ this.auth = null;
return sendMessage(sender, channel, message);
}
diff --git a/back/methods/chat/sendCheckingPresence.js b/back/methods/chat/sendCheckingPresence.js
index ac5836af3..b2a3ca725 100644
--- a/back/methods/chat/sendCheckingPresence.js
+++ b/back/methods/chat/sendCheckingPresence.js
@@ -30,24 +30,19 @@ module.exports = Self => {
const query = `SELECT worker_isWorking(?) isWorking`;
const [result] = await Self.rawSql(query, [workerId]);
- let room;
- if (result.isWorking)
- room = `@${account.name}`;
- else {
+ if (!result.isWorking) {
const workerDepartment = await models.WorkerDepartment.findById(workerId, {
include: {
relation: 'department'
}
});
- const department = workerDepartment.department();
+ const department = workerDepartment && workerDepartment.department();
const channelName = department.chatName;
- room = `#${channelName}`;
if (channelName)
- room = `#${channelName}`;
- else room = `@${account.name}`;
+ return Self.send(ctx, `#${channelName}`, `@${account.name} => ${message}`);
}
- return Self.send(ctx, room, message);
+ return Self.send(ctx, `@${account.name}`, message);
};
};
diff --git a/back/methods/chat/sendMessage.js b/back/methods/chat/sendMessage.js
deleted file mode 100644
index b6eaf79a8..000000000
--- a/back/methods/chat/sendMessage.js
+++ /dev/null
@@ -1,30 +0,0 @@
-module.exports = Self => {
- Self.remoteMethodCtx('sendMessage', {
- description: 'Send a RocketChat message',
- accessType: 'WRITE',
- accepts: [{
- arg: 'to',
- type: 'String',
- required: true,
- description: 'user (@) or channel (#) to send the message'
- }, {
- arg: 'message',
- type: 'String',
- required: true,
- description: 'The message'
- }],
- returns: {
- type: 'Object',
- root: true
- },
- http: {
- path: `/sendMessage`,
- verb: 'POST'
- }
- });
-
- // FIXME: Deprecate this method #2019
- Self.sendMessage = async(ctx, to, message) => {
- return Self.send(ctx, to, message);
- };
-};
diff --git a/back/methods/chat/spec/send.spec.js b/back/methods/chat/spec/send.spec.js
index b2585a9a1..56f2a9c27 100644
--- a/back/methods/chat/spec/send.spec.js
+++ b/back/methods/chat/spec/send.spec.js
@@ -9,10 +9,10 @@ describe('chat send()', () => {
expect(response.message).toEqual('Fake notification sent');
});
- it('should not return a response', async() => {
+ it('should retrun false as response', async() => {
let ctx = {req: {accessToken: {userId: 18}}};
let response = await app.models.Chat.send(ctx, '@salesPerson', 'I changed something');
- expect(response).toBeUndefined();
+ expect(response).toBeFalsy();
});
});
diff --git a/back/methods/chat/spec/sendCheckingPresence.spec.js b/back/methods/chat/spec/sendCheckingPresence.spec.js
index 12a163962..1523cb1d0 100644
--- a/back/methods/chat/spec/sendCheckingPresence.spec.js
+++ b/back/methods/chat/spec/sendCheckingPresence.spec.js
@@ -38,7 +38,7 @@ describe('chat sendCheckingPresence()', () => {
expect(response.statusCode).toEqual(200);
expect(response.message).toEqual('Fake notification sent');
- expect(chatModel.send).toHaveBeenCalledWith(ctx, '#cooler', 'I changed something');
+ expect(chatModel.send).toHaveBeenCalledWith(ctx, '#cooler', '@HankPym => I changed something');
});
it(`should call to send() method with the worker username when the worker is working`, async() => {
diff --git a/back/models/chat.js b/back/models/chat.js
index ecd47029c..ab23ef713 100644
--- a/back/models/chat.js
+++ b/back/models/chat.js
@@ -1,5 +1,4 @@
module.exports = Self => {
require('../methods/chat/send')(Self);
- require('../methods/chat/sendMessage')(Self);
require('../methods/chat/sendCheckingPresence')(Self);
};
diff --git a/db/changes/10121-zoneClosure/00-zoneClosure.sql b/db/changes/10121-zoneClosure/00-zoneClosure.sql
deleted file mode 100644
index 07db5b167..000000000
--- a/db/changes/10121-zoneClosure/00-zoneClosure.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-CREATE TABLE `vn`.`zoneClosure` (
- `zoneFk` INT NOT NULL,
- `dated` DATE NOT NULL,
- `hour` TIME NOT NULL,
- PRIMARY KEY (`zoneFk`, `dated`));
diff --git a/db/changes/10121-zoneClosure/00-zoneClosure_recalc.sql b/db/changes/10121-zoneClosure/00-zoneClosure_recalc.sql
deleted file mode 100644
index cb313cdec..000000000
--- a/db/changes/10121-zoneClosure/00-zoneClosure_recalc.sql
+++ /dev/null
@@ -1,50 +0,0 @@
-
-DROP procedure IF EXISTS vn.`zoneClosure_recalc`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` PROCEDURE vn.`zoneClosure_recalc`()
-proc: BEGIN
-/**
- * Recalculates the delivery time (hour) for every zone in days + scope in future
- */
- DECLARE vScope INT;
- DECLARE vCounter INT DEFAULT 0;
- DECLARE vShipped DATE DEFAULT CURDATE();
-
- DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
- BEGIN
- DO RELEASE_LOCK('vn.zoneClosure_recalc');
- RESIGNAL;
- END;
-
- IF NOT GET_LOCK('vn.zoneClosure_recalc', 0) THEN
- LEAVE proc;
- END IF;
-
- SELECT scope INTO vScope
- FROM zoneConfig;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.zone;
- CREATE TEMPORARY TABLE tmp.zone
- (INDEX (id))
- ENGINE = MEMORY
- SELECT id FROM zone;
-
- TRUNCATE TABLE zoneClosure;
-
- REPEAT
- CALL zone_getOptionsForShipment(vShipped);
- INSERT INTO zoneClosure(zoneFk, dated, `hour`)
- SELECT zoneFk, vShipped, `hour` FROM tmp.zoneOption;
-
- SET vCounter = vCounter + 1;
- SET vShipped = TIMESTAMPADD(DAY, 1, vShipped);
- UNTIL vCounter > vScope
- END REPEAT;
-
- DROP TEMPORARY TABLE tmp.zone;
- DO RELEASE_LOCK('vn.zoneClosure_recalc');
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10121-zoneClosure/00-zoneConfig.sql b/db/changes/10121-zoneClosure/00-zoneConfig.sql
deleted file mode 100644
index 915fb8894..000000000
--- a/db/changes/10121-zoneClosure/00-zoneConfig.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-CREATE TABLE `vn`.`zoneConfig` (
- `id` INT UNSIGNED NOT NULL,
- `scope` INT UNSIGNED NOT NULL,
- PRIMARY KEY (`id`));
-
-ALTER TABLE `vn`.`zoneConfig`
-CHANGE COLUMN `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ;
-
-INSERT INTO `vn`.`zoneConfig` (`scope`) VALUES ('1');
-
-INSERT INTO `bs`.`nightTask` (`order`, `schema`, `procedure`) VALUES ('100', 'vn', 'zoneClosure_recalc');
diff --git a/db/changes/10130-christmas/00-catalog_componentCalculate.sql b/db/changes/10130-christmas/00-catalog_componentCalculate.sql
deleted file mode 100644
index c778c7b3a..000000000
--- a/db/changes/10130-christmas/00-catalog_componentCalculate.sql
+++ /dev/null
@@ -1,254 +0,0 @@
-DROP procedure IF EXISTS `vn`.`catalog_componentCalculate`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`catalog_componentCalculate`(
- vZoneFk INT,
- vAddressFk INT,
- vShipped DATE)
-proc: BEGIN
-/**
- * Calcula los componentes de los articulos de tmp.ticketLot
- *
- * @param vZoneFk para calcular el transporte
- * @param vAgencyModeFk Id del modo de agencia
- * @param tmp.ticketLot (warehouseFk,available,itemFk,buyFk)
- *
- * @return tmp.ticketComponent(itemFk, warehouseFk, available, rate2, rate3, minPrice,
- * packing, grouping, groupingMode, buyFk, typeFk)
- * @return tmp.ticketComponentPrice (warehouseFk, itemFk, rate, grouping, price)
- */
- DECLARE vClientFk INT;
- DECLARE vGeneralInflationCoefficient INT DEFAULT 1;
- DECLARE vMinimumDensityWeight INT DEFAULT 167;
- DECLARE vBoxFreightItem INT DEFAULT 71;
- DECLARE vBoxVolume BIGINT; -- DEFAULT 138000;
- DECLARE vSpecialPriceComponent INT DEFAULT 10;
- DECLARE vDeliveryComponent INT DEFAULT 15;
- DECLARE vRecoveryComponent INT DEFAULT 17;
- DECLARE vSellByPacketComponent INT DEFAULT 22;
- DECLARE vBuyValueComponent INT DEFAULT 28;
- DECLARE vMarginComponent INT DEFAULT 29;
- DECLARE vDiscountLastItemComponent INT DEFAULT 32;
- DECLARE vExtraBaggedComponent INT DEFAULT 38;
- DECLARE vManaAutoComponent INT DEFAULT 39;
-
- SELECT volume INTO vBoxVolume
- FROM vn.packaging
- WHERE id = '94';
-
- SELECT clientFk INTO vClientFK
- FROM address
- WHERE id = vAddressFk;
-
- SET @rate2 := 0;
- SET @rate3 := 0;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentCalculate;
- CREATE TEMPORARY TABLE tmp.ticketComponentCalculate
- (PRIMARY KEY (itemFk, warehouseFk))
- ENGINE = MEMORY
- SELECT
- tl.itemFk, tl.warehouseFk, tl.available,
- IF((@rate2 := IFNULL(pf.rate2, b.price2)) < i.minPrice AND i.hasMinPrice, i.minPrice, @rate2) * 1.0 rate2,
- IF((@rate3 := IFNULL(pf.rate3, b.price3)) < i.minPrice AND i.hasMinPrice, i.minPrice, @rate3) * 1.0 rate3,
- IFNULL(pf.rate3, 0) AS minPrice,
- IFNULL(pf.packing, b.packing) packing,
- IFNULL(pf.`grouping`, b.`grouping`) `grouping`,
- ABS(IFNULL(pf.box, b.groupingMode)) groupingMode,
- tl.buyFk,
- i.typeFk,
- IF(i.hasKgPrice, b.weight / b.packing, NULL) weightGrouping
- FROM tmp.ticketLot tl
- JOIN buy b ON b.id = tl.buyFk
- JOIN item i ON i.id = tl.itemFk
- JOIN itemType it ON it.id = i.typeFk
- LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
- LEFT JOIN specialPrice sp ON sp.itemFk = i.id AND sp.clientFk = vClientFk
- LEFT JOIN (
- SELECT * FROM (
- SELECT pf.itemFk, pf.`grouping`, pf.packing, pf.box, pf.rate2, pf.rate3, zw.warehouseFk
- FROM priceFixed pf
- JOIN zoneWarehouse zw ON zw.zoneFk = vZoneFk AND (zw.warehouseFk = pf.warehouseFk OR pf.warehouseFk = 0)
- WHERE vShipped BETWEEN pf.started AND pf.ended ORDER BY pf.itemFk, pf.warehouseFk DESC
- ) tpf
- GROUP BY tpf.itemFk, tpf.warehouseFk
- ) pf ON pf.itemFk = tl.itemFk AND pf.warehouseFk = tl.warehouseFk
- WHERE b.buyingValue + b.freightValue + b.packageValue + b.comissionValue > 0.01 AND ic.display <> 0;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponent;
- CREATE TEMPORARY TABLE tmp.ticketComponent (
- `warehouseFk` INT UNSIGNED NOT NULL,
- `itemFk` INT NOT NULL,
- `componentFk` INT UNSIGNED NOT NULL,
- `cost` DECIMAL(10,4) NOT NULL,
- INDEX `itemWarehouse` USING BTREE (`itemFk` ASC, `warehouseFk` ASC),
- UNIQUE INDEX `itemWarehouseComponent` (`itemFk` ASC, `warehouseFk` ASC, `componentFk` ASC));
-
- INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost)
- SELECT
- tcc.warehouseFk,
- tcc.itemFk,
- vBuyValueComponent,
- b.buyingValue + b.freightValue + b.packageValue + b.comissionValue
- FROM tmp.ticketComponentCalculate tcc
- JOIN buy b ON b.id = tcc.buyFk;
-
- INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost)
- SELECT
- tcc.warehouseFk,
- tcc.itemFk,
- vMarginComponent,
- tcc.rate3 - b.buyingValue - b.freightValue - b.packageValue - b.comissionValue
- FROM tmp.ticketComponentCalculate tcc
- JOIN buy b ON b.id = tcc.buyFk;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentBase;
- CREATE TEMPORARY TABLE tmp.ticketComponentBase ENGINE = MEMORY
- SELECT tc.itemFk, ROUND(SUM(tc.cost), 4) AS base, tc.warehouseFk
- FROM tmp.ticketComponent tc
- GROUP BY tc.itemFk, warehouseFk;
-
- INSERT INTO tmp.ticketComponent
- SELECT tcb.warehouseFk, tcb.itemFk, vRecoveryComponent, ROUND(tcb.base * LEAST(cr.priceIncreasing, 0.25), 3)
- FROM tmp.ticketComponentBase tcb
- JOIN claimRatio cr ON cr.clientFk = vClientFk
- WHERE cr.priceIncreasing > 0.009;
-
- INSERT INTO tmp.ticketComponent
- SELECT tcb.warehouseFk, tcb.itemFk, vManaAutoComponent, ROUND(base * (0.01 + wm.pricesModifierRate), 3) as manaAuto
- FROM tmp.ticketComponentBase tcb
- JOIN `client` c on c.id = vClientFk
- JOIN workerMana wm ON c.salesPersonFk = wm.workerFk
- WHERE wm.isPricesModifierActivated
- HAVING manaAuto <> 0;
-
- INSERT INTO tmp.ticketComponent
- SELECT tcb.warehouseFk,
- tcb.itemFk,
- c.id,
- GREATEST(IFNULL(ROUND(tcb.base * c.tax, 4), 0), tcc.minPrice - tcc.rate3)
- FROM tmp.ticketComponentBase tcb
- JOIN component c
- JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk
- LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
- WHERE c.id = vDiscountLastItemComponent AND c.tax <> 0 AND tcc.minPrice < tcc.rate3 AND sp.value IS NULL;
-
- INSERT INTO tmp.ticketComponent
- SELECT tcc.warehouseFk, tcc.itemFk, vSellByPacketComponent, tcc.rate2 - tcc.rate3
- FROM tmp.ticketComponentCalculate tcc
- JOIN buy b ON b.id = tcc.buyFk
- LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
- WHERE sp.value IS NULL;
-
- INSERT INTO tmp.ticketComponent
- SELECT tcc.warehouseFK,
- tcc.itemFk,
- vDeliveryComponent,
- vGeneralInflationCoefficient
- * ROUND((
- i.compression
- * ic.cm3
- * IF(am.deliveryMethodFk = 1, (GREATEST(i.density, vMinimumDensityWeight) / vMinimumDensityWeight), 1)
- * IFNULL((z.price - z.bonus)
- * 1/*amz.inflation*/ , 50)) / vBoxVolume, 4
- ) cost
- FROM tmp.ticketComponentCalculate tcc
- JOIN item i ON i.id = tcc.itemFk
- JOIN zone z ON z.id = vZoneFk
- JOIN agencyMode am ON am.id = z.agencyModeFk
- LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk
- AND ic.itemFk = tcc.itemFk
- HAVING cost <> 0;
-
- IF (SELECT COUNT(*) FROM vn.addressForPackaging WHERE addressFk = vAddressFk) THEN
- INSERT INTO tmp.ticketComponent
- SELECT tcc.warehouseFk, b.itemFk, vExtraBaggedComponent, ap.packagingValue cost
- FROM tmp.ticketComponentCalculate tcc
- JOIN vn.addressForPackaging ap
- WHERE ap.addressFk = vAddressFk;
- END IF;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentCopy;
- CREATE TEMPORARY TABLE tmp.ticketComponentCopy ENGINE = MEMORY
- SELECT * FROM tmp.ticketComponent;
-
- INSERT INTO tmp.ticketComponent
- SELECT tcc.warehouseFk,
- tcc.itemFk,
- vSpecialPriceComponent,
- sp.value - SUM(tcc.cost) sumCost
- FROM tmp.ticketComponentCopy tcc
- JOIN component c ON c.id = tcc.componentFk
- JOIN specialPrice sp ON sp.clientFk = vClientFK AND sp.itemFk = tcc.itemFk
- WHERE c.classRate IS NULL
- GROUP BY tcc.itemFk, tcc.warehouseFk
- HAVING ABS(sumCost) > 0.001;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentSum;
- CREATE TEMPORARY TABLE tmp.ticketComponentSum
- (INDEX (itemFk, warehouseFk))
- ENGINE = MEMORY
- SELECT SUM(cost) sumCost, tc.itemFk, tc.warehouseFk, c.classRate
- FROM tmp.ticketComponent tc
- JOIN component c ON c.id = tc.componentFk
- GROUP BY tc.itemFk, tc.warehouseFk, c.classRate;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentRate;
- CREATE TEMPORARY TABLE tmp.ticketComponentRate ENGINE = MEMORY
- SELECT tcc.warehouseFk,
- tcc.itemFk,
- 1 rate,
- IF(tcc.groupingMode = 1, tcc.`grouping`, 1) `grouping`,
- CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) price,
- CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) / weightGrouping priceKg
- FROM tmp.ticketComponentCalculate tcc
- JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
- AND tcs.warehouseFk = tcc.warehouseFk
- WHERE IFNULL(tcs.classRate, 1) = 1
- AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0)
- GROUP BY tcs.warehouseFk, tcs.itemFk;
-
- INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
- SELECT
- tcc.warehouseFk,
- tcc.itemFk,
- 2 rate,
- tcc.packing `grouping`,
- SUM(tcs.sumCost) price,
- SUM(tcs.sumCost) / weightGrouping priceKg
- FROM tmp.ticketComponentCalculate tcc
- JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
- AND tcs.warehouseFk = tcc.warehouseFk
- WHERE tcc.available IS NULL OR (IFNULL(tcs.classRate, 2) = 2
- AND tcc.packing > 0 AND tcc.available >= tcc.packing)
- GROUP BY tcs.warehouseFk, tcs.itemFk;
-
- INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
- SELECT
- tcc.warehouseFk,
- tcc.itemFk,
- 3 rate,
- tcc.available `grouping`,
- SUM(tcs.sumCost) price,
- SUM(tcs.sumCost) / weightGrouping priceKg
- FROM tmp.ticketComponentCalculate tcc
- JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
- AND tcs.warehouseFk = tcc.warehouseFk
- WHERE IFNULL(tcs.classRate, 3) = 3
- GROUP BY tcs.warehouseFk, tcs.itemFk;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentPrice;
- CREATE TEMPORARY TABLE tmp.ticketComponentPrice ENGINE = MEMORY
- SELECT * FROM (
- SELECT * FROM tmp.ticketComponentRate ORDER BY price
- ) t
- GROUP BY itemFk, warehouseFk, `grouping`;
-
- DROP TEMPORARY TABLE
- tmp.ticketComponentCalculate,
- tmp.ticketComponentSum,
- tmp.ticketComponentBase,
- tmp.ticketComponentRate,
- tmp.ticketComponentCopy;
-END$$
-DELIMITER ;
\ No newline at end of file
diff --git a/db/changes/10130-christmas/00-chatConfig.sql b/db/changes/10130-christmas/00-chatConfig.sql
deleted file mode 100644
index beff3bde4..000000000
--- a/db/changes/10130-christmas/00-chatConfig.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-ALTER TABLE `vn`.`chatConfig`
-ADD COLUMN `host` VARCHAR(255) NOT NULL AFTER `id`,
-CHANGE COLUMN `uri` `api` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL ;
-
-UPDATE `vn`.`chatConfig` SET `host` = 'https://chat.verdnatura.es' WHERE (`id` = '1');
diff --git a/db/changes/10130-christmas/00-greugeConfig.sql b/db/changes/10130-christmas/00-greugeConfig.sql
deleted file mode 100644
index c21751f08..000000000
--- a/db/changes/10130-christmas/00-greugeConfig.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-CREATE TABLE `vn`.`greugeConfig` (
- `id` INT NOT NULL AUTO_INCREMENT,
- `freightPickUpPrice` DECIMAL(10,2) NOT NULL,
- PRIMARY KEY (`id`));
-
-INSERT IGNORE INTO `vn`.`greugeConfig` (`id`, `freightPickUpPrice`) VALUES ('1', '11');
diff --git a/db/changes/10130-christmas/00-manaSpellersRequery.sql b/db/changes/10130-christmas/00-manaSpellersRequery.sql
deleted file mode 100644
index cc185fdba..000000000
--- a/db/changes/10130-christmas/00-manaSpellersRequery.sql
+++ /dev/null
@@ -1,70 +0,0 @@
-
-DROP procedure IF EXISTS `vn`.`manaSpellersRequery`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`manaSpellersRequery`(vWorkerFk INTEGER)
-BEGIN
-
- DECLARE vWorkerIsExcluded BOOLEAN;
- DECLARE vFromDated DATE;
- DECLARE vToDated DATE DEFAULT TIMESTAMPADD(DAY,1,CURDATE());
- DECLARE vMana INT;
- DECLARE vAutoMana INT;
- DECLARE vManaBank INT;
- DECLARE vManaGreugeType INT;
-
- SELECT id INTO vMana
- FROM `component` WHERE code = 'mana';
-
- SELECT id INTO vAutoMana
- FROM `component` WHERE code = 'autoMana';
-
- SELECT id INTO vManaBank
- FROM `bank` WHERE code = 'mana';
-
- SELECT id INTO vManaGreugeType
- FROM `greugeType` WHERE code = 'mana';
-
- SELECT COUNT(*) INTO vWorkerIsExcluded
- FROM workerManaExcluded
- WHERE workerFk = vWorkerFk;
-
- IF NOT vWorkerIsExcluded THEN
-
- SELECT max(dated) INTO vFromDated
- FROM clientManaCache;
-
- REPLACE workerMana (workerFk, amount)
- SELECT vWorkerFk, sum(mana) FROM
- (
- SELECT s.quantity * sc.value as mana
- FROM ticket t
- JOIN address a ON a.id = t.addressFk
- JOIN client c ON c.id = a.clientFk
- JOIN sale s ON s.ticketFk = t.id
- JOIN saleComponent sc ON sc.saleFk = s.id
- WHERE c.salesPersonFk = vWorkerFk AND sc.componentFk IN (vMana, vAutoMana)
- AND t.shipped > vFromDated AND t.shipped < vToDated
- UNION ALL
- SELECT - r.amountPaid
- FROM receipt r
- JOIN client c ON c.id = r.clientFk
- WHERE c.salesPersonFk = vWorkerFk AND bankFk = vManaBank
- AND payed > vFromDated
- UNION ALL
- SELECT g.amount
- FROM greuge g
- JOIN client c ON c.id = g.clientFk
- WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = vManaGreugeType
- AND g.shipped > vFromDated and g.shipped < CURDATE()
- UNION ALL
- SELECT cc.mana
- FROM clientManaCache cc
- JOIN client c ON c.id = cc.clientFk
- WHERE c.salesPersonFk = vWorkerFk AND cc.dated = vFromDated
- ) sub;
- END IF;
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10130-christmas/00-timeControl_calculate.sql b/db/changes/10130-christmas/00-timeControl_calculate.sql
deleted file mode 100644
index 0a6470216..000000000
--- a/db/changes/10130-christmas/00-timeControl_calculate.sql
+++ /dev/null
@@ -1,44 +0,0 @@
-USE `vn`;
-DROP procedure IF EXISTS `timeControl_calculate`;
-
-DELIMITER $$
-USE `vn`$$
-CREATE DEFINER=`root`@`%` PROCEDURE `timeControl_calculate`(vDatedFrom DATETIME, vDatedTo DATETIME)
-BEGIN
- SET @vIsOdd := TRUE;
- SET @vUser := NULL;
- SET @vDated := NULL;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate;
-
- CREATE TEMPORARY TABLE tmp.timeControlCalculate
- SELECT userFk,
- dated,
- IF( timeWork >= 18000, @timeWork:=timeWork + 1200, @timeWork:=timeWork) timeWorkSeconds,
- SEC_TO_TIME(@timeWork ) timeWorkSexagesimal,
- @timeWork / 3600 timeWorkDecimal
- FROM (SELECT SUM(timeWork) timeWork,
- userFk,
- dated
- FROM (SELECT IF(@vUser = wtc.userFk, @vUser :=@vUser, @vUser := wtc.userFk ),
- IF(@vIsOdd, @vIsOdd := FALSE, @vIsOdd := TRUE ),
- IF(direction='in', @vIsOdd := TRUE, @vIsOdd := @vIsOdd ),
- IF(@vIsOdd, @vLastTimed:=UNIX_TIMESTAMP(timed),@vLastTimed:=@vLastTimed),
- IF(@vIsOdd, 0, UNIX_TIMESTAMP(timed)-@vLastTimed) timeWork,
- IF(direction='in', @vDated := DATE(wtc.timed), @vDated :=@vDated) dated,
- wtc.userFk,
- wtc.timed timed,
- direction
- FROM (SELECT * FROM workerTimeControl ORDER BY userFk, timed ASC) wtc
- JOIN tmp.`user` w ON w.userFk = wtc.userFk
- WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo
- ORDER BY userFk, timed ASC
- ) sub
- GROUP BY userFk, dated
- ORDER BY userFk, dated
- )sub2;
-
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10140-kings/00-ACL.sql b/db/changes/10140-kings/00-ACL.sql
deleted file mode 100644
index fe1cbeb24..000000000
--- a/db/changes/10140-kings/00-ACL.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Thermograph', '*', '*', 'ALLOW', 'ROLE', 'buyer');
-INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('TravelThermograph', '*', '*', 'ALLOW', 'ROLE', 'buyer');
-INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Entry', '*', '*', 'ALLOW', 'ROLE', 'buyer');
\ No newline at end of file
diff --git a/db/changes/10140-kings/00-buy_afterUpsert.sql b/db/changes/10140-kings/00-buy_afterUpsert.sql
deleted file mode 100644
index ab038628c..000000000
--- a/db/changes/10140-kings/00-buy_afterUpsert.sql
+++ /dev/null
@@ -1,81 +0,0 @@
-
-DROP procedure IF EXISTS `vn`.`buy_afterUpsert`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`buy_afterUpsert`(vSelf INT)
-BEGIN
-/**
- * Triggered actions when a buy is updated or inserted.
- *
- * @param vSelf The buy reference
- */
- DECLARE vEntryFk INT;
- DECLARE vItemFk INT;
- DECLARE vStickers INT;
- DECLARE vPacking INT;
- DECLARE vWarehouse INT;
- DECLARE vWarehouseOut INT;
- DECLARE vIsMerchandise BOOL;
- DECLARE vIsFeedStock BOOL;
- DECLARE vLanded DATE;
- DECLARE vBuyerFk INT;
- DECLARE vItemName VARCHAR(50);
-
- SELECT entryFk, itemFk, stickers, packing
- INTO vEntryFk, vItemFk, vStickers, vPacking
- FROM buy
- WHERE id = vSelf;
-
- SELECT t.warehouseInFk, t.warehouseOutFk, t.landed
- INTO vWarehouse, vWarehouseOut, vLanded
- FROM entry e
- JOIN travel t ON t.id = e.travelFk
- WHERE e.id = vEntryFk;
-
- SELECT k.merchandise, it.workerFk, i.longName
- INTO vIsMerchandise, vBuyerFk, vItemName
- FROM itemCategory k
- JOIN itemType it ON it.categoryFk = k.id
- JOIN item i ON i.typeFk = it.id
- WHERE i.id = vItemFk;
-
- IF vIsMerchandise THEN
- REPLACE itemCost SET
- itemFk = vItemFk,
- warehouseFk = vWarehouse,
- cm3 = buy_getUnitVolume(vSelf);
- END IF;
-
- SELECT isFeedStock INTO vIsFeedStock
- FROM warehouse WHERE id = vWarehouseOut AND id <> 13;
-
- IF vIsFeedStock THEN
- INSERT IGNORE INTO producer(`name`)
- SELECT es.company_name
- FROM buy b
- JOIN edi.ekt be ON be.id = b.ektFk
- JOIN edi.supplier es ON es.supplier_id = be.pro
- WHERE b.id = vSelf;
-
- IF buy_hasNotifyPassport(vSelf, vItemFk) THEN
- CALL vn.buy_notifyPassport(vSelf, vItemFk, vStickers, vPacking);
- END IF;
- END IF;
-
- -- Aviso al comprador de modificacion de entrada en Barajas
- IF (SELECT isBuyerToBeEmailed FROM warehouse WHERE id = vWarehouse)
- AND vLanded = CURDATE()
- AND vBuyerFk != account.myUserGetId()
- THEN
-
- CALL vn.mail_insert(CONCAT(account.userGetNameFromId(vBuyerFk),'@verdnatura.es'),
- CONCAT(account.myUserGetName(),'@verdnatura.es'),
- CONCAT('E ',vEntryFk,' Se ha modificado item ', vItemFk, ' ',vItemName),
- 'Este email se ha generado automáticamente');
-
- END IF;
-
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10140-kings/00-clientRisk_update.sql b/db/changes/10140-kings/00-clientRisk_update.sql
deleted file mode 100644
index 389236e1d..000000000
--- a/db/changes/10140-kings/00-clientRisk_update.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`clientRisk_update`(vClientId INT, vCompanyId INT, vAmount DECIMAL(10,2))
-BEGIN
- IF vAmount IS NOT NULL
- THEN
- INSERT INTO clientRisk
- SET
- clientFk = vClientId,
- companyFk = vCompanyId,
- amount = vAmount
- ON DUPLICATE KEY UPDATE
- amount = amount + VALUES(amount);
- END IF;
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10140-kings/00-componentType.sql b/db/changes/10140-kings/00-componentType.sql
deleted file mode 100644
index e17d35400..000000000
--- a/db/changes/10140-kings/00-componentType.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE `vn`.`componentType`
-CHANGE COLUMN `base` `isBase` TINYINT(4) NOT NULL DEFAULT '0' COMMENT 'Marca aquellas series que se utilizan para calcular el precio base de las ventas, a efectos estadisticos' ;
-
diff --git a/db/changes/10140-kings/00-customer_risk_update.sql b/db/changes/10140-kings/00-customer_risk_update.sql
deleted file mode 100644
index c7ecead4f..000000000
--- a/db/changes/10140-kings/00-customer_risk_update.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-
-DROP procedure IF EXISTS `bi`.`customer_risk_update`;
-
-DELIMITER $$
-USE `bi`$$
-CREATE DEFINER=`root`@`%` PROCEDURE `bi`.`customer_risk_update`(v_customer INT, v_company INT, v_amount DECIMAL(10,2))
-BEGIN
- CALL vn.clientRisk_update(v_customer, v_company, v_amount);
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10140-kings/00-department.sql b/db/changes/10140-kings/00-department.sql
deleted file mode 100644
index 29008d753..000000000
--- a/db/changes/10140-kings/00-department.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE `vn`.`department`
-ADD COLUMN `chatName` VARCHAR(45) NULL AFTER `path`;
diff --git a/db/changes/10140-kings/00-ticketComponentUpdateSale.sql b/db/changes/10140-kings/00-ticketComponentUpdateSale.sql
deleted file mode 100644
index b40debce6..000000000
--- a/db/changes/10140-kings/00-ticketComponentUpdateSale.sql
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-DROP procedure IF EXISTS `vn`.`ticketComponentUpdateSale`;
-
-DELIMITER $$
-
-CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`ticketComponentUpdateSale`(vOption INT)
-BEGIN
-/**
- * A partir de la tabla tmp.sale, crea los Movimientos_componentes
- * y modifica el campo Preu de la tabla Movimientos
- *
- * @param i_option integer tipo de actualizacion
- * @param table tmp.sale tabla memory con el campo saleFk, warehouseFk
- **/
- DECLARE vComponentFk INT;
- DECLARE vRenewComponents BOOLEAN;
- DECLARE vKeepPrices BOOLEAN;
-
- CASE vOption
- WHEN 1 THEN
- SET vRenewComponents = TRUE;
- SET vKeepPrices = FALSE;
- WHEN 2 THEN
- SET vComponentFk = 17;
- SET vRenewComponents = TRUE;
- SET vKeepPrices = TRUE;
- WHEN 3 THEN
- SET vComponentFk = 37;
- SET vRenewComponents = TRUE;
- SET vKeepPrices = TRUE;
- WHEN 4 THEN
- SET vComponentFk = 34;
- SET vRenewComponents = TRUE;
- SET vKeepPrices = TRUE;
- WHEN 5 THEN
- SET vComponentFk = 35;
- SET vRenewComponents = TRUE;
- SET vKeepPrices = TRUE;
- WHEN 6 THEN
- SET vComponentFk = 36;
- SET vRenewComponents = TRUE;
- SET vKeepPrices = TRUE;
- WHEN 7 THEN
- REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.8, 3)
- FROM sale s
- JOIN tmp.sale tmps ON tmps.saleFk = s.id
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
- AND sc.componentFk NOT IN (28, 29)
- GROUP BY s.id;
-
- REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 29, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.2, 3)
- FROM sale s
- JOIN tmp.sale tmps ON tmps.saleFk = s.id
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
- AND sc.componentFk NOT IN (28, 29)
- GROUP BY s.id;
-
- SET vRenewComponents = FALSE;
- SET vKeepPrices = FALSE;
- WHEN 8 THEN
- DELETE sc.*
- FROM tmp.sale tmps JOIN saleComponent sc ON sc.saleFk = tmps.saleFk;
-
- REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100)), 3)
- FROM sale s
- JOIN tmp.sale tmps ON tmps.saleFk = s.id;
-
- SET vRenewComponents = FALSE;
- SET vKeepPrices = FALSE;
- WHEN 9 THEN
- SET vRenewComponents = TRUE;
- SET vKeepPrices = TRUE;
- END CASE;
-
- IF vRenewComponents THEN
- DELETE sc.*
- FROM tmp.sale tmps
- JOIN saleComponent sc ON sc.saleFk = tmps.saleFk
- JOIN `component` c ON c.id = sc.componentFk
- WHERE c.isRenewable;
-
- REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, tc.componentFk, tc.cost
- FROM sale s
- JOIN tmp.sale tmps ON tmps.saleFk = s.id
- JOIN tmp.ticketComponent tc ON tc.itemFk = s.itemFk AND tc.warehouseFk = tmps.warehouseFk
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
- AND sc.componentFk = tc.componentFk
- LEFT JOIN `component` c ON c.id = tc.componentFk
- WHERE IF(sc.componentFk IS NULL AND NOT c.isRenewable, FALSE, TRUE);
- END IF;
-
- IF vKeepPrices THEN
- REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, vComponentFk, ROUND((s.price * (100 - s.discount) / 100) - SUM(sc.value), 3) dif
- FROM sale s
- JOIN tmp.sale tmps ON tmps.saleFk = s.id
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
- WHERE sc.saleFk <> vComponentFk
- GROUP BY s.id
- HAVING dif <> 0;
- ELSE
- UPDATE sale s
- JOIN item i on i.id = s.itemFk
- JOIN itemType it on it.id = i.typeFk
- JOIN (SELECT SUM(sc.value) sumValue, sc.saleFk
- FROM saleComponent sc
- JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
- GROUP BY sc.saleFk) sc ON sc.saleFk = s.id
- SET s.price = sumValue
- WHERE it.code != 'PRT' ;
-
- REPLACE INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 21, ROUND((s.price * (100 - s.discount) / 100) - SUM(value), 3) saleValue
- FROM sale s
- JOIN tmp.sale tmps ON tmps.saleFk = s.id
- LEFT JOIN saleComponent sc ON sc.saleFk = s.id
- WHERE sc.componentFk != 21
- GROUP BY s.id
- HAVING ROUND(saleValue, 4) <> 0;
- END IF;
-
- UPDATE sale s
- JOIN (
- SELECT SUM(sc.value) sumValue, sc.saleFk
- FROM saleComponent sc
- JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
- JOIN `component` c ON c.id = sc.componentFk
- JOIN componentType ct on ct.id = c.typeFk AND ct.isBase
- GROUP BY sc.saleFk) sc ON sc.saleFk = s.id
- SET s.priceFixed = sumValue, s.isPriceFixed = 1;
-
- DELETE sc.*
- FROM saleComponent sc
- JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
- JOIN sale s on s.id = sc.saleFk
- JOIN item i ON i.id = s.itemFk
- JOIN itemType it ON it.id = i.typeFk
- WHERE it.code = 'PRT';
-
- INSERT INTO saleComponent(saleFk, componentFk, value)
- SELECT s.id, 15, s.price
- FROM sale s
- JOIN tmp.sale tmps ON tmps.saleFk = s.id
- JOIN item i ON i.id = s.itemFK
- JOIN itemType it ON it.id = i.typeFk
- WHERE it.code = 'PRT' AND s.price > 0;
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10140-kings/00-travelThermograph.sql b/db/changes/10140-kings/00-travelThermograph.sql
deleted file mode 100644
index c19151a45..000000000
--- a/db/changes/10140-kings/00-travelThermograph.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-ALTER TABLE `vn`.`travelThermograph`
-ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT FIRST,
-DROP PRIMARY KEY,
-ADD PRIMARY KEY (`id`);
-
-ALTER TABLE `vn`.`travelThermograph`
-ADD UNIQUE INDEX `thermograph_created` (`thermographFk` ASC, `created` ASC) VISIBLE;
\ No newline at end of file
diff --git a/db/changes/10140-kings/00-triggerInvoiceOut.sql b/db/changes/10140-kings/00-triggerInvoiceOut.sql
deleted file mode 100644
index 7f6ed30b1..000000000
--- a/db/changes/10140-kings/00-triggerInvoiceOut.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-DROP TRIGGER IF EXISTS `vn`.`invoiceOut_afterInsert`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` TRIGGER `vn`.`invoiceOut_afterInsert` AFTER INSERT ON `vn`.`invoiceOut` FOR EACH ROW BEGIN
- CALL clientRisk_update(NEW.clientFk, NEW.companyFk, NEW.amount);
-END$$
-DELIMITER ;
-
-DROP TRIGGER IF EXISTS `vn`.`invoiceOut_beforeUpdate`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` TRIGGER `vn`.`invoiceOut_beforeUpdate` BEFORE UPDATE ON `vn`.`invoiceOut` FOR EACH ROW
-BEGIN
- CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
- CALL clientRisk_update (NEW.clientFk, NEW.companyFk, NEW.amount);
-END$$
-
-DELIMITER ;
-
-
-DROP TRIGGER IF EXISTS `vn`.`invoiceOut_beforeDelete`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` TRIGGER `vn`.`invoiceOut_beforeDelete` BEFORE DELETE ON `invoiceOut` FOR EACH ROW BEGIN
- CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
-END$$
-DELIMITER ;
diff --git a/db/changes/10140-kings/00-triggerReceipt.sql b/db/changes/10140-kings/00-triggerReceipt.sql
deleted file mode 100644
index c9c368a40..000000000
--- a/db/changes/10140-kings/00-triggerReceipt.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-DROP TRIGGER IF EXISTS `vn`.`receipt_afterInsert`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` TRIGGER `vn`.`receipt_afterInsert` AFTER INSERT ON `receipt` FOR EACH ROW
- CALL clientRisk_update(NEW.clientFk, NEW.companyFk, -NEW.amountPaid)$$
-DELIMITER ;
-DROP TRIGGER IF EXISTS `vn`.`receipt_beforeUpdate`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` TRIGGER `vn`.`receipt_beforeUpdate` BEFORE UPDATE ON `receipt` FOR EACH ROW BEGIN
- CALL clientRisk_update(OLD.clientFk, OLD.companyFk, OLD.amountPaid);
- CALL clientRisk_update(NEW.clientFk, NEW.companyFk, -NEW.amountPaid);
-END$$
-DELIMITER ;
-DROP TRIGGER IF EXISTS `vn`.`receipt_beforeDelete`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` TRIGGER `vn`.`receipt_beforeDelete` BEFORE DELETE ON `receipt` FOR EACH ROW
- CALL clientRisk_update(OLD.clientFk, OLD.companyFk, OLD.amountPaid)$$
-DELIMITER ;
diff --git a/db/changes/10140-kings/00-weekWaste_getDetail.sql b/db/changes/10140-kings/00-weekWaste_getDetail.sql
deleted file mode 100644
index a7e099f58..000000000
--- a/db/changes/10140-kings/00-weekWaste_getDetail.sql
+++ /dev/null
@@ -1,29 +0,0 @@
-USE `bs`;
-DROP procedure IF EXISTS `weekWaste_getDetail`;
-
-DELIMITER $$
-USE `bs`$$
-CREATE DEFINER=`root`@`%` PROCEDURE `weekWaste_getDetail`()
-BEGIN
- DECLARE vLastWeek DATE;
- DECLARE vWeek INT;
- DECLARE vYear INT;
-
- SET vLastWeek = TIMESTAMPADD(WEEK,-1,CURDATE());
- SET vYear = YEAR(vLastWeek);
- SET vWeek = WEEK(vLastWeek, 1);
-
- SELECT *, 100 * dwindle / total AS percentage
- FROM (
- SELECT buyer,
- ws.family,
- sum(ws.saleTotal) AS total,
- sum(ws.saleWaste) AS dwindle
- FROM bs.waste ws
- WHERE year = vYear AND week = vWeek
- GROUP BY buyer, family
- ) sub
- ORDER BY percentage DESC;
-END$$
-
-DELIMITER ;
diff --git a/db/changes/10140-kings/00-worker_isWorking.sql b/db/changes/10140-kings/00-worker_isWorking.sql
deleted file mode 100644
index b80d287e0..000000000
--- a/db/changes/10140-kings/00-worker_isWorking.sql
+++ /dev/null
@@ -1,32 +0,0 @@
-USE `vn`;
-DROP function IF EXISTS `worker_isWorking`;
-
-DELIMITER $$
-USE `vn`$$
-CREATE DEFINER=`root`@`%` FUNCTION `worker_isWorking`(vWorkerFk INT) RETURNS tinyint(1)
- READS SQL DATA
-BEGIN
-/**
- * Comprueba si el trabajador está trabajando en el momento de la consulta
- * @return Devuelve TRUE en caso de que este trabajando. Si se encuentra en un descanso devolverá FALSE
- */
- DECLARE vLastIn DATETIME ;
-
- SELECT MAX(timed) INTO vLastIn
- FROM vn.workerTimeControl
- WHERE userFk = vWorkerFk AND
- direction = 'in';
-
- IF (SELECT MOD(COUNT(*),2)
- FROM vn.workerTimeControl
- WHERE userFk = vWorkerFk AND
- timed >= vLastIn
- ) THEN
- RETURN TRUE;
- ELSE
- RETURN FALSE;
- END IF;
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10140-kings/01-order_confirmWithUser.sql b/db/changes/10140-kings/01-order_confirmWithUser.sql
deleted file mode 100644
index c398edc4c..000000000
--- a/db/changes/10140-kings/01-order_confirmWithUser.sql
+++ /dev/null
@@ -1,240 +0,0 @@
-
-DROP procedure IF EXISTS `hedera`.`order_confirmWithUser`;
-
-DELIMITER $$
-CREATE DEFINER=`root`@`%` PROCEDURE `hedera`.`order_confirmWithUser`(IN `vOrder` INT, IN `vUserId` INT)
-BEGIN
-/**
- * Confirms an order, creating each of its tickets on the corresponding
- * date, store and user.
- *
- * @param vOrder The order identifier
- * @param vUser The user identifier
- */
- DECLARE vOk BOOL;
- DECLARE vDone BOOL DEFAULT FALSE;
- DECLARE vWarehouse INT;
- DECLARE vShipment DATETIME;
- DECLARE vTicket INT;
- DECLARE vNotes VARCHAR(255);
- DECLARE vItem INT;
- DECLARE vConcept VARCHAR(30);
- DECLARE vAmount INT;
- DECLARE vPrice DECIMAL(10,2);
- DECLARE vSale INT;
- DECLARE vRate INT;
- DECLARE vRowId INT;
- DECLARE vDelivery DATE;
- DECLARE vAddress INT;
- DECLARE vIsConfirmed BOOL;
- DECLARE vClientId INT;
- DECLARE vCompanyId INT;
- DECLARE vAgencyModeId INT;
-
- DECLARE TICKET_FREE INT DEFAULT 2;
-
- DECLARE cDates CURSOR FOR
- SELECT zgs.shipped, r.warehouse_id
- FROM `order` o
- JOIN order_row r ON r.order_id = o.id
- LEFT JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = r.warehouse_id
- WHERE o.id = vOrder AND r.amount != 0
- GROUP BY r.warehouse_id;
-
- DECLARE cRows CURSOR FOR
- SELECT r.id, r.item_id, i.name, r.amount, r.price, r.rate
- FROM order_row r
- JOIN vn.item i ON i.id = r.item_id
- WHERE r.amount != 0
- AND r.warehouse_id = vWarehouse
- AND r.order_id = vOrder
- ORDER BY r.rate DESC;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND
- SET vDone = TRUE;
-
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- ROLLBACK;
- RESIGNAL;
- END;
-
- -- Carga los datos del pedido
-
- SELECT o.date_send, o.address_id, o.note,
- o.confirmed, a.clientFk, o.company_id, o.agency_id
- INTO vDelivery, vAddress, vNotes,
- vIsConfirmed, vClientId, vCompanyId, vAgencyModeId
- FROM hedera.`order` o
- JOIN vn.address a ON a.id = o.address_id
- WHERE o.id = vOrder;
-
- -- Comprueba que el pedido no está confirmado
-
- IF vIsConfirmed THEN
- CALL util.throw ('ORDER_ALREADY_CONFIRMED');
- END IF;
-
- -- Comprueba que el pedido no está vacío
-
- SELECT COUNT(*) > 0 INTO vOk
- FROM order_row WHERE order_id = vOrder AND amount > 0;
-
- IF !vOk THEN
- CALL util.throw ('ORDER_EMPTY');
- END IF;
-
- -- Carga las fechas de salida de cada almacén
-
- CALL vn.zone_getShippedWarehouse (vDelivery, vAddress, vAgencyModeId);
-
- -- Trabajador que realiza la acción
-
- IF vUserId IS NULL THEN
- SELECT employeeFk INTO vUserId FROM orderConfig;
- END IF;
-
- -- Crea los tickets del pedido
-
- START TRANSACTION;
-
- OPEN cDates;
-
- lDates:
- LOOP
- SET vTicket = NULL;
- SET vDone = FALSE;
- FETCH cDates INTO vShipment, vWarehouse;
-
- IF vDone THEN
- LEAVE lDates;
- END IF;
-
- -- Busca un ticket existente que coincida con los parametros
-
- SELECT t.id INTO vTicket
- FROM vn.ticket t
- LEFT JOIN vn.ticketState tls on tls.ticket = t.id
- JOIN `order` o
- ON o.address_id = t.addressFk
- AND vWarehouse = t.warehouseFk
- AND o.agency_id = t.agencyModeFk
- AND o.date_send = t.landed
- AND vShipment = DATE(t.shipped)
- WHERE o.id = vOrder
- AND t.invoiceOutFk IS NULL
- AND IFNULL(tls.alertLevel,0) = 0
- AND t.clientFk <> 1118
- LIMIT 1;
-
- -- Crea el ticket en el caso de no existir uno adecuado
-
- IF vTicket IS NULL
- THEN
- CALL vn.ticketCreateWithUser(
- vClientId,
- IFNULL(vShipment, CURDATE()),
- vWarehouse,
- vCompanyId,
- vAddress,
- vAgencyModeId,
- NULL,
- vDelivery,
- vUserId,
- vTicket
- );
- ELSE
- INSERT INTO vncontrol.inter
- SET Id_Ticket = vTicket,
- Id_Trabajador = vUserId,
- state_id = TICKET_FREE;
- END IF;
-
- INSERT IGNORE INTO vn.orderTicket
- SET orderFk = vOrder,
- ticketFk = vTicket;
-
- -- Añade las notas
-
- IF vNotes IS NOT NULL AND vNotes != ''
- THEN
- INSERT INTO vn.ticketObservation SET
- ticketFk = vTicket,
- observationTypeFk = 4 /* salesperson */ ,
- `description` = vNotes
- ON DUPLICATE KEY UPDATE
- `description` = CONCAT(VALUES(`description`),'. ', `description`);
- END IF;
-
- -- Añade los movimientos y sus componentes
-
- OPEN cRows;
-
- lRows:
- LOOP
- SET vDone = FALSE;
- FETCH cRows INTO vRowId, vItem, vConcept, vAmount, vPrice, vRate;
-
- IF vDone THEN
- LEAVE lRows;
- END IF;
-
- INSERT INTO vn.sale
- SET
- itemFk = vItem,
- ticketFk = vTicket,
- concept = vConcept,
- quantity = vAmount,
- price = vPrice,
- priceFixed = 0,
- isPriceFixed = TRUE;
-
- SET vSale = LAST_INSERT_ID();
-
- INSERT INTO vn.saleComponent
- (saleFk, componentFk, `value`)
- SELECT vSale, cm.component_id, cm.price
- FROM order_component cm
- JOIN vn.component c ON c.id = cm.component_id
- WHERE cm.order_row_id = vRowId
- GROUP BY vSale, cm.component_id;
-
- UPDATE order_row SET Id_Movimiento = vSale
- WHERE id = vRowId;
-
- END LOOP;
-
- CLOSE cRows;
-
- -- Fija el coste
-
- DROP TEMPORARY TABLE IF EXISTS tComponents;
- CREATE TEMPORARY TABLE tComponents
- (INDEX (saleFk))
- ENGINE = MEMORY
- SELECT SUM(sc.`value`) valueSum, sc.saleFk
- FROM vn.saleComponent sc
- JOIN vn.component c ON c.id = sc.componentFk
- JOIN vn.componentType ct ON ct.id = c.typeFk AND ct.isBase
- JOIN vn.sale s ON s.id = sc.saleFk
- WHERE s.ticketFk = vTicket
- GROUP BY sc.saleFk;
-
- UPDATE vn.sale s
- JOIN tComponents mc ON mc.saleFk = s.id
- SET s.priceFixed = valueSum;
-
- DROP TEMPORARY TABLE tComponents;
- END LOOP;
-
- CLOSE cDates;
-
- DELETE FROM basketOrder WHERE orderFk = vOrder;
- UPDATE `order` SET confirmed = TRUE, confirm_date = NOW()
- WHERE id = vOrder;
-
- COMMIT;
-END$$
-
-DELIMITER ;
-
diff --git a/db/changes/10140-kings/01-tarifaComponentSerie.sql b/db/changes/10140-kings/01-tarifaComponentSerie.sql
deleted file mode 100644
index acdae0b13..000000000
--- a/db/changes/10140-kings/01-tarifaComponentSerie.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-CREATE
- OR REPLACE ALGORITHM = UNDEFINED
- DEFINER = `root`@`%`
- SQL SECURITY DEFINER
-VIEW `bi`.`tarifa_componentes_series` AS
- SELECT
- `ct`.`id` AS `tarifa_componentes_series_id`,
- `ct`.`type` AS `Serie`,
- `ct`.`isBase` AS `base`,
- `ct`.`isMargin` AS `margen`
- FROM
- `vn`.`componentType` `ct`;
diff --git a/db/changes/10141-zoneDoCalc/00-ticket.sql b/db/changes/10141-zoneDoCalc/00-ticket.sql
new file mode 100644
index 000000000..a756a11af
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/00-ticket.sql
@@ -0,0 +1,19 @@
+ALTER TABLE `vn`.`ticket`
+ADD COLUMN `zonePrice` DECIMAL(10,2) NULL DEFAULT NULL AFTER `collectionFk`,
+ADD COLUMN `zoneBonus` DECIMAL(10,2) NULL DEFAULT NULL AFTER `zonePrice`,
+ADD COLUMN `zoneClosure` TIME NULL AFTER `zoneBonus`;
+
+CREATE TABLE `vn`.`zoneCalcTicket` (
+ `zoneFk` int(11) NOT NULL PRIMARY KEY,
+ CONSTRAINT `zoneCalcTicketfk_1` FOREIGN KEY (`zoneFk`) REFERENCES `vn`.`zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP EVENT IF EXISTS vn.`zone_doCalc`;
+CREATE DEFINER=`root`@`%` EVENT vn.`zone_doCalc`
+ ON SCHEDULE EVERY 15 SECOND STARTS '2020-01-31 11:32:30'
+ ON COMPLETION PRESERVE ENABLE
+ DO CALL util.procNoOverlap('vn.zone_doCalc');
+
+DROP TABLE `vn`.`zoneConfig`;
+
+DROP procedure IF EXISTS vn.`zoneClosure_recalc`;
\ No newline at end of file
diff --git a/db/changes/10141-zoneDoCalc/01-ticket_doCalc.sql b/db/changes/10141-zoneDoCalc/01-ticket_doCalc.sql
new file mode 100644
index 000000000..d7538ff84
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/01-ticket_doCalc.sql
@@ -0,0 +1,56 @@
+USE `vn`;
+DROP procedure IF EXISTS `zone_doCalc`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_doCalc`()
+proc: BEGIN
+/**
+ * Updates ticket fields related with zone
+ */
+ DECLARE vDone BOOL;
+ DECLARE vTicketFk INT;
+ DECLARE vShipped DATE;
+ DECLARE vZoneFk INT;
+
+ DECLARE cCur CURSOR FOR
+ SELECT t.id, t.shipped, t.zoneFk
+ FROM zoneCalcTicket zct
+ JOIN ticket t ON t.zoneFk = zct.zoneFk
+ WHERE shipped >= CURDATE();
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND
+ SET vDone = TRUE;
+
+ OPEN cCur;
+
+ myLoop: LOOP
+ SET vDone = FALSE;
+ FETCH cCur INTO vTicketFk, vShipped, vZoneFk;
+
+ IF vDone THEN
+ LEAVE myLoop;
+ END IF;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.zone;
+ CREATE TEMPORARY TABLE tmp.zone
+ (INDEX (id))
+ ENGINE = MEMORY
+ SELECT vZoneFk id;
+
+ CALL zone_getOptionsForShipment(vShipped, TRUE);
+
+ UPDATE ticket t
+ LEFT JOIN tmp.zoneOption zo ON TRUE
+ SET zonePrice = zo.price, zoneBonus = zo.bonus, zoneClosure = zo.`hour`
+ WHERE t.id = vTicketFk;
+
+ END LOOP;
+
+ CLOSE cCur;
+
+ DELETE FROM zoneCalcTicket;
+END$$
+
+DELIMITER ;
+
diff --git a/db/changes/10141-zoneDoCalc/02-insertPastTickets.sql b/db/changes/10141-zoneDoCalc/02-insertPastTickets.sql
new file mode 100644
index 000000000..4314e5d7d
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/02-insertPastTickets.sql
@@ -0,0 +1,62 @@
+USE `vn`;
+DROP procedure IF EXISTS `zone_doCalcInitialize`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_doCalcInitialize`()
+proc: BEGIN
+/**
+ * Initialize ticket
+ */
+ DECLARE vDone BOOL;
+ DECLARE vTicketFk INT;
+ DECLARE vLanded DATE;
+ DECLARE vZoneFk INT;
+
+ DECLARE cCur CURSOR FOR
+ SELECT t.id, t.landed, t.zoneFk
+ FROM ticket t
+ WHERE (zonePrice IS NULL OR zoneBonus IS NULL OR zoneClosure IS NULL)
+ AND landed >= '2019-01-01' AND shipped >= '2019-01-01'
+ GROUP BY landed, zoneFk;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND
+ SET vDone = TRUE;
+
+ OPEN cCur;
+
+ myLoop: LOOP
+ SET vDone = FALSE;
+ FETCH cCur INTO vTicketFk, vLanded, vZoneFk;
+
+ IF vDone THEN
+ LEAVE myLoop;
+ END IF;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.zone;
+ CREATE TEMPORARY TABLE tmp.zone
+ (INDEX (id))
+ ENGINE = MEMORY
+ SELECT vZoneFk id;
+
+ CALL zone_getOptionsForLanding(vLanded, TRUE);
+
+ UPDATE ticket t
+ LEFT JOIN tmp.zoneOption zo ON TRUE
+ SET zonePrice = zo.price, zoneBonus = zo.bonus, zoneClosure = zo.`hour`
+ WHERE t.zoneFk = vZoneFk AND landed = vLanded;
+
+ UPDATE ticket t
+ LEFT JOIN vn.zone z ON z.id = t.zoneFk
+ SET zonePrice = z.price, zoneBonus = z.bonus, zoneClosure = z.`hour`
+ WHERE t.zonePrice IS NULL AND z.id = vZoneFk
+ AND landed >= '2019-01-01' AND shipped >= '2019-01-01';
+
+ END LOOP;
+
+ CLOSE cCur;
+
+ DELETE FROM zoneCalcTicket;
+END$$
+
+DELIMITER ;
\ No newline at end of file
diff --git a/db/changes/10141-zoneDoCalc/02-procNoOverlap.sql b/db/changes/10141-zoneDoCalc/02-procNoOverlap.sql
new file mode 100644
index 000000000..253264ce9
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/02-procNoOverlap.sql
@@ -0,0 +1,30 @@
+USE `util`;
+DROP procedure IF EXISTS `procNoOverlap`;
+
+DELIMITER $$
+USE `util`$$
+CREATE PROCEDURE `procNoOverlap` (procName VARCHAR(255))
+SQL SECURITY INVOKER
+proc: BEGIN
+/**
+ * call procedure without overlap
+ */
+ DECLARE vIsChanged BOOL;
+
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+ BEGIN
+ DO RELEASE_LOCK(procName);
+ RESIGNAL;
+ END;
+
+ IF !GET_LOCK(procName, 0) THEN
+ LEAVE proc;
+ END IF;
+
+ CALL exec(CONCAT('CALL ', procName));
+
+ DO RELEASE_LOCK(procName);
+END$$
+
+DELIMITER ;
+
diff --git a/db/changes/10141-zoneDoCalc/03-getOptionsForLanding.sql b/db/changes/10141-zoneDoCalc/03-getOptionsForLanding.sql
new file mode 100644
index 000000000..e0f5f9a48
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-getOptionsForLanding.sql
@@ -0,0 +1,66 @@
+USE `vn`;
+DROP procedure IF EXISTS `zone_getOptionsForLanding`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_getOptionsForLanding`(vLanded DATE, vShowExpiredZones BOOLEAN)
+BEGIN
+/**
+ * Gets computed options for the passed zones and delivery date.
+ *
+ * @table tmp.zones(id) The zones ids
+ * @param vLanded The delivery date
+ * @return tmp.zoneOption The computed options
+ */
+ DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption;
+ CREATE TEMPORARY TABLE tmp.zoneOption
+ ENGINE = MEMORY
+ SELECT
+ zoneFk,
+ `hour`,
+ travelingDays,
+ price,
+ bonus,
+ TIMESTAMPADD(DAY, -travelingDays, vLanded) shipped
+ FROM (
+ SELECT t.id zoneFk,
+ TIME(IFNULL(e.`hour`, z.`hour`)) `hour`,
+ IFNULL(e.travelingDays, z.travelingDays) travelingDays,
+ IFNULL(e.price, z.price) price,
+ IFNULL(e.bonus, z.bonus) bonus
+ FROM tmp.zone t
+ JOIN zone z ON z.id = t.id
+ JOIN zoneEvent e ON e.zoneFk = t.id
+ WHERE (
+ e.`type` = 'day'
+ AND e.dated = vLanded
+ ) OR (
+ e.`type` != 'day'
+ AND e.weekDays & (1 << WEEKDAY(vLanded))
+ AND (e.`started` IS NULL OR vLanded >= e.`started`)
+ AND (e.`ended` IS NULL OR vLanded <= e.`ended`)
+ )
+ ORDER BY
+ zoneFk,
+ CASE
+ WHEN e.`type` = 'day'
+ THEN 1
+ WHEN e.`type` = 'range'
+ THEN 2
+ ELSE 3
+ END
+ ) t
+ GROUP BY zoneFk;
+
+ DELETE t FROM tmp.zoneOption t
+ JOIN zoneExclusion e
+ ON e.zoneFk = t.zoneFk AND e.`dated` = vLanded;
+
+ IF NOT vShowExpiredZones THEN
+ DELETE FROM tmp.zoneOption
+ WHERE shipped < CURDATE()
+ OR (shipped = CURDATE() AND CURTIME() > `hour`);
+ END IF;
+END$$
+
+DELIMITER ;
\ No newline at end of file
diff --git a/db/changes/10141-zoneDoCalc/03-rutasAnalyze.sql b/db/changes/10141-zoneDoCalc/03-rutasAnalyze.sql
new file mode 100644
index 000000000..313f2f797
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-rutasAnalyze.sql
@@ -0,0 +1,171 @@
+USE `vn`;
+DROP procedure IF EXISTS `rutasAnalyze`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `rutasAnalyze`(vYear INT, vMonth INT)
+BEGIN
+
+/* Analiza los costes de las rutas de reparto y lo almacena en la tabla Rutas_Master
+*
+* PAK 15/4/2019
+*/
+
+ DELETE FROM bi.rutasBoard
+ WHERE year = vYear AND month = vMonth;
+
+ -- Rellenamos la tabla con los datos de las rutas VOLUMETRICAS, especialmente con los bultos "virtuales"
+ INSERT INTO bi.rutasBoard(year,
+ month,
+ warehouse_id,
+ Id_Ruta,
+ Id_Agencia,
+ km,
+ Dia,
+ Fecha,
+ Bultos,
+ Matricula,
+ Tipo,
+ Terceros)
+ SELECT YEAR(r.created),
+ MONTH(r.created),
+ GREATEST(1,a.warehouseFk),
+ r.id,
+ r.agencyModeFk,
+ r.kmEnd - r.kmStart,
+ DAYNAME(r.created),
+ r.created,
+ SUM(sv.volume / ebv.m3),
+ v.numberPlate,
+ IF(ISNULL(`r`.`cost`), 'P', 'A'),
+ r.cost
+ FROM vn.route r
+ JOIN vn.ticket t ON t.routeFk = r.id
+ LEFT JOIN vn.zone z ON z.id = t.zoneFk
+ LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
+ LEFT JOIN vn.agency a ON a.id = am.agencyFk
+ LEFT JOIN vn.vehicle v ON v.id = r.vehicleFk
+ JOIN vn.saleVolume sv ON sv.ticketFk = t.id
+ JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = 71
+ WHERE YEAR(r.created) = vYear AND MONTH(r.created) = vMonth
+ AND z.isVolumetric
+ GROUP BY r.id;
+
+ -- Rellenamos la tabla con los datos de las rutas NO VOLUMETRICAS, especialmente con los bultos "virtuales"
+ INSERT INTO bi.rutasBoard(year,
+ month,
+ warehouse_id,
+ Id_Ruta,
+ Id_Agencia,
+ km,
+ Dia,
+ Fecha,
+ Bultos,
+ Matricula,
+ Tipo,
+ Terceros)
+ SELECT YEAR(r.created),
+ MONTH(r.created),
+ GREATEST(1,a.warehouseFk),
+ r.id,
+ r.agencyModeFk,
+ r.kmEnd - r.kmStart,
+ DAYNAME(r.created),
+ r.created,
+ SUM(t.packages),
+ v.numberPlate,
+ IF(ISNULL(`r`.`cost`), 'P', 'A'),
+ r.cost
+ FROM vn.route r
+ JOIN vn.ticket t ON t.routeFk = r.id
+ LEFT JOIN vn.zone z ON z.id = t.zoneFk
+ LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
+ LEFT JOIN vn.agency a ON a.id = am.agencyFk
+ LEFT JOIN vn.vehicle v ON v.id = r.vehicleFk
+ WHERE YEAR(r.created) = vYear AND MONTH(r.created) = vMonth
+ AND z.isVolumetric = FALSE
+ GROUP BY r.id
+ ON DUPLICATE KEY UPDATE Bultos = Bultos + VALUES(Bultos);
+
+ -- Coste REAL de cada bulto "virtual", de acuerdo con el valor apuntado a mano en la ruta
+ UPDATE bi.rutasBoard r
+ INNER JOIN vn2008.Rutas_Master rm ON rm.año = r.year AND rm.mes = r.month AND rm.warehouse_id = r.warehouse_id
+ SET r.coste_bulto = IF(r.Tipo ='A', r.Terceros, r.km * rm.coste_km ) / r.Bultos
+ WHERE r.Bultos > 0
+ AND rm.año = vYear
+ AND rm.mes = vMonth;
+
+ -- Coste PRACTICO de cada bulto, de acuerdo con los componentes de tipo AGENCIA en cada linea de venta
+ UPDATE bi.rutasBoard r
+ JOIN (
+ SELECT t.routeFk, sum(s.quantity * sc.value) practicoTotal
+ FROM vn.route r
+ JOIN vn.time tm ON tm.dated = r.created
+ JOIN vn.ticket t ON t.routeFk = r.id
+ JOIN vn.sale s ON s.ticketFk = t.id
+ 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.type = 'agencia'
+ AND tm.year = vYear
+ AND tm.month = vMonth
+ GROUP BY r.id
+ ) sub ON sub.routeFk = r.Id_Ruta
+ SET r.practico = sub.practicoTotal / r.Bultos;
+
+ -- Coste TEORICO de una caja "virtual" para cada ruta, teniendo en cuenta que hay carros, pallets, etc
+ UPDATE bi.rutasBoard r
+ JOIN (
+ SELECT t.routeFk,
+ SUM(t.zonePrice/ ebv.ratio)/ count(*) AS BultoTeoricoMedio
+ FROM vn.ticket t
+ JOIN vn.route r ON r.id = t.routeFk
+ JOIN vn.time tm ON tm.dated = r.created
+ JOIN vn.expedition e ON e.ticketFk = t.id
+ JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.isBox
+ JOIN vn.address ad ON ad.id = t.addressFk
+ JOIN vn.client c ON c.id = ad.clientFk
+ LEFT JOIN vn.zone z ON z.id = t.zoneFk
+ WHERE tm.year = vYear
+ AND tm.month = vMonth
+ AND z.isVolumetric = FALSE
+ GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk
+ SET r.teorico = sub.BultoTeoricoMedio;
+
+ -- Coste VOLUMETRICO TEORICO de una caja "virtual" para cada ruta
+ UPDATE bi.rutasBoard r
+ JOIN (
+ SELECT t.routeFk,
+ SUM(freight) AS BultoTeoricoMedio
+ FROM vn.ticket t
+ JOIN vn.route r ON r.id = t.routeFk
+ JOIN vn.time tm ON tm.dated = r.created
+ JOIN vn.saleVolume sf ON sf.ticketFk = t.id
+ JOIN vn.client c ON c.id = t.clientFk
+ JOIN vn.zone z ON z.id = t.zoneFk
+ WHERE tm.year = vYear
+ AND tm.month = vMonth
+ AND z.isVolumetric != FALSE
+ GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk
+ SET r.teorico = sub.BultoTeoricoMedio / r.Bultos;
+
+ -- La diferencia entre el teorico y el practico se deberia de cobrar en greuges, cada noche
+ UPDATE bi.rutasBoard r
+ JOIN (
+ SELECT t.routeFk,
+ Sum(g.amount) AS greuge
+ FROM vn.ticket t
+ JOIN vn.route r ON r.id = t.routeFk
+ JOIN vn.time tm ON tm.dated = r.created
+ JOIN vn.greuge g ON g.ticketFk = t.id
+ JOIN vn.greugeType gt ON gt.id = g.greugeTypeFk
+ WHERE tm.year = vYear
+ AND tm.month = vMonth
+ AND gt.name = 'Diferencia portes'
+ GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk
+ SET r.greuge = sub.greuge / r.Bultos;
+
+END$$
+
+DELIMITER ;
+
diff --git a/db/changes/10141-zoneDoCalc/03-saleVolume.sql b/db/changes/10141-zoneDoCalc/03-saleVolume.sql
new file mode 100644
index 000000000..2ded49a8d
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-saleVolume.sql
@@ -0,0 +1,26 @@
+USE `vn`;
+CREATE
+ OR REPLACE ALGORITHM = UNDEFINED
+ DEFINER = `root`@`%`
+ SQL SECURITY DEFINER
+VIEW `saleVolume` AS
+ SELECT
+ `s`.`ticketFk` AS `ticketFk`,
+ `s`.`id` AS `saleFk`,
+ IFNULL(ROUND(((((`i`.`compression` * (GREATEST(`i`.`density`, 167) / 167)) * `ic`.`cm3`) * `s`.`quantity`) / 1000),
+ 2),
+ 0) AS `litros`,
+ `t`.`routeFk` AS `routeFk`,
+ `t`.`shipped` AS `shipped`,
+ (((`s`.`quantity` * `ic`.`cm3`) * `i`.`compression`) / 1000000) AS `volume`,
+ ((((`s`.`quantity` * `ic`.`cm3`) * `i`.`compression`) * (GREATEST(`i`.`density`, 167) / 167)) / 1000000) AS `physicalWeight`,
+ (((`s`.`quantity` * `ic`.`cm3`) * `i`.`density`) / 1000000) AS `weight`,
+ (((`s`.`quantity` * `ic`.`cm3`) * `i`.`compression`) / 1000000) AS `physicalVolume`,
+ ((((`s`.`quantity` * `ic`.`cm3`) * `t`.`zonePrice`) * `i`.`compression`) / `cb`.`volume`) AS `freight`
+ FROM
+ ((((`sale` `s`
+ JOIN `item` `i` ON ((`i`.`id` = `s`.`itemFk`)))
+ JOIN `ticket` `t` ON ((`t`.`id` = `s`.`ticketFk`)))
+ JOIN `packaging` `cb` ON ((`cb`.`id` = '94')))
+ JOIN `itemCost` `ic` ON (((`ic`.`itemFk` = `s`.`itemFk`)
+ AND (`ic`.`warehouseFk` = `t`.`warehouseFk`))));
diff --git a/db/changes/10141-zoneDoCalc/03-viewSaleFreight__.sql b/db/changes/10141-zoneDoCalc/03-viewSaleFreight__.sql
new file mode 100644
index 000000000..903c8b48a
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-viewSaleFreight__.sql
@@ -0,0 +1,24 @@
+DROP VIEW IF EXISTS `vn`.`saleFreight` ;
+USE `vn`;
+CREATE
+ OR REPLACE ALGORITHM = UNDEFINED
+ DEFINER = `root`@`%`
+ SQL SECURITY DEFINER
+VIEW `saleFreight__` AS
+ SELECT
+ `s`.`ticketFk` AS `ticketFk`,
+ `t`.`clientFk` AS `clientFk`,
+ `t`.`routeFk` AS `routeFk`,
+ `s`.`id` AS `saleFk`,
+ `t`.`zoneFk` AS `zoneFk`,
+ `t`.`companyFk` AS `companyFk`,
+ `t`.`shipped` AS `shipped`,
+ `t`.`zonePrice` AS `price`,
+ ((((`s`.`quantity` * `r`.`cm3`) * `t`.`zonePrice`) * `i`.`compression`) / `cb`.`volume`) AS `freight`
+ FROM
+ ((((`vn`.`sale` `s`
+ JOIN `vn`.`item` `i` ON ((`i`.`id` = `s`.`itemFk`)))
+ JOIN `vn`.`ticket` `t` ON ((`t`.`id` = `s`.`ticketFk`)))
+ JOIN `vn`.`packaging` `cb` ON ((`cb`.`id` = '94')))
+ JOIN `bi`.`rotacion` `r` ON (((`r`.`Id_Article` = `s`.`itemFk`)
+ AND (`r`.`warehouse_id` = `t`.`warehouseFk`))));
diff --git a/db/changes/10141-zoneDoCalc/03-zone_geShippedWarehouse.sql b/db/changes/10141-zoneDoCalc/03-zone_geShippedWarehouse.sql
new file mode 100644
index 000000000..14d5d8cd9
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-zone_geShippedWarehouse.sql
@@ -0,0 +1,41 @@
+USE `vn`;
+DROP procedure IF EXISTS `zone_getShippedWarehouse`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_getShippedWarehouse`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT)
+BEGIN
+/**
+ * Devuelve la mÃnima fecha de envÃo para cada warehouse
+ *
+ * @param vLanded La fecha de recepcion
+ * @param vAddressFk Id del consignatario
+ * @param vAgencyModeFk Id de la agencia
+ * @return tmp.zoneGetShipped
+ */
+
+ CALL zone_getFromGeo(address_getGeo(vAddressFk));
+ CALL zone_getOptionsForLanding(vLanded,TRUE);
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.zoneGetShipped;
+ CREATE TEMPORARY TABLE tmp.zoneGetShipped
+ ENGINE = MEMORY
+ SELECT * FROM (
+ SELECT zo.zoneFk,
+ TIMESTAMPADD(DAY,-zo.travelingDays, vLanded) shipped,
+ zo.`hour`,
+ zw.warehouseFk,
+ z.agencyModeFk
+ FROM tmp.zoneOption zo
+ JOIN zoneWarehouse zw ON zw.zoneFk = zo.zoneFk
+ JOIN zone z ON z.id = zo.zoneFk
+ WHERE z.agencyModeFk = vAgencyModeFk
+ ORDER BY shipped) t
+ GROUP BY warehouseFk;
+
+ DROP TEMPORARY TABLE
+ tmp.zone,
+ tmp.zoneOption;
+END$$
+
+DELIMITER ;
\ No newline at end of file
diff --git a/db/changes/10141-zoneDoCalc/03-zone_getAgency.sql b/db/changes/10141-zoneDoCalc/03-zone_getAgency.sql
new file mode 100644
index 000000000..b2837d43c
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-zone_getAgency.sql
@@ -0,0 +1,42 @@
+USE `vn`;
+DROP procedure IF EXISTS `zone_getAgency`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_getAgency`(vAddress INT, vLanded DATE)
+BEGIN
+/**
+ * Devuelve el listado de agencias disponibles para la fecha
+ * y dirección pasadas.
+ *
+ * @param vAddress Id de dirección de envío, %NULL si es recogida
+ * @param vLanded Fecha de recogida
+ * @select Listado de agencias disponibles
+ */
+
+ CALL zone_getFromGeo(address_getGeo(vAddress));
+ CALL zone_getOptionsForLanding(vLanded, FALSE);
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.zoneGetAgency;
+ CREATE TEMPORARY TABLE tmp.zoneGetAgency
+ (INDEX (agencyModeFk)) ENGINE = MEMORY
+ SELECT am.name agencyMode,
+ am.description,
+ z.agencyModeFk,
+ am.deliveryMethodFk,
+ TIMESTAMPADD(DAY,-zo.travelingDays, vLanded) shipped,
+ TRUE isIncluded,
+ zo.zoneFk
+ FROM tmp.zoneOption zo
+ JOIN zone z ON z.id = zo.zoneFk
+ JOIN agencyMode am ON am.id = z.agencyModeFk
+ GROUP BY agencyModeFk;
+
+ DROP TEMPORARY TABLE
+ tmp.zone,
+ tmp.zoneOption;
+
+END$$
+
+DELIMITER ;
+
diff --git a/db/changes/10141-zoneDoCalc/03-zone_getAvailable.sql b/db/changes/10141-zoneDoCalc/03-zone_getAvailable.sql
new file mode 100644
index 000000000..2ef1a1ae9
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-zone_getAvailable.sql
@@ -0,0 +1,18 @@
+USE `vn`;
+DROP procedure IF EXISTS `zone_getAvailable`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_getAvailable`(vAddress INT, vLanded DATE)
+BEGIN
+ CALL zone_getFromGeo(address_getGeo(vAddress));
+ CALL zone_getOptionsForLanding(vLanded, FALSE);
+
+ SELECT * FROM tmp.zoneOption;
+
+ DROP TEMPORARY TABLE
+ tmp.zone,
+ tmp.zoneOption;
+END$$
+
+DELIMITER ;
\ No newline at end of file
diff --git a/db/changes/10141-zoneDoCalc/03-zone_getWarehouse.sql b/db/changes/10141-zoneDoCalc/03-zone_getWarehouse.sql
new file mode 100644
index 000000000..c1cea8b13
--- /dev/null
+++ b/db/changes/10141-zoneDoCalc/03-zone_getWarehouse.sql
@@ -0,0 +1,41 @@
+USE `vn`;
+DROP procedure IF EXISTS `zone_getWarehouse`;
+
+DELIMITER $$
+USE `vn`$$
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_getWarehouse`(vAddress INT, vLanded DATE, vWarehouse INT)
+BEGIN
+/**
+ * Devuelve el listado de agencias disponibles para la fecha,
+ * dirección y almacén pasados.
+ *
+ * @param vAddress
+ * @param vWarehouse warehouse
+ * @param vLanded Fecha de recogida
+ * @select Listado de agencias disponibles
+ */
+
+ CALL zone_getFromGeo(address_getGeo(vAddress));
+ CALL zone_getOptionsForLanding(vLanded, FALSE);
+
+ SELECT am.id agencyModeFk,
+ am.name agencyMode,
+ am.description,
+ am.deliveryMethodFk,
+ TIMESTAMPADD(DAY, -zo.travelingDays, vLanded) shipped,
+ zw.warehouseFk,
+ z.id zoneFk
+ FROM tmp.zoneOption zo
+ JOIN zone z ON z.id = zo.zoneFk
+ JOIN agencyMode am ON am.id = z.agencyModeFk
+ JOIN zoneWarehouse zw ON zw.zoneFk = zo.zoneFk
+ WHERE zw.warehouseFk
+ GROUP BY z.agencyModeFk
+ ORDER BY agencyMode;
+
+ DROP TEMPORARY TABLE
+ tmp.zone,
+ tmp.zoneOption;
+END$$
+
+DELIMITER ;
\ No newline at end of file
diff --git a/db/changes/10150-entry/00-ticketUpdateAction.sql b/db/changes/10150-entry/00-ticketUpdateAction.sql
new file mode 100644
index 000000000..a05c65d7a
--- /dev/null
+++ b/db/changes/10150-entry/00-ticketUpdateAction.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `vn`.`ticketUpdateAction`
+ADD COLUMN `code` VARCHAR(45) NOT NULL AFTER `description`;
+
+UPDATE `vn`.`ticketUpdateAction` SET `code`='changePrice' WHERE `id`='1';
+UPDATE `vn`.`ticketUpdateAction` SET `code`='turnInMana' WHERE `id`='3';
diff --git a/db/changes/10160-postValentineDay/00-ACL.sql b/db/changes/10160-postValentineDay/00-ACL.sql
new file mode 100644
index 000000000..5b6301e3d
--- /dev/null
+++ b/db/changes/10160-postValentineDay/00-ACL.sql
@@ -0,0 +1,2 @@
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES ('Intrastat', '*', '*', 'ALLOW', 'ROLE', 'buyer');
diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql
index 7e766195d..74290b451 100644
--- a/db/dump/dumpedFixtures.sql
+++ b/db/dump/dumpedFixtures.sql
@@ -23,7 +23,7 @@ USE `util`;
LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
-INSERT INTO `config` VALUES (1,'10121',0,'production',NULL);
+INSERT INTO `config` VALUES (1,'10140',0,'production',NULL);
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -36,7 +36,7 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-23 14:05:01
+-- Dump completed on 2020-02-13 9:07:05
USE `account`;
-- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64)
--
@@ -61,7 +61,7 @@ USE `account`;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
-INSERT INTO `role` VALUES (0,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2018-04-23 14:33:59'),(1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'),(13,'teamBoss','Jefe de departamento',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'),(20,'manager','Departamento de gerencia',1,'2017-06-01 14:57:02','2017-06-01 14:57:51'),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08'),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'),(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'),(49,'production','Empleado de producción',0,'2018-02-26 15:28:23','2019-01-21 12:57:21'),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57'),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01'),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07'),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05'),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08'),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26'),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56'),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23');
+INSERT INTO `role` VALUES (0,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2018-04-23 14:33:59'),(1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'),(13,'teamBoss','Jefe de departamento',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'),(20,'manager','Departamento de gerencia',1,'2017-06-01 14:57:02','2017-06-01 14:57:51'),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08'),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'),(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'),(49,'production','Empleado de producción',0,'2018-02-26 15:28:23','2019-01-21 12:57:21'),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57'),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01'),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07'),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05'),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08'),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26'),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56'),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23'),(69,'coolerAssist','Empleado cámara con permiso compras',1,'2020-02-05 12:36:09','2020-02-05 12:36:09');
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
@@ -71,7 +71,7 @@ UNLOCK TABLES;
LOCK TABLES `roleInherit` WRITE;
/*!40000 ALTER TABLE `roleInherit` DISABLE KEYS */;
-INSERT INTO `roleInherit` VALUES (9,0),(66,0),(5,1),(13,1),(18,1),(31,1),(32,1),(34,1),(35,1),(37,1),(40,1),(42,1),(44,1),(47,1),(51,1),(53,1),(54,1),(56,1),(58,1),(1,2),(1,3),(30,5),(39,5),(60,5),(67,5),(11,6),(1,11),(2,11),(3,11),(16,13),(20,13),(21,13),(22,13),(34,13),(41,13),(43,13),(45,13),(48,13),(50,13),(52,13),(55,13),(57,13),(59,13),(61,13),(16,15),(20,16),(21,18),(52,19),(65,19),(17,20),(30,20),(5,21),(19,21),(22,21),(39,21),(30,22),(5,33),(34,33),(15,35),(41,35),(52,35),(65,35),(49,36),(61,36),(17,37),(38,37),(60,37),(67,37),(17,39),(41,40),(43,42),(36,44),(45,44),(36,47),(48,47),(50,49),(60,50),(65,50),(52,51),(21,53),(30,53),(55,54),(57,56),(15,57),(39,57),(50,57),(60,57),(49,58),(59,58),(50,59),(17,64),(30,64),(38,64),(20,65);
+INSERT INTO `roleInherit` VALUES (9,0),(66,0),(5,1),(13,1),(18,1),(31,1),(32,1),(34,1),(35,1),(37,1),(40,1),(42,1),(44,1),(47,1),(51,1),(53,1),(54,1),(56,1),(58,1),(1,2),(1,3),(30,5),(39,5),(60,5),(67,5),(11,6),(1,11),(2,11),(3,11),(16,13),(20,13),(21,13),(22,13),(34,13),(41,13),(43,13),(45,13),(48,13),(50,13),(52,13),(55,13),(57,13),(59,13),(61,13),(16,15),(20,16),(21,18),(52,19),(65,19),(17,20),(30,20),(5,21),(19,21),(22,21),(39,21),(30,22),(5,33),(34,33),(15,35),(41,35),(52,35),(65,35),(69,35),(49,36),(61,36),(17,37),(38,37),(60,37),(67,37),(17,39),(41,40),(43,42),(36,44),(45,44),(36,47),(48,47),(69,47),(50,49),(60,50),(65,50),(52,51),(21,53),(30,53),(55,54),(57,56),(15,57),(39,57),(50,57),(60,57),(49,58),(59,58),(50,59),(17,64),(30,64),(38,64),(20,65);
/*!40000 ALTER TABLE `roleInherit` ENABLE KEYS */;
UNLOCK TABLES;
@@ -81,7 +81,7 @@ UNLOCK TABLES;
LOCK TABLES `roleRole` WRITE;
/*!40000 ALTER TABLE `roleRole` DISABLE KEYS */;
-INSERT INTO `roleRole` VALUES (0,0),(0,1),(0,2),(0,3),(0,5),(0,6),(0,9),(0,11),(0,13),(0,15),(0,16),(0,17),(0,18),(0,19),(0,20),(0,21),(0,22),(0,30),(0,31),(0,32),(0,33),(0,34),(0,35),(0,36),(0,37),(0,38),(0,39),(0,40),(0,41),(0,42),(0,43),(0,44),(0,45),(0,47),(0,48),(0,49),(0,50),(0,51),(0,52),(0,53),(0,54),(0,55),(0,56),(0,57),(0,58),(0,59),(0,60),(0,61),(0,62),(0,64),(0,65),(0,66),(0,67),(1,1),(1,2),(1,3),(1,6),(1,11),(2,2),(2,6),(2,11),(3,3),(3,6),(3,11),(5,1),(5,2),(5,3),(5,5),(5,6),(5,11),(5,13),(5,18),(5,21),(5,33),(5,53),(6,6),(9,0),(9,1),(9,2),(9,3),(9,5),(9,6),(9,9),(9,11),(9,13),(9,15),(9,16),(9,17),(9,18),(9,19),(9,20),(9,21),(9,22),(9,30),(9,31),(9,32),(9,33),(9,34),(9,35),(9,36),(9,37),(9,38),(9,39),(9,40),(9,41),(9,42),(9,43),(9,44),(9,45),(9,47),(9,48),(9,49),(9,50),(9,51),(9,52),(9,53),(9,54),(9,55),(9,56),(9,57),(9,58),(9,59),(9,60),(9,61),(9,62),(9,64),(9,65),(9,66),(9,67),(11,6),(11,11),(13,1),(13,2),(13,3),(13,6),(13,11),(13,13),(15,1),(15,2),(15,3),(15,6),(15,11),(15,13),(15,15),(15,35),(15,56),(15,57),(16,1),(16,2),(16,3),(16,6),(16,11),(16,13),(16,15),(16,16),(16,35),(16,56),(16,57),(17,1),(17,2),(17,3),(17,5),(17,6),(17,11),(17,13),(17,15),(17,16),(17,17),(17,18),(17,19),(17,20),(17,21),(17,33),(17,35),(17,36),(17,37),(17,39),(17,44),(17,47),(17,49),(17,50),(17,53),(17,56),(17,57),(17,58),(17,59),(17,64),(17,65),(18,1),(18,2),(18,3),(18,6),(18,11),(18,18),(19,1),(19,2),(19,3),(19,6),(19,11),(19,13),(19,18),(19,19),(19,21),(19,53),(20,1),(20,2),(20,3),(20,6),(20,11),(20,13),(20,15),(20,16),(20,18),(20,19),(20,20),(20,21),(20,35),(20,36),(20,44),(20,47),(20,49),(20,50),(20,53),(20,56),(20,57),(20,58),(20,59),(20,65),(21,1),(21,2),(21,3),(21,6),(21,11),(21,13),(21,18),(21,21),(21,53),(22,1),(22,2),(22,3),(22,6),(22,11),(22,13),(22,18),(22,21),(22,22),(22,53),(30,1),(30,2),(30,3),(30,5),(30,6),(30,11),(30,13),(30,15),(30,16),(30,18),(30,19),(30,20),(30,21),(30,22),(30,30),(30,33),(30,35),(30,36),(30,44),(30,47),(30,49),(30,50),(30,53),(30,56),(30,57),(30,58),(30,59),(30,64),(30,65),(31,1),(31,2),(31,3),(31,6),(31,11),(31,31),(32,1),(32,2),(32,3),(32,6),(32,11),(32,32),(33,33),(34,1),(34,2),(34,3),(34,6),(34,11),(34,13),(34,33),(34,34),(35,1),(35,2),(35,3),(35,6),(35,11),(35,35),(36,1),(36,2),(36,3),(36,6),(36,11),(36,36),(36,44),(36,47),(37,1),(37,2),(37,3),(37,6),(37,11),(37,37),(38,1),(38,2),(38,3),(38,6),(38,11),(38,37),(38,38),(38,64),(39,1),(39,2),(39,3),(39,5),(39,6),(39,11),(39,13),(39,18),(39,21),(39,33),(39,39),(39,53),(39,56),(39,57),(40,1),(40,2),(40,3),(40,6),(40,11),(40,40),(41,1),(41,2),(41,3),(41,6),(41,11),(41,13),(41,35),(41,40),(41,41),(42,1),(42,2),(42,3),(42,6),(42,11),(42,42),(43,1),(43,2),(43,3),(43,6),(43,11),(43,13),(43,42),(43,43),(44,1),(44,2),(44,3),(44,6),(44,11),(44,44),(45,1),(45,2),(45,3),(45,6),(45,11),(45,13),(45,44),(45,45),(47,1),(47,2),(47,3),(47,6),(47,11),(47,47),(48,1),(48,2),(48,3),(48,6),(48,11),(48,13),(48,47),(48,48),(49,1),(49,2),(49,3),(49,6),(49,11),(49,36),(49,44),(49,47),(49,49),(49,58),(50,1),(50,2),(50,3),(50,6),(50,11),(50,13),(50,36),(50,44),(50,47),(50,49),(50,50),(50,56),(50,57),(50,58),(50,59),(51,1),(51,2),(51,3),(51,6),(51,11),(51,51),(52,1),(52,2),(52,3),(52,6),(52,11),(52,13),(52,18),(52,19),(52,21),(52,35),(52,51),(52,52),(52,53),(53,1),(53,2),(53,3),(53,6),(53,11),(53,53),(54,1),(54,2),(54,3),(54,6),(54,11),(54,54),(55,1),(55,2),(55,3),(55,6),(55,11),(55,13),(55,54),(55,55),(56,1),(56,2),(56,3),(56,6),(56,11),(56,56),(57,1),(57,2),(57,3),(57,6),(57,11),(57,13),(57,56),(57,57),(58,1),(58,2),(58,3),(58,6),(58,11),(58,58),(59,1),(59,2),(59,3),(59,6),(59,11),(59,13),(59,58),(59,59),(60,1),(60,2),(60,3),(60,5),(60,6),(60,11),(60,13),(60,18),(60,21),(60,33),(60,36),(60,37),(60,44),(60,47),(60,49),(60,50),(60,53),(60,56),(60,57),(60,58),(60,59),(60,60),(61,1),(61,2),(61,3),(61,6),(61,11),(61,13),(61,36),(61,44),(61,47),(61,61),(62,62),(64,64),(65,1),(65,2),(65,3),(65,6),(65,11),(65,13),(65,18),(65,19),(65,21),(65,35),(65,36),(65,44),(65,47),(65,49),(65,50),(65,53),(65,56),(65,57),(65,58),(65,59),(65,65),(66,0),(66,1),(66,2),(66,3),(66,5),(66,6),(66,9),(66,11),(66,13),(66,15),(66,16),(66,17),(66,18),(66,19),(66,20),(66,21),(66,22),(66,30),(66,31),(66,32),(66,33),(66,34),(66,35),(66,36),(66,37),(66,38),(66,39),(66,40),(66,41),(66,42),(66,43),(66,44),(66,45),(66,47),(66,48),(66,49),(66,50),(66,51),(66,52),(66,53),(66,54),(66,55),(66,56),(66,57),(66,58),(66,59),(66,60),(66,61),(66,62),(66,64),(66,65),(66,66),(66,67),(67,1),(67,2),(67,3),(67,5),(67,6),(67,11),(67,13),(67,18),(67,21),(67,33),(67,37),(67,53),(67,67);
+INSERT INTO `roleRole` VALUES (0,0),(0,1),(0,2),(0,3),(0,5),(0,6),(0,9),(0,11),(0,13),(0,15),(0,16),(0,17),(0,18),(0,19),(0,20),(0,21),(0,22),(0,30),(0,31),(0,32),(0,33),(0,34),(0,35),(0,36),(0,37),(0,38),(0,39),(0,40),(0,41),(0,42),(0,43),(0,44),(0,45),(0,47),(0,48),(0,49),(0,50),(0,51),(0,52),(0,53),(0,54),(0,55),(0,56),(0,57),(0,58),(0,59),(0,60),(0,61),(0,62),(0,64),(0,65),(0,66),(0,67),(0,69),(1,1),(1,2),(1,3),(1,6),(1,11),(2,2),(2,6),(2,11),(3,3),(3,6),(3,11),(5,1),(5,2),(5,3),(5,5),(5,6),(5,11),(5,13),(5,18),(5,21),(5,33),(5,53),(6,6),(9,0),(9,1),(9,2),(9,3),(9,5),(9,6),(9,9),(9,11),(9,13),(9,15),(9,16),(9,17),(9,18),(9,19),(9,20),(9,21),(9,22),(9,30),(9,31),(9,32),(9,33),(9,34),(9,35),(9,36),(9,37),(9,38),(9,39),(9,40),(9,41),(9,42),(9,43),(9,44),(9,45),(9,47),(9,48),(9,49),(9,50),(9,51),(9,52),(9,53),(9,54),(9,55),(9,56),(9,57),(9,58),(9,59),(9,60),(9,61),(9,62),(9,64),(9,65),(9,66),(9,67),(9,69),(11,6),(11,11),(13,1),(13,2),(13,3),(13,6),(13,11),(13,13),(15,1),(15,2),(15,3),(15,6),(15,11),(15,13),(15,15),(15,35),(15,56),(15,57),(16,1),(16,2),(16,3),(16,6),(16,11),(16,13),(16,15),(16,16),(16,35),(16,56),(16,57),(17,1),(17,2),(17,3),(17,5),(17,6),(17,11),(17,13),(17,15),(17,16),(17,17),(17,18),(17,19),(17,20),(17,21),(17,33),(17,35),(17,36),(17,37),(17,39),(17,44),(17,47),(17,49),(17,50),(17,53),(17,56),(17,57),(17,58),(17,59),(17,64),(17,65),(18,1),(18,2),(18,3),(18,6),(18,11),(18,18),(19,1),(19,2),(19,3),(19,6),(19,11),(19,13),(19,18),(19,19),(19,21),(19,53),(20,1),(20,2),(20,3),(20,6),(20,11),(20,13),(20,15),(20,16),(20,18),(20,19),(20,20),(20,21),(20,35),(20,36),(20,44),(20,47),(20,49),(20,50),(20,53),(20,56),(20,57),(20,58),(20,59),(20,65),(21,1),(21,2),(21,3),(21,6),(21,11),(21,13),(21,18),(21,21),(21,53),(22,1),(22,2),(22,3),(22,6),(22,11),(22,13),(22,18),(22,21),(22,22),(22,53),(30,1),(30,2),(30,3),(30,5),(30,6),(30,11),(30,13),(30,15),(30,16),(30,18),(30,19),(30,20),(30,21),(30,22),(30,30),(30,33),(30,35),(30,36),(30,44),(30,47),(30,49),(30,50),(30,53),(30,56),(30,57),(30,58),(30,59),(30,64),(30,65),(31,1),(31,2),(31,3),(31,6),(31,11),(31,31),(32,1),(32,2),(32,3),(32,6),(32,11),(32,32),(33,33),(34,1),(34,2),(34,3),(34,6),(34,11),(34,13),(34,33),(34,34),(35,1),(35,2),(35,3),(35,6),(35,11),(35,35),(36,1),(36,2),(36,3),(36,6),(36,11),(36,36),(36,44),(36,47),(37,1),(37,2),(37,3),(37,6),(37,11),(37,37),(38,1),(38,2),(38,3),(38,6),(38,11),(38,37),(38,38),(38,64),(39,1),(39,2),(39,3),(39,5),(39,6),(39,11),(39,13),(39,18),(39,21),(39,33),(39,39),(39,53),(39,56),(39,57),(40,1),(40,2),(40,3),(40,6),(40,11),(40,40),(41,1),(41,2),(41,3),(41,6),(41,11),(41,13),(41,35),(41,40),(41,41),(42,1),(42,2),(42,3),(42,6),(42,11),(42,42),(43,1),(43,2),(43,3),(43,6),(43,11),(43,13),(43,42),(43,43),(44,1),(44,2),(44,3),(44,6),(44,11),(44,44),(45,1),(45,2),(45,3),(45,6),(45,11),(45,13),(45,44),(45,45),(47,1),(47,2),(47,3),(47,6),(47,11),(47,47),(48,1),(48,2),(48,3),(48,6),(48,11),(48,13),(48,47),(48,48),(49,1),(49,2),(49,3),(49,6),(49,11),(49,36),(49,44),(49,47),(49,49),(49,58),(50,1),(50,2),(50,3),(50,6),(50,11),(50,13),(50,36),(50,44),(50,47),(50,49),(50,50),(50,56),(50,57),(50,58),(50,59),(51,1),(51,2),(51,3),(51,6),(51,11),(51,51),(52,1),(52,2),(52,3),(52,6),(52,11),(52,13),(52,18),(52,19),(52,21),(52,35),(52,51),(52,52),(52,53),(53,1),(53,2),(53,3),(53,6),(53,11),(53,53),(54,1),(54,2),(54,3),(54,6),(54,11),(54,54),(55,1),(55,2),(55,3),(55,6),(55,11),(55,13),(55,54),(55,55),(56,1),(56,2),(56,3),(56,6),(56,11),(56,56),(57,1),(57,2),(57,3),(57,6),(57,11),(57,13),(57,56),(57,57),(58,1),(58,2),(58,3),(58,6),(58,11),(58,58),(59,1),(59,2),(59,3),(59,6),(59,11),(59,13),(59,58),(59,59),(60,1),(60,2),(60,3),(60,5),(60,6),(60,11),(60,13),(60,18),(60,21),(60,33),(60,36),(60,37),(60,44),(60,47),(60,49),(60,50),(60,53),(60,56),(60,57),(60,58),(60,59),(60,60),(61,1),(61,2),(61,3),(61,6),(61,11),(61,13),(61,36),(61,44),(61,47),(61,61),(62,62),(64,64),(65,1),(65,2),(65,3),(65,6),(65,11),(65,13),(65,18),(65,19),(65,21),(65,35),(65,36),(65,44),(65,47),(65,49),(65,50),(65,53),(65,56),(65,57),(65,58),(65,59),(65,65),(66,0),(66,1),(66,2),(66,3),(66,5),(66,6),(66,9),(66,11),(66,13),(66,15),(66,16),(66,17),(66,18),(66,19),(66,20),(66,21),(66,22),(66,30),(66,31),(66,32),(66,33),(66,34),(66,35),(66,36),(66,37),(66,38),(66,39),(66,40),(66,41),(66,42),(66,43),(66,44),(66,45),(66,47),(66,48),(66,49),(66,50),(66,51),(66,52),(66,53),(66,54),(66,55),(66,56),(66,57),(66,58),(66,59),(66,60),(66,61),(66,62),(66,64),(66,65),(66,66),(66,67),(66,69),(67,1),(67,2),(67,3),(67,5),(67,6),(67,11),(67,13),(67,18),(67,21),(67,33),(67,37),(67,53),(67,67),(69,1),(69,2),(69,3),(69,6),(69,11),(69,35),(69,47),(69,69);
/*!40000 ALTER TABLE `roleRole` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -94,7 +94,7 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-23 14:05:01
+-- Dump completed on 2020-02-13 9:07:05
USE `salix`;
-- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64)
--
@@ -119,7 +119,7 @@ USE `salix`;
LOCK TABLES `ACL` WRITE;
/*!40000 ALTER TABLE `ACL` DISABLE KEYS */;
-INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','employee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','employee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','employee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','employee'),(30,'GreugeType','*','READ','ALLOW','ROLE','employee'),(31,'Mandate','*','READ','ALLOW','ROLE','employee'),(32,'MandateType','*','READ','ALLOW','ROLE','employee'),(33,'Company','*','READ','ALLOW','ROLE','employee'),(34,'Greuge','*','READ','ALLOW','ROLE','employee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','employee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','removes','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','*','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','salesAssistant'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','salesAssistant'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','salesAssistant'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','employee'),(111,'ClientLog','*','READ','ALLOW','ROLE','employee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','employee'),(114,'Receipt','*','READ','ALLOW','ROLE','employee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','employee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','employee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'WorkerCalendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'WorkerCalendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(164,'InvoiceOut','regenerate','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','READ','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','employee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(188,'TicketDms','removeFile','WRITE','ALLOW','ROLE','employee'),(189,'TicketDms','*','READ','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','employee'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','employee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','salesAssistant'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer');
+INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','employee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','employee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','employee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','employee'),(30,'GreugeType','*','READ','ALLOW','ROLE','employee'),(31,'Mandate','*','READ','ALLOW','ROLE','employee'),(32,'MandateType','*','READ','ALLOW','ROLE','employee'),(33,'Company','*','READ','ALLOW','ROLE','employee'),(34,'Greuge','*','READ','ALLOW','ROLE','employee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','employee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','removes','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','salesAssistant'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','salesAssistant'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','salesAssistant'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','employee'),(111,'ClientLog','*','READ','ALLOW','ROLE','employee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','employee'),(114,'Receipt','*','READ','ALLOW','ROLE','employee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','employee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','employee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'WorkerCalendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'WorkerCalendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(164,'InvoiceOut','regenerate','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','READ','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','employee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(188,'TicketDms','removeFile','WRITE','ALLOW','ROLE','employee'),(189,'TicketDms','*','READ','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','employee'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','employee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','salesAssistant'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','*','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;
@@ -142,7 +142,7 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-23 14:05:01
+-- Dump completed on 2020-02-13 9:07:05
USE `vn`;
-- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64)
--
@@ -217,7 +217,7 @@ UNLOCK TABLES;
LOCK TABLES `pgc` WRITE;
/*!40000 ALTER TABLE `pgc` DISABLE KEYS */;
-INSERT INTO `pgc` VALUES ('4722000000',0.00,'Importación Exento ',1,0,0,1),('4722000010',10.00,'Importación Reducido ',1,0,0,1),('4722000021',21.00,'Importación General ',1,0,0,1),('4770000001',8.00,'Reducido',1,1,1,1),('4770000002',0.00,'Extra-Community supply',3,1,0,2),('4770000004',4.00,'Super reducido',1,1,1,1),('4770000010',10.00,'Reducido',1,1,1,1),('4770000020',0.00,'Exento',7,1,1,1),('4770000021',21.00,'General',1,1,1,1),('4770000101',10.00,'Reducido ',1,1,1,1),('4770000108',8.00,'Reducido',1,1,1,1),('4770000110',1.40,'Rec. Eq. Reducido',1,0,0,1),('4770000215',21.00,'General',1,1,1,1),('4770000405',0.50,'Rec. Eq. Super Reducido',1,0,0,1),('4770000504',4.00,'Super reducido',1,1,1,1),('4770000521',5.20,'Rec. Eq. General',1,0,0,1),('4770000701',1.00,'Rec. Eq. Reducido',1,0,0,1),('4771000000',0.00,'Intra-Community supply',6,1,1,1),('4771000001',0.00,'Intra-Community services',7,1,1,1),('HolandaGEN',21.00,'General',1,0,0,1),('HolandaRED',9.00,'Reducido',1,0,0,1),('IGIC cero',0.00,'Cero',1,0,0,1),('IGIC gener',6.50,'General',1,0,0,1),('IGIC reduc',3.00,'Reducido',1,0,0,1);
+INSERT INTO `pgc` VALUES ('4722000000',0.00,'Importación Exento ',1,0,0,1,0),('4722000010',10.00,'Importación Reducido ',1,0,0,1,0),('4722000021',21.00,'Importación General ',1,0,0,1,0),('4770000001',8.00,'Reducido',1,1,1,1,0),('4770000002',0.00,'Extra-Community supply',3,1,0,2,0),('4770000004',4.00,'Super reducido',1,1,1,1,0),('4770000010',10.00,'Reducido',1,1,1,1,0),('4770000020',0.00,'Exento',7,1,1,1,0),('4770000021',21.00,'General',1,1,1,1,0),('4770000101',10.00,'Reducido ',1,1,1,1,0),('4770000108',8.00,'Reducido',1,1,1,1,0),('4770000110',1.40,'Rec. Eq. Reducido',1,0,0,1,1),('4770000215',21.00,'General',1,1,1,1,0),('4770000405',0.50,'Rec. Eq. Super Reducido',1,0,0,1,1),('4770000504',4.00,'Super reducido',1,1,1,1,0),('4770000521',5.20,'Rec. Eq. General',1,0,0,1,1),('4770000701',1.00,'Rec. Eq. Reducido',1,0,0,1,1),('4771000000',0.00,'Intra-Community supply',6,1,1,1,0),('4771000001',0.00,'Intra-Community services',7,1,1,1,0),('HolandaGEN',21.00,'General',1,0,0,1,0),('HolandaRED',9.00,'Reducido',1,0,0,1,0),('IGIC cero',0.00,'Cero',1,0,0,1,0),('IGIC gener',6.50,'General',1,0,0,1,0),('IGIC reduc',3.00,'Reducido',1,0,0,1,0);
/*!40000 ALTER TABLE `pgc` ENABLE KEYS */;
UNLOCK TABLES;
@@ -307,7 +307,7 @@ UNLOCK TABLES;
LOCK TABLES `department` WRITE;
/*!40000 ALTER TABLE `department` DISABLE KEYS */;
-INSERT INTO `department` VALUES (1,'VERDNATURA',1,2,763,0,NULL,NULL,NULL,0,0,0,0,NULL,'/'),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/'),(23,'CAMARA',5,6,NULL,72,604,2,6,1,0,0,0,NULL,'/'),(31,'INFORMATICA',7,8,NULL,72,127,3,9,0,0,0,0,NULL,'/'),(34,'CONTABILIDAD',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/'),(35,'FINANZAS',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/'),(36,'LABORAL',13,14,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/'),(37,'PRODUCCION',15,24,NULL,72,230,3,11,0,0,0,4,NULL,'/'),(38,'SACADO',16,17,NULL,72,230,4,14,1,0,1,0,37,'/37/'),(39,'ENCAJADO',18,19,NULL,72,230,4,12,1,0,1,0,37,'/37/'),(41,'ADMINISTRACION',25,26,NULL,72,599,3,8,0,0,0,0,NULL,'/'),(43,'VENTAS',27,48,NULL,0,NULL,NULL,NULL,0,0,0,10,NULL,'/'),(44,'GERENCIA',49,50,NULL,72,300,2,7,0,0,0,0,NULL,'/'),(45,'LOGISTICA',51,52,NULL,72,596,3,19,0,0,0,0,NULL,'/'),(46,'REPARTO',20,21,NULL,72,659,3,10,0,0,1,0,37,'/37/'),(48,'ALMACENAJE',53,54,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/'),(49,'PROPIEDAD',55,56,NULL,72,1008,1,1,0,0,0,0,NULL,'/'),(52,'CARGA AEREA',57,58,NULL,72,163,4,28,0,0,0,0,NULL,'/'),(53,'MARKETING Y COMUNICACIÓN',59,60,NULL,72,1238,0,0,0,0,0,0,NULL,'/'),(54,'ORNAMENTALES',61,62,NULL,72,433,3,21,0,0,0,0,NULL,'/'),(55,'TALLER NATURAL',63,64,NULL,72,695,2,23,0,0,0,0,NULL,'/'),(56,'TALLER ARTIFICIAL',65,66,NULL,72,1780,2,24,0,0,0,0,NULL,'/'),(58,'CAMPOS',67,68,NULL,72,225,2,2,0,0,0,0,NULL,'/'),(59,'MANTENIMIENTO',69,70,NULL,72,1907,4,16,0,0,0,0,NULL,'/'),(60,'RECLAMACIONES',71,72,NULL,72,563,3,20,0,0,0,0,NULL,'/'),(61,'VNH',73,74,NULL,73,1297,3,17,0,0,0,0,NULL,'/'),(63,'VENTAS FRANCIA',28,29,NULL,72,277,2,27,0,0,1,0,43,'/43/'),(66,'VERDNAMADRID',75,76,NULL,72,163,3,18,0,0,0,0,NULL,'/'),(68,'COMPLEMENTOS',77,78,NULL,72,617,3,26,1,0,0,0,NULL,'/'),(69,'VERDNABARNA',79,80,NULL,74,432,3,22,0,0,0,0,NULL,'/'),(77,'PALETIZADO',22,23,NULL,72,230,4,15,1,0,1,0,37,'/37/'),(80,'EQUIPO J VALLES',30,31,NULL,72,693,3,4,0,0,1,0,43,'/43/'),(86,'LIMPIEZA',81,82,NULL,72,599,0,0,0,0,0,0,NULL,'/'),(89,'COORDINACION',83,84,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/'),(90,'TRAILER',85,86,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/'),(91,'ARTIFICIAL',87,88,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/'),(92,'EQUIPO SILVERIO',32,33,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/'),(93,'CONFECCION',89,90,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/'),(94,'EQUIPO J BROCAL',34,35,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/'),(95,'EQUIPO C ZAMBRANO',36,37,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/'),(96,'EQUIPO C LOPEZ',38,39,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/'),(97,'EQUIPO D SARRION',40,41,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/'),(98,'EQUIPO RODRIGO',42,43,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/'),(99,'EQUIPO MANOLI',44,45,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/'),(101,'EQUIPO J IBAÑEZ',46,47,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/');
+INSERT INTO `department` VALUES (1,'VERDNATURA',1,2,763,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/',NULL),(23,'CAMARA',5,6,NULL,72,604,2,6,1,0,0,0,NULL,'/',NULL),(31,'INFORMATICA',7,8,NULL,72,127,3,9,0,0,0,0,NULL,'/','informatica'),(34,'CONTABILIDAD',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(35,'FINANZAS',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(36,'LABORAL',13,14,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(37,'PRODUCCION',15,24,NULL,72,230,3,11,0,0,0,4,NULL,'/',NULL),(38,'SACADO',16,17,NULL,72,230,4,14,1,0,1,0,37,'/37/',NULL),(39,'ENCAJADO',18,19,NULL,72,230,4,12,1,0,1,0,37,'/37/',NULL),(41,'ADMINISTRACION',25,26,NULL,72,599,3,8,0,0,0,0,NULL,'/',NULL),(43,'VENTAS',27,48,NULL,0,NULL,NULL,NULL,0,0,0,10,NULL,'/',NULL),(44,'GERENCIA',49,50,NULL,72,300,2,7,0,0,0,0,NULL,'/',NULL),(45,'LOGISTICA',51,52,NULL,72,596,3,19,0,0,0,0,NULL,'/',NULL),(46,'REPARTO',20,21,NULL,72,659,3,10,0,0,1,0,37,'/37/',NULL),(48,'ALMACENAJE',53,54,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(49,'PROPIEDAD',55,56,NULL,72,1008,1,1,0,0,0,0,NULL,'/',NULL),(52,'CARGA AEREA',57,58,NULL,72,163,4,28,0,0,0,0,NULL,'/',NULL),(53,'MARKETING Y COMUNICACIÓN',59,60,NULL,72,1238,0,0,0,0,0,0,NULL,'/',NULL),(54,'ORNAMENTALES',61,62,NULL,72,433,3,21,0,0,0,0,NULL,'/',NULL),(55,'TALLER NATURAL',63,64,NULL,72,695,2,23,0,0,0,0,NULL,'/',NULL),(56,'TALLER ARTIFICIAL',65,66,NULL,72,1780,2,24,0,0,0,0,NULL,'/',NULL),(58,'CAMPOS',67,68,NULL,72,225,2,2,0,0,0,0,NULL,'/',NULL),(59,'MANTENIMIENTO',69,70,NULL,72,1907,4,16,0,0,0,0,NULL,'/',NULL),(60,'RECLAMACIONES',71,72,NULL,72,563,3,20,0,0,0,0,NULL,'/',NULL),(61,'VNH',73,74,NULL,73,1297,3,17,0,0,0,0,NULL,'/',NULL),(63,'VENTAS FRANCIA',28,29,NULL,72,277,2,27,0,0,1,0,43,'/43/',NULL),(66,'VERDNAMADRID',75,76,NULL,72,163,3,18,0,0,0,0,NULL,'/',NULL),(68,'COMPLEMENTOS',77,78,NULL,72,617,3,26,1,0,0,0,NULL,'/',NULL),(69,'VERDNABARNA',79,80,NULL,74,432,3,22,0,0,0,0,NULL,'/',NULL),(77,'PALETIZADO',22,23,NULL,72,230,4,15,1,0,1,0,37,'/37/',NULL),(80,'EQUIPO J VALLES',30,31,NULL,72,693,3,4,0,0,1,0,43,'/43/','jvp_equipo'),(86,'LIMPIEZA',81,82,NULL,72,599,0,0,0,0,0,0,NULL,'/',NULL),(89,'COORDINACION',83,84,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL),(90,'TRAILER',85,86,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(91,'ARTIFICIAL',87,88,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL),(92,'EQUIPO SILVERIO',32,33,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','sdc_equipo'),(93,'CONFECCION',89,90,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(94,'EQUIPO J BROCAL',34,35,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jes_equipo'),(95,'EQUIPO C ZAMBRANO',36,37,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','czg_equipo'),(96,'EQUIPO C LOPEZ',38,39,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','cla_equipo'),(97,'EQUIPO D SARRION',40,41,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','dsr_equipo'),(98,'EQUIPO RODRIGO',42,43,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','rhr_equipo'),(99,'EQUIPO MANOLI',44,45,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','man_equipo'),(101,'EQUIPO J IBAÑEZ',46,47,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jmi_equipo');
/*!40000 ALTER TABLE `department` ENABLE KEYS */;
UNLOCK TABLES;
@@ -340,7 +340,7 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-23 14:05:01
+-- Dump completed on 2020-02-13 9:07:05
USE `cache`;
-- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64)
--
@@ -378,7 +378,7 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-23 14:05:01
+-- Dump completed on 2020-02-13 9:07:05
USE `hedera`;
-- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64)
--
@@ -436,7 +436,7 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-23 14:05:01
+-- Dump completed on 2020-02-13 9:07:06
USE `postgresql`;
-- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64)
--
@@ -491,7 +491,7 @@ UNLOCK TABLES;
LOCK TABLES `professional_category` WRITE;
/*!40000 ALTER TABLE `professional_category` DISABLE KEYS */;
-INSERT INTO `professional_category` VALUES (1,'Mozos',5,1,27.5),(2,'Encargados',3,1,27.5),(4,'Comprador',3,1,27.5),(5,'Aux Administracion',NULL,1,27.5),(6,'Of Administracion',3,1,27.5),(7,'Jefe Administracion',2,1,27.5),(8,'Informatico',3,1,27.5),(9,'Directivo',1,0,27.5),(10,'Aux Ventas',4,1,27.5),(11,'Vendedor',4,1,27.5),(12,'Jefe de Ventas',4,0,27.5),(13,'Repartidor',5,1,27.5),(14,'Aprendices',NULL,1,27.5),(15,'Técnicos',2,1,27.5),(16,'Aux Florista',5,1,27.5),(17,'Florista',4,1,27.5),(18,'Jefe Floristas',2,1,27.5),(19,'Técnico marketing',3,1,27.5),(20,'Auxiliar marketing',4,1,27.5),(21,'Aux Informática',4,1,27.5),(22,'Peón agrícola',5,1,27.5),(23,'Oficial mantenimiento',4,1,27.5),(24,'Aux mantenimiento',5,1,27.5),(25,'Mozo Aeropuerto',5,1,27.5),(26,'Coordinador',2,1,27.5),(28,'Aux Logistica',4,1,27.5),(29,'Oficial Logistica',3,1,27.5),(30,'Subencargado',4,1,27.5);
+INSERT INTO `professional_category` VALUES (1,'Mozos',5,1,27.5),(2,'Encargados',3,1,27.5),(4,'Comprador',3,1,27.5),(5,'Aux Administracion',NULL,1,27.5),(6,'Of Administracion',3,1,27.5),(7,'Jefe Administracion',2,1,27.5),(8,'Informatico',3,1,27.5),(9,'Directivo',1,0,27.5),(10,'Aux Ventas',4,1,27.5),(11,'Vendedor',4,1,27.5),(12,'Jefe de Ventas',4,0,27.5),(13,'Repartidor',5,1,27.5),(14,'Aprendices',NULL,1,27.5),(15,'Técnicos',2,1,27.5),(16,'Aux Florista',5,1,27.5),(17,'Florista',4,1,27.5),(18,'Jefe Floristas',2,1,27.5),(19,'Técnico marketing',3,1,27.5),(20,'Auxiliar marketing',4,1,27.5),(21,'Aux Informática',4,1,27.5),(22,'Peón agrícola',5,1,27.5),(23,'Oficial mantenimiento',4,1,27.5),(24,'Aux mantenimiento',5,1,27.5),(25,'Mozo Aeropuerto',5,1,27.5),(26,'Coordinador',2,1,27.5),(28,'Aux Logistica',4,1,27.5),(29,'Oficial Logistica',3,1,27.5),(30,'Subencargado',4,1,27.5),(31,'Conductor +3500kg',NULL,1,NULL);
/*!40000 ALTER TABLE `professional_category` ENABLE KEYS */;
UNLOCK TABLES;
@@ -511,7 +511,7 @@ UNLOCK TABLES;
LOCK TABLES `workcenter` WRITE;
/*!40000 ALTER TABLE `workcenter` DISABLE KEYS */;
-INSERT INTO `workcenter` VALUES (1,'Silla',20,1027,1),(2,'Mercaflor',19,NULL,NULL),(3,'Marjales',26,20008,NULL),(4,'VNH',NULL,NULL,3),(5,'Madrid',28,2852,5),(6,'Vilassar',88,88031,2),(7,'Tenerife',NULL,NULL,10);
+INSERT INTO `workcenter` VALUES (1,'Silla',20,1030,1),(2,'Mercaflor',19,NULL,NULL),(3,'Marjales',26,20008,NULL),(4,'VNH',NULL,NULL,3),(5,'Madrid',28,2852,5),(6,'Vilassar',88,88031,2),(7,'Tenerife',NULL,NULL,10);
/*!40000 ALTER TABLE `workcenter` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -524,4 +524,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-23 14:05:01
+-- Dump completed on 2020-02-13 9:07:06
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 7b7651a9d..f7d5d94f1 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -35,7 +35,7 @@ INSERT INTO `vn`.`packagingConfig`(`upperGap`)
UPDATE `account`.`role` SET id = 100 WHERE id = 0;
INSERT INTO `account`.`user`(`id`,`name`, `nickname`, `password`,`role`,`active`,`email`, `lang`)
- SELECT id, name, CONCAT(name, 'Nick'),MD5('nightmare'), id, 1, CONCAT(name, '@mydomain.com'), 'es'
+ SELECT id, name, CONCAT(name, 'Nick'),MD5('nightmare'), id, 1, CONCAT(name, '@mydomain.com'), 'EN'
FROM `account`.`role` WHERE id <> 20
ORDER BY id;
@@ -55,18 +55,18 @@ INSERT INTO `hedera`.`tpvConfig`(`id`, `currency`, `terminal`, `transactionType`
INSERT INTO `account`.`user`(`id`,`name`,`nickname`, `password`,`role`,`active`,`email`,`lang`)
VALUES
- (101, 'BruceWayne', 'Bruce Wayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@mydomain.com', 'es'),
- (102, 'PetterParker', 'Petter Parker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@mydomain.com', 'en'),
- (103, 'ClarkKent', 'Clark Kent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@mydomain.com', 'fr'),
- (104, 'TonyStark', 'Tony Stark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@mydomain.com', 'es'),
- (105, 'MaxEisenhardt', 'Max Eisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt'),
- (106, 'DavidCharlesHaller', 'David Charles Haller', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'DavidCharlesHaller@mydomain.com', 'es'),
- (107, 'HankPym', 'Hank Pym', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'HankPym@mydomain.com', 'es'),
- (108, 'CharlesXavier', 'Charles Xavier', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'CharlesXavier@mydomain.com', 'es'),
- (109, 'BruceBanner', 'Bruce Banner', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'BruceBanner@mydomain.com', 'es'),
- (110, 'JessicaJones', 'Jessica Jones', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'JessicaJones@mydomain.com', 'es'),
- (111, 'Missing', 'Missing', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es'),
- (112, 'Trash', 'Trash', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es');
+ (101, 'BruceWayne', 'Bruce Wayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@mydomain.com', 'ES'),
+ (102, 'PetterParker', 'Petter Parker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@mydomain.com', 'EN'),
+ (103, 'ClarkKent', 'Clark Kent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@mydomain.com', 'FR'),
+ (104, 'TonyStark', 'Tony Stark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@mydomain.com', 'ES'),
+ (105, 'MaxEisenhardt', 'Max Eisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@mydomain.com', 'PT'),
+ (106, 'DavidCharlesHaller', 'David Charles Haller', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'DavidCharlesHaller@mydomain.com', 'EN'),
+ (107, 'HankPym', 'Hank Pym', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'HankPym@mydomain.com', 'EN'),
+ (108, 'CharlesXavier', 'Charles Xavier', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'CharlesXavier@mydomain.com', 'EN'),
+ (109, 'BruceBanner', 'Bruce Banner', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'BruceBanner@mydomain.com', 'EN'),
+ (110, 'JessicaJones', 'Jessica Jones', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'JessicaJones@mydomain.com', 'EN'),
+ (111, 'Missing', 'Missing', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'EN'),
+ (112, 'Trash', 'Trash', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'EN');
INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`)
VALUES
@@ -684,8 +684,14 @@ INSERT INTO `vn`.`taxCode`(`id`, `dated`, `code`, `taxTypeFk`, `rate`, `equaliza
INSERT INTO `vn`.`taxClass`(`id`, `description`, `code`)
VALUES
- (1, 'Reduced VAT','R'),
+ (1, 'Reduced VAT', 'R'),
(2, 'General VAT', 'G');
+
+INSERT INTO `vn`.`taxClassCode`(`taxClassFk`, `effectived`, `taxCodeFk`)
+ VALUES
+ (1, CURDATE(), 1),
+ (1, CURDATE(), 21),
+ (2, CURDATE(), 2);
INSERT INTO `vn`.`intrastat`(`id`, `description`, `taxClassFk`, `taxCodeFk`)
VALUES
@@ -753,7 +759,7 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
(7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.44, 0, 0, 0, CURDATE()),
(8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 1.79, 0, 0, 0, CURDATE()),
(9, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, CURDATE()),
- (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, CURDATE()),
+ (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, CURDATE()),
(11, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, CURDATE()),
(12, 4, 16, 'Melee weapon heavy shield 1x0.5m', 20, 1.71, 0, 0, 0, CURDATE()),
(13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, CURDATE()),
@@ -814,25 +820,25 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
(8, 28, 1.25),
(8, 29, 0.42),
(8, 39, 0.017),
+
(9, 15, 3.0949),
(9, 21, 0.001),
- (9, 28, 50),
- (9, 29, 49.4),
+ (9, 28, 53),
+ (9, 29, 46.4),
(9, 39, 0.994),
- (10, 15, 0.0111),
- (10, 21, -0.001),
- (10, 28, 5),
- (10, 29, 2),
+ (10, 15, 0.0199),
+ (10, 28, 7),
+ (10, 29, 0),
(10, 39, 0.07),
(11, 15, 3.0949),
(11, 21, 0.001),
- (11, 28, 50),
- (11, 29, 49.4),
+ (11, 28, 53),
+ (11, 29, 46.4),
(11, 39, 0.994),
(12, 15, 0.0199),
(12, 21, 0.003),
- (12, 28, 1.25),
- (12, 29, 0.42),
+ (12, 28, 2.25),
+ (12, 29, -0.58),
(12, 39, 0.017),
(13, 15, 0.114),
(13, 28, 5),
@@ -1123,17 +1129,19 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
(4, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 50.00, 500, 'fourth travel', 0),
(5, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 2, 1, 50.00, 500, 'fifth travel', 1),
(6, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 4, 2, 1, 50.00, 500, 'sixth travel', 1),
- (7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'seventh travel', 1);
+ (7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'seventh travel', 1),
+ (8, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'eight travel', 1);
-INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `companyFk`, `ref`, `notes`, `evaNotes`)
+INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `companyFk`, `ref`,`isInventory`, `isRaid`, `notes`, `evaNotes`)
VALUES
- (1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 442, 'Movement 1', 'this is the note one', 'observation one'),
- (2, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 442, 'Movement 2', 'this is the note two', 'observation two'),
- (3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 442, 'Movement 3', 'this is the note three', 'observation three'),
- (4, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 69, 'Movement 4', 'this is the note four', 'observation four'),
- (5, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 442, 'Movement 5', 'this is the note five', 'observation five'),
- (6, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 6, 442, 'Movement 6', 'this is the note six', 'observation six'),
- (7, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 7', 'this is the note seven', 'observation seven');
+ (1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 442, 'Movement 1', 0, 0, '', ''),
+ (2, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
+ (3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
+ (4, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
+ (5, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
+ (6, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 6, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
+ (7, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
+ (8, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 8', 1, 1, '', '');
INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`)
VALUES
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index c78730381..35cb82fd4 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -3217,7 +3217,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `comercialesCompleto__`(IN vWorker INT, vDate DATE)
BEGIN
-CALL vn.subordinateGetList(vWorker);
+CALL vn.worker_GetHierarchy(vWorker);
SELECT
c.Id_Cliente id_cliente,
@@ -3323,9 +3323,9 @@ FROM
WHERE
(c.Id_Trabajador = vWorker OR tr.boss = vWorker)
GROUP BY Id_Cliente) dead ON dead.Id_Cliente = c.Id_Cliente
- JOIN tmp.subordinate s ON s.workerFk = c.Id_Trabajador;
+ JOIN tmp.workerHierarchyList s ON s.workerFk = c.Id_Trabajador;
-DROP TEMPORARY TABLE tmp.subordinate;
+DROP TEMPORARY TABLE tmp.workerHierarchyList;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -3583,6 +3583,36 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `bs` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 DROP PROCEDURE IF EXISTS `fruitsEvolution` */;
+/*!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 = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`z-developer`@`%` PROCEDURE `fruitsEvolution`()
+BEGIN
+select Id_Cliente,
+ Cliente, count(semana) as semanas, (w.code IS NOT NULL) isWorker
+from (
+select distinct v.Id_Cliente, c.name as Cliente, week(fecha, 3) as semana
+from bs.ventas v
+join vn.itemType it ON it.id = v.tipo_id
+join vn.client c ON c.id = v.Id_Cliente
+where it.categoryFk = 12
+and v.fecha > '2020-01-01') sub
+left join vn.worker w ON w.id = sub.Id_Cliente
+group by Id_Cliente;
+
+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 DROP PROCEDURE IF EXISTS `indicatorsUpdate` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -4725,13 +4755,194 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add`(intYEAR INT, vQuarter INT)
+BEGIN
+
+ DECLARE vCommissionRate DOUBLE DEFAULT 0.029;
+
+ -- vaciar tabla
+ DELETE v.* FROM vendedores v
+ JOIN vn.`time` t ON t.`year` = v.año AND t.`month` = v.mes
+ WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter;
+
+ REPLACE vendedores(Id_Trabajador, año, mes, importe, comision)
+ SELECT c.Id_Trabajador
+ , intYEAR
+ , MONTH(v.fecha) intMONTH
+ , sum(v.importe)
+ , sum(v.importe) * vCommissionRate
+ FROM ventas v
+ JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente
+ JOIN vn.`time` t on t.dated = v.fecha
+ WHERE c.Id_Trabajador is not null
+ AND t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter
+ GROUP BY c.Id_Trabajador, t.`month`;
+
+ -- Ventas nuevas
+ UPDATE vendedores v
+ JOIN
+ (
+ SELECT c.Id_Trabajador
+ , sum(importe) * vCommissionRate as comisionNueva
+ , t.`month`
+ , t.`year`
+ FROM ventas v
+ JOIN bs.clientNewBorn cnb on v.Id_Cliente = cnb.clientFk
+ JOIN vn2008.Clientes c ON c.Id_Cliente = v.Id_Cliente
+ JOIN vn2008.`time` t on t.`date` = v.fecha
+ WHERE c.Id_Trabajador is not null
+ AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter
+ GROUP BY c.Id_Trabajador, t.`month`
+ ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año
+ SET v.comisionNuevos = sub.comisionNueva, v.comision = v.comision - sub.comisionNueva;
+
+ -- Ventas cedidas
+ UPDATE vendedores v
+ JOIN (
+ SELECT cc.Id_Trabajador_old as Id_Trabajador
+ , sum(importe) * vCommissionRate * comision_old as cedido
+ , sum(importe) * vCommissionRate * comision_new as arrendada
+ , t.`month`
+ , t.`year`
+ FROM ventas v
+ JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente
+ JOIN vn2008.Clientes_cedidos cc on cc.Id_Cliente = c.Id_Cliente AND v.fecha between datSTART and datEND
+ JOIN vn2008.`time` t on t.`date` = v.fecha
+ WHERE c.Id_Trabajador is not null
+ AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter
+ GROUP BY cc.Id_Trabajador_old, t.`month`
+ ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año
+ SET v.comisionCedida = sub.cedido, v.comision = v.comision - sub.cedido - sub.arrendada;
+
+ -- Ventas arrendadas
+ UPDATE vendedores v
+ JOIN (
+ SELECT cc.Id_Trabajador_new as Id_Trabajador
+ , sum(importe) * vCommissionRate * comision_new as arrendada
+ , t.`month`
+ , t.`year`
+ FROM ventas v
+ JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente
+ JOIN vn2008.Clientes_cedidos cc on cc.Id_Cliente = c.Id_Cliente AND v.fecha between datSTART and datEND
+ JOIN vn2008.`time` t on t.`date` = v.fecha
+ WHERE c.Id_Trabajador is not null
+ AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter
+ GROUP BY cc.Id_Trabajador_new, t.`month`
+ ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año
+ SET v.comisionArrendada = sub.arrendada;
+
+ -- Sustitucion cedidas - lended
+ INSERT INTO vendedores (Id_Trabajador, mes, año, comision)
+ SELECT c.salesPersonFk
+ , t.`month`
+ , t.`year`
+ , sum(importe) * vCommissionRate as lended
+ FROM ventas v
+ JOIN vn.client c ON c.id = v.Id_Cliente
+ JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha
+ JOIN vn.`time` t ON t.dated = v.fecha
+ WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter
+ GROUP BY c.salesPersonFk, t.`month`
+ ON DUPLICATE KEY UPDATE comision = comision - VALUES(comision);
+
+ -- Sustitucion arrendadas - borrowed
+ INSERT INTO vendedores (Id_Trabajador, mes, año, sustitucionArrendada)
+ SELECT scd.substituteFk
+ , t.`month`
+ , t.`year`
+ , sum(importe) * vCommissionRate as borrowed
+ FROM ventas v
+ JOIN vn.client c ON c.id = v.Id_Cliente
+ JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha
+ JOIN vn.`time` t ON t.dated = v.fecha
+ WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter
+ GROUP BY scd.substituteFk, t.`month`
+ ON DUPLICATE KEY UPDATE sustitucionArrendada = VALUES(sustitucionArrendada);
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.workerItemType;
+ CREATE TEMPORARY TABLE tmp.workerItemType
+ (INDEX(ownerWorkerFk, itemTypeFk))
+ SELECT wd.workerFk ownerWorkerFk, itemTypeFk, dit.workerFk substituteFk
+ FROM vn.departmentItemType dit
+ JOIN vn.workerDepartment wd ON wd.departmentFk = dit.departmentFk;
+
+ -- itemType Lended, prestado
+ UPDATE vendedores v
+ JOIN (
+ SELECT c.Id_Trabajador
+ , sum(importe) * vCommissionRate as amount
+ , t.`month`
+ , t.`year`
+ FROM ventas v
+ JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente
+ JOIN tmp.workerItemType wit ON wit.ownerWorkerFk = c.Id_Trabajador AND wit.itemTypeFk = v.tipo_id
+ JOIN vn2008.`time` t on t.`date` = v.fecha
+ WHERE t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter
+ GROUP BY c.Id_Trabajador, t.`month`
+ ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año
+ SET v.comision = v.comision - sub.amount;
+
+ -- itemType borrowed, tomado prestado
+ INSERT INTO vendedores (Id_Trabajador, año, mes, itemTypeBorrowed)
+ SELECT wit.substituteFk
+ , t.`year`
+ , t.`month`
+ , importe * vCommissionRate
+ FROM ventas v
+ JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente
+ JOIN tmp.workerItemType wit ON wit.ownerWorkerFk = c.Id_Trabajador AND wit.itemTypeFk = v.tipo_id
+ JOIN vn2008.`time` t on t.`date` = v.fecha
+ WHERE t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter
+ ON DUPLICATE KEY UPDATE itemTypeBorrowed = itemTypeBorrowed + values(itemTypeBorrowed);
+
+ DROP TEMPORARY TABLE tmp.workerItemType;
+
+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 DROP PROCEDURE IF EXISTS `vendedores_add_launcher` */;
+/*!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 = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add`(intYEAR INT, vQuarter INT)
+CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add_launcher`()
+BEGIN
+
+ call bs.vendedores_add(YEAR(CURDATE()),QUARTER(CURDATE()));
+
+ call bs.vendedores_evolution_add;
+
+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 DROP PROCEDURE IF EXISTS `vendedores_add__` */;
+/*!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_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add__`(intYEAR INT, vQuarter INT)
BEGIN
DECLARE vCommissionRate DOUBLE DEFAULT 0.029;
@@ -4879,40 +5090,17 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
-/*!50003 DROP PROCEDURE IF EXISTS `vendedores_add_launcher` */;
+/*!50003 DROP PROCEDURE IF EXISTS `vendedores_add___` */;
/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add_launcher`()
-BEGIN
-
- call bs.vendedores_add(YEAR(CURDATE()),QUARTER(CURDATE()));
-
- call bs.vendedores_evolution_add;
-
-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 DROP PROCEDURE IF EXISTS `vendedores_add__` */;
-/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add__`(intYEAR INT, vQuarter INT)
+CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add___`(intYEAR INT, vQuarter INT)
BEGIN
DECLARE comisionRate DOUBLE DEFAULT 0.029;
@@ -5573,9 +5761,9 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
@@ -11666,20 +11854,20 @@ BEGIN
-- Comprueba que se ha seleccionado una dirección
IF vDeliveryMethod IN ('AGENCY', 'DELIVERY')
- && vAddress IS NULL
+ AND vAddress IS NULL
THEN
CALL util.throw ('ORDER_EMPTY_ADDRESS');
END IF;
-- Comprueba que la agencia es correcta
- CALL vn.zoneGetAgency(vAddress, vLanded);
+ CALL vn.zone_getAgency(vAddress, vLanded);
SELECT COUNT(*) > 0 INTO vIsAvailable
FROM tmp.zoneGetAgency
WHERE agencyModeFk = vAgencyMode;
- IF !vIsAvailable THEN
+ IF NOT vIsAvailable THEN
CALL util.throw ('ORDER_INVALID_AGENCY');
END IF;
@@ -11719,9 +11907,9 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
@@ -11918,8 +12106,7 @@ BEGIN
(saleFk, componentFk, `value`)
SELECT vSale, cm.component_id, cm.price
FROM order_component cm
- JOIN bi.tarifa_componentes tc
- ON tc.Id_Componente = cm.component_id
+ JOIN vn.component c ON c.id = cm.component_id
WHERE cm.order_row_id = vRowId
GROUP BY vSale, cm.component_id;
@@ -11938,12 +12125,9 @@ BEGIN
ENGINE = MEMORY
SELECT SUM(sc.`value`) valueSum, sc.saleFk
FROM vn.saleComponent sc
- JOIN bi.tarifa_componentes tc ON tc.Id_Componente = sc.componentFk
- JOIN bi.tarifa_componentes_series tcs
- ON tcs.tarifa_componentes_series_id = tc.tarifa_componentes_series_id
- AND tcs.base
- JOIN vn.sale s
- ON s.id = sc.saleFk
+ JOIN vn.component c ON c.id = sc.componentFk
+ JOIN vn.componentType ct ON ct.id = c.typeFk AND ct.isBase
+ JOIN vn.sale s ON s.id = sc.saleFk
WHERE s.ticketFk = vTicket
GROUP BY sc.saleFk;
@@ -16604,6 +16788,37 @@ CREATE TABLE `debug` (
) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Log de depuración';
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `version`
+--
+
+DROP TABLE IF EXISTS `version`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `version` (
+ `code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `number` char(11) COLLATE utf8_unicode_ci NOT NULL,
+ `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`code`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `versionUser`
+--
+
+DROP TABLE IF EXISTS `versionUser`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `versionUser` (
+ `code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `user` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `number` char(11) COLLATE utf8_unicode_ci NOT NULL,
+ `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`code`,`user`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Dumping events for database 'util'
--
@@ -17270,7 +17485,6 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `findObject` */;
-ALTER DATABASE `util` CHARACTER SET utf8 COLLATE utf8_general_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
@@ -17292,6 +17506,77 @@ BEGIN
*/
SET vChain = CONCAT('%', vChain, '%');
+ SELECT * FROM
+ (
+ SELECT
+ `routine_schema` `schema`,
+ `routine_name` `name`,
+ `routine_type` `type`,
+ `routine_definition` `definition`,
+ `created`,
+ `last_altered`
+ FROM `information_schema`.`routines`
+ WHERE `routine_definition` LIKE vChain COLLATE utf8_general_ci
+ UNION ALL
+ SELECT
+ `event_schema`,
+ `event_name`,
+ 'EVENT',
+ `event_definition`,
+ `created`,
+ `last_altered`
+ FROM `information_schema`.`events`
+ WHERE `event_definition` LIKE vChain COLLATE utf8_general_ci
+ UNION ALL
+ SELECT
+ `EVENT_OBJECT_SCHEMA`,
+ `TRIGGER_NAME`,
+ 'TRIGGER',
+ `ACTION_STATEMENT`,
+ NULL,
+ NULL
+ FROM `information_schema`.`TRIGGERS`
+ WHERE `ACTION_STATEMENT` LIKE vChain COLLATE utf8_general_ci
+ UNION ALL
+ SELECT
+ `TABLE_SCHEMA`,
+ `TABLE_NAME`,
+ 'VIEW',
+ `VIEW_DEFINITION`,
+ NULL,
+ NULL
+ FROM `information_schema`.`VIEWS`
+ WHERE `VIEW_DEFINITION` LIKE vChain COLLATE utf8_general_ci
+ ) t
+ ORDER BY `schema`, `name`;
+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 DROP PROCEDURE IF EXISTS `findObject__` */;
+/*!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 = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `findObject__`(vChain VARCHAR(45))
+ READS SQL DATA
+BEGIN
+/**
+ * Devuelve un listado de todos los procedimientos, funciones
+ * eventos, disparadores y vistas que inluyen una cadena dada.
+ *
+ * @param vChain Cadena a buscar
+ * @select Listado de objetos
+ */
+ SET vChain = CONCAT('%', vChain, '%');
+
SELECT * FROM
(
SELECT
@@ -17341,7 +17626,6 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
-ALTER DATABASE `util` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
/*!50003 DROP PROCEDURE IF EXISTS `proc_changedPrivs` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -17895,7 +18179,7 @@ CREATE TABLE `agencyMode` (
`cod71` tinyint(3) unsigned DEFAULT '0',
`web` smallint(1) unsigned zerofill NOT NULL DEFAULT '0',
`agencyFk` smallint(5) unsigned NOT NULL,
- `agencyServiceFk` tinyint(4) NOT NULL DEFAULT '1',
+ `agencyServiceFk__` tinyint(4) NOT NULL DEFAULT '1',
`inflation` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT 'Este valor se utiliza para aumentar el valor del componente porte.',
`isVolumetric` tinyint(1) NOT NULL DEFAULT '0',
`reportMail` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
@@ -18042,7 +18326,7 @@ CREATE TABLE `bank` (
`bank` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`account` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`cash` smallint(6) NOT NULL DEFAULT '0',
- `warehouseFk` smallint(5) unsigned NOT NULL DEFAULT '1',
+ `warehouseFk__` smallint(5) unsigned NOT NULL DEFAULT '1',
`entityFk` int(10) unsigned NOT NULL,
`isActive` tinyint(4) NOT NULL DEFAULT '1',
`currencyFk` tinyint(3) unsigned DEFAULT '1',
@@ -18516,7 +18800,8 @@ DROP TABLE IF EXISTS `chatConfig`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chatConfig` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `uri` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `host` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `api` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
@@ -18851,7 +19136,7 @@ CREATE TABLE `client` (
`fi` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`fax` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'obsoleta (comprobar)',
- `email` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`cc` varchar(23) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'obsoleta (comprobar)',
`dueDay` smallint(6) NOT NULL DEFAULT '5',
`receipt` int(11) DEFAULT '1' COMMENT 'obsoleta',
@@ -19497,7 +19782,7 @@ CREATE TABLE `collectionVolumetry` (
`level` int(10) unsigned NOT NULL DEFAULT '0',
`lines` int(10) unsigned NOT NULL DEFAULT '1',
`liters` int(10) unsigned NOT NULL DEFAULT '0',
- `height` int(10) NOT NULL DEFAULT '20',
+ `height` int(10) unsigned NOT NULL DEFAULT '20',
PRIMARY KEY (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -19607,7 +19892,7 @@ DROP TABLE IF EXISTS `componentType`;
CREATE TABLE `componentType` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
- `base` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Marca aquellas series que se utilizan para calcular el precio base de las ventas, a efectos estadisticos',
+ `isBase` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Marca aquellas series que se utilizan para calcular el precio base de las ventas, a efectos estadisticos',
`isMargin` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `Serie_UNIQUE` (`type`)
@@ -19763,6 +20048,101 @@ CREATE TABLE `contactChannel` (
) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Canal por el que nos ha conocido un cliente y se ha dado de';
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `conveyor`
+--
+
+DROP TABLE IF EXISTS `conveyor`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `conveyor` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `typeFk` int(11) NOT NULL,
+ `stratum` int(11) NOT NULL DEFAULT '0',
+ `length` int(11) DEFAULT NULL,
+ `width` int(11) DEFAULT NULL,
+ `height` int(11) DEFAULT NULL,
+ `x` int(11) DEFAULT NULL,
+ `y` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `conveyor_fk1_idx` (`typeFk`),
+ CONSTRAINT `conveyor_fk1` FOREIGN KEY (`typeFk`) REFERENCES `conveyorType` (`id`) ON UPDATE CASCADE
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `conveyorBuildingClass`
+--
+
+DROP TABLE IF EXISTS `conveyorBuildingClass`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `conveyorBuildingClass` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `priority` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tipo de caja para el montaje de pallets';
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `conveyorConfig`
+--
+
+DROP TABLE IF EXISTS `conveyorConfig`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `conveyorConfig` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `itemName` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
+ `length` int(11) DEFAULT NULL,
+ `width` int(11) DEFAULT NULL,
+ `height` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `itemName_UNIQUE` (`itemName`)
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `conveyorExpedition`
+--
+
+DROP TABLE IF EXISTS `conveyorExpedition`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `conveyorExpedition` (
+ `expeditionFk` int(11) NOT NULL,
+ `conveyorFk` int(11) DEFAULT NULL,
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `conveyorBuildingClassFk` int(11) NOT NULL,
+ `length` int(11) NOT NULL DEFAULT '1',
+ `width` int(11) NOT NULL DEFAULT '1',
+ `height` int(11) NOT NULL DEFAULT '1',
+ `x` int(11) NOT NULL DEFAULT '1',
+ `y` int(11) NOT NULL DEFAULT '1',
+ `routeFk` int(11) NOT NULL,
+ PRIMARY KEY (`expeditionFk`),
+ KEY `conveyorExpedition_fk1_idx` (`conveyorFk`),
+ KEY `conveyorExpedition_fk2_idx` (`conveyorBuildingClassFk`),
+ CONSTRAINT `conveyorExpedition_fk1` FOREIGN KEY (`conveyorFk`) REFERENCES `conveyor` (`id`) ON UPDATE CASCADE,
+ CONSTRAINT `conveyorExpedition_fk2` FOREIGN KEY (`conveyorBuildingClassFk`) REFERENCES `conveyorBuildingClass` (`id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `conveyorType`
+--
+
+DROP TABLE IF EXISTS `conveyorType`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `conveyorType` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Table structure for table `country`
--
@@ -20208,6 +20588,7 @@ CREATE TABLE `department` (
`sons` decimal(10,0) NOT NULL DEFAULT '0',
`parentFk` int(10) unsigned DEFAULT NULL,
`path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `chatName` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`),
KEY `fk_department_Trabajadores1_idx` (`workerFk`),
@@ -21042,6 +21423,22 @@ CREATE TABLE `envialiaConfig` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `errorLogApp`
+--
+
+DROP TABLE IF EXISTS `errorLogApp`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `errorLogApp` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `error` varchar(55) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `date` datetime DEFAULT NULL,
+ `workerFk` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Guarda un registro de errores e la app de almacén';
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Temporary table structure for view `exchangeInsuranceEntry`
--
@@ -21381,6 +21778,20 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
+--
+-- Table structure for table `greugeConfig`
+--
+
+DROP TABLE IF EXISTS `greugeConfig`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `greugeConfig` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `freightPickUpPrice` decimal(10,2) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Table structure for table `greugeType`
--
@@ -21772,16 +22183,14 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_afterInsert`
- AFTER INSERT ON `invoiceOut` FOR EACH ROW
-BEGIN
- CALL bi.customer_risk_update (NEW.clientFk, NEW.companyFk, NEW.amount);
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_afterInsert` AFTER INSERT ON `vn`.`invoiceOut` FOR EACH ROW BEGIN
+ CALL clientRisk_update(NEW.clientFk, NEW.companyFk, NEW.amount);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -21791,17 +22200,16 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_beforeUpdate`
- BEFORE UPDATE ON `invoiceOut` FOR EACH ROW
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_beforeUpdate` BEFORE UPDATE ON `vn`.`invoiceOut` FOR EACH ROW
BEGIN
- CALL bi.customer_risk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
- CALL bi.customer_risk_update (NEW.clientFk, NEW.companyFk, NEW.amount);
+ CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
+ CALL clientRisk_update (NEW.clientFk, NEW.companyFk, NEW.amount);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -21811,16 +22219,14 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_beforeDelete`
- BEFORE DELETE ON `invoiceOut` FOR EACH ROW
-BEGIN
- CALL bi.customer_risk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_beforeDelete` BEFORE DELETE ON `invoiceOut` FOR EACH ROW BEGIN
+ CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -22366,6 +22772,23 @@ CREATE TABLE `itemFreeNumber` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `itemLabel`
+--
+
+DROP TABLE IF EXISTS `itemLabel`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `itemLabel` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `itemFk` int(11) DEFAULT NULL,
+ `itemName` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `price` decimal(10,2) DEFAULT NULL,
+ `labels` int(11) DEFAULT NULL COMMENT 'Tabla hecha para Ruben Espinosa, para sacar etiquetas en Holanda para un cliente.',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Table structure for table `itemLog`
--
@@ -22457,7 +22880,7 @@ CREATE TABLE `itemPlacementSupply` (
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`userFk` int(10) unsigned NOT NULL COMMENT 'Persona que crea la orden',
`repoUserFk` int(10) unsigned DEFAULT NULL COMMENT 'Reponedor que la tiene asignada',
- `sectorFk` int(11) NOT NULL DEFAULT '2',
+ `sectorFk` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `itemPlacementSupply_fk1_idx` (`itemFk`),
KEY `itemPlacementSupply_fk2_idx` (`userFk`),
@@ -22492,33 +22915,6 @@ SET character_set_client = utf8;
1 AS `size`,
1 AS `workerCode`,
1 AS `repoCode`,
- 1 AS `parking`,
- 1 AS `sectorFk`*/;
-SET character_set_client = @saved_cs_client;
-
---
--- Temporary table structure for view `itemPlacementSupplyList__`
---
-
-DROP TABLE IF EXISTS `itemPlacementSupplyList__`;
-/*!50001 DROP VIEW IF EXISTS `itemPlacementSupplyList__`*/;
-SET @saved_cs_client = @@character_set_client;
-SET character_set_client = utf8;
-/*!50001 CREATE VIEW `itemPlacementSupplyList__` AS SELECT
- 1 AS `id`,
- 1 AS `itemFk`,
- 1 AS `quantity`,
- 1 AS `priority`,
- 1 AS `created`,
- 1 AS `userFk`,
- 1 AS `repoUserFk`,
- 1 AS `saldo`,
- 1 AS `longName`,
- 1 AS `subName`,
- 1 AS `size`,
- 1 AS `workerCode`,
- 1 AS `repoCode`,
- 1 AS `parking`,
1 AS `sectorFk`*/;
SET character_set_client = @saved_cs_client;
@@ -22654,7 +23050,8 @@ SET character_set_client = utf8;
1 AS `packing`,
1 AS `hour`,
1 AS `isPreviousPreparable`,
- 1 AS `physicalVolume`*/;
+ 1 AS `physicalVolume`,
+ 1 AS `warehouseFk`*/;
SET character_set_client = @saved_cs_client;
--
@@ -23211,6 +23608,18 @@ CREATE TABLE `itemVerdecora` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Relaciona nuestros articulos con los de Verdecora';
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `kk`
+--
+
+DROP TABLE IF EXISTS `kk`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `kk` (
+ `pasillo` varchar(3) COLLATE utf8_unicode_ci NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
--
-- Table structure for table `labourTree`
--
@@ -23869,6 +24278,7 @@ CREATE TABLE `pgc` (
`mod340` tinyint(1) NOT NULL DEFAULT '0',
`mod347` tinyint(1) NOT NULL DEFAULT '0',
`cplusTrascendency477Fk` int(10) unsigned DEFAULT '1',
+ `isEqualizated` tinyint(1) DEFAULT '0',
PRIMARY KEY (`code`),
KEY `pgc_fk1_idx` (`cplusTaxBreakFk`),
KEY `pgc_fk2_idx` (`cplusTrascendency477Fk`),
@@ -24237,7 +24647,7 @@ CREATE TABLE `printServerQueue2` (
KEY `Id_Informe` (`reportFk`),
KEY `Id_Prioridad` (`priorityFk`),
KEY `Id_Trabajador` (`workerFk`)
-) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -24512,14 +24922,14 @@ CREATE TABLE `receipt` (
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_afterInsert` AFTER INSERT ON `receipt` FOR EACH ROW
- CALL bi.customer_risk_update (NEW.clientFk, NEW.companyFk, -NEW.amountPaid) */;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_afterInsert` AFTER INSERT ON `receipt` FOR EACH ROW
+ CALL clientRisk_update(NEW.clientFk, NEW.companyFk, -NEW.amountPaid) */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
@@ -24528,16 +24938,15 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_beforeUpdate` BEFORE UPDATE ON `receipt` FOR EACH ROW
-BEGIN
- CALL bi.customer_risk_update (OLD.clientFk, OLD.companyFk, OLD.amountPaid);
- CALL bi.customer_risk_update (NEW.clientFk, NEW.companyFk, -NEW.amountPaid);
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_beforeUpdate` BEFORE UPDATE ON `receipt` FOR EACH ROW BEGIN
+ CALL clientRisk_update(OLD.clientFk, OLD.companyFk, OLD.amountPaid);
+ CALL clientRisk_update(NEW.clientFk, NEW.companyFk, -NEW.amountPaid);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -24547,14 +24956,14 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_beforeDelete` BEFORE DELETE ON `receipt` FOR EACH ROW
- CALL bi.customer_risk_update (OLD.clientFk, OLD.companyFk, OLD.amountPaid) */;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_beforeDelete` BEFORE DELETE ON `receipt` FOR EACH ROW
+ CALL clientRisk_update(OLD.clientFk, OLD.companyFk, OLD.amountPaid) */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
@@ -24979,6 +25388,11 @@ BEGIN
SET NEW.discount = 0;
END IF;
+ IF old.discount > 0 AND NEW.discount = 0 THEN
+ INSERT INTO ticketLog
+ SET originFk = NEW.ticketFk, userFk = account.myUserGetId(), `action` = 'insert',
+ description = CONCAT('Cambio de descuento del item :', ' ', new.itemFk, ' de ', old.discount ,' a 0 ');
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -25422,9 +25836,12 @@ CREATE TABLE `shelving` (
`isPrinted` tinyint(4) NOT NULL DEFAULT '0',
`priority` int(11) DEFAULT NULL,
`parked` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `userFk` int(11) DEFAULT NULL,
PRIMARY KEY (`code`),
KEY `shelving_fk1_idx` (`parkingFk`),
- CONSTRAINT `shelving_fk1` FOREIGN KEY (`parkingFk`) REFERENCES `parking` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
+ KEY `shelving_fk2_idx` (`userFk`),
+ CONSTRAINT `shelving_fk1` FOREIGN KEY (`parkingFk`) REFERENCES `parking` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `shelving_fk2` FOREIGN KEY (`userFk`) REFERENCES `worker` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla usada para localizar el carro en el parking del altillo';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -26144,6 +26561,10 @@ BEGIN
SET NEW.landed = DATE_FORMAT(NEW.landed, '2000-%m-%d %T');
SET NEW.routeFk = NULL;
END IF;
+
+ IF NEW.routeFk AND NEW.isDeleted THEN
+ CALL util.throw ('This ticket is deleted');
+ END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -26212,8 +26633,8 @@ CREATE TABLE `ticketCollection` (
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`level` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
+ UNIQUE KEY `ticketCollection_fk2_idx` (`ticketFk`),
KEY `ticketCollection_fk1_idx` (`collectionFk`),
- KEY `ticketCollection_fk2_idx` (`ticketFk`),
CONSTRAINT `ticketCollection_fk1` FOREIGN KEY (`collectionFk`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ticketCollection_fk2` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
@@ -26261,8 +26682,14 @@ DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`ticketDms_beforeDelete` BEFORE DELETE ON `ticketDms` FOR EACH ROW
BEGIN
UPDATE dms
- SET dmsTypeFk = (SELECT id FROM dmsType WHERE `code` = 'trash')
- WHERE id = OLD.dmsFk;
+ SET dmsTypeFk = (SELECT id
+ FROM dmsType
+ WHERE `code` = 'trash'
+ )
+ WHERE id = OLD.dmsFk AND ( SELECT IF(COUNT(*) > 0, FALSE, TRUE)
+ FROM ticketDms
+ WHERE dmsFk = OLD.dmsFk
+ ) ;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -27204,6 +27631,7 @@ DROP TABLE IF EXISTS `travelThermograph`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `travelThermograph` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
`thermographFk` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`created` date NOT NULL,
`warehouseFk` smallint(6) unsigned NOT NULL,
@@ -27211,7 +27639,7 @@ CREATE TABLE `travelThermograph` (
`temperature` enum('COOL','WARM') COLLATE utf8_unicode_ci NOT NULL,
`result` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`dmsFk` int(11) DEFAULT NULL,
- PRIMARY KEY (`thermographFk`,`created`),
+ PRIMARY KEY (`id`),
KEY `thermograph_fk_idx` (`thermographFk`),
KEY `gestdoc_fk_idx` (`dmsFk`),
KEY `travel_id` (`travelFk`),
@@ -27220,7 +27648,7 @@ CREATE TABLE `travelThermograph` (
CONSTRAINT `travelThermographThermographFgn` FOREIGN KEY (`thermographFk`) REFERENCES `thermograph` (`id`) ON UPDATE CASCADE,
CONSTRAINT `travelThermographTravelFgn` FOREIGN KEY (`travelFk`) REFERENCES `travel` (`id`),
CONSTRAINT `travelThermographWarehouseFgn` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Registra cada termografo que se ha introducido en cada travel';
+) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Registra cada termografo que se ha introducido en cada travel';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -27505,7 +27933,6 @@ CREATE TABLE `worker` (
`birthed` date NOT NULL,
`maritalStatus` enum('soltero/a','casado/a') COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(9) COLLATE utf8_unicode_ci NOT NULL,
- `companyFk` smallint(5) unsigned NOT NULL,
`clientFk` int(11) DEFAULT NULL,
`userFk` int(10) unsigned DEFAULT NULL,
`bossFk` int(11) NOT NULL DEFAULT '2',
@@ -27518,7 +27945,6 @@ CREATE TABLE `worker` (
UNIQUE KEY `Id_Cliente_Interno` (`clientFk`),
KEY `sub` (`sub`),
KEY `boss_idx` (`bossFk`),
- KEY `empresa_id` (`companyFk`),
CONSTRAINT `Clientes` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE,
CONSTRAINT `worker_ibfk_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
@@ -28016,14 +28442,14 @@ SET character_set_client = utf8;
SET character_set_client = @saved_cs_client;
--
--- Temporary table structure for view `workerTimeControl_Journey`
+-- Temporary table structure for view `workerTimeControl_Journey__`
--
-DROP TABLE IF EXISTS `workerTimeControl_Journey`;
-/*!50001 DROP VIEW IF EXISTS `workerTimeControl_Journey`*/;
+DROP TABLE IF EXISTS `workerTimeControl_Journey__`;
+/*!50001 DROP VIEW IF EXISTS `workerTimeControl_Journey__`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE VIEW `workerTimeControl_Journey` AS SELECT
+/*!50001 CREATE VIEW `workerTimeControl_Journey__` AS SELECT
1 AS `userFk`,
1 AS `dated`,
1 AS `Journey`,
@@ -29226,14 +29652,15 @@ BEGIN
LIMIT 1;
-- Margen
- INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost)
+ -- No se aplica margen, cau 12589
+/* INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost)
SELECT vWarehouse, vItem, vComponentMargin, (vCost / ((100 - rate2) / 100)) - vCost
FROM vn.rate
WHERE dated <= CURDATE()
AND warehouseFk = vWarehouse
ORDER BY dated DESC
LIMIT 1;
-
+ */
-- Recobro
INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost)
SELECT vWarehouse, vItem, vComponentRecovery, ROUND(LEAST(recobro,0.25), 3)
@@ -32100,9 +32527,9 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
@@ -32731,11 +33158,11 @@ BEGIN
JOIN itemType it ON it.categoryFk = k.id
JOIN item i ON i.typeFk = it.id
WHERE i.id = vItemFk;
-
+
IF vIsMerchandise THEN
- REPLACE bi.rotacion SET
- Id_Article = vItemFk,
- warehouse_id = vWarehouse,
+ REPLACE itemCost SET
+ itemFk = vItemFk,
+ warehouseFk = vWarehouse,
cm3 = buy_getUnitVolume(vSelf);
END IF;
@@ -32750,7 +33177,7 @@ BEGIN
JOIN edi.supplier es ON es.supplier_id = be.pro
WHERE b.id = vSelf;
- IF vn2008.has_notify_passport(vItemFk, vSelf) THEN
+ IF buy_hasNotifyPassport(vSelf, vItemFk) THEN
CALL vn.buy_notifyPassport(vSelf, vItemFk, vStickers, vPacking);
END IF;
END IF;
@@ -33356,9 +33783,9 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
@@ -33378,7 +33805,6 @@ proc: BEGIN
* packing, grouping, groupingMode, buyFk, typeFk)
* @return tmp.ticketComponentPrice (warehouseFk, itemFk, rate, grouping, price)
*/
-
DECLARE vClientFk INT;
DECLARE vGeneralInflationCoefficient INT DEFAULT 1;
DECLARE vMinimumDensityWeight INT DEFAULT 167;
@@ -33471,17 +33897,17 @@ proc: BEGIN
GROUP BY tc.itemFk, warehouseFk;
INSERT INTO tmp.ticketComponent
- SELECT tcb.warehouseFk, tcb.itemFk, vRecoveryComponent, ROUND(tcb.base * LEAST(cr.recobro, 0.25), 3)
+ SELECT tcb.warehouseFk, tcb.itemFk, vRecoveryComponent, ROUND(tcb.base * LEAST(cr.priceIncreasing, 0.25), 3)
FROM tmp.ticketComponentBase tcb
- JOIN bi.claims_ratio cr ON cr.Id_Cliente = vClientFk
- WHERE cr.recobro > 0.009;
+ JOIN claimRatio cr ON cr.clientFk = vClientFk
+ WHERE cr.priceIncreasing > 0.009;
INSERT INTO tmp.ticketComponent
- SELECT tcb.warehouseFk, tcb.itemFk, vManaAutoComponent, ROUND(base * (0.01 + prices_modifier_rate), 3) as manaAuto
+ SELECT tcb.warehouseFk, tcb.itemFk, vManaAutoComponent, ROUND(base * (0.01 + wm.pricesModifierRate), 3) as manaAuto
FROM tmp.ticketComponentBase tcb
JOIN `client` c on c.id = vClientFk
- JOIN bs.mana_spellers ms ON c.salesPersonFk = ms.Id_Trabajador
- WHERE ms.prices_modifier_activated
+ JOIN workerMana wm ON c.salesPersonFk = wm.workerFk
+ WHERE wm.isPricesModifierActivated
HAVING manaAuto <> 0;
INSERT INTO tmp.ticketComponent
@@ -33490,7 +33916,7 @@ proc: BEGIN
c.id,
GREATEST(IFNULL(ROUND(tcb.base * c.tax, 4), 0), tcc.minPrice - tcc.rate3)
FROM tmp.ticketComponentBase tcb
- JOIN `component` c
+ JOIN component c
JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk
LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
WHERE c.id = vDiscountLastItemComponent AND c.tax <> 0 AND tcc.minPrice < tcc.rate3 AND sp.value IS NULL;
@@ -33509,7 +33935,7 @@ proc: BEGIN
vGeneralInflationCoefficient
* ROUND((
i.compression
- * r.cm3
+ * ic.cm3
* IF(am.deliveryMethodFk = 1, (GREATEST(i.density, vMinimumDensityWeight) / vMinimumDensityWeight), 1)
* IFNULL((z.price - z.bonus)
* 1/*amz.inflation*/ , 50)) / vBoxVolume, 4
@@ -33518,8 +33944,8 @@ proc: BEGIN
JOIN item i ON i.id = tcc.itemFk
JOIN zone z ON z.id = vZoneFk
JOIN agencyMode am ON am.id = z.agencyModeFk
- LEFT JOIN bi.rotacion r ON r.warehouse_id = tcc.warehouseFk
- AND r.Id_Article = tcc.itemFk
+ LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk
+ AND ic.itemFk = tcc.itemFk
HAVING cost <> 0;
IF (SELECT COUNT(*) FROM vn.addressForPackaging WHERE addressFk = vAddressFk) THEN
@@ -33540,7 +33966,7 @@ proc: BEGIN
vSpecialPriceComponent,
sp.value - SUM(tcc.cost) sumCost
FROM tmp.ticketComponentCopy tcc
- JOIN `component` c ON c.id = tcc.componentFk
+ JOIN component c ON c.id = tcc.componentFk
JOIN specialPrice sp ON sp.clientFk = vClientFK AND sp.itemFk = tcc.itemFk
WHERE c.classRate IS NULL
GROUP BY tcc.itemFk, tcc.warehouseFk
@@ -33552,7 +33978,7 @@ proc: BEGIN
ENGINE = MEMORY
SELECT SUM(cost) sumCost, tc.itemFk, tc.warehouseFk, c.classRate
FROM tmp.ticketComponent tc
- JOIN `component` c ON c.id = tc.componentFk
+ JOIN component c ON c.id = tc.componentFk
GROUP BY tc.itemFk, tc.warehouseFk, c.classRate;
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentRate;
@@ -34569,6 +34995,34 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PROCEDURE IF EXISTS `clientRisk_update` */;
+/*!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 = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `clientRisk_update`(vClientId INT, vCompanyId INT, vAmount DECIMAL(10,2))
+BEGIN
+ IF vAmount IS NOT NULL
+ THEN
+ INSERT INTO clientRisk
+ SET
+ clientFk = vClientId,
+ companyFk = vCompanyId,
+ amount = vAmount
+ ON DUPLICATE KEY UPDATE
+ amount = amount + VALUES(amount);
+ 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 DROP PROCEDURE IF EXISTS `clonTravelComplete` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -34786,18 +35240,20 @@ BEGIN
sh.code COLLATE utf8_general_ci as shelving,
ish.created,
ish.visible,
- IFNULL(p.pickingOrder,0) as `order`,
+ IFNULL(cpd.id,0) as `order`,
IF(sc.isPreviousPreparedByPacking, ish.packing, g.`grouping`) as `grouping`
FROM vn.ticketCollection tc
JOIN vn.sale s ON s.ticketFk = tc.ticketFk
JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
JOIN vn.parking p ON p.id = sh.parkingFk
+ LEFT JOIN vn.coolerPathDetail cpd ON CAST(cpd.hallway AS DECIMAL(3,0)) = p.column
JOIN vn.sector sc ON sc.id = p.sectorFk
JOIN vn.warehouse w ON w.id = sc.warehouseFk
JOIN tmp.`grouping` g ON g.itemFk = s.itemFk
WHERE tc.collectionFk = vCollectionFk
AND w.aliasFk = vWarehouseAliasFk
+ AND ish.visible > 0
UNION ALL
SELECT s.id as saleFk, s.itemFk,
ip.code COLLATE utf8_general_ci as placement,
@@ -34814,8 +35270,241 @@ BEGIN
JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vCalcFk
LEFT JOIN tmp.grouping2 g ON g.itemFk = s.itemFk
WHERE tc.collectionFk = vCollectionFk
- -- HAVING visible > 0
- ;
+ AND v.visible - p.quantity > 0
+ AND IFNULL(cpd.id,0);
+
+ DROP TEMPORARY TABLE
+ tmp.parked,
+ tmp.`grouping`,
+ tmp.grouping2;
+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 DROP PROCEDURE IF EXISTS `collectionPlacement_get_beta` */;
+/*!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 = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `collectionPlacement_get_beta`(vCollectionFk INT)
+BEGIN
+
+ DECLARE vCalcFk INT;
+ DECLARE vWarehouseFk INT;
+ DECLARE vWarehouseAliasFk INT;
+
+ SELECT t.warehouseFk, w.aliasFk
+ INTO vWarehouseFk, vWarehouseAliasFk
+ FROM vn.ticket t
+ JOIN vn.ticketCollection tc ON tc.ticketFk = t.id
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ WHERE tc.collectionFk = vCollectionFk
+ LIMIT 1;
+
+ CALL cache.visible_refresh(vCalcFk,FALSE,vWarehouseFk);
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.parked;
+ CREATE TEMPORARY TABLE tmp.parked
+ ENGINE MEMORY
+ SELECT s.itemFk, 0 as quantity
+ FROM vn.ticketCollection tc
+ JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ WHERE tc.collectionFk = vCollectionFk;
+
+ UPDATE tmp.parked pk
+ JOIN ( SELECT itemFk, sum(visible) as visible
+ FROM vn.itemShelvingStock iss
+ JOIN vn.warehouse w ON w.id = iss.warehouseFk
+ WHERE w.aliasFk = vWarehouseAliasFk
+ GROUP BY iss.itemFk ) iss ON iss.itemFk = pk.itemFk
+ SET pk.quantity = iss.visible;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.`grouping`;
+ CREATE TEMPORARY TABLE tmp.`grouping`
+ ENGINE MEMORY
+ SELECT itemFk, `grouping`
+ FROM (
+ SELECT itemFk,
+ CASE groupingMode
+ WHEN 0 THEN 1
+ WHEN 2 THEN packing
+ ELSE `grouping`
+ END AS `grouping`
+ FROM buy b
+ JOIN entry e ON e.id = b.entryFk
+ JOIN travel tr ON tr.id = e.travelFk
+ WHERE tr.warehouseInFk = vWarehouseFk
+ AND landed BETWEEN (SELECT FechaInventario FROM vn2008.tblContadores LIMIT 1) AND CURDATE()
+ AND b.isIgnored = FALSE
+ ORDER BY tr.landed DESC
+ ) sub
+ GROUP BY sub.itemFk ;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.grouping2;
+ CREATE TEMPORARY TABLE tmp.grouping2
+ ENGINE MEMORY
+ SELECT * FROM tmp.`grouping`;
+
+ SELECT s.id as saleFk, s.itemFk,
+ p.code COLLATE utf8_general_ci as placement ,
+ sh.code COLLATE utf8_general_ci as shelving,
+ ish.created,
+ ish.visible,
+ IFNULL(cpd.id,0) as `order`,
+ IF(sc.isPreviousPreparedByPacking, ish.packing, g.`grouping`) as `grouping`
+ FROM vn.ticketCollection tc
+ JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk
+ JOIN vn.shelving sh ON sh.code = ish.shelvingFk
+ JOIN vn.parking p ON p.id = sh.parkingFk
+ LEFT JOIN vn.coolerPathDetail cpd ON CAST(cpd.hallway AS DECIMAL(3,0)) = p.column
+ JOIN vn.sector sc ON sc.id = p.sectorFk
+ JOIN vn.warehouse w ON w.id = sc.warehouseFk
+ JOIN tmp.`grouping` g ON g.itemFk = s.itemFk
+ WHERE tc.collectionFk = vCollectionFk
+ AND w.aliasFk = vWarehouseAliasFk
+ AND ish.visible > 0
+ UNION ALL
+ SELECT s.id as saleFk, s.itemFk,
+ ip.code COLLATE utf8_general_ci as placement,
+ '' COLLATE utf8_general_ci as shelving,
+ modificationDate as created,
+ v.visible - p.quantity as visible,
+ IFNULL(cpd.id,0) as `order`,
+ g.`grouping`
+ FROM vn.ticketCollection tc
+ JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ JOIN vn.itemPlacement ip ON ip.itemFk = s.itemFk AND ip.warehouseFk = vWarehouseFk
+ LEFT JOIN vn.coolerPathDetail cpd ON cpd.hallway = LEFT(ip.`code`,3)
+ JOIN tmp.parked p ON p.itemFk = s.itemFk
+ JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vCalcFk
+ LEFT JOIN tmp.grouping2 g ON g.itemFk = s.itemFk
+ WHERE tc.collectionFk = vCollectionFk
+ AND v.visible - p.quantity > 0
+ AND IFNULL(cpd.id,0);
+
+ DROP TEMPORARY TABLE
+ tmp.parked,
+ tmp.`grouping`,
+ tmp.grouping2;
+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 DROP PROCEDURE IF EXISTS `collectionPlacement_get__` */;
+/*!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 = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `collectionPlacement_get__`(vCollectionFk INT)
+BEGIN
+
+ DECLARE vCalcFk INT;
+ DECLARE vWarehouseFk INT;
+ DECLARE vWarehouseAliasFk INT;
+
+ SELECT t.warehouseFk, w.aliasFk
+ INTO vWarehouseFk, vWarehouseAliasFk
+ FROM vn.ticket t
+ JOIN vn.ticketCollection tc ON tc.ticketFk = t.id
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ WHERE tc.collectionFk = vCollectionFk
+ LIMIT 1;
+
+ CALL cache.visible_refresh(vCalcFk,FALSE,vWarehouseFk);
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.parked;
+ CREATE TEMPORARY TABLE tmp.parked
+ ENGINE MEMORY
+ SELECT s.itemFk, 0 as quantity
+ FROM vn.ticketCollection tc
+ JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ WHERE tc.collectionFk = vCollectionFk;
+
+ UPDATE tmp.parked pk
+ JOIN ( SELECT itemFk, sum(visible) as visible
+ FROM vn.itemShelvingStock iss
+ JOIN vn.warehouse w ON w.id = iss.warehouseFk
+ WHERE w.aliasFk = vWarehouseAliasFk
+ GROUP BY iss.itemFk ) iss ON iss.itemFk = pk.itemFk
+ SET pk.quantity = iss.visible;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.`grouping`;
+ CREATE TEMPORARY TABLE tmp.`grouping`
+ ENGINE MEMORY
+ SELECT itemFk, `grouping`
+ FROM (
+ SELECT itemFk,
+ CASE groupingMode
+ WHEN 0 THEN 1
+ WHEN 2 THEN packing
+ ELSE `grouping`
+ END AS `grouping`
+ FROM buy b
+ JOIN entry e ON e.id = b.entryFk
+ JOIN travel tr ON tr.id = e.travelFk
+ WHERE tr.warehouseInFk = vWarehouseFk
+ AND landed BETWEEN (SELECT FechaInventario FROM vn2008.tblContadores LIMIT 1) AND CURDATE()
+ AND b.isIgnored = FALSE
+ ORDER BY tr.landed DESC
+ ) sub
+ GROUP BY sub.itemFk ;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.grouping2;
+ CREATE TEMPORARY TABLE tmp.grouping2
+ ENGINE MEMORY
+ SELECT * FROM tmp.`grouping`;
+
+ SELECT s.id as saleFk, s.itemFk,
+ p.code COLLATE utf8_general_ci as placement ,
+ sh.code COLLATE utf8_general_ci as shelving,
+ ish.created,
+ ish.visible,
+ IFNULL(p.pickingOrder,0) as `order`,
+ IF(sc.isPreviousPreparedByPacking, ish.packing, g.`grouping`) as `grouping`
+ FROM vn.ticketCollection tc
+ JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk
+ JOIN vn.shelving sh ON sh.code = ish.shelvingFk
+ JOIN vn.parking p ON p.id = sh.parkingFk
+ JOIN vn.sector sc ON sc.id = p.sectorFk
+ JOIN vn.warehouse w ON w.id = sc.warehouseFk
+ JOIN tmp.`grouping` g ON g.itemFk = s.itemFk
+ WHERE tc.collectionFk = vCollectionFk
+ AND w.aliasFk = vWarehouseAliasFk
+ AND ish.visible > 0
+ UNION ALL
+ SELECT s.id as saleFk, s.itemFk,
+ ip.code COLLATE utf8_general_ci as placement,
+ '' COLLATE utf8_general_ci as shelving,
+ modificationDate as created,
+ v.visible - p.quantity as visible,
+ IFNULL(cpd.hallway * 100,0) as `order`,
+ g.`grouping`
+ FROM vn.ticketCollection tc
+ JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ JOIN vn.itemPlacement ip ON ip.itemFk = s.itemFk AND ip.warehouseFk = vWarehouseFk
+ LEFT JOIN vn.coolerPathDetail cpd ON cpd.hallway = LEFT(ip.`code`,3)
+ JOIN tmp.parked p ON p.itemFk = s.itemFk
+ JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vCalcFk
+ LEFT JOIN tmp.grouping2 g ON g.itemFk = s.itemFk
+ WHERE tc.collectionFk = vCollectionFk
+ AND v.visible - p.quantity > 0
+ AND IFNULL(cpd.id,0);
DROP TEMPORARY TABLE
tmp.parked,
@@ -35035,6 +35724,238 @@ DELIMITER ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `collection_new`(vSectorFk INT)
+proc:BEGIN
+
+ DECLARE vIsPreviousPrepared BOOLEAN;
+ DECLARE vCollectionFk INT;
+ DECLARE vWarehouseFk INT;
+ DECLARE vMaxTickets INT DEFAULT 4;
+ DECLARE vStateFk INT;
+ DECLARE vFirstTicketFk INT;
+ DECLARE vWorkerCode VARCHAR(3);
+ DECLARE vShelve INT;
+ DECLARE vTicket INT;
+
+ -- Establecemos el almacén y si es un sector de preparación previa, así como el estado para los tickets que se vayan preparando
+ SELECT isPreviousPrepared, warehouseFk
+ INTO vIsPreviousPrepared, vWarehouseFk
+ FROM vn.sector
+ WHERE id = vSectorFk;
+
+ IF vIsPreviousPrepared THEN
+
+ SELECT id INTO vStateFk
+ FROM vn.state
+ WHERE `code` = 'PREVIOUS_PREPARATION';
+ ELSE
+
+ SELECT id INTO vStateFk
+ FROM vn.state
+ WHERE `code` = 'ON_PREPARATION';
+
+ END IF;
+
+ -- Obtenemos el código del usuario
+ SELECT w.code
+ INTO vWorkerCode
+ FROM vn.worker w
+ WHERE w.id = account.myUserGetId();
+
+ -- Se obtiene nº de colección y el buffer con los pedidos preparables
+ INSERT INTO vn.collection
+ SET workerFk = account.myUserGetId();
+
+ SELECT LAST_INSERT_ID() INTO vCollectionFk;
+
+ CALL vn2008.production_control_source(vWarehouseFk, 0);
+
+ -- Se seleccionan los primeros tickets, asignando colección para dejarlos bloqueados a otros sacadores.
+ INSERT IGNORE INTO vn.ticketCollection(ticketFk, collectionFk)
+ SELECT pb.Id_Ticket,
+ vCollectionFk
+ FROM tmp.production_buffer pb
+ JOIN vn.state s ON s.id = pb.state
+ WHERE pb.collectionFk IS NULL
+ AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
+ ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto
+ LIMIT vMaxTickets;
+
+ -- Creamos una tabla temporal con los datos que necesitamos para depurar la colección
+ DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
+ CREATE TEMPORARY TABLE tmp.ticket
+ SELECT pb.Id_Ticket ticketFk,
+ pb.lines,
+ pb.m3 * 1000 liters,
+ 0 as height,
+ 0 as shelve
+ FROM tmp.production_buffer pb
+ JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
+ WHERE tc.collectionFk = vCollectionFk;
+
+ /* El criterio para formar la colección es el siguiente:
+ *
+ * 1º.- Los tickets asignados son prioritarios, y por ello ya vienen ordenados en las primeras posiciones.
+ * 2º.- Las recogidas en Silla tienen que ir en carros independientes.
+ *
+ * Por tanto, si el primer pedido es recogida, nos olvidamos del resto.
+ * Si el primer pedido no es recogida, eliminamos las recogidas posteriores.
+ */
+
+ SELECT ticketFk
+ INTO vFirstTicketFk
+ FROM tmp.ticket
+ LIMIT 1;
+
+ IF (SELECT pb.Agencia FROM tmp.production_buffer pb WHERE Id_Ticket = vFirstTicketFk) = 'REC_SILLA' THEN
+
+ DELETE FROM tmp.ticket WHERE ticketFk != vFirstTicketFk;
+
+ UPDATE tmp.ticket SET shelve = 1;
+ -- Como sólo hay un ticket, se le asigna el nivel 1 y acabamos
+
+ ELSE
+
+ -- Eliminamos los de recogida, puesto que el primero sabemos que no es de rec_silla
+ DELETE t.*
+ FROM tmp.ticket t
+ JOIN tmp.production_buffer pb ON pb.Id_Ticket = t.ticketFk
+ WHERE pb.Agencia = 'REC_SILLA';
+
+ -- Establece altura máxima por pedido, porque las plantas no se pueden recostar.
+ UPDATE tmp.ticket t
+ JOIN
+ ( SELECT MAX(i.size) maxHeigth,
+ tc.ticketFk
+ FROM vn.ticketCollection tc
+ JOIN vn.sale s ON s.ticketFk = tc.ticketFk
+ JOIN vn.item i ON i.id = s.itemFk
+ JOIN vn.itemType it ON it.id = i.typeFk
+ JOIN vn.itemCategory ic ON ic.id = it.categoryFk
+ WHERE ic.isReclining = FALSE
+ AND tc.collectionFk = vCollectionFk
+ GROUP BY tc.ticketFk) sub ON sub.ticketFk = t.ticketFk
+ SET t.height = sub.maxHeigth;
+
+ -- Vamos a generar una tabla con todas las posibilidades de asignacion de pedido
+ DROP TEMPORARY TABLE IF EXISTS tmp.ticketShelve;
+ CREATE TEMPORARY TABLE tmp.ticketShelve
+ SELECT ticketFk, shelve
+ FROM (
+ SELECT t.ticketFk,
+ cv.`level` shelve,
+ CAST(cv.lines AS SIGNED) - t.lines as linesDif,
+ CAST(cv.liters AS SIGNED) - t.liters as litersDif,
+ CAST(cv.height AS SIGNED) - t.height as heightDif
+ FROM vn.collectionVolumetry cv
+ JOIN tmp.ticket t
+ ORDER BY (t.ticketFk = vFirstTicketFk) DESC, linesDif
+ ) sub
+ WHERE linesDif >= 0
+ AND litersDif >= 0
+ AND heightDif >= 0
+ ORDER BY linesDif;
+
+ -- Asignamos la primera balda util al primer pedido
+ SELECT IFNULL(shelve,0) INTO vShelve
+ FROM tmp.ticketShelve
+ WHERE ticketFk = vFirstTicketFk
+ LIMIT 1;
+
+ IF vShelve THEN
+
+ UPDATE tmp.ticket
+ SET shelve = vShelve
+ WHERE ticketFk = vFirstTicketFk;
+
+ DELETE FROM tmp.ticketShelve
+ WHERE ticketFk = vFirstTicketFk
+ OR shelve = vShelve;
+
+ WHILE (SELECT COUNT(*) FROM tmp.ticketShelve) DO
+
+ SELECT ticketFk, shelve
+ INTO vTicket, vShelve
+ FROM tmp.ticketShelve
+ LIMIT 1;
+
+ UPDATE tmp.ticket
+ SET shelve = vShelve
+ WHERE ticketFk = vTicket;
+
+ DELETE FROM tmp.ticketShelve
+ WHERE ticketFk = vTicket
+ OR shelve = vShelve;
+
+ END WHILE;
+
+ ELSE
+
+ UPDATE tmp.ticket
+ SET shelve = 1
+ WHERE ticketFk = vFirstTicketFk;
+
+ END IF;
+
+ END IF;
+
+ -- Eliminamos los que se han quedado sin balda
+ DELETE FROM tmp.ticket WHERE shelve = 0 ;
+
+ -- Elimina los tickets bloqueados que no se van a preparar
+ DELETE tc.*
+ FROM vn.ticketCollection tc
+ LEFT JOIN tmp.ticket t ON t.ticketFk = tc.ticketFk
+ WHERE tc.collectionFk = vCollectionFk
+ AND t.ticketFk IS NULL;
+
+ -- Actualiza el estado de la colección
+ UPDATE vn.collection c
+ JOIN vn.state st ON st.code = 'ON_PREPARATION'
+ SET c.stateFk = st.id
+ WHERE c.id = vCollectionFk;
+
+ -- Asigna las bandejas
+ UPDATE vn.ticketCollection tc
+ JOIN tmp.ticket t ON t.ticketFk = tc.ticketFk
+ SET tc.level = t.shelve;
+
+ -- Actualiza el estado de los tickets
+ INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador)
+ SELECT vStateFk, ticketFk, account.myUserGetId()
+ FROM vn.ticketCollection tc
+ WHERE tc.collectionFk = vCollectionFk;
+
+ -- Avisa los preparados previos que hay que bajar del altillo imprimiendo etiqueta
+ INSERT IGNORE INTO vn.ticketDown(ticketFk)
+ SELECT DISTINCT tc.ticketFk
+ FROM vn.ticketCollection tc
+ JOIN vncontrol.inter vi ON vi.Id_Ticket = tc.ticketFk
+ JOIN vn.state st ON st.id = vi.state_id
+ JOIN vn.ticket t ON t.id = tc.ticketFk
+ JOIN vn.warehouse w ON w.id = t.warehouseFk
+ WHERE tc.collectionFk = vCollectionFk
+ AND w.name = 'Silla FV'
+ AND st.code = 'PREVIOUS_PREPARATION';
+
+ SELECT vCollectionFk;
+
+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 DROP PROCEDURE IF EXISTS `collection_new__` */;
+/*!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 = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `collection_new__`(vSectorFk INT)
proc:BEGIN
DECLARE vIsPreviousPrepared BOOLEAN;
@@ -35078,6 +35999,14 @@ proc:BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
+ -- Reenvio a la version beta si el sector es el de pruebas
+ IF vSectorFk IN (17,18) THEN
+
+ CALL vn.collection_new_beta(vSectorFk);
+ LEAVE proc;
+
+ END IF;
+
SELECT isPreviousPrepared, warehouseFk
INTO vIsPreviousPrepared, vWarehouseFk
FROM vn.sector
@@ -35130,6 +36059,7 @@ proc:BEGIN
JOIN vn.state s ON s.id = pb.state
LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
WHERE pb.problems = 0
+ AND pb.Agencia = 'REC_SILLA'
AND tc.ticketFk IS NULL
AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto, m3 DESC, pb.lines DESC
@@ -35316,510 +36246,39 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
-/*!50003 DROP PROCEDURE IF EXISTS `collection_new_beta` */;
+/*!50003 DROP PROCEDURE IF EXISTS `collection_update` */;
/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`%` PROCEDURE `collection_new_beta`(vSectorFk INT)
-proc:BEGIN
+CREATE DEFINER=`root`@`%` PROCEDURE `collection_update`(vTicketFk INT)
+BEGIN
+
+ DECLARE vNumChecked INT;
+ DECLARE vCollectionFk INT;
- DECLARE vIsPreviousPrepared BOOLEAN;
- DECLARE vCollectionFk INT;
- DECLARE vWarehouseFk INT;
-
- DECLARE vTicketLiters INT;
- DECLARE vTicketLines INT;
- DECLARE vTicketFk INT;
- DECLARE vTicketHeight INT;
- DECLARE vTicketHeightTop INT;
- DECLARE vTicketHeightFloor INT;
- DECLARE vIsTicketCollected BOOLEAN;
- DECLARE vMaxTickets INT;
- DECLARE vStateFk INT;
- DECLARE vTopTicketFk INT;
- DECLARE vFloorTicketFk INT;
-
- DECLARE vVolumetryLiters INT;
- DECLARE vVolumetryLines INT;
- DECLARE vVolumetryFk INT;
- DECLARE vVolumetryLevel INT;
- DECLARE vVolumetryHeight INT;
- DECLARE vVolumetryLitersMax INT;
- DECLARE vVolumetryLinesMax INT;
- DECLARE vVolumetryHeightTop INT;
- DECLARE vVolumetryHeightFloor INT;
-
- DECLARE vDone BOOLEAN DEFAULT FALSE;
- DECLARE vWorkerCode VARCHAR(3);
-
- DECLARE cVolumetry CURSOR FOR
- SELECT level, liters, `lines`, height
- FROM vn.collectionVolumetry
- ORDER BY `level`;
-
- DECLARE cTicket CURSOR FOR
- SELECT *
- FROM tmp.ticket
- ORDER BY height DESC;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
- SELECT isPreviousPrepared, warehouseFk
- INTO vIsPreviousPrepared, vWarehouseFk
- FROM vn.sector
- WHERE id = vSectorFk;
-
- SELECT w.code
- INTO vWorkerCode
- FROM vn.worker w
- WHERE w.id = account.myUserGetId();
-
- IF vIsPreviousPrepared THEN
-
- SELECT id INTO vStateFk
- FROM vn.state
- WHERE `code` = 'PREVIOUS_PREPARATION';
- ELSE
-
- SELECT id INTO vStateFk
- FROM vn.state
- WHERE `code` = 'ON_PREPARATION';
-
- END IF;
-
- SELECT COUNT(*), sum(liters), sum(`lines`)
- INTO vMaxTickets, vVolumetryLitersMax, vVolumetryLinesMax
- FROM vn.collectionVolumetry;
-
- CALL vn2008.production_control_source(vWarehouseFk, 0);
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
-
- -- Recogida Silla requiere carros individuales
-
- IF (SELECT pb.Agencia
- FROM tmp.production_buffer pb
- JOIN vn.state s ON s.id = pb.state
- LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
- WHERE pb.problems = 0
- AND tc.ticketFk IS NULL
- AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
- ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto, m3 DESC, pb.lines DESC
- LIMIT 1) = 'REC_SILLA' THEN
-
- CREATE TEMPORARY TABLE tmp.ticket
- SELECT pb.Id_Ticket ticketFk,
- pb.lines,
- pb.m3 * 1000 liters,
- 0 as height
- FROM tmp.production_buffer pb
- JOIN vn.state s ON s.id = pb.state
- LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
- WHERE pb.problems = 0
- AND tc.ticketFk IS NULL
- AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
- ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto, m3 DESC, pb.lines DESC
- LIMIT 1;
-
- ELSE
-
- CREATE TEMPORARY TABLE tmp.ticket
- SELECT pb.Id_Ticket ticketFk,
- pb.lines,
- pb.m3 * 1000 liters,
- 0 as height
- FROM tmp.production_buffer pb
- JOIN vn.state s ON s.id = pb.state
- LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
- WHERE pb.problems = 0
- AND pb.Agencia != 'REC_SILLA'
- AND tc.ticketFk IS NULL
- AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
- ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto, m3 DESC, pb.lines DESC
- LIMIT vMaxTickets;
-
- -- Establece altura máxima por pedido, porque las plantas no se pueden recostar.
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticket2;
- CREATE TEMPORARY TABLE tmp.ticket2
- SELECT MAX(i.size) maxHeigth, t.ticketFk
- FROM tmp.ticket t
- JOIN vn.sale s ON s.ticketFk = t.ticketFk
- JOIN vn.item i ON i.id = s.itemFk
- JOIN vn.itemType it ON it.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = it.categoryFk
- WHERE ic.isReclining = FALSE
- GROUP BY t.ticketFk;
-
- UPDATE tmp.ticket t
- JOIN tmp.ticket2 t2 ON t2.ticketFk = t.ticketFk
- SET t.height = t2.maxHeigth;
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticket2;
- -- Si hay un ticket con una planta que supera la máxima altura para la bandeja superior, el pedido ha de ser único. Por tanto, eliminamos el resto.
- -- Si hay dos tickets con plantas que superen la medida inferior, el carro llevará una bandeja. Hay que eliminar los otros dos.
-
- SELECT height, ticketFk
- INTO vTicketHeightTop, vTopTicketFk
- FROM tmp.ticket
- ORDER BY height DESC
- LIMIT 1;
-
- SELECT max(height)
- INTO vVolumetryHeightTop
- FROM vn.collectionVolumetry;
-
- SELECT height, ticketFk
- INTO vTicketHeightFloor, vFloorTicketFk
- FROM tmp.ticket
- WHERE ticketFk != vTopTicketFk
- ORDER BY height DESC
- LIMIT 1;
-
- SELECT height
- INTO vVolumetryHeightFloor
- FROM vn.collectionVolumetry
- WHERE level = 1;
-
- IF vTicketHeightTop > vVolumetryHeightTop
- OR vTicketHeightFloor > vVolumetryHeightFloor THEN
-
- DELETE FROM tmp.ticket WHERE ticketFk != vTopTicketFk;
-
- ELSEIF vTicketHeightFloor <= vVolumetryHeightFloor THEN
-
- DELETE FROM tmp.ticket WHERE ticketFk NOT IN (vTopTicketFk, vFloorTicketFk);
-
- END IF;
-
-
-
+ /*SI TODAS LOS TICKETS DE UNA COLECCIÓN ESTAN REVISADOS CAMBIADOS ESTADO COLECCIÓN*/
+ SELECT collectionFk
+ INTO vCollectionFk
+ FROM vn.ticketCollection
+ WHERE ticketFk = vTicketFk;
+
+ IF (SELECT COUNT(*)
+ FROM vn.ticketCollection tc
+ JOIN vn.ticketLastState tls ON tls.ticketFk = tc.ticketFk
+ WHERE tc.collectionFk = vCollectionFk
+ AND (name = 'Preparación' OR name = 'En Revisión' OR name = 'Impreso' OR name = 'Preparado') ) = 0 THEN
+
+ UPDATE vn.collection
+ SET stateFk = (SELECT id FROM vn.state WHERE code = 'PREPARED')
+ WHERE id = vCollectionFk;
END IF;
-
-
- -- Empieza el bucle
- OPEN cVolumetry;
- OPEN cTicket;
-
- FETCH cTicket INTO vTicketFk, vTicketLines, vTicketLiters, vTicketHeight;
- FETCH cVolumetry INTO vVolumetryLevel, vVolumetryLiters, vVolumetryLines, vVolumetryHeight;
-
- IF NOT vDone THEN
-
- INSERT INTO vn.collection
- SET workerFk = account.myUserGetId();
-
- SELECT LAST_INSERT_ID() INTO vCollectionFk;
-
- END IF;
-
- bucle:WHILE NOT vDone DO
-
- IF (vVolumetryLitersMax < vTicketLiters OR vVolumetryLinesMax < vTicketLines) AND vVolumetryLevel > 1 THEN
-
- LEAVE bucle;
-
- END IF;
-
- SELECT COUNT(*) INTO vIsTicketCollected
- FROM vn.ticketCollection
- WHERE ticketFk = vTicketFk
- AND collectionFk = vCollectionFk;
-
- IF vIsTicketCollected THEN
-
- UPDATE vn.ticketCollection
- SET level = CONCAT(level, vVolumetryLevel)
- WHERE ticketFk = vTicketFk
- AND collectionFk = vCollectionFk;
-
- ELSE
-
- INSERT INTO vn.ticketCollection
- SET collectionFk = vCollectionFk,
- ticketFk = vTicketFk,
- level = vVolumetryLevel;
-
- INSERT INTO vncontrol.inter
- SET state_id = vStateFk,
- Id_Ticket = vTicketFk,
- Id_Trabajador = account.myUserGetId();
-
- END IF;
-
- SET vVolumetryLitersMax = GREATEST(0,vVolumetryLitersMax - vVolumetryLiters);
- SET vVolumetryLinesMax = GREATEST(0,vVolumetryLinesMax - vVolumetryLines);
- SET vTicketLiters = GREATEST(0,vTicketLiters - vVolumetryLiters);
- SET vTicketLines = GREATEST(0,vTicketLines - vVolumetryLines);
-
- IF vVolumetryLitersMax = 0 OR vVolumetryLinesMax = 0 THEN
-
- LEAVE bucle;
-
- END IF;
-
- IF vTicketLiters > 0 OR vTicketLines > 0 THEN
-
- FETCH cVolumetry INTO vVolumetryLevel, vVolumetryLiters, vVolumetryLines, vVolumetryHeight;
-
- ELSE
-
- FETCH cTicket INTO vTicketFk, vTicketLines, vTicketLiters, vTicketHeight;
- FETCH cVolumetry INTO vVolumetryLevel, vVolumetryLiters, vVolumetryLines, vVolumetryHeight;
-
- END IF;
-
- END WHILE;
-
-
- UPDATE vn.collection c
- JOIN vn.state st ON st.code = 'ON_PREPARATION'
- SET c.stateFk = st.id
- WHERE c.id = vCollectionFk;
-
- INSERT IGNORE INTO vn.ticketDown(ticketFk)
- SELECT DISTINCT tc.ticketFk
- FROM vn.ticketCollection tc
- JOIN vncontrol.inter vi ON vi.Id_Ticket = tc.ticketFk
- JOIN vn.state st ON st.id = vi.state_id
- JOIN vn.ticket t ON t.id = tc.ticketFk
- JOIN vn.warehouse w ON w.id = t.warehouseFk
- WHERE tc.collectionFk = vCollectionFk
- AND w.name = 'Silla FV'
- AND st.code = 'PREVIOUS_PREPARATION';
-
-
- SELECT vCollectionFk;
-
- CLOSE cVolumetry;
- CLOSE cTicket;
- -- DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
- -- DROP TEMPORARY TABLE IF EXISTS tmp.ticket2;
-
-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 DROP PROCEDURE IF EXISTS `collection_new__` */;
-/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`%` PROCEDURE `collection_new__`(vSectorFk INT)
-proc:BEGIN
-
- DECLARE vIsPreviousPrepared BOOLEAN;
- DECLARE vCollectionFk INT;
- DECLARE vWarehouseFk INT;
- DECLARE vTicketLiters INT;
- DECLARE vTicketLines INT;
- DECLARE vTicketFk INT;
- DECLARE vIsTicketCollected BOOLEAN;
- DECLARE vMaxTickets INT;
- DECLARE vStateFk INT;
- DECLARE vVolumetryLiters INT;
- DECLARE vVolumetryLines INT;
- DECLARE vVolumetryFk INT;
- DECLARE vVolumetryLevel INT;
- DECLARE vVolumetryLitersMax INT;
- DECLARE vVolumetryLinesMax INT;
- DECLARE vDone BOOLEAN DEFAULT FALSE;
- DECLARE vWorkerCode VARCHAR(3);
-
- DECLARE cVolumetry CURSOR FOR
- SELECT level, liters, `lines`
- FROM vn.collectionVolumetry
- ORDER BY `level`;
-
- DECLARE cTicket CURSOR FOR
- SELECT *
- FROM tmp.ticket;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-
- SELECT isPreviousPrepared, warehouseFk
- INTO vIsPreviousPrepared, vWarehouseFk
- FROM vn.sector
- WHERE id = vSectorFk;
-
- SELECT w.code
- INTO vWorkerCode
- FROM vn.worker w
- WHERE w.id = account.myUserGetId();
-
- IF vIsPreviousPrepared THEN
-
- SELECT id INTO vStateFk
- FROM vn.state
- WHERE `code` = 'PREVIOUS_PREPARATION';
- ELSE
-
- SELECT id INTO vStateFk
- FROM vn.state
- WHERE `code` = 'ON_PREPARATION';
-
- END IF;
-
- SELECT COUNT(*), sum(liters), sum(`lines`)
- INTO vMaxTickets, vVolumetryLitersMax, vVolumetryLinesMax
- FROM vn.collectionVolumetry;
-
- CALL vn2008.production_control_source(vWarehouseFk, 0);
-
- DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
-
- IF (SELECT pb.Agencia
- FROM tmp.production_buffer pb
- JOIN vn.state s ON s.id = pb.state
- LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
- WHERE pb.problems = 0
- AND tc.ticketFk IS NULL
- AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
- ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto, m3 DESC, pb.lines DESC
- LIMIT 1) = 'REC_SILLA' THEN
-
- CREATE TEMPORARY TABLE tmp.ticket
- SELECT pb.Id_Ticket ticketFk,
- pb.lines,
- pb.m3 * 1000 liters
- FROM tmp.production_buffer pb
- JOIN vn.state s ON s.id = pb.state
- LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
- WHERE pb.problems = 0
- AND tc.ticketFk IS NULL
- AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
- ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto, m3 DESC, pb.lines DESC
- LIMIT 1;
-
- ELSE
-
- CREATE TEMPORARY TABLE tmp.ticket
- SELECT pb.Id_Ticket ticketFk,
- pb.lines,
- pb.m3 * 1000 liters
- FROM tmp.production_buffer pb
- JOIN vn.state s ON s.id = pb.state
- LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket
- WHERE pb.problems = 0
- AND pb.Agencia != 'REC_SILLA'
- AND tc.ticketFk IS NULL
- AND (s.isPreparable OR (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode))
- ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, pb.Hora, pb.Minuto, m3 DESC, pb.lines DESC
- LIMIT vMaxTickets;
-
- END IF;
-
- -- Empieza el bucle
- OPEN cVolumetry;
- OPEN cTicket;
-
- FETCH cTicket INTO vTicketFk, vTicketLines, vTicketLiters;
- FETCH cVolumetry INTO vVolumetryLevel, vVolumetryLiters, vVolumetryLines;
-
- IF NOT vDone THEN
-
- INSERT INTO vn.collection
- SET workerFk = account.myUserGetId();
-
- SELECT LAST_INSERT_ID() INTO vCollectionFk;
-
- END IF;
-
- bucle:WHILE NOT vDone DO
-
- IF (vVolumetryLitersMax < vTicketLiters OR vVolumetryLinesMax < vTicketLines) AND vVolumetryLevel > 1 THEN
-
- LEAVE bucle;
-
- END IF;
-
- SELECT COUNT(*) INTO vIsTicketCollected
- FROM vn.ticketCollection
- WHERE ticketFk = vTicketFk
- AND collectionFk = vCollectionFk;
-
- IF vIsTicketCollected THEN
-
- UPDATE vn.ticketCollection
- SET level = CONCAT(level, vVolumetryLevel)
- WHERE ticketFk = vTicketFk
- AND collectionFk = vCollectionFk;
-
- ELSE
-
- INSERT INTO vn.ticketCollection
- SET collectionFk = vCollectionFk,
- ticketFk = vTicketFk,
- level = vVolumetryLevel;
-
- INSERT INTO vncontrol.inter
- SET state_id = vStateFk,
- Id_Ticket = vTicketFk,
- Id_Trabajador = account.myUserGetId();
-
- END IF;
-
- SET vVolumetryLitersMax = GREATEST(0,vVolumetryLitersMax - vVolumetryLiters);
- SET vVolumetryLinesMax = GREATEST(0,vVolumetryLinesMax - vVolumetryLines);
- SET vTicketLiters = GREATEST(0,vTicketLiters - vVolumetryLiters);
- SET vTicketLines = GREATEST(0,vTicketLines - vVolumetryLines);
-
- IF vVolumetryLitersMax = 0 OR vVolumetryLinesMax = 0 THEN
-
- LEAVE bucle;
-
- END IF;
-
- IF vTicketLiters > 0 OR vTicketLines > 0 THEN
-
- FETCH cVolumetry INTO vVolumetryLevel, vVolumetryLiters, vVolumetryLines;
-
- ELSE
-
- FETCH cTicket INTO vTicketFk, vTicketLines, vTicketLiters;
- FETCH cVolumetry INTO vVolumetryLevel, vVolumetryLiters, vVolumetryLines;
-
- END IF;
-
- END WHILE;
-
-
- UPDATE vn.collection c
- JOIN vn.state st ON st.code = 'ON_PREPARATION'
- SET c.stateFk = st.id
- WHERE c.id = vCollectionFk;
-
- INSERT IGNORE INTO vn.ticketDown(ticketFk)
- SELECT DISTINCT tc.ticketFk
- FROM vn.ticketCollection tc
- JOIN vncontrol.inter vi ON vi.Id_Ticket = tc.ticketFk
- JOIN vn.state st ON st.id = vi.state_id
- JOIN vn.ticket t ON t.id = tc.ticketFk
- JOIN vn.warehouse w ON w.id = t.warehouseFk
- WHERE tc.collectionFk = vCollectionFk
- AND w.name = 'Silla FV'
- AND st.code = 'PREVIOUS_PREPARATION';
-
-
- SELECT vCollectionFk;
-
- CLOSE cVolumetry;
- CLOSE cTicket;
- DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
-
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -37815,7 +38274,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
-CREATE DEFINER=`root`@`%` PROCEDURE `getItemUbication`(vItemFk INT)
+CREATE DEFINER=`root`@`%` PROCEDURE `getItemUbication`(vItemFk VARCHAR(22))
BEGIN
SELECT vn.barcodeToItem(vItemFk) INTO vItemFk;
@@ -41882,28 +42341,22 @@ DELIMITER ;
/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `itemShelvingMake`(IN `vShelvingFk` VARCHAR(8), IN `vBarcode` VARCHAR(22), IN `vShelve` VARCHAR(2), IN `vDeep` INT, IN `vQuantity` INT, IN `vPackagingFk` VARCHAR(10), IN `vGrouping` INT, IN `vPacking` INT, IN `vWarehouseFk` INT, IN `vLevel` INT)
BEGIN
-
-
DECLARE vItemFk INT;
-
-
-
+
SELECT vn.barcodeToItem(vBarcode) INTO vItemFk;
-
- SELECT itemFk INTO vItemFk
+ /*SELECT itemFk INTO vItemFk
FROM vn.buy b
- WHERE b.id = vItemFk;
-
+ WHERE b.id = vItemFk;*/
IF (SELECT COUNT(*) FROM vn.shelving WHERE code = vShelvingFk COLLATE utf8_unicode_ci) = 0 THEN
@@ -41915,8 +42368,6 @@ BEGIN
END IF;
-
-
IF (SELECT COUNT(*) FROM vn.itemShelving
WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk
AND itemFk = vItemFk
@@ -42474,9 +42925,9 @@ DELIMITER ;
/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
@@ -42497,12 +42948,12 @@ BEGIN
LIMIT 1;
UPDATE vn.itemShelving
- SET quantity = quantity - ( vPacking * vQuantity ),
- visible = visible - ( vPacking * vQuantity ),
- available = available - ( vPacking * vQuantity )
- WHERE shelvingFk = shelvingFkO COLLATE utf8_unicode_ci AND itemFk = vItemFk;
+ SET shelvingFk = shelvingFkD
+ WHERE shelvingFk = shelvingFkO COLLATE utf8_unicode_ci
+ AND itemFk = vItemFk
+ AND visible = ( vPacking * vQuantity );
- CALL vn.itemShelvingMakeFromDate(shelvingFkD,vItemFk,'A',0,( vPacking * vQuantity ),'',0,vPacking,1,1,vDate);
+ /*CALL vn.itemShelvingMakeFromDate(shelvingFkD,vItemFk,'A',0,( vPacking * vQuantity ),'',0,vPacking,1,1,vDate); */
SELECT true;
@@ -43547,9 +43998,25 @@ BEGIN
DECLARE vWorkerIsExcluded BOOLEAN;
DECLARE vFromDated DATE;
DECLARE vToDated DATE DEFAULT TIMESTAMPADD(DAY,1,CURDATE());
-
- SELECT COUNT(*) INTO vWorkerIsExcluded
- FROM bs.manaSpellersExcluded
+ DECLARE vMana INT;
+ DECLARE vAutoMana INT;
+ DECLARE vManaBank INT;
+ DECLARE vManaGreugeType INT;
+
+ SELECT id INTO vMana
+ FROM `component` WHERE code = 'mana';
+
+ SELECT id INTO vAutoMana
+ FROM `component` WHERE code = 'autoMana';
+
+ SELECT id INTO vManaBank
+ FROM `bank` WHERE code = 'mana';
+
+ SELECT id INTO vManaGreugeType
+ FROM `greugeType` WHERE code = 'mana';
+
+ SELECT COUNT(*) INTO vWorkerIsExcluded
+ FROM workerManaExcluded
WHERE workerFk = vWorkerFk;
IF NOT vWorkerIsExcluded THEN
@@ -43557,7 +44024,7 @@ BEGIN
SELECT max(dated) INTO vFromDated
FROM clientManaCache;
- REPLACE bs.workerMana (workerFk, amount)
+ REPLACE workerMana (workerFk, amount)
SELECT vWorkerFk, sum(mana) FROM
(
SELECT s.quantity * sc.value as mana
@@ -43566,28 +44033,22 @@ BEGIN
JOIN client c ON c.id = a.clientFk
JOIN sale s ON s.ticketFk = t.id
JOIN saleComponent sc ON sc.saleFk = s.id
- WHERE c.salesPersonFk = vWorkerFk AND componentFk IN (39, 37) -- maná auto y maná
+ WHERE c.salesPersonFk = vWorkerFk AND sc.componentFk IN (vMana, vAutoMana)
AND t.shipped > vFromDated AND t.shipped < vToDated
-
UNION ALL
-
SELECT - r.amountPaid
FROM receipt r
JOIN client c ON c.id = r.clientFk
- WHERE c.salesPersonFk = vWorkerFk AND bankFk = 66
+ WHERE c.salesPersonFk = vWorkerFk AND bankFk = vManaBank
AND payed > vFromDated
-
UNION ALL
-
SELECT g.amount
FROM greuge g
JOIN client c ON c.id = g.clientFk
- WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = 3 -- Maná
- AND g.shipped > vFromDated and g.shipped < CURDATE()
-
- UNION ALL
-
- SELECT mana
+ WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = vManaGreugeType
+ AND g.shipped > vFromDated and g.shipped < CURDATE()
+ UNION ALL
+ SELECT cc.mana
FROM clientManaCache cc
JOIN client c ON c.id = cc.clientFk
WHERE c.salesPersonFk = vWorkerFk AND cc.dated = vFromDated
@@ -44462,7 +44923,7 @@ BEGIN
WHILE vRow <= vToRow DO
INSERT IGNORE INTO vn.parking(`column`, `row`, sectorFk, `code`, pickingOrder)
- VALUES (vColumn, vRow, vSectorFk, vCode, vColumn )
+ VALUES (vColumn, vRow, vSectorFk, vCode, vColumn * 100 + vRow )
ON DUPLICATE KEY UPDATE `code` = vCode;
SET vRow = vRow + 1;
@@ -44623,7 +45084,6 @@ BEGIN
SELECT 0,999999,0 INTO @sameTicket, @ticket, @litrosTicket;
-
SELECT @litrosTicket := IF(sub.ticketFk = @ticket, @litrosTicket + Litros, Litros) as LitrosTicket,
@sameTicket := IF(sub.ticketFk = @ticket, @sameTicket, IF(@sameTicket, 0 , 1)) as sameTicket,
sub.*,
@@ -44641,7 +45101,7 @@ BEGIN
CAST(isa.physicalVolume * 1000 AS DECIMAL(10,0)) as Litros
FROM vn.itemShelvingAvailable isa
JOIN vn.item i ON i.id = isa.itemFk
- JOIN vn.sector s ON s.id = isa.sectorFk
+ JOIN vn.sector s ON s.id = isa.sectorFk AND s.warehouseFk = isa.warehouseFk
WHERE IF(s.isPreviousPreparedByPacking, (MOD(TRUNCATE(isa.quantity,0), isa.packing)= 0 ), TRUE)
AND isa.isPreviousPreparable = TRUE
AND isa.sectorFk = vSectorFk
@@ -46151,7 +46611,7 @@ DELIMITER ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `shelvingPark`(IN `vShelvingFk` VARCHAR(8), IN `vParkingCode` VARCHAR(8))
-BEGIN
+proc: BEGIN
DECLARE vParkingFk INT DEFAULT 0;
DECLARE idParking INT;
@@ -46162,22 +46622,23 @@ BEGIN
/*ELIMINAR ESPACIOS*/
SET vParkingCode = replace(vParkingCode,' ','') ;
- /*SINO EXISTE EL PARKING LO CREAMOS*/
+ /*SINO EXISTE EL PARKING ABORTAMOS*/
SELECT id INTO idParking
FROM vn.parking
WHERE code = vParkingCode COLLATE utf8_unicode_ci;
-
+
IF idParking IS NULL THEN
- IF LOCATE('-',vParkingCode) = 4 THEN
+
+ LEAVE proc;
+ /*IF LOCATE('-',vParkingCode) = 4 THEN
SELECT SUBSTRING_INDEX(vParkingCode,'-',1) INTO vColumn;
SELECT SUBSTRING_INDEX(vParkingCode,'-',-1) INTO vRow;
INSERT INTO vn.parking(`column`,`row`,code,sectorFk)
VALUES(vColumn,vRow,vParkingCode,1);
END IF;
+ */
END IF;
- /*FIN INSERTAR PARKING*/
-
-
+
SELECT id INTO vParkingFk
FROM vn.parking
WHERE `code` = vParkingCode COLLATE utf8_unicode_ci;
@@ -46321,77 +46782,6 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
-/*!50003 DROP PROCEDURE IF EXISTS `sinComponentes` */;
-/*!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_general_ci */ ;
-/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
-DELIMITER ;;
-CREATE DEFINER=`root`@`%` PROCEDURE `sinComponentes`()
-BEGIN
- DECLARE v_done BOOL DEFAULT FALSE;
- DECLARE vSaleFk INTEGER;
- DECLARE vCur CURSOR FOR
-SELECT s.id
- FROM vn.ticket t
- JOIN vn.client clt ON clt.id = t.clientFk
- JOIN vn.sale s ON s.ticketFk = t.id
- JOIN vn.item i ON i.id = s.itemFk
- JOIN vn.itemType tp ON tp.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = tp.categoryFk
- LEFT JOIN tmp.coste c ON c.id = s.id
- WHERE t.shipped >= '2019-10-01' AND t.shipped <= '2019-10-30'
- AND c.id IS NULL
- AND clt.isActive != 0
- AND ic.merchandise != 0
- GROUP BY s.id;
-
- DECLARE CONTINUE HANDLER FOR NOT FOUND
- SET v_done = TRUE;
-
-DROP TEMPORARY TABLE IF EXISTS tmp.coste;
-
-DROP TEMPORARY TABLE IF EXISTS tmp.coste;
-CREATE TEMPORARY TABLE tmp.coste
- (primary key (id)) ENGINE = MEMORY
- SELECT s.id
- FROM vn.ticket t
- JOIN vn.client clt ON clt.id = t.clientFk
- JOIN vn.sale s ON s.ticketFk = t.id
- JOIN vn.item i ON i.id = s.itemFk
- JOIN vn.itemType tp ON tp.id = i.typeFk
- JOIN vn.itemCategory ic ON ic.id = tp.categoryFk
- 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 AND ct.id = 1
- WHERE t.shipped >= '2019-10-01'
- AND ic.merchandise != 0;
-
-
- OPEN vCur;
-
- l: LOOP
- SET v_done = FALSE;
- FETCH vCur INTO vSaleFk;
-
- IF v_done THEN
- LEAVE l;
- END IF;
-
- CALL vn.ticketCalculateSaleForcePrice2(vSaleFk);
- END LOOP;
-
- CLOSE vCur;
- 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 DROP PROCEDURE IF EXISTS `solunionRiskRequest` */;
ALTER DATABASE `vn` CHARACTER SET utf8 COLLATE utf8_general_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -47455,9 +47845,9 @@ DELIMITER ;
/*!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_general_ci */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
@@ -47478,6 +47868,7 @@ BEGIN
DECLARE vNewInvoiceId INT;
DECLARE vHasDailyInvoice BOOL;
DECLARE vWithPackage BOOL;
+ DECLARE vHasToInvoice BOOL;
DECLARE cur CURSOR FOR
SELECT ticketFk FROM tmp.ticketClosure;
@@ -47511,13 +47902,15 @@ BEGIN
t.companyFk,
t.shipped,
co.hasDailyInvoice,
- w.isManaged
+ w.isManaged,
+ c.hasToInvoice
INTO vClientFk,
vIsTaxDataChecked,
vCompanyFk,
vShipped,
vHasDailyInvoice,
- vWithPackage
+ vWithPackage,
+ vHasToInvoice
FROM ticket t
JOIN `client` c ON c.id = t.clientFk
JOIN province p ON p.id = c.provinceFk
@@ -47543,7 +47936,7 @@ BEGIN
AND getSpecialPrice(e.itemFk, vClientFk) > 0
GROUP BY e.itemFk);
- IF(vHasDailyInvoice) THEN
+ IF(vHasDailyInvoice) AND vHasToInvoice THEN
-- Facturacion rapida
CALL ticketTrackingAdd(vTicketFk, 'DELIVERED', NULL);
@@ -47827,6 +48220,30 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PROCEDURE IF EXISTS `ticketCollection_get` */;
+/*!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_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `ticketCollection_get`(vTicketFk INT)
+BEGIN
+
+ SELECT collectionFk
+ FROM vn.collectionReportSource
+ WHERE ticketFk = vTicketFk
+ GROUP BY collectionFk;
+
+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 DROP PROCEDURE IF EXISTS `ticketComponentCalculate__` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -48526,7 +48943,7 @@ BEGIN
FROM saleComponent sc
JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
JOIN `component` c ON c.id = sc.componentFk
- JOIN componentType ct on ct.id = c.typeFk AND ct.base
+ JOIN componentType ct on ct.id = c.typeFk AND ct.isBase
GROUP BY sc.saleFk) sc ON sc.saleFk = s.id
SET s.priceFixed = sumValue, s.isPriceFixed = 1;
@@ -50433,7 +50850,7 @@ BEGIN
DECLARE vWarehouseFk INT;
DECLARE vCursor CURSOR FOR
SELECT id, landed, addressFk, agencyModeFk, warehouseFk
- FROM vn.ticket WHERE shipped >= '2019-07-01';
+ FROM vn.ticket WHERE shipped BETWEEN '2019-01-01' and '2019-02-01' AND zoneFk is null;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET vDone = 1;
OPEN vCursor;
@@ -50442,7 +50859,7 @@ BEGIN
CALL zoneGetShippedWarehouse(vLanded, vAddressFk, vAgencyModeFk);
UPDATE vn.ticket t
JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = vWarehouseFk
- SET zoneFk = zgs.id
+ SET t.zoneFk = zgs.zoneFk
WHERE t.id = vFechedTicket;
UNTIL vDone END REPEAT;
@@ -50683,6 +51100,76 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PROCEDURE IF EXISTS `ticket_withoutComponents` */;
+/*!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_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `ticket_withoutComponents`(vDatedFrom DATETIME, vDatedTo DATETIME)
+BEGIN
+ DECLARE v_done BOOL DEFAULT FALSE;
+ DECLARE vSaleFk INTEGER;
+ DECLARE vCur CURSOR FOR
+ SELECT s.id
+ FROM vn.ticket t
+ JOIN vn.client clt ON clt.id = t.clientFk
+ JOIN vn.sale s ON s.ticketFk = t.id
+ JOIN vn.item i ON i.id = s.itemFk
+ JOIN vn.itemType tp ON tp.id = i.typeFk
+ JOIN vn.itemCategory ic ON ic.id = tp.categoryFk
+ LEFT JOIN tmp.coste c ON c.id = s.id
+ WHERE t.shipped >= vDatedFrom AND t.shipped <= vDatedTo
+ AND c.id IS NULL
+ AND clt.isActive != 0
+ AND ic.merchandise != 0
+ GROUP BY s.id;
+
+ DECLARE CONTINUE HANDLER FOR NOT FOUND
+ SET v_done = TRUE;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.coste;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.coste;
+ CREATE TEMPORARY TABLE tmp.coste
+ (primary key (id)) ENGINE = MEMORY
+ SELECT s.id
+ FROM vn.ticket t
+ JOIN vn.client clt ON clt.id = t.clientFk
+ JOIN vn.sale s ON s.ticketFk = t.id
+ JOIN vn.item i ON i.id = s.itemFk
+ JOIN vn.itemType tp ON tp.id = i.typeFk
+ JOIN vn.itemCategory ic ON ic.id = tp.categoryFk
+ 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 AND ct.id = 1
+ WHERE t.shipped >= vDatedFrom
+ AND ic.merchandise != 0;
+
+ OPEN vCur;
+
+ l: LOOP
+ SET v_done = FALSE;
+ FETCH vCur INTO vSaleFk;
+
+ IF v_done THEN
+ LEAVE l;
+ END IF;
+
+ CALL vn.ticketCalculateSaleForcePrice2(vSaleFk);
+ END LOOP;
+
+ CLOSE vCur;
+ 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 DROP PROCEDURE IF EXISTS `timeBusiness_calculate` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -50944,9 +51431,9 @@ DELIMITER ;
/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
@@ -50976,10 +51463,14 @@ BEGIN
wtc.userFk,
wtc.timed timed,
direction
- FROM workerTimeControl wtc
- JOIN tmp.`user` w ON w.userFk = wtc.userFk
+ FROM (SELECT wtc.*
+ FROM workerTimeControl wtc
+ JOIN tmp.`user` w ON w.userFk = wtc.userFk
+ WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo
+ ORDER BY userFk, timed ASC
+ ) wtc
WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo
- ORDER BY userFk, timed
+ ORDER BY userFk, timed ASC
) sub
GROUP BY userFk, dated
ORDER BY userFk, dated
@@ -51138,6 +51629,57 @@ BEGIN
DROP TEMPORARY TABLE tmp.`user`;
+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 DROP PROCEDURE IF EXISTS `timeControl_calculate__` */;
+/*!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_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `timeControl_calculate__`(vDatedFrom DATETIME, vDatedTo DATETIME)
+BEGIN
+ SET @vIsOdd := TRUE;
+ SET @vUser := NULL;
+ SET @vDated := NULL;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate;
+
+ CREATE TEMPORARY TABLE tmp.timeControlCalculate
+ SELECT userFk,
+ dated,
+ IF( timeWork >= 18000, @timeWork:=timeWork + 1200, @timeWork:=timeWork) timeWorkSeconds,
+ SEC_TO_TIME(@timeWork ) timeWorkSexagesimal,
+ @timeWork / 3600 timeWorkDecimal
+ FROM (SELECT SUM(timeWork) timeWork,
+ userFk,
+ dated
+ FROM (SELECT IF(@vUser = wtc.userFk, @vUser :=@vUser, @vUser := wtc.userFk ),
+ IF(@vIsOdd, @vIsOdd := FALSE, @vIsOdd := TRUE ),
+ IF(direction='in', @vIsOdd := TRUE, @vIsOdd := @vIsOdd ),
+ IF(@vIsOdd, @vLastTimed:=UNIX_TIMESTAMP(timed),@vLastTimed:=@vLastTimed),
+ IF(@vIsOdd, 0, UNIX_TIMESTAMP(timed)-@vLastTimed) timeWork,
+ IF(direction='in', @vDated := DATE(wtc.timed), @vDated :=@vDated) dated,
+ wtc.userFk,
+ wtc.timed timed,
+ direction
+ FROM (SELECT * FROM workerTimeControl ORDER BY userFk, timed ASC) wtc
+ JOIN tmp.`user` w ON w.userFk = wtc.userFk
+ WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo
+ ORDER BY userFk, timed ASC
+ ) sub
+ GROUP BY userFk, dated
+ ORDER BY userFk, dated
+ )sub2;
+
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -54073,6 +54615,9 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getAvailable`(vAddress INT, vLanded DATE)
BEGIN
+
+/* JGF esta trabajando en este archivo, si se modifica avisadme 2020-02-12*/
+
CALL zone_getFromGeo(address_getGeo(vAddress));
CALL zone_getOptionsForLanding(vLanded);
@@ -54364,14 +54909,86 @@ DELIMITER ;
/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getOptionsForLanding`(vLanded DATE)
BEGIN
+/**
+ * Gets computed options for the passed zones and delivery date.
+ *
+ * @table tmp.zones(id) The zones ids
+ * @param vLanded The delivery date
+ * @return tmp.zoneOption The computed options
+ */
+ DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption;
+ CREATE TEMPORARY TABLE tmp.zoneOption
+ ENGINE = MEMORY
+ SELECT
+ zoneFk,
+ `hour`,
+ travelingDays,
+ price,
+ bonus,
+ TIMESTAMPADD(DAY, -travelingDays, vLanded) shipped
+ FROM (
+ SELECT t.id zoneFk,
+ TIME(IFNULL(e.`hour`, z.`hour`)) `hour`,
+ IFNULL(e.travelingDays, z.travelingDays) travelingDays,
+ IFNULL(e.price, z.price) price,
+ IFNULL(e.bonus, z.bonus) bonus
+ FROM tmp.zone t
+ JOIN zone z ON z.id = t.id
+ JOIN zoneEvent e ON e.zoneFk = t.id
+ WHERE (
+ e.`type` = 'day'
+ AND e.dated = vLanded
+ ) OR (
+ e.`type` != 'day'
+ AND e.weekDays & (1 << WEEKDAY(vLanded))
+ AND (e.`started` IS NULL OR vLanded >= e.`started`)
+ AND (e.`ended` IS NULL OR vLanded <= e.`ended`)
+ )
+ ORDER BY
+ zoneFk,
+ CASE
+ WHEN e.`type` = 'day'
+ THEN 1
+ WHEN e.`type` = 'range'
+ THEN 2
+ ELSE 3
+ END
+ ) t
+ GROUP BY zoneFk;
+
+ DELETE t FROM tmp.zoneOption t
+ JOIN zoneExclusion e
+ ON e.zoneFk = t.zoneFk AND e.`dated` = vLanded;
+
+ DELETE FROM tmp.zoneOption
+ WHERE shipped < CURDATE()
+ OR (shipped = CURDATE() AND CURTIME() > `hour`);
+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 DROP PROCEDURE IF EXISTS `zone_getOptionsForLanding__` */;
+/*!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_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_getOptionsForLanding__`(vLanded DATE)
+BEGIN
/**
* Gets computed options for the passed zones and delivery date.
*
@@ -54438,14 +55055,99 @@ DELIMITER ;
/*!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 = utf8 */ ;
-/*!50003 SET character_set_results = utf8 */ ;
-/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET character_set_client = utf8mb4 */ ;
+/*!50003 SET character_set_results = utf8mb4 */ ;
+/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getOptionsForShipment`(vShipped DATE, vShowExpiredZones BOOLEAN)
BEGIN
+/**
+ * Gets computed options for the passed zones and shipping date.
+ *
+ * @table tmp.zones(id) The zones ids
+ * @param vShipped The shipping date
+ * @return tmp.zoneOption(zoneFk, hour, travelingDays, price, bonus, specificity) The computed options
+ */
+ DECLARE vHour TIME DEFAULT TIME(NOW());
+
+ DROP TEMPORARY TABLE IF EXISTS tLandings;
+ CREATE TEMPORARY TABLE tLandings
+ (INDEX (eventFk))
+ ENGINE = MEMORY
+ SELECT e.id eventFk,
+ @travelingDays := IFNULL(e.travelingDays, z.travelingDays) travelingDays,
+ TIMESTAMPADD(DAY, @travelingDays, vShipped) landed
+ FROM tmp.zone t
+ JOIN zone z ON z.id = t.id
+ JOIN zoneEvent e ON e.zoneFk = t.id;
+
+ DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption;
+ CREATE TEMPORARY TABLE tmp.zoneOption
+ ENGINE = MEMORY
+ SELECT *
+ FROM (
+ SELECT t.id zoneFk,
+ TIME(IFNULL(e.`hour`, z.`hour`)) `hour`,
+ l.travelingDays,
+ IFNULL(e.price, z.price) price,
+ IFNULL(e.bonus, z.bonus) bonus,
+ l.landed
+ FROM tmp.zone t
+ JOIN zone z ON z.id = t.id
+ JOIN zoneEvent e ON e.zoneFk = t.id
+ JOIN tLandings l ON l.eventFk = e.id
+ WHERE (
+ e.`type` = 'day'
+ AND e.`dated` = l.landed
+ ) OR (
+ e.`type` != 'day'
+ AND e.weekDays & (1 << WEEKDAY(l.landed))
+ AND (e.`started` IS NULL OR l.landed >= e.`started`)
+ AND (e.`ended` IS NULL OR l.landed <= e.`ended`)
+ )
+ ORDER BY
+ zoneFk,
+ CASE
+ WHEN e.`type` = 'day'
+ THEN 1
+ WHEN e.`type` = 'range'
+ THEN 2
+ ELSE 3
+ END
+ ) t
+ GROUP BY zoneFk;
+
+ DROP TEMPORARY TABLE tLandings;
+
+ DELETE t FROM tmp.zoneOption t
+ JOIN zoneExclusion e
+ ON e.zoneFk = t.zoneFk AND e.`dated` = t.landed;
+
+ IF NOT vShowExpiredZones THEN
+ DELETE FROM tmp.zoneOption
+ WHERE vShipped < CURDATE()
+ OR (vShipped = CURDATE() AND CURTIME() > `hour`);
+ 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 DROP PROCEDURE IF EXISTS `zone_getOptionsForShipment__` */;
+/*!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_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
+DELIMITER ;;
+CREATE DEFINER=`root`@`%` PROCEDURE `zone_getOptionsForShipment__`(vShipped DATE, vShowExpiredZones BOOLEAN)
+BEGIN
/**
* Gets computed options for the passed zones and shipping date.
*
@@ -54585,6 +55287,9 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getWarehouse`(vAddress INT, vLanded DATE, vWarehouse INT)
BEGIN
+
+/* JGF esta trabajando en este archivo, si se modifica avisadme 2020-02-12*/
+
/**
* Devuelve el listado de agencias disponibles para la fecha,
* dirección y almacén pasados.
@@ -54735,10 +55440,14 @@ DELIMITER ;;
AFTER INSERT ON `inter`
FOR EACH ROW
BEGIN
+
+
REPLACE vn.ticketLastState(ticketFk, ticketTrackingFk, name)
SELECT NEW.Id_Ticket, NEW.inter_id, `name`
FROM vn.state
WHERE id = NEW.state_id;
+
+
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -56284,25 +56993,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
-/*!50001 VIEW `itemPlacementSupplyList` AS select `ips`.`id` AS `id`,`ips`.`itemFk` AS `itemFk`,`ips`.`quantity` AS `quantity`,`ips`.`priority` AS `priority`,ifnull(`isps`.`created`,`ips`.`created`) AS `created`,`ips`.`userFk` AS `userFk`,`ips`.`repoUserFk` AS `repoUserFk`,(`ips`.`quantity` - sum(ifnull(`isps`.`quantity`,0))) AS `saldo`,concat(`i`.`longName`,' ',`i`.`size`) AS `longName`,`i`.`subName` AS `subName`,`i`.`size` AS `size`,`w`.`code` AS `workerCode`,`rw`.`code` AS `repoCode`,max(`p`.`code`) AS `parking`,`ips`.`sectorFk` AS `sectorFk` from (((((((`itemPlacementSupply` `ips` join `item` `i` on((`i`.`id` = `ips`.`itemFk`))) left join `worker` `w` on((`w`.`userFk` = `ips`.`userFk`))) left join `worker` `rw` on((`rw`.`userFk` = `ips`.`repoUserFk`))) left join `itemShelvingPlacementSupply` `isps` on((`isps`.`itemPlacementSupplyFk` = `ips`.`id`))) left join `itemShelving` `ish` on((`ish`.`id` = `isps`.`itemShelvingFk`))) left join `shelving` `s` on((`ish`.`shelvingFk` = `s`.`code`))) left join `parking` `p` on((`s`.`parkingFk` = `p`.`id`))) where (`ips`.`created` >= curdate()) group by `ips`.`priority`,`ips`.`id`,`p`.`sectorFk` */;
-/*!50001 SET character_set_client = @saved_cs_client */;
-/*!50001 SET character_set_results = @saved_cs_results */;
-/*!50001 SET collation_connection = @saved_col_connection */;
-
---
--- Final view structure for view `itemPlacementSupplyList__`
---
-
-/*!50001 DROP VIEW IF EXISTS `itemPlacementSupplyList__`*/;
-/*!50001 SET @saved_cs_client = @@character_set_client */;
-/*!50001 SET @saved_cs_results = @@character_set_results */;
-/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8 */;
-/*!50001 SET character_set_results = utf8 */;
-/*!50001 SET collation_connection = utf8_general_ci */;
-/*!50001 CREATE ALGORITHM=UNDEFINED */
-/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
-/*!50001 VIEW `itemPlacementSupplyList__` AS select `ips`.`id` AS `id`,`ips`.`itemFk` AS `itemFk`,`ips`.`quantity` AS `quantity`,`ips`.`priority` AS `priority`,`ips`.`created` AS `created`,`ips`.`userFk` AS `userFk`,`ips`.`repoUserFk` AS `repoUserFk`,(`ips`.`quantity` - sum(ifnull(`isps`.`quantity`,0))) AS `saldo`,concat(`i`.`longName`,' ',`i`.`size`) AS `longName`,`i`.`subName` AS `subName`,`i`.`size` AS `size`,`w`.`code` AS `workerCode`,`rw`.`code` AS `repoCode`,max(`p`.`code`) AS `parking`,max(`p`.`sectorFk`) AS `sectorFk` from (((((((`itemPlacementSupply` `ips` join `itemShelving` `ish` on((`ish`.`itemFk` = `ips`.`itemFk`))) join `item` `i` on((`i`.`id` = `ish`.`itemFk`))) left join `worker` `w` on((`w`.`userFk` = `ips`.`userFk`))) left join `worker` `rw` on((`rw`.`userFk` = `ips`.`repoUserFk`))) left join `itemShelvingPlacementSupply` `isps` on((`isps`.`itemPlacementSupplyFk` = `ips`.`id`))) left join `shelving` `s` on((`ish`.`shelvingFk` = `s`.`code`))) left join `parking` `p` on((`s`.`parkingFk` = `p`.`id`))) where (`ips`.`created` >= curdate()) group by `ips`.`priority`,`ips`.`id`,`p`.`sectorFk` */;
+/*!50001 VIEW `itemPlacementSupplyList` AS select `ips`.`id` AS `id`,`ips`.`itemFk` AS `itemFk`,`ips`.`quantity` AS `quantity`,`ips`.`priority` AS `priority`,ifnull(`isps`.`created`,`ips`.`created`) AS `created`,`ips`.`userFk` AS `userFk`,`ips`.`repoUserFk` AS `repoUserFk`,(`ips`.`quantity` - sum(ifnull(`isps`.`quantity`,0))) AS `saldo`,concat(`i`.`longName`,' ',`i`.`size`) AS `longName`,`i`.`subName` AS `subName`,`i`.`size` AS `size`,`w`.`code` AS `workerCode`,`rw`.`code` AS `repoCode`,`ips`.`sectorFk` AS `sectorFk` from ((((`itemPlacementSupply` `ips` join `item` `i` on((`i`.`id` = `ips`.`itemFk`))) left join `worker` `w` on((`w`.`userFk` = `ips`.`userFk`))) left join `worker` `rw` on((`rw`.`userFk` = `ips`.`repoUserFk`))) left join `itemShelvingPlacementSupply` `isps` on((`isps`.`itemPlacementSupplyFk` = `ips`.`id`))) where (`ips`.`created` >= curdate()) group by `ips`.`priority`,`ips`.`id`,`ips`.`sectorFk` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -56338,7 +57029,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
-/*!50001 VIEW `itemShelvingAvailable` AS select `s`.`id` AS `saleFk`,`tst`.`updated` AS `Modificado`,`s`.`ticketFk` AS `ticketFk`,0 AS `isPicked`,`s`.`itemFk` AS `itemFk`,`s`.`quantity` AS `quantity`,`s`.`concept` AS `concept`,`i`.`size` AS `size`,`st`.`name` AS `Estado`,`st`.`sectorProdPriority` AS `sectorProdPriority`,`stock`.`visible` AS `available`,`stock`.`sectorFk` AS `sectorFk`,`stock`.`shelvingFk` AS `matricula`,`stock`.`parkingFk` AS `parking`,`stock`.`itemShelvingFk` AS `itemShelving`,`am`.`name` AS `Agency`,`t`.`shipped` AS `shipped`,`stock`.`grouping` AS `grouping`,`stock`.`packing` AS `packing`,`z`.`hour` AS `hour`,`st`.`isPreviousPreparable` AS `isPreviousPreparable`,`sv`.`physicalVolume` AS `physicalVolume` from (((((((((`vn`.`sale` `s` join `vn`.`ticket` `t` on((`t`.`id` = `s`.`ticketFk`))) join `vn`.`agencyMode` `am` on((`am`.`id` = `t`.`agencyModeFk`))) join `vn`.`ticketStateToday` `tst` on((`tst`.`ticket` = `t`.`id`))) join `vn`.`state` `st` on((`st`.`id` = `tst`.`state`))) join `vn`.`item` `i` on((`i`.`id` = `s`.`itemFk`))) join `vn`.`itemShelvingStock` `stock` on((`stock`.`itemFk` = `i`.`id`))) left join `vn`.`saleTracking` `stk` on((`stk`.`saleFk` = `s`.`id`))) left join `vn`.`zone` `z` on((`z`.`id` = `t`.`zoneFk`))) left join `vn`.`saleVolume` `sv` on((`sv`.`saleFk` = `s`.`id`))) where ((`t`.`shipped` between `util`.`yesterday`() and `util`.`dayend`(curdate())) and isnull(`stk`.`id`) and (`stock`.`visible` > 0) and isnull(`stk`.`saleFk`) and `st`.`sectorProdPriority`) */;
+/*!50001 VIEW `itemShelvingAvailable` AS select `s`.`id` AS `saleFk`,`tst`.`updated` AS `Modificado`,`s`.`ticketFk` AS `ticketFk`,0 AS `isPicked`,`s`.`itemFk` AS `itemFk`,`s`.`quantity` AS `quantity`,`s`.`concept` AS `concept`,`i`.`size` AS `size`,`st`.`name` AS `Estado`,`st`.`sectorProdPriority` AS `sectorProdPriority`,`stock`.`visible` AS `available`,`stock`.`sectorFk` AS `sectorFk`,`stock`.`shelvingFk` AS `matricula`,`stock`.`parkingFk` AS `parking`,`stock`.`itemShelvingFk` AS `itemShelving`,`am`.`name` AS `Agency`,`t`.`shipped` AS `shipped`,`stock`.`grouping` AS `grouping`,`stock`.`packing` AS `packing`,`z`.`hour` AS `hour`,`st`.`isPreviousPreparable` AS `isPreviousPreparable`,`sv`.`physicalVolume` AS `physicalVolume`,`t`.`warehouseFk` AS `warehouseFk` from (((((((((`vn`.`sale` `s` join `vn`.`ticket` `t` on((`t`.`id` = `s`.`ticketFk`))) join `vn`.`agencyMode` `am` on((`am`.`id` = `t`.`agencyModeFk`))) join `vn`.`ticketStateToday` `tst` on((`tst`.`ticket` = `t`.`id`))) join `vn`.`state` `st` on((`st`.`id` = `tst`.`state`))) join `vn`.`item` `i` on((`i`.`id` = `s`.`itemFk`))) join `vn`.`itemShelvingStock` `stock` on((`stock`.`itemFk` = `i`.`id`))) left join `vn`.`saleTracking` `stk` on((`stk`.`saleFk` = `s`.`id`))) left join `vn`.`zone` `z` on((`z`.`id` = `t`.`zoneFk`))) left join `vn`.`saleVolume` `sv` on((`sv`.`saleFk` = `s`.`id`))) where ((`t`.`shipped` between `util`.`yesterday`() and `util`.`dayend`(curdate())) and isnull(`stk`.`id`) and (`stock`.`visible` > 0) and isnull(`stk`.`saleFk`) and `st`.`sectorProdPriority`) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -56531,12 +57222,12 @@ USE `vn`;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8 */;
-/*!50001 SET character_set_results = utf8 */;
-/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 SET character_set_client = utf8mb4 */;
+/*!50001 SET character_set_results = utf8mb4 */;
+/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
-/*!50001 VIEW `lastTopClaims` AS select `s`.`itemFk` AS `itemFk`,`i`.`longName` AS `itemName`,`it`.`name` AS `itemTypeName`,count(0) AS `claimsNumber`,round(sum(((((`cb`.`quantity` * `s`.`price`) * (1 - ((`c`.`responsibility` - 1) / 4))) * (100 - `s`.`discount`)) / 100)),2) AS `claimedAmount`,round(sum((((`cb`.`quantity` * `s`.`price`) * (100 - `s`.`discount`)) / 100)),2) AS `totalAmount` from ((((`claim` `c` join `claimBeginning` `cb` on((`cb`.`claimFk` = `c`.`id`))) join `sale` `s` on((`s`.`id` = `cb`.`saleFk`))) join `item` `i` on((`i`.`id` = `s`.`itemFk`))) join `itemType` `it` on((`it`.`id` = `i`.`typeFk`))) where (`c`.`created` >= (curdate() + interval -(1) week)) group by `s`.`itemFk` having (((`claimedAmount` > 100) and (`claimsNumber` > 2)) or (`claimsNumber` > 4)) order by `claimedAmount` desc */;
+/*!50001 VIEW `lastTopClaims` AS select `s`.`itemFk` AS `itemFk`,`i`.`longName` AS `itemName`,`it`.`name` AS `itemTypeName`,count(0) AS `claimsNumber`,round(sum(((((`cb`.`quantity` * `s`.`price`) * (1 - ((`c`.`responsibility` - 1) / 4))) * (100 - `s`.`discount`)) / 100)),2) AS `claimedAmount`,round(sum((((`cb`.`quantity` * `s`.`price`) * (100 - `s`.`discount`)) / 100)),2) AS `totalAmount` from ((((`claim` `c` join `claimBeginning` `cb` on((`cb`.`claimFk` = `c`.`id`))) join `sale` `s` on((`s`.`id` = `cb`.`saleFk`))) join `item` `i` on((`i`.`id` = `s`.`itemFk`))) join `itemType` `it` on((`it`.`id` = `i`.`typeFk`))) where (`c`.`created` >= (curdate() + interval -(1) week)) group by `s`.`itemFk` having (((`claimedAmount` > 100) and (`claimsNumber` > 2)) or (`claimsNumber` > 4)) order by `claimsNumber` desc */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -56974,19 +57665,19 @@ USE `vn`;
/*!50001 SET collation_connection = @saved_col_connection */;
--
--- Final view structure for view `workerTimeControl_Journey`
+-- Final view structure for view `workerTimeControl_Journey__`
--
-/*!50001 DROP VIEW IF EXISTS `workerTimeControl_Journey`*/;
+/*!50001 DROP VIEW IF EXISTS `workerTimeControl_Journey__`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
-/*!50001 SET character_set_client = utf8 */;
-/*!50001 SET character_set_results = utf8 */;
-/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 SET character_set_client = utf8mb4 */;
+/*!50001 SET character_set_results = utf8mb4 */;
+/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
-/*!50001 VIEW `workerTimeControl_Journey` AS select `wtc`.`userFk` AS `userFk`,cast(`wtc`.`timed` as date) AS `dated`,cast(sum((if((`wtc`.`order` % 2),-(1),1) * (hour(`wtc`.`timed`) + (minute(`wtc`.`timed`) / 60)))) as decimal(10,2)) AS `Journey`,dayname(`wtc`.`timed`) AS `dayName`,`w`.`lastName` AS `name`,`w`.`firstName` AS `firstname` from (`workerTimeControl` `wtc` join `worker` `w` on((`w`.`userFk` = `wtc`.`userFk`))) group by cast(`wtc`.`timed` as date),`wtc`.`userFk` */;
+/*!50001 VIEW `workerTimeControl_Journey__` AS select `wtc`.`userFk` AS `userFk`,cast(`wtc`.`timed` as date) AS `dated`,cast(sum((if((`wtc`.`order` % 2),-(1),1) * (hour(`wtc`.`timed`) + (minute(`wtc`.`timed`) / 60)))) as decimal(10,2)) AS `Journey`,dayname(`wtc`.`timed`) AS `dayName`,`w`.`lastName` AS `name`,`w`.`firstName` AS `firstname` from (`workerTimeControl` `wtc` join `worker` `w` on((`w`.`userFk` = `wtc`.`userFk`))) group by cast(`wtc`.`timed` as date),`wtc`.`userFk` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
@@ -57024,4 +57715,4 @@ USE `vncontrol`;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2020-01-24 12:08:27
+-- Dump completed on 2020-02-13 9:07:01
diff --git a/db/tests/vn/ticket_recalcComponents.spec.js b/db/tests/vn/ticket_recalcComponents.spec.js
new file mode 100644
index 000000000..e140db34c
--- /dev/null
+++ b/db/tests/vn/ticket_recalcComponents.spec.js
@@ -0,0 +1,62 @@
+const app = require('vn-loopback/server/server');
+const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
+
+describe('ticket_recalcComponents()', () => {
+ it('should recalculate the components in a ticket and check it', async() => {
+ let stmts = [];
+ let stmt;
+ const ticketId = 11;
+
+ stmts.push('START TRANSACTION');
+
+ let sales = await app.models.Sale.find({where: {ticketFk: ticketId}});
+
+ stmt = new ParameterizedSQL('UPDATE vn.sale SET price=100 WHERE id IN(?,?)', [
+ sales[0].id,
+ sales[1].id
+ ]);
+ stmts.push(stmt);
+
+ stmt = new ParameterizedSQL('SELECT * FROM vn.sale WHERE ticketFk = ?', [
+ ticketId
+ ]);
+ stmts.push(stmt);
+
+ let modifiedSales = stmts.push(stmt) - 1;
+
+ stmt = new ParameterizedSQL('CALL vn.ticket_recalcComponents(?)', [
+ ticketId,
+ ]);
+ stmts.push(stmt);
+
+ stmt = new ParameterizedSQL('SELECT * FROM vn.sale WHERE ticketFk = ?', [
+ ticketId
+ ]);
+ stmts.push(stmt);
+
+ let expectedSales = stmts.push(stmt) - 1;
+
+ stmts.push('ROLLBACK');
+
+ let sql = ParameterizedSQL.join(stmts, ';');
+ let result = await app.models.Ticket.rawStmt(sql);
+
+ // original data
+ const firstPrice = sales[0].price;
+ const secondPrice = sales[1].price;
+
+ // alteratons for test purposes
+ const modifiedFirstPrice = result[modifiedSales][0].price;
+ const modifiedSecondPrice = result[modifiedSales][1].price;
+
+ // expected data after recalc
+ const expectedSalesFirstPrice = result[expectedSales][0].price;
+ const expectedSalesSecondPrice = result[expectedSales][1].price;
+
+ expect(firstPrice).not.toEqual(modifiedFirstPrice);
+ expect(secondPrice).not.toEqual(modifiedSecondPrice);
+
+ expect(firstPrice).toEqual(expectedSalesFirstPrice);
+ expect(secondPrice).toEqual(expectedSalesSecondPrice);
+ });
+});
diff --git a/e2e/dms/ecc/3.jpeg b/e2e/dms/ecc/3.jpeg
new file mode 100644
index 000000000..fb2483f69
Binary files /dev/null and b/e2e/dms/ecc/3.jpeg differ
diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js
index 13ec7099b..816eea064 100644
--- a/e2e/helpers/extensions.js
+++ b/e2e/helpers/extensions.js
@@ -1,4 +1,3 @@
-/* eslint no-invalid-this: "off" */
import {url as defaultURL} from './config';
let actions = {
@@ -13,8 +12,16 @@ let actions = {
return exists;
},
- parsedUrl: async function() {
- return new URL(await this.url());
+ expectURL: async function(expectedHash) {
+ try {
+ await this.waitForFunction(expectedHash => {
+ return document.location.hash.includes(expectedHash);
+ }, {}, expectedHash);
+ } catch (error) {
+ throw new Error(`failed to reach URL containing: ${expectedHash}`);
+ }
+ await this.waitForContentLoaded();
+ return true;
},
waitUntilNotPresent: async function(selector) {
@@ -23,32 +30,18 @@ let actions = {
}, selector);
},
- changeLanguageToEnglish: async function() {
- let langSelector = '.user-popover vn-autocomplete[ng-model="$ctrl.lang"]';
-
- await this.waitToClick('#user');
- await this.wait(langSelector);
- let lang = await this.waitToGetProperty(`${langSelector} input`, 'value');
-
- if (lang !== 'English')
- await this.autocompleteSearch(langSelector, 'English');
-
- await this.keyboard.press('Escape');
- await this.waitForSelector(langSelector, {hidden: true});
- },
-
doLogin: async function(userName, password = 'nightmare') {
- await this.wait(`vn-login [ng-model="$ctrl.user"]`);
- await this.clearInput(`vn-login [ng-model="$ctrl.user"]`);
- await this.write(`vn-login [ng-model="$ctrl.user"]`, userName);
- await this.clearInput(`vn-login [ng-model="$ctrl.password"]`);
- await this.write(`vn-login [ng-model="$ctrl.password"]`, password);
- await this.click('vn-login button[type=submit]');
+ await this.waitForSelector(`vn-login vn-textfield[ng-model="$ctrl.user"]`, {visible: true});
+ await this.clearInput(`vn-login vn-textfield[ng-model="$ctrl.user"]`);
+ await this.write(`vn-login vn-textfield[ng-model="$ctrl.user"]`, userName);
+ await this.clearInput(`vn-login vn-textfield[ng-model="$ctrl.password"]`);
+ await this.write(`vn-login vn-textfield[ng-model="$ctrl.password"]`, password);
+ await this.waitToClick('vn-login button[type=submit]');
},
login: async function(userName) {
try {
- await this.waitForURL('#!/login');
+ await this.expectURL('#!/login');
} catch (e) {
await this.goto(`${defaultURL}/#!/login`);
let dialog = await this.evaluate(() => {
@@ -59,10 +52,9 @@ let actions = {
}
await this.doLogin(userName);
- await this.wait(() => {
+ await this.waitForFunction(() => {
return document.location.hash === '#!/';
}, {});
- await this.changeLanguageToEnglish();
},
selectModule: async function(moduleName) {
@@ -72,7 +64,7 @@ let actions = {
let selector = `vn-home a[ui-sref="${moduleName}.index"]`;
await this.waitToClick(selector);
- await this.waitForURL(snakeName);
+ await this.expectURL(snakeName);
},
loginAndModule: async function(userName, moduleName) {
@@ -104,14 +96,14 @@ let actions = {
},
clearTextarea: async function(selector) {
- await this.wait(selector);
+ await this.waitForSelector(selector, {visible: true});
await this.evaluate(inputSelector => {
- return document.querySelector(inputSelector).value = '';
+ return document.querySelector(`${inputSelector} textarea`).value = '';
}, selector);
},
clearInput: async function(selector) {
- await this.wait(selector);
+ await this.waitForSelector(selector, {visible: true});
let field = await this.evaluate(selector => {
return document.querySelector(`${selector} input`).closest('.vn-field').$ctrl.field;
}, selector);
@@ -136,43 +128,55 @@ let actions = {
},
waitPropertyLength: async function(selector, property, minLength) {
- await this.wait((selector, property, minLength) => {
+ await this.waitForFunction((selector, property, minLength) => {
const element = document.querySelector(selector);
return element && element[property] != null && element[property] !== '' && element[property].length >= minLength;
}, {}, selector, property, minLength);
return await this.getProperty(selector, property);
},
- waitPropertyValue: async function(selector, property, status) {
- await this.waitForSelector(selector);
- return await this.waitForFunction((selector, property, status) => {
- const element = document.querySelector(selector);
- return element[property] === status;
- }, {}, selector, property, status);
+ expectPropertyValue: async function(selector, property, value) {
+ let builtSelector = selector;
+ if (property != 'innerText')
+ builtSelector = await this.selectorFormater(selector);
+
+ try {
+ return await this.waitForFunction((selector, property, value) => {
+ const element = document.querySelector(selector);
+ return element[property] == value;
+ }, {}, builtSelector, property, value);
+ } catch (error) {
+ throw new Error(`${value} wasn't the value of ${builtSelector}, ${error}`);
+ }
},
waitToGetProperty: async function(selector, property) {
+ let builtSelector = selector;
+ if (selector.includes('vn-input-file') || property != 'innerText')
+ builtSelector = await this.selectorFormater(selector);
+
try {
await this.waitForFunction((selector, property) => {
const element = document.querySelector(selector);
return element && element[property] != null && element[property] !== '';
- }, {}, selector, property);
- return await this.getProperty(selector, property);
+ }, {}, builtSelector, property);
+ return await this.getProperty(builtSelector, property);
} catch (error) {
- throw new Error(`couldn't get property: ${property} of ${selector}`);
+ throw new Error(`couldn't get property: ${property} of ${builtSelector}, ${error}`);
}
},
write: async function(selector, text) {
+ let builtSelector = await this.selectorFormater(selector);
await this.waitForSelector(selector, {});
- await this.type(`${selector} input`, text);
- await this.waitForTextInInput(selector, text);
+ await this.type(builtSelector, text);
+ await this.waitForTextInField(selector, text);
},
waitToClick: async function(selector) {
await this.waitForSelector(selector, {});
- await this.click(selector, {waitUntil: 'domcontentloaded'});
+ await this.click(selector);
},
focusElement: async function(selector) {
@@ -253,7 +257,7 @@ let actions = {
waitForNumberOfElements: async function(selector, count) {
return await this.waitForFunction((selector, count) => {
- return document.querySelectorAll(selector).length === count;
+ return document.querySelectorAll(selector).length == count;
}, {}, selector, count);
},
@@ -274,17 +278,36 @@ let actions = {
},
waitForTextInElement: async function(selector, text) {
- await this.wait(selector);
- return await this.wait((selector, text) => {
+ await this.waitForSelector(selector);
+ return await this.waitForFunction((selector, text) => {
return document.querySelector(selector).innerText.toLowerCase().includes(text.toLowerCase());
}, {}, selector, text);
},
- waitForTextInInput: async function(selector, text) {
- await this.wait(selector);
- return await this.wait((selector, text) => {
- return document.querySelector(`${selector} input`).value.toLowerCase().includes(text.toLowerCase());
- }, {}, selector, text);
+ selectorFormater: async function(selector) {
+ let builtSelector = `${selector} input`;
+
+ if (selector.includes('vn-autocomplete'))
+ return builtSelector = `${selector} input`;
+
+ if (selector.includes('vn-textarea'))
+ return builtSelector = `${selector} textarea`;
+
+ if (selector.includes('vn-textfield'))
+ return builtSelector = `${selector} input`;
+
+ if (selector.includes('vn-input-file'))
+ return builtSelector = `${selector} section`;
+
+ return builtSelector;
+ },
+
+ waitForTextInField: async function(selector, text) {
+ let builtSelector = await this.selectorFormater(selector);
+ await this.waitForSelector(builtSelector);
+ return await this.waitForFunction((selector, text) => {
+ return document.querySelector(selector).value.toLowerCase().includes(text.toLowerCase());
+ }, {}, builtSelector, text);
},
waitForInnerText: async function(selector) {
@@ -304,12 +327,6 @@ let actions = {
}, selector);
},
- waitForURL: async function(hashURL) {
- await this.waitForFunction(expectedHash => {
- return document.location.hash.includes(expectedHash);
- }, {}, hashURL);
- },
-
hideSnackbar: async function() {
await this.waitToClick('#shapes .shown button');
},
@@ -326,7 +343,7 @@ let actions = {
},
waitForLastSnackbar: async function() {
- await this.wait(2000); // this needs a refactor to be somehow dynamic ie: page.waitForResponse(urlOrPredicate[, options]) or something to fire waitForLastShape once the request is completed
+ await this.waitFor(1000); // this needs a refactor to be somehow dynamic ie: page.waitForResponse(urlOrPredicate[, options]) or something to fire waitForLastShape once the request is completed
await this.waitForSpinnerLoad();
return await this.waitForLastShape('vn-snackbar .shown .text');
},
@@ -336,14 +353,15 @@ let actions = {
await this.write('vn-searchbar', searchValue);
await this.waitToClick('vn-searchbar vn-icon[icon="search"]');
await this.waitForNumberOfElements('.search-result', 1);
- await this.waitFor(1000);
+ await this.waitForContentLoaded();
await this.evaluate(() => {
return document.querySelector('.search-result').click();
});
+ await this.waitForContentLoaded();
},
accessToSection: async function(sectionRoute) {
- await this.waitForSelector(`vn-left-menu`, {visible: true});
+ await this.waitForSelector('vn-left-menu');
let nested = await this.evaluate(sectionRoute => {
return document.querySelector(`vn-left-menu li li > a[ui-sref="${sectionRoute}"]`) != null;
}, sectionRoute);
@@ -359,18 +377,23 @@ let actions = {
return navButton.click();
}, sectionRoute);
await this.waitForNavigation({waitUntil: ['networkidle0']});
+ await this.waitForContentLoaded();
},
autocompleteSearch: async function(selector, searchValue) {
- try {
- await this.waitToClick(`${selector} input`);
- await this.waitForSelector(selector => {
- document
- .querySelector(`${selector} vn-drop-down`).$ctrl.content
- .querySelectorAll('li');
- }, selector);
+ let builtSelector = await this.selectorFormater(selector);
- await this.write(`.vn-drop-down.shown`, searchValue);
+ await this.waitForContentLoaded();
+ await this.waitToClick(selector);
+ await this.waitForSelector(selector => {
+ document
+ .querySelector(`${selector} vn-drop-down`).$ctrl.content
+ .querySelectorAll('li');
+ }, selector);
+
+ await this.write('.vn-drop-down.vn-popover.vn-popup.shown vn-textfield', searchValue);
+
+ try {
await this.waitForFunction((selector, searchValue) => {
let element = document
.querySelector(`${selector} vn-drop-down`).$ctrl.content
@@ -378,20 +401,24 @@ let actions = {
if (element)
return element.innerText.toLowerCase().includes(searchValue.toLowerCase());
}, {}, selector, searchValue);
-
- await this.keyboard.press('Enter');
- await this.waitForFunction((selector, searchValue) => {
- return document.querySelector(`${selector} input`).value.toLowerCase()
- .includes(searchValue.toLowerCase());
- }, {}, selector, searchValue);
} catch (error) {
- throw new Error(`${selector} failed to autocomplete ${searchValue}! ${error}`);
+ let inputValue = await this.evaluate(() => {
+ return document.querySelector('.vn-drop-down.vn-popover.vn-popup.shown vn-textfield input').value;
+ });
+ throw new Error(`${builtSelector} value is ${inputValue}! ${error}`);
}
+ await this.keyboard.press('Enter');
+ await this.waitForFunction((selector, searchValue) => {
+ return document.querySelector(selector).value.toLowerCase()
+ .includes(searchValue.toLowerCase());
+ }, {}, builtSelector, searchValue);
+
await this.waitForMutation(`.vn-drop-down`, 'childList');
+ await this.waitForContentLoaded();
},
reloadSection: async function(sectionRoute) {
- await this.waitFor(1000);
+ await this.waitForContentLoaded();
await Promise.all([
this.waitForNavigation({waitUntil: 'networkidle0'}),
this.click('vn-icon[icon="desktop_windows"]', {}),
@@ -401,6 +428,7 @@ let actions = {
this.waitForNavigation({waitUntil: 'networkidle0'}),
this.click(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`, {}),
]);
+ await this.waitForContentLoaded();
},
forceReloadSection: async function(sectionRoute) {
@@ -426,7 +454,7 @@ let actions = {
},
isDisabled: async function(selector) {
- await this.wait(selector);
+ await this.waitForSelector(selector);
return await this.evaluate(selector => {
let element = document.querySelector(selector);
return element.$ctrl.disabled;
@@ -490,6 +518,13 @@ let actions = {
}, selector);
},
+ closePopup: async function(selector) {
+ await Promise.all([
+ this.keyboard.press('Escape'),
+ this.waitForSelector('.vn-popup', {hidden: true}),
+ ]);
+ },
+
waitForContentLoaded: async function() {
await this.waitFor(1000);
// to be implemented in base of a directive loaded once al modules are done loading, further investigation required.
diff --git a/e2e/helpers/puppeteer.js b/e2e/helpers/puppeteer.js
index 01496be20..ed05909d0 100644
--- a/e2e/helpers/puppeteer.js
+++ b/e2e/helpers/puppeteer.js
@@ -4,16 +4,29 @@ import {extendPage} from './extensions';
import {url as defaultURL} from './config';
export async function getBrowser() {
+ let headless = !process.env.E2E_SHOW;
const browser = await Puppeteer.launch({
args: [
'--no-sandbox',
`--window-size=${ 1920 },${ 1080 }`
],
defaultViewport: null,
- headless: false,
+ headless: headless,
slowMo: 0, // slow down by ms
});
let page = (await browser.pages())[0];
+ await page.evaluateOnNewDocument(() => {
+ Object.defineProperty(navigator, 'language', {
+ get: function() {
+ return 'en';
+ }
+ });
+ Object.defineProperty(navigator, 'languages', {
+ get: function() {
+ return ['en'];
+ }
+ });
+ });
page = extendPage(page);
page.setDefaultTimeout(5000);
await page.goto(defaultURL, {waitUntil: 'networkidle0'});
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 95f7610ba..bbf3d0452 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -21,25 +21,36 @@ export default {
acceptButton: '.vn-confirm.shown button[response=accept]'
},
clientsIndex: {
- searchClientInput: 'vn-topbar',
+ topbarSearch: 'vn-topbar',
searchButton: 'vn-searchbar vn-icon[icon="search"]',
searchResult: 'vn-client-index .vn-item',
createClientButton: `vn-float-button`,
othersButton: 'vn-left-menu li[name="Others"] > a'
},
+ clientSummary: {
+ header: 'vn-client-summary > vn-card > h5',
+ email: 'vn-client-summary vn-label-value[label="Email"]',
+ street: 'vn-client-summary vn-label-value[label="Street"]',
+ verifiedData: 'vn-client-summary > vn-card > vn-horizontal vn-check[ng-model="$ctrl.summary.isTaxDataChecked"]',
+ payMethod: 'vn-client-summary vn-label-value[label="Pay method"]',
+ defaultAdressName: 'vn-client-summary vn-label-value[label="Name"]',
+ userName: 'vn-client-summary vn-label-value[label="User"]',
+ rate: 'vn-client-summary vn-label-value[label="Rate"]',
+ credit: 'vn-client-summary vn-label-value[label="Credit"]',
+ },
createClientView: {
- name: `vn-client-create [ng-model="$ctrl.client.name"]`,
- taxNumber: 'vn-client-create [ng-model="$ctrl.client.fi"]',
- socialName: 'vn-client-create [ng-model="$ctrl.client.socialName"]',
- street: 'vn-client-create [ng-model="$ctrl.client.street"]',
- postcode: 'vn-client-create [ng-model="$ctrl.client.postcode"]',
- city: 'vn-client-create [ng-model="$ctrl.client.city"]',
- province: `vn-autocomplete[ng-model="$ctrl.client.provinceFk"]`,
- country: `vn-autocomplete[ng-model="$ctrl.client.countryFk"]`,
- userName: 'vn-client-create [ng-model="$ctrl.client.userName"]',
- email: 'vn-client-create [ng-model="$ctrl.client.email"]',
- salesPersonAutocomplete: `vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]`,
- createButton: `button[type=submit]`,
+ name: 'vn-client-create vn-textfield[ng-model="$ctrl.client.name"]',
+ taxNumber: 'vn-client-create vn-textfield[ng-model="$ctrl.client.fi"]',
+ socialName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.socialName"]',
+ street: 'vn-client-create vn-textfield[ng-model="$ctrl.client.street"]',
+ postcode: 'vn-client-create vn-textfield[ng-model="$ctrl.client.postcode"]',
+ city: 'vn-client-create vn-textfield[ng-model="$ctrl.client.city"]',
+ province: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
+ country: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
+ userName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.userName"]',
+ email: 'vn-client-create vn-textfield[ng-model="$ctrl.client.email"]',
+ salesPerson: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
+ createButton: 'vn-client-create button[type=submit]',
cancelButton: 'vn-button[href="#!/client/index"]'
},
clientDescriptor: {
@@ -48,77 +59,78 @@ export default {
},
clientBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]',
- nameInput: 'vn-client-basic-data [ng-model="$ctrl.client.name"]',
- contactInput: 'vn-client-basic-data [ng-model="$ctrl.client.contact"]',
- phoneInput: 'vn-client-basic-data [ng-model="$ctrl.client.phone"]',
- mobileInput: 'vn-client-basic-data [ng-model="$ctrl.client.mobile"]',
- emailInput: 'vn-client-basic-data [ng-model="$ctrl.client.email"]',
- salesPersonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
- channelAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
- saveButton: `button[type=submit]`
+ name: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.name"]',
+ contact: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.contact"]',
+ email: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.email"]',
+ phone: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.phone"]',
+ mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]',
+ salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
+ channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
+ saveButton: 'vn-client-basic-data button[type=submit]'
},
clientFiscalData: {
fiscalDataButton: 'vn-left-menu a[ui-sref="client.card.fiscalData"]',
- socialNameInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.socialName"]',
- fiscalIdInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.fi"]',
- equalizationTaxCheckbox: 'vn-check[ng-model="$ctrl.client.isEqualizated"]',
+ socialName: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.socialName"]',
+ fiscalId: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.fi"]',
+ equalizationTaxCheckbox: 'vn-client-fiscal-data vn-check[ng-model="$ctrl.client.isEqualizated"]',
acceptPropagationButton: '.vn-confirm.shown button[response=accept]',
- addressInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.street"]',
- postcodeInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.postcode"]',
- cityInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.city"]',
- provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
- countryAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
- activeCheckbox: 'vn-check[label="Active"]',
- frozenCheckbox: 'vn-check[label="Frozen"]',
- invoiceByAddressCheckbox: 'vn-check[label="Invoice by address"]',
- verifiedDataCheckbox: 'vn-check[label="Verified data"]',
- hasToInvoiceCheckbox: 'vn-check[label="Has to invoice"]',
- invoiceByMailCheckbox: 'vn-check[label="Invoice by mail"]',
- viesCheckbox: 'vn-check[label="Vies"]',
- saveButton: `button[type=submit]`,
+ address: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.street"]',
+ postcode: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.postcode"]',
+ city: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.city"]',
+ province: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
+ country: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
+ activeCheckbox: 'vn-client-fiscal-data vn-check[label="Active"]',
+ frozenCheckbox: 'vn-client-fiscal-data vn-check[label="Frozen"]',
+ invoiceByAddressCheckbox: 'vn-client-fiscal-data vn-check[label="Invoice by address"]',
+ verifiedDataCheckbox: 'vn-client-fiscal-data vn-check[label="Verified data"]',
+ hasToInvoiceCheckbox: 'vn-client-fiscal-data vn-check[label="Has to invoice"]',
+ invoiceByMailCheckbox: 'vn-client-fiscal-data vn-check[label="Invoice by mail"]',
+ viesCheckbox: 'vn-client-fiscal-data vn-check[label="Vies"]',
+ saveButton: 'button[type=submit]',
+ acceptDuplicationButton: '.vn-confirm.shown button[response=accept]',
watcher: 'vn-client-fiscal-data vn-watcher'
},
clientBillingData: {
- payMethodAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
- IBANInput: 'vn-client-billing-data [ng-model="$ctrl.client.iban"]',
- dueDayInput: 'vn-client-billing-data [ng-model="$ctrl.client.dueDay"]',
+ payMethod: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
+ IBAN: 'vn-client-billing-data vn-textfield[ng-model="$ctrl.client.iban"]',
+ dueDay: 'vn-client-billing-data vn-input-number[ng-model="$ctrl.client.dueDay"]',
receivedCoreLCRCheckbox: 'vn-client-billing-data vn-check[label="Received LCR"]',
receivedCoreVNLCheckbox: 'vn-client-billing-data vn-check[label="Received core VNL"]',
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
- swiftBicAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
+ swiftBic: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
clearswiftBicButton: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"] .icons > vn-icon[icon=clear]',
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
- newBankEntityName: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.name"]',
- newBankEntityBIC: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.bic"]',
- newBankEntityCode: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.id"]',
+ newBankEntityName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.name"]',
+ newBankEntityBIC: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.bic"]',
+ newBankEntityCode: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.id"]',
acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]',
- saveButton: `button[type=submit]`,
+ saveButton: 'vn-client-billing-data button[type=submit]',
watcher: 'vn-client-billing-data vn-watcher'
},
clientAddresses: {
addressesButton: 'vn-left-menu a[ui-sref="client.card.address.index"]',
- createAddress: `vn-client-address-index vn-float-button`,
- defaultCheckboxInput: 'vn-check[label="Default"]',
- consigneeInput: '[ng-model="$ctrl.address.nickname"]',
- streetAddressInput: '[ng-model="$ctrl.address.street"]',
- postcodeInput: '[ng-model="$ctrl.address.postalCode"]',
- cityInput: '[ng-model="$ctrl.address.city"]',
- provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.provinceId"]',
- agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeId"]',
- phoneInput: '[ng-model="$ctrl.address.phone"]',
- mobileInput: '[ng-model="$ctrl.address.mobile"]',
+ createAddress: 'vn-client-address-index vn-float-button',
+ defaultCheckbox: 'vn-check[label="Default"]',
+ consignee: 'vn-textfield[ng-model="$ctrl.address.nickname"]',
+ streetAddress: 'vn-textfield[ng-model="$ctrl.address.street"]',
+ postcode: 'vn-textfield[ng-model="$ctrl.address.postalCode"]',
+ city: 'vn-textfield[ng-model="$ctrl.address.city"]',
+ province: 'vn-autocomplete[ng-model="$ctrl.address.provinceId"]',
+ agency: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeId"]',
+ phone: 'vn-textfield[ng-model="$ctrl.address.phone"]',
+ mobileInput: 'vn-textfield[ng-model="$ctrl.address.mobile"]',
defaultAddress: 'vn-client-address-index div:nth-child(1) div[name="street"]',
- incotermsAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.incotermsId"]',
- customsAgentAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.customsAgentId"]',
+ incoterms: 'vn-autocomplete[ng-model="$ctrl.address.incotermsId"]',
+ customsAgent: 'vn-autocomplete[ng-model="$ctrl.address.customsAgentId"]',
secondMakeDefaultStar: 'vn-client-address-index vn-card div:nth-child(2) vn-icon-button[icon="star_border"]',
firstEditAddress: 'vn-client-address-index div:nth-child(1) > a',
secondEditAddress: 'vn-client-address-index div:nth-child(2) > a',
activeCheckbox: 'vn-check[label="Enabled"]',
equalizationTaxCheckbox: 'vn-client-address-edit vn-check[label="Is equalizated"]',
- firstObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) [ng-model="observation.observationTypeFk"]',
- firstObservationDescriptionInput: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) [ng-model="observation.description"]',
- secondObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) [ng-model="observation.observationTypeFk"]',
- secondObservationDescriptionInput: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) [ng-model="observation.description"]',
+ firstObservationType: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) vn-autocomplete[ng-model="observation.observationTypeFk"]',
+ firstObservationDescription: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) vn-textfield[ng-model="observation.description"]',
+ secondObservationType: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) vn-autocomplete[ng-model="observation.observationTypeFk"]',
+ secondObservationDescription: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) vn-textfield[ng-model="observation.description"]',
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
saveButton: 'button[type=submit]',
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
@@ -128,26 +140,26 @@ export default {
clientWebAccess: {
webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]',
enableWebAccessCheckbox: 'vn-check[label="Enable web access"]',
- userNameInput: 'vn-client-web-access [ng-model="$ctrl.account.name"]',
+ userName: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.name"]',
saveButton: 'button[type=submit]'
},
clientNotes: {
addNoteFloatButton: 'vn-float-button',
- noteInput: '[ng-model="$ctrl.note.text"]',
+ note: 'vn-textarea[ng-model="$ctrl.note.text"]',
saveButton: 'button[type=submit]',
firstNoteText: 'vn-client-note .text'
},
clientCredit: {
addCreditFloatButton: 'vn-float-button',
- creditInput: 'vn-client-credit-create [ng-model="$ctrl.client.credit"]',
- saveButton: 'button[type=submit]',
- firstCreditText: 'vn-client-credit-index vn-card vn-table vn-tbody > vn-tr'
+ credit: 'vn-client-credit-create vn-input-number[ng-model="$ctrl.client.credit"]',
+ firstCreditText: 'vn-client-credit-index vn-card vn-table vn-tbody > vn-tr',
+ saveButton: 'button[type=submit]'
},
clientGreuge: {
addGreugeFloatButton: 'vn-float-button',
- amountInput: 'vn-client-greuge-create [ng-model="$ctrl.greuge.amount"]',
- descriptionInput: 'vn-client-greuge-create [ng-model="$ctrl.greuge.description"]',
- typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.greuge.greugeTypeFk"]',
+ amount: 'vn-client-greuge-create vn-input-number[ng-model="$ctrl.greuge.amount"]',
+ description: 'vn-client-greuge-create vn-textfield[ng-model="$ctrl.greuge.description"]',
+ type: 'vn-autocomplete[ng-model="$ctrl.greuge.greugeTypeFk"]',
saveButton: 'button[type=submit]',
firstGreugeText: 'vn-client-greuge-index vn-card vn-table vn-tbody > vn-tr'
},
@@ -166,10 +178,10 @@ export default {
},
clientBalance: {
balanceButton: 'vn-left-menu a[ui-sref="client.card.balance.index"]',
- companyAutocomplete: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]',
+ company: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]',
newPaymentButton: `vn-float-button`,
newPaymentBank: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.receipt.bankFk"]',
- newPaymentAmountInput: '.vn-dialog.shown [ng-model="$ctrl.receipt.amountPaid"]',
+ newPaymentAmount: '.vn-dialog.shown vn-input-number[ng-model="$ctrl.receipt.amountPaid"]',
saveButton: '.vn-dialog.shown vn-button[label="Save"]',
firstBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)'
@@ -184,6 +196,13 @@ export default {
firstDocWorkerDescriptor: '.vn-popover.shown vn-worker-descriptor',
acceptDeleteButton: '.vn-confirm.shown button[response="accept"]'
},
+ clientContacts: {
+ addContactButton: 'vn-client-contact vn-icon[icon="add_circle"]',
+ name: 'vn-client-contact vn-textfield[ng-model="contact.name"]',
+ phone: 'vn-client-contact vn-textfield[ng-model="contact.phone"]',
+ deleteFirstPhone: 'vn-client-contact vn-icon[icon="delete"]',
+ saveButton: 'button[type=submit]'
+ },
itemsIndex: {
searchIcon: 'vn-searchbar vn-icon[icon="search"]',
createItemButton: `vn-float-button`,
@@ -191,7 +210,7 @@ export default {
searchResultPreviewButton: 'vn-item-index .buttons > [icon="desktop_windows"]',
searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]',
acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]',
- searchItemInput: 'vn-searchbar',
+ topbarSearch: 'vn-topbar',
searchButton: 'vn-searchbar vn-icon[icon="search"]',
closeItemSummaryPreview: '.vn-popup.shown',
fieldsToShowButton: 'vn-item-index vn-table > div > div > vn-icon-button[icon="menu"]',
@@ -213,10 +232,10 @@ export default {
saveFieldsButton: '.vn-dialog.shown vn-horizontal:nth-child(16) > vn-button > button'
},
itemCreateView: {
- temporalName: 'vn-item-create [ng-model="$ctrl.item.provisionalName"]',
- typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
- intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
- originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
+ temporalName: 'vn-item-create vn-textfield[ng-model="$ctrl.item.provisionalName"]',
+ type: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
+ intrastat: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
+ origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
createButton: 'button[type=submit]',
cancelButton: 'vn-button[ui-sref="item.index"]'
},
@@ -224,8 +243,8 @@ export default {
goBackToModuleIndexButton: 'vn-item-descriptor a[href="#!/item/index"]',
moreMenu: 'vn-item-descriptor vn-icon-menu[icon=more_vert]',
moreMenuRegularizeButton: '.vn-drop-down.shown li[name="Regularize stock"]',
- regularizeQuantityInput: '.vn-dialog.shown [ng-model="$ctrl.quantity"]',
- regularizeWarehouseAutocomplete: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
+ regularizeQuantity: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.quantity"]',
+ regularizeWarehouse: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
editButton: 'vn-item-descriptor vn-float-button[icon="edit"]',
regularizeSaveButton: '.vn-dialog.shown tpl-buttons > button',
inactiveIcon: 'vn-item-descriptor vn-icon[icon="icon-unavailable"]',
@@ -234,64 +253,68 @@ export default {
itemBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="item.card.basicData"]',
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
- typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
- intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
- nameInput: 'vn-item-basic-data [ng-model="$ctrl.item.name"]',
- relevancyInput: 'vn-item-basic-data [ng-model="$ctrl.item.relevancy"]',
- originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
- expenseAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.expenseFk"]',
- longNameInput: 'vn-textfield[ng-model="$ctrl.item.longName"]',
+ type: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
+ intrastat: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
+ name: 'vn-item-basic-data vn-textfield[ng-model="$ctrl.item.name"]',
+ relevancy: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.relevancy"]',
+ origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
+ expense: 'vn-autocomplete[ng-model="$ctrl.item.expenseFk"]',
+ longName: 'vn-textfield[ng-model="$ctrl.item.longName"]',
isActiveCheckbox: 'vn-check[label="Active"]',
priceInKgCheckbox: 'vn-check[label="Price in kg"]',
+ newIntrastatButton: 'vn-item-basic-data vn-icon-button[vn-tooltip="New intrastat"] > button',
+ newIntrastatId: '.vn-dialog.shown vn-input-number[ng-model="$ctrl.newIntrastat.intrastatId"]',
+ newIntrastatDescription: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newIntrastat.description"]',
+ acceptIntrastatButton: '.vn-dialog.shown button[response="accept"]',
submitBasicDataButton: `button[type=submit]`
},
itemTags: {
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
tagsButton: 'vn-left-menu a[ui-sref="item.card.tags"]',
- fourthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]',
- fourthValueInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.value"]',
- fourthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.priority"]',
+ fourthTag: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]',
+ fourthValue: 'vn-item-tags vn-horizontal:nth-child(4) vn-textfield[ng-model="itemTag.value"]',
+ fourthRelevancy: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.priority"]',
fourthRemoveTagButton: 'vn-item-tags vn-horizontal:nth-child(4) vn-icon-button[icon="delete"]',
- fifthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]',
- fifthValueInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.value"]',
- fifthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.priority"]',
- sixthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]',
- sixthValueInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.value"]',
- sixthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.priority"]',
- seventhTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]',
- seventhValueInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.value"]',
- seventhRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.priority"]',
+ fifthTag: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]',
+ fifthValue: 'vn-item-tags vn-horizontal:nth-child(5) vn-textfield[ng-model="itemTag.value"]',
+ fifthRelevancy: 'vn-item-tags vn-horizontal:nth-child(5) vn-input-number[ng-model="itemTag.priority"]',
+ sixthTag: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]',
+ sixthValue: 'vn-item-tags vn-horizontal:nth-child(6) vn-textfield[ng-model="itemTag.value"]',
+ sixthRelevancy: 'vn-item-tags vn-horizontal:nth-child(6) vn-input-number[ng-model="itemTag.priority"]',
+ seventhTag: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]',
+ seventhValue: 'vn-item-tags vn-horizontal:nth-child(7) vn-textfield[ng-model="itemTag.value"]',
+ seventhRelevancy: 'vn-item-tags vn-horizontal:nth-child(7) vn-input-number[ng-model="itemTag.priority"]',
addItemTagButton: 'vn-item-tags vn-icon-button[icon="add_circle"]',
submitItemTagsButton: 'vn-item-tags button[type=submit]'
},
itemTax: {
undoChangesButton: 'vn-item-tax vn-button-bar > vn-button[label="Undo changes"]',
- firstClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[ng-model="tax.taxClassFk"]',
- secondClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="tax.taxClassFk"]',
- thirdClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="tax.taxClassFk"]',
+ firstClass: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[ng-model="tax.taxClassFk"]',
+ secondClass: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="tax.taxClassFk"]',
+ thirdClass: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="tax.taxClassFk"]',
submitTaxButton: 'vn-item-tax button[type=submit]'
},
itemBarcodes: {
addBarcodeButton: 'vn-item-barcode vn-icon[icon="add_circle"]',
- thirdCodeInput: 'vn-item-barcode vn-horizontal:nth-child(3) [ng-model="barcode.code"]',
+ thirdCode: 'vn-item-barcode vn-horizontal:nth-child(3) vn-textfield[ng-model="barcode.code"]',
submitBarcodesButton: 'vn-item-barcode button[type=submit]',
firstCodeRemoveButton: 'vn-item-barcode vn-horizontal vn-none vn-icon[icon="delete"]'
},
itemNiches: {
addNicheButton: 'vn-item-niche vn-icon[icon="add_circle"]',
- firstWarehouseAutocomplete: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]',
- firstCodeInput: 'vn-item-niche vn-horizontal:nth-child(1) [ng-model="niche.code"]',
- secondWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]',
- secondCodeInput: 'vn-item-niche vn-horizontal:nth-child(2) [ng-model="niche.code"]',
+ firstWarehouse: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]',
+ firstCode: 'vn-item-niche vn-horizontal:nth-child(1) vn-textfield[ng-model="niche.code"]',
+ secondWarehouse: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]',
+ secondCode: 'vn-item-niche vn-horizontal:nth-child(2) vn-textfield[ng-model="niche.code"]',
secondNicheRemoveButton: 'vn-item-niche vn-horizontal:nth-child(2) > vn-none > vn-icon-button[icon="delete"]',
- thirdWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]',
- thirdCodeInput: 'vn-item-niche vn-horizontal:nth-child(3) [ng-model="niche.code"]',
+ thirdWarehouse: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]',
+ thirdCode: 'vn-item-niche vn-horizontal:nth-child(3) vn-textfield[ng-model="niche.code"]',
submitNichesButton: 'vn-item-niche button[type=submit]'
},
itemBotanical: {
- botanicalInput: 'vn-item-botanical vn-horizontal:nth-child(1) [ng-model="$ctrl.botanical.botanical"]',
- genusAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]',
- speciesAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]',
+ botanical: 'vn-item-botanical vn-horizontal:nth-child(1) vn-textfield[ng-model="$ctrl.botanical.botanical"]',
+ genus: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]',
+ species: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]',
submitBotanicalButton: `vn-item-botanical button[type=submit]`
},
itemSummary: {
@@ -306,7 +329,7 @@ export default {
secondTicketId: 'vn-item-diary vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > span',
firstBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(1) > vn-td.balance',
fourthBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(4) > vn-td.balance',
- warehouseAutocomplete: 'vn-item-diary vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
+ warehouse: 'vn-item-diary vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
},
itemLog: {
anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr',
@@ -315,7 +338,7 @@ export default {
ticketSummary: {
header: 'vn-ticket-summary > vn-card > h5',
state: 'vn-ticket-summary vn-label-value[label="State"] > section > span',
- route: 'vn-ticket-summary vn-label-value[label="Route"] > section > span > a',
+ route: 'vn-ticket-summary vn-label-value[label="Route"] > section > span > span',
total: 'vn-ticket-summary vn-one.taxes > p:nth-child(3) > strong',
sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr',
firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span',
@@ -330,29 +353,27 @@ export default {
},
ticketsIndex: {
openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]',
- advancedSearchInvoiceOut: 'vn-ticket-search-panel [ng-model="filter.refFk"]',
+ advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[ng-model="filter.refFk"]',
newTicketButton: 'vn-ticket-index > a',
searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr',
searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)',
- searchTicketInput: 'vn-searchbar',
- searchWeeklyClearInput: 'vn-searchbar vn-icon[icon=clear]',
+ topbarSearch: 'vn-searchbar',
advancedSearchButton: 'vn-ticket-search-panel button[type=submit]',
searchButton: 'vn-searchbar vn-icon[icon="search"]',
searchWeeklyButton: 'vn-searchbar vn-icon[icon="search"]',
moreMenu: 'vn-ticket-index vn-icon-menu[icon=more_vert]',
- menuWeeklyTickets: 'vn-left-menu [ui-sref="ticket.weekly.index"]',
sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6)',
weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr',
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
acceptDeleteTurn: '.vn-confirm.shown button[response="accept"]'
},
createTicketView: {
- clientAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.clientId"]',
- addressAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.addressId"]',
- deliveryDateInput: 'vn-ticket-create vn-date-picker[ng-model="$ctrl.landed"]',
- warehouseAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.warehouseId"]',
- agencyAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
+ client: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.clientId"]',
+ address: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.addressId"]',
+ deliveryDate: 'vn-ticket-create vn-date-picker[ng-model="$ctrl.landed"]',
+ warehouse: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.warehouseId"]',
+ agency: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
createButton: `button[type=submit]`
},
ticketDescriptor: {
@@ -367,7 +388,7 @@ export default {
moreMenuMakeInvoice: '.vn-drop-down.shown li[name="Make invoice"]',
moreMenuChangeShippedHour: '.vn-drop-down.shown li[name="Change shipped hour"]',
changeShippedHourDialog: '.vn-dialog.shown',
- changeShippedHourInput: '.vn-dialog.shown [ng-model="$ctrl.newShipped"]',
+ changeShippedHour: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newShipped"]',
addStowawayDialogFirstTicket: '.vn-dialog.shown vn-table vn-tbody vn-tr',
shipButton: 'vn-ticket-descriptor vn-icon[icon="icon-stowaway"]',
thursdayButton: '.vn-popup.shown vn-tool-bar > vn-button:nth-child(4)',
@@ -381,8 +402,8 @@ export default {
ticketNotes: {
firstNoteRemoveButton: 'vn-icon[icon="delete"]',
addNoteButton: 'vn-icon[icon="add_circle"]',
- firstNoteTypeAutocomplete: 'vn-autocomplete[ng-model="observation.observationTypeFk"]',
- firstDescriptionInput: 'vn-ticket-observation [ng-model="observation.description"]',
+ firstNoteType: 'vn-autocomplete[ng-model="observation.observationTypeFk"]',
+ firstDescription: 'vn-ticket-observation vn-textfield[ng-model="observation.description"]',
submitNotesButton: 'button[type=submit]'
},
ticketExpedition: {
@@ -393,8 +414,8 @@ export default {
},
ticketPackages: {
packagesButton: 'vn-left-menu a[ui-sref="ticket.card.package"]',
- firstPackageAutocomplete: 'vn-autocomplete[label="Package"]',
- firstQuantityInput: 'vn-ticket-package vn-horizontal:nth-child(1) [ng-model="package.quantity"]',
+ firstPackage: 'vn-autocomplete[label="Package"]',
+ firstQuantity: 'vn-ticket-package vn-horizontal:nth-child(1) vn-input-number[ng-model="package.quantity"]',
firstRemovePackageButton: 'vn-icon-button[vn-tooltip="Remove package"]',
addPackageButton: 'vn-icon-button[vn-tooltip="Add package"]',
clearPackageAutocompleteButton: 'vn-autocomplete[label="Package"] .icons > vn-icon[icon=clear]',
@@ -461,21 +482,18 @@ export default {
},
ticketTracking: {
trackingButton: 'vn-left-menu a[ui-sref="ticket.card.tracking.index"]',
- createStateButton: `vn-float-button`,
- stateAutocomplete: 'vn-ticket-tracking-edit vn-autocomplete[ng-model="$ctrl.stateFk"]',
- saveButton: `button[type=submit]`,
+ createStateButton: 'vn-float-button',
+ saveButton: 'button[type=submit]',
cancelButton: 'vn-ticket-tracking-edit vn-button[ui-sref="ticket.card.tracking.index"]'
},
ticketBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="ticket.card.basicData.stepOne"]',
- clientAutocomplete: 'vn-autocomplete[ng-model="$ctrl.clientFk"]',
- addressAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.addressFk"]',
- agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
- zoneAutocomplete: 'vn-autocomplete[ng-model="$ctrl.zoneId"]',
+ agency: 'vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
+ zone: 'vn-autocomplete[ng-model="$ctrl.zoneId"]',
nextStepButton: 'vn-step-control .buttons > section:last-child vn-button',
finalizeButton: 'vn-step-control .buttons > section:last-child button[type=submit]',
stepTwoTotalPriceDif: 'vn-ticket-basic-data-step-two vn-tfoot > vn-tr > :nth-child(6)',
- chargesReasonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.option"]',
+ chargesReason: 'vn-ticket-basic-data-step-two div:nth-child(3) > vn-radio',
},
ticketComponents: {
base: 'vn-ticket-components [name="base-sum"]'
@@ -484,9 +502,9 @@ export default {
addRequestButton: 'vn-ticket-request-index > a > vn-float-button > button',
request: 'vn-ticket-request-index vn-table vn-tr',
descriptionInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.description"]',
- atenderAutocomplete: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.attenderFk"]',
- quantityInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.quantity"]',
- priceInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.price"]',
+ atender: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.attenderFk"]',
+ quantity: 'vn-ticket-request-create vn-input-number[ng-model="$ctrl.ticketRequest.quantity"]',
+ price: 'vn-ticket-request-create vn-input-number[ng-model="$ctrl.ticketRequest.price"]',
firstRemoveRequestButton: 'vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)',
saveButton: 'vn-ticket-request-create button[type=submit]',
firstDescription: 'vn-ticket-request-index vn-table vn-tr:nth-child(1) > vn-td:nth-child(2) vn-textfield',
@@ -501,20 +519,20 @@ export default {
ticketService: {
addServiceButton: 'vn-ticket-service vn-icon-button[vn-tooltip="Add service"] > button',
firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]',
- firstServiceTypeAutocomplete: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
- firstQuantityInput: 'vn-ticket-service [ng-model="service.quantity"]',
- firstPriceInput: 'vn-ticket-service [ng-model="service.price"]',
- firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
+ firstServiceType: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
+ firstQuantity: 'vn-ticket-service vn-input-number[ng-model="service.quantity"]',
+ firstPrice: 'vn-ticket-service vn-input-number[ng-model="service.price"]',
+ firstVatType: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
fistDeleteServiceButton: 'vn-ticket-service form vn-horizontal:nth-child(1) vn-icon-button[icon="delete"]',
- newServiceTypeNameInput: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]',
- newServiceTypeExpenseAutocomplete: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.newServiceType.expenseFk"]',
+ newServiceTypeName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]',
+ newServiceTypeExpense: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.newServiceType.expenseFk"]',
serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal',
- saveServiceButton: `button[type=submit]`,
+ saveServiceButton: 'button[type=submit]',
saveServiceTypeButton: '.vn-dialog.shown tpl-buttons > button'
},
createStateView: {
- stateAutocomplete: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
- workerAutocomplete: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
+ state: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
+ worker: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
clearStateInputButton: 'vn-autocomplete[ng-model="$ctrl.stateFk"] .icons > vn-icon[icon=clear]',
saveStateButton: `button[type=submit]`
},
@@ -531,7 +549,7 @@ export default {
claimSummary: {
header: 'vn-claim-summary > vn-card > h5',
state: 'vn-claim-summary vn-label-value[label="State"] > section > span',
- observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"] textarea',
+ observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"]',
firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span',
firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img',
itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
@@ -542,14 +560,14 @@ export default {
firstActionTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor'
},
claimBasicData: {
- claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
+ claimState: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
responsabilityInputRange: 'vn-range',
- observationInput: 'vn-textarea[ng-model="$ctrl.claim.observation"] textarea',
+ observation: 'vn-textarea[ng-model="$ctrl.claim.observation"]',
saveButton: `button[type=submit]`
},
claimDetail: {
secondItemDiscount: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(6) > span',
- discountInput: '.vn-popover.shown [ng-model="$ctrl.newDiscount"]',
+ discount: '.vn-popover.shown vn-input-number[ng-model="$ctrl.newDiscount"]',
discoutPopoverMana: '.vn-popover.shown .content > div > vn-horizontal > h5',
addItemButton: 'vn-claim-detail a vn-float-button',
firstClaimableSaleFromTicket: '.vn-dialog.shown vn-tbody > vn-tr',
@@ -560,16 +578,16 @@ export default {
claimDevelopment: {
addDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > vn-one > vn-icon-button > button > vn-icon',
firstDeleteDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > form > vn-horizontal:nth-child(2) > vn-icon-button > button > vn-icon',
- firstClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
- firstClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
- firstClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
- firstClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
- firstClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
- secondClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
- secondClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
- secondClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
- secondClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
- secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
+ firstClaimReason: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
+ firstClaimResult: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
+ firstClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
+ firstClaimWorker: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
+ firstClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
+ secondClaimReason: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
+ secondClaimResult: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
+ secondClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
+ secondClaimWorker: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
+ secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
saveDevelopmentButton: 'button[type=submit]'
},
claimAction: {
@@ -593,31 +611,29 @@ export default {
acceptNavigationButton: '.vn-confirm.shown button[response=accept]'
},
createOrderView: {
- clientAutocomplete: 'vn-autocomplete[label="Client"]',
- addressAutocomplete: 'vn-autocomplete[label="Address"]',
- agencyAutocomplete: 'vn-autocomplete[label="Agency"]',
+ client: 'vn-autocomplete[label="Client"]',
+ agency: 'vn-autocomplete[label="Agency"]',
landedDatePicker: 'vn-date-picker[label="Landed"]',
createButton: 'button[type=submit]',
cancelButton: 'vn-button[href="#!/client/index"]'
},
orderCatalog: {
- orderByAutocomplete: 'vn-autocomplete[label="Order by"]',
plantRealmButton: 'vn-order-catalog > vn-side-menu vn-icon[icon="icon-plant"]',
- typeAutocomplete: 'vn-autocomplete[data="$ctrl.itemTypes"]',
- itemIdInput: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.itemId"]',
- itemTagValueInput: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.value"]',
- openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-vertical > vn-textfield[ng-model="$ctrl.value"] .append i',
- tagAutocomplete: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]',
- tagValueInput: 'vn-order-catalog-search-panel [ng-model="filter.value"]',
+ type: 'vn-autocomplete[data="$ctrl.itemTypes"]',
+ itemId: 'vn-order-catalog > vn-side-menu vn-textfield[vn-id="itemId"]',
+ itemTagValue: 'vn-order-catalog > vn-side-menu vn-datalist[vn-id="search"]',
+ openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-vertical > vn-datalist[vn-id="search"] .append i',
+ tag: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]',
+ tagValue: 'vn-order-catalog-search-panel vn-textfield[ng-model="filter.value"]',
searchTagButton: 'vn-order-catalog-search-panel button[type=submit]',
thirdFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(3) vn-icon[icon=cancel]',
fourthFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(4) vn-icon[icon=cancel]',
},
orderBasicData: {
- clientAutocomplete: 'vn-autocomplete[label="Client"]',
- addressAutocomplete: 'vn-autocomplete[label="Address"]',
- agencyAutocomplete: 'vn-autocomplete[label="Agency"]',
- observationInput: 'vn-textarea[label="Observation"] textarea',
+ client: 'vn-autocomplete[label="Client"]',
+ address: 'vn-autocomplete[label="Address"]',
+ agency: 'vn-autocomplete[label="Agency"]',
+ observation: 'vn-textarea[label="Observation"]',
saveButton: `button[type=submit]`,
acceptButton: '.vn-confirm.shown button[response="accept"]'
},
@@ -631,28 +647,33 @@ export default {
addNewRouteButton: 'vn-route-index > a[ui-sref="route.create"]'
},
createRouteView: {
- workerAutocomplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
+ worker: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]',
- vehicleAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
- agencyAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
- descriptionInput: 'vn-route-create [ng-model="$ctrl.route.description"]',
+ vehicleAuto: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
+ agency: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
+ description: 'vn-route-create [ng-model="$ctrl.route.description"]',
submitButton: 'vn-route-create button[type=submit]'
},
routeDescriptor: {
volume: 'vn-route-descriptor vn-label-value[label="Volume"] > section > span'
},
routeSummary: {
- routeId: 'vn-route-summary > vn-card > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span'
+ header: 'vn-route-summary > vn-card > h5',
+ routeId: 'vn-route-summary > vn-card > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span',
+ cost: 'vn-route-summary vn-label-value[label="Cost"]',
+ firstTicketID: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2) > span',
+ firstTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor',
+ firstAlias: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(3) > span',
+ firstClientDescriptor: '.vn-popover.shown vn-client-descriptor',
},
routeBasicData: {
- workerAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
- vehicleAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
- agencyAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
- kmStartInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmStart"]',
- kmEndInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmEnd"]',
- createdDateInput: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]',
- startedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.started"]',
- finishedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.finished"]',
+ worker: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
+ vehicle: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
+ kmStart: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmStart"]',
+ kmEnd: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmEnd"]',
+ createdDate: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]',
+ startedHour: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.started"]',
+ finishedHour: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.finished"]',
saveButton: 'vn-route-basic-data button[type=submit]'
},
routeTickets: {
@@ -666,12 +687,18 @@ export default {
firstTicketDeleteButton: 'vn-route-tickets vn-tr:nth-child(1) vn-icon[icon="delete"]',
confirmButton: '.vn-confirm.shown button[response="accept"]'
},
+ workerBasicData: {
+ name: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.firstName"]',
+ surname: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.lastName"]',
+ phone: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.phone"]',
+ saveButton: 'vn-worker-basic-data button[type=submit]'
+ },
workerPbx: {
- extensionInput: 'vn-worker-pbx [ng-model="$ctrl.worker.sip.extension"]',
+ extension: 'vn-worker-pbx vn-textfield[ng-model="$ctrl.worker.sip.extension"]',
saveButton: 'vn-worker-pbx button[type=submit]'
},
workerTimeControl: {
- timeDialogInput: '.vn-dialog.shown [ng-model="$ctrl.newTime"]',
+ timeDialog: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newTime"]',
mondayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(1) > vn-icon-button',
tuesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(2) > vn-icon-button',
wednesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(3) > vn-icon-button',
@@ -723,7 +750,7 @@ export default {
acceptDeleteDialog: '.vn-confirm.shown button[response="accept"]'
},
invoiceOutIndex: {
- searchInvoiceOutInput: 'vn-searchbar',
+ topbarSearch: 'vn-searchbar',
searchButton: 'vn-searchbar vn-icon[icon="search"]',
searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
},
@@ -736,6 +763,30 @@ export default {
acceptBookingButton: '.vn-confirm.shown button[response="accept"]'
},
invoiceOutSummary: {
- bookedLabel: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-one > vn-label-value:nth-child(4) > section > span'
+ bookedLabel: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-one > vn-label-value:nth-child(4) > section > span',
+ company: 'vn-invoice-out-summary vn-label-value[label="Company"]',
+ taxOne: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-two > vn-table > div > vn-tbody > vn-tr:nth-child(1)',
+ taxTwo: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-two > vn-table > div > vn-tbody > vn-tr:nth-child(2)',
+ ticketOne: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-auto > vn-table > div > vn-tbody > vn-tr:nth-child(1)',
+ ticketTwo: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-auto > vn-table > div > vn-tbody > vn-tr:nth-child(2)'
+ },
+ travelThermograph: {
+ add: 'vn-travel-thermograph-index vn-float-button[icon="add"]',
+ thermographID: 'vn-travel-thermograph-create vn-autocomplete[ng-model="$ctrl.dms.thermographId"]',
+ uploadIcon: 'vn-travel-thermograph-create vn-icon[icon="cloud_upload"]',
+ createdThermograph: 'vn-travel-thermograph-index vn-tbody > vn-tr',
+ upload: 'vn-travel-thermograph-create button[type=submit]'
+ },
+ agencyBasicData: {
+ name: 'vn-zone-basic-data vn-textfield[ng-model="$ctrl.zone.name"]',
+ agency: 'vn-zone-basic-data vn-autocomplete[ng-model="$ctrl.zone.agencyModeFk"]',
+ maxVolume: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.m3Max"]',
+ travelingDays: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.travelingDays"]',
+ closing: 'vn-zone-basic-data vn-input-time[ng-model="$ctrl.zone.hour"]',
+ price: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.price"]',
+ bonus: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.bonus"]',
+ inflation: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.inflation"]',
+ volumetric: 'vn-zone-basic-data vn-check[ng-model="$ctrl.zone.isVolumetric"]',
+ saveButton: 'vn-zone-basic-data vn-submit > button',
}
};
diff --git a/e2e/paths/01-login/01_login.spec.js b/e2e/paths/01-login/01_login.spec.js
index ff9752b2b..abb022011 100644
--- a/e2e/paths/01-login/01_login.spec.js
+++ b/e2e/paths/01-login/01_login.spec.js
@@ -36,8 +36,8 @@ describe('Login path', async() => {
it('should log in', async() => {
await page.doLogin('employee', 'nightmare');
await page.waitForNavigation();
- let url = await page.parsedUrl();
+ let url = await page.expectURL('#!/');
- expect(url.hash).toEqual('#!/');
+ expect(url).toBe(true);
});
});
diff --git a/e2e/paths/02-client-module/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js
similarity index 85%
rename from e2e/paths/02-client-module/01_create_client.spec.js
rename to e2e/paths/02-client/01_create_client.spec.js
index ea5ffb17d..8f1a116ee 100644
--- a/e2e/paths/02-client-module/01_create_client.spec.js
+++ b/e2e/paths/02-client/01_create_client.spec.js
@@ -15,7 +15,7 @@ describe('Client create path', async() => {
});
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => {
- await page.write(selectors.clientsIndex.searchClientInput, 'Carol Danvers');
+ await page.write(selectors.clientsIndex.topbarSearch, 'Carol Danvers');
await page.waitToClick(selectors.clientsIndex.searchButton);
await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 0);
const result = await page.countElement(selectors.clientsIndex.searchResult);
@@ -26,9 +26,9 @@ describe('Client create path', async() => {
it('should now access to the create client view by clicking the create-client floating button', async() => {
await page.waitToClick(selectors.clientsIndex.createClientButton);
await page.wait(selectors.createClientView.createButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/client/create');
- expect(url.hash).toEqual('#!/client/create');
+ expect(url).toBe(true);
});
it('should receive an error when clicking the create button having all the form fields empty', async() => {
@@ -42,7 +42,7 @@ describe('Client create path', async() => {
await page.write(selectors.createClientView.taxNumber, '74451390E');
await page.write(selectors.createClientView.userName, 'CaptainMarvel');
await page.write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es');
- await page.autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'replenisher');
+ await page.autocompleteSearch(selectors.createClientView.salesPerson, 'replenisher');
await page.waitToClick(selectors.createClientView.createButton);
const result = await page.waitForLastSnackbar();
@@ -53,7 +53,6 @@ describe('Client create path', async() => {
await page.write(selectors.createClientView.name, 'Carol Danvers');
await page.write(selectors.createClientView.socialName, 'AVG tax');
await page.write(selectors.createClientView.street, 'Many places');
- await page.waitForContentLoaded();
await page.autocompleteSearch(selectors.createClientView.country, 'España');
await page.autocompleteSearch(selectors.createClientView.province, 'Province one');
await page.write(selectors.createClientView.city, 'Valencia');
@@ -79,13 +78,13 @@ describe('Client create path', async() => {
it(`should check for autocompleted city, province and country`, async() => {
const clientCity = await page
- .waitToGetProperty(`${selectors.createClientView.city} input`, 'value');
+ .waitToGetProperty(selectors.createClientView.city, 'value');
const clientProvince = await page
- .waitToGetProperty(`${selectors.createClientView.province} input`, 'value');
+ .waitToGetProperty(selectors.createClientView.province, 'value');
const clientCountry = await page
- .waitToGetProperty(`${selectors.createClientView.country} input`, 'value');
+ .waitToGetProperty(selectors.createClientView.country, 'value');
expect(clientCity).toEqual('Valencia');
expect(clientProvince).toEqual('Province one');
@@ -107,17 +106,15 @@ describe('Client create path', async() => {
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.clientsButton);
await page.wait(selectors.clientsIndex.createClientButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/client/index');
- expect(url.hash).toEqual('#!/client/index');
+ expect(url).toBe(true);
});
it(`should search for the user Carol Danvers to confirm it exists`, async() => {
- await page.waitForContentLoaded();
await page.accessToSearchResult('Carol Danvers');
- await page.waitForURL('#!/client/114/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/client/114/summary');
- expect(url.hash).toEqual('#!/client/114/summary');
+ expect(url).toBe(true);
});
});
diff --git a/e2e/paths/02-client-module/02_edit_basic_data.spec.js b/e2e/paths/02-client/02_edit_basic_data.spec.js
similarity index 62%
rename from e2e/paths/02-client-module/02_edit_basic_data.spec.js
rename to e2e/paths/02-client/02_edit_basic_data.spec.js
index 94b617ed9..6ae512542 100644
--- a/e2e/paths/02-client-module/02_edit_basic_data.spec.js
+++ b/e2e/paths/02-client/02_edit_basic_data.spec.js
@@ -18,22 +18,22 @@ describe('Client Edit basicData path', () => {
describe('as employee', () => {
it('should not be able to change the salesPerson', async() => {
- await page.wait(selectors.clientBasicData.nameInput);
+ await page.wait(selectors.clientBasicData.name);
const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
- }, `${selectors.clientBasicData.salesPersonAutocomplete} input`);
+ }, `${selectors.clientBasicData.salesPerson} input`);
expect(result).toBeTruthy();
});
it('should edit the client basic data but leave salesPerson untainted', async() => {
- await page.clearInput(selectors.clientBasicData.nameInput);
- await page.write(selectors.clientBasicData.nameInput, 'Ptonomy Wallace');
- await page.clearInput(selectors.clientBasicData.contactInput);
- await page.write(selectors.clientBasicData.contactInput, 'David Haller');
- await page.clearInput(selectors.clientBasicData.emailInput);
- await page.write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es');
- await page.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets');
+ await page.clearInput(selectors.clientBasicData.name);
+ await page.write(selectors.clientBasicData.name, 'Ptonomy Wallace');
+ await page.clearInput(selectors.clientBasicData.contact);
+ await page.write(selectors.clientBasicData.contact, 'David Haller');
+ await page.clearInput(selectors.clientBasicData.email);
+ await page.write(selectors.clientBasicData.email, 'PWallace@verdnatura.es');
+ await page.autocompleteSearch(selectors.clientBasicData.channel, 'Rumors on the streets');
await page.waitToClick(selectors.clientBasicData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -42,58 +42,62 @@ describe('Client Edit basicData path', () => {
it('should confirm the name have been edited', async() => {
await page.reloadSection('client.card.basicData');
- const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientBasicData.name, 'value');
expect(result).toEqual('Ptonomy Wallace');
});
it('should confirm the contact name have been edited', async() => {
const result = await page
- .waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value');
+ .waitToGetProperty(selectors.clientBasicData.contact, 'value');
expect(result).toEqual('David Haller');
});
it('should confirm the email have been edited', async() => {
const result = await page
- .waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value');
+ .waitToGetProperty(selectors.clientBasicData.email, 'value');
expect(result).toEqual('PWallace@verdnatura.es');
});
it('should confirm the channel have been selected', async() => {
const result = await page
- .waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.clientBasicData.channel, 'value');
expect(result).toEqual('Rumors on the streets');
});
});
describe('as salesAssistant', () => {
- beforeAll(async() => {
+ it('should navigate to a client basic data', async() => {
await page.loginAndModule('salesASsistant', 'client');
await page.accessToSearchResult('Ptonomy Wallace');
await page.accessToSection('client.card.basicData');
});
it('should be able to change the salesPerson', async() => {
- await page.wait(selectors.clientBasicData.nameInput);
+ await page.waitForSelector(selectors.clientBasicData.name);
const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
- }, `${selectors.clientBasicData.salesPersonAutocomplete} input`);
+ }, `${selectors.clientBasicData.salesPerson} input`);
expect(result).toBeFalsy();
});
it('should edit the client basic data including salesPerson', async() => {
- await page.clearInput(selectors.clientBasicData.nameInput);
- await page.write(selectors.clientBasicData.nameInput, 'Ororo Munroe');
- await page.clearInput(selectors.clientBasicData.contactInput);
- await page.write(selectors.clientBasicData.contactInput, 'Black Panther');
- await page.clearInput(selectors.clientBasicData.emailInput);
- await page.write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es');
- await page.autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'replenisherNick');
- await page.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper');
+ await page.clearInput(selectors.clientBasicData.name);
+ await page.write(selectors.clientBasicData.name, 'Ororo Munroe');
+ await page.clearInput(selectors.clientBasicData.contact);
+ await page.write(selectors.clientBasicData.contact, 'Black Panther');
+ await page.clearInput(selectors.clientBasicData.email);
+ await page.write(selectors.clientBasicData.email, 'Storm@verdnatura.es');
+ await page.clearInput(selectors.clientBasicData.phone);
+ await page.write(selectors.clientBasicData.phone, '333333333');
+ await page.clearInput(selectors.clientBasicData.mobile);
+ await page.write(selectors.clientBasicData.mobile, '444444444');
+ await page.autocompleteSearch(selectors.clientBasicData.salesPerson, 'replenisherNick');
+ await page.autocompleteSearch(selectors.clientBasicData.channel, 'Metropolis newspaper');
await page.waitToClick(selectors.clientBasicData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -102,35 +106,49 @@ describe('Client Edit basicData path', () => {
it('should now confirm the name have been edited', async() => {
await page.reloadSection('client.card.basicData');
- const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientBasicData.name, 'value');
expect(result).toEqual('Ororo Munroe');
});
it('should now confirm the contact name have been edited', async() => {
const result = await page
- .waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value');
+ .waitToGetProperty(selectors.clientBasicData.contact, 'value');
expect(result).toEqual('Black Panther');
});
it('should now confirm the email have been edited', async() => {
const result = await page
- .waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value');
+ .waitToGetProperty(selectors.clientBasicData.email, 'value');
expect(result).toEqual('Storm@verdnatura.es');
});
+ it('should now confirm the phone have been edited', async() => {
+ const result = await page
+ .waitToGetProperty(selectors.clientBasicData.phone, 'value');
+
+ expect(result).toEqual('333333333');
+ });
+
+ it('should now confirm the mobile have been edited', async() => {
+ const result = await page
+ .waitToGetProperty(selectors.clientBasicData.mobile, 'value');
+
+ expect(result).toEqual('444444444');
+ });
+
it('should confirm the sales person have been selected', async() => {
const result = await page
- .waitToGetProperty(`${selectors.clientBasicData.salesPersonAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.clientBasicData.salesPerson, 'value');
expect(result).toEqual('replenisherNick');
});
it('should now confirm the channel have been selected', async() => {
const result = await page
- .waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.clientBasicData.channel, 'value');
expect(result).toEqual('Metropolis newspaper');
});
diff --git a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js b/e2e/paths/02-client/03_edit_fiscal_data.spec.js
similarity index 85%
rename from e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
rename to e2e/paths/02-client/03_edit_fiscal_data.spec.js
index 25127e314..ac08b100d 100644
--- a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
+++ b/e2e/paths/02-client/03_edit_fiscal_data.spec.js
@@ -36,10 +36,9 @@ describe('Client Edit fiscalData path', () => {
it(`should click on the fiscal data button`, async() => {
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
- await page.waitForURL('fiscal-data');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('fiscal-data');
- expect(url.hash).toContain('fiscal-data');
+ expect(url).toBe(true);
});
it('should not be able to edit the verified data checkbox', async() => {
@@ -58,19 +57,19 @@ describe('Client Edit fiscalData path', () => {
});
it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => {
- await page.wait(selectors.clientFiscalData.socialNameInput);
- await page.clearInput(selectors.clientFiscalData.socialNameInput);
- await page.write(selectors.clientFiscalData.socialNameInput, 'SMASH');
- await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
- await page.write(selectors.clientFiscalData.fiscalIdInput, 'INVALID!');
- await page.clearInput(selectors.clientFiscalData.addressInput);
- await page.write(selectors.clientFiscalData.addressInput, 'Somewhere edited');
- await page.autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'España');
- await page.autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province one');
- await page.clearInput(selectors.clientFiscalData.cityInput);
- await page.write(selectors.clientFiscalData.cityInput, 'Valencia');
- await page.clearInput(selectors.clientFiscalData.postcodeInput);
- await page.write(selectors.clientFiscalData.postcodeInput, '46000');
+ await page.wait(selectors.clientFiscalData.socialName);
+ await page.clearInput(selectors.clientFiscalData.socialName);
+ await page.write(selectors.clientFiscalData.socialName, 'SMASH');
+ await page.clearInput(selectors.clientFiscalData.fiscalId);
+ await page.write(selectors.clientFiscalData.fiscalId, 'INVALID!');
+ await page.clearInput(selectors.clientFiscalData.address);
+ await page.write(selectors.clientFiscalData.address, 'Somewhere edited');
+ await page.autocompleteSearch(selectors.clientFiscalData.country, 'España');
+ await page.autocompleteSearch(selectors.clientFiscalData.province, 'Province one');
+ await page.clearInput(selectors.clientFiscalData.city);
+ await page.write(selectors.clientFiscalData.city, 'Valencia');
+ await page.clearInput(selectors.clientFiscalData.postcode);
+ await page.write(selectors.clientFiscalData.postcode, '46000');
await page.waitToClick(selectors.clientFiscalData.activeCheckbox);
await page.waitToClick(selectors.clientFiscalData.frozenCheckbox);
await page.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckbox);
@@ -80,15 +79,17 @@ describe('Client Edit fiscalData path', () => {
await page.waitToClick(selectors.clientFiscalData.equalizationTaxCheckbox);
await page.waitToClick(selectors.clientFiscalData.verifiedDataCheckbox);
await page.waitToClick(selectors.clientFiscalData.saveButton);
+ await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('Invalid Tax number');
- }, 15000);
+ });
it(`should edit the fiscal this time with a valid fiscal id`, async() => {
- await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
- await page.write(selectors.clientFiscalData.fiscalIdInput, '94980061C');
+ await page.clearInput(selectors.clientFiscalData.fiscalId);
+ await page.write(selectors.clientFiscalData.fiscalId, '94980061C');
await page.waitToClick(selectors.clientFiscalData.saveButton);
+ await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -103,8 +104,8 @@ describe('Client Edit fiscalData path', () => {
it('should receive an error if the fiscal id contains A or B at the beginning', async() => {
await page.waitToClick(selectors.clientFiscalData.viesCheckbox);
- await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
- await page.write(selectors.clientFiscalData.fiscalIdInput, 'A94980061C');
+ await page.clearInput(selectors.clientFiscalData.fiscalId);
+ await page.write(selectors.clientFiscalData.fiscalId, 'A94980061C');
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -112,8 +113,8 @@ describe('Client Edit fiscalData path', () => {
});
it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async() => {
- await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
- await page.write(selectors.clientFiscalData.fiscalIdInput, '94980061C');
+ await page.clearInput(selectors.clientFiscalData.fiscalId);
+ await page.write(selectors.clientFiscalData.fiscalId, '94980061C');
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -123,10 +124,9 @@ describe('Client Edit fiscalData path', () => {
// confirm all addresses have now EQtax checked step 1
it(`should click on the addresses button to access to the client's addresses`, async() => {
await page.waitToClick(selectors.clientAddresses.addressesButton);
- await page.waitForURL('/address/index');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/address/index');
- expect(url.hash).toContain('/address/index');
+ expect(url).toBe(true);
});
// confirm all addresses have now EQtax checked step 2
@@ -151,6 +151,7 @@ describe('Client Edit fiscalData path', () => {
it('should navigate back to fiscal data and uncheck EQtax then check VIES', async() => {
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
await page.waitToClick(selectors.clientFiscalData.viesCheckbox);
+ await page.waitToClick(selectors.clientFiscalData.invoiceByAddressCheckbox);
await page.waitToClick(selectors.clientFiscalData.equalizationTaxCheckbox);
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -167,44 +168,44 @@ describe('Client Edit fiscalData path', () => {
it('should confirm its name have been edited', async() => {
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('SMASH');
});
it('should confirm the fiscal id have been edited', async() => {
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.fiscalIdInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.fiscalId, 'value');
expect(result).toEqual('94980061C');
});
it('should confirm the address have been edited', async() => {
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.addressInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.address, 'value');
expect(result).toEqual('Somewhere edited');
});
it('should confirm the postcode have been edited', async() => {
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.postcodeInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.postcode, 'value');
expect(result).toContain('46000');
});
it('should confirm the city have been autocompleted', async() => {
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.cityInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value');
expect(result).toEqual('Valencia');
});
it(`should confirm the province have been autocompleted`, async() => {
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.provinceAutocomplete} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.province, 'value');
expect(result).toEqual('Province one');
});
it('should confirm the country have been autocompleted', async() => {
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.countryAutocomplete} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.country, 'value');
expect(result).toEqual('España');
});
@@ -239,10 +240,10 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBe('unchecked');
});
- it('should confirm invoice by address checkbox is unchecked', async() => {
+ it('should confirm invoice by address checkbox is checked', async() => {
const result = await page.checkboxState(selectors.clientFiscalData.invoiceByAddressCheckbox);
- expect(result).toBe('unchecked');
+ expect(result).toBe('checked');
});
it('should confirm Equalization tax checkbox is unchecked', async() => {
@@ -260,16 +261,15 @@ describe('Client Edit fiscalData path', () => {
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1
it(`should click on the addresses button to access to the client's addresses`, async() => {
await page.waitToClick(selectors.clientAddresses.addressesButton);
- await page.waitForURL('/address/index');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/address/index');
- expect(url.hash).toContain('/address/index');
+ expect(url).toBe(true);
});
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2
it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async() => {
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
- await page.waitForTextInInput(selectors.clientAddresses.cityInput, 'Silla');
+ await page.waitForTextInField(selectors.clientAddresses.city, 'Silla');
await page.waitToClick(selectors.clientAddresses.equalizationTaxCheckbox);
await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar();
diff --git a/e2e/paths/02-client-module/04_edit_billing_data.spec.js b/e2e/paths/02-client/04_edit_billing_data.spec.js
similarity index 73%
rename from e2e/paths/02-client-module/04_edit_billing_data.spec.js
rename to e2e/paths/02-client/04_edit_billing_data.spec.js
index 4b6d83651..b757940be 100644
--- a/e2e/paths/02-client-module/04_edit_billing_data.spec.js
+++ b/e2e/paths/02-client/04_edit_billing_data.spec.js
@@ -17,11 +17,11 @@ describe('Client Edit billing data path', () => {
});
it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
- await page.autocompleteSearch(selectors.clientBillingData.payMethodAutocomplete, 'PayMethod with IBAN');
- await page.autocompleteSearch(selectors.clientBillingData.swiftBicAutocomplete, 'BBKKESMMMMM');
- await page.clearInput(selectors.clientBillingData.dueDayInput);
- await page.write(selectors.clientBillingData.dueDayInput, '60');
- await page.waitForTextInInput(selectors.clientBillingData.dueDayInput, '60');
+ await page.autocompleteSearch(selectors.clientBillingData.payMethod, 'PayMethod with IBAN');
+ await page.autocompleteSearch(selectors.clientBillingData.swiftBic, 'BBKKESMMMMM');
+ await page.clearInput(selectors.clientBillingData.dueDay);
+ await page.write(selectors.clientBillingData.dueDay, '60');
+ await page.waitForTextInField(selectors.clientBillingData.dueDay, '60');
await page.waitToClick(selectors.clientBillingData.receivedCoreLCRCheckbox);
await page.waitToClick(selectors.clientBillingData.receivedCoreVNLCheckbox);
await page.waitToClick(selectors.clientBillingData.receivedB2BVNLCheckbox);
@@ -37,30 +37,30 @@ describe('Client Edit billing data path', () => {
await page.write(selectors.clientBillingData.newBankEntityCode, '9999');
await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT');
await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton);
- await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'Gotham City Bank');
- let newcode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value');
+ await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'Gotham City Bank');
+ let newcode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
expect(newcode).toEqual('GTHMCT Gotham City Bank');
});
it(`should confirm the IBAN pay method was sucessfully saved`, async() => {
- let payMethod = await page.waitToGetProperty(`${selectors.clientBillingData.payMethodAutocomplete} input`, 'value');
+ let payMethod = await page.waitToGetProperty(selectors.clientBillingData.payMethod, 'value');
expect(payMethod).toEqual('PayMethod with IBAN');
});
it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => {
- await page.write(selectors.clientBillingData.IBANInput, 'ES9121000418450200051332');
+ await page.write(selectors.clientBillingData.IBAN, 'ES9121000418450200051332');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
- await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'caixesbb');
- let automaticCode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value');
+ await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'caixesbb');
+ let automaticCode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
expect(automaticCode).toEqual('CAIXESBB Caixa Bank');
});
it(`should save the form with all its new data`, async() => {
- await page.waitForContentLoaded();
+ await page.waitFor(3000);
await page.waitForWatcherData(selectors.clientBillingData.watcher);
await page.waitToClick(selectors.clientBillingData.saveButton);
let snackbarMessage = await page.waitForLastSnackbar();
@@ -69,19 +69,19 @@ describe('Client Edit billing data path', () => {
});
it('should confirm the due day have been edited', async() => {
- let dueDate = await page.waitToGetProperty(`${selectors.clientBillingData.dueDayInput} input`, 'value');
+ let dueDate = await page.waitToGetProperty(selectors.clientBillingData.dueDay, 'value');
expect(dueDate).toEqual('60');
});
it('should confirm the IBAN was saved', async() => {
- let IBAN = await page.waitToGetProperty(`${selectors.clientBillingData.IBANInput} input`, 'value');
+ let IBAN = await page.waitToGetProperty(selectors.clientBillingData.IBAN, 'value');
expect(IBAN).toEqual('ES9121000418450200051332');
});
it('should confirm the swift / BIC code was saved', async() => {
- let code = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value');
+ let code = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
expect(code).toEqual('CAIXESBB Caixa Bank');
});
diff --git a/e2e/paths/02-client-module/05_add_address.spec.js b/e2e/paths/02-client/05_add_address.spec.js
similarity index 82%
rename from e2e/paths/02-client-module/05_add_address.spec.js
rename to e2e/paths/02-client/05_add_address.spec.js
index 8eb4a86bf..af4ccf5d6 100644
--- a/e2e/paths/02-client-module/05_add_address.spec.js
+++ b/e2e/paths/02-client/05_add_address.spec.js
@@ -18,19 +18,18 @@ describe('Client Add address path', () => {
it(`should click on the add new address button to access to the new address form`, async() => {
await page.waitToClick(selectors.clientAddresses.createAddress);
- await page.waitForURL('address/create');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('address/create');
- expect(url.hash).toContain('address/create');
+ expect(url).toBe(true);
});
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
- await page.waitToClick(selectors.clientAddresses.defaultCheckboxInput);
- await page.autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province five');
- await page.write(selectors.clientAddresses.cityInput, 'Valencia');
- await page.write(selectors.clientAddresses.postcodeInput, '46000');
- await page.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement');
- await page.write(selectors.clientAddresses.phoneInput, '999887744');
+ await page.waitToClick(selectors.clientAddresses.defaultCheckbox);
+ await page.autocompleteSearch(selectors.clientAddresses.province, 'Province five');
+ await page.write(selectors.clientAddresses.city, 'Valencia');
+ await page.write(selectors.clientAddresses.postcode, '46000');
+ await page.autocompleteSearch(selectors.clientAddresses.agency, 'Entanglement');
+ await page.write(selectors.clientAddresses.phone, '999887744');
await page.write(selectors.clientAddresses.mobileInput, '999887744');
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -40,8 +39,8 @@ describe('Client Add address path', () => {
it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => {
- await page.write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner');
- await page.write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York');
+ await page.write(selectors.clientAddresses.consignee, 'Bruce Bunner');
+ await page.write(selectors.clientAddresses.streetAddress, '320 Park Avenue New York');
await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar();
@@ -49,7 +48,7 @@ describe('Client Add address path', () => {
});
it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => {
- await page.autocompleteSearch(selectors.clientAddresses.incotermsAutocomplete, 'Free Alongside Ship');
+ await page.autocompleteSearch(selectors.clientAddresses.incoterms, 'Free Alongside Ship');
await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar();
@@ -57,7 +56,7 @@ describe('Client Add address path', () => {
});
it(`should create a new address with all it's data`, async() => {
- await page.autocompleteSearch(selectors.clientAddresses.customsAgentAutocomplete, 'Agent one');
+ await page.autocompleteSearch(selectors.clientAddresses.customsAgent, 'Agent one');
await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar();
@@ -87,10 +86,9 @@ describe('Client Add address path', () => {
it(`should click on the edit icon of the default address`, async() => {
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
- await page.waitForURL('/edit');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/edit');
- expect(url.hash).toContain('/edit');
+ expect(url).toBe(true);
});
it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => {
@@ -105,9 +103,8 @@ describe('Client Add address path', () => {
it(`should go back to the addreses section by clicking the cancel button`, async() => {
await page.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
await page.waitToClick('.vn-confirm.shown button[response="accept"]');
- await page.waitForURL('address/index');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('address/index');
- expect(url.hash).toContain('address/index');
+ expect(url).toBe(true);
});
});
diff --git a/e2e/paths/02-client-module/06_add_address_notes.spec.js b/e2e/paths/02-client/06_add_address_notes.spec.js
similarity index 84%
rename from e2e/paths/02-client-module/06_add_address_notes.spec.js
rename to e2e/paths/02-client/06_add_address_notes.spec.js
index c19de91b8..58a949698 100644
--- a/e2e/paths/02-client-module/06_add_address_notes.spec.js
+++ b/e2e/paths/02-client/06_add_address_notes.spec.js
@@ -19,15 +19,14 @@ describe('Client add address notes path', () => {
it(`should click on the edit icon of the default address`, async() => {
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street');
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
- await page.waitForURL('/edit');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/edit');
- expect(url.hash).toContain('/edit');
+ expect(url).toBe(true);
});
it('should not save a description without observation type', async() => {
await page.waitToClick(selectors.clientAddresses.addObservationButton);
- await page.write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description');
+ await page.write(selectors.clientAddresses.firstObservationDescription, 'first description');
await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar();
@@ -35,8 +34,8 @@ describe('Client add address notes path', () => {
});
it('should not save an observation type without description', async() => {
- await page.clearInput(selectors.clientAddresses.firstObservationDescriptionInput);
- await page.autocompleteSearch(selectors.clientAddresses.firstObservationTypeAutocomplete, 'comercial');
+ await page.clearInput(selectors.clientAddresses.firstObservationDescription);
+ await page.autocompleteSearch(selectors.clientAddresses.firstObservationType, 'comercial');
await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar();
@@ -44,10 +43,10 @@ describe('Client add address notes path', () => {
});
it('should create two new observations', async() => {
- await page.write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description');
+ await page.write(selectors.clientAddresses.firstObservationDescription, 'first description');
await page.waitToClick(selectors.clientAddresses.addObservationButton);
- await page.autocompleteSearch(selectors.clientAddresses.secondObservationTypeAutocomplete, 'observation one');
- await page.write(selectors.clientAddresses.secondObservationDescriptionInput, 'second description');
+ await page.autocompleteSearch(selectors.clientAddresses.secondObservationType, 'observation one');
+ await page.write(selectors.clientAddresses.secondObservationDescription, 'second description');
await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar();
diff --git a/e2e/paths/02-client-module/07_edit_web_access.spec.js b/e2e/paths/02-client/07_edit_web_access.spec.js
similarity index 85%
rename from e2e/paths/02-client-module/07_edit_web_access.spec.js
rename to e2e/paths/02-client/07_edit_web_access.spec.js
index 835c8c25e..f9b023716 100644
--- a/e2e/paths/02-client-module/07_edit_web_access.spec.js
+++ b/e2e/paths/02-client/07_edit_web_access.spec.js
@@ -18,8 +18,8 @@ describe('Client Edit web access path', () => {
it(`should uncheck the Enable web access checkbox and update the name`, async() => {
await page.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox);
- await page.clearInput(selectors.clientWebAccess.userNameInput);
- await page.write(selectors.clientWebAccess.userNameInput, 'Hulk');
+ await page.clearInput(selectors.clientWebAccess.userName);
+ await page.write(selectors.clientWebAccess.userName, 'Hulk');
await page.waitToClick(selectors.clientWebAccess.saveButton);
const result = await page.waitForLastSnackbar();
@@ -28,7 +28,7 @@ describe('Client Edit web access path', () => {
it('should confirm web access is now unchecked', async() => {
await page.waitToClick(selectors.clientBasicData.basicDataButton);
- await page.wait(selectors.clientBasicData.nameInput);
+ await page.wait(selectors.clientBasicData.name);
await page.waitToClick(selectors.clientsIndex.othersButton);
await page.waitToClick(selectors.clientWebAccess.webAccessButton);
const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox);
@@ -37,7 +37,7 @@ describe('Client Edit web access path', () => {
});
it('should confirm web access name have been updated', async() => {
- const result = await page.waitToGetProperty(`${selectors.clientWebAccess.userNameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientWebAccess.userName, 'value');
expect(result).toEqual('Hulk');
});
diff --git a/e2e/paths/02-client-module/08_add_notes.spec.js b/e2e/paths/02-client/08_add_notes.spec.js
similarity index 78%
rename from e2e/paths/02-client-module/08_add_notes.spec.js
rename to e2e/paths/02-client/08_add_notes.spec.js
index 6a9ae26f0..8f1a9244d 100644
--- a/e2e/paths/02-client-module/08_add_notes.spec.js
+++ b/e2e/paths/02-client/08_add_notes.spec.js
@@ -18,15 +18,14 @@ describe('Client Add notes path', () => {
it(`should click on the add note button`, async() => {
await page.waitToClick(selectors.clientNotes.addNoteFloatButton);
- await page.waitForURL('/note/create');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/note/create');
- expect(url.hash).toContain('/note/create');
+ expect(url).toBe(true);
});
it(`should create a note`, async() => {
- await page.waitFor(selectors.clientNotes.noteInput);
- await page.type(`${selectors.clientNotes.noteInput} textarea`, 'Meeting with Black Widow 21st 9am');
+ await page.waitFor(selectors.clientNotes.note);
+ await page.type(`${selectors.clientNotes.note} textarea`, 'Meeting with Black Widow 21st 9am');
await page.waitToClick(selectors.clientNotes.saveButton);
const result = await page.waitForLastSnackbar();
diff --git a/e2e/paths/02-client-module/09_add_credit.spec.js b/e2e/paths/02-client/09_add_credit.spec.js
similarity index 76%
rename from e2e/paths/02-client-module/09_add_credit.spec.js
rename to e2e/paths/02-client/09_add_credit.spec.js
index 3f8aa0912..05c50e809 100644
--- a/e2e/paths/02-client-module/09_add_credit.spec.js
+++ b/e2e/paths/02-client/09_add_credit.spec.js
@@ -18,16 +18,14 @@ describe('Client Add credit path', () => {
it(`should click on the add credit button`, async() => {
await page.waitToClick(selectors.clientCredit.addCreditFloatButton);
- await page.waitForURL('/credit/create');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/credit/create');
- expect(url.hash).toContain('/credit/create');
+ expect(url).toBe(true);
});
it(`should edit the credit`, async() => {
- await page.waitForContentLoaded();
- await page.clearInput(selectors.clientCredit.creditInput);
- await page.write(selectors.clientCredit.creditInput, '999');
+ await page.clearInput(selectors.clientCredit.credit);
+ await page.write(selectors.clientCredit.credit, '999');
await page.waitToClick(selectors.clientCredit.saveButton);
const result = await page.waitForLastSnackbar();
@@ -35,7 +33,6 @@ describe('Client Add credit path', () => {
});
it('should confirm the credit was updated', async() => {
- await page.waitForContentLoaded();
const result = await page.waitToGetProperty(selectors.clientCredit.firstCreditText, 'innerText');
expect(result).toContain(999);
diff --git a/e2e/paths/02-client-module/10_add_greuge.spec.js b/e2e/paths/02-client/10_add_greuge.spec.js
similarity index 79%
rename from e2e/paths/02-client-module/10_add_greuge.spec.js
rename to e2e/paths/02-client/10_add_greuge.spec.js
index 3a127ab12..c934a42f1 100644
--- a/e2e/paths/02-client-module/10_add_greuge.spec.js
+++ b/e2e/paths/02-client/10_add_greuge.spec.js
@@ -18,14 +18,13 @@ describe('Client Add greuge path', () => {
it(`should click on the add greuge button`, async() => {
await page.waitToClick(selectors.clientGreuge.addGreugeFloatButton);
- await page.waitForURL('greuge/create');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('greuge/create');
- expect(url.hash).toContain('greuge/create');
+ expect(url).toBe(true);
});
it(`should receive an error if all fields are empty but date and type on submit`, async() => {
- await page.autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff');
+ await page.autocompleteSearch(selectors.clientGreuge.type, 'Diff');
await page.waitToClick(selectors.clientGreuge.saveButton);
const result = await page.waitForLastSnackbar();
@@ -33,9 +32,9 @@ describe('Client Add greuge path', () => {
});
it(`should create a new greuge with all its data`, async() => {
- await page.write(selectors.clientGreuge.amountInput, '999');
- await page.waitForTextInInput(selectors.clientGreuge.amountInput, '999');
- await page.write(selectors.clientGreuge.descriptionInput, 'new armor for Batman!');
+ await page.write(selectors.clientGreuge.amount, '999');
+ await page.waitForTextInField(selectors.clientGreuge.amount, '999');
+ await page.write(selectors.clientGreuge.description, 'new armor for Batman!');
await page.waitToClick(selectors.clientGreuge.saveButton);
const result = await page.waitForLastSnackbar();
diff --git a/e2e/paths/02-client-module/11_mandate.spec.js b/e2e/paths/02-client/11_mandate.spec.js
similarity index 100%
rename from e2e/paths/02-client-module/11_mandate.spec.js
rename to e2e/paths/02-client/11_mandate.spec.js
diff --git a/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js b/e2e/paths/02-client/12_lock_of_verified_data.spec.js
similarity index 90%
rename from e2e/paths/02-client-module/12_lock_of_verified_data.spec.js
rename to e2e/paths/02-client/12_lock_of_verified_data.spec.js
index ddb5f6d04..870ce7cb1 100644
--- a/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js
+++ b/e2e/paths/02-client/12_lock_of_verified_data.spec.js
@@ -26,9 +26,9 @@ describe('Client lock verified data path', () => {
});
it('should edit the social name', async() => {
- await page.wait(selectors.clientFiscalData.socialNameInput);
- await page.clearInput(selectors.clientFiscalData.socialNameInput);
- await page.write(selectors.clientFiscalData.socialNameInput, 'Captain America Civil War');
+ await page.wait(selectors.clientFiscalData.socialName);
+ await page.clearInput(selectors.clientFiscalData.socialName);
+ await page.write(selectors.clientFiscalData.socialName, 'Captain America Civil War');
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -37,7 +37,7 @@ describe('Client lock verified data path', () => {
it('should confirm the social name have been edited', async() => {
await page.reloadSection('client.card.fiscalData');
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('Captain America Civil War');
});
@@ -59,6 +59,7 @@ describe('Client lock verified data path', () => {
it('should check the Verified data checkbox', async() => {
await page.waitToClick(selectors.clientFiscalData.verifiedDataCheckbox);
await page.waitToClick(selectors.clientFiscalData.saveButton);
+ await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -72,9 +73,9 @@ describe('Client lock verified data path', () => {
});
it('should again edit the social name', async() => {
- await page.wait(selectors.clientFiscalData.socialNameInput);
- await page.clearInput(selectors.clientFiscalData.socialNameInput);
- await page.write(selectors.clientFiscalData.socialNameInput, 'Ant man and the Wasp');
+ await page.wait(selectors.clientFiscalData.socialName);
+ await page.clearInput(selectors.clientFiscalData.socialName);
+ await page.write(selectors.clientFiscalData.socialName, 'Ant man and the Wasp');
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -83,7 +84,7 @@ describe('Client lock verified data path', () => {
it('should again confirm the social name have been edited', async() => {
await page.reloadSection('client.card.fiscalData');
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('Ant man and the Wasp');
});
@@ -103,8 +104,8 @@ describe('Client lock verified data path', () => {
});
it('should not be able to save change throwing a verified data error', async() => {
- await page.clearInput(selectors.clientFiscalData.socialNameInput);
- await page.write(selectors.clientFiscalData.socialNameInput, 'This wont happen');
+ await page.clearInput(selectors.clientFiscalData.socialName);
+ await page.write(selectors.clientFiscalData.socialName, 'This wont happen');
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -113,12 +114,12 @@ describe('Client lock verified data path', () => {
});
describe('as salesAssistant', () => {
- beforeAll(async() => {
+ it('should log in as salesAssistant then get to the client fiscal data', async() => {
await page.forceReloadSection('client.card.fiscalData');
await page.loginAndModule('salesAssistant', 'client');
await page.accessToSearchResult('Hank Pym');
await page.accessToSection('client.card.fiscalData');
- });
+ }, 20000);
it('should confirm verified data button is enabled for salesAssistant', async() => {
const isDisabled = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
@@ -127,8 +128,8 @@ describe('Client lock verified data path', () => {
});
it('should now edit the social name', async() => {
- await page.clearInput(selectors.clientFiscalData.socialNameInput);
- await page.write(selectors.clientFiscalData.socialNameInput, 'new social name edition');
+ await page.clearInput(selectors.clientFiscalData.socialName);
+ await page.write(selectors.clientFiscalData.socialName, 'new social name edition');
await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -137,7 +138,7 @@ describe('Client lock verified data path', () => {
it('should now confirm the social name have been edited once and for all', async() => {
await page.reloadSection('client.card.fiscalData');
- const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('new social name edition');
});
@@ -158,7 +159,7 @@ describe('Client lock verified data path', () => {
});
it('should confirm the form is enabled for salesPerson', async() => {
- await page.wait(selectors.clientFiscalData.socialNameInput);
+ await page.wait(selectors.clientFiscalData.socialName);
const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
}, 'vn-textfield[ng-model="$ctrl.client.socialName"] > div');
diff --git a/e2e/paths/02-client-module/13_log.spec.js b/e2e/paths/02-client/13_log.spec.js
similarity index 86%
rename from e2e/paths/02-client-module/13_log.spec.js
rename to e2e/paths/02-client/13_log.spec.js
index 4b09b0500..462d66347 100644
--- a/e2e/paths/02-client-module/13_log.spec.js
+++ b/e2e/paths/02-client/13_log.spec.js
@@ -17,8 +17,8 @@ describe('Client log path', () => {
});
it('should update the clients name', async() => {
- await page.clearInput(selectors.clientBasicData.nameInput);
- await page.write(selectors.clientBasicData.nameInput, 'this is a test');
+ await page.clearInput(selectors.clientBasicData.name);
+ await page.write(selectors.clientBasicData.name, 'this is a test');
await page.waitToClick(selectors.clientBasicData.saveButton);
let result = await page.waitForLastSnackbar();
@@ -27,10 +27,9 @@ describe('Client log path', () => {
it('should navigate to the log section', async() => {
await page.waitToClick(selectors.clientLog.logButton);
- await page.waitForURL('log');
- let url = await page.parsedUrl();
+ let url = await page.expectURL('log');
- expect(url.hash).toContain('log');
+ expect(url).toBe(true);
});
it('should check the previous value of the last logged change', async() => {
diff --git a/e2e/paths/02-client-module/14_balance.spec.js b/e2e/paths/02-client/14_balance.spec.js
similarity index 84%
rename from e2e/paths/02-client-module/14_balance.spec.js
rename to e2e/paths/02-client/14_balance.spec.js
index 37b118ef2..f45937deb 100644
--- a/e2e/paths/02-client-module/14_balance.spec.js
+++ b/e2e/paths/02-client/14_balance.spec.js
@@ -9,7 +9,7 @@ describe('Client balance path', () => {
page = browser.page;
await page.loginAndModule('administrative', 'client');
await page.accessToSearchResult('Petter Parker');
- }, 30000);
+ });
afterAll(async() => {
await browser.close();
@@ -25,7 +25,7 @@ describe('Client balance path', () => {
it('should access to the balance section to check the data shown matches the local settings', async() => {
await page.accessToSection('client.card.balance.index');
- let result = await page.waitToGetProperty(`${selectors.clientBalance.companyAutocomplete} input`, 'value');
+ let result = await page.waitToGetProperty(selectors.clientBalance.company, 'value');
expect(result).toEqual('CCs');
});
@@ -39,20 +39,15 @@ describe('Client balance path', () => {
});
it('should click the new payment button', async() => {
- await page.keyboard.press('Escape');
+ await page.closePopup();
await page.reloadSection('client.card.balance.index');
- await page.waitForURL('/balance');
+ let url = await page.expectURL('/balance');
- let url = await page.parsedUrl();
-
- expect(url.hash).toContain('/balance');
+ expect(url).toBe(true);
});
it('should create a new payment that clears the debt', async() => {
- await Promise.all([
- page.waitToClick(selectors.clientBalance.newPaymentButton),
- page.waitForSelector('.vn-dialog.vn-popup.shown', {visible: true})
- ]);
+ await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.autocompleteSearch(selectors.clientBalance.newPaymentBank, 'Pay on receipt');
await page.waitToClick(selectors.clientBalance.saveButton);
let result = await page.waitForLastSnackbar();
@@ -63,7 +58,7 @@ describe('Client balance path', () => {
it('should check balance is now 0 and the company is now VNL becouse the user local settings were removed', async() => {
await page.waitForSpinnerLoad();
let company = await page
- .waitToGetProperty(`${selectors.clientBalance.companyAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.clientBalance.company, 'value');
let firstBalanceLine = await page
.waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText');
@@ -76,8 +71,8 @@ describe('Client balance path', () => {
it('should create a new payment that sets the balance to positive value', async() => {
await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :(
- await page.clearInput(selectors.clientBalance.newPaymentAmountInput);
- await page.write(selectors.clientBalance.newPaymentAmountInput, '100');
+ await page.clearInput(selectors.clientBalance.newPaymentAmount);
+ await page.write(selectors.clientBalance.newPaymentAmount, '100');
await page.waitToClick(selectors.clientBalance.saveButton);
let result = await page.waitForLastSnackbar();
@@ -95,8 +90,8 @@ describe('Client balance path', () => {
await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :(
await page.waitForSelector('.vn-dialog.vn-popup.shown', {visible: true});
- await page.clearInput(selectors.clientBalance.newPaymentAmountInput);
- await page.write(selectors.clientBalance.newPaymentAmountInput, '-150');
+ await page.clearInput(selectors.clientBalance.newPaymentAmount);
+ await page.write(selectors.clientBalance.newPaymentAmount, '-150');
await page.waitToClick(selectors.clientBalance.saveButton);
let result = await page.waitForLastSnackbar();
@@ -116,13 +111,13 @@ describe('Client balance path', () => {
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.clientsButton);
await page.wait(selectors.clientsIndex.createClientButton);
- let url = await page.parsedUrl();
+ let url = await page.expectURL('#!/client/index');
- expect(url.hash).toEqual('#!/client/index');
+ expect(url).toBe(true);
});
it('should now search for the user Petter Parker', async() => {
- await page.write(selectors.clientsIndex.searchClientInput, 'Petter Parker');
+ await page.write(selectors.clientsIndex.topbarSearch, 'Petter Parker');
await page.waitToClick(selectors.clientsIndex.searchButton);
await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1);
let resultCount = await page.countElement(selectors.clientsIndex.searchResult);
@@ -135,10 +130,9 @@ describe('Client balance path', () => {
await page.waitToClick(selectors.clientsIndex.searchResult);
await page.waitForContentLoaded();
await page.waitToClick(selectors.clientBalance.balanceButton);
- await page.waitForURL('/balance');
- let url = await page.parsedUrl();
+ let url = await page.expectURL('/balance');
- expect(url.hash).toContain('/balance');
+ expect(url).toBe(true);
});
it('should not be able to click the new payment button as it isnt present', async() => {
diff --git a/e2e/paths/02-client-module/15_user_config.spec.js b/e2e/paths/02-client/15_user_config.spec.js
similarity index 59%
rename from e2e/paths/02-client-module/15_user_config.spec.js
rename to e2e/paths/02-client/15_user_config.spec.js
index cb91b1e37..193305177 100644
--- a/e2e/paths/02-client-module/15_user_config.spec.js
+++ b/e2e/paths/02-client/15_user_config.spec.js
@@ -16,30 +16,32 @@ describe('User config', () => {
describe('as salesPerson', () => {
it('should login', async() => {
await page.login('salesPerson');
+ await page.waitForContentLoaded();
});
it('should now open the user config form to check the settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton);
+ await page.waitForContentLoaded();
- let userLocalWarehouse = await page
- .getProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
+ let expectedLocalWarehouse = await page
+ .expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');
- let userLocalBank = await page
- .getProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
+ let expectedLocalBank = await page
+ .expectPropertyValue(selectors.globalItems.userLocalBank, 'value', '');
- let userLocalCompany = await page
- .getProperty(`${selectors.globalItems.userLocalCompany} input`, 'value');
+ let expectedLocalCompany = await page
+ .expectPropertyValue(selectors.globalItems.userLocalCompany, 'value', '');
let userWarehouse = await page
- .waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
let userCompany = await page
- .waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userCompany, 'value');
- expect(userLocalWarehouse).toEqual('');
- expect(userLocalBank).toEqual('');
- expect(userLocalCompany).toEqual('');
+ expect(expectedLocalWarehouse).toBeTruthy();
+ expect(expectedLocalBank).toBeTruthy();
+ expect(expectedLocalCompany).toBeTruthy();
expect(userWarehouse).toEqual('Warehouse Three');
expect(userCompany).toEqual('VNH');
});
@@ -48,28 +50,31 @@ describe('User config', () => {
describe('as employee', () => {
it('should log in', async() => {
await page.login('employee');
+ await page.waitForContentLoaded();
});
it('should open the user config form to check the settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton);
- let userLocalWarehouse = await page
- .getProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
+ await page.waitFor(1000);
+ let expectedLocalWarehouse = await page
+ .expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');
- let userLocalBank = await page
- .getProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
- let userLocalCompany = await page
- .getProperty(`${selectors.globalItems.userLocalCompany} input`, 'value');
+ let expectedLocalBank = await page
+ .expectPropertyValue(selectors.globalItems.userLocalBank, 'value', '');
+
+ let expectedLocalCompany = await page
+ .expectPropertyValue(selectors.globalItems.userLocalCompany, 'value', '');
let userWarehouse = await page
- .waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
let userCompany = await page
- .waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userCompany, 'value');
- expect(userLocalWarehouse).toEqual('');
- expect(userLocalBank).toEqual('');
- expect(userLocalCompany).toEqual('');
+ expect(expectedLocalWarehouse).toBeTruthy();
+ expect(expectedLocalBank).toBeTruthy();
+ expect(expectedLocalCompany).toBeTruthy();
expect(userWarehouse).toEqual('Warehouse Two');
expect(userCompany).toEqual('CCs');
});
@@ -87,24 +92,25 @@ describe('User config', () => {
describe('as salesPerson 2nd run', () => {
it('should log in once more', async() => {
await page.login('salesPerson');
+ await page.waitForContentLoaded();
});
it('should again open the user config form to check the local settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton);
let userLocalWarehouse = await page
- .waitToGetProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userLocalWarehouse, 'value');
let userLocalBank = await page
- .waitToGetProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userLocalBank, 'value');
let userLocalCompany = await page
- .waitToGetProperty(`${selectors.globalItems.userLocalCompany} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userLocalCompany, 'value');
let userWarehouse = await page
- .waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
let userCompany = await page
- .waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userCompany, 'value');
expect(userLocalWarehouse).toContain('Warehouse Four');
expect(userLocalBank).toContain('Pay on receipt');
diff --git a/e2e/paths/02-client-module/16_web_payment.spec.js b/e2e/paths/02-client/16_web_payment.spec.js
similarity index 100%
rename from e2e/paths/02-client-module/16_web_payment.spec.js
rename to e2e/paths/02-client/16_web_payment.spec.js
diff --git a/e2e/paths/02-client-module/17_dms.spec.js b/e2e/paths/02-client/17_dms.spec.js
similarity index 93%
rename from e2e/paths/02-client-module/17_dms.spec.js
rename to e2e/paths/02-client/17_dms.spec.js
index 01a197c84..9891fd3f4 100644
--- a/e2e/paths/02-client-module/17_dms.spec.js
+++ b/e2e/paths/02-client/17_dms.spec.js
@@ -27,7 +27,7 @@ describe('Client DMS', () => {
it(`should click on the first document line worker name making the descriptor visible`, async() => {
await page.waitToClick(selectors.dms.firstDocWorker);
- await page.wait(selectors.dms.firstDocWorkerDescriptor);
+ await page.waitForSelector(selectors.dms.firstDocWorkerDescriptor);
const visible = await page.isVisible(selectors.dms.firstDocWorkerDescriptor);
expect(visible).toBeTruthy();
diff --git a/e2e/paths/02-client/18_contacts.spec.js b/e2e/paths/02-client/18_contacts.spec.js
new file mode 100644
index 000000000..252c5d667
--- /dev/null
+++ b/e2e/paths/02-client/18_contacts.spec.js
@@ -0,0 +1,37 @@
+import selectors from '../../helpers/selectors';
+import getBrowser from '../../helpers/puppeteer';
+
+describe('Client contacts', () => {
+ let browser;
+ let page;
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('employee', 'client');
+ await page.accessToSearchResult('Clark Kent');
+ await page.accessToSection('client.card.contact');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should add a contact', async() => {
+ await page.waitToClick(selectors.clientContacts.addContactButton);
+ await page.clearInput(selectors.clientContacts.name);
+ await page.write(selectors.clientContacts.name, 'Ansible');
+ await page.write(selectors.clientContacts.phone, 'FTL comms');
+ await page.waitToClick(selectors.clientContacts.saveButton);
+ let result = await page.waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
+
+ it('should delete de contact', async() => {
+ await page.waitToClick(selectors.clientContacts.deleteFirstPhone);
+ await page.waitToClick(selectors.clientContacts.saveButton);
+ let result = await page.waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
+});
diff --git a/e2e/paths/02-client/19_summary.spec.js b/e2e/paths/02-client/19_summary.spec.js
new file mode 100644
index 000000000..11b5a298e
--- /dev/null
+++ b/e2e/paths/02-client/19_summary.spec.js
@@ -0,0 +1,80 @@
+import selectors from '../../helpers/selectors.js';
+import getBrowser from '../../helpers/puppeteer';
+
+describe('Client summary path', () => {
+ let browser;
+ let page;
+
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('employee', 'client');
+ await page.accessToSearchResult('Petter Parker');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should reach the first route summary section', async() => {
+ let url = await page.expectURL('#!/client/102/summary');
+
+ expect(url).toBe(true);
+ });
+
+ it('should display details from the client on the header', async() => {
+ await page.waitForTextInElement(selectors.clientSummary.header, 'Petter Parker');
+ const result = await page.waitToGetProperty(selectors.clientSummary.header, 'innerText');
+
+ expect(result).toContain('Petter Parker');
+ });
+
+ it('should display some basic data', async() => {
+ const result = await page.waitToGetProperty(selectors.clientSummary.email, 'innerText');
+
+ expect(result).toContain('PetterParker@mydomain.com');
+ });
+
+ it('should display fiscal address details', async() => {
+ const result = await page.waitToGetProperty(selectors.clientSummary.street, 'innerText');
+
+ expect(result).toContain('20 Ingram Street');
+ });
+
+ it('should display some fiscal data', async() => {
+ await page.waitForClassPresent(selectors.clientSummary.verifiedData, 'checked');
+ const result = await page.waitToGetProperty(selectors.clientSummary.verifiedData, 'innerText');
+
+ expect(result).toContain('Verified data');
+ });
+
+ it('should display pay method details', async() => {
+ const result = await page.waitToGetProperty(selectors.clientSummary.payMethod, 'innerText');
+
+ expect(result).toContain('PayMethod five');
+ });
+
+ it('should display default address details', async() => {
+ const result = await page.waitToGetProperty(selectors.clientSummary.defaultAdressName, 'innerText');
+
+ expect(result).toContain('Petter Parker');
+ });
+
+ it('should display web access details', async() => {
+ const result = await page.waitToGetProperty(selectors.clientSummary.userName, 'innerText');
+
+ expect(result).toContain('PetterParker');
+ });
+
+ it('should display business data', async() => {
+ const result = await page.waitToGetProperty(selectors.clientSummary.rate, 'innerText');
+
+ expect(result).toContain('%');
+ });
+
+ it('should display financial information', async() => {
+ const result = await page.waitToGetProperty(selectors.clientSummary.credit, 'innerText');
+
+ expect(result).toContain('€300.00');
+ });
+});
diff --git a/e2e/paths/03-worker/01_basicData.spec.js b/e2e/paths/03-worker/01_basicData.spec.js
new file mode 100644
index 000000000..21443c517
--- /dev/null
+++ b/e2e/paths/03-worker/01_basicData.spec.js
@@ -0,0 +1,50 @@
+import selectors from '../../helpers/selectors.js';
+import getBrowser from '../../helpers/puppeteer';
+
+describe('Worker basic data path', () => {
+ let browser;
+ let page;
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('hr', 'worker');
+ await page.accessToSearchResult('David Charles Haller');
+ await page.accessToSection('worker.card.basicData');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should edit the form', async() => {
+ await page.clearInput(selectors.workerBasicData.name);
+ await page.write(selectors.workerBasicData.name, 'David C.');
+ await page.clearInput(selectors.workerBasicData.surname);
+ await page.write(selectors.workerBasicData.surname, 'H.');
+ await page.clearInput(selectors.workerBasicData.phone);
+ await page.write(selectors.workerBasicData.phone, '444332211');
+ await page.waitToClick(selectors.workerBasicData.saveButton);
+ const result = await page.waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
+
+ it('should reload the section then check the name was edited', async() => {
+ await page.reloadSection('worker.card.basicData');
+ const result = await page.waitToGetProperty(selectors.workerBasicData.name, 'value');
+
+ expect(result).toEqual('David C.');
+ });
+
+ it('should the surname was edited', async() => {
+ const result = await page.waitToGetProperty(selectors.workerBasicData.surname, 'value');
+
+ expect(result).toEqual('H.');
+ });
+
+ it('should the phone was edited', async() => {
+ const result = await page.waitToGetProperty(selectors.workerBasicData.phone, 'value');
+
+ expect(result).toEqual('444332211');
+ });
+});
diff --git a/e2e/paths/03-worker-module/02_time_control.spec.js b/e2e/paths/03-worker/02_time_control.spec.js
similarity index 96%
rename from e2e/paths/03-worker-module/02_time_control.spec.js
rename to e2e/paths/03-worker/02_time_control.spec.js
index 6f5815665..d49ffca03 100644
--- a/e2e/paths/03-worker-module/02_time_control.spec.js
+++ b/e2e/paths/03-worker/02_time_control.spec.js
@@ -1,8 +1,7 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
-// #2047 WorkerTimeControl no suma horas
-xdescribe('Worker time control path', () => {
+describe('Worker time control path', () => {
let browser;
let page;
beforeAll(async() => {
@@ -23,7 +22,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '07:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfMonday, 'innerText');
@@ -34,7 +33,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfMonday, 'innerText');
@@ -45,7 +44,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '18:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText');
@@ -67,7 +66,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '14:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText');
@@ -78,7 +77,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfMonday, 'innerText');
@@ -108,7 +107,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '08:00';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfTuesday, 'innerText');
@@ -119,7 +118,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfTuesday, 'innerText');
@@ -130,7 +129,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfTuesday, 'innerText');
@@ -141,7 +140,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '16:00';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfTuesday, 'innerText');
@@ -161,7 +160,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '09:00';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfWednesday, 'innerText');
@@ -172,7 +171,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfWednesday, 'innerText');
@@ -183,7 +182,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfWednesday, 'innerText');
@@ -194,7 +193,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '17:00';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfWednesday, 'innerText');
@@ -214,7 +213,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '09:59';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfThursday, 'innerText');
@@ -224,7 +223,7 @@ xdescribe('Worker time control path', () => {
it(`should joyfully scan out Hank Pym for break`, async() => {
const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfThursday, 'innerText');
@@ -234,7 +233,7 @@ xdescribe('Worker time control path', () => {
it(`should joyfully scan in Hank Pym from the break`, async() => {
const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfThursday, 'innerText');
@@ -244,7 +243,7 @@ xdescribe('Worker time control path', () => {
it(`should joyfully scan out Hank Pym for the day`, async() => {
const scanTime = '17:59';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfThursday, 'innerText');
@@ -263,7 +262,7 @@ xdescribe('Worker time control path', () => {
it('should smilingly scan in Hank Pym', async() => {
const scanTime = '07:30';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfFriday, 'innerText');
@@ -273,7 +272,7 @@ xdescribe('Worker time control path', () => {
it(`should smilingly scan out Hank Pym for break`, async() => {
const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfFriday, 'innerText');
@@ -283,7 +282,7 @@ xdescribe('Worker time control path', () => {
it(`should smilingly scan in Hank Pym from the break`, async() => {
const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfFriday, 'innerText');
@@ -293,7 +292,7 @@ xdescribe('Worker time control path', () => {
it(`should smilingly scan out Hank Pym for the day`, async() => {
const scanTime = '15:30';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfFriday, 'innerText');
@@ -324,7 +323,7 @@ xdescribe('Worker time control path', () => {
it('should lovingly scan in Hank Pym', async() => {
const scanTime = '06:00';
await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSaturday, 'innerText');
@@ -334,7 +333,7 @@ xdescribe('Worker time control path', () => {
it(`should lovingly scan out Hank Pym for the day with no break to leave a bit early`, async() => {
const scanTime = '13:40';
await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSaturday, 'innerText');
@@ -353,7 +352,7 @@ xdescribe('Worker time control path', () => {
it('should gladly scan in Hank Pym', async() => {
const scanTime = '05:00';
await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSunday, 'innerText');
@@ -363,7 +362,7 @@ xdescribe('Worker time control path', () => {
it(`should gladly scan out Hank Pym for the day with no break to leave a bit early`, async() => {
const scanTime = '12:40';
await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton);
- await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
+ await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSunday, 'innerText');
diff --git a/e2e/paths/03-worker-module/01_pbx.spec.js b/e2e/paths/03-worker/03_pbx.spec.js
similarity index 80%
rename from e2e/paths/03-worker-module/01_pbx.spec.js
rename to e2e/paths/03-worker/03_pbx.spec.js
index 7b0de917c..83849a5dd 100644
--- a/e2e/paths/03-worker-module/01_pbx.spec.js
+++ b/e2e/paths/03-worker/03_pbx.spec.js
@@ -17,8 +17,7 @@ describe('Worker pbx path', () => {
});
it('should receive an error when the extension exceeds 4 characters', async() => {
- await page.waitForContentLoaded();
- await page.write(selectors.workerPbx.extensionInput, '55555');
+ await page.write(selectors.workerPbx.extension, '55555');
await page.waitToClick(selectors.workerPbx.saveButton);
const result = await page.waitForLastSnackbar();
@@ -26,8 +25,8 @@ describe('Worker pbx path', () => {
});
it('should sucessfully save the changes', async() => {
- await page.clearInput(selectors.workerPbx.extensionInput);
- await page.write(selectors.workerPbx.extensionInput, '4444');
+ await page.clearInput(selectors.workerPbx.extension);
+ await page.write(selectors.workerPbx.extension, '4444');
await page.waitToClick(selectors.workerPbx.saveButton);
const result = await page.waitForLastSnackbar();
diff --git a/e2e/paths/04-item-module/01_summary.spec.js b/e2e/paths/04-item/01_summary.spec.js
similarity index 91%
rename from e2e/paths/04-item-module/01_summary.spec.js
rename to e2e/paths/04-item/01_summary.spec.js
index f08900142..97fef9ca9 100644
--- a/e2e/paths/04-item-module/01_summary.spec.js
+++ b/e2e/paths/04-item/01_summary.spec.js
@@ -15,8 +15,8 @@ describe('Item summary path', () => {
});
it('should search for an item', async() => {
- await page.clearInput(selectors.itemsIndex.searchItemInput);
- await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon longbow 2m');
+ await page.clearInput(selectors.itemsIndex.topbarSearch);
+ await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon longbow 2m');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const result = await page.countElement(selectors.itemsIndex.searchResult);
@@ -68,15 +68,14 @@ describe('Item summary path', () => {
});
it(`should close the summary popup`, async() => {
- await page.keyboard.press('Escape');
- await page.waitUntilNotPresent(selectors.itemSummary.basicData);
- await page.waitFor(selectors.itemSummary.basicData, {hidden: true});
+ await page.closePopup();
+ await page.waitForSelector(selectors.itemSummary.basicData, {hidden: true});
});
it('should search for other item', async() => {
await page.clearInput('vn-searchbar');
await page.waitToClick(selectors.itemsIndex.searchButton);
- await page.write(selectors.itemsIndex.searchItemInput, 'Melee weapon combat fist 15cm');
+ await page.write(selectors.itemsIndex.topbarSearch, 'Melee weapon combat fist 15cm');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const result = await page.countElement(selectors.itemsIndex.searchResult);
@@ -125,16 +124,15 @@ describe('Item summary path', () => {
});
it(`should now close the summary popup`, async() => {
- await page.keyboard.press('Escape');
+ await page.closePopup();
await page.waitForSelector(selectors.itemSummary.basicData, {hidden: true});
});
it(`should navigate to the one of the items detailed section`, async() => {
await page.waitToClick(selectors.itemsIndex.searchResult);
- await page.waitForURL('summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('summary');
- expect(url.hash).toContain('summary');
+ expect(url).toBe(true);
});
it(`should check the descritor edit button is not visible for employee`, async() => {
diff --git a/e2e/paths/04-item-module/02_basic_data.spec.js b/e2e/paths/04-item/02_basic_data.spec.js
similarity index 56%
rename from e2e/paths/04-item-module/02_basic_data.spec.js
rename to e2e/paths/04-item/02_basic_data.spec.js
index ab4b224f0..64827ed9b 100644
--- a/e2e/paths/04-item-module/02_basic_data.spec.js
+++ b/e2e/paths/04-item/02_basic_data.spec.js
@@ -21,16 +21,16 @@ describe('Item Edit basic data path', () => {
});
it(`should edit the item basic data`, async() => {
- await page.clearInput(selectors.itemBasicData.nameInput);
- await page.write(selectors.itemBasicData.nameInput, 'Rose of Purity');
- await page.autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Anthurium');
- await page.autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares');
- await page.clearInput(selectors.itemBasicData.relevancyInput);
- await page.write(selectors.itemBasicData.relevancyInput, '1');
- await page.autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain');
- await page.autocompleteSearch(selectors.itemBasicData.expenseAutocomplete, 'Alquiler VNH');
- await page.clearInput(selectors.itemBasicData.longNameInput);
- await page.write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity');
+ await page.clearInput(selectors.itemBasicData.name);
+ await page.write(selectors.itemBasicData.name, 'Rose of Purity');
+ await page.autocompleteSearch(selectors.itemBasicData.type, 'Anthurium');
+ await page.autocompleteSearch(selectors.itemBasicData.intrastat, 'Coral y materiales similares');
+ await page.clearInput(selectors.itemBasicData.relevancy);
+ await page.write(selectors.itemBasicData.relevancy, '1');
+ await page.autocompleteSearch(selectors.itemBasicData.origin, 'Spain');
+ await page.autocompleteSearch(selectors.itemBasicData.expense, 'Alquiler VNH');
+ await page.clearInput(selectors.itemBasicData.longName);
+ await page.write(selectors.itemBasicData.longName, 'RS Rose of Purity');
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox);
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
@@ -39,52 +39,71 @@ describe('Item Edit basic data path', () => {
expect(result).toEqual('Data saved!');
}, 20000);
+ it(`should create a new intrastat`, async() => {
+ await page.waitToClick(selectors.itemBasicData.newIntrastatButton);
+ await page.write(selectors.itemBasicData.newIntrastatId, '588420239');
+ await page.write(selectors.itemBasicData.newIntrastatDescription, 'Tropical Flowers');
+ await page.waitToClick(selectors.itemBasicData.acceptIntrastatButton);
+ await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers');
+ let newcode = await page.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
+
+ expect(newcode).toEqual('588420239 Tropical Flowers');
+ });
+
+ it(`should save with the new intrastat`, async() => {
+ await page.waitFor(250);
+ await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers');
+ await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
+ const result = await page.waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
+
it(`should confirm the item name was edited`, async() => {
await page.reloadSection('item.card.basicData');
- await page.waitForContentLoaded();
- const result = await page.waitToGetProperty(`${selectors.itemBasicData.nameInput} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.itemBasicData.name, 'value');
expect(result).toEqual('Rose of Purity');
});
it(`should confirm the item type was edited`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.type, 'value');
expect(result).toEqual('Anthurium');
});
- it(`should confirm the item intrastad was edited`, async() => {
+ it(`should confirm the item intrastat was edited`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
- expect(result).toEqual('5080000 Coral y materiales similares');
+ expect(result).toEqual('588420239 Tropical Flowers');
});
it(`should confirm the item relevancy was edited`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBasicData.relevancyInput} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.relevancy, 'value');
expect(result).toEqual('1');
});
it(`should confirm the item origin was edited`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.origin, 'value');
expect(result).toEqual('Spain');
});
it(`should confirm the item expence was edited`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBasicData.expenseAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.expense, 'value');
expect(result).toEqual('Alquiler VNH');
});
it(`should confirm the item long name was edited`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBasicData.longNameInput} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.longName, 'value');
expect(result).toEqual('RS Rose of Purity');
});
diff --git a/e2e/paths/04-item-module/03_tax.spec.js b/e2e/paths/04-item/03_tax.spec.js
similarity index 73%
rename from e2e/paths/04-item-module/03_tax.spec.js
rename to e2e/paths/04-item/03_tax.spec.js
index 3f3b387d4..ef2d68096 100644
--- a/e2e/paths/04-item-module/03_tax.spec.js
+++ b/e2e/paths/04-item/03_tax.spec.js
@@ -17,9 +17,9 @@ describe('Item edit tax path', () => {
});
it(`should add the item tax to all countries`, async() => {
- await page.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'General VAT');
- await page.autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT');
- await page.autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'General VAT');
+ await page.autocompleteSearch(selectors.itemTax.firstClass, 'General VAT');
+ await page.autocompleteSearch(selectors.itemTax.secondClass, 'General VAT');
+ await page.autocompleteSearch(selectors.itemTax.thirdClass, 'General VAT');
await page.waitToClick(selectors.itemTax.submitTaxButton);
const result = await page.waitForLastSnackbar();
@@ -28,35 +28,35 @@ describe('Item edit tax path', () => {
it(`should confirm the first item tax class was edited`, async() => {
await page.reloadSection('item.card.tax');
- const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
+ const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('General VAT');
});
it(`should confirm the second item tax class was edited`, async() => {
const secondVatType = await page
- .waitToGetProperty(`${selectors.itemTax.secondClassAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemTax.secondClass, 'value');
expect(secondVatType).toEqual('General VAT');
});
it(`should confirm the third item tax class was edited`, async() => {
const thirdVatType = await page
- .waitToGetProperty(`${selectors.itemTax.thirdClassAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemTax.thirdClass, 'value');
expect(thirdVatType).toEqual('General VAT');
});
it(`should edit the first class without saving the form`, async() => {
- await page.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT');
- const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
+ await page.autocompleteSearch(selectors.itemTax.firstClass, 'Reduced VAT');
+ const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('Reduced VAT');
});
it(`should now click the undo changes button and see the changes works`, async() => {
await page.waitToClick(selectors.itemTax.undoChangesButton);
- const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
+ const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('General VAT');
});
diff --git a/e2e/paths/04-item-module/04_tags.spec.js b/e2e/paths/04-item/04_tags.spec.js
similarity index 66%
rename from e2e/paths/04-item-module/04_tags.spec.js
rename to e2e/paths/04-item/04_tags.spec.js
index 1665d3bab..098ac75eb 100644
--- a/e2e/paths/04-item-module/04_tags.spec.js
+++ b/e2e/paths/04-item/04_tags.spec.js
@@ -19,10 +19,10 @@ describe('Item create tags path', () => {
it(`should create a new tag and delete a former one`, async() => {
await page.waitToClick(selectors.itemTags.fourthRemoveTagButton);
await page.waitToClick(selectors.itemTags.addItemTagButton);
- await page.autocompleteSearch(selectors.itemTags.seventhTagAutocomplete, 'Ancho de la base');
- await page.write(selectors.itemTags.seventhValueInput, '50');
- await page.clearInput(selectors.itemTags.seventhRelevancyInput);
- await page.write(selectors.itemTags.seventhRelevancyInput, '4');
+ await page.autocompleteSearch(selectors.itemTags.seventhTag, 'Ancho de la base');
+ await page.write(selectors.itemTags.seventhValue, '50');
+ await page.clearInput(selectors.itemTags.seventhRelevancy);
+ await page.write(selectors.itemTags.seventhRelevancy, '4');
await page.waitToClick(selectors.itemTags.submitItemTagsButton);
const result = await page.waitForLastSnackbar();
@@ -32,30 +32,30 @@ describe('Item create tags path', () => {
it(`should confirm the fourth row data is the expected one`, async() => {
await page.reloadSection('item.card.tags');
await page.wait('vn-item-tags');
- let result = await page.waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value');
+ let result = await page.waitToGetProperty(selectors.itemTags.fourthTag, 'value');
expect(result).toEqual('Ancho de la base');
result = await page
- .waitToGetProperty(`${selectors.itemTags.fourthValueInput} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.fourthValue, 'value');
expect(result).toEqual('50');
result = await page
- .waitToGetProperty(`${selectors.itemTags.fourthRelevancyInput} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.fourthRelevancy, 'value');
expect(result).toEqual('4');
});
it(`should confirm the fifth row data is the expected one`, async() => {
let tag = await page
- .waitToGetProperty(`${selectors.itemTags.fifthTagAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.fifthTag, 'value');
let value = await page
- .waitToGetProperty(`${selectors.itemTags.fifthValueInput} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.fifthValue, 'value');
let relevancy = await page
- .waitToGetProperty(`${selectors.itemTags.fifthRelevancyInput} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.fifthRelevancy, 'value');
expect(tag).toEqual('Color');
expect(value).toEqual('Brown');
@@ -64,13 +64,13 @@ describe('Item create tags path', () => {
it(`should confirm the sixth row data is the expected one`, async() => {
let tag = await page
- .waitToGetProperty(`${selectors.itemTags.sixthTagAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.sixthTag, 'value');
let value = await page
- .waitToGetProperty(`${selectors.itemTags.sixthValueInput} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.sixthValue, 'value');
let relevancy = await page
- .waitToGetProperty(`${selectors.itemTags.sixthRelevancyInput} input`, 'value');
+ .waitToGetProperty(selectors.itemTags.sixthRelevancy, 'value');
expect(tag).toEqual('Categoria');
expect(value).toEqual('+1 precission');
diff --git a/e2e/paths/04-item-module/05_niche.spec.js b/e2e/paths/04-item/05_niche.spec.js
similarity index 66%
rename from e2e/paths/04-item-module/05_niche.spec.js
rename to e2e/paths/04-item/05_niche.spec.js
index 345b5eb8c..4da8ed5fe 100644
--- a/e2e/paths/04-item-module/05_niche.spec.js
+++ b/e2e/paths/04-item/05_niche.spec.js
@@ -17,11 +17,11 @@ describe('Item create niche path', () => {
});
it(`should click create a new niche and delete a former one`, async() => {
- await page.waitForTextInInput(selectors.itemNiches.firstWarehouseAutocomplete, 'Warehouse One');
+ await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemNiches.addNicheButton);
await page.waitToClick(selectors.itemNiches.secondNicheRemoveButton);
- await page.autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two');
- await page.write(selectors.itemNiches.thirdCodeInput, 'A4');
+ await page.autocompleteSearch(selectors.itemNiches.thirdWarehouse, 'Warehouse Two');
+ await page.write(selectors.itemNiches.thirdCode, 'A4');
await page.waitToClick(selectors.itemNiches.submitNichesButton);
const result = await page.waitForLastSnackbar();
@@ -30,36 +30,36 @@ describe('Item create niche path', () => {
it(`should confirm the first niche is the expected one`, async() => {
await page.reloadSection('item.card.niche');
- await page.waitForTextInInput(selectors.itemNiches.firstWarehouseAutocomplete, 'Warehouse One');
+ await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
let result = await page
- .waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemNiches.firstWarehouse, 'value');
expect(result).toEqual('Warehouse One');
result = await page
- .waitToGetProperty(`${selectors.itemNiches.firstCodeInput} input`, 'value');
+ .waitToGetProperty(selectors.itemNiches.firstCode, 'value');
expect(result).toEqual('A1');
});
it(`should confirm the second niche is the expected one`, async() => {
let result = await page
- .waitToGetProperty(`${selectors.itemNiches.secondWarehouseAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemNiches.secondWarehouse, 'value');
expect(result).toEqual('Warehouse Three');
result = await page
- .waitToGetProperty(`${selectors.itemNiches.secondCodeInput} input`, 'value');
+ .waitToGetProperty(selectors.itemNiches.secondCode, 'value');
expect(result).toEqual('A3');
});
it(`should confirm the third niche is the expected one`, async() => {
let result = await page
- .waitToGetProperty(`${selectors.itemNiches.thirdWarehouseAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemNiches.thirdWarehouse, 'value');
expect(result).toEqual('Warehouse Two');
result = await page
- .waitToGetProperty(`${selectors.itemNiches.thirdCodeInput} input`, 'value');
+ .waitToGetProperty(selectors.itemNiches.thirdCode, 'value');
expect(result).toEqual('A4');
});
diff --git a/e2e/paths/04-item-module/06_botanical.spec.js b/e2e/paths/04-item/06_botanical.spec.js
similarity index 64%
rename from e2e/paths/04-item-module/06_botanical.spec.js
rename to e2e/paths/04-item/06_botanical.spec.js
index 407dd6fc7..edcc94f28 100644
--- a/e2e/paths/04-item-module/06_botanical.spec.js
+++ b/e2e/paths/04-item/06_botanical.spec.js
@@ -17,9 +17,9 @@ describe('Item Create botanical path', () => {
});
it(`should create a new botanical for the item`, async() => {
- await page.write(selectors.itemBotanical.botanicalInput, 'Cicuta maculata');
- await page.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia');
- await page.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata');
+ await page.write(selectors.itemBotanical.botanical, 'Cicuta maculata');
+ await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abelia');
+ await page.autocompleteSearch(selectors.itemBotanical.species, 'dealbata');
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
const result = await page.waitForLastSnackbar();
@@ -28,33 +28,33 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was created`, async() => {
await page.reloadSection('item.card.botanical');
- await page.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Cicuta maculata');
+ await page.waitForTextInField(selectors.itemBotanical.botanical, 'Cicuta maculata');
const result = await page
- .waitToGetProperty(`${selectors.itemBotanical.botanicalInput} input`, 'value');
+ .waitToGetProperty(selectors.itemBotanical.botanical, 'value');
expect(result).toEqual('Cicuta maculata');
});
it(`should confirm the Genus for the item was created`, async() => {
- await page.waitForTextInInput(selectors.itemBotanical.genusAutocomplete, 'Abelia');
+ await page.waitForTextInField(selectors.itemBotanical.genus, 'Abelia');
const result = await page
- .waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBotanical.genus, 'value');
expect(result).toEqual('Abelia');
});
it(`should confirm the Species for the item was created`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBotanical.species, 'value');
expect(result).toEqual('dealbata');
});
it(`should edit botanical for the item`, async() => {
- await page.clearInput(selectors.itemBotanical.botanicalInput);
- await page.write(selectors.itemBotanical.botanicalInput, 'Herp Derp');
- await page.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies');
- await page.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens');
+ await page.clearInput(selectors.itemBotanical.botanical);
+ await page.write(selectors.itemBotanical.botanical, 'Herp Derp');
+ await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abies');
+ await page.autocompleteSearch(selectors.itemBotanical.species, 'decurrens');
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
const result = await page.waitForLastSnackbar();
@@ -63,24 +63,24 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was edited`, async() => {
await page.reloadSection('item.card.botanical');
- await page.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Herp Derp');
+ await page.waitForTextInField(selectors.itemBotanical.botanical, 'Herp Derp');
const result = await page
- .waitToGetProperty(`${selectors.itemBotanical.botanicalInput} input`, 'value');
+ .waitToGetProperty(selectors.itemBotanical.botanical, 'value');
expect(result).toEqual('Herp Derp');
});
it(`should confirm the Genus for the item was edited`, async() => {
- await page.waitForTextInInput(selectors.itemBotanical.genusAutocomplete, 'Abies');
+ await page.waitForTextInField(selectors.itemBotanical.genus, 'Abies');
const result = await page
- .waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBotanical.genus, 'value');
expect(result).toEqual('Abies');
});
it(`should confirm the Species for the item was edited`, async() => {
const result = await page
- .waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBotanical.species, 'value');
expect(result).toEqual('decurrens');
});
diff --git a/e2e/paths/04-item-module/07_barcode.spec.js b/e2e/paths/04-item/07_barcode.spec.js
similarity index 83%
rename from e2e/paths/04-item-module/07_barcode.spec.js
rename to e2e/paths/04-item/07_barcode.spec.js
index dfe16f384..7750b4b6d 100644
--- a/e2e/paths/04-item-module/07_barcode.spec.js
+++ b/e2e/paths/04-item/07_barcode.spec.js
@@ -19,7 +19,7 @@ describe('Item Create barcodes path', () => {
it(`should click create a new code and delete a former one`, async() => {
await page.waitToClick(selectors.itemBarcodes.firstCodeRemoveButton);
await page.waitToClick(selectors.itemBarcodes.addBarcodeButton);
- await page.write(selectors.itemBarcodes.thirdCodeInput, '5');
+ await page.write(selectors.itemBarcodes.thirdCode, '5');
await page.waitToClick(selectors.itemBarcodes.submitBarcodesButton);
const result = await page.waitForLastSnackbar();
@@ -28,9 +28,9 @@ describe('Item Create barcodes path', () => {
it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => {
await page.reloadSection('item.card.itemBarcode');
- await page.waitForTextInInput(selectors.itemBarcodes.thirdCodeInput, '5');
+ await page.waitForTextInField(selectors.itemBarcodes.thirdCode, '5');
const result = await page
- .waitToGetProperty(`${selectors.itemBarcodes.thirdCodeInput} input`, 'value');
+ .waitToGetProperty(selectors.itemBarcodes.thirdCode, 'value');
expect(result).toEqual('5');
});
diff --git a/e2e/paths/04-item-module/08_create_and_clone.spec.js b/e2e/paths/04-item/08_create_and_clone.spec.js
similarity index 67%
rename from e2e/paths/04-item-module/08_create_and_clone.spec.js
rename to e2e/paths/04-item/08_create_and_clone.spec.js
index 209e4f1cf..32d0ff23b 100644
--- a/e2e/paths/04-item-module/08_create_and_clone.spec.js
+++ b/e2e/paths/04-item/08_create_and_clone.spec.js
@@ -16,8 +16,8 @@ describe('Item Create/Clone path', () => {
describe('create', () => {
it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => {
- await page.clearInput(selectors.itemsIndex.searchItemInput);
- await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet');
+ await page.clearInput(selectors.itemsIndex.topbarSearch);
+ await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0);
const result = await page.countElement(selectors.itemsIndex.searchResult);
@@ -27,34 +27,30 @@ describe('Item Create/Clone path', () => {
it('should access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
- await page.wait(selectors.itemCreateView.createButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/item/create');
- expect(url.hash).toEqual('#!/item/create');
+ expect(url).toBe(true);
});
it('should return to the item index by clickig the cancel button', async() => {
await page.waitToClick(selectors.itemCreateView.cancelButton);
- await page.wait(selectors.itemsIndex.createItemButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/item/index');
- expect(url.hash).toEqual('#!/item/index');
+ expect(url).toBe(true);
});
it('should now access to the create item view by clicking the create floating button', async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.itemsIndex.createItemButton);
- await page.wait(selectors.itemCreateView.createButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/item/create');
- expect(url.hash).toEqual('#!/item/create');
+ expect(url).toBe(true);
});
it('should create the Infinity Gauntlet item', async() => {
await page.write(selectors.itemCreateView.temporalName, 'Infinity Gauntlet');
- await page.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo');
- await page.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares');
- await page.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand');
+ await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
+ await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
+ await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.waitToClick(selectors.itemCreateView.createButton);
const result = await page.waitForLastSnackbar();
@@ -63,23 +59,23 @@ describe('Item Create/Clone path', () => {
it('should confirm Infinity Gauntlet item was created', async() => {
let result = await page
- .waitToGetProperty(`${selectors.itemBasicData.nameInput} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.name, 'value');
expect(result).toEqual('Infinity Gauntlet');
result = await page
- .waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.type, 'value');
expect(result).toEqual('Crisantemo');
result = await page
- .waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
expect(result).toEqual('5080000 Coral y materiales similares');
result = await page
- .waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.itemBasicData.origin, 'value');
expect(result).toEqual('Holand');
});
@@ -89,15 +85,14 @@ describe('Item Create/Clone path', () => {
it('should return to the items index by clicking the return to items button', async() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton);
- await page.waitForURL('#!/item/index');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/item/index');
- expect(url.hash).toContain('#!/item/index');
+ expect(url).toBe(true);
});
it(`should search for the item Infinity Gauntlet`, async() => {
- await page.clearInput(selectors.itemsIndex.searchItemInput);
- await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet');
+ await page.clearInput(selectors.itemsIndex.topbarSearch);
+ await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const result = await page.countElement(selectors.itemsIndex.searchResult);
@@ -109,16 +104,15 @@ describe('Item Create/Clone path', () => {
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchResultCloneButton);
await page.waitToClick(selectors.itemsIndex.acceptClonationAlertButton);
- await page.waitForURL('tags');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('tags');
- expect(url.hash).toContain('tags');
+ expect(url).toBe(true);
});
it('should search for the item Infinity Gauntlet and find two', async() => {
await page.waitToClick(selectors.itemTags.goToItemIndexButton);
- await page.clearInput(selectors.itemsIndex.searchItemInput);
- await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet');
+ await page.clearInput(selectors.itemsIndex.topbarSearch);
+ await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2);
const result = await page.countElement(selectors.itemsIndex.searchResult);
diff --git a/e2e/paths/04-item-module/09_regularize.spec.js b/e2e/paths/04-item/09_regularize.spec.js
similarity index 78%
rename from e2e/paths/04-item-module/09_regularize.spec.js
rename to e2e/paths/04-item/09_regularize.spec.js
index 4c023113c..7f63694b9 100644
--- a/e2e/paths/04-item-module/09_regularize.spec.js
+++ b/e2e/paths/04-item/09_regularize.spec.js
@@ -25,17 +25,16 @@ describe('Item regularize path', () => {
it('should check the local settings were saved', async() => {
const userLocalWarehouse = await page
- .waitToGetProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
+ .waitToGetProperty(selectors.globalItems.userLocalWarehouse, 'value');
- await page.keyboard.press('Escape');
- await page.waitForSelector('.user-popover.vn-popover', {hidden: true});
+ await page.closePopup();
expect(userLocalWarehouse).toContain('Warehouse Four');
});
it('should search for an specific item', async() => {
- await page.clearInput(selectors.itemsIndex.searchItemInput);
- await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm');
+ await page.clearInput(selectors.itemsIndex.topbarSearch);
+ await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon pistol 9mm');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const resultCount = await page.countElement(selectors.itemsIndex.searchResult);
@@ -46,23 +45,22 @@ describe('Item regularize path', () => {
it(`should click on the search result to access to the item tax`, async() => {
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
await page.waitToClick(selectors.itemsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it('should open the regularize dialog and check the warehouse matches the local user settings', async() => {
await page.waitToClick(selectors.itemDescriptor.moreMenu);
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
- const result = await page.waitToGetProperty(`${selectors.itemDescriptor.regularizeWarehouseAutocomplete} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.itemDescriptor.regularizeWarehouse, 'value');
expect(result).toEqual('Warehouse Four');
});
it('should regularize the item', async() => {
- await page.write(selectors.itemDescriptor.regularizeQuantityInput, '100');
- await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One');
+ await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
+ await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
const result = await page.waitForLastSnackbar();
@@ -76,13 +74,12 @@ describe('Item regularize path', () => {
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
page.waitToClick(selectors.globalItems.ticketsButton)
]);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/ticket/index');
- expect(url.hash).toEqual('#!/ticket/index');
+ expect(url).toBe(true);
});
it('should clear the user local settings now', async() => {
- await page.waitForTransitionEnd('vn-searchbar');
await page.waitToClick(selectors.globalItems.userMenuButton);
await page.clearInput(selectors.globalItems.userConfigFirstAutocomplete);
const result = await page.waitForLastSnackbar();
@@ -92,7 +89,7 @@ describe('Item regularize path', () => {
it('should search for the ticket with alias missing', async() => {
await page.keyboard.press('Escape');
- await page.write(selectors.ticketsIndex.searchTicketInput, 'missing');
+ await page.write(selectors.ticketsIndex.topbarSearch, 'missing');
await page.keyboard.press('Enter');
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult);
@@ -103,10 +100,9 @@ describe('Item regularize path', () => {
it(`should click on the search result to access to the ticket summary`, async() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing');
await page.waitToClick(selectors.ticketsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should check the ticket sale quantity is showing a negative value`, async() => {
@@ -128,15 +124,14 @@ describe('Item regularize path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.itemsButton);
- await page.wait(selectors.itemsIndex.searchItemInput);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/item/index');
- expect(url.hash).toEqual('#!/item/index');
+ expect(url).toBe(true);
});
it('should search for the item once again', async() => {
- await page.clearInput(selectors.itemsIndex.searchItemInput);
- await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm');
+ await page.clearInput(selectors.itemsIndex.topbarSearch);
+ await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon pistol 9mm');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const resultCount = await page.countElement(selectors.itemsIndex.searchResult);
@@ -147,17 +142,16 @@ describe('Item regularize path', () => {
it(`should click on the search result to access to the item tax`, async() => {
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
await page.waitToClick(selectors.itemsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it('should regularize the item once more', async() => {
await page.waitToClick(selectors.itemDescriptor.moreMenu);
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
- await page.write(selectors.itemDescriptor.regularizeQuantityInput, '100');
- await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One');
+ await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
+ await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
const result = await page.waitForLastSnackbar();
@@ -172,13 +166,13 @@ describe('Item regularize path', () => {
page.waitToClick(selectors.globalItems.ticketsButton)
]);
await page.waitForTransitionEnd('vn-searchbar');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/ticket/index');
- expect(url.hash).toEqual('#!/ticket/index');
+ expect(url).toBe(true);
});
it('should search for the ticket with id 25 once again', async() => {
- await page.write(selectors.ticketsIndex.searchTicketInput, '25');
+ await page.write(selectors.ticketsIndex.topbarSearch, '25');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult);
@@ -189,10 +183,9 @@ describe('Item regularize path', () => {
it(`should now click on the search result to access to the ticket summary`, async() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, '25');
await page.waitToClick(selectors.ticketsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should check the ticket contains now two sales`, async() => {
diff --git a/e2e/paths/04-item-module/10_item_index.spec.js b/e2e/paths/04-item/10_item_index.spec.js
similarity index 100%
rename from e2e/paths/04-item-module/10_item_index.spec.js
rename to e2e/paths/04-item/10_item_index.spec.js
diff --git a/e2e/paths/04-item-module/11_item_log.spec.js b/e2e/paths/04-item/11_item_log.spec.js
similarity index 80%
rename from e2e/paths/04-item-module/11_item_log.spec.js
rename to e2e/paths/04-item/11_item_log.spec.js
index 8c75ed0c1..213365c12 100644
--- a/e2e/paths/04-item-module/11_item_log.spec.js
+++ b/e2e/paths/04-item/11_item_log.spec.js
@@ -15,7 +15,7 @@ describe('Item log path', () => {
});
it(`should search for the Knowledge artifact to confirm it isn't created yet`, async() => {
- await page.write(selectors.itemsIndex.searchItemInput, 'Knowledge artifact');
+ await page.write(selectors.itemsIndex.topbarSearch, 'Knowledge artifact');
await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0);
const result = await page.countElement(selectors.itemsIndex.searchResult);
@@ -25,17 +25,16 @@ describe('Item log path', () => {
it('should access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
- await page.wait(selectors.itemCreateView.createButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/item/create');
- expect(url.hash).toEqual('#!/item/create');
+ expect(url).toBe(true);
});
it('should create the Knowledge artifact item', async() => {
await page.write(selectors.itemCreateView.temporalName, 'Knowledge artifact');
- await page.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo');
- await page.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares');
- await page.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand');
+ await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
+ await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
+ await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.waitToClick(selectors.itemCreateView.createButton);
const result = await page.waitForLastSnackbar();
@@ -45,19 +44,17 @@ describe('Item log path', () => {
it('should return to the items index by clicking the return to items button', async() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton);
- await page.waitForURL('#!/item/index');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/item/index');
- expect(url.hash).toContain('#!/item/index');
+ expect(url).toBe(true);
});
it(`should search for the created item and navigate to it's log section`, async() => {
await page.accessToSearchResult('Knowledge artifact');
await page.accessToSection('item.card.log');
- await page.waitForURL('/log');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/log');
- expect(url.hash).toContain('/log');
+ expect(url).toBe(true);
});
it(`should confirm the log is showing 5 entries`, async() => {
diff --git a/e2e/paths/04-item-module/12_descriptor.spec.js b/e2e/paths/04-item/12_descriptor.spec.js
similarity index 100%
rename from e2e/paths/04-item-module/12_descriptor.spec.js
rename to e2e/paths/04-item/12_descriptor.spec.js
diff --git a/e2e/paths/05-ticket-module/01-sale/01_list_sales.spec.js b/e2e/paths/05-ticket/01-sale/01_list_sales.spec.js
similarity index 99%
rename from e2e/paths/05-ticket-module/01-sale/01_list_sales.spec.js
rename to e2e/paths/05-ticket/01-sale/01_list_sales.spec.js
index aefdaa4cb..766ca1a18 100644
--- a/e2e/paths/05-ticket-module/01-sale/01_list_sales.spec.js
+++ b/e2e/paths/05-ticket/01-sale/01_list_sales.spec.js
@@ -18,7 +18,6 @@ describe('Ticket List sale path', () => {
});
it('should confirm the first ticket sale contains the colour tag', async() => {
- await page.waitForContentLoaded();
const value = await page
.waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText');
diff --git a/e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js
similarity index 98%
rename from e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js
rename to e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js
index 3ef2b1c3d..f2265797c 100644
--- a/e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js
+++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js
@@ -21,7 +21,7 @@ xdescribe('Ticket Edit sale path', () => {
it(`should click on the first sale claim icon to navigate over there`, async() => {
const url = await nightmare
.waitToClick(selectors.ticketSales.firstSaleClaimIcon)
- .wait(selectors.claimBasicData.claimStateAutocomplete)
+ .wait(selectors.claimBasicData.claimState)
.parsedUrl();
expect(url.hash).toEqual('#!/claim/2/basic-data');
@@ -32,7 +32,7 @@ xdescribe('Ticket Edit sale path', () => {
.waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible)
.waitToClick(selectors.globalItems.ticketsButton)
- .wait(selectors.ticketsIndex.searchTicketInput)
+ .wait(selectors.ticketsIndex.topbarSearch)
.parsedUrl();
expect(url.hash).toEqual('#!/ticket/index');
@@ -196,7 +196,7 @@ xdescribe('Ticket Edit sale path', () => {
.waitToClick(selectors.ticketSales.thirdSaleCheckbox)
.waitToClick(selectors.ticketSales.moreMenu)
.waitToClick(selectors.ticketSales.moreMenuCreateClaim)
- .wait(selectors.claimBasicData.claimStateAutocomplete)
+ .wait(selectors.claimBasicData.claimState)
.parsedUrl();
expect(url.hash).toContain('basic-data');
@@ -228,7 +228,7 @@ xdescribe('Ticket Edit sale path', () => {
.waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible)
.waitToClick(selectors.globalItems.ticketsButton)
- .wait(selectors.ticketsIndex.searchTicketInput)
+ .wait(selectors.ticketsIndex.topbarSearch)
.parsedUrl();
expect(url.hash).toEqual('#!/ticket/index');
diff --git a/e2e/paths/05-ticket-module/01_observations.spec.js b/e2e/paths/05-ticket/01_observations.spec.js
similarity index 79%
rename from e2e/paths/05-ticket-module/01_observations.spec.js
rename to e2e/paths/05-ticket/01_observations.spec.js
index 1215e6423..cccfa8b67 100644
--- a/e2e/paths/05-ticket-module/01_observations.spec.js
+++ b/e2e/paths/05-ticket/01_observations.spec.js
@@ -18,25 +18,24 @@ describe('Ticket Create notes path', () => {
});
it('should create a new note', async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketNotes.addNoteButton);
- await page.autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one');
- await page.write(selectors.ticketNotes.firstDescriptionInput, 'description');
+ await page.autocompleteSearch(selectors.ticketNotes.firstNoteType, 'observation one');
+ await page.write(selectors.ticketNotes.firstDescription, 'description');
await page.waitToClick(selectors.ticketNotes.submitNotesButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
- }, 15000);
+ });
it('should confirm the note is the expected one', async() => {
await page.reloadSection('ticket.card.observation');
const result = await page
- .waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.ticketNotes.firstNoteType, 'value');
expect(result).toEqual('observation one');
const firstDescription = await page
- .waitToGetProperty(`${selectors.ticketNotes.firstDescriptionInput} input`, 'value');
+ .waitToGetProperty(selectors.ticketNotes.firstDescription, 'value');
expect(firstDescription).toEqual('description');
});
diff --git a/e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js
similarity index 100%
rename from e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js
rename to e2e/paths/05-ticket/02_expeditions_and_log.spec.js
diff --git a/e2e/paths/05-ticket-module/04_packages.spec.js b/e2e/paths/05-ticket/04_packages.spec.js
similarity index 76%
rename from e2e/paths/05-ticket-module/04_packages.spec.js
rename to e2e/paths/05-ticket/04_packages.spec.js
index a4b52c3a4..fd2945877 100644
--- a/e2e/paths/05-ticket-module/04_packages.spec.js
+++ b/e2e/paths/05-ticket/04_packages.spec.js
@@ -20,7 +20,7 @@ describe('Ticket Create packages path', () => {
it(`should attempt create a new package but receive an error if package is blank`, async() => {
await page.waitToClick(selectors.ticketPackages.firstRemovePackageButton);
await page.waitToClick(selectors.ticketPackages.addPackageButton);
- await page.write(selectors.ticketPackages.firstQuantityInput, '99');
+ await page.write(selectors.ticketPackages.firstQuantity, '99');
await page.waitToClick(selectors.ticketPackages.savePackagesButton);
const result = await page.waitForLastSnackbar();
@@ -28,8 +28,8 @@ describe('Ticket Create packages path', () => {
});
it(`should delete the first package and receive and error to save a new one with blank quantity`, async() => {
- await page.clearInput(selectors.ticketPackages.firstQuantityInput);
- await page.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Container medical box 1m');
+ await page.clearInput(selectors.ticketPackages.firstQuantity);
+ await page.autocompleteSearch(selectors.ticketPackages.firstPackage, 'Container medical box 1m');
await page.waitToClick(selectors.ticketPackages.savePackagesButton);
const result = await page.waitForLastSnackbar();
@@ -40,14 +40,14 @@ describe('Ticket Create packages path', () => {
const result = await page
.evaluate(selector => {
return document.querySelector(`${selector} input`).checkValidity();
- }, selectors.ticketPackages.firstQuantityInput);
+ }, selectors.ticketPackages.firstQuantity);
expect(result).toBeTruthy();
});
it(`should create a new package with correct data`, async() => {
- await page.clearInput(selectors.ticketPackages.firstQuantityInput);
- await page.write(selectors.ticketPackages.firstQuantityInput, '-99');
+ await page.clearInput(selectors.ticketPackages.firstQuantity);
+ await page.write(selectors.ticketPackages.firstQuantity, '-99');
await page.waitToClick(selectors.ticketPackages.savePackagesButton);
const result = await page.waitForLastSnackbar();
@@ -56,15 +56,15 @@ describe('Ticket Create packages path', () => {
it(`should confirm the first select is the expected one`, async() => {
await page.reloadSection('ticket.card.package');
- await page.waitForTextInInput(selectors.ticketPackages.firstPackageAutocomplete, 'Container medical box 1m');
- const result = await page.waitToGetProperty(`${selectors.ticketPackages.firstPackageAutocomplete} input`, 'value');
+ await page.waitForTextInField(selectors.ticketPackages.firstPackage, 'Container medical box 1m');
+ const result = await page.waitToGetProperty(selectors.ticketPackages.firstPackage, 'value');
expect(result).toEqual('7 : Container medical box 1m');
});
it(`should confirm the first quantity is just a number and the string part was ignored by the imput number`, async() => {
- await page.waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '-99');
- const result = await page.waitToGetProperty(`${selectors.ticketPackages.firstQuantityInput} input`, 'value');
+ await page.waitForTextInField(selectors.ticketPackages.firstQuantity, '-99');
+ const result = await page.waitToGetProperty(selectors.ticketPackages.firstQuantity, 'value');
expect(result).toEqual('-99');
});
diff --git a/e2e/paths/05-ticket-module/05_tracking_state.spec.js b/e2e/paths/05-ticket/05_tracking_state.spec.js
similarity index 84%
rename from e2e/paths/05-ticket-module/05_tracking_state.spec.js
rename to e2e/paths/05-ticket/05_tracking_state.spec.js
index 339042e3b..108e8776f 100644
--- a/e2e/paths/05-ticket-module/05_tracking_state.spec.js
+++ b/e2e/paths/05-ticket/05_tracking_state.spec.js
@@ -19,12 +19,11 @@ describe('Ticket Create new tracking state path', () => {
});
it('should access to the create state view by clicking the create floating button', async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketTracking.createStateButton);
- await page.waitForSelector(selectors.createStateView.stateAutocomplete, {visible: true});
- let url = await page.parsedUrl();
+ await page.waitForSelector(selectors.createStateView.state, {visible: true});
+ let url = await page.expectURL('tracking/edit');
- expect(url.hash).toContain('tracking/edit');
+ expect(url).toBe(true);
});
it(`should attempt create a new state but receive an error if state is empty`, async() => {
@@ -35,7 +34,7 @@ describe('Ticket Create new tracking state path', () => {
});
it(`should create a new state`, async() => {
- await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?');
+ await page.autocompleteSearch(selectors.createStateView.state, '¿Fecha?');
await page.waitToClick(selectors.createStateView.saveStateButton);
let result = await page.waitForLastSnackbar();
@@ -52,15 +51,14 @@ describe('Ticket Create new tracking state path', () => {
it('should now access to the create state view by clicking the create floating button', async() => {
await page.waitToClick(selectors.ticketTracking.createStateButton);
- await page.waitForURL('tracking/edit');
- let url = await page.parsedUrl();
+ let url = await page.expectURL('tracking/edit');
- expect(url.hash).toContain('tracking/edit');
+ expect(url).toBe(true);
});
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
await page.waitFor(1500);
- await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, 'Encajado');
+ await page.autocompleteSearch(selectors.createStateView.state, 'Encajado');
await page.waitToClick(selectors.createStateView.saveStateButton);
let result = await page.waitForLastSnackbar();
@@ -68,9 +66,9 @@ describe('Ticket Create new tracking state path', () => {
});
it(`should make sure the worker gets autocomplete uppon selecting the assigned state`, async() => {
- await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, 'asignado');
+ await page.autocompleteSearch(selectors.createStateView.state, 'asignado');
let result = await page
- .waitToGetProperty(`${selectors.createStateView.workerAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.createStateView.worker, 'value');
expect(result).toEqual('salesPersonNick');
});
diff --git a/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js
similarity index 65%
rename from e2e/paths/05-ticket-module/06_basic_data_steps.spec.js
rename to e2e/paths/05-ticket/06_basic_data_steps.spec.js
index 01bd80fb9..de78b9fa7 100644
--- a/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js
+++ b/e2e/paths/05-ticket/06_basic_data_steps.spec.js
@@ -18,10 +18,10 @@ describe('Ticket Edit basic data path', () => {
});
it(`should confirm the zone autocomplete is disabled unless your role is productionBoss`, async() => {
- await page.waitForSelector(selectors.ticketBasicData.zoneAutocomplete, {});
+ await page.waitForSelector(selectors.ticketBasicData.zone, {});
const disabled = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
- }, `${selectors.ticketBasicData.zoneAutocomplete} input`);
+ }, `${selectors.ticketBasicData.zone} input`);
expect(disabled).toBeTruthy();
});
@@ -34,43 +34,43 @@ describe('Ticket Edit basic data path', () => {
it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => {
await page.waitForSpinnerLoad();
- await page.wait(selectors.ticketBasicData.zoneAutocomplete);
+ await page.wait(selectors.ticketBasicData.zone);
const disabled = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
- }, `${selectors.ticketBasicData.zoneAutocomplete} input`);
+ }, `${selectors.ticketBasicData.zone} input`);
expect(disabled).toBeFalsy();
});
it(`should check the zone is for Silla247`, async() => {
let zone = await page
- .waitToGetProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.ticketBasicData.zone, 'value');
expect(zone).toContain('Zone 247 A');
});
it(`should edit the ticket agency then check there are no zones for it`, async() => {
- await page.autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Entanglement');
- let zone = await page
- .getProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value');
+ await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Entanglement');
+ await page.waitFor(1000);
+ let emptyZone = await page
+ .expectPropertyValue(selectors.ticketBasicData.zone, 'value', '');
- expect(zone.length).toEqual(0);
+ expect(emptyZone).toBeTruthy();
});
it(`should edit the ticket zone then check the agency is for the new zone`, async() => {
- await page.autocompleteSearch(selectors.ticketBasicData.zoneAutocomplete, 'Zone expensive A');
+ await page.autocompleteSearch(selectors.ticketBasicData.zone, 'Zone expensive A');
let zone = await page
- .waitToGetProperty(`${selectors.ticketBasicData.agencyAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.ticketBasicData.agency, 'value');
expect(zone).toContain('Silla247Expensive');
});
it(`should click next`, async() => {
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
- await page.waitForURL('data/step-two');
- let url = await page.parsedUrl();
+ let url = await page.expectURL('data/step-two');
- expect(url.hash).toContain('data/step-two');
+ expect(url).toBe(true);
});
it(`should have a price diference`, async() => {
@@ -80,20 +80,11 @@ describe('Ticket Edit basic data path', () => {
expect(result).toContain('-€248.00');
});
- it(`should then click next to move on to step three`, async() => {
- await page.waitToClick(selectors.ticketBasicData.nextStepButton);
- await page.waitForURL('data/step-three');
- let url = await page.parsedUrl();
-
- expect(url.hash).toContain('data/step-three');
- });
-
it(`should select a new reason for the changes made then click on finalize`, async() => {
- await page.autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'Cambiar los precios en el ticket');
+ await page.waitToClick(selectors.ticketBasicData.chargesReason);
await page.waitToClick(selectors.ticketBasicData.finalizeButton);
- await page.waitForURL('summary');
- let url = await page.parsedUrl();
+ let url = await page.expectURL('summary');
- expect(url.hash).toContain('summary');
+ expect(url).toBe(true);
});
});
diff --git a/e2e/paths/05-ticket-module/08_components.spec.js b/e2e/paths/05-ticket/08_components.spec.js
similarity index 100%
rename from e2e/paths/05-ticket-module/08_components.spec.js
rename to e2e/paths/05-ticket/08_components.spec.js
diff --git a/e2e/paths/05-ticket-module/09_weekly.spec.js b/e2e/paths/05-ticket/09_weekly.spec.js
similarity index 80%
rename from e2e/paths/05-ticket-module/09_weekly.spec.js
rename to e2e/paths/05-ticket/09_weekly.spec.js
index 0734d2f7b..3e791dc18 100644
--- a/e2e/paths/05-ticket-module/09_weekly.spec.js
+++ b/e2e/paths/05-ticket/09_weekly.spec.js
@@ -8,7 +8,7 @@ describe('Ticket descriptor path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('employee', 'ticket');
+ await page.loginAndModule('buyer', 'ticket');
await page.accessToSection('ticket.weekly.index');
});
@@ -26,7 +26,6 @@ describe('Ticket descriptor path', () => {
it('should go back to the ticket index then search and access a ticket summary', async() => {
await page.accessToSection('ticket.index');
await page.accessToSearchResult('11');
- await page.waitForContentLoaded();
});
it('should add the ticket to thursday turn using the descriptor more menu', async() => {
@@ -42,16 +41,14 @@ describe('Ticket descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
- await page.waitForContentLoaded();
+ let url = await page.expectURL('#!/ticket/index');
- const url = await page.parsedUrl();
-
- expect(url.hash).toEqual('#!/ticket/index');
+ expect(url).toBe(true);
});
it('should confirm the ticket 11 was added to thursday', async() => {
await page.accessToSection('ticket.weekly.index');
- const result = await page.waitToGetProperty(`${selectors.ticketsIndex.sixthWeeklyTicket} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
expect(result).toEqual('Thursday');
});
@@ -60,16 +57,13 @@ describe('Ticket descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
- await page.waitForURL('#!/ticket/index');
+ let url = await page.expectURL('#!/ticket/index');
- const url = await page.parsedUrl();
-
- expect(url.hash).toEqual('#!/ticket/index');
+ expect(url).toBe(true);
});
it('should now search for the ticket 11', async() => {
- await page.waitForContentLoaded();
- await page.write(selectors.ticketsIndex.searchTicketInput, '11');
+ await page.write(selectors.ticketsIndex.topbarSearch, '11');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult);
@@ -79,14 +73,12 @@ describe('Ticket descriptor path', () => {
it(`should click on the search result to access to the ticket`, async() => {
await page.waitToClick(selectors.ticketsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it('should add the ticket to saturday turn using the descriptor more menu', async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuAddToTurn);
await page.waitToClick(selectors.ticketDescriptor.saturdayButton);
@@ -99,21 +91,20 @@ describe('Ticket descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
- await page.wait(selectors.ticketsIndex.searchTicketInput);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/ticket/index');
- expect(url.hash).toEqual('#!/ticket/index');
+ expect(url).toBe(true);
});
it('should confirm the ticket 11 was added on saturday', async() => {
await page.accessToSection('ticket.weekly.index');
- const result = await page.waitToGetProperty(`${selectors.ticketsIndex.sixthWeeklyTicket} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
expect(result).toEqual('Saturday');
});
it('should now search for the weekly ticket 11', async() => {
- await page.write(selectors.ticketsIndex.searchTicketInput, '11');
+ await page.write(selectors.ticketsIndex.topbarSearch, '11');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchWeeklyResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchWeeklyResult);
diff --git a/e2e/paths/05-ticket-module/10_request.spec.js b/e2e/paths/05-ticket/10_request.spec.js
similarity index 80%
rename from e2e/paths/05-ticket-module/10_request.spec.js
rename to e2e/paths/05-ticket/10_request.spec.js
index f4fea9c2b..ce2c3a324 100644
--- a/e2e/paths/05-ticket-module/10_request.spec.js
+++ b/e2e/paths/05-ticket/10_request.spec.js
@@ -20,9 +20,9 @@ describe('Ticket purchase request path', () => {
it(`should add a new request`, async() => {
await page.waitToClick(selectors.ticketRequests.addRequestButton);
await page.write(selectors.ticketRequests.descriptionInput, 'New stuff');
- await page.write(selectors.ticketRequests.quantityInput, '99');
- await page.autocompleteSearch(selectors.ticketRequests.atenderAutocomplete, 'buyerNick');
- await page.write(selectors.ticketRequests.priceInput, '999');
+ await page.write(selectors.ticketRequests.quantity, '99');
+ await page.autocompleteSearch(selectors.ticketRequests.atender, 'buyerNick');
+ await page.write(selectors.ticketRequests.price, '999');
await page.waitToClick(selectors.ticketRequests.saveButton);
const result = await page.waitForLastSnackbar();
@@ -30,15 +30,14 @@ describe('Ticket purchase request path', () => {
});
it(`should have been redirected to the request index`, async() => {
- await page.waitForURL('/request');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/request');
- expect(url.hash).toContain('/request');
+ expect(url).toBe(true);
});
it(`should confirm the new request was added`, async() => {
await page.reloadSection('ticket.card.request.index');
- const result = await page.waitToGetProperty(`${selectors.ticketRequests.firstDescription} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.ticketRequests.firstDescription, 'value');
expect(result).toEqual('New stuff');
});
diff --git a/e2e/paths/05-ticket-module/11_diary.spec.js b/e2e/paths/05-ticket/11_diary.spec.js
similarity index 85%
rename from e2e/paths/05-ticket-module/11_diary.spec.js
rename to e2e/paths/05-ticket/11_diary.spec.js
index 363901050..b529ee1ff 100644
--- a/e2e/paths/05-ticket-module/11_diary.spec.js
+++ b/e2e/paths/05-ticket/11_diary.spec.js
@@ -17,7 +17,7 @@ xdescribe('Ticket diary path', () => {
});
it('should search for a specific ticket', async() => {
- await page.write(selectors.ticketsIndex.searchTicketInput, '1');
+ await page.write(selectors.ticketsIndex.topbarSearch, '1');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult);
@@ -28,20 +28,18 @@ xdescribe('Ticket diary path', () => {
it(`should click on the search result to access to the ticket summary`, async() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
await page.waitToClick(selectors.ticketsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should navigate to the item diary from the 1st sale item id descriptor popover`, async() => {
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
await page.waitForTransitionEnd('.vn-popover');
await page.waitToClick(selectors.ticketSummary.popoverDiaryButton);
- await page.waitForURL('/diary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/diary');
- expect(url.hash).toContain('/diary');
+ expect(url).toBe(true);
});
it(`should check the second line id is marked as message`, async() => {
@@ -59,7 +57,7 @@ xdescribe('Ticket diary path', () => {
});
it(`should change to the warehouse two and check there are sales marked as negative balance`, async() => {
- await page.autocompleteSearch(selectors.itemDiary.warehouseAutocomplete, 'Warehouse Two');
+ await page.autocompleteSearch(selectors.itemDiary.warehouse, 'Warehouse Two');
const result = await page
.waitToGetProperty(selectors.itemDiary.firstBalance, 'className');
diff --git a/e2e/paths/05-ticket-module/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js
similarity index 85%
rename from e2e/paths/05-ticket-module/12_descriptor.spec.js
rename to e2e/paths/05-ticket/12_descriptor.spec.js
index dec11dfa2..1aa0516de 100644
--- a/e2e/paths/05-ticket-module/12_descriptor.spec.js
+++ b/e2e/paths/05-ticket/12_descriptor.spec.js
@@ -17,7 +17,7 @@ describe('Ticket descriptor path', () => {
describe('Delete ticket', () => {
it('should search for an specific ticket', async() => {
- await page.write(selectors.ticketsIndex.searchTicketInput, '18');
+ await page.write(selectors.ticketsIndex.topbarSearch, '18');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult);
@@ -28,17 +28,15 @@ describe('Ticket descriptor path', () => {
it(`should click on the search result to access to the ticket summary`, async() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Cerebro');
await page.waitToClick(selectors.ticketsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should update the shipped hour using the descriptor menu`, async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuChangeShippedHour);
- await page.pickTime(selectors.ticketDescriptor.changeShippedHourInput, '08:15');
+ await page.pickTime(selectors.ticketDescriptor.changeShippedHour, '08:15');
await page.waitToClick(selectors.ticketDescriptor.acceptChangeHourButton);
const result = await page.waitForLastSnackbar();
@@ -62,13 +60,13 @@ describe('Ticket descriptor path', () => {
});
it('should have been relocated to the ticket index', async() => {
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/ticket/index');
- expect(url.hash).toEqual('#!/ticket/index');
+ expect(url).toBe(true);
});
it(`should search for the deleted ticket and check it's date`, async() => {
- await page.write(selectors.ticketsIndex.searchTicketInput, '18');
+ await page.write(selectors.ticketsIndex.topbarSearch, '18');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
await page.wait(selectors.ticketsIndex.searchResultDate);
@@ -80,8 +78,8 @@ describe('Ticket descriptor path', () => {
describe('add stowaway', () => {
it('should search for a ticket', async() => {
- await page.clearInput(selectors.ticketsIndex.searchTicketInput);
- await page.write(selectors.ticketsIndex.searchTicketInput, '16');
+ await page.clearInput(selectors.ticketsIndex.topbarSearch);
+ await page.write(selectors.ticketsIndex.topbarSearch, '16');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult);
@@ -92,10 +90,9 @@ describe('Ticket descriptor path', () => {
it(`should now click on the search result to access to the ticket summary`, async() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Many Places');
await page.waitToClick(selectors.ticketsIndex.searchResult);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it('should open the add stowaway dialog', async() => {
@@ -126,14 +123,12 @@ describe('Ticket descriptor path', () => {
it(`should navigate back to the added ticket using the descriptors ship button`, async() => {
await page.waitToClick(selectors.ticketDescriptor.shipButton);
- await page.waitForURL('#!/ticket/17/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/ticket/17/summary');
- expect(url.hash).toContain('#!/ticket/17/summary');
+ expect(url).toBe(true);
});
it('should delete the stowaway', async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteStowawayButton);
await page.waitToClick(selectors.ticketDescriptor.acceptDeleteStowawayButton);
@@ -153,10 +148,9 @@ describe('Ticket descriptor path', () => {
await page.loginAndModule('adminBoss', 'ticket');
await page.accessToSearchResult(invoiceableTicketId);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL(`ticket/${invoiceableTicketId}/summary`);
- expect(url.hash).toContain(`ticket/${invoiceableTicketId}/summary`);
+ expect(url).toBe(true);
});
it(`should make sure the ticket doesn't have an invoiceOutFk yet`, async() => {
diff --git a/e2e/paths/05-ticket-module/13_services.spec.js b/e2e/paths/05-ticket/13_services.spec.js
similarity index 85%
rename from e2e/paths/05-ticket-module/13_services.spec.js
rename to e2e/paths/05-ticket/13_services.spec.js
index 05f00249b..0a09c7aa3 100644
--- a/e2e/paths/05-ticket-module/13_services.spec.js
+++ b/e2e/paths/05-ticket/13_services.spec.js
@@ -26,11 +26,11 @@ describe('Ticket services path', () => {
const result = await page.isDisabled(selectors.ticketService.firstAddServiceTypeButton);
expect(result).toBeTruthy();
- }, 15000);
+ });
it('should receive an error if you attempt to save a service without access rights', async() => {
- await page.clearInput(selectors.ticketService.firstPriceInput);
- await page.write(selectors.ticketService.firstPriceInput, '999');
+ await page.clearInput(selectors.ticketService.firstPrice);
+ await page.write(selectors.ticketService.firstPrice, '999');
await page.waitToClick(selectors.ticketService.saveServiceButton);
const result = await page.waitForLastSnackbar();
@@ -44,17 +44,15 @@ describe('Ticket services path', () => {
await page.loginAndModule('administrative', 'ticket');
await page.accessToSearchResult(editableTicketId);
await page.accessToSection('ticket.card.service');
- await page.waitForURL('/service');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/service');
- expect(url.hash).toContain('/service');
+ expect(url).toBe(true);
});
it('should click on the add button to prepare the form to create a new service', async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketService.addServiceButton);
const result = await page
- .isVisible(selectors.ticketService.firstServiceTypeAutocomplete);
+ .isVisible(selectors.ticketService.firstServiceType);
expect(result).toBeTruthy();
});
@@ -69,7 +67,7 @@ describe('Ticket services path', () => {
it('should click on the add new service type to open the dialog', async() => {
await page.waitToClick(selectors.ticketService.firstAddServiceTypeButton);
await page.wait('.vn-dialog.shown');
- const result = await page.isVisible(selectors.ticketService.newServiceTypeNameInput);
+ const result = await page.isVisible(selectors.ticketService.newServiceTypeName);
expect(result).toBeTruthy();
});
@@ -82,10 +80,11 @@ describe('Ticket services path', () => {
});
it('should create a new service type then add price then create the service', async() => {
- await page.write(selectors.ticketService.newServiceTypeNameInput, 'Documentos');
- await page.autocompleteSearch(selectors.ticketService.newServiceTypeExpenseAutocomplete, 'Retencion');
+ await page.write(selectors.ticketService.newServiceTypeName, 'Documentos');
+ await page.autocompleteSearch(selectors.ticketService.newServiceTypeExpense, 'Retencion');
await page.waitToClick(selectors.ticketService.saveServiceTypeButton);
- await page.write(selectors.ticketService.firstPriceInput, '999');
+ await page.write(selectors.ticketService.firstPrice, '999');
+ await page.waitFor(1000); // time needed for the button to be clickable
await page.waitToClick(selectors.ticketService.saveServiceButton);
const result = await page.waitForLastSnackbar();
@@ -95,28 +94,28 @@ describe('Ticket services path', () => {
it('should confirm the service description was created correctly', async() => {
await page.reloadSection('ticket.card.service');
const result = await page
- .waitToGetProperty(`${selectors.ticketService.firstServiceTypeAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.ticketService.firstServiceType, 'value');
expect(result).toEqual('Documentos');
});
it('should confirm the service quantity was created correctly', async() => {
const result = await page
- .waitToGetProperty(`${selectors.ticketService.firstQuantityInput} input`, 'value');
+ .waitToGetProperty(selectors.ticketService.firstQuantity, 'value');
expect(result).toEqual('1');
});
it('should confirm the service price was created correctly', async() => {
const result = await page
- .waitToGetProperty(`${selectors.ticketService.firstPriceInput} input`, 'value');
+ .waitToGetProperty(selectors.ticketService.firstPrice, 'value');
expect(result).toEqual('999');
});
it('should confirm the service VAT was created correctly', async() => {
const result = await page
- .waitToGetProperty(`${selectors.ticketService.firstVatTypeAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.ticketService.firstVatType, 'value');
expect(result).toEqual('General VAT');
});
@@ -124,6 +123,7 @@ describe('Ticket services path', () => {
it('should delete the service', async() => {
await page.waitToClick(selectors.ticketService.fistDeleteServiceButton);
await page.waitForNumberOfElements(selectors.ticketService.serviceLine, 0);
+ await page.waitFor(1000); // without this wait it fails to click the save button
await page.waitToClick(selectors.ticketService.saveServiceButton);
const result = await page.waitForLastSnackbar();
diff --git a/e2e/paths/05-ticket-module/14_create_ticket.spec.js b/e2e/paths/05-ticket/14_create_ticket.spec.js
similarity index 71%
rename from e2e/paths/05-ticket-module/14_create_ticket.spec.js
rename to e2e/paths/05-ticket/14_create_ticket.spec.js
index 843658c94..e501ea0ef 100644
--- a/e2e/paths/05-ticket-module/14_create_ticket.spec.js
+++ b/e2e/paths/05-ticket/14_create_ticket.spec.js
@@ -17,18 +17,17 @@ describe('Ticket create path', () => {
it('should open the new ticket form', async() => {
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
- await page.wait(selectors.createTicketView.clientAutocomplete);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/ticket/create');
- expect(url.hash).toEqual('#!/ticket/create');
+ expect(url).toBe(true);
});
it('should succeed to create a ticket', async() => {
- await page.autocompleteSearch(selectors.createTicketView.clientAutocomplete, 'Tony Stark');
- await page.autocompleteSearch(selectors.createTicketView.addressAutocomplete, 'Tony Stark');
- await page.datePicker(selectors.createTicketView.deliveryDateInput, 1, null);
- await page.autocompleteSearch(selectors.createTicketView.warehouseAutocomplete, 'Warehouse One');
- await page.autocompleteSearch(selectors.createTicketView.agencyAutocomplete, 'Silla247');
+ await page.autocompleteSearch(selectors.createTicketView.client, 'Tony Stark');
+ await page.autocompleteSearch(selectors.createTicketView.address, 'Tony Stark');
+ await page.datePicker(selectors.createTicketView.deliveryDate, 1, null);
+ await page.autocompleteSearch(selectors.createTicketView.warehouse, 'Warehouse One');
+ await page.autocompleteSearch(selectors.createTicketView.agency, 'Silla247');
await page.waitToClick(selectors.createTicketView.createButton);
const result = await page.waitForLastSnackbar();
@@ -36,9 +35,8 @@ describe('Ticket create path', () => {
});
it('should check the url is now the summary of the ticket', async() => {
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
});
diff --git a/e2e/paths/05-ticket-module/15_create_ticket_from_client.spec.js b/e2e/paths/05-ticket/15_create_ticket_from_client.spec.js
similarity index 73%
rename from e2e/paths/05-ticket-module/15_create_ticket_from_client.spec.js
rename to e2e/paths/05-ticket/15_create_ticket_from_client.spec.js
index 2b7e15a92..28c11de3a 100644
--- a/e2e/paths/05-ticket-module/15_create_ticket_from_client.spec.js
+++ b/e2e/paths/05-ticket/15_create_ticket_from_client.spec.js
@@ -19,18 +19,17 @@ describe('Ticket create from client path', () => {
it('should click the create simple ticket on the descriptor menu', async() => {
await page.waitToClick(selectors.clientDescriptor.moreMenu);
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
- await page.waitForURL('#!/ticket/create?clientFk=102');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('clientFk=102');
- expect(url.hash).toContain('clientFk=102');
+ expect(url).toBe(true);
});
it('should check if the client details are the expected ones', async() => {
const client = await page
- .waitToGetProperty(`${selectors.createTicketView.clientAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.createTicketView.client, 'value');
const address = await page
- .waitToGetProperty(`${selectors.createTicketView.addressAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.createTicketView.address, 'value');
expect(client).toContain('Petter Parker');
diff --git a/e2e/paths/05-ticket-module/16_summary.spec.js b/e2e/paths/05-ticket/16_summary.spec.js
similarity index 92%
rename from e2e/paths/05-ticket-module/16_summary.spec.js
rename to e2e/paths/05-ticket/16_summary.spec.js
index 17c1ca71d..e7c6507d7 100644
--- a/e2e/paths/05-ticket-module/16_summary.spec.js
+++ b/e2e/paths/05-ticket/16_summary.spec.js
@@ -18,10 +18,9 @@ describe('Ticket Summary path', () => {
it('should navigate to the target ticket summary section', async() => {
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult(ticketId);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should display details from the ticket and it's client on the top of the header`, async() => {
@@ -76,10 +75,9 @@ describe('Ticket Summary path', () => {
it('should log in as production then navigate to the summary of the same ticket', async() => {
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult(ticketId);
- await page.waitForURL('/summary');
- let url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it('should click on the SET OK button', async() => {
diff --git a/e2e/paths/06-claim-module/01_basic_data.spec.js b/e2e/paths/06-claim/01_basic_data.spec.js
similarity index 74%
rename from e2e/paths/06-claim-module/01_basic_data.spec.js
rename to e2e/paths/06-claim/01_basic_data.spec.js
index f19cc28f0..9718fb583 100644
--- a/e2e/paths/06-claim-module/01_basic_data.spec.js
+++ b/e2e/paths/06-claim/01_basic_data.spec.js
@@ -8,19 +8,22 @@ describe('Claim edit basic data path', () => {
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
- await page.loginAndModule('salesAssistant', 'claim');
- await page.accessToSearchResult('1');
- await page.accessToSection('claim.card.basicData');
});
afterAll(async() => {
await browser.close();
});
+ it(`should log in as salesAssistant then reach basic data of the target claim`, async() => {
+ await page.loginAndModule('salesAssistant', 'claim');
+ await page.accessToSearchResult('1');
+ await page.accessToSection('claim.card.basicData');
+ });
+
it(`should edit claim state and observation fields`, async() => {
- await page.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado');
- await page.clearTextarea(selectors.claimBasicData.observationInput);
- await page.type(selectors.claimBasicData.observationInput, 'edited observation');
+ await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Gestionado');
+ await page.clearTextarea(selectors.claimBasicData.observation);
+ await page.write(selectors.claimBasicData.observation, 'edited observation');
await page.waitToClick(selectors.claimBasicData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -28,31 +31,30 @@ describe('Claim edit basic data path', () => {
});
it(`should have been redirected to the next section of claims as the role is salesAssistant`, async() => {
- await page.waitForURL('/detail');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/detail');
- expect(url.hash).toContain('/detail');
+ expect(url).toBe(true);
});
it('should confirm the claim state was edited', async() => {
await page.reloadSection('claim.card.basicData');
- await page.wait(selectors.claimBasicData.claimStateAutocomplete);
- const result = await page.waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value');
+ await page.wait(selectors.claimBasicData.claimState);
+ const result = await page.waitToGetProperty(selectors.claimBasicData.claimState, 'value');
expect(result).toEqual('Gestionado');
});
it('should confirm the claim observation was edited', async() => {
const result = await page
- .waitToGetProperty(selectors.claimBasicData.observationInput, 'value');
+ .waitToGetProperty(selectors.claimBasicData.observation, 'value');
expect(result).toEqual('edited observation');
});
it(`should edit the claim to leave it untainted`, async() => {
- await page.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente');
- await page.clearTextarea(selectors.claimBasicData.observationInput);
- await page.type(selectors.claimBasicData.observationInput, 'Observation one');
+ await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Pendiente');
+ await page.clearTextarea(selectors.claimBasicData.observation);
+ await page.write(selectors.claimBasicData.observation, 'Observation one');
await page.waitToClick(selectors.claimBasicData.saveButton);
const result = await page.waitForLastSnackbar();
diff --git a/e2e/paths/06-claim-module/02_development.spec.js b/e2e/paths/06-claim/02_development.spec.js
similarity index 63%
rename from e2e/paths/06-claim-module/02_development.spec.js
rename to e2e/paths/06-claim/02_development.spec.js
index 9e7dbbe36..346f88581 100644
--- a/e2e/paths/06-claim-module/02_development.spec.js
+++ b/e2e/paths/06-claim/02_development.spec.js
@@ -20,31 +20,30 @@ describe('Claim development', () => {
it('should delete a development and create a new one', async() => {
await page.waitToClick(selectors.claimDevelopment.firstDeleteDevelopmentButton);
await page.waitToClick(selectors.claimDevelopment.addDevelopmentButton);
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimReasonAutocomplete, 'Baja calidad');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResultAutocomplete, 'Deshidratacion');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResponsibleAutocomplete, 'Calidad general');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimWorkerAutocomplete, 'deliveryNick');
- await page.autocompleteSearch(selectors.claimDevelopment.secondClaimRedeliveryAutocomplete, 'Reparto');
+ await page.autocompleteSearch(selectors.claimDevelopment.secondClaimReason, 'Baja calidad');
+ await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResult, 'Deshidratacion');
+ await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResponsible, 'Calidad general');
+ await page.autocompleteSearch(selectors.claimDevelopment.secondClaimWorker, 'deliveryNick');
+ await page.autocompleteSearch(selectors.claimDevelopment.secondClaimRedelivery, 'Reparto');
await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
- }, 15000);
+ });
it(`should redirect to the next section of claims as the role is salesAssistant`, async() => {
- await page.waitForURL('/action');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/action');
- expect(url.hash).toContain('/action');
+ expect(url).toBe(true);
});
it('should edit a development', async() => {
await page.reloadSection('claim.card.development');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimReasonAutocomplete, 'Calor');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResultAutocomplete, 'Cocido');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResponsibleAutocomplete, 'Calidad general');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimWorkerAutocomplete, 'adminAssistantNick');
- await page.autocompleteSearch(selectors.claimDevelopment.firstClaimRedeliveryAutocomplete, 'Cliente');
+ await page.autocompleteSearch(selectors.claimDevelopment.firstClaimReason, 'Calor');
+ await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResult, 'Cocido');
+ await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResponsible, 'Calidad general');
+ await page.autocompleteSearch(selectors.claimDevelopment.firstClaimWorker, 'adminAssistantNick');
+ await page.autocompleteSearch(selectors.claimDevelopment.firstClaimRedelivery, 'Cliente');
await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
const result = await page.waitForLastSnackbar();
@@ -54,19 +53,19 @@ describe('Claim development', () => {
it('should confirm the first development is the expected one', async() => {
await page.reloadSection('claim.card.development');
const reason = await page
- .waitToGetProperty(`${selectors.claimDevelopment.firstClaimReasonAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.firstClaimReason, 'value');
const result = await page
- .waitToGetProperty(`${selectors.claimDevelopment.firstClaimResultAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.firstClaimResult, 'value');
const responsible = await page
- .waitToGetProperty(`${selectors.claimDevelopment.firstClaimResponsibleAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.firstClaimResponsible, 'value');
const worker = await page
- .waitToGetProperty(`${selectors.claimDevelopment.firstClaimWorkerAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.firstClaimWorker, 'value');
const redelivery = await page
- .waitToGetProperty(`${selectors.claimDevelopment.firstClaimRedeliveryAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.firstClaimRedelivery, 'value');
expect(reason).toEqual('Calor');
expect(result).toEqual('Cocido');
@@ -77,19 +76,19 @@ describe('Claim development', () => {
it('should confirm the second development is the expected one', async() => {
const reason = await page
- .waitToGetProperty(`${selectors.claimDevelopment.secondClaimReasonAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.secondClaimReason, 'value');
const result = await page
- .waitToGetProperty(`${selectors.claimDevelopment.secondClaimResultAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.secondClaimResult, 'value');
const responsible = await page
- .waitToGetProperty(`${selectors.claimDevelopment.secondClaimResponsibleAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.secondClaimResponsible, 'value');
const worker = await page
- .waitToGetProperty(`${selectors.claimDevelopment.secondClaimWorkerAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.secondClaimWorker, 'value');
const redelivery = await page
- .waitToGetProperty(`${selectors.claimDevelopment.secondClaimRedeliveryAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.claimDevelopment.secondClaimRedelivery, 'value');
expect(reason).toEqual('Baja calidad');
expect(result).toEqual('Deshidratacion');
diff --git a/e2e/paths/06-claim-module/03_detail.spec.js b/e2e/paths/06-claim/03_detail.spec.js
similarity index 92%
rename from e2e/paths/06-claim-module/03_detail.spec.js
rename to e2e/paths/06-claim/03_detail.spec.js
index e62a2981f..cf758919e 100644
--- a/e2e/paths/06-claim-module/03_detail.spec.js
+++ b/e2e/paths/06-claim/03_detail.spec.js
@@ -56,15 +56,14 @@ xdescribe('Claim detail', () => {
await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult('1');
await page.accessToSection('claim.card.detail');
- await page.waitForURL('/detail');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/detail');
- expect(url.hash).toContain('/detail');
+ expect(url).toBe(true);
});
it('should edit de second item claimed discount', async() => {
await page.waitToClick(selectors.claimDetail.secondItemDiscount);
- await page.write(selectors.claimDetail.discountInput, '100');
+ await page.write(selectors.claimDetail.discount, '100');
await page.keyboard.press('Enter');
const result = await page.waitForLastSnackbar();
@@ -100,10 +99,9 @@ xdescribe('Claim detail', () => {
});
it(`should have been redirected to the next section in claims`, async() => {
- await page.waitForURL('/development');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('development');
- expect(url.hash).toContain('development');
+ expect(url).toBe(true);
});
it('should navigate back to claim.detail to confirm the claim contains now two items', async() => {
diff --git a/e2e/paths/06-claim-module/04_claim_action.spec.js b/e2e/paths/06-claim/04_claim_action.spec.js
similarity index 90%
rename from e2e/paths/06-claim-module/04_claim_action.spec.js
rename to e2e/paths/06-claim/04_claim_action.spec.js
index 996cf5e11..c0bc91365 100644
--- a/e2e/paths/06-claim-module/04_claim_action.spec.js
+++ b/e2e/paths/06-claim/04_claim_action.spec.js
@@ -32,12 +32,11 @@ describe('Claim action path', () => {
expect(result).toEqual('Data saved!');
});
- // #2036 claim.action destinatario
it('should edit the second line destination field', async() => {
await page.autocompleteSearch(selectors.claimAction.secondLineDestination, 'Bueno');
- // const result = await page.waitForLastSnackbar();
+ const result = await page.waitForLastSnackbar();
- // expect(result).toEqual('Data saved!');
+ expect(result).toEqual('Data saved!');
});
it('should delete the first line', async() => {
@@ -49,7 +48,7 @@ describe('Claim action path', () => {
it('should refresh the view to check the remaining line is the expected one', async() => {
await page.reloadSection('claim.card.action');
- const result = await page.waitToGetProperty(`${selectors.claimAction.firstLineDestination} input`, 'value');
+ const result = await page.waitToGetProperty(selectors.claimAction.firstLineDestination, 'value');
expect(result).toEqual('Bueno');
});
diff --git a/e2e/paths/06-claim-module/05_summary.spec.js b/e2e/paths/06-claim/05_summary.spec.js
similarity index 92%
rename from e2e/paths/06-claim-module/05_summary.spec.js
rename to e2e/paths/06-claim/05_summary.spec.js
index 71f8b7252..9dab65954 100644
--- a/e2e/paths/06-claim-module/05_summary.spec.js
+++ b/e2e/paths/06-claim/05_summary.spec.js
@@ -18,10 +18,9 @@ describe('claim Summary path', () => {
it('should navigate to the target claim summary section', async() => {
await page.loginAndModule('employee', 'claim');
await page.accessToSearchResult(claimId);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should display details from the claim and it's client on the top of the header`, async() => {
@@ -61,8 +60,7 @@ describe('claim Summary path', () => {
it(`should check the url for the item diary link of the descriptor is for the right item id`, async() => {
await page.waitForSelector(selectors.claimSummary.itemDescriptorPopoverItemDiaryButton, {visible: true});
- await page.keyboard.press('Escape');
- await page.waitFor(1000);
+ await page.closePopup();
});
it('should display the claim development details', async() => {
@@ -82,8 +80,7 @@ describe('claim Summary path', () => {
it(`should check the url for the go to clientlink of the descriptor is for the right client id`, async() => {
await page.waitForSelector(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton, {visible: true});
- await page.keyboard.press('Escape');
- await page.waitFor(1000);
+ await page.closePopup();
});
it(`should click on the first action ticket ID making the ticket descriptor visible`, async() => {
diff --git a/e2e/paths/06-claim-module/06_descriptor.spec.js b/e2e/paths/06-claim/06_descriptor.spec.js
similarity index 82%
rename from e2e/paths/06-claim-module/06_descriptor.spec.js
rename to e2e/paths/06-claim/06_descriptor.spec.js
index 83dbec5fd..104f63945 100644
--- a/e2e/paths/06-claim-module/06_descriptor.spec.js
+++ b/e2e/paths/06-claim/06_descriptor.spec.js
@@ -18,14 +18,12 @@ describe('claim Descriptor path', () => {
it('should now navigate to the target claim summary section', async() => {
await page.loginAndModule('employee', 'claim');
await page.accessToSearchResult(claimId);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should not be able to see the delete claim button of the descriptor more menu`, async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.claimDescriptor.moreMenu);
await page.waitForSelector(selectors.claimDescriptor.moreMenuDeleteClaim, {hidden: true});
});
@@ -33,10 +31,9 @@ describe('claim Descriptor path', () => {
it(`should log in as salesAssistant and navigate to the target claim`, async() => {
await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult(claimId);
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should be able to see the delete claim button of the descriptor more menu`, async() => {
@@ -53,10 +50,9 @@ describe('claim Descriptor path', () => {
});
it(`should have been relocated to the claim index`, async() => {
- await page.waitForURL('/claim/index');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/claim/index');
- expect(url.hash).toContain('/claim/index');
+ expect(url).toBe(true);
});
it(`should search for the deleted claim to find no results`, async() => {
diff --git a/e2e/paths/07-order-module/01_edit_basic_data.spec.js b/e2e/paths/07-order/01_edit_basic_data.spec.js
similarity index 73%
rename from e2e/paths/07-order-module/01_edit_basic_data.spec.js
rename to e2e/paths/07-order/01_edit_basic_data.spec.js
index 1dd89b4b7..768985628 100644
--- a/e2e/paths/07-order-module/01_edit_basic_data.spec.js
+++ b/e2e/paths/07-order/01_edit_basic_data.spec.js
@@ -21,13 +21,13 @@ describe('Order edit basic data path', () => {
describe('when confirmed order', () => {
it('should not be able to change the client', async() => {
- await page.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark');
- await page.autocompleteSearch(selectors.orderBasicData.addressAutocomplete, 'Tony Stark');
+ await page.autocompleteSearch(selectors.orderBasicData.client, 'Tony Stark');
+ await page.autocompleteSearch(selectors.orderBasicData.address, 'Tony Stark');
await page.waitToClick(selectors.orderBasicData.saveButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`);
- }, 15000);
+ });
});
describe('when order with rows', () => {
@@ -39,16 +39,14 @@ describe('Order edit basic data path', () => {
await page.waitForContentLoaded();
await page.accessToSearchResult(orderId);
await page.accessToSection('order.card.basicData');
- await page.waitForContentLoaded();
- await page.waitForSelector(selectors.orderBasicData.observationInput, {visible: true});
- await page.waitForURL('basic-data');
- const url = await page.parsedUrl();
+ await page.waitForSelector(selectors.orderBasicData.observation, {visible: true});
+ let url = await page.expectURL(`#!/order/${orderId}/basic-data`);
- expect(url.hash).toEqual(`#!/order/${orderId}/basic-data`);
+ expect(url).toBe(true);
});
it('should not be able to change anything', async() => {
- await page.type(selectors.orderBasicData.observationInput, 'observation');
+ await page.write(selectors.orderBasicData.observation, 'observation');
await page.waitToClick(selectors.orderBasicData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -62,36 +60,33 @@ describe('Order edit basic data path', () => {
await page.waitToClick(selectors.orderBasicData.acceptButton);
await page.waitForContentLoaded();
await page.waitToClick(selectors.ordersIndex.createOrderButton);
- await page.waitForURL('#!/order/create');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/order/create');
- expect(url.hash).toContain('#!/order/create');
+ expect(url).toBe(true);
});
it('should now create a new one', async() => {
- await page.autocompleteSearch(selectors.createOrderView.clientAutocomplete, 'Jessica Jones');
+ await page.autocompleteSearch(selectors.createOrderView.client, 'Jessica Jones');
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
- await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, 'Other agency');
+ await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
await page.waitToClick(selectors.createOrderView.createButton);
- await page.waitForURL('/catalog');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/catalog');
- expect(url.hash).toContain('/catalog');
+ expect(url).toBe(true);
});
it('should navigate to the basic data section of the new order', async() => {
await page.accessToSection('order.card.basicData');
- await page.wait(selectors.orderBasicData.observationInput);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/basic-data');
- expect(url.hash).toContain('/basic-data');
+ expect(url).toBe(true);
});
it('should be able to modify all the properties', async() => {
- await page.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark');
- await page.autocompleteSearch(selectors.orderBasicData.addressAutocomplete, 'Tony Stark');
- await page.autocompleteSearch(selectors.orderBasicData.agencyAutocomplete, 'Silla247');
- await page.type(selectors.orderBasicData.observationInput, 'my observation');
+ await page.autocompleteSearch(selectors.orderBasicData.client, 'Tony Stark');
+ await page.autocompleteSearch(selectors.orderBasicData.address, 'Tony Stark');
+ await page.autocompleteSearch(selectors.orderBasicData.agency, 'Silla247');
+ await page.write(selectors.orderBasicData.observation, 'my observation');
await page.waitToClick(selectors.orderBasicData.saveButton);
const result = await page.waitForLastSnackbar();
@@ -101,21 +96,21 @@ describe('Order edit basic data path', () => {
it('should now confirm the client have been edited', async() => {
await page.reloadSection('order.card.basicData');
const result = await page
- .waitToGetProperty(`${selectors.orderBasicData.clientAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.orderBasicData.client, 'value');
expect(result).toEqual('104: Tony Stark');
});
it('should now confirm the agency have been edited', async() => {
const result = await page
- .waitToGetProperty(`${selectors.orderBasicData.agencyAutocomplete} input`, 'value');
+ .waitToGetProperty(selectors.orderBasicData.agency, 'value');
expect(result).toEqual('7: Silla247');
});
it('should now confirm the observations have been edited', async() => {
const result = await page
- .waitToGetProperty(selectors.orderBasicData.observationInput, 'value');
+ .waitToGetProperty(selectors.orderBasicData.observation, 'value');
expect(result).toEqual('my observation');
});
diff --git a/e2e/paths/07-order-module/02_catalog.spec.js b/e2e/paths/07-order/02_catalog.spec.js
similarity index 82%
rename from e2e/paths/07-order-module/02_catalog.spec.js
rename to e2e/paths/07-order/02_catalog.spec.js
index 430eba007..ca6489779 100644
--- a/e2e/paths/07-order-module/02_catalog.spec.js
+++ b/e2e/paths/07-order/02_catalog.spec.js
@@ -17,30 +17,26 @@ describe('Order catalog', () => {
it('should open the create new order form', async() => {
await page.waitToClick(selectors.ordersIndex.createOrderButton);
- await page.waitForURL('order/create');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('order/create');
- expect(url.hash).toContain('order/create');
+ expect(url).toBe(true);
});
it('should create a new order', async() => {
let today = new Date().getDate();
- await page.autocompleteSearch(selectors.createOrderView.clientAutocomplete, 'Tony Stark');
+ await page.autocompleteSearch(selectors.createOrderView.client, 'Tony Stark');
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
- await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, 'Other agency');
+ await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
await page.waitToClick(selectors.createOrderView.createButton);
- await page.waitForURL('/catalog');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/catalog');
-
- expect(url.hash).toContain('/catalog');
+ expect(url).toBe(true);
});
it('should add the realm and type filters and obtain results', async() => {
- await page.waitForContentLoaded();
await page.waitToClick(selectors.orderCatalog.plantRealmButton);
- await page.autocompleteSearch(selectors.orderCatalog.typeAutocomplete, 'Anthurium');
+ await page.autocompleteSearch(selectors.orderCatalog.type, 'Anthurium');
await page.waitForNumberOfElements('section.product', 4);
const result = await page.countElement('section.product');
@@ -48,7 +44,7 @@ describe('Order catalog', () => {
});
it('should search for the item tag value +1 and find two results', async() => {
- await page.write(selectors.orderCatalog.itemTagValueInput, '+1');
+ await page.write(selectors.orderCatalog.itemTagValue, '+1');
await page.keyboard.press('Enter');
await page.waitForNumberOfElements('section.product', 2);
const result = await page.countElement('section.product');
@@ -58,8 +54,8 @@ describe('Order catalog', () => {
it('should search for the item tag categoria +1 and find two results', async() => {
await page.waitToClick(selectors.orderCatalog.openTagSearch);
- await page.autocompleteSearch(selectors.orderCatalog.tagAutocomplete, 'categoria');
- await page.write(selectors.orderCatalog.tagValueInput, '+1');
+ await page.autocompleteSearch(selectors.orderCatalog.tag, 'categoria');
+ await page.write(selectors.orderCatalog.tagValue, '+1');
await page.waitToClick(selectors.orderCatalog.searchTagButton);
await page.waitForNumberOfElements('section.product', 1);
const result = await page.countElement('section.product');
@@ -70,6 +66,7 @@ describe('Order catalog', () => {
it('should remove the tag filters and have 4 results', async() => {
await page.waitForContentLoaded();
await page.waitToClick(selectors.orderCatalog.fourthFilterRemoveButton);
+ await page.waitForContentLoaded();
await page.waitToClick(selectors.orderCatalog.thirdFilterRemoveButton);
await page.waitForNumberOfElements('.product', 4);
const result = await page.countElement('section.product');
@@ -78,7 +75,7 @@ describe('Order catalog', () => {
});
it('should search for an item by id', async() => {
- await page.write(selectors.orderCatalog.itemIdInput, '2');
+ await page.write(selectors.orderCatalog.itemId, '2');
await page.keyboard.press('Enter');
await page.waitForNumberOfElements('section.product', 1);
const result = await page.countElement('section.product');
diff --git a/e2e/paths/07-order-module/03_lines.spec.js b/e2e/paths/07-order/03_lines.spec.js
similarity index 87%
rename from e2e/paths/07-order-module/03_lines.spec.js
rename to e2e/paths/07-order/03_lines.spec.js
index 99c8a221b..21fceac44 100644
--- a/e2e/paths/07-order-module/03_lines.spec.js
+++ b/e2e/paths/07-order/03_lines.spec.js
@@ -40,10 +40,11 @@ describe('Order lines', () => {
it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => {
await page.waitToClick(selectors.orderLine.confirmOrder);
- await page.waitForURL('ticket/index');
- const url = await page.parsedUrl();
- expect(url.hash).toContain('ticket/index');
- expect(url.hash).toContain('clientFk');
+ let hashPartOne = await page.expectURL('ticket/index');
+ let hashPartTwo = await page.expectURL('clientFk');
+
+ expect(hashPartOne).toBe(true);
+ expect(hashPartTwo).toBe(true);
});
});
diff --git a/e2e/paths/08-route/01_summary.spec.js b/e2e/paths/08-route/01_summary.spec.js
new file mode 100644
index 000000000..c062b9b08
--- /dev/null
+++ b/e2e/paths/08-route/01_summary.spec.js
@@ -0,0 +1,61 @@
+import selectors from '../../helpers/selectors.js';
+import getBrowser from '../../helpers/puppeteer';
+
+describe('Route summary path', () => {
+ let browser;
+ let page;
+
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('employee', 'route');
+ await page.waitToClick('vn-route-index vn-tbody > a:nth-child(1)');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should reach the first route summary section', async() => {
+ let url = await page.expectURL('#!/route/1/summary');
+
+ expect(url).toBe(true);
+ });
+
+ it(`should display details from the route on the header`, async() => {
+ await page.waitForTextInElement(selectors.routeSummary.header, 'first route');
+ const result = await page.waitToGetProperty(selectors.routeSummary.header, 'innerText');
+
+ expect(result).toContain('first route');
+ });
+
+ it('should display some route details like the cost', async() => {
+ const result = await page.waitToGetProperty(selectors.routeSummary.cost, 'innerText');
+
+ expect(result).toContain('€10.00');
+ });
+
+ it('should click on the first ticket ID making the descriptor popover visible', async() => {
+ await page.waitToClick(selectors.routeSummary.firstTicketID);
+ await page.waitForSelector(selectors.routeSummary.firstTicketDescriptor);
+ const visible = await page.isVisible(selectors.routeSummary.firstTicketDescriptor);
+
+ expect(visible).toBe(true);
+ });
+
+ it('should close the ticket descriptor', async() => {
+ await page.closePopup();
+ });
+
+ it('should click on the first alias making the client descriptor popover visible', async() => {
+ await page.waitToClick(selectors.routeSummary.firstAlias);
+ await page.waitForSelector(selectors.routeSummary.firstClientDescriptor);
+ const visible = await page.isVisible(selectors.routeSummary.firstClientDescriptor);
+
+ expect(visible).toBe(true);
+ });
+
+ it('should close the client descriptor', async() => {
+ await page.closePopup();
+ });
+});
diff --git a/e2e/paths/08-route-module/02_basic_data.spec.js b/e2e/paths/08-route/02_basic_data.spec.js
similarity index 61%
rename from e2e/paths/08-route-module/02_basic_data.spec.js
rename to e2e/paths/08-route/02_basic_data.spec.js
index 29b205172..91688b3ff 100644
--- a/e2e/paths/08-route-module/02_basic_data.spec.js
+++ b/e2e/paths/08-route/02_basic_data.spec.js
@@ -18,43 +18,43 @@ describe('Route basic Data path', () => {
});
it('should edit the route basic data', async() => {
- await page.autocompleteSearch(selectors.routeBasicData.workerAutoComplete, 'adminBossNick');
- await page.autocompleteSearch(selectors.routeBasicData.vehicleAutoComplete, '1111-IMK');
- await page.datePicker(selectors.routeBasicData.createdDateInput, 1, null);
- await page.clearInput(selectors.routeBasicData.kmStartInput);
- await page.write(selectors.routeBasicData.kmStartInput, '1');
- await page.clearInput(selectors.routeBasicData.kmEndInput);
- await page.write(selectors.routeBasicData.kmEndInput, '2');
- await page.type(`${selectors.routeBasicData.startedHourInput} input`, '0800');
- await page.type(`${selectors.routeBasicData.finishedHourInput} input`, '1230');
+ await page.autocompleteSearch(selectors.routeBasicData.worker, 'adminBossNick');
+ await page.autocompleteSearch(selectors.routeBasicData.vehicle, '1111-IMK');
+ await page.datePicker(selectors.routeBasicData.createdDate, 1, null);
+ await page.clearInput(selectors.routeBasicData.kmStart);
+ await page.write(selectors.routeBasicData.kmStart, '1');
+ await page.clearInput(selectors.routeBasicData.kmEnd);
+ await page.write(selectors.routeBasicData.kmEnd, '2');
+ await page.type(`${selectors.routeBasicData.startedHour} input`, '0800');
+ await page.type(`${selectors.routeBasicData.finishedHour} input`, '1230');
await page.waitToClick(selectors.routeBasicData.saveButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
- }, 15000);
+ });
it('should confirm the worker was edited', async() => {
await page.reloadSection('route.card.basicData');
- const worker = await page.waitToGetProperty(`${selectors.routeBasicData.workerAutoComplete} input`, 'value');
+ const worker = await page.waitToGetProperty(selectors.routeBasicData.worker, 'value');
expect(worker).toEqual('adminBoss - adminBossNick');
});
it('should confirm the vehicle was edited', async() => {
- const vehicle = await page.waitToGetProperty(`${selectors.routeBasicData.vehicleAutoComplete} input`, 'value');
+ const vehicle = await page.waitToGetProperty(selectors.routeBasicData.vehicle, 'value');
expect(vehicle).toEqual('1111-IMK');
});
it('should confirm the km start was edited', async() => {
- const kmStart = await page.waitToGetProperty(`${selectors.routeBasicData.kmStartInput} input`, 'value');
+ const kmStart = await page.waitToGetProperty(selectors.routeBasicData.kmStart, 'value');
expect(kmStart).toEqual('1');
});
it('should confirm the km end was edited', async() => {
- const kmEnd = await page.waitToGetProperty(`${selectors.routeBasicData.kmEndInput} input`, 'value');
+ const kmEnd = await page.waitToGetProperty(selectors.routeBasicData.kmEnd, 'value');
expect(kmEnd).toEqual('2');
});
diff --git a/e2e/paths/08-route-module/01_create.spec.js b/e2e/paths/08-route/03_create.spec.js
similarity index 73%
rename from e2e/paths/08-route-module/01_create.spec.js
rename to e2e/paths/08-route/03_create.spec.js
index 74b5d9173..11ffd500b 100644
--- a/e2e/paths/08-route-module/01_create.spec.js
+++ b/e2e/paths/08-route/03_create.spec.js
@@ -19,14 +19,13 @@ describe('Route create path', () => {
it('should click on the add new route button and open the creation form', async() => {
await page.waitForContentLoaded();
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
- await page.wait(selectors.createRouteView.workerAutocomplete);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/route/create');
- expect(url.hash).toEqual('#!/route/create');
+ expect(url).toBe(true);
});
it(`should attempt to create a new route but fail since employee has no access rights`, async() => {
- await page.write(selectors.createRouteView.descriptionInput, 'faster faster!!');
+ await page.write(selectors.createRouteView.description, 'faster faster!!');
await page.waitToClick(selectors.createRouteView.submitButton);
const result = await page.waitForLastSnackbar();
@@ -38,23 +37,21 @@ describe('Route create path', () => {
beforeAll(async() => {
await page.login('delivery');
await page.selectModule('route');
- await page.changeLanguageToEnglish();
});
it('should again click on the add new route button and open the creation form', async() => {
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
- await page.wait(selectors.createRouteView.workerAutocomplete);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/route/create');
- expect(url.hash).toEqual('#!/route/create');
+ expect(url).toBe(true);
});
it(`should create a new route`, async() => {
- await page.autocompleteSearch(selectors.createRouteView.workerAutocomplete, 'teamManagerNick');
+ await page.autocompleteSearch(selectors.createRouteView.worker, 'teamManagerNick');
await page.datePicker(selectors.createRouteView.createdDatePicker, 0, null);
- await page.autocompleteSearch(selectors.createRouteView.vehicleAutoComplete, '4444-IMK');
- await page.autocompleteSearch(selectors.createRouteView.agencyAutoComplete, 'Teleportation device');
- await page.write(selectors.createRouteView.descriptionInput, 'faster faster!!');
+ await page.autocompleteSearch(selectors.createRouteView.vehicleAuto, '4444-IMK');
+ await page.autocompleteSearch(selectors.createRouteView.agency, 'Teleportation device');
+ await page.write(selectors.createRouteView.description, 'faster faster!!');
await page.waitToClick(selectors.createRouteView.submitButton);
const result = await page.waitForLastSnackbar();
@@ -62,10 +59,9 @@ describe('Route create path', () => {
});
it(`should confirm the redirection to the created route summary`, async() => {
- await page.wait(selectors.routeSummary.routeId);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
});
});
diff --git a/e2e/paths/08-route-module/03_tickets.spec.js b/e2e/paths/08-route/04_tickets.spec.js
similarity index 100%
rename from e2e/paths/08-route-module/03_tickets.spec.js
rename to e2e/paths/08-route/04_tickets.spec.js
diff --git a/e2e/paths/09-invoice-out/01_summary.spec.js b/e2e/paths/09-invoice-out/01_summary.spec.js
new file mode 100644
index 000000000..126c745d3
--- /dev/null
+++ b/e2e/paths/09-invoice-out/01_summary.spec.js
@@ -0,0 +1,48 @@
+import selectors from '../../helpers/selectors.js';
+import getBrowser from '../../helpers/puppeteer';
+
+describe('InvoiceOut summary path', () => {
+ let browser;
+ let page;
+
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('employee', 'invoiceOut');
+ await page.accessToSearchResult('T1111111');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should reach the summary section', async() => {
+ const result = await page.expectURL('/summary');
+
+ expect(result).toBe(true);
+ });
+
+ it('should contain the company from which the invoice is emited', async() => {
+ const result = await page.waitToGetProperty(selectors.invoiceOutSummary.company, 'innerText');
+
+ expect(result).toEqual('Company VNL');
+ });
+
+ it('should contain the tax breakdown', async() => {
+ const firstTax = await page.waitToGetProperty(selectors.invoiceOutSummary.taxOne, 'innerText');
+
+ const secondTax = await page.waitToGetProperty(selectors.invoiceOutSummary.taxTwo, 'innerText');
+
+ expect(firstTax).toContain('10%');
+ expect(secondTax).toContain('21%');
+ });
+
+ it('should contain the tickets info', async() => {
+ const firstTicket = await page.waitToGetProperty(selectors.invoiceOutSummary.ticketOne, 'innerText');
+
+ const secondTicket = await page.waitToGetProperty(selectors.invoiceOutSummary.ticketTwo, 'innerText');
+
+ expect(firstTicket).toContain('Bat cave');
+ expect(secondTicket).toContain('Stark tower');
+ });
+});
diff --git a/e2e/paths/09-invoice-out-module/01_descriptor.spec.js b/e2e/paths/09-invoice-out/02_descriptor.spec.js
similarity index 84%
rename from e2e/paths/09-invoice-out-module/01_descriptor.spec.js
rename to e2e/paths/09-invoice-out/02_descriptor.spec.js
index a98d2eb02..e70c39ded 100644
--- a/e2e/paths/09-invoice-out-module/01_descriptor.spec.js
+++ b/e2e/paths/09-invoice-out/02_descriptor.spec.js
@@ -30,16 +30,14 @@ describe('InvoiceOut descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton);
- await page.wait(selectors.invoiceOutIndex.searchInvoiceOutInput);
- await page.waitForURL('#!/invoice-out/index');
- const url = await page.parsedUrl();
+ await page.wait(selectors.invoiceOutIndex.topbarSearch);
+ let url = await page.expectURL('#!/invoice-out/index');
- expect(url.hash).toEqual('#!/invoice-out/index');
+ expect(url).toBe(true);
});
it('should search for the target invoiceOut', async() => {
- await page.waitForContentLoaded();
- await page.write(selectors.invoiceOutIndex.searchInvoiceOutInput, 'T2222222');
+ await page.write(selectors.invoiceOutIndex.topbarSearch, 'T2222222');
await page.waitToClick(selectors.invoiceOutIndex.searchButton);
await page.waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 1);
const result = await page.countElement(selectors.invoiceOutIndex.searchResult);
@@ -49,10 +47,9 @@ describe('InvoiceOut descriptor path', () => {
it(`should click on the search result to access to the invoiceOut summary`, async() => {
await page.accessToSearchResult('T2222222');
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it('should delete the invoiceOut using the descriptor more menu', async() => {
@@ -65,13 +62,13 @@ describe('InvoiceOut descriptor path', () => {
});
it('should have been relocated to the invoiceOut index', async() => {
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/invoice-out/index');
- expect(url.hash).toEqual('#!/invoice-out/index');
+ expect(url).toBe(true);
});
it(`should search for the deleted invouceOut to find no results`, async() => {
- await page.write(selectors.invoiceOutIndex.searchInvoiceOutInput, 'T2222222');
+ await page.write(selectors.invoiceOutIndex.topbarSearch, 'T2222222');
await page.waitToClick(selectors.invoiceOutIndex.searchButton);
await page.waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 0);
const result = await page.countElement(selectors.invoiceOutIndex.searchResult);
@@ -83,10 +80,9 @@ describe('InvoiceOut descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
- await page.wait(selectors.ticketsIndex.searchTicketInput);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/ticket/index');
- expect(url.hash).toEqual('#!/ticket/index');
+ expect(url).toBe(true);
});
it('should search for tickets with an specific invoiceOut to find no results', async() => {
@@ -105,19 +101,16 @@ describe('InvoiceOut descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton);
- await page.wait(selectors.invoiceOutIndex.searchInvoiceOutInput);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/invoice-out/index');
- expect(url.hash).toEqual('#!/invoice-out/index');
+ expect(url).toBe(true);
});
it(`should search and access to the invoiceOut summary`, async() => {
- await page.waitForContentLoaded();
await page.accessToSearchResult('T1111111');
- await page.waitForURL('/summary');
- const url = await page.parsedUrl();
+ let url = await page.expectURL('/summary');
- expect(url.hash).toContain('/summary');
+ expect(url).toBe(true);
});
it(`should check the invoiceOut is booked in the summary data`, async() => {
@@ -147,6 +140,7 @@ describe('InvoiceOut descriptor path', () => {
let expectedDate = `${day}/${month}/${today.getFullYear()}`;
+ await page.waitForContentLoaded();
const result = await page
.waitToGetProperty(selectors.invoiceOutSummary.bookedLabel, 'innerText');
diff --git a/e2e/paths/10-travel/01_thermograph.spec.js b/e2e/paths/10-travel/01_thermograph.spec.js
new file mode 100644
index 000000000..efa2295a6
--- /dev/null
+++ b/e2e/paths/10-travel/01_thermograph.spec.js
@@ -0,0 +1,52 @@
+import selectors from '../../helpers/selectors.js';
+import getBrowser from '../../helpers/puppeteer';
+
+describe('Travel thermograph path', () => {
+ let browser;
+ let page;
+
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('buyer', 'travel');
+ await page.accessToSearchResult('3');
+ await page.accessToSection('travel.card.thermograph.index');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should reach the thermograph section', async() => {
+ const result = await page.expectURL('/thermograph/index');
+
+ expect(result).toBe(true);
+ });
+
+ it('should click the add thermograph floating button', async() => {
+ await page.waitToClick(selectors.travelThermograph.add);
+ const result = await page.expectURL('/thermograph/create');
+
+ expect(result).toBe(true);
+ });
+
+ it('should select the thermograph and then the file to upload', async() => {
+ let currentDir = process.cwd();
+ let filePath = `${currentDir}/e2e/dms/ecc/3.jpeg`;
+ await page.autocompleteSearch(selectors.travelThermograph.thermographID, '138350-0');
+
+ const [fileChooser] = await Promise.all([
+ page.waitForFileChooser(),
+ page.waitToClick(selectors.travelThermograph.uploadIcon)
+ ]);
+ await fileChooser.accept([filePath]);
+
+ await page.waitToClick(selectors.travelThermograph.upload);
+ });
+
+ it('should reload the section and check everything was saved', async() => {
+ let createdThermograph = await page.waitToGetProperty(selectors.travelThermograph.createdThermograph, 'innerText');
+
+ expect(createdThermograph).toContain('138350-0');
+ });
+});
diff --git a/e2e/paths/11-agency/01_basic-data.spec.js b/e2e/paths/11-agency/01_basic-data.spec.js
new file mode 100644
index 000000000..43369aeab
--- /dev/null
+++ b/e2e/paths/11-agency/01_basic-data.spec.js
@@ -0,0 +1,103 @@
+import selectors from '../../helpers/selectors.js';
+import getBrowser from '../../helpers/puppeteer';
+
+describe('Agency basic data path', () => {
+ let browser;
+ let page;
+
+ beforeAll(async() => {
+ browser = await getBrowser();
+ page = browser.page;
+ await page.loginAndModule('deliveryBoss', 'zone'); // turns up the agency module name and route aint the same lol
+ await page.accessToSearchResult('10');
+ await page.accessToSection('zone.card.basicData');
+ });
+
+ afterAll(async() => {
+ await browser.close();
+ });
+
+ it('should reach the basic data section', async() => {
+ let url = await page.expectURL('#!/zone/10/basic-data');
+
+ expect(url).toBe(true);
+ });
+
+ it('should edit de form and then save', async() => {
+ await page.clearInput(selectors.agencyBasicData.name);
+ await page.write(selectors.agencyBasicData.name, 'Brimstone teleportation');
+ await page.autocompleteSearch(selectors.agencyBasicData.agency, 'Quantum break device');
+ await page.write(selectors.agencyBasicData.maxVolume, '10');
+ await page.clearInput(selectors.agencyBasicData.travelingDays);
+ await page.write(selectors.agencyBasicData.travelingDays, '1');
+ await page.clearInput(selectors.agencyBasicData.closing);
+ await page.type(selectors.agencyBasicData.closing, '2100');
+ await page.clearInput(selectors.agencyBasicData.price);
+ await page.write(selectors.agencyBasicData.price, '999');
+ await page.clearInput(selectors.agencyBasicData.bonus);
+ await page.write(selectors.agencyBasicData.bonus, '100');
+ await page.clearInput(selectors.agencyBasicData.inflation);
+ await page.write(selectors.agencyBasicData.inflation, '200');
+ await page.waitToClick(selectors.agencyBasicData.volumetric);
+ await page.waitToClick(selectors.agencyBasicData.saveButton);
+ });
+
+ it('should reload the section', async() => {
+ await page.reloadSection('zone.card.basicData');
+ let url = await page.expectURL('#!/zone/10/basic-data');
+
+ expect(url).toBe(true);
+ });
+
+ it('should confirm the name was updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.name, 'value');
+
+ expect(result).toEqual('Brimstone teleportation');
+ });
+
+ it('should confirm the agency was updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.agency, 'value');
+
+ expect(result).toEqual('Quantum break device');
+ });
+
+ it('should confirm the max volume was updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.maxVolume, 'value');
+
+ expect(result).toEqual('10');
+ });
+
+ it('should confirm the traveling days were updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.travelingDays, 'value');
+
+ expect(result).toEqual('1');
+ });
+
+ it('should confirm the closing hour was updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.closing, 'value');
+
+ expect(result).toEqual('21:00');
+ });
+
+ it('should confirm the price was updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.price, 'value');
+
+ expect(result).toEqual('999');
+ });
+
+ it('should confirm the bonus was updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.bonus, 'value');
+
+ expect(result).toEqual('100');
+ });
+
+ it('should confirm the inflation was updated', async() => {
+ const result = await page.waitToGetProperty(selectors.agencyBasicData.inflation, 'value');
+
+ expect(result).toEqual('200');
+ });
+
+ it('should confirm the volumetric checkbox was checked', async() => {
+ await page.waitForClassPresent(selectors.agencyBasicData.volumetric, 'checked');
+ });
+});
diff --git a/e2e/smokes/01_client_path.spec.js b/e2e/smokes/01_client_path.spec.js
index 4ac4d331d..6c106b2eb 100644
--- a/e2e/smokes/01_client_path.spec.js
+++ b/e2e/smokes/01_client_path.spec.js
@@ -16,18 +16,16 @@ describe('create client path', () => {
it('should access to the create client view by clicking the create-client floating button', async() => {
await page.waitToClick(selectors.clientsIndex.createClientButton);
- await page.wait(selectors.createClientView.createButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/client/create');
- expect(url.hash).toEqual('#!/client/create');
+ expect(url).toBe(true);
});
it('should cancel the client creation to go back to clients index', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitToClick(selectors.globalItems.clientsButton);
- await page.wait(selectors.clientsIndex.createClientButton);
- const url = await page.parsedUrl();
+ let url = await page.expectURL('#!/client/index');
- expect(url.hash).toEqual('#!/client/index');
+ expect(url).toBe(true);
});
});
diff --git a/front/core/components/button/index.js b/front/core/components/button/index.js
index 17710967a..e8c998801 100644
--- a/front/core/components/button/index.js
+++ b/front/core/components/button/index.js
@@ -9,6 +9,7 @@ export default class Button extends FormInput {
this.initTabIndex();
this.element.addEventListener('keyup', e => this.onKeyup(e));
this.element.addEventListener('click', e => this.onClick(e));
+ this.button = this.element.querySelector('button');
}
$onInit() {
@@ -21,13 +22,17 @@ export default class Button extends FormInput {
switch (event.key) {
case ' ':
case 'Enter':
+ if (this.button)
+ return this.button.click();
return this.element.click();
}
}
onClick(event) {
- if (this.disabled)
+ if (this.disabled) {
+ event.preventDefault();
event.stopImmediatePropagation();
+ }
}
}
Button.$inject = ['$element', '$scope'];
diff --git a/front/core/components/crud-model/crud-model.js b/front/core/components/crud-model/crud-model.js
index 9a260a690..ef5c346b9 100644
--- a/front/core/components/crud-model/crud-model.js
+++ b/front/core/components/crud-model/crud-model.js
@@ -128,31 +128,37 @@ export default class CrudModel extends ModelProxy {
}
/**
- * Returns an object with the unsaved changes made to the model.
+ * Saves current changes on the server.
*
- * @return {Object} The current changes
+ * @return {Promise} The save request promise
*/
- getChanges() {
+ save() {
if (!this.isChanged)
return null;
let deletes = [];
let updates = [];
let creates = [];
+ let orgDeletes = [];
+ let orgUpdates = [];
+ let orgCreates = [];
let pk = this.primaryKey;
- for (let row of this.removed)
+ for (let row of this.removed) {
deletes.push(row.$orgRow[pk]);
+ orgDeletes.push(row);
+ }
- for (let row of this._data) {
+ for (let row of this.data) {
if (row.$isNew) {
let data = {};
for (let prop in row) {
if (prop.charAt(0) !== '$')
data[prop] = row[prop];
}
- creates.push(data);
+ creates.push(row);
+ orgCreates.push(row);
} else if (row.$oldData) {
let data = {};
for (let prop in row.$oldData)
@@ -161,6 +167,7 @@ export default class CrudModel extends ModelProxy {
data,
where: {[pk]: row.$orgRow[pk]}
});
+ orgUpdates.push(row);
}
}
@@ -171,23 +178,25 @@ export default class CrudModel extends ModelProxy {
changes[prop] = undefined;
}
- return changes;
- }
-
- /**
- * Saves current changes on the server.
- *
- * @return {Promise} The save request promise
- */
- save() {
- let changes = this.getChanges();
-
if (!changes)
return this.$q.resolve();
let url = this.saveUrl ? this.saveUrl : `${this._url}/crud`;
return this.$http.post(url, changes)
- .then(() => {
+ .then(res => {
+ const created = res.data;
+
+ // Apply new data to created instances
+ for (let i = 0; i < orgCreates.length; i++) {
+ const row = orgCreates[i];
+ row[pk] = created[i][pk];
+
+ for (let prop in row) {
+ if (prop.charAt(0) !== '$')
+ row[prop] = created[i][prop];
+ }
+ }
+
this.applyChanges();
super.save();
});
diff --git a/front/core/components/crud-model/index.spec.js b/front/core/components/crud-model/index.spec.js
new file mode 100644
index 000000000..e0daa2558
--- /dev/null
+++ b/front/core/components/crud-model/index.spec.js
@@ -0,0 +1,50 @@
+describe('Component vnCrudModel', () => {
+ let $httpBackend;
+ let controller;
+ let $element;
+
+ beforeEach(ngModule('vnCore'));
+
+ beforeEach(inject(($compile, $rootScope, _$httpBackend_) => {
+ $element = $compile(`
{{$t('Code')}} | +{{$t('Code')}} | {{$t('Quantity')}} | {{$t('Concept')}} |
---|---|---|---|
{{sale.itemFk}} | -{{Math.trunc(sale.subtotal)}} | -
- {{sale.concept}} {{sale.subName | uppercase}}
- |
- |
{{sale.itemFk}} | +{{Math.trunc(sale.subtotal)}} | +{{sale.concept}} | +|
+
+ {{sale.tag5}}
+ {{sale.value5}}
+
+ |
+
+
+ {{sale.tag6}}
+ {{sale.value6}}
+
+ |
+
+
+ {{sale.tag7}}
+ {{sale.value7}}
+
+ |
+