diff --git a/db/routines/vn/events/claim_changeState.sql b/db/routines/vn/events/claim_changeState.sql index 790ef0c34..5d94170a0 100644 --- a/db/routines/vn/events/claim_changeState.sql +++ b/db/routines/vn/events/claim_changeState.sql @@ -6,15 +6,15 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`claim_changeState` ENABLE DO BEGIN - DECLARE vClaimStete INT; + DECLARE vClaimState INT; - SELECT id INTO vClaimStete + SELECT id INTO vClaimState FROM claimState cs WHERE cs.code = 'canceled'; UPDATE claim c JOIN claimState cs ON cs.id = c.claimStateFk - SET c.claimStateFk = vClaimStete + SET c.claimStateFk = vClaimState WHERE c.created < util.VN_CURDATE() - INTERVAL 2 MONTH AND cs.code IN('incomplete','coming','waiting','out');