{% extends "juntagrico/manage/base.html" %} {% load crispy_forms_tags %} {% load i18n %} {% load static %} {% load juntagrico.config %} {% load juntagrico.common %} {% load juntagrico.snippets %} {% block page_title %}

{% blocktrans %}Beiträge in Runde {{ round }}{% endblocktrans %}

{% endblock %} {% block content %} {% crispy round_form %} {% include 'juntagrico/manage/member/snippets/toggle_buttons.html' with co_members=True %} {{ block.super }} {% endblock %} {% block list %} {% config "currency" as c_currency %} {% block list_head %} {% endblock %} {% block list_foot %} {% endblock %} {% for subscription in object_list %} {% block list_entry %} {% if subscription.current_contribution %} {% with selection=subscription.current_contribution.0 %} {% endwith %} {% else %} {% endif %} {% endblock %} {% endfor %}
{% trans "Auswahl" %} {% blocktrans %}Beitrag [{{ c_currency }}] (Nominal){% endblocktrans %} {% trans "Kann kontaktiert werden" %} {% trans "Zuletzt geändert am" %} {% vocabulary "subscription" %} {% trans "Inhalt" %} {% trans "Kontakt" %}
{% trans "Auswahl" %} {% blocktrans %}Beitrag [{{ c_currency }}]{% endblocktrans %} {% trans "Kann kontaktiert werden" %} {% trans "Zuletzt geändert am" %} {% vocabulary "subscription" %} {% trans "Inhalt" %} {% trans "Kontakt" %}
{% if perms.juntagrico_contribution.view_contributionselection or perms.juntagrico_contribution.change_contributionselection %} {{ selection.selected_option|default:_('Anderer Betrag') }} {% else %} {{ selection.selected_option|default:_('Anderer Betrag') }} {% endif %} {{ selection.price|floatformat:'2g' }} ({{ selection.get_nominal_price|floatformat:'2g' }}) {{ selection.contact_me|yesno:_("Ja,Nein") }} {{ selection.modification_date|date:"Y-m-d" }} {% trans "Kein Gebot" %} - - - {% include 'juntagrico/manage/subscription/snippets/display_linked.html' %} {% for item in subscription.content_strings %}
{{ item }}
{% endfor %}
{% include 'juntagrico/manage/subscription/snippets/members_linked.html' %}
{% endblock %} {% block datatable_constructor %} {{ block.super }} {# sort by date #} config.order = [ [3, 'desc'], ] {# show total price of selected #} {% get_current_language as current_language %} number_formater = new Intl.NumberFormat("{{ current_language }}", { style: "currency", currency: "{% config 'currency' %}" }) config.footerCallback = function (row, data, start, end, display) { let api = this.api(); // Remove the formatting to get float data for summation let floatVal = function (i) { if (typeof(i) === 'number') { return i; } if (typeof(i) === 'string') { let amount = i.split('(')[0].replace(/ /g, "").split(dt_language.decimal).join('.') return parseFloat(amount) || 0 } return 0; }; // Total let total = api .column(1, { search: 'applied' }) .data() .reduce((a, b) => floatVal(a) + floatVal(b), 0); api.column(1).footer().innerHTML = '{% trans "Total:" %}
' + number_formater.format(total) + '
'; } {% endblock %}