Receipt Creation SQL Diagnostics

If an expected receipt is still missing after completing the applicable troubleshooting steps, an administrator with authorized query access can use the following read-only SQL queries to investigate bank statement processing and receipt creation.

Important: These queries are for diagnostic purposes only. Don't modify application data. If query access is unavailable, provide the statement details, process logs, and exception information to Oracle Support.

Before Running the Queries

Start with the statement-header query. Use the returned STATEMENT_HEADER_ID and BANK_ACCOUNT_ID in the subsequent queries.

If the statement number returns more than one header, identify the intended statement using the bank account, cur-rency, and statement date.

The queries use the following bind parameters:
Parameter Description
P_STATEMENT_NUMBER Exact statement number as text
P_STATEMENT_HEADER_ID Numeric statement-header identifier returned by the first query
P_BANK_ACCOUNT_ID Numeric bank-account identifier returned by the first query

Define and supply these parameters in your authorized query tool. Supply one bank account identifier for the count query.

Keep the relevant scheduled-process request IDs, logs, and output with the query results. Results may contain bank-account and payment information. Share them through a secure service-request channel and mask sensitive values where appropriate.

1. Review the Statement Header

Use this query to locate the affected statement and obtain the identifiers required for the remaining queries
SELECT statement_header_id,
       statement_number,
       bank_account_id,
       currency_code,
       statement_date,
       recon_status_code,
       autorec_process_code,
       autorec_process_id,
       intraday_flag,
       creation_date,
       last_update_date
FROM fusion.ce_statement_headers
WHERE statement_number = :P_STATEMENT_NUMBER;
Review the Result
  • Review the statement date, currency, intraday indicator, reconciliation status, and autoreconciliation process details.
  • If no row is returned, confirm the statement number and import result before continuing.

2. Review the Bank Account Configuration

Use P_BANK_ACCOUNT_ID from the selected statement header.
SELECT bank_account_id,
       bank_account_name,
       bank_account_num,
       currency_code,
       ar_use_allowed_flag,
       ap_use_allowed_flag,
       start_date,
       end_date,
       recon_ruleset_id,
       allow_receipt_from_stmt_flag,
       receipt_creation_start_date,
       stmt_default_receipt_method_id
FROM fusion.ce_bank_accounts
WHERE bank_account_id = :P_BANK_ACCOUNT_ID;
Review the Result
  • Compare ALLOW_RECEIPT_FROM_STMT_FLAG, RECEIPT_CREATION_START_DATE, and STMT_DEFAULT_RECEIPT_METHOD_ID with the configuration in Chapter 2.
  • Review the bank account's effective dates and reconciliation rules.
  • A blank default-method identifier must be interpreted with the configured receipt-method fallback; it isn't, by itself, proof of missing setup.

3. Review the Statement Lines and Processing Status

Use P_STATEMENT_HEADER_ID from the selected statement header.
SELECT statement_line_id,
       statement_header_id,
       line_number,
       trx_type,
       flow_indicator,
       recon_status,
       amount,
       addenda_txt,
       external_transaction_id,
       receipt_creation_process_id,
       receipt_creation_status_code,
       creation_date,
       last_update_date
FROM fusion.ce_statement_lines
WHERE statement_header_id = :P_STATEMENT_HEADER_ID;
Review the Result
  • Locate the affected LINE_NUMBER.
  • Review FLOW_INDICATOR, RECON_STATUS, EXTERNAL_TRANSACTION_ID, RECEIPT_CREATION_PROCESS_ID, RECEIPT_CREATION_STATUS_CODE, and the timestamps.
  • Compare these values with the relevant process log and output. Don't assume that every unreconciled line must create a receipt.

4. Review Receipt Creation Exceptions

This query returns exceptions for statement lines whose receipt-creation status is ERROR.
SELECT message_name,
       exception_type_code,
       exception_attribute
