<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: GL Account -->
 <LOVS_ROW>
  <GUID>F26C78167A224EFBE0530100007F336B</GUID>
  <LOV_NAME>GL Account</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
ffvv.flex_value value,
ffvv.description||case when ffvv.enabled_flag=&apos;Y&apos; and sysdate between nvl(ffvv.start_date_active,sysdate) and nvl(ffvv.end_date_active,sysdate) then null else &apos; (inactive)&apos; end description
from
fnd_id_flex_segments_vl fifsgv,
fnd_flex_values_vl ffvv
where
gl_security_pkg.validate_segval(fifsgv.segment_num,null,ffvv.flex_value)=&apos;TRUE&apos; and
fifsgv.application_id=101 and
fifsgv.id_flex_code=&apos;GL#&apos; and
fifsgv.enabled_flag=&apos;Y&apos; and
(fifsgv.application_id, fifsgv.id_flex_code, fifsgv.id_flex_num, fifsgv.application_column_name) in (select fsav.application_id, fsav.id_flex_code, fsav.id_flex_num, fsav.application_column_name from fnd_segment_attribute_values fsav where fsav.segment_attribute_type=&apos;GL_ACCOUNT&apos; and fsav.attribute_value=&apos;Y&apos;) and
fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
(:$flex$.chart_of_accounts_id is not null or :$flex$.chart_of_accounts is not null or :$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null or :$flex$.book is not null) and
fifsgv.id_flex_num in (
select /*+ no_unnest*/ fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code=&apos;GL#&apos; and
(
fifsv.id_flex_num=:$flex$.chart_of_accounts_id or
xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos; or
(:$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null) and
fifsgv.id_flex_num in
(
select
gl.chart_of_accounts_id
from
gl_ledgers gl
where
(:$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$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$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
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(+))
)
) or
fifsgv.id_flex_num in (select fbc.accounting_flex_structure from fa_book_controls fbc where xxen_util.contains(:$flex$.book,fbc.book_type_code)=&apos;Y&apos;)
)
)
order by
ffvv.flex_value</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 Balancing -->
 <LOVS_ROW>
  <GUID>F26C78167A214EFBE0530100007F336B</GUID>
  <LOV_NAME>GL Balancing</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
ffvv.flex_value value,
ffvv.description||case when ffvv.enabled_flag=&apos;Y&apos; and sysdate between nvl(ffvv.start_date_active,sysdate) and nvl(ffvv.end_date_active,sysdate) then null else &apos; (inactive)&apos; end description
from
fnd_id_flex_segments_vl fifsgv,
fnd_flex_values_vl ffvv
where
gl_security_pkg.validate_segval(fifsgv.segment_num,null,ffvv.flex_value)=&apos;TRUE&apos; and
fifsgv.application_id=101 and
fifsgv.id_flex_code=&apos;GL#&apos; and
fifsgv.enabled_flag=&apos;Y&apos; and
(fifsgv.application_id, fifsgv.id_flex_code, fifsgv.id_flex_num, fifsgv.application_column_name) in (select fsav.application_id, fsav.id_flex_code, fsav.id_flex_num, fsav.application_column_name from fnd_segment_attribute_values fsav where fsav.segment_attribute_type=&apos;GL_BALANCING&apos; and fsav.attribute_value=&apos;Y&apos;) and
fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
(:$flex$.chart_of_accounts_id is not null or :$flex$.chart_of_accounts is not null or :$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null or :$flex$.book is not null) and
fifsgv.id_flex_num in (
select /*+ no_unnest*/ fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code=&apos;GL#&apos; and
(
fifsv.id_flex_num=:$flex$.chart_of_accounts_id or
xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos; or
(:$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null) and
fifsgv.id_flex_num in
(
select
gl.chart_of_accounts_id
from
gl_ledgers gl
where
(:$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$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$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
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(+))
)
) or
fifsgv.id_flex_num in (select fbc.accounting_flex_structure from fa_book_controls fbc where xxen_util.contains(:$flex$.book,fbc.book_type_code)=&apos;Y&apos;)
)
)
order by
ffvv.flex_value</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </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: AR Aging -->
 <REPORTS_ROW>
  <GUID>B057D82F30B17A2DE0530100007FD563</GUID>
  <SQL_TEXT>select
x1.ledger ledger,
x1.operating_unit operating_unit,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &quot;&amp;lp_bal_seg_p&quot;,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_acc_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &quot;&amp;lp_acc_seg_p&quot;,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_accounting_flexfield&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.code_combination_id, &apos;ALL&apos;, &apos;Y&apos;, &apos;VALUE&apos;) gl_account_segments,
x1.sort_field1 salesperson,
x1.cust_name customer,
x1.cust_no customer_number,
x1.cust_country customer_country,
x1.cust_class customer_classification,
x1.credit_limits,
x1.order_credit_limits,
x1.collector collector,
&amp;lp_invoice_cols_s
x1.revaluation_from_currency amounts_currency,
--
nvl(sum(case when nvl(x1.rk,1)=1 then x1.amt_due_original else 0 end),0)     original_amount,
nvl(sum(case when nvl(x1.rk,1)=1 then x1.amt_due_remaining else 0 end),0)    outstanding_amount,
nvl(sum(
 case 
 when nvl(x1.rk,1)=1
 and  ( x1.days_past_due &gt; 0
       or  (:p_credit_option = &apos;DETAIL&apos; and x1.class in (&apos;PMT&apos;,&apos;CM&apos;,&apos;CLAIM&apos;))
       or  (:p_risk_option = &apos;DETAIL&apos; and x1.invoice_type = :p_risk_meaning)
      )
 then x1.amt_due_remaining
 else 0
 end
),0) past_due_amount,
--
&amp;lp_on_acc_summ_cols
:p_age_basis Aging_Basis,
&amp;lp_aging_amount_cols
&amp;lp_aging_pct_cols
-- Revaluation Columns
&amp;lp_reval_columns
&amp;lp_reval_aging_amount_cols
--
&amp;party_dff_cols1
&amp;cust_dff_cols1
--
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) &quot;&amp;lp_bal_seg_p Desc&quot;,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_acc_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) &quot;&amp;lp_acc_seg_p Desc&quot;
&amp;lp_sla_sel_outer
from
(--x1 start
select /*+ no_push_pred(sla) */
x.ledger,
(select haou.name from hr_all_organization_units haou where haou.organization_id=x.org_id) operating_unit,
x.sort_field1,
x.sort_field2,
hcpamv.credit_limits,
hcpamv.order_credit_limits,
x.cust_name,
x.cust_no,
x.cust_country,
x.cust_class,
(select ac.name from ar_collectors ac where ac.collector_id=nvl(hcps.collector_id,hcpa.collector_id)) collector,
x.class,
x.cons_billing_number,
x.invnum,
x.invoice_currency_code,
x.term,
x.trx_date,
x.due_date,
x.days_past_trx,
x.days_past_due,
x.amt_due_original,
x.amount_adjusted,
x.amount_applied,
x.amount_credited,
x.gl_date,
x.data_converted,
x.ps_exchange_rate,
x.code_combination_id,
x.chart_of_accounts_id,
x.invoice_type,
x.comments,
x.reference,
--
&amp;lp_bucket_cols1
--
case when (:p_credit_option=&apos;SUMMARY&apos; and x.class in (&apos;PMT&apos;,&apos;CM&apos;,&apos;CLAIM&apos;))
or (:p_risk_option=&apos;SUMMARY&apos; AND x.invoice_type=:p_risk_meaning)
then to_number(null)
else x.amt_due_remaining
end amt_due_remaining,
case when :p_credit_option=&apos;SUMMARY&apos; AND x.class=&apos;PMT&apos;
then x.amt_due_remaining
else null
end  on_account_amount_cash,
case when :p_credit_option=&apos;SUMMARY&apos; AND x.class=&apos;CM&apos;
then x.amt_due_remaining
else null
end  on_account_amount_credit,
case when :p_risk_option=&apos;SUMMARY&apos; AND x.invoice_type=:p_risk_meaning
then x.amt_due_remaining
else null
end  on_account_amount_risk,
case when :p_credit_option=&apos;SUMMARY&apos; AND x.class=&apos;CLAIM&apos;
then x.amt_due_remaining
else null
end  cust_amount_claim,
nvl(:p_in_currency,x.functional_currency) revaluation_from_currency,
decode(nvl(:p_in_currency,x.functional_currency),:p_reval_currency,1,(select gdr.conversion_rate from gl_daily_conversion_types gdct, gl_daily_rates gdr where nvl(:p_in_currency,x.functional_currency)=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,
  --
&amp;party_dff_cols2
&amp;cust_dff_cols2
  --
xxen_util.meaning(:p_reporting_level,&apos;FND_MO_REPORTING_LEVEL&apos;,0) reporting_level,
case :p_reporting_level when &apos;1000&apos; then x.ledger when &apos;3000&apos; then (select haou.name from hr_all_organization_units haou where haou.organization_id=x.org_id) end reporting_entity,
nvl(sla.code_combination_id, x.code_combination_id) rec_code_combination_id,
x.payment_sched_id,
nvl(round(sla.accounted_dr*x.installment_ratio, 2), case when x.rec_acctd_amount &gt;= 0 then x.rec_acctd_amount else 0 end) accounted_dr,
nvl(round(sla.accounted_cr * x.installment_ratio, 2), case when x.rec_acctd_amount &lt; 0 then abs(x.rec_acctd_amount) else 0 end) accounted_cr,
nvl(round(case x.sla_entity_code when &apos;RECEIPTS&apos; then sla.accounted_dr else sla_net.net_accounted_dr end*x.installment_ratio,2), case when x.rec_acctd_amount &gt;= 0 then x.rec_acctd_amount else 0 end) net_accounted_dr,
nvl(round(case x.sla_entity_code when &apos;RECEIPTS&apos; then sla.accounted_cr else sla_net.net_accounted_cr end*x.installment_ratio,2), case when x.rec_acctd_amount &lt; 0 then abs(x.rec_acctd_amount) else 0 end) net_accounted_cr,
row_number() over (partition by x.payment_sched_id order by nvl(sla.code_combination_id, x.code_combination_id)) rk,
x.sla_entity_code
from
(-- x start
select
substrb(hp.party_name,1,50) cust_name,
hca.account_number cust_no,
nvl(sales.name,jrrev.resource_name) sort_field1,
arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id) sort_field2,
nvl(sales.salesrep_id, -3) salesrep_id,
rt.name term,
site.site_use_id,
loc.state cust_state,
loc.city cust_city,
(select ftv.territory_short_name from fnd_territories_vl ftv where ftv.territory_code=loc.country) cust_country,
xxen_util.meaning(hca.customer_class_code,&apos;CUSTOMER CLASS&apos;,222) cust_class,
decode(decode(upper(rtrim(rpad(:p_in_format_option_low, 1))),&apos;D&apos;,&apos;D&apos;,null),null,-1,acct_site.cust_acct_site_id) addr_id,
nvl(hca.cust_account_id,-999) cust_id,
hca.party_id,
--
&amp;party_dff_cols3
&amp;cust_dff_cols3
--
ps.payment_schedule_id payment_sched_id,
ps.class class,
ps.trx_date,
ps.due_date,
decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, ps.amount_due_original * nvl(ps.exchange_rate, 1), ps.amount_due_original) amt_due_original,
xxen_ar_arxagrw_pkg.comp_amt_due_remainingformula
(ps.class,
arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id),
ps.payment_schedule_id,
ps.amt_due_remaining,
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted
) amt_due_remaining,
ps.trx_number invnum,
ceil(:p_in_as_of_date_low - ps.trx_date) days_past_trx,
ceil(:p_in_as_of_date_low - ps.due_date) days_past_due,
ps.amount_adjusted amount_adjusted,
ps.amount_applied amount_applied,
ps.amount_credited amount_credited,
ps.gl_date gl_date,
decode(ps.invoice_currency_code, gsob.currency_code, null, decode(ps.exchange_rate, null, &apos;*&apos;, null)) data_converted,
nvl(ps.exchange_rate, 1) ps_exchange_rate,
--
&amp;lp_bucket_cols2
--
c.code_combination_id,
c.chart_of_accounts_id,
ci.cons_billing_number  cons_billing_number,
arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id) invoice_type,
rct.comments,
rct.ct_reference reference,
ps.invoice_currency_code,
gsob.currency_code functional_currency,
gsob.name ledger,
gsob.set_of_books_id ledger_id,
ps.org_id,
gld.acctd_amount rec_acctd_amount,
ps.customer_trx_id,
&apos;TRANSACTIONS&apos; sla_entity_code,
ps.customer_trx_id sla_source_id,
ps.amount_due_original/nvl(
(select sum(ps2.amount_due_original) 
from ar_payment_schedules ps2 
where ps2.customer_trx_id=ps.customer_trx_id and
ps2.class&lt;&gt;&apos;PMT&apos;), 0) installment_ratio
from
hz_cust_accounts hca,
hz_parties hp,
(
select
a.customer_id,
a.customer_site_use_id ,
a.customer_trx_id,
a.payment_schedule_id,
a.class ,
sum(a.primary_salesrep_id) primary_salesrep_id,
a.term_id,
a.trx_date,
a.due_date,
sum(a.amount_due_remaining) amt_due_remaining,
a.trx_number,
a.amount_due_original,
a.amount_adjusted,
a.amount_applied ,
a.amount_credited ,
a.amount_adjusted_pending,
a.gl_date ,
a.cust_trx_type_id,
a.org_id,
a.invoice_currency_code,
a.exchange_rate,
sum(a.cons_inv_id) cons_inv_id
from
(
select
ps.customer_id,
ps.customer_site_use_id,
ps.customer_trx_id,
ps.payment_schedule_id,
ps.class,
0 primary_salesrep_id,
ps.term_id,
ps.trx_date,
ps.due_date,
nvl(sum(decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, nvl(adj.acctd_amount, 0), adj.amount)),0) * (-1)  amount_due_remaining,
ps.trx_number,
ps.amount_due_original,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted_pending,
ps.gl_date,
ps.cust_trx_type_id,
ps.org_id,
ps.invoice_currency_code,
nvl(ps.exchange_rate,1) exchange_rate,
0 cons_inv_id
from
ar_payment_schedules ps,
ar_adjustments adj
where
ps.gl_date &lt;= :p_in_as_of_date_low
and ps.customer_id &gt; 0
and ps.gl_date_closed  &gt; :p_in_as_of_date_low
and decode(upper(:p_in_currency),null,ps.invoice_currency_code,upper(:p_in_currency))=ps.invoice_currency_code
and adj.payment_schedule_id=ps.payment_schedule_id
and adj.status=&apos;A&apos;
and adj.gl_date &gt; :p_in_as_of_date_low
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
and adj.org_id=ps.org_id
group by
ps.customer_id,
ps.customer_site_use_id,
ps.customer_trx_id,
ps.class,
ps.term_id,
ps.trx_date,
ps.due_date,
ps.trx_number,
ps.amount_due_original,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted_pending,
ps.gl_date,
ps.cust_trx_type_id,
ps.org_id,
ps.invoice_currency_code,
nvl(ps.exchange_rate,1),
ps.payment_schedule_id
union all
select
ps.customer_id,
ps.customer_site_use_id,
ps.customer_trx_id,
ps.payment_schedule_id,
ps.class,
0 primary_salesrep_id,
ps.term_id,
ps.trx_date,
ps.due_date,
nvl(sum(decode( nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;),
&apos;Y&apos;, (decode(ps.class,
&apos;CM&apos;, decode( app.application_type, &apos;CM&apos;, app.acctd_amount_applied_from, app.acctd_amount_applied_to),
app.acctd_amount_applied_to)+
nvl(app.acctd_earned_discount_taken,0)+nvl(app.acctd_unearned_discount_taken,0)
),( app.amount_applied+nvl(app.earned_discount_taken,0)+nvl(app.unearned_discount_taken,0)
))*decode(ps.class,&apos;CM&apos;, decode(app.application_type,&apos;CM&apos;,-1,1),1)),0) amount_due_remaining,
ps.trx_number,
ps.amount_due_original,
ps.amount_adjusted,
ps.amount_applied ,
ps.amount_credited,
ps.amount_adjusted_pending,
ps.gl_date gl_date,
ps.cust_trx_type_id,
ps.org_id,
ps.invoice_currency_code,
nvl(ps.exchange_rate, 1) exchange_rate,
0 cons_inv_id
from
ar_payment_schedules ps,
ar_receivable_applications app
where
ps.gl_date &lt;= :p_in_as_of_date_low
and ps.customer_id &gt; 0
and ps.gl_date_closed  &gt; :p_in_as_of_date_low
and decode(upper(:p_in_currency),null,ps.invoice_currency_code, upper(:p_in_currency))=ps.invoice_currency_code
and (app.applied_payment_schedule_id=ps.payment_schedule_id or
app.payment_schedule_id=ps.payment_schedule_id)
and app.status IN (&apos;APP&apos;, &apos;ACTIVITY&apos;)
and nvl( app.confirmed_flag, &apos;Y&apos; )=&apos;Y&apos;
and app.gl_date &gt; :p_in_as_of_date_low
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
and app.org_id=ps.org_id
group by
ps.customer_id,
ps.customer_site_use_id,
ps.customer_trx_id,
ps.class,
ps.term_id,
ps.trx_date,
ps.due_date,
ps.trx_number,
ps.amount_due_original,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted_pending,
ps.gl_date,
ps.cust_trx_type_id,
ps.org_id,
ps.invoice_currency_code,
nvl(ps.exchange_rate, 1),
ps.payment_schedule_id
union all
select
ps.customer_id,
ps.customer_site_use_id,
ps.customer_trx_id,
ps.payment_schedule_id,
ps.class class,
nvl(ct.primary_salesrep_id, -3) primary_salesrep_id,
ps.term_id,
ps.trx_date,
ps.due_date,
decode( nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, ps.acctd_amount_due_remaining, ps.amount_due_remaining) amt_due_remaining,
ps.trx_number,
ps.amount_due_original,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted_pending,
ps.gl_date,
ps.cust_trx_type_id,
ps.org_id,
ps.invoice_currency_code,
nvl(ps.exchange_rate, 1) exchange_rate,
ps.cons_inv_id
from
ar_payment_schedules ps,
ra_customer_trx ct
where
ps.gl_date &lt;= :p_in_as_of_date_low
and ps.gl_date_closed  &gt; :p_in_as_of_date_low
and decode(upper(:p_in_currency),null, ps.invoice_currency_code, upper(:p_in_currency))=ps.invoice_currency_code
and ps.customer_trx_id=ct.customer_trx_id
and ps.class &lt;&gt; &apos;CB&apos;
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
and ct.org_id=ps.org_id
union all
select
ps.customer_id,
ps.customer_site_use_id ,
ps.customer_trx_id,
ps.payment_schedule_id,
ps.class class,
nvl(ct.primary_salesrep_id,-3) primary_salesrep_id,
ps.term_id,
ps.trx_date,
ps.due_date,
decode( nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, ps.acctd_amount_due_remaining, ps.amount_due_remaining) amt_due_remaining,
ps.trx_number,
ps.amount_due_original,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted_pending,
ps.gl_date,
ps.cust_trx_type_id,
ps.org_id,
ps.invoice_currency_code,
nvl(ps.exchange_rate, 1) exchange_rate,
ps.cons_inv_id
from
ar_payment_schedules ps,
ra_customer_trx ct,
ar_adjustments adj
where
ps.gl_date &lt;= :p_in_as_of_date_low
and ps.gl_date_closed  &gt; :p_in_as_of_date_low
and decode(upper(:p_in_currency),null, ps.invoice_currency_code, upper(:p_in_currency))=ps.invoice_currency_code
and ps.class=&apos;CB&apos;
and ps.customer_trx_id=adj.chargeback_customer_trx_id (+)
and ps.org_id=adj.org_id (+)
and adj.customer_trx_id=ct.customer_trx_id (+)
and adj.org_id=ct.org_id (+)
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
) a
group by
a.customer_id,
a.customer_site_use_id,
a.customer_trx_id,
a.payment_schedule_id,
a.class,
a.term_id,
a.trx_date,
a.due_date,
a.trx_number,
a.amount_due_original,
a.amount_adjusted,
a.amount_applied,
a.amount_credited,
a.amount_adjusted_pending,
a.gl_date,
a.cust_trx_type_id,
a.org_id,
a.invoice_currency_code,
a.exchange_rate
) ps,
ar_cons_inv ci,
ra_salesreps_all sales,
jtf_rs_resource_extns_vl jrrev,
hz_cust_site_uses site,
hz_cust_acct_sites acct_site,
hz_party_sites party_site,
hz_locations loc,
ra_cust_trx_line_gl_dist gld,
ar_dispute_history dh,
ra_terms rt,
gl_code_combinations c,
ra_customer_trx rct,
gl_sets_of_books gsob
where
--upper(RTRIM(RPAD(:p_in_summary_option_low,1)) )=&apos;I&apos;
ps.customer_site_use_id=site.site_use_id
and site.cust_acct_site_id=acct_site.cust_acct_site_id
and acct_site.party_site_id=party_site.party_site_id
and loc.location_id=party_site.location_id
and ps.customer_id=hca.cust_account_id
and hca.party_id=hp.party_id
and ps.customer_trx_id=gld.customer_trx_id
and gld.account_class=&apos;REC&apos;
and gld.latest_rec_flag=&apos;Y&apos;
and gld.code_combination_id=c.code_combination_id
and ps.payment_schedule_id=dh.payment_schedule_id(+)
and ps.term_id=rt.term_id (+)
and :p_in_as_of_date_low  &gt;= nvl(dh.start_date(+), :p_in_as_of_date_low)
and :p_in_as_of_date_low  &lt;  nvl(dh.end_date(+), :p_in_as_of_date_low + 1)
and ( dh.dispute_history_id is null
or dh.dispute_history_id =
(select max(dh2.dispute_history_id)
from ar_dispute_history dh2
where dh2.payment_schedule_id=ps.payment_schedule_id
and :p_in_as_of_date_low&gt;=nvl(dh2.start_date(+), :p_in_as_of_date_low)
and :p_in_as_of_date_low&lt;nvl(dh2.end_date(+), :p_in_as_of_date_low + 1)
)
)
and rct.customer_trx_id=ps.customer_trx_id
and gsob.set_of_books_id=rct.set_of_books_id
&amp;lp_invoice_type_low
&amp;lp_invoice_type_high
&amp;lp_bal_seg_low
&amp;lp_bal_seg_high
&amp;lp_acc_seg_low
&amp;lp_acc_seg_high
and ps.cons_inv_id=ci.cons_inv_id(+)
and nvl(ps.primary_salesrep_id,-3)=sales.salesrep_id
and sales.org_id=ps.org_id
and jrrev.resource_id=sales.resource_id
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
and gld.org_id=ps.org_id
and site.org_id=ps.org_id
and 2=2
union all
select
substrb(nvl(hp.party_name,:p_short_unid_phrase),1,50) cust_name,
hca.account_number cust_no,
nvl(sales.name,jrrev.resource_name),
initcap(:p_payment_meaning),
nvl(sales.salesrep_id,-3),
null term,
site.site_use_id,
loc.state cust_state,
loc.city cust_city,
(select ftv.territory_short_name from fnd_territories_vl ftv where ftv.territory_code=loc.country) cust_country,
xxen_util.meaning(hca.customer_class_code,&apos;CUSTOMER CLASS&apos;,222) cust_class,
decode(decode(upper(RTRIM(RPAD(:p_in_format_option_low, 1))),&apos;D&apos;,&apos;D&apos;,null),null,-1,acct_site.cust_acct_site_id) addr_id,
nvl(hca.cust_account_id, -999) cust_id,
hca.party_id,
--
&amp;party_dff_cols3
&amp;cust_dff_cols3
--
ps.payment_schedule_id,
app.class,
ps.trx_date,
ps.due_date,
decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, ps.amount_due_original * nvl(ps.exchange_rate, 1), ps.amount_due_original) amt_due_original,
xxen_ar_arxagrw_pkg.Comp_Amt_Due_RemainingFormula
( app.class,
initcap(:p_payment_meaning),
ps.payment_schedule_id,
decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, nvl(-SUM(app.acctd_amount), 0), nvl(-SUM(app.amount), 0)), -- amount due remaining
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted
) amt_due_remaining,
ps.trx_number,
ceil(:p_in_as_of_date_low - ps.trx_date) days_past_trx,
ceil(:p_in_as_of_date_low - ps.due_date) days_past_due,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
ps.gl_date,
decode(ps.invoice_currency_code, gsob.currency_code, null, decode(ps.exchange_rate, null, &apos;*&apos;, null)),
nvl(ps.exchange_rate, 1),
--
&amp;lp_bucket_cols3
--
app.code_combination_id,
app.chart_of_accounts_id,
ci.cons_billing_number cons_billing_number,
initcap(:p_payment_meaning) invoice_type,
acr.comments,
null reference,
ps.invoice_currency_code,
gsob.currency_code functional_currency,
gsob.name ledger,
gsob.set_of_books_id ledger_id,
ps.org_id,
-- Derive accounted amount from ar_receivable_applications for Payments
decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, nvl(-SUM(app.acctd_amount), 0), nvl(-SUM(app.amount), 0)) rec_acctd_amount,
ps.customer_trx_id,
&apos;RECEIPTS&apos; sla_entity_code,
ps.cash_receipt_id sla_source_id,
1 installment_ratio
from
hz_cust_accounts hca,
hz_parties hp,
ar_payment_schedules ps,
ar_cons_inv ci,
ra_salesreps_all sales,
jtf_rs_resource_extns_vl jrrev,
hz_cust_site_uses site,
hz_cust_acct_sites acct_site,
hz_party_sites party_site,
hz_locations loc,
ar_cash_receipts acr,
gl_sets_of_books gsob,
(
select
c.code_combination_id,
c.chart_of_accounts_id,
ps.payment_schedule_id payment_schedule_id,
decode(app.applied_payment_schedule_id, -4, &apos;CLAIM&apos;,ps.class) class,
app.acctd_amount_applied_from acctd_amount,
app.amount_applied amount,
app.status status
from
ar_receivable_applications app,
gl_code_combinations c,
ar_payment_schedules ps
where
app.gl_date &lt;= :p_in_as_of_date_low
 --and upper(RTRIM(RPAD(:p_in_summary_option_low,1))) =&apos;I&apos;
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
and ps.cash_receipt_id=app.cash_receipt_id
and app.code_combination_id=c.code_combination_id
and app.status in ( &apos;ACC&apos;, &apos;UNAPP&apos;, &apos;UNID&apos;,&apos;OTHER ACC&apos;)
and nvl(app.confirmed_flag, &apos;Y&apos;)=&apos;Y&apos;
and ps.gl_date_closed&gt; :p_in_as_of_date_low
and ((app.reversal_gl_date is not null and
ps.gl_date &lt;= :p_in_as_of_date_low
) or
app.reversal_gl_date is null
)
and decode(upper(:p_in_currency), null, ps.invoice_currency_code, upper(:p_in_currency))=ps.invoice_currency_code
and nvl( ps.receipt_confirmed_flag, &apos;Y&apos; )=&apos;Y&apos;
&amp;lp_bal_seg_low
&amp;lp_bal_seg_high
&amp;lp_acc_seg_low
&amp;lp_acc_seg_high
and app.org_id=ps.org_id
) app
where
ps.payment_schedule_id=app.payment_schedule_id
and ps.customer_id=hca.cust_account_id(+)
and hca.party_id=hp.party_id(+)
and ps.customer_site_use_id=site.site_use_id(+)
and site.cust_acct_site_id=acct_site.cust_acct_site_id(+)
and acct_site.party_site_id=party_site.party_site_id(+)
and loc.location_id(+)=party_site.location_id
and acr.cash_receipt_id=ps.cash_receipt_id
and gsob.set_of_books_id=acr.set_of_books_id
and ps.cons_inv_id=ci.cons_inv_id(+)
and sales.salesrep_id=-3
and sales.org_id =ps.org_id
and jrrev.resource_id=sales.resource_id
and site.org_id (+)=ps.org_id
and 2=2
group by
hp.party_name,
hca.account_number,
hca.customer_class_code,
site.site_use_id,
nvl(sales.name,jrrev.resource_name),
nvl(sales.salesrep_id,-3),
loc.state,
loc.city,
loc.country,
acct_site.cust_acct_site_id,
hca.cust_account_id,
hca.party_id,
--
&amp;party_dff_cols3_g
&amp;cust_dff_cols3_g
--
ps.payment_schedule_id,
ps.trx_date,
ps.due_date,
ps.trx_number,
ps.amount_due_original,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
ps.gl_date,
ps.amount_in_dispute,
ps.amount_adjusted_pending,
ps.invoice_currency_code,
ps.exchange_rate,
app.class,
app.code_combination_id,
app.chart_of_accounts_id,
decode( app.status, &apos;UNID&apos;, &apos;UNID&apos;,&apos;OTHER ACC&apos;,&apos;OTHER ACC&apos;,&apos;UNAPP&apos;),
ci.cons_billing_number ,
initcap(:p_payment_meaning),
acr.comments,
gsob.currency_code,
gsob.name,
gsob.set_of_books_id,
ps.org_id,
ps.customer_trx_id,
ps.cash_receipt_id
union all
select
substrb(nvl(hp.party_name, :p_short_unid_phrase),1,50) cust_name,
hca.account_number cust_no,
nvl(sales.name,jrrev.resource_name),
initcap(:p_risk_meaning),
nvl(sales.salesrep_id,-3),
null term,
site.site_use_id,
loc.state cust_state,
loc.city cust_city,
(select ftv.territory_short_name from fnd_territories_vl ftv where ftv.territory_code=loc.country) cust_country,
xxen_util.meaning(hca.customer_class_code,&apos;CUSTOMER CLASS&apos;,222) cust_class,
decode(decode(upper(RTRIM(RPAD(:p_in_format_option_low, 1))),&apos;D&apos;,&apos;D&apos;,null),null,-1,acct_site.cust_acct_site_id) addr_id,
nvl(hca.cust_account_id, -999) cust_id,
hca.party_id,
--
&amp;party_dff_cols3
&amp;cust_dff_cols3
--
ps.payment_schedule_id,
initcap(:p_risk_meaning),
ps.trx_date,
ps.due_date,
decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, ps.amount_due_original * nvl(ps.exchange_rate, 1), ps.amount_due_original) amt_due_original,
xxen_ar_arxagrw_pkg.comp_amt_due_remainingformula
( initcap(:p_risk_meaning),
initcap(:p_risk_meaning),
ps.payment_schedule_id,
decode( nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, crh.acctd_amount, crh.amount), -- amount due remaining
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted
)amt_due_remaining,
ps.trx_number,
ceil(:p_in_as_of_date_low - ps.trx_date) days_past_trx,
ceil(:p_in_as_of_date_low - ps.due_date) days_past_due,
ps.amount_adjusted,
ps.amount_applied,
ps.amount_credited,
crh.gl_date,
decode(ps.invoice_currency_code, gsob.currency_code, null, decode(crh.exchange_rate, null, &apos;*&apos;, null)),
nvl(crh.exchange_rate, 1),
--
&amp;lp_bucket_cols4
--
c.code_combination_id,
c.chart_of_accounts_id,
ci.cons_billing_number  cons_billing_number,
initcap(:p_risk_meaning) invoice_type,
cr.comments,
null reference,
ps.invoice_currency_code,
gsob.currency_code functional_currency,
gsob.name ledger,
gsob.set_of_books_id ledger_id,
ps.org_id,
-- Derive accounted amount from ar_cash_receipt_history for Risk
decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, crh.acctd_amount, crh.amount) rec_acctd_amount,
ps.customer_trx_id,
&apos;RECEIPTS&apos; sla_entity_code,
cr.cash_receipt_id sla_source_id,
1 installment_ratio
from
hz_cust_accounts hca,
hz_parties hp,
ar_payment_schedules ps,
ar_cons_inv ci,
hz_cust_site_uses site,
hz_cust_acct_sites acct_site,
hz_party_sites party_site,
hz_locations loc,
ar_cash_receipts cr,
ar_cash_receipt_history crh,
gl_code_combinations c,
ra_salesreps_all sales,
jtf_rs_resource_extns_vl jrrev,
gl_sets_of_books gsob
where
crh.gl_date &lt;= :p_in_as_of_date_low
--and upper(RTRIM(RPAD(:p_in_summary_option_low,1))) =&apos;I&apos;
and upper(:p_risk_option) != &apos;NONE&apos;
and ps.customer_id=hca.cust_account_id(+)
and hca.party_id=hp.party_id(+)
and ps.cash_receipt_id=cr.cash_receipt_id
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
and cr.cash_receipt_id=crh.cash_receipt_id
and crh.account_code_combination_id=c.code_combination_id
and ps.customer_site_use_id=site.site_use_id(+)
and site.cust_acct_site_id=acct_site.cust_acct_site_id(+)
and acct_site.party_site_id=party_site.party_site_id(+)
and loc.location_id(+)=party_site.location_id
and decode(upper(:p_in_currency), null, ps.invoice_currency_code, upper(:p_in_currency))=ps.invoice_currency_code
and (crh.current_record_flag=&apos;Y&apos; or crh.reversal_gl_date &gt; :p_in_as_of_date_low )
and crh.status not in (decode(crh.factor_flag,&apos;Y&apos;,&apos;RISK_ELIMINATED&apos;,&apos;N&apos;,&apos;CLEARED&apos;),&apos;REVERSED&apos;)
and not exists (select &apos;x&apos;
from ar_receivable_applications ra
where ra.cash_receipt_id=cr.cash_receipt_id
and ra.status=&apos;ACTIVITY&apos;
and applied_payment_schedule_id=-2)
and cr.cash_receipt_id not in
(select ps.reversed_cash_receipt_id
from ar_payment_schedules ps
where ps.reversed_cash_receipt_id=cr.cash_receipt_id
and ps.class=&apos;DM&apos;
and ps.gl_date&lt;= (:p_in_as_of_date_low))
and gsob.set_of_books_id=cr.set_of_books_id
&amp;lp_bal_seg_low
&amp;lp_bal_seg_high
&amp;lp_acc_seg_low
&amp;lp_acc_seg_high
and ps.cons_inv_id=ci.cons_inv_id(+)
and sales.salesrep_id=-3
and sales.org_id=ps.org_id
and jrrev.resource_id=sales.resource_id
and crh.org_id=ps.org_id
and cr.org_id=ps.org_id
and site.org_id (+)=ps.org_id
and 2=2
union all
select
substrb(hp.party_name,1,50) cust_name,
hca.account_number cust_no,
nvl(sales.name,jrrev.resource_name) sort_field1,
arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id) sort_field2,
nvl(sales.salesrep_id, -3)salesrep_id,
rt.name term,
site.site_use_id contact_site_id,
loc.state cust_state,
loc.city cust_city,
(select ftv.territory_short_name from fnd_territories_vl ftv where ftv.territory_code=loc.country) cust_country,
xxen_util.meaning(hca.customer_class_code,&apos;CUSTOMER CLASS&apos;,222) cust_class,
decode(decode(upper(rtrim(rpad(:p_in_format_option_low, 1))),&apos;D&apos;,&apos;D&apos;,null),null,-1,acct_site.cust_acct_site_id) addr_id,
nvl(hca.cust_account_id,-999) cust_id,
hca.party_id,
--
&amp;party_dff_cols3
&amp;cust_dff_cols3
--
ps.payment_schedule_id payment_sched_id,
ps.class class,
ps.trx_date,
ps.due_date,
decode(nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, ps.amount_due_original * nvl(ps.exchange_rate, 1), ps.amount_due_original) amt_due_original,
xxen_ar_arxagrw_pkg.comp_amt_due_remainingformula
( ps.class,
arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id),
ps.payment_schedule_id,
decode( nvl2(:p_in_currency,&apos;N&apos;,&apos;Y&apos;), &apos;Y&apos;, ps.acctd_amount_due_remaining,ps.amount_due_remaining), -- amount due remaining
ps.amount_applied,
ps.amount_credited,
ps.amount_adjusted
)amt_due_remaining,
ps.trx_number invnum,
ceil(:p_in_as_of_date_low - ps.trx_date) days_past_trx,
ceil(:p_in_as_of_date_low - ps.due_date) days_past_due,
ps.amount_adjusted amount_adjusted,
ps.amount_applied amount_applied,
ps.amount_credited amount_credited,
ps.gl_date gl_date,
decode(ps.invoice_currency_code, gsob.currency_code, null, decode(ps.exchange_rate, null, &apos;*&apos;, null)) data_converted,
nvl(ps.exchange_rate, 1) ps_exchange_rate,
--
&amp;lp_bucket_cols3
--
c.code_combination_id,
c.chart_of_accounts_id,
ci.cons_billing_number cons_billing_number,
arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id) invoice_type,
ct.comments,
ct.ct_reference reference,
ps.invoice_currency_code,
gsob.currency_code functional_currency,
gsob.name ledger,
gsob.set_of_books_id ledger_id,
ps.org_id,
to_number(null) rec_acctd_amount,
ps.customer_trx_id,
&apos;TRANSACTIONS&apos; sla_entity_code,
ps.customer_trx_id sla_source_id,
ps.amount_due_original/nvl(
(select sum(ps2.amount_due_original) 
from ar_payment_schedules ps2 
where ps2.customer_trx_id=ps.customer_trx_id 
and ps2.class&lt;&gt;&apos;PMT&apos;), 0) installment_ratio
from
hz_cust_accounts hca,
hz_parties hp,
ar_payment_schedules ps,
ar_cons_inv ci,
ra_salesreps_all sales,
jtf_rs_resource_extns_vl jrrev,
hz_cust_site_uses site,
hz_cust_acct_sites acct_site,
hz_party_sites party_site,
hz_locations loc,
ar_transaction_history th,
ar_distributions dist,
gl_code_combinations c,
ra_customer_trx ct,
ra_terms rt,
gl_sets_of_books gsob
where
ps.gl_date &lt;= :p_in_as_of_date_low
 --and upper(RTRIM(RPAD(:p_in_summary_option_low,1)) )=&apos;I&apos;
