VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: lindapowers on October 10, 2014, 15:36:31 PM

Title: Function for calculating cost price not working for Child products
Post by: lindapowers on October 10, 2014, 15:36:31 PM
VirtueMart 2.6.10 and Joomla! 2.5.25

The function where you click "calculate cost price" and you enter the price with tax works fine in parent products and normal products but not in child products, keeps adding the tax. Check it yourself.

Regards

Title: Re: Function for calculating cost price not working for Child products
Post by: MarioP on October 10, 2014, 15:48:48 PM
Hmm...I've just tested. Works for me
Title: Re: Function for calculating cost price not working for Child products
Post by: lindapowers on October 10, 2014, 16:03:33 PM
Ill explain with images:


This is a normal product:

I want 1.70 € as price with tax.

(http://i57.tinypic.com/10og2fa.jpg)

And perfect, result shows 1.70 € (rounded in frontpage)

(http://i60.tinypic.com/161ib88.jpg)


Now the problem commented here:

Child Product, I try to do the same, I want 6.50 as price with tax.

(http://i58.tinypic.com/aetimf.jpg)

But in this case the tax is added to the price as you can see:

(http://i61.tinypic.com/119v7rc.jpg)



Regards



Title: Re: Function for calculating cost price not working for Child products
Post by: MarioP on October 10, 2014, 21:19:36 PM
Hmm - first example ( tax 4%) is ok.
- price with tax - 1,7
- price without tax - 1,6346

The second one (tax 10%) - seems to be something wrong
The tax on 6,5 €  wasn't simply added, because
- price with tax - 6,5
- price without tax - 5.9090
- tax - 0,591
So: 6,5+0,591 isn't equal 7,15
Your tax rule just adds tax to the final price: 6,5 + 10% = 7,15 and then it calculates the cost price.
I don't know why...I'm not able to recreate that situation for the children

Do you use different taxes for parent and its childs? :o Or do we have a parent and a child not related with each other in the example you've presented?
Title: Re: Function for calculating cost price not working for Child products
Post by: lindapowers on October 11, 2014, 20:57:19 PM
Hi Mario

I use tax per categories, therefore 4% is assigned to a few categories and 10% to others.

The parent of the second example has 10% tax also (VatTax both our rules)

But thinking about this, the child has no category assigned and mabe that is causing a problem in the calculation for this function?

Title: Re: Function for calculating cost price not working for Child products
Post by: Milbo on October 12, 2014, 01:23:07 AM
That is right. They dont have categories. They are different loaded in the FE and have for calculation the categories of the father.