今天发现用户在在PO做finally close时候报错:
Error: You cannot finally close this purchase order because there are outstanding invoices and/or credit memos
metalink上有对此的解释:
cause: Issue was caused by invalid data. Some invoice lines were not validated.
This is a valid system error if invoices that are not validated are matched to the PO user is trying to finally close.
Action should be taken to validate these invoices before attempting to finally close the PO.
如何后台查找没有验证的invoice:
SELECT ai.invoice_id, ai.invoice_num
FROM po_headers_all ph,
po_distributions_all pd,
po_releases_all pr,
ap_invoice_distributions_all aid,
ap_invoices_all ai
WHERE ph.po_header_id = &po_header_id
AND ph.po_header_id = pd.po_header_id
AND pd.po_release_id = pr.po_release_id(+)
AND pd.po_distribution_id = aid.po_distribution_id
AND aid.invoice_id = ai.invoice_id
AND (exists (select 'hold'
from ap_holds_all ah
where ai.invoice_id = ah.invoice_id
AND ah.release_lookup_code is null) OR exists
(select 'unvalidated dist'
from ap_invoice_distributions_all aid2
where ai.invoice_id = aid2.invoice_id
and nvl(aid2.match_status_flag, 'N') <> 'A'));
if no records shown for above script, please refer to metalink: Doc ID 1306249.1 for oracle Bug