Hi,
Below is code written in a runnable class to post an invoice. This code works fine and the sales order is invoiced if the customer is not a foreign customer.
However, the code is not working and status remains "Delivered" if the customer is a foreign customer. If I post the invoice from the sales order form, it is getting invoiced.
Foreign customer: "Foreign customer" field in "General" section of "Tax Information" tab in customer form
Any guidance please.
//Invoicing the sales order SalesFormLetter formLetterObj; formLetterObj = SalesFormLetter::construct(DocumentStatus::Invoice); formLetterObj.update(SalesTable::find("XXXX-000092"));