{% 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 %}

Holdings

{% set holdings = api.holdings(aggregation_key) %}

{% if aggregation_key %}Holdings{% else %}Holdings{% endif %}

{% for key in ['account', 'currency', 'cost_currency'] %}

{% if not (aggregation_key == key) %}Holdings by {{key|replace('_',' ')|capitalize}}{% else %}Holdings by {{key|replace('_',' ')|capitalize}}{% 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 %}