<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<LOVS>
<!-- loader xml for Enginatics Blitz Report lov: AP Invoice Number -->
 <LOVS_ROW>
  <GUID>8E2FF36EDF3079D2E0530100007F1FF2</GUID>
  <LOV_NAME>AP Invoice Number</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <FILTER_BEFORE_DISPLAY>Y</FILTER_BEFORE_DISPLAY>
  <LOV_QUERY>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>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: AP Invoice Type -->
 <LOVS_ROW>
  <GUID>B20C1D394FC36EDDE0530100007F5621</GUID>
  <LOV_NAME>AP Invoice Type</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>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>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: AP Supplier -->
 <LOVS_ROW>
  <GUID>B9847D20A0E4742FE0538931640A6379</GUID>
  <LOV_NAME>AP Supplier</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <FILTER_BEFORE_DISPLAY>Y</FILTER_BEFORE_DISPLAY>
  <LOV_QUERY>select
aps.vendor_name value,
aps.segment1 description
from
ap_suppliers aps
where
(:$flex$.operating_unit is null or aps.vendor_id in (select assa.vendor_id from hr_all_organization_units_vl haouv, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos; and haouv.organization_id=assa.org_id)) and
(:$flex$.organization_code is null or aps.vendor_id in (select assa.vendor_id from org_organization_definitions ood, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.organization_code,ood.organization_code)=&apos;Y&apos; and ood.operating_unit=assa.org_id))
order by
aps.vendor_name,
aps.vendor_id</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: AP Supplier Site -->
 <LOVS_ROW>
  <GUID>8E2FF36EDF0279D2E0530100007F1FF2</GUID>
  <LOV_NAME>AP Supplier Site</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>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>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: GL Ledger -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEB879D2E0530100007F1FF2</GUID>
  <LOV_NAME>GL Ledger</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||decode(gl.ledger_category_code,&apos;NONE&apos;,xxen_util.meaning(gl.object_type_code,&apos;LEDGERS&apos;,101),xxen_util.meaning(gl.ledger_category_code,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101))||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
(:$flex$.ledger_category is null or gl.ledger_category_code=xxen_util.lookup_code(:$flex$.ledger_category,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101,&apos;Y&apos;)) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.ledger_id in (select nvl(glsnav.ledger_id,gasna.ledger_id) from gl_access_set_norm_assign gasna, gl_ledger_set_norm_assign_v glsnav where gasna.access_set_id=fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;) and gasna.ledger_id=glsnav.ledger_set_id(+)) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
decode(gl.ledger_category_code,&apos;PRIMARY&apos;,1,&apos;SECONDARY&apos;,2,&apos;ALC&apos;,3,&apos;NONE&apos;,4),
gl.name</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>دفاتر الأستاذ المقيدة بمجموعة الوصول ، المحددة بواسطة قيمة الملف الشخصي &quot;مجموعة الوصول إلى بيانات GL&quot; لمسؤولية تسجيل الدخول الحالية</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Ledger, die durch das Zugriffsset eingeschränkt sind, definiert durch den Profilwert &apos;GL Data Access Set&apos; der aktuellen Anmeldeverantwortung</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Libros restringidos por el conjunto de acceso, definido por el valor del perfil &quot;Conjunto de acceso a datos GL&quot; de la responsabilidad de inicio de sesión actual</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Grands livres limités par un ensemble d&apos;accès, défini par la valeur du profil &quot;GL Data Access Set&quot; de la responsabilité de connexion actuelle</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Libri mastri limitati dal set di accesso, definito dal valore del profilo &apos;GL Data Access Set&apos; della responsabilità di login corrente</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>現在のログイン責任者のプロファイル値&apos;GL Data Access Set&apos;によって定義されたアクセスセットによって制限された元帳</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>현재 로그인 권한의 프로파일 값 &apos;GL 데이터 액세스 세트&apos;로 정의 된 액세스 세트로 제한되는 원장</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Ledgers restritos pelo conjunto de acesso, definido pelo valor do perfil &apos;GL Data Access Set&apos; da atual responsabilidade de login</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Леджеры, ограниченные набором доступа, определяемые значением профиля &quot;GL Data Access Set&quot; текущей ответственности за вход в систему</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Ledgers begränsade av åtkomstuppsättning, definierade av profilvärde &apos;GL Data Access Set&apos; för det aktuella inloggningsansvaret</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Mevcut oturum açma sorumluluğunun profil değeri &apos;GL Veri Erişim Kümesi&apos; ile tanımlanan erişim kümesiyle kısıtlanmış defterler</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Ledgers restricted by access set, defined by profile value &apos;GL Data Access Set&apos; of the current login responsibility</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>由访问集限制的分类账，由当前登录责任的配置文件值 &quot;GL数据访问集 &quot;定义。</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: HR Operating Unit -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEB979D2E0530100007F1FF2</GUID>
  <LOV_NAME>HR Operating Unit</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
(:$flex$.ledger is null or hou.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hou.organization_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
hou.name</LOV_QUERY>
  <VERSION_COMMENTS>Fixed where clause duplication</VERSION_COMMENTS>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>وحدة التشغيل مقيدة بالتحكم في الوصول متعدد المنظمات (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Bedieneinheit eingeschränkt durch Multi Org Access Control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Unidad operativa restringida por el control de acceso multiorgánico (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Unité opérationnelle restreinte par un contrôle d&apos;accès multi-organismes (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Unità operativa limitata dal controllo di accesso multiorgano (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>多機関アクセス制御(MOAC)で制限された操作ユニット</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>다중 조직 액세스 제어 (MOAC)에 의해 제한되는 운영 단위</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Unidade operacional restrita por controle de acesso multi org (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Операционное устройство, ограниченное мультиорганизованным контролем доступа (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Styrenhet begränsad av multi-org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Çoklu kuruluş erişim kontrolü (MOAC) tarafından kısıtlanan işletim birimi</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Operating unit restricted by multi org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>受多机构访问控制（MOAC）限制的操作单元。</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: Yes -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEA679D2E0530100007F1FF2</GUID>
  <LOV_NAME>Yes</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
</LOVS>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: AP Invoices and Lines 11i -->
 <REPORTS_ROW>
  <GUID>B5F889C2A60B0296E0530100007FC863</GUID>
  <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.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,
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,
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>
  <ENABLED>Y</ENABLED>
  <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
</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||decode(gl.ledger_category_code,&apos;NONE&apos;,xxen_util.meaning(gl.object_type_code,&apos;LEDGERS&apos;,101),xxen_util.meaning(gl.ledger_category_code,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101))||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
(:$flex$.ledger_category is null or gl.ledger_category_code=xxen_util.lookup_code(:$flex$.ledger_category,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101,&apos;Y&apos;)) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.ledger_id in (select nvl(glsnav.ledger_id,gasna.ledger_id) from gl_access_set_norm_assign gasna, gl_ledger_set_norm_assign_v glsnav where gasna.access_set_id=fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;) and gasna.ledger_id=glsnav.ledger_set_id(+)) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
decode(gl.ledger_category_code,&apos;PRIMARY&apos;,1,&apos;SECONDARY&apos;,2,&apos;ALC&apos;,3,&apos;NONE&apos;,4),
gl.name</LOV_QUERY_DSP>
    <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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
(:$flex$.ledger is null or hou.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hou.organization_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
hou.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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,
-- 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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
aps.vendor_name value,
aps.segment1 description
from
ap_suppliers aps
where
(:$flex$.operating_unit is null or aps.vendor_id in (select assa.vendor_id from hr_all_organization_units_vl haouv, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos; and haouv.organization_id=assa.org_id)) and
(:$flex$.organization_code is null or aps.vendor_id in (select assa.vendor_id from org_organization_definitions ood, ap_supplier_sites_all assa where xxen_util.contains(:$flex$.organization_code,ood.organization_code)=&apos;Y&apos; and ood.operating_unit=assa.org_id))
order by
aps.vendor_name,
aps.vendor_id</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Supplier</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>27</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>28</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <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>29</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <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>30</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>31</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <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>32</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>33</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>34</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <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>35</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>36</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>37</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_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>38</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>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <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>39</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>
  <PARAMETER_DEPENDENCIES>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Expense_Account_From</FLEX_BIND>
    <PARAMETER_NAME>Expense Account From</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Expense Account To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_date_from</FLEX_BIND>
    <PARAMETER_NAME>Accounting Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Accounting Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ap_supplier</FLEX_BIND>
    <PARAMETER_NAME>Supplier</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Supplier Site</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_creation_date_from</FLEX_BIND>
    <PARAMETER_NAME>Invoice Creation Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Invoice Creation Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_date_from</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Invoice Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_number</FLEX_BIND>
    <PARAMETER_NAME>Invoice Number</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Exclude Cancelled</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_number</FLEX_BIND>
    <PARAMETER_NAME>Invoice Number</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Accounting Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Expense Account From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Expense Account To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Creation Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Date Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Number</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Operating Unit</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Payment Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Accounting Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Creation Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Date Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Number</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Payment Period</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Supplier</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Supplier Site</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_date_from</FLEX_BIND>
    <PARAMETER_NAME>Payment Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Payment Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
  </PARAMETER_DEPENDENCIES>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
  <UPLOAD_DEPENDENCIES>
  </UPLOAD_DEPENDENCIES>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
