I'm wondering if there's a sensible way of identifying the order lines to be delivered (via the stock module) - or at least the order amount that's not been invoiced.
Order_GetAllCurrent surely returns open orders, but the order amount is the order total, regardless of delivery status, or how much has been invoiced until now.
OrderLine_GetDeliveryDate doesn't seem to return anything at all. What does it represent, really?
My alternate strategy was to do Invoices_FindByOrderNumber, as I was thinking of subtracting these from the order total, thus getting how much remains to be invoiced.
However, if I understand correctly, the order number changes each time it is partially invoiced.
So how should I identify the invoices originating from the same order?
(My goal is ultimately on the basis of the undelivered order lines to check which of these have items in stock, and thus which orders can be completed the most or fully - or would be the most "profitable to deliver". The e-conomic GUI seems to fall short in the regard, as it only shows it on a line basis.)
I hope this makes sense.