Remove not needed line and fix deductible amount calculation

This commit is contained in:
Bernat Brunet Torruella 2018-06-15 13:22:02 +02:00
parent 99be12ccc4
commit 4d9306498b

View file

@ -58,7 +58,6 @@ class BaseTrytonInvoiceMapper(Model):
taxes = self.total_invoice_taxes(invoice)
taxes_base = 0
taxes_amount = 0
val = attrgetter('company_total_amount')(invoice)
for tax in taxes:
taxes_base += self.get_tax_base(tax)
taxes_amount += self.get_tax_amount(tax)
@ -171,7 +170,7 @@ class RecievedTrytonInvoiceMapper(mapping.RecievedInvoiceMapper,
val = Decimal(0)
for tax in self.taxes(invoice):
val += tax.amount
val += tax.company_amount
# On 4.X change the return for: return val
return val if val is None or not credit_note else -val