ACH Outbound File [message #303222] |
Thu, 28 February 2008 07:43 |
Krishna_dev
Messages: 32 Registered: May 2007
|
Member |
|
|
I am trying to create an outbound ACH File to the bank showing the payment information for each vendor we will be paying. Below is some sample code I have been referencing. Can anyone tell me which tables I will be querying to get the approved payments that should be going to the bank. Please help as this is urgent.
PROCEDURE process_payments(errbuf OUT varchar2,
retcode OUT number,
p_inbound_file)
AS
CURSOR header_cur is
SELECT INV.invoice_id invoice_id,
INV.invoice_num invoice_num,
INV. vendor_id,
INV.Attribute1 batch_number,
INV.description inbound_file_name,
VEN.vendor_name vendor_name,
VEN.segment1 supplier_number,
INV.vendor_site_id,
SITES.vendor_site_code site_name
FROM ap_invoices_all INV,
po_vendors VEN,
po_vendor_sites_all SITES
WHERE INV.Vendor_id = VEN.vendor_id
AND SITES.vendor_site_id = INV.vendor_site_id
AND INV.invoice_id in (10093,10094)
AND ltrim(rtrim(INV.description)) =ltrim(rtrim(p_inbound_file));
CURSOR payments_cur(p_invoice_id Number) is
SELECT PAY.check_id,
PAY.amount,
PAY.invoice_payment_id,
CHK.check_number chk_number,
CHK.amount chk_amount,
CHK.check_date chk_date
FROM ap_invoice_payments_all PAY,
ap_checks_all CHK
WHERE PAY.check_id = CHK.check_id
AND PAY.invoice_id = P_invoice_id
AND CHK.status_lookup_code = 'NEGOTIABLE';
END process_payments
|
|
|