<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 Period -->
 <LOVS_ROW>
  <GUID>C23FDB3DBE0DC71FE0530100007FACC7</GUID>
  <LOV_NAME>AP Period</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>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.ledger_id=
(
select 
asp.set_of_books_id 
from   
ap_system_parameters asp, 
gl_ledgers gl,
hr_operating_units hou 
where  
asp.set_of_books_id=gl.ledger_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>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Past AP period, dependent on Ledger and/or Operating Unit</DESCRIPTION>
   </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: APL: AP Invoices and Lines -->
 <REPORTS_ROW>
  <GUID>382972533FD5AC4EE0633D74000A9B93</GUID>
  <SQL_TEXT>select
ap_inv.ledger,
ap_inv.operating_unit,
ap_inv.supplier,
ap_inv.supplier_number,
ap_inv.supplier_site,
ap_inv.invoice_num,
ap_inv.doc_sequence_value document_number,
ap_inv.invoice_status,
ap_inv.batch_name,
ap_inv.invoice_creation_date,
ap_inv.invoice_received_date,
ap_inv.invoice_date,
ap_inv.invoice_gl_date,
ap_inv.due_date,
ap_inv.days_due,
ap_inv.invoice_type,
ap_inv.invoice_source,
ap_inv.invoice_description,
ap_inv.has_attachment,
ap_inv.invoice_currency_code,
ap_inv.payment_currency_code,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.invoice_amount) invoice_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_invoices_utility_pkg.get_item_total(ap_inv.invoice_id, ap_inv.org_id)) items_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_invoices_utility_pkg.get_retained_total(ap_inv.invoice_id, ap_inv.org_id)) retainage_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_invoices_utility_pkg.get_prepaid_amount(ap_inv.invoice_id)) prepayments_applied_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_invoices_utility_pkg.get_amount_withheld(ap_inv.invoice_id)) witholding_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,
nvl(ap_invoices_utility_pkg.get_item_total(ap_inv.invoice_id, ap_inv.org_id),0)
+ nvl(ap_invoices_utility_pkg.get_retained_total(ap_inv.invoice_id, ap_inv.org_id),0)
- nvl(abs(ap_invoices_utility_pkg.get_prepaid_amount(ap_inv.invoice_id)),0)
- nvl(ap_invoices_utility_pkg.get_amount_withheld(ap_inv.invoice_id),0)
) invoice_subtotal,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.total_tax_amount) tax_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.self_assessed_tax_amount) self_assessed_tax_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_invoices_utility_pkg.get_freight_total(ap_inv.invoice_id, ap_inv.org_id)) freight_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_invoices_utility_pkg.get_misc_total(ap_inv.invoice_id, ap_inv.org_id)) miscellaneous_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,
nvl(ap_invoices_utility_pkg.get_item_total(ap_inv.invoice_id, ap_inv.org_id),0)
+ nvl(ap_invoices_utility_pkg.get_retained_total(ap_inv.invoice_id, ap_inv.org_id),0)
- nvl(abs(ap_invoices_utility_pkg.get_prepaid_amount(ap_inv.invoice_id)),0)
- nvl(ap_invoices_utility_pkg.get_amount_withheld(ap_inv.invoice_id),0)
+ nvl(ap_inv.total_tax_amount,0)
+ nvl(ap_invoices_utility_pkg.get_freight_total(ap_inv.invoice_id, ap_inv.org_id),0)
+ nvl(ap_invoices_utility_pkg.get_misc_total(ap_inv.invoice_id, ap_inv.org_id),0)
) invoice_total,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.amount_applicable_to_discount) amount_applicable_to_discount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.discount_amount_taken) discount_amount_taken,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.approved_amount) approved_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.pay_curr_invoice_amount) payment_curr_invoice_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.amount_paid) amount_paid,
ap_inv.base_currency,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.invoice_amount_base) invoice_amount_base,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.tax_amount_base) tax_amount_base,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.amt_applicable_to_disc_base) amt_applicable_to_disc_base,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.discount_amount_taken_base) discount_amount_taken_base,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.approved_amount_base) approved_amount_base,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.amount_paid_base) amount_paid_base,
ap_inv.payment_num,
ap_inv.payment_date,
decode(ap_inv.first_psched,&apos;Y&apos;,ap_inv.gross_amount) payment_num_gross_amount,
decode(ap_inv.first_psched,&apos;Y&apos;,ap_inv.amount_remaining) payment_num_amount_remaining,
ap_inv.unit_registration_number,
ap_inv.supplier_registration_number,
&amp;gst_columns
&amp;aging_bucket_cols2
ap_inv.payment_cross_rate,
ap_inv.payment_cross_rate_date,
ap_inv.discount_date,
ap_inv.future_pay_due_date,
ap_inv.payment_method,
ap_inv.payment_priority,
ap_inv.invoice_payment_status,
ap_inv.schedule_payment_status,
ap_inv.second_discount_date,
ap_inv.third_discount_date,
decode(ap_inv.first_psched,&apos;Y&apos;,ap_inv.discount_amount_available) discount_amount_available,
decode(ap_inv.first_psched,&apos;Y&apos;,ap_inv.second_disc_amt_available) second_disc_amt_available,
decode(ap_inv.first_psched,&apos;Y&apos;,ap_inv.third_disc_amt_available) third_disc_amt_available,
decode(ap_inv.first_psched,&apos;Y&apos;,ap_inv.discount_amount_remaining) discount_amount_remaining,
decode(ap_inv.first_psched,&apos;Y&apos;,ap_inv.inv_curr_gross_amount) inv_curr_gross_amount,
ap_inv.bank_name,
ap_inv.iban,
ap_inv.invoice_terms,
ap_inv.terms_date,
ap_inv.invoice_cancelled_date,
ap_inv.invoice_cancelled_by,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.invoice_cancelled_amount) invoice_cancelled_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.invoice_temp_cancelled_amount) invoice_temp_cancelled_amount,
ap_inv.auto_tax_calculation_method,
ap_inv.invoice_pay_group,
ap_inv.invoice_exclusive_payment_flag,
ap_inv.dispute_reason,
ap_inv.supplier_site_payment_hold,
ap_inv.scheduled_payment_hold,
ap_inv.scheduled_payment_hold_reason,
ap_holds.holds invoice_holds,
ap_holds.hold_dates invoice_hold_dates,
ap_holds.holds_held_by invoice_holds_held_by,
ap_holds.hold_po_references invoice_hold_purchase_orders,
ap_holds.hold_receipt_references invoice_hold_receipts,
&amp;invoice_detail_columns
&amp;dff_columns2
ap_inv.accts_pay_account,
ap_inv.accts_pay_account_descripton,
ap_inv.recurring_pmt_number,
ap_inv.recurring_pmt_period_type,
ap_inv.recurring_number_of_periods,
ap_inv.recurring_pmt_description,
ap_inv.supplier_taxpayer_id,
ap_inv.supplier_tax_registration,
ap_inv.supplier_inactive_on,
ap_inv.customer_num,
ap_inv.one_time_supplier,
ap_inv.supplier_credit_status,
ap_inv.credit_limit,
ap_inv.supplier_withholding_status,
ap_inv.withholding_start_date,
ap_inv.supplier_vat_code,
ap_inv.supplier_site_alt,
ap_inv.purchasing_site,
ap_inv.rfq_site,
ap_inv.pay_site,
ap_inv.tax_reporting_site,
ap_inv.p_card_site,
ap_inv.attention_ar,
ap_inv.address_line1,
ap_inv.address_line2,
ap_inv.address_line3,
ap_inv.address_line4,
ap_inv.city,
ap_inv.state,
ap_inv.zip,
ap_inv.county,
ap_inv.province,
ap_inv.country,
ap_inv.area_code,
ap_inv.phone,
ap_inv.fax_area_code,
ap_inv.fax,
ap_inv.supplier_notif_method,
ap_inv.email_address,
ap_inv.remittance_email,
&amp;gcc_dist_segment_columns
&amp;attachment_columns
ap_inv.created_by,
ap_inv.creation_date,
ap_inv.last_updated_by,
ap_inv.last_update_date,
ap_inv.line_created_by,
ap_inv.line_creation_date,
ap_inv.line_last_updated_by,
ap_inv.line_last_update_date,
ap_inv.dist_created_by,
ap_inv.dist_creation_date,
ap_inv.dist_last_updated_by,
ap_inv.dist_last_update_date,
ap_inv.invoice_id
from
(
select
gl.name ledger,
haouv.name operating_unit,
nvl(aps.vendor_name,hp.party_name) supplier,
nvl(aps.segment1,hp.party_number) supplier_number,
nvl(assa.vendor_site_code,hps.party_site_number) supplier_site,
aia.invoice_num,
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,
aba.batch_name,
xxen_util.client_time(aia.creation_date) invoice_creation_date,
xxen_util.client_time(aia.invoice_received_date) invoice_received_date,
aia.invoice_date,
aia.gl_date invoice_gl_date,
apsa.due_date,
ceil(sysdate-apsa.due_date) days_due,
xxen_util.meaning(aia.invoice_type_lookup_code,&apos;INVOICE TYPE&apos;,200) invoice_type,
aia.source invoice_source,
aia.description invoice_description,
(select xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) from fnd_attached_documents fad where to_char(aia.invoice_id)=fad.pk1_value and fad.entity_name=&apos;AP_INVOICES&apos; and rownum=1) has_attachment,
aia.invoice_currency_code,
aia.payment_currency_code,
aia.invoice_amount,
aia.total_tax_amount,
aia.self_assessed_tax_amount,
aia.amount_applicable_to_discount,
aia.discount_amount_taken,
aia.approved_amount,
aia.pay_curr_invoice_amount,
aia.amount_paid,
gl.currency_code base_currency,
decode(aia.invoice_currency_code,gl.currency_code,aia.invoice_amount,aia.base_amount) invoice_amount_base,
aia.total_tax_amount*nvl(aia.exchange_rate,1) tax_amount_base,
aia.amount_applicable_to_discount*nvl(aia.exchange_rate,1) amt_applicable_to_disc_base,
aia.discount_amount_taken/aia.payment_cross_rate*nvl(aia.exchange_rate,1) discount_amount_taken_base,
aia.approved_amount*nvl(aia.exchange_rate,1) approved_amount_base,
aia.amount_paid/aia.payment_cross_rate*nvl(aia.exchange_rate,1) amount_paid_base,
aia.dispute_reason,
aia.doc_sequence_value,
apsa.payment_priority,
apsa.payment_num,
(
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
) payment_date,
apsa.gross_amount,
apsa.amount_remaining/aia.payment_cross_rate*nvl(aia.exchange_rate,1) amount_remaining,
&amp;aging_bucket_cols1
&amp;gst_header
&amp;gst_lines
&amp;gst_distributions
:p_trx_date_from trx_date_from,
:p_trx_date_to trx_date_to,
aia.payment_cross_rate,
aia.payment_cross_rate_date,
apsa.discount_date,
apsa.future_pay_due_date,
case when assa.hold_all_payments_flag=&apos;Y&apos; and aia.cancelled_date is null and aia.payment_status_flag&lt;&gt;&apos;Y&apos; then xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) end supplier_site_payment_hold,
decode(apsa.hold_flag,&apos;Y&apos;,xxen_util.meaning(apsa.hold_flag,&apos;YES_NO&apos;,0)) scheduled_payment_hold,
decode(apsa.hold_flag,&apos;Y&apos;,apsa.iby_hold_reason) scheduled_payment_hold_reason,
nvl(xxen_util.meaning(apsa.payment_method_code,&apos;PAYMENT METHOD&apos;,200),apsa.payment_method_code) payment_method,
xxen_util.meaning(aia.payment_status_flag,&apos;INVOICE PAYMENT STATUS&apos;,200) invoice_payment_status,
xxen_util.meaning(apsa.payment_status_flag,&apos;INVOICE PAYMENT STATUS&apos;,200) schedule_payment_status,
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,
apsa.inv_curr_gross_amount,
cbv.bank_name,
ieba.masked_iban iban,
at.name invoice_terms,
aia.terms_date,
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,
xxen_util.meaning(aia.auto_tax_calc_flag,&apos;AP_TAX_CALCULATION_METHOD&apos;,200) auto_tax_calculation_method,
aia.pay_group_lookup_code invoice_pay_group,
xxen_util.meaning(aia.exclusive_payment_flag,&apos;YES_NO&apos;,0) invoice_exclusive_payment_flag,
xxen_util.concatenated_segments(aia.accts_pay_code_combination_id) accts_pay_account,
xxen_util.segments_description(aia.accts_pay_code_combination_id) accts_pay_account_descripton,
aila.line_number,
xxen_util.meaning(aila.line_type_lookup_code,&apos;INVOICE LINE TYPE&apos;,200) line_type,
xxen_util.meaning(aila.line_source,&apos;LINE SOURCE&apos;,200) line_source,
decode(aila.discarded_flag,&apos;Y&apos;,&apos;Y&apos;) line_discarded,
replace(aila.description,&apos;~&apos;,&apos;-&apos;) line_description,
aila.amount line_amount,
nvl(aila.base_amount,aila.amount) line_base_amount,
aila.accounting_date line_accounting_date,
decode(aila.deferred_acctg_flag,&apos;Y&apos;,xxen_util.meaning(aila.deferred_acctg_flag,&apos;YES_NO&apos;,0)) deferred_option,
aila.def_acctg_start_date deferred_start_date,
aila.def_acctg_end_date deferred_end_date,
aila.tax_regime_code,
aila.tax,
aila.tax_jurisdiction_code,
aila.tax_rate_code,
aila.tax_rate,
case when aila.line_type_lookup_code=&apos;ITEM&apos; then (select distinct hl.location_code from hr_locations hl where hl.location_id=aila.ship_to_location_id) end warehouse_code,
aida.distribution_line_number dist_line_number,
xxen_util.meaning(aida.line_type_lookup_code,&apos;INVOICE DISTRIBUTION TYPE&apos;,200) distribution_type,
aida.period_name,
aida.accounting_date dist_accounting_date,
case when &apos;&amp;show_aida&apos;=&apos;Y&apos; then aida.quantity_invoiced else aila.quantity_invoiced end quantity_invoiced,
case when &apos;&amp;show_aida&apos;=&apos;Y&apos; then aida.unit_price else aila.unit_price end unit_price,
aida.amount dist_amount,
nvl(aida.base_amount,aida.amount) dist_base_amount,
aida.invoice_price_variance dist_invoice_price_variance,
aida.base_invoice_price_variance dist_base_inv_price_variance,
aida.dist_code_combination_id,
xxen_util.concatenated_segments(aida.dist_code_combination_id) expense_account,
xxen_util.concatenated_segments(aida.price_var_code_combination_id) price_variance_account,
xxen_util.segments_description(aida.dist_code_combination_id) expense_account_descripton,
xxen_util.segments_description(aida.price_var_code_combination_id) price_variance_account_desc,
xxen_util.meaning(aida.dist_match_type,&apos;MATCH_STATUS&apos;,200) dist_match_type,
decode(aida.match_status_flag,&apos;A&apos;,&apos;Validated&apos;,&apos;T&apos;,&apos;Tested&apos;,&apos;S&apos;,&apos;Stopped&apos;,&apos;Never Validated&apos;) dist_match_status,
(select pha.segment1 from po_headers_all pha where nvl((select pda.po_header_id from po_distributions_all pda where nvl(aida.po_distribution_id,aila.po_distribution_id)=pda.po_distribution_id),aia.quick_po_header_id)=pha.po_header_id) po_number,
nvl((select max(rt.transaction_date) from rcv_transactions rt where rt.transaction_id = nvl(aida.rcv_transaction_id,aila.rcv_transaction_id) and rt.transaction_type in (&apos;RECEIVE&apos;,&apos;DELIVER&apos;)),
    (select max(rt.transaction_date) from rcv_transactions rt where rt.po_line_id = aila.po_line_id and rt.po_line_location_id = aila.po_line_location_id and rt.transaction_type in (&apos;RECEIVE&apos;,&apos;DELIVER&apos;))
) receipt_date,
(select  listagg(x.receipt_num,&apos;,&apos;) within group (order by x.receipt_num) receipt_num
from
(select distinct
 rsh.receipt_num
 from
 rcv_transactions rt,
 rcv_shipment_lines rsl,
 rcv_shipment_headers rsh
 where
 rt.transaction_id= nvl(aida.rcv_transaction_id,aila.rcv_transaction_id) and
 rsl.shipment_line_id=rt.shipment_line_id and
 rt.transaction_type in (&apos;RECEIVE&apos;,&apos;DELIVER&apos;) and
 rsh.shipment_header_id=rt.shipment_header_id
) x
)receipt_number,
xxen_util.meaning(aida.assets_tracking_flag,&apos;YES_NO&apos;,0) dist_asset_tracking_flag,
aida.assets_addition_flag dist_assets_addition_flag,
replace(aida.description,&apos;~&apos;,&apos;-&apos;) dist_description,
aida.expenditure_item_date pa_expenditure_item_date,
aida.expenditure_type pa_expenditure_type,
coalesce(haouv1.name,haouv3.name,haouv2.name) expenditure_organization,
nvl(xxen_util.meaning(aida.pa_addition_flag,&apos;PA_ADDITION_FLAG&apos;,275),aida.pa_addition_flag) pa_addition_flag,
aida.project_accounting_context,
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,
arpa.recurring_pay_num    recurring_pmt_number,
arpa.rec_pay_period_type  recurring_pmt_period_type,
arpa.num_of_periods       recurring_number_of_periods,
arpa.description          recurring_pmt_description,
aps.num_1099             supplier_taxpayer_id,
aps.vat_registration_num supplier_tax_registration,
aps.end_date_active      supplier_inactive_on,
aps.customer_num,
xxen_util.meaning(aps.one_time_flag,&apos;YES_NO&apos;,0) one_time_supplier,
aps.credit_status_lookup_code supplier_credit_status,
aps.credit_limit,
aps.withholding_status_lookup_code supplier_withholding_status,
aps.withholding_start_date,
aps.vat_code supplier_vat_code,
assa.vendor_site_code_alt   supplier_site_alt,
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,
nvl(assa.address_line1,hl.address1) address_line1,
nvl(assa.address_line2,hl.address2) address_line2,
nvl(assa.address_line3,hl.address3) address_line3,
nvl(assa.address_line4,hl.address4) address_line4,
nvl(assa.city,hl.city) city,
nvl(assa.state,hl.state) state,
nvl(assa.zip,hl.postal_code)  zip,
nvl(assa.county,hl.county) county,
nvl(assa.province,hl.province) province,
nvl(assa.country,hl.country) country,
assa.area_code,
assa.phone,
assa.fax_area_code,
assa.fax,
assa.supplier_notif_method,
assa.email_address,
assa.remittance_email,
&amp;dff_columns
xxen_util.user_name(aia.created_by) created_by,
xxen_util.client_time(aia.creation_date) creation_date,
xxen_util.user_name(aia.last_updated_by) last_updated_by,
xxen_util.client_time(aia.last_update_date) last_update_date,
xxen_util.user_name(aila.created_by) line_created_by,
xxen_util.client_time(aila.creation_date) line_creation_date,
xxen_util.user_name(aila.last_updated_by) line_last_updated_by,
xxen_util.client_time(aila.last_update_date) line_last_update_date,
xxen_util.user_name(aida.created_by) dist_created_by,
xxen_util.client_time(aida.creation_date) dist_creation_date,
xxen_util.user_name(aida.last_updated_by) dist_last_updated_by,
xxen_util.client_time(aida.last_update_date) dist_last_update_date,
aia.invoice_id,
aia.org_id,
(select 
jprl.registration_number
from
jai_party_regs jpr,
jai_party_reg_lines jprl,
jai_tax_lines_v jtlv
where
jpr.party_reg_id=jprl.party_reg_id and
jpr.party_type_code=&apos;IO&apos; and
jprl.registration_type_code=&apos;GST&apos; and
jtlv.trx_id=aia.invoice_id and
jpr.party_id=jtlv.organization_id and
jpr.party_site_id=jtlv.location_id and
jprl.effective_to is null and
rownum=1
) unit_registration_number,
(select 
jprl.registration_number
from
jai_party_regs jpr,
jai_party_reg_lines jprl
where
jpr.party_reg_id=jprl.party_reg_id and
jpr.party_type_code=&apos;THIRD_PARTY_SITE&apos; and
jprl.registration_type_code=&apos;GST&apos; and
jpr.party_id=aia.vendor_id and
jpr.party_site_id=aia.vendor_site_id and
jprl.effective_to is null and
regime_id in (select jr.regime_id from jai_regimes jr where jr.regime_code like &apos;%GST India&apos;) and
rownum=1
) supplier_registration_number,
decode(row_number() over (partition by apsa.invoice_id order by nvl(apsa.payment_num,1),aila.line_number,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 aila.line_number,aida.accounting_date,aida.distribution_line_number),1,&apos;Y&apos;) first_psched,
decode(row_number() over (partition by apsa.invoice_id,aila.line_number order by aida.accounting_date,aida.distribution_line_number),1,&apos;Y&apos;) first_line
from
gl_ledgers gl,
hr_all_organization_units_vl haouv,
hr_all_organization_units_vl haouv1,
hr_all_organization_units_vl haouv2,
hr_all_organization_units_vl haouv3,
ap_invoices_all aia,
ap_batches_all aba,
ap_payment_schedules_all apsa,
iby_ext_bank_accounts ieba,
ce_banks_v cbv,
ap_suppliers aps,
ap_supplier_sites_all assa,
hz_parties hp,
hz_party_sites hps,
hz_locations hl,
(select aila.* from ap_invoice_lines_all aila where &apos;&amp;show_aila&apos;=&apos;Y&apos;) aila,
(select aida2.* from ap_invoice_distributions_all aida2, gl_code_combinations gcc where &apos;&amp;show_aida&apos;=&apos;Y&apos; and 2=2 and aida2.dist_code_combination_id=gcc.code_combination_id) aida,
ap_recurring_payments_all arpa,
ap_terms at,
pa_projects_all ppa,
pa_tasks pt
where
1=1 and
aia.set_of_books_id=gl.ledger_id and
aia.org_id=haouv.organization_id(+) and
aia.expenditure_organization_id=haouv1.organization_id(+) and
aila.expenditure_organization_id=haouv2.organization_id(+) and
aida.expenditure_organization_id=haouv3.organization_id(+) and
aia.batch_id=aba.batch_id(+) and
aia.invoice_id=apsa.invoice_id and
apsa.external_bank_account_id=ieba.ext_bank_account_id(+) and
ieba.bank_id=cbv.bank_party_id(+) and
aia.vendor_id=aps.vendor_id(+) and
aia.vendor_site_id=assa.vendor_site_id(+) and
aia.party_id=hp.party_id(+) and
aia.party_site_id=hps.party_site_id(+) and
hps.location_id=hl.location_id(+) and
decode(apsa.payment_num,1,apsa.invoice_id)=aila.invoice_id(+) and
aila.invoice_id=aida.invoice_id(+)and
aila.line_number=aida.invoice_line_number(+) 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(+) and
(
:p_has_dist_criteria is null or aia.invoice_id in --need this to apply dist level restrictions in case report is run at header or line level
(
select
aida2.invoice_id
from
ap_invoice_distributions_all aida2,
gl_code_combinations gcc
where
2=2 and
nvl(aila.line_number,aida2.invoice_line_number)=aida2.invoice_line_number and
nvl(aida.distribution_line_number,aida2.distribution_line_number)=aida2.distribution_line_number and
aida2.dist_code_combination_id=gcc.code_combination_id
)
)
) ap_inv,
(
select distinct
x.invoice_id,
listagg(x.hold_name,&apos;, &apos;) within group (order by x.hold_name) over (partition by x.invoice_id) holds,
case count(distinct fnd_date.date_to_displaydate(x.hold_date)) over (partition by x.invoice_id)
 when 1 then to_char(fnd_date.date_to_displaydate(x.hold_date))
 else listagg(to_char(fnd_date.date_to_displaydate(x.hold_date)),&apos;, &apos;) within group (order by x.hold_name) over (partition by x.invoice_id)
 end hold_dates,
case count(distinct x.held_by_user_name) over (partition by x.invoice_id)
 when 1 then x.held_by_user_name
 else listagg(x.held_by_user_name,&apos;, &apos;) within group (order by x.hold_name) over (partition by x.invoice_id)
 end holds_held_by,
x.po_ref hold_po_references,
x.receipt_ref hold_receipt_references
from
(
select distinct
  aha.invoice_id,
  alc.displayed_field hold_name,
  first_value(aha.hold_date) over (partition by aha.invoice_id,aha.hold_lookup_code order by aha.hold_date) hold_date,
  first_value(decode(aha.held_by,5,xxen_util.meaning(&apos;SYSTEM&apos;,&apos;NLS TRANSLATION&apos;,200),xxen_util.user_name(aha.held_by))) over (partition by aha.invoice_id,aha.hold_lookup_code order by aha.hold_date) held_by_user_name,
  po.po_ref,
  rcv.receipt_ref
 from
  ap_holds_all aha,
  ap_lookup_codes alc,
  (select distinct
    x.invoice_id,
    listagg(x.po_ref,&apos;,&apos;) within group (order by x.po_ref) over (partition by x.invoice_id) po_ref
   from
    (select distinct
      aha.invoice_id,
      nvl(pha.clm_document_number,pha.segment1)||&apos;(&apos;||nvl(to_char(pra.release_num),&apos; &apos;)||&apos;)(&apos;||nvl(pla.line_num_display, to_char(pla.line_num))||&apos;)(&apos;||plla.shipment_num||&apos;)&apos; po_ref
     from
      ap_holds_all aha,
      po_line_locations_all plla,
      po_lines_all pla,
      po_headers_all pha,
      po_releases_all pra
     where
      aha.release_lookup_code is null and
      plla.line_location_id=aha.line_location_id and
      pla.po_line_id=plla.po_line_id and
      pha.po_header_id=plla.po_header_id and
      pra.po_release_id (+)=plla.po_release_id
    ) x
  ) po,
  (select distinct
    x.invoice_id,
    listagg(x.receipt_ref,&apos;,&apos;) within group (order by x.receipt_ref) over (partition by x.invoice_id) receipt_ref
   from
    (select distinct
      aha.invoice_id,
      rsh.receipt_num||&apos;(&apos;||rsl.line_num||&apos;)&apos; receipt_ref
     from
      ap_holds_all aha,
      rcv_transactions rt,
      rcv_shipment_lines rsl,
      rcv_shipment_headers rsh
     where
      aha.release_lookup_code is null and
      rt.transaction_id=aha.rcv_transaction_id and
      rsl.shipment_line_id=rt.shipment_line_id and
      rsh.shipment_header_id=rt.shipment_header_id
    ) x
  ) rcv
 where
  aha.release_lookup_code is null and
  aha.hold_lookup_code=alc.lookup_code and
  alc.lookup_type=&apos;HOLD CODE&apos; and
  aha.invoice_id=po.invoice_id(+) and
  aha.invoice_id=rcv.invoice_id(+)
) x
) ap_holds,
(select
 fad.attached_document_id attachment_id,
 fad.entity_name,
 fad.pk1_value entity_id,
 fad.seq_num,
 fdd.user_name type,
 fdct.user_name category,
 fdt.title,
 fdt.description,
 case fd.datatype_id
 when 1 then (select fdst.short_text from fnd_documents_short_text fdst where fdst.media_id = fd.media_id)
 when 5 then fd.url
 when 6 then (select fl.file_name from fnd_lobs fl where fl.file_id = fd.media_id)
 else null
 end content,
 case when fd.datatype_id = 6 then fd.media_id else null end file_id
 from
 fnd_attached_documents fad,
 fnd_documents fd,
 fnd_documents_tl fdt,
 fnd_document_datatypes fdd,
 fnd_document_categories_tl fdct
 where
 fad.document_id = fd.document_id and
 fd.document_id = fdt.document_id and
 fdt.language = userenv(&apos;lang&apos;) and
 fd.datatype_id = fdd.datatype_id and
 fdd.language = userenv(&apos;lang&apos;) and
 fd.category_id = fdct.category_id and
 fdct.language = userenv(&apos;lang&apos;) and
 fd.datatype_id in (1,5,6)
) attchmt,
gl_code_combinations_kfv gcck
where
ap_inv.invoice_id=ap_holds.invoice_id(+) and
decode(:p_show_attachments,&apos;Y&apos;,&apos;AP_INVOICES&apos;,null)=attchmt.entity_name(+) and
decode(:p_show_attachments,&apos;Y&apos;,to_char(ap_inv.invoice_id),null)=attchmt.entity_id(+) and
ap_inv.dist_code_combination_id=gcck.code_combination_id(+)
order by
ap_inv.operating_unit,
ap_inv.supplier,
ap_inv.supplier_number,
ap_inv.invoice_date,
ap_inv.invoice_gl_date,
ap_inv.invoice_num,
ap_inv.payment_num,
ap_inv.line_number,
ap_inv.dist_accounting_date,
ap_inv.dist_line_number,
attchmt.seq_num</SQL_TEXT>
  <ENABLED>Y</ENABLED>
  <XDO_APPLICATION_SHORT_NAME>SQLAP</XDO_APPLICATION_SHORT_NAME>
  <NUMBER_FORMAT>#,##0.000;[Red]-#,##0.000</NUMBER_FORMAT>
  <COPIED_FROM_GUID>55DEB4D48B1D727FE0530100007F0ADE</COPIED_FROM_GUID>
  <REQUIRED_PARAMETERS>(:Ledger is not null or :Operating_Unit is not null)</REQUIRED_PARAMETERS>
  <ATTRIBUTE1>Y</ATTRIBUTE1>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>APL: AP Invoices and Lines</REPORT_NAME>
    <DESCRIPTION>Detail Invoice Aging report with line item details and amounts

Parameter explanation:
- Invoice on Hold (LOV: Yes/No)
  Default Value = Null (Hold Status not considered as per current behaviour)
  Yes - Only Invoices that currently have an unreleased hold will be retrieved
  No - Only Invoices that do not currently have an unreleased hold will be retrieved

- Hold Name (LOV: AP Hold Names)
  Default Value Null
  If specified - only Invoices that currently have an unreleased hold of the specified name will be retrieved

Hold column explanation:
- Holds  - a list of the current unreleased holds against the invoice
- Hold Dates - the Hold Date
- Holds Held By - the name of user who applied the holds
- Hold PO References - Identifies the matching POs for PO Matching Holds in the format: PO Number(Release number)(Line Number)(Shipment Number)
- Hold Receipt References  - Identifies the matching Receipts for Receipt Matching Holds in the format: Receipt Number(Line Number)</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>Please enter a Ledger or Operating Unit</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
  </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;attachment_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;dff_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;dff_columns2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;gcc_dist_segment_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;gst_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;gst_distributions</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;gst_header</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;gst_lines</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>&amp;show_aila</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_has_dist_criteria</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_show_attachments</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_trx_date_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_trx_date_to</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>-30</DISPLAY_SEQUENCE>
    <ANCHOR>:p_trx_date_from</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select nvl(:$flex$.accounting_date_from,nvl(:$flex$.payment_date_from,nvl(:$flex$.invoice_date_from,
nvl((select gps.start_date from gl_period_statuses gps,gl_ledgers gl where gps.period_name=:$flex$.invoice_date_period and gps.set_of_books_id=gl.ledger_id and gl.name=:$flex$.ledger and gps.application_id=200),
nvl((select gps.start_date from gl_period_statuses gps,gl_ledgers gl where gps.period_name=:$flex$.accounting_period and gps.set_of_books_id=gl.ledger_id and gl.name=:$flex$.ledger and gps.application_id=200),
(select gps.start_date from gl_period_statuses gps,gl_ledgers gl where gps.period_name=:$flex$.payment_period and gps.set_of_books_id=gl.ledger_id and gl.name=:$flex$.ledger and gps.application_id=200))
)
)
)
) from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>RCV Trx Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>-20</DISPLAY_SEQUENCE>
    <ANCHOR>:p_trx_date_to</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select nvl(:$flex$.accounting_date_to+1,nvl(:$flex$.payment_date_to+1,nvl(:$flex$.invoice_date_to+1,
nvl((select gps.end_date+1 from gl_period_statuses gps,gl_ledgers gl where gps.period_name=:$flex$.invoice_date_period and gps.set_of_books_id=gl.ledger_id and gl.name=:$flex$.ledger and gps.application_id=200),
nvl((select gps.end_date+1 from gl_period_statuses gps,gl_ledgers gl where gps.period_name=:$flex$.accounting_period and gps.set_of_books_id=gl.ledger_id and gl.name=:$flex$.ledger and  gps.application_id=200),
(select gps.end_date+1 from gl_period_statuses gps,gl_ledgers gl where gps.period_name=:$flex$.payment_period and gps.set_of_books_id=gl.ledger_id and gl.name=:$flex$.ledger and gps.application_id=200))
)
)
)
) from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>RCV Trx Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>-10</DISPLAY_SEQUENCE>
    <ANCHOR>:p_has_dist_criteria</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select &apos;Y&apos; from dual where
:$flex$.accounting_period is not null or
:$flex$.accounting_date_from is not null or
:$flex$.accounting_date_to is not null or
:$flex$.expense_account_from is not null or
:$flex$.expense_account_to is not null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Distribution Selection Criteria</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gl.name=:ledger and 
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>F</LANGUAGE>
      <PARAMETER_NAME>Grand livre</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <ANCHOR>&amp;gcc_dist_segment_columns</ANCHOR>
    <SQL_TEXT>select distinct
&apos;gcck.&apos;||lower(fifsv.application_column_name)||&apos; &quot;&apos;||substrb(fifsv.form_left_prompt_,1,xxen_report.max_column_length)||&apos;&quot;,&apos;||chr(10)||
&apos;xxen_util.segment_description(gcck.&apos;||lower(fifsv.application_column_name)||&apos;, &apos;&apos;&apos;||fifsv.application_column_name||&apos;&apos;&apos;, gcck.chart_of_accounts_id&apos;||
(
select
&apos;, gcck.&apos;||lower(fifs.application_column_name)
from
fnd_id_flex_segments fifs
where
fifsv.application_id=fifs.application_id and
fifsv.id_flex_code=fifs.id_flex_code and
fifsv.id_flex_num=fifs.id_flex_num and
fifsv.enabled_flag=fifs.enabled_flag and
fifs.flex_value_set_id=(select ffvs.parent_flex_value_set_id from fnd_flex_value_sets ffvs where fifsv.flex_value_set_id=ffvs.flex_value_set_id)
)||&apos;) &quot;&apos;||substrb(fifsv.form_left_prompt_,1,xxen_report.max_column_length-5)||&apos; desc&quot;,&apos; text,
min(fifsv.id_flex_num) over (partition by fifsv.application_column_name, fifsv.form_left_prompt) min_id_flex_num,
min(fifsv.segment_num) over (partition by fifsv.application_column_name, fifsv.form_left_prompt) min_segment_num
from
(select xxen_util.init_cap(fifsv.form_left_prompt) form_left_prompt_, fifsv.* from fnd_id_flex_segments_vl fifsv) fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.id_flex_num in
(
select
gl.chart_of_accounts_id
from
gl_ledgers gl
where
gl.ledger_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
) and
fifsv.enabled_flag=&apos;Y&apos;
order by
min_id_flex_num,
min_segment_num</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Grand livre</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</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>F</LANGUAGE>
      <PARAMETER_NAME>Unité d&apos;exploitation</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</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/aia.payment_cross_rate*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/aia.payment_cross_rate*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/aia.payment_cross_rate*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/aia.payment_cross_rate*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/aia.payment_cross_rate*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/aia.payment_cross_rate*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/aia.payment_cross_rate*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/aia.payment_cross_rate*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/aia.payment_cross_rate*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>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Nom du seau de vieillissement</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <ANCHOR>&amp;aging_bucket_cols2</ANCHOR>
    <SQL_TEXT>select
 &apos;case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_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 ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_inv.current_bucket end &quot;Current&quot;,
case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_inv.between_1_30 end between_1_30,
case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_inv.between_31_60 end between_31_60,
case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_inv.between_61_90 end between_61_90,
case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_inv.between_91_120 end between_91_120,
case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_inv.between_121_150 end between_121_150,
case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_inv.between_151_180 end between_151_180,
case ap_inv.first_psched when &apos;&apos;Y&apos;&apos; then ap_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>F</LANGUAGE>
      <PARAMETER_NAME>Nom du seau de vieillissement</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>:display_level=:display_level</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 and Payment Schedules only&apos; description from dual union all
select &apos;Lines&apos; value, &apos;Show Invoice Headers and Lines only&apos; description from dual union all
select &apos;Lines and Distributions&apos; value, &apos;Show Invoice Headers, Lines and Distributions&apos; description from dual</LOV_QUERY_DSP>
    <MATCHING_VALUE>Lines and Distributions</MATCHING_VALUE>
    <DEFAULT_VALUE>Headers</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <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>10</SORT_ORDER>
    <ANCHOR>&amp;gst_columns</ANCHOR>
    <SQL_TEXT>decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.discount) discount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.cgst_tax_rate) cgst_tax_rate ,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.sgst_tax_rate) sgst_tax_rate,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.igst_tax_rate) igst_tax_rate,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.cgst_amount) cgst_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.sgst_amount) sgst_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.igst_amount) igst_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.igst_imports) igst_imports,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.customs_amount) customs_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.anty_duty_amount) anty_duty_amount,
decode(ap_inv.first_invoice,&apos;Y&apos;,ap_inv.others_amount) others_amount,</SQL_TEXT>
    <MATCHING_VALUE>Headers</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>11</SORT_ORDER>
    <ANCHOR>&amp;gst_columns</ANCHOR>
    <SQL_TEXT>ap_inv.discount ,
ap_inv.cgst_tax_rate,
ap_inv.sgst_tax_rate,
ap_inv.igst_tax_rate,
ap_inv.cgst_amount,
ap_inv.sgst_amount,
ap_inv.igst_amount,
ap_inv.igst_imports,
ap_inv.customs_amount,
ap_inv.anty_duty_amount,
ap_inv.others_amount,</SQL_TEXT>
    <MATCHING_VALUE>Lines</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>12</SORT_ORDER>
    <ANCHOR>&amp;gst_columns</ANCHOR>
    <SQL_TEXT>ap_inv.discount ,
ap_inv.cgst_tax_rate,
ap_inv.sgst_tax_rate,
ap_inv.igst_tax_rate,
ap_inv.cgst_amount,
ap_inv.sgst_amount,
ap_inv.igst_amount,
ap_inv.igst_imports,
ap_inv.customs_amount,
ap_inv.anty_duty_amount,
ap_inv.others_amount,</SQL_TEXT>
    <MATCHING_VALUE>Lines and 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>13</SORT_ORDER>
    <ANCHOR>&amp;gst_distributions</ANCHOR>
    <SQL_TEXT>(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt where rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.tax_type_code like &apos;%DISCOUNT%&apos;) discount,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;CGST_%%&apos;) cgst_tax_rate,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;SGST_%&apos;) sgst_tax_rate,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;IGST_%&apos;) igst_tax_rate,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;CGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where  rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;CGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;CGST_%&apos;) 
end cgst_amount,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;SGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where  rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;SGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;SGST_%&apos;) 
end sgst_amount,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;IGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where  rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;IGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;IGST_%&apos;) 
end igst_amount,
case when aia.invoice_currency_code&lt;&gt;&apos;INR&apos; then (select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt where rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code like &apos;IGST%PUR%%&apos;) end igst_imports,
(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt where rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code=&apos;CUSTOMS&apos;) customs_amount,
(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt where rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=200 and jtlv.trx_id=rt.po_header_id and jtlv.trx_line_id=rt.po_line_id and jtlv.trx_loc_line_id=rt.po_line_location_id and jtlv.tax_type_id in (select jtt.tax_type_id from jai_tax_types jtt where jtt.tax_type_code=&apos;PUR_ANTI_DUMPING_DUTY&apos;)) anty_duty_amount,
(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt where rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code not like &apos;%DISCOUNT%&apos; and jtlv.tax_type_code not like &apos;%FREIGHT%&apos; and jtlv.tax_type_code not like &apos;%GST%&apos; and jtlv.tax_type_code not like &apos;%CUSTOM%&apos;) others_amount,</SQL_TEXT>
    <MATCHING_VALUE>Lines and 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>14</SORT_ORDER>
    <ANCHOR>&amp;gst_header</ANCHOR>
    <SQL_TEXT>(select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aia.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.tax_type_code like &apos;%DISCOUNT%&apos;)jtlv) discount,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;CGST_%%&apos;) cgst_tax_rate,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;SGST_%&apos;) sgst_tax_rate,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;IGST_%&apos;) igst_tax_rate,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;CGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aia.invoice_id=aida.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;CGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;CGST_%&apos;)
end cgst_amount,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;SGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aia.invoice_id=aida.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;SGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;SGST_%&apos;)
end sgst_amount,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;IGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aia.invoice_id=aida.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id
 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1)
and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;IGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aia.invoice_id and jtlv.application_id=200 and jtlv.tax_type_code like &apos;IGST_%&apos;)
end igst_amount,
case when aia.invoice_currency_code&lt;&gt;&apos;INR&apos; then (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aia.invoice_id=aida.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code like &apos;IGST%PUR%%&apos;)jtlv) end igst_imports,
(select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aia.invoice_id=aida.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code=&apos;CUSTOMS&apos;)jtlv) customs_amount,
(select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aia.invoice_id=aida.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=200 and jtlv.trx_id=rt.po_header_id and jtlv.trx_line_id=rt.po_line_id and jtlv.trx_loc_line_id=rt.po_line_location_id and jtlv.tax_type_id in (select jtt.tax_type_id from jai_tax_types jtt where jtt.tax_type_code=&apos;PUR_ANTI_DUMPING_DUTY&apos;))jtlv) anty_duty_amount,
(select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aia.invoice_id=aida.invoice_id and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code not like &apos;%DISCOUNT%&apos; and jtlv.tax_type_code not like &apos;%FREIGHT%&apos; and jtlv.tax_type_code not like &apos;%GST%&apos; and jtlv.tax_type_code not like &apos;%CUSTOM%&apos;)jtlv) others_amount,</SQL_TEXT>
    <MATCHING_VALUE>Headers</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>15</SORT_ORDER>
    <ANCHOR>&amp;gst_lines</ANCHOR>
    <SQL_TEXT>(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.tax_type_code like &apos;%DISCOUNT%&apos;) discount,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;CGST_%%&apos;) cgst_tax_rate,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;SGST_%&apos;) sgst_tax_rate,
(select max(jtlv.tax_rate_code) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;IGST_%&apos;) igst_tax_rate,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;CGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;CGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;CGST_%&apos;) 
end cgst_amount,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;SGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1)  and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;SGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;SGST_%&apos;) 
end sgst_amount,
case when nvl((select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;IGST_%&apos;),0)=0
then
 (select sum(jtlv.rounded_tax_amt_fun_curr) from (select distinct jtlv.tax_line_id,jtlv.rounded_tax_amt_fun_curr from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.entity_code = &apos;RCV_TRANSACTION&apos; and jtlv.tax_type_code like &apos;IGST_%&apos;)jtlv)
else
(select sum(jtlv.rounded_tax_amt_trx_curr) from jai_tax_lines_v jtlv where jtlv.trx_id=aila.invoice_id and jtlv.trx_line_id=aila.line_number and jtlv.application_id=200 and tax_type_code like &apos;IGST_%&apos;) 
end igst_amount,
case when aia.invoice_currency_code&lt;&gt;&apos;INR&apos; then (select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and rt.transaction_date &gt;= nvl(:p_trx_date_from,rt.transaction_date) and rt.transaction_date &lt; nvl(:p_trx_date_to,rt.transaction_date+1) and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code like &apos;IGST%PUR%%&apos;) end igst_imports,
(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code=&apos;CUSTOMS&apos;) customs_amount,
(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=200 and jtlv.trx_id=rt.po_header_id and jtlv.trx_line_id=rt.po_line_id and jtlv.trx_loc_line_id=rt.po_line_location_id and jtlv.tax_type_id in (select jtt.tax_type_id from jai_tax_types jtt where jtt.tax_type_code=&apos;PUR_ANTI_DUMPING_DUTY&apos;)) anty_duty_amount,
(select sum(jtlv.rounded_tax_amt_fun_curr) from jai_tax_lines_v jtlv, rcv_transactions rt, ap_invoice_distributions_all aida where aida.invoice_id=aila.invoice_id and aida.invoice_line_number=aila.line_number and rt.transaction_id=aida.rcv_transaction_id and jtlv.application_id=707 and jtlv.trx_id=rt.shipment_header_id and jtlv.trx_line_id=rt.shipment_line_id and jtlv.trx_loc_line_id=rt.transaction_id and jtlv.trx_type=&apos;RECEIVE&apos; and jtlv.tax_type_code not like &apos;%DISCOUNT%&apos; and jtlv.tax_type_code not like &apos;%FREIGHT%&apos; and jtlv.tax_type_code not like &apos;%GST%&apos; and jtlv.tax_type_code not like &apos;%CUSTOM%&apos;) others_amount,</SQL_TEXT>
    <MATCHING_VALUE>Lines</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>16</SORT_ORDER>
    <ANCHOR>&amp;invoice_detail_columns</ANCHOR>
    <SQL_TEXT>ap_inv.line_number,
