SET @admin_role_id := (SELECT `id` FROM ohrm_user_role WHERE `name` = 'Admin');  
SET @supervisor_role_id := (SELECT `id` FROM ohrm_user_role WHERE `name` = 'Supervisor');
      
INSERT INTO `ohrm_module` (`name`, `status`) VALUES ('csvExport', 1);  
      
SET @module_id := (SELECT LAST_INSERT_ID());  
      
INSERT INTO ohrm_screen (`name`, `module_id`, `action_url`) VALUES  
('Timesheet Csv Extract', @module_id, 'viewTimesheetCsvExtract');  
      
SET @timesheet_csv_screen_id := (SELECT LAST_INSERT_ID());  
      
SET @parent_menu_id := (SELECT `id` FROM ohrm_menu_item WHERE `menu_title` = 'Timesheets' AND `level` = 2);
      
INSERT INTO ohrm_menu_item (`menu_title`, `screen_id`, `parent_id`, `level`, `order_hint`, `url_extras`, `status`) VALUES  
('Export To CSV', @timesheet_csv_screen_id, @parent_menu_id, 3, 301, '', 1);  
      
INSERT INTO ohrm_user_role_screen (user_role_id, screen_id, can_read, can_create, can_update, can_delete) VALUES  
(@admin_role_id, @timesheet_csv_screen_id, 1, 1, 1, 0),
(@supervisor_role_id, @timesheet_csv_screen_id, 1, 1, 1, 0); 