<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 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: GL Ledger -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEB879D2E0530100007F1FF2</GUID>
  <LOV_NAME>GL Ledger</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||decode(gl.ledger_category_code,&apos;NONE&apos;,xxen_util.meaning(gl.object_type_code,&apos;LEDGERS&apos;,101),xxen_util.meaning(gl.ledger_category_code,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101))||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
(:$flex$.ledger_category is null or gl.ledger_category_code=xxen_util.lookup_code(:$flex$.ledger_category,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101,&apos;Y&apos;)) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.ledger_id in (select nvl(glsnav.ledger_id,gasna.ledger_id) from gl_access_set_norm_assign gasna, gl_ledger_set_norm_assign_v glsnav where gasna.access_set_id=fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;) and gasna.ledger_id=glsnav.ledger_set_id(+)) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
decode(gl.ledger_category_code,&apos;PRIMARY&apos;,1,&apos;SECONDARY&apos;,2,&apos;ALC&apos;,3,&apos;NONE&apos;,4),
gl.name</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>دفاتر الأستاذ المقيدة بمجموعة الوصول ، المحددة بواسطة قيمة الملف الشخصي &quot;مجموعة الوصول إلى بيانات GL&quot; لمسؤولية تسجيل الدخول الحالية</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Ledger, die durch das Zugriffsset eingeschränkt sind, definiert durch den Profilwert &apos;GL Data Access Set&apos; der aktuellen Anmeldeverantwortung</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Libros restringidos por el conjunto de acceso, definido por el valor del perfil &quot;Conjunto de acceso a datos GL&quot; de la responsabilidad de inicio de sesión actual</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Grands livres limités par un ensemble d&apos;accès, défini par la valeur du profil &quot;GL Data Access Set&quot; de la responsabilité de connexion actuelle</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Libri mastri limitati dal set di accesso, definito dal valore del profilo &apos;GL Data Access Set&apos; della responsabilità di login corrente</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>現在のログイン責任者のプロファイル値&apos;GL Data Access Set&apos;によって定義されたアクセスセットによって制限された元帳</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>현재 로그인 권한의 프로파일 값 &apos;GL 데이터 액세스 세트&apos;로 정의 된 액세스 세트로 제한되는 원장</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Ledgers restritos pelo conjunto de acesso, definido pelo valor do perfil &apos;GL Data Access Set&apos; da atual responsabilidade de login</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Леджеры, ограниченные набором доступа, определяемые значением профиля &quot;GL Data Access Set&quot; текущей ответственности за вход в систему</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Ledgers begränsade av åtkomstuppsättning, definierade av profilvärde &apos;GL Data Access Set&apos; för det aktuella inloggningsansvaret</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Mevcut oturum açma sorumluluğunun profil değeri &apos;GL Veri Erişim Kümesi&apos; ile tanımlanan erişim kümesiyle kısıtlanmış defterler</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Ledgers restricted by access set, defined by profile value &apos;GL Data Access Set&apos; of the current login responsibility</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>由访问集限制的分类账，由当前登录责任的配置文件值 &quot;GL数据访问集 &quot;定义。</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: HR Operating Unit -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEB979D2E0530100007F1FF2</GUID>
  <LOV_NAME>HR Operating Unit</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
(:$flex$.ledger is null or hou.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hou.organization_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
hou.name</LOV_QUERY>
  <VERSION_COMMENTS>Fixed where clause duplication</VERSION_COMMENTS>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>وحدة التشغيل مقيدة بالتحكم في الوصول متعدد المنظمات (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Bedieneinheit eingeschränkt durch Multi Org Access Control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Unidad operativa restringida por el control de acceso multiorgánico (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Unité opérationnelle restreinte par un contrôle d&apos;accès multi-organismes (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Unità operativa limitata dal controllo di accesso multiorgano (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>多機関アクセス制御(MOAC)で制限された操作ユニット</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>다중 조직 액세스 제어 (MOAC)에 의해 제한되는 운영 단위</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Unidade operacional restrita por controle de acesso multi org (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Операционное устройство, ограниченное мультиорганизованным контролем доступа (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Styrenhet begränsad av multi-org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Çoklu kuruluş erişim kontrolü (MOAC) tarafından kısıtlanan işletim birimi</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Operating unit restricted by multi org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>受多机构访问控制（MOAC）限制的操作单元。</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: Yes -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEA679D2E0530100007F1FF2</GUID>
  <LOV_NAME>Yes</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
</LOVS>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: AP Accounted Invoice Aging -->
 <REPORTS_ROW>
  <GUID>D23CFAD3DBADE590E05362FB0905CC73</GUID>
  <SQL_TEXT>with xtb as (
select /*+ parallel(xtb) leading(xtb) no_merge */
xtb.definition_code tb_code,
xtdv.name tb_name,
nvl(xtb.applied_to_entity_id,xtb.source_entity_id) entity_id,
xtb.code_combination_id,
xtb.source_application_id,
sum (nvl2(xtb.applied_to_entity_id,0,nvl(xtb.entered_unrounded_cr,0) - nvl(xtb.entered_unrounded_dr,0))) entered_unrounded_orig_amount,
sum (nvl2(xtb.applied_to_entity_id,0,nvl(xtb.entered_rounded_cr,0)   - nvl(xtb.entered_rounded_dr,0)))   entered_rounded_orig_amount,
sum (nvl2(xtb.applied_to_entity_id,0,nvl(xtb.acctd_unrounded_cr,0)   - nvl(xtb.acctd_unrounded_dr,0)))   acctd_unrounded_orig_amount,
sum (nvl2(xtb.applied_to_entity_id,0,nvl(xtb.acctd_rounded_cr,0)     - nvl(xtb.acctd_rounded_dr,0)) )    acctd_rounded_orig_amount,
sum (nvl(xtb.entered_unrounded_cr,0)) - sum(nvl(xtb.entered_unrounded_dr,0)) entered_unrounded_rem_amount,
sum (nvl(xtb.entered_rounded_cr,0))   - sum(nvl(xtb.entered_rounded_dr,0))   entered_rounded_rem_amount,
sum (nvl(xtb.acctd_unrounded_cr,0))   - sum(nvl(xtb.acctd_unrounded_dr,0))   acctd_unrounded_rem_amount,
sum (nvl(xtb.acctd_rounded_cr,0))     - sum(nvl(xtb.acctd_rounded_dr,0))     acctd_rounded_rem_amount,
case when sum (nvl2(xtb.applied_to_entity_id,0,nvl(xtb.entered_rounded_cr,0)   - nvl(xtb.entered_rounded_dr,0)))=0 then 1
else
sum (nvl2(xtb.applied_to_entity_id,0,nvl(xtb.acctd_rounded_cr,0)     - nvl(xtb.acctd_rounded_dr,0)) ) /
sum (nvl2(xtb.applied_to_entity_id,0,nvl(xtb.entered_rounded_cr,0)   - nvl(xtb.entered_rounded_dr,0)))
end conversion_rate,
xtb.ledger_id,
xtb.party_id,
xtb.balancing_segment_value,
xtb.natural_account_segment_value,
xtb.cost_center_segment_value,
xtb.intercompany_segment_value,
xtb.management_segment_value,
dte.as_of_date
from
xla_trial_balances xtb,
xla_tb_definitions_vl xtdv,
(
select
gl.ledger_id,
gl.name ledger_name,
:p_as_of_date as_of_date
from
gl_ledgers gl
where
:p_as_of_date is not null and
(
nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos; or
fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;)=&apos;Y&apos; and
gl.ledger_id in  (
select
gasa.ledger_id
from
gl_access_sets gas,
gl_access_set_assignments gasa
where
gas.access_set_id=gasa.access_set_id and
(
gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
)
)
)
union
select
x.ledger_id,
x.name ledger_name,
x.end_date as_of_date
from
(
select
1-rank() over (partition by gl.name order by ((glp.period_year * 100000) + glp.period_num) desc) relative_period,
gl.ledger_id,
gl.name,
glp.end_date
from
gl_ledgers gl,
gl_periods glp,
gl_periods glpc
where
:p_as_of_date is null and
:p_relative_period is not null and
(
nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos; or
fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;)=&apos;Y&apos; and
gl.ledger_id in  (
select
gasa.ledger_id
from
gl_access_sets gas,
gl_access_set_assignments gasa
where
gas.access_set_id=gasa.access_set_id and
(
gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
)
)
) and
gl.period_set_name=glp.period_set_name and
gl.accounted_period_type=glp.period_type and
glp.adjustment_period_flag=&apos;N&apos; and
gl.period_set_name=glpc.period_set_name and
gl.accounted_period_type=glpc.period_type and
glpc.adjustment_period_flag=&apos;N&apos; and
trunc(sysdate) between glpc.start_date and glpc.end_date and
glp.start_date&lt;=glpc.start_date
) x
where
x.relative_period=to_number(:p_relative_period)
) dte
where
2=2 and
xtdv.definition_code in 
(
select 
xtd.definition_code
from 
xla_tb_defn_je_sources xtd,
xla_subledgers xs
where 
xtd.je_source_name=xs.je_source_name and 
xs.application_id=200
)  and
xtb.ledger_id=dte.ledger_id and
xtb.definition_code=xtdv.definition_code and
xtb.source_application_id=200 and
xtb.gl_date between to_date(&apos;01/01/1950&apos;,&apos;DD/MM/YYYY&apos;) and dte.as_of_date and
xtdv.enabled_flag=&apos;Y&apos;
group by
xtb.definition_code,
xtdv.name,
nvl(xtb.applied_to_entity_id,xtb.source_entity_id),
xtb.code_combination_id ,
xtb.source_application_id,
xtb.ledger_id,
xtb.party_id,
xtb.balancing_segment_value,
xtb.natural_account_segment_value,
xtb.cost_center_segment_value,
xtb.intercompany_segment_value,
xtb.management_segment_value,
dte.as_of_date
having
sum(nvl(xtb.acctd_rounded_cr,0)) &lt;&gt; sum (nvl(xtb.acctd_rounded_dr,0))
),
ap_inv as (
select
xtb.as_of_date,
xtb.tb_code,
xtb.tb_name,
xtb.ledger_id,
gl.name ledger_name,
gl.short_name ledger_short_name,
gl.currency_code ledger_currency,
haouv.name operating_unit,
xtb.source_application_id,
xtb.entity_id source_entity_id,
xte.entity_code source_entity_code,
xte.security_id_int_1 org_id,
xte.transaction_number source_transaction_number,
xetv.name source_trx_type,
xtb.code_combination_id,
xtb.entered_unrounded_orig_amount,
xtb.entered_rounded_orig_amount,
xtb.acctd_unrounded_orig_amount,
xtb.acctd_rounded_orig_amount,
xtb.entered_unrounded_rem_amount,
xtb.entered_rounded_rem_amount,
xtb.acctd_unrounded_rem_amount,
xtb.acctd_rounded_rem_amount,
xtb.balancing_segment_value,
xtb.natural_account_segment_value,
xtb.cost_center_segment_value,
xtb.intercompany_segment_value,
xtb.management_segment_value,
xtb.entity_id applied_to_entity_id,
xtb.party_id third_party_number,
hp.party_name third_party_name,
hps.party_site_name third_party_site_name,
ftv2.territory_short_name third_party_site_country,
aps.segment1 vendor_number,
aps.vendor_name,
assa.vendor_site_code vendor_site,
ftv1.territory_short_name vendor_site_country,
aia.invoice_num invoice_number,
aia.doc_sequence_value invoice_document_number,
aia.invoice_date,
aia.gl_date invoice_gl_date,
aia.cancelled_date invoice_cancelled_date,
aia.source invoice_source,
xxen_util.meaning(aia.invoice_type_lookup_code,&apos;INVOICE TYPE&apos;,200) invoice_type,
aia.description invoice_description,
xxen_util.ap_invoice_status(aia.invoice_id,aia.invoice_amount,aia.payment_status_flag,aia.invoice_type_lookup_code,aia.validation_request_id) invoice_status,
xxen_util.meaning(aia.payment_status_flag,&apos;INVOICE PAYMENT STATUS&apos;,200) invoice_payment_status,
xxen_util.meaning(aia.pay_group_lookup_code,&apos;PAY GROUP&apos;,201) pay_group,
(select ipmv.payment_method_name from iby_payment_methods_vl ipmv where ipmv.payment_method_code=aia.payment_method_code) payment_method,
aia.dispute_reason,
apsa.iby_hold_reason payment_hold_reason,
aia.invoice_currency_code invoice_currency, 
aia.invoice_amount,
nvl(aia.base_amount,aia.invoice_amount) invoice_amount_functional,
case when aia.invoice_currency_code&lt;&gt;gl.currency_code then aia.exchange_rate end invoice_exchange_rate,
case when aia.invoice_currency_code&lt;&gt;gl.currency_code then (select gdct.user_conversion_type from gl_daily_conversion_types gdct where gdct.conversion_type=aia.exchange_rate_type) end invoice_exchange_rate_type,
case when aia.invoice_currency_code&lt;&gt;gl.currency_code then aia.exchange_date end invoice_exchange_rate_date,
aia.invoice_id,
apsa.payment_num,
apsa.due_date,
ceil(xtb.as_of_date-apsa.due_date) days_due,
case
when xtb.acctd_rounded_rem_amount=0 then 0
when count(apsa.payment_num) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id)=1 then xtb.acctd_rounded_rem_amount
-- multiple payment schedules, but invoice is cancelled or over paid, then allocate to the first payment schedule only
when aia.invoice_amount=0 or sign(xtb.acctd_rounded_rem_amount)&lt;&gt;sign(aia.invoice_amount) then
case when apsa.payment_num=first_value(apsa.payment_num) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num) then xtb.acctd_rounded_rem_amount else 0 end
-- multiple paymement schedules. Consume amount remaining from latest payment schedule to first
when nvl(sum(abs(round(apsa.gross_amount*xtb.conversion_rate,fcv.precision))) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),
abs(xtb.acctd_rounded_rem_amount))&lt;=abs(xtb.acctd_rounded_rem_amount)
then case
when apsa.payment_num=first_value(apsa.payment_num) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num) -- 1st payment schedule - consume all remaining amount
then sign(xtb.acctd_rounded_rem_amount) * (nvl(abs(xtb.acctd_rounded_rem_amount) - sum(abs(round(apsa.gross_amount*xtb.conversion_rate,fcv.precision))) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),abs(xtb.acctd_rounded_rem_amount)))
when nvl(abs(xtb.acctd_rounded_rem_amount) - sum(abs(round(apsa.gross_amount*xtb.conversion_rate,fcv.precision))) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),
abs(xtb.acctd_rounded_rem_amount))&gt;=abs(round(apsa.gross_amount*xtb.conversion_rate,fcv.precision))
then sign(xtb.acctd_rounded_rem_amount) * abs(round(apsa.gross_amount*xtb.conversion_rate,fcv.precision))
else sign(xtb.acctd_rounded_rem_amount) * (nvl(abs(xtb.acctd_rounded_rem_amount) - sum(abs(round(apsa.gross_amount*xtb.conversion_rate,fcv.precision))) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),abs(xtb.acctd_rounded_rem_amount)))
end
else 0 -- all remaining amount already consumed
end ps_amount_remaining,
case
when xtb.entered_rounded_rem_amount=0 then 0
when count(apsa.payment_num) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id)=1 then xtb.entered_rounded_rem_amount
when aia.invoice_amount=0 or sign(xtb.entered_rounded_rem_amount)&lt;&gt;sign(aia.invoice_amount) then
case when apsa.payment_num=first_value(apsa.payment_num) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num) then xtb.entered_rounded_rem_amount else 0 end
when nvl(sum(abs(apsa.gross_amount)) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),
abs(xtb.entered_rounded_rem_amount))&lt;=abs(xtb.entered_rounded_rem_amount)
then case
when apsa.payment_num=first_value(apsa.payment_num) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num)
then sign(xtb.entered_rounded_rem_amount) * (nvl(abs(xtb.entered_rounded_rem_amount) - sum(abs(apsa.gross_amount)) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),abs(xtb.entered_rounded_rem_amount)))
when nvl(abs(xtb.entered_rounded_rem_amount) - sum(abs(apsa.gross_amount)) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),
abs(xtb.entered_rounded_rem_amount))&gt;=abs(apsa.gross_amount)
then sign(xtb.entered_rounded_rem_amount) * abs(apsa.gross_amount)
else sign(xtb.entered_rounded_rem_amount) * (nvl(abs(xtb.entered_rounded_rem_amount) - sum(abs(apsa.gross_amount)) over (partition by aia.invoice_id,xtb.tb_code,xtb.code_combination_id order by apsa.payment_num desc rows between unbounded preceding and 1 preceding),abs(xtb.entered_rounded_rem_amount)))
end
else 0
end ps_entered_amt_remaining,
decode(gl.currency_code,:p_reval_currency,1,(select gdr.conversion_rate from gl_daily_conversion_types gdct, gl_daily_rates gdr where gl.currency_code=gdr.from_currency and gdr.to_currency=:p_reval_currency and :p_reval_conv_date=gdr.conversion_date and gdct.user_conversion_type=:p_reval_conv_type and gdct.conversion_type=gdr.conversion_type)) reval_conv_rate,
cbbv.bank_name               remit_to_bank_name,
cbbv.bank_number             remit_to_bank_number,
cbbv.bank_branch_name        remit_to_branch_name,
cbbv.branch_number           remit_to_branch_number,
cbbv.country                 remit_to_branch_country,
ieba.masked_bank_account_num remit_to_account_num,
xxen_util.meaning(ap_invoices_pkg.get_wfapproval_status(aia.invoice_id,aia.org_id),&apos;AP_WFAPPROVAL_STATUS&apos;,200) approval_status,
(select count(*)
from
ap_holds_all aha
where
aha.invoice_id=aia.invoice_id and
aha.release_lookup_code is null
) invoice_holds_count,
(select count(*)
from ap_payment_schedules_all apsa
where apsa.invoice_id = aia.invoice_id
and apsa.hold_flag = &apos;Y&apos;
) scheduled_payment_holds,
xxen_util.yes(assa.hold_future_payments_flag) hold_future_payments,
xxen_util.yes(assa.hold_all_payments_flag) hold_all_payments
from
xtb,
xla_transaction_entities xte,
xla_entity_types_vl xetv,
ap_invoices_all aia,
ap_payment_schedules_all apsa,
ap_suppliers aps,
ap_supplier_sites_all assa,
fnd_territories_vl ftv1,
hz_parties hp,
hz_party_sites hps,
hz_locations hl,
fnd_territories_vl ftv2,
gl_ledgers gl,
fnd_currencies_vl fcv,
hr_all_organization_units_vl haouv,
iby_ext_bank_accounts ieba,
ce_bank_branches_v cbbv
where
xtb.entity_id=xte.entity_id and
xtb.source_application_id=xte.application_id and
xte.entity_code=&apos;AP_INVOICES&apos; and
xte.entity_code=xetv.entity_code and
xte.application_id=xetv.application_id and
nvl(xte.source_id_int_1,-99)=aia.invoice_id and
nvl(xte.source_id_int_1,-99)=apsa.invoice_id and
aia.org_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) and
aia.vendor_id=aps.vendor_id(+) and
aia.vendor_site_id=assa.vendor_site_id(+) and
assa.country=ftv1.territory_code(+) and
aia.party_id=hp.party_id and
aia.party_site_id=hps.party_site_id(+) and
(aps.employee_id is not null or hps.party_site_id is not null) and
hps.location_id=hl.location_id(+) and
hl.country=ftv2.territory_code(+) and
xtb.ledger_id=gl.ledger_id and
gl.currency_code=fcv.currency_code and
haouv.organization_id=aia.org_id and
apsa.external_bank_account_id=ieba.ext_bank_account_id(+) and
ieba.branch_id=cbbv.branch_party_id(+) and
ieba.bank_id=cbbv.bank_party_id(+)
)
--
-- Main Query Starts Here
--
select
ap_inv.ledger_name,
ap_inv.tb_name trial_balance_name,
ap_inv.ledger_currency,
gcck.concatenated_segments account,
ap_inv.third_party_name,
ap_inv.third_party_number,
ap_inv.third_party_site_name,
ap_inv.third_party_site_country,
ap_inv.vendor_number,
ap_inv.vendor_name,
ap_inv.vendor_site,
ap_inv.vendor_site_country,
ap_inv.operating_unit,
ap_inv.source_trx_type transaction_type,
ap_inv.source_transaction_number transaction_number,
ap_inv.invoice_document_number,
ap_inv.invoice_date,
ap_inv.invoice_gl_date,
ap_inv.invoice_cancelled_date,
ap_inv.invoice_source,
ap_inv.invoice_type,
ap_inv.invoice_description,
ap_inv.invoice_status,
ap_inv.invoice_payment_status,
ap_inv.approval_status,
ap_inv.invoice_holds_count,
ap_inv.scheduled_payment_holds,
ap_inv.hold_future_payments,
ap_inv.hold_all_payments,
ap_inv.pay_group,
ap_inv.payment_method,
ap_inv.dispute_reason,
ap_inv.payment_hold_reason,
ap_inv.invoice_currency,
ap_inv.invoice_exchange_rate,
ap_inv.invoice_exchange_rate_type,
ap_inv.invoice_exchange_rate_date,
case when ap_inv.payment_num=first_value(ap_inv.payment_num) over (partition by ap_inv.invoice_id,ap_inv.tb_code,ap_inv.code_combination_id order by ap_inv.payment_num) then ap_inv.invoice_amount end invoice_amount,
case when ap_inv.payment_num=first_value(ap_inv.payment_num) over (partition by ap_inv.invoice_id,ap_inv.tb_code,ap_inv.code_combination_id order by ap_inv.payment_num) then ap_inv.invoice_amount_functional end invoice_amount_functional,
case when ap_inv.payment_num=first_value(ap_inv.payment_num) over (partition by ap_inv.invoice_id,ap_inv.tb_code,ap_inv.code_combination_id order by ap_inv.payment_num) then ap_inv.acctd_rounded_orig_amount end transaction_original_amount,
case when ap_inv.payment_num=first_value(ap_inv.payment_num) over (partition by ap_inv.invoice_id,ap_inv.tb_code,ap_inv.code_combination_id order by ap_inv.payment_num) then ap_inv.acctd_rounded_rem_amount end transaction_remaining_amount,
case when ap_inv.payment_num=first_value(ap_inv.payment_num) over (partition by ap_inv.invoice_id,ap_inv.tb_code,ap_inv.code_combination_id order by ap_inv.payment_num) then ap_inv.entered_rounded_rem_amount end inv_currency_remaining_amount,
ap_inv.payment_num,
ap_inv.as_of_date,
ap_inv.due_date,
ap_inv.days_due,
&amp;aging_bucket_cols
&amp;reval_columns
ap_inv.balancing_segment_value balancing_segment,
gl_flexfields_pkg.get_description(gcck.chart_of_accounts_id,&apos;GL_BALANCING&apos;,ap_inv.balancing_segment_value) balancing_segment_desc,
ap_inv.natural_account_segment_value account_segment,
gl_flexfields_pkg.get_description(gcck.chart_of_accounts_id,&apos;GL_ACCOUNT&apos;,ap_inv.natural_account_segment_value) account_segment_desc,
ap_inv.cost_center_segment_value cost_center_segment,
gl_flexfields_pkg.get_description(gcck.chart_of_accounts_id,&apos;FA_COST_CTR&apos;,ap_inv.cost_center_segment_value) cost_center_segment_desc,
ap_inv.remit_to_bank_name,
ap_inv.remit_to_bank_number,
ap_inv.remit_to_branch_name,
ap_inv.remit_to_branch_number,
ap_inv.remit_to_branch_country,
ap_inv.remit_to_account_num,
ap_inv.invoice_id
from
ap_inv,
gl_code_combinations_kfv gcck
where
1=1 and
ap_inv.code_combination_id=gcck.code_combination_id(+) and
ap_inv.ps_amount_remaining&lt;&gt;0
order by
ap_inv.ledger_name,
ap_inv.tb_name,
gcck.concatenated_segments,
ap_inv.third_party_name,
ap_inv.third_party_number,
ap_inv.invoice_gl_date,
ap_inv.invoice_id,
ap_inv.payment_num</SQL_TEXT>
  <VERSION_COMMENTS>Added entered amount aging bucket columns</VERSION_COMMENTS>
  <ENABLED>Y</ENABLED>
  <XDO_APPLICATION_SHORT_NAME>SQLAP</XDO_APPLICATION_SHORT_NAME>
  <NUMBER_FORMAT>#,##0.00</NUMBER_FORMAT>
  <REQUIRED_PARAMETERS>(:As_of_Date is not null and :As_of_Relative_Period_Close is null ) or
(:As_of_Date is null and :As_of_Relative_Period_Close is not null ) 
</REQUIRED_PARAMETERS>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>AP Accounted Invoice Aging</REPORT_NAME>
    <DESCRIPTION>Application: Payables
Report: Accounts Payable Accounted Invoice Aging Report
Pre-requisite: XLA_TRIAL_BALANCES should be populated before running this report.

Description.
Report details Aging of outstanding amounts at a specified point in time for Accounted Invoices and relies mainly on the data in XLA_TRIAL_BALANCES table for the accounting information.
XLA_TRIAL_BALANCES data is inserted by the Open Account Balances Data Manager.
The Open Account Balances Data Manager maintains reportable information for all enabled open account balance listing definitions. This program is submitted automatically after a successful transfer to General Ledger for the same ledger or
manually by running the Open Account Balances Data Manager program. When changes are applied to a Open Account Balances Listing Definition, the Open Account Balances Data Manager program is automatically submitted for the changed definition.

For scheduling the report to run periodically, use the &apos;as of relative period close&apos; offset parameter. This is the relative period offset to the current period, so when the current period changes, the period close as of date will also be automatically updated when the report is re-run.</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>Please specify a value for either the &apos;As of Date&apos; or &apos;As of Relative Period Close&apos; parameters</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>R12 only</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;aging_bucket_cols</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;reval_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_as_of_date</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_relative_period</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_reval_conv_date</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_reval_conv_type</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_reval_currency</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>(dte.ledger_name=:ledger or
dte.ledger_id in (select glsa.ledger_id from gl_ledgers gl,gl_ledger_set_assignments glsa where glsa.ledger_set_id=gl.ledger_id and gl.name=:ledger)
)</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>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>ap_inv.operating_unit=: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>AR</LANGUAGE>
      <PARAMETER_NAME>وحدة التشغيل</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Betriebseinheit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <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_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>业务实体</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>xtdv.name=:report_definition</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
xtdv.name value,
xtdv.description description
from
xla_tb_definitions_vl xtdv
where xtdv.enabled_flag=&apos;Y&apos; and 
(xtdv.definition_code in 
 (select 
   xtd.definition_code
  from 
   xla_tb_defn_je_sources xtd,
   xla_subledgers xs
  where 
   xtd.je_source_name=xs.je_source_name and 
   xs.application_id=200
 )
) and
((nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos;) or
 (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;Y&apos; and 
  exists
   (select 
     1
    from 
     gl_access_sets gas,
     gl_access_set_assignments asa
    where 
     gas.access_set_id=asa.access_set_id and 
     asa.ledger_id=xtdv.ledger_id and 
     (gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
      gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
     )
   )
 )
) and
(:$flex$.Ledger is null or 
 xtdv.ledger_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.Ledger,gl.name) = &apos;Y&apos;) or
 xtdv.ledger_id in (select glsa.ledger_id from gl_ledgers gl,gl_ledger_set_assignments glsa where glsa.ledger_set_id=gl.ledger_id and xxen_util.contains(:$flex$.Ledger,gl.name) = &apos;Y&apos;) 
) and
(:$flex$.Operating_Unit is null or xtdv.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.Operating_Unit,hou.name) = &apos;Y&apos;)) 
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select 
xtdv.name
from 
xla_tb_definitions_vl xtdv
where
(xtdv.ledger_id=(select gl.ledger_id from gl_ledgers gl where gl.name=:$flex$.Ledger) or 
 xtdv.ledger_id=(select hou.set_of_books_id from hr_operating_units hou where hou.name=:$flex$.Operating_Unit)
) and
rownum=1</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>AR</LANGUAGE>
      <PARAMETER_NAME>تعريف التقرير</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Auswertungsdefinition</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Définition du rapport</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Definition</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>报表定义</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>:p_as_of_date</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select sysdate from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>AR</LANGUAGE>
      <PARAMETER_NAME>اعتبارًا من تاريخ</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Vom</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>En date du</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>As of Date</PARAMETER_NAME>
      <DESCRIPTION>As of Date</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>截止日期</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;aging_bucket_cols</ANCHOR>
    <SQL_TEXT>select
case when x.amount_type=&apos;ACCOUNTED&apos; then
&apos;case when ceil(ap_inv.as_of_date-ap_inv.due_date) between &apos; || to_char(aap.days_start) || &apos; and &apos; || to_char(aap.days_to) || &apos; and ap_inv.ps_amount_remaining != 0 then ap_inv.ps_amount_remaining end &quot;&apos; || aap.title || &apos;&quot;,&apos;
else
&apos;case when ceil(ap_inv.as_of_date-ap_inv.due_date) between &apos; || to_char(aap.days_start) || &apos; and &apos; || to_char(aap.days_to) || &apos; and ap_inv.ps_entered_amt_remaining != 0 then ap_inv.ps_entered_amt_remaining end &quot;&apos; || substrb(aap.title,1,xxen_report.max_column_length-8) || &apos; Entered Amt&quot;,&apos;
end
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
 ) aap,
 (select &apos;ACCOUNTED&apos; amount_type from dual union all select &apos;ENTERED&apos; amount_type from dual) x
order by
x.amount_type,
aap.period_sequence_num</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;
) x
order by
x.value</LOV_QUERY_DSP>
    <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>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(ap_inv.third_party_name=:p_third_party_name or ap_inv.vendor_name=:p_third_party_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>AR</LANGUAGE>
      <PARAMETER_NAME>اسم الطرف الآخر</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Geschäftspartnername</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Nom du tiers</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Third Party Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>第三方名称</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gcck.concatenated_segments&gt;=:p_account_from</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.gl_account_type = &apos;L&apos;
and gcck.detail_posting_allowed = &apos;Y&apos;
and gcck.enabled_flag = &apos;Y&apos;
and gcck.summary_flag = &apos;N&apos;
and gcck.chart_of_accounts_id in
(select 
  gl.chart_of_accounts_id    
 from 
 gl_ledgers gl
 where 
 (:$flex$.Ledger is null or xxen_util.contains(:$flex$.Ledger,gl.name) = &apos;Y&apos;) and
 (:$flex$.Operating_Unit is null or gl.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.Operating_Unit,hou.name) = &apos;Y&apos;)) and
 (:$flex$.Report_Definition is null or gl.ledger_id in (select xtdv.ledger_id from xla_tb_definitions_vl xtdv where xxen_util.contains(:$flex$.Report_Definition,xtdv.name) = &apos;Y&apos;)) and
 ( (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos;) or
   (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;Y&apos; and 
    exists
     (select 1
      from 
       gl_access_sets gas,
       gl_access_set_assignments asa
      where 
       gas.access_set_id=asa.access_set_id and 
       asa.ledger_id=gl.ledger_id and 
       ( gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
         gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
       )
     )
   )
 )
) 
order by gcck.concatenated_segments</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>AR</LANGUAGE>
      <PARAMETER_NAME>حساب من</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Von Konto</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Compte de créditeurs De</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payables Account From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>帐户自</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gcck.concatenated_segments&lt;=:p_account_to</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.gl_account_type = &apos;L&apos;
