matthiask / plata

Plata - the lean and mean Django-based Shop
https://plata-django-shop.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
197 stars 63 forks source link

VAT issue #70

Closed emilian closed 7 years ago

emilian commented 9 years ago

I need to charge VAT for customers inside the European Union.

How would I begin implementing this type of tax?

miraculixx commented 9 years ago

+1

emilian commented 9 years ago

@miraculixx I found a way to do it. Just modify the TaxProcessor class in the shop/processors.py file. You can add something like this to the process method:

if order.billing_country in ['COUNTRY_CODES']:
    item.tax_rate = TAX_RATE
else:
    item.tax_rate = 0

Alternatively you could subclass ProcessorBase and implement a custom VAT processor. Just remember to add it to settings.PLATA_ORDER_PROCESSORS.

matthiask commented 7 years ago

@emilian Yes, subclassing ProcessorBase and adding the class to PLATA_ORDER_PROCESSORS is the intended way to do this.