ap_inv.line_type,
ap_inv.line_source,
ap_inv.line_discarded,
ap_inv.line_description,
case ap_inv.first_line when &apos;Y&apos; then ap_inv.line_amount end line_amount,
case ap_inv.first_line when &apos;Y&apos; then ap_inv.line_base_amount end line_base_amount,
ap_inv.line_accounting_date,
ap_inv.deferred_option,
ap_inv.deferred_start_date,
ap_inv.deferred_end_date,
ap_inv.tax_regime_code,
ap_inv.tax,
ap_inv.tax_jurisdiction_code,
ap_inv.tax_rate_code,
ap_inv.tax_rate,
ap_inv.po_number,
ap_inv.receipt_date,
ap_inv.receipt_number,
case ap_inv.first_line when &apos;Y&apos; then ap_inv.quantity_invoiced end quantity_invoiced,
ap_inv.unit_price,
ap_inv.warehouse_code,</SQL_TEXT>
    <MATCHING_VALUE>Lines</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Niveau d&apos;affichage</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Display Level</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>17</SORT_ORDER>
    <ANCHOR>&amp;invoice_detail_columns</ANCHOR>
    <SQL_TEXT>ap_inv.line_number,
ap_inv.line_type,
ap_inv.line_source,
ap_inv.line_discarded,
ap_inv.line_description,
case ap_inv.first_line when &apos;Y&apos; then ap_inv.line_amount end line_amount,
case ap_inv.first_line when &apos;Y&apos; then ap_inv.line_base_amount end line_base_amount,
ap_inv.line_accounting_date,
ap_inv.deferred_option,
ap_inv.deferred_start_date,
ap_inv.deferred_end_date,
ap_inv.tax_regime_code,
ap_inv.tax,
ap_inv.tax_jurisdiction_code,
ap_inv.tax_rate_code,
ap_inv.tax_rate,
ap_inv.po_number,
ap_inv.receipt_date,
ap_inv.receipt_number,
ap_inv.warehouse_code,
ap_inv.dist_line_number,
ap_inv.distribution_type,
ap_inv.period_name,
ap_inv.dist_accounting_date,
ap_inv.dist_creation_date,
ap_inv.dist_last_update_date,
ap_inv.quantity_invoiced,
ap_inv.unit_price,
ap_inv.dist_amount,
ap_inv.dist_base_amount,
ap_inv.dist_invoice_price_variance,
ap_inv.dist_base_inv_price_variance,
ap_inv.expense_account,
ap_inv.price_variance_account,
ap_inv.expense_account_descripton,
ap_inv.price_variance_account_desc,
ap_inv.dist_match_type,
ap_inv.dist_match_status,
ap_inv.po_number,
ap_inv.dist_asset_tracking_flag,
ap_inv.dist_assets_addition_flag,
ap_inv.dist_description,
ap_inv.pa_expenditure_item_date,
ap_inv.pa_expenditure_type,
ap_inv.expenditure_organization,
ap_inv.pa_addition_flag,
ap_inv.project_accounting_context,
ap_inv.project_number,
ap_inv.project_name,
ap_inv.project_description,
ap_inv.project_type,
ap_inv.project_status_code,
ap_inv.project_start_date,
ap_inv.project_completion_date,
ap_inv.task_number,
ap_inv.task_name,
ap_inv.task_description,
ap_inv.service_type_code,
ap_inv.task_start_date,
ap_inv.task_completion_date,
</SQL_TEXT>
    <MATCHING_VALUE>Lines and Distributions</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Niveau d&apos;affichage</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Display Level</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>18</SORT_ORDER>
    <ANCHOR>&amp;show_aida</ANCHOR>
    <SQL_TEXT>Y</SQL_TEXT>
    <MATCHING_VALUE>Lines and 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>19</SORT_ORDER>
    <ANCHOR>&amp;show_aila</ANCHOR>
    <SQL_TEXT>Y</SQL_TEXT>
    <MATCHING_VALUE>Lines%</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Niveau d&apos;affichage</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Display Level</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>20</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>F</LANGUAGE>
      <PARAMETER_NAME>Fournisseur</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Supplier</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>21</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>F</LANGUAGE>
      <PARAMETER_NAME>Site du fournisseur</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Supplier Site</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>22</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>F</LANGUAGE>
      <PARAMETER_NAME>Numéro de facture</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>23</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=:invoice_period_name and gps.set_of_books_id=gl.ledger_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=:invoice_period_name and gps.set_of_books_id=gl.ledger_id and gps.application_id=200)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>AP Period</LOV_NAME>
    <LOV_GUID>C23FDB3DBE0DC71FE0530100007FACC7</LOV_GUID>
    <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.ledger_id=
(
select 
asp.set_of_books_id 
from   
ap_system_parameters asp, 
gl_ledgers gl,
hr_operating_units hou 
where  
asp.set_of_books_id=gl.ledger_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>F</LANGUAGE>
      <PARAMETER_NAME>Date de l&apos;invitation Période</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Date Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>24</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>
    <DEFAULT_VALUE>select trunc(sysdate,&apos;month&apos;) from dual where
:$flex$.invoice_number is null and
:$flex$.invoice_date_period is null and
:$flex$.accounting_period is null and
:$flex$.payment_period is null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Date de l&apos;Inv.</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>25</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>F</LANGUAGE>
      <PARAMETER_NAME>Date de l&apos;inv.</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>26</SORT_ORDER>
    <DISPLAY_SEQUENCE>110</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>select
&apos;aida2.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 aida2.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_ledgers gl
where
gps.period_name=:accounting_period_name and
gps.set_of_books_id=gl.ledger_id and
gps.application_id=200 and
(:ledger is null or xxen_util.contains(:ledger,gl.name)=&apos;Y&apos;) and
rownum=1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>AP Period</LOV_NAME>
    <LOV_GUID>C23FDB3DBE0DC71FE0530100007FACC7</LOV_GUID>
    <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.ledger_id=
(
select 
asp.set_of_books_id 
from   
ap_system_parameters asp, 
gl_ledgers gl,
hr_operating_units hou 
where  
asp.set_of_books_id=gl.ledger_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>F</LANGUAGE>
      <PARAMETER_NAME>Période comptable</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>27</SORT_ORDER>
    <DISPLAY_SEQUENCE>120</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>aida2.accounting_date(+)&gt;=:accounting_date_from
 
</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Date comptable du</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>28</SORT_ORDER>
    <DISPLAY_SEQUENCE>130</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>aida2.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>F</LANGUAGE>
      <PARAMETER_NAME>Date de comptabilisation au</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>29</SORT_ORDER>
    <DISPLAY_SEQUENCE>140</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_name and
gl.ledger_id=gps.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
aca.check_id=aipa.check_id
)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_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>30</SORT_ORDER>
    <DISPLAY_SEQUENCE>150</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>31</SORT_ORDER>
    <DISPLAY_SEQUENCE>160</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>32</SORT_ORDER>
    <DISPLAY_SEQUENCE>170</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 and
:$flex$.invoice_date_period is null and
:$flex$.invoice_date_from is null and
:$flex$.invoice_date_to is null and
:$flex$.accounting_period is null and
:$flex$.accounting_date_from is null and
:$flex$.accounting_date_to is null and
:$flex$.payment_period is null and
:$flex$.payment_date_from is null and
:$flex$.payment_date_to is null and
:$flex$.invoice_status is null and
:$flex$.payment_status is null and
:$flex$.creation_date_from is null and
:$flex$.creation_date_to is null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Ouvert uniquement</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Open only</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>33</SORT_ORDER>
    <DISPLAY_SEQUENCE>180</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>F</LANGUAGE>
      <PARAMETER_NAME>Jours de retard</PARAMETER_NAME>
      <DESCRIPTION>Jours d&apos;échéance (supérieurs à)</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <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>34</SORT_ORDER>
    <DISPLAY_SEQUENCE>190</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>F</LANGUAGE>
      <PARAMETER_NAME>Type de facture</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>35</SORT_ORDER>
    <DISPLAY_SEQUENCE>200</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>36</SORT_ORDER>
    <DISPLAY_SEQUENCE>210</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>F</LANGUAGE>
      <PARAMETER_NAME>Statut du paiement</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payment Status</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>37</SORT_ORDER>
    <DISPLAY_SEQUENCE>220</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>select
x.segment_name||&apos;&gt;=&apos;&apos;&apos;||x.seg_val||&apos;&apos;&apos;&apos;||decode(rownum,count,null,&apos; and&apos;)
from
(
select
count(*) over () count,
&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_ledgers gl where gl.ledger_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>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_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_ledgers gl
where
gl.ledger_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>F</LANGUAGE>
      <PARAMETER_NAME>Compte de dépenses De</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <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>230</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>select
x.segment_name||&apos;&lt;=&apos;&apos;&apos;||x.seg_val||&apos;&apos;&apos;&apos;||decode(rownum,count,null,&apos; and&apos;)
from
(
select
count(*) over () count,
&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_ledgers gl where gl.ledger_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>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_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_ledgers gl
where
gl.ledger_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>
    <DEFAULT_VALUE>:$flex$.Expense_Account_From</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Compte de dépenses à</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <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>240</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>aia.cancelled_date 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>
    <DEFAULT_VALUE>select &apos;Y&apos; from dual where :$flex$.invoice_number is null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Exclure Annulé</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Exclude Cancelled</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>40</SORT_ORDER>
    <DISPLAY_SEQUENCE>250</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>F</LANGUAGE>
      <PARAMETER_NAME>Facture en attente</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice on Hold</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>41</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>F</LANGUAGE>
      <PARAMETER_NAME>Facture en attente</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice on Hold</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>42</SORT_ORDER>
    <DISPLAY_SEQUENCE>260</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>F</LANGUAGE>
      <PARAMETER_NAME>Nom du détenteur</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Hold Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>43</SORT_ORDER>
    <DISPLAY_SEQUENCE>270</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>F</LANGUAGE>
      <PARAMETER_NAME>A l&apos;attachement</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Has Attachment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>44</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>F</LANGUAGE>
      <PARAMETER_NAME>A l&apos;attachement</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Has Attachment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>45</SORT_ORDER>
    <DISPLAY_SEQUENCE>280</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>Creation Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>46</SORT_ORDER>
    <DISPLAY_SEQUENCE>290</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>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Creation Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>47</SORT_ORDER>
    <DISPLAY_SEQUENCE>300</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;dff_columns</ANCHOR>
    <SQL_TEXT>select
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_column_name_prefix=&gt;&apos;Invoice: &apos;)||
case when :display_level like &apos;Lines%&apos; then xxen_util.dff_columns(p_table_name=&gt;&apos;ap_invoice_lines_all&apos;,p_column_name_prefix=&gt;&apos;Invoice Line: &apos;) 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>
    <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>48</SORT_ORDER>
    <ANCHOR>&amp;dff_columns2</ANCHOR>
    <SQL_TEXT>select
xxen_util.dff_columns(p_table_name=&gt;&apos;po_vendors&apos;,p_column_name_prefix=&gt;&apos;Supplier: &apos;,p_prefix=&gt;&apos;ap_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;ap_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;ap_inv.&apos;)||
case when :display_level like &apos;Lines%&apos; then xxen_util.dff_columns(p_table_name=&gt;&apos;ap_invoice_lines_all&apos;,p_column_name_prefix=&gt;&apos;Invoice Line: &apos;,p_prefix=&gt;&apos;ap_inv.&apos;) end
from
dual
where :show_dff=:show_dff</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_ROW>
    <SORT_ORDER>49</SORT_ORDER>
    <DISPLAY_SEQUENCE>310</DISPLAY_SEQUENCE>
    <ANCHOR>:p_show_attachments</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Attachments</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>50</SORT_ORDER>
    <ANCHOR>&amp;attachment_columns</ANCHOR>
    <SQL_TEXT>attchmt.seq_num attachment_seq,
attchmt.type attachment_type,
attchmt.category attachment_category,
attchmt.title attachment_title,
attchmt.description attachment_description,
attchmt.content attachment_content,</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Attachments</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
   <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$.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>Distribution Selection Criteria</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>Open only</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>RCV Trx Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_date_to</FLEX_BIND>
    <PARAMETER_NAME>Accounting Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Distribution Selection Criteria</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_date_to</FLEX_BIND>
    <PARAMETER_NAME>Accounting Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_date_to</FLEX_BIND>
    <PARAMETER_NAME>Accounting Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_period</FLEX_BIND>
    <PARAMETER_NAME>Accounting Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Distribution Selection Criteria</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_period</FLEX_BIND>
    <PARAMETER_NAME>Accounting Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_period</FLEX_BIND>
    <PARAMETER_NAME>Accounting Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_period</FLEX_BIND>
    <PARAMETER_NAME>Accounting Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.accounting_period</FLEX_BIND>
    <PARAMETER_NAME>Accounting Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>RCV Trx 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$.creation_date_from</FLEX_BIND>
    <PARAMETER_NAME>Creation Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.creation_date_to</FLEX_BIND>
    <PARAMETER_NAME>Creation Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.expense_account_from</FLEX_BIND>
    <PARAMETER_NAME>Expense Account From</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Distribution Selection Criteria</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.expense_account_to</FLEX_BIND>
    <PARAMETER_NAME>Expense Account To</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Distribution Selection Criteria</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_date_from</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Open only</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>RCV Trx Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_date_period</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_date_period</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_date_period</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_date_period</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_date_to</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_date_to</FLEX_BIND>
    <PARAMETER_NAME>Invoice Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>RCV Trx 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>Invoice Date From</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$.invoice_status</FLEX_BIND>
    <PARAMETER_NAME>Invoice Status</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 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>RCV Trx Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date To</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 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>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>Open only</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_ROW>
    <FLEX_BIND>:$flex$.payment_date_from</FLEX_BIND>
    <PARAMETER_NAME>Payment Date From</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_date_to</FLEX_BIND>
    <PARAMETER_NAME>Payment Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_date_to</FLEX_BIND>
    <PARAMETER_NAME>Payment Date To</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_period</FLEX_BIND>
    <PARAMETER_NAME>Payment Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_period</FLEX_BIND>
    <PARAMETER_NAME>Payment Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Open only</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_period</FLEX_BIND>
    <PARAMETER_NAME>Payment Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_period</FLEX_BIND>
    <PARAMETER_NAME>Payment Period</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>RCV Trx Date To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.payment_status</FLEX_BIND>
    <PARAMETER_NAME>Payment Status</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Open only</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>
