<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<LOVS>
<!-- loader xml for Enginatics Blitz Report lov: CE Internal Bank Account Name (Secured) -->
 <LOVS_ROW>
  <GUID>C8A7FD7AC920667BE0530100007F4469</GUID>
  <LOV_NAME>CE Internal Bank Account Name (Secured)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>with ce_sec_v as
(select  /*+ materialize */
   cbaua.bank_account_id,
   cspv.organization_type
 from 
   ce_bank_acct_uses_all cbaua,
   ce_security_profiles_v cspv
 where
    ((cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;OPERATING_UNIT&apos;) or 
     (cbaua.legal_entity_id = cspv.organization_id and cspv.organization_type = &apos;LEGAL_ENTITY&apos;) or 
     (cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;BUSINESS_GROUP&apos;)
    ) and
   trunc(nvl(cbaua.end_date,sysdate)) &gt;= trunc(sysdate)
)
select
 cba.bank_account_name value,
 hpb.party_name||&apos; (&apos;||cba.currency_code||&apos;) Account#: &apos; || cba.masked_account_num description
from
 ce_bank_accounts cba,
 hz_parties hpb,
 hz_parties hpbb
where
 cba.account_classification = &apos;INTERNAL&apos; and
 nvl(cba.netting_acct_flag,&apos;N&apos;) = &apos;N&apos; and
 hpb.party_id = cba.bank_id and
 hpbb.party_id = cba.bank_branch_id and
 (:$flex$.legal_entity is null or
  cba.account_owner_org_id in (select xep.legal_entity_id from xle_entity_profiles xep where xxen_util.contains(:$flex$.legal_entity,xep.name) = &apos;Y&apos;)
 ) and
 hpb.party_name = nvl(:$flex$.bank_name,hpb.party_name) and
 hpbb.party_name = nvl(:$flex$.bank_branch,hpbb.party_name) and
 ( ((cba.ap_use_allowed_flag = &apos;Y&apos; or cba.ar_use_allowed_flag =&apos;Y&apos;) and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;OPERATING_UNIT&apos;)
   ) or
   (cba.xtr_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;LEGAL_ENTITY&apos;)
   ) or
   (cba.pay_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;BUSINESS_GROUP&apos;)
   )
 )
order by
 cba.bank_account_name
</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>CE Internal Bank Account Names secured by CE Security Profile</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: CE Internal Bank Account Number (secured, masked) -->
 <LOVS_ROW>
  <GUID>C8A7FD7AC91F667BE0530100007F4469</GUID>
  <LOV_NAME>CE Internal Bank Account Number (secured, masked)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>with ce_sec_v as
(select  /*+ materialize */
   cbaua.bank_account_id,
   cspv.organization_type
 from 
   ce_bank_acct_uses_all cbaua,
   ce_security_profiles_v cspv
 where
    ((cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;OPERATING_UNIT&apos;) or 
     (cbaua.legal_entity_id = cspv.organization_id and cspv.organization_type = &apos;LEGAL_ENTITY&apos;) or 
     (cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;BUSINESS_GROUP&apos;)
    ) and
   trunc(nvl(cbaua.end_date,sysdate)) &gt;= trunc(sysdate)
)
select
 cba.masked_account_num value,
 hpb.party_name||&apos; (&apos;||cba.currency_code||&apos;) Account:&apos; || cba.bank_account_name description
from
 ce_bank_accounts cba,
 hz_parties hpb,
 hz_parties hpbb
where
 cba.account_classification = &apos;INTERNAL&apos; and
 nvl(cba.netting_acct_flag,&apos;N&apos;) = &apos;N&apos; and
 hpb.party_id = cba.bank_id and
 hpbb.party_id = cba.bank_branch_id and
 (:$flex$.legal_entity is null or
  cba.account_owner_org_id in (select xep.legal_entity_id from xle_entity_profiles xep where xxen_util.contains(:$flex$.legal_entity,xep.name) = &apos;Y&apos;)
 ) and
 hpb.party_name = nvl(:$flex$.bank_name,hpb.party_name) and
 hpbb.party_name = nvl(:$flex$.bank_branch,hpbb.party_name) and
 ( ((cba.ap_use_allowed_flag = &apos;Y&apos; or cba.ar_use_allowed_flag =&apos;Y&apos;) and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;OPERATING_UNIT&apos;)
   ) or
   (cba.xtr_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;LEGAL_ENTITY&apos;)
   ) or
   (cba.pay_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;BUSINESS_GROUP&apos;)
   )
 )
order by
 cba.masked_account_num
</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>CE Internal Bank Account Numbers secured by CE Security Profile</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: CE Legal Entities -->
 <LOVS_ROW>
  <GUID>C9C878DC04AA0259E0530100007FB368</GUID>
  <LOV_NAME>CE Legal Entities</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select distinct
 xep.name value,
 null description
from
 xle_entity_profiles xep,
 ce_bank_accounts cba,
 ce_bank_acct_uses_all cbaua,
 ce_security_profiles_v cspv
where
 xep.legal_entity_id = cba.account_owner_org_id and
 cba.bank_account_id = cbaua.bank_account_id and
 ((cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;OPERATING_UNIT&apos;) or
 (cbaua.legal_entity_id = cspv.organization_id and cspv.organization_type = &apos;LEGAL_ENTITY&apos;) or
 (cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;BUSINESS_GROUP&apos;)
 ) and
 trunc(nvl(cbaua.end_date,sysdate)) &gt;= trunc(sysdate)</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>CE Legal Entities</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
</LOVS>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: CE General Ledger Reconciliation -->
 <REPORTS_ROW>
  <GUID>CB08ABBA2FB6E927E0530100007FD659</GUID>
  <SQL_TEXT>with
q_gl_end_bal as
(
  select
    &apos;GL END BALANCE&apos;   record_type,
    null               operating_unit,
    null               transaction_number,
    to_date(null)      gl_date,
    to_date(null)      effective_date,
    null               agent,
    null               payment_method,
    null               transaction_subtype,
    null               je_name,
    to_number(null)    je_line,
    null               je_line_type,
    to_date(null)      je_posted_date,
    null               statement_number,
    to_number(null)    statement_line,
    null               statement_trx_type,
    null               status,
    :c_bank_curr_dsp   currency,
    to_number(null)    transaction_amount,
    to_number(null)    accounted_amount,
    to_number (nvl(bal.period_net_dr,0) - nvl(bal.period_net_cr,0) + nvl(bal.begin_balance_dr,0) - nvl(bal.begin_balance_cr,0))
                       gl_end_balance,
    glcc.code_combination_id
                       cash_account_ccid
  from
    gl_balances bal,
    gl_code_combinations glcc
  where
   bal.actual_flag(+) = &apos;A&apos; and
   bal.ledger_id(+) = :c_set_of_books_id and
   bal.currency_code(+) = :c_bank_curr_dsp and
   nvl(bal.translated_flag,&apos;R&apos;) = &apos;R&apos; and
   bal.period_name(+) = :p_period_name and
   bal.code_combination_id(+) = glcc.code_combination_id and
   glcc.chart_of_accounts_id = :c_chart_of_accounts_id and
   glcc.template_id is null  and
   glcc.code_combination_id in
    ( select distinct
       case col.cnum
       when 1 then cba2.asset_code_combination_id
       when 2 then cgac2.asset_code_combination_id
       when 3 then cgac2.ap_asset_ccid
       when 4 then cgac2.ar_asset_ccid
       when 5 then cgac2.xtr_asset_ccid
       end
      from
       ce_bank_accounts cba2,
       ce_bank_acct_uses_all cbaua2,
       ce_gl_accounts_ccid cgac2,
       ( select 1 as cnum from dual union all
         select 2 as cnum from dual union all
         select 3 as cnum from dual union all
         select 4 as cnum from dual union all
         select 5 as cnum from dual
       ) col
      where
       cba2.bank_account_id = :p_bank_account_id and
       cbaua2.bank_account_id = cba2.bank_account_id and
       cgac2.bank_acct_use_id = cbaua2.bank_acct_use_id
    )
),
q_stmt_end_bal as
(
  select
    &apos;STMT END BALANCE&apos; record_type,
    null               operating_unit,
    null               transaction_number,
    to_date(null)      gl_date,
    to_date(null)      effective_date,
    null               agent,
    null               payment_method,
    null               transaction_subtype,
    null               je_name,
    to_number(null)    je_line,
    null               je_line_type,
    to_date(null)      je_posted_date,
    null               statement_number,
    to_number(null)    statement_line,
    null               statement_trx_type,
    null               status,
    :c_bank_curr_dsp   currency,
    to_number(null)    transaction_amount,
    to_number(:p_closing_balance)
                       accounted_amount,
    to_number(null)    gl_end_balance,
    to_number(:c_asset_cc_id) cash_account_ccid
  from
    dual
),
q_ar_receipts as
(
  /* query 1: fetch latest receipt history event which has hit gl cash account and is not reconciled
     query 2: fetch unreconciled cleared event for a reversed receipt */
  select
    &apos;RECEIPT&apos;          record_type,
    fnd_access_control_util.get_org_name(cr.org_id)
                       operating_unit,
    cr.receipt_number  transaction_number,
    crh.gl_date        gl_date,
    cr.receipt_date    effective_date,
    hz.party_name      agent,
    arm.name           payment_method,
    null               transaction_subtype,
    null               je_name,
    to_number(null)    je_line,
    null               je_line_type,
    to_date(null)      je_posted_date,
    null               statement_number,
    to_number(null)    statement_line,
    null               statement_trx_type,
    crh.status         status,
    cr.currency_code   currency,
    cr.amount          transaction_amount,
    decode(:c_bank_curr_dsp,
           :c_gl_currency_code, decode(crh.status,&apos;REVERSED&apos;,-crh.acctd_amount,crh.acctd_amount),
                                decode(crh.status,&apos;REVERSED&apos;,-crh.amount,crh.amount)
          )            accounted_amount,
    to_number(null)    gl_end_balance,
    gla.ar_asset_ccid cash_account_ccid
  from
    ar_cash_receipts cr,
    ar_cash_receipt_history crh,
    hz_cust_accounts cu,
    hz_parties hz,
    ar_receipt_methods arm,
    ce_bank_acct_uses_ou_v bau,
    ce_bank_accounts ba,
    ce_gl_accounts_ccid gla,
    ce_system_parameters sys
  where
    cr.cash_receipt_id = crh.cash_receipt_id and
    cr.remit_bank_acct_use_id = bau.bank_acct_use_id and
    bau.bank_account_id = :p_bank_account_id and
    bau.org_id = cr.org_id and
    bau.bank_account_id = ba.bank_account_id and
    ba.account_owner_org_id = sys.legal_entity_id and
    bau.ar_use_enable_flag = &apos;Y&apos; and
    gla.bank_acct_use_id = bau.bank_acct_use_id and
    crh.account_code_combination_id = gla.ar_asset_ccid and
    crh.status in(&apos;REMITTED&apos;, &apos;CLEARED&apos;, &apos;REVERSED&apos;) and
    crh.gl_date &lt;= :c_as_of_date and
    crh.gl_date &gt;= sys.cashbook_begin_date and
    decode(crh.status,&apos;REMITTED&apos;,nvl(crh.reversal_created_from,&apos;X&apos;),crh.created_from) &lt;&gt; &apos;RATE ADJUSTMENT TRIGGER&apos; and
    not ( crh.status = &apos;REMITTED&apos; and
          crh.created_from = &apos;RATE ADJUSTMENT TRIGGER&apos; and
          crh.reversal_created_from is null and
          crh.amount = - 1 * cr.amount
        ) and
    not ( crh.status =&apos;CLEARED&apos; and
          nvl(crh.reversal_created_from,&apos;x&apos;) =&apos;RATE ADJUSTMENT TRIGGER&apos;
        ) and
    crh.posting_control_id &gt; 0 and
    not exists
      ( select 1
        from ar_cash_receipt_history_all crh_r
        where
          crh_r.cash_receipt_history_id = crh.reversal_cash_receipt_hist_id and
          crh_r.gl_date &lt;= :c_as_of_date and
          crh_r.posting_control_id &gt; 0 and
          crh_r.created_from &lt;&gt; &apos;RATE ADJUSTMENT TRIGGER&apos;
      ) and
    cu.cust_account_id(+) = cr.pay_from_customer and
    hz.party_id(+) = cu.party_id and
    arm.receipt_method_id = cr.receipt_method_id and
    cr.status &lt;&gt; &apos;REV&apos; and
    not exists
      ( select null
        from
          ce_statement_recon_gt_v sr,
          ce_statement_lines sl,
          ce_statement_headers sh
        where
          sr.reference_id = crh.cash_receipt_history_id and
          sr.reference_type = &apos;RECEIPT&apos; and
          sr.status_flag = &apos;M&apos; and
          sr.current_record_flag = &apos;Y&apos; and
          sl.statement_line_id = sr.statement_line_id and
          sl.statement_header_id = sh.statement_header_id and
          sh.bank_account_id = :p_bank_account_id and
          sh.statement_date &lt;= :c_as_of_date
        union
        /* this union is required for receipts with rate adjustment that are reconciled. for such cases, the reference will be of the rate adjustment record */
        select null
        from
          ce_statement_recon_gt_v sr,
          ce_statement_lines sl,
          ce_statement_headers sh,
          ar_cash_receipt_history crh_rc
        where
          sr.reference_id = crh_rc.cash_receipt_history_id and
          sr.reference_type = &apos;RECEIPT&apos; and
          sr.status_flag = &apos;M&apos; and
          sr.current_record_flag = &apos;Y&apos; and
          sl.statement_line_id = sr.statement_line_id and
          sl.statement_header_id = sh.statement_header_id and
          sh.bank_account_id = :p_bank_account_id and
          sh.statement_date &lt;= :c_as_of_date and
          crh_rc.created_from = &apos;RATE ADJUSTMENT TRIGGER&apos; and
          crh_rc.cash_receipt_id = cr.cash_receipt_id
      ) and
    /* not exists to filter out receipts reversed without remittance */
    not exists
      ( select 1
        from
          ar_cash_receipt_history_all crh2
        where
          crh.cash_receipt_history_id = crh2.reversal_cash_receipt_hist_id and
          crh.status = &apos;REVERSED&apos; and
          crh2.status = &apos;CONFIRMED&apos;
      )
  union all
  select
    &apos;RECEIPT&apos;          record_type,
    fnd_access_control_util.get_org_name(cr.org_id)
                       operating_unit,
    cr.receipt_number  transaction_number,
    crh.gl_date        gl_date,
    cr.receipt_date    effective_date,
    hz.party_name      agent,
    arm.name           payment_method,
    null               transaction_subtype,
    null               je_name,
    to_number(null)    je_line,
    null               je_line_type,
    to_date(null)      je_posted_date,
    null               statement_number,
    to_number(null)    statement_line,
    null               statement_trx_type,
    crh.status         status,
    cr.currency_code   currency,
    cr.amount          transaction_amount,
    decode(:c_bank_curr_dsp,:c_gl_currency_code,crh.acctd_amount,crh.amount)
                       accounted_amount,
    to_number(null)    gl_end_balance,
    gla.ar_asset_ccid  cash_account_ccid
  from
    ar_cash_receipts cr,
    ar_cash_receipt_history crh2,
    ar_cash_receipt_history crh,
    hz_cust_accounts cu,
    hz_parties hz,
    ar_receipt_methods arm,
    ce_bank_acct_uses_ou_v bau,
    ce_gl_accounts_ccid gla,
    ce_bank_accounts ba,
    ce_system_parameters sys
  where
    cr.cash_receipt_id = crh.cash_receipt_id and
    cr.remit_bank_acct_use_id = bau.bank_acct_use_id and
    bau.bank_account_id = :p_bank_account_id and
    bau.org_id = cr.org_id and
    bau.bank_account_id = ba.bank_account_id and
    ba.account_owner_org_id = sys.legal_entity_id and
    bau.ar_use_enable_flag = &apos;Y&apos; and
    gla.bank_acct_use_id = bau.bank_acct_use_id and
    crh.account_code_combination_id = gla.ar_asset_ccid and
    crh.status in(&apos;REMITTED&apos;, &apos;CLEARED&apos;) and
    crh.gl_date &lt;= :c_as_of_date and
    crh.gl_date &gt;= sys.cashbook_begin_date and
    crh.gl_posted_date is not null and
    crh.created_from &lt;&gt; &apos;RATE ADJUSTMENT TRIGGER&apos; and
    crh2.cash_receipt_id = crh.cash_receipt_id and
    crh2.cash_receipt_history_id = crh.reversal_cash_receipt_hist_id and
    crh2.status = &apos;REVERSED&apos; and
    crh2.gl_date &lt;= :c_as_of_date and
    crh2.gl_date &gt;= sys.cashbook_begin_date and
    cu.cust_account_id(+) = cr.pay_from_customer and
    hz.party_id(+) = cu.party_id and
    arm.receipt_method_id = cr.receipt_method_id and
    (cr.status &lt;&gt; &apos;REV&apos; or
     (cr.status = &apos;REV&apos; and crh.reversal_gl_date &gt; :c_as_of_date)
    ) and
    not exists
      ( select null
        from
          ce_statement_recon_gt_v sr,
          ce_statement_lines sl,
          ce_statement_headers sh
        where
          sr.reference_id = crh.cash_receipt_history_id and
          sr.reference_type = &apos;RECEIPT&apos; and
          sr.status_flag = &apos;M&apos; and
          sr.current_record_flag = &apos;Y&apos; and
          sl.statement_line_id = sr.statement_line_id and
          sl.statement_header_id = sh.statement_header_id and
          sh.bank_account_id = :p_bank_account_id and
          sh.statement_date &lt;= :c_as_of_date
      )
),
q_ap_payments as
(
  /* query 1: checks have not hit gl cash, but are reconciled. (query 1 of union)
     query 2: checks have hit gl cash, but are not reconciled. (query 2 of union) */
  select
    &apos;PAYMENT&apos;                record_type,
    fnd_access_control_util.get_org_name(c.org_id)
                             operating_unit,
    to_char(c.check_number)  transaction_number,
    xle.event_date           gl_date,
    c.check_date             effective_date,
    c.vendor_name            agent,
    c.payment_method_code    payment_method,
    null                     transaction_subtype,
    null                     je_name,
    to_number(null)          je_line,
    null                     je_line_type,
    to_date(null)            je_posted_date,
    null                     statement_number,
    to_number(null)          statement_line,
    null                     statement_trx_type,
    c.status_lookup_code     status,
    c.currency_code          currency,
    c.amount                 transaction_amount,
    decode(:c_bank_curr_dsp,
           :c_gl_currency_code,nvl(nvl(c.cleared_base_amount,c.base_amount),c.amount)
                              ,c.amount
          )                  accounted_amount,
    to_number(null)          gl_end_balance,
    coalesce(gla.ap_asset_ccid,gla.asset_code_combination_id,ba.asset_code_combination_id) cash_account_ccid
  from
    ap_checks_all c,
    ce_bank_acct_uses_all bau,
    ce_gl_accounts_ccid gla,
    ce_security_profiles_gt ou,
    ce_bank_accounts ba,
    ce_system_parameters sys,
    xla_transaction_entities trx,
    xla_events xle
  where
    c.check_date &lt;=   trunc(:c_as_of_date) + 1 - 1/24/60/60 and
    c.ce_bank_acct_use_id = bau.bank_acct_use_id and
    c.org_id = bau.org_id and
    bau.bank_account_id = :p_bank_account_id and
    gla.bank_acct_use_id = bau.bank_acct_use_id and
    bau.org_id = ou.organization_id and
    ou.organization_type = &apos;OPERATING_UNIT&apos; and
    bau.bank_account_id = ba.bank_account_id and
    ba.account_owner_org_id = sys.legal_entity_id and
    trx.application_id = 200 and
    trx.ledger_id = sys.set_of_books_id and
    nvl(trx.source_id_int_1,-99) = c.check_id and
    trx.entity_code = &apos;AP_PAYMENTS&apos; and
    xle.application_id = trx.application_id and
    xle.entity_id = trx.entity_id and
    xle.event_type_code not in (&apos;PAYMENT CANCELLED&apos;,&apos;REFUND CANCELLED&apos;) and
    xle.event_number =
      ( select max(event_number)
        from
          xla_events xe2
        where xe2.application_id = xle.application_id and
          xe2.entity_id = xle.entity_id and
          xe2.event_date &lt;= :c_as_of_date and
          xe2.event_date &gt;= sys.cashbook_begin_date and
          xe2.event_status_code = &apos;P&apos; and
          xe2.event_type_code not in
            (&apos;PAYMENT MATURITY ADJUSTED&apos;,
             &apos;MANUAL PAYMENT ADJUSTED&apos;,
             &apos;PAYMENT ADJUSTED&apos;,
             &apos;PAYMENT CLEARING ADJUSTED&apos;,
             &apos;MANUAL REFUND ADJUSTED&apos;,
             &apos;REFUND ADJUSTED&apos;
            )
      ) and
    exists
      ( select  /*+ push_subq no_unnest*/ 1
        from
          ap_payment_history_all h2
        where
          h2.check_id = c.check_id and
          h2.transaction_type like decode(c.void_date, null, h2.transaction_type,&apos;%CANCEL%&apos;)
      ) and
    not exists
      ( select null
        from
          xla_ae_headers xeh,
          xla_ae_lines ael1
        where
          xeh.event_id = xle.event_id and
          xeh.application_id = xle.application_id and
          ael1.application_id = xeh.application_id and
          xeh.entity_id = xle.entity_id and
          ael1.ae_header_id = xeh.ae_header_id and
          xeh.event_type_code not in
            (&apos;PAYMENT UNCLEARED&apos;,
             &apos;PAYMENT CANCELLED&apos;,
             &apos;REFUND CANCELLED&apos;
            ) and
          ael1.accounting_class_code = &apos;CASH&apos;
      ) and
    /* check that payment is reconciled */
    exists
      ( select null
        from
          ce_statement_reconcils_all csr,
          ce_statement_lines csl,
          ce_statement_headers csh
        where
          csr.reference_id = c.check_id and
          csr.current_record_flag = &apos;Y&apos; and
          csr.reference_type = &apos;PAYMENT&apos; and
          csr.status_flag = &apos;M&apos; and
          csr.statement_line_id = csl.statement_line_id and
          csl.statement_header_id = csh.statement_header_id and
          csh.statement_date &lt;= :c_as_of_date and
          csh.statement_date &gt;= sys.cashbook_begin_date
      )
  union all
  select
    &apos;PAYMENT&apos;                record_type,
    fnd_access_control_util.get_org_name(c.org_id)
                             operating_unit,
    to_char(c.check_number)  transaction_number,
    aeh.accounting_date      gl_date,
    c.check_date             effective_date,
    c.vendor_name            agent,
    c.payment_method_code    payment_method,
    null                     transaction_subtype,
    null                     je_name,
    to_number(null)          je_line,
    null                     je_line_type,
    to_date(null)            je_posted_date,
    null                     statement_number,
    to_number(null)          statement_line,
    null                     statement_trx_type,
    c.status_lookup_code     status,
    c.currency_code          currency,
    c.amount                 transaction_amount,
    -1*decode(:c_bank_curr_dsp,
              :c_gl_currency_code,nvl(nvl(c.cleared_base_amount,c.base_amount),c.amount)
                                 ,c.amount
             )               accounted_amount,
    to_number(null)          gl_end_balance,
    coalesce(gla.ap_asset_ccid,gla.asset_code_combination_id,ba.asset_code_combination_id) cash_account_ccid
  from
    ap_checks_all c,
    ce_bank_acct_uses_all bau,
    ce_gl_accounts_ccid gla,
    ce_security_profiles_gt ou,
    ce_bank_accounts ba,
    ce_system_parameters sys,
    xla_transaction_entities trx,
    xla_ae_headers aeh
  where
    c.check_date &lt;=  trunc(:c_as_of_date) + 1 - 1/24/60/60 and
    c.ce_bank_acct_use_id = bau.bank_acct_use_id and
    c.org_id = bau.org_id and
    bau.bank_account_id = :p_bank_account_id and
    gla.bank_acct_use_id = bau.bank_acct_use_id and
    bau.org_id = ou.organization_id and
    ou.organization_type = &apos;OPERATING_UNIT&apos; and
    bau.bank_account_id = ba.bank_account_id and
    ba.account_owner_org_id = sys.legal_entity_id and
    nvl(trx.source_id_int_1,-99) = c.check_id and
    trx.entity_code = &apos;AP_PAYMENTS&apos; and
    trx.application_id = 200 and
    trx.ledger_id = sys.set_of_books_id and
    aeh.entity_id = trx.entity_id and
    aeh.application_id = trx.application_id and
    aeh.application_id = 200 and
    /* fetch latest accounted event before as_of_date and check that it hits the gl cash account */
    aeh.event_type_code in
      (&apos;PAYMENT CLEARED&apos;,
       &apos;PAYMENT CREATED&apos;,
       &apos;REFUND RECORDED&apos;,
       &apos;PAYMENT MATURED&apos;
      ) and
    aeh.ledger_id = sys.set_of_books_id and
    aeh.event_id =
      ( select max(event_id)
        from
          xla_events xe
        where
          xe.application_id = 200 and
          xe.entity_id = trx.entity_id and
          xe.event_number =
            ( select max(event_number)
              from
                xla_events xe2
              where
                xe2.application_id = 200 and
                xe2.entity_id = xe.entity_id and
                xe2.event_date &lt;= :c_as_of_date and
                xe2.event_date &gt;= sys.cashbook_begin_date and
                xe2.event_status_code = &apos;P&apos; and
                xe2.event_type_code not in
                  (&apos;PAYMENT MATURITY ADJUSTED&apos;,
                   &apos;MANUAL PAYMENT ADJUSTED&apos;,
                   &apos;PAYMENT ADJUSTED&apos;,
                   &apos;PAYMENT CLEARING ADJUSTED&apos;,
                   &apos;MANUAL REFUND ADJUSTED&apos;,
                   &apos;REFUND ADJUSTED&apos;
                  )
            )
      ) and
    exists
      ( select &apos;x&apos;
        from
          xla_ae_lines ael
        where
          aeh.ae_header_id = ael.ae_header_id and
          ael.application_id = 200 and
          ael.accounting_class_code = &apos;CASH&apos;
      ) and
    exists
      ( select 1
        from
          ap_payment_history_all h2
        where
          h2.check_id = c.check_id and
          h2.transaction_type like decode(c.void_date, null, h2.transaction_type, &apos;%CANCEL%&apos;)
      ) and
    /* check that payment is not reconciled */
    not exists
      ( select /*+ push_subq no_unnest */ null
        from
          ce_statement_reconcils_all csr,
          ce_statement_lines csl,
          ce_statement_headers csh
        where
          csr.reference_id = c.check_id and
          csr.reference_type = &apos;PAYMENT&apos; and
          csr.status_flag = &apos;M&apos; and
          csr.current_record_flag = &apos;Y&apos; and
          csr.statement_line_id = csl.statement_line_id and
          csl.statement_header_id = csh.statement_header_id and
          csh.statement_date &lt;= :c_as_of_date
      )
),
q_cashflows as
(
  select
    &apos;CASHFLOW&apos;               record_type,
    null                     operating_unit,
    to_char(ca.cashflow_id)  transaction_number,
    ch.accounting_date       gl_date,
    ca.cashflow_date         effective_date,
    nvl(xle.name,ca.customer_text) agent,
    null                     payment_method,
    trxn.transaction_sub_type_name transaction_subtype,
    null                     je_name,
    to_number(null)          je_line,
    null                     je_line_type,
    to_date(null)            je_posted_date,
    null                     statement_number,
    to_number(null)          statement_line,
    null                     statement_trx_type,
    l1.meaning               status,
    ca.cashflow_currency_code currency,
    ca.cashflow_amount       transaction_amount,
    decode(ca.cashflow_direction,&apos;RECEIPT&apos;,(-1),&apos;PAYMENT&apos;,(1)) * nvl(ch.cleared_amount,ca.cashflow_amount)
                             accounted_amount,
    to_number(null)          gl_end_balance,
    coalesce(gla.xtr_asset_ccid,gla.asset_code_combination_id,ba.asset_code_combination_id) cash_account_ccid
  from
    ce_cashflows ca,
    ce_cashflow_acct_h ch,
    ce_bank_accounts ba,
    ce_bank_acct_uses_all bau,
    ce_gl_accounts_ccid gla,
    ce_trxns_subtype_codes trxn,
    xle_firstparty_information_v xle,
    ce_lookups l1,
    ce_system_parameters sys
  where
    ca.cashflow_bank_account_id  = :p_bank_account_id and
    ca.cashflow_legal_entity_id  = sys.legal_entity_id and
    ca.cashflow_id  = ch.cashflow_id and
    ba.bank_account_id = ca.cashflow_bank_account_id and
    bau.bank_account_id = ca.cashflow_bank_account_id and
    bau.legal_entity_id = ca.cashflow_legal_entity_id and
    gla.bank_acct_use_id = bau.bank_acct_use_id and
    ca.source_trxn_subtype_code_id = trxn.trxn_subtype_code_id(+) and
    ch.accounting_date  &gt;= sys.cashbook_begin_date and
    ca.counterparty_party_id = xle.party_id(+) and
    l1.lookup_type = &apos;CASHFLOW_STATUS_CODE&apos; and
    l1.lookup_code = ca.cashflow_status_code and
    ca.cashflow_status_code = &apos;RECONCILED&apos; and
    ch.event_id =
      ( select nvl(max(a.event_id),-1)
        from
          ce_cashflow_acct_h a
        where
          a.cashflow_id = ch.cashflow_id and
          trunc(a.accounting_date) &lt;= :c_as_of_date
      ) and
    ch.event_type = decode(ca.source_trxn_type,&apos;BAT&apos;,&apos;CE_BAT_CLEARED&apos;,&apos;STMT&apos;,&apos;CE_STMT_RECORDED&apos;) and
    ch.status_code = &apos;UNACCOUNTED&apos;
  union
  select
    &apos;CASHFLOW&apos;               record_type,
    null                     operating_unit,
    to_char(ca.cashflow_id)  transaction_number,
    ch.accounting_date       gl_date,
    ca.cashflow_date         effective_date,
    nvl(xle.name,ca.customer_text) agent,
    null                     payment_method,
    trxn.transaction_sub_type_name transaction_subtype,
    null                     je_name,
    to_number(null)          je_line,
    null                     je_line_type,
    to_date(null)            je_posted_date,
    null                     statement_number,
    to_number(null)          statement_line,
    null                     statement_trx_type,
    l1.meaning               status,
    ca.cashflow_currency_code currency,
    ca.cashflow_amount       transaction_amount,
    decode(ca.cashflow_direction,&apos;RECEIPT&apos;,(1),&apos;PAYMENT&apos;,(-1)) * nvl(ch.cleared_amount,ca.cashflow_amount)
                             accounted_amount,
    to_number(null)          gl_end_balance,
    coalesce(gla.xtr_asset_ccid,gla.asset_code_combination_id,ba.asset_code_combination_id) cash_account_ccid
  from
    ce_cashflows ca,
    ce_cashflow_acct_h ch,
    ce_bank_accounts ba,
    ce_bank_acct_uses_all bau,
    ce_gl_accounts_ccid gla,
    xla_events e,
    xla_ae_headers eh,
    xla_ae_lines el,
    ce_trxns_subtype_codes trxn,
    xle_firstparty_information_v xle,
    ce_lookups l1,
    ce_system_parameters sys
  where
    ca.cashflow_bank_account_id = :p_bank_account_id and
    ca.source_trxn_subtype_code_id = trxn.trxn_subtype_code_id(+) and
    ca.cashflow_legal_entity_id = sys.legal_entity_id and
    ca.cashflow_id = ch.cashflow_id and
    ba.bank_account_id = ca.cashflow_bank_account_id and
    bau.bank_account_id = ca.cashflow_bank_account_id and
    bau.legal_entity_id = ca.cashflow_legal_entity_id and
    gla.bank_acct_use_id = bau.bank_acct_use_id and
    ch.event_id = e.event_id and
    eh.event_id = e.event_id and
    el.ae_header_id = eh.ae_header_id and
    el.accounting_class_code = &apos;CASH&apos; and
    ch.accounting_date &gt;= sys.cashbook_begin_date and
    ca.counterparty_party_id = xle.party_id(+) and
    l1.lookup_type = &apos;CASHFLOW_STATUS_CODE&apos; and
    l1.lookup_code = ca.cashflow_status_code and
    ca.cashflow_status_code = &apos;CLEARED&apos; and
    ch.event_id =
      ( select nvl(max(a.event_id),-1)
        from
          ce_cashflow_acct_h a
        where
          a.cashflow_id = ch.cashflow_id and
          trunc(a.accounting_date) &lt;= :c_as_of_date
      ) and
    ch.event_type = decode(ca.source_trxn_type,&apos;BAT&apos;,&apos;CE_BAT_CLEARED&apos;,&apos;STMT&apos;,&apos;CE_STMT_RECORDED&apos;) and
    ch.status_code = &apos;ACCOUNTED&apos;
  union
  select
    &apos;CASHFLOW&apos;               record_type,
    null                     operating_unit,
    to_char(ca.cashflow_id)  transaction_number,
    ch.accounting_date       gl_date,
    ca.cashflow_date         effective_date,
    nvl(xle.name,ca.customer_text) agent,
    null                     payment_method,
    trxn.transaction_sub_type_name transaction_subtype,
    null                     je_name,
    to_number(null)          je_line,
    null                     je_line_type,
    to_date(null)            je_posted_date,
    null                     statement_number,
    to_number(null)          statement_line,
    null                     statement_trx_type,
    l1.meaning               status,
    ca.cashflow_currency_code currency,
    ca.cashflow_amount       transaction_amount,
    decode(ca.cashflow_direction,&apos;RECEIPT&apos;,(-1),&apos;PAYMENT&apos;,(1)) * nvl(ch.cleared_amount,ca.cashflow_amount)
                             accounted_amount,
    to_number(null)          gl_end_balance,
    coalesce(gla.xtr_asset_ccid,gla.asset_code_combination_id,ba.asset_code_combination_id) cash_account_ccid
  from
    ce_cashflows ca,
    ce_cashflow_acct_h ch,
    ce_bank_accounts ba,
    ce_bank_acct_uses_all bau,
    ce_gl_accounts_ccid gla,
    ce_trxns_subtype_codes trxn,
    xle_firstparty_information_v xle,
    ce_lookups l1,
    ce_system_parameters sys
  where
    ca.cashflow_bank_account_id   = :p_bank_account_id and
    ca.source_trxn_subtype_code_id = trxn.trxn_subtype_code_id(+) and
    ca.cashflow_legal_entity_id = sys.legal_entity_id and
    ca.cashflow_id = ch.cashflow_id and
    ba.bank_account_id = ca.cashflow_bank_account_id and
    bau.bank_account_id = ca.cashflow_bank_account_id and
    bau.legal_entity_id = ca.cashflow_legal_entity_id and
    gla.bank_acct_use_id = bau.bank_acct_use_id and
    ch.accounting_date &gt;= sys.cashbook_begin_date and
    ca.counterparty_party_id = xle.party_id(+) and
    l1.lookup_type = &apos;CASHFLOW_STATUS_CODE&apos; and
    l1.lookup_code = ca.cashflow_status_code and
    ca.cashflow_status_code = &apos;CREATED&apos; and
    ch.event_id =
      ( select nvl(max(a.event_id),-1)
        from
          ce_cashflow_acct_h a
        where
          a.cashflow_id = ch.cashflow_id and
          trunc(a.accounting_date) &lt;= :c_as_of_date
      ) and
    ( (ch.event_type = &apos;CE_BAT_UNCLEARED&apos; and
       ch.status_code  = &apos;ACCOUNTED&apos;
      ) or
      (ch.event_type  = &apos;CE_BAT_CREATED&apos;
      )
    ) and
    exists
      ( select null
        from
          ce_statement_lines csl,
          ce_statement_headers csh,
          ce_transaction_codes_v cod
        where
          csl.trx_type in (&apos;DEBIT&apos;,&apos;CREDIT&apos;,&apos;SWEEP_IN&apos;,&apos;SWEEP_OUT&apos;) and
          csl.trx_code = cod.trx_code and
          cod.bank_account_id = :p_bank_account_id and
          cod.reconcile_flag = &apos;CE&apos; and
          csl.bank_trx_number = ca.bank_trxn_number and
          csh.statement_header_id = csl.statement_header_id and
          csh.bank_account_id = :p_bank_account_id
      )
),
q_gl_je_lines as
(
  select
    &apos;JE_LINE&apos;          record_type,
    null               operating_unit,
    null               transaction_number,
    jel.effective_date gl_date,
    jel.effective_date effective_date,
    null               agent,
    null               payment_method,
    null               transaction_subtype,
    jeh.name           je_name,
    jel.je_line_num    je_line,
    cel.meaning        je_line_type,
    jeh.posted_date    je_posted_date,
    null               statement_number,
    to_number(null)    statement_line,
    null               statement_trx_type,
    gll.meaning        status,
    jeh.currency_code  currency,
    decode(nvl(jel.entered_dr,0),0, jel.entered_cr, jel.entered_dr)
                       transaction_amount,
    decode(:c_bank_curr_dsp,
           :c_gl_currency_code,decode(nvl(jel.accounted_dr,0),0, nvl(-1*jel.accounted_cr,0), nvl(jel.accounted_dr,0)),
                               decode(nvl(jel.entered_dr,0)  ,0, nvl(-1*jel.entered_cr,0)  , nvl(jel.entered_dr,0))
          )            accounted_amount,
    to_number(null)    gl_end_balance,
    aba.asset_ccid     cash_account_ccid
  from
    gl_je_lines jel,
    gl_je_headers jeh,
    ce_lookups cel,
    gl_lookups gll,
    gl_sets_of_books sob,
    ( select
        cba.bank_account_id,
        cba.currency_code,
        cba.asset_code_combination_id asset_ccid
      from ce_bank_accounts cba
      union
      select
        cba.bank_account_id,
        cba.currency_code,
        cgl.ar_asset_ccid asset_ccid
      from
        ce_bank_accounts cba,
        ce_bank_acct_uses_ou_v cbu,
        ce_gl_accounts_ccid cgl
      where
        cba.bank_account_id = cbu.bank_account_id and
        cbu.bank_acct_use_id = cgl.bank_acct_use_id and
        cgl.ar_asset_ccid is not null
      union
      select
        cba.bank_account_id,
        cba.currency_code,
        cgl.ap_asset_ccid asset_ccid
      from
        ce_bank_accounts cba,
        ce_bank_acct_uses_ou_v cbu,
        ce_gl_accounts_ccid cgl
      where
        cba.bank_account_id = cbu.bank_account_id and
        cbu.bank_acct_use_id = cgl.bank_acct_use_id and
        cgl.ap_asset_ccid is not null
    ) aba
  where
    jel.ledger_id = to_number(:c_set_of_books_id) and
    jel.code_combination_id = aba.asset_ccid and
    aba.bank_account_id = :p_bank_account_id and
    sob.set_of_books_id = to_number(:c_set_of_books_id) and
    decode(aba.currency_code,sob.currency_code, jeh.currency_code, aba.currency_code) = jeh.currency_code and
    jel.status = &apos;P&apos; and
    jel.effective_date &lt;= :c_as_of_date and
    jel.effective_date &gt;= to_date(:c_cashbook_begin_date) and
    jeh.je_header_id = jel.je_header_id and
    jeh.je_source not in
      (&apos;Payables&apos;,
       &apos;Receivables&apos;,
       &apos;AP Translator&apos;,
       &apos;AR Translator&apos;,
       &apos;Treasury&apos;,
       &apos;Cash Management&apos;,
       &apos;Consolidation&apos;,
       &apos;Payroll&apos;
      ) and
    jeh.je_category &lt;&gt; &apos;Revaluation&apos; and
    cel.lookup_type = &apos;TRX_TYPE&apos; and
    cel.lookup_code = decode(decode(nvl(jel.entered_dr,0),0,nvl(jel.accounted_dr,0),jel.entered_dr),
                             0, &apos;JE_CREDIT&apos;
                              , &apos;JE_DEBIT&apos;
                            ) and
    (decode(nvl(jel.entered_dr,0), 0, nvl(jel.accounted_dr, 0), jel.entered_dr) = 0 or
     decode(nvl(jel.entered_cr,0), 0, nvl(jel.accounted_cr, 0), jel.entered_cr) = 0
    ) and
    gll.lookup_type = &apos;MJE_BATCH_STATUS&apos; and
    gll.lookup_code = jel.status and
    jeh.actual_flag = &apos;A&apos; and
    not exists
      ( select
          null
        from
          ce_statement_recon_gt_v sr,
          ce_statement_lines sl,
          ce_statement_headers sh
        where
          sr.reference_id = jel.je_line_num and
        sr.reference_type = &apos;JE_LINE&apos; and
        sr.je_header_id = jel.je_header_id and
        sr.status_flag = &apos;M&apos; and
        sr.current_record_flag = &apos;Y&apos; and
        sl.statement_line_id = sr.statement_line_id and
        sl.statement_header_id = sh.statement_header_id and
        sh.statement_date &lt;= :c_as_of_date and
        sh.statement_date &gt;= to_date(:c_cashbook_begin_date)
      )
),
q_stmt_error_lines as
(
  select
    &apos;STMT_LINE_ERROR&apos;  record_type,
    null               operating_unit,
    null               transaction_number,
    sh.gl_date         gl_date,
    sl.trx_date        effective_date,
    null               agent,
    null               payment_method,
    null               transaction_subtype,
    null               je_name,
    to_number(null)    je_line,
    null               je_line_type,
    to_date(null)      je_posted_date,
    sh.statement_number statement_number,
    sl.line_number     statement_line,
    sl.trx_type        statement_trx_type,
    &apos;ERROR&apos;            status,
    nvl(sl.currency_code,nvl(sh.currency_code,aba.currency_code))
                       currency,
    decode(nvl(sl.currency_code,nvl(sh.currency_code,aba.currency_code)),
           sob.currency_code, sl.amount,nvl(sl.original_amount, sl.amount)
          )            transaction_amount,
    decode(sl.trx_type,
           &apos;CREDIT&apos;     , - sl.amount,
           &apos;MISC_CREDIT&apos;, - sl.amount,
           &apos;STOP&apos;       , - sl.amount,
           &apos;DEBIT&apos;      , sl.amount,
           &apos;MISC_DEBIT&apos; , sl.amount,
           &apos;NSF&apos;        , sl.amount,
           &apos;REJECTED&apos;   , sl.amount,
                          0
          )            accounted_amount,
    to_number(null)    gl_end_balance,
    aba.asset_code_combination_id cash_account_ccid
  from
    ce_statement_lines sl,
    ce_statement_headers sh,
    ce_bank_accts_gt_v aba,
    gl_sets_of_books sob,
    ce_system_parameters sys
  where
    sl.statement_header_id = sh.statement_header_id and
    sh.bank_account_id = :p_bank_account_id and
    sh.statement_date &lt;= :c_as_of_date and
    sh.statement_date &gt;= sys.cashbook_begin_date and
    sl.status = &apos;ERROR&apos; and
    aba.bank_account_id = sh.bank_account_id and
    sob.set_of_books_id = sys.set_of_books_id and
    sys.legal_entity_id = aba.account_owner_org_id
)
--
-- Main Query Starts Here
--
select
  (select xep.name legal_entity
   from   xle_entity_profiles xep,
          ce_bank_accounts cba
   where  xep.legal_entity_id = cba.account_owner_org_id and
          cba.bank_account_id = :p_bank_account_id
  )                     legal_entity,
  :c_name               ledger,
  :p_period_name        period,
  :c_account_number_dsp bank_account_num,
  :c_account_name_dsp   bank_account_name,
  :c_bank_curr_dsp      bank_account_currency,
  :c_bank_name_dsp      bank_name,
  :c_bank_branch_dsp    bank_branch,
  case x.seq
  when 1 then &apos;General Ledger Cash Account Balance&apos;
  when 2 then &apos;Bank Statement Closing Balance&apos;
  when 3 then &apos;Unreconciled Receipts&apos;
  when 4 then &apos;Unreconciled Payments&apos;
  when 5 then &apos;Unreconciled Cashflows&apos;
  when 6 then &apos;Unreconciled Journal Lines&apos;
  when 7 then &apos;Stmnt Lines Marked As Errors&apos;
  end                        record_type,
  x.gl_date,
  x.effective_date,
  x.currency,
  x.transaction_amount,
  x.accounted_amount,
  x.operating_unit,
  x.agent,
  x.transaction_number,
  x.payment_method,
  x.transaction_subtype,
  x.je_name,
  x.je_line,
  x.je_line_type,
  x.je_posted_date,
  x.statement_number,
  x.statement_line,
  x.statement_trx_type,
  x.status,
  x.gl_end_balance,
  case when x.seq = 1
  then sum(x.gl_end_balance) over () - sum(x.accounted_amount) over ()
  else to_number(null)
  end   difference_amount,
  --gl cash account
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;VALUE&apos;) gl_company_code,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;GL_BALANCING&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) gl_company_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;VALUE&apos;) gl_account_code,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;GL_ACCOUNT&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) gl_account_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;FA_COST_CTR&apos;, &apos;Y&apos;, &apos;VALUE&apos;) gl_cost_center_code,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;FA_COST_CTR&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) gl_cost_center_desc,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;ALL&apos;, &apos;Y&apos;, &apos;VALUE&apos;) gl_cash_account,
  fnd_flex_xml_publisher_apis.process_kff_combination_1(&apos;acct_flex_bal_seg&apos;, &apos;SQLGL&apos;, &apos;GL#&apos;, :c_chart_of_accounts_id, NULL, x.cash_account_ccid, &apos;ALL&apos;, &apos;Y&apos;, &apos;DESCRIPTION&apos;) gl_cash_account_desc,
  -- pivot labels
  :c_bank_name_dsp || &apos; - &apos; || :c_account_number_dsp || &apos; - &apos; || :c_account_name_dsp || &apos; (&apos; || :c_bank_curr_dsp || &apos;)&apos; bank_account,
  case x.seq
  when 1 then &apos;A: General Ledger Cash Account Balance&apos;
  when 2 then &apos;B: Bank Statement Closing Balance&apos;
  when 3 then &apos;C: + Unreconciled Receipts&apos;
  when 4 then &apos;D: +/- Unreconciled Payments&apos;
  when 5 then &apos;E: +/- Unreconciled Cashflows&apos;
  when 6 then &apos;F: +/- Unreconciled Journal Lines&apos;
  when 7 then &apos;G: +/- Stmnt Lines Marked As Errors&apos;
  end                        record_type_label,
  x.seq
from
  ( select 1 seq, q_gl_end_bal.* from q_gl_end_bal
    union all
    select 2 seq, q_stmt_end_bal.* from q_stmt_end_bal
    union all
    select 3 seq, q_ar_receipts.* from q_ar_receipts
    union all
    select 4 seq, q_ap_payments.* from q_ap_payments
    union all
    select 5 seq, q_cashflows.* from q_cashflows
    union all
    select 6 seq, q_gl_je_lines.* from q_gl_je_lines
    union all
    select 7 seq, q_stmt_error_lines.* from q_stmt_error_lines
  ) x
where
  1=1
order by
  x.seq,
  x.gl_date nulls  first,
  x.effective_date nulls first,
  x.agent,
  x.je_name,
  x.je_line,
  x.statement_number,
  x.statement_line,
  x.transaction_number</SQL_TEXT>
  <ENABLED>Y</ENABLED>
  <XDO_APPLICATION_SHORT_NAME>CE</XDO_APPLICATION_SHORT_NAME>
  <XDO_DATA_SOURCE_CODE>CEXRECRE_XML</XDO_DATA_SOURCE_CODE>
  <NUMBER_FORMAT>#,##0.00;[Red]-#,##0.00</NUMBER_FORMAT>
  <REQUIRED_PARAMETERS>(:Bank_Account_Name is not null or :Bank_Account_Number is not null)</REQUIRED_PARAMETERS>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <REPORT_NAME>CE تقرير تسوية الأستاذ العام</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: كشوف الحسابات - تسوية
Application: إدارة النقدية
Source: تقرير تسوية الأستاذ العام
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <REPORT_NAME>CE Rechnungswesenabstimmung</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Kontoauszüge - Abstimmung
Application: Cash Management
Source: Rechnungswesenabstimmung
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <REPORT_NAME>CE Conciliación en Contabilidad General</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Conciliación - Estados
Application: Cash Management
Source: Conciliación en Contabilidad General
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <REPORT_NAME>CE Etat du rapprochement dans Oracle General Ledger</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Relevés - Rapprochement
Application: Cash Management
Source: Etat du rapprochement dans Oracle General Ledger
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <REPORT_NAME>CE Rapporto Quadratura General Ledger</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Rendiconti - Quadratura
Application: Gestione flussi di cassa
Source: Rapporto Quadratura General Ledger
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <REPORT_NAME>CE General Ledger調整レポート</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: 取引明細書 - 調整
Application: Cash Management
Source: General Ledger調整レポート
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <REPORT_NAME>CE GL 대사 보고서</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: 명세서 - 대사
Application: Cash Management
Source: GL 대사 보고서
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <REPORT_NAME>CE Relatório de Reconciliação do General Ledger</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Demonstrativos - Reconciliação
Application: Cash Management
Source: Relatório de Reconciliação do General Ledger
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <REPORT_NAME>CE Отчет о выверке по Главной книге</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Выписки - выверка
Application: Движение денежных средств
Source: Отчет о выверке по Главной книге
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <REPORT_NAME>CE Avstämningsrapport</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Utdrag - Avstämning
Application: Cash Management
Source: Huvudbok: Avstämningsrapport
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <REPORT_NAME>CE Genel Muhasebe Mutabakat Raporu</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: Ekstreler - Mutabakat
Application: Nakit Yönetimi
Source: Genel Muhasebe Mutabakat Raporu
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>CE General Ledger Reconciliation</REPORT_NAME>
    <DESCRIPTION>Application: Cash Management
Description: Bank Statements - General Ledger Reconciliation

Provides equivalent functionality to the following standard Oracle Forms/Reports
- General Ledger Reconciliation Report
  Applicable Templates:
  Pivot: Reconciliation Summary

Source: General Ledger Reconciliation Report
Short Name: CEXRECRE
DB package: CE_CEXRECRE_XMLP_PKG</DESCRIPTION>
    <REQUIRED_PARAMETERS_MESSAGE>Please specify either the Bank Account Name or Bank Account Number Parameter</REQUIRED_PARAMETERS_MESSAGE>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <REPORT_NAME>CE 总帐管理系统调节报表</REPORT_NAME>
    <DESCRIPTION>Imported from BI Publisher
Description: 报表 - 调节
Application: 现金管理系统
Source: 总帐管理系统调节报表
Short Name: CEXRECRE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>R12 only</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_account_name_dsp</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_account_number_dsp</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_adjusted_bank_balance</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_all_translation</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_as_of_date</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_asset_cc_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_bank_branch_dsp</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_bank_curr_dsp</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_bank_name_dsp</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_cashbook_begin_date</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_chart_of_accounts_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_difference</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_flexdata</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_gl_currency_code</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_name</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_set_of_books_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:c_the_end</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_bank_account_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_clearing_ccid</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_closing_balance</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_closing_statement_number</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_conc_request_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_debug_mode</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_period_name</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_recon_accounting_flag</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_recon_used_flag</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_sql_trace</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_summ_or_detail</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_test_layout</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>-10</DISPLAY_SEQUENCE>
    <ANCHOR>:p_bank_account_id</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select
 cba.bank_account_id
from
 ce_bank_accounts cba
where
 (:$flex$.Bank_Account_Name is not null or :$flex$.Bank_Account_Number is not null) and
 (:$flex$.Bank_Account_Name is null or cba.bank_account_name = :$flex$.Bank_Account_Name) and
 (:$flex$.Bank_Account_Number is null or cba.masked_account_num = :$flex$.Bank_Account_Number)</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>AR</LANGUAGE>
      <PARAMETER_NAME>رقم حساب البنك</PARAMETER_NAME>
      <DESCRIPTION>رقم حساب البنك</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Kontonummer</PARAMETER_NAME>
      <DESCRIPTION>Kontonummer</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>ID du compte bancaire</PARAMETER_NAME>
      <DESCRIPTION>Numéro de compte bancaire</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>I</LANGUAGE>
      <PARAMETER_NAME>Numero conto bancario</PARAMETER_NAME>
      <DESCRIPTION>Numero conto bancario</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Bank Account Id</PARAMETER_NAME>
      <DESCRIPTION>Bank Account Number ID</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>银行帐号</PARAMETER_NAME>
      <DESCRIPTION>银行帐号</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>1=1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>CE Legal Entities</LOV_NAME>
    <LOV_GUID>C9C878DC04AA0259E0530100007FB368</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
 xep.name value,
 null description
from
 xle_entity_profiles xep,
 ce_bank_accounts cba,
 ce_bank_acct_uses_all cbaua,
 ce_security_profiles_v cspv
where
 xep.legal_entity_id = cba.account_owner_org_id and
 cba.bank_account_id = cbaua.bank_account_id and
 ((cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;OPERATING_UNIT&apos;) or
 (cbaua.legal_entity_id = cspv.organization_id and cspv.organization_type = &apos;LEGAL_ENTITY&apos;) or
 (cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;BUSINESS_GROUP&apos;)
 ) and
 trunc(nvl(cbaua.end_date,sysdate)) &gt;= trunc(sysdate)</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select
clbovv.name
from
ce_le_bg_ou_vs_v clbovv,
hr_operating_units hou,
gl_ledgers gl,
gl_ledger_config_details glcd,
xle_firstparty_information_v xfi
where
hou.organization_id=nvl((select mgoat.organization_id from mo_glob_org_access_tmp mgoat where mgoat.organization_id=nvl(fnd_profile.value(&apos;DEFAULT_ORG_ID&apos;),mgoat.organization_id) and rownum=1),fnd_global.org_id) and
hou.set_of_books_id=gl.ledger_id and
gl.object_type_code=&apos;L&apos; and
gl.configuration_id=glcd.configuration_id and
glcd.object_type_code=&apos;LEGAL_ENTITY&apos; and
glcd.setup_step_code=&apos;NONE&apos; and
glcd.object_id=xfi.legal_entity_id and
xfi.legal_entity_id = clbovv.legal_entity_id</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Entité légale</PARAMETER_NAME>
      <DESCRIPTION>Legal Entity</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Legal Entity</PARAMETER_NAME>
      <DESCRIPTION>Legal Entity</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>1=1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>CE Internal Bank Account Name (Secured)</LOV_NAME>
    <LOV_GUID>C8A7FD7AC920667BE0530100007F4469</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>with ce_sec_v as
(select  /*+ materialize */
   cbaua.bank_account_id,
   cspv.organization_type
 from 
   ce_bank_acct_uses_all cbaua,
   ce_security_profiles_v cspv
 where
    ((cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;OPERATING_UNIT&apos;) or 
     (cbaua.legal_entity_id = cspv.organization_id and cspv.organization_type = &apos;LEGAL_ENTITY&apos;) or 
     (cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;BUSINESS_GROUP&apos;)
    ) and
   trunc(nvl(cbaua.end_date,sysdate)) &gt;= trunc(sysdate)
)
select
 cba.bank_account_name value,
 hpb.party_name||&apos; (&apos;||cba.currency_code||&apos;) Account#: &apos; || cba.masked_account_num description
from
 ce_bank_accounts cba,
 hz_parties hpb,
 hz_parties hpbb
where
 cba.account_classification = &apos;INTERNAL&apos; and
 nvl(cba.netting_acct_flag,&apos;N&apos;) = &apos;N&apos; and
 hpb.party_id = cba.bank_id and
 hpbb.party_id = cba.bank_branch_id and
 (:$flex$.legal_entity is null or
  cba.account_owner_org_id in (select xep.legal_entity_id from xle_entity_profiles xep where xxen_util.contains(:$flex$.legal_entity,xep.name) = &apos;Y&apos;)
 ) and
 hpb.party_name = nvl(:$flex$.bank_name,hpb.party_name) and
 hpbb.party_name = nvl(:$flex$.bank_branch,hpbb.party_name) and
 ( ((cba.ap_use_allowed_flag = &apos;Y&apos; or cba.ar_use_allowed_flag =&apos;Y&apos;) and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;OPERATING_UNIT&apos;)
   ) or
   (cba.xtr_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;LEGAL_ENTITY&apos;)
   ) or
   (cba.pay_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;BUSINESS_GROUP&apos;)
   )
 )
