EcoAccount withdraws

* adds functionality for withdraws from eco accounts in detail view of interventions and eco account as well
* adds get_surface() method to AbstractCompensation class to provide a simple getter for a sql calculation
* adds get_surface_withdraws() method to EcoAccount class to provide a simple getter for a sql calculation
* renames some routes to match coherent rout naming
* adds logic check on NewWithdrawForm
* renames templates/table directory to templates/form, since there are form-table templates inside --> more clarity
* adds new autocomplete routes to konova/urls.py for Interventions and EcoAccounts
* adds/updates translations
* adds/updates template comments
* updates requirements.txt
This commit is contained in:
mipel
2021-08-10 10:42:04 +02:00
parent 17d697da92
commit 72d61a23da
21 changed files with 388 additions and 121 deletions

View File

@@ -9,11 +9,10 @@
{% fontawesome_5_static %}
<link rel="stylesheet" href="{% static 'css/konova.css' %}">
{% comment %}
Adds script for modal rendering
Adds script for modal rendering. Script depends on Jquery, therefore it needs to be loaded afterwards.
{% endcomment %}
<script src="{% static 'js/jquery.bootstrap.modal.forms.min.js' %}"></script>
{% block head %}
{% endblock %}
</head>
<body>

View File

@@ -14,4 +14,15 @@
</div>
</div>
{% comment %}
"Why is there a form.media call???"
We use modal forms, right?
And we use dal (django-autocomplete-light), right?
In order to get these nice autocomplete (js triggered) form fields to work, we need to load form.media
somewhere. BUT when these fields are called inside a modal form (which we use quiet often), the form.media
can not be called properly due to some deprecated functions of jquery regarding synchronous calling.
So, we simply call the form.media in here, in case there is any form.media to be loaded.
{% endcomment %}
{{ form.media }}
</footer>

View File

@@ -16,7 +16,7 @@
{% endif %}
<form method="post" action="{{ form.action_url }}" {% for attr_key, attr_val in form.form_attrs.items %} {{attr_key}}="{{attr_val}}"{% endfor %}>
{% csrf_token %}
{% include 'table/generic_table_form_body.html' %}
{% include 'form/generic_table_form_body.html' %}
<div class="row">
<div class="col-md">
<a href="{{ form.cancel_redirect }}">

View File

@@ -1,4 +1,4 @@
{% load i18n l10n %}
{% load i18n l10n bootstrap4 %}
{% comment %}
A generic modal form template which is based on django-bootstrap-modal-forms package
https://pypi.org/project/django-bootstrap-modal-forms/
@@ -18,7 +18,7 @@
<article>
{{ form.form_caption }}
</article>
{% include 'table/generic_table_form_body.html' %}
{% include 'form/generic_table_form_body.html' %}
</div>
{% if form.render_submit %}
<div class="modal-footer">