{% extends "base.html" %} {% block title %}{{ _("Bills") }} · Wealth Dashboard{% endblock %} {% block heading %}{{ _("Bills") }}{% endblock %} {% block lede %}

{{ _("What is expected to leave the account, and whether it did. A subscription is found; a bill is declared — the rent, the insurance, the electricity — and matched against the rows as they arrive, so this page can say paid, due, or missed.") }}

{% endblock %} {% block content %} {% set state_labels = {'paid': _("paid"), 'due': _("due"), 'missed': _("missed"), 'never': _("never seen")} %} {% macro bill_fields(b) %}
{% if b %}
{% endif %} {% endmacro %}
{{ _("Fixed costs a month") }}
{% for ccy, v in data.monthly.items() %}{{ money(v, ccy) }}{% if not loop.last %} · {% endif %}{% else %}—{% endfor %}
{{ _n(data.active | length, "{n} active bill", "{n} active bills") }}
{{ _("Missed") }}
{{ data.missed | length }}
{{ _("past due by more than a week, nothing seen since") }}
{{ _("Due within a week") }}
{{ data.due | length }}
{% if data.upcoming %}{{ _f("next: {name}, {date}", name=data.upcoming[0].name, date=d(data.upcoming[0].next)) }}{% else %}—{% endif %}

{{ _("Add a bill") }}

{{ _("or adopt one the app detected") }}
{{ bill_fields(none) }}

{{ _("The text is looked for in the counterparty and the description of money going out; an amount, if given, allows a fifth either way — utilities vary. The due day snaps the next date to the day of the month the bill is usually taken.") }}

{% if data.bills %}

{{ _("Every bill") }}

{% for b in data.bills %}
{{ state_labels[b.state] }} {{ b.name }} {% if b.state == 'never' %}{{ _("no payment matched yet") }} {% else %}{{ _f("last {date}, {amount}", date=d(b.last), amount=money(b.last_amount, b.currency)) }} · {% if b.days is not none and b.days >= 0 %}{{ _f("next {date}, in {n} days", date=d(b.next), n=b.days) }}{% else %}{{ _f("was due {date}, {n} days ago", date=d(b.next), n=-b.days) }}{% endif %}{% endif %} · {{ _n(b.paid_count, "{n} payment seen", "{n} payments seen") }}
{{ bill_fields(b) }}
{% endfor %}
{% endif %} {% endblock %}