mirror of
https://gitlab.com/datalifeit/trytond-aeat_sii
synced 2023-12-13 20:30:37 +01:00
Change amount getter in mapping to use the company amounts values introduced with the dependency of the account_invoice_company_currency module. Update scenario too
This commit is contained in:
parent
cb485e964b
commit
d564144d51
|
@ -1,9 +1,9 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# The COPYRIGHT file at the top level of this repository contains the full
|
# The COPYRIGHT file at the top level of this repository contains the full
|
||||||
# copyright notices and license terms.
|
# copyright notices and license terms.
|
||||||
|
from decimal import Decimal
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
from decimal import Decimal
|
|
||||||
|
|
||||||
from pyAEATsii import mapping
|
from pyAEATsii import mapping
|
||||||
from pyAEATsii import callback_utils
|
from pyAEATsii import callback_utils
|
||||||
|
@ -47,11 +47,11 @@ class BaseTrytonInvoiceMapper(Model):
|
||||||
|
|
||||||
counterpart_id_type = attrgetter('party.sii_identifier_type')
|
counterpart_id_type = attrgetter('party.sii_identifier_type')
|
||||||
counterpart_id = counterpart_nif
|
counterpart_id = counterpart_nif
|
||||||
untaxed_amount = attrgetter('untaxed_amount')
|
untaxed_amount = attrgetter('company_untaxed_amount')
|
||||||
total_amount = attrgetter('total_amount')
|
total_amount = attrgetter('company_total_amount')
|
||||||
tax_rate = attrgetter('tax.rate')
|
tax_rate = attrgetter('tax.rate')
|
||||||
tax_base = attrgetter('base')
|
tax_base = attrgetter('company_base')
|
||||||
tax_amount = attrgetter('amount')
|
tax_amount = attrgetter('company_amount')
|
||||||
|
|
||||||
def counterpart_name(self, invoice):
|
def counterpart_name(self, invoice):
|
||||||
return tools.unaccent(invoice.party.name)
|
return tools.unaccent(invoice.party.name)
|
||||||
|
@ -140,7 +140,7 @@ class RecievedTrytonInvoiceMapper(mapping.RecievedInvoiceMapper,
|
||||||
def deductible_amount(self, invoice):
|
def deductible_amount(self, invoice):
|
||||||
val = Decimal(0)
|
val = Decimal(0)
|
||||||
for tax in self.taxes(invoice):
|
for tax in self.taxes(invoice):
|
||||||
val += tax.amount
|
val += tax.company_amount
|
||||||
return val
|
return val
|
||||||
|
|
||||||
tax_reagyp_rate = BaseTrytonInvoiceMapper.tax_rate
|
tax_reagyp_rate = BaseTrytonInvoiceMapper.tax_rate
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
version=4.0.0
|
version=4.0.0
|
||||||
depends:
|
depends:
|
||||||
account_invoice
|
account_invoice
|
||||||
|
account_invoice_company_currency
|
||||||
extras_depend:
|
extras_depend:
|
||||||
account_es
|
account_es
|
||||||
account_es_pyme
|
account_es_pyme
|
||||||
|
|
Loading…
Reference in a new issue