Uninvoiced Receipts:
SELECT pha.segment1 po_number,
TO_CHAR (pha.creation_date, 'DD-MON-RRRR') po_date,
(SELECT vendor_name
FROM ap_suppliers ap
WHERE ap.vendor_id = pha.vendor_id)
supplier_name,
pla.quantity,
pla.unit_price,
pla.quantity * pla.unit_price AS line_amount,
(SELECT concatenated_segments
FROM gl_code_combinations_kfv gcc
WHERE gcc.code_combination_id = pda.code_combination_id)
charge_account,
rsh.receipt_num grn_no,
TO_CHAR (rsh.creation_date, 'DD-MON-RRRR') grn_date,
rt.quantity grn_quantity,
rt.quantity_billed
FROM po_distributions_all pda,
po_lines_all pla,
po_headers_all pha,
rcv_transactions rt,
rcv_shipment_headers rsh
WHERE pda.po_line_id = pla.po_line_id
AND pla.po_header_id = pha.po_header_id
AND pha.po_header_id = rt.po_header_id
AND pla.po_line_id = rt.po_line_id
AND rt.transaction_type = 'RECEIVE'
AND rt.shipment_header_id = rsh.shipment_header_id
AND pda.po_distribution_id NOT IN
(SELECT po_distribution_id
FROM po_distributions_all pda
WHERE po_distribution_id IN
(SELECT DISTINCT po_distribution_id
FROM ap_invoice_distributions_all))
Comments
Post a Comment