API and Query to get AP Invoice Status:
1. Get Invoice status from API
SELECT ai.invoice_num,
ai.invoice_amount,
AP_INVOICES_PKG.GET_APPROVAL_STATUS (ai.invoice_id,
ai.invoice_amount,
ai.payment_status_flag,
ai.invoice_type_lookup_code)
inv_status
FROM ap_invoices_all ai
WHERE invoice_num = '<inv number>' AND org_id = <org id>;
2. Get actual meaning from below query from lookup:
SELECT lookup_type,
LOOKUP_CODE,
MEANING,
DESCRIPTION,
TAG,
START_DATE_ACTIVE,
END_DATE_ACTIVE,
ENABLED_FLAG
FROM FND_LOOKUP_VALUES_VL
WHERE ( NVL ('', territory_code) = territory_code
OR territory_code IS NULL)
AND (VIEW_APPLICATION_ID = 200)
AND (SECURITY_GROUP_ID = 0)
AND lookup_Type = 'NLS TRANSLATION'
AND LOOKUP_CODE = '<Inv_status from above query> ' ---'NEVER APPROVED'
ORDER BY LOOKUP_CODE;
No comments:
Post a Comment