Unable to create a standalone Credit Memo via Standard Payables Import Interface
We are having a issue with Invoice conversion wherein we are unable to convert standalone Credit Memo which is matched to a Purchase Order. In our situation in legacy system Invoice was paid to Vendor and then due to goods return in the legacy system users created a Credit Memo matched to PO. Now when we are converting that Credit memo (since we are not bringing in paid invoices) we are getting error as Negative Quantity Billed.
After analysis of the standard import package 'AP_IMPORT_VALIDATION_PKG' the logic is to check for all the invoices matched to PO and then add the Credit Memo quantity to those already invoiced quantity (from ap_lines_all). If the total is less than zero throw Negative Quanttity Billed error.