I Need to restrict the tax amount. so i went Mage/Tax/Model/Calculation.php
Then Finds calcTaxAmount()
Tax Applying Function. I need to restrict tax who all are enter the tax vatid in checkout onepage tax should be zero
so
public function calcTaxAmount($price, $taxRate, $priceIncludeTax = false, $round = true)
{
$billing = Mage::getModel('checkout/session')->getQuote()->getCustomerTaxvat();
if($billing != "" )
{
return 0;
}
$taxRate = $taxRate / 100;
if ($priceIncludeTax) {
$amount = $price * (1 - 1 / (1 + $taxRate));
} else {
$amount = $price * $taxRate;
}
if ($round) {
return $this->round($amount);
}
return $amount;
}
I added the new condition. its working some stores of multistores. Only one store cannot working properly. it causes user cannot register , and addtocart not working for that particular store. i found getQuote the issue. i remove the new condtion like below working fine.
Old Function:-
public function calcTaxAmount($price, $taxRate, $priceIncludeTax = false, $round = true)
{
$taxRate = $taxRate / 100;
if ($priceIncludeTax) {
$amount = $price * (1 - 1 / (1 + $taxRate));
} else {
$amount = $price * $taxRate;
}
if ($round) {
return $this->round($amount);
}
return $amount;
}