-- v1.31: Supplier Aging Report permission
-- Run once on your DB.

INSERT IGNORE INTO permissions (code, name, module) VALUES
  ('suppliers.aging.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 = 'suppliers.aging.view';

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