c92557cd2a
For some reason, I had to put o.invoice_id at the end of the select list. Else, sell orders would receive wrong/empty data.