Assuming updatelineitems is required, the following result was found.
} // // now loop through the invoice line items and rebuild the list l_UpdateLineItems = List(); for each r_OldLineItem in invoice.get("line_items") { m_LineItem = Map(); v_OldInvoiceItemID = r_OldLineItem.get("item_id");...