SimpleVATTax
Use this component to calculate a Value Added Tax (VAT).
Note
- The SimpleVATTax component is a Site Server 3.0 Commerce Edition sample tax component. The SampleRegionalTax component is the sample tax component for Commerce Server 2000. Because all tax components in the product are intended only as samples, Microsoft strongly recommends that you have an independent tax professional verify all applicable tax rates and data generated by this component before you use such information for personal or business purposes.
Intended use: Order Processing pipeline, Tax stage.
Configuration Values
You can determine how the SimpleVATTax component calculates the tax by setting component properties. Use the following boxes on the Simple VAT Tax tab of the Component Properties dialog box to determine this information.
Box | Description |
Apply when | Determines when to apply the tax. The values are:
Always Default. Specifies that the tax is always applied to the order. Equal to country Specifies that the tax should be applied when the value of the Has any value Specifies that the tax is applied when the |
Country | The string to compare to the ship _to _country key in the order to determine if tax is applied. |
Rate Item Key | The key in the item that contains the tax rate charged for the item. |
Values Read
The SimpleVATTax component reads the following values from the indicated dictionaries.
Key | Dictionary | Description |
item._oadjust_adjustedprice |
Order | The total cost for an item. |
item._product_tax_rate |
Order | Dynamic. Default shown. The tax rate for the product. The key name is determined by value in the RateItemKey configuration box. |
Values Written
The SimpleVATTax component assigns values to the following keys in the Order dictionary.
Key | Description |
item._tax_total |
The total tax for items with this stockkeeping unit (SKU). |
item._tax_vat_item |
The VAT for the item. |
item._tax_included |
The amount of tax included in the cost of the item. |
_tax_total |
The total tax for this order. |
_tax_included |
The amount of tax included in the cost of the order. |
Remarks
The SimpleVATTax component calculates simple Value Added Tax (VAT).
The SimpleVATTax component always assigns zero (0) to the _tax
_total
keys for both the item and the order. The component does not handle fractions of currency units — all calculations are rounded to the nearest whole unit.
The combination of the values in the Key, Apply when, and Country boxes determine whether tax should be applied. The SimpleVATTax component first checks the Apply when value:
If it is set to Always, the tax is always applied to the order.
If the value in the Apply when box is set to Has any value, the tax is applied to the order whenever the order form contains any value for the
ship_to_country
key.If the value in the Apply when box is set to Equal to Country, the component does a comparison between the value of the
ship
_to
_country
key on the order form and the text string in the Country box on this property page. If there is a match, the component applies the tax whose value is stored in the field specified in Rate Item Key.
Example
To specify that a VAT tax rate of 6.5% is charged for an item in Germany, do the following:
- Add a column for the VAT rate in Germany to your product table. The tax rate should be specified as a real number:
ger_vat_tax_rate real NOT NULL
Assign tax rates to each product in your product table using an SQL script. For this example, assign the 6.5% VAT rate to Product ABC. Type 6.5 into the ger_vat_tax_rate column in the Product ABC row.
Enter the following values in the property page for the SimpleVATTax component in the Pipeline Editor:
Box Value Apply when Always Country GER Rate Item Key _product_ger_vat_tax_rate
If the user types a country/region on the order form that is not specified in the SimpleVATTax component configuration, the values of the _tax
_total
and _tax_included
keys in the order and in the items will not be set.