<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: Acer: XXGLR009 -->
 <REPORTS_ROW>
  <GUID>EAE0323A88740D49E0530100007F2980</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>select
-- ledger
x.ledger_name,
x.ledger_currency,
x.ledger_id,
-- accounts
x.account,
x.account_desc,
x.bal_seg_val,
x.bal_seg_desc,
x.acct_seg_val,
x.acct_seg_desc,
x.cost_ctr_seg_val,
x.cost_ctr_seg_desc,
x.additional_segment_name,
x.additional_segment_value,
x.additional_segment_desc,
-- start balances
nvl(
(select distinct
  glb.begin_balance_dr
 from
  gl_balances glb
 where
  glb.actual_flag = &apos;A&apos; and
  glb.currency_code = x.ledger_currency and
  glb.code_combination_id = x.line_ccid and
  glb.ledger_id = x.ledger_id and
  glb.period_name = :p_start_period_name_h
),0) acc_dr_begin,
nvl(
(select distinct
  glb.begin_balance_cr
 from
  gl_balances glb
 where
  glb.actual_flag = &apos;A&apos; and
  glb.currency_code = x.ledger_currency and
  glb.code_combination_id = x.line_ccid and
  glb.ledger_id = x.ledger_id and
  glb.period_name = :p_start_period_name_h
),0) acc_cr_begin,
-- start period movement prior to p_start_date
nvl(
(select
  sum(gll.accounted_dr)
 from
   gl_je_lines gll
 where
  gll.effective_date &gt;= :p_period_start_date_h and
  gll.effective_date &lt; :p_start_date_h and
  gll.code_combination_id = x.line_ccid and
  gll.ledger_id = x.ledger_id and
  gll.status = &apos;P&apos;
),0) acc_dr_period,
nvl(
(select
  sum(gll.accounted_cr)
 from
   gl_je_lines gll
 where
  gll.effective_date &gt;= :p_period_start_date_h and
  gll.effective_date &lt; :p_start_date_h and
  gll.code_combination_id = x.line_ccid and
  gll.ledger_id = x.ledger_id and
  gll.status = &apos;P&apos;
),0) acc_cr_period,
-- contra account
x.contra_acct_value,
case when :p_report_name = &apos;CONTRA&apos;
then
 case x.contra_acct_value
 when &apos;MULTIPLE&apos; then &apos;MULTIPLE&apos;
 when &apos;NO CONTRA ACCOUNT&apos; then &apos;NO CONTRA ACCOUNT&apos;
 else
   (select
     ffvv.description
    from
     fnd_segment_attribute_values fsav,
     fnd_id_flex_segments_vl fifsgv,
     fnd_flex_values_vl ffvv
    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       = :p_coa_id and
     fsav.attribute_value   = &apos;Y&apos; and
     fifsgv.application_id=fsav.application_id and
     fifsgv.id_flex_code=fsav.id_flex_code and
     fifsgv.id_flex_num=fsav.id_flex_num and
     fifsgv.application_column_name = fsav.application_column_name and
     fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
     ffvv.flex_value = x.contra_acct_value
   )
 end
else null
end contra_acct_value_desc,
case when :p_report_name = &apos;CONTRA&apos;
then
gl_xml_journal_rpt_pkg.net_begin_balance 
  (p_acct_seg_where =&gt; &apos;&amp;p_aff_from_where2 &amp;p_aff_to_where2&apos;,
   p_status         =&gt; x.batch_status_code,
   p_start_date     =&gt; :p_start_date_h,
   p_currency       =&gt; :p_currency,
   p_led_id         =&gt; x.ledger_id,
   p_bal_seg_name   =&gt; :p_gl_bal_segment,
   p_bal_seg_val    =&gt; x.bal_seg_val,
   p_acct_seg_name  =&gt; :p_gl_acc_segment,
   p_acct_seg_val   =&gt; x.acct_seg_val,
   p_sec_seg_name   =&gt; :p_gl_sec_segment,
   p_sec_seg_val    =&gt; x.additional_segment_value) 
else to_number(null)
end cf_contra_net_begin_balance,
case when :p_report_name = &apos;CONTRA&apos;
then
gl_xml_journal_rpt_pkg.net_line_balance 
  (p_acct_seg_where =&gt; &apos;&amp;p_aff_from_where2 &amp;p_aff_to_where2&apos;,
   p_status         =&gt; x.batch_status_code,
   p_start_date     =&gt; :p_start_date_h,
   p_currency       =&gt; :p_currency,
   p_led_id         =&gt; x.ledger_id,
   p_bal_seg_name   =&gt; :p_gl_bal_segment,
   p_bal_seg_val    =&gt; x.bal_seg_val,
   p_acct_seg_name  =&gt; :p_gl_acc_segment,
   p_acct_seg_val   =&gt; x.acct_seg_val,
   p_sec_seg_name   =&gt; :p_gl_sec_segment,
   p_sec_seg_val    =&gt; x.additional_segment_value)
else to_number(null)
end cf_contra_net_line_balance,
-- journal batch
x.batch_id,
x.batch_name,
x.batch_desc,
x.batch_status_code,
x.batch_status,
x.batch_posted_date,
x.batch_period_name,
x.batch_effective_date,
x.actual_flag,
x.batch_type,
x.average_journal_flag,
x.jrnl_type,
x.approval_status_code,
x.approval_status,
x.bud_control_status,
x.budget_ctl_status,
x.batch_tot_dr,
x.batch_tot_cr,
x.batch_tot_acc_dr,
x.batch_tot_acc_cr,
x.batch_date_created,
-- journnal header
x.hdr_id,
x.hdr_name,
x.hdr_desc,
x.tax_status_code,
x.tax_status,
x.hdr_tot_dr,
x.hdr_tot_cr,
x.hdr_tot_acc_dr,
x.hdr_tot_acc_cr,
x.hdr_curr_code,
x.conversion_date,
x.conversion_rate,
x.conversion_type,
x.budget_version_id,
(select gbv.budget_name from gl_budget_versions gbv where gbv.budget_version_id = x.budget_version_id) budget_name,
x.encumbrance_type_id,
(select get.encumbrance_type from gl_encumbrance_types get where get.encumbrance_type_id = x.encumbrance_type_id) encumbrance_type,
x.hdr_extreference,
x.hdr_last_update_date,
x.hdr_eff_date,
x.doc_seq_id,
x.doc_seq_name,
x.doc_seq_value,
x.posting_seq_value,
x.close_seq_value,
nvl2(x.sl_event_id,x.xlq_reporting_seq,x.close_seq_value) cf_reporting_seq,
x.hdr_last_updated_by,
x.hdr_source,
x.hdr_category2,
x.hdr_category,
nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) cf_category,
-- journal line
x.je_line_num,
x.tax_code_id,
x.tax_type_code,
(select gtcv.tax_code from gl_tax_codes_v gtcv where to_char(gtcv.tax_code_id)=x.tax_code_id and gtcv.tax_type_code = x.tax_type_code) tax_code,
x.tax_type,
x.line_desc,
x.entered_dr,
x.entered_cr,
x.accounted_dr,
x.accounted_cr,
x.stat_amount,
x.effective_date,
x.reference1,
x.reference2,
x.reference3,
x.reference4,
x.reference5,
x.reference6,
x.reference7,
x.reference8,
x.reference9,
x.reference10,
x.line_proj_code2,
case
when x.sl_event_id is not null and x.hdr_source = &apos;Receivables&apos;
then
  coalesce
  (
   (select distinct
     ractla.attribute1
    from
     ra_cust_trx_line_gl_dist_all ractl,
     ra_customer_trx_all ract,
     ra_customer_trx_lines_all ractla,
     ra_batch_sources_all rabs
				where
				 rabs.batch_source_id = ract.batch_source_id and
					ract.customer_trx_id = ractla.customer_trx_id and
					ractla.customer_trx_id = ractl.customer_trx_id and
					ractla.customer_trx_line_id = ractl.customer_trx_line_id and
					ractl.event_id = x.sl_event_id  and
					ractl.code_combination_id = x.line_ccid and
					rownum=1
   ),
   (select distinct
     ractla.attribute1
			 from
			  ar_receivable_applications_all araa,
     ra_customer_trx_all ract,
     ra_customer_trx_lines_all ractla,
     ra_batch_sources_all rabs
				where
				 rabs.batch_source_id = ract.batch_source_id and
					ract.customer_trx_id = ractla.customer_trx_id and
					ractla.customer_trx_id = araa.customer_trx_id and
					araa.event_id = x.sl_event_id and
					rownum=1
   ),
   x.line_proj_code2
  )
when x.sl_event_id is not null and x.hdr_source = &apos;Payables&apos;
then
  case
  when x.hdr_category = &apos;Payments&apos;
  then
    nvl(
    (select distinct
      apila.attribute1
					from
					 ap_invoices_all apia,
						ap_invoice_lines_all apila,
      ap_invoice_payments_all aip
					where
					 aip.accounting_event_id = x.sl_event_id and
					 aip.payment_num = x.event_number and
					 apia.invoice_id = aip.invoice_id and
					 apila.invoice_id = aip.invoice_id and
					 rownum=1
    ),x.line_proj_code2)
  else
    nvl(
    (select distinct
      apila.attribute1
					from
					 ap_invoices_all apia,
						ap_invoice_lines_all apila,
     	ap_invoice_distributions_all apida,
     	xla_distribution_links xdl
					where
					 xdl.application_id = 200 and
					 xdl.ae_header_id = x.ae_header_id and
					 xdl.ae_line_num = x.sl_line_num and
					 xdl.source_distribution_type = &apos;AP_INV_DIST&apos; and
					 xdl.source_distribution_id_num_1 = apida.invoice_distribution_id and
					 apia.invoice_id = apida.invoice_id and
					 apila.invoice_id = apida.invoice_id and
					 apila.line_number = apida.invoice_line_number and
					 rownum=1
    ),x.line_proj_code2)
  end
else
 x.line_proj_code2
end line_proj_code,
x.line_fund_code,
(select ctsc.transaction_sub_type_name from ce_trxns_subtype_codes ctsc where ctsc.trxn_subtype_code_id = x.line_fund_code) cf_fund_code,
x.line_reference,
x.line_ccid,
x.jgzz_recon_ref,
x.sub_doc_seq_name,
x.sub_doc_seq_id,
x.sub_doc_seq_val,
-- subledger
x.transaction_no,
x.sl_doc_seq_no,
x.xlq_reporting_seq,
x.party_type_code,
x.party_id,
x.party_site_id,
case when x.sl_event_id is not null
then
 case
 when x.hdr_source = &apos;Assets&apos; and x.party_type_code = &apos;C&apos;
 then to_char(x.source_id_int_1)
 when x.hdr_source = &apos;Receivables&apos; and x.party_type_code = &apos;C&apos;
 then
   (select
     a.account_number||&apos;-&apos;||c.location
    from
     hz_cust_accounts a,
     hz_cust_acct_sites_all b,
     hz_cust_site_uses_all c
    where
     a.cust_account_id   = b.cust_account_id and
     b.cust_acct_site_id = c.cust_acct_site_id and
     c.site_use_id       = x.party_site_id
   )
 when x.hdr_source = &apos;Payables&apos; and x.party_type_code = &apos;S&apos;
 then
   (select pv.segment1 from po_vendors pv where pv.vendor_id = x.party_id)
 when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos; and x.entity_code = &apos;WO_ACCOUNTING_EVENTS&apos;
 then
   (select
     substrb(pv.segment1,1,100)
    from
     cst_write_offs cwos,
     po_distributions_all poda,
     po_vendors pv
    where
      pv.vendor_id=cwos.vendor_id and
      poda.po_distribution_id = cwos.po_distribution_id and
      cwos.write_off_id = x.transaction_no
   )
 when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos;
 then
   (select
     substrb(pv.segment1,1,100)
    from
     rcv_transactions rt,
     rcv_shipment_headers rsh,
     po_vendors pv
    where
      pv.vendor_id=rt.vendor_id and
      rsh.shipment_header_id = rt.shipment_header_id and
      rt.transaction_id = x.transaction_no
   )
 else
  null
 end
