aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-07 19:15:42 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-07 19:15:42 -0600
commit8aa967f32d8e7ca6da2d759bd49f0bb4ee2021b0 (patch)
treeafa341df2652e5f89ad88468e4245b8307714a75
parentc1f563b7e613da1c8bded39e6012348702d69201 (diff)
downloadLedger.py-8aa967f32d8e7ca6da2d759bd49f0bb4ee2021b0.tar.gz
Ledger.py-8aa967f32d8e7ca6da2d759bd49f0bb4ee2021b0.zip
Balance is now sorted!
Apparently it can only be sorted alphabetically. So I hard-coded it.
-rw-r--r--utils/balance.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/balance.py b/utils/balance.py
index c13dee8..750f998 100644
--- a/utils/balance.py
+++ b/utils/balance.py
@@ -51,6 +51,8 @@ class tree:
def __str__(self, level=0, ignore_level = False) -> str:
+ self.children.sort(key=lambda child: child.name)
+
result = ''
if not ignore_level:
for price in self.value:
@@ -89,6 +91,7 @@ class accounts_tree:
def __str__(self) -> str:
+ self.my_accounts.children.sort(key=lambda child: child.name)
self.my_accounts.compute_value()
result = ''