IMPORTANT
This Solution modifies the existing CRM entities Account, Contact, Product, Opportunityproduct, Quotedetail, Salesorderdetail, Invoicedetail. Since this is a managed solution our changes should be merged with your changes, but we recommend to take a backup of these entities before you import the solution.

The following steps are required in order to sucessfully import and configure the VAT Calculation Plugin:

Import the solution
First, import the managed solution into Microsoft Dynamics CRM 2011. Make sure to enable the included proccesses. All the required fields should be merged into your current forms.
If the fields were not added to the forms you should add the following fields to the forms:
  • Product: VAT rate (VAT rate associated with the product)
  • Account: Booking group (Controls if the account is a national customer or not)
  • Contact: Booking group (Controls if the contact is a national customer or not)
  • Opportunityproduct, Qoutedetail, Salesorderdetail, Invoicedetail: No tax (Checkbox whether taxes should be calculated or not), VAT rate (VAT rate used if no existing product is used)

Create VAT Rates
If the solution was imported sucessfully a new entity "VAT rates" was created. In some cases you may have to add the VAT rate entity to the sitemap using Customization -> Customize the system -> (Select the VAT Rate Entity) -> Show in Settings
Here you can create VAT Rates:
VAT_Config.PNG

The percent field is the VAT rate. If you set default to true, this entry will be used if no VAT is specified for a product. The fields in the "Calculaction for..." tab allows you to disable this rate for a certain entity. If you disable all VAT rates for a certain entity, no taxes will be calculated.

Assign VAT Rates to prodcuts
The product entity is now extended by a field called "bec_vatconfigid". This lookup field must be filled with an appropriate VAT Rate. If no value is specified for this field the plugin will use the default VAT rate.

Add JavaScript Functionality
The library Xrm Service Toolkit was used in this project.
In the solution is a JavasScript file called "bec_VAT.Plugin.Main.js". This file provides three functions:
  • VATPluginSetForeignerNotification: This function shows a notification to the user if the customer of the opportunity (or quote etc.) is a foreigner. If you want to add this function to the OnLoad Event of the opportunityproduct, salesorderdetail, quotedetail or invoicedetail you must also include the file "bec_XrmServiceToolkitChanged".
  • VATPluginSetFieldVisibility: This function toogles the visibility of the fields "No tax" and "VAT rate" depending on the value of the override product field. You should add this function to the OnLoad Event of the opportunityproduct, salesorderdetail, quotedetail or invoicedetail. Furthermore you should add this function to the OnChange event of the override product field in the same forms.
  • VATPluginSetDefaultVatConfigLookup: This function loads the current valid default VAT rate for an opportunityproduct, salesorderdetail, quotedetail or invoicedetail and prefills the VAT rate field. You should add this function in the OnChange Event of the override product field. You must also include the file "bec_XrmServiceToolkitChanged" in order for this function to work.

Last edited Apr 25, 2013 at 3:53 PM by teamGreenIT, version 12

Comments

No comments yet.