invoice-line: accept incomplete tax data
This commit is contained in:
parent
77b9aebe4b
commit
83bb948e78
1 changed files with 8 additions and 3 deletions
11
document.py
11
document.py
|
@ -733,9 +733,14 @@ class Incoming(metaclass=PoolMeta):
|
||||||
line_taxes = line_data.pop('taxes', [])
|
line_taxes = line_data.pop('taxes', [])
|
||||||
for x in line_taxes:
|
for x in line_taxes:
|
||||||
percent = x.get('percent', None)
|
percent = x.get('percent', None)
|
||||||
if (x.get('type', '') == 'VAT') and (percent is not None):
|
if cfg1 and cfg1.accept_incomplete_tax:
|
||||||
percent = percent / Decimal('100')
|
if percent is not None:
|
||||||
tax_and_category.append(get_tax_by_percent(percent))
|
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
|
# check result
|
||||||
if len(line_taxes) != len(tax_and_category):
|
if len(line_taxes) != len(tax_and_category):
|
||||||
|
|
Loading…
Reference in a new issue