#6321 - Negative tickets #1945
|
@ -24,7 +24,6 @@ node {
|
||||||
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
|
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
|
||||||
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
|
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
|
||||||
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
|
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
|
||||||
// env.DEBUG = 'strong-remoting:shared-method'
|
|
||||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`sale_add`(
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`sale_add`(
|
||||||
IN vStarted DATE,
|
IN vStarted DATE,
|
||||||
IN vEnded DATE)
|
IN vEnded DATE
|
||||||
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Añade las ventas que se realizaron entre 2 fechas a la tabla bs.sale
|
* Añade las ventas que se realizaron entre 2 fechas a la tabla bs.sale
|
||||||
|
@ -10,63 +11,54 @@ BEGIN
|
||||||
* @param vEnded Fecha de fin
|
* @param vEnded Fecha de fin
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
DECLARE vLoopDate DATE;
|
|
||||||
DECLARE vLoopDateTime DATETIME;
|
|
||||||
|
|
||||||
IF vStarted < (util.VN_CURDATE() - INTERVAL 5 YEAR) OR vStarted > vEnded THEN
|
IF vStarted < (util.VN_CURDATE() - INTERVAL 5 YEAR) OR vStarted > vEnded THEN
|
||||||
CALL util.throw('Wrong date');
|
CALL util.throw('Wrong date');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SET vLoopDate = vStarted;
|
|
||||||
|
|
||||||
DELETE FROM sale
|
DELETE FROM sale
|
||||||
WHERE dated BETWEEN vStarted AND vEnded;
|
WHERE dated BETWEEN vStarted AND vEnded;
|
||||||
|
|
||||||
WHILE vLoopDate <= vEnded DO
|
REPLACE sale(
|
||||||
SET vLoopDateTime = util.dayEnd(vLoopDate);
|
saleFk,
|
||||||
|
amount,
|
||||||
REPLACE sale(
|
surcharge,
|
||||||
saleFk,
|
dated,
|
||||||
amount,
|
typeFk,
|
||||||
surcharge,
|
clientFk,
|
||||||
dated,
|
companyFk,
|
||||||
typeFk,
|
margin
|
||||||
clientFk,
|
)WITH calculatedSales AS(
|
||||||
companyFk,
|
SELECT s.id saleFk,
|
||||||
margin
|
CAST(SUM(IF(ct.isBase, s.quantity * sc.value, 0)) AS DECIMAL(10, 3)) amount,
|
||||||
)WITH calculatedSales AS(
|
CAST(SUM(IF(ct.isBase, 0, s.quantity * sc.value)) AS DECIMAL(10, 3)) surcharge,
|
||||||
SELECT s.id saleFk,
|
s.total,
|
||||||
SUM(IF(ct.isBase, s.quantity * sc.value, 0)) amount,
|
DATE(t.shipped) dated,
|
||||||
SUM(IF(ct.isBase, 0, s.quantity * sc.value)) surcharge,
|
i.typeFk,
|
||||||
s.total pvp,
|
t.clientFk,
|
||||||
DATE(t.shipped) dated,
|
t.companyFk,
|
||||||
i.typeFk,
|
CAST(SUM(IF(ct.isMargin, s.quantity * sc.value, 0 )) AS DECIMAL(10, 3)) marginComponents
|
||||||
t.clientFk,
|
FROM vn.ticket t
|
||||||
t.companyFk,
|
STRAIGHT_JOIN vn.sale s ON s.ticketFk = t.id
|
||||||
SUM(IF(ct.isMargin, s.quantity * sc.value, 0 )) marginComponents
|
JOIN vn.item i ON i.id = s.itemFk
|
||||||
FROM vn.ticket t
|
JOIN vn.itemType it ON it.id = i.typeFk
|
||||||
STRAIGHT_JOIN vn.sale s ON s.ticketFk = t.id
|
JOIN vn.itemCategory ic ON ic.id = it.categoryFk
|
||||||
JOIN vn.item i ON i.id = s.itemFk
|
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
||||||
JOIN vn.itemType it ON it.id = i.typeFk
|
JOIN vn.component c ON c.id = sc.componentFk
|
||||||
JOIN vn.itemCategory ic ON ic.id = it.categoryFk
|
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||||
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
WHERE t.shipped BETWEEN vStarted AND vEnded
|
||||||
JOIN vn.component c ON c.id = sc.componentFk
|
AND s.quantity <> 0
|
||||||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
AND ic.merchandise
|
||||||
WHERE t.shipped BETWEEN vLoopDate AND vLoopDateTime
|
GROUP BY s.id
|
||||||
AND s.quantity <> 0
|
)SELECT saleFk,
|
||||||
AND ic.merchandise
|
amount,
|
||||||
GROUP BY s.id
|
surcharge,
|
||||||
)SELECT saleFk,
|
dated,
|
||||||
amount,
|
typeFk,
|
||||||
surcharge,
|
clientFk,
|
||||||
dated,
|
companyFk,
|
||||||
typeFk,
|
IF (marginComponents IS NULL,
|
||||||
clientFk,
|
0,
|
||||||
companyFk,
|
CAST(marginComponents + amount + surcharge - total AS DECIMAL(10, 3)))
|
||||||
marginComponents + amount + surcharge - pvp
|
FROM calculatedSales;
|
||||||
FROM calculatedSales;
|
|
||||||
|
|
||||||
SET vLoopDate = vLoopDate + INTERVAL 1 DAY;
|
|
||||||
END WHILE;
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -34,7 +34,7 @@ BEGIN
|
||||||
vPrinterFk,
|
vPrinterFk,
|
||||||
IFNULL(right(`t`.`routeFk`, 3),0),
|
IFNULL(right(`t`.`routeFk`, 3),0),
|
||||||
if (@vVolume := vn.ticketTotalVolume(t.id) > 1.5, @vVolume, IFNULL( rm.beachFk, 0)),
|
if (@vVolume := vn.ticketTotalVolume(t.id) > 1.5, @vVolume, IFNULL( rm.beachFk, 0)),
|
||||||
LEFT(IFNULL(et.description ,replace(`z`.`name`, 'ZONA ', 'Z')),14) truckName,
|
LEFT(IFNULL(rs.description ,replace(`z`.`name`, 'ZONA ', 'Z')),14) truckName,
|
||||||
t.clientFk ,
|
t.clientFk ,
|
||||||
ifnull(c.mobile, ifnull(a.mobile, ifnull(c.phone, a.phone))),
|
ifnull(c.mobile, ifnull(a.mobile, ifnull(c.phone, a.phone))),
|
||||||
LEFT(p.name, 20),
|
LEFT(p.name, 20),
|
||||||
|
@ -46,7 +46,7 @@ BEGIN
|
||||||
JOIN vn.address a ON a.id = t.addressFk
|
JOIN vn.address a ON a.id = t.addressFk
|
||||||
JOIN vn.province p ON p.id = a.provinceFk
|
JOIN vn.province p ON p.id = a.provinceFk
|
||||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
||||||
LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
|
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||||
LEFT JOIN vn.beach b ON b.code = rm.beachFk
|
LEFT JOIN vn.beach b ON b.code = rm.beachFk
|
||||||
LEFT JOIN vn.`zone`z ON z.id = t.zoneFk
|
LEFT JOIN vn.`zone`z ON z.id = t.zoneFk
|
||||||
JOIN vn.agencyMode am ON t.agencyModeFk = am.id
|
JOIN vn.agencyMode am ON t.agencyModeFk = am.id
|
||||||
|
|
|
@ -12,7 +12,7 @@ AS SELECT `s`.`user_id` AS `id`,
|
||||||
`c`.`permit` AS `permit`,
|
`c`.`permit` AS `permit`,
|
||||||
`c`.`type` AS `type`,
|
`c`.`type` AS `type`,
|
||||||
`c`.`context` AS `context`,
|
`c`.`context` AS `context`,
|
||||||
`c`.`incomingLimit` AS `incominglimit`,
|
`c`.`call-limit` AS `call-limit`,
|
||||||
`c`.`pickupGroup` AS `pickupgroup`,
|
`c`.`pickupGroup` AS `pickupgroup`,
|
||||||
`c`.`directMedia` AS `directmedia`,
|
`c`.`directMedia` AS `directmedia`,
|
||||||
`c`.`insecure` AS `insecure`,
|
`c`.`insecure` AS `insecure`,
|
||||||
|
|
|
@ -15,14 +15,14 @@ BEGIN
|
||||||
|
|
||||||
DECLARE vDayMinute INT;
|
DECLARE vDayMinute INT;
|
||||||
|
|
||||||
SELECT HOUR(IFNULL(et.ETD, z.`hour`)) * 60 + MINUTE(IFNULL(et.ETD, z.`hour`)) INTO vDayMinute
|
SELECT HOUR(IFNULL(rs.ETD, z.`hour`)) * 60 + MINUTE(IFNULL(rs.ETD, z.`hour`)) INTO vDayMinute
|
||||||
FROM vn.expedition e
|
FROM vn.expedition e
|
||||||
JOIN vn.ticket t ON e.ticketFk = t.id
|
JOIN vn.ticket t ON e.ticketFk = t.id
|
||||||
JOIN vn.`zone` z ON z.id = t.zoneFk
|
JOIN vn.`zone` z ON z.id = t.zoneFk
|
||||||
LEFT JOIN vn.route r ON r.id = t.routeFk
|
LEFT JOIN vn.route r ON r.id = t.routeFk
|
||||||
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
||||||
LEFT JOIN vn.routesMonitor rm ON t.routeFk = rm.routeFk
|
LEFT JOIN vn.routesMonitor rm ON t.routeFk = rm.routeFk
|
||||||
LEFT JOIN vn.expeditionTruck et ON rm.expeditionTruckFk = et.id
|
LEFT JOIN vn.roadmapStop rs ON rm.expeditionTruckFk = rs.id
|
||||||
WHERE e.id = vExpeditionFk;
|
WHERE e.id = vExpeditionFk;
|
||||||
|
|
||||||
RETURN vDayMinute;
|
RETURN vDayMinute;
|
||||||
|
|
|
@ -296,8 +296,8 @@ BEGIN
|
||||||
|
|
||||||
SET @dm := (24 * 60) - 10;
|
SET @dm := (24 * 60) - 10;
|
||||||
|
|
||||||
UPDATE vn.expeditionTruck et
|
UPDATE vn.roadmapStop rs
|
||||||
SET et.eta = timestampadd(MINUTE ,@dm := 1 + @dm,util.VN_CURDATE())
|
SET rs.eta = timestampadd(MINUTE ,@dm := 1 + @dm,util.VN_CURDATE())
|
||||||
WHERE description LIKE 'PRU%' ;
|
WHERE description LIKE 'PRU%' ;
|
||||||
|
|
||||||
DELETE FROM srt.movingLog ;
|
DELETE FROM srt.movingLog ;
|
||||||
|
|
|
@ -3,10 +3,10 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
VIEW `srt`.`bufferDayMinute`
|
VIEW `srt`.`bufferDayMinute`
|
||||||
AS SELECT `b`.`id` AS `bufferFk`,
|
AS SELECT `b`.`id` AS `bufferFk`,
|
||||||
`e`.`id` AS `expeditionFk`,
|
`e`.`id` AS `expeditionFk`,
|
||||||
`srt`.`dayMinute`(IFNULL(`et`.`eta`, `z`.`hour`)) AS `dayMinute`,
|
`srt`.`dayMinute`(IFNULL(`rs`.`eta`, `z`.`hour`)) AS `dayMinute`,
|
||||||
`e`.`position` AS `position`,
|
`e`.`position` AS `position`,
|
||||||
IFNULL(
|
IFNULL(
|
||||||
`et`.`eta`,
|
`rs`.`eta`,
|
||||||
`util`.`VN_CURDATE`() + INTERVAL `srt`.`dayMinute`(`z`.`hour`) MINUTE
|
`util`.`VN_CURDATE`() + INTERVAL `srt`.`dayMinute`(`z`.`hour`) MINUTE
|
||||||
) AS `ETD`,
|
) AS `ETD`,
|
||||||
`e2`.`ticketFk` AS `ticketFk`,
|
`e2`.`ticketFk` AS `ticketFk`,
|
||||||
|
@ -34,7 +34,7 @@ FROM (
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et` ON(`rm`.`expeditionTruckFk` = `et`.`id`)
|
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`expeditionTruckFk` = `rs`.`id`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`zone` `z` ON(`z`.`id` = `t`.`zoneFk`)
|
LEFT JOIN `vn`.`zone` `z` ON(`z`.`id` = `t`.`zoneFk`)
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,22 +4,22 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
AS SELECT `e`.`id` AS `expeditionFk`,
|
AS SELECT `e`.`id` AS `expeditionFk`,
|
||||||
`e`.`bufferFk` AS `bufferFk`,
|
`e`.`bufferFk` AS `bufferFk`,
|
||||||
`e`.`position` AS `position`,
|
`e`.`position` AS `position`,
|
||||||
`srt`.`dayMinute`(IFNULL(`et`.`eta`, `z`.`hour`)) AS `dayMinute`,
|
`srt`.`dayMinute`(IFNULL(`rs`.`eta`, `z`.`hour`)) AS `dayMinute`,
|
||||||
IFNULL(
|
IFNULL(
|
||||||
`et`.`eta`,
|
`rs`.`eta`,
|
||||||
`util`.`VN_CURDATE`() + INTERVAL `srt`.`dayMinute`(`z`.`hour`) + 120 MINUTE
|
`util`.`VN_CURDATE`() + INTERVAL `srt`.`dayMinute`(`z`.`hour`) + 120 MINUTE
|
||||||
) AS `eta`,
|
) AS `eta`,
|
||||||
`ve`.`ticketFk` AS `ticketFk`,
|
`ve`.`ticketFk` AS `ticketFk`,
|
||||||
IFNULL(`t`.`routeFk`, `t`.`agencyModeFk`) AS `routeFk`,
|
IFNULL(`t`.`routeFk`, `t`.`agencyModeFk`) AS `routeFk`,
|
||||||
`z`.`name` AS `zonaTicket`,
|
`z`.`name` AS `zonaTicket`,
|
||||||
`et`.`description` AS `truck`,
|
`rs`.`description` AS `truck`,
|
||||||
`es`.`description` AS `expeditionState`,
|
`es`.`description` AS `expeditionState`,
|
||||||
`b`.`hasWorkerWaiting` AS `hasWorkerWaiting`,
|
`b`.`hasWorkerWaiting` AS `hasWorkerWaiting`,
|
||||||
`b`.`isActive` AS `isActive`,
|
`b`.`isActive` AS `isActive`,
|
||||||
IF(
|
IF(
|
||||||
`et`.`id` IS NULL,
|
`rs`.`id` IS NULL,
|
||||||
`c`.`bufferDefault`,
|
`c`.`bufferDefault`,
|
||||||
`et`.`bufferFk`
|
`rs`.`bufferFk`
|
||||||
) AS `bufferTruck`,
|
) AS `bufferTruck`,
|
||||||
`bt`.`typeName` AS `typeName`,
|
`bt`.`typeName` AS `typeName`,
|
||||||
`rm`.`bufferFk` AS `routeBuffer`
|
`rm`.`bufferFk` AS `routeBuffer`
|
||||||
|
@ -45,7 +45,7 @@ FROM (
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et` ON(`rm`.`expeditionTruckFk` = `et`.`id`)
|
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`expeditionTruckFk` = `rs`.`id`)
|
||||||
)
|
)
|
||||||
JOIN `srt`.`config` `c`
|
JOIN `srt`.`config` `c`
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,13 +4,13 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
AS SELECT `e`.`id` AS `expeditionFk`,
|
AS SELECT `e`.`id` AS `expeditionFk`,
|
||||||
`e`.`id` MOD 10000 AS `expedition`,
|
`e`.`id` MOD 10000 AS `expedition`,
|
||||||
IFNULL(
|
IFNULL(
|
||||||
`et`.`eta`,
|
`rs`.`eta`,
|
||||||
`util`.`VN_CURDATE`() + INTERVAL `srt`.`dayMinute`(`z`.`hour`) + 120 MINUTE
|
`util`.`VN_CURDATE`() + INTERVAL `srt`.`dayMinute`(`z`.`hour`) + 120 MINUTE
|
||||||
) AS `ETD`,
|
) AS `ETD`,
|
||||||
`ve`.`ticketFk` AS `ticketFk`,
|
`ve`.`ticketFk` AS `ticketFk`,
|
||||||
right(IFNULL(`t`.`routeFk`, `t`.`agencyModeFk`), 3) AS `routeFk`,
|
right(IFNULL(`t`.`routeFk`, `t`.`agencyModeFk`), 3) AS `routeFk`,
|
||||||
`z`.`name` AS `zonaTicket`,
|
`z`.`name` AS `zonaTicket`,
|
||||||
`et`.`description` AS `truck`,
|
`rs`.`description` AS `truck`,
|
||||||
`epo`.`workerCode` AS `worker`,
|
`epo`.`workerCode` AS `worker`,
|
||||||
`p`.`name` AS `labeler`,
|
`p`.`name` AS `labeler`,
|
||||||
`ve`.`counter` AS `expeditionCounter`,
|
`ve`.`counter` AS `expeditionCounter`,
|
||||||
|
@ -32,7 +32,7 @@ FROM (
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`t`.`routeFk` = `rm`.`routeFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et` ON(`rm`.`expeditionTruckFk` = `et`.`id`)
|
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rm`.`expeditionTruckFk` = `rs`.`id`)
|
||||||
)
|
)
|
||||||
JOIN `dipole`.`expedition_PrintOut` `epo` ON(`epo`.`expeditionFk` = `e`.`id`)
|
JOIN `dipole`.`expedition_PrintOut` `epo` ON(`epo`.`expeditionFk` = `e`.`id`)
|
||||||
)
|
)
|
||||||
|
|
|
@ -86,7 +86,7 @@ BEGIN
|
||||||
WHERE cs.description = 'Anulado'
|
WHERE cs.description = 'Anulado'
|
||||||
AND c.created < v2Months;
|
AND c.created < v2Months;
|
||||||
|
|
||||||
DELETE FROM expeditionTruck WHERE eta < v3Months;
|
DELETE FROM roadmapStop WHERE eta < v3Months;
|
||||||
DELETE FROM XDiario WHERE FECHA < v3Months OR FECHA IS NULL;
|
DELETE FROM XDiario WHERE FECHA < v3Months OR FECHA IS NULL;
|
||||||
|
|
||||||
-- Borrar travels sin entradas
|
-- Borrar travels sin entradas
|
||||||
|
|
|
@ -24,7 +24,7 @@ BEGIN
|
||||||
10 * p.height as height,
|
10 * p.height as height,
|
||||||
IFNULL(t.routeFk,am.agencyFk) routeFk,
|
IFNULL(t.routeFk,am.agencyFk) routeFk,
|
||||||
hour(e.created) * 60 + minute(e.created),
|
hour(e.created) * 60 + minute(e.created),
|
||||||
IFNULL(et.description , a.name),
|
IFNULL(rs.description , a.name),
|
||||||
IFNULL(t.routeFk,am.agencyFk) criterion,
|
IFNULL(t.routeFk,am.agencyFk) criterion,
|
||||||
IFNULL(p.conveyorBuildingClassFk , pc.defaultConveyorBuildingClass)
|
IFNULL(p.conveyorBuildingClassFk , pc.defaultConveyorBuildingClass)
|
||||||
FROM vn.expedition e
|
FROM vn.expedition e
|
||||||
|
@ -34,7 +34,7 @@ BEGIN
|
||||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||||
LEFT JOIN vn.agency a ON a.id = am.agencyFk
|
LEFT JOIN vn.agency a ON a.id = am.agencyFk
|
||||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
||||||
LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
|
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||||
JOIN vn.packagingConfig pc
|
JOIN vn.packagingConfig pc
|
||||||
WHERE t.warehouseFk IN (60,1,44)
|
WHERE t.warehouseFk IN (60,1,44)
|
||||||
AND e.created BETWEEN vStarted AND vEnded
|
AND e.created BETWEEN vStarted AND vEnded
|
||||||
|
|
|
@ -2,7 +2,7 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionTruck_Add`(vHour VARCHAR(5), vDescription VARCHAR(45))
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionTruck_Add`(vHour VARCHAR(5), vDescription VARCHAR(45))
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
INSERT INTO vn.expeditionTruck(eta,description)
|
INSERT INTO vn.roadmapStop(eta,description)
|
||||||
VALUES(CONCAT(util.VN_CURDATE(), ' ', vHour), vDescription);
|
VALUES(CONCAT(util.VN_CURDATE(), ' ', vHour), vDescription);
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -4,9 +4,9 @@ BEGIN
|
||||||
|
|
||||||
SELECT id truckFk,
|
SELECT id truckFk,
|
||||||
eta,
|
eta,
|
||||||
description Destino
|
description Destino
|
||||||
FROM expeditionTruck
|
FROM roadmapStop
|
||||||
WHERE eta BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
|
WHERE eta BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
|
||||||
ORDER BY eta;
|
ORDER BY eta;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -53,8 +53,8 @@ BEGIN
|
||||||
am.name zonaRuta,
|
am.name zonaRuta,
|
||||||
t.routeFk ruta,
|
t.routeFk ruta,
|
||||||
rm.beachFk ubicacion,
|
rm.beachFk ubicacion,
|
||||||
et.eta ,
|
rs.eta ,
|
||||||
et.description camion,
|
rs.description camion,
|
||||||
vTicketsPendientes AS ticketsPendientes,
|
vTicketsPendientes AS ticketsPendientes,
|
||||||
vEtiquetasTotales AS etiquetasTotales,
|
vEtiquetasTotales AS etiquetasTotales,
|
||||||
vEtiquetasEscaneadas AS etiquetasEscaneadas,
|
vEtiquetasEscaneadas AS etiquetasEscaneadas,
|
||||||
|
@ -67,7 +67,7 @@ BEGIN
|
||||||
LEFT JOIN vn.route r ON r.id = t.routeFk
|
LEFT JOIN vn.route r ON r.id = t.routeFk
|
||||||
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
||||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
|
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
|
||||||
LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
|
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||||
WHERE e.id = vExpeditionFk;
|
WHERE e.id = vExpeditionFk;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -37,8 +37,8 @@ BEGIN
|
||||||
am.name zonaRuta,
|
am.name zonaRuta,
|
||||||
t.routeFk ruta,
|
t.routeFk ruta,
|
||||||
rm.beachFk ubicacion,
|
rm.beachFk ubicacion,
|
||||||
et.eta ,
|
rs.eta ,
|
||||||
et.description camion,
|
rs.description camion,
|
||||||
vTicketsPendientes AS ticketsPendientes,
|
vTicketsPendientes AS ticketsPendientes,
|
||||||
vEtiquetasTotales AS etiquetasTotales,
|
vEtiquetasTotales AS etiquetasTotales,
|
||||||
vEtiquetasEscaneadas AS etiquetasEscaneadas
|
vEtiquetasEscaneadas AS etiquetasEscaneadas
|
||||||
|
@ -50,7 +50,7 @@ BEGIN
|
||||||
LEFT JOIN vn.route r ON r.id = t.routeFk
|
LEFT JOIN vn.route r ON r.id = t.routeFk
|
||||||
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
||||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
|
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
|
||||||
LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
|
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||||
WHERE e.id = vExpeditionFk;
|
WHERE e.id = vExpeditionFk;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -2,7 +2,7 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingRadar`(
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingRadar`(
|
||||||
vSectorFk INT
|
vSectorFk INT
|
||||||
)
|
)
|
||||||
proc:BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Calcula la información detallada respecto un sector.
|
* Calcula la información detallada respecto un sector.
|
||||||
*
|
*
|
||||||
|
@ -15,37 +15,24 @@ proc:BEGIN
|
||||||
DECLARE vWarehouseFk INT DEFAULT 0;
|
DECLARE vWarehouseFk INT DEFAULT 0;
|
||||||
DECLARE vSonSectorFk INT;
|
DECLARE vSonSectorFk INT;
|
||||||
DECLARE vWorkerFk INT;
|
DECLARE vWorkerFk INT;
|
||||||
|
|
||||||
SELECT s.workerFk
|
SELECT s.workerFk INTO vWorkerFk
|
||||||
INTO vWorkerFk
|
FROM sector s
|
||||||
FROM vn.sector s
|
|
||||||
WHERE s.id = vSectorFk;
|
WHERE s.id = vSectorFk;
|
||||||
|
|
||||||
SELECT w.id, s.warehouseFk INTO vBuyerFk, vWarehouseFk
|
|
||||||
FROM vn.worker w
|
|
||||||
JOIN vn.sector s ON s.code = w.code
|
|
||||||
WHERE s.id = vSectorFk;
|
|
||||||
|
|
||||||
SELECT s.id INTO vSectorFk
|
|
||||||
FROM vn.sector s
|
|
||||||
WHERE s.warehouseFk = vWarehouseFk
|
|
||||||
AND s.isMain;
|
|
||||||
|
|
||||||
SELECT COUNT(*) INTO hasFatherSector
|
SELECT COUNT(*) INTO hasFatherSector
|
||||||
FROM vn.sector
|
FROM sector
|
||||||
WHERE sonFk = vSectorFk;
|
WHERE sonFk = vSectorFk;
|
||||||
|
|
||||||
SELECT warehouseFk, sonFk INTO vWarehouseFk, vSonSectorFk
|
SELECT warehouseFk, sonFk INTO vWarehouseFk, vSonSectorFk
|
||||||
FROM vn.sector
|
FROM sector
|
||||||
WHERE id = vSectorFk;
|
WHERE id = vSectorFk;
|
||||||
|
|
||||||
CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk);
|
CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk);
|
||||||
CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE());
|
CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE());
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingRadar;
|
|
||||||
|
|
||||||
IF hasFatherSector THEN
|
IF hasFatherSector THEN
|
||||||
CREATE TEMPORARY TABLE tmp.itemShelvingRadar
|
CREATE OR REPLACE TEMPORARY TABLE tItemShelvingRadar
|
||||||
(PRIMARY KEY (itemFk))
|
(PRIMARY KEY (itemFk))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT *
|
SELECT *
|
||||||
|
@ -54,57 +41,77 @@ proc:BEGIN
|
||||||
i.longName,
|
i.longName,
|
||||||
i.size,
|
i.size,
|
||||||
i.subName producer,
|
i.subName producer,
|
||||||
IFNULL(a.available,0) available,
|
IFNULL(a.available, 0) available,
|
||||||
SUM(IF(s.sonFk = vSectorFk, IFNULL(iss.visible,0), 0)) upstairs,
|
SUM(IF(s.sonFk = vSectorFk, IFNULL(iss.visible, 0), 0)) upstairs,
|
||||||
SUM(IF(iss.sectorFk = vSectorFk, IFNULL(iss.visible,0), 0)) downstairs,
|
SUM(IF(iss.sectorFk = vSectorFk, IFNULL(iss.visible, 0), 0)) downstairs,
|
||||||
IF(it.isPackaging, NULL, IFNULL(v.visible,0)) as visible,
|
IF(it.isPackaging, NULL, IFNULL(v.visible, 0)) visible,
|
||||||
vSectorFk sectorFk
|
vSectorFk sectorFk,
|
||||||
FROM vn.itemShelvingStock iss
|
ish.isChecked,
|
||||||
JOIN vn.sector s ON s.id = iss.sectorFk
|
sub.isAllChecked
|
||||||
JOIN vn.item i on i.id = iss.itemFk
|
FROM itemShelvingStock iss
|
||||||
JOIN vn.itemType it ON it.id = i.typeFk AND vBuyerFk IN (0,it.workerFk)
|
JOIN itemShelving ish ON ish.shelvingFk = iss.shelvingFk
|
||||||
LEFT JOIN cache.available a ON a.item_id = iss.itemFk AND a.calc_id = vCalcAvailableFk
|
LEFT JOIN (
|
||||||
LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk
|
SELECT itemFk,
|
||||||
|
IF(
|
||||||
|
COUNT(*) = SUM(IF(isChecked >= 0, 1, 0)),
|
||||||
|
TRUE,
|
||||||
|
FALSE
|
||||||
|
) isAllChecked
|
||||||
|
FROM itemShelving is2
|
||||||
|
GROUP BY itemFk
|
||||||
|
) sub ON sub.itemFk = ish.itemFk
|
||||||
|
JOIN sector s ON s.id = iss.sectorFk
|
||||||
|
JOIN item i ON i.id = iss.itemFk
|
||||||
|
JOIN itemType it ON it.id = i.typeFk
|
||||||
|
LEFT JOIN cache.available a ON a.item_id = iss.itemFk
|
||||||
|
AND a.calc_id = vCalcAvailableFk
|
||||||
|
LEFT JOIN cache.visible v ON v.item_id = iss.itemFk
|
||||||
|
AND v.calc_id = vCalcVisibleFk
|
||||||
WHERE vSectorFk IN (iss.sectorFk, s.sonFk)
|
WHERE vSectorFk IN (iss.sectorFk, s.sonFk)
|
||||||
GROUP BY iss.itemFk
|
GROUP BY iss.itemFk
|
||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
SELECT v.item_id,
|
||||||
SELECT v.item_id,
|
|
||||||
i.longName,
|
i.longName,
|
||||||
i.size,
|
i.size,
|
||||||
i.subName producer,
|
i.subName,
|
||||||
IFNULL(a.available,0) as available,
|
IFNULL(a.available, 0),
|
||||||
0 upstairs,
|
0,
|
||||||
0 downstairs,
|
0,
|
||||||
IF(it.isPackaging, NULL, v.visible) visible,
|
IF(it.isPackaging, NULL, v.visible),
|
||||||
vSectorFk as sectorFk
|
vSectorFk,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
FROM cache.visible v
|
FROM cache.visible v
|
||||||
JOIN vn.item i on i.id = v.item_id
|
JOIN item i ON i.id = v.item_id
|
||||||
JOIN vn.itemType it ON it.id = i.typeFk AND vBuyerFk IN (0,it.workerFk)
|
JOIN itemType it ON it.id = i.typeFk
|
||||||
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = v.item_id AND iss.warehouseFk = vWarehouseFk
|
LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id
|
||||||
LEFT JOIN cache.available a ON a.item_id = v.item_id AND a.calc_id = vCalcAvailableFk
|
AND iss.warehouseFk = vWarehouseFk
|
||||||
|
LEFT JOIN cache.available a ON a.item_id = v.item_id
|
||||||
|
AND a.calc_id = vCalcAvailableFk
|
||||||
WHERE v.calc_id = vCalcVisibleFk
|
WHERE v.calc_id = vCalcVisibleFk
|
||||||
AND iss.itemFk IS NULL
|
AND iss.itemFk IS NULL
|
||||||
AND it.isInventory
|
AND it.isInventory
|
||||||
) sub GROUP BY itemFk;
|
) sub
|
||||||
|
GROUP BY itemFk;
|
||||||
|
|
||||||
SELECT ishr.*,
|
SELECT ishr.*,
|
||||||
CAST(visible - upstairs - downstairs AS DECIMAL(10,0)) AS nicho,
|
CAST(visible - upstairs - downstairs AS DECIMAL(10, 0)) nicho,
|
||||||
CAST(downstairs - IFNULL(notPickedYed,0) AS DECIMAL(10,0)) as pendiente
|
CAST(downstairs - IFNULL(notPickedYed, 0) AS DECIMAL(10, 0)) pendiente
|
||||||
FROM tmp.itemShelvingRadar ishr
|
FROM tItemShelvingRadar ishr
|
||||||
JOIN vn.item i ON i.id = ishr.itemFk
|
JOIN item i ON i.id = ishr.itemFk
|
||||||
LEFT JOIN (SELECT s.itemFk, sum(s.quantity) as notPickedYed
|
LEFT JOIN (
|
||||||
FROM vn.ticket t
|
SELECT s.itemFk, SUM(s.quantity) notPickedYed
|
||||||
JOIN vn.ticketStateToday tst ON tst.ticketFk = t.id
|
FROM ticket t
|
||||||
JOIN vn.sale s ON s.ticketFk = t.id
|
JOIN ticketStateToday tst ON tst.ticketFk = t.id
|
||||||
WHERE t.warehouseFk = vWarehouseFk
|
JOIN alertLevel al ON al.id = tst.alertLevel
|
||||||
AND tst.alertLevel = 0
|
JOIN sale s ON s.ticketFk = t.id
|
||||||
GROUP BY s.itemFk
|
WHERE t.warehouseFk = vWarehouseFk
|
||||||
) sub ON sub.itemFk = ishr.itemFk
|
AND al.code = 'FREE'
|
||||||
ORDER BY i.typeFk, i.longName;
|
GROUP BY s.itemFk
|
||||||
|
) sub ON sub.itemFk = ishr.itemFk
|
||||||
|
ORDER BY i.typeFk, i.longName;
|
||||||
ELSE
|
ELSE
|
||||||
CREATE TEMPORARY TABLE tmp.itemShelvingRadar
|
CREATE OR REPLACE TEMPORARY TABLE tItemShelvingRadar
|
||||||
(PRIMARY KEY (itemFk))
|
(PRIMARY KEY (itemFk))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT iss.itemFk,
|
SELECT iss.itemFk,
|
||||||
|
@ -115,80 +122,86 @@ proc:BEGIN
|
||||||
i.size,
|
i.size,
|
||||||
i.subName producer,
|
i.subName producer,
|
||||||
i.upToDown,
|
i.upToDown,
|
||||||
IFNULL(a.available,0) available,
|
IFNULL(a.available, 0) available,
|
||||||
IFNULL(v.visible - iss.visible,0) dayEndVisible,
|
IFNULL(v.visible - iss.visible, 0) dayEndVisible,
|
||||||
IFNULL(v.visible - iss.visible,0) firstNegative,
|
IFNULL(v.visible - iss.visible, 0) firstNegative,
|
||||||
IFNULL(v.visible - iss.visible,0) itemPlacementVisible,
|
IFNULL(v.visible - iss.visible, 0) itemPlacementVisible,
|
||||||
IFNULL(i.minimum * b.packing,0) itemPlacementSize,
|
IFNULL(i.minimum * b.packing, 0) itemPlacementSize,
|
||||||
ips.onTheWay,
|
ips.onTheWay,
|
||||||
iss.visible itemShelvingStock,
|
iss.visible itemShelvingStock,
|
||||||
IFNULL(v.visible,0) visible,
|
IFNULL(v.visible, 0) visible,
|
||||||
b.isPickedOff,
|
b.isPickedOff,
|
||||||
iss.sectorFk
|
iss.sectorFk
|
||||||
FROM vn.itemShelvingStock iss
|
FROM itemShelvingStock iss
|
||||||
JOIN vn.item i on i.id = iss.itemFk
|
JOIN item i ON i.id = iss.itemFk
|
||||||
LEFT JOIN cache.last_buy lb ON lb.item_id = iss.itemFk AND lb.warehouse_id = vWarehouseFk
|
LEFT JOIN cache.last_buy lb ON lb.item_id = iss.itemFk
|
||||||
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
AND lb.warehouse_id = vWarehouseFk
|
||||||
LEFT JOIN cache.available a ON a.item_id = iss.itemFk AND a.calc_id = vCalcAvailableFk
|
LEFT JOIN buy b ON b.id = lb.buy_id
|
||||||
LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk
|
LEFT JOIN cache.available a ON a.item_id = iss.itemFk
|
||||||
LEFT JOIN (SELECT itemFk, sum(saldo) as onTheWay
|
AND a.calc_id = vCalcAvailableFk
|
||||||
FROM vn.itemPlacementSupplyList
|
LEFT JOIN cache.visible v ON v.item_id = iss.itemFk
|
||||||
WHERE saldo > 0
|
AND v.calc_id = vCalcVisibleFk
|
||||||
GROUP BY itemFk
|
LEFT JOIN (
|
||||||
) ips ON ips.itemFk = i.id
|
SELECT itemFk, SUM(saldo) onTheWay
|
||||||
WHERE IFNULL(iss.sectorFk,0) IN (0, vSectorFk)
|
FROM itemPlacementSupplyList
|
||||||
OR iss.sectorFk = vSectorFk;
|
WHERE saldo > 0
|
||||||
|
GROUP BY itemFk
|
||||||
|
) ips ON ips.itemFk = i.id
|
||||||
|
WHERE iss.sectorFk = vSectorFk
|
||||||
|
OR iss.sectorFk IS NULL;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tmp.itemOutTime;
|
CREATE OR REPLACE TEMPORARY TABLE tmp.itemOutTime
|
||||||
CREATE TEMPORARY TABLE tmp.itemOutTime
|
SELECT *, SUM(amount) quantity
|
||||||
SELECT *,SUM(amount) quantity
|
FROM (
|
||||||
FROM
|
SELECT io.itemFk,
|
||||||
(SELECT io.itemFk,
|
io.quantity amount,
|
||||||
io.quantity amount,
|
IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) `hours`,
|
||||||
IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) as hours,
|
IF(MINUTE(t.shipped), MINUTE(t.shipped), MINUTE(z.`hour`)) `minutes`
|
||||||
IF(MINUTE(t.shipped), MINUTE(t.shipped), MINUTE(z.`hour`)) as minutes
|
FROM itemTicketOut `io`
|
||||||
FROM itemTicketOut io
|
JOIN tItemShelvingRadar isr ON isr.itemFk = io.itemFk
|
||||||
JOIN tmp.itemShelvingRadar isr ON isr.itemFk = io.itemFk
|
JOIN ticket t ON t.id= io.ticketFk
|
||||||
JOIN vn.ticket t on t.id= io.ticketFk
|
JOIN ticketState ts ON ts.ticketFk = io.ticketFk
|
||||||
JOIN vn.ticketState ts on ts.ticketFk = io.ticketFk
|
JOIN `state` s ON s.id = ts.stateFk
|
||||||
JOIN vn.state s ON s.id = ts.stateFk
|
LEFT JOIN `zone` z ON z.id = t.zoneFk
|
||||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
LEFT JOIN (
|
||||||
LEFT JOIN (SELECT DISTINCT saleFk
|
SELECT DISTINCT saleFk
|
||||||
FROM vn.saleTracking st
|
FROM saleTracking st
|
||||||
WHERE st.created > util.VN_CURDATE()
|
WHERE st.created > util.VN_CURDATE()
|
||||||
AND st.isChecked
|
AND st.isChecked
|
||||||
) stPrevious ON `stPrevious`.`saleFk` = io.saleFk
|
) stPrevious ON stPrevious.saleFk = io.saleFk
|
||||||
WHERE t.warehouseFk = vWarehouseFk
|
WHERE t.warehouseFk = vWarehouseFk
|
||||||
AND s.isPicked = 0
|
AND NOT s.isPicked
|
||||||
AND NOT io.reserved
|
AND NOT io.reserved
|
||||||
AND stPrevious.saleFk IS NULL
|
AND stPrevious.saleFk IS NULL
|
||||||
AND io.shipped >= util.VN_CURDATE()
|
AND io.shipped >= util.VN_CURDATE()
|
||||||
AND io.shipped < util.VN_CURDATE() + INTERVAL 1 DAY
|
AND io.shipped < util.VN_CURDATE() + INTERVAL 1 DAY
|
||||||
) sub
|
) sub
|
||||||
GROUP BY itemFk, hours, minutes;
|
GROUP BY itemFk, `hours`, `minutes`;
|
||||||
|
|
||||||
INSERT INTO tmp.itemShelvingRadar (itemFk)
|
INSERT INTO tItemShelvingRadar (itemFk)
|
||||||
SELECT itemFk FROM tmp.itemOutTime
|
SELECT itemFk FROM tmp.itemOutTime
|
||||||
ON DUPLICATE KEY UPDATE dayEndVisible = dayEndVisible + quantity,
|
ON DUPLICATE KEY UPDATE dayEndVisible = dayEndVisible + quantity,
|
||||||
firstNegative = if (firstNegative < 0, firstNegative, firstNegative + quantity),
|
firstNegative = IF(firstNegative < 0, firstNegative, firstNegative + quantity),
|
||||||
`hour` = ifnull(if (firstNegative > 0 , `hour`, hours),0),
|
`hour` = IFNULL(IF(firstNegative > 0 , `hour`, `hours`), 0),
|
||||||
`minute` = ifnull(if (firstNegative > 0, `minute`, minutes),0);
|
`minute` = IFNULL(IF(firstNegative > 0, `minute`, `minutes`), 0);
|
||||||
|
|
||||||
UPDATE tmp.itemShelvingRadar isr
|
UPDATE tItemShelvingRadar isr
|
||||||
JOIN (SELECT s.itemFk, sum(s.quantity) amount
|
JOIN (
|
||||||
FROM sale s
|
SELECT s.itemFk, SUM(s.quantity) amount
|
||||||
JOIN ticket t ON t.id = s.ticketFk
|
FROM sale s
|
||||||
JOIN ticketLastState tls ON tls.ticketFk = t.id
|
JOIN ticket t ON t.id = s.ticketFk
|
||||||
WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
|
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||||
AND tls.name = 'Prep Camara'
|
WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
|
||||||
GROUP BY s.itemFk) sub ON sub.itemFk = isr.itemFk
|
AND ts.code = 'COOLER_PREPARATION'
|
||||||
|
GROUP BY s.itemFk
|
||||||
|
) sub ON sub.itemFk = isr.itemFk
|
||||||
SET isr.dayEndVisible = dayEndVisible + sub.amount,
|
SET isr.dayEndVisible = dayEndVisible + sub.amount,
|
||||||
firstNegative = firstNegative + sub.amount;
|
firstNegative = firstNegative + sub.amount;
|
||||||
|
|
||||||
SELECT * FROM tmp.itemShelvingRadar;
|
SELECT * FROM tItemShelvingRadar;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.itemShelvingRadar;
|
DROP TEMPORARY TABLE tItemShelvingRadar;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -21,6 +21,9 @@ BEGIN
|
||||||
|
|
||||||
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated);
|
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated);
|
||||||
|
|
||||||
|
-- Añadido temporalmente para que no se cuelgue la db
|
||||||
|
SET vShowType = TRUE;
|
||||||
|
|
||||||
WITH itemTags AS (
|
WITH itemTags AS (
|
||||||
SELECT i.id,
|
SELECT i.id,
|
||||||
typeFk,
|
typeFk,
|
||||||
|
|
|
@ -20,7 +20,7 @@ BEGIN
|
||||||
CONCAT(tc.collectionFk, ' ', LEFT(cc.code, 4)) color,
|
CONCAT(tc.collectionFk, ' ', LEFT(cc.code, 4)) color,
|
||||||
CONCAT(tc.collectionFk, ' ', SUBSTRING('ABCDEFGH',tc.wagon, 1), '-', tc.level) levelV,
|
CONCAT(tc.collectionFk, ' ', SUBSTRING('ABCDEFGH',tc.wagon, 1), '-', tc.level) levelV,
|
||||||
tc.ticketFk,
|
tc.ticketFk,
|
||||||
LEFT(COALESCE(et.description, zo.name, am.name),12) agencyDescription,
|
LEFT(COALESCE(rs.description, zo.name, am.name),12) agencyDescription,
|
||||||
am.name,
|
am.name,
|
||||||
t.clientFk,
|
t.clientFk,
|
||||||
CONCAT(CAST(SUM(sv.volume) AS DECIMAL(5, 2)), 'm³') m3 ,
|
CONCAT(CAST(SUM(sv.volume) AS DECIMAL(5, 2)), 'm³') m3 ,
|
||||||
|
@ -47,7 +47,7 @@ BEGIN
|
||||||
LEFT JOIN ticketTrolley tt ON tt.ticket = t.id
|
LEFT JOIN ticketTrolley tt ON tt.ticket = t.id
|
||||||
LEFT JOIN zone zo ON t.zoneFk = zo.id
|
LEFT JOIN zone zo ON t.zoneFk = zo.id
|
||||||
LEFT JOIN routesMonitor rm ON rm.routeFk = t.routeFk
|
LEFT JOIN routesMonitor rm ON rm.routeFk = t.routeFk
|
||||||
LEFT JOIN expeditionTruck et ON et.id = rm.expeditionTruckFk
|
LEFT JOIN roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||||
WHERE IF(vIsCollection, tc.collectionFk = vParam, tc.ticketFk = vParam)
|
WHERE IF(vIsCollection, tc.collectionFk = vParam, tc.ticketFk = vParam)
|
||||||
GROUP BY t.id
|
GROUP BY t.id
|
||||||
ORDER BY cc.code;
|
ORDER BY cc.code;
|
||||||
|
|
|
@ -106,8 +106,8 @@ BEGIN
|
||||||
SET rm.m3boxes = sub.m3boxes;
|
SET rm.m3boxes = sub.m3boxes;
|
||||||
|
|
||||||
UPDATE routesMonitor rm
|
UPDATE routesMonitor rm
|
||||||
JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
|
JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||||
SET rm.etd = et.eta;
|
SET rm.etd = rs.eta;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.routesMonitor;
|
DROP TEMPORARY TABLE tmp.routesMonitor;
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`exchangeReportSource`
|
|
||||||
AS SELECT `e`.`dated` AS `dated`,
|
|
||||||
cast(sum(`e`.`amountIn`) AS decimal(10, 2)) AS `amountIn`,
|
|
||||||
cast(sum(`e`.`rateIn`) AS decimal(10, 4)) AS `rateIn`,
|
|
||||||
cast(sum(`e`.`amountOut`) AS decimal(10, 2)) AS `amountOut`,
|
|
||||||
cast(sum(`e`.`rateOut`) AS decimal(10, 4)) AS `rateOut`,
|
|
||||||
cast(sum(`e`.`amountEntry`) AS decimal(10, 2)) AS `amountEntry`,
|
|
||||||
cast(sum(`e`.`rateEntry`) AS decimal(10, 4)) AS `rateEntry`,
|
|
||||||
cast(
|
|
||||||
IFNULL(`rr`.`value`, `rrc`.`simulatedValue`) AS decimal(10, 4)
|
|
||||||
) AS `rateECB`
|
|
||||||
FROM (
|
|
||||||
(
|
|
||||||
`vn`.`exchangeReportSourcePrevious` `e`
|
|
||||||
LEFT JOIN `vn`.`referenceRate` `rr` ON(`rr`.`dated` = `e`.`dated`)
|
|
||||||
)
|
|
||||||
JOIN `vn`.`referenceRateConfig` `rrc` ON(1)
|
|
||||||
)
|
|
||||||
GROUP BY `e`.`dated`
|
|
||||||
ORDER BY `e`.`dated`
|
|
|
@ -1,29 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`exchangeReportSourcePrevious`
|
|
||||||
AS SELECT `exchangeInsuranceIn`.`dated` AS `dated`,
|
|
||||||
`exchangeInsuranceIn`.`amount` AS `amountIn`,
|
|
||||||
`exchangeInsuranceIn`.`rate` AS `rateIn`,
|
|
||||||
0.00 AS `amountOut`,
|
|
||||||
0.00 AS `rateOut`,
|
|
||||||
0.00 AS `amountEntry`,
|
|
||||||
0.00 AS `rateEntry`
|
|
||||||
FROM `vn`.`exchangeInsuranceIn`
|
|
||||||
UNION ALL
|
|
||||||
SELECT `exchangeInsuranceOut`.`received` AS `received`,
|
|
||||||
0.00 AS `amountIn`,
|
|
||||||
0.00 AS `ratedIn`,
|
|
||||||
`exchangeInsuranceOut`.`divisa` AS `amountOut`,
|
|
||||||
`exchangeInsuranceOut`.`rate` AS `ratedOut`,
|
|
||||||
0.00 AS `amountEntry`,
|
|
||||||
0.00 AS `rateEntry`
|
|
||||||
FROM `vn`.`exchangeInsuranceOut`
|
|
||||||
UNION ALL
|
|
||||||
SELECT `exchangeInsuranceEntry`.`dated` AS `dated`,
|
|
||||||
0.00 AS `amountIn`,
|
|
||||||
0.00 AS `ratedIn`,
|
|
||||||
0.00 AS `amountOut`,
|
|
||||||
0.00 AS `ratedOut`,
|
|
||||||
`exchangeInsuranceEntry`.`Dolares` AS `amountEntry`,
|
|
||||||
`exchangeInsuranceEntry`.`rate` AS `rateEntry`
|
|
||||||
FROM `vn`.`exchangeInsuranceEntry`
|
|
|
@ -1,9 +1,9 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
SQL SECURITY DEFINER
|
SQL SECURITY DEFINER
|
||||||
VIEW `vn`.`expeditionCommon`
|
VIEW `vn`.`expeditionCommon`
|
||||||
AS SELECT `et`.`id` AS `truckFk`,
|
AS SELECT `rs`.`id` AS `truckFk`,
|
||||||
`et`.`eta` AS `eta`,
|
`rs`.`eta` AS `eta`,
|
||||||
IFNULL(ucase(`et`.`description`), 'SIN ESCANEAR') AS `description`,
|
IFNULL(ucase(`rs`.`description`), 'SIN ESCANEAR') AS `description`,
|
||||||
`es`.`palletFk` AS `palletFk`,
|
`es`.`palletFk` AS `palletFk`,
|
||||||
`t`.`routeFk` AS `routeFk`,
|
`t`.`routeFk` AS `routeFk`,
|
||||||
`es`.`id` AS `scanFk`,
|
`es`.`id` AS `scanFk`,
|
||||||
|
@ -17,8 +17,8 @@ FROM (
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
`vn`.`expeditionTruck` `et`
|
`vn`.`roadmapStop` `rs`
|
||||||
LEFT JOIN `vn`.`routesMonitor` `r` ON(`et`.`id` = `r`.`expeditionTruckFk`)
|
LEFT JOIN `vn`.`routesMonitor` `r` ON(`rs`.`id` = `r`.`expeditionTruckFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`ticket` `t` ON(`r`.`routeFk` = `t`.`routeFk`)
|
LEFT JOIN `vn`.`ticket` `t` ON(`r`.`routeFk` = `t`.`routeFk`)
|
||||||
)
|
)
|
||||||
|
@ -28,4 +28,4 @@ FROM (
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionPallet` `ep` ON(`es`.`palletFk` = `ep`.`id`)
|
LEFT JOIN `vn`.`expeditionPallet` `ep` ON(`es`.`palletFk` = `ep`.`id`)
|
||||||
)
|
)
|
||||||
WHERE `et`.`eta` >= `util`.`VN_CURDATE`()
|
WHERE `rs`.`eta` >= `util`.`VN_CURDATE`()
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
SQL SECURITY DEFINER
|
SQL SECURITY DEFINER
|
||||||
VIEW `vn`.`expeditionPallet_Print`
|
VIEW `vn`.`expeditionPallet_Print`
|
||||||
AS SELECT `et2`.`description` AS `truck`,
|
AS SELECT `rs2`.`description` AS `truck`,
|
||||||
`t`.`routeFk` AS `routeFk`,
|
`t`.`routeFk` AS `routeFk`,
|
||||||
`r`.`description` AS `zone`,
|
`r`.`description` AS `zone`,
|
||||||
COUNT(`es`.`id`) AS `eti`,
|
COUNT(`es`.`id`) AS `eti`,
|
||||||
`ep`.`id` AS `palletFk`,
|
`ep`.`id` AS `palletFk`,
|
||||||
`et`.`id` <=> `rm`.`expeditionTruckFk` AS `isMatch`,
|
`rs`.`id` <=> `rm`.`expeditionTruckFk` AS `isMatch`,
|
||||||
`t`.`warehouseFk` AS `warehouseFk`,
|
`t`.`warehouseFk` AS `warehouseFk`,
|
||||||
IF(
|
IF(
|
||||||
`r`.`created` > `util`.`VN_CURDATE`() + INTERVAL 1 DAY,
|
`r`.`created` > `util`.`VN_CURDATE`() + INTERVAL 1 DAY,
|
||||||
|
@ -20,8 +20,8 @@ FROM (
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
`vn`.`expeditionTruck` `et`
|
`vn`.`roadmapStop` `rs`
|
||||||
JOIN `vn`.`expeditionPallet` `ep` ON(`ep`.`truckFk` = `et`.`id`)
|
JOIN `vn`.`expeditionPallet` `ep` ON(`ep`.`truckFk` = `rs`.`id`)
|
||||||
)
|
)
|
||||||
JOIN `vn`.`expeditionScan` `es` ON(`es`.`palletFk` = `ep`.`id`)
|
JOIN `vn`.`expeditionScan` `es` ON(`es`.`palletFk` = `ep`.`id`)
|
||||||
)
|
)
|
||||||
|
@ -33,7 +33,7 @@ FROM (
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`rm`.`routeFk` = `r`.`id`)
|
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`rm`.`routeFk` = `r`.`id`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et2` ON(`et2`.`id` = `rm`.`expeditionTruckFk`)
|
LEFT JOIN `vn`.`roadmapStop` `rs2` ON(`rs2`.`id` = `rm`.`expeditionTruckFk`)
|
||||||
)
|
)
|
||||||
GROUP BY `ep`.`id`,
|
GROUP BY `ep`.`id`,
|
||||||
`t`.`routeFk`
|
`t`.`routeFk`
|
||||||
|
|
|
@ -15,7 +15,7 @@ FROM (
|
||||||
`vn`.`route` `r`
|
`vn`.`route` `r`
|
||||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`r`.`id` = `rm`.`routeFk`)
|
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`r`.`id` = `rm`.`routeFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et` ON(`et`.`id` = `rm`.`expeditionTruckFk`)
|
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rs`.`id` = `rm`.`expeditionTruckFk`)
|
||||||
)
|
)
|
||||||
JOIN `vn`.`ticket` `t` ON(`t`.`routeFk` = `r`.`id`)
|
JOIN `vn`.`ticket` `t` ON(`t`.`routeFk` = `r`.`id`)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
SQL SECURITY DEFINER
|
SQL SECURITY DEFINER
|
||||||
VIEW `vn`.`expeditionScan_Monitor`
|
VIEW `vn`.`expeditionScan_Monitor`
|
||||||
AS SELECT `et`.`id` AS `truckFk`,
|
AS SELECT `rs`.`id` AS `truckFk`,
|
||||||
`et`.`eta` AS `ETD`,
|
`rs`.`eta` AS `ETD`,
|
||||||
`et`.`description` AS `description`,
|
`rs`.`description` AS `description`,
|
||||||
`ep`.`id` AS `palletFk`,
|
`ep`.`id` AS `palletFk`,
|
||||||
`ep`.`position` AS `position`,
|
`ep`.`position` AS `position`,
|
||||||
`ep`.`built` AS `built`,
|
`ep`.`built` AS `built`,
|
||||||
|
@ -12,8 +12,8 @@ AS SELECT `et`.`id` AS `truckFk`,
|
||||||
`es`.`scanned` AS `scanned`
|
`es`.`scanned` AS `scanned`
|
||||||
FROM (
|
FROM (
|
||||||
(
|
(
|
||||||
`vn`.`expeditionTruck` `et`
|
`vn`.`roadmapStop` `rs`
|
||||||
LEFT JOIN `vn`.`expeditionPallet` `ep` ON(`ep`.`truckFk` = `et`.`id`)
|
LEFT JOIN `vn`.`expeditionPallet` `ep` ON(`ep`.`truckFk` = `rs`.`id`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionScan` `es` ON(`es`.`palletFk` = `ep`.`id`)
|
LEFT JOIN `vn`.`expeditionScan` `es` ON(`es`.`palletFk` = `ep`.`id`)
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,7 +14,7 @@ AS SELECT `e`.`id` AS `expeditionFk`,
|
||||||
IF(
|
IF(
|
||||||
`t`.`routeFk`,
|
`t`.`routeFk`,
|
||||||
IFNULL(
|
IFNULL(
|
||||||
`et`.`description`,
|
`rs`.`description`,
|
||||||
REPLACE(`am`.`name`, 'ZONA ', 'Z')
|
REPLACE(`am`.`name`, 'ZONA ', 'Z')
|
||||||
),
|
),
|
||||||
`z`.`name`
|
`z`.`name`
|
||||||
|
@ -45,7 +45,7 @@ FROM (
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`rm`.`routeFk` = `t`.`routeFk`)
|
LEFT JOIN `vn`.`routesMonitor` `rm` ON(`rm`.`routeFk` = `t`.`routeFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et` ON(`et`.`id` = `rm`.`expeditionTruckFk`)
|
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rs`.`id` = `rm`.`expeditionTruckFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`beach` `b` ON(`b`.`code` = `rm`.`beachFk`)
|
LEFT JOIN `vn`.`beach` `b` ON(`b`.`code` = `rm`.`beachFk`)
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
AS SELECT `t`.`id` AS `ticketFk`,
|
AS SELECT `t`.`id` AS `ticketFk`,
|
||||||
`t`.`warehouseFk` AS `warehouseFk`,
|
`t`.`warehouseFk` AS `warehouseFk`,
|
||||||
`t`.`routeFk` AS `routeFk`,
|
`t`.`routeFk` AS `routeFk`,
|
||||||
`et`.`description` AS `description`
|
`rs`.`description` AS `description`
|
||||||
FROM (
|
FROM (
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
|
@ -13,7 +13,7 @@ FROM (
|
||||||
)
|
)
|
||||||
JOIN `vn`.`routesMonitor` `rm` ON(`rm`.`routeFk` = `t`.`routeFk`)
|
JOIN `vn`.`routesMonitor` `rm` ON(`rm`.`routeFk` = `t`.`routeFk`)
|
||||||
)
|
)
|
||||||
JOIN `vn`.`expeditionTruck` `et` ON(`et`.`id` = `rm`.`expeditionTruckFk`)
|
JOIN `vn`.`roadmapStop` `rs` ON(`rs`.`id` = `rm`.`expeditionTruckFk`)
|
||||||
)
|
)
|
||||||
WHERE `e`.`id` IS NULL
|
WHERE `e`.`id` IS NULL
|
||||||
AND `et`.`eta` > `util`.`VN_CURDATE`()
|
AND `rs`.`eta` > `util`.`VN_CURDATE`()
|
||||||
|
|
|
@ -7,13 +7,13 @@ AS SELECT `e`.`truckFk` AS `id`,
|
||||||
`e`.`palletFk` AS `pallet`,
|
`e`.`palletFk` AS `pallet`,
|
||||||
`e`.`routeFk` AS `route`,
|
`e`.`routeFk` AS `route`,
|
||||||
COUNT(DISTINCT `e`.`scanFk`) AS `scans`,
|
COUNT(DISTINCT `e`.`scanFk`) AS `scans`,
|
||||||
`et`.`description` AS `destinos`,
|
`rs`.`description` AS `destinos`,
|
||||||
sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,
|
sum(`e`.`truckFk` <> `e`.`expeditionTruckFk`) AS `fallos`,
|
||||||
`e`.`expeditionTruckFk` AS `expeditionTruckFk`,
|
`e`.`expeditionTruckFk` AS `expeditionTruckFk`,
|
||||||
max(`e`.`lastPacked`) AS `lastPacked`
|
max(`e`.`lastPacked`) AS `lastPacked`
|
||||||
FROM (
|
FROM (
|
||||||
`vn`.`expeditionCommon` `e`
|
`vn`.`expeditionCommon` `e`
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et` ON(`et`.`id` = `e`.`expeditionTruckFk`)
|
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rs`.`id` = `e`.`expeditionTruckFk`)
|
||||||
)
|
)
|
||||||
GROUP BY `e`.`truckFk`,
|
GROUP BY `e`.`truckFk`,
|
||||||
`e`.`palletFk`,
|
`e`.`palletFk`,
|
||||||
|
|
|
@ -6,8 +6,8 @@ AS SELECT `t`.`routeFk` AS `routeFk`,
|
||||||
COUNT(`es`.`id`) AS `scanned`,
|
COUNT(`es`.`id`) AS `scanned`,
|
||||||
COUNT(DISTINCT `es`.`palletFk`) AS `pallets`,
|
COUNT(DISTINCT `es`.`palletFk`) AS `pallets`,
|
||||||
max(`es`.`scanned`) AS `lastScanned`,
|
max(`es`.`scanned`) AS `lastScanned`,
|
||||||
max(`et`.`description`) AS `description`,
|
max(`rs`.`description`) AS `description`,
|
||||||
max(`et`.`eta`) AS `eta`
|
max(`rs`.`eta`) AS `eta`
|
||||||
FROM (
|
FROM (
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
|
@ -19,9 +19,9 @@ FROM (
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionPallet` `ep` ON(`ep`.`id` = `es`.`palletFk`)
|
LEFT JOIN `vn`.`expeditionPallet` `ep` ON(`ep`.`id` = `es`.`palletFk`)
|
||||||
)
|
)
|
||||||
LEFT JOIN `vn`.`expeditionTruck` `et` ON(`et`.`id` = `ep`.`truckFk`)
|
LEFT JOIN `vn`.`roadmapStop` `rs` ON(`rs`.`id` = `ep`.`truckFk`)
|
||||||
)
|
)
|
||||||
WHERE `t`.`shipped` >= `util`.`VN_CURDATE`()
|
WHERE `t`.`shipped` >= `util`.`VN_CURDATE`()
|
||||||
AND `t`.`routeFk` <> 0
|
AND `t`.`routeFk` <> 0
|
||||||
GROUP BY `t`.`routeFk`
|
GROUP BY `t`.`routeFk`
|
||||||
ORDER BY max(`et`.`eta`)
|
ORDER BY max(`rs`.`eta`)
|
||||||
|
|
|
@ -14,6 +14,5 @@ AS SELECT `dn`.`id` AS `albaran_id`,
|
||||||
`dn`.`workerFk` AS `Id_Trabajador`,
|
`dn`.`workerFk` AS `Id_Trabajador`,
|
||||||
`dn`.`supervisorFk` AS `Id_Responsable`,
|
`dn`.`supervisorFk` AS `Id_Responsable`,
|
||||||
`dn`.`departmentFk` AS `department_id`,
|
`dn`.`departmentFk` AS `department_id`,
|
||||||
`dn`.`invoiceInFk` AS `recibida_id`,
|
`dn`.`invoiceInFk` AS `recibida_id`
|
||||||
`dn`.`farmingFk` AS `farmingFk`
|
|
||||||
FROM `vn`.`deliveryNote` `dn`
|
FROM `vn`.`deliveryNote` `dn`
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
-- Place your SQL code here
|
||||||
|
ALTER TABLE IF EXISTS vn.expeditionTruck RENAME vn.roadmapStop;
|
||||||
|
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
|
SQL SECURITY DEFINER
|
||||||
|
VIEW `vn`.`expeditionTruck`
|
||||||
|
AS SELECT `rs`.`id` AS `id`,
|
||||||
|
`rs`.`roadmapFk` AS `roadmapFk`,
|
||||||
|
`rs`.`warehouseFk` AS `warehouseFk`,
|
||||||
|
`rs`.`eta` AS `eta`,
|
||||||
|
`rs`.`description` AS `description`,
|
||||||
|
`rs`.`bufferFk` AS `bufferFk`,
|
||||||
|
`rs`.`created` AS `created`,
|
||||||
|
`rs`.`userFk` AS `userFk`
|
||||||
|
FROM `vn`.`roadmapStop` `rs`;
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE vn.deliveryNote CHANGE farmingFk farmingFk__ int(10) unsigned DEFAULT NULL NULL;
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE pbx.sipConfig
|
||||||
|
CHANGE incomingLimit `call-limit` varchar(10)
|
||||||
|
CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL;
|
|
@ -6,6 +6,7 @@ services:
|
||||||
context: front
|
context: front
|
||||||
environment:
|
environment:
|
||||||
- TZ
|
- TZ
|
||||||
|
- NODE_ENV
|
||||||
ports:
|
ports:
|
||||||
- 80
|
- 80
|
||||||
deploy:
|
deploy:
|
||||||
|
|
|
@ -4,7 +4,9 @@ ENV TZ Europe/Madrid
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends nginx \
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
nginx \
|
||||||
|
gettext-base \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||||
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
||||||
|
@ -14,5 +16,7 @@ COPY nginx.conf sites-available/salix
|
||||||
RUN rm sites-enabled/default && ln -s ../sites-available/salix sites-enabled/salix
|
RUN rm sites-enabled/default && ln -s ../sites-available/salix sites-enabled/salix
|
||||||
|
|
||||||
COPY dist /salix/dist
|
COPY dist /salix/dist
|
||||||
|
COPY env.template.js /salix/dist
|
||||||
|
COPY nginx-entrypoint.sh /
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
ENTRYPOINT [ "sh", "/nginx-entrypoint.sh" ]
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
window.process = {
|
||||||
|
env: {NODE_ENV: '${NODE_ENV}'}
|
||||||
|
};
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
WWW_DIR=/salix/dist
|
||||||
|
INJECT_FILE_SRC="${WWW_DIR}/env.template.js"
|
||||||
|
INJECT_FILE_DST="${WWW_DIR}/env.js"
|
||||||
|
envsubst < "${INJECT_FILE_SRC}" > "${INJECT_FILE_DST}"
|
||||||
|
[ -z "$@" ] && nginx -g 'daemon off;' || $@
|
|
@ -5,6 +5,8 @@
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no"/>
|
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no"/>
|
||||||
<meta name="mobile-web-app-capable" content="yes"/>
|
<meta name="mobile-web-app-capable" content="yes"/>
|
||||||
<link rel="manifest" href="<%= require('./manifest.json') %>"/>
|
<link rel="manifest" href="<%= require('./manifest.json') %>"/>
|
||||||
|
<script type="text/javascript" src="/env.js">
|
||||||
|
</script>
|
||||||
<title vn-title translate></title>
|
<title vn-title translate></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -139,6 +139,9 @@ function webpack(done) {
|
||||||
webpack.description = `Transpiles application into files`;
|
webpack.description = `Transpiles application into files`;
|
||||||
|
|
||||||
function webpackDevServer(done) {
|
function webpackDevServer(done) {
|
||||||
|
const replace = require('gulp-replace');
|
||||||
|
const rename = require('gulp-rename');
|
||||||
|
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const merge = require('webpack-merge');
|
const merge = require('webpack-merge');
|
||||||
const WebpackDevServer = require('webpack-dev-server');
|
const WebpackDevServer = require('webpack-dev-server');
|
||||||
|
@ -148,6 +151,12 @@ function webpackDevServer(done) {
|
||||||
|
|
||||||
let devServer = wpConfig.devServer;
|
let devServer = wpConfig.devServer;
|
||||||
|
|
||||||
|
// local env
|
||||||
|
gulp.src(srcDir + '/env.template.js')
|
||||||
|
.pipe(replace('${NODE_ENV}', 'development'))
|
||||||
|
.pipe(rename('env.js'))
|
||||||
|
.pipe(gulp.dest(buildDir));
|
||||||
|
|
||||||
for (let entryName in wpConfig.entry) {
|
for (let entryName in wpConfig.entry) {
|
||||||
let entry = wpConfig.entry[entryName];
|
let entry = wpConfig.entry[entryName];
|
||||||
if (!Array.isArray(entry))
|
if (!Array.isArray(entry))
|
||||||
|
|
|
@ -40,7 +40,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:id/client-debt-statement-pdf',
|
path: '/:id/client-debt-statement-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.clientDebtStatementPdf = (ctx, id) => Self.printReport(ctx, id, 'client-debt-statement');
|
Self.clientDebtStatementPdf = (ctx, id) => Self.printReport(ctx, id, 'client-debt-statement');
|
||||||
|
|
|
@ -3,6 +3,7 @@ const UserError = require('vn-loopback/util/user-error');
|
||||||
module.exports = function(Self) {
|
module.exports = function(Self) {
|
||||||
Self.remoteMethodCtx('createReceipt', {
|
Self.remoteMethodCtx('createReceipt', {
|
||||||
description: 'Creates receipt and its compensation if necessary',
|
description: 'Creates receipt and its compensation if necessary',
|
||||||
|
accessType: 'READ',
|
||||||
accepts: [{
|
accepts: [{
|
||||||
arg: 'clientFk',
|
arg: 'clientFk',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
@ -45,7 +46,8 @@ module.exports = function(Self) {
|
||||||
http: {
|
http: {
|
||||||
verb: 'post',
|
verb: 'post',
|
||||||
path: '/:clientFk/createReceipt'
|
path: '/:clientFk/createReceipt'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.createReceipt = async(ctx, options) => {
|
Self.createReceipt = async(ctx, options) => {
|
||||||
|
|
|
@ -35,7 +35,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:id/credit-request-pdf',
|
path: '/:id/credit-request-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.creditRequestPdf = (ctx, id) => Self.printReport(ctx, id, 'credit-request');
|
Self.creditRequestPdf = (ctx, id) => Self.printReport(ctx, id, 'credit-request');
|
||||||
|
|
|
@ -47,7 +47,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:id/incoterms-authorization-pdf',
|
path: '/:id/incoterms-authorization-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.incotermsAuthorizationPdf = (ctx, id) => Self.printReport(ctx, id, 'incoterms-authorization');
|
Self.incotermsAuthorizationPdf = (ctx, id) => Self.printReport(ctx, id, 'incoterms-authorization');
|
||||||
|
|
|
@ -41,7 +41,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:id/letter-debtor-pdf',
|
path: '/:id/letter-debtor-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.letterDebtorPdf = (ctx, id) => Self.printReport(ctx, id, 'letter-debtor');
|
Self.letterDebtorPdf = (ctx, id) => Self.printReport(ctx, id, 'letter-debtor');
|
||||||
|
|
|
@ -29,7 +29,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:id/balance-compensation-pdf',
|
path: '/:id/balance-compensation-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.balanceCompensationPdf = (ctx, id) => Self.printReport(ctx, id, 'balance-compensation');
|
Self.balanceCompensationPdf = (ctx, id) => Self.printReport(ctx, id, 'balance-compensation');
|
||||||
|
|
|
@ -34,7 +34,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:id/receipt-pdf',
|
path: '/:id/receipt-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.receiptPdf = (ctx, id) => Self.printReport(ctx, id, 'receipt');
|
Self.receiptPdf = (ctx, id) => Self.printReport(ctx, id, 'receipt');
|
||||||
|
|
|
@ -31,7 +31,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:reference/invoice-out-pdf',
|
path: '/:reference/invoice-out-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.invoiceOutPdf = async(ctx, reference) => {
|
Self.invoiceOutPdf = async(ctx, reference) => {
|
||||||
|
|
|
@ -51,7 +51,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: '/:id/label-pdf',
|
path: '/:id/label-pdf',
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.labelPdf = (ctx, id) => Self.printReport(ctx, id, 'item-label');
|
Self.labelPdf = (ctx, id) => Self.printReport(ctx, id, 'item-label');
|
||||||
|
|
|
@ -87,10 +87,6 @@ module.exports = Self => {
|
||||||
|
|
||||||
const where = filter.where;
|
const where = filter.where;
|
||||||
where['r.id'] = filter.id;
|
where['r.id'] = filter.id;
|
||||||
where.and = [{or: [
|
|
||||||
{'t.packages': {gt: 0}},
|
|
||||||
{and: [{'ot.code': 'delivery'}, {'tob.observationTypeFk': {neq: null}}]}
|
|
||||||
]}];
|
|
||||||
|
|
||||||
stmt.merge(conn.makeWhere(filter.where));
|
stmt.merge(conn.makeWhere(filter.where));
|
||||||
stmt.merge(conn.makeGroupBy('t.id'));
|
stmt.merge(conn.makeGroupBy('t.id'));
|
||||||
|
|
|
@ -28,7 +28,8 @@ module.exports = Self => {
|
||||||
http: {
|
http: {
|
||||||
path: `/:id/docuwareDownload`,
|
path: `/:id/docuwareDownload`,
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.docuwareDownload = async id => {
|
Self.docuwareDownload = async id => {
|
||||||
|
|
|
@ -82,6 +82,8 @@
|
||||||
"gulp-print": "^2.0.1",
|
"gulp-print": "^2.0.1",
|
||||||
"gulp-wrap": "^0.15.0",
|
"gulp-wrap": "^0.15.0",
|
||||||
"gulp-yaml": "^1.0.1",
|
"gulp-yaml": "^1.0.1",
|
||||||
|
"gulp-rename": "^2.0.0",
|
||||||
|
"gulp-replace": "^1.1.4",
|
||||||
"html-loader": "^0.4.5",
|
"html-loader": "^0.4.5",
|
||||||
"html-loader-jest": "^0.2.1",
|
"html-loader-jest": "^0.2.1",
|
||||||
"html-webpack-plugin": "^5.5.1",
|
"html-webpack-plugin": "^5.5.1",
|
||||||
|
|
|
@ -202,6 +202,12 @@ devDependencies:
|
||||||
gulp-print:
|
gulp-print:
|
||||||
specifier: ^2.0.1
|
specifier: ^2.0.1
|
||||||
version: 2.0.1
|
version: 2.0.1
|
||||||
|
gulp-rename:
|
||||||
|
specifier: ^2.0.0
|
||||||
|
version: 2.0.0
|
||||||
|
gulp-replace:
|
||||||
|
specifier: ^1.1.4
|
||||||
|
version: 1.1.4
|
||||||
gulp-wrap:
|
gulp-wrap:
|
||||||
specifier: ^0.15.0
|
specifier: ^0.15.0
|
||||||
version: 0.15.0(ejs@2.3.1)
|
version: 0.15.0(ejs@2.3.1)
|
||||||
|
@ -2632,6 +2638,10 @@ packages:
|
||||||
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
|
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@types/expect@1.20.4:
|
||||||
|
resolution: {integrity: sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@types/express-serve-static-core@4.17.42:
|
/@types/express-serve-static-core@4.17.42:
|
||||||
resolution: {integrity: sha512-ckM3jm2bf/MfB3+spLPWYPUH573plBFwpOhqQ2WottxYV85j1HQFlxmnTq57X1yHY9awZPig06hL/cLMgNWHIQ==}
|
resolution: {integrity: sha512-ckM3jm2bf/MfB3+spLPWYPUH573plBFwpOhqQ2WottxYV85j1HQFlxmnTq57X1yHY9awZPig06hL/cLMgNWHIQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -2790,6 +2800,13 @@ packages:
|
||||||
resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==}
|
resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@types/vinyl@2.0.12:
|
||||||
|
resolution: {integrity: sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw==}
|
||||||
|
dependencies:
|
||||||
|
'@types/expect': 1.20.4
|
||||||
|
'@types/node': 20.11.16
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@types/yargs-parser@21.0.3:
|
/@types/yargs-parser@21.0.3:
|
||||||
resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==}
|
resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
@ -3770,6 +3787,11 @@ packages:
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/binaryextensions@2.3.0:
|
||||||
|
resolution: {integrity: sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==}
|
||||||
|
engines: {node: '>=0.8'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/bindings@1.5.0:
|
/bindings@1.5.0:
|
||||||
resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}
|
resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
@ -7090,6 +7112,22 @@ packages:
|
||||||
map-stream: 0.0.7
|
map-stream: 0.0.7
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/gulp-rename@2.0.0:
|
||||||
|
resolution: {integrity: sha512-97Vba4KBzbYmR5VBs9mWmK+HwIf5mj+/zioxfZhOKeXtx5ZjBk57KFlePf5nxq9QsTtFl0ejnHE3zTC9MHXqyQ==}
|
||||||
|
engines: {node: '>=4'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/gulp-replace@1.1.4:
|
||||||
|
resolution: {integrity: sha512-SVSF7ikuWKhpAW4l4wapAqPPSToJoiNKsbDoUnRrSgwZHH7lH8pbPeQj1aOVYQrbZKhfSVBxVW+Py7vtulRktw==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
dependencies:
|
||||||
|
'@types/node': 20.11.16
|
||||||
|
'@types/vinyl': 2.0.12
|
||||||
|
istextorbinary: 3.3.0
|
||||||
|
replacestream: 4.0.3
|
||||||
|
yargs-parser: 21.1.1
|
||||||
|
dev: true
|
||||||
|
|
||||||
/gulp-util@3.0.8:
|
/gulp-util@3.0.8:
|
||||||
resolution: {integrity: sha512-q5oWPc12lwSFS9h/4VIjG+1NuNDlJ48ywV2JKItY4Ycc/n1fXJeYPVQsfu5ZrhQi7FGSDBalwUCLar/GyHXKGw==}
|
resolution: {integrity: sha512-q5oWPc12lwSFS9h/4VIjG+1NuNDlJ48ywV2JKItY4Ycc/n1fXJeYPVQsfu5ZrhQi7FGSDBalwUCLar/GyHXKGw==}
|
||||||
engines: {node: '>=0.10'}
|
engines: {node: '>=0.10'}
|
||||||
|
@ -8324,6 +8362,14 @@ packages:
|
||||||
istanbul-lib-report: 3.0.1
|
istanbul-lib-report: 3.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/istextorbinary@3.3.0:
|
||||||
|
resolution: {integrity: sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
dependencies:
|
||||||
|
binaryextensions: 2.3.0
|
||||||
|
textextensions: 3.3.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
/jackspeak@2.3.6:
|
/jackspeak@2.3.6:
|
||||||
resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
|
resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
|
@ -12065,6 +12111,14 @@ packages:
|
||||||
remove-trailing-separator: 1.1.0
|
remove-trailing-separator: 1.1.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/replacestream@4.0.3:
|
||||||
|
resolution: {integrity: sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==}
|
||||||
|
dependencies:
|
||||||
|
escape-string-regexp: 1.0.5
|
||||||
|
object-assign: 4.1.1
|
||||||
|
readable-stream: 2.3.8
|
||||||
|
dev: true
|
||||||
|
|
||||||
/request@2.88.2:
|
/request@2.88.2:
|
||||||
resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==}
|
resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==}
|
||||||
engines: {node: '>= 6'}
|
engines: {node: '>= 6'}
|
||||||
|
@ -13563,6 +13617,11 @@ packages:
|
||||||
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
|
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/textextensions@3.3.0:
|
||||||
|
resolution: {integrity: sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/throat@5.0.0:
|
/throat@5.0.0:
|
||||||
resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==}
|
resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
|
@ -3,7 +3,7 @@ SELECT c.itemPackingTypeFk code,
|
||||||
SUBSTRING('ABCDEFGH', tc.wagon, 1) wagon,
|
SUBSTRING('ABCDEFGH', tc.wagon, 1) wagon,
|
||||||
tc.`level`,
|
tc.`level`,
|
||||||
t.id ticketFk,
|
t.id ticketFk,
|
||||||
COALESCE(et.description, zo.name, am.name) agencyDescription,
|
COALESCE(rs.description, zo.name, am.name) agencyDescription,
|
||||||
cc.code color,
|
cc.code color,
|
||||||
t.clientFk,
|
t.clientFk,
|
||||||
CAST(SUM(sv.volume) AS DECIMAL(5, 2)) volume,
|
CAST(SUM(sv.volume) AS DECIMAL(5, 2)) volume,
|
||||||
|
@ -35,7 +35,7 @@ SELECT c.itemPackingTypeFk code,
|
||||||
LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id
|
LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id
|
||||||
LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id
|
LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id
|
||||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk
|
||||||
LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk
|
LEFT JOIN vn.roadmapStop rs ON rs.id = rm.expeditionTruckFk
|
||||||
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
|
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||||
JOIN vn.productionConfig pc
|
JOIN vn.productionConfig pc
|
||||||
WHERE t.id IN (?)
|
WHERE t.id IN (?)
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
SELECT ep.id palletFk,
|
SELECT ep.id palletFk,
|
||||||
t.routeFk,
|
t.routeFk,
|
||||||
et2.description truck,
|
rs2.description truck,
|
||||||
r.description `zone`,
|
r.description `zone`,
|
||||||
COUNT(es.id) labels,
|
COUNT(es.id) labels,
|
||||||
t.warehouseFk warehouseFk,
|
t.warehouseFk warehouseFk,
|
||||||
dayname(r.created) `dayName`,
|
dayname(r.created) `dayName`,
|
||||||
et.id <=> rm.expeditionTruckFk isMatch
|
rs.id <=> rm.expeditionTruckFk isMatch
|
||||||
FROM vn.expeditionTruck et
|
FROM vn.roadmapStop rs
|
||||||
JOIN vn.expeditionPallet ep ON ep.truckFk = et.id
|
JOIN vn.expeditionPallet ep ON ep.truckFk = rs.id
|
||||||
JOIN vn.expeditionScan es ON es.palletFk = ep.id
|
JOIN vn.expeditionScan es ON es.palletFk = ep.id
|
||||||
JOIN vn.expedition e ON e.id = es.expeditionFk
|
JOIN vn.expedition e ON e.id = es.expeditionFk
|
||||||
JOIN vn.ticket t ON t.id = e.ticketFk
|
JOIN vn.ticket t ON t.id = e.ticketFk
|
||||||
JOIN vn.route r ON r.id = t.routeFk
|
JOIN vn.route r ON r.id = t.routeFk
|
||||||
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
|
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
|
||||||
LEFT JOIN vn.expeditionTruck et2 ON et2.id = rm.expeditionTruckFk
|
LEFT JOIN vn.roadmapStop rs2 ON rs2.id = rm.expeditionTruckFk
|
||||||
WHERE ep.id = ?
|
WHERE ep.id = ?
|
||||||
GROUP BY ep.id, t.routeFk
|
GROUP BY ep.id, t.routeFk
|
||||||
ORDER BY t.routeFk
|
ORDER BY t.routeFk
|
||||||
|
|
|
@ -70,6 +70,7 @@ let baseConfig = {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
|
nodeEnv: false,
|
||||||
runtimeChunk: true,
|
runtimeChunk: true,
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
chunks: 'all',
|
chunks: 'all',
|
||||||
|
@ -99,9 +100,6 @@ let baseConfig = {
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
chunks: ['salix']
|
chunks: ['salix']
|
||||||
}),
|
}),
|
||||||
new webpack.DefinePlugin({
|
|
||||||
'process.env.NODE_ENV': JSON.stringify(env)
|
|
||||||
})
|
|
||||||
],
|
],
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
stats: {
|
stats: {
|
||||||
|
|
Loading…
Reference in New Issue