{% extends "core/base.jinja" %} {% macro monthly(obj) %}
{% for array in obj %} {% for dict in array %} {% if dict['sum'] != 0 %} {% set link=url('core:user_account_detail', user_id=profile.id, year=dict['date'].year, month=dict['date'].month) %} {% endif %} {% endfor %} {% endfor %}
{% trans %}Year{% endtrans %} {% trans %}Month{% endtrans %} {% trans %}Total{% endtrans %}
{{ dict['date'].year }} {{ dict['date']|date("E") }} {{ dict['sum'] }} €
{% endmacro %} {% block title %} {% trans user_name=profile.get_display_name() %}{{ user_name }}'s account{% endtrans %} {% endblock %} {% block content %} {% if customer %}

{% trans %}User account{% endtrans %}

{% trans %}Amount: {% endtrans %}{{ customer.amount }} €

{% set bought = customer.buyings.exists() %} {% set refilled = customer.refillings.exists() %} {% if bought or refilled %} {% if bought %}
{% trans %}Account buyings{% endtrans %}
{{ monthly(buyings_month) }} {% endif %} {% if refilled %}
{% trans %}Refillings{% endtrans %}
{{ monthly(refilling_month) }} {% endif %} {% endif %} {% if customer.user.invoices.exists() %}
{% trans %}Eboutic invoices{% endtrans %}
{{ monthly(invoices_month) }} {% endif %} {% if etickets %}

{% trans %}Etickets{% endtrans %}

{% endif %}
{% else %}

{% trans %}User has no account{% endtrans %}

{% endif %} {% endblock %} {% block script %} {{ super() }} {% endblock %}