Edit

ProcessOrder (orderSeq, mode, paramsArray)

Return value:  0 on sucess, 1 on failure

Definition:  ProcessOrder is intended to offer all order processing options in the future. As of 9.2.6 it offers one mode for purchase orders: Receive Stock Before Invoice. This creates and posts a stock receipt journal for the receive quantities that are on the order. To fully automate stock receipting, use UpdateOrderLines first to set the quantities to receive on every line.

  • Identify the order to be processed by specifying its sequence number in orderSeq.

  • the mode must be ProcessOrder_GoodsReceivedBeforeInvoice

  • the paramsArray has named parameters specific to the order processing mode

For ProcessOrder_GoodsReceivedBeforeInvoice, the required parameters are:

"unbilledStockAcct" the account code for unbilled stock (must be CL)

"date" the data for the journal

"period" the period in which to post the journal

Example 

    let res = UpdateOrderLines(993, CreateArray("CA100", 55, "CB200", 0))    // receiving 55 of CA100, did not receive any CB200
    if res == 0
        let res = ProcessOrder(993, ProcessOrder_GoodsReceivedBeforeInvoice, CreateArray("unbilledStockAcct", "2100", "period", CurrentPeriod(), "date", Today()))
    endif
    if res != 0
        // Check GetLastErrorMessage()
    endf

Availability:  available within MWScript handlers in MoneyWorks 9.2.6 and later