Closed rogerfar closed 5 years ago
The same code exists in ObjectItems`1.cs I suspect it would be a problem there too.
You're right, OrderBy is indeed enough to get it to work, no need to do the GroupBy and flattening again. I pushed another commit with these changes.
When creating and invoice it will attempt to sort the InvoiceLineAdd list by the nameOrder, but because this is an unsafe order it jumbles the list and causes the lines to be out of order when generating the XML.
I added a unit test to show this behaviour. The old sort would generate the following XML:
The new way: