{% extends "base.html" %} {% block title %}{{ account.name }} · Wealth Dashboard{% endblock %} {% block heading %}{{ account.name }}{% endblock %} {% block content %} {% if people %}

{% if owners %}{{ _f("Belongs to {names}.", names=owners | map(attribute='name') | join(", ")) }} {% else %}{{ _("Belongs to nobody yet, so it shows under Everyone only.") }}{% endif %} {{ _("Change") }}

{% endif %}
{{ _("Balance") }}
{% if balance %}{{ money(balance.amount, balance.currency) }} {% else %}—{% endif %}
{% if balance %}{{ _("typed in") if balance.balance_type == 'manual' else (balance.balance_type or _("reported")) }} · {{ _f("as of {date}", date=d(balance.as_of)) }} {% else %}{{ _("nothing reported yet") }}{% endif %}
{% if not link %} {# No bank reports this balance, so the owner does. A reading, dated: the newest one is what the overview adds up. #}
{% endif %}
{{ _("Transactions") }}
{{ total_transactions }}
{{ account.currency }} · {{ type_label(account.type) }}
{% if readings | length > 1 %}

{{ _("Balance over time") }}

{{ _n(readings | length, "{n} reading since {date}", "{n} readings since {date}", date=d(readings[0].date)) }}

{{ _("Each point is a reading of the balance on that day — from a sync, a statement, the loan's schedule, or typed in above. The newest reading of a day stands for the day; between readings the last one holds.") }}

{% endif %} {% if broker or (account.type == 'broker' and not link and (saxo_state.configured or kraken_ready)) %}

{{ _("Broker connection") }}

{% if broker %}

{{ 'Saxo Bank' if broker.provider == 'saxo' else 'Kraken' }} {% if broker.remote_label and broker.provider == 'saxo' %}· {{ _f("account {id}", id=broker.remote_label) }}{% endif %} {% if broker.provider == 'saxo' and saxo_state.environment == 'sim' %}· {{ _("simulation") }}{% endif %}

{{ _f("Last sync: {when}.", when=(d(broker.last_sync_at) if broker.last_sync_at else _("never"))) }} {% if broker.provider == 'saxo' %} {% if saxo_state.alive %}{{ _("The login is being kept alive.") }} {% else %}{{ _("The Saxo login has lapsed — connect again to resume syncing.") }}{% endif %} {% else %}{{ _("Read-only key; syncs with the daily sync.") }}{% endif %}

{% if broker.last_error %}
{{ broker.last_error }}
{% endif %}
{% if broker.provider == 'saxo' and not saxo_state.alive %}

{{ _("Connect Saxo again") }}

{% endif %} {% if broker.provider == 'kraken' %}

{{ _("A coin sent to a wallet of your own is still yours. Name the wallet — an account of type Broker, created under Accounts — and a withdrawal becomes a move between the two, at the cost the units carried; a coin sent back in is the same the other way round.") }}

{% endif %} {% else %} {% if saxo_state.configured %}

{{ _("Saxo Bank: log in at Saxo and this account becomes your first Saxo account; any others are created beside it.") }}

{{ _("Connect Saxo") }}

{% endif %} {% if kraken_ready %}

{{ _("Kraken: link this account to the API key under Settings and pull every trade, deposit and reward.") }}

{% endif %} {% endif %}
{% endif %}

{{ _("Bank connection") }}

{% if link %}

{{ link.aspsp_name }} ({{ link.aspsp_country }}){% if link.iban %} · {{ link.iban }}{% endif %}

{{ _f("Last sync: {when}.", when=(d(link.last_sync_at) if link.last_sync_at else _("never"))) }} {% if link.days_left is not none %} {% if link.days_left > 7 %} {{ _n(link.days_left, "Consent valid for {n} more day.", "Consent valid for {n} more days.") }} {% elif link.days_left >= 0 %} {{ _n(link.days_left, "Consent expires in {n} day — reconnect soon.", "Consent expires in {n} days — reconnect soon.") }} {% else %} {{ _("Consent expired. Reconnect to resume syncing.") }} {% endif %} {% endif %}

{% if link.last_error %}
{{ link.last_error }}
{% endif %}

{{ _("Reconnect or change bank") }}

{{ _("The account and its history stay; the syncing ends.") }}
{% else %}

{{ _("This account is not connected to a bank. Connecting it pulls the balance and the transaction history straight from the bank, with your own Enable Banking credentials.") }}

{% if configured %}

{{ _("Connect a bank") }}

{% set paste_link %}{{ _("Paste the code here") }}{% endset %}

{{ _f("Started one already and landed on a dead page? {paste}.", paste=paste_link) | safe }}

{% else %} {% set settings_link %}{{ _("Settings") }}{% endset %}

{{ _f("Add your Enable Banking Application ID and private key in {settings} first.", settings=settings_link) | safe }}

{% endif %} {% endif %}

{{ _("Import a broker CSV") }} {{ _("Add by hand") }} {{ _("Edit or delete") }}

{% if positions %}

{{ _("Holdings") }}

{% for p in positions %} {% endfor %}
{{ _("Security") }}{{ _("ISIN") }}{{ _("Quantity") }} {{ _("Net invested") }}{{ _("Last traded at") }} {{ _("At that price") }}
{{ p.name or p.isin }}{{ _n(p.trades, "{n} trade", "{n} trades") }}, {{ _f("last {date}", date=d(p.last_trade)) }} {{ p.isin }} {{ qty(p.quantity) }} {% if p.incomplete_history %}{{ _("export starts too late") }}{% endif %} {{ money(p.net_invested, p.currency) }} {% if p.last_price %}{{ qty(p.last_price) }}{% else %}—{% endif %} {% if p.value_at_last_price %}{{ money(p.value_at_last_price, p.currency) }}{% else %}—{% endif %}
{% if positions | selectattr('incomplete_history') | list %}

{{ _("A negative quantity is not a short position: it is a sale whose purchase is older than the file you imported. Export a period that starts when you opened the account and re-import — overlap is free.") }}

{% endif %}

{{ _("Quantities are the running sum of every buy and sell, imported or typed in. The last two columns use the price of your most recent trade, not a market price — this app has no price feed yet, and a stale number presented as a valuation is worse than none.") }} {{ _("Click a security to see, and correct, every row behind it.") }}

{% endif %} {% if imports %}

{{ _("Recent imports") }}

{% for im in imports %} {% endfor %}
{{ _("When") }}{{ _("File") }}{{ _("Through") }}{{ _("Rows brought") }}
{{ im.at[:16].replace('T', ' ') }} {{ im.filename or '—' }} {{ im.source }} {{ im.still }}{% if im.still != im.inserted %}{{ _f("of {n}", n=im.inserted) }}{% endif %} {% if im.still %}
{% if im.source.startswith('csv:') %}{% endif %}
{% else %}{{ _("nothing left of it") }}{% endif %}

{{ _("An import can be taken back as one thing — every row it brought, and only those; a row a re-import found already there belongs to the import that first brought it. Wrong signs from a mapping: undo, forget the mapping, import again.") }}

{% endif %}

{{ _("Recent transactions") }}{% if transactions %} {{ _("Export as CSV") }}{% endif %}

{% if transactions %} {% for t in transactions %} {% endfor %}
{{ _("Date") }}{{ _("Description") }}{{ _("Counterparty") }}{{ _("Amount") }}
{{ d(t.txn_date) }} {{ t.description }}{% if t.source == 'manual' %}{{ _("typed in") }}{% endif %} {{ t.counterparty or '' }} {{ money(t.amount, t.currency) }}
{% if total_transactions > transactions|length %}

{{ _f("Showing the {shown} most recent of {total}.", shown=transactions|length, total=total_transactions) }}

{% endif %} {% else %}

{{ _("No transactions yet.") }}

{% set add_link %}{{ _("Add by hand") }}{% endset %}

{{ _f("Connect a bank, import a CSV, or {add}.", add=add_link) | safe }}

{% endif %} {% endblock %} {% block scripts %} {% if readings | length > 1 %} {% endif %} {% endblock %}