Fix shipping vat
parent
dd70788226
commit
a987746e01
|
|
@ -34,7 +34,7 @@ public class Order {
|
||||||
List<Product> highVatProducts = filterHighVatProducts(products);
|
List<Product> highVatProducts = filterHighVatProducts(products);
|
||||||
float lowVatPortion = getPrice(lowVatProducts) / totalPrice;
|
float lowVatPortion = getPrice(lowVatProducts) / totalPrice;
|
||||||
float highVatPortion = getPrice(highVatProducts) / totalPrice;
|
float highVatPortion = getPrice(highVatProducts) / totalPrice;
|
||||||
return baseShippingCost * lowVatPortion / (1 + Constants.lowVat) + baseShippingCost * highVatPortion / (1 + Constants.highVat);
|
return baseShippingCost - (baseShippingCost * lowVatPortion / (1 + Constants.lowVat) + baseShippingCost * highVatPortion / (1 + Constants.highVat));
|
||||||
}
|
}
|
||||||
|
|
||||||
public float calculateShippingCost(List<Product> products) {
|
public float calculateShippingCost(List<Product> products) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue