<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: 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: Yes -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEA679D2E0530100007F1FF2</GUID>
  <LOV_NAME>Yes</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
</LOVS>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: INV Intercompany Invoice Reconciliation -->
 <REPORTS_ROW>
  <GUID>B4BD260CA5599AE5E053B46B6358B59A</GUID>
  <SQL_TEXT>with mmt as -- driving inventory transactions for intercompany
  (
    select
      &apos;Sales Order&apos;                    source_document
    , ooha.ordered_date                source_document_date
    , to_char(ooha.order_number)       source_document_num
    , oe_order_misc_pub.get_concat_line_number(oola.line_id)
                                       source_document_line_num
    , oola.ordered_quantity            source_document_qty
    , oola.order_quantity_uom          source_document_uom
    , &apos;INTERCOMPANY&apos;                   source_line_context
    , null                             receipt_number
    , oola.line_id                     source_line_id
    , to_number(hoi.org_information3)  shipping_ou_id
    , oola.org_id                      selling_ou_id
    , mmt.transaction_id
    , mmt.transaction_type_id
    , mmt.transaction_action_id
    , mmt.transaction_date
    , mmt.organization_id
    , mmt.transfer_organization_id
    , mmt.inventory_item_id
    , mmt.transaction_quantity
    , mmt.transaction_uom
    , mmt.primary_quantity
    , mmt.transaction_cost
    , mmt.actual_cost
    , mmt.transfer_price
    , mmt.currency_code
    , mmt.currency_conversion_rate
    , mmt.currency_conversion_type
    , mmt.currency_conversion_date
    , mmt.costed_flag
    , mmt.invoiced_flag
    , mmt.transaction_id          sla_inv_transaction_id
    , ( select distinct
          listagg(micv.category_concat_segs,&apos;, &apos;) within group (order by micv.category_concat_segs) over (partition by micv.inventory_item_id,micv.organization_id)
        from mtl_item_categories_v micv
        where micv.category_set_id   = :p_category_set_id
        and   micv.organization_id   = mmt.organization_id
        and   micv.inventory_item_id = mmt.inventory_item_id
      ) &amp;l_category_set_name
    , null            requisition_number
    , to_number(null) requisition_line
    , to_number(null) requisition_unit_price
    , to_number(null) requisition_requested_qty
    , to_number(null) requisition_delivered_qty
    , to_number(null) requisition_delivered_amount
    , to_number(null) requisition_shipped_qty
    , to_number(null) requisition_shipped_amount
    , to_number(null) requisition_qty_variance
    , to_number(null) requisition_cost_variance
    from
      mtl_material_transactions    mmt
    , hr_organization_information  hoi
    , oe_order_lines_all           oola
    , oe_order_headers_all         ooha
    , mtl_intercompany_parameters  mip
    where
        mmt.transaction_source_type_id        in (2,12)  -- sales order/rma
    and mmt.transaction_action_id               in (1,27)  -- issue from stores/receipt into stores
    and mmt.logical_transactions_created    is null
    and oola.line_id                         = mmt.trx_source_line_id
    and ooha.header_id                       = oola.header_id
    and hoi.organization_id                  = mmt.organization_id
    and hoi.org_information_context          = &apos;Accounting Information&apos;
    and mip.ship_organization_id             = to_number(hoi.org_information3)
    and mip.sell_organization_id             = oola.org_id
    and nvl(:p_ico_source,&apos;Sales Order&apos;)     = &apos;Sales Order&apos;
    union
     select
      &apos;Internal Sales Order&apos;           source_document
    , ooha.ordered_date                source_document_date
    , to_char(ooha.order_number)       source_document_num
    , oe_order_misc_pub.get_concat_line_number(oola.line_id)
                                       source_document_line_num
    , oola.ordered_quantity            source_document_qty
    , oola.order_quantity_uom          source_document_uom
    , &apos;INTERCOMPANY&apos;                   source_line_context
    , rsh.receipt_num                  receipt_number
    , oola.line_id                     source_line_id
    , to_number(hoi1.org_information3) shipping_ou_id
    , to_number(hoi2.org_information3) selling_ou_id
    , mmt.transaction_id
    , mmt.transaction_type_id
    , mmt.transaction_action_id
    , mmt.transaction_date
    , mmt.organization_id
    , mmt.transfer_organization_id
    , mmt.inventory_item_id
    , mmt.transaction_quantity
    , mmt.transaction_uom
    , mmt.primary_quantity
    , mmt.transaction_cost
    , mmt.actual_cost
    , mmt.transfer_price
    , mmt.currency_code
    , mmt.currency_conversion_rate
    , mmt.currency_conversion_type
    , mmt.currency_conversion_date
    , mmt.costed_flag
    , mmt.invoiced_flag
    , mmt2.transaction_id          sla_inv_transaction_id
    , ( select distinct
          listagg(micv.category_concat_segs,&apos;, &apos;) within group (order by micv.category_concat_segs) over (partition by micv.inventory_item_id,micv.organization_id)
        from mtl_item_categories_v micv
        where micv.category_set_id   = :p_category_set_id
        and   micv.organization_id   = mmt.organization_id
        and   micv.inventory_item_id = mmt.inventory_item_id
      ) &amp;l_category_set_name
    , prha.segment1 requisition_number
    , prla.line_num requisition_line
    , prla.unit_price requisition_unit_price
    , (prla.quantity - nvl(prla.quantity_cancelled,0)) requisition_requested_qty
    , prla.quantity_delivered requisition_delivered_qty
    , prla.quantity_delivered * prla.unit_price requisition_delivered_amount
    , (select sum(oola2.shipped_quantity) 
       from oe_order_lines_all oola2 
       where oola2.order_source_id = pspa.order_source_id 
       and   oola2.orig_sys_document_ref = prha.segment1
       and   oola2.orig_sys_line_ref = prla.line_num
       and   oola2.source_document_id = prla.requisition_header_id 
       and   oola2.source_document_line_id = prla.requisition_line_id 
       and   oola2.shipped_quantity is not null 
       and   prla.quantity_delivered &gt; 0
      ) requisition_shipped_qty
    , (select sum(oola2.shipped_quantity * nvl(oola2.unit_selling_price,0)) 
       from oe_order_lines_all oola2 
       where oola2.order_source_id = pspa.order_source_id 
       and   oola2.orig_sys_document_ref = prha.segment1
       and   oola2.orig_sys_line_ref = prla.line_num
       and   oola2.source_document_id = prla.requisition_header_id 
       and   oola2.source_document_line_id = prla.requisition_line_id 
       and   oola2.shipped_quantity is not null 
       and   prla.quantity_delivered &gt; 0
      ) requisition_shipped_amount
    , (select sum(oola2.shipped_quantity) - prla.quantity_delivered 
       from oe_order_lines_all oola2 
       where oola2.order_source_id = pspa.order_source_id 
       and   oola2.orig_sys_document_ref = prha.segment1
       and   oola2.orig_sys_line_ref = prla.line_num
       and   oola2.source_document_id = prla.requisition_header_id 
       and   oola2.source_document_line_id = prla.requisition_line_id 
       and   oola2.shipped_quantity is not null 
       and   prla.quantity_delivered &gt; 0
      ) requisition_qty_variance
    , (select sum(oola2.shipped_quantity * nvl(oola2.unit_selling_price,0)) - (prla.quantity_delivered * nvl(prla.unit_price,0)) 
       from oe_order_lines_all oola2 
       where oola2.order_source_id = pspa.order_source_id 
       and   oola2.orig_sys_document_ref = prha.segment1
       and   oola2.orig_sys_line_ref = prla.line_num
       and   oola2.source_document_id = prla.requisition_header_id 
       and   oola2.source_document_line_id = prla.requisition_line_id 
       and   oola2.shipped_quantity is not null 
       and   prla.quantity_delivered &gt; 0
      ) requisition_cost_variance
    from
      mtl_material_transactions    mmt
    , oe_order_lines_all           oola
    , oe_order_headers_all         ooha
    , hr_organization_information  hoi1
    , hr_organization_information  hoi2
    , mtl_intercompany_parameters  mip
    , rcv_transactions             rt
    , rcv_shipment_headers         rsh
    , mtl_material_transactions    mmt2
    , po_requisition_headers_all   prha
    , po_requisition_lines_all     prla
    , po_system_parameters_all     pspa
    where
        mmt.transaction_source_type_id      in (8)     -- internal order
    and mmt.transaction_action_id           in (21)    -- intransit shipment
    and oola.line_id                         = mmt.trx_source_line_id
    and ooha.header_id                       = oola.header_id
    and hoi1.organization_id                 = mmt.organization_id
    and hoi1.org_information_context         = &apos;Accounting Information&apos;
    and hoi2.organization_id                 = mmt.transfer_organization_id
    and hoi2.org_information_context         = &apos;Accounting Information&apos;
    and mip.ship_organization_id             = to_number(hoi1.org_information3)
    and mip.sell_organization_id             = to_number(hoi2.org_information3)
    and fnd_profile.value(&apos;INV_INTERCOMPANY_INVOICE_INTERNAL_ORDER&apos;)
                                             = 1
    and mmt2.transfer_transaction_id     (+) = mmt.transaction_id -- mmt2 = intransit receiving transaction
    and rt.transaction_id                (+) = mmt2.rcv_transaction_id
    and rsh.shipment_header_id           (+) = rt.shipment_header_id
    and prla.requisition_header_id       (+) = oola.source_document_id
    and prla.requisition_line_id         (+) = oola.source_document_line_id
    and prha.requisition_header_id       (+) = prla.requisition_header_id
    and pspa.org_id                      (+) = prha.org_id
    and nvl(:p_ico_source,&apos;Internal Sales Order&apos;) = &apos;Internal Sales Order&apos;
    union
    select
      &apos;Sales Order&apos;                    source_document
    , ooha.ordered_date                source_document_date
    , to_char(ooha.order_number)       source_document_num
    , oe_order_misc_pub.get_concat_line_number(oola.line_id)
                                       source_document_line_num
    , oola.ordered_quantity            source_document_qty
    , oola.order_quantity_uom          source_document_uom
    , &apos;INTERCOMPANY&apos;                   source_line_context
    , null                             receipt_number
    , oola.line_id                     source_line_id
    , to_number(hoi1.org_information3) shipping_ou_id
    , to_number(hoi2.org_information3) selling_ou_id
    , mmt.transaction_id
    , mmt.transaction_type_id
    , mmt.transaction_action_id
    , mmt.transaction_date
    , mmt.organization_id
    , mmt.transfer_organization_id
    , mmt.inventory_item_id
    , mmt.transaction_quantity
    , mmt.transaction_uom
    , mmt.primary_quantity
    , mmt.transaction_cost
    , mmt.actual_cost
    , mmt.transfer_price
    , mmt.currency_code
    , mmt.currency_conversion_rate
    , mmt.currency_conversion_type
    , mmt.currency_conversion_date
    , mmt.costed_flag
    , mmt.invoiced_flag
    , mmt.transaction_id          sla_inv_transaction_id
    , ( select distinct
          listagg(micv.category_concat_segs,&apos;, &apos;) within group (order by micv.category_concat_segs) over (partition by micv.inventory_item_id,micv.organization_id)
        from mtl_item_categories_v micv
        where micv.category_set_id   = :p_category_set_id
        and   micv.organization_id   = mmt.organization_id
        and   micv.inventory_item_id = mmt.inventory_item_id
      ) &amp;l_category_set_name
    , null            requisition_number
    , to_number(null) requisition_line
    , to_number(null) requisition_unit_price
    , to_number(null) requisition_requested_qty
    , to_number(null) requisition_delivered_qty
    , to_number(null) requisition_delivered_amount
    , to_number(null) requisition_shipped_qty
    , to_number(null) requisition_shipped_amount
    , to_number(null) requisition_qty_variance
    , to_number(null) requisition_cost_variance
    from
      mtl_material_transactions    mmt
    , oe_order_lines_all           oola
    , oe_order_headers_all         ooha
    , hr_organization_information  hoi1
    , hr_organization_information  hoi2
    , mtl_transaction_flow_headers mtfh
    , mtl_intercompany_parameters  mip
    where
        mmt.transaction_source_type_id      in (13)    -- inventory
    and mmt.transaction_action_id           in (9,14)  -- logical sales order issue/logical sales order receipt
    and mmt.logical_trx_type_code           in (2,5)
    and oola.line_id                         = mmt.trx_source_line_id
    and ooha.header_id                       = oola.header_id
    and hoi1.organization_id                 = mmt.organization_id
    and hoi1.org_information_context         = &apos;Accounting Information&apos;
    and hoi2.organization_id                 = mmt.transfer_organization_id
    and hoi2.org_information_context         = &apos;Accounting Information&apos;
    and mtfh.header_id                       = mmt.trx_flow_header_id
    and mtfh.flow_type                       = 1
    and mip.ship_organization_id             = to_number(hoi1.org_information3)
    and mip.sell_organization_id             = to_number(hoi2.org_information3)
    and nvl(:p_ico_source,&apos;Sales Order&apos;)     = &apos;Sales Order&apos;
    union
    select
      &apos;Purchase Order&apos;                 source_document
    , pha.creation_date                source_document_date
    , pha.segment1                     source_document_num
    , pla.line_num || &apos;.&apos; || plla.shipment_num
                                       source_document_line_num
    , plla.quantity  - nvl(plla.quantity_cancelled,0)
                                       source_document_qty
    , nvl( ( select mufm.uom_code
             from  mtl_units_of_measure mufm
             where mufm.unit_of_measure = plla.unit_meas_lookup_code
             and   rownum=1
            )
         ,  plla.unit_meas_lookup_code
         )                             source_document_uom
    , &apos;GLOBAL_PROCUREMENT&apos;             source_line_context
    , rsh.receipt_num                  receipt_number
    , plla.line_location_id            source_line_id
    , to_number(hoi1.org_information3) shipping_ou_id
    , to_number(hoi2.org_information3) selling_ou_id
    , mmt.transaction_id
    , mmt.transaction_type_id
    , mmt.transaction_action_id
    , mmt.transaction_date
    , mmt.organization_id
    , mmt.transfer_organization_id
    , mmt.inventory_item_id
    , mmt.transaction_quantity
    , mmt.transaction_uom
    , mmt.primary_quantity
    , mmt.transaction_cost
    , mmt.actual_cost
    , mmt.transfer_price
    , mmt.currency_code
    , mmt.currency_conversion_rate
    , mmt.currency_conversion_type
    , mmt.currency_conversion_date
    , mmt.costed_flag
    , mmt.invoiced_flag
    , mmt.transaction_id          sla_inv_transaction_id
    , ( select distinct
          listagg(micv.category_concat_segs,&apos;, &apos;) within group (order by micv.category_concat_segs) over (partition by micv.inventory_item_id,micv.organization_id)
        from mtl_item_categories_v micv
        where micv.category_set_id   = :p_category_set_id
        and   micv.organization_id   = mmt.organization_id
        and   micv.inventory_item_id = mmt.inventory_item_id
      ) &amp;l_category_set_name
    , null            requisition_number
    , to_number(null) requisition_line
    , to_number(null) requisition_unit_price
    , to_number(null) requisition_requested_qty
    , to_number(null) requisition_delivered_qty
    , to_number(null) requisition_delivered_amount
    , to_number(null) requisition_shipped_qty
    , to_number(null) requisition_shipped_amount
    , to_number(null) requisition_qty_variance
    , to_number(null) requisition_cost_variance
    from
      mtl_material_transactions    mmt
    , po_headers_all               pha
    , rcv_transactions             rt
    , rcv_shipment_headers         rsh
    , po_line_locations_all        plla
    , po_lines_all                 pla
    , hr_organization_information  hoi1
    , hr_organization_information  hoi2
    , mtl_transaction_flow_headers mtfh
    , mtl_intercompany_parameters  mip
    where
        mmt.transaction_source_type_id      in (13)    -- invenory
    and mmt.transaction_action_id           in (9,14)  -- logical sales order issue/logical sales order receipt
    and mmt.logical_trx_type_code           in (1,3)
    and pha.po_header_id                     = mmt.transaction_source_id
    and rt.transaction_id                (+) = mmt.rcv_transaction_id
    and rsh.shipment_header_id           (+) = rt.shipment_header_id
    and plla.line_location_id            (+) = rt.po_line_location_id
    and pla.po_line_id                   (+) = rt.po_line_id
    and hoi1.organization_id                 = mmt.organization_id
    and hoi1.org_information_context         = &apos;Accounting Information&apos;
    and hoi2.organization_id                 = mmt.transfer_organization_id
    and hoi2.org_information_context         = &apos;Accounting Information&apos;
    and mtfh.header_id                       = mmt.trx_flow_header_id
    and mtfh.flow_type                       = 2
    and mip.ship_organization_id             = to_number(hoi1.org_information3)
    and mip.sell_organization_id             = to_number(hoi2.org_information3)
    and nvl(:p_ico_source,&apos;Purchase Order&apos;)  = &apos;Purchase Order&apos;
  )
, ar_ico as
  ( select
      rctla.interface_line_context
    , rctla.interface_line_attribute6
    , rctla.interface_line_attribute7
    , rctla.customer_trx_id
    , rctla.customer_trx_line_id
    , hp.party_name            customer_name
    , hca.account_number       customer_num
    , hcsua.location           customer_location
    , apsa.trx_number
    , apsa.trx_date
    , apsa.invoice_currency_code
    , case apsa.status
      when &apos;OP&apos; then &apos;Open&apos;
      when &apos;CL&apos; then &apos;Closed&apos;
                else apsa.status
      end   status
    , apsa.amount_due_original
    , apsa.tax_original
    , apsa.exchange_rate
    , apsa.exchange_rate_type
    , apsa.exchange_date
    , rctla.line_number
    , rctla.quantity_invoiced
    , rctla.uom_code
    , rctla.unit_selling_price
    , rctla.extended_amount
    , zl.tax                   tax_type
    , zl.tax_rate_code         tax_rate_code
    , zl.tax_rate              tax_rate
    from
      ra_customer_trx_lines_all    rctla
    , ra_customer_trx_all          rcta
    , ar_payment_schedules_all     apsa
    , hz_cust_accounts             hca
    , hz_parties                   hp
    , hz_cust_site_uses_all        hcsua
    , ( select distinct
          zl1.trx_id
        , zl1.trx_line_id
        , listagg (zl1.tax,&apos;/ &apos;) within group (order by zl1.tax) over (partition by zl1.trx_id,zl1.trx_line_id) tax
        , listagg (zl1.tax_rate_code,&apos;/ &apos;) within group (order by zl1.tax, zl1.tax_rate_code) over (partition by zl1.trx_id,zl1.trx_line_id) tax_rate_code
        , listagg (to_char(zl1.tax_rate),&apos;/ &apos;) within group (order by zl1.tax, zl1.tax_rate_code) over (partition by zl1.trx_id,zl1.trx_line_id) tax_rate
        from (select distinct
                zl2.trx_id
              , zl2.trx_line_id
              , zl2.tax
              , zl2.tax_rate_code
              , zl2.tax_rate
              from
                zx_lines zl2
              where zl2.application_id    = 222
              and   zl2.entity_code       = &apos;TRANSACTIONS&apos;
              and   zl2.trx_level_type    = &apos;LINE&apos;
             ) zl1
      ) zl
    where
        rctla.interface_line_context  in (&apos;INTERCOMPANY&apos;,&apos;GLOBAL_PROCUREMENT&apos;)
    and rctla.line_type               = &apos;LINE&apos;
    and rcta.customer_trx_id          = rctla.customer_trx_id
    and apsa.customer_trx_id          = rctla.customer_trx_id
    and hca.cust_account_id           = rcta.bill_to_customer_id
    and hp.party_id                   = hca.party_id
    and hcsua.site_use_id             = rcta.bill_to_site_use_id
    and zl.trx_id                 (+) = rctla.customer_trx_id
    and zl.trx_line_id            (+) = rctla.customer_trx_line_id
  )
, ar_intf as -- ar interface data
  ( select
      rila.interface_line_context
    , rila.interface_line_attribute6
    , rila.interface_line_attribute7
    , rila.interface_line_id
    , rila.interface_status
    , rila.request_id
    , listagg(riea.message_text,chr(10))
      within group (order by riea.message_text)
      over (partition by rila.interface_line_context,rila.interface_line_attribute6,rila.interface_line_attribute7,rila.interface_line_id,rila.interface_status,rila.request_id) error
    from
      ra_interface_lines_all  rila
    , (select distinct
         interface_line_id
       , message_text
       from
         ra_interface_errors_all
       )                      riea
    where
        rila.interface_line_id          = riea.interface_line_id (+)
    and nvl(rila.interface_status,&apos;U&apos;) != &apos;P&apos;
  )
, ap_ico as -- ap invoice data
  ( select
      aia.reference_1          customer_trx_id
    , aila.reference_1         customer_trx_line_id
    , aia.invoice_id
    , asup.vendor_name
    , asup.segment1            vendor_num
    , assa.vendor_site_code
    , aia.invoice_num
    , aia.invoice_date
    , aia.invoice_currency_code
    , aia.invoice_amount
    , aia.total_tax_amount
    , aia.amount_paid
    , aia.exchange_rate
    , aia.exchange_rate_type
    , aia.exchange_date
    , aila.line_number
    , xxen_util.meaning(aila.line_source,&apos;LINE SOURCE&apos;,200)
                               line_source
    , decode(aila.discarded_flag,&apos;Y&apos;,&apos;Y&apos;,null)
                               line_discarded_flag
    , aila.quantity_invoiced
    , nvl( ( select mufm.uom_code
             from  mtl_units_of_measure mufm
             where mufm.unit_of_measure = aila.unit_meas_lookup_code
             and   rownum=1
            )
         ,  aila.unit_meas_lookup_code
         )                     unit_meas_lookup_code
    , aila.unit_price
    , aila.amount              line_amount
    , zl.tax                   tax_type
    , zl.tax_rate_code         tax_rate_code
    , zl.tax_rate              tax_rate
    from
      ap_invoices_all              aia
    , ap_invoice_lines_all         aila
    , ap_suppliers                 asup
    , ap_supplier_sites_all        assa
    , ( select distinct
          zl1.trx_id
        , zl1.trx_line_id
        , listagg (zl1.tax,&apos;/ &apos;) within group (order by zl1.tax) over (partition by zl1.trx_id,zl1.trx_line_id) tax
        , listagg (zl1.tax_rate_code,&apos;/ &apos;) within group (order by zl1.tax, zl1.tax_rate_code) over (partition by zl1.trx_id,zl1.trx_line_id) tax_rate_code
        , listagg (to_char(zl1.tax_rate),&apos;/ &apos;) within group (order by zl1.tax, zl1.tax_rate_code) over (partition by zl1.trx_id,zl1.trx_line_id) tax_rate
        from (select distinct
                zl2.trx_id
              , zl2.trx_line_id
              , zl2.tax
              , zl2.tax_rate_code
              , zl2.tax_rate
              from
                zx_lines zl2
              where zl2.application_id    = 200
              and   zl2.entity_code       = &apos;AP_INVOICES&apos;
              and   zl2.trx_level_type    = &apos;LINE&apos;
             ) zl1
      ) zl
    where
        aila.invoice_id               = aia.invoice_id
    and aia.vendor_id                 = asup.vendor_id
    and aia.vendor_site_id            = assa.vendor_site_id
    and zl.trx_id                 (+) = aila.invoice_id
    and zl.trx_line_id            (+) = aila.line_number
    and aia.source                    = &apos;Intercompany&apos;
    and aila.line_type_lookup_code    = &apos;ITEM&apos;
  )
