Tuesday 10 December 2013

AP Invoice Validation Status


(See Metalink doc ID 301806.1)
There is no column in the AP_INVOICES_ALL table that stores the validation status. Invoice distributions are validated individually and the status is stored at the invoice distribution level. This status is stored in AP_INVOICE_DISTRIBUTIONS_ALL.MATCH_STATUS_FLAG.
Valid values for the column are:

A – Validated (it used to be called Approved)
N or null – Never validated
T – Tested but not validated


The invoice header form derives the invoice validation status based on the following:
‘Validated’
- If all of the invoice distributions have a MATCH_STATUS_FLAG = ‘A’
‘Never Validated’
- If all of the invoice distributions have a MATCH_STATUS_FLAG = null or ‘N’
‘Needs Revalidation’
- If there are any rows in AP_HOLDS that do not have a release code.
- If any of the invoice distributions have a MATCH_STATUS_FLAG = ‘T’.
- If the invoice distributions have MATCH_STATUS_FLAG values = ‘N’, null and ‘A’ (mixed).

  Query:
========

select distinct match_status_flag from ap_invoice_distributions_all


/* Formatted on 11/10/2016 8:13:49 AM (QP5 v5.114.809.3010) */
SELECT   DECODE (
            AP_INVOICES_UTILITY_PKG.GET_APPROVAL_STATUS (
               AIA.INVOICE_ID,
               AIA.INVOICE_AMOUNT,
               AIA.PAYMENT_STATUS_FLAG,
               AIA.INVOICE_TYPE_LOOKUP_CODE
            ),
            'FULL',
            'Fully Applied',
            'NEVER APPROVED',
            'Never Validated',
            'NEEDS REAPPROVAL',
            'Needs Revalidation',
            'CANCELLED',
            'Cancelled',
            'UNPAID',
            'Unpaid',
            'AVAILABLE',
            'Available',
            'UNAPPROVED',
            'Unvalidated',
            'APPROVED',
            'Validated',
            'PERMANENT',
            'Permanent Prepayment',
            NULL
         )
  --  INTO  V_STATUS
  FROM   AP_INVOICES_ALL AIA
 WHERE   AIA.INVOICE_ID = <INVOICE_ID>;

4 comments:

  1. Here is the correct way to find Payable Invoice Validation Status:

    http://m-burhan.blogspot.com/2012/06/function-which-provide-ap-validation.html

    ReplyDelete
  2. Any way to tell when the invoice or invoice distribution was last validated?

    ReplyDelete

  3. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here .Same as your blog i found another one Oracle Project Portfolio Management Cloud . Actually I was looking for the same information on internet for Oracle PPM and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete