{% load report_tags %}
{% comment "Optional note" %}
Total: {{data|slotTotalAmount|floatformat:0}}
{% endcomment %}
{% with has_aggregation=False %}
{% for col in columns %}
{% if columns|col_type:forloop.counter0 == 'numeric' and columns|col_aggregation:forloop.counter0 == 'sum' or columns|col_aggregation:forloop.counter0 == 'avg' %}
{{ has_aggregation|update_variable:True }}
{% endif %}
{% endfor %}
{% if has_aggregation %}
{% with first_td=1 %}
{% for col in columns %}
{% if columns|col_type:forloop.counter0 == 'numeric' and columns|col_aggregation:forloop.counter0 == 'sum' or columns|col_aggregation:forloop.counter0 == 'avg' %}
{{col.title}}
|
{% else %}
|
{% endif %}
{% endfor %}
{% endwith %}
{% with first_td=1 %}
{% for col in columns %}
{% with pricision=columns|col_precision:forloop.counter0 %}
{% if columns|col_type:forloop.counter0 == 'numeric' and columns|col_aggregation:forloop.counter0 == 'sum' %}
{% slotTotalAmt 1 1 rows=data cols=columns colindex=forloop.counter0 as result %}{{ result|floatformat:pricision }}
|
{% elif columns|col_type:forloop.counter0 == 'numeric' and columns|col_aggregation:forloop.counter0 == 'avg' %}
{% slotAvgAmt 1 1 rows=data cols=columns colindex=forloop.counter0 row_length=data|length as result %}{{ result|floatformat:pricision }}
|
{% else %}
|
{% endif %}
{% endwith %}
{% endfor %}
{% endwith %}
{% endif %}
{% endwith %}