refactor: refs #7920 Main change #3194
|
@ -1,12 +1,12 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
|
||||||
vShelvingFk VARCHAR(10)
|
vShelvingCode VARCHAR(10)
|
||||||
guillermo marked this conversation as resolved
Outdated
|
|||||||
)
|
)
|
||||||
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 vShelvingCode Matrícula del carro
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
SELECT isl.itemShelvingFk,
|
SELECT isl.itemShelvingFk,
|
||||||
|
@ -29,8 +29,8 @@ BEGIN
|
||||||
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
|
||||||
JOIN shelving sh ON sh.id = isl.shelvingFk
|
JOIN shelving sh ON sh.id = isl.shelvingFk
|
||||||
WHERE sh.code = vShelvingFk COLLATE utf8mb3_unicode_ci
|
WHERE sh.code = vShelvingCode COLLATE utf8mb3_unicode_ci
|
||||||
OR isl.itemFk = vShelvingFk -- ?? Respeto porque ya estaba
|
OR isl.itemFk = vShelvingCode -- ?? Respeto porque ya estaba
|
||||||
ORDER BY isl.created DESC;
|
ORDER BY isl.created DESC;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_devalueA2`(
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_devalueA2`(
|
||||||
vSelf INT,
|
vSelf INT,
|
||||||
vShelvingCode VARCHAR(10),
|
vShelvingCode VARCHAR(10) COLLATE utf8mb3_general_ci,
|
||||||
vBuyingValue DECIMAL(10,4),
|
vBuyingValue DECIMAL(10,4),
|
||||||
vQuantity INT
|
vQuantity INT
|
||||||
)
|
)
|
||||||
|
@ -112,7 +112,7 @@ BEGIN
|
||||||
SELECT ish.id, ish.visible INTO vTargetItemShelvingFk, vCurrentVisible
|
SELECT ish.id, ish.visible INTO vTargetItemShelvingFk, vCurrentVisible
|
||||||
FROM itemShelving ish
|
FROM itemShelving ish
|
||||||
JOIN shelving sh ON sh.id = ish.shelvingFk
|
JOIN shelving sh ON sh.id = ish.shelvingFk
|
||||||
WHERE sh.code = vShelvingCode COLLATE utf8mb3_general_ci
|
WHERE sh.code = vShelvingCode
|
||||||
guillermo marked this conversation as resolved
Outdated
jgallego
commented
si el poses dalt en la definicio no cal que el poses dos vegades en el codi si el poses dalt en la definicio no cal que el poses dos vegades en el codi
|
|||||||
AND ish.itemFk = vSelf
|
AND ish.itemFk = vSelf
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ BEGIN
|
||||||
FROM itemShelving ish
|
FROM itemShelving ish
|
||||||
JOIN shelving sh ON sh.id = ish.shelvingFk
|
JOIN shelving sh ON sh.id = ish.shelvingFk
|
||||||
WHERE ish.itemFK = vSelf
|
WHERE ish.itemFK = vSelf
|
||||||
AND sh.code = vShelvingCode COLLATE utf8mb3_general_ci
|
AND sh.code = vShelvingCode
|
||||||
ON DUPLICATE KEY UPDATE
|
ON DUPLICATE KEY UPDATE
|
||||||
visible = vQuantity + VALUES(visible);
|
visible = vQuantity + VALUES(visible);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ BEGIN
|
||||||
DECLARE vQuantity INT;
|
DECLARE vQuantity INT;
|
||||||
DECLARE vRemainder INT DEFAULT 0;
|
DECLARE vRemainder INT DEFAULT 0;
|
||||||
DECLARE vRemainderSaleFk INT;
|
DECLARE vRemainderSaleFk INT;
|
||||||
DECLARE vShelving VARCHAR(10);
|
DECLARE vShelvingFk VARCHAR(10);
|
||||||
DECLARE vTicketFk INT;
|
DECLARE vTicketFk INT;
|
||||||
|
|
||||||
SELECT s.quantity,
|
SELECT s.quantity,
|
||||||
|
@ -262,7 +262,7 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
CALL dipole.expedition_Add(vExpeditionFk,vPrinterFk, TRUE);
|
CALL dipole.expedition_Add(vExpeditionFk,vPrinterFk, TRUE);
|
||||||
|
|
||||||
SELECT shelvingFk, p.code
|
SELECT shelvingFk, p.code
|
||||||
INTO vShelving, vParkingCode
|
INTO vShelvingFk, vParkingCode
|
||||||
FROM itemShelving ish
|
FROM itemShelving ish
|
||||||
JOIN shelving sh ON sh.id = ish.shelvingFk
|
JOIN shelving sh ON sh.id = ish.shelvingFk
|
||||||
JOIN parking p ON p.id = sh.parkingFk
|
JOIN parking p ON p.id = sh.parkingFk
|
||||||
|
@ -273,7 +273,7 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
itemFk = vItemFk,
|
itemFk = vItemFk,
|
||||||
quantity = vPacking,
|
quantity = vPacking,
|
||||||
longName = vConcept,
|
longName = vConcept,
|
||||||
shelvingFk = vShelving,
|
shelvingFk = vShelvingFk,
|
||||||
parkingCode = vParkingCode,
|
parkingCode = vParkingCode,
|
||||||
phone = RIGHT(phone,vMaxPhoneLength),
|
phone = RIGHT(phone,vMaxPhoneLength),
|
||||||
street = RIGHT(street, vMAxStreetLength)
|
street = RIGHT(street, vMAxStreetLength)
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`shelvingChange`(IN `vShelvingO` VARCHAR(8), IN `vShelvingD` VARCHAR(8))
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`shelvingChange`(
|
||||||
guillermo marked this conversation as resolved
Outdated
jgallego
commented
la taula es varchar10, revisals tots per si de cas la taula es varchar10, revisals tots per si de cas
|
|||||||
|
`vShelvingO` VARCHAR(10),
|
||||||
|
`vShelvingD` VARCHAR(10)
|
||||||
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
UPDATE itemShelving ish
|
UPDATE itemShelving ish
|
||||||
JOIN shelving sh1 ON sh1.code = vShelvingD COLLATE utf8_unicode_ci
|
JOIN shelving sh1 ON sh1.code = vShelvingD COLLATE utf8_unicode_ci
|
||||||
JOIN shelving sh2 ON sh2.code = vShelvingO COLLATE utf8_unicode_ci
|
JOIN shelving sh2 ON sh2.code = vShelvingO COLLATE utf8_unicode_ci
|
||||||
SET ish.shelvingFk = sh1.id
|
SET ish.shelvingFk = sh1.id
|
||||||
WHERE ish.shelvingFk = sh2.id;
|
WHERE ish.shelvingFk = sh2.id;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue
int? o shelvingCode?
ShelvingCode, vuic fer-ho retrocompatible