# Extended OEK report

* adds available rest surface of eco account to public report
* adds amount of deducted surface per each deduction to public report
This commit is contained in:
2026-08-03 13:06:51 +02:00
parent 2aa625a6ac
commit cbe309f114
2 changed files with 46 additions and 9 deletions
+11 -1
View File
@@ -66,7 +66,15 @@ class EcoAccountPublicReportView(AbstractPublicReportView):
deductions = acc.deductions.all() \
.distinct("intervention") \
.select_related("intervention") \
.values_list("intervention__id", "intervention__identifier", "intervention__title", named=True)
.values_list("intervention__id",
"intervention__identifier",
"intervention__title",
"surface",
named=True)
# Calculate rest of available surface for deductions
available_total = acc.deductable_rest
available_relative = acc.get_deductable_rest_relative()
context = {
"obj": acc,
@@ -86,6 +94,8 @@ class EcoAccountPublicReportView(AbstractPublicReportView):
"actions": actions,
"deductions": deductions,
"tables_scrollable": False,
"available": available_relative,
"available_total": available_total,
TAB_TITLE_IDENTIFIER: tab_title,
}
context = BaseContext(request, context).context