Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: VAT rounded?

  1. #1
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,517
    Thanks
    114
    Thanked 110 Times in 109 Posts

    VAT rounded?

    I'm not sure how to do something correctley on our ecommerce system.
    Its rounding issues im having and I cant quite figure out the best way to store the VAT and weather this should be rounded. At present everything is stored rounded apart from the VAT.

    Let me explain a little bit about how the storing a transaction works

    The ex vat selling price for each item is added up. This is done with the calculation on the cost price and a margin. Once i get to the EX VAT total for each item I round this value to the nearest penny. This is so if a user adds 3 items to the basket - Three times the ex total of the item does actually add up.

    Each item is stored in a table against the order id.
    For each item we store
    - The cost rate (how much we pay the supplier for a single item)
    - The cost total (quantity of that item ordered multiply by the cost rate)
    - The Ex vat rate (The ex VAT selling price of a single item rounded)
    - The Ex Total (quantity of that item ordered multiply by the ex vat rate rounded)
    - The Quantity


    We then calculate the ex VAT total for the order. Sum of the EX totals. This result will already be rounded. We then add the carriage which is EX VAT. Then we times by 1.2 to get to the grand total. However for each transaction we store the
    - Cost Total ( Sum of cost totals)
    - EX Total. ( Sum of the totals)
    - Carriage ( The amount the user will pay carriage for the order EX VAT)
    - VAT ( The amount of VAT payed for the that entire order)
    - The VAT RATE. e.g 1.2
    - The Grand Total (EX Total + Carriage + VAT)

    The problem is on the screen everything is displayed rounded and Everything is stored rounded except the VAT. The grand total is stored to pennies. should i be storing the VAT rate rounded or full float. Should the grand total be stored full float. What happens when we try to calculate the VAT total at year end. Will what we should be paying VAT equal the sum of the rounded VAT values. Thats really what i am trying to figure out
    You can not say you know how to do something, until you can teach it to someone else.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    The total VAT you report at the end of the year needs to match the actual amount of VAT that you collect, so IMO you should store the VAT rounded (since everything else is rounded), same for purchases, you can only claim what you shell out and the Inland revenue I assume does not do halfpennies any more ( I remember them )

    The only time you should worry (IMO) about amounts less than 1p would be in your cost pricing, and even then only for internal purposes, when you pay or sell you are doing so to the nearest penny.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • Users who have thanked firepages for this post:

    timgolding (09-13-2013)

  • #3
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,517
    Thanks
    114
    Thanked 110 Times in 109 Posts
    OK I will round the VAt amounts and make sure the figures add up thanks for your help.
    You can not say you know how to do something, until you can teach it to someone else.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •