Commerce Canadian Taxes
Commerce Canadian Taxes builds on the Drupal Commerce's Commerce Tax module for Canadian retail sales taxes. It deals with simple retail sales taxes and can be extended to support less common ones in Canadian tax jurisdictions.
Retail sales tax coverage is not complete, but will cover most situations. For example, the Ontario tax rule that exempts the provincial tax component for sales of food under $4 has not been implemented.
The following retail sales taxes are supported:
- NL: HST, RST(vehicles)
- NS: HST
- PE: HST
- NB: HST, PVT, TPPT
- QC: GST, QST
- ON: HST, GST
- MB: GST, RST, PVT
- SK: GST, PST, LCT
- AB: GST
- BC: GST, PST
- YT: GST
- NT: GST
- NU: GST
- GST = Goods and Services Tax
- HST = Harmonized Sales Tax
- LCT = Liquor Consumption Tax
- PST = Provincial Sales Tax
- PVT = Provincial Vehicle Tax
- QST = Quebec Sales Tax
- RST = Retail Sales Tax
- TPPT = Tangible Personal Property Tax
- Fields are created for each tax and grouped under each jurisdiction
- A single field collection is added to each Commerce Product bundle and Commerce Shipping line item
- Commerce Tax rates are defined for each tax in each jurisdiction
- Taxes are configurable for each jurisdiction on a product level
- Rules are used to calculate taxes on cart line items
- A separate UI module is provided to initialize the tax field instances
Default shipping tax settings: The exclusion of PST for MB, SK, and BC is handled in code for the time being.
Currently, there is one set of global defaults for all taxable things. However, line items are created transparently, meaning they don't exist until they're created for the cart. So, there is no easy user-configurable way to control what taxes are applicable on shipping without also affecting the default settings for products.
One approach would be to create a different set of defaults for each taxable entity.
Too bad shipping was not implemented as a product...
Relationship to other modules
Commerce Canadian Taxes supports applying taxes to Commerce Line Items, including Commerce Shipping Line Items. The same tax field can be added to Shipping Line Items via the Commerce Canadian Taxes UI module.
Upgrading from Commerce Canadian Taxes 7.x-1.x
Uninstall Commerce Canadian Taxes 7.x-1.x
- Back up your installation. (Backing up a site - https://drupal.org/node/22281)
- Put your site in maintenance mode (Note #4 - https://drupal.org/node/570162)
- Disable 'Commerce Canadian Taxes'.
- Uninstall 'Commerce Canadian Taxes'.
- Delete the 'commerce_canadian_taxes folder'.
- Flush all caches, then take your site out of maintenance mode.
- If the tax rules from v7.x-1.x are not deleted following step #6, manually delete the following tax rules:
'HST New Brunswick'
'PST Quebec (QST/TVQ)'
- Download and install the Commerce Canadian Taxes module, which includes the Commerce Canadian Taxes UI module.
- Go to "Modules" (admin/modules) and enable both modules.
A field named 'Canadian Sales Taxes' (
field_sales_taxes_ca) is automatically added to all Commerce Product types and Shipping Line Item (if installed) with default settings for applicable taxes.
- At this point, the tax fields are created but existing host instances are not yet initialized. In this case, the host instances are the various commerce_product bundles. This is normal when fields are added after entities are created. Normally, you would use Views Bulk Operations (VBO) to initialize your products. However, initialization of Field Collections does not work with VBO.
The Commerce Canadian Taxes UI module will initialize all product instances in user-configurable batch sizes. This process takes considerable time, proportionate with the number of items you're initializing. Depending on the performance of your server, large batch sizes (> 25 products per batch) may time-out.
Alternatively, you can load and save each existing product one-by-one using the Commerce Product UI.
- Change the applicable tax settings for each product, as necessary
- Commerce Line Item
- Commerce Order
- Commerce Tax
- Commerce Tax UI
- Field Collection
Default applicable tax settings are configured using the Field Collections UI.
To edit the default tax field settings, click "manage fields" for each Administrative Area (province), and edit the default value of each tax field (boolean).
"Structure > Field collections"
Applicable taxes can be set for each product for each product using the Commerce Product UI.
Simply open the product and update the tax settings under "Canadian Sales Taxes".
"Store > Products"
Tax rates are configured using Commerce Tax Rate UI:
"Store > Configuration > Taxes"
Rules are configured using the Rules UI:
"Configuration > Workflow > Rules > Components"
Integration with other commerce modules
Commerce Canadian Taxes 7.x-2.x integrates with Commerce Shipping (7.x-2.0) but needs to be configured to function properly.
- Change the
Apply sales tax to shippingrule to use the new
Canadian sales taxes.
- Navigate to rules configuration (Configuration > Workflow > Rules)
- Edit rule 'Apply sales tax to shipping'
- Edit action 'Calculate taxes for a line item'
- Change 'Tax type'
Canadian sales taxes
- Save the rule.
- Add the existing field 'Canadian Sales Taxes' (field_sales_taxes_ca) to the shipping line item.
- Navigate to the Shipping Line Item fields
(Store > Configuration > Line Item Types > Shipping > Manage fields).
- Click on '-Select an existing field-'.
- Choose 'Canadian Sales Taxes' (or 'Field collection: field_sales_taxes_ca
(Canadian Sales Taxes)' as it appears in the select.
- Change the 'Widget Type' from 'Embedded' to 'Hidden' (optional).
- Save the Shipping line item fields.
Note: Commerce Canadian Taxes integrates with Commerce Shipping using hook
hook_commerce_shipping_line_item_new_alter to initialize the line item's tax field.
If you need to charge taxes on other line item types you will need to implement the equivalent hook, if it exists.
- Issue https://drupal.org/node/2029043 related to the latest release of Internationalization
Need to patch to get Boolean field labels to show instead of "On Value"
- Can't update Field Collections with Views Bulk Operations (VBO)
Changes from version 1.x
Version 2.x is a complete re-write of the initial module. Additional tax rates have been added and are current as at 1 July 2013.
Note that you cannot upgrade from version 1.x to 2.x.
Version 1.x is no longer supported.
Version 2.x sponsored by: Esper Consulting Inc., Ottawa, Canada