diff --git a/document.py b/document.py index 8767cd9..cd3b854 100644 --- a/document.py +++ b/document.py @@ -733,9 +733,14 @@ class Incoming(metaclass=PoolMeta): line_taxes = line_data.pop('taxes', []) for x in line_taxes: percent = x.get('percent', None) - if (x.get('type', '') == 'VAT') and (percent is not None): - percent = percent / Decimal('100') - tax_and_category.append(get_tax_by_percent(percent)) + if cfg1 and cfg1.accept_incomplete_tax: + if percent is not None: + percent = percent / Decimal('100') + tax_and_category.append(get_tax_by_percent(percent)) + else: + if (x.get('type', '') == 'VAT') and (percent is not None): + percent = percent / Decimal('100') + tax_and_category.append(get_tax_by_percent(percent)) # check result if len(line_taxes) != len(tax_and_category):