refactor: refs #7920 Major changes
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
779a75cd78
commit
2273dc636e
|
@ -1,11 +1,10 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`shelvingChange`(IN `vShelvingO` VARCHAR(8), IN `vShelvingD` VARCHAR(8))
|
||||
BEGIN
|
||||
|
||||
UPDATE vn.itemShelving
|
||||
SET shelvingFk = vShelvingD COLLATE utf8_unicode_ci
|
||||
WHERE shelvingFk = vShelvingO COLLATE utf8_unicode_ci;
|
||||
|
||||
|
||||
UPDATE itemShelving ish
|
||||
JOIN shelving sh1 ON sh1.code = vShelvingD COLLATE utf8_unicode_ci
|
||||
JOIN shelving sh2 ON sh2.code = vShelvingO COLLATE utf8_unicode_ci
|
||||
SET ish.shelvingFk = sh1.id
|
||||
WHERE ish.shelvingFk = sh2.id;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`shelvingParking_get`(vShelvingFk VARCHAR(10), vWarehouseFk INT, vDayRange INT)
|
||||
BEGIN
|
||||
|
||||
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`shelvingParking_get`(
|
||||
vShelvingCode VARCHAR(10),
|
||||
vWarehouseFk INT,
|
||||
vDayRange INT
|
||||
)
|
||||
BEGIN
|
||||
SELECT s.itemFk,
|
||||
s.concept,
|
||||
CAST(SUM(s.quantity) AS DECIMAL(10,0)) as sinServir,
|
||||
|
@ -10,14 +12,15 @@ SELECT s.itemFk,
|
|||
FROM vn.sale s
|
||||
LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id
|
||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||
LEFT JOIN vn.itemShelvingStock ist ON ist.itemFk = s.itemFk AND ist.warehouseFk = vWarehouseFk
|
||||
JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk AND ish.shelvingFk = vShelvingFk COLLATE utf8_general_ci
|
||||
LEFT JOIN vn.itemShelvingStock ist ON ist.itemFk = s.itemFk
|
||||
AND ist.warehouseFk = vWarehouseFk
|
||||
JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk
|
||||
JOIN shelving sh ON sh.id = ish.shelvingFk
|
||||
AND sh.code = vShelvingCode COLLATE utf8_general_ci
|
||||
WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(TIMESTAMPADD(DAY, GREATEST(0,vDayRange), util.VN_CURDATE()))
|
||||
AND iss.saleFk IS NULL
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
GROUP BY s.itemFk
|
||||
HAVING sinServir > aparcado;
|
||||
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -25,7 +25,7 @@ BEGIN
|
|||
LEFT JOIN (
|
||||
SELECT ish.itemFk, CAST(SUM(ish.visible) AS DECIMAL(10,0)) AS reserva
|
||||
FROM vn.itemShelving ish
|
||||
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN vn.shelving sh ON sh.id = ish.shelvingFk
|
||||
JOIN vn.parking p ON p.id = sh.parkingFk
|
||||
JOIN vn.sector s ON s.id = p.sectorFk
|
||||
WHERE s.code = 'FUENTES_PICASSE'
|
||||
|
@ -68,7 +68,7 @@ BEGIN
|
|||
sh.isSpam
|
||||
FROM vn.itemShelving ish
|
||||
JOIN vn.item i ON i.id = ish.itemFk
|
||||
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN vn.shelving sh ON sh.id = ish.shelvingFk
|
||||
JOIN vn.parking p ON p.id = sh.parkingFk
|
||||
JOIN vn.sector s ON s.id = p.sectorFk
|
||||
JOIN vn.warehouse w ON w.id = s.warehouseFk
|
||||
|
|
|
@ -9,7 +9,7 @@ BEGIN
|
|||
JOIN vn.sale s ON s.ticketFk = t.id
|
||||
JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id
|
||||
JOIN vn.itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN vn.shelving sh ON sh.id = ish.shelvingFk
|
||||
JOIN vn.parking p ON p.id = sh.parkingFk
|
||||
WHERE p.sectorFk = vSectorFk
|
||||
) sub ON sub.id = td.ticketFk
|
||||
|
|
|
@ -27,7 +27,7 @@ BEGIN
|
|||
SUM(ish.visible) visible,
|
||||
s.warehouseFk warehouseFk
|
||||
FROM itemShelving ish
|
||||
JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN shelving sh ON sh.id = ish.shelvingFk
|
||||
JOIN parking p ON p.id = sh.parkingFk
|
||||
JOIN sector s ON s.id = p.sectorFk
|
||||
GROUP BY ish.itemFk,
|
||||
|
|
|
@ -28,7 +28,7 @@ BEGIN
|
|||
SUM(ish.visible) visible,
|
||||
s.warehouseFk warehouseFk
|
||||
FROM itemShelving ish
|
||||
JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN shelving sh ON sh.id = ish.shelvingFk
|
||||
JOIN parking p ON p.id = sh.parkingFk
|
||||
JOIN sector s ON s.id = p.sectorFk
|
||||
GROUP BY ish.itemFk,
|
||||
|
|
|
@ -15,7 +15,7 @@ FROM (
|
|||
(
|
||||
(
|
||||
`vn`.`itemShelving` `ish`
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`code` = `ish`.`shelvingFk`)
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
|
||||
)
|
||||
JOIN `vn`.`item` `i` ON(`i`.`id` = `ish`.`itemFk`)
|
||||
)
|
||||
|
|
|
@ -18,7 +18,7 @@ FROM (
|
|||
(
|
||||
(
|
||||
`vn`.`itemShelving` `ish`
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`code` = `ish`.`shelvingFk`)
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
|
||||
)
|
||||
LEFT JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
|
||||
)
|
||||
|
|
|
@ -13,7 +13,7 @@ FROM (
|
|||
`vn`.`itemShelvingSale` `iss`
|
||||
JOIN `vn`.`itemShelving` `ish` ON(`ish`.`id` = `iss`.`itemShelvingFk`)
|
||||
)
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`code` = `ish`.`shelvingFk`)
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
|
||||
)
|
||||
JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
|
||||
)
|
||||
|
|
|
@ -21,7 +21,7 @@ FROM (
|
|||
(
|
||||
(
|
||||
`vn`.`itemShelving` `ish`
|
||||
LEFT JOIN `vn`.`shelving` `sh` ON(`sh`.`code` = `ish`.`shelvingFk`)
|
||||
LEFT JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
|
||||
)
|
||||
LEFT JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
|
||||
)
|
||||
|
|
|
@ -19,7 +19,7 @@ FROM (
|
|||
(
|
||||
(
|
||||
`vn`.`itemShelving` `ish`
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`code` = `ish`.`shelvingFk`)
|
||||
JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
|
||||
)
|
||||
JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue