<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: AP Invoices and Lines 11i -->
 <REPORTS_ROW>
  <GUID>B5F889C2A60B0296E0530100007FC863</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>select
inv.ledger,
inv.ledger_currency,
inv.operating_unit,
inv.supplier,
inv.supplier_number,
inv.supplier_site,
inv.invoice_num,
inv.invoice_source,
inv.invoice_type,
inv.invoice_status,
inv.approval_status,
inv.invoice_date,
inv.invoice_date_period,
inv.invoice_creation_date,
inv.invoice_creation_period,
inv.invoice_creation_delay,
inv.invoice_gl_date,
inv.invoice_description,
inv.invoice_terms,
inv.invoice_terms_date,
inv.invoice_pay_group,
inv.invoice_exclusive_payment,
-- invoice amounts
inv.invoice_currency_code,
decode(inv.first_invoice,&apos;Y&apos;,inv.invoice_amount) invoice_amount,
decode(inv.first_invoice,&apos;Y&apos;,inv.approved_amount) approved_amount,
decode(inv.first_invoice,&apos;Y&apos;,inv.amount_applicable_to_discount) amount_applicable_to_discount,
decode(inv.first_invoice,&apos;Y&apos;,inv.tax_amount) tax_amount,
inv.payment_currency_code,
decode(inv.first_invoice,&apos;Y&apos;,inv.pay_curr_invoice_amount) pay_curr_invoice_amount,
decode(inv.first_invoice,&apos;Y&apos;,inv.invoice_amount_paid) invoice_amount_paid,
decode(inv.first_invoice,&apos;Y&apos;,inv.discount_amount_taken) discount_amount_taken,
-- accounted amounts
decode(inv.first_invoice,&apos;Y&apos;,inv.invoice_amount_acctd) invoice_amount_acctd,
decode(inv.first_invoice,&apos;Y&apos;,inv.approved_amount_acctd) approved_amount_acctd,
decode(inv.first_invoice,&apos;Y&apos;,inv.amount_applic_to_disc_acctd) amount_applic_to_disc_acctd,
decode(inv.first_invoice,&apos;Y&apos;,inv.tax_amount_acctd) tax_amount_acctd,
decode(inv.first_invoice,&apos;Y&apos;,inv.amount_paid_acctd) amount_paid_acctd,
decode(inv.first_invoice,&apos;Y&apos;,inv.discount_amount_taken_acctd) discount_amount_taken_acctd,
inv.exchange_rate_type,
inv.exchange_date,
inv.exchange_rate,
inv.payment_cross_rate_type,
inv.payment_cross_rate_date,
inv.payment_cross_rate,
--
inv.invoice_created_by,
inv.invoice_on_hold,
inv.invoice_has_attachment,
inv.liability_account,
inv.liability_account_descripton,
inv.invoice_cancelled_date,
inv.invoice_cancelled_amount,
inv.invoice_cancelled_by,
decode(inv.first_invoice,&apos;Y&apos;,inv.invoice_temp_cancelled_amount) invoice_temp_cancelled_amount,
inv.recurring_pay_num,
inv.recurring_period_type,
inv.recurring_number_of_periods,
inv.recurring_pmt_description,
-- payment_schedules
inv.payment_num,
inv.due_date,
inv.days_due,
inv.future_pay_due_date,
inv.inv_payment_status,
inv.sched_payment_status,
inv.hold_flag,
decode(inv.first_psched,&apos;Y&apos;,inv.inv_curr_gross_amount) inv_curr_gross_amount,
decode(inv.first_psched,&apos;Y&apos;,inv.gross_amount) gross_amount,
decode(inv.first_psched,&apos;Y&apos;,inv.amount_remaining) amount_remaining,
&amp;aging_bucket_cols2
inv.payment_method,
inv.payment_priority,
inv.bank_name,
inv.iban,
inv.actual_payment_date,
inv.discount_date,
inv.second_discount_date,
inv.third_discount_date,
decode(inv.first_psched,&apos;Y&apos;,inv.discount_amount_available) discount_amount_available,
decode(inv.first_psched,&apos;Y&apos;,inv.second_disc_amt_available) second_disc_amt_available,
decode(inv.first_psched,&apos;Y&apos;,inv.third_disc_amt_available) third_disc_amt_available,
decode(inv.first_psched,&apos;Y&apos;,inv.discount_amount_remaining) discount_amount_remaining,
-- kpis
inv.validated_without_holds,
inv.late_po_flag,
inv.late_po_number,
inv.late_po_cost_centre,
inv.late_po_creation_date,
inv.late_po_created_by,
inv.invoice_count,
inv.distribution_count,
--
--
&amp;invoice_detail_columns
--
-- supplier/site details
inv.supplier_inactive_on,
inv.taxpayer_id,
inv.tax_registration_number,
inv.vat_code,
inv.supplier_customer_num,
inv.one_time_supplier,
inv.credit_status_lookup_code,
inv.credit_limit,
inv.withholding_status_lookup_code,
inv.withholding_start_date,
inv.purchasing_site,
inv.rfq_site,
inv.pay_site,
inv.tax_reporting_site,
inv.p_card_site,
inv.attention_ar,
inv.address_line1,
inv.address_line2,
inv.address_line3,
inv.address_line4,
inv.city,
inv.state,
inv.zip,
inv.county,
inv.province,
inv.country,
inv.area_code,
inv.phone,
inv.fax_area_code,
inv.fax,
inv.supplier_notif_method,
inv.email_address,
inv.remittance_email,
--
&amp;dff_columns2
--
inv.invoice_id
from
(
select
gl.name ledger,
gl.currency_code ledger_currency,
haouv.name operating_unit,
aps.vendor_name supplier,
aps.segment1 supplier_number,
assa.vendor_site_code supplier_site,
aia.invoice_num,
aia.source invoice_source,
xxen_util.meaning(aia.invoice_type_lookup_code,&apos;INVOICE TYPE&apos;,200) invoice_type,
xxen_util.ap_invoice_status(aia.invoice_id,aia.invoice_amount,aia.payment_status_flag,aia.invoice_type_lookup_code,aia.validation_request_id) invoice_status,
xxen_util.meaning(aia.wfapproval_status,&apos;AP_WFAPPROVAL_STATUS&apos;,200) approval_status,
aia.invoice_date,
(select gps.period_name
 from   gl_period_statuses gps
 where  gps.set_of_books_id = aia.set_of_books_id
 and    gps.application_id = 200
 and    gps.adjustment_period_flag = &apos;N&apos;
 and    aia.invoice_date between gps.start_date and gps.end_date
) invoice_date_period,
xxen_util.client_time(aia.creation_date) invoice_creation_date,
(select gps.period_name
 from   gl_period_statuses gps
 where  gps.set_of_books_id = aia.set_of_books_id
 and    gps.application_id = 200
 and    gps.adjustment_period_flag = &apos;N&apos;
 and    aia.creation_date between gps.start_date and gps.end_date
) invoice_creation_period,
(trunc(aia.creation_date)-trunc(aia.invoice_date)) invoice_creation_delay,
aia.gl_date invoice_gl_date,
aia.description invoice_description,
at.name invoice_terms,
aia.terms_date invoice_terms_date,
aia.pay_group_lookup_code invoice_pay_group,
xxen_util.meaning(aia.exclusive_payment_flag,&apos;YES_NO&apos;,0) invoice_exclusive_payment,
-- invoice amounts
aia.invoice_currency_code,
aia.invoice_amount,
aia.approved_amount,
aia.amount_applicable_to_discount,
aia.tax_amount,
aia.payment_currency_code,
aia.pay_curr_invoice_amount,
aia.amount_paid invoice_amount_paid,
aia.discount_amount_taken,
-- accounted amounts
decode(aia.invoice_currency_code,gl.currency_code,aia.invoice_amount,aia.base_amount) invoice_amount_acctd,
nvl(aia.approved_amount,0)*aia.exchange_rate approved_amount_acctd,
nvl(aia.amount_applicable_to_discount,0)*nvl(aia.exchange_rate,1) amount_applic_to_disc_acctd,
nvl(aia.tax_amount,0)*nvl(aia.exchange_rate,1) tax_amount_acctd,
nvl(aia.amount_paid,0)/decode(nvl(aia.payment_cross_rate,1),0,1,aia.payment_cross_rate)*nvl(aia.exchange_rate,1) amount_paid_acctd,
nvl(aia.discount_amount_taken,0)/decode(nvl(aia.payment_cross_rate,1),0,1,aia.payment_cross_rate)*nvl(aia.exchange_rate,1) discount_amount_taken_acctd,
(select gdct.user_conversion_type from gl_daily_conversion_types gdct where gdct.conversion_type = aia.exchange_rate_type) exchange_rate_type,
aia.exchange_date,
aia.exchange_rate,
(select gdct.user_conversion_type from gl_daily_conversion_types gdct where gdct.conversion_type = aia.payment_cross_rate_type) payment_cross_rate_type,
aia.payment_cross_rate_date,
aia.payment_cross_rate,
--
xxen_util.user_name(aia.created_by) invoice_created_by,

case when
apsa.hold_flag = &apos;Y&apos; or
(assa.hold_all_payments_flag = &apos;Y&apos; and aia.payment_status_flag != &apos;Y&apos; and aia.cancelled_date is null) or
exists
(select
 null
 from
 ap_holds_all aha
 where
 aha.invoice_id = aia.invoice_id and
 aha.release_lookup_code is null
)
then xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0)
end invoice_on_hold,
nvl((select
     xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0)
     from
     fnd_attached_documents fad,
     fnd_documents_vl fdv
     where
     fad.document_id = fdv.document_id and
     fad.entity_name = &apos;AP_INVOICES&apos; and
     fad.pk1_value = aia.invoice_id and
     rownum &lt;= 1
    ),
    xxen_util.meaning(&apos;N&apos;,&apos;YES_NO&apos;,0)
) invoice_has_attachment,
xxen_util.concatenated_segments(aia.accts_pay_code_combination_id) liability_account,
xxen_util.segments_description(aia.accts_pay_code_combination_id) liability_account_descripton,
aia.cancelled_date invoice_cancelled_date,
aia.cancelled_amount invoice_cancelled_amount,
xxen_util.user_name(aia.cancelled_by) invoice_cancelled_by,
aia.temp_cancelled_amount invoice_temp_cancelled_amount,
arpa.recurring_pay_num,
arpa.rec_pay_period_type recurring_period_type,
arpa.num_of_periods recurring_number_of_periods,
arpa.description recurring_pmt_description,
-- payment_schedules
apsa.payment_num,
apsa.due_date,
ceil(sysdate-apsa.due_date) days_due,
apsa.future_pay_due_date,
xxen_util.meaning(aia.payment_status_flag,&apos;INVOICE PAYMENT STATUS&apos;,200) inv_payment_status,
xxen_util.meaning(apsa.payment_status_flag,&apos;INVOICE PAYMENT STATUS&apos;,200) sched_payment_status,
apsa.hold_flag,
apsa.inv_curr_gross_amount,
apsa.gross_amount,
apsa.amount_remaining/aia.payment_cross_rate*nvl(aia.exchange_rate,1) amount_remaining,
&amp;aging_bucket_cols1
nvl(xxen_util.meaning(apsa.payment_method_lookup_code,&apos;PAYMENT METHOD&apos;,200),apsa.payment_method_lookup_code) payment_method,
apsa.payment_priority,
abb.bank_name,
aba.iban_number iban,
(select
 max(aca.check_date)
 from
 ap_invoice_payments_all aipa,
 ap_checks_all aca
 where
 apsa.invoice_id=aipa.invoice_id and
 apsa.payment_num=aipa.payment_num and
 aipa.check_id=aca.check_id and
 aca.void_date is null and
 aca.stopped_date is null
) actual_payment_date,
apsa.discount_date,
apsa.second_discount_date,
apsa.third_discount_date,
apsa.discount_amount_available,
apsa.second_disc_amt_available,
apsa.third_disc_amt_available,
apsa.discount_amount_remaining,
-- kpis
(select
 xxen_util.meaning(
  min(
   case when
   aha2.creation_date is not null and
   aha2.hold_date &lt;= nvl(aaea2.creation_date,sysdate)
   then &apos;N&apos;
   else &apos;Y&apos;
   end
  ),&apos;YES_NO&apos;,0)
 from
 ap_invoices_all aia2,
 ap_invoice_distributions_all aida2,
 ap_accounting_events_all aaea2,
 ap_holds_all aha2
 where
 aia2.invoice_id = aia.invoice_id and
 aia2.invoice_id = aida2.invoice_id (+) and
 aida2.accounting_event_id = aaea2.accounting_event_id (+) and
 aia2.invoice_id = aha2.invoice_id (+) and
 aha2.held_by (+) = 5 -- held by system
) validated_without_holds,
--
nvl2(pocc.po_number,xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0),null) late_po_flag,
pocc.po_number late_po_number,
pocc.po_cost_center late_po_cost_centre,
pocc.po_creation_date late_po_creation_date,
pocc.po_created_by late_po_created_by,
--
case when 1 = row_number() over (partition by aia.invoice_id order by apsa.payment_num,aida.distribution_line_number)
then 1
else null
end invoice_count,
case when 1 = row_number() over (partition by aia.invoice_id order by apsa.payment_num,aida.distribution_line_number)
then (select count(*) from ap_invoice_distributions_all aida where aida.invoice_id = aia.invoice_id and aida.line_type_lookup_code not in (&apos;TAX&apos;,&apos;AWT&apos;))
else null
end distribution_count,
--
aida.distribution_line_number dist_line_number,
xxen_util.meaning(aida.line_type_lookup_code,&apos;INVOICE DISTRIBUTION TYPE&apos;,200) dist_line_type,
aida.quantity_invoiced,
aida.unit_price,
aida.amount dist_amount,
nvl(aida.base_amount,aida.amount) dist_acctd_amount,
aida.period_name dist_period,
aida.accounting_date dist_accounting_date,
xxen_util.concatenated_segments(aida.dist_code_combination_id) dist_expense_account,
replace(aida.description,&apos;~&apos;,&apos;-&apos;) dist_description,
(select atca.name from ap_tax_codes_all atca where decode(aida.line_type_lookup_code,&apos;AWT&apos;,aida.tax_code_id)=atca.tax_id) withholding_tax,
(select aatra.tax_rate from ap_awt_tax_rates_all aatra where aida.awt_tax_rate_id=aatra.tax_rate_id) withholding_tax_rate,
(select aps_awt.vendor_name from ap_tax_codes_all atca, po_vendors aps_awt where decode(aida.line_type_lookup_code,&apos;AWT&apos;,aida.tax_code_id)=atca.tax_id and atca.awt_vendor_id=aps_awt.vendor_id) tax_authority,
(select assa_awt.vendor_site_code from ap_tax_codes_all atca, po_vendor_sites_all assa_awt where decode(aida.line_type_lookup_code,&apos;AWT&apos;,aida.tax_code_id)=atca.tax_id and atca.awt_vendor_site_id=assa_awt.vendor_site_id) tax_authority_site,
aida.awt_gross_amount withholding_gross_amount,
(select aca.check_number from ap_invoice_payments_all aipa, ap_checks_all aca where aida.awt_invoice_payment_id=aipa.invoice_payment_id and aipa.check_id=aca.check_id) withholding_payment_document,
(select aca.check_date from ap_invoice_payments_all aipa, ap_checks_all aca where aida.awt_invoice_payment_id=aipa.invoice_payment_id and aipa.check_id=aca.check_id) withholding_payment_date,
(select aia_awt.invoice_num from ap_invoices_all aia_awt where aida.awt_invoice_id=aia_awt.invoice_id) tax_authority_invoice,
aida.assets_addition_flag dist_assets_addition,
aida.invoice_price_variance dist_invoice_price_variance,
aida.base_invoice_price_variance dist_base_inv_price_variance,
xxen_util.concatenated_segments(aida.price_var_code_combination_id) dist_price_variance_account,
-- po match
xxen_util.meaning(aida.dist_match_type,&apos;MATCH_STATUS&apos;,200) dist_match_type,
aida.match_status_flag dist_match_status,
pha.segment1 po_number,
xxen_util.user_name(pha.created_by) po_created_by,
trunc(pha.creation_date) po_creation_date,
case when (pha.creation_date - aia.creation_date) &gt; 0 then xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) else null end po_created_after_invoice,
nvl2(pda.code_combination_id,xxen_util.concatenated_segments(pda.code_combination_id),null) po_dist_account,
nvl2(pda.code_combination_id,fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_cost_seg&apos;,&apos;SQLGL&apos;,&apos;GL#&apos;,gl.chart_of_accounts_id,null,pda.code_combination_id,&apos;FA_COST_CTR&apos;,&apos;Y&apos;,&apos;VALUE&apos;),null) po_dist_cost_centre,
--
-- project
ppa.segment1 project_number,
ppa.name project_name,
ppa.description project_description,
ppa.project_type,
ppa.project_status_code,
ppa.start_date project_start_date,
ppa.completion_date project_completion_date,
pt.task_number,
pt.task_name,
pt.description task_description,
pt.service_type_code,
pt.start_date task_start_date,
pt.completion_date task_completion_date,
aida.expenditure_item_date pa_expenditure_item_date,
aida.expenditure_type pa_expenditure_type,
coalesce(haouv1.name,haouv3.name) pa_expenditure_organization,
aida.pa_addition_flag,
aida.project_accounting_context,
--
aida.creation_date dist_creation_date,
aida.last_update_date dist_last_update_date,
--
-- supplier/site details
aps.end_date_active supplier_inactive_on,
aps.num_1099 taxpayer_id,
aps.vat_registration_num tax_registration_number,
aps.vat_code,
aps.customer_num supplier_customer_num,
xxen_util.meaning(aps.one_time_flag,&apos;YES_NO&apos;,0) one_time_supplier,
aps.credit_status_lookup_code,
aps.credit_limit,
aps.withholding_status_lookup_code,
aps.withholding_start_date,
xxen_util.meaning(assa.purchasing_site_flag,&apos;YES_NO&apos;,0) purchasing_site,
xxen_util.meaning(assa.rfq_only_site_flag,&apos;YES_NO&apos;,0) rfq_site,
xxen_util.meaning(assa.pay_site_flag,&apos;YES_NO&apos;,0) pay_site,
xxen_util.meaning(assa.tax_reporting_site_flag,&apos;YES_NO&apos;,0) tax_reporting_site,
xxen_util.meaning(assa.pcard_site_flag,&apos;YES_NO&apos;,0) p_card_site,
xxen_util.meaning(assa.attention_ar_flag,&apos;YES_NO&apos;,0) attention_ar,
assa.address_line1,
assa.address_line2,
assa.address_line3,
assa.address_line4,
assa.city,
assa.state,
assa.zip,
assa.county,
assa.province,
assa.country,
assa.area_code,
assa.phone,
assa.fax_area_code,
assa.fax,
assa.supplier_notif_method,
assa.email_address,
assa.remittance_email,
--
&amp;dff_columns1
--
aia.invoice_id,
decode(row_number() over (partition by apsa.invoice_id order by nvl(apsa.payment_num,1), aida.accounting_date,aida.distribution_line_number),1,&apos;Y&apos;) first_invoice,
decode(row_number() over (partition by apsa.invoice_id,apsa.payment_num order by aida.accounting_date,aida.distribution_line_number),1,&apos;Y&apos;) first_psched
from
gl_sets_of_books gl,
hr_all_organization_units_vl haouv,
hr_all_organization_units_vl haouv1,
hr_all_organization_units_vl haouv3,
ap_invoices_all aia,
ap_payment_schedules_all apsa,
ap_bank_accounts_all  aba,
ap_bank_branches abb,
po_vendors aps,
po_vendor_sites_all assa,
(select distinct
  y.invoice_id,
  first_value(y.cctr) over (partition by y.invoice_id order by y.cctr_amount desc, y.po_header_id desc, y.cctr rows between unbounded preceding and unbounded following) po_cost_center,
  first_value(y.po_number) over (partition by y.invoice_id order by y.cctr_amount desc, y.po_header_id desc, y.cctr rows between unbounded preceding and unbounded following) po_number,
  first_value(y.po_creation_date) over (partition by y.invoice_id order by y.cctr_amount desc, y.po_header_id desc, y.cctr rows between unbounded preceding and unbounded following) po_creation_date,
  first_value(y.po_created_by) over (partition by y.invoice_id order by y.cctr_amount desc, y.po_header_id desc, y.cctr rows between unbounded preceding and unbounded following) po_created_by
 from
  (select
     aida.invoice_id,
     pha.po_header_id,
     pha.segment1 po_number,
     xxen_util.user_name(pha.creation_date) po_creation_date,
     xxen_util.user_name(pha.created_by) po_created_by,
     fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_cost_seg&apos;,&apos;SQLGL&apos;,&apos;GL#&apos;,gcc.chart_of_accounts_id,null,gcc.code_combination_id,&apos;FA_COST_CTR&apos;,&apos;Y&apos;,&apos;VALUE&apos;) cctr,
     sum(aida.amount) over (partition by aida.invoice_id,pha.po_header_id,fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_cost_seg&apos;,&apos;SQLGL&apos;,&apos;GL#&apos;,gcc.chart_of_accounts_id,null,gcc.code_combination_id,&apos;FA_COST_CTR&apos;,&apos;Y&apos;,&apos;VALUE&apos;)) cctr_amount
   from
     ap_invoice_distributions_all aida,
     po_distributions_all pda,
     po_headers_all pha,
     gl_code_combinations gcc
   where
     aida.line_type_lookup_code != &apos;TAX&apos; and
     aida.po_distribution_id = pda.po_distribution_id and
     pda.po_header_id = pha.po_header_id and
     pda.code_combination_id = gcc.code_combination_id and
     aida.creation_date &lt; pha.creation_date
  ) y
) pocc,
(select aida.* from ap_invoice_distributions_all aida where &apos;&amp;show_aida&apos;=&apos;Y&apos;) aida,
gl_code_combinations gcc,
po_distributions_all pda,
po_headers_all pha,
ap_recurring_payments_all arpa,
ap_terms at,
pa_projects_all ppa,
pa_tasks pt
where
1=1 and
( (nvl(&apos;&amp;show_aida&apos;,&apos;N&apos;) = &apos;Y&apos; and
   2=2
  ) or
  (nvl(&apos;&amp;show_aida&apos;,&apos;N&apos;) != &apos;Y&apos; and
   exists --need this to apply dist level restrictions in case report is run at header or line level
   (select null
    from
     ap_invoice_distributions_all aida,
     gl_code_combinations gcc
    where
     aida.invoice_id               = aia.invoice_id and
     aida.dist_code_combination_id = gcc.code_combination_id and
     2=2
   )
  )
) and
aia.set_of_books_id=gl.set_of_books_id and
aia.org_id=haouv.organization_id(+) and
aia.expenditure_organization_id=haouv1.organization_id(+) and
aida.expenditure_organization_id=haouv3.organization_id(+) and
aia.invoice_id=apsa.invoice_id and
apsa.external_bank_account_id = aba.bank_account_id (+) and
aba.account_type (+) = &apos;SUPPLIER&apos; and
aba.bank_branch_id = abb.bank_branch_id (+) and
aia.vendor_id=aps.vendor_id and
aia.vendor_site_id=assa.vendor_site_id and
aia.invoice_id = pocc.invoice_id (+) and
aia.invoice_id=aida.invoice_id (+) and
aida.dist_code_combination_id = gcc.code_combination_id (+) and
aida.po_distribution_id = pda.po_distribution_id (+) and
pda.po_header_id = pha.po_header_id (+) and
aida.project_id=ppa.project_id(+) and
aida.task_id=pt.task_id(+) and
aia.recurring_payment_id=arpa.recurring_payment_id(+) and
aia.terms_id=at.term_id(+)
) inv
order by
inv.operating_unit,
inv.supplier,
inv.supplier_number,
inv.invoice_date,
inv.invoice_gl_date,
inv.invoice_num,
inv.payment_num,
inv.dist_accounting_date,
inv.dist_line_number</SQL_TEXT>
  <VERSION_COMMENTS>Added the distribution level withholding tax columns Withholding Tax, Withholding Tax Rate, Tax Authority, Tax Authority Site, Withholding Gross Amount, Withholding Payment Document, Withholding Payment Date and Tax Authority Invoice, plus templates Withholding Tax by Tax Authority and Withholding Tax by Supplier.</VERSION_COMMENTS>
  <XDO_APPLICATION_SHORT_NAME>SQLAP</XDO_APPLICATION_SHORT_NAME>
  <REQUIRED_PARAMETERS>(:Ledger is not null or :Operating_Unit is not null)</REQUIRED_PARAMETERS>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>AP Invoices and Lines 11i</REPORT_NAME>
    <DESCRIPTION>Detail Invoice Aging report with line item details and amounts.

The Approval Status column and parameter show and filter the status of the invoice in the Invoice Approval Workflow.

On withholding tax distributions, the withholding columns show the withholding tax and rate, the tax authority supplier and site of the tax, the gross amount subject to withholding, the payment that created the withholding when it was calculated at payment, and the invoice raised to the tax authority.</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>You must select a Ledger and/or Operating Unit</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;aging_bucket_cols1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;aging_bucket_cols2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;dff_columns1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;dff_columns2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;invoice_detail_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;show_aida</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gl.name=:ledger
and (haouv.organization_id is null or haouv.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))</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Ledger</LOV_NAME>
    <LOV_GUID>8E2FF36EDEB879D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||decode(gl.ledger_category_code,&apos;NONE&apos;,xxen_util.meaning(gl.object_type_code,&apos;LEDGERS&apos;,101),xxen_util.meaning(gl.ledger_category_code,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101))||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
(:$flex$.ledger_category is null or gl.ledger_category_code=xxen_util.lookup_code(:$flex$.ledger_category,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101,&apos;Y&apos;)) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.ledger_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;LEDGER&apos;) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
decode(gl.ledger_category_code,&apos;PRIMARY&apos;,1,&apos;SECONDARY&apos;,2,&apos;ALC&apos;,3,&apos;NONE&apos;,4),
gl.name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>coalesce(xxen_util.previous_parameter_value(:parameter_id),xxen_util.default_ledger)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haouv.name=:operating_unit</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>HR Operating Unit</LOV_NAME>
    <LOV_GUID>8E2FF36EDEB979D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
(:$flex$.ledger is null or hou.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hou.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;OU&apos;)
order by
hou.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;aging_bucket_cols1</ANCHOR>
    <SQL_TEXT>select
 &apos;case when ceil(sysdate-apsa.due_date) between &apos; || to_char(aap.days_start) || &apos; and &apos; || to_char(aap.days_to) || &apos; and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end bucket&apos; || to_char(aap.period_sequence_num) || &apos;,&apos;
from
 (select
   aapl.period_sequence_num,
   aapl.days_start,
   aapl.days_to,
   substr(aapl.report_heading1 || nvl2(aapl.report_heading1,nvl2(aapl.report_heading2,&apos; &apos;,null),null) || aapl.report_heading2,1,xxen_report.max_column_length) title
  from
   ap_aging_periods aap,
   ap_aging_period_lines aapl
  where
   aap.aging_period_id = aapl.aging_period_id and
   aap.period_name = :p_aging_bucket_name
  order by
   aapl.period_sequence_num
 ) aap
