feat: previas con sitema de reservas refs #6861 #2176
|
@ -75,7 +75,7 @@ BEGIN
|
|||
END IF;
|
||||
|
||||
IF vHasThrow THEN
|
||||
CALL util.throw("No hay disponibilidad para el artículo seleccionado");
|
||||
CALL util.throw("There is no available for the selected item");
|
||||
carlosap marked this conversation as resolved
Outdated
|
||||
END IF;
|
||||
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
no pots posar ací el throw? no pots posar ací el throw?
carlosap
commented
No hi ha un error especific per a caada error, s'aprofita la variable vHasThrow en varios puestos No hi ha un error especific per a caada error, s'aprofita la variable vHasThrow en varios puestos
|
||||
IF vSaleGroupFk THEN
|
||||
|
|
|
@ -40,7 +40,7 @@ BEGIN
|
|||
DROP TEMPORARY TABLE tCollection;
|
||||
|
||||
jgallego marked this conversation as resolved
jgallego
commented
si hi ha un throw el leave es innecesari si hi ha un throw el leave es innecesari
|
||||
IF vHasTooMuchCollections THEN
|
||||
CALL util.throw('Hay colecciones pendientes');
|
||||
CALL util.throw('There are pending collections');
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
castella no castella no
|
||||
END IF;
|
||||
|
||||
SELECT warehouseFk, itemPackingTypeFk
|
||||
|
|
|
@ -7,7 +7,7 @@ BEGIN
|
|||
* @return Retorna ticketFk, level, agencyName, warehouseFk, salesPersonFk, observation
|
||||
*/
|
||||
DECLARE vItemPackingTypeFk VARCHAR(1);
|
||||
DECLARE vDated DATE;
|
||||
DECLARE vYesterday DATE;
|
||||
|
||||
-- Si los sacadores son los de pruebas, pinta los colores
|
||||
SELECT itemPackingTypeFk
|
||||
|
@ -15,7 +15,7 @@ BEGIN
|
|||
FROM collection
|
||||
WHERE id = vParamFk;
|
||||
|
||||
SET vDated = util.yesterday();
|
||||
SET vYesterday = util.yesterday();
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
vYesterday vYesterday
|
||||
|
||||
WITH observation AS (
|
||||
SELECT tob.ticketFk, tob.description
|
||||
|
@ -45,7 +45,7 @@ BEGIN
|
|||
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
||||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||
WHERE t.id = vParamFk
|
||||
AND t.shipped >= vDated
|
||||
AND t.shipped >= vYesterday
|
||||
UNION ALL
|
||||
SELECT t.id ticketFk,
|
||||
IF(NOT(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`,
|
||||
|
@ -84,6 +84,6 @@ BEGIN
|
|||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||
WHERE sc.id = vParamFk
|
||||
AND t.shipped >= vDated;
|
||||
AND t.shipped >= vYesterday;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -29,7 +29,7 @@ BEGIN
|
|||
END;
|
||||
|
||||
IF (SELECT isPicked FROM itemShelvingSale WHERE id = vItemShelvingSaleFk) THEN
|
||||
CALL util.throw('Reserva completada');
|
||||
CALL util.throw('Reservation completed');
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
en castella no en castella no
|
||||
END IF;
|
||||
|
||||
SELECT s.itemFk, iss.saleFk, iss.itemShelvingFk, SUM(IFNULL(iss.quantity,0))
|
||||
|
@ -43,7 +43,7 @@ BEGIN
|
|||
OR (vQuantity < vReservedQuantity AND
|
||||
(NOT vIsItemShelvingSaleEmpty OR vIsItemShelvingSaleEmpty IS NULL))
|
||||
OR (vIsItemShelvingSaleEmpty IS NOT NULL AND vQuantity = vReservedQuantity) THEN
|
||||
CALL util.throw('La cantidad no puede distinta a la reserva');
|
||||
CALL util.throw('The quantity cannot be different from the reserved');
|
||||
END IF;
|
||||
|
||||
START TRANSACTION;
|
||||
|
@ -89,7 +89,7 @@ BEGIN
|
|||
COMMIT;
|
||||
jgallego
commented
itemShelvingSaleReserve itemShelvingSaleReserve
|
||||
|
||||
IF vIsItemShelvingSaleEmpty AND vQuantity <> vReservedQuantity THEN
|
||||
CALL itemShelvingSale_moveReserv(vItemShelvingFk, vQuantity);
|
||||
CALL itemShelving_moveReserv(vItemShelvingFk, vQuantity);
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,11 +1,11 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_moveReserv`(
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_moveReserv`(
|
||||
vItemShelvingFk INT(10),
|
||||
vItemFk INT(10)
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Elimina reservas de un itemShelvingSale e intenta reservar en otra ubicación
|
||||
* Elimina reservas de un itemShelving e intenta reservar en otra ubicación
|
||||
*
|
||||
* @param vItemShelvingFk Id itemShelving
|
||||
*/
|
||||
|
@ -20,7 +20,6 @@ BEGIN
|
|||
SELECT id INTO vItemShelvingFk
|
||||
FROM itemShelving
|
||||
WHERE id = vItemShelvingFk
|
||||
AND FALSE
|
||||
FOR UPDATE;
|
||||
|
||||
UPDATE itemShelving
|
|
@ -12,8 +12,7 @@ BEGIN
|
|||
LEFT JOIN vn.sale sl ON sl.id = sgd.saleFk
|
||||
LEFT JOIN itemShelvingSale iss ON iss.saleFk = sl.id
|
||||
WHERE sc.userFk = account.myUser_getId()
|
||||
AND (ISNULL(scsg.sectorCollectionFk)
|
||||
OR (NOT iss.isPicked))
|
||||
AND (scsg.sectorCollectionFk IS NULL OR NOT iss.isPicked)
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
Por temas de optimización en WHERE, utilizaremos la comparación a null usando IS NULL Por temas de optimización en WHERE, utilizaremos la comparación a null usando IS NULL ~~ISNULL(parentFk)~~
|
||||
AND sc.created > util.VN_CURDATE() - INTERVAL 1 DAY;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -6,7 +6,7 @@ BEGIN
|
|||
|
||||
UPDATE sale s
|
||||
JOIN operator o ON o.workerFk = account.myUser_getId()
|
||||
SET isPicked = IF(o.isOnReservationMode, isPicked, TRUE)
|
||||
SET s.isPicked = IF(o.isOnReservationMode, isPicked, TRUE)
|
||||
carlosap marked this conversation as resolved
Outdated
jgallego
commented
isPicked de quina taula? isPicked de quina taula?
|
||||
WHERE id = NEW.saleFk;
|
||||
END$$
|
||||
DELIMITER ;
|
Loading…
Reference in New Issue
castella no.