# 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user