Merge branch 'dev' into test
gitea/salix/test This commit looks good
Details
gitea/salix/test This commit looks good
Details
This commit is contained in:
commit
f118f22a69
|
@ -37,11 +37,11 @@ BEGIN
|
||||||
WHERE z.agencyModeFk != vAgencyModeFk;
|
WHERE z.agencyModeFk != vAgencyModeFk;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SELECT e.`type`, e.dated, e.`started`, e.`ended`, e.weekDays
|
SELECT e.zoneFk, e.`type`, e.dated, e.`started`, e.`ended`, e.weekDays
|
||||||
FROM tmp.zone t
|
FROM tmp.zone t
|
||||||
JOIN zoneEvent e ON e.zoneFk = t.id;
|
JOIN zoneEvent e ON e.zoneFk = t.id;
|
||||||
|
|
||||||
SELECT DISTINCT e.dated
|
SELECT e.zoneFk, e.dated
|
||||||
FROM tmp.zone t
|
FROM tmp.zone t
|
||||||
JOIN zoneExclusion e ON e.zoneFk = t.id;
|
JOIN zoneExclusion e ON e.zoneFk = t.id;
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@ CREATE TABLE `vn`.`userPhone` (
|
||||||
`id` INT NOT NULL AUTO_INCREMENT,
|
`id` INT NOT NULL AUTO_INCREMENT,
|
||||||
`userFk` INT(10) UNSIGNED NOT NULL,
|
`userFk` INT(10) UNSIGNED NOT NULL,
|
||||||
`typeFk` VARCHAR(45) NOT NULL,
|
`typeFk` VARCHAR(45) NOT NULL,
|
||||||
`phone` VARCHAR(15) NOT NULL,
|
`phone` VARCHAR(25) NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE INDEX `UserFK_Phone` (`userFk` ASC, `phone` ASC));
|
UNIQUE INDEX `UserFk_Phone` (`userFk` ASC, `typeFk` ASC, `phone` ASC));
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE `vn`.`userPhone`
|
ALTER TABLE `vn`.`userPhone`
|
||||||
|
|
|
@ -56,7 +56,7 @@ proc: BEGIN
|
||||||
IF((@rate3 := IFNULL(pf.rate3, b.price3)) < i.minPrice AND i.hasMinPrice, i.minPrice, @rate3) * 1.0 rate3,
|
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.rate3, 0) AS minPrice,
|
||||||
IFNULL(pf.packing, b.packing) packing,
|
IFNULL(pf.packing, b.packing) packing,
|
||||||
IFNULL(pf.`grouping`, b.`grouping`) grouping,
|
IFNULL(pf.`grouping`, b.`grouping`) `grouping`,
|
||||||
ABS(IFNULL(pf.box, b.groupingMode)) groupingMode,
|
ABS(IFNULL(pf.box, b.groupingMode)) groupingMode,
|
||||||
tl.buyFk,
|
tl.buyFk,
|
||||||
i.typeFk,
|
i.typeFk,
|
||||||
|
@ -201,7 +201,7 @@ proc: BEGIN
|
||||||
SELECT tcc.warehouseFk,
|
SELECT tcc.warehouseFk,
|
||||||
tcc.itemFk,
|
tcc.itemFk,
|
||||||
1 rate,
|
1 rate,
|
||||||
IF(tcc.groupingMode = 1, tcc.`grouping`, 1) grouping,
|
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)) price,
|
||||||
CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) / weightGrouping priceKg
|
CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) / weightGrouping priceKg
|
||||||
FROM tmp.ticketComponentCalculate tcc
|
FROM tmp.ticketComponentCalculate tcc
|
||||||
|
@ -211,12 +211,12 @@ proc: BEGIN
|
||||||
AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0)
|
AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0)
|
||||||
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
||||||
|
|
||||||
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, grouping, price, priceKg)
|
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
|
||||||
SELECT
|
SELECT
|
||||||
tcc.warehouseFk,
|
tcc.warehouseFk,
|
||||||
tcc.itemFk,
|
tcc.itemFk,
|
||||||
2 rate,
|
2 rate,
|
||||||
tcc.packing grouping,
|
tcc.packing `grouping`,
|
||||||
SUM(tcs.sumCost) price,
|
SUM(tcs.sumCost) price,
|
||||||
SUM(tcs.sumCost) / weightGrouping priceKg
|
SUM(tcs.sumCost) / weightGrouping priceKg
|
||||||
FROM tmp.ticketComponentCalculate tcc
|
FROM tmp.ticketComponentCalculate tcc
|
||||||
|
@ -226,12 +226,12 @@ proc: BEGIN
|
||||||
AND tcc.packing > 0 AND tcc.available >= tcc.packing)
|
AND tcc.packing > 0 AND tcc.available >= tcc.packing)
|
||||||
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
||||||
|
|
||||||
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, grouping, price, priceKg)
|
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
|
||||||
SELECT
|
SELECT
|
||||||
tcc.warehouseFk,
|
tcc.warehouseFk,
|
||||||
tcc.itemFk,
|
tcc.itemFk,
|
||||||
3 rate,
|
3 rate,
|
||||||
tcc.available grouping,
|
tcc.available `grouping`,
|
||||||
SUM(tcs.sumCost) price,
|
SUM(tcs.sumCost) price,
|
||||||
SUM(tcs.sumCost) / weightGrouping priceKg
|
SUM(tcs.sumCost) / weightGrouping priceKg
|
||||||
FROM tmp.ticketComponentCalculate tcc
|
FROM tmp.ticketComponentCalculate tcc
|
||||||
|
|
|
@ -57,7 +57,7 @@ proc: BEGIN
|
||||||
IF((@rate3 := IFNULL(pf.rate3, b.price3)) < i.minPrice AND i.hasMinPrice, i.minPrice, @rate3) * 1.0 rate3,
|
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.rate3, 0) AS minPrice,
|
||||||
IFNULL(pf.packing, b.packing) packing,
|
IFNULL(pf.packing, b.packing) packing,
|
||||||
IFNULL(pf.`grouping`, b.`grouping`) grouping,
|
IFNULL(pf.`grouping`, b.`grouping`) `grouping`,
|
||||||
ABS(IFNULL(pf.box, b.groupingMode)) groupingMode,
|
ABS(IFNULL(pf.box, b.groupingMode)) groupingMode,
|
||||||
tl.buyFk,
|
tl.buyFk,
|
||||||
i.typeFk,
|
i.typeFk,
|
||||||
|
@ -204,7 +204,7 @@ proc: BEGIN
|
||||||
SELECT tcc.warehouseFk,
|
SELECT tcc.warehouseFk,
|
||||||
tcc.itemFk,
|
tcc.itemFk,
|
||||||
1 rate,
|
1 rate,
|
||||||
IF(tcc.groupingMode = 1, tcc.`grouping`, 1) grouping,
|
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)) price,
|
||||||
CAST(SUM(tcs.sumCost) / weightGrouping AS DECIMAL(10,2)) priceKg
|
CAST(SUM(tcs.sumCost) / weightGrouping AS DECIMAL(10,2)) priceKg
|
||||||
FROM tmp.ticketComponentCalculate tcc
|
FROM tmp.ticketComponentCalculate tcc
|
||||||
|
@ -214,12 +214,12 @@ proc: BEGIN
|
||||||
AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0)
|
AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0)
|
||||||
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
||||||
|
|
||||||
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, grouping, price, priceKg)
|
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
|
||||||
SELECT
|
SELECT
|
||||||
tcc.warehouseFk,
|
tcc.warehouseFk,
|
||||||
tcc.itemFk,
|
tcc.itemFk,
|
||||||
2 rate,
|
2 rate,
|
||||||
tcc.packing grouping,
|
tcc.packing `grouping`,
|
||||||
SUM(tcs.sumCost) price,
|
SUM(tcs.sumCost) price,
|
||||||
SUM(tcs.sumCost) / weightGrouping priceKg
|
SUM(tcs.sumCost) / weightGrouping priceKg
|
||||||
FROM tmp.ticketComponentCalculate tcc
|
FROM tmp.ticketComponentCalculate tcc
|
||||||
|
@ -229,12 +229,12 @@ proc: BEGIN
|
||||||
AND tcc.packing > 0 AND tcc.available >= tcc.packing)
|
AND tcc.packing > 0 AND tcc.available >= tcc.packing)
|
||||||
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
||||||
|
|
||||||
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, grouping, price, priceKg)
|
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
|
||||||
SELECT
|
SELECT
|
||||||
tcc.warehouseFk,
|
tcc.warehouseFk,
|
||||||
tcc.itemFk,
|
tcc.itemFk,
|
||||||
3 rate,
|
3 rate,
|
||||||
tcc.available grouping,
|
tcc.available `grouping`,
|
||||||
SUM(tcs.sumCost) price,
|
SUM(tcs.sumCost) price,
|
||||||
SUM(tcs.sumCost) / weightGrouping priceKg
|
SUM(tcs.sumCost) / weightGrouping priceKg
|
||||||
FROM tmp.ticketComponentCalculate tcc
|
FROM tmp.ticketComponentCalculate tcc
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
DROP procedure IF EXISTS `vn`.`buy_notifyPassport`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`buy_notifyPassport`(
|
||||||
|
IN vBuyFk INT,
|
||||||
|
IN vItemFk INT,
|
||||||
|
IN vStickers SMALLINT,
|
||||||
|
IN vPacking SMALLINT
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO vn.mail(`subject`,`body`,`sender`)
|
||||||
|
SELECT 'Solicitar pasaporte',
|
||||||
|
CONCAT(
|
||||||
|
'Etiquetas: ', IFNULL(vStickers, 0),
|
||||||
|
', Packing: ', IFNULL(vPacking, 0),
|
||||||
|
', Nombre: ', IFNULL(i.`name`, 0),
|
||||||
|
', buy_edi: ', IFNULL(e.id, 0),
|
||||||
|
', Nombre botánico: ', IFNULL(g.latin_genus_name, ''), ' ', IFNULL(s.latin_species_name, ''),
|
||||||
|
', Productor: ',IFNULL(es.company_name, IFNULL(p.`name`, ''))
|
||||||
|
)
|
||||||
|
,'ekt@verdnatura.es'
|
||||||
|
FROM item i
|
||||||
|
LEFT JOIN itemBotanical ib ON ib.itemFk = i.id
|
||||||
|
LEFT JOIN edi.genus g ON g.genus_id = ib.genusFk
|
||||||
|
LEFT JOIN edi.specie s ON IFNULL(s.specie_id, ib.specieFk) = ib.specieFk
|
||||||
|
LEFT JOIN producer p ON p.id = i.producerFk
|
||||||
|
LEFT JOIN buy b ON b.id = vBuyFk
|
||||||
|
LEFT JOIN edi.ekt e ON b.ektFk = e.id
|
||||||
|
LEFT JOIN edi.supplier es ON es.supplier_id = e.pro
|
||||||
|
WHERE i.id = vItemFk;
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
DROP function IF EXISTS `vn`.`clientGetMana`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE DEFINER=`root`@`%` FUNCTION `vn`.`clientGetMana`(vClient INT) RETURNS decimal(10,2)
|
||||||
|
DETERMINISTIC
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Devuelve el mana del cliente.
|
||||||
|
*
|
||||||
|
* @param vClient Id del cliente
|
||||||
|
* @return Mana del cliente
|
||||||
|
*/
|
||||||
|
DECLARE vMana DECIMAL(10,2);
|
||||||
|
DECLARE vFromDated DATE;
|
||||||
|
DECLARE vHasMana BOOLEAN;
|
||||||
|
DECLARE vManaComponent INT;
|
||||||
|
DECLARE vAutoManaComponent INT;
|
||||||
|
DECLARE vManaBank INT;
|
||||||
|
DECLARE vManaGreugeType INT;
|
||||||
|
|
||||||
|
SELECT id INTO vManaGreugeType FROM greugeType WHERE code = 'mana';
|
||||||
|
SELECT id INTO vManaBank FROM bank WHERE code = 'mana';
|
||||||
|
SELECT id INTO vManaComponent FROM component WHERE code = 'mana';
|
||||||
|
SELECT id INTO vAutoManaComponent FROM component WHERE code = 'autoMana';
|
||||||
|
|
||||||
|
SELECT COUNT(*) INTO vHasMana
|
||||||
|
FROM `client` c
|
||||||
|
WHERE c.id = vClient AND c.typeFk = 'normal';
|
||||||
|
|
||||||
|
IF NOT vHasMana THEN
|
||||||
|
RETURN 0;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SELECT max(dated) INTO vFromDated
|
||||||
|
FROM clientManaCache;
|
||||||
|
|
||||||
|
SELECT sum(mana) INTO vMana
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT mana
|
||||||
|
FROM clientManaCache
|
||||||
|
WHERE clientFk = vClient
|
||||||
|
AND dated = vFromDated
|
||||||
|
UNION ALL
|
||||||
|
SELECT s.quantity * value
|
||||||
|
FROM ticket t
|
||||||
|
JOIN address a ON a.id = t.addressFk
|
||||||
|
JOIN sale s on s.ticketFk = t.id
|
||||||
|
JOIN saleComponent sc on sc.saleFk = s.id
|
||||||
|
WHERE sc.componentFk IN (vManaComponent, vAutoManaComponent)
|
||||||
|
AND t.shipped > vFromDated
|
||||||
|
AND t.shipped < TIMESTAMPADD(DAY,1,CURDATE())
|
||||||
|
AND a.clientFk = vClient
|
||||||
|
UNION ALL
|
||||||
|
SELECT - amountPaid
|
||||||
|
FROM receipt r
|
||||||
|
JOIN `client` c ON c.id = r.clientFk
|
||||||
|
WHERE r.bankFk = vManaBank
|
||||||
|
AND r.payed > vFromDated
|
||||||
|
AND r.payed <= CURDATE()
|
||||||
|
AND c.id = vClient
|
||||||
|
UNION ALL
|
||||||
|
SELECT g.amount
|
||||||
|
FROM greuge g
|
||||||
|
JOIN client c ON c.id = g.clientFk
|
||||||
|
WHERE g.greugeTypeFk = vManaGreugeType
|
||||||
|
AND g.shipped > vFromDated
|
||||||
|
AND g.shipped <= CURDATE()
|
||||||
|
AND c.id = vClient
|
||||||
|
) sub;
|
||||||
|
RETURN IFNULL(vMana,0);
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
USE `vn`;
|
||||||
|
DROP procedure IF EXISTS `getItemVisibleAvailable`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
USE `vn`$$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `getItemVisibleAvailable`(
|
||||||
|
vItem INT,
|
||||||
|
vDate DATE,
|
||||||
|
vWarehouse TINYINT,
|
||||||
|
vRefresh BOOL)
|
||||||
|
BEGIN
|
||||||
|
-- DEPRECADO - UTILIZAR vn.item_getVisibleAvailable() - JSB - 2019-11-20
|
||||||
|
CALL item_getVisibleAvailable(vItem, vDate, vWarehouse, vRefresh);
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
USE `vn`;
|
||||||
|
DROP procedure IF EXISTS `itemGetVisibleAvailable`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
USE `vn`$$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `itemGetVisibleAvailable`(
|
||||||
|
vItem INT,
|
||||||
|
vDate DATE,
|
||||||
|
vWarehouse TINYINT,
|
||||||
|
vRefresh BOOL)
|
||||||
|
BEGIN
|
||||||
|
-- DEPRECADO - UTILIZAR vn.item_getVisibleAvailable() - JSB - 2019-11-20
|
||||||
|
CALL item_getVisibleAvailable(vItem, vDate, vWarehouse, vRefresh);
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
|
||||||
|
USE `vn`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
USE `vn`$$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `item_getVisibleAvailable`(
|
||||||
|
vItem INT,
|
||||||
|
vDate DATE,
|
||||||
|
vWarehouse TINYINT,
|
||||||
|
vRefresh BOOL)
|
||||||
|
BEGIN
|
||||||
|
DECLARE vVisibleCalc INT;
|
||||||
|
DECLARE vAvailableCalc INT;
|
||||||
|
DECLARE vVisibleAltillo INT;
|
||||||
|
|
||||||
|
CALL cache.available_refresh(vAvailableCalc, FALSE /*vRefresh*/ , vWarehouse, vDate);
|
||||||
|
CALL cache.visible_refresh(vVisibleCalc, FALSE,vWarehouse);
|
||||||
|
|
||||||
|
SELECT visible INTO vVisibleAltillo
|
||||||
|
FROM vn.itemShelvingStock
|
||||||
|
WHERE itemFk = vItem
|
||||||
|
AND warehouseFk = vWarehouse;
|
||||||
|
|
||||||
|
IF vRefresh THEN
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS vn2008.tmp_item;
|
||||||
|
CREATE TEMPORARY TABLE vn2008.tmp_item
|
||||||
|
(PRIMARY KEY (item_id))
|
||||||
|
ENGINE = MEMORY
|
||||||
|
SELECT vItem item_id, 0 stock, 0 visible;
|
||||||
|
|
||||||
|
SELECT i.id, i.longName, i.box, i.typeFk,
|
||||||
|
i.tag5,i.value5,i.tag6,i.value6,i.tag7,i.value7,i.tag8,i.value8,
|
||||||
|
ip.code, ip.reserve,
|
||||||
|
vi.visible - IFNULL(vVisibleAltillo,0) AS visible,
|
||||||
|
av.available
|
||||||
|
FROM vn.item i
|
||||||
|
LEFT JOIN vn.itemPlacement ip
|
||||||
|
ON i.id = ip.itemFk AND ip.warehouseFk = vWarehouse
|
||||||
|
LEFT JOIN vn2008.tmp_item v
|
||||||
|
ON v.item_id = i.id
|
||||||
|
LEFT JOIN cache.available av
|
||||||
|
ON av.calc_id = vAvailableCalc AND av.item_id = i.id
|
||||||
|
LEFT JOIN cache.visible vi
|
||||||
|
ON vi.calc_id = vVisibleCalc AND vi.item_id = i.id
|
||||||
|
LEFT JOIN cache.stock st
|
||||||
|
ON st.warehouse_id = vWarehouse AND st.item_id = i.id
|
||||||
|
WHERE (vItem IS NULL OR i.id = vItem);
|
||||||
|
|
||||||
|
ELSE
|
||||||
|
|
||||||
|
SELECT i.id, i.longName, i.box, i.typeFk,
|
||||||
|
i.tag5,i.value5,i.tag6,i.value6,i.tag7,i.value7,i.tag8,i.value8,
|
||||||
|
ip.code, ip.reserve,
|
||||||
|
v.visible - IFNULL(vVisibleAltillo,0) AS visible,
|
||||||
|
av.available
|
||||||
|
FROM vn.item i
|
||||||
|
LEFT JOIN vn.itemPlacement ip
|
||||||
|
ON i.id = ip.itemFk AND ip.warehouseFk = vWarehouse
|
||||||
|
LEFT JOIN cache.visible v
|
||||||
|
ON v.item_id = i.id AND v.calc_id = vVisibleCalc
|
||||||
|
LEFT JOIN cache.available av
|
||||||
|
ON av.item_id = i.id AND av.calc_id = vAvailableCalc
|
||||||
|
WHERE (vItem IS NULL OR i.id = vItem);
|
||||||
|
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
;
|
|
@ -0,0 +1,73 @@
|
||||||
|
DROP function IF EXISTS `vn`.`workerTimeControl_add`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE DEFINER=`root`@`%` FUNCTION `vn`.`workerTimeControl_add`( vUserFk INT, vWarehouseFk INT, vTimed DATETIME, vIsManual BOOL) RETURNS int(11)
|
||||||
|
DETERMINISTIC
|
||||||
|
BEGIN
|
||||||
|
DECLARE vDirection VARCHAR(6);
|
||||||
|
DECLARE vLastIn DATETIME;
|
||||||
|
DECLARE vDayStayMax INT;
|
||||||
|
DECLARE vHasDirectionOut INT;
|
||||||
|
DECLARE vLastInsertedId INT;
|
||||||
|
|
||||||
|
SELECT dayStayMax INTO vDayStayMax
|
||||||
|
FROM workerTimeControlParams;
|
||||||
|
|
||||||
|
SELECT timeWorkerControl_getDirection(vUserFk,vTimed) INTO vDirection;
|
||||||
|
|
||||||
|
IF vDirection = 'out' THEN
|
||||||
|
|
||||||
|
SELECT MAX(timed) INTO vLastIn
|
||||||
|
FROM workerTimeControl
|
||||||
|
WHERE userFk = vUserFk
|
||||||
|
AND direction = 'in'
|
||||||
|
AND timed < vTimed;
|
||||||
|
|
||||||
|
UPDATE workerTimeControl wtc
|
||||||
|
SET wtc.direction = 'middle'
|
||||||
|
WHERE userFk = vUserFk
|
||||||
|
AND direction = 'out'
|
||||||
|
AND timed BETWEEN vLastIn AND vTimed;
|
||||||
|
|
||||||
|
ELSE IF vDirection = 'in' THEN
|
||||||
|
|
||||||
|
SELECT COUNT(*) INTO vHasDirectionOut
|
||||||
|
FROM workerTimeControl wtc
|
||||||
|
WHERE userFk = vUserFk
|
||||||
|
AND direction = 'out'
|
||||||
|
AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
|
||||||
|
|
||||||
|
UPDATE workerTimeControl wtc
|
||||||
|
SET wtc.direction = IF (vHasDirectionOut,'middle','out')
|
||||||
|
WHERE userFk = vUserFk
|
||||||
|
AND direction = 'in'
|
||||||
|
AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed);
|
||||||
|
|
||||||
|
END IF;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
INSERT INTO workerTimeControl(userFk, timed, warehouseFk, direction, manual)
|
||||||
|
VALUES(vUserFk, vTimed, vWarehouseFk, vDirection, vIsManual);
|
||||||
|
|
||||||
|
SET vLastInsertedId = LAST_INSERT_ID();
|
||||||
|
|
||||||
|
CALL workerTimeControlSOWP(vUserFk, vTimed);
|
||||||
|
|
||||||
|
RETURN vLastInsertedId;
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP procedure IF EXISTS `vn`.`workerTimeControl_add`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`workerTimeControl_add`(IN vUserFk INT, IN vWarehouseFk INT, IN vTimed DATETIME, IN vIsManual BOOL)
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
SELECT workerTimeControl_add(vUserFk,vWarehouseFk,vTimed,vIsManual);
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,92 @@
|
||||||
|
DROP function IF EXISTS `vn`.`bionicCalcReverse`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE DEFINER=`root`@`%` FUNCTION `vn`.`bionicCalcReverse`(vWarehouse INT,
|
||||||
|
vMargin DECIMAL(10,3),
|
||||||
|
vRetailedPrice DECIMAL(10,3),
|
||||||
|
vM3 DECIMAL(10,3),
|
||||||
|
vAddress INT,
|
||||||
|
vAgencyMode INT) RETURNS decimal(10,3)
|
||||||
|
DETERMINISTIC
|
||||||
|
BEGIN
|
||||||
|
DECLARE vGeneralInflationCoeficient INT;
|
||||||
|
DECLARE vVerdnaturaVolumeBox BIGINT;
|
||||||
|
DECLARE vClientFk INT;
|
||||||
|
DECLARE vComponentRecovery VARCHAR(50) DEFAULT 'debtCollection';
|
||||||
|
DECLARE vComponentMana VARCHAR(50) DEFAULT 'autoMana';
|
||||||
|
DECLARE vComponentPort VARCHAR(50) DEFAULT 'delivery';
|
||||||
|
DECLARE vComponentMargin VARCHAR(50) DEFAULT 'margin';
|
||||||
|
DECLARE vComponentCost VARCHAR(50) DEFAULT 'purchaseValue';
|
||||||
|
DECLARE vComponentCostValue DECIMAL(10,2);
|
||||||
|
DECLARE vItem INT DEFAULT 98;
|
||||||
|
DECLARE vItemCarryBox INT;
|
||||||
|
|
||||||
|
SELECT generalInflationCoeFicient, verdnaturaVolumeBox, itemCarryBox
|
||||||
|
INTO vGeneralInflationCoeficient, vVerdnaturaVolumeBox, vItemCarryBox
|
||||||
|
FROM bionicConfig;
|
||||||
|
|
||||||
|
SELECT clientFk INTO vClientFk FROM address WHERE id = vAddress;
|
||||||
|
|
||||||
|
-- Creamos la tabla tmp.bionicComponent
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp.bionicComponent;
|
||||||
|
CREATE TEMPORARY TABLE tmp.bionicComponent(
|
||||||
|
`warehouseFk` smallint(5) unsigned NOT NULL,
|
||||||
|
`itemFk` int(11) NOT NULL,
|
||||||
|
`componentFk` int(10) unsigned NOT NULL,
|
||||||
|
`value` decimal(10,4) NOT NULL,
|
||||||
|
UNIQUE KEY `itemWarehouseComponent` (`itemFk`,`warehouseFk`,`componentFk`) USING HASH,
|
||||||
|
KEY `itemWarehouse` (`itemFk`,`warehouseFk`) USING BTREE
|
||||||
|
) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
-- Margin
|
||||||
|
INSERT INTO tmp.bionicComponent (warehouseFk, itemFk, componentFk, `value`)
|
||||||
|
SELECT vWarehouse, vItem, id, vMargin
|
||||||
|
FROM component
|
||||||
|
WHERE code = vComponentMargin;
|
||||||
|
|
||||||
|
-- Recobro
|
||||||
|
INSERT INTO tmp.bionicComponent (warehouseFk, itemFk, componentFk, `value`)
|
||||||
|
SELECT vWarehouse, vItem, c.id, ROUND(LEAST(cr.recobro,0.25), 3)
|
||||||
|
FROM bi.claims_ratio cr
|
||||||
|
JOIN component c ON c.code = vComponentRecovery
|
||||||
|
WHERE cr.Id_Cliente = vClientFk AND cr.recobro > 0.009;
|
||||||
|
|
||||||
|
-- Componente de maná automático, en función del maná acumulado por el comercial.
|
||||||
|
INSERT INTO tmp.bionicComponent (warehouseFk, itemFk, componentFk, `value`)
|
||||||
|
SELECT vWarehouse, vItem, co.id, ROUND(ms.prices_modifier_rate, 3)
|
||||||
|
FROM client c
|
||||||
|
JOIN bs.mana_spellers ms ON c.salesPersonFk = ms.Id_Trabajador
|
||||||
|
JOIN component co ON co.code = vComponentMana
|
||||||
|
WHERE ms.prices_modifier_activated AND c.id = vClientFk LIMIT 1;
|
||||||
|
|
||||||
|
-- Reparto
|
||||||
|
INSERT INTO tmp.bionicComponent (warehouseFk, itemFk, componentFk, `value`)
|
||||||
|
SELECT vWarehouse, vItem, co.id, vGeneralInflationCoeficient
|
||||||
|
* ROUND(
|
||||||
|
vM3
|
||||||
|
* az.price
|
||||||
|
* az.inflation
|
||||||
|
/ vVerdnaturaVolumeBox, 4
|
||||||
|
)
|
||||||
|
FROM agencyMode ag
|
||||||
|
JOIN address a ON a.id = vAddress AND ag.id = vAgencyMode
|
||||||
|
JOIN agencyProvince ap ON ap.agencyFk = ag.agencyFk
|
||||||
|
AND ap.warehouseFk = vWarehouse AND ap.provinceFk = a.provinceFk
|
||||||
|
JOIN agencyModeZone az ON az.agencyModeFk = vAgencyMode
|
||||||
|
AND az.zone = ap.zone AND az.itemFk = 71 AND az.warehouseFk = vWarehouse
|
||||||
|
JOIN component co ON co.code = vComponentPort;
|
||||||
|
|
||||||
|
-- Coste
|
||||||
|
SELECT vRetailedPrice - SUM(`value`) INTO vComponentCostValue
|
||||||
|
FROM tmp.bionicComponent;
|
||||||
|
|
||||||
|
INSERT INTO tmp.bionicComponent (warehouseFk, itemFk, componentFk, `value`)
|
||||||
|
SELECT vWarehouse, vItem, id,vComponentCostValue
|
||||||
|
FROM component
|
||||||
|
WHERE code = vComponentCost;
|
||||||
|
|
||||||
|
RETURN vComponentCostValue;
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
SELECT entryFk, itemFk, stickers, packing
|
||||||
|
INTO vEntryFk, vItemFk, vStickers, vPacking
|
||||||
|
FROM buy
|
||||||
|
WHERE id = vSelf;
|
||||||
|
|
||||||
|
SELECT t.warehouseInFk, t.warehouseOutFk
|
||||||
|
INTO vWarehouse, vWarehouseOut
|
||||||
|
FROM entry e
|
||||||
|
JOIN travel t ON t.id = e.travelFk
|
||||||
|
WHERE e.id = vEntryFk;
|
||||||
|
|
||||||
|
SELECT k.merchandise INTO vIsMerchandise
|
||||||
|
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 bi.rotacion SET
|
||||||
|
Id_Article = vItemFk,
|
||||||
|
warehouse_id = vWarehouse,
|
||||||
|
cm3 = buy_getUnitVolume(vSelf);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SELECT isFeedStock INTO vIsFeedStock
|
||||||
|
FROM warehouse WHERE id = vWarehouseOut AND id <> 13;
|
||||||
|
|
||||||
|
IF vIsFeedStock AND vn2008.has_notify_passport(vItemFk, vSelf) THEN
|
||||||
|
CALL vn.buy_notifyPassport(vSelf, vItemFk, vStickers, vPacking);
|
||||||
|
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 = 1;
|
||||||
|
END IF;
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
DROP procedure IF EXISTS `vn2008`.`notify_passport`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `vn2008`.`notify_passport`(
|
||||||
|
IN vItemFk INT,
|
||||||
|
IN vStickers SMALLINT,
|
||||||
|
IN vPacking SMALLINT,
|
||||||
|
IN vBuyFk INT
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
-- DPRECATED use vn.buy_notifyPassport
|
||||||
|
CALL vn.buy_notifyPassport(vBuyFk, vItemFk, vStickers, vPacking);
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
USE `util`;
|
USE `util`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: util
|
-- Host: db.verdnatura.es Database: util
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -36,9 +36,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:47
|
-- Dump completed on 2019-11-19 13:07:53
|
||||||
USE `account`;
|
USE `account`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: account
|
-- Host: db.verdnatura.es Database: account
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -71,7 +71,7 @@ UNLOCK TABLES;
|
||||||
|
|
||||||
LOCK TABLES `roleInherit` WRITE;
|
LOCK TABLES `roleInherit` WRITE;
|
||||||
/*!40000 ALTER TABLE `roleInherit` DISABLE KEYS */;
|
/*!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),(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),(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),(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),(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),(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);
|
||||||
/*!40000 ALTER TABLE `roleInherit` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `roleInherit` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ UNLOCK TABLES;
|
||||||
|
|
||||||
LOCK TABLES `roleRole` WRITE;
|
LOCK TABLES `roleRole` WRITE;
|
||||||
/*!40000 ALTER TABLE `roleRole` DISABLE KEYS */;
|
/*!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),(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),(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,15),(15,35),(16,1),(16,2),(16,3),(16,6),(16,11),(16,13),(16,15),(16,16),(16,35),(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,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);
|
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),(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),(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,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);
|
||||||
/*!40000 ALTER TABLE `roleRole` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `roleRole` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||||
|
@ -94,9 +94,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:53
|
||||||
USE `salix`;
|
USE `salix`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: salix
|
-- Host: db.verdnatura.es Database: salix
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -142,9 +142,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:53
|
||||||
USE `vn`;
|
USE `vn`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: vn
|
-- Host: db.verdnatura.es Database: vn
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -310,9 +310,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:53
|
||||||
USE `vn2008`;
|
USE `vn2008`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: vn2008
|
-- Host: db.verdnatura.es Database: vn2008
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -388,9 +388,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:53
|
||||||
USE `bi`;
|
USE `bi`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: bi
|
-- Host: db.verdnatura.es Database: bi
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -436,9 +436,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:53
|
||||||
USE `cache`;
|
USE `cache`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: cache
|
-- Host: db.verdnatura.es Database: cache
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -474,9 +474,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:53
|
||||||
USE `hedera`;
|
USE `hedera`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: hedera
|
-- Host: db.verdnatura.es Database: hedera
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -532,9 +532,9 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:54
|
||||||
USE `postgresql`;
|
USE `postgresql`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: postgresql
|
-- Host: db.verdnatura.es Database: postgresql
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
@ -620,4 +620,4 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-11-13 10:04:48
|
-- Dump completed on 2019-11-19 13:07:54
|
||||||
|
|
|
@ -10,6 +10,11 @@ INSERT INTO `account`.`mailConfig` (`id`, `domain`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', 'verdnatura.es');
|
('1', 'verdnatura.es');
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`bionicConfig` (`generalInflationCoeficient`, `minimumDensityVolumetricWeight`, `verdnaturaVolumeBox`, `itemCarryBox`)
|
||||||
|
VALUES
|
||||||
|
(1.30, 167.00, 138000, 71);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `account`.`user`(`id`,`name`, `nickname`, `password`,`role`,`active`,`email`, `lang`)
|
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'), 'es'
|
||||||
FROM `account`.`role`;
|
FROM `account`.`role`;
|
||||||
|
@ -31,7 +36,7 @@ INSERT INTO `hedera`.`tpvConfig`(`id`, `currency`, `terminal`, `transactionType`
|
||||||
INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`,`lang`)
|
INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`,`lang`)
|
||||||
VALUES
|
VALUES
|
||||||
(101, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@mydomain.com', 'es'),
|
(101, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@mydomain.com', 'es'),
|
||||||
(102, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@mydomain.com', 'es'),
|
(102, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@mydomain.com', 'en'),
|
||||||
(103, 'ClarkKent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@mydomain.com', 'fr'),
|
(103, 'ClarkKent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@mydomain.com', 'fr'),
|
||||||
(104, 'TonyStark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@mydomain.com', 'es'),
|
(104, 'TonyStark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@mydomain.com', 'es'),
|
||||||
(105, 'MaxEisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt'),
|
(105, 'MaxEisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt'),
|
||||||
|
@ -558,18 +563,18 @@ INSERT INTO `vn`.`vehicle`(`id`, `numberPlate`, `tradeMark`, `model`, `companyFk
|
||||||
(5, '4444-IMK', 'STARK INDUSTRIES', 'MARK-XLII', 442, 1, 'Iron-Man Heavy Armor MARK-XLII', 13, 1),
|
(5, '4444-IMK', 'STARK INDUSTRIES', 'MARK-XLII', 442, 1, 'Iron-Man Heavy Armor MARK-XLII', 13, 1),
|
||||||
(6, '5555-IMK', 'STARK INDUSTRIES', 'MARK-XLV', 442, 1, 'Iron-Man Heavy Armor MARK-XLV', 12, 0);
|
(6, '5555-IMK', 'STARK INDUSTRIES', 'MARK-XLV', 442, 1, 'Iron-Man Heavy Armor MARK-XLV', 12, 0);
|
||||||
|
|
||||||
INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`)
|
INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`, `inventoried`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'beta-server', 'nightmare@mydomain.com', '200');
|
(1, 'beta-server', 'nightmare@mydomain.com', '200', DATE_ADD(CURDATE(),INTERVAL -1 MONTH));
|
||||||
|
|
||||||
INSERT INTO `vn`.`greugeType`(`id`, `name`)
|
INSERT INTO `vn`.`greugeType`(`id`, `name`, `code`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Diff'),
|
(1, 'Diff', 'diff'),
|
||||||
(2, 'Recover'),
|
(2, 'Recover', 'recover'),
|
||||||
(3, 'Manna'),
|
(3, 'Mana', 'mana'),
|
||||||
(4, 'Reclaim'),
|
(4, 'Reclaim', 'reclaim'),
|
||||||
(5, 'Heritage'),
|
(5, 'Heritage', 'heritage'),
|
||||||
(6, 'Miscellaneous');
|
(6, 'Miscellaneous', 'miscellaneous');
|
||||||
|
|
||||||
INSERT INTO `vn`.`greuge`(`id`, `clientFk`, `description`, `amount`, `shipped`, `created`, `greugeTypeFk`, `ticketFk`)
|
INSERT INTO `vn`.`greuge`(`id`, `clientFk`, `description`, `amount`, `shipped`, `created`, `greugeTypeFk`, `ticketFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -1117,10 +1122,6 @@ INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`package
|
||||||
(14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, 0.00, NULL, 0, 1, 0, CURDATE()),
|
(14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, 0.00, NULL, 0, 1, 0, CURDATE()),
|
||||||
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0.00, NULL, 0, 1, 0, CURDATE());
|
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0.00, NULL, 0, 1, 0, CURDATE());
|
||||||
|
|
||||||
INSERT INTO `vn2008`.`tblContadores`(`id`,`FechaInventario`)
|
|
||||||
VALUES
|
|
||||||
(1,DATE_ADD(CURDATE(),INTERVAL -1 MONTH));
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
|
INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'AGENCY', 'Agencia'),
|
(1, 'AGENCY', 'Agencia'),
|
||||||
|
@ -1834,12 +1835,12 @@ INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `dated`)
|
||||||
(8, 'day', DATE_ADD(CURDATE(), INTERVAL +5 DAY)),
|
(8, 'day', DATE_ADD(CURDATE(), INTERVAL +5 DAY)),
|
||||||
(8, 'day', DATE_ADD(CURDATE(), INTERVAL +6 DAY));
|
(8, 'day', DATE_ADD(CURDATE(), INTERVAL +6 DAY));
|
||||||
|
|
||||||
INSERT INTO `vn`.`workerTimeControl`(`userFk`,`timed`,`manual`, `direction`)
|
INSERT INTO `vn`.`workerTimeControl`(`userFk`, `timed`, `order`, `manual`, `direction`)
|
||||||
VALUES
|
VALUES
|
||||||
(106, CONCAT(CURDATE(), ' 07:00'), TRUE, 'in'),
|
(106, CONCAT(CURDATE(), ' 07:00'), 1, TRUE, 'in'),
|
||||||
(106, CONCAT(CURDATE(), ' 10:00'), TRUE, 'middle'),
|
(106, CONCAT(CURDATE(), ' 10:00'), 2, TRUE, 'middle'),
|
||||||
(106, CONCAT(CURDATE(), ' 10:10'), TRUE, 'middle'),
|
(106, CONCAT(CURDATE(), ' 10:10'), 3, TRUE, 'middle'),
|
||||||
(106, CONCAT(CURDATE(), ' 15:00'), TRUE, 'out');
|
(106, CONCAT(CURDATE(), ' 15:00'), 4, TRUE, 'out');
|
||||||
|
|
||||||
INSERT INTO `vn`.`dmsType`(`id`, `name`, `path`, `readRoleFk`, `writeRoleFk`, `code`)
|
INSERT INTO `vn`.`dmsType`(`id`, `name`, `path`, `readRoleFk`, `writeRoleFk`, `code`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -428,6 +428,16 @@ let actions = {
|
||||||
|
|
||||||
waitForSpinnerLoad: function() {
|
waitForSpinnerLoad: function() {
|
||||||
return this.waitUntilNotPresent('vn-topbar vn-spinner');
|
return this.waitUntilNotPresent('vn-topbar vn-spinner');
|
||||||
|
},
|
||||||
|
|
||||||
|
waitForWatcherData: function(selector) {
|
||||||
|
return this.wait(selector)
|
||||||
|
.wait(selector => {
|
||||||
|
const watcher = document.querySelector(selector);
|
||||||
|
let orgData = watcher.$ctrl.orgData;
|
||||||
|
return !angular.equals({}, orgData) && orgData != null;
|
||||||
|
}, selector)
|
||||||
|
.waitForSpinnerLoad();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,8 @@ export default {
|
||||||
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
|
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
|
||||||
saveButton: `button[type=submit]`,
|
saveButton: `button[type=submit]`,
|
||||||
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
|
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
|
||||||
cancelEditAddressButton: 'vn-client-address-edit > form > vn-button-bar > vn-button > button'
|
cancelEditAddressButton: 'vn-client-address-edit > form > vn-button-bar > vn-button > button',
|
||||||
|
watcher: 'vn-client-address-edit vn-watcher'
|
||||||
},
|
},
|
||||||
clientWebAccess: {
|
clientWebAccess: {
|
||||||
webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]',
|
webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]',
|
||||||
|
|
|
@ -138,7 +138,7 @@ describe('Client Edit fiscalData path', () => {
|
||||||
it(`should click on the 1st edit icon to confirm EQtax is checked`, async() => {
|
it(`should click on the 1st edit icon to confirm EQtax is checked`, async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.clientAddresses.firstEditAddress)
|
.waitToClick(selectors.clientAddresses.firstEditAddress)
|
||||||
.waitForSpinnerLoad()
|
.waitForWatcherData(selectors.clientAddresses.watcher)
|
||||||
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
||||||
|
|
||||||
expect(result).toBe('checked');
|
expect(result).toBe('checked');
|
||||||
|
@ -149,7 +149,7 @@ describe('Client Edit fiscalData path', () => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.clientAddresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitToClick(selectors.clientAddresses.secondEditAddress)
|
.waitToClick(selectors.clientAddresses.secondEditAddress)
|
||||||
.waitForSpinnerLoad()
|
.waitForWatcherData(selectors.clientAddresses.watcher)
|
||||||
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
||||||
|
|
||||||
expect(result).toBe('checked');
|
expect(result).toBe('checked');
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import './tooltip';
|
import './tooltip';
|
||||||
|
|
||||||
// #1615 migrar karma a jest
|
describe('Component vnTooltip', () => {
|
||||||
xdescribe('Component vnTooltip', () => {
|
|
||||||
let $element;
|
let $element;
|
||||||
let controller;
|
let controller;
|
||||||
let $parent;
|
let $parent;
|
||||||
|
@ -21,8 +20,8 @@ xdescribe('Component vnTooltip', () => {
|
||||||
$parent.css({
|
$parent.css({
|
||||||
backgroundColor: 'red',
|
backgroundColor: 'red',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
width: '10px',
|
width: '100px',
|
||||||
height: '10px',
|
height: '100px',
|
||||||
top: '0',
|
top: '0',
|
||||||
left: '0'
|
left: '0'
|
||||||
});
|
});
|
||||||
|
@ -36,13 +35,13 @@ xdescribe('Component vnTooltip', () => {
|
||||||
|
|
||||||
describe('show()', () => {
|
describe('show()', () => {
|
||||||
it(`should check that tooltip is visible into the screen`, () => {
|
it(`should check that tooltip is visible into the screen`, () => {
|
||||||
|
expect(element.classList).not.toContain('show');
|
||||||
|
|
||||||
controller.show($parent[0]);
|
controller.show($parent[0]);
|
||||||
|
|
||||||
let rect = element.getBoundingClientRect();
|
let rect = element.getBoundingClientRect();
|
||||||
let style = window.getComputedStyle(element);
|
|
||||||
|
|
||||||
expect(style.visibility).toEqual('visible');
|
expect(element.classList).toContain('show');
|
||||||
expect(style.display).not.toEqual('none');
|
|
||||||
|
|
||||||
expect(0).toBeLessThanOrEqual(rect.top);
|
expect(0).toBeLessThanOrEqual(rect.top);
|
||||||
expect(0).toBeLessThanOrEqual(rect.left);
|
expect(0).toBeLessThanOrEqual(rect.left);
|
||||||
|
@ -54,14 +53,16 @@ xdescribe('Component vnTooltip', () => {
|
||||||
describe('hide()', () => {
|
describe('hide()', () => {
|
||||||
it(`should check that tooltip is not visible`, () => {
|
it(`should check that tooltip is not visible`, () => {
|
||||||
controller.show($parent[0]);
|
controller.show($parent[0]);
|
||||||
|
|
||||||
|
expect(element.classList).toContain('show');
|
||||||
controller.hide();
|
controller.hide();
|
||||||
let style = window.getComputedStyle(element);
|
|
||||||
|
|
||||||
expect(style.display).toEqual('none');
|
expect(element.classList).not.toContain('show');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('relocate()', () => {
|
// #1892 reparar unitarios front tooltip.js
|
||||||
|
xdescribe('relocate()', () => {
|
||||||
it(`should reallocate tooltip on top-left`, () => {
|
it(`should reallocate tooltip on top-left`, () => {
|
||||||
controller.show($parent[0]);
|
controller.show($parent[0]);
|
||||||
let rect = element.getBoundingClientRect();
|
let rect = element.getBoundingClientRect();
|
||||||
|
|
|
@ -62,12 +62,15 @@ class Controller extends Component {
|
||||||
return date && new Date(date).setHours(0, 0, 0, 0);
|
return date && new Date(date).setHours(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.exclusionsMap = {};
|
this.exclusions = {};
|
||||||
let exclusions = value.exclusions;
|
let exclusions = value.exclusions;
|
||||||
|
|
||||||
if (exclusions) {
|
if (exclusions) {
|
||||||
for (let exclusion of exclusions)
|
for (let exclusion of exclusions) {
|
||||||
this.exclusionsMap[toStamp(exclusion.dated)] = exclusion;
|
let stamp = toStamp(exclusion.dated);
|
||||||
|
if (!this.exclusions[stamp]) this.exclusions[stamp] = [];
|
||||||
|
this.exclusions[stamp].push(exclusion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let events = value.events;
|
let events = value.events;
|
||||||
|
@ -98,6 +101,7 @@ class Controller extends Component {
|
||||||
let stamp = day.getTime();
|
let stamp = day.getTime();
|
||||||
let wday = day.getDay();
|
let wday = day.getDay();
|
||||||
let dayEvents = [];
|
let dayEvents = [];
|
||||||
|
let exclusions = this.exclusions[stamp] || [];
|
||||||
|
|
||||||
if (this.events) {
|
if (this.events) {
|
||||||
for (let event of this.events) {
|
for (let event of this.events) {
|
||||||
|
@ -114,46 +118,46 @@ class Controller extends Component {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match)
|
if (match && !exclusions.find(e => e.zoneFk == event.zoneFk))
|
||||||
dayEvents.push(event);
|
dayEvents.push(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let exclusion = this.exclusionsMap[stamp];
|
if (dayEvents.length)
|
||||||
|
this.days[stamp] = dayEvents;
|
||||||
if (dayEvents.length || exclusion) {
|
|
||||||
let dayData = {};
|
|
||||||
if (dayEvents.length) dayData.events = dayEvents;
|
|
||||||
if (exclusion) dayData.exclusion = exclusion;
|
|
||||||
this.days[stamp] = dayData;
|
|
||||||
}
|
|
||||||
|
|
||||||
day.setDate(day.getDate() + 1);
|
day.setDate(day.getDate() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelection($days, $type, $weekday) {
|
onSelection($days, $type, $weekday) {
|
||||||
let $data = [];
|
let $events = [];
|
||||||
|
let $exclusions = [];
|
||||||
|
|
||||||
for (let day of $days) {
|
for (let day of $days) {
|
||||||
let dayData = this.days[day.getTime()];
|
let stamp = day.getTime();
|
||||||
if (dayData) $data.push(dayData);
|
$events = $events.concat(this.days[stamp] || []);
|
||||||
|
$exclusions = $exclusions.concat(this.exclusions[stamp] || []);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit('selection', {
|
this.emit('selection', {
|
||||||
$days,
|
$days,
|
||||||
$type,
|
$type,
|
||||||
$weekday,
|
$weekday,
|
||||||
$data
|
$events,
|
||||||
|
$exclusions
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
hasEvents(day) {
|
hasEvents(day) {
|
||||||
return this.days[day.getTime()] != null;
|
let stamp = day.getTime();
|
||||||
|
return this.days[stamp] || this.exclusions[stamp];
|
||||||
}
|
}
|
||||||
|
|
||||||
getClass(day) {
|
getClass(day) {
|
||||||
let dayData = this.days[day.getTime()];
|
let stamp = day.getTime();
|
||||||
return dayData && dayData.exclusion ? 'excluded' : '';
|
return this.exclusions[stamp] && !this.days[stamp]
|
||||||
|
? 'excluded' : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Controller.$inject = ['$element', '$scope', 'vnWeekDays'];
|
Controller.$inject = ['$element', '$scope', 'vnWeekDays'];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<vn-zone-calendar
|
<vn-zone-calendar
|
||||||
id="calendar"
|
id="calendar"
|
||||||
data="data"
|
data="data"
|
||||||
on-selection="$ctrl.onSelection($days, $type, $weekday, $data)"
|
on-selection="$ctrl.onSelection($days, $type, $weekday, $events, $exclusions)"
|
||||||
class="vn-w-md">
|
class="vn-w-md">
|
||||||
</vn-zone-calendar>
|
</vn-zone-calendar>
|
||||||
<vn-side-menu side="right">
|
<vn-side-menu side="right">
|
||||||
|
|
|
@ -36,22 +36,13 @@ class Controller extends Section {
|
||||||
: this.$t('Everyday');
|
: this.$t('Everyday');
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelection(days, type, weekday, data) {
|
onSelection(days, type, weekday, events, exclusions) {
|
||||||
if (this.editMode == 'include') {
|
if (this.editMode == 'include') {
|
||||||
let dayData = data[0] || {};
|
if (events.length)
|
||||||
let event = dayData.events && dayData.events[0];
|
this.edit(events[0]);
|
||||||
|
|
||||||
if (event)
|
|
||||||
this.edit(event);
|
|
||||||
else
|
else
|
||||||
this.create(days, type, weekday);
|
this.create(days, type, weekday);
|
||||||
} else {
|
} else {
|
||||||
let exclusions = [];
|
|
||||||
for (let dayData of data) {
|
|
||||||
if (dayData.exclusion)
|
|
||||||
exclusions.push(dayData.exclusion.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exclusions.length)
|
if (exclusions.length)
|
||||||
this.exclusionDelete(exclusions);
|
this.exclusionDelete(exclusions);
|
||||||
else
|
else
|
||||||
|
@ -155,16 +146,16 @@ class Controller extends Section {
|
||||||
.then(() => this.refresh());
|
.then(() => this.refresh());
|
||||||
}
|
}
|
||||||
|
|
||||||
exclusionDelete(ids) {
|
exclusionDelete(exclusions) {
|
||||||
let promises = [];
|
let reqs = [];
|
||||||
|
|
||||||
for (let id of ids) {
|
for (let exclusion of exclusions) {
|
||||||
promises.push(
|
if (!exclusion.id) continue;
|
||||||
this.$http.delete(`${this.exclusionsPath}/${id}`)
|
let path = `${this.exclusionsPath}/${exclusion.id}`;
|
||||||
);
|
reqs.push(this.$http.delete(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$q.all(promises)
|
this.$q.all(reqs)
|
||||||
.then(() => this.refresh());
|
.then(() => this.refresh());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
// Visible Avaible
|
// Visible Avaible
|
||||||
let query = `
|
let query = `
|
||||||
CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
|
CALL vn.item_getVisibleAvailable(?,curdate(),?,?)`;
|
||||||
|
|
||||||
let options = [summary.item.id, summary.item.itemType().warehouseFk, false];
|
let options = [summary.item.id, summary.item.itemType().warehouseFk, false];
|
||||||
[res] = await Self.rawSql(query, options);
|
[res] = await Self.rawSql(query, options);
|
||||||
|
|
|
@ -24,7 +24,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
Self.getVisibleAvailable = async(id, warehouseFk) => {
|
Self.getVisibleAvailable = async(id, warehouseFk) => {
|
||||||
let query = `
|
let query = `
|
||||||
CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
|
CALL vn.item_getVisibleAvailable(?,curdate(),?,?)`;
|
||||||
|
|
||||||
let options = [id, warehouseFk, false];
|
let options = [id, warehouseFk, false];
|
||||||
[res] = await Self.rawSql(query, options);
|
[res] = await Self.rawSql(query, options);
|
||||||
|
|
|
@ -65,7 +65,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
|
|
||||||
let query = `
|
let query = `
|
||||||
CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
|
CALL vn.item_getVisibleAvailable(?,curdate(),?,?)`;
|
||||||
|
|
||||||
let params = [itemFk, warehouseFk, true];
|
let params = [itemFk, warehouseFk, true];
|
||||||
let [res] = await Self.rawSql(query, params, options);
|
let [res] = await Self.rawSql(query, params, options);
|
||||||
|
|
|
@ -16,7 +16,7 @@ describe('regularize()', () => {
|
||||||
let ctx = {req: {accessToken: {userId: 18}}};
|
let ctx = {req: {accessToken: {userId: 18}}};
|
||||||
|
|
||||||
|
|
||||||
let query = `CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
|
let query = `CALL vn.item_getVisibleAvailable(?,curdate(),?,?)`;
|
||||||
|
|
||||||
let options = [itemFk, warehouseFk, true];
|
let options = [itemFk, warehouseFk, true];
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ module.exports = Self => {
|
||||||
include: {relation: 'ticket'}
|
include: {relation: 'ticket'}
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
let [[stock]] = await Self.rawSql(`CALL vn.getItemVisibleAvailable(?,?,?,?)`, [
|
let [[stock]] = await Self.rawSql(`CALL vn.item_getVisibleAvailable(?,?,?,?)`, [
|
||||||
ctx.args.itemFk,
|
ctx.args.itemFk,
|
||||||
request.ticket().shipped,
|
request.ticket().shipped,
|
||||||
request.ticket().warehouseFk,
|
request.ticket().warehouseFk,
|
||||||
|
|
|
@ -43,7 +43,7 @@ module.exports = Self => {
|
||||||
const ticket = await models.Ticket.findById(id);
|
const ticket = await models.Ticket.findById(id);
|
||||||
|
|
||||||
const shouldRefresh = false;
|
const shouldRefresh = false;
|
||||||
const [[stock]] = await Self.rawSql(`CALL vn.itemGetVisibleAvailable(?, ?, ?, ?)`, [
|
const [[stock]] = await Self.rawSql(`CALL vn.item_getVisibleAvailable(?, ?, ?, ?)`, [
|
||||||
itemId,
|
itemId,
|
||||||
ticket.shipped,
|
ticket.shipped,
|
||||||
ticket.warehouseFk,
|
ticket.warehouseFk,
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
/*
|
|
||||||
Author : Enrique Blasco BLanquer
|
|
||||||
Date: 27 de mayo de 2019
|
|
||||||
*/
|
|
||||||
module.exports = Self => {
|
|
||||||
Self.remoteMethodCtx('checkUuid', {
|
|
||||||
description: 'Check UUID from user',
|
|
||||||
accessType: 'WRITE',
|
|
||||||
accepts: [{
|
|
||||||
arg: 'data',
|
|
||||||
type: 'object',
|
|
||||||
required: true,
|
|
||||||
description: 'uuid,model',
|
|
||||||
http: {source: 'body'}
|
|
||||||
}],
|
|
||||||
returns: [{
|
|
||||||
type: 'Object',
|
|
||||||
root: true
|
|
||||||
}],
|
|
||||||
http: {
|
|
||||||
path: `/checkUuid`,
|
|
||||||
verb: 'POST'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Self.checkUuid = async(ctx, data) => {
|
|
||||||
const myUserId = ctx.req.accessToken.userId;
|
|
||||||
// 1 Check is a registered user with a uuid
|
|
||||||
let deviceUser = await Self.findOne({where: {userFk: myUserId, sn: data.uuid}});
|
|
||||||
|
|
||||||
if (deviceUser != null)
|
|
||||||
return {'state': true, 'mng': ''};
|
|
||||||
else {
|
|
||||||
// 2 If it does not exist it can be for two reasons:
|
|
||||||
// 2.1 It is the first time that the application enters so we have to register a new user associated with the user
|
|
||||||
// 2.2 Has the user associated with a different uuid, so we deny access.
|
|
||||||
|
|
||||||
let device = await Self.findOne({where: {userFk: myUserId}});
|
|
||||||
if (device != null) {
|
|
||||||
// The device is already registered by another user, access is denied
|
|
||||||
return {'state': false, 'mng': 'Ya estas regisgtrado en otro dispositivo, contacta con los dioses de informática.'};
|
|
||||||
} else {
|
|
||||||
// Check that the device is free
|
|
||||||
let aDevice = await Self.findOne({where: {sn: data.uuid}});
|
|
||||||
if (aDevice != null)
|
|
||||||
return {'state': false, 'mng': 'El dispositivo esta siendo usado por otro usuario'};
|
|
||||||
else {
|
|
||||||
// It's the first time you access the application, insert
|
|
||||||
/* await Self.rawSql('INSERT INTO vn2008.device (sn, model) VALUES (?,?);', [data.uuid, data.model]);*/
|
|
||||||
await Self.create({
|
|
||||||
sn: data.uuid,
|
|
||||||
model: data.model,
|
|
||||||
userFk: myUserId
|
|
||||||
});
|
|
||||||
|
|
||||||
return {'state': true, 'mng': 'Nuevo dispositivo registrado'};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
|
@ -1,11 +0,0 @@
|
||||||
const app = require('vn-loopback/server/server');
|
|
||||||
|
|
||||||
describe('device checkUuid()', () => {
|
|
||||||
it('should return an state equal to false', async() => {
|
|
||||||
let ctx = {req: {accessToken: {userId: 9}}};
|
|
||||||
let data = {'uuid': '123', 'model': 'ihpne kike molon'};
|
|
||||||
let result = await app.models.Device.checkUuid(ctx, data);
|
|
||||||
|
|
||||||
expect(result.name).toBeFalsy();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -134,11 +134,11 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (currentContract) {
|
if (currentContract) {
|
||||||
const maxDays = currentContract.holidays().days;
|
const maxHolidays = currentContract.holidays().days;
|
||||||
calendar.totalHolidays = maxDays;
|
calendar.totalHolidays = maxHolidays;
|
||||||
|
|
||||||
if (workedDays < 365)
|
if (workedDays < 365)
|
||||||
calendar.totalHolidays = Math.round(2 * maxDays * (workedDays + 1) / 365) / 2;
|
calendar.totalHolidays = Math.round(2 * maxHolidays * (workedDays) / 365) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [calendar, absences, holidays];
|
return [calendar, absences, holidays];
|
||||||
|
|
|
@ -1,20 +1,7 @@
|
||||||
const app = require('vn-loopback/server/server');
|
const app = require('vn-loopback/server/server');
|
||||||
|
|
||||||
describe('Worker absences()', () => {
|
describe('Worker absences()', () => {
|
||||||
afterAll(async done => {
|
it('should get the absence calendar for a full year contract', async() => {
|
||||||
const hiredWorker = await app.models.WorkerLabour.findById(106);
|
|
||||||
|
|
||||||
const endedDate = new Date();
|
|
||||||
endedDate.setFullYear(endedDate.getFullYear() + 1);
|
|
||||||
endedDate.setHours(0, 0, 0, 0);
|
|
||||||
endedDate.setMonth(0);
|
|
||||||
endedDate.setDate(1);
|
|
||||||
|
|
||||||
await hiredWorker.updateAttributes({ended: endedDate});
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should get the absence calendar for the given dates then evaluate the type of absences', async() => {
|
|
||||||
let ctx = {req: {accessToken: {userId: 106}}};
|
let ctx = {req: {accessToken: {userId: 106}}};
|
||||||
let workerFk = 106;
|
let workerFk = 106;
|
||||||
|
|
||||||
|
@ -43,16 +30,11 @@ describe('Worker absences()', () => {
|
||||||
expect(sixthType).toEqual('Holidays');
|
expect(sixthType).toEqual('Holidays');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should see he/she has 26.5`, async() => {
|
it('should get the absence calendar for a permanent contract', async() => {
|
||||||
let workerFk = 106;
|
let workerFk = 106;
|
||||||
const firedWorker = await app.models.WorkerLabour.findById(workerFk);
|
let worker = await app.models.WorkerLabour.findById(workerFk);
|
||||||
|
let endedDate = worker.ended;
|
||||||
const endedDate = new Date();
|
await worker.updateAttributes({ended: null});
|
||||||
endedDate.setDate(endedDate.getDate() + 1);
|
|
||||||
endedDate.setMonth(endedDate.getMonth() + 1);
|
|
||||||
endedDate.setHours(0, 0, 0, 0);
|
|
||||||
|
|
||||||
await firedWorker.updateAttributes({ended: endedDate});
|
|
||||||
|
|
||||||
let ctx = {req: {accessToken: {userId: 9}}};
|
let ctx = {req: {accessToken: {userId: 9}}};
|
||||||
|
|
||||||
|
@ -71,76 +53,6 @@ describe('Worker absences()', () => {
|
||||||
let calendar = result[0];
|
let calendar = result[0];
|
||||||
let absences = result[1];
|
let absences = result[1];
|
||||||
|
|
||||||
expect(calendar.totalHolidays).toEqual(26.5);
|
|
||||||
expect(calendar.holidaysEnjoyed).toEqual(5);
|
|
||||||
|
|
||||||
let firstType = absences[0].absenceType().name;
|
|
||||||
let sixthType = absences[5].absenceType().name;
|
|
||||||
|
|
||||||
expect(firstType).toEqual('Leave of absence');
|
|
||||||
expect(sixthType).toEqual('Holidays');
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should see he/she has 26.5`, async() => {
|
|
||||||
const firedWorker = await app.models.WorkerLabour.findById(106);
|
|
||||||
|
|
||||||
const endedDate = new Date();
|
|
||||||
endedDate.setDate(endedDate.getDate() + 1);
|
|
||||||
endedDate.setMonth(endedDate.getMonth() + 1);
|
|
||||||
endedDate.setHours(0, 0, 0, 0);
|
|
||||||
|
|
||||||
await firedWorker.updateAttributes({ended: endedDate});
|
|
||||||
|
|
||||||
let ctx = {req: {accessToken: {userId: 106}}};
|
|
||||||
let workerFk = 106;
|
|
||||||
|
|
||||||
const started = new Date();
|
|
||||||
started.setHours(0, 0, 0, 0);
|
|
||||||
started.setMonth(0);
|
|
||||||
started.setDate(1);
|
|
||||||
|
|
||||||
const monthIndex = 11;
|
|
||||||
const ended = new Date();
|
|
||||||
ended.setHours(0, 0, 0, 0);
|
|
||||||
ended.setMonth(monthIndex + 1);
|
|
||||||
ended.setDate(0);
|
|
||||||
|
|
||||||
let result = await app.models.WorkerCalendar.absences(ctx, workerFk, started, ended);
|
|
||||||
let calendar = result[0];
|
|
||||||
let absences = result[1];
|
|
||||||
|
|
||||||
expect(calendar.totalHolidays).toEqual(26.5);
|
|
||||||
expect(calendar.holidaysEnjoyed).toEqual(5);
|
|
||||||
|
|
||||||
let firstType = absences[0].absenceType().name;
|
|
||||||
let sixthType = absences[5].absenceType().name;
|
|
||||||
|
|
||||||
expect(firstType).toEqual('Leave of absence');
|
|
||||||
expect(sixthType).toEqual('Holidays');
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should see he/she has 27.5`, async() => {
|
|
||||||
let ctx = {req: {accessToken: {userId: 106}}};
|
|
||||||
let workerFk = 106;
|
|
||||||
|
|
||||||
const firedWorker = await app.models.WorkerLabour.findById(106);
|
|
||||||
await firedWorker.updateAttributes({ended: null});
|
|
||||||
|
|
||||||
const started = new Date();
|
|
||||||
started.setHours(0, 0, 0, 0);
|
|
||||||
started.setMonth(0);
|
|
||||||
started.setDate(1);
|
|
||||||
|
|
||||||
const monthIndex = 11;
|
|
||||||
const ended = new Date();
|
|
||||||
ended.setHours(0, 0, 0, 0);
|
|
||||||
ended.setMonth(monthIndex + 1);
|
|
||||||
ended.setDate(0);
|
|
||||||
|
|
||||||
let result = await app.models.WorkerCalendar.absences(ctx, workerFk, started, ended);
|
|
||||||
let calendar = result[0];
|
|
||||||
let absences = result[1];
|
|
||||||
|
|
||||||
expect(calendar.totalHolidays).toEqual(27.5);
|
expect(calendar.totalHolidays).toEqual(27.5);
|
||||||
expect(calendar.holidaysEnjoyed).toEqual(5);
|
expect(calendar.holidaysEnjoyed).toEqual(5);
|
||||||
|
|
||||||
|
@ -149,5 +61,93 @@ describe('Worker absences()', () => {
|
||||||
|
|
||||||
expect(firstType).toEqual('Leave of absence');
|
expect(firstType).toEqual('Leave of absence');
|
||||||
expect(sixthType).toEqual('Holidays');
|
expect(sixthType).toEqual('Holidays');
|
||||||
|
|
||||||
|
// restores the contract end date
|
||||||
|
await worker.updateAttributes({ended: endedDate});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should give the same holidays as worked days since the holidays amount matches the amount of days in a year', async() => {
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
|
// getting how many days in a year
|
||||||
|
const yearStart = new Date();
|
||||||
|
yearStart.setHours(0, 0, 0, 0);
|
||||||
|
yearStart.setMonth(0);
|
||||||
|
yearStart.setDate(1);
|
||||||
|
|
||||||
|
const yearEnd = new Date();
|
||||||
|
yearEnd.setHours(23, 59, 59, 59);
|
||||||
|
yearEnd.setMonth(11);
|
||||||
|
yearEnd.setDate(31);
|
||||||
|
const startedTime = yearStart.getTime();
|
||||||
|
const endedTime = yearEnd.getTime();
|
||||||
|
const dayTimestamp = 1000 * 60 * 60 * 24;
|
||||||
|
|
||||||
|
const daysInYear = Math.floor((endedTime - startedTime) / dayTimestamp);
|
||||||
|
|
||||||
|
// sets the holidays per year to the amount of days in the current year
|
||||||
|
let holidaysConfig = await app.models.WorkCenterHoliday.findOne({
|
||||||
|
where: {
|
||||||
|
workCenterFk: 1,
|
||||||
|
year: today.getFullYear()
|
||||||
|
}});
|
||||||
|
|
||||||
|
let originalHolidaysValue = holidaysConfig.days;
|
||||||
|
|
||||||
|
await app.models.WorkCenterHoliday.updateAll(
|
||||||
|
{
|
||||||
|
workCenterFk: 1,
|
||||||
|
year: today.getFullYear()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
days: daysInYear
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// normal test begins
|
||||||
|
const contract = await app.models.WorkerLabour.findById(106);
|
||||||
|
const contractStartDate = contract.started;
|
||||||
|
|
||||||
|
const startingContract = new Date();
|
||||||
|
startingContract.setHours(0, 0, 0, 0);
|
||||||
|
startingContract.setMonth(today.getMonth());
|
||||||
|
startingContract.setDate(1);
|
||||||
|
|
||||||
|
await contract.updateAttributes({started: startingContract});
|
||||||
|
|
||||||
|
let ctx = {req: {accessToken: {userId: 106}}};
|
||||||
|
let workerFk = 106;
|
||||||
|
|
||||||
|
let result = await app.models.WorkerCalendar.absences(ctx, workerFk, yearStart, yearEnd);
|
||||||
|
let calendar = result[0];
|
||||||
|
let absences = result[1];
|
||||||
|
|
||||||
|
let remainingDays = 0;
|
||||||
|
for (let i = today.getMonth(); i < 12; i++) {
|
||||||
|
today.setMonth(i + 1);
|
||||||
|
today.setDate(0);
|
||||||
|
|
||||||
|
remainingDays += today.getDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(calendar.totalHolidays).toEqual(remainingDays);
|
||||||
|
expect(calendar.holidaysEnjoyed).toEqual(5);
|
||||||
|
|
||||||
|
let firstType = absences[0].absenceType().name;
|
||||||
|
let sixthType = absences[5].absenceType().name;
|
||||||
|
|
||||||
|
expect(firstType).toEqual('Leave of absence');
|
||||||
|
expect(sixthType).toEqual('Holidays');
|
||||||
|
|
||||||
|
// resets the holidays per year with originalHolidaysValue and the contract starting date
|
||||||
|
await app.models.WorkCenterHoliday.updateAll(
|
||||||
|
{
|
||||||
|
workCenterFk: 1,
|
||||||
|
year: today.getFullYear()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
days: originalHolidaysValue
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await contract.updateAttributes({started: contractStartDate});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,7 +34,9 @@ module.exports = Self => {
|
||||||
const subordinate = await Worker.findById(data.workerFk);
|
const subordinate = await Worker.findById(data.workerFk);
|
||||||
const timed = new Date(data.timed);
|
const timed = new Date(data.timed);
|
||||||
|
|
||||||
return Self.rawSql('CALL vn.workerTimeControl_add(?, ?, ?, ?)', [
|
let [result] = await Self.rawSql('SELECT vn.workerTimeControl_add(?, ?, ?, ?) AS id', [
|
||||||
subordinate.userFk, null, timed, true]);
|
subordinate.userFk, null, timed, true]);
|
||||||
|
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
const app = require('vn-loopback/server/server');
|
const app = require('vn-loopback/server/server');
|
||||||
|
|
||||||
describe('workerTimeControl addTimeEntry()', () => {
|
describe('workerTimeControl addTimeEntry()', () => {
|
||||||
let insertedTime;
|
let timeEntry;
|
||||||
|
let createdTimeEntry;
|
||||||
|
|
||||||
it('should fail to add a time entry if the target user is not a subordinate', async() => {
|
it('should fail to add a time entry if the target user is not a subordinate', async() => {
|
||||||
let error;
|
let error;
|
||||||
|
@ -52,11 +53,9 @@ describe('workerTimeControl addTimeEntry()', () => {
|
||||||
timed: todayAtSix
|
timed: todayAtSix
|
||||||
};
|
};
|
||||||
|
|
||||||
await app.models.WorkerTimeControl.addTimeEntry(ctx, data);
|
timeEntry = await app.models.WorkerTimeControl.addTimeEntry(ctx, data);
|
||||||
|
|
||||||
insertedTime = await app.models.WorkerTimeControl.findOne({where: {timed: data.timed}});
|
createdTimeEntry = await app.models.WorkerTimeControl.findById(timeEntry.id);
|
||||||
|
|
||||||
let createdTimeEntry = await app.models.WorkerTimeControl.findById(insertedTime.id);
|
|
||||||
|
|
||||||
expect(createdTimeEntry).toBeDefined();
|
expect(createdTimeEntry).toBeDefined();
|
||||||
});
|
});
|
||||||
|
@ -66,10 +65,6 @@ describe('workerTimeControl addTimeEntry()', () => {
|
||||||
let teamBossId = 13;
|
let teamBossId = 13;
|
||||||
let ctx = {req: {accessToken: {userId: teamBossId}}};
|
let ctx = {req: {accessToken: {userId: teamBossId}}};
|
||||||
|
|
||||||
let createdTimeEntry = await app.models.WorkerTimeControl.findById(insertedTime.id);
|
|
||||||
|
|
||||||
expect(createdTimeEntry).toBeDefined();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await app.models.WorkerTimeControl.deleteTimeEntry(ctx, createdTimeEntry.id);
|
await app.models.WorkerTimeControl.deleteTimeEntry(ctx, createdTimeEntry.id);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -85,14 +80,12 @@ describe('workerTimeControl addTimeEntry()', () => {
|
||||||
let HHRRId = 37;
|
let HHRRId = 37;
|
||||||
let ctx = {req: {accessToken: {userId: HHRRId}}};
|
let ctx = {req: {accessToken: {userId: HHRRId}}};
|
||||||
|
|
||||||
let createdTimeEntry = await app.models.WorkerTimeControl.findById(insertedTime.id);
|
|
||||||
|
|
||||||
expect(createdTimeEntry).toBeDefined();
|
expect(createdTimeEntry).toBeDefined();
|
||||||
|
|
||||||
ctx.req.accessToken.userId = HHRRId;
|
ctx.req.accessToken.userId = HHRRId;
|
||||||
await app.models.WorkerTimeControl.deleteTimeEntry(ctx, insertedTime.id);
|
await app.models.WorkerTimeControl.deleteTimeEntry(ctx, timeEntry.id);
|
||||||
|
|
||||||
createdTimeEntry = await app.models.WorkerTimeControl.findById(insertedTime.id);
|
createdTimeEntry = await app.models.WorkerTimeControl.findById(timeEntry.id);
|
||||||
|
|
||||||
expect(createdTimeEntry).toBeNull();
|
expect(createdTimeEntry).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
const UserError = require('vn-loopback/util/user-error');
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
require('../methods/device/checkUuid')(Self);
|
|
||||||
|
|
||||||
Self.rewriteDbError(function(err) {
|
Self.rewriteDbError(function(err) {
|
||||||
if (err.code === 'ER_DUP_ENTRY')
|
if (err.code === 'ER_DUP_ENTRY')
|
||||||
return new UserError(``);
|
return new UserError(``);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
filter="::$ctrl.filter"
|
filter="::$ctrl.filter"
|
||||||
data="$ctrl.hours">
|
data="$ctrl.hours">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<vn-card class="vn-pa-lg vn-w-md">
|
<vn-card class="vn-pa-lg vn-w-lg">
|
||||||
<vn-table model="model" auto-load="false">
|
<vn-table model="model" auto-load="false">
|
||||||
<vn-thead>
|
<vn-thead>
|
||||||
<vn-tr>
|
<vn-tr>
|
||||||
|
@ -31,8 +31,8 @@
|
||||||
</vn-thead>
|
</vn-thead>
|
||||||
<vn-tbody>
|
<vn-tbody>
|
||||||
<vn-tr>
|
<vn-tr>
|
||||||
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" expand center>
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" expand>
|
||||||
<section ng-repeat="hour in weekday.hours" center>
|
<section ng-repeat="hour in weekday.hours">
|
||||||
<vn-icon
|
<vn-icon
|
||||||
icon="{{
|
icon="{{
|
||||||
::hour.direction == 'in' ? 'arrow_forward' : 'arrow_back'
|
::hour.direction == 'in' ? 'arrow_forward' : 'arrow_back'
|
||||||
|
@ -45,7 +45,6 @@
|
||||||
<vn-chip
|
<vn-chip
|
||||||
ng-class="::{'colored': hour.manual}"
|
ng-class="::{'colored': hour.manual}"
|
||||||
removable="::hour.manual"
|
removable="::hour.manual"
|
||||||
translate-attr="{title: 'Category'}"
|
|
||||||
on-remove="$ctrl.showDeleteDialog(hour)">
|
on-remove="$ctrl.showDeleteDialog(hour)">
|
||||||
{{::hour.timed | date: 'HH:mm'}}
|
{{::hour.timed | date: 'HH:mm'}}
|
||||||
</vn-chip>
|
</vn-chip>
|
||||||
|
|
|
@ -12,6 +12,7 @@ vn-worker-time-control {
|
||||||
& > section {
|
& > section {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
padding: .3em 0;
|
padding: .3em 0;
|
||||||
|
|
||||||
& > vn-icon {
|
& > vn-icon {
|
||||||
|
|
|
@ -19,7 +19,6 @@ module.exports = app => {
|
||||||
require('./core/database').init();
|
require('./core/database').init();
|
||||||
// Init SMTP Instance
|
// Init SMTP Instance
|
||||||
require('./core/smtp').init();
|
require('./core/smtp').init();
|
||||||
//
|
|
||||||
require('./core/mixins');
|
require('./core/mixins');
|
||||||
require('./core/filters');
|
require('./core/filters');
|
||||||
require('./core/directives');
|
require('./core/directives');
|
||||||
|
|
|
@ -39,9 +39,9 @@
|
||||||
|
|
||||||
<!-- Privacy block -->
|
<!-- Privacy block -->
|
||||||
<div class="privacy">
|
<div class="privacy">
|
||||||
<p>{{$t('privacy.fiscalAddress')}}</p>
|
<p>{{$t('fiscalAddress')}}</p>
|
||||||
<p>{{$t('privacy.disclaimer')}}</p>
|
<p>{{$t('disclaimer')}}</p>
|
||||||
<p>{{$t('privacy.law')}}</p>
|
<p>{{$t('privacy')}}</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- Privacy block end -->
|
<!-- Privacy block end -->
|
||||||
</footer>
|
</footer>
|
|
@ -1,4 +1,3 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'email-footer',
|
name: 'email-footer'
|
||||||
props: ['isPreview', 'locale']
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
buttons:
|
||||||
|
webAcccess: Visit our website
|
||||||
|
info: Help us to improve
|
||||||
|
fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla
|
||||||
|
· www.verdnatura.es · clientes@verdnatura.es
|
||||||
|
disclaimer: '- NOTICE - This message is private and confidential, and should be used
|
||||||
|
exclusively by the person receiving it. If you have received this message by mistake,
|
||||||
|
please notify the sender and delete that message and any attached documents that it may contain.
|
||||||
|
Verdnatura Levante SL does not waive confidentiality or any privilege due to erroneous
|
||||||
|
transmission or malfunction. Likewise, it is not responsible for the changes, alterations,
|
||||||
|
errors or omissions that could be made to the message once sent.'
|
||||||
|
privacy: 'In compliance with the provisions of Organic Law 15/1999, on the
|
||||||
|
Protection of Personal Data, we inform you that the personal data you provide
|
||||||
|
will be included in automated files of VERDNATURA LEVANTE SL, being able at all
|
||||||
|
times to exercise the rights of access, rectification, cancellation and opposition,
|
||||||
|
communicating it in writing to the registered office of the entity.
|
||||||
|
The purpose of the file is administrative management, accounting, and billing.'
|
|
@ -1,7 +1,6 @@
|
||||||
buttons:
|
buttons:
|
||||||
webAcccess: Visita nuestra Web
|
webAcccess: Visita nuestra Web
|
||||||
info: Ayúdanos a mejorar
|
info: Ayúdanos a mejorar
|
||||||
privacy:
|
|
||||||
fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla
|
fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla
|
||||||
· www.verdnatura.es · clientes@verdnatura.es
|
· www.verdnatura.es · clientes@verdnatura.es
|
||||||
disclaimer: '- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado
|
disclaimer: '- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado
|
||||||
|
@ -11,7 +10,7 @@ privacy:
|
||||||
confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal
|
confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal
|
||||||
funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones,
|
funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones,
|
||||||
errores u omisiones que pudieran hacerse al mensaje una vez enviado.'
|
errores u omisiones que pudieran hacerse al mensaje una vez enviado.'
|
||||||
law: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de
|
privacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de
|
||||||
Datos de Carácter Personal, te comunicamos que los datos personales que facilites
|
Datos de Carácter Personal, te comunicamos que los datos personales que facilites
|
||||||
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
|
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
|
||||||
todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición,
|
todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
buttons:
|
buttons:
|
||||||
webAcccess: Visitez notre site web
|
webAcccess: Visitez notre site web
|
||||||
info: Aidez-nous à améliorer
|
info: Aidez-nous à améliorer
|
||||||
privacy:
|
|
||||||
fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla
|
fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla
|
||||||
· www.verdnatura.es · clientes@verdnatura.es
|
· www.verdnatura.es · clientes@verdnatura.es
|
||||||
disclaimer: "- AVIS - Ce message est privé et confidentiel et doit être utilisé
|
disclaimer: "- AVIS - Ce message est privé et confidentiel et doit être utilisé
|
||||||
|
@ -11,9 +10,9 @@ privacy:
|
||||||
confidentialité ni aux privilèges résultant d'une transmission erronée ou d'un dysfonctionnement.
|
confidentialité ni aux privilèges résultant d'une transmission erronée ou d'un dysfonctionnement.
|
||||||
De même, il n'est pas responsable des modifications, altérations, erreurs ou
|
De même, il n'est pas responsable des modifications, altérations, erreurs ou
|
||||||
omissions qui pourraient être apportées au message une fois envoyé."
|
omissions qui pourraient être apportées au message une fois envoyé."
|
||||||
law: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de
|
privacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
|
||||||
Datos de Carácter Personal, te comunicamos que los datos personales que facilites
|
des données personnelles, nous vous informons que les données personnelles que
|
||||||
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L.,pudiendo en
|
vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous
|
||||||
todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición,
|
pouvez à tout moment, exercer les droits d'accès, de rectification, d'annulation
|
||||||
comunicándolo porescrito al domicilio social de la entidad. La finalidad del fichero
|
et d'opposition, en communiquant par écrit au siège social de la société. Le dossier
|
||||||
es la gestión administrativa, contabilidad, y facturación.
|
a pour objet la gestion administrative, la comptabilité et la facturation.
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
buttons:
|
||||||
|
webAcccess: Visite o nosso site
|
||||||
|
info: Ajude-nos a melhorar
|
||||||
|
fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla
|
||||||
|
· www.verdnatura.es · clientes@verdnatura.es
|
||||||
|
disclaimer: '- AVISO - Esta mensagem é privada e confidencial e deve ser usada exclusivamente
|
||||||
|
pela pessoa que a recebe. Se você recebeu esta mensagem por engano, notifique o remetente e
|
||||||
|
exclua essa mensagem e todos os documentos anexos que ela possa conter.
|
||||||
|
A Verdnatura Levante SL não renuncia à confidencialidade ou a qualquer privilégio devido a
|
||||||
|
transmissão ou mau funcionamento incorretos. Da mesma forma, não se responsabiliza pelas alterações,
|
||||||
|
alterações, erros ou omissões que possam ser feitos na mensagem após o envio.'
|
||||||
|
privacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
|
||||||
|
de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão
|
||||||
|
nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
|
||||||
|
exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando
|
||||||
|
por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão
|
||||||
|
administrativa, contabilidade e facturação.
|
|
@ -1,4 +1,3 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'email-header',
|
name: 'email-header'
|
||||||
props: ['locale']
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
numPages: Page {{page}} of {{pages}}
|
||||||
|
law:
|
||||||
|
privacy: 'In compliance with the provisions of Organic Law 15/1999, on the
|
||||||
|
Protection of Personal Data, we inform you that the personal data you provide
|
||||||
|
will be included in automated files of VERDNATURA LEVANTE SL, being able at all
|
||||||
|
times to exercise the rights of access, rectification, cancellation and opposition,
|
||||||
|
communicating it in writing to the registered office of the entity.
|
||||||
|
The purpose of the file is administrative management, accounting, and billing.'
|
|
@ -1,7 +1,5 @@
|
||||||
numPages: Página {{page}} de {{pages}}
|
numPages: Página {{page}} de {{pages}}
|
||||||
law:
|
law:
|
||||||
phytosanitary: 'VERDNATURA LEVANTE SL - Pasaporte Fitosanitario R.P. Generalitat
|
|
||||||
Valenciana - Nº Comerciante: ES17462130'
|
|
||||||
privacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
|
privacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
|
||||||
de Datos de Carácter Personal, le comunicamos que los datos personales que facilite
|
de Datos de Carácter Personal, le comunicamos que los datos personales que facilite
|
||||||
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
|
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
numPages: Page {{page}} de {{pages}}
|
numPages: Page {{page}} de {{pages}}
|
||||||
law:
|
law:
|
||||||
phytosanitary: 'VERDNATURA LEVANTE SL - Passeport Phytosanitaire R.P. Generalitat
|
|
||||||
Valenciana - Numéro d''opérateur: ES17462130'
|
|
||||||
privacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
|
privacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
|
||||||
des données personnelles, nous vous informons que les données personnelles que
|
des données personnelles, nous vous informons que les données personnelles que
|
||||||
vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous
|
vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
numPages: Página {{page}} de {{pages}}
|
numPages: Página {{page}} de {{pages}}
|
||||||
law:
|
law:
|
||||||
phytosanitary: 'VERDNATURA LEVANTE S.L - Passaporte Fitossanitário R.P. Generalitat
|
|
||||||
Valenciana - Nº Comerciante: ES17462130'
|
|
||||||
privacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
|
privacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
|
||||||
de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão
|
de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão
|
||||||
nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
|
nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
<section v-if="centerText" class="uppercase">{{centerText}}</section>
|
<section v-if="centerText" class="uppercase">{{centerText}}</section>
|
||||||
<section class="number">{{$t('numPages')}}</section>
|
<section class="number">{{$t('numPages')}}</section>
|
||||||
</section>
|
</section>
|
||||||
<p class="phytosanitary" v-if="showPhytosanitary">{{$t('law.phytosanitary')}}</p>
|
<p class="phytosanitary" v-if="showPhytosanitary">{{phytosanitary}}</p>
|
||||||
<p class="privacy" v-html="$t('law.privacy')"></p>
|
<p class="privacy" v-html="$t('law.privacy')"></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
|
const db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'report-footer',
|
name: 'report-footer',
|
||||||
props: ['leftText', 'centerText', 'locale', 'showPhytosanitary']
|
async serverPrefetch() {
|
||||||
|
const companyCode = this.companyCode || 'VNL';
|
||||||
|
|
||||||
|
this.phytosanitary = await this.getPhytosanitary(companyCode);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPhytosanitary(code) {
|
||||||
|
return db.findValue(`
|
||||||
|
SELECT phytosanitary FROM company c
|
||||||
|
WHERE c.code = :code`, {code});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: ['companyCode', 'showPhytosanitary', 'leftText', 'centerText']
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
company:
|
||||||
|
contactData: www.verdnatura.es - clientes@verdnatura.es
|
|
@ -1,5 +1,2 @@
|
||||||
company:
|
company:
|
||||||
fiscalAddress: VERDNATURA LEVANTE S.L., B97367486 Avda. Espioca, 100, 46460 Silla
|
contactData: www.verdnatura.es - clientes@verdnatura.es
|
||||||
- www.verdnatura.es - clientes@verdnatura.es
|
|
||||||
registry: 'CIF: B97367486 Registro Mercantil de Valencia, Tomo 8041, Libro 5334,
|
|
||||||
Folio 160, Sección 8, Hoja V 102076'
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
company:
|
||||||
|
contactData: www.verdnatura.es - clientes@verdnatura.es
|
|
@ -1,5 +1,2 @@
|
||||||
company:
|
company:
|
||||||
fiscalAddress: VERDNATURA LEVANTE S.L., B97367486 Avda. Espioca, 100, 46460 Silla
|
contactData: · www.verdnatura.es · clientes@verdnatura.es
|
||||||
- www.verdnatura.es - clientes@verdnatura.es
|
|
||||||
registry: 'CIF: B97367486 Registro Mercantil de Valencia, Tomo 8041, Libro 5334,
|
|
||||||
Folio 160, Sección 8, Hoja V 102076'
|
|
|
@ -1,5 +1,10 @@
|
||||||
<header>
|
<header>
|
||||||
<img v-bind:src="getReportSrc('report-logo.svg')" alt="Verdnatura"/>
|
<img v-bind:src="getReportSrc('report-logo.svg')" alt="Verdnatura"/>
|
||||||
<section>{{$t('company.fiscalAddress')}}</section>
|
<section>
|
||||||
<section>{{$t('company.registry')}}</section>
|
{{companyName}}. {{company.street}}.
|
||||||
|
{{company.postCode}} {{company.city}}.
|
||||||
|
☎ {{companyPhone}}
|
||||||
|
· {{$t('company.contactData')}}
|
||||||
|
</section>
|
||||||
|
<section>CIF: {{fiscalAddress.nif}} {{fiscalAddress.register}}</section>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -1,4 +1,46 @@
|
||||||
|
const db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'report-header',
|
name: 'report-header',
|
||||||
props: ['isPreview', 'locale']
|
async serverPrefetch() {
|
||||||
|
const companyCode = this.companyCode || 'VNL';
|
||||||
|
|
||||||
|
this.company = await this.getCompany(companyCode);
|
||||||
|
this.fiscalAddress = await this.getFiscalAddress(companyCode);
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
companyName() {
|
||||||
|
if (!this.company.name) return;
|
||||||
|
|
||||||
|
return this.company.name.toUpperCase();
|
||||||
|
},
|
||||||
|
companyPhone() {
|
||||||
|
if (!this.company.phone) return;
|
||||||
|
|
||||||
|
let phone = this.company.phone;
|
||||||
|
|
||||||
|
if (phone.length >= 13) {
|
||||||
|
const prefix = parseInt(phone.substr(0, 4));
|
||||||
|
const number = phone.substr(5, phone.length);
|
||||||
|
return `+${prefix} ${number}`;
|
||||||
|
} else
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getCompany(code) {
|
||||||
|
return db.findOne(`
|
||||||
|
SELECT s.name, s.street, s.postCode, s.city, s.phone
|
||||||
|
FROM company c
|
||||||
|
JOIN supplier s ON s.id = c.id
|
||||||
|
WHERE c.code = :code`, {code});
|
||||||
|
},
|
||||||
|
getFiscalAddress(code) {
|
||||||
|
return db.findOne(`
|
||||||
|
SELECT nif, register FROM company c
|
||||||
|
JOIN supplier s ON s.id = c.id
|
||||||
|
WHERE c.code = :code`, {code});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: ['companyCode']
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,15 +15,34 @@ module.exports = {
|
||||||
* @param {String} query - The raw SQL query
|
* @param {String} query - The raw SQL query
|
||||||
* @param {Object} params - Parameterized values
|
* @param {Object} params - Parameterized values
|
||||||
*
|
*
|
||||||
* @return {Object} - Result
|
* @return {Object} - Result promise
|
||||||
*/
|
*/
|
||||||
rawSql(query, params) {
|
rawSql(query, params) {
|
||||||
return this.pool.query(query, params).then(([rows]) => {
|
return this.pool.query(query, params).then(([rows]) => {
|
||||||
return rows;
|
return rows;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Returns the first row from a given raw sql
|
||||||
|
* @param {String} query - The raw SQL query
|
||||||
|
* @param {Object} params - Parameterized values
|
||||||
|
*
|
||||||
|
* @return {Object} - Result promise
|
||||||
|
*/
|
||||||
findOne(query, params) {
|
findOne(query, params) {
|
||||||
return this.rawSql(query, params).then(([rows]) => rows);
|
return this.rawSql(query, params).then(([row]) => row);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Returns the first property from a given raw sql
|
||||||
|
* @param {String} query - The raw SQL query
|
||||||
|
* @param {Object} params - Parameterized values
|
||||||
|
*
|
||||||
|
* @return {Object} - Result promise
|
||||||
|
*/
|
||||||
|
findValue(query, params) {
|
||||||
|
return this.findOne(query, params).then(row => {
|
||||||
|
return Object.values(row)[0];
|
||||||
|
});
|
||||||
},
|
},
|
||||||
findFromDef() {
|
findFromDef() {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
const Vue = require('vue');
|
const Vue = require('vue');
|
||||||
const db = require('../database');
|
const db = require('../database');
|
||||||
|
const config = require('../config');
|
||||||
|
const fallbackLocale = config.i18n.fallbackLocale;
|
||||||
const userLocale = {
|
const userLocale = {
|
||||||
async serverPrefetch() {
|
async serverPrefetch() {
|
||||||
if (this.clientId)
|
if (this.clientId)
|
||||||
|
@ -13,7 +15,9 @@ const userLocale = {
|
||||||
return db.findOne(`
|
return db.findOne(`
|
||||||
SELECT lang FROM account.user
|
SELECT lang FROM account.user
|
||||||
WHERE id = ?`, [clientId]).then(rows => {
|
WHERE id = ?`, [clientId]).then(rows => {
|
||||||
|
if (rows)
|
||||||
return rows.lang;
|
return rows.lang;
|
||||||
|
else return fallbackLocale;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -34,10 +31,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -80,10 +77,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -22,10 +22,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -57,10 +54,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -37,10 +34,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -33,10 +30,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -69,7 +66,6 @@
|
||||||
<attachment v-for="attachment in attachments"
|
<attachment v-for="attachment in attachments"
|
||||||
v-bind:key="attachment.filename"
|
v-bind:key="attachment.filename"
|
||||||
v-bind:attachment="attachment"
|
v-bind:attachment="attachment"
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:args="$props">
|
v-bind:args="$props">
|
||||||
</attachment>
|
</attachment>
|
||||||
</div>
|
</div>
|
||||||
|
@ -77,10 +73,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -52,7 +49,6 @@
|
||||||
<attachment v-for="attachment in attachments"
|
<attachment v-for="attachment in attachments"
|
||||||
v-bind:key="attachment.filename"
|
v-bind:key="attachment.filename"
|
||||||
v-bind:attachment="attachment"
|
v-bind:attachment="attachment"
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:args="$props">
|
v-bind:args="$props">
|
||||||
</attachment>
|
</attachment>
|
||||||
</div>
|
</div>
|
||||||
|
@ -60,10 +56,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -54,10 +51,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -77,10 +74,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
||||||
LEFT JOIN worker w ON w.id = c.salesPersonFk
|
LEFT JOIN worker w ON w.id = c.salesPersonFk
|
||||||
LEFT JOIN account.user wu ON wu.id = w.userFk
|
LEFT JOIN account.user wu ON wu.id = w.userFk
|
||||||
WHERE c.id = ?`, [clientId]);
|
WHERE c.id = ?`, [clientId]);
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
'email-header': emailHeader.build(),
|
'email-header': emailHeader.build(),
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-header
|
<email-header v-bind="$props"></email-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -45,10 +42,7 @@
|
||||||
<!-- Footer block -->
|
<!-- Footer block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<email-footer
|
<email-footer v-bind="$props"></email-footer>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</email-footer>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Empty block -->
|
<!-- Empty block -->
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-header
|
<report-header v-bind="$props"></report-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -93,8 +90,7 @@
|
||||||
<report-footer id="pageFooter"
|
<report-footer id="pageFooter"
|
||||||
v-bind:left-text="$t('claim', [claimId])"
|
v-bind:left-text="$t('claim', [claimId])"
|
||||||
v-bind:center-text="client.name"
|
v-bind:center-text="client.name"
|
||||||
v-bind:is-preview="isPreview"
|
v-bind="$props">
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-footer>
|
</report-footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,9 +8,8 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-header
|
<report-header v-bind="$props"
|
||||||
v-bind:is-preview="isPreview"
|
v-bind:company-code="ticket.companyCode">
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-header>
|
</report-header>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -238,11 +237,11 @@
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-footer id="pageFooter"
|
<report-footer id="pageFooter"
|
||||||
|
v-bind:company-code="ticket.companyCode"
|
||||||
v-bind:show-phytosanitary="true"
|
v-bind:show-phytosanitary="true"
|
||||||
v-bind:left-text="$t('ticket', [ticket.id])"
|
v-bind:left-text="$t('ticket', [ticket.id])"
|
||||||
v-bind:center-text="client.socialName"
|
v-bind:center-text="client.socialName"
|
||||||
v-bind:is-preview="isPreview"
|
v-bind="$props">
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-footer>
|
</report-footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -57,8 +57,9 @@ module.exports = {
|
||||||
`SELECT
|
`SELECT
|
||||||
t.id,
|
t.id,
|
||||||
t.shipped,
|
t.shipped,
|
||||||
t.companyFk
|
c.code companyCode
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
|
JOIN company c ON c.id = t.companyFk
|
||||||
WHERE t.id = ?`, [ticketId]);
|
WHERE t.id = ?`, [ticketId]);
|
||||||
},
|
},
|
||||||
fetchAddress(ticketId) {
|
fetchAddress(ticketId) {
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
title: Delivery note
|
||||||
|
ticketId: Delivery note
|
||||||
|
clientId: Client
|
||||||
|
deliveryAddress: Delivery address
|
||||||
|
fiscalData: Fiscal data
|
||||||
|
saleLines: Line items
|
||||||
|
date: Date
|
||||||
|
reference: Ref.
|
||||||
|
quantity: Qty.
|
||||||
|
concept: Concept
|
||||||
|
price: PSP/u
|
||||||
|
discount: Disc.
|
||||||
|
vat: VAT
|
||||||
|
amount: Amount
|
||||||
|
type: Type
|
||||||
|
taxBase: Tax base
|
||||||
|
tax: Tax
|
||||||
|
fee: Fee
|
||||||
|
total: Total
|
||||||
|
subtotal: Subtotal
|
||||||
|
taxBreakdown: Tax breakdown
|
||||||
|
packagings: Buckets and packaging
|
||||||
|
services: Services
|
||||||
|
vatType: VAT Type
|
||||||
|
digitalSignature: Digital signature
|
||||||
|
ticket: Delivery note {0}
|
|
@ -1,10 +1,10 @@
|
||||||
title: Bon de livraison
|
title: Albarán
|
||||||
ticketId: Bon de livraison
|
ticketId: Albarán
|
||||||
clientId: Client
|
clientId: Cliente
|
||||||
deliveryAddress: Addresse de livraison
|
deliveryAddress: Dirección de entrega
|
||||||
fiscalData: Datos fiscales
|
fiscalData: Datos fiscales
|
||||||
saleLines: Líneas de pedido
|
saleLines: Líneas de pedido
|
||||||
date: Date
|
date: Fecha
|
||||||
reference: Ref.
|
reference: Ref.
|
||||||
quantity: Cant.
|
quantity: Cant.
|
||||||
concept: Concepto
|
concept: Concepto
|
||||||
|
@ -18,8 +18,8 @@ tax: Tasa
|
||||||
fee: Cuota
|
fee: Cuota
|
||||||
total: Total
|
total: Total
|
||||||
subtotal: Subtotal
|
subtotal: Subtotal
|
||||||
taxBreakdown: Répartition de la taxe
|
taxBreakdown: Desglose impositivo
|
||||||
packagings: Seaux et emballages
|
packagings: Cubos y embalajes
|
||||||
services: Servicios
|
services: Servicios
|
||||||
vatType: Tipo de IVA
|
vatType: Tipo de IVA
|
||||||
digitalSignature: Firma digital
|
digitalSignature: Firma digital
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-header
|
<report-header v-bind="$props"></report-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -161,8 +158,7 @@
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-footer id="pageFooter"
|
<report-footer id="pageFooter"
|
||||||
v-bind:left-text="$t('routeId', [route.id])"
|
v-bind:left-text="$t('routeId', [route.id])"
|
||||||
v-bind:is-preview="isPreview"
|
v-bind="$props">
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-footer>
|
</report-footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,7 +59,7 @@ module.exports = {
|
||||||
LEFT JOIN ticket t ON t.routeFk = r.id
|
LEFT JOIN ticket t ON t.routeFk = r.id
|
||||||
LEFT JOIN address a ON a.id = t.addressFk
|
LEFT JOIN address a ON a.id = t.addressFk
|
||||||
LEFT JOIN client c ON c.id = t.clientFk
|
LEFT JOIN client c ON c.id = t.clientFk
|
||||||
LEFT JOIN worker w ON w.id = vn2008.Averiguar_ComercialCliente_Id(t.clientFk, CURDATE())
|
LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE())
|
||||||
LEFT JOIN account.user u ON u.id = w.userFk
|
LEFT JOIN account.user u ON u.id = w.userFk
|
||||||
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3
|
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3
|
||||||
LEFT JOIN province p ON a.provinceFk = p.id
|
LEFT JOIN province p ON a.provinceFk = p.id
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-header
|
<report-header v-bind="$props"></report-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -91,8 +88,7 @@
|
||||||
<report-footer id="pageFooter"
|
<report-footer id="pageFooter"
|
||||||
v-bind:left-text="$t('client', [client.id])"
|
v-bind:left-text="$t('client', [client.id])"
|
||||||
v-bind:center-text="client.socialName"
|
v-bind:center-text="client.socialName"
|
||||||
v-bind:is-preview="isPreview"
|
v-bind="$props">
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-footer>
|
</report-footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-header
|
<report-header v-bind="$props"></report-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -44,8 +41,7 @@
|
||||||
<report-footer id="pageFooter"
|
<report-footer id="pageFooter"
|
||||||
v-bind:left-text="$t('client', [client.id])"
|
v-bind:left-text="$t('client', [client.id])"
|
||||||
v-bind:center-text="client.socialName"
|
v-bind:center-text="client.socialName"
|
||||||
v-bind:is-preview="isPreview"
|
v-bind="$props">
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-footer>
|
</report-footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
<!-- Header block -->
|
<!-- Header block -->
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-block">
|
<div class="grid-block">
|
||||||
<report-header
|
<report-header v-bind="$props"></report-header>
|
||||||
v-bind:is-preview="isPreview"
|
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-header>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
|
@ -174,8 +171,7 @@
|
||||||
<report-footer id="pageFooter"
|
<report-footer id="pageFooter"
|
||||||
v-bind:left-text="$t('order', [supplier.mandateCode])"
|
v-bind:left-text="$t('order', [supplier.mandateCode])"
|
||||||
v-bind:center-text="client.socialName"
|
v-bind:center-text="client.socialName"
|
||||||
v-bind:is-preview="isPreview"
|
v-bind="$props">
|
||||||
v-bind:locale="locale">
|
|
||||||
</report-footer>
|
</report-footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue