-- v1.32: Purchase Reports permission
-- Run once on your DB.

INSERT IGNORE INTO permissions (code, name, module) VALUES
  ('purchases.reports.view', 'عرض تقارير المشتريات', 'purchases');

-- Grant to Admin and Manager
INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT 1, p.id FROM permissions p WHERE p.code = 'purchases.reports.view';

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT 2, p.id FROM permissions p WHERE p.code = 'purchases.reports.view';