FROM fusion.ar_cash_processing_exceptions
WHERE source_id IN (
    SELECT statement_line_id
    FROM fusion.ce_statement_lines
    WHERE statement_header_id = :P_STATEMENT_HEADER_ID
      AND receipt_creation_status_code = 'ERROR'
);
Review the Result
  • Use MESSAGE_NAME, EXCEPTION_TYPE_CODE, and EXCEPTION_ATTRIBUTE to identify the reported issue.
  • For AR_RCE_MISSING_SETUP, review the Create Bank Statement Transactions log for the specific missing configuration.
  • An empty result doesn't establish that import and subsequent processing succeeded.

5. Find Receipts Created from the Statement

Use the selected statement-header identifier to find receipts linked to its statement lines.
SELECT receipt_number
FROM fusion.ar_cash_receipts_all
WHERE source_stmt_line_id IN (
    SELECT statement_line_id
    FROM fusion.ce_statement_lines
    WHERE statement_header_id = :P_STATEMENT_HEADER_ID
);
Review the Result
  • Review the returned receipt numbers in Manage Receipts and compare them with the intended payment.
  • If no rows are returned, the query found no linked receipt for the selected statement lines. Review the processing status, exceptions, and logs before retrying.

6. Review Processing Candidates for the Bank Account

This account-level query counts lines that meet its processing-state, date, format, and history conditions.

Run it with the bank account identifier from the selected statement header.
SELECT COUNT(1) AS eligible_line_count
FROM fusion.ce_statement_lines l,
     fusion.ce_statement_headers h,
     fusion.ce_bank_accounts v,
     fusion.iby_inbound_file i
WHERE l.statement_header_id = h.statement_header_id
  AND h.bank_account_id = v.bank_account_id
  AND h.inbound_file_id = i.inbound_file_id
  AND (
         l.receipt_creation_process_id IS NULL
         OR (
              l.receipt_creation_process_id IS NOT NULL
              AND l.receipt_creation_status_code = 'INPROCESS'
              AND l.last_update_date < SYSDATE - 1/4
            )
         OR (
              l.receipt_creation_process_id IS NOT NULL
              AND l.receipt_creation_status_code = 'ERROR'
              AND l.last_update_date < SYSDATE - 1/4
            )
      )
  AND l.flow_indicator IN ('CRDT')
  AND l.recon_status IN ('UNR')
  AND h.intraday_flag = 'N'
  AND v.allow_receipt_from_stmt_flag = 'Y'
  AND l.creation_date >
      GREATEST(
          NVL(v.receipt_creation_start_date, SYSDATE) - 30,
          SYSDATE - 30
      )
  AND v.bank_account_id IN (:P_BANK_ACCOUNT_ID)
  AND i.format_type_code = 'CE_BANK_STATEMENTS'
  AND NOT EXISTS (
          SELECT 1
          FROM fusion.ce_statement_headers hed,
               fusion.ce_bank_accounts cba
          WHERE hed.bank_account_id = cba.bank_account_id
            AND cba.bank_account_id = v.bank_account_id
            AND hed.creation_date > SYSDATE - 45
            AND hed.autorec_process_id IS NOT NULL
            AND hed.autorec_process_code = 'PROCESSED'
            AND cba.recon_ruleset_id IS NOT NULL
            AND NVL(
                    cba.recon_start_date,
                    TO_DATE('01/01/1900', 'MM/DD/YYYY')
                ) < hed.statement_date
      )
  AND NOT EXISTS (
          SELECT 1
          FROM fusion.ce_external_transactions t
          WHERE t.bank_account_id = v.bank_account_id
            AND t.source = 'STMT'
            AND t.creation_date > SYSDATE - 45
      );
Review the Result
  • Interpret the count with the preceding statement, line, exception, and receipt results.
  • A positive count doesn't confirm that all receipt-creation validations will pass, including receipt-method setup and inclusion or exclusion rules.
  • A zero count isn't conclusive evidence that the selected statement has no eligible lines.

Count-Query Limitations

The query includes a six-hour last-update cutoff for lines already marked INPROCESS or ERROR, a 30-day line-creation filter, and 45-day processing-history checks.

The two NOT EXISTS conditions operate at the bank-account level. Other statements or statement-sourced external transactions for the account can therefore suppress the count.

These are diagnostic query filters, not instructions to wait, resubmit a file, or change application data.