#25 Public reports

* adds public report for compensations
* adds/updates translations
* prepares EMA and eco account reports
This commit is contained in:
2021-10-13 17:35:11 +02:00
parent 7daceb947f
commit 354ec4c929
17 changed files with 303 additions and 88 deletions

View File

@@ -4,7 +4,8 @@
{% block body %}
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-6">
<h3>{{obj.identifier}}</h3>
<h3>{% trans 'Report' %}</h3>
<h4>{{obj.identifier}}</h4>
<div class="table-container">
<table class="table table-hover">
<tr>
@@ -48,7 +49,7 @@
<th scope="row">{% trans 'Compensations' %}</th>
<td class="align-middle">
{% for comp in obj.compensations.all %}
<a href="{% url 'compensation:detail' comp.id %}" target="_blank">
<a href="{% url 'compensation:report' comp.id %}">
{{comp.identifier}}
</a>
<br>
@@ -61,7 +62,7 @@
<th scope="row">{% trans 'Deductions of eco-accounts' %}</th>
<td class="align-middle">
{% for deduction in deductions %}
<a href="{% url 'compensation:acc-detail' deduction.account.id %}">
<a href="{% url 'compensation:acc-report' deduction.account.id %}">
{{deduction.account.identifier}}
</a>
<br>

View File

@@ -492,6 +492,11 @@ def report_view(request:HttpRequest, id: str):
template = "report/unavailable.html"
return render(request, template, {})
# Prepare data for map viewer
geom_form = SimpleGeomForm(
instance=intervention
)
distinct_deductions = intervention.deductions.all().distinct(
"account"
)
@@ -508,6 +513,7 @@ def report_view(request:HttpRequest, id: str):
"deductions": distinct_deductions,
"qrcode": qrcode_img,
"qrcode_lanis": qrcode_img_lanis,
"geom_form": geom_form,
}
context = BaseContext(request, context).context
return render(request, template, context)