Invoice VAT calculation is wrong for the last product in the cart...

Started by pyb, October 02, 2012, 16:16:40 PM

Previous topic - Next topic

pyb

Hi,

I've got a problem with virtuemart 2.

Everything is fine, except the calculation of VAT in the invoice email... VAT for the last product is wrong...

As you can see in the attachment file... On the product line, VAT is 181,71€ !!!
VAT total is well calculated, the good VAT is 15,14€ (...) (12*6,44*19,6%)

What's going wrong ???

Cheers
Pierre

[attachment cleanup by admin]

Milbo

Hmm sorry, I dont have really a clue. Maybe a template override? I also advice to test the new version 2.0.11e
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

pyb

Hi,
Thanks for you reply !

I found something this morning...

In : components\com_virtuemart\views\invoice\tmpl\invoice_items.php

Line 73 :

<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right" class="priceCol"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($item->product_tax ,0$qtt). "</span>" ?></td>
<?php ?>


The product_tax is already store multiply by quantity in BDD ! ...So i replace $qtt by 1, and it's fine.


<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right" class="priceCol"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($item->product_tax ,01). /* PYB : remplacement de $qtt par 1 car la TVA est déjà stockée sur la quantité commandée */"</span>" ?></td>
                                <?php ?>


Thanks for all.
Pierre

Milbo

Then you used an old template override. On the long term, we will remove the parameter for quantity there.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/