Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Vendor - Invoice Query - Single Row Display

User_FHYJ0Apr 16 2020 — edited Apr 16 2020

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');

Capture.JPG

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.

Capture_1.JPG

Appreciate your help on this.

Thanks

SG

Comments
Post Details
Added on Apr 16 2020
19 comments
3,941 views