VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: jack19 on October 13, 2012, 14:19:17 PM

Title: TAXES - (showing the correct discounts)
Post by: jack19 on October 13, 2012, 14:19:17 PM
Hi,
I have the following question on the calculation of taxes.
For the Italian tax authorities to use the calculation is as follows eg:
Unit price: 15.70, VAT 21%

Q.ty 1 ->15.70 * 21% VAT=3.2977 roud to ->3.30
Q.ty 2 ->31.40 * 21% VAT=6.594 round to ->6.59 not 6.60 (3.30*2)
Q.ty 3 ->47.10 * 21% VAT=9.891 round to ->9.89 not 9.90 (3.30*3)
Q.ty 4 ->62.80 *21%  VAT=13.188 round to ->13.19 not 13.20 (3.30*4)
etc.
Then the calculation for the unit is done by multiplying the tax for the individual product units (3.30 * # Units), but we need to calculate the total product for the tax rate (15.70 * # Units * 21%)
Also, if you add a discount (e.g. 10%) calculation should be like in the attached images.
I noticed a display error in the invoice. (See images).
Any idea?
Rgds

[attachment cleanup by admin]
Title: Re: TAXES - (showing the correct discounts)
Post by: jack19 on October 15, 2012, 11:27:15 AM
Hi,
what are the correct pages to make the changes I want?
Rgds
Title: Re: TAXES - (showing the correct discounts)
Post by: jack19 on October 15, 2012, 15:21:32 PM
Quote from: jack19 on October 13, 2012, 14:19:17 PM
...
I noticed a display error in the invoice. (See images).
...
Hi,
I found this workaround:
file invoice_items.php around line 80 found this code
<?php  echo  $this->currency->priceDisplay$item->product_subtotal_discount );  //No quantity is already stored with it ?>
replace with
<?php //echo  $this->currency->priceDisplay( $item->product_subtotal_discount );  //No quantity is already stored with it
// Edinting for show the correct disconut
                 $priceBaseWT str_replace(",",".",$this->currency->priceDisplay($item->product_basePriceWithTax,0$qtt));
  $priceSubtotalWT str_replace(",",".",$this->currency->priceDisplay(  $item->product_subtotal_with_tax ,0));
  $PriceDiscount str_replace(".",",",number_format($priceBaseWT-$priceSubtotalWT,2));
  echo $PriceDiscount;
// End editing   
?>

but I should also display the currency symbol, as I take it?
echo $PriceDiscount." currency symbol???

Ops, I found this:
echo $PriceDiscount." ".$this->currency->getSymbol('_symbol');
It is correct?
Rgds
Title: Re: TAXES - (showing the correct discounts)
Post by: jack19 on October 23, 2012, 11:27:49 AM
Quote from: jack19 on October 13, 2012, 14:19:17 PM
Hi,
I have the following question on the calculation of taxes.
For the Italian tax authorities to use the calculation is as follows eg:
Unit price: 15.70, VAT 21%

Q.ty 1 ->15.70 * 21% VAT=3.2977 roud to ->3.30
Q.ty 2 ->31.40 * 21% VAT=6.594 round to ->6.59 not 6.60 (3.30*2)
Q.ty 3 ->47.10 * 21% VAT=9.891 round to ->9.89 not 9.90 (3.30*3)
Q.ty 4 ->62.80 *21%  VAT=13.188 round to ->13.19 not 13.20 (3.30*4)
etc.
Then the calculation for the unit is done by multiplying the tax for the individual product units (3.30 * # Units), but we need to calculate the total product for the tax rate (15.70 * # Units * 21%)
Also, if you add a discount (e.g. 10%) calculation should be like in the attached images.
I noticed a display error in the invoice. (See images).
Any idea?
Rgds
Hi,
I am still finding this problem in version 2.0.12e. Again.
What are the pages to make corrections?
Thks.
Best Regards
Title: Re: TAXES - (showing the correct discounts)
Post by: jack19 on November 05, 2012, 11:28:13 AM
Up
:'(
Title: Re: TAXES - (showing the correct discounts)
Post by: bytelord on November 05, 2012, 17:16:45 PM
Hello,

Please try to use vat tax per product, http://forum.virtuemart.net/index.php?topic=108865.5

Regards
Title: Re: TAXES - (showing the correct discounts)
Post by: jack19 on November 05, 2012, 18:04:00 PM
Quote from: bytelord on November 05, 2012, 17:16:45 PM
Hello,

Please try to use vat tax per product, http://forum.virtuemart.net/index.php?topic=108865.5

Regards
Hi,
I tried, but practically does not change the result. The problem remains.
Regards
Title: Re: TAXES - (showing the correct discounts)
Post by: bytelord on November 05, 2012, 18:17:23 PM
For rounding please follow the thread http://forum.virtuemart.net/index.php?topic=108809.0
Milbo have some good answers on that
Title: Re: TAXES - (showing the correct discounts)
Post by: AH on November 05, 2012, 20:43:34 PM
I agree that milbo expressed the problem of rounding in detailed terms.

But this has not resulted in a viable solution as yet.