and gcck.detail_posting_allowed = &apos;Y&apos;
and gcck.enabled_flag = &apos;Y&apos;
and gcck.summary_flag = &apos;N&apos;
and gcck.chart_of_accounts_id in
(select 
  gl.chart_of_accounts_id    
 from 
 gl_ledgers gl
 where 
 (:$flex$.Ledger is null or xxen_util.contains(:$flex$.Ledger,gl.name) = &apos;Y&apos;) and
 (:$flex$.Operating_Unit is null or gl.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.Operating_Unit,hou.name) = &apos;Y&apos;)) and
 (:$flex$.Report_Definition is null or gl.ledger_id in (select xtdv.ledger_id from xla_tb_definitions_vl xtdv where xxen_util.contains(:$flex$.Report_Definition,xtdv.name) = &apos;Y&apos;)) and
 ( (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos;) or
   (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;Y&apos; and 
    exists
     (select 1
      from 
       gl_access_sets gas,
       gl_access_set_assignments asa
      where 
       gas.access_set_id=asa.access_set_id and 
       asa.ledger_id=gl.ledger_id and 
       ( gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
         gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
       )
     )
   )
 )
)
order by gcck.concatenated_segments</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.Payables_Account_From</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>AR</LANGUAGE>
      <PARAMETER_NAME>حساب إلى</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Bis Konto</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Compte de dettes à</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payables Account To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>帐户至</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>85</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>ap_inv.invoice_payment_status != xxen_util.meaning(&apos;Y&apos;,&apos;INVOICE PAYMENT STATUS&apos;,200)</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>Exclude Fully Paid</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <DISPLAY_SEQUENCE>87</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>ap_inv.invoice_cancelled_date is null</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Exclude Cancelled</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>11</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>:p_reval_currency</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
fcv.currency_code value,
fcv.description
from
fnd_currencies_vl fcv,
gl_daily_rates gdr
where
fcv.currency_code=gdr.to_currency and
fcv.enabled_flag=&apos;Y&apos; and
gdr.from_currency in (
select
gl.currency_code
from
gl_ledgers gl
where
(:$flex$.Ledger is null or xxen_util.contains(:$flex$.Ledger,gl.name) = &apos;Y&apos;) and
(:$flex$.Operating_Unit is null or gl.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.Operating_Unit,hou.name) = &apos;Y&apos;)) and
(:$flex$.Report_Definition is null or gl.ledger_id in (select xtdv.ledger_id from xla_tb_definitions_vl xtdv where xxen_util.contains(:$flex$.Report_Definition,xtdv.name) = &apos;Y&apos;)) and
( (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos;) or
  (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;Y&apos; and 
   exists
    (select 1
     from 
      gl_access_sets gas,
      gl_access_set_assignments asa
     where 
      gas.access_set_id=asa.access_set_id and 
      asa.ledger_id=gl.ledger_id and 
      ( gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
        gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
      )
    )
  )
)
) and
gdr.conversion_date&gt;=sysdate-365
order by 1</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Monnaie de réévaluation</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>12</SORT_ORDER>
    <ANCHOR>&amp;reval_columns</ANCHOR>
    <SQL_TEXT>select
x.txt
from
(
 select
  1 seq1,
  1 seq2,
  &apos;ap_inv.ledger_currency revaluation_from_currency,
   :p_reval_currency revaluation_currency,
   :p_reval_conv_type revaluation_rate_type,
   nvl2(:p_reval_currency,:p_reval_conv_date,null) revaluation_date,
   ap_inv.reval_conv_rate revaluation_rate,
   case when ap_inv.payment_num = first_value(ap_inv.payment_num) over (partition by ap_inv.invoice_id order by ap_inv.payment_num) then ap_inv.acctd_rounded_orig_amount * ap_inv.reval_conv_rate end &quot;Original Amount &apos; || :p_reval_currency || &apos;&quot;,
   case when ap_inv.payment_num = first_value(ap_inv.payment_num) over (partition by ap_inv.invoice_id order by ap_inv.payment_num) then ap_inv.acctd_rounded_rem_amount * ap_inv.reval_conv_rate end &quot;Outstanding Amount &apos; || :p_reval_currency || &apos;&quot;,&apos; txt
 from dual
 union
 select
  2 seq1,
  aap.period_sequence_num seq2,
  &apos;case when ceil(ap_inv.as_of_date-ap_inv.due_date) between &apos; || to_char(aap.days_start) || &apos; and &apos; || to_char(aap.days_to) || &apos; and ap_inv.ps_amount_remaining != 0 then ap_inv.ps_amount_remaining * ap_inv.reval_conv_rate end &quot;&apos; || substrb(aap.title,1,xxen_report.max_column_length-4) || &apos; &apos; || :p_reval_currency || &apos;&quot;,&apos; txt
 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
  ) aap
) x
order by
x.seq1,
x.seq2
</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Monnaie de réévaluation</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>13</SORT_ORDER>
    <DISPLAY_SEQUENCE>100</DISPLAY_SEQUENCE>
    <ANCHOR>:p_reval_conv_type</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
gdct.user_conversion_type value, 
gdct.description||&apos; (&apos;||count(*) over (partition by gdr.conversion_type)||&apos;)&apos; description
from
gl_daily_conversion_types gdct,
gl_daily_rates gdr
where
gdr.from_currency in (
select
gl.currency_code
from
gl_ledgers gl
where
(:$flex$.Ledger is null or xxen_util.contains(:$flex$.Ledger,gl.name) = &apos;Y&apos;) and
(:$flex$.Operating_Unit is null or gl.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.Operating_Unit,hou.name) = &apos;Y&apos;)) and
(:$flex$.Report_Definition is null or gl.ledger_id in (select xtdv.ledger_id from xla_tb_definitions_vl xtdv where xxen_util.contains(:$flex$.Report_Definition,xtdv.name) = &apos;Y&apos;)) and
( (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos;) or
  (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;Y&apos; and 
   exists
    (select 1
     from 
      gl_access_sets gas,
      gl_access_set_assignments asa
     where 
      gas.access_set_id=asa.access_set_id and 
      asa.ledger_id=gl.ledger_id and 
      ( gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
        gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
      )
    )
  )
)
) and
gdr.to_currency=:$flex$.revaluation_currency and
gdr.conversion_date&gt;=sysdate-365 and
gdct.conversion_type=gdr.conversion_type
order by 1</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Taux de réévaluation Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Rate Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>14</SORT_ORDER>
    <DISPLAY_SEQUENCE>110</DISPLAY_SEQUENCE>
    <ANCHOR>:p_reval_conv_date</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>sysdate</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Date de réévaluation</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Date</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>15</SORT_ORDER>
    <DISPLAY_SEQUENCE>120</DISPLAY_SEQUENCE>
    <ANCHOR>:p_relative_period</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
to_char(x.relative_period) value,
&apos;Current Period&apos; ||
decode(x.relative_period,0,null,&apos; &apos; || to_char(x.relative_period) || &apos; &apos; || x.period_type) ||
&apos; (&apos; || x.period_name || &apos;)&apos; description
from
(
select
1-rank() over (partition by gl.name order by ((glp.period_year * 100000) + glp.period_num) desc) relative_period,
glp.period_name,
glp.period_type
from
 gl_ledgers gl
,gl_periods glp
,gl_periods glpc
where
    (:$flex$.Ledger is null or xxen_util.contains(:$flex$.Ledger,gl.name) = &apos;Y&apos;)
and (:$flex$.Operating_Unit is null or gl.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.Operating_Unit,hou.name) = &apos;Y&apos;))
and (:$flex$.Report_Definition is null or gl.ledger_id in (select xtdv.ledger_id from xla_tb_definitions_vl xtdv where xxen_util.contains(:$flex$.Report_Definition,xtdv.name) = &apos;Y&apos;))
and ( (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;N&apos;) or
      (nvl(fnd_profile.value(&apos;XLA_USE_LEDGER_SECURITY&apos;),&apos;N&apos;)=&apos;Y&apos; and 
       exists
        (select 1
         from 
          gl_access_sets gas,
          gl_access_set_assignments asa
         where 
          gas.access_set_id=asa.access_set_id and 
          asa.ledger_id=gl.ledger_id and 
          ( gas.access_set_id=nvl(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;-1&apos;) or
            gas.access_set_id=nvl(fnd_profile.value(&apos;XLA_GL_SECONDARY_ACCESS_SET_ID&apos;),&apos;-1&apos;)
          )
        )
      )
    )
and gl.period_set_name=glp.period_set_name
and gl.accounted_period_type=glp.period_type
and glp.adjustment_period_flag=&apos;N&apos;
and gl.period_set_name=glpc.period_set_name
and gl.accounted_period_type=glpc.period_type
and glpc.adjustment_period_flag=&apos;N&apos;
and trunc(sysdate-1) between glpc.start_date and glpc.end_date
and glp.start_date &lt;= glpc.start_date
) x
order by
x.relative_period desc
</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>A partir de la clôture de la période relative</PARAMETER_NAME>
      <DESCRIPTION>As of Period Close based on the Period Offset relative to the current period. Useful when scheduling the request to be run periodically, the as of date will update automatically relative to the current period.</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>As of Relative Period Close</PARAMETER_NAME>
      <DESCRIPTION>As of Period Close based on the Period Offset relative to the current period. Useful when scheduling the request to be run periodically, the as of date will update automatically relative to the current period.</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>As of Relative Period Close</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Payables 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>Payables 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>Report Definition</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Currency</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Rate Type</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>As of Relative Period Close</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>Payables Account From</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>Payables Account 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>Report Definition</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>Revaluation Currency</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>Revaluation Rate Type</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Payables_Account_From</FLEX_BIND>
    <PARAMETER_NAME>Payables Account From</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Payables Account To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Report_Definition</FLEX_BIND>
    <PARAMETER_NAME>Report Definition</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>As of Relative Period Close</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Report_Definition</FLEX_BIND>
    <PARAMETER_NAME>Report Definition</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Payables Account From</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Report_Definition</FLEX_BIND>
    <PARAMETER_NAME>Report Definition</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Payables Account To</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Report_Definition</FLEX_BIND>
    <PARAMETER_NAME>Report Definition</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Currency</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Report_Definition</FLEX_BIND>
    <PARAMETER_NAME>Report Definition</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Rate Type</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$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Third Party Name</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.revaluation_currency</FLEX_BIND>
    <PARAMETER_NAME>Revaluation Currency</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Rate Type</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>
