Lists the Inventory Organizations the current user has data access to — used as the LOV source for an "Inventory Organization" report parameter.
/* Inventory Organization list that a user has access to */
SELECT iodv.organization_name,
iodv.organization_id
FROM fusion.inv_organization_definitions_v iodv
WHERE (iodv.disable_date IS NULL OR iodv.disable_date > sysdate)
AND iodv.inventory_enabled_flag = 'Y'
AND iodv.organization_id IN (
SELECT DISTINCT furda.inv_organization_id
FROM fusion.per_users pu,
fusion.fun_user_role_data_asgnmnts furda
WHERE pu.user_guid = furda.user_guid
AND nvl(furda.active_flag, 'N') = 'Y'
AND sysdate BETWEEN furda.start_date_active AND nvl(furda.end_date_active, sysdate)
AND upper(pu.username) = upper(:xdo_user_name)
)
ORDER BY iodv.organization_name;