else
 null
end party_no,
--
case when x.sl_event_id is not null
then
 case
 when x.hdr_source = &apos;Assets&apos;
 then
   (select substrb(description,1,100) from fa_additions ad where ad.asset_id = x.source_id_int_1)
 when x.hdr_source = &apos;Receivables&apos;
 then
   (select
     substrb(nvl(party.party_name,&apos;&apos;),1,100)
    from
     hz_parties party,
     hz_cust_accounts acnt,
     hz_cust_acct_sites_all site,
     hz_cust_site_uses_all uses,
     hz_party_sites ps,
     hz_locations loc
    where
     party.party_id = acnt.party_id and
     acnt.cust_account_id = site.cust_account_id and
     site.cust_acct_site_id = uses.cust_acct_site_id and
     ps.party_site_id=site.party_site_id and
     loc.location_id=ps.location_id and
     uses.site_use_id = x.party_site_id
   )
 when x.hdr_source = &apos;Payables&apos; and x.party_type_code = &apos;S&apos;
 then
   nvl
    ((select
       decode(ai.source,&apos;INDIA TDS&apos;,pv.vendor_name,ai.attribute1)
      from
       ap_invoices_all  ai,
       po_vendors pv
      where
       ai.invoice_id = x.source_id_int_1 and
       ai.vendor_id = pv.vendor_id
     ),
     (select substrb(pv.vendor_name,1,100) from po_vendors pv where pv.vendor_id = x.party_id)
    )
 when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos; and x.entity_code = &apos;WO_ACCOUNTING_EVENTS&apos;
 then
   (select
     pv.vendor_name
    from
     cst_write_offs cwos,
     po_distributions_all poda,
     po_vendors pv
    where
      pv.vendor_id=cwos.vendor_id and
      poda.po_distribution_id = cwos.po_distribution_id and
      cwos.write_off_id = x.transaction_no
   )
 when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos;
 then
   (select
     pv.vendor_name
    from
     rcv_transactions rt,
     rcv_shipment_headers rsh,
     po_vendors pv
    where
      pv.vendor_id=rt.vendor_id and
      rsh.shipment_header_id = rt.shipment_header_id and
      rt.transaction_id = x.transaction_no
   )
 else
  null
 end
else
 null
end party_name,
--
case
when nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) in (&apos;Payments&apos;,&apos;Receipts&apos;)
then x.hdr_source
when nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos;
then
  case
  when x.sl_event_id is not null and x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos; and x.entity_code = &apos;WO_ACCOUNTING_EVENTS&apos;
  then
     (select
       pha.attribute6
      from
       cst_write_offs cwos,
       po_distributions_all poda,
       po_headers_all pha
      where
        pha.po_header_id=poda.po_header_id and
        poda.po_distribution_id = cwos.po_distribution_id and
        cwos.write_off_id = x.transaction_no
     )
  when x.sl_event_id is not null and x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos;
  then
     (select
       pha.attribute6
      from
       rcv_transactions rt,
       rcv_shipment_headers rsh,
       po_headers_all pha
      where
        pha.po_header_id=rt.po_header_id and
        rsh.shipment_header_id = rt.shipment_header_id and
        rt.transaction_id = x.transaction_no
     )
  else
   null
  end
when x.sl_event_id is not null and x.hdr_source = &apos;Receivables&apos;
then
  coalesce
  (
   (select distinct
     rabs.name
    from
     ra_cust_trx_line_gl_dist_all ractl,
     ra_customer_trx_all ract,
     ra_customer_trx_lines_all ractla,
     ra_batch_sources_all rabs
				where
				 rabs.batch_source_id = ract.batch_source_id and
					ract.customer_trx_id = ractla.customer_trx_id and
					ractla.customer_trx_id = ractl.customer_trx_id and
					ractla.customer_trx_line_id = ractl.customer_trx_line_id and
					ractl.event_id = x.sl_event_id  and
					ractl.code_combination_id = x.line_ccid and
					rownum=1
   ),
   (select distinct
     rabs.name
			 from
			  ar_receivable_applications_all araa,
     ra_customer_trx_all ract,
     ra_customer_trx_lines_all ractla,
     ra_batch_sources_all rabs
				where
				 rabs.batch_source_id = ract.batch_source_id and
					ract.customer_trx_id = ractla.customer_trx_id and
					ractla.customer_trx_id = araa.customer_trx_id and
					araa.event_id = x.sl_event_id and
					rownum=1
   ),
   x.hdr_source
  )
when x.sl_event_id is not null and x.hdr_source = &apos;Payables&apos;
then
  case
  when x.hdr_category = &apos;Payments&apos;
  then
    nvl(
    (select distinct
      apia.source
					from
					 ap_invoices_all apia,
						ap_invoice_lines_all apila,
      ap_invoice_payments_all aip
					where
					 aip.accounting_event_id = x.sl_event_id and
					 aip.payment_num = x.event_number and
					 apia.invoice_id = aip.invoice_id and
					 apila.invoice_id = aip.invoice_id and
					 rownum=1
    ),x.hdr_source)
  else
    nvl(
    (select distinct
      apia.source
					from
					 ap_invoices_all apia,
						ap_invoice_lines_all apila,
     	ap_invoice_distributions_all apida,
     	xla_distribution_links xdl
					where
					 xdl.application_id = 200 and
					 xdl.ae_header_id = x.ae_header_id and
					 xdl.ae_line_num = x.sl_line_num and
					 xdl.source_distribution_type = &apos;AP_INV_DIST&apos; and
					 xdl.source_distribution_id_num_1 = apida.invoice_distribution_id and
					 apia.invoice_id = apida.invoice_id and
					 apila.invoice_id = apida.invoice_id and
					 apila.line_number = apida.invoice_line_number and
					 rownum=1
    ),x.hdr_source)
  end
else
 x.hdr_source
end sl_source,
--
case
when x.hdr_source=&apos;Assets&apos; and x.source_id_int_3 is not null
then to_char(x.source_id_int_3)
when x.hdr_source=&apos;Payables&apos; and x.transaction_no is not null
then
 case when x.hdr_category=&apos;Payments&apos;
 then
   (select distinct
     ab.batch_name
    from
     ap_batches_all ab,
     ap_invoices_all ai,
     ap_invoice_payments_all aip
    where
     ai.batch_id = ab.batch_id and
     ai.invoice_id = aip.invoice_id and
     aip.check_id = x.source_id_int_1 and
     rownum=1
   )
 else
   (select
     ab.batch_name
    from
     ap_batches_all ab,
     ap_invoices_all ai
    where
     ai.batch_id = ab.batch_id and
     ai.invoice_id = x.source_id_int_1 and
     rownum=1
   )
 end
when x.hdr_source=&apos;Receivables&apos; and x.transaction_no is not null
then
 case when x.hdr_category=&apos;Receipts&apos;
 then
   (select distinct
     nvl(bat.name ,&apos;&apos;)
    from
     ar_cash_receipts_all cr,
     ar_cash_receipt_history_all crh,
     ar_batches_all bat
    where
     bat.batch_id = crh.batch_id and
     crh.cash_receipt_id = x.source_id_int_1 and
     rownum=1
   )
 else
   (select
     nvl(rab.name ,&apos;&apos;)
    from
     ra_batches_all rab,
     ra_customer_trx_all ct
    where
     rab.batch_id = ct.batch_id and
     ct.customer_trx_id  = x.source_id_int_1 and
     rownum=1
   )
 end
else
 null
end sl_batch_no,
--
nvl
 (case when x.sl_event_id is not null
  then
   case
   when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos; and x.entity_code = &apos;WO_ACCOUNTING_EVENTS&apos;
   then
     (select
       to_char(cwos.write_off_id)
      from
       cst_write_offs cwos,
       po_distributions_all poda,
       po_vendors pv
      where
        pv.vendor_id=cwos.vendor_id and
        poda.po_distribution_id = cwos.po_distribution_id and
        cwos.write_off_id = x.transaction_no
     )
   when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos;
   then
     (select
       rsh.receipt_num
      from
       rcv_transactions rt,
       rcv_shipment_headers rsh,
       po_vendors pv
      where
        pv.vendor_id=rt.vendor_id and
        rsh.shipment_header_id = rt.shipment_header_id and
        rt.transaction_id = x.transaction_no
     )
   else
    null
   end
  else
   null
  end,
  x.transaction_no
 ) cf_receipt_num,
 --
case when x.sl_event_id is not null
then
 case
 when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos; and x.entity_code = &apos;WO_ACCOUNTING_EVENTS&apos;
 then
   (select
     to_char(poda.po_header_id)
    from
     cst_write_offs cwos,
     po_distributions_all poda,
     po_vendors pv
    where
      pv.vendor_id=cwos.vendor_id and
      poda.po_distribution_id = cwos.po_distribution_id and
      cwos.write_off_id = x.transaction_no
   )
 when x.hdr_source = &apos;Cost Management&apos; and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) = &apos;Receiving&apos;
 then
   (select
     to_char(rt.po_header_id)
    from
     rcv_transactions rt,
     rcv_shipment_headers rsh,
     po_vendors pv
    where
      pv.vendor_id=rt.vendor_id and
      rsh.shipment_header_id = rt.shipment_header_id and
      rt.transaction_id = x.transaction_no
   )
 else
  null
 end
else
 null
end cmgt_po_header_id,
--
case
when (x.hdr_source =&apos;Receivables&apos;) and nvl2(x.sl_event_id,x.hdr_category,x.hdr_category2) not in (&apos;Misc Receipts&apos;,&apos;Receipts&apos;,&apos;Adjustment&apos;) and x.transaction_no is not null
then
  (select distinct
    rcta.purchase_order
   from
    ra_customer_trx_all rcta,
    org_organization_definitions ood
   where
    ood.set_of_books_id = x.ledger_id and
    rcta.org_id= ood.organization_id and
    rcta.trx_number=x.transaction_no and
    rownum=1
   )
