EcoAccount detail
* adds detail view for eco account * adds withdraw detail view to eco acount detail * generalizes compensation/includes templates to be reusable for eco-accounts * moves is_shared_with() check to class BaseObject * adds/updates translations
This commit is contained in:
@@ -239,7 +239,7 @@ class EcoAccountTable(BaseTable):
|
||||
|
||||
"""
|
||||
withdraws = record.withdraws.all()
|
||||
withdraw_surfaces = withdraws.aggregate(Sum("amount"))["amount__sum"] or 0
|
||||
withdraw_surfaces = withdraws.aggregate(Sum("surface"))["surface__sum"] or 0
|
||||
after_states_surfaces = record.after_states.all().aggregate(Sum("surface"))["surface__sum"] or withdraw_surfaces ## no division by zero
|
||||
value = int(((after_states_surfaces - withdraw_surfaces) / after_states_surfaces) * 100)
|
||||
html = render_to_string("konova/custom_widgets/progressbar.html", {"value": value})
|
||||
|
||||
Reference in New Issue
Block a user