SET @taxExemptionsDataGroupId := (SELECT `id` FROM `ohrm_data_group` WHERE `name` = 'taxExemptionsDataGroupId');
SET @tax_attachmentDataGroupId := (SELECT `id` FROM `ohrm_data_group` WHERE `name` = 'tax_attachment');
SET @tax_custom_fieldsDataGroupId := (SELECT `id` FROM `ohrm_data_group` WHERE `name` = 'tax_custom_fields');

SET @pimModuleId := (SELECT `id` FROM `ohrm_module` WHERE `name` = 'pim');

SET @leftMenuScreenId := (SELECT id FROM ohrm_screen
    WHERE action_url = 'viewUsTaxExemptions' AND module_id = @pimModuleId);
INSERT INTO `ohrm_menu_item` (`menu_title`,`menu_category`, `screen_id`,
`order_hint`, `status`) VALUES
('Tax Exemptions', 'pim_left_menu', @leftMenuScreenId, 75, IFNULL((select value from ohrm_config where property = 'pim_show_tax_exemptions'), 0));
SET @leftMenuItemId := (SELECT LAST_INSERT_ID());
INSERT INTO `ohrm_menu_item_data_group` (`menu_item_id`, `data_group_id`) VALUES
(@leftMenuItemId, @taxExemptionsDataGroupId),
(@leftMenuItemId, @tax_attachmentDataGroupId),
(@leftMenuItemId, @tax_custom_fieldsDataGroupId);