chore: check if discount_percentage exists

fixes TypeError: '>' not supported between instances of 'NoneType' and 'float'

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay D. Pai 2019-10-05 10:18:21 +05:30
parent 2caf32d421
commit 01aca675ef
No known key found for this signature in database
GPG Key ID: 75507BE256F40CED

View File

@ -19,7 +19,7 @@
{%- endmacro %}
{%- macro render_discount_or_margin(item) -%}
{%- if item.discount_percentage > 0.0 or item.margin_type %}
{%- if (item.discount_percentage and item.discount_percentage > 0.0) or item.margin_type %}
<ScontoMaggiorazione>
{%- if item.discount_percentage > 0.0 %}
<Tipo>SC</Tipo>