{% set sort_type = { "": 'num', "": 'num', "": 'num', } %} {% macro querycell(name, value, type_) %} {% set type = type_|string %} {% if type == "" %} {% for position in value|sort(attribute='units.currency') %} {{ position.units|format_amount }}
{% endfor %} {% elif type == "" %} {% if name == "account" %} {{ value }} {% else %} {{ value }} {% endif %} {% elif type == "" or type == "" %} {{ value|format_currency }} {% elif type == "" %} {{ value|format_amount }} {% elif type == "" %} {{ value|upper }} {% elif type == "" %} {{ value }} {% elif type == "" %} {{ value|join(',') }} {% elif type == "" %} {{ value or '' }} {% elif type == "" %} {{ value.units|format_amount }} {% else %} {{ value }} {% endif %} {% endmacro %} {% macro querytable(contents, types, rows, filter_empty=None) %} {% if contents %}
{{ contents }}
{% elif types %} {% for name, type in types %} {% endfor %} {% for row in rows if filter_empty == None or not row[filter_empty].is_empty() %} {% for name, type in types %} {{ querycell(name, row[name], type) }} {% endfor %} {% endfor %}
{{ name }}
{% endif %} {% endmacro %} {% macro download_links(query) -%} ({{ _('Download as') }} CSV{% if config['HAVE_EXCEL'] %}, XLS, XLSX, or ODS {% endif %}) {%- endmacro %}