<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>
<LOVS>
<!-- loader xml for Enginatics Blitz Report lov: AP Supplier -->
 <LOVS_ROW>
  <GUID>B9847D20A0E4742FE0538931640A6379</GUID>
  <LOV_NAME>AP Supplier</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <FILTER_BEFORE_DISPLAY>Y</FILTER_BEFORE_DISPLAY>
  <LOV_QUERY>select
aps.vendor_name value,
aps.segment1 description
from
ap_suppliers aps
where
(:$flex$.operating_unit is null or aps.vendor_id in (select assa.vendor_id from hr_all_organization_units_vl haouv, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos; and haouv.organization_id=assa.org_id)) and
(:$flex$.organization_code is null or aps.vendor_id in (select assa.vendor_id from org_organization_definitions ood, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.organization_code,ood.organization_code)=&apos;Y&apos; and ood.operating_unit=assa.org_id))
order by
aps.vendor_name,
aps.vendor_id</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: GL Chart of Accounts (inv org restricted) -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEC579D2E0530100007F1FF2</GUID>
  <LOV_NAME>GL Chart of Accounts (inv org restricted)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
fifsv.id_flex_structure_name value,
fifsv.id_flex_structure_code description
from
fnd_id_flex_structures_vl fifsv
where
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101 and
fifsv.id_flex_num in (select ood.chart_of_accounts_id from org_organization_definitions ood where nvl(ood.disable_date,sysdate)&gt;=sysdate) and
fifsv.id_flex_num in (select oav.chart_of_accounts_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id)
order by
fifsv.id_flex_structure_name</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>مخطط الحسابات المتعلق بمؤسسات المخزون المعينة لمسؤولية تسجيل الدخول الحالية</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Kontenplan für Inventarorganisationen, die der aktuellen Anmeldeverantwortung zugeordnet sind</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Plan de cuentas relacionado con las organizaciones de inventario asignadas a la responsabilidad de inicio de sesión actual</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Plan comptable relatif aux organismes d&apos;inventaire affectés à la responsabilité de la connexion actuelle</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Piano dei conti relativo alle organizzazioni di inventario assegnate alla responsabilità di login corrente</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>現在のログイン責任者に割り当てられた在庫組織に関連する勘定科目一覧表</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>현재 로그인 권한에 지정된 재고 조직과 관련된 계정과 목표</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Plano de contas relacionado às organizações de inventário atribuídas à responsabilidade de login atual</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>План счетов, относящихся к инвентаризационным организациям, на которые возложена ответственность за текущий вход в систему</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Kontokarta relaterade till lagerorganisationer som tilldelats det nuvarande inloggningsansvaret</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Mevcut oturum açma sorumluluğuna atanan envanter organizasyonlarıyla ilgili hesap planı</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Chart of accounts related to inventory organizations assigned to the current login responsibility</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>与分配给当前登录责任的清单组织有关的账户表</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: GL Ledger -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEB879D2E0530100007F1FF2</GUID>
  <LOV_NAME>GL Ledger</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>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 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
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>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>دفاتر الأستاذ المقيدة بمجموعة الوصول ، المحددة بواسطة قيمة الملف الشخصي &quot;مجموعة الوصول إلى بيانات GL&quot; لمسؤولية تسجيل الدخول الحالية</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Ledger, die durch das Zugriffsset eingeschränkt sind, definiert durch den Profilwert &apos;GL Data Access Set&apos; der aktuellen Anmeldeverantwortung</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Libros restringidos por el conjunto de acceso, definido por el valor del perfil &quot;Conjunto de acceso a datos GL&quot; de la responsabilidad de inicio de sesión actual</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Grands livres limités par un ensemble d&apos;accès, défini par la valeur du profil &quot;GL Data Access Set&quot; de la responsabilité de connexion actuelle</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Libri mastri limitati dal set di accesso, definito dal valore del profilo &apos;GL Data Access Set&apos; della responsabilità di login corrente</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>現在のログイン責任者のプロファイル値&apos;GL Data Access Set&apos;によって定義されたアクセスセットによって制限された元帳</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>현재 로그인 권한의 프로파일 값 &apos;GL 데이터 액세스 세트&apos;로 정의 된 액세스 세트로 제한되는 원장</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Ledgers restritos pelo conjunto de acesso, definido pelo valor do perfil &apos;GL Data Access Set&apos; da atual responsabilidade de login</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Леджеры, ограниченные набором доступа, определяемые значением профиля &quot;GL Data Access Set&quot; текущей ответственности за вход в систему</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Ledgers begränsade av åtkomstuppsättning, definierade av profilvärde &apos;GL Data Access Set&apos; för det aktuella inloggningsansvaret</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Mevcut oturum açma sorumluluğunun profil değeri &apos;GL Veri Erişim Kümesi&apos; ile tanımlanan erişim kümesiyle kısıtlanmış defterler</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Ledgers restricted by access set, defined by profile value &apos;GL Data Access Set&apos; of the current login responsibility</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>由访问集限制的分类账，由当前登录责任的配置文件值 &quot;GL数据访问集 &quot;定义。</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: HR Operating Unit -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEB979D2E0530100007F1FF2</GUID>
  <LOV_NAME>HR Operating Unit</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>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 mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
hou.name</LOV_QUERY>
  <VERSION_COMMENTS>Fixed where clause duplication</VERSION_COMMENTS>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>وحدة التشغيل مقيدة بالتحكم في الوصول متعدد المنظمات (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Bedieneinheit eingeschränkt durch Multi Org Access Control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Unidad operativa restringida por el control de acceso multiorgánico (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Unité opérationnelle restreinte par un contrôle d&apos;accès multi-organismes (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Unità operativa limitata dal controllo di accesso multiorgano (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>多機関アクセス制御(MOAC)で制限された操作ユニット</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>다중 조직 액세스 제어 (MOAC)에 의해 제한되는 운영 단위</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Unidade operacional restrita por controle de acesso multi org (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Операционное устройство, ограниченное мультиорганизованным контролем доступа (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Styrenhet begränsad av multi-org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Çoklu kuruluş erişim kontrolü (MOAC) tarafından kısıtlanan işletim birimi</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Operating unit restricted by multi org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>受多机构访问控制（MOAC）限制的操作单元。</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: INV Category Set -->
 <LOVS_ROW>
  <GUID>8E2FF36EDECA79D2E0530100007F1FF2</GUID>
  <LOV_NAME>INV Category Set</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: INV Item (master, costing enabled only) -->
 <LOVS_ROW>
  <GUID>91D022B15B12FFB9E053BB6B63587F0B</GUID>
  <LOV_NAME>INV Item (master, costing enabled only)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <FILTER_BEFORE_DISPLAY>Y</FILTER_BEFORE_DISPLAY>
  <LOV_QUERY>select
msiv.concatenated_segments value,
msiv.description
from
mtl_system_items_vl msiv
where
msiv.organization_id=(
select
max(mp.master_organization_id) master_organization_id
from
mtl_parameters mp
where
mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) or
fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) is null 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
msiv.costing_enabled_flag=&apos;Y&apos;
order by
msiv.concatenated_segments</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>All costing enabled items from item master org</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
</LOVS>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: CAC Receiving Expense Value (Period-End) -->
 <REPORTS_ROW>
  <GUID>37075861B99D2E68E0630100007FB744</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>with orgs_and_period as
-- Get the list of organizations, ledgers and operating units for Discrete and OPM organizations
        (select nvl(gl.short_name, gl.name) ledger,
                gl.ledger_id,
                to_number(hoi.org_information2) legal_entity_id,
                haou2.name operating_unit,
                haou2.organization_id operating_unit_id,
                gps.period_name,
                gps.end_date,
                haou.name organization_name,
                mp.organization_code,
                mp.organization_id,
                nvl(mp.process_enabled_flag, &apos;N&apos;) process_enabled_flag,
                haou.date_to disable_date,
                gl.currency_code
         from   mtl_parameters mp,
                hr_organization_information hoi,
                hr_all_organization_units_vl haou, -- inv_organization_id
                hr_all_organization_units_vl haou2, -- operating unit
                gl_ledgers gl,
                gl_period_statuses gps
         -- Avoid disabled inventory organizations
         where  sysdate                        &lt;  nvl(haou.date_to, sysdate +1)
         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
         and    gl.ledger_id                    = to_number(hoi.org_information1) -- get the ledger_id
         and    gps.ledger_id                   = gl.ledger_id
         and    gps.application_id              = 201 -- PO
         and    mp.organization_code in (select oav.organization_code from org_access_view oav where  oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id) 
         and    1=1                             -- p_operating_unit, p_ledger
         and    2=2                             -- p_period_name
         and    3=3                             -- p_org_code
         -- Revision for Operating Unit and Ledger Controls and Parameters
         and    (nvl(fnd_profile.value(&apos;XXEN_REPORT_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos; or 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    (nvl(fnd_profile.value(&apos;XXEN_REPORT_USE_OPERATING_UNIT_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos; or 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))
         group by
                nvl(gl.short_name, gl.name),
                gl.ledger_id,
                to_number(hoi.org_information2),
                haou2.name, -- operating_unit
                haou2.organization_id, -- operating_unit_id
                gps.period_name,
                gps.end_date,
                haou.name,
                mp.organization_code,
                mp.organization_id,
                nvl(mp.process_enabled_flag, &apos;N&apos;), -- process_enabled_flag
                haou.date_to,
                gl.currency_code
        ) -- orgs_and_period

--------------- main sql starts here -----------------------

select  op.ledger Ledger,
-- ==================================================================
-- This statement works using inline table queries with a union all
-- on the inside inline queries wrapped by an &quot;outside&quot; inline query
-- in order to produce a single row per item.
-- ==================================================================
        op.operating_unit Operating_Unit,
        op.organization_code Org_Code,
        op.organization_name Organization_Name,
        op.period_name Period_name,
        -- End revision for version 1.8
        &amp;segment_columns
        pov.vendor_name Supplier,
        he.full_name Buyer,
        msiv.concatenated_segments Item_Number,
        nvl(msiv.description,net_rcv.item_description) Item_Description,
&amp;category_columns
        pl.displayed_field Destination_Type,
        net_rcv.po_number PO_Number,
        net_rcv.po_line_num PO_Line,
        net_rcv.release_num PO_Release,
        pp.name Project_Number,
        (select max(prh.segment1)
         from   apps.po_requisition_headers_all prh,
                apps.po_requisition_lines_all prl
         where  prh.requisition_header_id = prl.requisition_header_id
         and    prl.line_location_id      = net_rcv.po_line_location_id) Requisition_Number,
        (select max(he.full_name)
         from   apps.po_requisition_headers_all prh,
                apps.po_requisition_lines_all prl,
                apps.hr_employees he
         where  prh.requisition_header_id = prl.requisition_header_id
         and    prl.line_location_id      = net_rcv.po_line_location_id
         and    prh.preparer_id           = he.employee_id) Requestor,
        (select max(he.email_address)
         from   apps.po_requisition_headers_all prh,
                apps.po_requisition_lines_all prl,
                apps.hr_employees he
         where  prh.requisition_header_id = prl.requisition_header_id
         and    prl.line_location_id      = net_rcv.po_line_location_id
         and    prh.preparer_id           = he.employee_id) Requestor_Email,
        net_rcv.receipt_num Receipt_Number,
        net_rcv.transaction_date Receipt_Date,
        case 
         when (sysdate - net_rcv.transaction_date) &lt; 31  then &apos;30 days&apos;
         when (sysdate - net_rcv.transaction_date) &lt; 61  then &apos;60 days&apos;
         when (sysdate - net_rcv.transaction_date) &lt; 91  then &apos;90 days&apos;
         when (sysdate - net_rcv.transaction_date) &lt; 121 then &apos;120 days&apos;
         when (sysdate - net_rcv.transaction_date) &lt; 151 then &apos;150 days&apos;
         when (sysdate - net_rcv.transaction_date) &lt; 181 then &apos;180 days&apos;
         else &apos;Over 180 days&apos;
        end Aging_Date,
-- ==========================================================
-- Select the onhand quantities and values
-- from the Part 3 condensing to one row per item and org
-- ==========================================================
        net_rcv.unit_of_measure Transaction_UOM,
        sum(net_rcv.quantity) Onhand_Quantity,
        -- Revision for version 1.8
        op.currency_code Currency_Code,
        sum(net_rcv.amount) Onhand_Value
from    -- Revision for version 1.8
        orgs_and_period op,
        mtl_system_items_vl msiv,
        rcv_parameters rp,
        po_vendors pov,
        hr_employees he,
        pa_projects_all pp,
        po_lookup_codes pl,
        gl_code_combinations_kfv gcc1,
        gl_code_combinations_kfv gcc2,
        -- ==================================
        -- Get receiving quantities and value
        -- ==================================
        -- ================================================
        -- part 3
        -- Condense the Union down to individual Org/Items
        -- ================================================
        (select all_rcv.organization_id,
                all_rcv.inventory_item_id,
                all_rcv.destination_type_code,
                all_rcv.item_description,
                all_rcv.po_number,
                all_rcv.po_line_num,
                all_rcv.vendor_id,
                all_rcv.agent_id,
                all_rcv.po_header_id,
                all_rcv.po_line_id,
                all_rcv.po_line_location_id,
                all_rcv.release_num,
                all_rcv.project_id,
                all_rcv.receipt_num,
                all_rcv.charge_account_id,
                min(trunc(all_rcv.transaction_date)) transaction_date,
                all_rcv.unit_of_measure,
                sum(nvl(all_rcv.quantity,0)) quantity,
                sum(nvl(all_rcv.amount,0)) amount
         from   (
                 -- ===================================
                     -- =============================================================
                     -- part 2
                     -- get the onhand receiving quantities for Expense destinations
                     -- =============================================================
                 select &apos;Onhand Section&apos;, -- section
                        rrvv.organization_id,
                        rrvv.inventory_item_id,
                        rrvv.item_description,
                        rrvv.destination_type_code,
                        rrvv.po_number,
                        rrvv.po_line_num,
                        rrvv.vendor_id,
                        rrvv.agent_id,
                        rrvv.po_header_id,
                        rrvv.po_line_id,
                        rrvv.po_line_location_id,
                        rrvv.release_num,
                        rrvv.project_id,
                        rrvv.po_distribution_id,
                        rrvv.receipt_num,
                        rrvv.transaction_date,
                        rrvv.charge_account_id,
                        rrvv.unit_of_measure,
                        rrvv.source_document_code,
                        rrvv.deliver_to_location_id,
                        rrvv.source_document,
                        rrvv.document_line_num,
                        rrvv.actual_price,
                        sum(rrvv.primary_quantity) quantity,
                        sum(round(rrvv.amount,2)) amount,
                        rrvv.shipment_num,
                        rrvv.rcv_transaction_id
                 from   (select rs.to_organization_id organization_id,
                                rs.item_id inventory_item_id,
                                pl.item_description, 
                                rs.destination_type_code,
                                ph.segment1 po_number,
                                pl.line_num po_line_num,
                                ph.vendor_id, 
                                ph.agent_id,
                                rs.po_header_id,
                                rs.po_line_id,
                                rs.po_line_location_id,
                                pr.release_num,
                                pd.project_id,
                                pd.po_distribution_id,
                                rsh.receipt_num,
                                rt.transaction_date,
                                pd.code_combination_id charge_account_id,
                                rs.unit_of_measure,
                                rsl.source_document_code,
                                decode(rsl.source_document_code, 
                                       &apos;INV&apos;, rsl.deliver_to_location_id, 
                                       &apos;PO&apos;, pd.deliver_to_location_id,
                                       &apos;REQ&apos;, prl.deliver_to_location_id) deliver_to_location_id, 
                                decode(rsl.source_document_code,
                                       &apos;INV&apos;, rsh.shipment_num, 
                                       &apos;PO&apos;, ph.segment1, 
                                       &apos;REQ&apos;, prh.segment1) source_document, 
                                decode(rsl.source_document_code,
                                       &apos;INV&apos;, rsl.line_num, 
                                       &apos;PO&apos;, pl.line_num,
                                       &apos;REQ&apos;, prl.line_num) document_line_num, 
                                decode(rsl.source_document_code,
                                       &apos;INV&apos;, (rsl.shipment_unit_price * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity),
                                       -- Revision for version 1.8
                                       -- &apos;PO&apos;, (pll.price_override *bnvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity),
                                       &apos;PO&apos;, ((pll.price_override * nvl(ph.rate,1))
                                               + decode(nvl(pd.nonrecoverable_tax,0), 0, 0, pd.nonrecoverable_tax / pd.quantity_ordered * nvl(ph.rate,1)))
                                             * (rt.source_doc_quantity/rt.primary_quantity),
                                       -- End revision for version 1.8
                                       -- Add in non recoverable tax amounts
                                       &apos;REQ&apos;, prl.unit_price * (rt.source_doc_quantity / rt.primary_quantity)) actual_price, 
                                sum(rs.to_org_primary_quantity) primary_quantity,
                                decode(rsl.source_document_code,
                                       &apos;INV&apos;, (rsl.shipment_unit_price * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity),
                                       -- Revision for version 1.8
                                       -- Add in non recoverable tax amounts
                                       -- &apos;PO&apos;, (pll.price_override * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity),
                                       &apos;PO&apos;, ((pll.price_override * nvl(ph.rate,1))
                                               + decode(nvl(pd.nonrecoverable_tax,0), 0, 0, pd.nonrecoverable_tax / pd.quantity_ordered * nvl(ph.rate,1)))
                                             * (rt.source_doc_quantity/rt.primary_quantity),
                                       -- End revision for version 1.8
                                       &apos;REQ&apos;, prl.unit_price * (rt.source_doc_quantity / rt.primary_quantity))
                                       * sum(rs.to_org_primary_quantity) amount,
                                rsh.shipment_num shipment_num, 
                                rs.rcv_transaction_id
                         from   mtl_supply rs,
                                rcv_shipment_headers rsh, 
                                rcv_shipment_lines rsl, 
                                po_headers_all ph, 
                                po_lines_all pl, 
                                po_line_locations_all pll, 
                                po_distributions_all pd, 
                                po_requisition_headers_all prh, 
                                po_requisition_lines_all prl,
                                rcv_transactions rt,
                                po_releases_all pr,
                                -- Revision for version 1.8
                                orgs_and_period op
                         where  rsh.shipment_header_id        = rs.shipment_header_id
                         and    rsl.shipment_line_id          = rs.shipment_line_id
                         and    ph.po_header_id (+)           = rs.po_header_id
                         and    pl.po_line_id (+)             = rs.po_line_id
                         and    pll.line_location_id (+)      = rs.po_line_location_id
                         and    pd.po_distribution_id (+)     = rs.po_distribution_id
                         and    prh.requisition_header_id (+) = rs.req_header_id
                         and    prl.requisition_line_id (+)   = rs.req_line_id
                         and    pr.po_release_id (+)          = rs.po_release_id
                         and    rs.rcv_transaction_id         = rt.transaction_id
                         and    rs.destination_type_code      = &apos;EXPENSE&apos;
                         and    pd.destination_type_code      = &apos;EXPENSE&apos;
                         and    rs.supply_type_code           = &apos;RECEIVING&apos;
                         -- Revision for version 1.8
                         and    rs.to_organization_id          = op.organization_id
                         group by
                                rs.to_organization_id,
                                rs.item_id, 
                                pl.item_description,
                                rs.destination_type_code,
                                ph.segment1,
                                pl.line_num,
                                ph.vendor_id,
                                ph.agent_id,
                                rs.po_header_id,
                                rs.po_line_id,
                                rs.po_line_location_id,
                                pr.release_num,
                                pd.project_id,
                                pd.po_distribution_id,
                                rsh.receipt_num, 
                                rt.transaction_date,
                                pd.code_combination_id,
                                rs.unit_of_measure, 
                                rsh.shipment_num, 
                                rsl.source_document_code, 
                                decode(rsl.source_document_code, &apos;INV&apos;, rsl.deliver_to_location_id, 
                                                                 &apos;PO&apos;, pd.deliver_to_location_id,
                                                                 &apos;REQ&apos;, prl.deliver_to_location_id), 
                                decode(rsl.source_document_code, &apos;INV&apos;, rsh.shipment_num, 
                                                                 &apos;PO&apos;, ph.segment1, 
                                                                 &apos;REQ&apos;, prh.segment1), 
                                decode(rsl.source_document_code, &apos;INV&apos;, rsl.line_num, 
                                                                 &apos;PO&apos;, pl.line_num,
                                                                 &apos;REQ&apos;, prl.line_num), 
                                decode(rsl.source_document_code, &apos;INV&apos;, (rsl.shipment_unit_price * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity), 
                                                                 -- Revision for version 1.8
                                                                 -- &apos;PO&apos;, (pll.price_override *nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity),
                                                                 &apos;PO&apos;, ((pll.price_override * nvl(ph.rate,1)) + decode(nvl(pd.nonrecoverable_tax,0), 0, 0, pd.nonrecoverable_tax / pd.quantity_ordered * nvl(ph.rate,1)))
                                                                 * (rt.source_doc_quantity/rt.primary_quantity),
                                                                 -- End revision for version 1.8
                                                                 &apos;REQ&apos;, prl.unit_price * (rt.source_doc_quantity / rt.primary_quantity)), 
                                rsh.shipment_num,  
                                rs.rcv_transaction_id) rrvv
                 group by
                        &apos;Onhand Section&apos;, -- section
                        rrvv.organization_id,
                        rrvv.inventory_item_id,
                        rrvv.item_description,
                        rrvv.destination_type_code,
                        rrvv.po_number,
                        rrvv.po_line_num,
                        rrvv.vendor_id,
                        rrvv.agent_id,
                        rrvv.po_header_id,
                        rrvv.po_line_id,
                        rrvv.po_line_location_id,
                        rrvv.release_num,
                        rrvv.project_id,
                        rrvv.po_distribution_id,
                        rrvv.receipt_num,
                        rrvv.transaction_date,
                        rrvv.charge_account_id,
                        rrvv.unit_of_measure,
                        rrvv.source_document_code,
                        rrvv.deliver_to_location_id,
                        rrvv.source_document,
                        rrvv.document_line_num,
                        rrvv.actual_price,
                        rrvv.shipment_num, 
                        rrvv.rcv_transaction_id
                 union all
                      -- =============================================================            
                     -- Part 1
                     -- Sum up all the post close rcv&apos;g transactions by item and org
                     -- The SIGN of the quantities and amounts have been reversed
                     -- =============================================================            
                 select &apos;Section 1.1 Post Close&apos; section,
                        rt.organization_id,
                        rsl.item_id inventory_item_id, 
                        pl.item_description,
                        pd.destination_type_code,
                        ph.segment1 po_number,
                        pl.line_num po_line_num,
                        ph.vendor_id,               
                        ph.agent_id,
                        rt.po_header_id,
                        rt.po_line_id,
                        rt.po_line_location_id,
                        pr.release_num,
                        pd.project_id,
                        pd.po_distribution_id,        
                        rsh.receipt_num,
                        rt.transaction_date,
                        pd.code_combination_id charge_account_id,
                        rt.unit_of_measure,
                        rsl.source_document_code, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.deliver_to_location_id, 
                                                         &apos;PO&apos;, pd.deliver_to_location_id) deliver_to_location_id, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsh.shipment_num, 
                                                         &apos;PO&apos;, ph.segment1) source_document, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.line_num, 
                                                         &apos;PO&apos;, pl.line_num) document_line_num, 
                        decode(rsl.source_document_code, &apos;INV&apos;, (rsl.shipment_unit_price * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity),
                                                         -- Revision for version 1.8
                                                         -- &apos;PO&apos;, (pll.price_override *nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity)) actual_price,
                                                         &apos;PO&apos;, ((pll.price_override *nvl(ph.rate,1)) + decode(nvl(pd.nonrecoverable_tax,0), 0, 0, pd.nonrecoverable_tax / pd.quantity_ordered * nvl(ph.rate,1)))
                                                         * (rt.source_doc_quantity/rt.primary_quantity)) actual_price,
                                                         -- End revision for version 1.8
                        -- Revert back to version 1.3, rrsl.source_doc_quantity not accurate on CORRECT transaction types
                        -- invert the SIGN as we will subtract away these quantities, based
                        -- upon the SIGN of the net amount of the accounting entry
                        -- sum(abs(nvl(rt.primary_quantity,0)) * decode(sign(nvl(rrsl.accounted_dr,0) - nvl(rrsl.accounted_cr,0)), -1, 1, -1)) quantity,
                        -- sum(round(-1*(nvl(rrsl.accounted_dr,0) - nvl(rrsl.accounted_cr,0)),2)) amount,
                        abs(nvl(rt.primary_quantity,0)) * decode(sign(rrsl.amount), -1, 1, -1) quantity,
                        rrsl.amount * -1 amount,
                        rsh.shipment_num, 
                        rt.transaction_id rcv_transaction_id
                 from   rcv_transactions rt,
                        po_headers_all ph,
                        po_lines_all pl,
                        po_line_locations_all pll,
                        rcv_shipment_headers rsh,
                        rcv_shipment_lines rsl,
                        po_releases_all pr,
                        po_distributions_all pd,
                        rcv_parameters rp,
                        po_system_parameters_all psp,
                        -- Revision for version 1.8
                        -- org_acct_periods oap,
                        orgs_and_period op,
                        -- End revision for version 1.8
                        -- ==========================================================================
                        -- mtl_supply does not store split expense receipts by multiple PO_DISTRIBUTION_IDs
                        -- and will only store one of the PO distributions for a given receipt or receiving txn id.
                        -- You can only see the split PO distributions in rcv_receiving_sub_ledger since
                        -- rcv_transactions, rcv_shipment_lines has a null po_distribution_id, but rcv_receiving_sub_ledger
                        -- may have multiple lines for each rcv_transaction_id.  And since we are trying to 
                        -- recreate a prior state in mtl_supply, we have to emulate this, and subtract  
                        -- the rcv_transaction amounts and quantities by the same po_distribution_id.  The
                        -- assumption is that mtl_supply will have the max(po_distribution_id) from rrsl.
                        -- ==========================================================================
                        (select max(to_number(rrsl.reference3)) po_distribution_id,
                                rrsl.rcv_transaction_id rcv_transaction_id,
                                rrsl.code_combination_id code_combination_id,
                                sum(round((nvl(rrsl.accounted_dr,0) - nvl(rrsl.accounted_cr,0)),2)) amount
                         from   rcv_receiving_sub_ledger rrsl,
                                rcv_transactions rt,
                                -- Revision for version 1.8
                                -- org_acct_periods oap
                                org_organization_definitions ood,
                                gl_period_statuses gps
                                -- End revision for version 1.8
                         where  rrsl.rcv_transaction_id       = rt.transaction_id
                         -- Revision for version 1.8
                         -- and    trunc(rt.transaction_date)    &gt; oap.schedule_close_date
                         -- and    rt.organization_id            = oap.organization_id
                         and    trunc(rt.transaction_date)    &gt; gps.end_date
                         and    rt.organization_id            = ood.organization_id
                         and    gps.ledger_id                 = ood.set_of_books_id
                         and    gps.application_id            = 201 -- PO
                         and    2=2                           -- p_period_name
                         and    6=6                           -- p_org_code
                         and    rrsl.accounting_line_type     = &apos;Receiving Inspection&apos;
                         group by
                                rrsl.rcv_transaction_id,
                                rrsl.code_combination_id) rrsl
                 where  rt.shipment_header_id        = rsh.shipment_header_id
                 and    rt.shipment_line_id          = rsl.shipment_line_id
                 and    rt.po_header_id              = ph.po_header_id
                 and    rt.po_line_id                = pl.po_line_id
                 and    rt.po_line_location_id       = pll.line_location_id
                 and    pd.line_location_id          = pll.line_location_id
                 and    pr.po_release_id (+)         = rsl.po_release_id  
                 and    rt.transaction_id            = rrsl.rcv_transaction_id
                 and    pd.po_distribution_id        = rrsl.po_distribution_id
                 and    rt.po_line_location_id       = pd.line_location_id
                 -- Revision for version 1.8
                 -- and    oap.organization_id         = rt.organization_id
                 -- and    trunc(rt.transaction_date)  &gt; oap.schedule_close_date
                 -- The op.end_date does not have a timestamp so we have to trunc to make the comparison
                 -- Don&apos;t use rrsl.accounting date, really slow, use rt.transaction_date instead
                 and    trunc(rt.transaction_date)   &gt; op.end_date
                 and    rt.organization_id           = op.organization_id
                 -- End revision for version 1.8
                 and    rp.receiving_account_id      = rrsl.code_combination_id
                 and    rp.organization_id           = rt.organization_id
                 and    pd.destination_type_code     = &apos;EXPENSE&apos;
                 and    psp.org_id                   = ph.org_id
                 -- Only have expense receipts if accrual expenses at time of receipt
                 and    psp.expense_accrual_code     = &apos;RECEIPT&apos;
                 group by
                        &apos;Section 1.1 Post Close&apos;, -- section
                        rt.organization_id,
                        rsl.item_id,
                        pl.item_description,
                        pd.destination_type_code,
                        ph.segment1,
                        pl.line_num,
                        ph.vendor_id,               
                        ph.agent_id,
                        rt.po_header_id,
                        rt.po_line_id,
                        rt.po_line_location_id,
                        rsh.receipt_num,
                        pr.release_num,
                        pd.project_id,
                        pd.po_distribution_id,
                        rt.transaction_date,
                        pd.code_combination_id,
                        rt.unit_of_measure,
                        rsl.source_document_code, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.deliver_to_location_id, 
                                                         &apos;PO&apos;, pd.deliver_to_location_id), 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsh.shipment_num, 
                                                         &apos;PO&apos;, ph.segment1), 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.line_num, 
                                                         &apos;PO&apos;, pl.line_num), 
                        decode(rsl.source_document_code, &apos;INV&apos;, (rsl.shipment_unit_price * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity), 
                                                         -- Revision for version 1.8
                                                         -- &apos;PO&apos;, (pll.price_override *nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity)) actual_price,
                                                         &apos;PO&apos;, ((pll.price_override *nvl(ph.rate,1)) + decode(nvl(pd.nonrecoverable_tax,0), 0, 0, pd.nonrecoverable_tax / pd.quantity_ordered * nvl(ph.rate,1)))
                                                         * (rt.source_doc_quantity/rt.primary_quantity)),
                                                         -- End revision for version 1.8
                        abs(nvl(rt.primary_quantity,0)) * decode(sign(rrsl.amount), -1, 1, -1),
                        rrsl.amount * -1,
                        rsh.shipment_num, 
                        rt.transaction_id
                 union all
                 -- ==========================================================
                 -- 1.7 Get the change in unit prices between the RECEIVE and
                 -- DELIVER transaction types.  When retroactive price adjust-
                 -- ments are not in use, the Oracle Receiving accounting 
                 -- entries in rrsl are not recording these differences
                 -- and as a result, the sum of the receiving accounting
                 -- entries do not agree with the perpetual receiving values
                 -- on the Oracle Receiving Value Report.  The Oracle report
                 -- is in effect, revaluing the onhand receiving quantities
                 -- without a rrsl revaluation entry, leading to a cumulative
                 -- accounting vs. perpetual receiving value out-of-balance.
                 -- Especially as the Oracle Receiving Value Report assumes
                 -- both the RECEIVE and DELIVER were at the latest unit price
                 -- per the DELIVER transaction.  
                 -- ==========================================================
                 select &apos;Section 1.2 Post Close&apos; section,
                        rae.organization_id,
                        rae.inventory_item_id,
                        pl.item_description,
                        pd.destination_type_code,
                        ph.segment1 po_number,
                        pl.line_num po_line_num,
                        ph.vendor_id,               
                        ph.agent_id,
                        rae.po_header_id,
                        rae.po_line_id,
                        rae.po_line_location_id,
                        pr.release_num,
                        pd.project_id,
                        pd.po_distribution_id,
                        rsh.receipt_num,
                        rt.transaction_date,
                        pd.code_combination_id charge_account_id,
                        rt.unit_of_measure,
                        rsl.source_document_code, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.deliver_to_location_id, 
                                                         &apos;PO&apos;, pd.deliver_to_location_id) deliver_to_location_id, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsh.shipment_num, 
                                                         &apos;PO&apos;, ph.segment1) source_document, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.line_num, 
                                                          &apos;PO&apos;, pl.line_num) document_line_num, 
                        decode(rsl.source_document_code, &apos;INV&apos;, 
                                (rsl.shipment_unit_price * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity), 
                                                         &apos;PO&apos;, 
                                (pll.price_override *nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity)) actual_price,
                        to_number(null) quantity,
                        -- =====================================================================
                        -- Calculate the adjustment amount by subtracting the DELIVER unit price
                        -- by the RECEIVE unit price times RECEIVE quantity.  Invert the SIGN
                        -- of the quantity as we will subtract away these amounts and convert
                        -- the price into the primary UOM -- (rae.source_doc_quantity/rae.primary_quantity)
                        -- Use rcv_accounting_events to get the quantity received by PO Distribution.
                        -- =====================================================================
                        -- Quantity X Price Difference = Adjustment Amount
                        -- Quantity
                        round(decode(rt.transaction_type,
                                        &apos;RECEIVE&apos;, -1 * rt.primary_quantity,
                                        &apos;RETURN TO VENDOR&apos;, 1 * rt.primary_quantity,
                                        &apos;MATCH&apos;, -1 * rt.primary_quantity,
                                        &apos;CORRECT&apos;,
                                                decode(parent_rt.transaction_type,
                                                        &apos;UNORDERED&apos;, 0,
                                                        &apos;RECEIVE&apos;, -1 * rt.primary_quantity,
                                                        &apos;RETURN TO VENDOR&apos;, 1 * rt.primary_quantity,
                                                        0
                                                      ),
                                        0
                                    ) *
                                -- Unit Price Difference
                                ((decode(deliver_rt.currency_conversion_rate,
                                        null, nvl(deliver_rt.po_unit_price,0),
                                        nvl(deliver_rt.po_unit_price,0) * deliver_rt.currency_conversion_rate
                                       ) *
                                        -- Convert into the primary UOM
                                       (deliver_rt.source_doc_quantity/deliver_rt.primary_quantity)
                                ) -
                                (decode(rt.currency_conversion_rate,
                                        null, nvl(rt.po_unit_price,0),
                                        nvl(rt.po_unit_price,0) * rt.currency_conversion_rate
                                       ) *
                                        -- Convert into the primary UOM
                                        (rt.source_doc_quantity/rt.primary_quantity)
                                ))
                           ,2) amount,
                        rsh.shipment_num,
                        rae.rcv_transaction_id
                 from   -- =====================================================================
                        -- Client has multiple PO distributions per Receipt Number for the same
                        -- PO Header, Line, Line Location and item number.
                        -- Need to use rcv_accounting_events to get the split quantities
                        -- =====================================================================
                        rcv_transactions rt,
                        rcv_transactions parent_rt,
                        rcv_transactions deliver_rt, -- get the child DELIVER entries
                        rcv_shipment_headers rsh,
                        rcv_shipment_lines rsl,
                        rcv_accounting_events rae,
                        rcv_receiving_sub_ledger rrsl,
                        rcv_parameters rp,
                        po_headers_all ph,
                        po_lines_all pl,
                        po_line_locations_all pll,
                        po_releases_all pr,
                        po_distributions_all pd,
                        -- Revision for version 1.8
                        -- org_acct_periods oap
                        orgs_and_period op
                        -- End revision for version 1.8
                 where  rt.transaction_id            = rae.rcv_transaction_id
                 and    rt.parent_transaction_id     = parent_rt.transaction_id (+)
                 and    rt.organization_id           = parent_rt.organization_id (+)
                 and    rt.transaction_id            = rrsl.rcv_transaction_id
                 and    rrsl.accounting_line_type in (&apos;Clearing&apos;, &apos;Receiving Inspection&apos;)
                 and    pd.po_distribution_id        = rrsl.reference3
                 and    ph.po_header_id              = rae.po_header_id         
                 and    pr.po_release_id (+)         = rsl.po_release_id
                 and    pl.po_line_id                = rae.po_line_id
                 and    pll.line_location_id         = rae.po_line_location_id
                 and    pd.destination_type_code     = &apos;EXPENSE&apos;
                 and    rae.accounting_event_id      = rrsl.accounting_event_id
                 and    rt.shipment_header_id        = rsh.shipment_header_id
                 and    rt.shipment_line_id          = rsl.shipment_line_id
                 and    rt.shipment_header_id        = rsh.shipment_header_id
                 and    rt.shipment_line_id          = rsl.shipment_line_id
                 and    rt.transaction_type         &lt;&gt; &apos;DELIVER&apos;  -- only want receipts, return to vendor and corrections
                 and    deliver_rt.transaction_type  = &apos;DELIVER&apos;  -- get the deliver transaction for the price difference
                 and    deliver_rt.parent_transaction_id = rt.transaction_id
                 and    deliver_rt.po_unit_price    &lt;&gt; rt.po_unit_price
                 -- Revision for version 1.8
                 -- and    oap.organization_id          = rt.organization_id
                 -- and    deliver_rt.transaction_date &gt;= oap.schedule_close_date + 1
                 -- and    rt.transaction_date         &gt;= oap.schedule_close_date + 1
                 -- and    rrsl.transaction_date       &gt;= oap.schedule_close_date + 1
                 and    op.organization_id           = rp.organization_id
                 and    deliver_rt.transaction_date &gt;= op.end_date + 1
                 and    rt.transaction_date         &gt;= op.end_date + 1
                 and    rrsl.transaction_date       &gt;= op.end_date + 1
                 and    rae.organization_id          = rp.organization_id
                 and    rp.organization_id           = rt.organization_id                 
                 -- Assume if Retroactive Price Adjustments in use, then Section 1.5 picks up these entries.
                 and    rp.retroprice_adj_account_id is null
                 group by
                        &apos;Section 1.2 Post Close&apos;, -- section
                        rae.rcv_transaction_id,
                        rae.organization_id,
                        rae.inventory_item_id,
                        pl.item_description,
                        pd.destination_type_code,
                        ph.segment1, -- po_number
                        pl.line_num,
                        ph.vendor_id,               
                        ph.agent_id,
                        rae.po_header_id,
                        rae.po_line_id,
                        rae.po_line_location_id,
                        pr.release_num,
                        pd.project_id,
                        pd.po_distribution_id,
                        rsh.receipt_num,
                        rt.transaction_date,
                        pd.code_combination_id, -- charge_account_id
                        rt.unit_of_measure,
                        rsl.source_document_code, 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.deliver_to_location_id, 
                                                         &apos;PO&apos;, pd.deliver_to_location_id), -- deliver_to_location_id
                        decode(rsl.source_document_code, &apos;INV&apos;, rsh.shipment_num, 
                                                         &apos;PO&apos;, ph.segment1), -- source_document 
                        decode(rsl.source_document_code, &apos;INV&apos;, rsl.line_num, 
                                                          &apos;PO&apos;, pl.line_num), -- document_line_num
                        decode(rsl.source_document_code, &apos;INV&apos;, 
                                (rsl.shipment_unit_price * nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity), 
                                                         &apos;PO&apos;, 
                                (pll.price_override *nvl(ph.rate,1)) * (rt.source_doc_quantity/rt.primary_quantity)), -- actual_price
                       to_number(null), -- quantity
                        -- =====================================================================
                        -- Calculate the adjustment amount by subtracting the DELIVER unit price
                        -- by the RECEIVE unit price times RECEIVE quantity.  Invert the SIGN
                        -- of the quantity as we will subtract away these amounts and convert
                        -- the price into the primary UOM -- (rae.source_doc_quantity/rae.primary_quantity)
                        -- Use rcv_accounting_events to get the quantity received by PO Distribution.
                        -- =====================================================================
                        -- Quantity X Price Difference = Adjustment Amount
                        -- Quantity
                        round(decode(rt.transaction_type,
                                        &apos;RECEIVE&apos;, -1 * rt.primary_quantity,
                                        &apos;RETURN TO VENDOR&apos;, 1 * rt.primary_quantity,
                                        &apos;MATCH&apos;, -1 * rt.primary_quantity,
                                        &apos;CORRECT&apos;,
                                                decode(parent_rt.transaction_type,
                                                        &apos;UNORDERED&apos;, 0,
                                                        &apos;RECEIVE&apos;, -1 * rt.primary_quantity,
                                                        &apos;RETURN TO VENDOR&apos;, 1 * rt.primary_quantity,
                                                        0
                                                      ),
                                        0
                                    ) *
                                -- Unit Price Difference
                                ((decode(deliver_rt.currency_conversion_rate,
                                        null, nvl(deliver_rt.po_unit_price,0),
                                        nvl(deliver_rt.po_unit_price,0) * deliver_rt.currency_conversion_rate
                                       ) *
                                        -- Convert into the primary UOM
                                       (deliver_rt.source_doc_quantity/deliver_rt.primary_quantity)
                                ) -
                                (decode(rt.currency_conversion_rate,
                                        null, nvl(rt.po_unit_price,0),
                                        nvl(rt.po_unit_price,0) * rt.currency_conversion_rate
                                       ) *
                                        -- Convert into the primary UOM
                                        (rt.source_doc_quantity/rt.primary_quantity)
                                ))
                           ,2), -- amount
                        rsh.shipment_num, 
                        rt.transaction_id
                ) all_rcv
        group by all_rcv.organization_id,
                 all_rcv.inventory_item_id,
                 all_rcv.destination_type_code,
                 -- Fix for version 1.5
                 all_rcv.item_description,
                 all_rcv.po_number,
                 all_rcv.po_line_num,
                 all_rcv.vendor_id,
                 all_rcv.agent_id,
                 -- End fix for version 1.5
                 all_rcv.po_header_id,
                 all_rcv.po_line_id,
                 all_rcv.po_line_location_id,
                 all_rcv.release_num,
                 all_rcv.project_id,
                 all_rcv.receipt_num,
                 all_rcv.charge_account_id,
                 all_rcv.unit_of_measure
        ) net_rcv
        -- ===========================
        -- End of getting quantities
        -- ===========================
