VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: nickson on December 20, 2012, 20:57:38 PM

Title: Allmost there
Post by: nickson on December 20, 2012, 20:57:38 PM
Well, It seems like version 2.0.16 makes the shop better and better. All I wanted was the tax to work correct on discount coupons.
That seems sorted out now.

Well allmost that is. The thing is when I set the tax to Vat tax per product, witch is needed for the coupon discount to work correct for me, additional costs (for product options) are now displayed without tax.
That is really not what I want. Because on my site prices are all including taxes.

What to do?
Title: Re: Allmost there
Post by: Milbo on December 20, 2012, 22:26:59 PM
oh, interesting. Tomorrow then. I think I am just missing the vat tax for the customs. Strange that no one saw that before :-)
Title: Re: Allmost there
Post by: Milbo on December 20, 2012, 22:33:25 PM
Please edit calculationh.php,

replace the function around line 1090 with this

function calculateCustomPriceWithTax($price, $override_id=0) {

$taxRules = $this->gatherEffectingRulesForProductPrice('Tax', $override_id);
$vattaxRules = $this->gatherEffectingRulesForProductPrice('VatTax', $override_id);
$rules = array_merge($taxRules,$vattaxRules);
if(!empty($rules)){
$price = $this->executeCalculation($rules, $price, true);
}

$price = $this->roundInternal($price);

return $price;
}
Title: Re: Allmost there
Post by: nickson on December 20, 2012, 23:23:09 PM
Works like a charm! Thanks a lot!

Is this going to be inserted in any next release?
Then I wont have to add it to my list of adjustments on any update ;)

Thanks again!
Title: Re: Allmost there
Post by: Milbo on December 21, 2012, 00:05:40 AM
Will be added, I think even with vm config setting.
Title: Re: Allmost there
Post by: Milbo on December 21, 2012, 14:21:01 PM
Is now in the new uploaded version. We did not fix really bugs, so same version number.