Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Nauman 98 posts 118 karma points
    Dec 22, 2010 @ 12:42
    Nauman
    0

    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

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 22, 2010 @ 13:06
    Søren Spelling Lund
    0

    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.

  • Jameskn 64 posts 78 karma points
    Jan 05, 2011 @ 19:56
    Jameskn
    0

    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

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 06, 2011 @ 06:59
    Søren Spelling Lund
    0

    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. 

  • Jameskn 64 posts 78 karma points
    Jan 06, 2011 @ 11:18
    Jameskn
    0

    Many thanks for the reply and the clarafication.

  • Jameskn 64 posts 78 karma points
    Jan 12, 2011 @ 18:40
    Jameskn
    0

    Hi,

    Just to confirm does this get fixed in the latest release?

    Not listed in the release notes.

    Cheers,

    James

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 12, 2011 @ 19:19
    Søren Spelling Lund
    0

    It didn't make it in.  It'll be part of the maintenance release 1.3.0.1.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 12, 2011 @ 20:49
    Søren Spelling Lund
    0

    There doesn't seem to be a rounding issue with VAT. Here's an XML fragment of a test order line I made:

       <lineItems>
            <lineItem index="3" sku="200-000-001" variantSku="004" productName="10" price="100.5555" quantity="1" discount="0.0000" vat="13.0722" total="113.6277">
                <orderProperties />
            </lineItem>
        </lineItems>
    
    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.
  • Jameskn 64 posts 78 karma points
    Jan 12, 2011 @ 21:34
    Jameskn
    0

    "

    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.
  • Gilles Faessler 29 posts 53 karma points
    May 02, 2012 @ 17:10
    Gilles Faessler
    0

    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

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 03, 2012 @ 08:32
    Søren Spelling Lund
    0

    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.

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 03, 2012 @ 08:58
    Søren Spelling Lund
    0

    You can test it out in uCommerce 2.6 hot off the presses.

  • Gilles Faessler 29 posts 53 karma points
    May 03, 2012 @ 09:12
    Gilles Faessler
    0

    Hi Soeren. Thanks for the quick answer and action taken.

    We will test it and provide you some feedback

     

     

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 03, 2012 @ 09:16
    Søren Spelling Lund
    0

    Wonderful. Much appreciated.

  • Gilles Faessler 29 posts 53 karma points
    May 07, 2012 @ 08:52
    Gilles Faessler
    0

    Perfect, with 2.6 we don't have any rounding issues anymore on VAT.

    Gilles

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 09, 2012 @ 10:14
    Søren Spelling Lund
    0

    Awesome. Thanks for reporting back on your experience with it.

Please Sign in or register to post replies

Write your reply to:

Draft