end ar_po_num,
--
x.ae_header_id,
x.entity_code,
x.source_id_int_1,
x.source_id_int_3,
x.sl_event_id ,
x.event_number,
x.sl_line_num,
x.xla_description,
x.xla_gl_sl_link_id,
--
&apos;*&apos; last_col
from
(
select &amp;p_hint_clause
  lgr.name                          ledger_name,
  lgr.currency_code                 ledger_currency,
  lgr.ledger_id                     ledger_id,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;ALL&apos;, &apos;Y&apos;, &apos;VALUE&apos;) account,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;ALL&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) account_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) bal_seg_val,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) bal_seg_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;VALUE&apos;) acct_seg_val,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) acct_seg_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;FA_COST_CTR&apos;, &apos;Y&apos;, &apos;VALUE&apos;) cost_ctr_seg_val,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;FA_COST_CTR&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) cost_ctr_seg_desc,
  :p_sec_seg_name additional_segment_name,
  &amp;p_select_secondary_segment &amp;p_null_secondary_segment additional_segment_value,
  &amp;p_select_secondary_seg_desc &amp;p_null_secondary_segment additional_segment_desc,
  case when :p_report_name = &apos;CONTRA&apos; and (nvl(nvl(l.accounted_dr,gll.accounted_dr),0) != 0 or nvl(nvl(l.accounted_cr,gll.accounted_cr),0) !=0)
  then gl_xml_journal_rpt_pkg.Get_Contra_Account(:p_gl_acc_segment,glh.je_header_id,gll.subledger_doc_sequence_id,gll.subledger_doc_sequence_value,nvl(l.accounted_dr,gll.accounted_dr),nvl(l.accounted_cr,gll.accounted_cr))
  else null
  end                               contra_acct_value,
  --
  glb.je_batch_id                   batch_id,
  glb.name                          batch_name,
  glb.description                   batch_desc,
  glb.status                        batch_status_code,
  xxen_util.meaning(glb.status,&apos;MJE_BATCH_STATUS&apos;,101) batch_status,
  glb.posted_date                   batch_posted_date,
  glb.default_period_name           batch_period_name,
  glb.default_effective_date        batch_effective_date,
  glb.actual_flag                   actual_flag,
  xxen_util.description(glb.actual_flag,&apos;BATCH_TYPE&apos;,101) batch_type,
  glb.average_journal_flag          average_journal_flag,
  xxen_util.meaning(glb.average_journal_flag,&apos;AB_JOURNAL_TYPE&apos;,101) jrnl_type,
  glb.approval_status_code          approval_status_code,
  xxen_util.meaning(glb.approval_status_code,&apos;JE_BATCH_APPROVAL_STATUS&apos;,101) approval_status,
  glb.budgetary_control_status      bud_control_status,
  xxen_util.meaning(glb.budgetary_control_status,&apos;JE_BATCH_BC_STATUS&apos;,101) budget_ctl_status,
  glb.running_total_dr              batch_tot_dr,
  glb.running_total_cr              batch_tot_cr,
  glb.running_total_accounted_dr    batch_tot_acc_dr,
  glb.running_total_accounted_cr    batch_tot_acc_cr,
  glb.date_created                  batch_date_created,
  glh.je_header_id                  hdr_id,
  glh.name                          hdr_name,
  glh.description                   hdr_desc,
  glh.tax_status_code               tax_status_code,
  xxen_util.meaning(glh.tax_status_code,&apos;TAX_STATUS&apos;,101) tax_status,
  glh.running_total_dr              hdr_tot_dr,
  glh.running_total_cr              hdr_tot_cr,
  glh.running_total_accounted_dr    hdr_tot_acc_dr,
  glh.running_total_accounted_cr    hdr_tot_acc_cr,
  glh.currency_code                 hdr_curr_code,
  nvl(l.currency_conversion_date,glh.currency_conversion_date) conversion_date ,
  to_char( nvl(l.currency_conversion_rate,decode((nvl(gll.entered_dr,0)+nvl(gll.entered_cr,0)),0,0,(nvl(gll.accounted_dr,0)+nvl(gll.accounted_cr,0))/(nvl(gll.entered_dr,0)+nvl(gll.entered_cr,0)) )) ,&apos;999G999D9999&apos;) conversion_rate,
  dct.user_conversion_type          conversion_type,
  glh.budget_version_id             budget_version_id,
  glh.encumbrance_type_id           encumbrance_type_id,
  glh.external_reference            hdr_extreference,
  glh.last_update_date              hdr_last_update_date,
  glh.default_effective_date        hdr_eff_date,
  glh.doc_sequence_id               doc_seq_id,
  docseq.name                       doc_seq_name,
  glh.doc_sequence_value            doc_seq_value,
  glh.posting_acct_seq_value        posting_seq_value,
  nvl(h.close_acct_seq_value,glh.close_acct_seq_value)          close_seq_value,
  fu.user_name                      hdr_last_updated_by,
  gjs.user_je_source_name           hdr_source,
  gjc.user_je_category_name         hdr_category2,
  decode(gjs.user_je_source_name ,&apos;Assets&apos;,h.je_category_name,&apos;Payables&apos;,h.je_category_name,&apos;Receivables&apos;,h.je_category_name,&apos;Cost Management&apos;,h.je_category_name,gjc.user_je_category_name)        hdr_category,
  gll.je_line_num                   je_line_num,
  gll.tax_code_id                   tax_code_id,
  gll.tax_type_code                 tax_type_code,
  xxen_util.meaning(gll.tax_type_code,&apos;TAX_TYPE&apos;,101) tax_type,
  decode(e.event_id,null,gll.description,l.description)        line_desc,
  nvl(l.entered_dr,gll.entered_dr)      entered_dr,
  nvl(l.entered_cr,gll.entered_cr)      entered_cr,
  nvl(l.accounted_dr,gll.accounted_dr)  accounted_dr,
  nvl(l.accounted_cr,gll.accounted_cr)  accounted_cr,
  gll.stat_amount        stat_amount,
  gll.effective_date     effective_date,
  gll.reference_1        reference1,
  gll.reference_2        reference2,
  gll.reference_3        reference3,
  gll.reference_4        reference4,
  gll.reference_5        reference5,
  gll.reference_6        reference6,
  gll.reference_7        reference7,
  gll.reference_8        reference8,
  gll.reference_9        reference9,
  gll.reference_10       reference10,
  gll.attribute11        line_proj_code2,
  gll.attribute12        line_fund_code,
  gll.attribute13        line_reference,
  gll.code_combination_id line_ccid,
  decode(l.gl_sl_link_id,&apos;&apos;,rec.jgzz_recon_ref,l.jgzz_recon_ref)  jgzz_recon_ref,
  subdocseq.name        sub_doc_seq_name,
  gll.subledger_doc_sequence_id sub_doc_seq_id,
  gll.subledger_doc_sequence_value    sub_doc_seq_val,
  nvl(te.transaction_number,to_char(&apos; &apos;)) transaction_no,
  h.doc_sequence_value  sl_doc_seq_no,
  h.close_acct_seq_value xlq_reporting_seq,
  l.ae_header_id,
  te.entity_code,
  te.source_id_int_1 source_id_int_1,
  te.source_id_int_3 source_id_int_3,
  e.event_id sl_event_id ,
  e.event_number,
  l.ae_line_num sl_line_num,
  l.description xla_description,
  l.gl_sl_link_id  xla_gl_sl_link_id,
  l.party_type_code,
  l.party_site_id party_site_id    ,
  l.party_id party_id
from gl_je_lines_recon rec,
  gl_system_usages use1,
  xla.xla_ae_headers h ,
  xla.xla_ae_lines l ,
  xla.xla_events e ,
  xla.xla_transaction_entities te ,
  xla_gl_ledgers_v gl ,
  xle_entity_profiles le ,
  fnd_user ue ,
  fnd_application_vl app ,
  xla.xla_event_types_tl et ,
  xla.xla_event_classes_tl ec ,
  xla_lookups lk5 ,
  xla_lookups lk7 ,
  gl_import_references ir,
  gl_system_usages use,
  &amp;p_perf_from
  &amp;p_journal_from_clause
  &amp;p_ledger_from
where 1=1
  and glh.ledger_id = lgr.ledger_id
  &amp;p_ledger_where
  and glh.je_source = gjs.je_source_name
  and glh.je_category  =  gjc.je_category_name
  and glh.last_updated_by = fu.user_id
  and glb.je_batch_id = glh.je_batch_id
  and glh.doc_sequence_id = docseq.doc_sequence_id(+)
  and gll.subledger_doc_sequence_id = subdocseq.doc_sequence_id(+)
  and dct.conversion_type (+) = glh.currency_conversion_type
  and gll.status = &apos;P&apos;
  and rec.je_header_id(+) = gll.je_header_id
  and rec.je_line_num(+) = gll.je_line_num
  and rec.ledger_id(+) = :p_ledger_id
  and gl.ledger_id (+)= h.ledger_id
  and le.legal_entity_id   (+)= te.legal_entity_id
  and ue.user_id           (+)= e.created_by
  and ec.application_id(+) = et.application_id
  and ec.event_class_code  (+)= et.event_class_code
  and ec.language          (+)= userenv(&apos;LANG&apos;)
  and et.event_type_code   (+)= h.event_type_code
  and et.language          (+)= userenv(&apos;LANG&apos;)
  and et.application_id   (+)= h.application_id
  and app.application_id   (+)= h.application_id
  and te.entity_id         (+)= h.entity_id
  and e.event_id           (+)= h.event_id
  and h.ae_header_id       (+)= l.ae_header_id
  and lk5.lookup_code         = nvl(h.funds_status_code, &apos;REQUIRED&apos;)
  and lk5.lookup_type         = &apos;XLA_FUNDS_STATUS&apos;
  and lk7.lookup_code(+)      = l.accounting_class_code
  and lk7.lookup_type(+)      = &apos;XLA_ACCOUNTING_CLASS&apos;
  and ir.gl_sl_link_id        = l.gl_sl_link_id(+)
  and ir.gl_sl_link_table     = l.gl_sl_link_table(+)
  and ir.je_header_id(+) = gll.je_header_id
  and ir.je_line_num (+)= gll.je_line_num
  and gjs.je_source_name in(&apos;Assets&apos;,&apos;Inventory&apos;,&apos;Payables&apos;,&apos;Purchasing&apos;,&apos;Receivables&apos;,&apos;Revenue&apos;,&apos;Cost Management&apos;)
  &amp;p_posting_status
  &amp;p_header_posting_status
  &amp;p_das_where
  &amp;p_currency_where
  &amp;p_actual_type_where
  &amp;p_batch_where
  &amp;p_source_where
  &amp;p_category_where
  &amp;p_bal_where
  &amp;p_doc_id_where
  &amp;p_doc_val_where
  &amp;p_sub_doc_id_where
  &amp;p_sub_doc_val_where
  &amp;p_not_zero_line_where
  &amp;p_period_where
  &amp;p_contra_account_where
  &amp;p_journal_date_where
  &amp;p_journal_upd_date_where
  &amp;p_journal_last_upd_where
  &amp;p_aff_from_where
  &amp;p_aff_to_where
  &amp;p_amount_where
  &amp;p_journal_where_clause
union all
select &amp;p_hint_clause
  lgr.name        ledger_name,
  lgr.currency_code    ledger_currency,
  lgr.ledger_id     ledger_id,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;ALL&apos;, &apos;Y&apos;, &apos;VALUE&apos;) account,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;ALL&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) account_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) bal_seg_val,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) bal_seg_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;VALUE&apos;) acct_seg_val,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) acct_seg_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;FA_COST_CTR&apos;, &apos;Y&apos;, &apos;VALUE&apos;) cost_ctr_seg_val,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;FA_COST_CTR&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) cost_ctr_seg_desc,
  :p_sec_seg_name additional_segment_name,
  &amp;p_select_secondary_segment &amp;p_null_secondary_segment additional_segment_value,
  &amp;p_select_secondary_seg_desc &amp;p_null_secondary_segment additional_segment_desc,
  case when :p_report_name = &apos;CONTRA&apos;
  then gl_xml_journal_rpt_pkg.Get_Contra_Account(:p_gl_acc_segment,glh.je_header_id,gll.subledger_doc_sequence_id,gll.subledger_doc_sequence_value,gll.accounted_dr,gll.accounted_cr)
  else null
  end contra_acct_value,
  --
  glb.je_batch_id        batch_id,
  glb.name              batch_name,
  glb.description        batch_desc,
  glb.status             batch_status_code,
  xxen_util.meaning(glb.status,&apos;MJE_BATCH_STATUS&apos;,101) batch_status,
  glb.posted_date        batch_posted_date,
  glb.default_period_name    batch_period_name,
  glb.default_effective_date    batch_effective_date,
  glb.actual_flag            actual_flag,
  xxen_util.description(glb.actual_flag,&apos;BATCH_TYPE&apos;,101) batch_type,
  glb.average_journal_flag    average_journal_flag,
  xxen_util.meaning(glb.average_journal_flag,&apos;AB_JOURNAL_TYPE&apos;,101) jrnl_type,
  glb.approval_status_code    approval_status_code,
  xxen_util.meaning(glb.approval_status_code,&apos;JE_BATCH_APPROVAL_STATUS&apos;,101) approval_status,
  glb.budgetary_control_status    bud_control_status,
  xxen_util.meaning(glb.budgetary_control_status,&apos;JE_BATCH_BC_STATUS&apos;,101) budget_ctl_status,
  glb.running_total_dr    batch_tot_dr,
  glb.running_total_cr    batch_tot_cr,
  glb.running_total_accounted_dr    batch_tot_acc_dr,
  glb.running_total_accounted_cr    batch_tot_acc_cr,
  glb.date_created    batch_date_created,
  glh.je_header_id    hdr_id,
  glh.name              hdr_name,
  glh.description        hdr_desc,
  glh.tax_status_code    tax_status_code,
  xxen_util.meaning(glh.tax_status_code,&apos;TAX_STATUS&apos;,101) tax_status,
  glh.running_total_dr    hdr_tot_dr,
  glh.running_total_cr    hdr_tot_cr,
  glh.running_total_accounted_dr    hdr_tot_acc_dr,
  glh.running_total_accounted_cr    hdr_tot_acc_cr,
  glh.currency_code    hdr_curr_code,
  glh.currency_conversion_date conversion_date ,
  to_char(decode((nvl(gll.entered_dr,0)+nvl(gll.entered_cr,0)),0,0,(nvl(gll.accounted_dr,0)+nvl(gll.accounted_cr,0))/(nvl(gll.entered_dr,0)+nvl(gll.entered_cr,0)) ) ,&apos;999G999D9999&apos;) conversion_rate,
  dct.user_conversion_type    conversion_type,
  glh.budget_version_id    budget_version_id,
  glh.encumbrance_type_id    encumbrance_type_id,
  glh.external_reference    hdr_extreference,
  glh.last_update_date    hdr_last_update_date,
  glh.default_effective_date    hdr_eff_date,
  glh.doc_sequence_id          doc_seq_id,
  docseq.name        doc_seq_name,
  glh.doc_sequence_value    doc_seq_value,
  glh.posting_acct_seq_value        posting_seq_value,
  glh.close_acct_seq_value          close_seq_value,
  fu.user_name        hdr_last_updated_by,
  gjs.user_je_source_name    hdr_source,
  gjc.user_je_category_name    hdr_category2,
  gjc.user_je_category_name        hdr_category,
  gll.je_line_num        je_line_num,
  gll.tax_code_id        tax_code_id,
  gll.tax_type_code    tax_type_code,
  xxen_util.meaning(gll.tax_type_code,&apos;TAX_TYPE&apos;,101) tax_type,
  gll.description line_desc,
  gll.entered_dr      entered_dr,
  gll.entered_cr          entered_cr,
  gll.accounted_dr    accounted_dr,
  gll.accounted_cr    accounted_cr,
  gll.stat_amount        stat_amount,
  gll.effective_date    effective_date,
  gll.reference_1        reference1,
  gll.reference_2        reference2,
  gll.reference_3        reference3,
  gll.reference_4        reference4,
  gll.reference_5        reference5,
  gll.reference_6        reference6,
  gll.reference_7        reference7,
  gll.reference_8        reference8,
  gll.reference_9        reference9,
  gll.reference_10       reference10,
  gll.attribute11        line_proj_code2,
  gll.attribute12        line_fund_code,
  gll.attribute13        line_reference,
  gll.code_combination_id line_ccid,
  rec.jgzz_recon_ref,
  subdocseq.name        sub_doc_seq_name,
  gll.subledger_doc_sequence_id sub_doc_seq_id,
  gll.subledger_doc_sequence_value    sub_doc_seq_val,
  null transaction_no,
  null sl_doc_seq_no,
  null xlq_reporting_seq,
  null ae_header_id,
  null entity_code,
  null source_id_int_1,
  null source_id_int_3,
  null sl_event_id ,
  null event_number,
  null sl_line_num,
  null xla_description,
  null xla_gl_sl_link_id,
  null party_type_code,
  null party_site_id    ,
  null party_id
from gl_je_lines_recon rec,
  &amp;p_perf_from
  &amp;p_journal_from_clause
  &amp;p_ledger_from
where
 1=1
  and glh.ledger_id = lgr.ledger_id
  &amp;p_ledger_where
  and rec.je_header_id(+) = gll.je_header_id
  and rec.je_line_num(+) = gll.je_line_num
  and rec.ledger_id(+) = :p_ledger_id
  and  glh.je_source = gjs.je_source_name
  and  glh.je_category  =  gjc.je_category_name
  and  glh.last_updated_by = fu.user_id
  and  glb.je_batch_id = glh.je_batch_id
  and  glh.doc_sequence_id = docseq.doc_sequence_id(+)
  and  gll.subledger_doc_sequence_id = subdocseq.doc_sequence_id(+)
  and  dct.conversion_type (+) = glh.currency_conversion_type
  and  gll.status = &apos;P&apos;
  and  gjs.je_source_name not in(&apos;Assets&apos;,&apos;Inventory&apos;,&apos;Payables&apos;,&apos;Purchasing&apos;,&apos;Receivables&apos;,&apos;Revenue&apos;,&apos;Cost Management&apos;)
  &amp;p_posting_status
  &amp;p_header_posting_status
  &amp;p_das_where
  &amp;p_currency_where
  &amp;p_actual_type_where
  &amp;p_batch_where
  &amp;p_source_where
  &amp;p_category_where
  &amp;p_bal_where
  &amp;p_doc_id_where
  &amp;p_doc_val_where
  &amp;p_sub_doc_id_where
  &amp;p_sub_doc_val_where
  &amp;p_not_zero_line_where
  &amp;p_period_where
  &amp;p_contra_account_where
  &amp;p_journal_date_where
  &amp;p_journal_upd_date_where
  &amp;p_journal_last_upd_where
  &amp;p_aff_from_where
  &amp;p_aff_to_where
  &amp;p_amount_where
  &amp;p_journal_where_clause
) x
where
    :p_report_name = :p_report_name
and :p_access_set_id = :p_access_set_id
and :p_ledger = :p_ledger
and :p_ledger_id = :p_ledger_id
and :p_ledger_type = :p_ledger_type
and :p_coa_id = :p_coa_id
and nvl(:p_status,&apos;?&apos;) = nvl(:p_status,&apos;?&apos;)
and nvl(:p_currency,&apos;?&apos;) = nvl(:p_currency,&apos;?&apos;)
and nvl(:p_select_basis,&apos;?&apos;) = nvl(:p_select_basis,&apos;?&apos;)
and nvl(:p_use_date_col,&apos;?&apos;) = nvl(:p_use_date_col,&apos;?&apos;)
and nvl(:p_start_date,sysdate) = nvl(:p_start_date,sysdate)
and nvl(:p_end_date,sysdate) = nvl(:p_end_date,sysdate)
and nvl(:p_amount_from,0) = nvl(:p_amount_from,0)
and nvl(:p_amount_to,0) = nvl(:p_amount_to,0)
and nvl(:p_amt_flag,&apos;?&apos;) = nvl(:p_amt_flag,&apos;?&apos;)
and nvl(:p_aff_from,&apos;?&apos;) = nvl(:p_aff_from,&apos;?&apos;)
and nvl(:p_aff_to,&apos;?&apos;) = nvl(:p_aff_to,&apos;?&apos;)
and nvl(:p_contra_acct,&apos;?&apos;) = nvl(:p_contra_acct,&apos;?&apos;)
order by
account,
effective_date,
doc_seq_value</SQL_TEXT>
  <NUMBER_FORMAT>General</NUMBER_FORMAT>
  <REQUIRED_PARAMETERS>(:Period_Name is not null and :Start_Date is null and :End_Date is null) or
(:Period_Name is null and :Start_Date is not null and :End_Date is not null)</REQUIRED_PARAMETERS>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <REPORT_NAME>COPY OF: GL Journals</REPORT_NAME>
    <DESCRIPTION>تقرير دفعات دفتر اليومية ودفاتر اليومية ، بما في ذلك المبالغ والمرفقات</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>الرجاء إدخال المزيد من المعلمات</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <REPORT_NAME>COPY OF: GL Journals</REPORT_NAME>
    <DESCRIPTION>GL-Batches und Journale Bericht, einschließlich Beträge und Anhänge</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>Bitte weitere Parameter eingeben</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <REPORT_NAME>COPY OF: GL Journals</REPORT_NAME>
    <DESCRIPTION>Rapport sur les lots de GL et les journaux, y compris les montants et les pièces jointes</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>Veuillez saisir d&apos;autres paramètres</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <REPORT_NAME>COPY OF: GL Journals</REPORT_NAME>
    <DESCRIPTION>Report dei lotti e dei giornali GL, compresi gli importi e gli allegati</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>Si prega di inserire altri parametri</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>Acer: XXGLR009</REPORT_NAME>
    <DESCRIPTION>Acer: XXGLR009</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>Please specify either a period or Start and End Date</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <REPORT_NAME>COPY OF: GL Journals</REPORT_NAME>
    <DESCRIPTION>GL批次和日记账报告，包括金额和附件。</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>请输入更多参数</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_actual_type_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_aff_from_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_aff_from_where2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_aff_to_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_aff_to_where2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_amount_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_bal_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_batch_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_category_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_contra_account_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_currency_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_das_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_doc_id_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_doc_val_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_header_posting_status</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_hint_clause</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_journal_date_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_journal_from_clause</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_journal_last_upd_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_journal_upd_date_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_journal_where_clause</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_ledger_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_ledger_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_not_zero_line_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_null_secondary_segment</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_perf_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_period_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_posting_status</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_select_secondary_seg_desc</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_select_secondary_segment</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_source_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_sub_doc_id_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_sub_doc_val_where</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_access_set_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_aff_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_aff_to</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_amount_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_amount_to</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_amt_flag</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_coa_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_contra_acct</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_currency</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_end_date</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_gl_acc_segment</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_gl_bal_segment</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_gl_sec_segment</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_ledger</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_ledger_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_ledger_type</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_period_start_date_h</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_report_name</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_sec_seg_name</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_select_basis</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_start_date</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_start_date_h</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_start_period_name_h</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_status</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_use_date_col</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>-200</DISPLAY_SEQUENCE>
    <ANCHOR>:p_access_set_id</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Access Set ID</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>select nvl(gl_access_set_security_pkg.get_security_clause(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;R&apos;,&apos;LEDGER_COLUMN&apos;,&apos;LEDGER_ID&apos;,&apos;GLH&apos;,&apos;SEG_COLUMN&apos;,null,&apos;CC&apos;,null),&apos;1=1&apos;)
from 
dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Access Set ID</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>-190</DISPLAY_SEQUENCE>
    <ANCHOR>:p_ledger_id</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select gl.ledger_id
from gl_ledgers gl
where gl.name = :$flex$.Ledger_Ledger_Set</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger ID</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>-180</DISPLAY_SEQUENCE>
    <ANCHOR>:p_ledger_type</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select gl.object_type_code
from gl_ledgers gl
where gl.name = :$flex$.Ledger_Ledger_Set</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <ANCHOR>&amp;p_ledger_where</ANCHOR>
    <SQL_TEXT>and lgr.ledger_id = :p_ledger_id</SQL_TEXT>
    <MATCHING_VALUE>L</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <ANCHOR>&amp;p_ledger_where</ANCHOR>
    <SQL_TEXT>and ls.ledger_set_id = :p_ledger_id and lgr.ledger_id = ls.ledger_id</SQL_TEXT>
    <MATCHING_VALUE>S</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>-170</DISPLAY_SEQUENCE>
    <ANCHOR>:p_coa_id</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select gl.chart_of_accounts_id
from gl_ledgers gl
where gl.name = :$flex$.Ledger_Ledger_Set</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Chart Of Accounts</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>-160</DISPLAY_SEQUENCE>
    <ANCHOR>:p_start_period_name_h</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select 
nvl(
:$flex$.period_name,
(
select
gp.period_name
from
gl_ledgers gl,
gl_periods gp
where
gp.period_set_name = gl.period_set_name and
gp.period_type = gl.accounted_period_type and
gl.ledger_id = :$flex$.ledger_id and
:$flex$.start_date between gp.start_date and gp.end_date
)
)
from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>p_start_period_name_h</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>-150</DISPLAY_SEQUENCE>
    <ANCHOR>:p_period_start_date_h</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
gp.start_date
from
gl_ledgers gl,
gl_periods gp
where
gp.period_set_name = gl.period_set_name and
gp.period_type = gl.accounted_period_type and
gl.ledger_id = :$flex$.ledger_id and
( gp.period_name = :$flex$.Period_Name or
  (:$flex$.Period_Name is null and :$flex$.Start_Date between gp.start_date and gp.end_date)
)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>p_period_start_date_h</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <DISPLAY_SEQUENCE>-140</DISPLAY_SEQUENCE>
    <ANCHOR>:p_start_date_h</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
nvl(
(select
  gp.start_date
 from
  gl_ledgers gl,
  gl_periods gp
 where
  gp.period_set_name = gl.period_set_name and
  gp.period_type = gl.accounted_period_type and
  gl.ledger_id = :$flex$.ledger_id and
  gp.period_name = :$flex$.Period_Name
),:$flex$.start_date)
from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>p_start_date_h</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>11</SORT_ORDER>
    <DISPLAY_SEQUENCE>-130</DISPLAY_SEQUENCE>
    <ANCHOR>:p_gl_bal_segment</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
&apos;cc.&apos; || fsav.application_column_name
from
fnd_segment_attribute_values fsav
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       = :$flex$.chart_of_accounts and
fsav.attribute_value   = &apos;Y&apos;</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>p_gl_bal_segment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>12</SORT_ORDER>
    <DISPLAY_SEQUENCE>-120</DISPLAY_SEQUENCE>
    <ANCHOR>:p_gl_acc_segment</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
&apos;cc.&apos; || fsav.application_column_name
from
fnd_segment_attribute_values fsav
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       = :$flex$.chart_of_accounts and
fsav.attribute_value   = &apos;Y&apos;</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>p_gl_acc_segment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>13</SORT_ORDER>
    <DISPLAY_SEQUENCE>-110</DISPLAY_SEQUENCE>
    <ANCHOR>:p_gl_sec_segment</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
&apos;cc.&apos; || fifsv.application_column_name 
from
fnd_id_flex_segments_vl fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.enabled_flag=&apos;Y&apos; and
fifsv.form_left_prompt = :$flex$.Secondary_Segment and
fifsv.id_flex_num = :$flex$.chart_of_accounts</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>p_gl_sec_segment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>14</SORT_ORDER>
    <DISPLAY_SEQUENCE>-100</DISPLAY_SEQUENCE>
    <ANCHOR>:p_use_date_col</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
case when nvl(xxen_util.lookup_code(:$flex$.selection_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) = &apos;J&apos;
then
  case when nvl(xxen_util.lookup_code(:$flex$.Status,&apos;BATCH_STATUS&apos;,101),&apos;U&apos;) = &apos;P&apos;
  then &apos;glb2.posted_date&apos;
  else &apos;glh2.default_effective_date&apos;
  end 
else
 case 
 when :$flex$.report_name in (&apos;CONTRA&apos;,&apos;VOUCHER&apos;) or
            (xxen_util.lookup_code(:$flex$.selection_basis,&apos;SELECTION_BASE&apos;,101) is not null and  nvl(xxen_util.lookup_code(:$flex$.Status,&apos;BATCH_STATUS&apos;,101),&apos;U&apos;) != &apos;P&apos;)
 then  &apos;gll.effective_date&apos;
 when nvl(xxen_util.lookup_code(:$flex$.Status,&apos;BATCH_STATUS&apos;,101),&apos;U&apos;) = &apos;P&apos;
 then &apos;glb.posted_date&apos;
 else &apos;glh.default_effective_date&apos;
 end
end
from dual
</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_USE_DATE_COL</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>15</SORT_ORDER>
    <DISPLAY_SEQUENCE>-90</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_header_posting_status</ANCHOR>
    <SQL_TEXT>select
case :p_status_code
when &apos;E&apos; 
then &apos;and glh.je_header_id = gll.je_header_id(+) and gll.code_combination_id = cc.code_combination_id(+)&apos;
else &apos;and glh.je_header_id = gll.je_header_id and gll.ledger_id = lgr.ledger_id and gll.code_combination_id = cc.code_combination_id&apos;
end
from
dual
</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select nvl(xxen_util.lookup_code( :$flex$.Status,&apos;BATCH_STATUS&apos;,101),&apos;*null*&apos;) from dual</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_HEADER_POSTING_STATUS</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>16</SORT_ORDER>
    <DISPLAY_SEQUENCE>-80</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_hint_clause</ANCHOR>
    <SQL_TEXT>select
case 
when :p_report_name =  &apos;CHECK&apos; 
then
  case 
  when xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) = &apos;E&apos; or xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) = &apos;U&apos; or :p_batch_name is not null
  then null
  when xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) != &apos;E&apos; or xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) != &apos;U&apos; or :p_status is null  
  then 
    case when :p_ledger_type = &apos;S&apos;
    then
        &apos;/*+ ORDERED USE_NL(LS) INDEX(LS GL_LEDGER_SET_ASSIGNMENTS_N1)
               USE_NL(GLL) INDEX (GLL GL_JE_LINES_U1)
               USE_NL(GLL)INDEX(CC GL_CODE_COMBINATIONS_U1)
               USE_NL(GLB) INDEX(GLB GL_JE_BATCHES_U1)
               USE_NL(GJC) INDEX (GJC GL_JE_CATEGORIES_TL_U1)
               USE_NL(GJS) INDEX (GJS GL_JE_SOURCES_TL_U1)
               USE_NL(DCT) INDEX (DCT GL_DAILY_CONVERSION_TYPES_U1)
               USE_NL(DOCSEQ) INDEX(DOCSEQ FND_DOCUMENT_SEQUENCES_U1)
               USE_NL(SUBDOCSEQ) INDEX(SUBDOCSEQ FND_DOCUMENT_SEQUENCES_U1)
               USE_NL(FU) INDEX(FU FND_USER_U1)  */&apos;
    else
       &apos;/*+ ORDERED 
              USE_NL(GLL) INDEX (GLL GL_JE_LINES_U1)
              USE_NL(GLL)INDEX(CC GL_CODE_COMBINATIONS_U1)
              USE_NL(GLB) INDEX(GLB GL_JE_BATCHES_U1)
              USE_NL(GJC) INDEX (GJC GL_JE_CATEGORIES_TL_U1)
              USE_NL(GJS) INDEX (GJS GL_JE_SOURCES_TL_U1)
              USE_NL(DCT) INDEX (DCT GL_DAILY_CONVERSION_TYPES_U1)
              USE_NL(DOCSEQ) INDEX(DOCSEQ FND_DOCUMENT_SEQUENCES_U1)
              USE_NL(SUBDOCSEQ) INDEX(SUBDOCSEQ FND_DOCUMENT_SEQUENCES_U1)
              USE_NL(FU) INDEX(FU FND_USER_U1)  */&apos;
    end
 else  &apos;/*+ ORDERED */&apos;
 end
else null
end
from dual
</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>Y</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_HINT_CLAUSE</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>17</SORT_ORDER>
    <DISPLAY_SEQUENCE>-70</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_perf_from</ANCHOR>
    <SQL_TEXT>select
case 
when :p_report_name =  &apos;CHECK&apos; 
then
  case 
  when xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) = &apos;E&apos; or xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) = &apos;U&apos; or :p_batch_name is not null
  then
    &apos; gl_je_batches glb,  gl_je_headers glh &apos;|| decode(:p_ledger_type,&apos;S&apos;,&apos;, gl_ledger_set_assignments ls&apos;,null) ||
    &apos; , gl_je_lines gll, gl_code_combinations cc, gl_ledgers lgr, gl_je_sources gjs, gl_je_categories gjc, &apos;||
    &apos; gl_daily_conversion_types dct, fnd_document_sequences docseq, &apos;||
    &apos; fnd_document_sequences subdocseq, fnd_user fu &apos; 
  when xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) != &apos;E&apos; or xxen_util.lookup_code(:p_status,&apos;BATCH_STATUS&apos;,101) != &apos;U&apos; or :p_status is null   
  then 
    &apos; gl_je_headers glh &apos;|| decode(:p_ledger_type,&apos;S&apos;,&apos;, gl_ledger_set_assignments ls&apos;,null) ||
    &apos; , gl_je_batches glb, gl_je_lines gll, gl_code_combinations_kfv cc, gl_je_sources gjs,  gl_ledgers lgr,&apos;||
    &apos; gl_je_categories gjc,  gl_daily_conversion_types dct, fnd_document_sequences docseq, &apos;||
    &apos; fnd_document_sequences subdocseq, fnd_user fu &apos;
 else
    &apos; gl_ledgers lgr, gl_je_batches 		glb, gl_je_headers 		glh, gl_je_sources	gjs, gl_je_categories	gjc,&apos; ||
    &apos; gl_je_lines	gll, gl_daily_conversion_types dct,fnd_document_sequences	docseq, fnd_document_sequences	subdocseq, gl_code_combinations	cc, fnd_user	fu &apos; ||
    decode(:p_ledger_type,&apos;S&apos;,&apos;, gl_ledger_set_assignments ls &apos;,null)
 end
else 
  &apos; gl_ledgers lgr, gl_je_batches 		glb, gl_je_headers 		glh, gl_je_sources	gjs, gl_je_categories	gjc,&apos; ||
  &apos; gl_je_lines	gll, gl_daily_conversion_types dct,fnd_document_sequences	docseq, fnd_document_sequences	subdocseq, gl_code_combinations	cc, fnd_user	fu &apos; ||
  decode(:p_ledger_type,&apos;S&apos;,&apos;, gl_ledger_set_assignments ls&apos;,null)
end
from dual
</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>Y</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_PERF_FROM</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>18</SORT_ORDER>
    <DISPLAY_SEQUENCE>-60</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_amount_where</ANCHOR>
    <SQL_TEXT>select
case when nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) != &apos;J&apos; and
            (:p_amount_from is not null or :p_amount_to is not null)
then
  case :p_amt_flag
  when &apos;DR&apos; then &apos; and gll.accounted_dr &lt;&gt; 0 and gll.accounted_dr &apos;
  when &apos;CR&apos; then &apos; and gll.accounted_cr &lt;&gt; 0 and gll.accounted_cr &apos;
  else &apos; and ((gll.accounted_dr &lt;&gt; 0 and gll.accounted_dr &apos;
  end ||
  case when :p_amt_flag is null
  then
    case
    when :p_amount_from is not null and :p_amount_to is null
    then &apos;) or (gll.accounted_cr &lt;&gt; 0 and gll.accounted_cr &gt;= :p_amount_from))&apos;
    when :p_amount_from is null and :p_amount_to is not null
    then &apos;) or (gll.accounted_cr &lt;&gt; 0 and gll.accounted_cr &lt;= :p_amount_to))&apos;
    else &apos;) or (gll.accounted_cr &lt;&gt; 0 and gll2.accounted_cr between :p_amount_from and :p_amount_to))&apos;
    end
  else
   null
  end  
else
 null
end amount_where
from 
dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>Y</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_AMOUNT_WHERE</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>19</SORT_ORDER>
    <DISPLAY_SEQUENCE>-50</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_journal_from_clause</ANCHOR>
    <SQL_TEXT>with q1 as
(
select
--journal_from
case when nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) = &apos;J&apos;
then
  case when upper(:p_use_date_col) = &apos;GLB2.POSTED_DATE&apos; or upper(:p_use_date_col) = &apos;GLH2.DEFAULT_EFFECTIVE_DATE&apos;
  then &apos; gl_je_batches glb2,  &apos;
  else null
  end
else
 null
end journal_from,
--journal_where
case when nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) = &apos;J&apos;
then
  case when upper(:p_use_date_col) = &apos;GLB2.POSTED_DATE&apos; or upper(:p_use_date_col) = &apos;GLH2.DEFAULT_EFFECTIVE_DATE&apos;
  then &apos; and glb2.je_batch_id = glh2.je_batch_id  &apos;
  else null
  end
else
 null
end journal_where,
-- p_journal_date_where_2
case when nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) = &apos;J&apos;
then
  case
  when upper(:p_use_date_col) = &apos;GLH2.DEFAULT_EFFECTIVE_DATE&apos; and
       (:p_start_date is not null or :p_end_date is not null)
  then
    &apos; and glh2.period_name in (select period_name from gl_period_statuses ps where ps.application_id = 101 and ps.ledger_id =  lgr1.ledger_id &apos; ||
    case
    when :p_start_date is null then &apos; and ( ps.start_date &lt;= :p_end_date)&apos;
    when :p_send_date is null then &apos; and ( ps.end_date &gt;= :p_start_date)&apos;
    else &apos; and (ps.end_date &gt;= :p_start_date and ps.start_date &lt;= :p_end_date)&apos;
    end || &apos;)&apos;
  when upper(:p_use_date_col) = &apos;GLL2.EFFECTIVE_DATE&apos; and
       (:p_start_date is not null or :p_end_date is not null)
  then
    &apos; and gll2.period_name in (select period_name from gl_period_statuses ps where ps.application_id = 101 and ps.set_of_books_id = :p_ledger_id &apos; ||
    case
    when :p_start_date is null then &apos; and ( ps.start_date &lt;= :p_end_date)&apos;
    when :p_send_date is null then &apos; and ( ps.end_date &gt;= :p_start_date)&apos;
    else &apos; and (ps.end_date &gt;= :p_start_date and ps.start_date &lt;= :p_end_date)&apos;
    end || &apos;)&apos;
  else null
  end ||
  case when (:p_start_date is not null or :p_end_date is not null)
  then
    case
    when :p_start_date is null then &apos; and trunc(&apos;|| :p_use_date_col ||&apos;) &lt;= :p_end_date&apos;
    when :p_send_date is null then &apos; and trunc(&apos;|| :p_use_date_col ||&apos;) &gt;= :p_start_date&apos;
    else &apos; and trunc(&apos;|| :p_use_date_col ||&apos;) between :p_start_date and :p_end_date&apos;
    end
  else null
  end
else
  null
end p_journal_date_where_2,
-- amount_where_2
case when nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) = &apos;J&apos; and
            (:p_amount_from is not null or :p_amount_to is not null)
then
  case :p_amt_flag
  when &apos;DR&apos; then &apos; and gll2.accounted_dr &lt;&gt; 0 and gll2.accounted_dr &apos;
  when &apos;CR&apos; then &apos; and gll2.accounted_cr &lt;&gt; 0 and gll2.accounted_cr &apos;
  else &apos; and ((gll2.accounted_dr &lt;&gt; 0 and gll2.accounted_dr &apos;
  end ||
  case when :p_amt_flag is null
  then
    case
    when :p_amount_from is not null and :p_amount_to is null
    then &apos;) or (gll2.accounted_cr &lt;&gt; 0 and gll2.accounted_cr &gt;= :p_amount_from))&apos;
    when :p_amount_from is null and :p_amount_to is not null
    then &apos;) or (gll2.accounted_cr &lt;&gt; 0 and gll2.accounted_cr &lt;= :p_amount_to))&apos;
    else &apos;) or (gll2.accounted_cr &lt;&gt; 0 and gll2.accounted_cr between :p_amount_from and :p_amount_to))&apos;
    end
  else
   null
  end
else
 null
end amount_where_2
from
dual
)
select
&apos;, (select distinct gll2.je_header_id je_header_id,
        gll2.subledger_doc_sequence_id sub_doc_seq_id,
        gll2.subledger_doc_sequence_value sub_doc_seq_value
   from &apos; || q1.journal_from ||
&apos;         gl_ledgers   lgr1,
    gl_je_lines gll2,
          gl_je_headers glh2,
          gl_code_combinations_kfv gcc3 &apos;||decode(:p_ledger_type,&apos;S&apos;,&apos;, gl_ledger_set_assignments ls1&apos;,null)||&apos;
  where   lgr1.ledger_id = glh2.ledger_id
        &apos;|| q1.journal_where ||&apos;
        &apos;||decode(:p_ledger_type,&apos;S&apos;,&apos; and ls1.ledger_set_id = :p_ledger_id and lgr1.ledger_id = ls1.ledger_id&apos;,&apos; and  lgr1.ledger_id = :p_ledger_id&apos;)||&apos;
        &apos;|| q1.p_journal_date_where_2 || &apos;
        &apos;|| q1.amount_where_2 ||
case when :p_aff_from is not null
then
&apos;   and gcc3.concatenated_segments &gt;= :p_aff_from &apos;
else null
end ||
case when :p_aff_to is not null
then
&apos;   and gcc3.concatenated_segments &lt;= :p_aff_to &apos;
else null
end ||
&apos;   and &apos; || nvl(gl_access_set_security_pkg.get_security_clause(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;),&apos;R&apos;,&apos;LEDGER_COLUMN&apos;,&apos;LEDGER_ID&apos;,&apos;GLH2&apos;,&apos;SEG_COLUMN&apos;,null,&apos;GCC2&apos;,null),&apos;1=1&apos;) ||
&apos;   and gll2.je_header_id = glh2.je_header_id
    and glh2.ledger_id = gll2.ledger_id
    and gll2.code_combination_id = gcc3.code_combination_id
    and (nvl(gll2.accounted_dr, 0) &lt;&gt; 0 or nvl(gll2.accounted_cr, 0) &lt;&gt; 0 ))  sub_table
&apos;
from
q1

</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select &apos;Y&apos;
from dual
where nvl(xxen_util.lookup_code(:$flex$.selection_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) = &apos;J&apos;</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_JOURNAL_FROM_CLAUSE</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>20</SORT_ORDER>
    <DISPLAY_SEQUENCE>-40</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_journal_date_where</ANCHOR>
    <SQL_TEXT>select
case when nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) != &apos;J&apos;
then
  case
  when (upper(:p_use_date_col) = &apos;GLL.EFFECTIVE_DATE&apos;) and
       (:p_start_date is not null or :p_end_date is not null)
  then
    &apos; and gll.period_name in (select /*+ cardinailty(ps,2 ) */ period_name from gl_period_statuses ps where ps.application_id = 101 and ps.ledger_id = lgr.ledger_id &apos; ||
    case 
    when :p_start_date is null then &apos; and ( ps.start_date &lt;= :p_end_date)&apos;
    when :p_end_date is null then &apos; and ( ps.end_date &gt;= :p_start_date)&apos;  
    else &apos; and (ps.end_date &gt;= :p_start_date and ps.start_date &lt;= :p_end_date)&apos;
    end || &apos;)&apos;  
  else
    null
  end ||
  case when (:p_start_date is not null or :p_end_date is not null)
  then
    case 
    when :p_start_date is null then &apos; and trunc(&apos;|| :p_use_date_col ||&apos;) &lt;= :p_end_date&apos;
    when :p_end_date is null then &apos; and trunc(&apos;|| :p_use_date_col ||&apos;) &gt;= :p_start_date&apos;
    else &apos; and trunc(&apos;|| :p_use_date_col ||&apos;) between :p_start_date and :p_end_date&apos;
    end   
  else null
  end
else
 null
end p_journal_date_where
from
dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select &apos;Y&apos;
from dual
where nvl(xxen_util.lookup_code(:$flex$.selection_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) != &apos;J&apos;</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_JOURNAL_DATE_WHERE</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>21</SORT_ORDER>
    <DISPLAY_SEQUENCE>-30</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_not_zero_line_where</ANCHOR>
    <SQL_TEXT>select
&apos; and (((nvl(gll.accounted_dr, 0) &lt;&gt; 0) or (nvl(gll.accounted_cr, 0) &lt;&gt; 0)) or ((nvl(gll.entered_dr, 0) &lt;&gt; 0) or (nvl(gll.entered_cr, 0) &lt;&gt; 0))) &apos;
from dual
where nvl(xxen_util.lookup_code( :p_status,&apos;BATCH_STATUS&apos;,101),&apos;P&apos;) != &apos;E&apos;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>Y</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_NOT_ZERO_LINE_WHERE</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>22</SORT_ORDER>
    <DISPLAY_SEQUENCE>-20</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_contra_account_where</ANCHOR>
    <SQL_TEXT>and exists 
(select gjl2.je_line_num
 from gl_je_lines gjl2, gl_code_combinations_kfv gcc2
 where
 gjl2.je_header_id = glh.je_header_id and
 gjl2.code_combination_id = gcc2.code_combination_id and
 ((gjl2.subledger_doc_sequence_id = gll.subledger_doc_sequence_id and
   gjl2.subledger_doc_sequence_value = gll.subledger_doc_sequence_value
  ) or
  (gll.subledger_doc_sequence_id is null and 
   gjl2.subledger_doc_sequence_id is null and
   gjl2.subledger_doc_sequence_value is null
  )
 ) and
 ((gll.accounted_dr is not null and 
   gll.accounted_dr&lt;&gt; 0 and 
   gjl2.accounted_cr is not null and 
   gjl2.accounted_cr &lt;&gt; 0
  ) or
  (gll.accounted_cr is not null and 
   gll.accounted_cr&lt;&gt; 0 and 
   gjl2.accounted_dr is not null and 
   gjl2.accounted_dr &lt;&gt; 0
  )
 ) and 
 gcc2.concatenated_segments = :p_contra_acct
)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select &apos;Y&apos;
from dual
where :$flex$.Contra_Accounting_Flexfield is not null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_CONTRA_ACCOUNT_WHERE</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>23</SORT_ORDER>
    <DISPLAY_SEQUENCE>-10</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;p_null_secondary_segment</ANCHOR>
    <SQL_TEXT>&apos;&apos;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select &apos;Y&apos; from dual where :$flex$.secondary_segment is null</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>P_NULL_SECONDARY_SEGMENT</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>24</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>:p_report_name</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;CHECK&apos; value, null description from dual union
select &apos;CONTRA&apos; value, null description from dual union
select &apos;VOUCHER&apos; value, null description from dual
) x
order by
x.value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>CHECK</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>25</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>:p_ledger</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||decode(gl.ledger_category_code,&apos;NONE&apos;,xxen_util.meaning(gl.object_type_code,&apos;LEDGERS&apos;,101),xxen_util.meaning(gl.ledger_category_code,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101))||&apos;: &apos;||gl.description description
from
gl_access_set_ledgers gasl,
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
gasl.access_set_id=fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;) and
gl.ledger_id=gasl.ledger_id and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select name from gl_ledgers where ledger_id = gl_access_set_security_pkg.get_default_ledger_id(fnd_profile.value(&apos;GL_ACCESS_SET_ID&apos;), &apos;R&apos;)</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Grand livre</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger/Ledger Set</PARAMETER_NAME>
      <DESCRIPTION>Ledger Name</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>26</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>:p_select_basis</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select 
meaning value,
description
from
fnd_lookup_values_vl
where
lookup_type = &apos;SELECTION_BASE&apos;
and view_application_id = 101
order by
value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>Lines</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Selection Basis</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>27</SORT_ORDER>
    <ANCHOR>&amp;p_journal_where_clause</ANCHOR>
    <SQL_TEXT>and sub_table.je_header_id = gll.je_header_id 
