vat % calculation from a record

secondangel

Registered User.
Local time
Today, 00:16
Joined
Nov 6, 2008
Messages
52
Hi there

Im trying to take the vat percent from my selling price. I need to minus by 17.5%

Im trying this method in a query

[RetailPrice]-([RetailPrice]*0.175)

However my website adds vat to the price rather than multiplies.

So for ex if my product is £5 then minus vat its actually 4.1255 however then we my site adds vat of 17.5 to the price i get 4.86

I cant seem to use the percentage sign and my barin cant work out the maths involved.


Any help appreciated

Really i want

RetailPrice = RetailPrice - 17.5%


RetailPrice is set as currency with auto decimal places


also then when uk vat gets reduced next week ill be able to just ammned to the new value


or should i ammned the tax function in zen cart so it MULTIPLIES by my tax class rather than ADD
 
Last edited:
Add tax to a products price
function zen_add_tax($price, $tax) {
global $currencies;

if (DISPLAY_PRICE_WITH_TAX_ADMIN == 'true') {
return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($price, $tax);
} else {
return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
}
}

// Calculates Tax rounding the result
function zen_calculate_tax($price, $tax) {
global $currencies;

return zen_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
}



anything i should ammend here from my zen cart instead

that way i can keep my original access code
 
Last edited:
its quite hard to get this spot on but

(price /117.5 ) *100
so
£5.00 /0.04255 * 100 = 4.26 will get you close


However Vat ( or tax ) should be stored in a sepearate table - this give you the ability to change tax easly

if you belive the papers then Vat next year could be 18.5 or at least 17.5%

the range it can be (EU directive is a minimum of 15% and from memory 20% max)- puttting this into a table will help
 
To find out the vat element from any figure using a base rate of 17.5 % then use 7/47ths

So if you have a value of £117.5 divide this by 47 then multiply it by 7 to give you the vat element.

David
 
To find out the vat element from any figure using a base rate of 17.5 % then use 7/47ths

So if you have a value of £117.5 divide this by 47 then multiply it by 7 to give you the vat element.

David
Oooo didn't know that trick. Cheers.
 
When calculating any amount due to tax the formula is:

Price inc. tax * taxrate%/ (1 + taxrate%) = amount due to tax

So for a 17.5% tax rate on a 57.80 item it would be

57.80 * 0.175 / 1.175 = ~ 8.61
 
BTW when using 15% VAT the calculation for extracting the vat content of a value = 3/23rds

So (115/23)*3 = 15
 
I beleive the most reliable way to perform Inc pricing calculations to establish VAT should be

Inc / ( 1 + [Vat Rate])

Any changes in Vat rates can be accommodated rather having to change your method of calculation if the rate changes.

We perform Margin Vat calculations and use

Inc / (2 + [Vat Rate])

assuming the Supplier is not Vat Registered and the profit on the sale is 50%.

Simon
 
Chergh / Gary and/or Simon have the 'best' ones I think...
Amount EX VAT:
Amount / (1 + Vat%) > 57.80 / 1.175 = 49.19
or
Amount / (1 + VAT) * 100 > 57.80 / 117.5 * 100 = 49.19

VAT:
Amount / (1 + Vat%) * VAT% > 57.80 / 1.175 * 0.175 = 8.61
or
Amount / (1 + VAT) * 17.5 > 57.80 / 117.5 * 17.5 = 8.61

This allows you to calculate with the actual % instead of having to do trickery with 3/23 etc...
 

Users who are viewing this thread

Back
Top Bottom