Skip to content

Commit 0626bbe

Browse files
committed
Minor VAT calculation fix
1 parent bb69488 commit 0626bbe

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Libraries/SmartStore.Services/Orders/OrderTotalCalculationService.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,15 @@ public virtual void GetShoppingCartSubTotal(IList<OrganizedShoppingCartItem> car
185185
if (_shoppingCartSettings.RoundPricesDuringCalculation)
186186
{
187187
// Gross > Net RoundFix
188-
int temQuantity = shoppingCartItem.Item.Quantity;
189-
shoppingCartItem.Item.Quantity = 1;
188+
int qty = shoppingCartItem.Item.Quantity;
190189

191-
sciSubTotal = _priceCalculationService.GetSubTotal(shoppingCartItem, true);
190+
sciSubTotal = _priceCalculationService.GetUnitPrice(shoppingCartItem, true);
192191

193192
// Adaption to eliminate rounding issues
194193
sciExclTax = _taxService.GetProductPrice(shoppingCartItem.Item.Product, sciSubTotal, false, customer, out taxRate);
195-
sciExclTax = Math.Round(sciExclTax, 2) * temQuantity;
194+
sciExclTax = Math.Round(sciExclTax, 2) * qty;
196195
sciInclTax = _taxService.GetProductPrice(shoppingCartItem.Item.Product, sciSubTotal, true, customer, out taxRate);
197-
sciInclTax = Math.Round(sciInclTax, 2) * temQuantity;
198-
199-
shoppingCartItem.Item.Quantity = temQuantity;
196+
sciInclTax = Math.Round(sciInclTax, 2) * qty;
200197
}
201198
else
202199
{

0 commit comments

Comments
 (0)