union
select
&apos; case when ceil(sysdate-apsa.due_date)&lt;=0 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end current_bucket,
  case when ceil(sysdate-apsa.due_date) between 1 and 30 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end between_1_30,
  case when ceil(sysdate-apsa.due_date) between 31 and 60 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end between_31_60,
  case when ceil(sysdate-apsa.due_date) between 61 and 90 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end between_61_90,
  case when ceil(sysdate-apsa.due_date) between 91 and 120 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end between_91_120,
  case when ceil(sysdate-apsa.due_date) between 121 and 150 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end between_121_150,
  case when ceil(sysdate-apsa.due_date) between 151 and 180 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end between_151_180,
  case when ceil(sysdate-apsa.due_date) &gt;=181 and apsa.amount_remaining != 0 then apsa.amount_remaining/nvl(aia.payment_cross_rate,1)*nvl(aia.exchange_rate,1) end greater_than_180,&apos;
from
 dual
where not exists
 (select null from ap_aging_periods aap where aap.period_name = :p_aging_bucket_name and nvl(aap.status,&apos;A&apos;) = &apos;A&apos;)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
 x.value,
 x.description
from
(
select
aap.period_name value, 
aap.description description 
from 
ap_aging_periods aap
where
nvl(aap.status,&apos;A&apos;) = &apos;A&apos;
union
select
&apos;*Default*&apos; value,
null description
from
dual
) x
order by
x.value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>*Default*</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <ANCHOR>&amp;aging_bucket_cols2</ANCHOR>
    <SQL_TEXT>select
 &apos;case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.bucket&apos; || to_char(aap.period_sequence_num) || &apos; end &quot;&apos; || aap.title || &apos;&quot;,&apos;
from
 (select
   aapl.period_sequence_num,
   aapl.days_start,
   aapl.days_to,
   substr(aapl.report_heading1 || nvl2(aapl.report_heading1,nvl2(aapl.report_heading2,&apos; &apos;,null),null) || aapl.report_heading2,1,xxen_report.max_column_length) title
  from
   ap_aging_periods aap,
   ap_aging_period_lines aapl
  where
   aap.aging_period_id = aapl.aging_period_id and
   aap.period_name = :p_aging_bucket_name
  order by
   aapl.period_sequence_num
 ) aap
union
select
&apos;case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.current_bucket end &quot;Current&quot;,
case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.between_1_30 end between_1_30,
case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.between_31_60 end between_31_60,
case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.between_61_90 end between_61_90,
case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.between_91_120 end between_91_120,
case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.between_121_150 end between_121_150,
case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.between_151_180 end between_151_180,
case inv.first_psched when &apos;&apos;Y&apos;&apos; then inv.greater_than_180 end greater_than_180,&apos;
from
 dual
where not exists
 (select null from ap_aging_periods aap where aap.period_name = :p_aging_bucket_name and nvl(aap.status,&apos;A&apos;) = &apos;A&apos;)</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;show_aida</ANCHOR>
    <SQL_TEXT>Y</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select &apos;Headers&apos; value, &apos;Show Invoice Headers only&apos; description from dual union all
select &apos;Distributions&apos; value, &apos;Show Invoice Headers and Distributions&apos; description from dual</LOV_QUERY_DSP>
    <MATCHING_VALUE>Distributions</MATCHING_VALUE>
    <DEFAULT_VALUE>Distributions</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Display Level</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <ANCHOR>&amp;invoice_detail_columns</ANCHOR>
    <SQL_TEXT>inv.dist_line_number,
inv.dist_line_type,
inv.quantity_invoiced,
inv.unit_price,
inv.dist_amount,
inv.dist_acctd_amount,
inv.dist_period,
inv.dist_accounting_date,
inv.dist_expense_account,
inv.dist_description,
inv.dist_assets_addition,
inv.dist_invoice_price_variance,
inv.dist_base_inv_price_variance,
inv.dist_price_variance_account,
inv.withholding_tax,
inv.withholding_tax_rate,
inv.tax_authority,
inv.tax_authority_site,
inv.withholding_gross_amount,
inv.withholding_payment_document,
inv.withholding_payment_date,
inv.tax_authority_invoice,
-- po match
inv.dist_match_type,
inv.dist_match_status,
inv.po_number,
inv.po_created_by,
inv.po_creation_date,
inv.po_created_after_invoice, 
inv.po_dist_account,
inv.po_dist_cost_centre,
--
--
-- project
inv.project_number,
inv.project_name,
inv.project_description,
inv.project_type,
inv.project_status_code,
inv.project_start_date,
inv.project_completion_date,
inv.task_number,
inv.task_name,
inv.task_description,
inv.service_type_code,
inv.task_start_date,
inv.task_completion_date,
inv.pa_expenditure_item_date,
inv.pa_expenditure_type,
inv.pa_expenditure_organization,
inv.pa_addition_flag,
inv.project_accounting_context,
--
inv.dist_creation_date,
inv.dist_last_update_date,</SQL_TEXT>
    <MATCHING_VALUE>Distributions</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Display Level</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aps.vendor_name=: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</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>assa.vendor_site_code=:vendor_site_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>AP Supplier Site</LOV_NAME>
    <LOV_GUID>8E2FF36EDF0279D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select distinct
assa.vendor_site_code value,
assa.address_line1||&apos;, &apos;||assa.city||&apos;, &apos;||nvl(ftv.territory_short_name,assa.country) description
from
hr_all_organization_units_vl haouv,
ap_suppliers aps,
ap_supplier_sites_all assa,
fnd_territories_vl ftv
where
(:$flex$.ap_supplier is null or xxen_util.contains(:$flex$.ap_supplier,aps.vendor_name)=&apos;Y&apos;) and
(:$flex$.ap_supplier_number is null or xxen_util.contains(:$flex$.ap_supplier_number,aps.segment1)=&apos;Y&apos;) and
(:$flex$.operating_unit is null or xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos;) and
haouv.organization_id=assa.org_id and
aps.vendor_id=assa.vendor_id and
assa.country=ftv.territory_code(+)
order by
assa.vendor_site_code</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Supplier Site</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.invoice_num=:invoice_number</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>AP Invoice Number</LOV_NAME>
    <LOV_GUID>8E2FF36EDF3079D2E0530100007F1FF2</LOV_GUID>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
aia.invoice_num value,
aps.vendor_name||&apos; (&apos;||aia.invoice_date||&apos;)&apos; description
from
ap_invoices_all aia,
ap_suppliers aps
where
(:$flex$.operating_unit is null or aia.org_id 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 aia.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
aia.vendor_id=aps.vendor_id
order by
aia.invoice_date desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.invoice_date&gt;=(select
gps.start_date
from
gl_period_statuses gps
where
  gps.period_name=:period_name and
gps.set_of_books_id=gl.set_of_books_id and
gps.application_id=200) and
aia.invoice_date&lt;(select
gps.end_date+1
from
gl_period_statuses gps
where
gps.period_name=:period_name and
gps.set_of_books_id=gl.set_of_books_id and
gps.application_id=200)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
gps.period_name value,
xxen_util.meaning(gps.closing_status,&apos;CLOSING_STATUS&apos;,222)||&apos;: &apos;||gps.start_date||&apos; - &apos;||gps.end_date description
from
gl_period_statuses gps
where
gps.set_of_books_id=
(
select 
asp.set_of_books_id 
from   
ap_system_parameters asp, 
gl_sets_of_books gl,
hr_operating_units hou 
where  
asp.set_of_books_id=gl.set_of_books_id and
asp.set_of_books_id=hou.set_of_books_id and
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and 
(:$flex$.operating_unit is null or xxen_util.contains(:$flex$.operating_unit,hou.name)=&apos;Y&apos;) and 
rownum=1
) and
gps.start_date&lt;=sysdate+400 and
gps.application_id=200
order by
gps.start_date desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Date Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>11</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.invoice_date&gt;=:invoice_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>12</SORT_ORDER>
    <DISPLAY_SEQUENCE>100</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.invoice_date&lt;:invoice_date_to+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>last_day(:$flex$.invoice_date_from)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>13</SORT_ORDER>
    <DISPLAY_SEQUENCE>110</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.creation_date&gt;=(select
gps.start_date
from
gl_period_statuses gps
where
  gps.period_name=:period_name and
gps.set_of_books_id=gl.set_of_books_id and
gps.application_id=200) and
aia.creation_date&lt;(select
gps.end_date+1
from
gl_period_statuses gps
where
gps.period_name=:period_name and
gps.set_of_books_id=gl.set_of_books_id and
gps.application_id=200)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
gps.period_name value,
xxen_util.meaning(gps.closing_status,&apos;CLOSING_STATUS&apos;,222)||&apos;: &apos;||gps.start_date||&apos; - &apos;||gps.end_date description
from
gl_period_statuses gps
where
gps.set_of_books_id=
(
select 
asp.set_of_books_id 
from   
ap_system_parameters asp, 
gl_sets_of_books gl,
hr_operating_units hou 
where  
asp.set_of_books_id=gl.set_of_books_id and
asp.set_of_books_id=hou.set_of_books_id and
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and 
(:$flex$.operating_unit is null or xxen_util.contains(:$flex$.operating_unit,hou.name)=&apos;Y&apos;) and 
rownum=1
) and
gps.start_date&lt;=sysdate+400 and
gps.application_id=200
order by
gps.start_date desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Creation Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>14</SORT_ORDER>
    <DISPLAY_SEQUENCE>120</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.creation_date&gt;=:creation_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Creation Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>15</SORT_ORDER>
    <DISPLAY_SEQUENCE>130</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.creation_date&lt;:creation_date_to+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>last_day(:$flex$.invoice_creation_date_from)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Creation Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>16</SORT_ORDER>
    <DISPLAY_SEQUENCE>140</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>select
&apos;aida.accounting_date&gt;=to_date(&apos;&apos;&apos; || to_char(gps.start_date,&apos;YYYY/MM/DD&apos;) || &apos;&apos;&apos;,&apos;&apos;YYYY/MM/DD&apos;&apos;) and aida.accounting_date &lt; to_date(&apos;&apos;&apos; || to_char(gps.end_date+1,&apos;YYYY/MM/DD&apos;) || &apos;&apos;&apos;,&apos;&apos;YYYY/MM/DD&apos;&apos;)&apos;
from
gl_period_statuses gps,
gl_sets_of_books gl
where
gps.period_name=:acctg_period_name and
gps.set_of_books_id=gl.set_of_books_id and
gps.application_id=200 and
gl.set_of_books_id in (select asp.set_of_books_id from ap_system_parameters asp) and
(:ledger is null or xxen_util.contains(:ledger,gl.name)=&apos;Y&apos;) and
rownum=1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
gps.period_name value,
xxen_util.meaning(gps.closing_status,&apos;CLOSING_STATUS&apos;,222)||&apos;: &apos;||gps.start_date||&apos; - &apos;||gps.end_date description
from
gl_period_statuses gps
where
gps.set_of_books_id=
(
select 
asp.set_of_books_id 
from   
ap_system_parameters asp, 
gl_sets_of_books gl,
hr_operating_units hou 
where  
asp.set_of_books_id=gl.set_of_books_id and
asp.set_of_books_id=hou.set_of_books_id and
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and 
(:$flex$.operating_unit is null or xxen_util.contains(:$flex$.operating_unit,hou.name)=&apos;Y&apos;) and 
rownum=1
) and
gps.start_date&lt;=sysdate+400 and
gps.application_id=200
order by
gps.start_date desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>17</SORT_ORDER>
    <DISPLAY_SEQUENCE>150</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>aida.accounting_date&gt;=:accounting_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>18</SORT_ORDER>
    <DISPLAY_SEQUENCE>160</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>aida.accounting_date&lt;:accounting_date_to+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>last_day(:$flex$.accounting_date_from)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>19</SORT_ORDER>
    <DISPLAY_SEQUENCE>170</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.invoice_id in
(select 
  aipa.invoice_id
 from
 gl_period_statuses gps,
 ap_checks_all aca,
 ap_invoice_payments_all aipa
 where
 gps.period_name=:payment_period and
 gps.set_of_books_id=gl.set_of_books_id and
 gps.application_id=200 and
 aca.check_date &gt;= gps.start_date and
 aca.check_date &lt; gps.end_date+1 and
 aca.void_date is null and
 aca.stopped_date is null and
 aipa.check_id = aca.check_id
)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
gps.period_name value,
xxen_util.meaning(gps.closing_status,&apos;CLOSING_STATUS&apos;,222)||&apos;: &apos;||gps.start_date||&apos; - &apos;||gps.end_date description
from
gl_period_statuses gps
where
gps.set_of_books_id=
(
select 
asp.set_of_books_id 
from   
ap_system_parameters asp, 
gl_sets_of_books gl,
hr_operating_units hou 
where  
asp.set_of_books_id=gl.set_of_books_id and
asp.set_of_books_id=hou.set_of_books_id and
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and 
(:$flex$.operating_unit is null or xxen_util.contains(:$flex$.operating_unit,hou.name)=&apos;Y&apos;) and 
rownum=1
) and
gps.start_date&lt;=sysdate+400 and
gps.application_id=200
order by
gps.start_date desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payment Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>20</SORT_ORDER>
    <DISPLAY_SEQUENCE>180</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(select 
 max(aca.check_date) 
 from 
 ap_invoice_payments_all aipa, 
 ap_checks_all aca
 where
 aipa.check_id = aca.check_id and
 aca.void_date is null and
 aca.stopped_date is null and
 aipa.invoice_id = apsa.invoice_id and
 aipa.payment_num = apsa.payment_num
)&gt;=:payment_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payment Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>21</SORT_ORDER>
    <DISPLAY_SEQUENCE>190</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(select 
 max(aca.check_date) 
 from 
 ap_invoice_payments_all aipa, 
 ap_checks_all aca
 where
 aipa.check_id = aca.check_id and
 aca.void_date is null and
 aca.stopped_date is null and
 aipa.invoice_id = apsa.invoice_id and
 aipa.payment_num = apsa.payment_num
)&lt;:payment_date_to+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>last_day(:$flex$.payment_date_from)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payment Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>22</SORT_ORDER>
    <DISPLAY_SEQUENCE>200</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.payment_status_flag in (&apos;N&apos;,&apos;P&apos;) and
apsa.amount_remaining&lt;&gt;0</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <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>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <DEFAULT_VALUE>select &apos;Y&apos; from dual where :$flex$.invoice_number is null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Open only</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>23</SORT_ORDER>
    <DISPLAY_SEQUENCE>210</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>ceil(sysdate-apsa.due_date)&gt;:days_due</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Days Overdue</PARAMETER_NAME>
      <DESCRIPTION>Days Due (Greater than)</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>24</SORT_ORDER>
    <DISPLAY_SEQUENCE>220</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.invoice_type_lookup_code=xxen_util.lookup_code(:invoice_type,&apos;INVOICE TYPE&apos;,200)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>AP Invoice Type</LOV_NAME>
    <LOV_GUID>B20C1D394FC36EDDE0530100007F5621</LOV_GUID>
    <LOV_QUERY_DSP>select
flvv.meaning value,
flvv.description
from
fnd_lookup_values_vl flvv
where
flvv.lookup_type(+)=&apos;INVOICE TYPE&apos; and
flvv.view_application_id(+)=200 and
flvv.security_group_id(+)=0
order by
flvv.meaning</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>25</SORT_ORDER>
    <DISPLAY_SEQUENCE>230</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>xxen_util.ap_invoice_status(aia.invoice_id,aia.invoice_amount,aia.payment_status_flag,aia.invoice_type_lookup_code,aia.validation_request_id) = :p_invoice_status</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
flvv.meaning value,
null description
from
fnd_lookup_values_vl flvv
where
flvv.lookup_type in (&apos;NLS TRANSLATION&apos;,&apos;PREPAY STATUS&apos;) and
flvv.view_application_id = 200 and
flvv.security_group_id = fnd_global.security_group_id and
flvv.lookup_code in
(&apos;APPROVED&apos;,
 &apos;NEEDS REAPPROVAL&apos;,
 &apos;NEVER APPROVED&apos;,
 &apos;UNAPPROVED&apos;,
 &apos;UNPAID&apos;,
 &apos;FULL&apos;,
 &apos;PERMANENT&apos;,
 &apos;AVAILABLE&apos;,
 &apos;SELECTED FOR PAYMENT&apos;,
 &apos;SELECTED FOR VALIDATION&apos;,
 &apos;SELECTED FOR APPROVAL&apos;
)
order by
flvv.meaning</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Status</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>26</SORT_ORDER>
    <DISPLAY_SEQUENCE>235</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.wfapproval_status=xxen_util.lookup_code(:approval_status,&apos;AP_WFAPPROVAL_STATUS&apos;,200)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
flvv.meaning value,
flvv.description
from
fnd_lookup_values_vl flvv
where
flvv.lookup_type=&apos;AP_WFAPPROVAL_STATUS&apos; and
flvv.view_application_id=200 and
flvv.security_group_id=0 and
flvv.enabled_flag=&apos;Y&apos;
order by
flvv.meaning</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Approval Status</PARAMETER_NAME>
      <DESCRIPTION>Status of the invoice in the Invoice Approval Workflow.</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>27</SORT_ORDER>
    <DISPLAY_SEQUENCE>240</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.payment_status_flag=xxen_util.lookup_code(:payment_status,&apos;INVOICE PAYMENT STATUS&apos;,200)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
flv.meaning value,
flv.description
from
fnd_lookup_values flv
where
flv.lookup_type(+)=&apos;INVOICE PAYMENT STATUS&apos; and
flv.view_application_id(+)=200 and
flv.language(+)=userenv(&apos;lang&apos;) and
flv.security_group_id(+)=0
order by
flv.lookup_code</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payment Status</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>28</SORT_ORDER>
    <DISPLAY_SEQUENCE>250</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(aida.line_type_lookup_code=:distribution_type or aida.line_type_lookup_code is null)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
flvv.lookup_code id,
flvv.meaning value,
flvv.description
from
fnd_lookup_values_vl flvv
where
flvv.lookup_type(+)=&apos;INVOICE DISTRIBUTION TYPE&apos; and
flvv.view_application_id(+)=200 and
flvv.security_group_id(+)=0
order by
flvv.meaning</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Distribution Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>29</SORT_ORDER>
    <DISPLAY_SEQUENCE>260</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.cancelled_date is null</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <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>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <DEFAULT_VALUE>select &apos;Y&apos; from dual where :$flex$.invoice_number is null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Exclude Cancelled</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>30</SORT_ORDER>
    <DISPLAY_SEQUENCE>270</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>exists
(select 
 null
 from 
 ap_invoice_distributions_all aida 
 where 
 aida.invoice_id = aia.invoice_id and
 aida.po_distribution_id is not null
)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice PO Matched</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>31</SORT_ORDER>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>not exists
(select 
 null
 from 
 ap_invoice_distributions_all aida 
 where 
 aida.invoice_id = aia.invoice_id and
 aida.po_distribution_id is not null
)</SQL_TEXT>
    <MATCHING_VALUE>N</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice PO Matched</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>32</SORT_ORDER>
    <DISPLAY_SEQUENCE>280</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(
apsa.hold_flag = &apos;Y&apos; or
(assa.hold_all_payments_flag = &apos;Y&apos; and
 aia.payment_status_flag != &apos;Y&apos; and
 aia.cancelled_date is null
) or
exists
(select 
 null 
 from 
 ap_holds_all aha
 where 
 aha.invoice_id = aia.invoice_id and
 aha.release_lookup_code is null
)
)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice on Hold</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>33</SORT_ORDER>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>not (
apsa.hold_flag = &apos;Y&apos; or
(assa.hold_all_payments_flag = &apos;Y&apos; and
 aia.payment_status_flag != &apos;Y&apos; and
 aia.cancelled_date is null
) or
exists
(select 
 null 
 from 
 ap_holds_all aha
 where 
 aha.invoice_id = aia.invoice_id and
 aha.release_lookup_code is null
)
)</SQL_TEXT>
    <MATCHING_VALUE>N</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice on Hold</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>34</SORT_ORDER>
    <DISPLAY_SEQUENCE>290</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(
(:p_hold_code = &apos;Scheduled Payment Hold&apos; and 
 apsa.hold_flag = &apos;Y&apos;
) or
(:p_hold_code = &apos;Supplier Site Hold&apos; and
 assa.hold_all_payments_flag = &apos;Y&apos; and
 aia.payment_status_flag != &apos;Y&apos; and
 aia.cancelled_date is null
) or
exists
(select 
 null 
 from 
 ap_holds_all aha
 where 
 aha.invoice_id = aia.invoice_id and
 aha.release_lookup_code is null and
 aha.hold_lookup_code = xxen_util.lookup_code(:p_hold_code,&apos;HOLD CODE&apos;,200)
)
)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
x.value,
x.description
from
(
select
displayed_field value,
null description
from
ap_lookup_codes
where lookup_type=&apos;HOLD CODE&apos; and lookup_code in(select hold_lookup_code from ap_hold_codes where (hold_type like &apos;%REASON&apos; or hold_type in (&apos;INSUFFICIENT INFORMATION&apos;,&apos;PERIOD HOLD TYPE&apos;,&apos;PERIOD RELEASE TYPE&apos;))
and nvl(inactive_date,sysdate+1)&gt;sysdate)
and enabled_flag=&apos;Y&apos;
union
select
&apos;Scheduled Payment Hold&apos; value,
null description
from dual
union
select
&apos;Supplier Site Hold&apos; value,
null description
from dual
) x
order by 
x.value,
x.description</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Hold Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>35</SORT_ORDER>
    <DISPLAY_SEQUENCE>300</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>exists (select null from fnd_attached_documents fad where to_char(aia.invoice_id)=fad.pk1_value and aia.invoice_id=fad.pk1_value and fad.entity_name=&apos;AP_INVOICES&apos;)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Has Attachment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>36</SORT_ORDER>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>not exists (select null from fnd_attached_documents fad where to_char(aia.invoice_id)=fad.pk1_value and aia.invoice_id=fad.pk1_value and fad.entity_name=&apos;AP_INVOICES&apos;)</SQL_TEXT>
    <MATCHING_VALUE>N</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Has Attachment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>37</SORT_ORDER>
    <DISPLAY_SEQUENCE>310</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>select
decode(rownum,1,&apos; &apos;,&apos;and &apos;)||x.segment_name||&apos; &gt;= &apos;&apos;&apos;||x.seg_val||&apos;&apos;&apos;&apos;
from
(
select
&apos;gcc.&apos;||fifs.application_column_name segment_name,
substr(:p_expense_account_from,sum(fifs.display_size+1) over (order by fifs.segment_num rows between unbounded preceding and current row)-fifs.display_size,fifs.display_size) seg_val
from
fnd_id_flex_segments fifs
where
fifs.enabled_flag=&apos;Y&apos; and
fifs.application_id=101 and
fifs.id_flex_code=&apos;GL#&apos; and
fifs.id_flex_num=
(
select
gl.chart_of_accounts_id
from
gl_sets_of_books gl
where
gl.set_of_books_id in (select asp.set_of_books_id from ap_system_parameters asp) and
(:ledger is null or xxen_util.contains(:ledger,gl.name)=&apos;Y&apos;) and
rownum=1
)
order by
fifs.segment_num
) x</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
gcck.concatenated_segments value,
xxen_util.segments_description(gcck.code_combination_id) description
from
gl_code_combinations_kfv gcck
where
gcck.chart_of_accounts_id=
(
select
gl.chart_of_accounts_id
from
gl_sets_of_books gl
where
gl.set_of_books_id in (select asp.set_of_books_id from ap_system_parameters asp) and
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
rownum=1
) and
gcck.detail_posting_allowed=&apos;Y&apos; and
gcck.enabled_flag=&apos;Y&apos; and
gcck.summary_flag=&apos;N&apos;
order by
gcck.concatenated_segments</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Expense Account From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>38</SORT_ORDER>
    <DISPLAY_SEQUENCE>320</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>select
decode(rownum,1,&apos; &apos;,&apos;and &apos;)||x.segment_name||&apos; &lt;= &apos;&apos;&apos;||x.seg_val||&apos;&apos;&apos;&apos;
from
(
select
&apos;gcc.&apos;||fifs.application_column_name segment_name,
substr(:p_expense_account_to,sum(fifs.display_size+1) over (order by fifs.segment_num rows between unbounded preceding and current row)-fifs.display_size,fifs.display_size) seg_val
from
fnd_id_flex_segments fifs
where
fifs.enabled_flag=&apos;Y&apos; and
fifs.application_id=101 and
fifs.id_flex_code=&apos;GL#&apos; and
fifs.id_flex_num=
(
select
gl.chart_of_accounts_id
from
gl_sets_of_books gl
where
gl.set_of_books_id in (select asp.set_of_books_id from ap_system_parameters asp) and
(:ledger is null or xxen_util.contains(:ledger,gl.name)=&apos;Y&apos;) and
rownum=1
)
order by
fifs.segment_num
) x</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
gcck.concatenated_segments value,
xxen_util.segments_description(gcck.code_combination_id) description
from
gl_code_combinations_kfv gcck
where
gcck.chart_of_accounts_id=
(
select
gl.chart_of_accounts_id
from
gl_sets_of_books gl
where
gl.set_of_books_id in (select asp.set_of_books_id from ap_system_parameters asp) and
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
rownum=1
) and
gcck.detail_posting_allowed=&apos;Y&apos; and
gcck.enabled_flag=&apos;Y&apos; and
gcck.summary_flag=&apos;N&apos;
order by
gcck.concatenated_segments</LOV_QUERY_DSP>
    <MATCHING_VALUE>value</MATCHING_VALUE>
    <DEFAULT_VALUE>:$flex$.Expense_Account_From</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Expense Account To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>39</SORT_ORDER>
    <DISPLAY_SEQUENCE>330</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;dff_columns1</ANCHOR>
    <SQL_TEXT>select
case when  :show_dff  is not null
then
xxen_util.dff_columns(p_table_name=&gt;&apos;po_vendors&apos;,p_table_alias=&gt;&apos;aps&apos;,p_column_name_prefix=&gt;&apos;Supplier: &apos;)||
xxen_util.dff_columns(p_table_name=&gt;&apos;po_vendor_sites_all&apos;,p_table_alias=&gt;&apos;assa&apos;,p_column_name_prefix=&gt;&apos;Site: &apos;)||
xxen_util.dff_columns(p_table_name=&gt;&apos;ap_invoices_all&apos;,p_table_alias=&gt;&apos;aia&apos;,p_column_name_prefix=&gt;&apos;Invoice: &apos;)||
case when :display_level = &apos;Distributions&apos; then xxen_util.dff_columns(p_table_name=&gt;&apos;ap_invoice_distributions_all&apos;,p_table_alias=&gt;&apos;aida&apos;,p_column_name_prefix=&gt;&apos;Dist: &apos;) end
end
from
dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <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>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <DEFAULT_VALUE>Y</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>40</SORT_ORDER>
    <ANCHOR>&amp;dff_columns2</ANCHOR>
    <SQL_TEXT>select
case when  :show_dff  is not null
then
xxen_util.dff_columns(p_table_name=&gt;&apos;po_vendors&apos;,p_column_name_prefix=&gt;&apos;Supplier: &apos;,p_prefix=&gt;&apos;inv.&apos;)||
xxen_util.dff_columns(p_table_name=&gt;&apos;po_vendor_sites_all&apos;,p_table_alias=&gt;&apos;assa&apos;,p_column_name_prefix=&gt;&apos;Site: &apos;,p_prefix=&gt;&apos;inv.&apos;)||
xxen_util.dff_columns(p_table_name=&gt;&apos;ap_invoices_all&apos;,p_column_name_prefix=&gt;&apos;Invoice: &apos;,p_prefix=&gt;&apos;inv.&apos;)||
case when :display_level = &apos;Distributions&apos; then xxen_util.dff_columns(p_table_name=&gt;&apos;ap_invoice_lines_all&apos;,p_column_name_prefix=&gt;&apos;Dist: &apos;,p_prefix=&gt;&apos;inv.&apos;) end
end
from
dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <TEMPLATES>
   <TEMPLATES_ROW>
    <GUID>0D7FEF62609C41249B673D2C81284FE6</GUID>
    <TEMPLATE_NAME>Withholding Tax by Supplier</TEMPLATE_NAME>
    <DESCRIPTION>Withholding tax detail per supplier, invoice and payment, with the gross amount and the amount withheld, for supplier withholding certificates.</DESCRIPTION>
    <OWNER>SYSADMIN</OWNER>
    <TEMPLATE_COLUMNS>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>11</DISPLAY_SEQUENCE>
      <COLUMN_NAME>DIST_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>7</DISPLAY_SEQUENCE>
      <COLUMN_NAME>INVOICE_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>6</DISPLAY_SEQUENCE>
      <COLUMN_NAME>INVOICE_NUM</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SUPPLIER</COLUMN_NAME>
      <SORT_ORDER>1</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SUPPLIER_NUMBER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SUPPLIER_SITE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_GROSS_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>9</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_PAYMENT_DATE</COLUMN_NAME>
      <SORT_ORDER>2</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>8</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_PAYMENT_DOCUMENT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_TAX</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_TAX_RATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
    </TEMPLATE_COLUMNS>
    <TEMPLATE_PIVOT>
    </TEMPLATE_PIVOT>
    <TEMPLATE_SHARED_STRINGS>
    </TEMPLATE_SHARED_STRINGS>
    <TEMPLATE_PARAMETER_DEFAULTS>
     <TEMPLATE_PARAMETER_DEFAULTS_ROW>
      <PARAMETER_NAME>Display Level</PARAMETER_NAME>
      <DEFAULT_VALUE>Distributions</DEFAULT_VALUE>
     </TEMPLATE_PARAMETER_DEFAULTS_ROW>
     <TEMPLATE_PARAMETER_DEFAULTS_ROW>
      <PARAMETER_NAME>Distribution Type</PARAMETER_NAME>
      <DEFAULT_VALUE>AWT</DEFAULT_VALUE>
     </TEMPLATE_PARAMETER_DEFAULTS_ROW>
    </TEMPLATE_PARAMETER_DEFAULTS>
    <TEMPLATE_STYLES>
    </TEMPLATE_STYLES>
    <TEMPLATE_SHARING>
     <TEMPLATE_SHARING_ROW>
      <SHARING_LEVEL>S</SHARING_LEVEL>
      <LEVEL_VALUE>Site</LEVEL_VALUE>
     </TEMPLATE_SHARING_ROW>
    </TEMPLATE_SHARING>
    <PARAMETER_EXCLUSION>
    </PARAMETER_EXCLUSION>
    <TEMPLATE_CONDITIONS>
    </TEMPLATE_CONDITIONS>
   </TEMPLATES_ROW>
   <TEMPLATES_ROW>
    <GUID>F3D79D1B6FE24E6C8DE10DA501824F23</GUID>
    <TEMPLATE_NAME>Withholding Tax by Tax Authority</TEMPLATE_NAME>
    <DESCRIPTION>Withheld amounts per tax authority and withholding tax, with the supplier, invoice, payment and gross amount subject to withholding, for the withholding tax return.</DESCRIPTION>
    <OWNER>SYSADMIN</OWNER>
    <TEMPLATE_COLUMNS>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>14</DISPLAY_SEQUENCE>
      <COLUMN_NAME>DIST_ACCOUNTING_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>13</DISPLAY_SEQUENCE>
      <COLUMN_NAME>DIST_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>15</DISPLAY_SEQUENCE>
      <COLUMN_NAME>DIST_EXPENSE_ACCOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>9</DISPLAY_SEQUENCE>
      <COLUMN_NAME>INVOICE_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>8</DISPLAY_SEQUENCE>
      <COLUMN_NAME>INVOICE_NUM</COLUMN_NAME>
      <SORT_ORDER>4</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>6</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SUPPLIER</COLUMN_NAME>
      <SORT_ORDER>3</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>7</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SUPPLIER_SITE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TAX_AUTHORITY</COLUMN_NAME>
      <SORT_ORDER>1</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>16</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TAX_AUTHORITY_INVOICE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TAX_AUTHORITY_SITE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>12</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_GROSS_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>11</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_PAYMENT_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_PAYMENT_DOCUMENT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_TAX</COLUMN_NAME>
      <SORT_ORDER>2</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
      <COLUMN_NAME>WITHHOLDING_TAX_RATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
    </TEMPLATE_COLUMNS>
    <TEMPLATE_PIVOT>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>DIST_AMOUNT</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>TAX_AUTHORITY</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>WITHHOLDING_GROSS_AMOUNT</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>WITHHOLDING_TAX</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
    </TEMPLATE_PIVOT>
    <TEMPLATE_SHARED_STRINGS>
    </TEMPLATE_SHARED_STRINGS>
    <TEMPLATE_PARAMETER_DEFAULTS>
     <TEMPLATE_PARAMETER_DEFAULTS_ROW>
      <PARAMETER_NAME>Display Level</PARAMETER_NAME>
      <DEFAULT_VALUE>Distributions</DEFAULT_VALUE>
     </TEMPLATE_PARAMETER_DEFAULTS_ROW>
     <TEMPLATE_PARAMETER_DEFAULTS_ROW>
      <PARAMETER_NAME>Distribution Type</PARAMETER_NAME>
      <DEFAULT_VALUE>AWT</DEFAULT_VALUE>
     </TEMPLATE_PARAMETER_DEFAULTS_ROW>
    </TEMPLATE_PARAMETER_DEFAULTS>
    <TEMPLATE_STYLES>
    </TEMPLATE_STYLES>
    <TEMPLATE_SHARING>
     <TEMPLATE_SHARING_ROW>
      <SHARING_LEVEL>S</SHARING_LEVEL>
      <LEVEL_VALUE>Site</LEVEL_VALUE>
     </TEMPLATE_SHARING_ROW>
    </TEMPLATE_SHARING>
    <PARAMETER_EXCLUSION>
    </PARAMETER_EXCLUSION>
    <TEMPLATE_CONDITIONS>
    </TEMPLATE_CONDITIONS>
   </TEMPLATES_ROW>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
