Hi All,
SELECT aia.invoice_num "Invoice Number",
aia.invoice\_num "Credit Memo Number",
pv.vendor\_name "Vendor Name",
pv.segment1 "Vendor Number",
aia.invoice\_amount "Amount",
DECODE (apps.ap\_invoices\_pkg.get\_approval\_status (
invoice\_id,
invoice\_amount,
payment\_status\_flag,
invoice\_type\_lookup\_code),
'FULL', 'Fully Applied',
'UNAPPROVED', 'Unvalidated',
'NEEDS REAPPROVAL', 'Needs Revalidation',
'APPROVED', 'Validated',
'NEVER APPROVED', 'Never Validated',
'CANCELLED', 'Cancelled',
'UNPAID', 'Unpaid',
'AVAILABLE', 'Available')
"Validation",aia.INVOICE\_TYPE\_LOOKUP\_CODE
FROM ap_invoices_all aia, po_vendors pv
WHERE aia.vendor_id = pv.vendor_id
AND aia.invoice\_type\_lookup\_code IN ('STANDARD', 'CREDIT');

I need the Standard and Credit Memo Number to be shown against the same line for Same Vendor, having amount .
Mandatory, there should be Credit and Debit amount i.e Standard and Credit.
If there is just one of these, then those records should not be fetched.
E.g.

Appreciate your help on this.
Thanks
SG