InvoiceAdd.InvoiceLineAdd items being reordered
daniel-geiselhart opened this issue · 4 comments
daniel-geiselhart commented
Some items are getting reordered by InvoiceAdd.InvoiceLineAdd. Unable to see why this is happening
80000007-1554843372 QB Desktop Test 8000001E-1555443730 A/R 2019-05-10 0008 Owner Invoice ID 0008: momo 1 {a66c95ac-fac9-43fa-822e-3219204a45c3} 800000F4-1555593041 01-0050 · Plans and Specs 0.03 3.00 80000002-1553892706 800000D2-1555593040 06-1000 · Rough Carpentry 0.03 3.69 80000002-1553892706david-dawa commented
I am also encountering this issue.
rogerfar commented
This has become an issue for us too, especially pushing large invoices with 100's of lines it is critical the order remains the same.
It looks like it is because of the code in ObjectItems.cs
where it does the ordering on line 106, this is not a safe order, it will cause the order to be randomly jumbled.
I altered the code a bit so it keeps the correct order with a PR.
jsgoupil commented
After double checking the fix, the reason this was happening was because the sorting mechanism was unstable. Using OrderBy
makes the sort stable.
Thanks for the fix.