-- ===================================================================
-- Item master to quantity and item master to cost joins
-- ===================================================================
where  msiv.inventory_item_id  (+) = net_rcv.inventory_item_id  -- outer join as the items may be missing
and    msiv.organization_id    (+) = net_rcv.organization_id    -- outer join as the items may be missing
and    net_rcv.project_id          = pp.project_id (+)
-- Revision for version 1.8
-- and    mp.organization_id          = net_rcv.organization_id
and    7=7                         -- p_item_number, p_supplier
and    op.organization_id          = net_rcv.organization_id
-- ===================================================================
-- PO Header joins
-- ===================================================================
-- Fix for version 1.5
-- and    ph.po_header_id               = net_rcv.po_header_id
-- and    pl.po_line_id                 = net_rcv.po_line_id
-- and    pov.vendor_id                 = ph.vendor_id
-- and    ph.agent_id                   = he.employee_id
and    pov.vendor_id               = net_rcv.vendor_id
and    he.employee_id              = net_rcv.agent_id
-- End fix for version 1.5
-- ===================================================================
-- Receiving accrual account to account number join and org joins
-- ===================================================================
and    rp.receiving_account_id     = gcc1.code_combination_id (+) -- receiving value account
-- Revision for version 1.8
-- and    rp.organization_id          = mp.organization_id
and    rp.organization_id          = op.organization_id
and    net_rcv.charge_account_id   = gcc2.code_combination_id (+) -- offset charge account for expenses
-- ===================================================================
-- Joins for the lookup codes
-- ===================================================================
and    pl.lookup_type              = &apos;DESTINATION TYPE&apos;
and    pl.lookup_code              = net_rcv.destination_type_code
group by
        -- Revision for version 1.8
        op.ledger,
        op.operating_unit,
        op.organization_code,
        op.organization_name,
        op.period_name,
        -- End revision for version 1.8
        gcc1.concatenated_segments, -- Receiving_Account
        gcc2.concatenated_segments, -- Offset_Account
        &amp;segment_columns_grp
        pov.vendor_name,
        he.full_name,
        msiv.concatenated_segments,
        nvl(msiv.description,net_rcv.item_description),
        -- For category_columns
        -- Added for inline selects
        msiv.inventory_item_id,
        msiv.organization_id,
        -- End revision for version 1.6
        pl.displayed_field,
        net_rcv.po_number,
        net_rcv.po_line_num,
        net_rcv.release_num,
        pp.name,
        net_rcv.receipt_num,
        net_rcv.transaction_date,
        msiv.primary_uom_code,
        -- Revision for version 1.8
        op.currency_code,
        net_rcv.unit_of_measure,
        -- added for inline column select
        net_rcv.po_line_location_id
