diff --git a/db/routines/vn/procedures/ticket_setState.sql b/db/routines/vn/procedures/ticket_setState.sql index 13a93380d..bde8e0692 100644 --- a/db/routines/vn/procedures/ticket_setState.sql +++ b/db/routines/vn/procedures/ticket_setState.sql @@ -31,8 +31,8 @@ BEGIN CALL util.throw('ASSIGN_ZONE_FIRST'); END IF; - SET vCanChangeState = ( - vStateCode <> 'ON_CHECKING' OR + SET vCanChangeState = (( + vStateCode <> 'ON_CHECKING' AND vStateCode <> 'CHECKED') OR vticketAlertLevel < vPackedAlertLevel )AND NOT ( vTicketStateCode IN ('CHECKED', 'CHECKING') @@ -51,5 +51,6 @@ BEGIN ELSE CALL util.throw('INCORRECT_TICKET_STATE'); END IF; + END$$ DELIMITER ;