#26 Annual conservation report

* introduces new app 'analysis' for annual report generating and future features
* adds new templates (WIP)
* adds new routes (WIP)
This commit is contained in:
2021-10-18 15:52:51 +02:00
parent e170f283ce
commit 060ff5f4ad
22 changed files with 641 additions and 126 deletions

View File

@@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% load i18n fontawesome_5 %}
{% block body %}
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<h3>{% trans 'Report' %}</h3>
<h5>{{office.long_name}}</h5>
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-12">
{% include 'analysis/reports/includes/intervention/card_intervention.html' %}
{% include 'analysis/reports/includes/card_compensation.html' %}
{% include 'analysis/reports/includes/card_eco_account.html' %}
{% include 'analysis/reports/includes/card_old_interventions.html' %}
</div>
{% endblock %}

View File

@@ -0,0 +1,23 @@
{% load i18n fontawesome_5 %}
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="card">
<div id="compensation" class="card-header cursor-pointer rlp-r" data-toggle="collapse" data-target="#compensationBody" aria-expanded="true" aria-controls="compensationBody">
<div class="row">
<div class="col-sm-6">
<h5>
{% fa5_icon 'leaf' %}
{% trans 'Compensations' %}
</h5>
</div>
</div>
</div>
<div id="compensationBody" class="collapse" aria-labelledby="compensation">
<div class="card-body">
{% include 'form/table/generic_table_form_body.html' %}
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,23 @@
{% load i18n fontawesome_5 %}
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="card">
<div id="ecoAccounts" class="card-header cursor-pointer rlp-r" data-toggle="collapse" data-target="#ecoAccountsBody" aria-expanded="true" aria-controls="ecoAccountsBody">
<div class="row">
<div class="col-sm-6">
<h5>
{% fa5_icon 'tree' %}
{% trans 'Eco-Accounts' %}
</h5>
</div>
</div>
</div>
<div id="ecoAccountsBody" class="collapse" aria-labelledby="ecoAccounts">
<div class="card-body">
{% include 'form/table/generic_table_form_body.html' %}
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,24 @@
{% load i18n fontawesome_5 %}
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="card">
<div id="oldIntervention" class="card-header cursor-pointer rlp-r" data-toggle="collapse" data-target="#oldInterventionBody" aria-expanded="true" aria-controls="oldInterventionBody">
<div class="row">
<div class="col-sm-6">
<h5>
{% fa5_icon 'pencil-ruler' %}
{% trans 'Old interventions' %}
</h5>
<span>{% trans 'Before' %} 16.06.2018</span>
</div>
</div>
</div>
<div id="oldInterventionBody" class="collapse" aria-labelledby="oldIntervention">
<div class="card-body">
{% include 'form/table/generic_table_form_body.html' %}
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,30 @@
{% load i18n fontawesome_5 %}
<h3>{% trans 'Amount' %}</h3>
<strong>
{% blocktrans %}
Checked = Has been checked by the registration office according to LKompVzVo
{% endblocktrans %}
<br>
{% blocktrans %}
Recorded = Has been checked and published by the conservation office
{% endblocktrans %}
</strong>
<div class="table-container">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="w-25">{% trans 'Total' %}</th>
<th scope="col">{% fa5_icon 'star' %} {% trans 'Checked' %}</th>
<th scope="col">{% fa5_icon 'bookmark' %} {% trans 'Recorded' %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{report.intervention_report.queryset.count}}</td>
<td>{{report.intervention_report.queryset_checked.count}}</td>
<td>{{report.intervention_report.queryset_recorded.count}}</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,26 @@
{% load i18n fontawesome_5 %}
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="card">
<div id="intervention" class="card-header cursor-pointer rlp-r" data-toggle="collapse" data-target="#interventionBody" aria-expanded="true" aria-controls="interventionBody">
<div class="row">
<div class="col-sm-6">
<h5>
{% fa5_icon 'pencil-ruler' %}
{% trans 'Interventions' %}
</h5>
</div>
</div>
</div>
<div id="interventionBody" class="collapse" aria-labelledby="intervention">
<div class="card-body">
{% include 'analysis/reports/includes/intervention/amount.html' %}
<hr>
{% include 'analysis/reports/includes/intervention/laws.html' %}
<hr>
{% include 'analysis/reports/includes/intervention/compensated_by.html' %}
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,34 @@
{% load i18n fontawesome_5 %}
<h3>{% trans 'Compensated by' %}</h3>
<div class="table-container scroll-300">
<table class="table table-hover">
<thead>
<tr>
<th class="w-25" scope="col">{% trans 'Compensation type' %}</th>
<th class="w-25" scope="col">{% trans 'Total' %}</th>
<th class="w-25" scope="col">{% trans 'Checked' %}</th>
<th class="w-25" scope="col">{% trans 'Recorded' %}</th>
</tr>
</thead>
<tbody>
<tr>
<th>{% trans 'Compensation' %}</th>
<td>{{report.intervention_report.compensation_sum}}</td>
<td>{{report.intervention_report.compensation_sum_checked}}</td>
<td>{{report.intervention_report.compensation_sum_recorded}}</td>
</tr>
<tr>
<th>{% trans 'Payment' %}</th>
<td>{{report.intervention_report.payment_sum}}</td>
<td>{{report.intervention_report.payment_sum_checked}}</td>
<td>{{report.intervention_report.payment_sum_recorded}}</td>
</tr>
<tr>
<th>{% trans 'Deductions' %}</th>
<td>{{report.intervention_report.deduction_sum}}</td>
<td>{{report.intervention_report.deduction_sum_checked}}</td>
<td>{{report.intervention_report.deduction_sum_recorded}}</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,50 @@
{% load i18n fontawesome_5 %}
<h3>{% trans 'Law usage' %}</h3>
<strong>
{% blocktrans %}
Please note: One intervention can be based on multiple laws. This table therefore does not
count
{% endblocktrans %}
</strong>
<div class="table-container scroll-300">
<table class="table table-hover">
<thead>
<tr>
<th class="w-25" scope="col">
{% trans 'Law' %}
</th>
<th scope="col">
{% trans 'Checked' %}
</th>
<th scope="col">
{% trans 'Recorded' %}
</th>
<th scope="col">
{% trans 'Total' %}
</th>
</tr>
</thead>
<tbody>
{% for law in report.intervention_report.evaluated_laws %}
<tr>
<td>
{{law.short_name}}
<br>
<small>
{{law.long_name}}
</small>
</td>
<td>{{law.num_checked}}</td>
<td>{{law.num_recorded}}</td>
<td>{{law.num}}</td>
</tr>
{% endfor %}
<tr>
<td><strong>{% trans 'Total' %}</strong></td>
<td><strong>{{report.intervention_report.law_sum_checked}}</strong></td>
<td><strong>{{report.intervention_report.law_sum_recorded}}</strong></td>
<td><strong>{{report.intervention_report.law_sum}}</strong></td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,8 @@
{% extends 'base.html' %}
{% load i18n fontawesome_5 %}
{% block body %}
<div class="row">
<h3>{% trans 'Reports' %}</h3>
</div>
{% endblock %}