You would want to add somewhere between lines 14 and 18:
oInvoices.Lines.ItemCode = oOrder.Lines.ItemCode
Then you may possibly get another error, depending on whether or not you've met all of the requirements for your current document based on your current locale's business rules.
You just have to keep plugging away, field by field, until you have success, unless you have direct access to your locale's business rules.