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

@@ -11,12 +11,10 @@
<div class="col-sm-6">
<div class="d-flex justify-content-end">
{% if is_default_member and has_access %}
<a href="{% url 'compensation:new' %}" title="{% trans 'Add new withdraw' %}">
<button class="btn btn-outline-default">
{% fa5_icon 'plus' %}
{% fa5_icon 'tree' %}
</button>
</a>
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc-new-withdraw' obj.id %}" title="{% trans 'Add new withdraw' %}">
{% fa5_icon 'plus' %}
{% fa5_icon 'tree' %}
</button>
{% endif %}
</div>
</div>
@@ -32,6 +30,9 @@
<th scope="col">
{% trans 'Amount' %}
</th>
<th scope="col">
{% trans 'Created' %}
</th>
<th scope="col">
{% trans 'Action' %}
</th>
@@ -46,6 +47,7 @@
</a>
</td>
<td class="align-middle">{{ withdraw.surface|floatformat:2|intcomma }} m²</td>
<td class="align-middle">{{ withdraw.created.timestamp|default_if_none:""|naturalday}}</td>
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:withdraw-remove' withdraw.account.id withdraw.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove Withdraw' %}">