Fix #192 -- Disable bank import after last date of payments

This commit is contained in:
Raphael Michel
2017-01-14 16:12:25 +01:00
parent f285390f46
commit 7120e95d2a
2 changed files with 40 additions and 27 deletions

View File

@@ -2,6 +2,14 @@
{% load i18n %} {% load i18n %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% block inner %} {% block inner %}
{% if no_more_payments %}
<div class="alert alert-danger">
{% blocktrans trimmed with date=request.event.settings.payment_term_last|date:"SHORT_DATE_FORMAT" %}
In the payment settings of your event, you set the {{ date }} as the last date of any payments.
Therefore, you won't be able to mark any order as paid here.
{% endblocktrans %}
</div>
{% else %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">{% trans "Upload a new file" %}</h3> <h3 class="panel-title">{% trans "Upload a new file" %}</h3>
@@ -32,6 +40,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endif %}
{% if transactions_unhandled|length > 0 or request.GET.search %} {% if transactions_unhandled|length > 0 or request.GET.search %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">

View File

@@ -354,4 +354,8 @@ class ImportView(EventPermissionRequiredMixin, ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super().get_context_data() ctx = super().get_context_data()
ctx['job_running'] = self.job_running ctx['job_running'] = self.job_running
ctx['no_more_payments'] = False
if self.request.event.settings.get('payment_term_last'):
if now() > self.request.event.payment_term_last:
ctx['no_more_payments'] = True
return ctx return ctx