News:

Support the VirtueMart project and become a member

Main Menu

Rounding issue

Started by Malex, September 15, 2017, 15:17:10 PM

Previous topic - Next topic

Malex

Hello!

I have a bug setting rounded prices , if i set Final salesprice Rounding Digits to "0" and the Total tax amount rounding to "2", there is no effect on total tax amount, staying to "0" Rounding Digits
I tried the opposite, same problem, that's mean rounding final price and total tax are linked, hard to understand ..   :o
Please see attachements
Do you have an idea ?

Thanks a lot !



VM 3.2.4
Joomla 3.7.5

AH

What are you expecting
What tax are you setting etc
Regards
A

Joomla 4.4.5
php 8.1

Malex

#2
Hello,

i want 0 digit to Final salesprice and 2 digits to Total tax amount,
as youn can see in the second screen shot

Malex

I spent a lot of time searching a solution, please
would anyone have a track, an idea of ​​the direction to look for ?

Milbo

The tax for the products seems right. hmmm
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Malex

Quote from: Milbo on September 18, 2017, 12:58:27 PM
The tax for the products seems right. hmmm
The tax calculation is not the problem, the problem is tax rounding;
In admin > configuration > prices
When i set Final salesprice Rounding Digits to "0"
and
i set the Total tax amount rounding to "2",
no effect on total tax amount, staying to "0" Rounding Digits
see the second attachement "wrong" to see what i mean.

Milbo

yes, I noticed it. I just meant, that it is correct above. It is on my todo list.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Malex

Thanks for your reply. Do you thing i may apply some modifications in some files to make this work waiting for resolution ?

Milbo

I put it on my todo list, if you want to have it faster, help us, do it yourself and share the code here, or consider to buy a membership. http://extensions.virtuemart.net/support/virtuemart-supporter-membership-bronze-detail

The reason for the error is simple. The rounding of the final price is just the fallback of any non defined price. And the tax total is not defined.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Malex

Oh, mmm..
I'm afraid I do not have enough skills to find by myself ..
I searched for a long time..I will try again but it is a difficult problem to understand since there are 2 separate fields which one can change attributes in administration , without result...
I will consider buying a membership anyway but not sure that this will solve the problem
;)

Have a nice day

Milbo

This lines here echo $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $prow->prices, FALSE, FALSE, 1.0, false, true);

or the line you need to change
echo "<span  class='priceColor2'>" . $this->currencyDisplay->createPriceDiv ('billTaxAmount', '', $this->cart->cartPrices['billTaxAmount'], FALSE)

When you go to the function createPriceDiv, you will see this

//The fallback, when this price is not configured
if(empty($this->_priceConfig[$name])){
$this->_priceConfig[$name] = $this->_priceConfig['salesPrice'];
}


So you need to provide the $this->_priceConfig['billTaxAmount'] with the right array $this->_priceConfig['billTaxAmount'][0]=true and $this->_priceConfig['billTaxAmount'][1]=2 and $this->_priceConfig['billTaxAmount'][2] = true.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/