Removing VAT using line_item.change_line_price

Andy_Storey1
Tourist
9 0 4

All of our products have VAT included. 

In a Shopify Script I'm trying to remove the VAT (20%) if a customer is outside of the EU.

I'm testing that using: 
if Input.cart.shipping_address and localTax_EU_CountryCodes.include?(Input.cart.shipping_address.country_code)

The offical way of doing this is divide the VAT-included price by 1.2   So £20 / 1.2 = £16.67 ex VAT.

According to the docs, there is no divide by symbol to use here
https://help.shopify.com/api/tutorials/shopify-scripts#money

So I can't use 

          line_item.change_line_price(line_item.line_price / localTax_Amount, message: localTax_Message)
in my code.

Please help!

 

Andy

0 Likes