{% extends "base.html" %} {% block title %}Alberich: the Purse{% endblock %} {% macro picker(cur) %}
Picture {% for k in picker_icons %}{% endfor %}
{% endmacro %} {% macro usescard(tab) %}

Credits used

Logged one by one{% if tab == 'plan' %}, across every pouch{% endif %}. Tap Undo to give a credit back if you fat-fingered it; Restore puts it back.

{% if not uses %}

Nothing logged in the last 45 days.

{% else %}
{% for u in uses %}
{{ pxicon(u.icon, 24) }} {{ u.name }}
{{ u.when }}{% if u.undone_at %} ยท undone{% endif %}
{% if u.undone_at %} {% else %}{% endif %}
{% endfor %}
{% endif %}
{% endmacro %} {% block body %}

The Purse

The spendings that drain you, as counts per month. Pick one below to adjust it.

{% if tab == 'plan' %}

How the credits are worked out ({{ month }})

A pouch tied to a category gets a share of that category's aim from the Treasury, divided by what one credit costs. Credits update on their own when a statement is filed, and purchases the statements show for this month use them up. The month starts fresh on the 1st. Untick "set credits automatically" on a pouch to choose its credits yourself.

{% set loose = rows|selectattr('row.archived', 'equalto', 0)|rejectattr('row.category_id')|list %} {% if loose %}
{{ loose|length }} pouch{{ 'es' if loose|length != 1 }} ha{{ 've' if loose|length != 1 else 's' }} no category yet, so {{ 'their' if loose|length != 1 else 'its' }} credits cannot follow your spending. Pick one in the table below and press Save categories.
{% endif %}
{% for r in rows if not r.row.archived %}{% set d = derived.get(r.row.id) %}{% set st = states.get(r.row.id) %}
{{ pxicon(r.row.icon, 22) }}{{ r.row.name }} {{ r.row.credits_per_month }} credit{{ 's' if r.row.credits_per_month != 1 }} {{ 'automatic' if r.row.auto_credits and r.row.category_id else 'by hand' }}
{{ money(r.row.estimate_cents) if r.row.estimate_cents else 'set a cost' }} each · {% if d %}{{ d.category }} aim {{ money(d.target) }} a month{% elif r.row.category_id %}no spending in its category yet{% else %}no category{% endif %} {% if st %}· used {{ st.used }} of {{ st.allotted }}{% if st.used > st.allotted %} ({{ st.allotted - st.used }} left){% endif %}{% if st.from_statements %} ({{ st.from_statements }} from statements){% endif %}{% endif %}
{% set ov = over.get(r.row.id, []) %}{% set runs = ov|selectattr('over')|list %} {% if runs %}
ran over {% for o in runs %}{{ o.over }} over in {{ o.month }} ({{ o.used }} used of {{ o.allotted }}){{ '; ' if not loop.last }}{% endfor %}. That is a sign it may need more credits, or a higher cost each.
{% endif %} {% if not r.row.category_id %}{% endif %}
{% endfor %}
{% if loose %}{% endif %}
{{ usescard('plan') }} {% endif %} {% for r in rows if tab == r.row.id|string %}

{{ pxicon(r.row.icon, 24) }} {{ r.row.name }} {% if r.row.archived %}archived{% endif %}

{{ picker(r.row.icon) }}
Days (for "only on chosen days")
{% for d in days %}{% endfor %}

Changing credits re-spreads this month's unlock times. Logs already made are kept.

{{ usescard(r.row.id) }} {% endfor %} {% if tab == 'new' %}

Add a spending

{{ picker('') }}
{% endif %} {% endblock %}