Invoice Headers and Holds

-- ##############################################################################
--      INVOICE - MATCH / HOLD INFORMATION
-- ############################################################################*/
 
SELECT aia.invoice_id
     , aia.invoice_num
     , aia.doc_sequence_value inv_voucher
     , aia.invoice_amount
     , aia.invoice_date
     , ah.hold_lookup_code
     , ah.hold_reason
     , ah.hold_date
     , ah.creation_date hold_created
     , ah.last_update_date hold_updated
     , ah.release_lookup_code
     , ah.release_reason
  FROM ap.ap_invoices_all aia
  JOIN ap.ap_holds_all ah ON aia.invoice_id = ah.invoice_id
 WHERE 1 = 1
   AND ah.hold_lookup_code IN ('CANT FUNDS CHECK')
--   AND aia.doc_sequence_value = 2445122
--   AND aha.hold_date > '01-OCT-2013'
   AND 1 = 1;

Using Oracle SQL instead of ANSI SQL:

-- ##############################################################################
--      INVOICE - MATCH / HOLD INFORMATION
-- ############################################################################

SELECT aia.invoice_id
     , aia.invoice_num
     , aia.invoice_amount
     , aia.invoice_date
     , ah.*
     , ah.hold_id
     , ah.release_lookup_code
     , ah.release_reason
     , ah.status_flag
     , ah.last_update_date
  FROM ap.ap_invoices_all aia
     , ap.ap_holds_all ah
 WHERE aia.invoice_id = ah.invoice_id
   AND aia.doc_sequence_value = 2439927
--   AND aha.hold_date > '01-OCT-2013'
   AND 1 = 1;

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*