and ps.customer_site_use_id=site.site_use_id
and xxen_ar_arxagrw_pkg.include_org_id(ps.org_id)=&apos;Y&apos;
and site.cust_acct_site_id=acct_site.cust_acct_site_id
and acct_site.party_site_id =party_site.party_site_id
and loc.location_id=party_site.location_id
and ps.gl_date_closed  &gt; :p_in_as_of_date_low
and ps.class=&apos;BR&apos;
and decode(upper(:p_in_currency),null, ps.invoice_currency_code, upper(:p_in_currency))=ps.invoice_currency_code
and hca.party_id=hp.party_id
and th.transaction_history_id =
(select max(transaction_history_id)
from ar_transaction_history th2,
ar_distributions  dist2
where th2.transaction_history_id=dist2.source_id
and dist2.source_table=&apos;TH&apos;
and th2.gl_date &lt;= :p_in_as_of_date_low
and dist2.amount_dr is not null
and th2.customer_trx_id=ps.customer_trx_id)
and th.transaction_history_id=dist.source_id
and dist.source_table=&apos;TH&apos;
and dist.amount_dr is not null
and dist.source_table_secondary is null
and dist.code_combination_id=c.code_combination_id
and gsob.set_of_books_id=ct.set_of_books_id
&amp;lp_invoice_type_low
&amp;lp_invoice_type_high
&amp;lp_bal_seg_low
&amp;lp_bal_seg_high
&amp;lp_acc_seg_low
&amp;lp_acc_seg_high
and ps.cons_inv_id=ci.cons_inv_id(+)
and ps.customer_id=hca.cust_account_id
and ps.customer_trx_id=ct.customer_trx_id
and ct.customer_trx_id=th.customer_trx_id
and nvl(ct.primary_salesrep_id,-3)=sales.salesrep_id
and sales.org_id=ct.org_id
and jrrev.resource_id=sales.resource_id
and ct.org_id=ps.org_id
and site.org_id=ps.org_id
and ps.term_id=rt.term_id (+)
and :p_br_enabled=&apos;Y&apos;
and 2=2
) x, --X
hz_customer_profiles hcpa,
hz_customer_profiles hcps,
(select 
hcpam.cust_account_profile_id,
listagg(hcpam.currency_code||&apos;=&apos;||to_char(hcpam.overall_credit_limit),&apos;,&apos;) within group (order by hcpam.currency_code) as credit_limits,
listagg(hcpam.currency_code||&apos;=&apos;||to_char(hcpam.trx_credit_limit),&apos;,&apos;) within group (order by hcpam.currency_code) as order_credit_limits
from
hz_cust_profile_amts hcpam
where
hcpam.overall_credit_limit is not null or hcpam.trx_credit_limit is not null
group by 
hcpam.cust_account_profile_id 
) hcpamv,
(
select /*+ no_merge */
sla_inner.ledger_id,
sla_inner.entity_code,
sla_inner.source_id,
sla_inner.code_combination_id,
sla_inner.accounted_dr,
sla_inner.accounted_cr,
sla_inner.accounting_date
from
(
select /*+ full(xah) use_hash(xte xah xal) */
xte.ledger_id,
xte.entity_code,
xte.source_id_int_1 source_id,
xal.code_combination_id,
sum(nvl(xal.accounted_dr,0)) accounted_dr,
sum(nvl(xal.accounted_cr,0)) accounted_cr,
max(xah.accounting_date) accounting_date
from
xla_ae_headers xah,
xla_ae_lines xal,
xla_transaction_entities xte
where
:p_show_sla=&apos;Y&apos; and
xte.entity_code in (&apos;TRANSACTIONS&apos;,&apos;RECEIPTS&apos;) and
xte.application_id=xah.application_id and
xte.entity_id=xah.entity_id and
xah.ae_header_id=xal.ae_header_id and
xah.application_id=xal.application_id and
xal.application_id=222 and
xah.application_id=222 and
xal.accounting_class_code in (&apos;RECEIVABLE&apos;,&apos;UNAPP&apos;,&apos;BILLS_RECEIVABLE&apos;) and
xah.accounting_date&lt;=:p_in_as_of_date_low and
xah.ledger_id=xte.ledger_id and
exists (
select null
from
gl_code_combinations gcc,
gl_ledgers gl
where
gcc.code_combination_id=xal.code_combination_id and
gl.ledger_id=xte.ledger_id and
gcc.chart_of_accounts_id=gl.chart_of_accounts_id
)
group by
xte.ledger_id,
xte.entity_code,
xte.source_id_int_1,
xal.code_combination_id
) sla_inner
) sla,
-- SLA net: original receivable minus all applications/adjustments as of reporting date
(select
sn.customer_trx_id,
sum(nvl(sn.acctd_amount_dr,0)) net_accounted_dr,
sum(nvl(sn.acctd_amount_cr,0)) net_accounted_cr
from
(
-- Original receivable from ra_cust_trx_line_gl_dist
select
gld.customer_trx_id,
case when gld.acctd_amount&gt;=0 then gld.acctd_amount end acctd_amount_dr,
case when gld.acctd_amount&lt;0 then abs(gld.acctd_amount) end acctd_amount_cr
from
ra_cust_trx_line_gl_dist gld
where
:p_show_sla=&apos;Y&apos; and
gld.account_class=&apos;REC&apos; and
gld.latest_rec_flag=&apos;Y&apos; and
gld.gl_date &lt;= :p_in_as_of_date_low
union all
-- Cash/misc application credits to invoice receivable (via ar_distributions to avoid picking up internal application rows e.g. OKS service contracts)
select /*+ use_nl(ard) index(ard AR_DISTRIBUTIONS_N1) */
ara.applied_customer_trx_id customer_trx_id,
ard.acctd_amount_dr,
ard.acctd_amount_cr
from
ar_distributions ard,
ar_receivable_applications ara
where
:p_show_sla=&apos;Y&apos; and
ard.source_table=&apos;RA&apos; and
ard.source_type=&apos;REC&apos; and
ard.source_id=ara.receivable_application_id and
ara.applied_customer_trx_id is not null and
ara.reversal_gl_date is null and
ara.gl_date &lt;= :p_in_as_of_date_low
union all
-- CM side: DR to CM receivable when CM is applied to invoice
select
ara.customer_trx_id,
abs(nvl(ara.acctd_amount_applied_from,nvl(ara.amount_applied_from,ara.amount_applied))) acctd_amount_dr,
null acctd_amount_cr
from
ar_receivable_applications ara
where
:p_show_sla=&apos;Y&apos; and
ara.status=&apos;APP&apos; and
ara.application_type=&apos;CM&apos; and
ara.customer_trx_id is not null and
ara.reversal_gl_date is null and
ara.gl_date &lt;= :p_in_as_of_date_low
union all
-- CM application credit to invoice receivable
select
ara.applied_customer_trx_id customer_trx_id,
null acctd_amount_dr,
nvl(ara.acctd_amount_applied_to,ara.acctd_amount_applied_from) acctd_amount_cr
from
ar_receivable_applications ara
where
:p_show_sla=&apos;Y&apos; and
ara.status=&apos;APP&apos; and
ara.application_type=&apos;CM&apos; and
ara.applied_customer_trx_id is not null and
ara.reversal_gl_date is null and
ara.gl_date &lt;= :p_in_as_of_date_low
union all
-- Adjustment distributions
select /*+ use_nl(ard) index(ard AR_DISTRIBUTIONS_N1) */
adj.customer_trx_id,
ard.acctd_amount_dr,
ard.acctd_amount_cr
from
ar_distributions ard,
ar_adjustments adj
where
:p_show_sla=&apos;Y&apos; and
ard.source_table=&apos;ADJ&apos; and
ard.source_type=&apos;REC&apos; and
ard.source_id=adj.adjustment_id and
adj.gl_date &lt;= :p_in_as_of_date_low and
adj.status=&apos;A&apos;
) sn
where
sn.customer_trx_id is not null
group by
sn.customer_trx_id
) sla_net
where
hcpa.cust_account_id(+)=x.cust_id and
hcpa.site_use_id(+) is null and
hcps.cust_account_id(+)=x.cust_id and
hcps.site_use_id(+)=x.site_use_id and
hcpa.cust_account_profile_id=hcpamv.cust_account_profile_id(+)and
nvl(x.amt_due_remaining,0) != 0 and
x.ledger_id=sla.ledger_id(+) and 
x.sla_entity_code=sla.entity_code(+) and
x.sla_source_id=sla.source_id(+) and
decode(x.sla_entity_code,&apos;TRANSACTIONS&apos;,x.sla_source_id)=sla_net.customer_trx_id(+)
) x1 --x1
where
1=1
group by
x1.ledger,
x1.operating_unit,
x1.code_combination_id,
x1.chart_of_accounts_id,
x1.sort_field1,
x1.cust_name,
x1.cust_no,
x1.cust_country,
x1.cust_class,
x1.credit_limits,
x1.order_credit_limits,
--
&amp;party_dff_cols1_g
&amp;cust_dff_cols1_g
--
x1.collector,
x1.revaluation_from_currency,
x1.rec_code_combination_id,
x1.reval_conv_rate
&amp;lp_invoice_cols_g
order by
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;),
x1.sort_field1,
x1.cust_name,
x1.cust_no
&amp;lp_invoice_cols_g</SQL_TEXT>
  <VERSION_COMMENTS>Fixed sla_net: restored ar_distributions RA/REC for cash credits (ara-based approach incorrectly picked up internal OKS service contract application rows causing sla_net=0 for 728 open OKS invoices); fixed CM DR branch fallback to use amount_applied when acctd_amount_applied_from and amount_applied_from are both null (fixes applied CMs showing full credit instead of 0).</VERSION_COMMENTS>
  <ENABLED>Y</ENABLED>
  <NUMBER_FORMAT>#,##0.00;[Red]-#,##0.00</NUMBER_FORMAT>
  <DB_PACKAGE>XXEN_AR_ARXAGRW_PKG</DB_PACKAGE>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Application: المقبوضات
Source: تقرير التقادم - 7 رزم حسب مندوب المبيعات/الوكيل
Short Name: ARXAGRW</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Application: Debitoren
Source: Fälligkeiten - Schema 7 - nach Vertriebsmitarbeiter/Vertriebsbeauftragtem
Short Name: ARXAGRW</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Aplicación: Cuentas por cobrar
Fuente: Envejecimiento - 7 cubos - Informe por vendedor/agente
Nombre corto: ARXAGRW
Paquete: XXEN_AR_ARXAGRW_PKG</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Application: Receivables
Source: Balance âgée par vendeur/agent - 7 catégories
Short Name: ARXAGRW</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Application: Receivables
Source: Rapporto Scadenzario - 7 periodi fissi - per rappresentante commerciale/agente
Short Name: ARXAGRW</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>申請書を提出する。売掛債権
出典はこちらです。エイジング～7つのバケツ～営業マン・エージェント別レポート
ショートネーム.ARXAGRW
パッケージXXEN_AR_ARXAGRW_PKG</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>신청 : AR
출처 : 노화-7 개 버킷-영업 사원 / 상담원 별 보고서
짧은 이름 : ARXAGRW
패키지 : XXEN_AR_ARXAGRW_PKG</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Aplicação: Contas a receber
Fonte: Envelhecimento - 7 baldes - Por Relatório do vendedor/agente
Nome curto: ARXAGRW
Pacote: XXEN_AR_ARXAGRW_PKG</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Приложение: Дебиторская задолженность
Источник: Старение - 7 ведер - по данным продавца/агента
Короткое имя: ARXAGRW
Пакет: XXEN_AR_ARXAGRW_PKG</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Ansökan: Fordringar
Källa: Åldrande - 7 skopor - Av säljare / agentrapport
Kort namn: ARXAGRW
Paket: XXEN_AR_ARXAGRW_PKG</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Uygulama: Alacaklar
Kaynak: Yaşlanma - 7 Kova - Satış Görevlisi / Temsilci Raporuna Göre
Kısa isim: ARXAGRW
Paket: XXEN_AR_ARXAGRW_PKG</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>The AR Aging report allows users to review information about their open receivables items at a specified point in time (the As of Date). The report will show the aging of the open receivables items based on the selected aging bucket.

- The report includes detailed (Transaction Level) or summary (Customer Level) information about customers current and past due invoices, debit memos, and chargebacks.
- Optionally the report can include details of credit memos, on-account credits, unidentified payments, on-account and unapplied cash amounts, and receipts at risk.
- Optionally the report allows the open receivables items to be revalued to a different currency on a specified revaluation date using a specified revaluation currency rate type.
- All amounts in the report are shown in functional currency, except where the report is run for a specified entered currency, in which case the amounts are shown in the specified entered currency.

Report Parameters:

Reporting Level: The report can be run by Ledger or by Operating Unit. 

Reporting Context: The Ledgers or Operating Units the report is to be run for. Only Ledgers or Operating Units accessible to the current responsibility maybe selected. The report supports the multiple selection of Ledgers or Operating Units allowing to be run for more than one Ledger or Operating Unit. If the Reporting Context is left null, then the report will be run for all Operating Units accessible to the current responsibility. 

Report Summary: The report is summarized at either the Customer Level (Customer Summary) or at Transaction Level (Invoice Summary). The Customer Summary report includes open receivables totals at the customer level only and does not include transaction level details. The Invoice Summary report includes details and the outstanding amounts of the open receivables transactions.

As of Date: The report can be run to provide an aging snapshot at a specified point in time in the past. By default, the As of Date will be the current date. 

Aging Bucket Name:  The Aging Bucket Name determine the Aging Buckets to be used for aging the open receivables items. The aging amount columns in the report are dynamically determined based on the selected Aging Buket. 

Aging Basis: Transactions can be aged based on their Due Date (default) or on their Transaction (Invoice) Date.

Show On Account: The report can optionally include the details and/or amounts for credit memos, on-account credits, unidentified payments, on-account and unapplied cash amounts.
The options for displaying these are:
Do Not Show – they are not included in the report.
Summarize – the amounts are shown as separate columns in the report and are not included in the Aging Amount report columns.
Age – the amounts are included in the Aging Amount report columns.

Show Receipts At Risk: The report can optionally include the details and/or amounts for receipts at risk.
Do Not Show – they are not included in the report.
Summarize – the amounts are shown as separate a column in the report and are not included in the Aging Amount report columns.
Age – the amounts are included in the Aging Amount report columns.

Entered Currency: Restrict the report to open receivables items entered in the specified currency. By default, all amounts in the report are shown in functional currency, except in the case the report is run in for a specified Entered Currency. In this case the amounts are shown in the specified entered currency. 

Revaluation Date, Revaluation Currency, Revaluation Rate Type: 
If a revaluation date, currency, and rate type are specified, the report will include additional columns showing the open receivables amounts and aging in the specified revaluation currency.

Additionally, there are several additional parameters which can be used to restrict the data returned by the report.

Show SLA Accounting: Set to Yes to fetch SLA receivable accounting details for each transaction.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <REPORT_NAME>AR Aging</REPORT_NAME>
    <DESCRIPTION>Application: 应收帐款
Source: 帐龄 - 7 时段 - 按销售人员/代理商报表
Short Name: ARXAGRW</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>GST Reports</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>R12 only</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;cust_dff_cols1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;cust_dff_cols1_g</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;cust_dff_cols2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;cust_dff_cols3</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;cust_dff_cols3_g</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_acc_seg_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_acc_seg_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_acc_seg_p</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_aging_amount_cols</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_aging_pct_cols</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_bal_seg_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_bal_seg_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_bal_seg_p</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_bucket_cols1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_bucket_cols2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_bucket_cols3</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_bucket_cols4</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_invoice_cols_g</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_invoice_cols_s</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_invoice_type_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_invoice_type_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_on_acc_summ_cols</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_reval_aging_amount_cols</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_reval_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;lp_sla_sel_outer</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;party_dff_cols1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;party_dff_cols1_g</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;party_dff_cols2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;party_dff_cols3</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;party_dff_cols3_g</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:g_bucket_category</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:lp_org_id_in_list</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_age_basis</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_br_enabled</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_coaid</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_conc_request_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_credit_option</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_credit_option_dsp</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_amt_due_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_amt_due_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_as_of_date_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_bal_segment_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_bal_segment_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_bucket_type_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_collector_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_collector_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_currency</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_customer_name_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_customer_name_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_customer_num_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_customer_num_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_format_option_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_invoice_type_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_invoice_type_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_salesrep_name_high</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_salesrep_name_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_sortoption</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_in_summary_option_low</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_min_precision</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_payment_meaning</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_rep_type</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_reporting_entity_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_reporting_entity_name</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_reporting_level</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_reporting_level_name</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_ROW>
    <ANCHOR>:p_risk_meaning</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_risk_option</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_short_unid_phrase</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_show_sla</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>-90</DISPLAY_SEQUENCE>
    <ANCHOR>:p_coaid</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
gsob.chart_of_accounts_id
from
gl_sets_of_books gsob,
ar_system_parameters asp,
hr_all_organization_units haou
where
gsob.set_of_books_id=asp.set_of_books_id and
asp.org_id=haou.organization_id and
(
:$flex$.reporting_context is null or
:$flex$.reporting_level=&apos;1000&apos; and xxen_util.contains(:$flex$.reporting_context,gsob.name)=&apos;Y&apos; or
:$flex$.reporting_level=&apos;3000&apos; and xxen_util.contains(:$flex$.reporting_context,haou.name)=&apos;Y&apos;
) and
rownum=1</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Chart of Accounts Id</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>-80</DISPLAY_SEQUENCE>
    <ANCHOR>:p_rep_type</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select lookup_code from ar_lookups where lookup_type = &apos;AR_AGING_TYPE&apos; and lookup_code=&apos;ARXAGR&apos;</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>-70</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_sortoption</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_ARXAGR_SORT_BY</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
ar_lookups
where lookup_type=&apos;SORT_BY_ARXAGR&apos;
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>Salesperson</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Order By</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>-60</DISPLAY_SEQUENCE>
    <ANCHOR>:p_payment_meaning</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select rtrim(rpad(ARPT_SQL_FUNC_UTIL.get_lookup_meaning(&apos;INV/CM/ADJ&apos;,&apos;PMT&apos;),20))
from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Payment Meaning</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>-50</DISPLAY_SEQUENCE>
    <ANCHOR>:p_risk_meaning</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select rtrim(rpad(ARPT_SQL_FUNC_UTIL.get_lookup_meaning(&apos;MISC_PHRASES&apos;,&apos;RISK&apos;),20))
from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Risk Meaning</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>-40</DISPLAY_SEQUENCE>
    <ANCHOR>:p_short_unid_phrase</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select rtrim(rpad(ARPT_SQL_FUNC_UTIL.get_lookup_meaning(&apos;MISC_PHRASES&apos;,&apos;UNIDENTIFIED_PAYMENT&apos;),18))
from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Unidentified Meaning</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>-30</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_format_option_low</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_REPORT_FORMAT</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
l.lookup_code id,
l.meaning value,
null description
from
ar_lookups l
where l.lookup_type=&apos;REPORT_FORMAT&apos;
and l.enabled_flag=&apos;Y&apos;
and sysdate between nvl(l.start_date_active,sysdate)
and nvl(l.end_date_active,sysdate)
order by l.meaning,l.lookup_code
</LOV_QUERY_DSP>
    <DEFAULT_VALUE>D</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Format</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>-20</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;lp_bal_seg_p</ANCHOR>
    <SQL_TEXT>&lt;parameter_value&gt;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select nvl(
(
select fifsv.form_left_prompt
  from   fnd_segment_attribute_values fsav
     ,   fnd_id_flex_segments_vl      fifsv
  where  fsav.application_id    = 101
  and    fsav.id_flex_code      = &apos;GL#&apos;
  and    fsav.segment_attribute_type = &apos;GL_BALANCING&apos;
  and    fsav.id_flex_num       =
          (
            select distinct case when count(distinct gsob.chart_of_accounts_id) over () = 1 then gsob.chart_of_accounts_id else null end
            from gl_sets_of_books gsob
            where :$flex$.reporting_level  = &apos;1000&apos;
            and   :$flex$.reporting_context is not null
            and   xxen_util.contains(:$flex$.reporting_context,gsob.name) = &apos;Y&apos;
            union
            select distinct case when count(distinct gsob.chart_of_accounts_id) over () = 1 then gsob.chart_of_accounts_id else null end
            from gl_sets_of_books gsob
            ,    ar_system_parameters aps
            ,    hr_all_organization_units haou
            where gsob.set_of_books_id = aps.set_of_books_id
            and   haou.organization_id = aps.set_of_books_id
            and   :$flex$.reporting_level  = &apos;3000&apos;
            and   :$flex$.reporting_context is not null
            and   xxen_util.contains(:$flex$.reporting_context,haou.name) = &apos;Y&apos;
            union
            select distinct case when count(distinct gsob.chart_of_accounts_id) over () = 1 then gsob.chart_of_accounts_id else null end
            from gl_sets_of_books gsob
            ,    ar_system_parameters aps
            where gsob.set_of_books_id = aps.set_of_books_id
            and  :$flex$.reporting_context is null
          )
  and    fsav.attribute_value   = &apos;Y&apos;
  and    fifsv.application_id   = fsav.application_id
  and    fifsv.id_flex_code     = fsav.id_flex_code
  and    fifsv.id_flex_num      = fsav.id_flex_num
  and    fifsv.application_column_name = fsav.application_column_name
),
&apos;Balancing Segment&apos;)
from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Balancing Segment Label</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>-10</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;lp_acc_seg_p</ANCHOR>
    <SQL_TEXT>&lt;parameter_value&gt;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select nvl(
(
select fifsv.form_left_prompt
  from   fnd_segment_attribute_values fsav
     ,   fnd_id_flex_segments_vl      fifsv
  where  fsav.application_id    = 101
  and    fsav.id_flex_code      = &apos;GL#&apos;
  and    fsav.segment_attribute_type = &apos;GL_ACCOUNT&apos;
  and    fsav.id_flex_num       =
          (
            select distinct case when count(distinct gsob.chart_of_accounts_id) over () = 1 then gsob.chart_of_accounts_id else null end
            from gl_sets_of_books gsob
            where :$flex$.reporting_level  = &apos;1000&apos;
            and   :$flex$.reporting_context is not null
            and   xxen_util.contains(:$flex$.reporting_context,gsob.name) = &apos;Y&apos;
            union
            select distinct case when count(distinct gsob.chart_of_accounts_id) over () = 1 then gsob.chart_of_accounts_id else null end
            from gl_sets_of_books gsob
            ,    ar_system_parameters aps
            ,    hr_all_organization_units haou
            where gsob.set_of_books_id = aps.set_of_books_id
            and   haou.organization_id = aps.set_of_books_id
            and   :$flex$.reporting_level  = &apos;3000&apos;
            and   :$flex$.reporting_context is not null
            and   xxen_util.contains(:$flex$.reporting_context,haou.name) = &apos;Y&apos;
            union
            select distinct case when count(distinct gsob.chart_of_accounts_id) over () = 1 then gsob.chart_of_accounts_id else null end
            from gl_sets_of_books gsob
            ,    ar_system_parameters aps
            where gsob.set_of_books_id = aps.set_of_books_id
            and  :$flex$.reporting_context is null
          )
  and    fsav.attribute_value   = &apos;Y&apos;
  and    fifsv.application_id   = fsav.application_id
  and    fifsv.id_flex_code     = fsav.id_flex_code
  and    fifsv.id_flex_num      = fsav.id_flex_num
  and    fifsv.application_column_name = fsav.application_column_name
),
&apos;Account&apos;)
from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Account Segment Label</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>:p_reporting_level</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>FND_MO_REPORTING_LEVEL</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 lookup_type=&apos;FND_MO_REPORTING_LEVEL&apos;
and lookup_code in (1000,3000)
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>1000</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Reporting Level</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>11</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>x1.reporting_entity=:p_reporting_entity_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
entity_name value,
null description
from
fnd_mo_reporting_entities_v
where 
reporting_level=:$flex$.fnd_mo_reporting_level and
(
:$flex$.fnd_mo_reporting_level=&apos;1000&apos; and ledger_category_code=&apos;PRIMARY&apos; or 
:$flex$.fnd_mo_reporting_level=&apos;3000&apos;
) 
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>SELECT entity_name FROM FND_MO_REPORTING_ENTITIES_V WHERE reporting_level = :$flex$.fnd_mo_reporting_level and rownum=1</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Reporting Context</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>12</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_summary_option_low</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_TYPE_OF_REPORT</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
l.lookup_code id,
l.meaning value,
null description
from
ar_lookups l
where l.lookup_type=&apos;REPORT_TYPE&apos;
and l.enabled_flag=&apos;Y&apos;
and sysdate between nvl(l.start_date_active,sysdate)
and nvl(l.end_date_active,sysdate)
order by l.meaning,l.lookup_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>I</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Summary</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>13</SORT_ORDER>
    <ANCHOR>&amp;lp_invoice_cols_g</ANCHOR>
    <SQL_TEXT>,decode(x1.cons_billing_number,null,x1.invnum,x1.cons_billing_number || &apos;&apos;/&apos;&apos; || x1.invnum),
 x1.invoice_type, 
x1.invoice_currency_code,
x1.term,
x1.comments,
trunc(x1.trx_date),
x1.due_date,
x1.days_past_trx,
x1.days_past_due
</SQL_TEXT>
    <MATCHING_VALUE>I</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Summary</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>14</SORT_ORDER>
    <ANCHOR>&amp;lp_invoice_cols_s</ANCHOR>
    <SQL_TEXT>decode(x1.cons_billing_number,null,x1.invnum,x1.cons_billing_number || &apos;&apos;/&apos;&apos; || x1.invnum) &quot;Billing/Invoice Number&quot;, 
x1.invoice_type &quot;Type&quot;, 
x1.invoice_currency_code &quot;Invoice Currency&quot;,
x1.term,
x1.comments,
trunc(x1.trx_date) &quot;Invoice Date&quot;,
x1.due_date &quot;Due Date&quot;,
x1.days_past_trx &quot;Days Past Invoice Date&quot;,
x1.days_past_due &quot;Days Past Due Date&quot;,</SQL_TEXT>
    <MATCHING_VALUE>I</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Summary</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>15</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_as_of_date_low</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>sysdate</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>As Of Date</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>16</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_bucket_type_low</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
bucket_name value,
xxen_util.meaning(aging_type,&apos;AGING_BUCKETS_TYPE&apos;,222) description,
aging_type
from
ar_aging_buckets
where
status=&apos;A&apos;
order by
bucket_name
</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select distinct
first_value(bucket_name) over (order by aging_bucket_id desc range between unbounded preceding and unbounded following)
from
ar_aging_buckets
where upper(aging_type)=&apos;7BUCKET&apos;
and status=&apos;A&apos;</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>17</SORT_ORDER>
    <ANCHOR>&amp;lp_aging_amount_cols</ANCHOR>
    <SQL_TEXT>select
 &apos;sum(case when nvl(x1.rk,1)=1 then decode(x1.b&apos; || to_char(l.seq) || &apos;,1,x1.amt_due_remaining,null) end) &quot;&apos; || replace(XXEN_AR_ARXAGRW_PKG.bucket_title(:p_in_bucket_type_low,l.seq),&apos;Due&apos;,decode(:p_age_basis,&apos;Due Date&apos;,&apos;Due&apos;,&apos;Inv&apos;)) || &apos;&quot;,&apos;
from (
select
rownum-1 seq,
l.*
from ar_aging_bucket_lines l,
ar_aging_buckets b
where
l.aging_bucket_id = b.aging_bucket_id and
upper(b.bucket_name) = upper(:p_in_bucket_type_low) and
nvl(b.status,&apos;A&apos;) = &apos;A&apos;
order by
l.bucket_sequence_num
) l
order by
l.seq</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>18</SORT_ORDER>
    <ANCHOR>&amp;lp_aging_pct_cols</ANCHOR>
    <SQL_TEXT>select
&apos;case nvl(sum(case when nvl(x1.rk,1)=1 then x1.amt_due_remaining end),0) when 0 then to_number(null) else round(sum(case when nvl(x1.rk,1)=1 then decode(x1.b&apos; || to_char(l.seq) || &apos;,1,x1.amt_due_remaining,null) end) / sum(case when nvl(x1.rk,1)=1 then x1.amt_due_remaining end) * 100,2) end &quot;&apos; || substrb(replace(XXEN_AR_ARXAGRW_PKG.bucket_title(:p_in_bucket_type_low,l.seq),&apos;Due&apos;,decode(:p_age_basis,&apos;Due Date&apos;,&apos;Due&apos;,&apos;Inv&apos;)),1,xxen_report.max_column_length-2) || &apos; %&quot;,&apos;
from (
select
rownum-1 seq,
l.*
from ar_aging_bucket_lines l,
ar_aging_buckets b
where
l.aging_bucket_id = b.aging_bucket_id and
upper(b.bucket_name) = upper(:p_in_bucket_type_low) and
nvl(b.status,&apos;A&apos;) = &apos;A&apos;
order by
l.bucket_sequence_num
) l
order by
l.seq</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>19</SORT_ORDER>
    <ANCHOR>&amp;lp_bucket_cols1</ANCHOR>
    <SQL_TEXT>select
 &apos;   x.b&apos; || to_char(l.seq) || &apos;,&apos;
from (
select
rownum-1 seq,
l.*
from ar_aging_bucket_lines l,
ar_aging_buckets b
where
l.aging_bucket_id = b.aging_bucket_id and
upper(b.bucket_name) = upper(:p_in_bucket_type_low) and
nvl(b.status,&apos;A&apos;) = &apos;A&apos;
order by
l.bucket_sequence_num
) l
order by
l.seq</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>20</SORT_ORDER>
    <ANCHOR>&amp;lp_bucket_cols2</ANCHOR>
    <SQL_TEXT>select
&apos;     case when xxen_ar_arxagrw_pkg.bucket_line_type(&apos; || to_char(l.seq) || &apos;) is not null
     then
       arpt_sql_func_util.bucket_function
        ( xxen_ar_arxagrw_pkg.bucket_line_type(&apos; || to_char(l.seq) || &apos;),
          dh.amount_in_dispute,
          ps.amount_adjusted_pending,
          xxen_ar_arxagrw_pkg.bucket_days_from(&apos; || to_char(l.seq) || &apos;),
          xxen_ar_arxagrw_pkg.bucket_days_to(&apos; || to_char(l.seq) || &apos;),
          decode(:p_age_basis,&apos;&apos;Due Date&apos;&apos;,ps.due_date,ps.trx_date),
          xxen_ar_arxagrw_pkg.bucket_category,
          :p_in_as_of_date_low
        ) 
     else to_number(null) end b&apos; || to_char(l.seq) || &apos;,&apos;
from (
select
rownum-1 seq,
l.*
from ar_aging_bucket_lines l,
ar_aging_buckets b
where
l.aging_bucket_id = b.aging_bucket_id and
upper(b.bucket_name) = upper(:p_in_bucket_type_low) and
nvl(b.status,&apos;A&apos;) = &apos;A&apos;
order by
l.bucket_sequence_num
) l
order by
l.seq</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>21</SORT_ORDER>
    <ANCHOR>&amp;lp_bucket_cols3</ANCHOR>
    <SQL_TEXT>select
&apos;     case when xxen_ar_arxagrw_pkg.bucket_line_type(&apos; || to_char(l.seq) || &apos;) is not null
     then
       arpt_sql_func_util.bucket_function
        ( xxen_ar_arxagrw_pkg.bucket_line_type(&apos; || to_char(l.seq) || &apos;),
          ps.amount_in_dispute,
          ps.amount_adjusted_pending,
          xxen_ar_arxagrw_pkg.bucket_days_from(&apos; || to_char(l.seq) || &apos;),
          xxen_ar_arxagrw_pkg.bucket_days_to(&apos; || to_char(l.seq) || &apos;),
          decode(:p_age_basis,&apos;&apos;Due Date&apos;&apos;,ps.due_date,ps.trx_date),
          xxen_ar_arxagrw_pkg.bucket_category,
          :p_in_as_of_date_low
        ) 
     else to_number(null) end b&apos; || to_char(l.seq) || &apos;,&apos;
from (
select
rownum-1 seq,
l.*
from ar_aging_bucket_lines l,
ar_aging_buckets b
where
l.aging_bucket_id = b.aging_bucket_id and
upper(b.bucket_name) = upper(:p_in_bucket_type_low) and
nvl(b.status,&apos;A&apos;) = &apos;A&apos;
order by
l.bucket_sequence_num
) l
order by
l.seq</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>22</SORT_ORDER>
    <ANCHOR>&amp;lp_bucket_cols4</ANCHOR>
    <SQL_TEXT>select
&apos;     case when xxen_ar_arxagrw_pkg.bucket_line_type(&apos; || to_char(l.seq) || &apos;) is not null
     then
       arpt_sql_func_util.bucket_function
        ( xxen_ar_arxagrw_pkg.bucket_line_type(&apos; || to_char(l.seq) || &apos;),
          0,
          0,
          xxen_ar_arxagrw_pkg.bucket_days_from(&apos; || to_char(l.seq) || &apos;),
          xxen_ar_arxagrw_pkg.bucket_days_to(&apos; || to_char(l.seq) || &apos;),
          decode(:p_age_basis,&apos;&apos;Due Date&apos;&apos;,ps.due_date,ps.trx_date),
          xxen_ar_arxagrw_pkg.bucket_category,
          :p_in_as_of_date_low
        ) 
     else to_number(null) end b&apos; || to_char(l.seq) || &apos;,&apos;
from (
select
rownum-1 seq,
l.*
from ar_aging_bucket_lines l,
ar_aging_buckets b
where
l.aging_bucket_id = b.aging_bucket_id and
upper(b.bucket_name) = upper(:p_in_bucket_type_low) and
nvl(b.status,&apos;A&apos;) = &apos;A&apos;
order by
l.bucket_sequence_num
) l
order by
l.seq</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Bucket Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>23</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>:p_age_basis</ANCHOR>
    <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 &apos;Due Date&apos; value,&apos;Age based on Invoice Due Date&apos; description from dual union
select &apos;Invoice Date&apos; value,&apos;Age based on Invoice Transaction Date&apos; description from dual 
) x
order by
value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>Due Date</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Aging Basis</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>24</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>:p_credit_option_dsp</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
l.meaning value,
l.description description
from
ar_lookups l
where l.lookup_type=&apos;OPEN_CREDITS&apos;
and l.enabled_flag=&apos;Y&apos;
and sysdate between nvl(l.start_date_active,sysdate)
and nvl(l.end_date_active,sysdate)
order by l.meaning</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select meaning
from ar_lookups
where lookup_type = &apos;OPEN_CREDITS&apos;
and lookup_code = &apos;SUMMARY&apos;</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show On Account</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>25</SORT_ORDER>
    <ANCHOR>&amp;lp_on_acc_summ_cols</ANCHOR>
    <SQL_TEXT> sum(case when nvl(x1.rk,1)=1 then x1.on_account_amount_cash end) customer_payments,
 sum(case when nvl(x1.rk,1)=1 then x1.on_account_amount_credit end) customer_credit_memos,
 sum(case when nvl(x1.rk,1)=1 then x1.on_account_amount_risk end) customer_receipts_at_risk,
 sum(case when nvl(x1.rk,1)=1 then x1.cust_amount_claim end) customer_claims,</SQL_TEXT>
    <MATCHING_VALUE>Summarize</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show On Account</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>26</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>:p_risk_option</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_SHOW_RISK</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
l.lookup_code id,
l.meaning value,
null description
from
ar_lookups l
where l.lookup_type=&apos;SHOW_RISK&apos;
order by l.meaning,l.lookup_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>NONE</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Receipts At Risk</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>27</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>nvl(sales.name,jrrev.resource_name) = :p_in_salesrep_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
nvl(rs.name,jrrev.resource_name) value,
null description
from
ra_salesreps rs,
ra_salesreps_all rsa,
jtf_rs_resource_extns_vl jrrev
where
rsa.salesrep_id = rs.salesrep_id and
rsa.org_id = rs.org_id and 
jrrev.resource_id = rsa.resource_id
order by nvl(rs.name,jrrev.resource_name)</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Salesrep Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>28</SORT_ORDER>
    <DISPLAY_SEQUENCE>100</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>nvl(sales.name,jrrev.resource_name) &gt;= :p_in_salesrep_name_low</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
nvl(rs.name,jrrev.resource_name) value,
null description
from
ra_salesreps rs,
ra_salesreps_all rsa,
jtf_rs_resource_extns_vl jrrev
where
rsa.salesrep_id = rs.salesrep_id and
rsa.org_id = rs.org_id and 
jrrev.resource_id = rsa.resource_id
order by nvl(rs.name,jrrev.resource_name) 
</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Salesrep Name Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>29</SORT_ORDER>
    <DISPLAY_SEQUENCE>110</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>nvl(sales.name,jrrev.resource_name) &lt;= :p_in_salesrep_name_high</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
nvl(rs.name,jrrev.resource_name) value,
null description
from
ra_salesreps rs,
ra_salesreps_all rsa,
jtf_rs_resource_extns_vl jrrev
where
rsa.salesrep_id = rs.salesrep_id and
rsa.org_id = rs.org_id and 
jrrev.resource_id = rsa.resource_id
order by nvl(rs.name,jrrev.resource_name) 
</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.salesrep_name_low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Salesrep Name High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>30</SORT_ORDER>
    <DISPLAY_SEQUENCE>120</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>hp.party_name = :p_in_customer_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_CUSTOMER_NAME_WIDE</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
party.party_name id,
party.party_name value,
null description
from
hz_cust_accounts cu,hz_parties party
where cu.party_id=party.party_id
and exists (select cas.cust_account_id from hz_cust_acct_sites cas
where cas.cust_account_id=cu.cust_account_id)
order by value,description</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>31</SORT_ORDER>
    <DISPLAY_SEQUENCE>130</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>hp.party_name &gt;= :p_in_customer_name_low</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_CUSTOMER_NAME_WIDE</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
party.party_name id,
party.party_name value,
null description
from
hz_cust_accounts cu,hz_parties party
where cu.party_id=party.party_id
and exists (select cas.cust_account_id from hz_cust_acct_sites cas
where cas.cust_account_id=cu.cust_account_id)
order by value,description</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Name Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>32</SORT_ORDER>
    <DISPLAY_SEQUENCE>140</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>hp.party_name &lt;= :p_in_customer_name_high</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_CUSTOMER_NAME_WIDE</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
party.party_name id,
party.party_name value,
null description
from
hz_cust_accounts cu,hz_parties party
where cu.party_id=party.party_id
and exists (select cas.cust_account_id from hz_cust_acct_sites cas
where cas.cust_account_id=cu.cust_account_id)
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.customer_name_low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Name High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>33</SORT_ORDER>
    <DISPLAY_SEQUENCE>150</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>hca.account_number = :p_in_customer_num</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_CUSTOMER_NUMBER</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
cust.account_number id,
cust.account_number value,
null description
from
hz_cust_accounts cust,hz_parties party
where cust.party_id=party.party_id
order by cust.account_number</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>34</SORT_ORDER>
    <DISPLAY_SEQUENCE>160</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>hca.account_number &gt;= :p_in_customer_num_low</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_CUSTOMER_NUMBER</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
cust.account_number id,
cust.account_number value,
null description
from
hz_cust_accounts cust,hz_parties party
where cust.party_id=party.party_id
order by cust.account_number</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Number Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>35</SORT_ORDER>
    <DISPLAY_SEQUENCE>170</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>hca.account_number &lt;= :p_in_customer_num_high</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_CUSTOMER_NUMBER</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
cust.account_number id,
cust.account_number value,
null description
from
hz_cust_accounts cust,hz_parties party
where cust.party_id=party.party_id
order by cust.account_number</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.customer_number_low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Number High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>36</SORT_ORDER>
    <DISPLAY_SEQUENCE>175</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>hca.customer_class_code=:p_cust_class</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select 
al.lookup_code id,
al.meaning value,
al.description
from
ar_lookups al
where 
al.lookup_type =  &apos;CUSTOMER CLASS&apos;
order by
value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Classification</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>37</SORT_ORDER>
    <DISPLAY_SEQUENCE>180</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_currency</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_SRS_CURRENCY</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
currency_code id,
currency_code value,
name description
from
fnd_currencies_vl
where currency_flag=&apos;Y&apos;
and enabled_flag in (&apos;Y&apos;,&apos;N&apos;)
order by currency_code</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Entered Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>38</SORT_ORDER>
    <DISPLAY_SEQUENCE>190</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_amt_due_low</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Balance Due Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>39</SORT_ORDER>
    <DISPLAY_SEQUENCE>200</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_amt_due_high</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>:$flex$.balance_due_low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Balance Due High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>40</SORT_ORDER>
    <DISPLAY_SEQUENCE>210</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_invoice_type_low</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_INVOICE_TYPE</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
name id,
name value,
null description
from
ra_cust_trx_types
order by name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Type Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>41</SORT_ORDER>
    <ANCHOR>&amp;lp_invoice_type_low</ANCHOR>
    <SQL_TEXT>and arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id) &gt;= :p_in_invoice_type_low</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Type Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>42</SORT_ORDER>
    <DISPLAY_SEQUENCE>220</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_invoice_type_high</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>AR_INVOICE_TYPE</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
name id,
name value,
null description
from
ra_cust_trx_types
order by name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.invoice_type_low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Type High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>43</SORT_ORDER>
    <ANCHOR>&amp;lp_invoice_type_high</ANCHOR>
    <SQL_TEXT>and arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id) &lt;= :p_in_invoice_type_high</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Invoice Type High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>44</SORT_ORDER>
    <DISPLAY_SEQUENCE>230</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_bal_segment_low</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Balancing</LOV_NAME>
    <LOV_GUID>F26C78167A214EFBE0530100007F336B</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ffvv.flex_value value,
ffvv.description||case when ffvv.enabled_flag=&apos;Y&apos; and sysdate between nvl(ffvv.start_date_active,sysdate) and nvl(ffvv.end_date_active,sysdate) then null else &apos; (inactive)&apos; end description
from
fnd_id_flex_segments_vl fifsgv,
fnd_flex_values_vl ffvv
where
gl_security_pkg.validate_segval(fifsgv.segment_num,null,ffvv.flex_value)=&apos;TRUE&apos; and
fifsgv.application_id=101 and
fifsgv.id_flex_code=&apos;GL#&apos; and
fifsgv.enabled_flag=&apos;Y&apos; and
(fifsgv.application_id, fifsgv.id_flex_code, fifsgv.id_flex_num, fifsgv.application_column_name) in (select fsav.application_id, fsav.id_flex_code, fsav.id_flex_num, fsav.application_column_name from fnd_segment_attribute_values fsav where fsav.segment_attribute_type=&apos;GL_BALANCING&apos; and fsav.attribute_value=&apos;Y&apos;) and
fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
(:$flex$.chart_of_accounts_id is not null or :$flex$.chart_of_accounts is not null or :$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null or :$flex$.book is not null) and
fifsgv.id_flex_num in (
select /*+ no_unnest*/ fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code=&apos;GL#&apos; and
(
fifsv.id_flex_num=:$flex$.chart_of_accounts_id or
xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos; or
(:$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null) and
fifsgv.id_flex_num in
(
select
gl.chart_of_accounts_id
from
gl_ledgers gl
where
(:$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$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$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
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(+))
)
) or
fifsgv.id_flex_num in (select fbc.accounting_flex_structure from fa_book_controls fbc where xxen_util.contains(:$flex$.book,fbc.book_type_code)=&apos;Y&apos;)
)
)
order by
ffvv.flex_value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Company Segment Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>45</SORT_ORDER>
    <ANCHOR>&amp;lp_bal_seg_low</ANCHOR>
    <SQL_TEXT>and fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, c.CHART_OF_ACCOUNTS_ID, NULL, c.CODE_COMBINATION_ID, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &gt;= :p_in_bal_segment_low</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Company Segment Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>46</SORT_ORDER>
    <DISPLAY_SEQUENCE>240</DISPLAY_SEQUENCE>
    <ANCHOR>:p_in_bal_segment_high</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Balancing</LOV_NAME>
    <LOV_GUID>F26C78167A214EFBE0530100007F336B</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ffvv.flex_value value,
ffvv.description||case when ffvv.enabled_flag=&apos;Y&apos; and sysdate between nvl(ffvv.start_date_active,sysdate) and nvl(ffvv.end_date_active,sysdate) then null else &apos; (inactive)&apos; end description
from
fnd_id_flex_segments_vl fifsgv,
fnd_flex_values_vl ffvv
where
gl_security_pkg.validate_segval(fifsgv.segment_num,null,ffvv.flex_value)=&apos;TRUE&apos; and
fifsgv.application_id=101 and
fifsgv.id_flex_code=&apos;GL#&apos; and
fifsgv.enabled_flag=&apos;Y&apos; and
(fifsgv.application_id, fifsgv.id_flex_code, fifsgv.id_flex_num, fifsgv.application_column_name) in (select fsav.application_id, fsav.id_flex_code, fsav.id_flex_num, fsav.application_column_name from fnd_segment_attribute_values fsav where fsav.segment_attribute_type=&apos;GL_BALANCING&apos; and fsav.attribute_value=&apos;Y&apos;) and
fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
(:$flex$.chart_of_accounts_id is not null or :$flex$.chart_of_accounts is not null or :$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null or :$flex$.book is not null) and
fifsgv.id_flex_num in (
select /*+ no_unnest*/ fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code=&apos;GL#&apos; and
(
fifsv.id_flex_num=:$flex$.chart_of_accounts_id or
xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos; or
(:$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null) and
fifsgv.id_flex_num in
(
select
gl.chart_of_accounts_id
from
gl_ledgers gl
where
(:$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$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$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
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(+))
)
) or
fifsgv.id_flex_num in (select fbc.accounting_flex_structure from fa_book_controls fbc where xxen_util.contains(:$flex$.book,fbc.book_type_code)=&apos;Y&apos;)
)
)
order by
ffvv.flex_value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.company_segment_low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Company Segment High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>47</SORT_ORDER>
    <ANCHOR>&amp;lp_bal_seg_high</ANCHOR>
    <SQL_TEXT>and fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, c.CHART_OF_ACCOUNTS_ID, NULL, c.CODE_COMBINATION_ID, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &lt;= :p_in_bal_segment_high</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Company Segment High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>48</SORT_ORDER>
    <DISPLAY_SEQUENCE>250</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;lp_acc_seg_low</ANCHOR>
    <SQL_TEXT>and fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_acc_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, c.chart_of_accounts_id, NULL, c.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &gt;= :p_in_acc_segment_low</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Account</LOV_NAME>
    <LOV_GUID>F26C78167A224EFBE0530100007F336B</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ffvv.flex_value value,
ffvv.description||case when ffvv.enabled_flag=&apos;Y&apos; and sysdate between nvl(ffvv.start_date_active,sysdate) and nvl(ffvv.end_date_active,sysdate) then null else &apos; (inactive)&apos; end description
from
fnd_id_flex_segments_vl fifsgv,
fnd_flex_values_vl ffvv
where
gl_security_pkg.validate_segval(fifsgv.segment_num,null,ffvv.flex_value)=&apos;TRUE&apos; and
fifsgv.application_id=101 and
fifsgv.id_flex_code=&apos;GL#&apos; and
fifsgv.enabled_flag=&apos;Y&apos; and
(fifsgv.application_id, fifsgv.id_flex_code, fifsgv.id_flex_num, fifsgv.application_column_name) in (select fsav.application_id, fsav.id_flex_code, fsav.id_flex_num, fsav.application_column_name from fnd_segment_attribute_values fsav where fsav.segment_attribute_type=&apos;GL_ACCOUNT&apos; and fsav.attribute_value=&apos;Y&apos;) and
fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
(:$flex$.chart_of_accounts_id is not null or :$flex$.chart_of_accounts is not null or :$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null or :$flex$.book is not null) and
fifsgv.id_flex_num in (
select /*+ no_unnest*/ fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code=&apos;GL#&apos; and
(
fifsv.id_flex_num=:$flex$.chart_of_accounts_id or
xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos; or
(:$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null) and
fifsgv.id_flex_num in
(
select
gl.chart_of_accounts_id
from
gl_ledgers gl
where
(:$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$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$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
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(+))
)
) or
fifsgv.id_flex_num in (select fbc.accounting_flex_structure from fa_book_controls fbc where xxen_util.contains(:$flex$.book,fbc.book_type_code)=&apos;Y&apos;)
)
)
order by
ffvv.flex_value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>GL Account Segment Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>49</SORT_ORDER>
    <DISPLAY_SEQUENCE>260</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;lp_acc_seg_high</ANCHOR>
    <SQL_TEXT>and fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_acc_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, c.chart_of_accounts_id, NULL, c.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &lt;= :p_in_acc_segment_high</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Account</LOV_NAME>
    <LOV_GUID>F26C78167A224EFBE0530100007F336B</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ffvv.flex_value value,
