close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

A Tip for UK/European Developers regarding Vatable & Non-Vatable Goods and Shipping

Thread began 9/08/2010 3:38 pm by Dave Buchholz | Last modified 11/20/2014 9:07 am by Dave Buchholz | 4197 views | 3 replies

Dave BuchholzBeta Tester

A Tip for UK/European Developers regarding Vatable & Non-Vatable Goods and Shipping

Here in the UK if the goods that are being sold are subject to VAT and the company selling them are registered for vat then the carriage charge is also subject to VAT, but what if there are also goods being sold (in the case of the site I am working on children's clothes) that are not subject to VAT, how do you get eCart to add the VAT correctly ?

First of all you need to have a column in your database that denotes whether the product is vatable or not and a column in the eCart object to store this value in as per Jason's advice in this thread

Also make sure that the include shipping in cart subtotal when calculating sales tax checkbox under the shipping tab is checked.

When shipping to an address within the EU you must charge vat so I have a tax rule called EU Tax Calc that checks the for the existence of the session variable $_SESSION['eCartCheckoutForm_country'] and then checks the value to see whether the country being shipped to is within the EU. If the address is within the EU then we have to charge VAT

So the first rule in the Tax id the Standard Check that the number of unique items in the cart is greater than zero and then we check the session variable as described above.

For the Calculation choose Flat rate and paste this code into the box

((($this->GetTaxableTotal()) - ($this->ConditionalTotal("TotalPrice", "Taxable", "0"))) * 0.175)



What this code does is subtracts the non vatable portion of the order from the taxable total and then calculates the VAT due on the remainder (plus shipping)

I hope that helps somebody else who finds themselves in this situation.

The entire eCart rule should look like this in your eCart file

//eCart Rule
function WAEC_eCart1_EUTaxCalc() {
$totalTax = 0;
if (true && ((sizeof($this->Items) > 0) && (isset($_SESSION['eCartCheckoutForm_shipping_country'])) && ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "GB") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "BE") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "BG") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "CZ") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "DK") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "DE") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "EE") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "GR") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "ES") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "FR") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "IE") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "IT") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "CY") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "LV") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "LT") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "LU") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "HU") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "MT") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "NL") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "AT") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "PL") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "PT") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "RO") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "SI") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "SK") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "FI") || ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "SE"))) {
$totalTax += ((($this->GetTaxableTotal()) - ($this->ConditionalTotal("TotalPrice", "Taxable", "0"))) * 0.175);//Result
}
return WA_eCart_FormatNumber($totalTax, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...