having sum(nvl(net_rcv.amount,0)) &lt;&gt; 0
-- Order by Ledger, Operating Unit, Org Code, Valuation Accounts, Offset Accounts, PO Number, PO Line, PO Release, Receipt Number 
order by
       -- Revision for version 1.8
        op.ledger,
        op.operating_unit,
        op.organization_code,
        op.organization_name,
        op.period_name,
        -- End revision for version 1.8
        gcc1.concatenated_segments, -- Receiving_Account
        gcc2.concatenated_segments, -- Offset_Account
        pov.vendor_name, --   Supplier,
        he.full_name, --   Buyer,
        msiv.concatenated_segments, --   Item_Number,
        net_rcv.po_number,
        net_rcv.po_line_num,
        net_rcv.release_num,
        pp.name,
        net_rcv.receipt_num</SQL_TEXT>
  <VERSION_COMMENTS> v1.8 10 Oct 2025 Douglas Volz Changed inventory periods to PO financial periods. Added non-recoverable tax amounts into PO prices.</VERSION_COMMENTS>
  <NUMBER_FORMAT>#,##0.00000;[Red](#,##0.00000)</NUMBER_FORMAT>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>CAC Receiving Expense Value (Period-End)</REPORT_NAME>
    <DESCRIPTION>Report to show receiving value for expense locations and expense destination types, for expenses accrued at time of receipt.  You may run this report for open or closed accounting periods.  If run for a prior period the report automatically rolls back the quantities and values to the prior period&apos;s period end date.  if run for a current period, the report shows the real-time quantities and values.  This report displays both the receiving valuation account as well as the offset (expense or CapEx) account.

