Copied to clipboard

Flag this post as spam?

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


  • Paul Wright (suedeapple) 244 posts 641 karma points
    Feb 25, 2016 @ 16:19
    Paul Wright (suedeapple)
    0

    UK Vat - Getting the Actual VAT due, and Item Price

    Running Umbraco 7.4.1, TC 3.0.7

    I have enabled TeaCommerce to "Prices include VAT"

    I have an item which is £6.99

    TC XML order, totalprice is showing:

    **vatFormatted: £1.17

    formatted: £5.83

    withVatFormatted : £6.99 **

    Add (vatFormatted + formatted) together and you get £7. Is this a bug?...

    ... or is there another way to get the true amounts to 2 dec places without having to resort to an inline calc of (withVatFormatted - vatFormatted)

    Currently doing something like this...

      long storeId = long.Parse(Model.Content.GetPropertyValue<string>("store", true));
    Currency currentCurrency = TC.GetCurrentCurrency(storeId);
    order = TC.GetCurrentOrder(storeId, false);
    
    string totalPriceMinusVat = String.Format("{0}{1}", currentCurrency.Symbol, (Convert.ToDecimal(order.TotalPrice.Value.WithVatFormattedWithoutSymbol) - Convert.ToDecimal(order.TotalPrice.Value.VatFormattedWithoutSymbol)).ToString());
    
  • Nik 1304 posts 5527 karma points MVP 3x c-trib
    Feb 25, 2016 @ 17:11
    Nik
    0

    Welcome to the world of VAT calculations. Unfortunately, the less decimal places the more likely this is to occur if your numbers aren't cleanly multiplyable/divisible by the VAT values.

    That aside, I think your example is wrong.

    If you have an item and your Price including VAT is £5.99 The Pre-VAT price is 5.99 / 1.2 = £4.99 (2.d.p.)

    Your VAT is therefore £1 (2.d.p.) (Or £0.9983......)

    Because of rounding you will always get a bit of a discrepancy when showing these breakdowns I'm afraid.

  • Paul Wright (suedeapple) 244 posts 641 karma points
    Feb 25, 2016 @ 17:28
    Paul Wright (suedeapple)
    0

    Should say £6.99 :-) ... a small fundamental typo opppsie on my part - Sorry! :)

    Would be cool if TC could just give the total amount minus the rounded VAT though.

    Sub Total (Excluding VAT) : £5.82

    VAT : £1.17

    Total : £6.99

  • Anders Burla Johansen 2560 posts 8256 karma points
    Feb 26, 2016 @ 07:19
    Anders Burla Johansen
    0

    What if you dont use the formatted values, but the decimal values - they should be pretty correct. The formatted values are properly rounded.

Please Sign in or register to post replies

Write your reply to:

Draft