Tax rates in Magento for EU and Rest Of World - magento

As a UK VAT registered business selling outwith the UK I have created a tax rate based on the UK VAT rate for all EU countries. Out-with the EU no VAT will be charged so am I correct in thinking I don't have to create any further rates, and that a user buying from the Rest Of World will just not have no tax rule applied so no VAT will be added nor will a tax element appear in their invoice breakdown (VAT breakdown is enabled in the config)?

An up to date CSV for EU tax rates in 2014 that works with Magento 1.9.0.1 (note that this is the current UK VAT rate of 20%). You should not be charging VAT when you ship to countries outside of the EU zone- ignore their billing address, it is where you send the items that counts. It should also be noted that Iceland, Liechtenstein, Norway and Switzerland are exempt from UK VAT.
Code,Country,State,Zip/Post Code,Rate,Zip/Post is Range,Range From,Range To,default
GB,GB,*,,20.0000,,,,VAT
AL,AL,*,,20.0000,,,,VAT
AD,AD,*,,20.0000,,,,VAT
AT,AT,*,,20.0000,,,,VAT
BY,BY,*,,20.0000,,,,VAT
BE,BE,*,,20.0000,,,,VAT
BA,BA,*,,20.0000,,,,VAT
BG,BG,*,,20.0000,,,,VAT
HR,HR,*,,20.0000,,,,VAT
CY,CY,*,,20.0000,,,,VAT
CZ,CZ,*,,20.0000,,,,VAT
DK,DK,*,,20.0000,,,,VAT
EE,EE,*,,20.0000,,,,VAT
FO,FO,*,,20.0000,,,,VAT
FI,FI,*,,20.0000,,,,VAT
FR,FR,*,,20.0000,,,,VAT
DE,DE,*,,20.0000,,,,VAT
GI,GI,*,,20.0000,,,,VAT
GR,GR,*,,20.0000,,,,VAT
HU,HU,*,,20.0000,,,,VAT
IS,IS,*,,0.0000,,,,VAT
IE,IE,*,,20.0000,,,,VAT
IT,IT,*,,20.0000,,,,VAT
LV,LV,*,,20.0000,,,,VAT
LB,LB,*,,20.0000,,,,VAT
LI,LI,*,,0.0000,,,,VAT
LT,LT,*,,20.0000,,,,VAT
LU,LU,*,,20.0000,,,,VAT
MT,MT,*,,20.0000,,,,VAT
MD,MD,*,,20.0000,,,,VAT
MC,MC,*,,20.0000,,,,VAT
ME,ME,*,,20.0000,,,,VAT
NL,NL,*,,20.0000,,,,VAT
NO,NO,*,,0.0000,,,,VAT
PL,PL,*,,20.0000,,,,VAT
PT,PT,*,,20.0000,,,,VAT
RO,RO,*,,20.0000,,,,VAT
RS,RS,*,,20.0000,,,,VAT
SK,SK,*,,20.0000,,,,VAT
SI,SI,*,,20.0000,,,,VAT
ES,ES,*,,20.0000,,,,VAT
SJ,SJ,*,,20.0000,,,,VAT
SE,SE,*,,20.0000,,,,VAT
CH,CH,*,,0.0000,,,,VAT
TR,TR,*,,20.0000,,,,VAT
UA,UA,*,,20.0000,,,,VAT
VA,VA,*,,20.0000,,,,VAT

To my understanding, both those answers are incorrect. I'm fairly certain that as UK businesses we have to charge UK VAT only to the UK and other members of the EU, and zero rate to any country outside the EU. Both answers include non-EU countries in the csv, including AL (Albania), AD (Andorra), BY (Belarus), BA (Bosnia & Herzegovina), etc, etc.
Here's my edited list, although I'm not sure about VA (Vatican City), it seems to officially not be part of the EU, so in theory zero rated, can anyone clarify? (Not that I've ever had an order from there!)
Code,Country,State,Zip/Post Code,Rate,Zip/Post is Range,Range From,Range To,default
GB,GB,*,,20.0000,,,,VAT
AT,AT,*,,20.0000,,,,VAT
BE,BE,*,,20.0000,,,,VAT
BG,BG,*,,20.0000,,,,VAT
CY,CY,*,,20.0000,,,,VAT
CZ,CZ,*,,20.0000,,,,VAT
DK,DK,*,,20.0000,,,,VAT
EE,EE,*,,20.0000,,,,VAT
FI,FI,*,,20.0000,,,,VAT
FR,FR,*,,20.0000,,,,VAT
DE,DE,*,,20.0000,,,,VAT
GI,GI,*,,20.0000,,,,VAT
GR,GR,*,,20.0000,,,,VAT
HR,HR,*,,20.0000,,,,VAT
HU,HU,*,,20.0000,,,,VAT
IE,IE,*,,20.0000,,,,VAT
IT,IT,*,,20.0000,,,,VAT
LV,LV,*,,20.0000,,,,VAT
LI,LI,*,,0.0000,,,,VAT
LT,LT,*,,20.0000,,,,VAT
LU,LU,*,,20.0000,,,,VAT
MT,MT,*,,20.0000,,,,VAT
MC,MC,*,,20.0000,,,,VAT
NL,NL,*,,20.0000,,,,VAT
NO,NO,*,,0.0000,,,,VAT
PL,PL,*,,20.0000,,,,VAT
PT,PT,*,,20.0000,,,,VAT
RO,RO,*,,20.0000,,,,VAT
SK,SK,*,,20.0000,,,,VAT
SI,SI,*,,20.0000,,,,VAT
ES,ES,*,,20.0000,,,,VAT
SE,SE,*,,20.0000,,,,VAT
CH,CH,*,,0.0000,,,,VAT
VA,VA,*,,20.0000,,,,VAT

Related

ValueError: Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers

from os import listdir
from os.path import isfile, join
from datasets import load_dataset
from transformers import BertTokenizer
test_files = [join('./test/', f) for f in listdir('./test') if isfile(join('./test', f))]
dataset = load_dataset('json', data_files={"test": test_files}, cache_dir="./.cache_dir")
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
def encode(batch):
return tokenizer.encode_plus(batch["abstract"], max_length=32, add_special_tokens=True, pad_to_max_length=True,
return_attention_mask=True, return_token_type_ids=False, return_tensors="pt")
dataset.set_transform(encode)
When I run this code, I have
ValueError: Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers.
Instead of having a list of strings, I have a list of lists of strings. Here is the content of batch["article"]:
[['eleven politicians from 7 parties made comments in letter to a newspaper .', "said dpp alison saunders had ` damaged public confidence ' in justice .", 'ms saunders ruled lord janner unfit to stand trial over child abuse claims .', 'the cps has pursued at least 19 suspected paedophiles with dementia .'], ['an increasing number of surveys claim to reveal what makes us happiest .', 'but are these generic lists really of any use to us ?', 'janet street-porter makes her own list - of things making her unhappy !'], ["author of ` into the wild ' spoke to five rape victims in missoula , montana .", "` missoula : rape and the justice system in a college town ' was released april 21 .", "three of five victims profiled in the book sat down with abc 's nightline wednesday night .", 'kelsey belnap , allison huguet and hillary mclaughlin said they had been raped by university of montana football players .', "huguet and mclaughlin 's attacker , beau donaldson , pleaded guilty to rape in 2012 and was sentenced to 10 years .", 'belnap claimed four players gang-raped her in 2010 , but prosecutors never charged them citing lack of probable cause .', 'mr krakauer wrote book after realizing close friend was a rape victim .'], ['tesco announced a record annual loss of £ 6.38 billion yesterday .', 'drop in sales , one-off costs and pensions blamed for financial loss .', 'supermarket giant now under pressure to close 200 stores nationwide .', 'here , retail industry veterans , plus mail writers , identify what went wrong .'], ..., ['snp leader said alex salmond did not field questions over his family .', "said she was not ` moaning ' but also attacked criticism of women 's looks .", 'she made the remarks in latest programme profiling the main party leaders .', 'ms sturgeon also revealed her tv habits and recent image makeover .', 'she said she relaxed by eating steak and chips on a saturday night .']]
How could I fix this issue?

Magento table rate shipping - exclude some regions from shipping

I have setup a table rate shipping in Magento 1.9. I need to exclude some region from shipping.
For eg., In CSV there are 2 rows, in this format:
Country code - Region - postal - thrashhold - shipping cost
1. FR - Corsica - * - 0 - 18
2. * - * - * - 0 - 50
Currently, If I select France - Corsica in shipping calculator, then it returns shipping cost as 18, which is correct. If I select France - any other region then it shows shipping cost 50, which is not as requirement. Is it possible to restrict other regions, if I select France - any other region?
As per your CSV format condition on 2nd line is applied for all the location except FR-Corsica.You need to remove the second line then It must work as expected.
I think, I got it. I need to remove the regions from tables: directory_country_region and directory_country_region_name, then it wont give option to select other regions of France. Then the shipping can be restricted for these regions.
Only change order of rows
Example:
Country code - Region - postal - thrashhold - shipping cost
1. * - * - * - 0 - 50
2. FR - Corsica - * - 0 - 18

Is it possible to ask free form questions using google knowledge graph api?

Is it possible to ask a question like "how tall is the Eiffel Tower?" using google knowledge graph api? If not what is the correct api to use?
when i try this:
https://kgsearch.googleapis.com/v1/entities:search?query=how+tall+is+eiffel+tower&key=my_key&limit=1&indent=True
I get and empty result.
It's possible to ask, but half of the time it will "answer" with something different than what you were asking and the rest of the time it will give you an empty result.
Even unambiguous searches usually return empty or unexpected results. For example, when I search for the current US President it returns a result about Barack Obama, and when I search for the US population it doesn't really say what it should say (318.9 million (2014)):
=> #<HTTParty::Response:0x7ffc5857b938 parsed_response={"#context"=>{"#vocab"=>"http://schema.org/", "goog"=>"http://schema.googleapis.com/", "EntitySearchResult"=>"goog:EntitySearchResult", "detailedDescription"=>"goog:detailedDescription", "resultScore"=>"goog:resultScore", "kg"=>"http://g.co/kg"}, "#type"=>"ItemList", "itemListElement"=>[{"#type"=>"EntitySearchResult", "result"=>{"#id"=>"kg:/m/09c7w0", "name"=>"United States", "#type"=>["Country", "Thing", "Place", "AdministrativeArea"], "description"=>"Country", "image"=>{"contentUrl"=>"http://t1.gstatic.com/images?q=tbn:ANd9GcQKp8mjZhEK0hZroCA4srP9VA9eD8-0PcCsKSU4olhQlh6dMlxc", "url"=>"https://commons.wikimedia.org/wiki/File:USA_Flag_Map.svg", "license"=>"http://creativecommons.org/licenses/by-sa/2.5"}, "detailedDescription"=>{"articleBody"=>"The United States of America, commonly referred to as the United States or America, is a federal republic composed of 50 states, a federal district, five major self-governing territories, and various possessions. ", "url"=>"https://en.wikipedia.org/wiki/United_States", "license"=>"https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"}, "url"=>"http://www.usa.gov/"}, "resultScore"=>246.96698}, {"#type"=>"EntitySearchResult", "result"=>{"#id"=>"kg:/g/1q5jrvck9", "name"=>"Population: Us", "#type"=>["Thing"], "description"=>"Song by Frank Portman"}, "resultScore"=>20.875225}]}, #response=#<Net::HTTPOK 200 OK readbody=true>, #headers={"content-type"=>["application/json; charset=UTF-8"], "vary"=>["Origin", "X-Origin", "Referer"], "date"=>["Fri, 03 Feb 2017 20:33:38 GMT"], "server"=>["ESF"], "cache-control"=>["private"], "x-xss-protection"=>["1; mode=block"], "x-frame-options"=>["SAMEORIGIN"], "x-content-type-options"=>["nosniff"], "alt-svc"=>["quic=\":443\"; ma=2592000; v=\"35,34\""], "connection"=>["close"], "transfer-encoding"=>["chunked"]}>
Regardless of how I phrase the query or what keywords I use, it is practically useless. I have also tried specifying the &types= of results I want. Rarely does it ever return expected results; for example when I search for United States of America:
=> #<HTTParty::Response:0x7ffc58619f20 parsed_response={"#context"=>{"#vocab"=>"http://schema.org/", "goog"=>"http://schema.googleapis.com/", "EntitySearchResult"=>"goog:EntitySearchResult", "detailedDescription"=>"goog:detailedDescription", "resultScore"=>"goog:resultScore", "kg"=>"http://g.co/kg"}, "#type"=>"ItemList", "itemListElement"=>[{"#type"=>"EntitySearchResult", "result"=>{"#id"=>"kg:/m/09c7w0", "name"=>"United States", "#type"=>["Country", "Thing", "Place", "AdministrativeArea"], "description"=>"Country", "image"=>{"contentUrl"=>"http://t1.gstatic.com/images?q=tbn:ANd9GcQKp8mjZhEK0hZroCA4srP9VA9eD8-0PcCsKSU4olhQlh6dMlxc", "url"=>"https://commons.wikimedia.org/wiki/File:USA_Flag_Map.svg", "license"=>"http://creativecommons.org/licenses/by-sa/2.5"}, "detailedDescription"=>{"articleBody"=>"The United States of America, commonly referred to as the United States or America, is a federal republic composed of 50 states, a federal district, five major self-governing territories, and various possessions. ", "url"=>"https://en.wikipedia.org/wiki/United_States", "license"=>"https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"}, "url"=>"http://www.usa.gov/"}, "resultScore"=>4238.782227}]}, #response=#<Net::HTTPOK 200 OK readbody=true>, #headers={"content-type"=>["application/json; charset=UTF-8"], "vary"=>["Origin", "X-Origin", "Referer"], "date"=>["Fri, 03 Feb 2017 20:29:07 GMT"], "server"=>["ESF"], "cache-control"=>["private"], "x-xss-protection"=>["1; mode=block"], "x-frame-options"=>["SAMEORIGIN"], "x-content-type-options"=>["nosniff"], "alt-svc"=>["quic=\":443\"; ma=2592000; v=\"35,34\""], "connection"=>["close"], "transfer-encoding"=>["chunked"]}>
I'd recommend not to waste your time with it as I already did. Also note that the Custom Search API does not include results from the Knowledge Graph, and there "non-custom" search API has long been deprecated.

Magento Tax Calculation Incorrect

Hi currently running into an issue with magento 1.9 tax calculations.
I have a product setup as £10.82 with VAT of 20% to be added. The price including VAT is £12.98.
When 1 product is added to the cart everything is ok but if I add 7 the total should be £90.86 but its showing as:
Subtotal - £75.74
VAT - £15.15
Total - £90.89
Therefore 3p of VAT extra is added. Please advise on how I can fix this.
This is not a bug. Total £90.89 is correct but if you want total sum without "extra" 3p of VAT, you can select a different method of calculating VAT.
£10,82 * 20% = £2,164 = £2,16
total: 7 * (£10,82+£2,16) = £90,86
vs
7 * £10,82 = £75,74
£75,74 * 20% = £15,148 = £15,15
total: £75,74 + £15,15 = £90,89
Check Tax Calculation Method in Settings.

Are timezones with the same GMT offset different in any way?

Windows asks users to choose from about 200 timezones, when there are actually only 25 GMT offsets. (see below)
Can I ask users in my app to chose from these alone? Is there any difference between timezones that have the same GMT offset? (eg: Mountain Standard Time vs. Mexico Standard Time 2)
-12.0,GMT -12:00,Eniwetok, Kwajalein
-11.0,GMT -11:00,Midway Island, Samoa
-10.0,GMT -10:00,Hawaii
-9.0,GMT -9:00,Alaska
-8.0,GMT -8:00,Pacific Time, US & Canada
-7.0,GMT -7:00,Mountain Time, US & Canada
-6.0,GMT -6:00,Central Time, US & Canada, Mexico City
-5.0,GMT -5:00,Eastern Time, US & Canada, Bogota, Lima
-4.0,GMT -4:00,Atlantic Time, Canada, Caracas, La Paz
-3.5,GMT -3:30,Newfoundland
-3.0,GMT -3:00,Brazil, Buenos Aires, Georgetown
-2.0,GMT -2:00,Mid-Atlantic
-1.0,GMT -1:00 hour,Azores, Cape Verde Islands
0.0,GMT,Western Europe Time, London, Lisbon, Casablanca
1.0,GMT +1:00 hour,Brussels, Copenhagen, Madrid, Paris
2.0,GMT +2:00,Kaliningrad, South Africa
3.0,GMT +3:00,Baghdad, Riyadh, Moscow, St. Petersburg
3.5,GMT +3:30,Tehran
4.0,GMT +4:00,Abu Dhabi, Muscat, Baku, Tbilisi
4.5,GMT +4:30,Kabul
5.0,GMT +5:00,Ekaterinburg, Islamabad, Karachi, Tashkent
5.5,GMT +5:30,Bombay, Calcutta, Madras, New Delhi
5.75,GMT +5:45,Kathmandu
6.0,GMT +6:00,Almaty, Dhaka, Colombo
7.0,GMT +7:00,Bangkok, Hanoi, Jakarta
8.0,GMT +8:00,Beijing, Perth, Singapore, Hong Kong
9.0,GMT +9:00,Tokyo, Seoul, Osaka, Sapporo, Yakutsk
9.5,GMT +9:30,Adelaide, Darwin
10.0,GMT +10:00,Eastern Australia, Guam, Vladivostok
11.0,GMT +11:00,Magadan, Solomon Islands, New Caledonia
12.0,GMT +12:00,Auckland, Wellington, Fiji, Kamchatka
In general no, you can't. Time zone differs not only by default GMT offset, but also by DST (daylight saving time). So two TZ can have same offset, but one with DST and other without. Even TZ with same offset and both with DST can differ in DST start and end time.
You have to consider DST as well. From your list:
-5.0,GMT -5:00,Eastern Time, US & Canada, Bogota, Lima
Lima and New York differ one hour during summer. See e.g. http://www.timeanddate.com/worldclock/

Resources