if self.parent:
self.parent.children += [self]
+ def children_euro_sorted_at(self, up_incl: int) -> list[Self]:
+ 'Sorted .children, by .get_wealth_at(up_incl).'
+ return sorted(self.children,
+ key=lambda c:
+ c.get_wealth_at(up_incl).moneys.get('€', Decimal(0)))
+
def get_wealth_at_excl_incl(self, up_incl: int) -> tuple[_Wealth, _Wealth]:
'Total, with .children wealths, of wealth until Bookings of up_incl.'
total_excl = _Wealth()
</td>
<td>{{account.desc}}</td>
</tr>
- {% for child in account.children %}
+ {% for child in account.children_euro_sorted_at(block_id) %}
{{account_with_children(block_id, child, indent=indent+1)}}
{% endfor %}
{% endif %}