Tax

class en16931.Tax(percent, category, name, comment='')

Tax class.

It representas a tax to apply globally or to a concrete invoice line.

Only categories of taxes enabled by the EN16931 standard are supported. See the documentation of category() property for more details.

You can create Tax objects directly:

>>> t = Tax(0.21, "S", "IVA")

Or specify the relevant attributes when building InvoiceLines or Invoice

__eq__(other)

A tax is compared to other Tax objects by equality of their percentage, category, and name.

__hash__()

Return hash(self).

__init__(percent, category, name, comment='')

Initialize a Tax object.

Parameters:
  • category (string.) – A string representing the category of the Tax. It must be one of ‘AE’, ‘L’, ‘M’, ‘E’, ‘S’, ‘Z’, ‘G’, ‘O’, or ‘K’.

  • percent (float.) – The percentage of the Tax. Can be 0.

  • name (string.) – Arbitrary name to identify the Tax.

  • comment (string.) – A comment on the tax.

Notes

A tax is compared to other Tax objects by equality of their percentage, category, and name.

__repr__()

Return repr(self).

__weakref__

list of weak references to the object (if defined)

property category

The category of the Tax.

Parameters:

category (string.) – A string representing the category of the Tax. It must be one of ‘AE’, ‘L’, ‘M’, ‘E’, ‘S’, ‘Z’, ‘G’, ‘O’, or ‘K’.

Raises:

ValueError – if the category is not valid.:

Type:

Property

property code

An identification code of the tax.