After several false starts, I finally have a working tax module for ecommerce!
How it works:
In the United States, there are no national sales taxes. So sales tax is only required if an order is shipped to customers residing in the same state as a business. For instance if a company has two stores: one in New York and one in Massachusetts, they'll need to charge New York sales tax for orders shipped to New York and Massachusetts sales tax to orders shipped to Massachusetts. However they don't need to charge sales tax on orders shipped anywhere else.
With that in mind, the current implementation of taxes.module allows entry of any number of regions (states) and a tax rate for each. Then upon submittal of the checkout form, the shipping address (or billing if no items are shippable) is checked against the list of taxable regions. If it matches, the form gets updated with the tax information and a note saying that the user is getting taxed.
To do:
- More help text.
- Right now everything in the cart gets taxed. I would like to add per-product taxability because some items may not be taxable (e.g. clothing, file downloads, etc).
- More general solution that would work for non-U.S. locations. But in order to test regions, they need to be entered in a uniform fashion (meaning from a select list) and the ecommerce address.module currently only supports selections for the U.S. We may be able to tap into the power of location.module at some point, but for now, taxes only works for the United States. Maybe someone from Europe can provide some insight for how sales tax works for online orders over there.
What's here:
This archive contains patches for cart.module, payment.module, store.module, store.inc, and updates.inc as well as the taxes directory containing taxes.module and taxes.mysql.
Enjoy!
- Jeff Robbins
www.jjeff.com
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | EC_TaxesPatchesAndModule2.zip | 9.37 KB | jjeff |
| EC_TaxesPatchesAndModule.zip | 9.37 KB | jjeff |
Comments
Comment #1
jjeff commentedFixed a few issues and made it compatible with Drupal 4.6. Only taxes.module has changed, but here's the whole thing again.
-Jeff
Comment #2
ñull commentedFirst of all big thank you for thinking about tax. Living in Europe, I specially apreciate your interest in our complicated tax system.
I would prefer to be able to choose on per product basis. For instance On-line learning would be tax-free in Spain and (e-)books have a reduced tax.
Sales from a shop located in the Spain:
- Sales within the same country are taxed VAT
- Sales to locations abroad, but still inside Europe are all taxed VAT when the client cannot provide a valid VAT registration number. When they can provide a VAT registration number then the sales can be tax free.
- Sales to locations outside Europe tax free.
I am Dutch and I always believed that the second rule also applied there for sales within the Netherlands. May be that is changed in the meanwhile.
Also the invoices have special requirements:
- Tax registration number should appear
- Name address of seller and buyer
- The date
- With mixed tax rates in one invoice should either be avoided or tax calculation should be specified per item
Comment #3
hotgazpacho commentedAfter briefly looking over the code for taxes.module, I think this module might benefit greatly from abstracting the locations into Zones, like OSCommerce. I have just finished preliminary work on zones.module to provide this functionality. See my feature request postings and module code for more information.
In the mean time, I think I'll borrow from your work t create a zones_tax.module dependant on the zones.module.
Comment #4
hotgazpacho commentedAt the very least, taxes-cart.patch FAILS on 4.6.1
Comment #5
hotgazpacho commentedAnd applying all the other patches breaks the who ecommerce module on 4.6!
Comment #6
yktdan@drupal.org commentedLike others, I need a flag on each item as to whether it is taxable, e.g. memberships and donations are not taxable, but the books and maps we sell are taxable.
Fortunately we moved our offices from NY to NJ a few years ago. Doing NY taxes takes heroic efforts. You can't even base them on zip code because the differ by county and sometime city. Worse yet a few zipcodes cross county lines. Even worse if you want to do proper accounting to the state for taxes, there are a few towns where you need to know street address (but this mess could be handled by a backend accounting program). NJ is a constant for the whole state.
Even major companies sometimes punt on NY taxes. I live in NY and ordered from Norelco. They charged me the state portion of the sales tax. I guess they ate the rest (as much as 3%).
Is there a time frame for rolling the patches into the base code?
Comment #7
youngwax commentedso, how about tax-exempt customers?
Comment #8
matt westgate commentedA tax module has hit core based on this work.
Comment #9
fgmMore information about VAT in the EU. Com2 accurately describes the most common situations. However, there's more to it:
- Sales within the same country are USUALLY taxed VAT, but some buyers can obtain a clearance from the administration to buy tax-free, typically because he is a regular exporter. In this case, the seller must obtain a document certifying the buyer is entitled to this detaxing. Such documents are valid for the calendar year and up to a certain amount only.
- Sales to locations abroad, but still inside Europe are all taxed VAT when the client cannot provide a valid VAT registration number. When they can provide a VAT registration number then the sales can be tax free, but it is not mandatory that it be: some customers may prefer to be taxed (remember VAT is neutral for businesses, who recoup it from the VAT on their own sales)
- Sales to locations outside Europe are tax free, INCLUDING parts of EU countries located outside mainland Europe and local islands (colonies): areas like the french caribbean, for instance, are part of France, but are not subject to VAT from mainland Europe sellers. However, I think (this should be checked) that sales where the buyer and seller both are within such areas are subject to VAT.
As com2 says, invoices have special requirements:
- Tax registration number MUST appear, if buyer and sellere are not within the same EU country.
- Name address of seller and buyer MUST both appear
- The date MUST appear
- Tax calculation MUST be specified per item: as the EU allows for several VAT rates depending on the type of goods, each line must mention the rate of VAT being applied (typically a code into a table in the invoice footer), and the footer must list the total VAT being charged for each rate.
- Invoices (not just receipts) are mandatory above a certain amount being charged or it the customer requests one. Receipts can replace invoices for smaller purchases, but this doesn't seem really applicable to online sellers, for traceability purposes.
There's a tutorial on EU vat at: http://europa.eu.int/comm/taxation_customs/taxation/vat/how_vat_works/in... with links to the most common other taxes applicable all over the EU.
It would be nice if someone with an actual tax law background could check this for accuracy.
Comment #10
(not verified) commentedComment #11
(not verified) commented