diff --git a/aeat_mapping.py b/aeat_mapping.py index 4168e81..dd60115 100644 --- a/aeat_mapping.py +++ b/aeat_mapping.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # The COPYRIGHT file at the top level of this repository contains the full # copyright notices and license terms. +from decimal import Decimal from logging import getLogger from operator import attrgetter -from decimal import Decimal from pyAEATsii import mapping from pyAEATsii import callback_utils @@ -48,11 +48,11 @@ class BaseTrytonInvoiceMapper(Model): counterpart_id_type = attrgetter('party.sii_identifier_type') counterpart_id = counterpart_nif - untaxed_amount = attrgetter('untaxed_amount') - total_amount = attrgetter('total_amount') + untaxed_amount = attrgetter('company_untaxed_amount') + total_amount = attrgetter('company_total_amount') tax_rate = attrgetter('tax.rate') - tax_base = attrgetter('base') - tax_amount = attrgetter('amount') + tax_base = attrgetter('company_base') + tax_amount = attrgetter('company_amount') def counterpart_name(self, invoice): return tools.unaccent(invoice.party.name) @@ -141,7 +141,7 @@ class RecievedTrytonInvoiceMapper(mapping.RecievedInvoiceMapper, def deductible_amount(self, invoice): val = Decimal(0) for tax in self.taxes(invoice): - val += tax.amount + val += tax.company_amount return val tax_reagyp_rate = BaseTrytonInvoiceMapper.tax_rate diff --git a/tryton.cfg b/tryton.cfg index 5841c73..667699b 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -2,6 +2,7 @@ version=4.2.0 depends: account_invoice + account_invoice_company_currency extras_depend: account_es account_es_pyme