8144-devToTest_2448 #3216
|
@ -73,7 +73,7 @@ module.exports = Self => {
|
|||
JOIN item i ON i.id = s.itemFk
|
||||
JOIN itemShelvingSale iss ON iss.saleFk = s.id
|
||||
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 itemColor ic ON ic.itemFk = s.itemFk
|
||||
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 itemShelvingSale iss ON iss.saleFk = s.id
|
||||
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 itemColor ic ON ic.itemFk = s.itemFk
|
||||
LEFT JOIN origin o ON o.id = i.originFk
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`entry_splitByShelving`(
|
||||
vShelvingCode VARCHAR(3),
|
||||
vShelvingCode VARCHAR(10),
|
||||
vFromEntryFk INT,
|
||||
vToEntryFk INT
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ BEGIN
|
|||
DECLARE vDone BOOLEAN DEFAULT FALSE;
|
||||
|
||||
DECLARE cur CURSOR FOR
|
||||
SELECT bb.id buyFk,
|
||||
SELECT bb.id buyFk,
|
||||
LEAST(bb.stickers, FLOOR(ish.visible / ish.packing)) ishStickers,
|
||||
bb.stickers buyStickers
|
||||
FROM itemShelving ish
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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
|
||||
|
||||
/**
|
||||
* Devuelve el log de los item en cada carro
|
||||
*
|
||||
* @param vShelvingFk Matrícula del carro
|
||||
*
|
||||
*/
|
||||
|
||||
SELECT isl.itemShelvingFk,
|
||||
isl.created,
|
||||
isl.accion,
|
||||
|
@ -28,8 +28,9 @@ BEGIN
|
|||
FROM item
|
||||
JOIN itemShelvingLog isl ON item.id = isl.itemFk
|
||||
JOIN worker ON isl.workerFk = worker.id
|
||||
WHERE shelvingFk = vShelvingFk OR isl.itemFk = vShelvingFk
|
||||
ORDER BY isl.created DESC;
|
||||
|
||||
JOIN shelving sh ON sh.id = isl.shelvingFk
|
||||
WHERE sh.code = vShelvingFk COLLATE utf8mb3_unicode_ci
|
||||
OR isl.itemFk = vShelvingFk -- ?? Respeto porque ya estaba
|
||||
ORDER BY isl.created DESC;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -41,7 +41,7 @@ module.exports = Self => {
|
|||
u.name
|
||||
FROM itemShelvingSale iss
|
||||
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 account.user u ON u.id = iss.userFk`
|
||||
);
|
||||
|
|
|
@ -45,19 +45,19 @@ module.exports = Self => {
|
|||
WITH tItemShelving AS(
|
||||
SELECT is2.itemFk, is2.created, p.sectorFK, is2.id
|
||||
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.sector s ON s.id = p.sectorFk
|
||||
JOIN vn.productionConfig pc
|
||||
WHERE is2.shelvingFk = ? AND s.code = pc.sectorFromCode
|
||||
WHERE sh.code = ? AND s.code = pc.sectorFromCode
|
||||
), tItemInSector AS (
|
||||
SELECT is2.itemFk, is2.created, is2.shelvingFk
|
||||
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.sector s ON s.id = p.sectorFk
|
||||
JOIN vn.productionConfig pc
|
||||
WHERE is2.shelvingFk <> ?
|
||||
WHERE sh.code <> ?
|
||||
AND s.code = pc.sectorFromCode)
|
||||
SELECT ti.itemFK, tis.shelvingFk
|
||||
FROM tItemShelving ti
|
||||
|
|
|
@ -57,8 +57,7 @@
|
|||
"shelving": {
|
||||
"type": "belongsTo",
|
||||
"model": "Shelving",
|
||||
"foreignKey": "shelvingFk",
|
||||
"primaryKey": "code"
|
||||
"foreignKey": "shelvingFk"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue