Outline:
Return to Table of Contents
There are two forms of tax calculation available with the shopping system. Here is the data entry screen in the administration shop:
The simple tax calculation is based on one location and one percentage. The tax information for this method is entered directly into the administration shop and stored in the config.tag file.
The shopping system allows multiple tax calculations. To activate the more advanced tax calculations check the "Multiple" tax method radio button in the administration shop configuration. A special tax file called taxes.tdb is then created. This file must be in the shop mirror directory. This method will allow you to calculate taxes for multiple locations, calculate fixed rate for most customers with exemptions for particular categories, and to calculate tax by product type and country.
Creating and implementing the simple tax method involves providing values for a number of variables. These variables are populated through the administration shop and stored in the config.tag file. The basic variable fields for taxes as they appear in the config.tag file are:
&state-matches = "WA WAS WASH
WASHINGTON" ;
&tax-rate = "0.076" ;
&tax-shipping = "no" ;
&state-matches are a list of synonyms for the tax location. Matching is not case sensitive and none alphabetic symbols are ignored. For example:
WA WAS WASH WASHINGTON is adequate for a match to Washington state and will match any of these: Wa Wa. wa. wash WASH. Washington
&tax-rate is the rate to apply to the customer's purchases if his location matches the &state-matches variable.
&tax-shipping allows you to charge your customers tax on their shipping charges as well as their purchases.
Note: There is no taxes.tdb file when the simple method is used.
When the customer completes the shipping address the s_state is compared with the &state-matches variable to determine if taxes should be applied. If a shipping address is not provided then the field matches against the state variable in the billing address.
Tax regulations are complex and you may require more than one tax option for your customers. To enable multiple tax options, you must select "Multiple area tax method" in the administration shop and then create a taxes.tdb file to provide the tax specifications. The tax file must be a taxes.tdb file located in the mirror shop directory and the first two columns must be "method" and "rate". To review the general requirements for a *.tdb file see the database and data access section.
In addition to method and rate there are a number of other field names that are used to set up the taxes.tdb file. Here are the field names, and a definition for each field.
Field Name | Definition and Use |
method | The exact name of the tax as you wish it to appear in the customers cart. |
rate | The tax rate. The rate should be presented as a decimal; that is, 8.2 % should be entered as .082. |
match_fld | Designates the field name in the customer database that is used to check if a tax should be applied. In general this will be a state/province or country variable. The value is matched against the variables set for the shipping address. If a shipping address is not provided then the field matches against variables in the billing address. |
match_values | A list of possible spellings of the locality. The match is not case sensitive. Localities containing multiple words, such as "West Virginia" or "United Kingdom", must be contained in quotes. |
product_factor_fld | The field name in the product database that contains a multiplying factor. To suppress tax for an product place a "0" in the column in the product database. |
cust_exempt_fld | Contains the name of the field in the customer database that designates whether the customer is tax exempt. If the field contains the value "yes" then the customer will not be charged a tax. |
tax_shipping | Contains the value "yes" if the standard rate is to be applied to the shipping. This field can also contain a special tax rate to charge on the shipping costs. |
By combining the taxes.tdb with the appropriate updates to your product database and the registration of your customers, you can apply taxes in a variety of ways. The next sections will describe applying taxes by geographic location, product and enabling tax exemptions for customers or groups of customers.
Using the fields defined above allows you to define geographic locations and apply appropriate tax rates. This method will allow you to achieve the following results.
To ensure that taxes are applied correctly, you should obtain customer information prior to presenting the customer's cart. This can be completed through the registration screens. Without the customer information the match_fld will not be populated and no tax will be applied.
Taxes charged by product can take two forms. In one case, the tax may be for only one location with varying taxes by product. For example, clothes in a location may have a standard tax, but if they carry a sports teams logo there is a different tax rate. In the other case, some products may be tax exempt or may have a special tax. This could include certain foods that are not taxable.
When using the product tax, two data areas must be updated. The taxes.tdb file must include the product_factor_fld. This field indicates which column in the product database has the multiplier for the tax. Second, you must update your product database to include the multiplier field. Here is an example of the product database and the taxes.tdb that would support product taxes.
;item price descrip tax_prod
example 5.00 "This is an example product" 0
thing 200.00 "This is a thing" 1.25
widget .68 "This is a widget" 1
;method | rate | match_fld | match_values | product_factor_fld | cust_exempt_fld | tax_shipping |
[Washington State Sales Tax] | .082 | state | "wa washington" | tax_prod | taxexempt | "" |
Using these tables the customer would be charged an additional quarter of the tax rate if he purchases a "thing" and an "example" is not taxed.
Often a percentage of your customer population will be exempt from one or all the taxes that you normally apply. By using the cust_exempt_fld, you can automatically exempt special groups from taxes.
Modify the customer registration (customer.pan) to include an additional field for tax exemption. This field is then defined for customer exemption in your tax table under cust_exempt_fld. Next, you must add the field name to the "Customer fields" list in the administration shop on the shop/custom wizard panel. Now, when this field is filled the customer will not be charged tax.
To help you better understand multiple taxes, the following example provides a taxes.tdb file, a product database and the resulting cart panel after a customer makes his purchases. Remember, the customer must be register for taxes to be correctly applied.
Here is a taxes.tdb located in the shop mirror directory:
;method | rate | match_fld | match_values | product_factor_fld | cust_exempt_fld | tax_shipping |
[Washington State Sales Tax] | .082 | state | "wa washington" | "" | taxexempt | "" |
[California State Sales Tax] | .075 | state | "ca california calif" | "" | taxexempt | .025 |
[UK VAT tax] | .175 | country | [uk "united kingdom"] | "" | vat_taxable | "" |
[Canada GST Tax] | .007 | country | "ca can canada" | "" | gov_exempt | "" |
[British Columbia PST tax] | .105 | state | [bc "british columbia"] | "special_tax" | gov_exempt | "" |
Because a special tax is applied to certain products the additional field "special_tax" is included in the following product database.
;item price descrip special_tax
example 5.00 "This is an example product" 0
thing 200.00 "This is a thing" 2
widget .68 "This is a widget" 1
Using these two tables the system presents a customer from British Columbia, Canada with the following cart panel:
Note that a separate tax line appears for each tax that is applied to the customer's purchases.
Tax is a part of almost every business transaction completed today. The two tax options, basic and multiple, provide the flexibility to support your business needs.
created: 4/21/97 Katherine C.
Davis
edited: 10/14/97 Katherine C. Davis