[EcoAccount] See recorded state of withdraw #6
* adds prefiltering of withdraws --> excludes withdraws of as deleted flagged interventions * renders intervention-recorded icon into eco account withdraws details view * fixes bug in case of document deleting which does not contain any files * renames RecordForm into RecordModalForm for more clarity
This commit is contained in:
@@ -239,7 +239,9 @@ class EcoAccount(AbstractCompensation):
|
||||
|
||||
"""
|
||||
ret_val = 0
|
||||
withdraws = self.withdraws.all()
|
||||
withdraws = self.withdraws.filter(
|
||||
intervention__deleted=None,
|
||||
)
|
||||
withdraw_surfaces = withdraws.aggregate(Sum("surface"))["surface__sum"] or 0
|
||||
after_states_surfaces = self.after_states.all().aggregate(Sum("surface"))["surface__sum"] or withdraw_surfaces ## no division by zero
|
||||
ret_val = after_states_surfaces - withdraw_surfaces
|
||||
|
||||
Reference in New Issue
Block a user