From: Christian Heller <c.heller@plomlompom.de>
Date: Thu, 13 Feb 2025 02:19:18 +0000 (+0100)
Subject: In booking balance, also show accounts of zero diff _if_ they've been directly set... 
X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/index.html?a=commitdiff_plain;h=fdf65ec16872859851f640ca8c9a30d395ea4a39;p=ledgplom

In booking balance, also show accounts of zero diff _if_ they've been directly set in the Booking.
---

diff --git a/src/run.py b/src/run.py
index 17cc63b..bafb5bb 100755
--- a/src/run.py
+++ b/src/run.py
@@ -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)