Thursday, 26 December 2013

AR Interface Table - Summary by Batch Source Name

-- INTERFACE LINES SUMMARY
 
SELECT   rila.batch_source_name batch
       , rila.org_id
       , COUNT(*) lines
       , SUM(rila.unit_selling_price * rila.quantity) total
    FROM ar.ra_interface_lines_all rila
       , ar.ar_receipt_methods arm
       , gl.gl_ledgers gl
       , apps.hz_cust_accounts hca
       , apps.hz_parties hp
       , ar.ra_interface_errors_all riea
   WHERE rila.receipt_method_id = arm.receipt_method_id(+)
     AND rila.set_of_books_id = gl.ledger_id(+)
     AND rila.orig_system_bill_customer_id = hca.cust_account_id
     AND hp.party_id = hca.party_id
     AND rila.interface_line_id = riea.interface_line_id(+)
GROUP BY rila.batch_source_name
       , rila.org_id;

No comments:

Post a Comment