You can take a look at the TaxService class and the ITaxService interface. If you need to override the default behavior you can go ahead and either inherit TaxService or implement ITaxService from scratch.
Once you're happy with your implementation you can register it with uCommerce by editing the /umbraco/ucommerce/configuration/components.config file.
If I remember rightly VAT in the UK should be rounded.
Math.Round(Amount,2,MidPointRounding.AwayFromZero) (Excuse the potential error in syntax)
Is this not the case in the Tax Service class? Hence if we wanted to run an Ecommerce site with UK VAT we would need to change the default class in Ucommerce.
Any chance I can put a feature request in to allow you to choose the rounding in TaxService ?
The default behavior will be changed in uCommerce 1.3 to reflect the above. But for earlier versions you're correct that you'd have to change TaxService.
Please notice the VAT attribute which holds the value of 13.0722. As expected uCommerce stores the calculated values with greater precision than what is displayed on the page. The value will be used during authorization as well so the customer will be charged the exact amount.
The confusion stems from the fact that a FormatCurrency is run on the value which indeed does do rounding based on standard rules and as a result the values are slightly off. If you go ahead and format the values in the correct way you want there's no issue.
The confusion stems from the fact that a FormatCurrency is run on the value which indeed does do rounding based on standard rules and as a result the values are slightly off. If you go ahead and format the values in the correct way you want there's no issue." So I can change FormatCurrency in the system then? Will have a look tommorrow and work through this.
We have a similar problem with VAT beeing rounded to two positions.
VAT rate is 0.08. Item price without VAT is set to 11.1111. Item price with VAT is expected to be 12.00
When I add one item into basket and look into the database (OrderLine) I have following values : Price : 11.1111 -> OK Quantity : 1 -> OK VATRate : 0.08 -> OK VAT : 0.89 -> Incorrect, should be 0.8889 if not rounded to two positions.
Is this normal behaviour ? Should we work on TaxService to force VAT calculation with no rounding ?
The rounding issue is caused by the total calculations in the basket pipeline. They will round out to two decimal places. In retrospect this wasn't the clevereest of ideas and I will change the behavior for uCommerce 2.6.
rounding VAT
Hi Soren
I have a question on rounding of VAT. I have a product having
Price: 580.48
When I apply VAT 17.5 % the VAT is calculated 101.584. Ucommerce round of VAT upto 2 decimal places hence displays it as 101.58.
As you know the rules of VAT is to rounded of to upper value so it should be 101.59 after rounding to 2 decimal places.
Is there an option / way so I could round of VAT to upper value making it 101.59?
Nauman
Hi Nauman,
You can take a look at the TaxService class and the ITaxService interface. If you need to override the default behavior you can go ahead and either inherit TaxService or implement ITaxService from scratch.
Once you're happy with your implementation you can register it with uCommerce by editing the /umbraco/ucommerce/configuration/components.config file.
Hi,
Just to clarify what is it round at the moment ?
If I remember rightly VAT in the UK should be rounded.
Math.Round(Amount,2,MidPointRounding.AwayFromZero) (Excuse the potential error in syntax)
Is this not the case in the Tax Service class? Hence if we wanted to run an Ecommerce site with UK VAT we would need to change the default class in Ucommerce.
Any chance I can put a feature request in to allow you to choose the rounding in TaxService ?
Cheers,
James
Hi James,
The default behavior will be changed in uCommerce 1.3 to reflect the above. But for earlier versions you're correct that you'd have to change TaxService.
Many thanks for the reply and the clarafication.
Hi,
Just to confirm does this get fixed in the latest release?
Not listed in the release notes.
Cheers,
James
It didn't make it in. It'll be part of the maintenance release 1.3.0.1.
There doesn't seem to be a rounding issue with VAT. Here's an XML fragment of a test order line I made:
"
We have a similar problem with VAT beeing rounded to two positions.
VAT rate is 0.08. Item price without VAT is set to 11.1111. Item price with VAT is expected to be 12.00
When I add one item into basket and look into the database (OrderLine) I have following values :
Price : 11.1111 -> OK
Quantity : 1 -> OK
VATRate : 0.08 -> OK
VAT : 0.89 -> Incorrect, should be 0.8889 if not rounded to two positions.
Is this normal behaviour ? Should we work on TaxService to force VAT calculation with no rounding ?
Thanks
Gilles
Hi Gilles,
The rounding issue is caused by the total calculations in the basket pipeline. They will round out to two decimal places. In retrospect this wasn't the clevereest of ideas and I will change the behavior for uCommerce 2.6.
You can test it out in uCommerce 2.6 hot off the presses.
Hi Soeren. Thanks for the quick answer and action taken.
We will test it and provide you some feedback
Wonderful. Much appreciated.
Perfect, with 2.6 we don't have any rounding issues anymore on VAT.
Gilles
Awesome. Thanks for reporting back on your experience with it.
is working on a reply...