Taxation Policies

Creating new order is a process that apart from counting item values depends also on specific rules how to apply a tax to the order. Django-plans is designed with internationalization in mind, therefore the way that the module calculates additional tax for an order is highly customizable and depends in general on locale.

For each country, or more generally for each specific use, there need to be created specific taxation policy which defines what rate of tax is suitable for an order depending on issuer country and customer billing data.

Taxation policy can be defined as a simple class that should inherit from plans.taxation.TaxationPolicy and provide get_default_tax(vat_id, country_code) method. Having arguments like customer

class plans.taxation.TaxationPolicy[source]

Abstract class for defining taxation policies. Taxation policy is a way to handle what tax rate should be put on the order, this depends on user billing data.

Custom taxation policy should implement only method get_default_tax(vat_id, country_code). This method should return a percent value of tax that should be added to the Order, or None if tax is not applicable.

classmethod get_default_tax()[source]

Gets default tax rate. Simple returns settings.TAX

Returns:Decimal()
classmethod get_issuer_country_code()[source]

Gets issuers country. Simply returns settings.TAX_COUNTRY

Returns:unicode
classmethod get_tax_rate(tax_id, country_code)[source]

Methods

Parameters:
  • tax_id – customer tax id
  • country_code – customer country in ISO 2-letters format
Returns:

Decimal()

Django-plans application is shipped with some default taxation policies. You can choose them via TAXATION_POLICY variable.

EUTaxationPolicy

class plans.locale.eu.taxation.EUTaxationPolicy[source]
This taxation policy should be correct for all EU countries. It uses following rules:
  • if issuer country is not in EU - assert error,

  • return default tax in cases:
    • if issuer country and customer country are the same,
    • if issuer country and customer country are not not the same, but customer is private person from EU,
    • if issuer country and customer country are not not the same, customer is company, but his tax ID is not valid according VIES system.
  • return tax not applicable (None) in cases:
    • if issuer country and customer country are not not the same, customer is company from EU and his tax id is valid according VIES system.
    • if issuer country and customer country are not not the same and customer is private person not from EU,
    • if issuer country and customer country are not not the same and customer is company not from EU.

Please note, that term “private person” refers in system to user that did not provide tax ID and company refers to user that provides it.

Note

This taxation policy requires suds and vatnumber python modules (connecting to VIES). If you want them automatically installed please remember to insert extra depedencies for pip:

$ pip install django-plans[eu]

RussianTaxationPolicy

FIXME: under developement

class plans.locale.ru.taxation.RussianTaxationPolicy[source]

FIXME: description needed

get_tax_rate(tax_id, country_code)[source]

Project Versions

Table Of Contents

Previous topic

Plan change policies

Next topic

Invoicing

This Page