Parameters:
Period Name:  the accounting period you wish to report (mandatory).
Category Sets 1 - 3:  any item category you wish (optional)
Supplier Name: enter a supplier name to report (optional)
Item Number:  enter an item number to report (optional)
Organization Code:  specific inventory organization to report (optional)
Operating Unit:  specific operating unit (optional)
Ledger:  specific ledger (optional)

/* +=============================================================================+
-- |  Copyright 2010-25 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) 
-- | 
-- |  Version Modified on  Modified  by   Description
-- |  ======= =========== ============== =========================================
-- |      1.0  5 Jul 2010 Douglas Volz   Created initial Report for Celgene
-- |                                     based on XXX_IPV_RCV_VALUE_REPT.sql
-- |      1.1  5 Jul 2010 Douglas Volz   Added requisition, requestor and requestor
-- |                                     email address
-- |      1.2 15 Sep 2010 Douglas Volz   Added unit of measure, supplier, buyer columns.
-- |                                     Fix for parameter changes for BO Freehand SQL requirements,
-- |                                     changing the code to accept null or % or value GL Ledger names.
-- |      1.3 27 Sep 2010 Douglas Volz   Changed the report sort to include the offset accounts
-- |      1.4 04 Jan 2012 Douglas Volz   Fixed quantities to sum up rcv_receiving_sub_ledger,
-- |                                     as the view rcv_receiving_value_view and
-- |                                         rcv_transactions does not split out quantities by
-- |                                     po distributions.  For expenses you can have multiple expense
-- |                                     accounts or distributions for each scheduled receipt
-- |                                     in po_line_locations
-- |      1.5 08 Feb 2012 Douglas Volz   Rewrite code to fix quantity and amounts, mtl_supply does
-- |                                     not handle split rcv_transations, split by multiple 
-- |                                     po_distribution_ids.  It only stores one of the PODs for
-- |                                     expenses.
-- |      1.6 06 Jan 2020 Douglas Volz   Added item categories, Org Code and Operating Unit parameters.
-- |      1.7 29 May 2025 Douglas Volz   Removed tabs, added Blitz G/L and OU security..
-- |      1.8 15 Oct 2025 Douglas Volz   Changed inventory periods to PO financial periods.
-- |                                     Added non-recoverable tax amounts into PO prices.
-- |                                     And changed Period Name parameter to use INV Periods
-- |                                     which also include the master inventory org.
-- +=============================================================================+*/</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;category_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;segment_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;segment_columns_grp</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>3=3</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>6=6</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>7=7</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>-10</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;segment_columns</ANCHOR>
    <SQL_TEXT>with x as (
select
fifsv.application_column_name,
fifsv.form_left_prompt
from
fnd_id_flex_segments_vl fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.enabled_flag=&apos;Y&apos; and
fifsv.id_flex_num=(select fifsv0.id_flex_num from fnd_id_flex_structures_vl fifsv0 where fifsv0.application_id=101 and fifsv0.id_flex_code=&apos;GL#&apos; and fifsv0.id_flex_structure_name=:chart_of_accounts)
order by
fifsv.segment_num
)
select &apos;gcc1.&apos;||lower(x.application_column_name)||&apos; &quot;Rcvg &apos;||substr(x.form_left_prompt,1,21)||&apos;&quot;,&apos; text from x union all
select &apos;gcc2.&apos;||lower(x.application_column_name)||&apos; &quot;Offset &apos;||substr(x.form_left_prompt,1,21)||&apos;&quot;,&apos; text from x</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Chart of Accounts (inv org restricted)</LOV_NAME>
    <LOV_GUID>8E2FF36EDEC579D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
fifsv.id_flex_structure_name value,
fifsv.id_flex_structure_code description
from
fnd_id_flex_structures_vl fifsv
where
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101 and
fifsv.id_flex_num in (select ood.chart_of_accounts_id from org_organization_definitions ood where nvl(ood.disable_date,sysdate)&gt;=sysdate) and
fifsv.id_flex_num in (select oav.chart_of_accounts_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id)
order by
fifsv.id_flex_structure_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select
fifsv.id_flex_structure_name
from
fnd_id_flex_structures_vl fifsv
where
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101 and
fifsv.id_flex_num in (select ood.chart_of_accounts_id from org_organization_definitions ood where nvl(ood.disable_date,sysdate)&gt;=sysdate) and
fifsv.id_flex_num in (select oav.chart_of_accounts_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
fifsv.id_flex_num in (select ood.chart_of_accounts_id from org_organization_definitions ood where ood.organization_id = nvl(fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;),ood.organization_id))</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Chart of Accounts</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <ANCHOR>&amp;segment_columns_grp</ANCHOR>
    <SQL_TEXT>select
&apos;gcc1.&apos;||lower(fifsv.application_column_name)||&apos;,&apos; text
from
fnd_id_flex_segments_vl fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.enabled_flag=&apos;Y&apos; and
fifsv.id_flex_num=(select fifsv0.id_flex_num from fnd_id_flex_structures_vl fifsv0 where fifsv0.application_id=101 and fifsv0.id_flex_code=&apos;GL#&apos; and fifsv0.id_flex_structure_name=:chart_of_accounts)
union all
select
&apos;gcc2.&apos;||lower(fifsv.application_column_name)||&apos;,&apos; text
from
fnd_id_flex_segments_vl fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.enabled_flag=&apos;Y&apos; and
fifsv.id_flex_num=(select fifsv0.id_flex_num from fnd_id_flex_structures_vl fifsv0 where fifsv0.application_id=101 and fifsv0.id_flex_code=&apos;GL#&apos; and fifsv0.id_flex_structure_name=:chart_of_accounts)
order by 1</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Chart of Accounts</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>gps.period_name = :p_period_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
oap.period_name value,
max(oap.period_year||&apos;-&apos;||oap.period_num||&apos;, &apos;||xxen_util.meaning(nvl2(oap.period_close_date,decode(oap.open_flag,&apos;P&apos;,2,&apos;N&apos;,decode(oap.summarized_flag,&apos;N&apos;,65,66),4),3),&apos;MTL_ACCT_PERIOD_STATUS&apos;,700)||&apos; (&apos;||oap.period_start_date||&apos; - &apos;||oap.schedule_close_date||&apos;)&apos;) over (partition by oap.period_name) description,
max(oap.period_start_date) over (partition by oap.period_name) period_start_date,
max(oap.effective_period_num) over (partition by oap.period_name) effective_period_num
from
gl_ledgers gl,
org_organization_definitions ood,
mtl_parameters mp,
(select oap.period_year*10000+oap.period_num effective_period_num, oap.* from org_acct_periods oap) oap
where
oap.period_start_date&lt;=sysdate and
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$flex$.organization_code is null or xxen_util.contains(:$flex$.organization_code,ood.organization_code)=&apos;Y&apos;) and
ood.organization_id=mp.organization_id and
--mp.organization_id&lt;&gt;mp.master_organization_id and 
gl.period_set_name=oap.period_set_name and
gl.ledger_id=ood.set_of_books_id and
ood.organization_id=oap.organization_id
order by
period_start_date desc,
effective_period_num desc,
oap.period_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select distinct oap.period_name value
from org_acct_periods oap,
 (select max(oap.schedule_close_date) default_date
  from org_acct_periods oap,
  org_organization_definitions ood
  where ood.organization_id = oap.organization_id
  and nvl(ood.disable_date, sysdate + 1) &gt; sysdate) max
where oap.schedule_close_date = max.default_date
and rownum = 1
</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Period Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>coalesce(xxen_util.previous_parameter_value(:parameter_id),(select mdsv.category_set_name from mtl_default_sets_view mdsv where mdsv.functional_area_id=11))</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 1</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>coalesce(xxen_util.previous_parameter_value(:parameter_id),(select mdsv.category_set_name from mtl_default_sets_view mdsv where mdsv.functional_area_id=5))</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 2</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>xxen_util.previous_parameter_value(:parameter_id)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 3</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>7=7</ANCHOR>
    <SQL_TEXT>pov.vendor_name = :p_supplier_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>AP Supplier</LOV_NAME>
    <LOV_GUID>B9847D20A0E4742FE0538931640A6379</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
aps.vendor_name value,
aps.segment1 description
from
ap_suppliers aps
where
(:$flex$.operating_unit is null or aps.vendor_id in (select assa.vendor_id from hr_all_organization_units_vl haouv, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos; and haouv.organization_id=assa.org_id)) and
(:$flex$.organization_code is null or aps.vendor_id in (select assa.vendor_id from org_organization_definitions ood, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.organization_code,ood.organization_code)=&apos;Y&apos; and ood.operating_unit=assa.org_id))
order by
aps.vendor_name,
aps.vendor_id</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Supplier Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>7=7</ANCHOR>
    <SQL_TEXT>msiv.concatenated_segments = :p_item_number</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Item (master, costing enabled only)</LOV_NAME>
    <LOV_GUID>91D022B15B12FFB9E053BB6B63587F0B</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
msiv.concatenated_segments value,
msiv.description
from
mtl_system_items_vl msiv
where
msiv.organization_id=(
select
max(mp.master_organization_id) master_organization_id
from
mtl_parameters mp
where
mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) or
fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) is null 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
msiv.costing_enabled_flag=&apos;Y&apos;
order by
msiv.concatenated_segments</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Item Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>3=3</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
(:$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>10</SORT_ORDER>
    <ANCHOR>4=4</ANCHOR>
    <SQL_TEXT>ms.to_organization_id in (select mp.organization_id from mtl_parameters mp where mp.organization_code = :p_org_code)</SQL_TEXT>
    <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>11</SORT_ORDER>
    <ANCHOR>5=5</ANCHOR>
    <SQL_TEXT>rt.organization_id in (select mp.organization_id from mtl_parameters mp where mp.organization_code = :p_org_code)</SQL_TEXT>
    <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>12</SORT_ORDER>
    <ANCHOR>6=6</ANCHOR>
    <SQL_TEXT>ood.organization_id in (select mp.organization_id from mtl_parameters mp where mp.organization_code = :p_org_code)</SQL_TEXT>
    <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>13</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</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 mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
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>14</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</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 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
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>
  <PARAMETER_DEPENDENCIES>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.chart_of_accounts</FLEX_BIND>
    <PARAMETER_NAME>Chart of Accounts</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Ledger</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Operating Unit</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Organization Code</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Period Name</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Organization Code</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Supplier Name</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Category Set 1</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Category Set 2</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Category Set 3</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Period Name</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Supplier Name</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
  </PARAMETER_DEPENDENCIES>
  <TEMPLATES>
   <TEMPLATES_ROW>
    <GUID>8AEC3767930A51A63D13206F8D9CB9E4</GUID>
    <TEMPLATE_NAME>Pivot by Org</TEMPLATE_NAME>
    <DYNAMIC_COLUMNS>Y</DYNAMIC_COLUMNS>
    <OWNER>MFG</OWNER>
    <TEMPLATE_COLUMNS>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>37</DISPLAY_SEQUENCE>
      <COLUMN_NAME>AGING_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-4.0007</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Account</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>19</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BUYER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
      <COLUMN_NAME>CURRENCY_CODE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>25</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Class</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-4.0005</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Company</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>27</DISPLAY_SEQUENCE>
      <COLUMN_NAME>DESTINATION_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-4.0006</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Department</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-32.0033</DISPLAY_SEQUENCE>
      <COLUMN_NAME>EARLIEST_RECEIPT_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>24</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Family</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>21</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ITEM_DESCRIPTION</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ITEM_NUMBER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-13.0015</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ITEM_STATUS</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-13.0014</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ITEM_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>26</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Inv.Items Description</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-34.0037</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JOB_CLOSE_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-34.0036</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JOB_STATUS</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <COLUMN_NAME>LEDGER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-13.0016</DISPLAY_SEQUENCE>
      <COLUMN_NAME>MAKE_BUY_CODE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>7</DISPLAY_SEQUENCE>
      <COLUMN_NAME>OFFSET_ACCOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>39</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ONHAND_QUANTITY</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>41</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ONHAND_VALUE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
      <SORT_ORDER>1</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ORGANIZATION_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ORG_CODE</COLUMN_NAME>
      <SORT_ORDER>2</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-34.0038</DISPLAY_SEQUENCE>
      <COLUMN_NAME>OSP_RESOURCE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>15</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Offset Account</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>13</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Offset Company</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>14</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Offset Department</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>17</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Offset Product</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>16</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Offset Sub-Account</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PERIOD_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>29</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PO_LINE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-24.0025</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PO_LINE_STATUS</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>28</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PO_NUMBER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PO_RELEASE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-27.0028</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PROJECT_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>31</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PROJECT_NUMBER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-4.0009</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Product</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>22</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Product Cat</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>23</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Product Description</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>36</DISPLAY_SEQUENCE>
      <COLUMN_NAME>RECEIPT_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>35</DISPLAY_SEQUENCE>
      <COLUMN_NAME>RECEIPT_NUMBER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>6</DISPLAY_SEQUENCE>
      <COLUMN_NAME>RECEIVING_ACCOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>33</DISPLAY_SEQUENCE>
      <COLUMN_NAME>REQUESTOR</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>34</DISPLAY_SEQUENCE>
      <COLUMN_NAME>REQUESTOR_EMAIL</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>32</DISPLAY_SEQUENCE>
      <COLUMN_NAME>REQUISITION_NUMBER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Rcvg Account</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>8</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Rcvg Company</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>9</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Rcvg Department</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>12</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Rcvg Product</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>11</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Rcvg Sub-Account</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>18</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SUPPLIER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-4.0008</DISPLAY_SEQUENCE>
      <COLUMN_NAME>Sub-Account</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>38</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TRANSACTION_UOM</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-34.0035</DISPLAY_SEQUENCE>
      <COLUMN_NAME>UOM_CODE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>-34.0035</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WIP_JOB</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
    </TEMPLATE_COLUMNS>
    <TEMPLATE_PIVOT>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>LEDGER</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>OFFSET_ACCOUNT</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>ONHAND_QUANTITY</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>ONHAND_VALUE</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>ORG_CODE</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>RECEIVING_ACCOUNT</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
    </TEMPLATE_PIVOT>
    <TEMPLATE_SHARED_STRINGS>
    </TEMPLATE_SHARED_STRINGS>
    <TEMPLATE_PARAMETER_DEFAULTS>
    </TEMPLATE_PARAMETER_DEFAULTS>
    <TEMPLATE_STYLES>
    </TEMPLATE_STYLES>
    <TEMPLATE_SHARING>
     <TEMPLATE_SHARING_ROW>
      <SHARING_LEVEL>S</SHARING_LEVEL>
      <LEVEL_VALUE>Site</LEVEL_VALUE>
     </TEMPLATE_SHARING_ROW>
    </TEMPLATE_SHARING>
    <PARAMETER_EXCLUSION>
    </PARAMETER_EXCLUSION>
   </TEMPLATES_ROW>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
   <DEFAULT_TEMPLATES_ROW>
    <TEMPLATE_GUID>8AEC3767930A51A63D13206F8D9CB9E4</TEMPLATE_GUID>
   </DEFAULT_TEMPLATES_ROW>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
  <UPLOAD_DEPENDENCIES>
  </UPLOAD_DEPENDENCIES>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
