Wednesday, 11 January 2012

PO RECEIPT ACCOUNTING QUERY (CREDIT,DEPIT)

/* Formatted on 1/11/2012 3:24:13 PM (QP5 v5.115.810.9015) */
SELECT   rsh.receipt_num,
         rt.transaction_type,
         NULL account_type,
         gcck.concatenated_segments,
         rrsl.accounted_cr,
         rrsl.accounted_dr,
         rrsl.currency_code,
         ood.organization_code organization_code,
         rrsl.accounting_date gl_date
  FROM   rcv_receiving_sub_ledger rrsl,
         rcv_transactions rt,
         rcv_shipment_headers rsh,
         gl_code_combinations_kfv gcck,
         org_organization_definitions ood
 WHERE       rrsl.rcv_transaction_id = rt.transaction_id
         AND rt.shipment_header_id = rsh.shipment_header_id
         AND rrsl.code_combination_id = gcck.code_combination_id
         AND rsh.organization_id = ood.organization_id
--         AND rrsl.accounting_date BETWEEN :p_from_date AND :to_from_date
--         AND ood.OPERATING_UNIT = :organization_code
         and rsh.RECEIPT_NUM ='20126300019'        
UNION
SELECT   jirjb.receipt_num,
         jirjb.acct_nature,
         jirjb.acct_type,
         gcck.concatenated_segments,
         jirjb.entered_cr,
         jirjb.entered_dr,
         jirjb.currency_code,
         ood.organization_code organization_code,
         jirjb.transaction_date gl_date
  FROM   JAI_RCV_JOURNAL_ENTRIES jirjb,
         gl_code_combinations_kfv gcck,
         rcv_shipment_headers rsh,
         org_organization_definitions ood
 WHERE       jirjb.code_combination_id = gcck.code_combination_id
         AND jirjb.organization_code = ood.organization_code
--         AND jirjb.transaction_date BETWEEN :p_from_date AND :to_from_date
--         AND ood.OPERATING_UNIT = :organization_code
          and jirjb.RECEIPT_NUM ='20126300019'

No comments:

Post a Comment