The confirmation and product receipt steps are working correctly, but the invoice posting fails with the following error:
Invoice: INV-019231
Invoice INV-019231 could not post because it contained matching errors which must be approved.
Posting of order PO-N-9000897 canceled
3-way matching is enabled in the system.
Here is the X++ code:
PurchTable purchtable;
PurchFormLetter purchConfirm;
PurchFormLetter purchPackingSlip;
PurchFormLetter purchInvoice;
purchTable = PurchTable::find("PO-N-9000897");
// Confirm PO
purchConfirm = PurchFormLetter::construct(DocumentStatus::PurchaseOrder);
purchConfirm.update(
purchTable,
purchTable.PurchId,
systemDateGet(),
PurchUpdate::All,
AccountOrder::None,
NoYes::No,
NoYes::No
);
purchtable.reread();
// Product Receipt
purchPackingSlip = PurchFormLetter::construct(DocumentStatus::PackingSlip);
purchPackingSlip.update(
purchTable,
null,
systemDateGet(),
PurchUpdate::All,
AccountOrder::None,
NoYes::No,
NoYes::No
);
purchtable.reread();
// Invoice
purchInvoice = PurchFormLetter::construct(DocumentStatus::Invoice);
purchInvoice.update(
purchTable,
"INV-019231",
systemDateGet(),
PurchUpdate::All,
AccountOrder::None,
NoYes::No,
NoYes::No
);

Report
All responses (
Answers (