I have recently encountered an error while trying to post the purchase order invoice of the pre-paid PO. I was able to successfully post the pre-payment invoice and the product receipts without an issue. The error appears only when I tried posting the actual PO invoice in which the pre-payment has been applied. The error thrown by AX client was ambiguous and it was hard to figure out the actual root cause of the issue. The actual error message appeared only when I un-checked the CIL execution.
The error was because of the fact that I had an attachment attached to the PO. Once I removed the attachment from the PO then I was able to post the purchase order invoice without an error. I have checked this on AX 2012 R2 with CU6 installed.