{% set entry_types = ['open', 'close', 'transaction', 'balance', 'note', 'document', 'pad', 'query', 'custom'] %} {% set transaction_type_buttons = ( ('cleared', '*', _('Cleared transactions')), ('pending', '!', _('Pending transactions')), ('other', 'x', _('Other transactions')), ) %} {% set document_type_buttons = ( ('discovered', 'D', _('Documents with a #discovered tag')), ('statement', 'S', _('Documents with a #statement tag')), ) %} {% set keyboard_shortcuts = { 'open': 's o', 'close': 's c', 'balance': 's b', 'note': 's n', 'pad': 's p', 'query': 's q', 'custom': 's C', 'budget': 's B', 'transaction': 's t', 'cleared': 't c', 'pending': 't p', 'other': 't o', 'document': 's d', 'discovered': 'd d', 'statement': 'd s', } %}
{% for type in entry_types %} {% if type == 'transaction' %} {% for txn_type in transaction_type_buttons %} {% endfor %} {% elif type == 'custom' %} {% elif type == 'document' %} {% for doc_type in document_type_buttons %} {% endfor %} {% endif %} {% endfor %}
{% set account_url = url_for('account', name='REPLACEME') %} {% macro account_link(name) -%} {{ name }} {%- endmacro %} {% macro render_inventory(inv) -%} {% for pos in inv|units %} {{ pos.units|format_amount }}
{% endfor %} {%- endmacro %} {% macro render_metadata(metadata, entry_hash=None) -%} {% if metadata %}
{% for key, value in metadata.items() %}
{{ key }}
{%- if key.startswith('statement') %} {% endif -%} {{ value }} {%- if key.startswith('statement') %}{% endif -%}
{% endfor %}
{% endif %} {%- endmacro %} {% set tag_url = url_for_current(tag='#REPLACEME,'+(g.filters['tag'] or '')) %} {% set link_url = url_for_current(tag='^REPLACEME,'+(g.filters['tag'] or '')) %} {% macro render_tags_links(entry) -%} {% for tag in entry.tags %} #{{ tag }} {% endfor %} {% for link_ in entry.links %} ^{{ link_ }} {% endfor %} {%- endmacro %} {% autoescape false %}
  1. {{ _('Date') }} {{ _('F') }} {{ _('Narration/Payee') }} {{ _('Position') }} {{ _('Price') }} {{ _('Cost') }} {% if show_change_and_balance %} {{ _('Change') }} {{ _('Balance') }} {% endif %}

  2. {% for entry in journal|reverse %} {% if show_change_and_balance %} {% set entry, _, change, balance = entry %} {% endif %} {% set type = entry.__class__.__name__.lower() %} {% set entry_hash = entry|hash_entry %} {% set metadata = entry.meta|remove_keys(['__tolerances__', '__automatic__', 'filename', 'lineno']) %}
  3. {{ entry.date }} {{ entry.flag }} {% if type == 'open' %} Open {{ account_link(entry.account) }} {% elif type == 'close' %} Close {{ account_link(entry.account) }} {% elif type == 'note' %} {{ entry.comment }} {% elif type == 'query' %} Query: {{ entry.name }} {% elif type == 'pad' %} Pad {{ account_link(entry.account) }} from {{ account_link(entry.source_account) }} {% elif type == 'custom' %} {{ entry.type }} {%- for value in entry['values'] -%}  {%- if value.dtype|string == "" %}{{ account_link(value.value) }} {%- elif value.dtype|string == "" %}{{ value.value|format_amount }} {%- elif value.dtype|string == "" %}"{{ value.value }}" {%- elif value.dtype|string == "" %}{{ value.value }} {%- elif value.dtype|string == "" %}{{ value.value }}{% endif -%} {%- endfor -%} {% elif type == 'document' %} Document for {{ account_link(entry.account) }} {{ entry.filename|basename }} {{ render_tags_links(entry) }} {% elif type == 'balance' %} Balance {{ account_link(entry.account) }} {% if entry.diff_amount %}: expected = {{ entry.amount|format_amount }}; balance = {{ (entry.amount.number + entry.diff_amount.number)|format_currency(entry.amount.currency, show_if_zero=True) }} {{ entry.amount.currency }}; difference = {{ entry.diff_amount|format_amount }} {% else %} {{ entry.amount|format_amount }} {% endif %} {% elif type == 'transaction' %} {{ entry.payee or '' }}{% if entry.payee and entry.narration %} {% endif %}{{ entry.narration or '' }} {{ render_tags_links(entry) }} {% endif %} {% for key, value in metadata.items() %} {% endfor %} {% if type == 'transaction' %} {% for posting in entry.postings %} {% endfor %} {% endif %} {% if show_change_and_balance %} {{ render_inventory(change) }} {{ render_inventory(balance) }}

    {% endif %} {{ render_metadata(metadata, entry_hash) }} {% if entry.postings %} {% endif %}
  4. {% endfor %}
{% endautoescape %}