, ap_intf as -- ap interface data
  (
    select
      aii.reference_1     customer_trx_id
    , aili.reference_1    customer_trx_line_id
    , aii.invoice_id
    , aii.status
    , aii.request_id
    , listagg(air1.reject_lookup_code,chr(10))
      within group (order by air1.reject_lookup_code)
      over (partition by aii.reference_1,aili.reference_1,aii.invoice_id,aii.status,aii.request_id) error_h
    , listagg(air2.reject_lookup_code,chr(10))
      within group (order by air2.reject_lookup_code)
      over (partition by aii.reference_1,aili.reference_1,aii.invoice_id,aii.status,aii.request_id) error_l
    from
      ap_invoices_interface      aii
    , ap_invoice_lines_interface aili
    , (select distinct
         parent_table
       , parent_id
       , reject_lookup_code
       from
         ap_interface_rejections
       where
         parent_table = &apos;AP_INVOICES_INTERFACE&apos;
       )    air1
    , (select distinct
         parent_table
       , parent_id
       , reject_lookup_code
       from
         ap_interface_rejections
       where
         parent_table = &apos;AP_INVOICE_LINES_INTERFACE&apos;
       )    air2
    where
        aii.invoice_id           = aili.invoice_id
    and air1.parent_id       (+) = aii.invoice_id
    and air2.parent_id       (+) = aili.invoice_line_id
    and aii.source       = &apos;Intercompany&apos;
    and aii.status      != &apos;PROCESSED&apos;
  )
&amp;l_ap_sla_tables
&amp;l_inv_sla_tables
-- ******************************************************
-- main query start here
-- ******************************************************
select
   &amp;lp_select_columns1
   &amp;lp_select_columns2
   &amp;lp_sla_columns
from
  mmt                          mmt   -- inventory material transaction
, mtl_trx_types_view           mttv
, mtl_system_items_b_kfv         msik
, org_organization_definitions ood1
, org_organization_definitions ood2
, hr_all_organization_units    haou1
, hr_all_organization_units    haou2
, ar_intf                      ar_intf  -- ar invoice interface lines
, ar_ico                       ar_ico   -- ar ico invoices
, ap_intf                      ap_intf  -- ap invoice interface
, ap_ico                       ap_ico   -- ap ico invoices
&amp;lp_sla_from
where
-- inventory
    mmt.transaction_type_id                = mttv.transaction_type_id
and mmt.organization_id                    = msik.organization_id
and mmt.inventory_item_id                  = msik.inventory_item_id
and mmt.organization_id                    = ood1.organization_id
and mmt.transfer_organization_id           = ood2.organization_id (+)
and mmt.shipping_ou_id                     = haou1.organization_id
and mmt.selling_ou_id                      = haou2.organization_id
and (   mmt.shipping_ou_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)   
     or mmt.selling_ou_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)
    ) 
-- ar interface
and ar_intf.interface_line_context     (+) = mmt.source_line_context
and ar_intf.interface_line_attribute6  (+) = to_char(mmt.source_line_id)
and ar_intf.interface_line_attribute7  (+) = to_char(mmt.transaction_id)
-- ar invoice
and ar_ico.interface_line_context      (+) = mmt.source_line_context
and ar_ico.interface_line_attribute6   (+) = to_char(mmt.source_line_id)
and ar_ico.interface_line_attribute7   (+) = to_char(mmt.transaction_id)
-- ap interface
and ap_intf.customer_trx_id            (+) = to_char(ar_ico.customer_trx_id)
and ap_intf.customer_trx_line_id       (+) = to_char(ar_ico.customer_trx_line_id)
-- ap invoice
and ap_ico.customer_trx_id             (+) = to_char(ar_ico.customer_trx_id)
and ap_ico.customer_trx_line_id        (+) = to_char(ar_ico.customer_trx_line_id)
-- sla accounting
&amp;lp_sla_joins
--
and 1=1
&amp;lp_group_by_columns
order by
  haou1.name
, haou2.name
, ar_ico.trx_date
, ar_ico.trx_number</SQL_TEXT>
  <VERSION_COMMENTS>Fixed bug in operating unit access restriction when the default operating unit is set to something else</VERSION_COMMENTS>
  <ENABLED>Y</ENABLED>
  <NUMBER_FORMAT>General</NUMBER_FORMAT>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>تسوية الفواتير بين الشركات الشقيقة لحركات المخزون ، بما في ذلك مؤسسات الشحن والاستلام والكميات المطلوبة والمعاملات والفواتير والمبالغ والاختلافات المحتملة.
ويشمل أيضًا جميع تفاصيل فاتورة المستحقات بين الشركات الشقيقة (AR) والذمم الدائنة (AP).</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Intercompany-Rechnungsabgleich für Bestandstransaktionen, einschließlich Versand- und Empfangsorganisationen, bestellte, getätigte und fakturierte Mengen, Beträge und mögliche Diskrepanzen.
Er umfasst auch alle unternehmensübergreifenden Rechnungsdetails für Forderungen (AR) und Verbindlichkeiten (AP).</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Conciliación de facturas entre empresas para las transacciones de inventario, incluidas las organizaciones de envío y recepción, las cantidades pedidas, tramitadas y facturadas, los importes y las posibles discrepancias.
También incluye todos los detalles de las facturas de cuentas por cobrar (AR) y por pagar (AP) entre empresas.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Rapprochement des factures interentreprises pour les transactions d&apos;inventaire, y compris les organismes d&apos;expédition et de réception, les quantités commandées, négociées et facturées, les montants et les écarts éventuels.
Il comprend également tous les détails des factures interentreprises à recevoir (AR) et à payer (AP).</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Riconciliazione delle fatture intercompany per le transazioni di inventario, comprese le organizzazioni di spedizione e ricezione, le quantità ordinate, transate e fatturate, gli importi e le possibili discrepanze.
Include anche tutti i dettagli delle fatture intercompany Receivables (AR) e Payables (AP).</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>出荷・入荷組織、発注、取引、請求された数量、金額、および不一致の可能性を含む在庫取引の企業間請求書の調整を行います。
また、すべての企業間の売掛金（AR）と買掛金（AP）の請求書の詳細も含まれています。</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>출하 및 입고 조직, 주문, 거래 및 송장 수량, 금액 및 가능한 불일치를 포함하여 재고 트랜잭션에 대한 본지사 송장 조정.
또한 모든 본지사 AR (미수금) 및 AP (미지급금) 송장 상세 내역도 포함됩니다.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Reconciliação de faturas entre empresas para transações de estoque, incluindo organizações de remessa e recebimento, quantidades pedidas, transacionadas e faturadas, valores e possíveis discrepâncias.
Também inclui todos os detalhes das faturas de Contas a Receber (AR) e Contas a Pagar (AP) interempresariais.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Внутригрупповая выверка счетов-фактур по операциям с товарно-материальными запасами, включая организации-отправители и организации-получатели, количества, суммы и возможные расхождения в заказах, операциях и выставленных счетах-фактурах.
Она также включает в себя все детали счетов-фактур по внутригрупповой дебиторской задолженности (АР) и кредиторской задолженности (ДП).</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Koncernredovisning för lagertransaktioner, inklusive frakt- och mottagande organisationer, beställda, transaktioner och fakturerade kvantiteter, belopp och eventuella avvikelser.
Den innehåller också alla interna företags fordringar (AR) och betalningar (AP) fakturauppgifter.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Nakliye ve alıcı organizasyonlar, sipariş edilen, işlem gören ve faturalandırılan miktarlar, tutarlar ve olası tutarsızlıklar dahil envanter işlemleri için şirketler arası fatura mutabakatı.
Ayrıca tüm şirketler arası Alacaklar (AR) ve Borçlar (AP) fatura ayrıntılarını içerir.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>Intercompany invoice reconciliation for inventory transactions, including shipping and receiving organizations, ordered, transacted and invoiced quantities, amounts and possible discrepancies.
It also includes all intercompany Receivables (AR) and Payables (AP) invoice details. Optionally includes the Inventory and Intercompany AP SLA Accounting</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <REPORT_NAME>INV Intercompany Invoice Reconciliation</REPORT_NAME>
    <DESCRIPTION>库存交易的公司间发票核对，包括运输和接收组织、订购、交易和发票数量、金额和可能的差异。
它还包括所有公司间应收账款（AR）和应付账款（AP）的发票细节。</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>R12 only</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;l_ap_sla_tables</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;l_category_set_name</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;l_inv_sla_tables</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_group_by_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_select_columns1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_select_columns2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_sla_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_sla_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_sla_joins</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_category_set_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_ico_source</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;lp_select_columns1</ANCHOR>
    <SQL_TEXT>  haou1.name                                          &quot;Shipping/Procuring OU (AR)&quot;
, haou2.name                                          &quot;Receiving OU (AP)&quot;
, mmt.source_document_qty                             ordered_qty
, -mmt.transaction_quantity                           inv_transacted_qty
, ar_ico.quantity_invoiced                            ico_invoiced_qty
, nvl(mmt.source_document_qty,0) - nvl(ar_ico.quantity_invoiced,0) ico_qty_diff
, ar_ico.extended_amount                              ar_ico_line_amount
, ap_ico.line_amount                                  ap_ico_line_amount
, nvl(ar_ico.extended_amount,0) - nvl(ap_ico.line_amount,0) ico_amount_diff
, mmt.source_document
, trunc(mmt.source_document_date) source_document_date 
, mmt.source_document_num
, mmt.source_document_line_num                        &quot;Source Line/Shipment Num&quot;
, mmt.source_document_qty
, (select muot.unit_of_measure_tl from mtl_units_of_measure_tl muot where mmt.source_document_uom=muot.uom_code and muot.language=userenv(&apos;lang&apos;)) source_document_uom
, mmt.receipt_number
, msik.concatenated_segments                          item
, msik.description item_description
, mmt.&amp;l_category_set_name
, ood1.organization_code                               shipping_warehouse
, ood1.organization_name shipping_warehouse_name
, ood2.organization_code                               receiving_warehouse
, ood2.organization_name receiving_warehouse_name
, mmt.transaction_id                                  inv_trx_id
, mttv.transaction_source_type_name                   inv_trx_source
, xxen_util.meaning(mmt.transaction_action_id,&apos;MTL_TRANSACTION_ACTION&apos;,700) inv_action
, mttv.transaction_type_name                      inv_trx_type
, trunc(mmt.transaction_date)                      inv_trx_date
, mmt.transaction_quantity                            inv_trx_qty
, (select muot.unit_of_measure_tl from mtl_units_of_measure_tl muot where mmt.transaction_uom=muot.uom_code and muot.language=userenv(&apos;lang&apos;)) inv_trx_uom
, mmt.primary_quantity                                inv_primary_qty
, mmt.transaction_cost                                inv_trx_cost
, mmt.actual_cost                                     inv_actual_cost
, mmt.transfer_price                                  inv_transfer_price
, mmt.currency_code                                   inv_currency
, mmt.currency_conversion_rate                        inv_exchange_rate
, (select gdct.user_conversion_type from gl_daily_conversion_types gdct where mmt.currency_conversion_type=gdct.conversion_type) inv_exchange_type
, mmt.currency_conversion_date                        inv_exchange_date
, xxen_util.meaning(mmt.costed_flag,&apos;YES_NO&apos;,0) inv_costed_flag
, xxen_util.meaning(mmt.invoiced_flag,&apos;YES_NO&apos;,0) inv_invoiced_flag
,mmt.requisition_number
,mmt.requisition_line
,mmt.requisition_unit_price
,mmt.requisition_requested_qty
,mmt.requisition_shipped_qty
,mmt.requisition_shipped_amount
,mmt.requisition_delivered_qty
,mmt.requisition_delivered_amount
,mmt.requisition_qty_variance
,mmt.requisition_cost_variance</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select value, description 
from
  (select &apos;Invoice Level&apos; value, null description from dual
   union
   select &apos;Invoice Line Level&apos;, null from dual
   union
   select &apos;Invoice Line and SLA Level&apos;, null from dual
  )
order by
  value</LOV_QUERY_DSP>
    <MATCHING_VALUE>Invoice Line Level</MATCHING_VALUE>
    <DEFAULT_VALUE>Invoice Line Level</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <ANCHOR>&amp;lp_select_columns1</ANCHOR>
    <SQL_TEXT>  haou1.name                                          &quot;Shipping/Procuring OU (AR)&quot;
, haou2.name                                          &quot;Receiving OU (AP)&quot;
, sum(ar_ico.extended_amount)                         ar_ico_line_amount
, sum(ap_ico.line_amount)                             ap_ico_line_amount
, sum(nvl(ar_ico.extended_amount,0) - nvl(ap_ico.line_amount,0))
                                                      ico_amount_diff
, mmt.source_document
, trunc(mmt.source_document_date) source_document_date 
, mmt.source_document_num
--
, ar_ico.customer_name                                ar_ico_customer_name
, ar_ico.customer_num                                 ar_ico_customer_num
, ar_ico.customer_location                            ar_ico_customer_location
, ar_ico.trx_number                                   ar_ico_inv_num
, ar_ico.trx_date                                     ar_ico_inv_date
, ar_ico.invoice_currency_code                        ar_ico_inv_curr
, ar_ico.amount_due_original                          ar_ico_inv_total_amount
, ar_ico.tax_original                                 ar_ico_inv_tax_amount
, sum(ar_ico.extended_amount)                         ar_ico_inv_line_amount
--
, ap_ico.vendor_name                                  ap_ico_vendor_name
, ap_ico.vendor_num                                   ap_ico_vendor_num
, ap_ico.vendor_site_code                             ap_ico_vendor_site
, ap_ico.invoice_num                                  ap_ico_inv_num
, ap_ico.invoice_date                                 ap_ico_inv_date
, ap_ico.invoice_currency_code                        ap_ico_inv_curr
, ap_ico.invoice_amount                               ap_ico_inv_total_amount
, ap_ico.total_tax_amount                             ap_ico_inv_tax_amount
, sum(ap_ico.line_amount)                             ap_ico_inv_line_amount</SQL_TEXT>
    <MATCHING_VALUE>Invoice Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <ANCHOR>&amp;lp_select_columns1</ANCHOR>
    <SQL_TEXT>  haou1.name                                          &quot;Shipping/Procuring OU (AR)&quot;
, haou2.name                                          &quot;Receiving OU (AP)&quot;
, mmt.source_document_qty                             ordered_qty
, -mmt.transaction_quantity                           inv_transacted_qty
, ar_ico.quantity_invoiced                            ico_invoiced_qty
, nvl(mmt.source_document_qty,0) - nvl(ar_ico.quantity_invoiced,0) ico_qty_diff
, ar_ico.extended_amount                              ar_ico_line_amount
, ap_ico.line_amount                                  ap_ico_line_amount
, nvl(ar_ico.extended_amount,0) - nvl(ap_ico.line_amount,0) ico_amount_diff
, mmt.source_document
, trunc(mmt.source_document_date) source_document_date
, mmt.source_document_num
, mmt.source_document_line_num                        &quot;Source Line/Shipment Num&quot;
, mmt.source_document_qty
, (select muot.unit_of_measure_tl from mtl_units_of_measure_tl muot where mmt.source_document_uom=muot.uom_code and muot.language=userenv(&apos;lang&apos;)) source_document_uom
, mmt.receipt_number
, msik.concatenated_segments                          item
, msik.description item_description
, mmt.&amp;l_category_set_name
, ood1.organization_code                               shipping_warehouse
, ood1.organization_name shipping_warehouse_name
, ood2.organization_code                               receiving_warehouse
, ood2.organization_name receiving_warehouse_name
, mmt.transaction_id                                  inv_trx_id
, mttv.transaction_source_type_name                   inv_trx_source
, xxen_util.meaning(mmt.transaction_action_id,&apos;MTL_TRANSACTION_ACTION&apos;,700) inv_action
, mttv.transaction_type_name                          inv_trx_type
, trunc(mmt.transaction_date)                      inv_trx_date
, mmt.transaction_quantity                            inv_trx_qty
, (select muot.unit_of_measure_tl from mtl_units_of_measure_tl muot where mmt.transaction_uom=muot.uom_code and muot.language=userenv(&apos;lang&apos;)) inv_trx_uom
, mmt.primary_quantity                                inv_primary_qty
, mmt.transaction_cost                                inv_trx_cost
, mmt.actual_cost                                     inv_actual_cost
, mmt.transfer_price                                  inv_transfer_price
, mmt.currency_code                                   inv_currency
, mmt.currency_conversion_rate                        inv_exchange_rate
, (select gdct.user_conversion_type from gl_daily_conversion_types gdct where mmt.currency_conversion_type=gdct.conversion_type) inv_exchange_type
, mmt.currency_conversion_date                        inv_exchange_date
, xxen_util.meaning(mmt.costed_flag,&apos;YES_NO&apos;,0) inv_costed_flag
, xxen_util.meaning(mmt.invoiced_flag,&apos;YES_NO&apos;,0) inv_invoiced_flag</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <ANCHOR>&amp;l_ap_sla_tables</ANCHOR>
    <SQL_TEXT>, sla3 as -- sla accounting for ap invoice
  (
   select
     aida.invoice_id
   , aida.invoice_line_number
   , xdl.event_id               sla_event_id
   , xal.accounting_class_code  sla_accounting_class
   , xal.accounted_dr           sla_accounted_dr
   , xal.accounted_cr           sla_accounted_cr
   , gcck.concatenated_segments sla_account
   from
     ap_invoice_distributions_all aida
   , xla_distribution_links       xdl
   , xla_ae_lines                 xal
   , gl_ledgers                   gl
   , gl_code_combinations_kfv     gcck
   where
           aida.line_type_lookup_code       = &apos;ITEM&apos;
   and aida.parent_reversal_id          is null
   and aida.reference_2                      is not null
   and xdl.source_distribution_type      = &apos;AP_INV_DIST&apos;
   and xdl.source_distribution_id_num_1  = aida.invoice_distribution_id
   and xdl.event_id                      = aida.accounting_event_id
   and xal.ae_header_id                  = xdl.ae_header_id
   and xal.ae_line_num                   = xdl.ae_line_num
   and xal.application_id                = xdl.application_id
   and xal.accounting_class_code         = &apos;ITEM EXPENSE&apos;
   and gl.ledger_id                      = xal.ledger_id
   and gl.ledger_category_code           = &apos;PRIMARY&apos;
   and gcck.code_combination_id          = xal.code_combination_id
  )
</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <ANCHOR>&amp;l_inv_sla_tables</ANCHOR>
    <SQL_TEXT>, sla1 as -- sla accounting for inventory transaction discrete
  (
    select
      mta.transaction_id
    , xdl.event_id               sla_event_id
    , xal.accounting_class_code  sla_accounting_class
    , xal.accounted_dr           sla_accounted_dr
    , xal.accounted_cr           sla_accounted_cr
    , gcck.concatenated_segments sla_account
    from
      mtl_transaction_accounts     mta
    , xla_distribution_links       xdl
    , xla_ae_lines                 xal
    , gl_ledgers                   gl
    , gl_code_combinations_kfv     gcck
    where
       mta.accounting_line_type              != 1 -- inventory valuation
    and xdl.source_distribution_type          = &apos;MTL_TRANSACTION_ACCOUNTS&apos;
    and xdl.source_distribution_id_num_1      = mta.inv_sub_ledger_id
    and xal.ae_header_id                      = xdl.ae_header_id
    and xal.ae_line_num                       = xdl.ae_line_num
   and xal.application_id                = xdl.application_id
    and xal.accounting_class_code            != &apos;INVENTORY_VALUATION&apos;
    and gl.ledger_id                          = xal.ledger_id
    and gl.ledger_category_code               = &apos;PRIMARY&apos;
    and gcck.code_combination_id              = xal.code_combination_id
  )
