There is a new feature called Vendor Prepayments in AX 2012. It basically allows a company to prepay a vendor before the receipt of any goods. This was not there in AX 2009. So a user can basically attach a Prepayment record to a Purchase order and then post something called Prepayment invoice. When goods finally arrive, this Prepayment invoice is then applied to the "Real" Vendor invoice and settled. Its pretty straightforward and i guess logical.
My requirement is to do this Prepayment Invoice posting by code in X++.
If i try to use the PurchFormLetter class like below, it will post the Real invoice, which wont be correct as in the case of prepayments, there is no inventory transactions.
purchFormLetter = PurchFormLetter::construct(DocumentStatus::Invoice);
purchFormLetter.update(
purchTable,'8001',
systemDateGet(),
PurchUpdate::All,
AccountOrder::None,
NoYes::No,
NoYes::Yes);
I have looked around in AX Dev Guides, on google, on blogs but no help.
Does anybody know this?