7658-devToTest_2428 #2663

Merged
alexm merged 251 commits from 7658-devToTest_2428 into test 2024-07-02 07:20:13 +00:00
7 changed files with 16 additions and 18 deletions
Showing only changes of commit b9d1c3228b - Show all commits

View File

@ -75,7 +75,7 @@ BEGIN
END IF; END IF;
IF vHasThrow THEN 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");
END IF; END IF;
IF vSaleGroupFk THEN IF vSaleGroupFk THEN

View File

@ -40,7 +40,7 @@ BEGIN
DROP TEMPORARY TABLE tCollection; DROP TEMPORARY TABLE tCollection;
IF vHasTooMuchCollections THEN IF vHasTooMuchCollections THEN
CALL util.throw('Hay colecciones pendientes'); CALL util.throw('There are pending collections');
END IF; END IF;
SELECT warehouseFk, itemPackingTypeFk SELECT warehouseFk, itemPackingTypeFk

View File

@ -7,7 +7,7 @@ BEGIN
* @return Retorna ticketFk, level, agencyName, warehouseFk, salesPersonFk, observation * @return Retorna ticketFk, level, agencyName, warehouseFk, salesPersonFk, observation
*/ */
DECLARE vItemPackingTypeFk VARCHAR(1); DECLARE vItemPackingTypeFk VARCHAR(1);
DECLARE vDated DATE; DECLARE vYesterday DATE;
-- Si los sacadores son los de pruebas, pinta los colores -- Si los sacadores son los de pruebas, pinta los colores
SELECT itemPackingTypeFk SELECT itemPackingTypeFk
@ -15,7 +15,7 @@ BEGIN
FROM collection FROM collection
WHERE id = vParamFk; WHERE id = vParamFk;
SET vDated = util.yesterday(); SET vYesterday = util.yesterday();
WITH observation AS ( WITH observation AS (
SELECT tob.ticketFk, tob.description SELECT tob.ticketFk, tob.description
@ -45,7 +45,7 @@ BEGIN
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
LEFT JOIN observation ob ON ob.ticketFk = t.id LEFT JOIN observation ob ON ob.ticketFk = t.id
WHERE t.id = vParamFk WHERE t.id = vParamFk
AND t.shipped >= vDated AND t.shipped >= vYesterday
UNION ALL UNION ALL
SELECT t.id ticketFk, SELECT t.id ticketFk,
IF(NOT(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`, 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 observation ob ON ob.ticketFk = t.id
LEFT JOIN vn.client c ON c.id = t.clientFk LEFT JOIN vn.client c ON c.id = t.clientFk
WHERE sc.id = vParamFk WHERE sc.id = vParamFk
AND t.shipped >= vDated; AND t.shipped >= vYesterday;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -29,7 +29,7 @@ BEGIN
END; END;
IF (SELECT isPicked FROM itemShelvingSale WHERE id = vItemShelvingSaleFk) THEN IF (SELECT isPicked FROM itemShelvingSale WHERE id = vItemShelvingSaleFk) THEN
CALL util.throw('Reserva completada'); CALL util.throw('Reservation completed');
END IF; END IF;
SELECT s.itemFk, iss.saleFk, iss.itemShelvingFk, SUM(IFNULL(iss.quantity,0)) SELECT s.itemFk, iss.saleFk, iss.itemShelvingFk, SUM(IFNULL(iss.quantity,0))
@ -43,7 +43,7 @@ BEGIN
OR (vQuantity < vReservedQuantity AND OR (vQuantity < vReservedQuantity AND
(NOT vIsItemShelvingSaleEmpty OR vIsItemShelvingSaleEmpty IS NULL)) (NOT vIsItemShelvingSaleEmpty OR vIsItemShelvingSaleEmpty IS NULL))
OR (vIsItemShelvingSaleEmpty IS NOT NULL AND vQuantity = vReservedQuantity) THEN 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; END IF;
START TRANSACTION; START TRANSACTION;
@ -89,7 +89,7 @@ BEGIN
COMMIT; COMMIT;
IF vIsItemShelvingSaleEmpty AND vQuantity <> vReservedQuantity THEN IF vIsItemShelvingSaleEmpty AND vQuantity <> vReservedQuantity THEN
CALL itemShelvingSale_moveReserv(vItemShelvingFk, vQuantity); CALL itemShelving_moveReserv(vItemShelvingFk, vQuantity);
END IF; END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,11 +1,11 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_moveReserv`( CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_moveReserv`(
vItemShelvingFk INT(10), vItemShelvingFk INT(10),
vItemFk INT(10) vItemFk INT(10)
) )
BEGIN 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 * @param vItemShelvingFk Id itemShelving
*/ */
@ -20,7 +20,6 @@ BEGIN
SELECT id INTO vItemShelvingFk SELECT id INTO vItemShelvingFk
FROM itemShelving FROM itemShelving
WHERE id = vItemShelvingFk WHERE id = vItemShelvingFk
AND FALSE
FOR UPDATE; FOR UPDATE;
UPDATE itemShelving UPDATE itemShelving

View File

@ -12,8 +12,7 @@ BEGIN
LEFT JOIN vn.sale sl ON sl.id = sgd.saleFk LEFT JOIN vn.sale sl ON sl.id = sgd.saleFk
LEFT JOIN itemShelvingSale iss ON iss.saleFk = sl.id LEFT JOIN itemShelvingSale iss ON iss.saleFk = sl.id
WHERE sc.userFk = account.myUser_getId() WHERE sc.userFk = account.myUser_getId()
AND (ISNULL(scsg.sectorCollectionFk) AND (scsg.sectorCollectionFk IS NULL OR NOT iss.isPicked)
OR (NOT iss.isPicked))
AND sc.created > util.VN_CURDATE() - INTERVAL 1 DAY; AND sc.created > util.VN_CURDATE() - INTERVAL 1 DAY;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -5,8 +5,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelvingSale_afte
BEGIN BEGIN
UPDATE sale s UPDATE sale s
JOIN operator o ON o.workerFk = account.myUser_getId() JOIN operator o ON o.workerFk = account.myUser_getId()
SET isPicked = IF(o.isOnReservationMode, isPicked, TRUE) SET s.isPicked = IF(o.isOnReservationMode, isPicked, TRUE)
WHERE id = NEW.saleFk; WHERE id = NEW.saleFk;
END$$ END$$
DELIMITER ; DELIMITER ;