and (sub_table.sub_doc_seq_id is null or
     sub_table.sub_doc_seq_id = gll.subledger_doc_sequence_id
    )
and (sub_table.sub_doc_seq_value is null or
     sub_table.sub_doc_seq_value = gll.subledger_doc_sequence_value
)</SQL_TEXT>
    <MATCHING_VALUE>Journals</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Selection Basis</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>28</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glb.default_period_name = :p_period_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gp.period_name value,
(
select
xxen_util.meaning(gps.closing_status,&apos;CLOSING_STATUS&apos;,101)||&apos;: &apos;||fnd_date.date_to_displaydate(gps.start_date)||&apos; - &apos;||fnd_date.date_to_displaydate(gps.end_date) description
from
gl_period_statuses gps
where
gp.period_name=gps.period_name and
gps.ledger_id=gl.ledger_id and
gps.application_id=101
) description
from
gl_ledgers gl,
gl_periods gp
where
gp.end_date&lt;=sysdate and
gp.period_set_name = gl.period_set_name and
gp.period_type = gl.accounted_period_type and
gl.name = :$flex$.ledger_ledger_set
order by
gp.start_date desc</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select distinct
max(gp.period_name) keep (dense_rank last order by gp.start_date,gp.period_year,gp.period_num) over () period_name
from
gl.gl_periods gp
where
:$flex$.batch is null and
:$flex$.journal is null and
gp.start_date&lt;=sysdate and
(gp.period_set_name,gp.period_type) in (
select
gl.period_set_name,
gl.accounted_period_type
from
gl_ledgers gl
where
(:$flex$.ledger is null or xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;) and
(:$flex$.chart_of_accounts is null or gl.chart_of_accounts_id in (select 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 xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;))
)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Période du</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Period Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>29</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>:p_start_date</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Start Date</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>30</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>:p_end_date</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>End Date</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>31</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) = :p_bal_seg_val</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ffvv.flex_value value,
ffvv.description
from
fnd_segment_attribute_values fsav,
fnd_id_flex_segments_vl fifsgv,
fnd_flex_values_vl ffvv
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       = :$flex$.chart_of_accounts and
fsav.attribute_value   = &apos;Y&apos; and
fifsgv.application_id=fsav.application_id and
fifsgv.id_flex_code=fsav.id_flex_code and
fifsgv.id_flex_num=fsav.id_flex_num and
fifsgv.application_column_name = fsav.application_column_name and
fifsgv.flex_value_set_id=ffvv.flex_value_set_id and
sysdate between nvl(ffvv.start_date_active,sysdate) and nvl(ffvv.end_date_active,sysdate)
order by
ffvv.flex_value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Balancing Segment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>32</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>:p_sec_seg_name</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
fifsv.form_left_prompt value,
to_char(fifsv.segment_num,&apos;90&apos;) || &apos; &apos; || lower(fifsv.application_column_name) description
from
fnd_id_flex_segments_vl fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.enabled_flag=&apos;Y&apos; and
fifsv.id_flex_num = :$flex$.chart_of_accounts
order by
fifsv.segment_num
</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Secondary Segment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>33</SORT_ORDER>
    <ANCHOR>&amp;p_select_secondary_seg_desc</ANCHOR>
    <SQL_TEXT>select
&apos;fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;&apos;acct_flex_seg&apos;&apos;, &apos;&apos;SQLGL&apos;&apos;, &apos;&apos;GL#&apos;&apos;, cc.chart_of_accounts_id, NULL, cc.code_combination_id,&apos; || fifsv.segment_num || &apos;, &apos;&apos;Y&apos;&apos;, &apos;&apos;DESCRIPTION&apos;&apos;)&apos;
from
fnd_id_flex_segments_vl fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.enabled_flag=&apos;Y&apos; and
fifsv.form_left_prompt = :p_sec_seg_name and
fifsv.id_flex_num = :p_coa_id</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Secondary Segment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>34</SORT_ORDER>
    <ANCHOR>&amp;p_select_secondary_segment</ANCHOR>
    <SQL_TEXT>select
&apos;cc.&apos; || lower(fifsv.application_column_name) 
from
fnd_id_flex_segments_vl fifsv
where
fifsv.application_id=101 and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.enabled_flag=&apos;Y&apos; and
fifsv.form_left_prompt = :p_sec_seg_name and
fifsv.id_flex_num = :p_coa_id

</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Secondary Segment</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>35</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>:p_aff_from</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select 
gcck.concatenated_segments value,
xxen_util.segments_description(gcck.code_combination_id) description
from
gl_code_combinations_kfv gcck
where
gcck.detail_posting_allowed = &apos;Y&apos; and
gcck.enabled_flag = &apos;Y&apos; and
gcck.summary_flag = &apos;N&apos; and
gcck.chart_of_accounts_id = :$flex$.chart_of_accounts
order by
gcck.concatenated_segments</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Flexfield From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>36</SORT_ORDER>
    <ANCHOR>&amp;p_aff_from_where</ANCHOR>
    <SQL_TEXT>select
&apos;and cc.&apos;||lower(x.application_column_name)||&apos;&gt;=&apos;&apos;&apos;||
regexp_substr(x.concatenated_segments || x.delim, &apos;([^&apos; || x.delim || &apos;]*)\&apos; || x.delim, 1, x.seq, null, 1) || &apos;&apos;&apos;&apos; text
from
(
select
:p_aff_from concatenated_segments,
fifst.concatenated_segment_delimiter delim,
fifss.application_column_name,
fifss.segment_num,
row_number() over (order by fifss.segment_num) seq
from
fnd_id_flex_structures fifst,
fnd_id_flex_segments fifss
where
fifst.application_id=101 and
fifst.id_flex_code=&apos;GL#&apos; and
fifst.id_flex_num=:p_coa_id and
fifss.application_id=fifst.application_id and
fifss.id_flex_code=fifst.id_flex_code and
fifss.id_flex_num=fifst.id_flex_num and
fifss.enabled_flag=&apos;Y&apos;
order by
fifss.segment_num
) x
where
nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) != &apos;J&apos;</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Flexfield From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>37</SORT_ORDER>
    <ANCHOR>&amp;p_aff_from_where2</ANCHOR>
    <SQL_TEXT>select
&apos;and cc.&apos;||lower(x.application_column_name)||&apos;&gt;=&apos;&apos;&apos;&apos;&apos;||
regexp_substr(x.concatenated_segments || x.delim, &apos;([^&apos; || x.delim || &apos;]*)\&apos; || x.delim, 1, x.seq, null, 1) || &apos;&apos;&apos;&apos;&apos;&apos; text
from
(
select
:p_aff_from concatenated_segments,
fifst.concatenated_segment_delimiter delim,
fifss.application_column_name,
fifss.segment_num,
row_number() over (order by fifss.segment_num) seq
from
fnd_id_flex_structures fifst,
fnd_id_flex_segments fifss
where
fifst.application_id=101 and
fifst.id_flex_code=&apos;GL#&apos; and
fifst.id_flex_num=:p_coa_id and
fifss.application_id=fifst.application_id and
fifss.id_flex_code=fifst.id_flex_code and
fifss.id_flex_num=fifst.id_flex_num and
fifss.enabled_flag=&apos;Y&apos;
order by
fifss.segment_num
) x</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Flexfield From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>38</SORT_ORDER>
    <DISPLAY_SEQUENCE>100</DISPLAY_SEQUENCE>
    <ANCHOR>:p_aff_to</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select 
gcck.concatenated_segments value,
xxen_util.segments_description(gcck.code_combination_id) description
from
gl_code_combinations_kfv gcck
where
gcck.detail_posting_allowed = &apos;Y&apos; and
gcck.enabled_flag = &apos;Y&apos; and
gcck.summary_flag = &apos;N&apos; and
gcck.chart_of_accounts_id = :$flex$.chart_of_accounts
order by
gcck.concatenated_segments</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.Accounting_Flexfield_From</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Flexfield To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>39</SORT_ORDER>
    <ANCHOR>&amp;p_aff_to_where</ANCHOR>
    <SQL_TEXT>select
&apos;and cc.&apos;||lower(x.application_column_name)||&apos;&lt;=&apos;&apos;&apos;||
regexp_substr(x.concatenated_segments || x.delim, &apos;([^&apos; || x.delim || &apos;]*)\&apos; || x.delim, 1, x.seq, null, 1) || &apos;&apos;&apos;&apos; text
from
(
select
:p_aff_to concatenated_segments,
fifst.concatenated_segment_delimiter delim,
fifss.application_column_name,
fifss.segment_num,
row_number() over (order by fifss.segment_num) seq
from
fnd_id_flex_structures fifst,
fnd_id_flex_segments fifss
where
fifst.application_id=101 and
fifst.id_flex_code=&apos;GL#&apos; and
fifst.id_flex_num=:p_coa_id and
fifss.application_id=fifst.application_id and
fifss.id_flex_code=fifst.id_flex_code and
fifss.id_flex_num=fifst.id_flex_num and
fifss.enabled_flag=&apos;Y&apos;
order by
fifss.segment_num
) x
where
nvl(xxen_util.lookup_code(:p_select_basis,&apos;SELECTION_BASE&apos;,101),&apos;L&apos;) != &apos;J&apos;</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Flexfield To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>40</SORT_ORDER>
    <ANCHOR>&amp;p_aff_to_where2</ANCHOR>
    <SQL_TEXT>select
&apos;and cc.&apos;||lower(x.application_column_name)||&apos;&lt;=&apos;&apos;&apos;&apos;&apos;||
regexp_substr(x.concatenated_segments || x.delim, &apos;([^&apos; || x.delim || &apos;]*)\&apos; || x.delim, 1, x.seq, null, 1) || &apos;&apos;&apos;&apos;&apos;&apos; text
from
(
select
:p_aff_to concatenated_segments,
fifst.concatenated_segment_delimiter delim,
fifss.application_column_name,
fifss.segment_num,
row_number() over (order by fifss.segment_num) seq
from
fnd_id_flex_structures fifst,
fnd_id_flex_segments fifss
where
fifst.application_id=101 and
fifst.id_flex_code=&apos;GL#&apos; and
fifst.id_flex_num=:p_coa_id and
fifss.application_id=fifst.application_id and
fifss.id_flex_code=fifst.id_flex_code and
fifss.id_flex_num=fifst.id_flex_num and
fifss.enabled_flag=&apos;Y&apos;
order by
fifss.segment_num
) x</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Accounting Flexfield To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>41</SORT_ORDER>
    <DISPLAY_SEQUENCE>110</DISPLAY_SEQUENCE>
    <ANCHOR>:p_contra_acct</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select 
gcck.concatenated_segments value,
xxen_util.segments_description(gcck.code_combination_id) description
from
gl_code_combinations_kfv gcck
where
gcck.detail_posting_allowed = &apos;Y&apos; and
gcck.enabled_flag = &apos;Y&apos; and
gcck.summary_flag = &apos;N&apos; and
gcck.chart_of_accounts_id = :$flex$.chart_of_accounts and
:$flex$.report_name = &apos;CONTRA&apos;
order by
gcck.concatenated_segments</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Contra Accounting Flexfield</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>42</SORT_ORDER>
    <DISPLAY_SEQUENCE>120</DISPLAY_SEQUENCE>
    <ANCHOR>:p_status</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Journal Status</LOV_NAME>
    <LOV_GUID>B16B03AA6AEB5FDDE0530100007FE310</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select xxen_util.meaning(&apos;P&apos;,&apos;BATCH_STATUS&apos;,101) value, null description from dual union all
