-- Pacific Logistics · slice 35 · Supplier statements
--
-- Grants only. Reads from supplier_bills + supplier_payments + vendors.

INSERT IGNORE INTO user_groups_perms (user_group_id, controller_allowed, action_allowed, created_by, created_on) VALUES
(1,  'SupplierStatements', 'index', 1, NOW()),
(1,  'SupplierStatements', 'pdf',   1, NOW()),
(2,  'SupplierStatements', 'index', 1, NOW()),
(2,  'SupplierStatements', 'pdf',   1, NOW()),
(3,  'SupplierStatements', 'index', 1, NOW()),
(3,  'SupplierStatements', 'pdf',   1, NOW()),
(7,  'SupplierStatements', 'index', 1, NOW()),
(7,  'SupplierStatements', 'pdf',   1, NOW()),
(10, 'SupplierStatements', 'index', 1, NOW()),
(10, 'SupplierStatements', 'pdf',   1, NOW());

SELECT ug.user_group_name, GROUP_CONCAT(ugp.action_allowed ORDER BY ugp.action_allowed) AS actions
  FROM user_groups_perms ugp
  JOIN user_groups ug ON ug.c0d = ugp.user_group_id
 WHERE ugp.controller_allowed = 'SupplierStatements'
 GROUP BY ug.c0d, ug.user_group_name;
