Hello, i'm trying to invoice a purchase order in ax 2012 that already exists. The proc category is fixed assets. It has a qty of 1 and net amount of 150. matching policy is none.
It has fixed asset number value model of sl and transaction type acquisition.
What i'm trying to do just invoice a specific line on a PO. In this case there is only 1 line. I'm trying to do this in x++ code. Below I have code that usually invoices and works in a regular situation that has posting profiles setup etc. But in this case we have a proc category setup with a fixed asset. I get this error in code and i'm not sure how to get around it... is there any other way or something i can do to not check the posting profile for expense because it has fixed asset acquisition?
Error when invoicing invoice number: PO-xxx on Purchase Order: PO-xxx
Account number for transaction type Purchase expenditure for expense does not exist.
Posting of order PO-xx canceled
purchFormLetterInvoice = PurchFormLetter_Invoice::newFromSavedInvoice(vendInvoiceInfoTable);
purchFormLetterInvoice.showQueryForm(false);
purchFormLetterInvoice.specQty(PurchUpdate::RegisteredAndServices);
purchFormLetterInvoice.update(vendInvoiceInfoTable, vendInvoiceInfoTable.Num, systemdateget());