On our site we have had some problem with discounts. The problems manifest themselves in the sense that sometimes when a cart is trying to calculate discounts it doesn't delete all the old discount OrderLines. It seems to calculate the price correctly, but if you look in the database or in the backend under Orders, you can see the extra OrderLines. I have not really been able to recreate the problem reliably, but I wanted to look into it anyway.
When I am looking through the source code of Dynamicweb I can't seem to find the place where all the different SalesDiscountProviders are being called, so I can't see if there are any way the Order could get in a state where some OrderLines exist in the database, but not in the Order object.
Do any of you have a clear view of how that flow is executed and can point me in the direction of where it happens, so I can continue my research? :)
I've attached an example where you can see the two discount lines, but the price is only calculated from one of them.
Regards
Kasper