{% set entry_types = ['open', 'close', 'transaction', 'balance', 'note', 'document', 'pad', 'query'] %} {% set transaction_types = ['cleared', 'pending', 'padding', 'summarize', 'transfer', 'other'] %} {% set show_type = { 'open': config['journal-show-type-open'], 'close': config['journal-show-type-close'], 'transaction': config['journal-show-type-transaction'], 'balance': config['journal-show-type-balance'], 'note': config['journal-show-type-note'], 'document': config['journal-show-type-document'], 'pad': config['journal-show-type-pad'], 'query': config['journal-show-type-query'] } %} {% set show_transaction_type = { 'cleared': config['journal-show-transaction-cleared'], 'pending': config['journal-show-transaction-pending'], 'padding': config['journal-show-transaction-padding'], 'summarize': config['journal-show-transaction-summarize'], 'transfer': config['journal-show-transaction-transfer'], 'other': config['journal-show-transaction-other'], } %} {% set show_metadata = config['journal-show-metadata'] %} {% set show_legs = config['journal-show-legs'] %} {% if show_tablefilter %}
{% for type in entry_types %} {% endfor %}
{% for type in transaction_types %} {% endfor %}
{% endif %} {% set context_url = url_for('context', ehash='REPLACEME') %} {% set account_url = url_for('account_with_journal', name='REPLACEME') %} {% set tag_url = url_for_current(tag=['REPLACEME']+g.filters['tag']) %} {% macro account_link(name) -%} {{ name }} {%- endmacro %} {% macro render_inventory(inv) -%} {% if inv %} {% for currency, number in inv.items() %} {{ number|format_currency(currency) }} {{ currency }}
{% endfor %} {% endif %} {%- endmacro %} {% macro render_metadata(metadata, show_metadata) -%} {% if metadata %}
{% for key, value in metadata.items() %}
{{ key }}
{%- if key == 'statement' %}{% endif -%} {{ value }} {%- if key == 'statement' %}{% endif -%}
{% endfor %}
{% endif %} {%- endmacro %}
  1. Date F Narration/Payee Position Price Cost {% if show_change_and_balance %} Change Balance {% endif %}

  2. {% for entry in journal %} {% set type = entry.meta.type %}
  3. {{ entry.date }} {{ entry.flag }} {% if type == 'open' %} Open {{ account_link(entry.account) }} {% elif type == 'close' %} Close {{ account_link(entry.account) }} {% elif type == 'note' %} 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 == 'document' %} Document for {{ account_link(entry.account) }}: {{ entry.filename|basename }} {% elif type == 'balance' %} Balance {{ account_link(entry.account) }} {% if entry.diff_amount %} fails; expected = {{ entry.amount|format_amount }} balance = {{ (entry.amount.number + entry.diff_amount.number)|format_currency(entry.amount.currency) }} {{ entry.amount.currency }} difference = {{ entry.diff_amount|format_amount }} {% else %} has {{ entry.amount }} {% endif %} {% elif type == 'transaction' %} {{ entry.payee or '' }}{% if entry.payee and entry.narration %} | {% endif %}{{ entry.narration or '' }} {% for tag in entry.tags %}#{{ tag }}{% endfor %} {% endif %} {% if type == 'transaction' %} {% for posting in entry.postings %} {% endfor %} {% endif %} {% if show_change_and_balance %} {{ render_inventory(entry.change) }} {{ render_inventory(entry.balance) }}

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