<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: CAC Inventory Periods Not Closed or Summarized -->
 <REPORTS_ROW>
  <GUID>A2B9DFE304AE1B00E053BB6B6358DB3B</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>select fav.application_name Functional_Area,
 nvl(gl.short_name, gl.name) Ledger,
 haou2.name Operating_Unit,
 mp.organization_code Org_Code,
 haou.name Organization_Name,
 oap.period_name Period_Name,
 oap.period_num Period_Number,
 oap.period_year Period_Year,
 ml.meaning Inventory_Period_Status,
 fl2.meaning Summarized_Flag,
 -- Revision for version 1.2 and 1.4
 coalesce(
 (select max(hoh.organization_hierarchy_name) organization_hierarchy_name
  from hrfv_organization_hierarchies hoh
  where hoh.organization_hierarchy_name= &apos;&amp;p_hierarchy_name&apos;
  and (mp.organization_id = hoh.child_organization_id or mp.organization_id = hoh.parent_organization_id)
 ),
 (select max(hoh.organization_hierarchy_name) organization_hierarchy_name
  from hrfv_organization_hierarchies hoh
  where regexp_like(hoh.organization_hierarchy_name,&apos;&amp;p_name_open|&amp;p_name_close|&amp;p_name_period&apos;,&apos;i&apos;)
  and (mp.organization_id = hoh.child_organization_id or mp.organization_id = hoh.parent_organization_id)
 )
  ) Hierarchy_Name
from org_acct_periods oap,
 mtl_parameters mp,
 mfg_lookups ml,
 hr_organization_information hoi,
 hr_all_organization_units_vl haou,
 hr_all_organization_units_vl haou2,
 gl_ledgers gl,
 -- Revision for version 1.3
 fnd_application_vl fav,
 fnd_lookups fl2
where mp.organization_id = oap.organization_id
-- ===================================================================
-- Show accounting periods which are open
-- ===================================================================
-- Report Option Logic
-- If from an upgrade, the original R11i period close rows were never
-- upgraded after Oracle put in the summarization feature (in 11.5.10)
-- So earlier periods which existed before summarization have a null value
and (oap.open_flag = &apos;Y&apos;
  or 
  nvl(oap.summarized_flag,&apos;Y&apos;) = &apos;N&apos;
 )
and fl2.lookup_type             = &apos;YES_NO&apos;
and fl2.lookup_code             = nvl(oap.summarized_flag, &apos;N&apos;)
and ml.lookup_type              = &apos;MTL_ACCT_PERIOD_STATUS&apos;
and ml.lookup_code              = 
  decode((oap.open_flag||&apos;-&apos;||nvl(oap.summarized_flag,&apos;N&apos;)),
   &apos;N&apos;||&apos;-&apos;||&apos;N&apos;, 65, -- Closed not Summarized
   &apos;N&apos;||&apos;-&apos;||&apos;Y&apos;, 66, -- Closed
   &apos;P&apos;||&apos;-&apos;||&apos;N&apos;,  2, -- Processing
   &apos;P&apos;||&apos;-&apos;||&apos;Y&apos;,  2, -- Processing
   &apos;Y&apos;||&apos;-&apos;||&apos;N&apos;,  3, -- Open
   &apos;Y&apos;||&apos;-&apos;||&apos;Y&apos;,  3, -- Open
   &apos;N&apos;||&apos;-&apos;||&apos;E&apos;,  4, -- Error
   &apos;Y&apos;||&apos;-&apos;||&apos;E&apos;,  4, -- Error
   3)
-- Revision for version 1.3
and fav.application_id          = 401 -- Inventory
-- ===================================================================
-- Using base tables to avoid org_organization_definitions and
-- hr_operating_units
-- ===================================================================
and hoi.org_information_context = &apos;Accounting Information&apos;
and hoi.organization_id         = mp.organization_id
and hoi.organization_id         = haou.organization_id -- this gets the organization name
and haou2.organization_id       = to_number(hoi.org_information3) -- this gets the operating unit id
-- avoid selecting disabled inventory organizations
and sysdate                     &lt; nvl(haou.date_to, sysdate + 1)
and gl.ledger_id                = to_number(hoi.org_information1) -- this gets the ledger id
and mp.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id)
and gl.ledger_id in (select nvl(glsnav.ledger_id,gasna.ledger_id) from gl_access_set_norm_assign gasna, gl_ledger_set_norm_assign_v glsnav where gasna.access_set_id=fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;) and gasna.ledger_id=glsnav.ledger_set_id(+))
and haou2.organization_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
and 1=1                                                                                                   -- p_ledger, p_operating_unit, p_org_code
-- ===================================================================
-- avoid selecting item master orgs
and mp.master_organization_id  &lt;&gt; mp.organization_id
order by
 fav.application_name, -- Functional Area
 nvl(gl.short_name, gl.name), -- Ledger
 haou2.name, -- Operating Unit
 mp.organization_code, -- Org Code
 oap.period_year asc, -- Period Year
 oap.period_num asc, -- Period Number
 oap.period_name -- Period Name</SQL_TEXT>
  <VERSION_COMMENTS>Added operating unit security</VERSION_COMMENTS>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>CAC Inventory Periods Not Closed or Summarized</REPORT_NAME>
    <DESCRIPTION>Report to find all inventory accounting periods which are either still open or closed but not summarized.  When you close the inventory accounting period, the Period Close Reconciliation Report creates a very useful month-end summary of your inventory quantities and balances, by item, subinventory or intransit, cost group and inventory organization.  You can use this information to create a efficient month-end inventory value report.
