Using nopCommerce 4.40.3.
I have a problem with my shopping cart total decreasing every time i do reorder on an order including products with CustomEredenteredPrice options enabled. It only happends when PricesIncludeTax is enabled in taxsettings.
Found out that the ReOrderAsync function in the OrderProcessingService is always using
orderItem.UnitPriceExclTax regardless of taxsettings.
Original code:
await _shoppingCartService.AddToCartAsync(customer, product,
ShoppingCartType.ShoppingCart, order.StoreId,
orderItem.AttributesXml, orderItem.UnitPriceExclTax,
orderItem.RentalStartDateUtc, orderItem.RentalEndDateUtc,
orderItem.Quantity, false);
Fix:
await _shoppingCartService.AddToCartAsync(customer, product,
ShoppingCartType.ShoppingCart, order.StoreId,
orderItem.AttributesXml, _taxSettings.PricesIncludeTax ?
orderItem.UnitPriceInclTax : orderItem.UnitPriceExclTax,
orderItem.RentalStartDateUtc, orderItem.RentalEndDateUtc,
orderItem.Quantity, false);
This way the customered entered price will be correct both for those who have the PricesIncludeTax option enabled or disabled :)