invoice-line: accept incomplete tax data

This commit is contained in:
Frederik Jaeckel 2025-01-23 11:41:37 +01:00
parent 77b9aebe4b
commit 83bb948e78

View file

@ -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):