refactor: refs #7580 Fix and improvement #2700
|
@ -34,17 +34,18 @@ BEGIN
|
|||
IF vParam REGEXP '^[0-9]+$' THEN
|
||||
SET vLastWeek = util.VN_CURDATE() - INTERVAL 1 WEEK;
|
||||
|
||||
-- Comprobamos si es una prep. previa, ticket o colección
|
||||
-- Comprobamos si es una prep. previa, ticket, colección o shelving
|
||||
IF (SELECT TRUE FROM saleGroup WHERE id = vParam) THEN
|
||||
CALL saleGroup_setParking(vParam, vParkingFk);
|
||||
ELSEIF (SELECT TRUE FROM ticket WHERE id = vParam AND shipped >= vLastWeek) THEN
|
||||
CALL ticket_setParking(vParam, vParkingFk);
|
||||
ELSEIF (SELECT TRUE FROM `collection` WHERE id = vParam AND created >= vLastWeek) THEN
|
||||
CALL collection_setParking(vParam, vParkingFk);
|
||||
ELSEIF (SELECT TRUE FROM shelving WHERE code = vParam COLLATE utf8_unicode_ci) THEN
|
||||
CALL shelving_setParking(vParam, vParkingFk);
|
||||
END IF;
|
||||
ELSE
|
||||
guillermo marked this conversation as resolved
Outdated
|
||||
-- Por descarte, se considera una matrícula
|
||||
CALL shelving_setParking(vParam, vParkingFk);
|
||||
CALL util.throw('paramNotExist');
|
||||
guillermo marked this conversation as resolved
Outdated
carlosap
commented
No hay START TRANSACTION No hay START TRANSACTION
|
||||
END IF;
|
||||
|
||||
COMMIT;
|
||||
|
|
Loading…
Reference in New Issue
Para que se quede mejor el procedimiento, como ya lo estamos refactorizando en el ELSE pondríamos un THROW y la opción del shelving haríamos lo mismo que en las anteriores, comprobar con la SELECT si existe antes de llamarlo