diff --git a/__init__.py b/__init__.py index 9f1f07a..04ec904 100644 --- a/__init__.py +++ b/__init__.py @@ -6,10 +6,13 @@ import company import invoice import party import payment_type +import account def register(): Pool.register( + account.TaxTemplate, + account.Tax, company.Company, invoice.Invoice, invoice.InvoiceLine, diff --git a/account.py b/account.py new file mode 100644 index 0000000..d85f515 --- /dev/null +++ b/account.py @@ -0,0 +1,64 @@ +# The COPYRIGHT file at the top level of this repository contains the full +# copyright notices and license terms. +from trytond.model import fields +from trytond.pool import PoolMeta + +__all__ = ['TaxTemplate', 'Tax'] + + +REPORT_TYPES = [ + (None, ""), + ("01", "Value-Added Tax"), + ("02", "Taxes on production, services and imports in Ceuta and Melilla"), + ("03", "IGIC:Canaries General Indirect Tax"), + ("04", "IRPF:Personal Income Tax"), + ("05", "Other"), + ("06", "ITPAJD:Tax on wealth transfers and stamp duty"), + ("07", "IE: Excise duties and consumption taxes"), + ("08", "Ra: Customs duties"), + ("09", "IGTECM: Sales tax in Ceuta and Melilla"), + ("10", "IECDPCAC: Excise duties on oil derivates in Canaries"), + ("11", "IIIMAB: Tax on premises that affect the environment in the " + "Balearic Islands"), + ("12", "ICIO: Tax on construction, installation and works"), + ("13", "IMVDN: Local tax on unoccupied homes in Navarre"), + ("14", "IMSN: Local tax on building plots in Navarre"), + ("15", "IMGSN: Local sumptuary tax in Navarre"), + ("16", "IMPN: Local tax on advertising in Navarre"), + ("17", "REIVA: Special VAT for travel agencies"), + ("18", "REIGIC: Special IGIC: for travel agencies"), + ("19", "REIPSI: Special IPSI for travel agencies"), + ("20", "IPS: Insurance premiums Tax"), + ("21", "SWUA: Surcharge for Winding Up Activity"), + ("22", "IVPEE: Tax on the value of electricity generation"), + ("23", "Tax on the production of spent nuclear fuel and radioactive waste " + "from the generation of nuclear electric power"), + ("24", "Tax on the storage of spent nuclear energy and radioactive waste " + "in centralised facilities"), + ("25", "IDEC: Tax on bank deposits"), + ("26", "Excise duty applied to manufactured tobacco in Canaries"), + ("27", "IGFEI: Tax on Fluorinated Greenhouse Gases"), + ("28", "IRNR: Non-resident Income Tax"), + ("29", "Corporation Tax"), + ] + + +class TaxTemplate: + __metaclass__ = PoolMeta + __name__ = 'account.tax.template' + + report_type = fields.Selection(REPORT_TYPES, 'Report Type', sort=False) + + def _get_tax_value(self, tax=None): + res = super(TaxTemplate, self)._get_tax_value(tax) + + if not tax or tax.report_type != self.report_type: + res['report_type'] = self.report_type + + return res + +class Tax(): + __metaclass__ = PoolMeta + __name__ = 'account.tax' + + report_type = fields.Selection(REPORT_TYPES, 'Report Type', sort=False) diff --git a/invoice.xml b/invoice.xml index 7d60b4e..82cb50e 100644 --- a/invoice.xml +++ b/invoice.xml @@ -3,6 +3,20 @@ copyright notices and license terms. --> + + + + account.tax.template + + template_tax_form + + + + account.tax + + tax_form + + account.invoice diff --git a/tax.xml b/tax.xml new file mode 100644 index 0000000..9d4f800 --- /dev/null +++ b/tax.xml @@ -0,0 +1,2021 @@ + + + + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 03 + + + 01 + + + 04 + + + 01 + + + 01 + + + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + 01 + + + 04 + + + + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + 01 + + + \ No newline at end of file diff --git a/tryton.cfg b/tryton.cfg index c3f90af..93034d4 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -12,3 +12,4 @@ xml: invoice.xml party.xml payment_type.xml + tax.xml \ No newline at end of file diff --git a/view/tax_form.xml b/view/tax_form.xml new file mode 100644 index 0000000..6a0b388 --- /dev/null +++ b/view/tax_form.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/view/template_tax_form.xml b/view/template_tax_form.xml new file mode 100644 index 0000000..6a0b388 --- /dev/null +++ b/view/template_tax_form.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file