jsgoupil / quickbooks-sync

Sync Quickbooks Desktop
MIT License
87 stars 40 forks source link

InvoiceAdd.InvoiceLineAdd items being reordered #36

Closed daniel-geiselhart closed 5 years ago

daniel-geiselhart commented 5 years ago

Some items are getting reordered by InvoiceAdd.InvoiceLineAdd. Unable to see why this is happening

image

image

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-1553892706
david-dawa commented 5 years ago

I am also encountering this issue.

rogerfar commented 5 years ago

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 5 years ago

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.

jsgoupil commented 5 years ago

Fixed with e4f237f5417ceb21a7fc3c4bbad937b46f8dc2bd Released as 2.0.1