Tuesday 25 June 2013

transferred from SLA, but is not present in the GL

/* Formatted on 6/25/2013 5:04:16 PM (QP5 v5.114.809.3010) */
SELECT   l.ae_header_id, l.gl_sl_link_id, l.gl_sl_link_table
  FROM   xla_ae_lines l, xla_ae_headers h
 WHERE       l.application_id = h.application_id
         AND l.ae_header_id = h.ae_header_id
         AND h.application_id = :p_application_id
         AND h.ledger_id = :p_ledger_id
         AND h.upg_batch_id IS NULL
         AND h.gl_transfer_status_code = 'Y'
         AND h.accounting_entry_status_code = 'F'
         AND h.accounting_date BETWEEN :p_period_start_date
                                   AND  :p_period_end_date
         AND h.event_type_code <> ' MANUAL'
         AND NOT EXISTS
               (SELECT   1
                  FROM   gl_import_references ir, gl_je_headers gh
                 WHERE       ir.gl_sl_link_id = l.gl_sl_link_id
                         AND ir.gl_sl_link_table = l.gl_sl_link_table
                         AND ir.je_header_id = gh.je_header_id
                         AND ir.je_batch_id = gh.je_batch_id
                         AND gh.ledger_id > 0);

No comments:

Post a Comment