3 * Copyright © 2003-2024 The Galette Team
5 * This file is part of Galette (https://galette.eu).
7 * Galette is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * Galette is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
21 {% extends 'elements/list.html.twig' %}
25 'name': "batch-scheduledPaymentslist"
28 'name': "scheduledPayments"
32 {% if nb != 0 and (login.isAdmin() or login.isStaff()) and mode != 'ajax' %}
35 'name': 'batch-scheduledPaymentslist'
38 'title': _T("No entry selected"),
39 'content': _T("Please make sure to select at least one entry from the list to perform this action.")
42 {% set batch_actions = [
45 'label': _T("Delete"),
49 'name': 'csv__directdownload',
50 'label': _T("Export as CSV"),
57 <form action="{{ url_for("filterScheduledPayments") }}" method="post" class="ui form filters">
58 <div class="ui secondary yellow segment">
59 <div class="four fields">
61 <label for="date_field">{{ _T("Show contributions by") }}</label>
62 <select name="date_field" id="date_field" class="ui search dropdown">
63 <option value="{{ constant("Galette\\Filters\\ScheduledPaymentsList::DATE_RECORD") }}"{% if filters.date_field == constant('Galette\\Filters\\ScheduledPaymentsList::DATE_RECORD') %} selected="selected"{% endif %}>{{ _T("Date") }}</option>
64 <option value="{{ constant("Galette\\Filters\\ScheduledPaymentsList::DATE_SCHEDULED") }}"{% if filters.date_field == constant('Galette\\Filters\\ScheduledPaymentsList::DATE_SCHEDULED') %} selected="selected"{% endif %}>{{ _T("Scheduled date") }}</option>
67 <div class="two fields">
69 <label for="start_date_filter">{{ _T("since") }}</label>
70 <div class="ui calendar" id="contrib-rangestart">
71 <div class="ui input left icon">
72 <i class="calendar icon" aria-hidden="true"></i>
73 <input placeholder="{{ _T("yyyy-mm-dd format") }}" type="text" name="start_date_filter" id="start_date_filter" maxlength="10" size="10" value="{{ filters.start_date_filter }}"/>
78 <label for="end_date_filter">{{ _T("until") }}</label>
79 <div class="ui calendar" id="contrib-rangeend">
80 <div class="ui input left icon">
81 <i class="calendar icon" aria-hidden="true"></i>
82 <input placeholder="{{ _T("yyyy-mm-dd format") }}" type="text" name="end_date_filter" id="end_date_filter" maxlength="10" size="10" value="{{ filters.end_date_filter }}"/>
88 {% include "components/forms/payment_types.html.twig" with {
89 current: filters.payment_type_filter,
90 varname: "payment_type_filter",
92 empty: {'value': -1, 'label': _T("Select")}
95 <div class="ui right aligned basic fitted segment field flexend">
96 <button type="submit" class="tooltip ui labeled icon primary button" title="{{ _T("Apply filters") }}" name="filter">
97 <i class="search icon" aria-hidden="true"></i>
100 <button type="submit" id="clear_filter" name="clear_filter" class="tooltip ui labeled icon button" title="{{ _T("Reset all filters to defaults") }}">
101 <i class="trash alt red icon" aria-hidden="true"></i>
102 {{ _T("Clear filter") }}
108 {% if mode == 'ajax'%}
109 <input type="hidden" name="ajax" value="true"/>
110 <input type="hidden" name="from_contribution" value="{{ filters.from_contribution }}"/>
112 {% include "components/forms/csrf.html.twig" %}
119 'label': _Tn("%count shceduled payment", "%count scheduled payments", nb)|replace({"%count": nb}),
121 'name': 'filterScheduledPayments'
129 {'label': '#', 'order': constant("Galette\\Filters\\ScheduledPaymentsList::ORDERBY_ID")},
130 {'label': _T("Member"), 'order': constant("Galette\\Filters\\ScheduledPaymentsList::ORDERBY_MEMBER")},
131 {'label': _T("Date"), 'order': constant("Galette\\Filters\\ScheduledPaymentsList::ORDERBY_DATE")},
132 {'label': _T("Scheduled date"), 'order': constant("Galette\\Filters\\ScheduledPaymentsList::ORDERBY_SCHEDULED_DATE")},
133 {'label': _T('Amount'), 'order': constant("Galette\\Filters\\ScheduledPaymentsList::ORDERBY_AMOUNT")},
134 {'label': _T("Payment type"), 'order': constant("Galette\\Filters\\ScheduledPaymentsList::ORDERBY_PAYMENT_TYPE")}
137 {% if (not login.isAdmin() and not login.isStaff()) or mode == 'ajax' %}
138 {% set no_action = true %}
147 <th class="right aligned" colspan="{% if (login.isAdmin() or login.isStaff()) and member is not defined %}7{% else %}6{% endif %}">
148 {{ _T("Found total scheduled %f")|replace({"%f": scheduled.getSum()}) }}
155 {% for ordre, scheduled in list %}
156 {% set contribution = scheduled.getContribution() %}
157 {% if contribution.isFee() %}
158 {% set ctype = constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
160 {% set ctype = constant('Galette\\Entity\\Contribution::TYPE_DONATION') %}
163 <tr class="{% if mode == 'ajax' %}schedule_row {% endif %}" id="row_{{ scheduled.getId() }}">
164 <td data-scope="row">
165 <input type="checkbox" name="entries_sel[]" value="{{ scheduled.getId() }}"/>
166 {% if preferences.pref_show_id %}
167 {{ scheduled.getId() }}
169 {{ ordre + 1 + (filters.current_page - 1) * numrows }}
171 {% if (login.isAdmin() or login.isStaff()) and mode != 'ajax' %}
173 <a href="{{ url_for("editContribution", {"type": ctype, "id": contribution.id}) }}">
175 class="ui {% if contribution.isFee() %}user check{% else %}gift{% endif %} grey icon tooltip"
176 title="{% if contribution.isFee() %}{{ _T('Contribution') }}{% else %}{{ _T('Donation') }}{% endif %}"
178 <span class="visually-hidden">{{ _T("Contribution %id")|replace({"%id": contribution.id}) }}</span>
183 <td data-col-label="{{ _T("Member") }}">{{ memberName({id: scheduled.getContribution().member}) }}</td>
184 <td data-col-label="{{ _T("Date") }}">{{ scheduled.getCreationDate() }}</td>
185 <td data-col-label="{{ _T("Scheduled date") }}">{{ scheduled.getScheduledDate() }}</td>
186 <td data-col-label="{{ _T("Amount") }}">{{ scheduled.getAmount() }}</td>
187 <td data-col-label="{{ _T("Payment type") }}">{{ scheduled.getPaymentType() }}</td>
188 {% if (login.isAdmin() or login.isStaff()) and mode != 'ajax' %}
189 <td class="actions_row center">
190 {% if (login.isAdmin() or login.isStaff()) %}
192 href="{{ url_for("editScheduledPayment", {"id": scheduled.getId()}) }}"
195 <i class="ui edit icon tooltip" aria-hidden="true"></i>
196 <span class="ui special popup">{{ _T("Edit scheduled payment") }}</span>
199 href="{{ url_for("removeScheduledPayment", {"id": scheduled.getId()}) }}"
202 <i class="ui trash red icon tooltip" aria-hidden="true"></i>
203 <span class="ui special popup">{{ _T("Delete scheduled payment") }}</span>
210 <tr><td colspan="{% if (login.isAdmin() or login.isStaff()) and member is not defined %}6{% elseif login.isAdmin() or login.isStaff() %}6{% else %}5{% endif %}" class="emptylist">{{ _T("No scheduled payment") }}</td></tr>