{% extends "_layout.html" %} {% set active_page = 'holdings' %} {% import 'macros/_account_macros.html' as account_macros with context %} {% macro num_cell(value, currency) -%} {{ value|format_currency(currency) }} {%- endmacro %} {% block content %} {% set holdings = api.holdings(aggregation_key) %}

{% if aggregation_key %}{{ _('Holdings') }}{% else %}{{ _('Holdings') }}{% endif %}

{% for key, label in [('account', _('Account')), ('currency', _('Currency')), ('cost_currency', _('Cost currency'))] %}

{% if not (aggregation_key == key) %}{{ _('Holdings by') }} {{ label }}{% else %}{{ _('Holdings by') }} {{ label }}{% endif %}

{% endfor %}
{% for holding in holdings %} {{ num_cell(holding.number, holding.currency) }} {{ num_cell(holding.cost_number, holding.cost_currency) }} {{ num_cell(holding.price_number, holding.cost_currency) }} {{ num_cell(holding.book_value, holding.cost_currency) }} {{ num_cell(holding.market_value, holding.cost_currency) }} {% endfor %}
{{ _('Account') }} {{ _('Units') }} {{ _('Currency') }} {{ _('Cost currency') }} {{ _('Average Cost') }} {{ _('Price') }} {{ _('Book Value') }} {{ _('Market Value') }}
{{ account_macros.account_name(holding.account) }}{{ holding.currency}} {{ holding.cost_currency }}
{% endblock %}