<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: CAC Invoice Price Variance -->
 <REPORTS_ROW>
  <GUID>BFE414C441F75EAEE053BB6B63587750</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>select
gl.name ledger,
haouv_ou.name operating_unit,
mp.organization_code org_code,
x.period_name,
&amp;segment_columns
x.type,
xxen_util.meaning(x.accounting_class_code,&apos;XLA_ACCOUNTING_CLASS&apos;,602) accounting_class_code,
x.supplier,
x.buyer,
msiv.concatenated_segments item_number,
nvl(msiv.description,x.item_description) item_description,
xxen_util.meaning(msiv.item_type,&apos;ITEM_TYPE&apos;,3) user_item_type,
&amp;category_columns
xxen_util.meaning(x.destination_type_code,&apos;DESTINATION TYPE&apos;,201) destination_type,
x.po_number,
x.po_line,
x.po_release,
x.invoice_number,
decode(x.ipv_distribution_line_number,0,null,x.ipv_distribution_line_number) ipv_invoice_line,
decode(x.erv_distribution_line_number,0,null,x.erv_distribution_line_number) erv_invoice_line,
x.invoice_date,
x.accounting_date,
x.po_uom,
x.invoice_quantity,
nvl(x.po_currency_code,gl.currency_code) po_currency_code,
x.po_unit_price,
nvl(x.po_rate,1) po_exchange_rate,
gl.currency_code gl_currency_code,
round(nvl(x.po_rate,1)*x.po_unit_price,6) converted_po_unit_price,
nvl(x.po_rate,1)*x.po_unit_price*x.invoice_quantity total_po_amount,
nvl(x.invoice_currency_code,gl.currency_code) invoice_currency_code,
x.unit_price payables_unit_cost,
nvl(x.exchange_rate,1) payables_exchange_rate,
round(nvl(x.unit_price,0)*nvl(x.exchange_rate,1),6) converted_invoice_unit_cost,
decode(x.section,&apos;WO&apos;,0,round(nvl(x.unit_price,0)*nvl(x.exchange_rate,1),6)-round(nvl(x.po_rate,1)*x.po_unit_price,6)) unit_cost_variance,
round(nvl(x.unit_price,0)*nvl(x.exchange_rate,1)*x.invoice_quantity,2) total_invoice_amount,
round((nvl(x.unit_price,0)*nvl(x.exchange_rate,1)-nvl(x.po_rate,1)*x.po_unit_price)*x.invoice_quantity,2) total_calculated_ipv,
x.ipv_amount general_ledger_ipv_amount,
x.erv_amount general_ledger_erv_amount,
round((nvl(x.unit_price,0)*nvl(x.exchange_rate,1)-nvl(x.po_rate,1)*x.po_unit_price)*x.invoice_quantity/abs(decode(nvl(x.po_rate,1)*x.po_unit_price*x.invoice_quantity,0,1,nvl(x.po_rate,1)*x.po_unit_price*x.invoice_quantity))*100,1) percent
from
(
select
&apos;INV&apos; section,
v.ledger_id,
v.period_name,
plla.ship_to_organization_id organization_id,
aia.org_id,
pla.item_id inventory_item_id,
null item_description,
v.ipv_code_combination_id,
v.erv_code_combination_id,
v.type,
v.accounting_class_code,
aps.vendor_name supplier,
(select he.full_name from hr_employees he where pha.agent_id=he.employee_id) buyer,
v.destination_type_code,
pha.segment1 po_number,
to_char(pla.line_num) po_line,
pra.release_num po_release,
aia.invoice_num invoice_number,
v.ipv_distribution_line_number,
v.erv_distribution_line_number,
aia.invoice_date,
v.accounting_date,
pla.unit_meas_lookup_code po_uom,
v.quantity_invoiced*mucv.conversion_rate invoice_quantity,
pha.currency_code po_currency_code,
plla.price_override po_unit_price,
v.rate po_rate,
aia.invoice_currency_code,
v.unit_price,
aia.exchange_rate,
v.ipv_amount,
v.erv_amount
from
(
select
y.invoice_id,
y.period_name,
y.ledger_id,
y.accounting_date,
y.ipv_code_combination_id,
y.erv_code_combination_id,
y.type,
y.accounting_class_code,
y.ipv_distribution_line_number,
y.erv_distribution_line_number,
y.po_line_id,
y.line_location_id,
y.rate,
y.destination_type_code,
sum(nvl(aida.quantity_invoiced,0)) quantity_invoiced,
sum(nvl(aida.unit_price,0)) unit_price,
sum(y.ipv_amount) ipv_amount,
sum(y.erv_amount) erv_amount
from
(
select
z.invoice_id,
z.period_name,
z.ledger_id,
z.accounting_date,
max(z.ipv_code_combination_id) ipv_code_combination_id,
max(z.erv_code_combination_id) erv_code_combination_id,
&apos;IPV-ERV&apos; type,
max(z.accounting_class_code) accounting_class_code,
max(z.ipv_distribution_line_number) ipv_distribution_line_number,
max(z.erv_distribution_line_number) erv_distribution_line_number,
max(z.ipv_invoice_distribution_id) ipv_invoice_distribution_id,
max(z.erv_invoice_distribution_id) erv_invoice_distribution_id,
z.invoice_line_number,
z.matched_uom_lookup_code,
z.po_distribution_id,
z.quantity_invoiced,
z.related_id,
z.unit_price,
sum(z.ipv_amount) ipv_amount,
sum(z.erv_amount) erv_amount,
z.po_line_id,
z.line_location_id,
z.rate,
z.destination_type_code
from
(
select
aida.invoice_id,
aida.period_name,
xal.ledger_id,
aida.accounting_date,
decode(aida.line_type_lookup_code,&apos;IPV&apos;,xal.code_combination_id) ipv_code_combination_id,
decode(aida.line_type_lookup_code,&apos;ERV&apos;,xal.code_combination_id) erv_code_combination_id,
xal.accounting_class_code,
decode(aida.line_type_lookup_code,&apos;IPV&apos;,aida.invoice_line_number) ipv_distribution_line_number,
decode(aida.line_type_lookup_code,&apos;ERV&apos;,aida.invoice_line_number) erv_distribution_line_number,
decode(aida.line_type_lookup_code,&apos;IPV&apos;,aida.invoice_distribution_id) ipv_invoice_distribution_id,
decode(aida.line_type_lookup_code,&apos;ERV&apos;,aida.invoice_distribution_id) erv_invoice_distribution_id,
aida.invoice_line_number,
aida.matched_uom_lookup_code,
aida.po_distribution_id,
aida.quantity_invoiced,
aida.related_id,
aida.unit_price,
decode(aida.line_type_lookup_code,&apos;IPV&apos;,aida.base_amount,0) ipv_amount,
decode(aida.line_type_lookup_code,&apos;ERV&apos;,aida.base_amount,0) erv_amount,
pda.po_line_id,
pda.line_location_id,
pda.rate,
pda.destination_type_code
from
ap_invoice_distributions_all aida,
po_distributions_all pda,
xla_distribution_links xdl,
xla_ae_lines xal
where
2=2 and
aida.line_type_lookup_code in (&apos;IPV&apos;,&apos;ERV&apos;) and
aida.po_distribution_id=pda.po_distribution_id and
pda.destination_type_code&lt;&gt;&apos;EXPENSE&apos; and
aida.invoice_distribution_id=xdl.source_distribution_id_num_1 and
xdl.source_distribution_type=&apos;AP_INV_DIST&apos; and
xdl.application_id=200 and
xdl.ae_header_id=xal.ae_header_id and
xdl.ae_line_num=xal.ae_line_num and
xal.application_id=200 and
xal.accounting_class_code=decode(aida.line_type_lookup_code,&apos;IPV&apos;,&apos;IPV&apos;,&apos;EXCHANGE_RATE_VARIANCE&apos;)
) z
group by
z.invoice_id,
z.period_name,
z.ledger_id,
z.accounting_date,
z.invoice_line_number,
z.matched_uom_lookup_code,
z.po_distribution_id,
z.quantity_invoiced,
z.related_id,
z.unit_price,
z.po_line_id,
z.line_location_id,
z.rate,
z.destination_type_code
) y,
ap_invoice_distributions_all aida
where
y.related_id=aida.related_id and
aida.line_type_lookup_code=&apos;ACCRUAL&apos;
group by
y.invoice_id,
y.period_name,
y.ledger_id,
y.accounting_date,
y.ipv_code_combination_id,
y.erv_code_combination_id,
y.type,
y.accounting_class_code,
y.ipv_distribution_line_number,
y.erv_distribution_line_number,
y.ipv_invoice_distribution_id,
y.erv_invoice_distribution_id,
y.invoice_line_number,
aida.matched_uom_lookup_code,
y.po_distribution_id,
y.related_id,
y.po_line_id,
y.line_location_id,
y.rate,
y.destination_type_code
) v,
ap_invoices_all aia,
po_line_locations_all plla,
po_lines_all pla,
po_headers_all pha,
po_releases_all pra,
ap_suppliers aps,
mtl_uom_conversions_view mucv
where
v.invoice_id=aia.invoice_id and
v.line_location_id=plla.line_location_id and
v.po_line_id=pla.po_line_id and
plla.po_line_id=pla.po_line_id and
pla.po_header_id=pha.po_header_id and
aia.org_id=pha.org_id and
plla.po_release_id=pra.po_release_id(+) and
pha.vendor_id=aps.vendor_id and
plla.ship_to_organization_id=mucv.organization_id and
pla.item_id=mucv.inventory_item_id and
pla.unit_meas_lookup_code=mucv.unit_of_measure
union all
select
&apos;WO&apos; section,
w.ledger_id,
w.period_name,
w.organization_id,
to_number(null) org_id,
w.inventory_item_id,
w.item_description,
w.code_combination_id ipv_code_combination_id,
to_number(null) erv_code_combination_id,
w.write_off_type type,
w.accounting_class_code,
w.vendor_name supplier,
w.full_name buyer,
w.destination_type_code,
w.po_number,
w.po_line,
w.release_num po_release,
null invoice_number,
w.ipv_distribution_line_number,
0 erv_distribution_line_number,
w.invoice_date,
w.accounting_date,
w.unit_meas_lookup_code po_uom,
w.quantity_invoiced*w.conversion_rate invoice_quantity,
w.currency_code po_currency_code,
w.price_override po_unit_price,
w.rate po_rate,
w.invoice_currency_code,
w.unit_price,
w.exchange_rate,
w.ipv_amount,
0 erv_amount
from
(
select
cwo.write_off_id,
xal.ledger_id,
xah.period_name,
xal.code_combination_id,
xal.accounting_class_code,
cwo.destination_type_code,
cwo.transaction_date accounting_date,
nvl(cwo.currency_conversion_rate,1) conversion_rate,
cwo.currency_code,
decode(cwo.inventory_transaction_id,null,decode(cwo.po_distribution_id,null,&apos;AP No PO WO&apos;,&apos;AP-PO WO&apos;),&apos;INV WO&apos;) write_off_type,
case
when cwo.inventory_transaction_id is not null then (select max(mta.organization_id) from mtl_transaction_accounts mta where cwo.inventory_transaction_id=mta.transaction_id and cwo.accrual_account_id=mta.reference_account)
when cwo.po_distribution_id is not null then plla.ship_to_organization_id
else (select osp.master_organization_id from oe_system_parameters_all osp where aida.org_id=osp.org_id)
end organization_id,
coalesce(mmt.inventory_item_id,pla.item_id) inventory_item_id,
coalesce(pla.item_description,aida.description) item_description,
coalesce(aps_po.vendor_name,aps_ap.vendor_name) vendor_name,
nvl((select he.full_name from hr_employees he where pha.agent_id=he.employee_id),(select fu.user_name from fnd_user fu where nvl(mmt.created_by,aia.created_by)=fu.user_id)) full_name,
pha.segment1 po_number,
to_char(pla.line_num) po_line,
pra.release_num,
nvl(aida.distribution_line_number,0) ipv_distribution_line_number,
aia.invoice_date,
coalesce(pla.unit_meas_lookup_code,aida.matched_uom_lookup_code,aia.invoice_currency_code,(select msiv.primary_unit_of_measure from mtl_system_items_vl msiv where mmt.organization_id=msiv.organization_id and mmt.inventory_item_id=msiv.inventory_item_id)) unit_meas_lookup_code,
coalesce((select sum(mta.primary_quantity) from mtl_transaction_accounts mta where cwo.inventory_transaction_id=mta.transaction_id and cwo.accrual_account_id=mta.reference_account),aida.quantity_invoiced,0) quantity_invoiced,
coalesce(mmt.actual_cost,plla.price_override,0) price_override,
coalesce(mmt.currency_conversion_rate,pda.rate,pha.rate,1) rate,
aia.invoice_currency_code,
nvl(aida.unit_price,0) unit_price,
nvl(aida.exchange_rate,1) exchange_rate,
sum(nvl(xal.accounted_dr,0)-nvl(xal.accounted_cr,0)) ipv_amount
from
cst_write_offs cwo,
mtl_material_transactions mmt,
po_distributions_all pda,
po_line_locations_all plla,
po_lines_all pla,
po_headers_all pha,
po_releases_all pra,
ap_suppliers aps_po,
ap_invoice_distributions_all aida,
ap_invoices_all aia,
ap_suppliers aps_ap,
xla_distribution_links xdl,
xla_ae_lines xal,
xla_ae_headers xah
where
cwo.transaction_date&gt;=:p_trx_date_from and
cwo.transaction_date&lt;:p_trx_date_to+1 and
cwo.inventory_transaction_id=mmt.transaction_id(+) and
cwo.po_distribution_id=pda.po_distribution_id(+) and
pda.line_location_id=plla.line_location_id(+) and
pda.po_line_id=pla.po_line_id(+) and
pda.po_header_id=pha.po_header_id(+) and
plla.po_release_id=pra.po_release_id(+) and
pha.vendor_id=aps_po.vendor_id(+) and
cwo.invoice_distribution_id=aida.invoice_distribution_id(+) and
aida.invoice_id=aia.invoice_id(+) and
aia.vendor_id=aps_ap.vendor_id(+) and
cwo.write_off_id=xdl.source_distribution_id_num_1 and
xdl.source_distribution_type=&apos;CST_WRITE_OFFS&apos; and
xdl.application_id=707 and
xdl.ae_header_id=xal.ae_header_id and
xdl.ae_line_num=xal.ae_line_num and
xal.application_id=707 and
xal.ae_header_id=xah.ae_header_id and
xal.application_id=xah.application_id
group by
cwo.write_off_id,
xal.ledger_id,
xah.period_name,
xal.code_combination_id,
xal.accounting_class_code,
cwo.destination_type_code,
cwo.transaction_date,
cwo.currency_conversion_rate,
cwo.currency_code,
cwo.inventory_transaction_id,
cwo.po_distribution_id,
cwo.accrual_account_id,
plla.ship_to_organization_id,
aida.org_id,
mmt.inventory_item_id,
mmt.organization_id,
mmt.created_by,
mmt.actual_cost,
mmt.currency_conversion_rate,
pla.item_id,
pla.item_description,
aida.description,
aps_po.vendor_name,
aps_ap.vendor_name,
pha.agent_id,
aia.created_by,
pha.segment1,
pla.line_num,
pra.release_num,
aida.distribution_line_number,
aia.invoice_date,
pla.unit_meas_lookup_code,
aida.matched_uom_lookup_code,
aia.invoice_currency_code,
aida.quantity_invoiced,
plla.price_override,
pda.rate,
pha.rate,
aida.unit_price,
aida.exchange_rate
) w
) x,
mtl_parameters mp,
hr_organization_information hoi,
hr_all_organization_units_vl haouv_ou,
gl_ledgers gl,
mtl_system_items_vl msiv,
gl_code_combinations gcc1,
gl_code_combinations gcc2
where
1=1 and
3=3 and
mp.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;) and
x.organization_id=mp.organization_id and
mp.organization_id=hoi.organization_id and
hoi.org_information_context=&apos;Accounting Information&apos; and
to_number(hoi.org_information3)=haouv_ou.organization_id and
nvl(x.org_id,haouv_ou.organization_id)=haouv_ou.organization_id and
x.ledger_id=gl.ledger_id and
x.organization_id=msiv.organization_id(+) and
x.inventory_item_id=msiv.inventory_item_id(+) and
x.ipv_code_combination_id=gcc1.code_combination_id(+) and
x.erv_code_combination_id=gcc2.code_combination_id(+)
order by
gl.name,
haouv_ou.name,
mp.organization_code,
x.period_name,
x.type,
accounting_class_code,
x.supplier,
x.buyer,
item_number,
x.po_number,
x.po_line,
x.po_release,
x.invoice_number,
x.accounting_date</SQL_TEXT>
  <VERSION_COMMENTS>Rebuilt to the Blitz Report SQL standards: cost write-offs are reported (the write-off sections used date binds that no parameter provided, so they never returned rows), one write-off row per write-off and ledger, the duplicate GL Currency Code column is removed. Organization security from the Blitz Report organization access, with operating unit and ledger security through profiles Blitz Report Use Operating Unit Security and Blitz Report Use Ledger Security.</VERSION_COMMENTS>
  <NUMBER_FORMAT>#,##0.00000;[Red](#,##0.00000)</NUMBER_FORMAT>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>CAC Invoice Price Variance</REPORT_NAME>
    <DESCRIPTION>Report to display the Invoice Price Variances (IPV), Exchange Rate Variances (ERV) and A/P Accrual Write-Off Variances for an entered date range.  IPV is the difference between the PO unit price and the invoice unit cost times the quantity invoiced.  ERV is the difference between the purchase order exchange rate and the exchange rate used by the A/P invoice.  For a given invoice line, both the IPV and ERV amounts will be shown on the same row, in separate columns.  These entries have the Type &quot;IPV-ERV&quot;.  The A/P Accrual Write-Off Variances appear as separate rows with the Type &quot;INV WO&quot; for invoice write-off amounts.  The A/P Accrual Write-Off Variances typically use the IPV account so for completeness, are also displayed on this report.  

/* +=============================================================================+
-- |  Copyright 2006-2021 Douglas Volz Consulting, Inc.                          |
-- |  All rights reserved.                                                       |
-- +=============================================================================+
-- |
-- |  Original Author: Douglas Volz (doug@volzconsulting.com)
-- |
-- |  Program Name:  xxx_ipv_rept.sql
-- |
-- |  Parameters:
-- |  p_trx_date_from        -- starting accounting date for the payables invoices
-- |  p_trx_date_to          -- ending accounting date for the payables invoices
-- |  p_category_set1        -- The first item category set to report, typically the
-- |                            Cost or Product Line Category Set
-- |  p_category_set2        -- The second item category set to report, typically the
-- |                            Inventory Category Set 
-- |  p_vendor_name          -- Vendor you want to report (optional)
-- |  p_operating_unit       -- Operating Unit you wish to report, leave blank for all
-- |                            operating units (optional) 
-- |  p_ledger               -- general ledger you wish to report, leave blank for all
-- |                            ledgers (optional)
-- |
-- |  Description:
-- |  Report to display the invoice price variances for an entered date range.
-- |  IPV is the difference between the PO unit price and the invoice unit
-- |  cost times the quantity invoiced.
-- | 
-- |  Version Modified on Modified  by   Description
-- |  ======= =========== ============== =========================================
-- |  1.0     01 Jun 2006 Douglas Volz   Initial Coding based on XXX_IPV_REPT.sql
-- |  1.1     17 Apr 2010 Douglas Volz   Modified for Release 12 for Client, the IPV
-- |                                     columns are now null as a new line type
-- |                                     exists for IPV in AID, and the amount columns
-- |                                     only have the PO amounts, not the total invoice
-- |                                     amount.
-- |  1.11    22 May 2017 Douglas Volz   Added product type, business code, product family and
-- |                                     and product line inventory categories
-- |  1.12    20 Jul 2019 Douglas Volz   Removed all item categories except COSTING.
-- |  1.13    18 Feb 2021 Douglas Volz   Changed to multi-org views for items, categories
-- |                                     and HR organizations.
-- |  1.14    12 Apr 2021 Douglas Volz   Removed redundant joins and tables to improve performance.
-- |  1.15    23 Oct 2026 Andy Haack    Rebuilt to the Blitz Report SQL standards.
-- +=============================================================================+*/
</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;category_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;segment_columns</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>:p_trx_date_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_trx_date_to</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;IPV &apos;||substrb(x.form_left_prompt,1,xxen_report.max_column_length-9)||&apos;&quot;,&apos; text from x union all
select &apos;gcc2.&apos;||lower(x.application_column_name)||&apos; &quot;ERV &apos;||substrb(x.form_left_prompt,1,xxen_report.max_column_length-9)||&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>
    <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 ood.chart_of_accounts_id from org_organization_definitions ood where ood.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;))
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 gl.chart_of_accounts_id from gl_ledgers gl where gl.ledger_id in (select ood.set_of_books_id from org_organization_definitions ood where ood.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;))) and
rownum=1</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>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>aida.accounting_date&gt;=:p_trx_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select max(oap.period_start_date)
from org_acct_periods oap,
 mtl_parameters   mp
where mp.organization_id = oap.organization_id
and mp.organization_id &lt;&gt; mp.master_organization_id</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Transaction Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>aida.accounting_date&lt;:p_trx_date_to+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select max(oap.schedule_close_date)
from org_acct_periods oap,
 mtl_parameters   mp
where mp.organization_id = oap.organization_id
and mp.organization_id &lt;&gt; mp.master_organization_id</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Transaction Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</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>
    <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>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>
    <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>50</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>
    <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>60</DISPLAY_SEQUENCE>
    <ANCHOR>3=3</ANCHOR>
    <SQL_TEXT>x.supplier=:p_supplier_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>AP Supplier</LOV_NAME>
    <LOV_GUID>B9847D20A0E4742FE0538931640A6379</LOV_GUID>
    <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>70</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>mp.organization_code=:p_org_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
ood.organization_code value,
ood.organization_name description
from
org_organization_definitions ood
where
ood.organization_id not in (select mp.organization_id from mtl_parameters mp where mp.organization_id=mp.master_organization_id) and
ood.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;) 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>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haouv_ou.name=:p_operating_unit</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Operating Unit</LOV_NAME>
    <LOV_GUID>9B9627743E84607DE053BB6B635805FB</LOV_GUID>
    <LOV_QUERY_DSP>select
haouv.name value,
&apos;Operating Unit&apos; description
from
hr_all_organization_units_vl haouv
where
haouv.organization_id in
(
select
to_number(hoi.org_information3)
from
mtl_parameters mp,
hr_organization_information hoi,
hr_all_organization_units haou
where
mp.organization_id&lt;&gt;mp.master_organization_id and
mp.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;) and
mp.organization_id=hoi.organization_id and
hoi.org_information_context=&apos;Accounting Information&apos; and
(:$flex$.ledger is null or to_number(hoi.org_information1) in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hoi.organization_id=haou.organization_id and
nvl(haou.date_to,sysdate)&gt;=sysdate
)
order by 1</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>10</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 (inv org related)</LOV_NAME>
    <LOV_GUID>8E2FF36EDF3A79D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
gl.ledger_id in (select ood.set_of_books_id from org_organization_definitions ood where nvl(ood.disable_date,sysdate)&gt;=sysdate and ood.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&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.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,
gl.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
