/** * Given a store price that includes tax at the store rate, this function will back out the store's tax, and add in * the customer's tax. Returns this new price which is the customer's price including tax. * * @param float $storePriceInclTax * @param float $storeRate * @param float $customerRate * @return float */ protected function calculatePriceInclTax($storePriceInclTax, $storeRate, $customerRate) { $storeTax = $this->calculator->calcTaxAmount($storePriceInclTax, $storeRate, true, false); $priceExclTax = $storePriceInclTax - $storeTax; $customerTax = $this->calculator->calcTaxAmount($priceExclTax, $customerRate, false, false); $customerPriceInclTax = $this->calculator->round($priceExclTax + $customerTax); return $customerPriceInclTax; }