diff --git a/db/routines/vn/procedures/client_userDisable.sql b/db/routines/vn/procedures/client_userDisable.sql index f2ba65c1c..779ffd688 100644 --- a/db/routines/vn/procedures/client_userDisable.sql +++ b/db/routines/vn/procedures/client_userDisable.sql @@ -21,6 +21,7 @@ BEGIN AND a.id IS NULL AND u.active AND c.created < util.VN_CURDATE() - INTERVAL vMonths MONTH + AND NOT u.role = (SELECT id FROM `role` WHERE name = 'supplier') AND u.id NOT IN ( SELECT DISTINCT c.id FROM client c