select xxen_util.meaning(&apos;U&apos;,&apos;BATCH_STATUS&apos;,101) value, null description from dual union all
select xxen_util.meaning(&apos;E&apos;,&apos;VALIDATION_STATUS&apos;,101) value, null description from dual</LOV_QUERY_DSP>
    <DEFAULT_VALUE>xxen_util.meaning(&apos;P&apos;,&apos;BATCH_STATUS&apos;,101)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Statut</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Status</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>43</SORT_ORDER>
    <ANCHOR>&amp;p_posting_status</ANCHOR>
    <SQL_TEXT>select
case  xxen_util.lookup_code( :p_status,&apos;BATCH_STATUS&apos;,101)
when &apos;E&apos; 
then &apos;and glb.status in (select lookup_code from gl_lookups where lookup_type = &apos;&apos;MJE_BATCH_STATUS&apos;&apos; and lookup_code not in (&apos;&apos;S&apos;&apos;,&apos;&apos;I&apos;&apos;,&apos;&apos;U&apos;&apos;,&apos;&apos;P&apos;&apos;))&apos;
else &apos;and glb.status = xxen_util.lookup_code( :p_status,&apos;&apos;BATCH_STATUS&apos;&apos;,101)&apos;
end
from
dual
</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Status</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>44</SORT_ORDER>
    <DISPLAY_SEQUENCE>130</DISPLAY_SEQUENCE>
    <ANCHOR>:p_currency</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>FND Currency</LOV_NAME>
    <LOV_GUID>8E2FF36EDE9079D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
fcv.currency_code value,
fcv.description
from
fnd_currencies_vl fcv
where
fcv.enabled_flag=&apos;Y&apos;
order by
fcv.currency_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select gl.currency_code
from gl_ledgers gl
where gl.name = :$flex$.Ledger_Ledger_Set</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>45</SORT_ORDER>
    <ANCHOR>&amp;p_currency_where</ANCHOR>
    <SQL_TEXT>select 
case when :p_currency = &apos;STAT&apos;
then &apos;and glh.currency_code = &apos;&apos;STAT&apos;&apos;&apos;
else &apos;and glh.currency_code != &apos;&apos;STAT&apos;&apos;&apos;
end
from
dual</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Currency</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>46</SORT_ORDER>
    <DISPLAY_SEQUENCE>140</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glh.actual_flag in (select flvv.lookup_code from fnd_lookup_values_vl flvv where flvv.description=:p_actual_flag and flvv.lookup_type=&apos;BATCH_TYPE&apos; and flvv.view_application_id=101 and flvv.security_group_id=0)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Balance Type</LOV_NAME>
    <LOV_GUID>8E2FF36EDF3C79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
flvv.description value,
flvv.lookup_code description
from
fnd_lookup_values_vl flvv
where
flvv.lookup_type=&apos;BATCH_TYPE&apos; and
flvv.view_application_id=101 and
flvv.security_group_id=0
order by
flvv.lookup_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select flv.description
from fnd_lookup_values flv
where flv.lookup_type=&apos;BATCH_TYPE&apos;
and flv.view_application_id=101
and flv.language(+)=userenv(&apos;lang&apos;)
and flv.security_group_id=0
and flv.lookup_code = &apos;A&apos;</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Type d&apos;équilibre</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Balance Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>47</SORT_ORDER>
    <DISPLAY_SEQUENCE>150</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glb.name=:p_batch_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Batch</LOV_NAME>
    <LOV_GUID>B16C8DB2BC207B92E0530100007F1372</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select distinct
gjb.name value,
gjb.description
from
gl_je_batches gjb
where
gjb.je_batch_id in (select gjh.je_batch_id from gl_je_headers gjh where (:$flex$.journal is null or gjh.name=:$flex$.journal) and gjh.ledger_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos; or gl.ledger_category_code=xxen_util.lookup_code(:$flex$.ledger_category,&apos;GL_ASF_LEDGER_CATEGORY&apos;,101,&apos;Y&apos;)))
order by
gjb.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Lot</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Batch</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>48</SORT_ORDER>
    <DISPLAY_SEQUENCE>160</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(select gjsv.user_je_source_name from gl_je_sources_vl gjsv where gjsv.je_source_name=glh.je_source) &lt;=  :user_je_source_name_fr</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Journal Source</LOV_NAME>
    <LOV_GUID>8E2FF36EDF2379D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gjsv.user_je_source_name value,
gjsv.description 
from 
gl_je_sources_vl gjsv
order by
gjsv.user_je_source_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Source du journal</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Journal Source From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>49</SORT_ORDER>
    <DISPLAY_SEQUENCE>170</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(select gjsv.user_je_source_name from gl_je_sources_vl gjsv where gjsv.je_source_name=glh.je_source) &lt;=  :user_je_source_name_to</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Journal Source</LOV_NAME>
    <LOV_GUID>8E2FF36EDF2379D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gjsv.user_je_source_name value,
gjsv.description 
from 
gl_je_sources_vl gjsv
order by
gjsv.user_je_source_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Journal Source To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>50</SORT_ORDER>
    <DISPLAY_SEQUENCE>180</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(select gjcv.user_je_category_name from gl_je_categories_vl gjcv where gjcv.je_category_name=glh.je_category) &gt;=  :user_journal_category_fr</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Journal Category</LOV_NAME>
    <LOV_GUID>8E2FF36EDF2479D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gjcv.user_je_category_name value,
gjcv.description
from
gl_je_categories_vl gjcv
order by
gjcv.user_je_category_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Catégorie de journal</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Journal Category From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>51</SORT_ORDER>
    <DISPLAY_SEQUENCE>190</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>(select gjcv.user_je_category_name from gl_je_categories_vl gjcv where gjcv.je_category_name=glh.je_category) &gt;=  :user_journal_category_fr</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Journal Category</LOV_NAME>
    <LOV_GUID>8E2FF36EDF2479D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gjcv.user_je_category_name value,
gjcv.description
from
gl_je_categories_vl gjcv
order by
gjcv.user_je_category_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Journal Category To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>52</SORT_ORDER>
    <DISPLAY_SEQUENCE>200</DISPLAY_SEQUENCE>
    <ANCHOR>:p_amount_from</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Amount From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>53</SORT_ORDER>
    <DISPLAY_SEQUENCE>210</DISPLAY_SEQUENCE>
    <ANCHOR>:p_amount_to</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Amount To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>54</SORT_ORDER>
    <DISPLAY_SEQUENCE>220</DISPLAY_SEQUENCE>
    <ANCHOR>:p_amt_flag</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select 
x.value, 
null description 
from
(select &apos;DR&apos; value from dual union
 select &apos;CR&apos; value from dual
) x
order by
x.value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Amount Flag</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>55</SORT_ORDER>
    <DISPLAY_SEQUENCE>230</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glh.doc_sequence_id = (select fds.doc_sequence_id from fnd_document_sequences fds where fds.name = :p_doc_seq_name)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
fds.name value,
null description
from
fnd_document_sequences fds,
fnd_doc_sequence_assignments fdsa
where
    fdsa.doc_sequence_id = fds.doc_sequence_id
and fdsa.set_of_books_id in
(
select 
gl.ledger_id
from 
gl_ledgers gl
where
gl.ledger_id = :$flex$.ledger_id
union
select
l.ledger_id
from
apps.gl_ledgers                ls,
apps.gl_ledgers                l,
apps.gl_ledger_set_assignments lsa
where
lsa.ledger_set_id = :$flex$.ledger_id and 
l.ledger_id = lsa.ledger_id
)
order by fds.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Document Sequence Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>56</SORT_ORDER>
    <DISPLAY_SEQUENCE>240</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glh.doc_sequence_value = :p_doc_value</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
to_char(doc_sequence_value) value,
null description
from
gl_doc_sequence_audit
where 
doc_sequence_id= (select doc_sequence_id from fnd_document_sequences where name = :$flex$.document_sequence_name)
order by 
value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Document Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>57</SORT_ORDER>
    <DISPLAY_SEQUENCE>250</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glh.doc_sequence_value &gt;= :p_start_doc_value</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
to_char(doc_sequence_value) value,
null description
from
gl_doc_sequence_audit
where 
doc_sequence_id= (select doc_sequence_id from fnd_document_sequences where name = :$flex$.document_sequence_name)
order by 
value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Document Number Low</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>58</SORT_ORDER>
    <DISPLAY_SEQUENCE>260</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glh.doc_sequence_value &lt;= :p_end_doc_value</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
to_char(doc_sequence_value) value,
null description
from
gl_doc_sequence_audit
where 
doc_sequence_id= (select doc_sequence_id from fnd_document_sequences where name = :$flex$.document_sequence_name)
order by 
value</LOV_QUERY_DSP>
    <DEFAULT_VALUE>:$flex$.Document_Number_Low</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Document Number High</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>59</SORT_ORDER>
    <DISPLAY_SEQUENCE>270</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gll.subledger_doc_sequence_id = (select fds.doc_sequence_id from fnd_document_sequences fds where fds.name = :p_doc_seq_name)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
fds.name value,
null description
from
fnd_document_sequences fds,
fnd_doc_sequence_assignments fdsa
where
    fdsa.doc_sequence_id = fds.doc_sequence_id
and fdsa.set_of_books_id in
(
select 
gl.ledger_id
from 
gl_ledgers gl
where
gl.ledger_id = :$flex$.ledger_id
union
select
l.ledger_id
from
apps.gl_ledgers                ls,
apps.gl_ledgers                l,
apps.gl_ledger_set_assignments lsa
where
lsa.ledger_set_id = :$flex$.ledger_id and 
l.ledger_id = lsa.ledger_id
)
order by fds.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Subledger Document Seq</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>60</SORT_ORDER>
    <DISPLAY_SEQUENCE>280</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gll.subledger_doc_sequence_value = :p_sub_doc_value</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
to_char(doc_sequence_value) value,
null description
from
gl_doc_sequence_audit
where 
doc_sequence_id= (select doc_sequence_id from fnd_document_sequences where name = :$flex$.subledger_doc_seq)
order by 
value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Subledger Document Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>61</SORT_ORDER>
    <DISPLAY_SEQUENCE>290</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>glh.last_updated_by = xxen_util.user_id(:p_last_updated_by)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>FND User Name</LOV_NAME>
    <LOV_GUID>8E2FF36EDE8479D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
fu.user_name value,
trim(coalesce(
trim(papf.first_name||&apos; &apos;||papf.last_name),
fu.description,
fu.email_address,
papf.email_address
)||fu.inactive) description
from
(select case when sysdate between fu.start_date and nvl(fu.end_date,sysdate) then null else &apos; (inactive)&apos; end inactive, fu.* from fnd_user fu) fu,
(select papf.* from per_all_people_f papf where sysdate between papf.effective_start_date and papf.effective_end_date) papf,
(
select distinct
furg.user_id,
count(*) over (partition by furg.user_id) resp_count,
max(fr.responsibility_key) over (partition by furg.user_id) max_responsibility_key
from
fnd_responsibility fr,
fnd_user_resp_groups_direct furg
where
fr.responsibility_id=furg.responsibility_id and
fr.application_id=furg.responsibility_application_id
) furg
where
fu.employee_id=papf.person_id(+) and
fu.user_id=furg.user_id(+) and
not (furg.resp_count=1 and furg.max_responsibility_key=&apos;IRC_EXT_CANDIDATE&apos;)
order by
fu.inactive desc,
fu.user_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Last Updated By</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>62</SORT_ORDER>
    <DISPLAY_SEQUENCE>300</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>trunc(glh.last_update_date) &gt;= :p_start_update_date</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Date d&apos;entrée en vigueur</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Update Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>63</SORT_ORDER>
    <DISPLAY_SEQUENCE>310</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>trunc(glh.last_update_date) &lt; trunc(:p_end_update_date)+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Date de publication au</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Update Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