order by
 cba.bank_account_name
</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Nom du compte bancaire</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Bank Account Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>1=1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>CE Internal Bank Account Number (secured, masked)</LOV_NAME>
    <LOV_GUID>C8A7FD7AC91F667BE0530100007F4469</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>with ce_sec_v as
(select  /*+ materialize */
   cbaua.bank_account_id,
   cspv.organization_type
 from 
   ce_bank_acct_uses_all cbaua,
   ce_security_profiles_v cspv
 where
    ((cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;OPERATING_UNIT&apos;) or 
     (cbaua.legal_entity_id = cspv.organization_id and cspv.organization_type = &apos;LEGAL_ENTITY&apos;) or 
     (cbaua.org_id = cspv.organization_id and cspv.organization_type = &apos;BUSINESS_GROUP&apos;)
    ) and
   trunc(nvl(cbaua.end_date,sysdate)) &gt;= trunc(sysdate)
)
select
 cba.masked_account_num value,
 hpb.party_name||&apos; (&apos;||cba.currency_code||&apos;) Account:&apos; || cba.bank_account_name description
from
 ce_bank_accounts cba,
 hz_parties hpb,
 hz_parties hpbb
where
 cba.account_classification = &apos;INTERNAL&apos; and
 nvl(cba.netting_acct_flag,&apos;N&apos;) = &apos;N&apos; and
 hpb.party_id = cba.bank_id and
 hpbb.party_id = cba.bank_branch_id and
 (:$flex$.legal_entity is null or
  cba.account_owner_org_id in (select xep.legal_entity_id from xle_entity_profiles xep where xxen_util.contains(:$flex$.legal_entity,xep.name) = &apos;Y&apos;)
 ) and
 hpb.party_name = nvl(:$flex$.bank_name,hpb.party_name) and
 hpbb.party_name = nvl(:$flex$.bank_branch,hpbb.party_name) and
 ( ((cba.ap_use_allowed_flag = &apos;Y&apos; or cba.ar_use_allowed_flag =&apos;Y&apos;) and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;OPERATING_UNIT&apos;)
   ) or
   (cba.xtr_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;LEGAL_ENTITY&apos;)
   ) or
   (cba.pay_use_allowed_flag =&apos;Y&apos; and 
    exists (select null from ce_sec_v where ce_sec_v.bank_account_id = cba.bank_account_id and ce_sec_v.organization_type = &apos;BUSINESS_GROUP&apos;)
   )
 )
order by
 cba.masked_account_num
</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Numéro de compte bancaire</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Bank Account Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>:p_period_name</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
period_name id,
period_name value,
null description
from
gl_period_statuses
where application_id=101
and set_of_books_id in (select set_of_books_id
from ce_system_parameters sp,ce_bank_accounts ba
where sp.legal_entity_id=ba.account_owner_org_id
and ba.bank_account_id=:$flex$.bank_account_id)
and closing_status in (&apos;O&apos;,&apos;F&apos;,&apos;C&apos;)
order by period_year desc,period_num desc</LOV_QUERY_DSP>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>AR</LANGUAGE>
      <PARAMETER_NAME>اسم الفترة</PARAMETER_NAME>
      <DESCRIPTION>اسم الفترة</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Periodenbezeichnung</PARAMETER_NAME>
      <DESCRIPTION>Periodenbezeichnung</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Nom de la période</PARAMETER_NAME>
      <DESCRIPTION>Nom de la période</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>I</LANGUAGE>
      <PARAMETER_NAME>Nome periodo</PARAMETER_NAME>
      <DESCRIPTION>Nome del periodo</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Period Name</PARAMETER_NAME>
      <DESCRIPTION>Period Name</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>期间名称</PARAMETER_NAME>
      <DESCRIPTION>期间名称</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>:p_closing_balance</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <LOV_QUERY_DSP>select
 csh.control_end_balance value,
 csh.statement_date description
from
 ce_statement_headers csh
where
 csh.bank_account_id = :$flex$.bank_account_id
order by
 csh.statement_date desc</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select 
 csh.control_end_balance
from  
 ce_statement_headers csh
where
 csh.bank_account_id = :$flex$.bank_account_id and
 csh.statement_date =
 (select 
   max(csh2.statement_date)
  from   
   ce_statement_headers csh2
  where  
   csh2.bank_account_id = :$flex$.bank_account_id and
   csh2.statement_date &lt;
   (select
     gps.end_date + 1
    from
     ce_bank_accounts cba,
     ce_system_parameters csp,
     gl_period_statuses gps
    where 
     cba.bank_account_id=:$flex$.bank_account_id and
     csp.legal_entity_id=cba.account_owner_org_id and 
     gps.application_id=101 and 
     gps.set_of_books_id = csp.set_of_books_id and
     gps.period_name = :$flex$.Period_Name 
   )
 )</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>AR</LANGUAGE>
      <PARAMETER_NAME>الرصيد الختامي</PARAMETER_NAME>
      <DESCRIPTION>الرصيد الختامي</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>D</LANGUAGE>
      <PARAMETER_NAME>Endsaldo</PARAMETER_NAME>
      <DESCRIPTION>Endsaldo</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>F</LANGUAGE>
      <PARAMETER_NAME>Solde de clôture</PARAMETER_NAME>
      <DESCRIPTION>Solde de clôture</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>I</LANGUAGE>
      <PARAMETER_NAME>Saldo di chiusura</PARAMETER_NAME>
      <DESCRIPTION>Saldo di chiusura</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Closing Balance</PARAMETER_NAME>
      <DESCRIPTION>Closing Balance</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>ZHS</LANGUAGE>
      <PARAMETER_NAME>期末余额</PARAMETER_NAME>
      <DESCRIPTION>期末余额</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Bank_Account_Name</FLEX_BIND>
    <PARAMETER_NAME>Bank Account Name</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Bank Account Id</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Bank_Account_Number</FLEX_BIND>
    <PARAMETER_NAME>Bank Account Number</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Bank Account Id</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.Period_Name</FLEX_BIND>
    <PARAMETER_NAME>Period Name</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Closing Balance</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.bank_account_id</FLEX_BIND>
    <PARAMETER_NAME>Bank Account Id</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Closing Balance</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.bank_account_id</FLEX_BIND>
    <PARAMETER_NAME>Bank Account Id</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Period Name</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.legal_entity</FLEX_BIND>
    <PARAMETER_NAME>Legal Entity</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Bank Account Name</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.legal_entity</FLEX_BIND>
    <PARAMETER_NAME>Legal Entity</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Bank Account Number</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
  </PARAMETER_DEPENDENCIES>
  <TEMPLATES>
   <TEMPLATES_ROW>
    <TEMPLATE_NAME>Pivot: Default Template</TEMPLATE_NAME>
    <DESCRIPTION>Summary Pivot with drilldown to details</DESCRIPTION>
    <OWNER>SYSADMIN</OWNER>
    <TEMPLATE_COLUMNS>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>12</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ACCOUNTED_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>17</DISPLAY_SEQUENCE>
      <COLUMN_NAME>AGENT</COLUMN_NAME>
      <SORT_ORDER>4</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>7</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_ACCOUNT_CURRENCY</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_ACCOUNT_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_ACCOUNT_NUM</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>6</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
      <COLUMN_NAME>CURRENCY</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>29</DISPLAY_SEQUENCE>
      <COLUMN_NAME>DIFFERENCE_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>14</DISPLAY_SEQUENCE>
      <COLUMN_NAME>EFFECTIVE_DATE</COLUMN_NAME>
      <SORT_ORDER>3</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>8</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_CASH_ACCOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_CASH_ACCOUNT_DESC</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>13</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_DATE</COLUMN_NAME>
      <SORT_ORDER>2</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>28</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_END_BALANCE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>22</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_LINE</COLUMN_NAME>
      <SORT_ORDER>6</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>23</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_LINE_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>21</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_NAME</COLUMN_NAME>
      <SORT_ORDER>5</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>24</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_POSTED_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <COLUMN_NAME>LEDGER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <COLUMN_NAME>LEGAL_ENTITY</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>19</DISPLAY_SEQUENCE>
      <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>18</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PAYMENT_METHOD</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PERIOD</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>9</DISPLAY_SEQUENCE>
      <COLUMN_NAME>RECORD_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>32</DISPLAY_SEQUENCE>
      <COLUMN_NAME>RECORD_TYPE_LABEL</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>31</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SEQ</COLUMN_NAME>
      <SORT_ORDER>1</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>26</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATEMENT_LINE</COLUMN_NAME>
      <SORT_ORDER>8</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>25</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATEMENT_NUMBER</COLUMN_NAME>
      <SORT_ORDER>7</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>27</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATEMENT_TRX_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>15</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATUS</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>11</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TRANSACTION_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>16</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TRANSACTION_NUMBER</COLUMN_NAME>
      <SORT_ORDER>9</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TRANSACTION_SUBTYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
    </TEMPLATE_COLUMNS>
    <TEMPLATE_PIVOT>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>ACCOUNTED_AMOUNT</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>DIFFERENCE_AMOUNT</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>GL_CASH_ACCOUNT</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>GL_END_BALANCE</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>LEDGER</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>LEGAL_ENTITY</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>PERIOD</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>RECORD_TYPE_LABEL</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
    </TEMPLATE_PIVOT>
    <TEMPLATE_SHARED_STRINGS>
    </TEMPLATE_SHARED_STRINGS>
    <TEMPLATE_PARAMETER_DEFAULTS>
    </TEMPLATE_PARAMETER_DEFAULTS>
    <TEMPLATE_STYLES>
    </TEMPLATE_STYLES>
    <TEMPLATE_SHARING>
     <TEMPLATE_SHARING_ROW>
      <SHARING_LEVEL>S</SHARING_LEVEL>
      <LEVEL_VALUE>Site</LEVEL_VALUE>
     </TEMPLATE_SHARING_ROW>
    </TEMPLATE_SHARING>
    <PARAMETER_EXCLUSION>
    </PARAMETER_EXCLUSION>
   </TEMPLATES_ROW>
   <TEMPLATES_ROW>
    <TEMPLATE_NAME>Pivot: Reconciliation Summary</TEMPLATE_NAME>
    <DESCRIPTION>Reconciliation Summary Pivot with drilldown to details</DESCRIPTION>
    <OWNER>SYSADMIN</OWNER>
    <TEMPLATE_COLUMNS>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>13</DISPLAY_SEQUENCE>
      <COLUMN_NAME>ACCOUNTED_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>18</DISPLAY_SEQUENCE>
      <COLUMN_NAME>AGENT</COLUMN_NAME>
      <SORT_ORDER>4</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>8</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_ACCOUNT_CURRENCY</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_ACCOUNT_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_ACCOUNT_NUM</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>33</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_ACCOUNT_PIVOT_LABEL</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>6</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BANK_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>7</DISPLAY_SEQUENCE>
      <COLUMN_NAME>BRANCH_NAME</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>11</DISPLAY_SEQUENCE>
      <COLUMN_NAME>CURRENCY</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
      <COLUMN_NAME>DIFFERENCE_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>15</DISPLAY_SEQUENCE>
      <COLUMN_NAME>EFFECTIVE_DATE</COLUMN_NAME>
      <SORT_ORDER>3</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>9</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_CASH_ACCOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>31</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_CASH_ACCOUNT_DESC</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>14</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_DATE</COLUMN_NAME>
      <SORT_ORDER>2</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>29</DISPLAY_SEQUENCE>
      <COLUMN_NAME>GL_END_BALANCE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>23</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_LINE</COLUMN_NAME>
      <SORT_ORDER>6</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>24</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_LINE_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>22</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_NAME</COLUMN_NAME>
      <SORT_ORDER>5</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>25</DISPLAY_SEQUENCE>
      <COLUMN_NAME>JE_POSTED_DATE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <COLUMN_NAME>LEDGER</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <COLUMN_NAME>LEGAL_ENTITY</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
      <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>19</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PAYMENT_METHOD</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <COLUMN_NAME>PERIOD</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
      <COLUMN_NAME>RECORD_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>34</DISPLAY_SEQUENCE>
      <COLUMN_NAME>RECORD_TYPE_LABEL</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>32</DISPLAY_SEQUENCE>
      <COLUMN_NAME>SEQ</COLUMN_NAME>
      <SORT_ORDER>1</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>27</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATEMENT_LINE</COLUMN_NAME>
      <SORT_ORDER>8</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>26</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATEMENT_NUMBER</COLUMN_NAME>
      <SORT_ORDER>7</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>28</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATEMENT_TRX_TYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>16</DISPLAY_SEQUENCE>
      <COLUMN_NAME>STATUS</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>12</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TRANSACTION_AMOUNT</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>17</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TRANSACTION_NUMBER</COLUMN_NAME>
      <SORT_ORDER>9</SORT_ORDER>
     </TEMPLATE_COLUMNS_ROW>
     <TEMPLATE_COLUMNS_ROW>
      <DISPLAY_SEQUENCE>21</DISPLAY_SEQUENCE>
      <COLUMN_NAME>TRANSACTION_SUBTYPE</COLUMN_NAME>
     </TEMPLATE_COLUMNS_ROW>
    </TEMPLATE_COLUMNS>
    <TEMPLATE_PIVOT>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>ACCOUNTED_AMOUNT</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>BANK_ACCOUNT_PIVOT_LABEL</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>BANK_NAME</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>BRANCH_NAME</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>DIFFERENCE_AMOUNT</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>GL_CASH_ACCOUNT</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>6</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>GL_END_BALANCE</COLUMN_NAME>
      <FIELD_TYPE>VALUE</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
      <AGGREGATION>SUM</AGGREGATION>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>LEDGER</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>LEGAL_ENTITY</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>PERIOD</COLUMN_NAME>
      <FIELD_TYPE>FILTER</FIELD_TYPE>
      <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
     <TEMPLATE_PIVOT_ROW>
      <COLUMN_NAME>RECORD_TYPE_LABEL</COLUMN_NAME>
      <FIELD_TYPE>ROW</FIELD_TYPE>
      <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
     </TEMPLATE_PIVOT_ROW>
    </TEMPLATE_PIVOT>
    <TEMPLATE_SHARED_STRINGS>
    </TEMPLATE_SHARED_STRINGS>
    <TEMPLATE_PARAMETER_DEFAULTS>
    </TEMPLATE_PARAMETER_DEFAULTS>
    <TEMPLATE_STYLES>
    </TEMPLATE_STYLES>
    <TEMPLATE_SHARING>
     <TEMPLATE_SHARING_ROW>
      <SHARING_LEVEL>S</SHARING_LEVEL>
      <LEVEL_VALUE>Site</LEVEL_VALUE>
     </TEMPLATE_SHARING_ROW>
    </TEMPLATE_SHARING>
    <PARAMETER_EXCLUSION>
    </PARAMETER_EXCLUSION>
   </TEMPLATES_ROW>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
   <DEFAULT_TEMPLATES_ROW>
    <TEMPLATE_NAME>Pivot: Reconciliation Summary</TEMPLATE_NAME>
   </DEFAULT_TEMPLATES_ROW>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
  <UPLOAD_DEPENDENCIES>
  </UPLOAD_DEPENDENCIES>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