ffvv.description||case when ffvv.enabled_flag=&apos;Y&apos; and sysdate between nvl(ffvv.start_date_active,sysdate) and nvl(ffvv.end_date_active,sysdate) then null else &apos; (inactive)&apos; end description
from
fnd_id_flex_segments_vl fifsgv,
fnd_flex_values_vl ffvv
where
gl_security_pkg.validate_segval(fifsgv.segment_num,null,ffvv.flex_value)=&apos;TRUE&apos; and
fifsgv.application_id=101 and
fifsgv.id_flex_code=&apos;GL#&apos; and
fifsgv.enabled_flag=&apos;Y&apos; and
(fifsgv.application_id, fifsgv.id_flex_code, fifsgv.id_flex_num, fifsgv.application_column_name) in (select fsav.application_id, fsav.id_flex_code, fsav.id_flex_num, fsav.application_column_name from fnd_segment_attribute_values fsav where fsav.segment_attribute_type=&apos;GL_ACCOUNT&apos; and fsav.attribute_value=&apos;Y&apos;) and
fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
(:$flex$.chart_of_accounts_id is not null or :$flex$.chart_of_accounts is not null or :$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null or :$flex$.book is not null) and
fifsgv.id_flex_num in (
select /*+ no_unnest*/ fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code=&apos;GL#&apos; and
(
fifsv.id_flex_num=:$flex$.chart_of_accounts_id or
xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos; or
(:$flex$.operating_unit is not null or :$flex$.ledger is not null or :$flex$.ledger_category is not null) and
fifsgv.id_flex_num in
(
select
gl.chart_of_accounts_id
from
gl_ledgers gl
where
(:$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$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$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
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(+))
)
) or
fifsgv.id_flex_num in (select fbc.accounting_flex_structure from fa_book_controls fbc where xxen_util.contains(:$flex$.book,fbc.book_type_code)=&apos;Y&apos;)
)
)
order by
ffvv.flex_value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.GL_Account_Segment_Low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>GL Account Segment High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>50</SORT_ORDER>
    <DISPLAY_SEQUENCE>270</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>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Date</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>51</SORT_ORDER>
    <DISPLAY_SEQUENCE>280</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.enabled_flag=&apos;Y&apos; and
sysdate between nvl(fcv.start_date_active,sysdate) and nvl(fcv.end_date_active,sysdate) and
gdr.conversion_date=:$flex$.revaluation_date and
fcv.currency_code=gdr.to_currency and
gdr.from_currency in (
select
gl.currency_code
from
gl_ledgers gl
where
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
(
:$flex$.reporting_context is null or
:$flex$.reporting_level=&apos;1000&apos; and xxen_util.contains(:$flex$.reporting_context,gl.name)=&apos;Y&apos; or
:$flex$.reporting_level=&apos;3000&apos; and gl.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.reporting_context,hou.name)=&apos;Y&apos;)
)
)
order by
fcv.currency_code</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>52</SORT_ORDER>
    <ANCHOR>&amp;lp_reval_aging_amount_cols</ANCHOR>
    <SQL_TEXT>select
 &apos;sum(decode(x1.b&apos; || to_char(l.seq) || &apos;,1,x1.amt_due_remaining,null)) * x1.reval_conv_rate &quot;&apos; || substrb(replace(XXEN_AR_ARXAGRW_PKG.bucket_title(:p_in_bucket_type_low,l.seq),&apos;Due&apos;,decode(:p_age_basis,&apos;Due Date&apos;,&apos;Due&apos;,&apos;Inv&apos;)),1,xxen_report.max_column_length-4) || &apos; &apos; || :p_reval_currency || &apos;&quot;,&apos;
from (
select
rownum-1 seq,
l.*
from ar_aging_bucket_lines l,
ar_aging_buckets b
where
l.aging_bucket_id = b.aging_bucket_id and
upper(b.bucket_name) = upper(:p_in_bucket_type_low) and
nvl(b.status,&apos;A&apos;) = &apos;A&apos;
order by
l.bucket_sequence_num
) l
order by
l.seq</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>53</SORT_ORDER>
    <ANCHOR>&amp;lp_reval_columns</ANCHOR>
    <SQL_TEXT>select
&apos;x1.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,
 x1.reval_conv_rate revaluation_rate,
 nvl(sum(x1.amt_due_original),0) * x1.reval_conv_rate &quot;Original Amount &apos; || :p_reval_currency || &apos;&quot;,
 nvl(sum(x1.amt_due_remaining),0) * x1.reval_conv_rate &quot;Outstanding Amount &apos; || :p_reval_currency || &apos;&quot;,
 &apos; ||
case when xxen_util.lookup_code(:p_credit_option_dsp,&apos;OPEN_CREDITS&apos;,222) = &apos;SUMMARY&apos;
then
&apos;sum(x1.on_account_amount_cash)*x1.reval_conv_rate &quot;Customer Payments &apos; || :p_reval_currency || &apos;&quot;,
 sum(x1.on_account_amount_credit)*x1.reval_conv_rate &quot;Customer Credit Memos &apos; || :p_reval_currency || &apos;&quot;,
 sum(x1.on_account_amount_risk)*x1.reval_conv_rate &quot;Customer Receipts At Risk &apos; || :p_reval_currency || &apos;&quot;,
 sum(x1.cust_amount_claim)*x1.reval_conv_rate &quot;Customer Claims &apos; || :p_reval_currency || &apos;&quot;,
&apos;
end
from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>54</SORT_ORDER>
    <DISPLAY_SEQUENCE>290</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
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
(
:$flex$.reporting_context is null or
:$flex$.reporting_level=&apos;1000&apos; and xxen_util.contains(:$flex$.reporting_context,gl.name)=&apos;Y&apos; or
:$flex$.reporting_level=&apos;3000&apos; and gl.ledger_id in (select hou.set_of_books_id from hr_operating_units hou where xxen_util.contains(:$flex$.reporting_context,hou.name)=&apos;Y&apos;)
)
) and
gdr.to_currency=:$flex$.revaluation_currency and
gdr.conversion_date=:$flex$.revaluation_date and
gdct.conversion_type=gdr.conversion_type
order by
gdct.user_conversion_type</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Revaluation Rate Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>55</SORT_ORDER>
    <DISPLAY_SEQUENCE>300</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;party_dff_cols3</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_parties&apos;,p_table_alias=&gt;&apos;hp&apos;,p_column_name_prefix=&gt;&apos;Party: &apos;) sql_text 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 Party DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>56</SORT_ORDER>
    <ANCHOR>&amp;party_dff_cols1</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_parties&apos;,p_prefix=&gt;&apos;x1.&apos;,p_column_name_prefix=&gt;&apos;Party: &apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Party DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>57</SORT_ORDER>
    <ANCHOR>&amp;party_dff_cols1_g</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_parties&apos;,p_prefix=&gt;&apos;x1.&apos;,p_column_name_prefix=&gt;&apos;Party: &apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Party DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>58</SORT_ORDER>
    <ANCHOR>&amp;party_dff_cols2</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_parties&apos;,p_prefix=&gt;&apos;x.&apos;,p_column_name_prefix=&gt;&apos;Party: &apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Party DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>59</SORT_ORDER>
    <ANCHOR>&amp;party_dff_cols3_g</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_parties&apos;,p_table_alias=&gt;&apos;hp&apos;,p_hide_column_name=&gt;&apos;Y&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Party DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>60</SORT_ORDER>
    <DISPLAY_SEQUENCE>310</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;cust_dff_cols3</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_cust_accounts&apos;,p_table_alias=&gt;&apos;hca&apos;,p_column_name_prefix=&gt;&apos;Customer: &apos;) sql_text 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 Account DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>61</SORT_ORDER>
    <ANCHOR>&amp;cust_dff_cols1</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_cust_accounts&apos;,p_prefix=&gt;&apos;x1.&apos;,p_column_name_prefix=&gt;&apos;Customer: &apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Account DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>62</SORT_ORDER>
    <ANCHOR>&amp;cust_dff_cols1_g</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_cust_accounts&apos;,p_prefix=&gt;&apos;x1.&apos;,p_column_name_prefix=&gt;&apos;Customer: &apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Account DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>63</SORT_ORDER>
    <ANCHOR>&amp;cust_dff_cols2</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_cust_accounts&apos;,p_prefix=&gt;&apos;x.&apos;,p_column_name_prefix=&gt;&apos;Customer: &apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Account DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>64</SORT_ORDER>
    <ANCHOR>&amp;cust_dff_cols3_g</ANCHOR>
    <SQL_TEXT>select xxen_util.dff_columns(p_table_name=&gt;&apos;hz_cust_accounts&apos;,p_table_alias=&gt;&apos;hca&apos;,p_hide_column_name=&gt;&apos;Y&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show Account DFF Attributes</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>65</SORT_ORDER>
    <DISPLAY_SEQUENCE>500</DISPLAY_SEQUENCE>
    <ANCHOR>:p_show_sla</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <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 SLA Accounting</PARAMETER_NAME>
      <DESCRIPTION>Set to Yes to fetch SLA accounting information</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>66</SORT_ORDER>
    <ANCHOR>&amp;lp_sla_sel_outer</ANCHOR>
    <SQL_TEXT>,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.rec_code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &quot;Sla Receivables &amp;lp_bal_seg_p&quot;,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_acct_flex_acc_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.rec_code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;VALUE&apos;) &quot;Sla Receivables &amp;lp_acc_seg_p&quot;,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_accounting_flexfield&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.rec_code_combination_id, &apos;ALL&apos;, &apos;Y&apos;, &apos;VALUE&apos;) sla_receivables_segments,
fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;lp_accounting_flexfield&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, x1.chart_of_accounts_id, null, x1.rec_code_combination_id, &apos;ALL&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) sla_receivables_segments_desc,
nvl(sum(x1.accounted_dr),0) sla_receivables_accounted_dr,
nvl(sum(x1.accounted_cr),0) sla_receivables_accounted_cr,
nvl(sum(x1.accounted_dr),0)-nvl(sum(x1.accounted_cr),0) sla_receivables_accounted_amt,
nvl(sum(case when x1.sla_entity_code=&apos;RECEIPTS&apos; or nvl(x1.rk,1)=1 then x1.net_accounted_dr else 0 end),0)-nvl(sum(case when x1.sla_entity_code=&apos;RECEIPTS&apos; or nvl(x1.rk,1)=1 then x1.net_accounted_cr else 0 end),0) sla_receivables_net_amt</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Show SLA Accounting</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.GL_Account_Segment_Low</FLEX_BIND>
    <PARAMETER_NAME>GL Account Segment Low</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>GL Account Segment High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.balance_due_low</FLEX_BIND>
    <PARAMETER_NAME>Balance Due Low</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Balance Due High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.chart_of_accounts_id</FLEX_BIND>
    <PARAMETER_NAME>Chart of Accounts Id</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Company Segment High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.chart_of_accounts_id</FLEX_BIND>
    <PARAMETER_NAME>Chart of Accounts Id</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Company Segment Low</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.chart_of_accounts_id</FLEX_BIND>
    <PARAMETER_NAME>Chart of Accounts Id</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>GL Account Segment High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.chart_of_accounts_id</FLEX_BIND>
    <PARAMETER_NAME>Chart of Accounts Id</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>GL Account Segment Low</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.company_segment_low</FLEX_BIND>
    <PARAMETER_NAME>Company Segment Low</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Company Segment High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.customer_name_low</FLEX_BIND>
    <PARAMETER_NAME>Customer Name Low</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Customer Name High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.customer_number_low</FLEX_BIND>
    <PARAMETER_NAME>Customer Number Low</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Customer Number High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.fnd_mo_reporting_level</FLEX_BIND>
    <PARAMETER_NAME>Reporting Level</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Reporting Context</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.invoice_type_low</FLEX_BIND>
    <PARAMETER_NAME>Invoice Type Low</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Invoice Type High</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_context</FLEX_BIND>
    <PARAMETER_NAME>Reporting Context</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Account Segment Label</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_context</FLEX_BIND>
    <PARAMETER_NAME>Reporting Context</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Balancing Segment Label</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_context</FLEX_BIND>
    <PARAMETER_NAME>Reporting Context</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Chart of Accounts Id</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_context</FLEX_BIND>
    <PARAMETER_NAME>Reporting Context</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Currency</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_context</FLEX_BIND>
    <PARAMETER_NAME>Reporting Context</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Rate Type</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_level</FLEX_BIND>
    <PARAMETER_NAME>Reporting Level</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Account Segment Label</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_level</FLEX_BIND>
    <PARAMETER_NAME>Reporting Level</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Balancing Segment Label</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_level</FLEX_BIND>
    <PARAMETER_NAME>Reporting Level</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Chart of Accounts Id</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_level</FLEX_BIND>
    <PARAMETER_NAME>Reporting Level</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Currency</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.reporting_level</FLEX_BIND>
    <PARAMETER_NAME>Reporting Level</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Revaluation Rate Type</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_ROW>
    <FLEX_BIND>:$flex$.revaluation_date</FLEX_BIND>
    <PARAMETER_NAME>Revaluation Date</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Revaluation Currency</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.revaluation_date</FLEX_BIND>
    <PARAMETER_NAME>Revaluation Date</PARAMETER_NAME>
    <IS_DATE>Y</IS_DATE>
    <DEPENDENT_PARAMETER_NAME>Revaluation Rate Type</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.salesrep_name_low</FLEX_BIND>
    <PARAMETER_NAME>Salesrep Name Low</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Salesrep Name High</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>
