This commit is contained in:
parent
5ed8b33cef
commit
f3612c7ee3
|
@ -31,19 +31,17 @@ BEGIN
|
|||
|
||||
START TRANSACTION;
|
||||
|
||||
IF vParam REGEXP '^[0-9]+$' THEN
|
||||
SET vLastWeek = util.VN_CURDATE() - INTERVAL 1 WEEK;
|
||||
SET vLastWeek = util.VN_CURDATE() - INTERVAL 1 WEEK;
|
||||
|
||||
-- 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;
|
||||
-- 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);
|
||||
ELSE
|
||||
CALL util.throw('paramNotExist');
|
||||
END IF;
|
||||
|
|
Loading…
Reference in New Issue