<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: GCS Hierarchy Listing Data Source -->
 <REPORTS_ROW>
  <GUID>82288223EFAF3869E053B46B63588994</GUID>
  <SQL_TEXT>SELECT ghv.HIERARCHY_NAME,
       ghv.DESCRIPTION,
       fev.ENTITY_NAME,
       LEVEL,
       gcr.start_date,
       gcr.end_date,
       decode( gcr.entity_type_code, 
	       &apos;E&apos;, to_number(&apos;&apos;),
               decode( gcr.operassoc_parent_entity_id,
	               to_number(&apos;&apos;), gcr.ownership_percent,
                       decode(gcr.entity_type_code, 
		              &apos;O&apos;,-1,to_number(&apos;&apos;)))) ownership_percent,
       decode( gcr.operassoc_parent_entity_id,
               to_number(&apos;&apos;),to_number(&apos;&apos;), 
               decode(gcr.entity_type_code, 
	              &apos;O&apos;,-1,to_number(&apos;&apos;))) ownership_order,
       gtv.treatment_name,
       gctv.curr_treatment_name,
       gcr.entity_type_name ENTITY_TYPE_NAME,
       gcr.currency_name,
       decode(gcr.entity_type_code,&apos;C&apos;,2,&apos;O&apos;,1,&apos;E&apos;,3) entity_type
  FROM gcs_hierarchies_vl ghv,
       fem_entities_vl fev,
       (select gcr.hierarchy_id,
               gcr.parent_entity_id,
               gcr.child_entity_id,
               treatment_id,
               curr_treatment_id,
               ownership_percent,
               start_date,
               end_date,
               fetv.entity_type_code,
               fetv.entity_type_name ENTITY_TYPE_NAME,
               fcv.name CURRENCY_NAME,
               operassoc.parent_entity_id  operassoc_parent_entity_id
          FROM gcs_cons_relationships gcr,
               fem_entities_attr      fea,
               fem_entity_types_vl    fetv,
               fnd_currencies_vl      fcv,
               gcs_entity_cons_attrs  geca,
               (SELECT	operea.entity_id AS parent_entity_id,
                        operea.dim_attribute_numeric_member AS child_entity_id
                FROM	FEM_ENTITIES_ATTR operea,
                        FEM_DIM_ATTRIBUTES_B operda,
                        FEM_DIM_ATTR_VERSIONS_B oper_dav
                WHERE	operda.attribute_varchar_label = &apos;OPERATING_ENTITY&apos;
                AND	operda.attribute_id = operea.attribute_id
                AND	oper_dav.attribute_id = operda.attribute_id
                AND	oper_dav.default_version_flag = &apos;Y&apos;
                AND	oper_dav.version_id = operea.version_id) operassoc
         WHERE gcr.hierarchy_id = :pHierarchy
           AND gcr.child_entity_id = fea.entity_id
		   AND gcr.actual_ownership_flag = &apos;Y&apos;
           AND fea.attribute_id = :pAttribute
           AND fea.version_id = :pVersion
           AND fea.dim_attribute_varchar_member = fetv.entity_type_code
           AND geca.entity_id = gcr.child_entity_id
           AND geca.hierarchy_id = gcr.hierarchy_id
           AND fcv.currency_code = geca.currency_code
           AND	operassoc.child_entity_id (+)= gcr.child_entity_id
           AND	operassoc.parent_entity_id (+)= gcr.parent_entity_id
        UNION ALL
        SELECT ghv.hierarchy_id,
               null parent_entity_id,
               top_entity_id child_entity_id,
               null treatment_id,
               null curr_treatment_id,
               null ownership_percent,
               start_date,
               null end_date,
               fetv.entity_type_code,
               fetv.entity_type_name ENTITY_TYPE_NAME,
               fcv.name CURRENCY_NAME,
               null  operassoc_parent_entity_id
          FROM gcs_hierarchies_vl    ghv,
               fem_entities_attr     fea,
               fem_entity_types_vl   fetv,
               fnd_currencies_vl     fcv,
               gcs_entity_cons_attrs geca
         WHERE ghv.hierarchy_id = :pHierarchy
           AND fea.entity_id = top_entity_id
           AND fea.attribute_id = :pAttribute
           AND fea.version_id = :pVersion
           AND fea.dim_attribute_varchar_member = fetv.entity_type_code
           AND geca.entity_id = top_entity_id
           AND geca.hierarchy_id = ghv.hierarchy_id
           AND fcv.currency_code = geca.currency_code
        ) gcr,
       gcs_treatments_vl gtv,
       gcs_curr_treatments_vl gctv
 WHERE ghv.hierarchy_id = :pHierarchy
   AND gcr.hierarchy_id = ghv.hierarchy_id
   AND gcr.child_entity_id = fev.entity_id
   AND gcr.treatment_id = gtv.treatment_id(+)
   AND gcr.curr_treatment_id = gctv.curr_treatment_id(+)
 start WITH gcr.child_entity_id = :pXmlFileId
        AND gcr.hierarchy_id = :pHierarchy
        AND :pEffectiveDate BETWEEN gcr.start_date and NVL(gcr.end_date, :pEffectiveDate)
CONNECT BY PRIOR gcr.child_entity_id = gcr.parent_entity_id
       AND gcr.hierarchy_id = :pHierarchy
       AND :pEffectiveDate BETWEEN gcr.start_date and NVL(gcr.end_date, :pEffectiveDate)
ORDER SIBLINGS BY entity_type, ownership_order,fev.ENTITY_NAME
</SQL_TEXT>
  <ENABLED>Y</ENABLED>
  <XDO_APPLICATION_SHORT_NAME>GCS</XDO_APPLICATION_SHORT_NAME>
  <XDO_DATA_SOURCE_CODE>GCS_HIER_LIST_SOURCE</XDO_DATA_SOURCE_CODE>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>GCS Hierarchy Listing Data Source</REPORT_NAME>
    <DESCRIPTION>Application: Financial Consolidation Hub (Obsolete)
Source: 
Short Name: GCS_HIER_LIST_SOURCE
DB package: </DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>BI Publisher</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>:pattribute</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:peffectivedate</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:phierarchy</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:pversion</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:pxmlfileid</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
  </PARAMETER_DEPENDENCIES>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
  <UPLOAD_DEPENDENCIES>
  </UPLOAD_DEPENDENCIES>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
