i need assistance please in correctly joining payables invoices/checks with gl code combinations,i t
select * from ( SELECT gcc.segment1 Company ,gcc.segment2 CostCenter ,gcc.segment3 Account ,gcc.segment4 Project ,gcc.segment5 Services ,gcc.segment6 IC ,gjh.je_source Source ,gjh.default_effective_date ,gjh.name Header_Name ,gjh.doc_sequence_value ,to_char(effective_date,'DD-MON-YYYY') GL_DATE ,gjl.description Line_Description ,gjl.period_name Period_Name ,nvl(gjl.accounted_dr,0) Debit ,nvl(gjl.accounted_cr,0) Credit ,nvl(gjl.accounted_dr,0) - nvl(gjl.accounted_cr,0) "Debit-Credit" ,pv.vendor_name "VENDOR/CUSTOMER NAME" ,pv.segment1 "VENDOR/CUSTOMER NUMBER" ,aia.invoice_num Trx_Number ,aia.invoice_amount Trx_Amount ,to_char(aia.gl_date,'DD-MON-YYYY') Trx_GL_DATE FROM apps.gl_je_headers gjh, apps.gl_je_lines gjl, apps.XLA_AE_HEADERS xah, apps.XLA_AE_LINES xal, apps.XLA_DISTRIBUTION_LINKS xdl, -------------------------------------- XLA.XLA_TRANSACTION_ENTITIES xte, ----------------------------------------- apps.GL_IMPORT_REFERENCES gir, apps.AP_INVOICE_DISTRIBUTIONS_ALL dist, apps.gl_code_combinations gcc ,apps.ap_invoices_all aia ,apps.po_vendors pv WHERE gjh.je_header_id = gjl.je_header_id AND gjl.code_combination_id = gcc.code_combination_id AND aia.vendor_id = pv.vendor_id (+) and gjh.actual_flag = 'A' and gjh.je_source = 'Payables' and xte.entity_code ='AP_INVOICES' AND xah.ae_header_id