home · contact · privacy
In booking balance, also show accounts of zero diff _if_ they've been directly set...
authorChristian Heller <c.heller@plomlompom.de>
Thu, 13 Feb 2025 02:19:18 +0000 (03:19 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 13 Feb 2025 02:19:18 +0000 (03:19 +0100)
src/run.py

index 17cc63b3a889853d24a02bc3ea9dad24f2adb901..bafb5bb8579e6c77e035f320d30e0ce9954ba124 100755 (executable)
@@ -469,10 +469,14 @@ class Handler(PlomHttpHandler):
                     continue
                 wealth_before = accounts_before[path].wealth
                 wealth_after = accounts_after[path].wealth
-                diff = {c: a for c, a in (wealth_after - wealth_before
-                                          ).moneys.items()
-                        if a != 0}
-                if diff:
+                directly_set = full_name == path
+                diff = {
+                    c: a for c, a in (wealth_after - wealth_before
+                                      ).moneys.items()
+                    if a != 0
+                    or (directly_set
+                        and c in booking.account_changes[full_name].moneys)}
+                if diff or directly_set:
                     displayed_currencies = set(diff.keys())
                     for wealth in wealth_before, wealth_after:
                         wealth.ensure_currencies(displayed_currencies)