Join the OracleApps88 Telegram group @OracleApps88to get more information on Oracle EBS R12/Oracle Fusion applications.

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.

Friday, August 5, 2011

REPAY INVOICE DETAILS

SELECT
aid1.ROWID row_id, aid1.invoice_id invoice_id,
aid1.invoice_distribution_id invoice_distribution_id,
aid1.prepay_distribution_id prepay_distribution_id,
aid2.distribution_line_number prepay_dist_number,
(-1) * aid1.amount prepay_amount_applied,
aid1.dist_code_combination_id dist_code_combination_id,
aid2.accounting_date accounting_date, aid1.period_name period_name,
aid1.set_of_books_id set_of_books_id, aid1.description description,
aid1.po_distribution_id po_distribution_id,
aid1.rcv_transaction_id rcv_transaction_id, aid1.org_id org_id,
ai.invoice_num invoice_num, ai.vendor_id vendor_id,
ai.vendor_site_id vendor_site_id,
aid2.invoice_id prepay_id,
ai2.invoice_num prepayment_invoice_num

FROM
ap_invoices_all ai,
ap_invoice_distributions_all aid1,
ap_invoice_distributions_all aid2,
ap_invoices_all ai2

WHERE 1 = 1
AND aid1.prepay_distribution_id = aid2.invoice_distribution_id
AND ai.invoice_id = aid1.invoice_id
AND aid1.amount < 0
AND NVL (aid1.reversal_flag, 'N') != 'Y'
AND aid1.line_type_lookup_code = 'PREPAY'
AND ai.invoice_type_lookup_code NOT IN('PREPAYMENT', 'CREDIT', 'DEBIT')
and ai2.invoice_id = aid2.invoice_id

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect