refactor: refs #7920 Major changes
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Guillermo Bonet 2024-11-13 11:15:31 +01:00
parent 2273dc636e
commit b3bf0024e3
6 changed files with 17 additions and 17 deletions

View File

@ -73,7 +73,7 @@ module.exports = Self => {
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
JOIN itemShelvingSale iss ON iss.saleFk = s.id JOIN itemShelvingSale iss ON iss.saleFk = s.id
LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
LEFT JOIN shelving sh ON sh.code = ish.shelvingFk LEFT JOIN shelving sh ON sh.id = ish.shelvingFk
LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN parking p ON p.id = sh.parkingFk
LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk
LEFT JOIN origin o ON o.id = i.originFk LEFT JOIN origin o ON o.id = i.originFk
@ -114,7 +114,7 @@ module.exports = Self => {
JOIN item i ON i.id = s.itemFk JOIN item i ON i.id = s.itemFk
JOIN itemShelvingSale iss ON iss.saleFk = s.id JOIN itemShelvingSale iss ON iss.saleFk = s.id
LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
LEFT JOIN shelving sh ON sh.code = ish.shelvingFk LEFT JOIN shelving sh ON sh.id = ish.shelvingFk
LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN parking p ON p.id = sh.parkingFk
LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk
LEFT JOIN origin o ON o.id = i.originFk LEFT JOIN origin o ON o.id = i.originFk

View File

@ -1,6 +1,6 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`entry_splitByShelving`( CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`entry_splitByShelving`(
vShelvingCode VARCHAR(3), vShelvingCode VARCHAR(10),
vFromEntryFk INT, vFromEntryFk INT,
vToEntryFk INT vToEntryFk INT
) )
@ -19,7 +19,7 @@ BEGIN
DECLARE vDone BOOLEAN DEFAULT FALSE; DECLARE vDone BOOLEAN DEFAULT FALSE;
DECLARE cur CURSOR FOR DECLARE cur CURSOR FOR
SELECT bb.id buyFk, SELECT bb.id buyFk,
LEAST(bb.stickers, FLOOR(ish.visible / ish.packing)) ishStickers, LEAST(bb.stickers, FLOOR(ish.visible / ish.packing)) ishStickers,
bb.stickers buyStickers bb.stickers buyStickers
FROM itemShelving ish FROM itemShelving ish

View File

@ -1,14 +1,14 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(vShelvingFk VARCHAR(10) ) CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
vShelvingFk VARCHAR(10)
)
BEGIN BEGIN
/** /**
* Devuelve el log de los item en cada carro * Devuelve el log de los item en cada carro
* *
* @param vShelvingFk Matrícula del carro * @param vShelvingFk Matrícula del carro
* *
*/ */
SELECT isl.itemShelvingFk, SELECT isl.itemShelvingFk,
isl.created, isl.created,
isl.accion, isl.accion,
@ -28,8 +28,9 @@ BEGIN
FROM item FROM item
JOIN itemShelvingLog isl ON item.id = isl.itemFk JOIN itemShelvingLog isl ON item.id = isl.itemFk
JOIN worker ON isl.workerFk = worker.id JOIN worker ON isl.workerFk = worker.id
WHERE shelvingFk = vShelvingFk OR isl.itemFk = vShelvingFk JOIN shelving sh ON sh.id = isl.shelvingFk
ORDER BY isl.created DESC; WHERE sh.code = vShelvingFk COLLATE utf8mb3_unicode_ci
OR isl.itemFk = vShelvingFk -- ?? Respeto porque ya estaba
ORDER BY isl.created DESC;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -41,7 +41,7 @@ module.exports = Self => {
u.name u.name
FROM itemShelvingSale iss FROM itemShelvingSale iss
LEFT JOIN itemShelving ish ON iss.itemShelvingFk = ish.id LEFT JOIN itemShelving ish ON iss.itemShelvingFk = ish.id
LEFT JOIN shelving s ON ish.shelvingFk = s.code LEFT JOIN shelving s ON ish.shelvingFk = s.id
LEFT JOIN parking p ON s.parkingFk = p.id LEFT JOIN parking p ON s.parkingFk = p.id
LEFT JOIN account.user u ON u.id = iss.userFk` LEFT JOIN account.user u ON u.id = iss.userFk`
); );

View File

@ -45,19 +45,19 @@ module.exports = Self => {
WITH tItemShelving AS( WITH tItemShelving AS(
SELECT is2.itemFk, is2.created, p.sectorFK, is2.id SELECT is2.itemFk, is2.created, p.sectorFK, is2.id
FROM vn.itemShelving is2 FROM vn.itemShelving is2
JOIN vn.shelving sh ON sh.code = is2.shelvingFk JOIN vn.shelving sh ON sh.id = is2.shelvingFk
JOIN vn.parking p ON p.id = sh.parkingFk JOIN vn.parking p ON p.id = sh.parkingFk
JOIN vn.sector s ON s.id = p.sectorFk JOIN vn.sector s ON s.id = p.sectorFk
JOIN vn.productionConfig pc JOIN vn.productionConfig pc
WHERE is2.shelvingFk = ? AND s.code = pc.sectorFromCode WHERE sh.code = ? AND s.code = pc.sectorFromCode
), tItemInSector AS ( ), tItemInSector AS (
SELECT is2.itemFk, is2.created, is2.shelvingFk SELECT is2.itemFk, is2.created, is2.shelvingFk
FROM vn.itemShelving is2 FROM vn.itemShelving is2
JOIN vn.shelving sh ON sh.code = is2.shelvingFk JOIN vn.shelving sh ON sh.id = is2.shelvingFk
JOIN vn.parking p ON p.id = sh.parkingFk JOIN vn.parking p ON p.id = sh.parkingFk
JOIN vn.sector s ON s.id = p.sectorFk JOIN vn.sector s ON s.id = p.sectorFk
JOIN vn.productionConfig pc JOIN vn.productionConfig pc
WHERE is2.shelvingFk <> ? WHERE sh.code <> ?
AND s.code = pc.sectorFromCode) AND s.code = pc.sectorFromCode)
SELECT ti.itemFK, tis.shelvingFk SELECT ti.itemFK, tis.shelvingFk
FROM tItemShelving ti FROM tItemShelving ti

View File

@ -57,8 +57,7 @@
"shelving": { "shelving": {
"type": "belongsTo", "type": "belongsTo",
"model": "Shelving", "model": "Shelving",
"foreignKey": "shelvingFk", "foreignKey": "shelvingFk"
"primaryKey": "code"
} }
} }
} }