, sla2 as -- sla accounting for inventory transaction opm
  (
   select
     gxeh.transaction_id
   , xdl.event_id               sla_event_id
   , xal.accounting_class_code  sla_accounting_class
   , xal.accounted_dr           sla_accounted_dr
   , xal.accounted_cr           sla_accounted_cr
   , gcck.concatenated_segments sla_account
   from
     gmf_xla_extract_headers      gxeh
   , gmf_xla_extract_lines        gxel
   , xla_distribution_links       xdl
   , xla_ae_lines                 xal
   , gl_ledgers                   gl
   , gl_code_combinations_kfv     gcck
   where
       gxel.header_id                    = gxeh.header_id
   and gxel.event_id                     = gxeh.event_id
   and gxel.journal_line_type           != &apos;INV&apos;
   and xdl.source_distribution_type      = gxeh.entity_code
   and xdl.source_distribution_id_num_1  = gxel.line_id
   and xdl.event_id                      = gxeh.event_id
   and xal.ae_header_id                  = xdl.ae_header_id
   and xal.ae_line_num                   = xdl.ae_line_num
   and xal.application_id                = xdl.application_id
   and xal.accounting_class_code        != &apos;INVENTORY_VALUATION&apos;
   and gl.ledger_id                      = xal.ledger_id
   and gl.ledger_category_code           = &apos;PRIMARY&apos;
   and gcck.code_combination_id          = xal.code_combination_id
  )
</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <ANCHOR>&amp;lp_group_by_columns</ANCHOR>
    <SQL_TEXT>group by
  haou1.name
, haou2.name
, mmt.source_document
, mmt.source_document_date
, mmt.source_document_num
--
, ar_ico.customer_name
, ar_ico.customer_num
, ar_ico.customer_location
, ar_ico.trx_number
, ar_ico.trx_date
, ar_ico.invoice_currency_code
, ar_ico.amount_due_original
, ar_ico.tax_original
--
, ap_ico.vendor_name
, ap_ico.vendor_num
, ap_ico.vendor_site_code
, ap_ico.invoice_num
, ap_ico.invoice_date
, ap_ico.invoice_currency_code
, ap_ico.invoice_amount
, ap_ico.total_tax_amount</SQL_TEXT>
    <MATCHING_VALUE>Invoice Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <ANCHOR>&amp;lp_group_by_columns</ANCHOR>
    <SQL_TEXT>select null from dual</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <ANCHOR>&amp;lp_group_by_columns</ANCHOR>
    <SQL_TEXT>select null from dual</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <ANCHOR>&amp;lp_select_columns2</ANCHOR>
    <SQL_TEXT>select null from dual</SQL_TEXT>
    <MATCHING_VALUE>Invoice Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <ANCHOR>&amp;lp_select_columns2</ANCHOR>
    <SQL_TEXT>, ar_ico.customer_name           ar_ico_customer_name
, ar_ico.customer_num            ar_ico_customer_num
, ar_ico.customer_location       ar_ico_customer_location
, ar_ico.trx_number              ar_ico_inv_num
, ar_ico.trx_date                ar_ico_inv_date
, ar_ico.invoice_currency_code   ar_ico_inv_curr
, ar_ico.status                  ar_ico_inv_status
, ar_ico.amount_due_original     ar_ico_inv_total_amount
, ar_ico.tax_original            ar_ico_inv_tax_amount
, ar_ico.exchange_rate           ar_ico_inv_exchange_rate
, (select gdct.user_conversion_type from gl_daily_conversion_types gdct where ar_ico.exchange_rate_type=gdct.conversion_type) ar_ico_inv_exchange_type
, ar_ico.exchange_date           ar_ico_inv_exchange_date
, ar_ico.line_number             ar_ico_inv_line_num
, ar_ico.quantity_invoiced       ar_ico_inv_line_qty
, ar_ico.uom_code                ar_ico_inv_line_uom
, ar_ico.unit_selling_price      ar_ico_inv_line_unit_price
, ar_ico.extended_amount         ar_ico_inv_line_amount
, ar_ico.tax_type                ar_ico_inv_tax_type
, ar_ico.tax_rate_code           ar_ico_inv_tax_rate_code
, ar_ico.tax_rate                ar_ico_inv_tax_rate
--
, ap_ico.vendor_name             ap_ico_vendor_name
, ap_ico.vendor_num              ap_ico_vendor_num
, ap_ico.vendor_site_code        ap_ico_vendor_site
, ap_ico.invoice_num             ap_ico_inv_num
, ap_ico.invoice_date            ap_ico_inv_date
, ap_ico.invoice_currency_code   ap_ico_inv_curr
, ap_ico.invoice_amount          ap_ico_inv_total_amount
, ap_ico.total_tax_amount        ap_ico_inv_tax_amount
, ap_ico.exchange_rate           ap_ico_inv_exchange_rate
, (select gdct.user_conversion_type from gl_daily_conversion_types gdct where ap_ico.exchange_rate_type=gdct.conversion_type) ap_ico_inv_exchange_type
, ap_ico.exchange_date           ap_ico_inv_exchange_date
, ap_ico.line_number             ap_ico_inv_line_num
,ap_ico.line_source              ap_ico_inv_line_source
, ap_ico.line_discarded_flag     ap_ico_inv_line_discarded
, ap_ico.quantity_invoiced       ap_ico_inv_qty
, ap_ico.unit_meas_lookup_code   ap_ico_inv_uom
, ap_ico.unit_price              ap_ico_inv_line_unit_price
, ap_ico.line_amount             ap_ico_inv_line_amount
, ap_ico.tax_type                ap_ico_inv_tax_type
, ap_ico.tax_rate_code           ap_ico_inv_tax_rate_code
, ap_ico.tax_rate                ap_ico_inv_tax_rate
--
, case nvl(ar_ico.customer_trx_id,-99)
    when -99
    then case nvl(ar_intf.interface_line_attribute6,&apos;??&apos;)
         when &apos;??&apos; then &apos;NOT POPULATED&apos;
         else case nvl(ar_intf.request_id,-99)
              when -99 then &apos;UNPROCESSED&apos;
              else nvl(ar_intf.interface_status,&apos;ERROR&apos;)
              end
         end
    else null
  end                            ar_interface_status
, case nvl(ar_ico.customer_trx_id,-99)
    when -99
    then ar_intf.error
    else null
  end                            ar_interface_error
--
, case nvl(ap_ico.invoice_id,-99)
    when -99
    then case nvl(ap_intf.invoice_id,-99)
         when -99 then &apos;NOT POPULATED&apos;
         else case nvl(ap_intf.request_id,-99)
              when -99 then &apos;UNPROCESSED&apos;
              else ap_intf.status
              end
         end
    else null
  end                            ap_interface_status
, case nvl(ap_ico.invoice_id,-99)
    when -99
    then ap_intf.error_h ||
         nvl2(ap_intf.error_h || ap_intf.error_l,chr(10),null) ||
         ap_intf.error_l
    else null
  end                            ap_interface_error</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>11</SORT_ORDER>
    <ANCHOR>&amp;lp_select_columns2</ANCHOR>
    <SQL_TEXT>, ar_ico.customer_name           ar_ico_customer_name
, ar_ico.customer_num            ar_ico_customer_num
, ar_ico.customer_location       ar_ico_customer_location
, ar_ico.trx_number              ar_ico_inv_num
, ar_ico.trx_date                ar_ico_inv_date
, ar_ico.invoice_currency_code   ar_ico_inv_curr
, ar_ico.status                  ar_ico_inv_status
, ar_ico.amount_due_original     ar_ico_inv_total_amount
, ar_ico.tax_original            ar_ico_inv_tax_amount
, ar_ico.exchange_rate           ar_ico_inv_exchange_rate
, (select gdct.user_conversion_type from gl_daily_conversion_types gdct where ar_ico.exchange_rate_type=gdct.conversion_type) ar_ico_inv_exchange_type
, ar_ico.exchange_date           ar_ico_inv_exchange_date
, ar_ico.line_number             ar_ico_inv_line_num
, ar_ico.quantity_invoiced       ar_ico_inv_line_qty
, ar_ico.uom_code                ar_ico_inv_line_uom
, ar_ico.unit_selling_price      ar_ico_inv_line_unit_price
, ar_ico.extended_amount         ar_ico_inv_line_amount
, ar_ico.tax_type                ar_ico_inv_tax_type
, ar_ico.tax_rate_code           ar_ico_inv_tax_rate_code
, ar_ico.tax_rate                ar_ico_inv_tax_rate
--
, ap_ico.vendor_name             ap_ico_vendor_name
, ap_ico.vendor_num              ap_ico_vendor_num
, ap_ico.vendor_site_code        ap_ico_vendor_site
, ap_ico.invoice_num             ap_ico_inv_num
, ap_ico.invoice_date            ap_ico_inv_date
, ap_ico.invoice_currency_code   ap_ico_inv_curr
, ap_ico.invoice_amount          ap_ico_inv_total_amount
, ap_ico.total_tax_amount        ap_ico_inv_tax_amount
, ap_ico.exchange_rate           ap_ico_inv_exchange_rate
, (select gdct.user_conversion_type from gl_daily_conversion_types gdct where ap_ico.exchange_rate_type=gdct.conversion_type) ap_ico_inv_exchange_type
, ap_ico.exchange_date           ap_ico_inv_exchange_date
, ap_ico.line_number             ap_ico_inv_line_num
,ap_ico.line_source              ap_ico_inv_line_source
, ap_ico.line_discarded_flag     ap_ico_inv_line_discarded
, ap_ico.quantity_invoiced       ap_ico_inv_qty
, ap_ico.unit_meas_lookup_code   ap_ico_inv_uom
, ap_ico.unit_price              ap_ico_inv_line_unit_price
, ap_ico.line_amount             ap_ico_inv_line_amount
, ap_ico.tax_type                ap_ico_inv_tax_type
, ap_ico.tax_rate_code           ap_ico_inv_tax_rate_code
, ap_ico.tax_rate                ap_ico_inv_tax_rate
--
, case nvl(ar_ico.customer_trx_id,-99)
    when -99
    then case nvl(ar_intf.interface_line_attribute6,&apos;??&apos;)
         when &apos;??&apos; then &apos;NOT POPULATED&apos;
         else case nvl(ar_intf.request_id,-99)
              when -99 then &apos;UNPROCESSED&apos;
              else nvl(ar_intf.interface_status,&apos;ERROR&apos;)
              end
         end
    else null
  end                            ar_interface_status
, case nvl(ar_ico.customer_trx_id,-99)
    when -99
    then ar_intf.error
    else null
  end                            ar_interface_error
--
, case nvl(ap_ico.invoice_id,-99)
    when -99
    then case nvl(ap_intf.invoice_id,-99)
         when -99 then &apos;NOT POPULATED&apos;
         else case nvl(ap_intf.request_id,-99)
              when -99 then &apos;UNPROCESSED&apos;
              else ap_intf.status
              end
         end
    else null
  end                            ap_interface_status
, case nvl(ap_ico.invoice_id,-99)
    when -99
    then ap_intf.error_h ||
         nvl2(ap_intf.error_h || ap_intf.error_l,chr(10),null) ||
         ap_intf.error_l
    else null
  end                            ap_interface_error</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>12</SORT_ORDER>
    <ANCHOR>&amp;lp_sla_columns</ANCHOR>
    <SQL_TEXT>, sla3.sla_accounted_dr             ap_sla_accounted_dr
, sla3.sla_accounted_cr             ap_sla_accounted_cr
, sla3.sla_account                  ap_sla_account
, nvl(sla1.sla_accounting_class
     ,sla2.sla_accounting_class)      inv_sla_accounting_class
, case when sla1.sla_event_id is not null
  then sla1.sla_accounted_dr
  else sla2.sla_accounted_dr
  end                                 inv_sla_accounted_dr
, case when sla1.sla_event_id is not null
  then sla1.sla_accounted_cr
  else sla2.sla_accounted_cr
  end                                 inv_sla_accounted_cr
, case when sla1.sla_event_id is not null
  then sla1.sla_account
  else sla2.sla_account
  end                                 inv_sla_account
</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>13</SORT_ORDER>
    <ANCHOR>&amp;lp_sla_from</ANCHOR>
    <SQL_TEXT>, sla1                         sla1
, sla2                         sla2
, sla3                         sla3
</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>14</SORT_ORDER>
    <ANCHOR>&amp;lp_sla_joins</ANCHOR>
    <SQL_TEXT>and sla1.transaction_id                (+) = mmt.sla_inv_transaction_id
and sla2.transaction_id                (+) = mmt.sla_inv_transaction_id
and sla3.invoice_id                    (+) = ap_ico.invoice_id
and sla3.invoice_line_number           (+) = ap_ico.line_number
</SQL_TEXT>
    <MATCHING_VALUE>Invoice Line and SLA Level</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Detail</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>15</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haou1.name = :p_ship_ou</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>
    <DEFAULT_VALUE>coalesce(xxen_util.default_operating_unit,xxen_util.previous_parameter_value(:parameter_id))</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Shipping/Procuring Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>16</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haou2.name = :p_sell_ou</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>Receiving Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>17</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>mmt.transaction_date &gt;= :p_date_fr</SQL_TEXT>
    <PARAMETER_TYPE_DSP>DateTime</PARAMETER_TYPE_DSP>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Shipment/Receiving Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>18</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>mmt.transaction_date &lt; :p_date_to + 1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>DateTime</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>:$flex$.shipment_receiving_date_from</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Shipment/Receiving Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>19</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>:p_category_set_id</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV_SRS_CATEGORY_SET</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
category_set_id id,
category_set_name value,
description description
from
mtl_category_sets
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select
nvl(
(select mcs.category_set_id from mtl_category_sets mcs where mcs.category_set_name = &apos;Intrastat Commodity&apos;),
(select mdcs.category_set_id from mtl_default_category_sets mdcs where mdcs.functional_area_id=1)
) from dual</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Display Item Category Set</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>20</SORT_ORDER>
    <ANCHOR>&amp;l_category_set_name</ANCHOR>
    <SQL_TEXT>select &apos;&quot;&apos; || substr(mcs.category_set_name || &apos; Category&apos;,1,28) || &apos;&quot;&apos;
from mtl_category_sets mcs
where mcs.category_set_id = :p_category_set_id</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Display Item Category Set</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>21</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>:p_ico_source</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select l.value, l.description
from
(select &apos;Purchase Order&apos; value ,null description from dual union
 select &apos;Sales Order&apos;,null from dual union
 select &apos;Internal Sales Order&apos;, null from dual
) l
order by l.value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Intercompany Source</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>22</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>nvl(mmt.source_document_qty,0) - nvl(ar_ico.quantity_invoiced,0) != 0</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Quantity Variance only</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>23</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>nvl(ar_ico.extended_amount,0) - nvl(ap_ico.line_amount,0) != 0</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Amount Variance only</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.shipment_receiving_date_from</FLEX_BIND>
    <PARAMETER_NAME>Shipment/Receiving Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Shipment/Receiving Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
  </PARAMETER_DEPENDENCIES>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
  <UPLOAD_DEPENDENCIES>
  </UPLOAD_DEPENDENCIES>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