Note:  this report automatically looks for hierarchies which might be used with the Open Period Control and the Close Period Control Oracle programs.  Looking for the translated values of &quot;Close&quot;, &quot;Open&quot; and &quot;Period&quot; in the Hierarchy Name.

/* +=============================================================================+
-- | Copyright 2018 - 2020 Douglas Volz Consulting, Inc.                         |
-- | All rights reserved.                                                        |
-- | Permission to use this code is granted provided the original author is      |
-- | acknowledged. No warranties, express or otherwise is included in this       |
-- | permission.                                                                 |
-- +=============================================================================+
-- |
-- |  Original Author: Douglas Volz (doug@volzconsulting.com)
-- |
-- |  Program Name:  xxx_inv_periods_not_closed_rept.sql
-- |
-- |  Parameters:
-- |  p_org_hierarchy_name   -- select the organization hierarchy used to open and
-- |                            close your inventory organizations (optional)
-- |  p_org_code         -- Specific inventory organization you wish to report (optional)
-- |  p_operating_unit   -- Operating Unit you wish to report, leave blank for all
-- |                        operating units (optional) 
-- |  p_ledger           -- general ledger you wish to report, leave blank for all
-- |                        ledgers (optional)
-- |
-- |  Description:
-- |  Report to find all inventory accounting periods which are either still open,
-- |  or closed but not summarized.  When you close the inventory accounting period,
-- |  the Period Close Reconciliation Report creates a very useful month-end
-- |  summary of your inventory quantities and balances, by item, subinventory or
-- |  intransit, cost group and inventory organization.  You can use this 
-- |  information to create a efficient month-end inventory value report.
-- | 
-- |  History for xxx_inv_periods_not_closed_rept.sql
-- |
-- |  Version Modified on Modified  by    Description
-- |  ======= =========== =============== =========================================
-- |  1.0     06 Dec 2018 Douglas Volz    Report created based on Period Status Report
-- |  1.1     09 Feb 2020 Douglas Volz    Added Org, Ledger and Operating Unit parameters
-- |  1.2     08 Mar 2020 Douglas Volz    Improvements to finding the Hierarchy Name,
-- |                                      looking for the words Open, Close or Period.
-- |  1.3     27 Apr 2020 Douglas Volz    Changed to multi-language views for the
-- |                                      inventory orgs and operating units.
-- |  1.4     16 Aug 2020 Douglas Volz    Fix for revision 1.2 for Organization Hierarchy.
-- +=============================================================================+*/
</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_hierarchy_name</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_name_close</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_name_open</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_name_period</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>-30</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_name_close</ANCHOR>
    <SQL_TEXT>select fl_close.meaning
from fnd_lookups fl_close
where fl_close.lookup_type = &apos;CLN_OPEN_CLOSE&apos;
and fl_close.lookup_code = &apos;N&apos;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>an arbitrary value</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Lookup Value for Close</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>-20</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_name_open</ANCHOR>
    <SQL_TEXT>select fl_open.meaning
from fnd_lookups fl_open
where fl_open.lookup_type = &apos;CLN_OPEN_CLOSE&apos;
and fl_open.lookup_code = &apos;Y&apos;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>an arbitrary value</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Lookup Value for Open</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>-10</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_name_period</ANCHOR>
    <SQL_TEXT>select fl_period.meaning
from fnd_lookups fl_period
where fl_period.lookup_type = &apos;MTH_ENT_PERIOD_OF_USAGE&apos;
and fl_period.lookup_code = &apos;PERIOD&apos;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>an arbitrary value</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Lookup Value for Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_org_hierarchy_name</ANCHOR>
    <SQL_TEXT>&lt;parameter_value&gt;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>HR Hierarchy Name</LOV_NAME>
    <LOV_GUID>A6A156EB170F798DE053BB6B635840AB</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
pos.name value,
pbg.name description
from
per_organization_structures pos,
per_business_groups pbg
where
pos.business_group_id=pbg.business_group_id(+)
order by
pos.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Hierarchy Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>mp.organization_code = :p_org_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ood.organization_code value,
ood.organization_name description
from
org_organization_definitions ood
where
ood.organization_id not in (select mp.organization_id from mtl_parameters mp where mp.organization_id=mp.master_organization_id) and
ood.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id) and
(:$flex$.operating_unit is null or ood.operating_unit in (select haouv.organization_id from hr_all_organization_units_vl haouv where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos;)) and
(:$flex$.ledger is null or ood.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
nvl(ood.disable_date,sysdate)&gt;=sysdate
order by
ood.organization_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select mp.organization_code from mtl_parameters mp where mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haou2.name = :p_operating_unit</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>HR Operating Unit</LOV_NAME>
    <LOV_GUID>8E2FF36EDEB979D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
(:$flex$.ledger is null or hou.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hou.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;OU&apos;)
order by
hou.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gl.name = :p_ledger</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Ledger</LOV_NAME>
    <LOV_GUID>8E2FF36EDEB879D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||decode(gl.ledger_category_code,&apos;NONE&apos;,xxen_util.meaning(gl.object_type_code,&apos;LEDGERS&apos;,101),xxen_util.meaning(gl.ledger_category_code,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101))||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
(:$flex$.ledger_category is null or gl.ledger_category_code=xxen_util.lookup_code(:$flex$.ledger_category,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101,&apos;Y&apos;)) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.ledger_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;LEDGER&apos;) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
decode(gl.ledger_category_code,&apos;PRIMARY&apos;,1,&apos;SECONDARY&apos;,2,&apos;ALC&apos;,3,&apos;NONE&apos;,4),
gl.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
