{% set entry_types = ['open', 'close', 'transaction', 'balance', 'note', 'document', 'pad', 'query', 'custom', 'budget'] %} {% set transaction_types = ['cleared', 'pending', 'other'] %} {% set flags_to_types = {'*': 'cleared', '!': 'pending'} %} {% set document_types = ['discovered', 'statement'] %} {% set default_show_type = { 'open': 'open' in config['journal-show'], 'close': 'close' in config['journal-show'], 'balance': 'balance' in config['journal-show'], 'note': 'note' in config['journal-show'], 'pad': 'pad' in config['journal-show'], 'query': 'query' in config['journal-show'], 'custom': 'custom' in config['journal-show'], 'budget': 'budget' in config['journal-show'], 'transaction': 'transaction' in config['journal-show'], 'cleared': 'cleared' in config['journal-show-transaction'], 'pending': 'pending' in config['journal-show-transaction'], 'other': 'other' in config['journal-show-transaction'], 'document': 'document' in config['journal-show'], 'discovered': 'discovered' in config['journal-show-document'], 'statement': 'statement' in config['journal-show-document'], 'metadata': 'metadata' in config['journal-show'], 'postings': 'postings' in config['journal-show'], } %} {% if request.args.get('show', False) %} {% set _list = request.args.getlist('show') %} {% set show_type = { 'open': 'open' in _list, 'close': 'close' in _list, 'balance': 'balance' in _list, 'note': 'note' in _list, 'pad': 'pad' in _list, 'query': 'query' in _list, 'custom': 'custom' in _list, 'budget': 'budget' in _list, 'transaction': 'transaction' in _list, 'cleared': 'cleared' in _list, 'pending': 'pending' in _list, 'other': 'other' in _list, 'document': 'document' in _list, 'discovered': 'discovered' in _list, 'statement': 'statement' in _list, 'metadata': 'metadata' in _list, 'postings': 'postings' in _list, } %} {% else %} {% set show_type = default_show_type %} {% endif %} {% set transaction_type_buttons = { 'cleared': ('*', _('Cleared Transactions')), 'pending': ('!', _('Pending Transactions')), 'other': ('x', _('Other Transactions')), } %} {% set document_type_buttons = { 'discovered': ('D', _('Documents discovered by beancount')), 'statement': ('S', _('Statements from metadata')) } %}
{% set context_url = url_for('context', ehash='REPLACEME') %} {% set account_url = url_for('account', name='REPLACEME') %} {% macro account_link(name) -%} {% set levels = name|account_level %} {%- for level in range(0, levels) -%} {% set subaccount_name = name.rsplit(':', maxsplit=levels-loop.index)[0] %} {% set subaccount_part = name.split(':')[level] %} {%- if loop.last -%} {{ subaccount_part }} {%- else -%} {{ subaccount_part }}: {%- endif -%} {%- endfor -%} {%- endmacro %} {% macro render_inventory(inv) -%} {% for pos in inv %} {{ pos.units|format_amount }}{{ _('Date') }} {{ _('F') }} {{ _('Narration/Payee') }} {{ _('Position') }} {{ _('Price') }} {{ _('Cost') }} {% if show_change_and_balance %} {{ _('Change') }} {{ _('Balance') }} {% endif %}