EU VAT Enhanced for Magento 2 Documentation
- Magento 2 VAT Configuration
- Extension Configuration
- Check your PHP-Installation for the SOAP and CURL extensions – both are required in order to connect to the validation interfaces. If you don’t know what this is, please contact your webhosting provider – they can help you in this question.
- Make sure you have FTP/SFTP and SSH access to copy the extension files to your Magento 2 installation and to run commands.
Now you can proceed with the installation as follows:
- Upload the content of the .zip-Package (“app” folder) to your Magento root directory (“app”⇒“app”).
- Run the following commands by SSH from the Magento root directory:
bin/magento module:enable Geissweb_Euvat
The installation procedure is now completed. The next step is to configure Magento for VAT and to configure the extension.
Magento VAT Configuration
It is easy to use our automated setup in order to configure VAT for your country in your Magento installation. The setup will take care about creating the neccessary tax classes, tax rates and tax rules, as well as setting the required store configuration.
After successful installation, you should be able to see the setup notice in the admin area. To execute the setup, click on the “Configuration Helper” link. If you have already configured Magento for VAT, you can also skip the setup.
The following page will appear. Within this page, fill out the required fields with your data.
Explanation of the fields:
- License Key: Your license key is visible in the downloads section of your customer account. Please use the same license key for all development and the production installation.
- Installation Type: If you installed the module in the production installation, select "Production".
- Domestic Country: Depending on the country selected, the tax rates and shipping origin will be configured.
- Merchant VAT Number: Required for extended VAT number validation with return of a request identifier.
- Apply store configuration for VAT: When enabled, the setup will set configuration values required for VAT calculation:
Store config path Value general/country/default
Will be set to "Domestic Country" general/store_information/merchant_vat_number Will be set to "Merchant VAT Number" tax/classes/shipping_tax_class Will be set to the standard shipping tax class tax/calculation/based_on Will be set to "Shipping Address" customer/create_account/auto_group_assign Will be set to "No", this will disable Magento Core VAT validation. customer/create_account/vat_frontend_visibility Will be set to "Yes", shows the address based VAT number field in frontend. customer/address/taxvat_show Will be set to "No", will disable the account based Tax/VAT number field.
Create tax classes, rules and rates
This option can automatically set up all neccessary tax classes, rates and rules for VAT calculation. By default, it will create the rules for standard VAT calculation (at full rates of your country). Additionally, you can choose if you need further rules for example for electronic services or reduced products.
Tax class mapping
To be able to provide an automated setup, the function needs to know the internal IDs of the product and customer tax classes. Therefore we will remove the existing tax classes from your system and create new ones. Make sure to select the mapping of the new IDs to fit your requirements. Existing products and customer groups will get the new IDs assigned, instead of the old ones.
Now just click on “Run Setup” to run the setup. If everything worked, you will be redirected to the extension configuration settings.
If you don't want to use the automated setup, this will guide you to the neccessary steps to setup EU VAT in Magento 2. As the interface for creating tax rules, classes and rates has been combined in Magento 2, we go through every (possible) tax rule as follows:
Navigate to “Stores → Tax Rules“, and create the tax rules like shown:
Explanation of the rules
Imagine the point of view of a shop based in the Netherlands. The standard VAT rate in NL is 21%.
Consumers buy products with standard VAT: This is the basic standard rule required to calculate VAT for consumers. It applies to consumers and domestic businesses. For products and the shipping at standard rate, it will calculate 21% for each country listed in the tax rates section. For the tax rates, create one tax rate for each EU country with a rate of 21%.
Consumers buy products with reduced VAT: The same as above, just the product tax classes and tax rates change. For the tax rates, create one tax rate for each EU country with a rate of 6% (reduced VAT rate in NL).
Consumers buy digital products and services (MOSS rule for consumers): This rule is only needed if you sell digital content like downloads. It applies only to consumers, which shall get calculated the VAT rate of their own country. For the tax rates, create one tax rate for each EU country with the standard rate of this country. For example: "AT digital VAT" has a rate of 21%, whereby "DE digital VAT" has a rate of 19%.
Domestic businesses buy digital products and services: As the MOSS rule is only applicable to consumers, domestic businesses should get calculated the standard rate of the domestic (merchant) country. The customer tax class is "Business incl. VAT" and for the tax rates, you can use the same rates as in the first rule (Consumers buy products with standard VAT).
EU Businesses buy VAT exempt: The last rule is for EU businesses with valid VAT number. It applies to "Businesses excl. VAT" with all possible product tax classes. Create one tax rate for each country with 0%.
Prepare customer groups
Navigate to “Stores → Customer Groups”. The use of customer groups is totally optional with the extension. The extension will dynamically apply the customer tax class depending on the customers VAT number validation results and the shipping address. The tax class of the customer group is just a fallback. Therefore it is optional if you want to assign customers to groups depending on the VAT number validation results, as the group and the tax class are not firmly connected anymore.
For reference, we suggest these customer groups:
Configuration of VAT in Magento
There are several places at the Magento system configuration where the calculation of VAT is affected. Following we go through each setting areas step by step.
1. Enable the input fields for customers VAT-ID
- Navigate to “Stores → Configuration → (Customers) Customer Configuration”
- At Create New Account Options set Enable Automatic Assignment to Customer Group to No, to disable the Magento core VAT validation
- At Create New Account Options set Show VAT Number on Frontend to Yes
- At Create New Account Options set your Default Group eg. General
- At Name and Address Options set Show Tax/VAT Number to No
2. Set the tax calculation method
- Navigate to “Stores → Configuration → (Sales) Tax”
- At Tax Classes set "Tax Class for Shipping" to Shipping with standard VAT rate
- At Tax Classes set "Default Tax Class for Product" to Products with standard VAT rate
- At Tax Classes set "Default Tax Class for Customer" to Consumers incl. VAT
- At Calculation Settings set Tax Calculation Based Oni> to “Shipping Address”
- At Default Tax Destination Calculation set Default Country to your domestic (merchant) country
3. Set the shipping origin
This will define the country from where tax calculation will be based on.
- Navigate to “Stores → Configuration → (Sales) Shipping Settings”
- Set the merchant shipping origin country
Now you have done all settings required in Magento for EU VAT calculation.
Finally we will go through the system configuration of the extension. There are many settings which will have influence on how the extension installation will calculate VAT or assign customer groups.
- License Key: Set your license key which you can find at your customer account at “My Downloadable Products”
- Installation Type: If this is your production installation, please select "Production".
- Enable AJAX Validation: Will enable the AJAX VAT number validation
- Validation Interface: Which interface shall be used to validate the numbers. There is currently only "VIES" available.
- IPv6 Compatibility: If you have general problems to connect to the interface, the IPv6 compatibility mode might help. It depends on your server setup if you need this option. Turn it on and set your servers IPv4 address to see if the connection is working then.
- Use dynamic customer tax class: This setting will enable the custom VAT calculation algorithm, based on the customer address instead of the customer group like Magento core does. It will apply one of the three tax classes configured below.
- Use customer group assignment: It is optional to assign customer groups to customers based on the VAT number validation results.
- Choose the desired customer groups for the situations described in the configuration comments.
- Excluded groups: If you use the group assignment, and need special groups for discounts, select these here. Customers in the selected groups will not be assigned to other groups based on the configuration above.
- Enable Address fields on registration page: If enabled, the customer address input fields are shown at the registration, together with the VAT number input field. Your customers can register and will be assigned to the matching customer group, if group assignment is used.
- Frontend VAT number field required: If you do strictly B2B, you might want to require a VAT number from your customers.
- VAT number tooltip: A little help text, to guide your customers.
You have now done all neccessary actions required to get a well working VAT calculation and number validation in Magento 2.
Shoud you have any question, please contact us at email@example.com.