home · contact · privacy
Fix brokenness of individual-Booking view.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 22 Jan 2025 12:09:09 +0000 (13:09 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 22 Jan 2025 12:09:09 +0000 (13:09 +0100)
ledger.py

index 51c722b4d48f351f3cf94232cd78c159961370e8..f2566bd072c3b40386897af635c9f352c32a16f4 100755 (executable)
--- a/ledger.py
+++ b/ledger.py
@@ -154,16 +154,15 @@ class Booking:
     # pylint: disable=too-few-public-methods
 
     def __init__(self, id_: int, dat_lines: list[DatLine]) -> None:
-        self.id_ = id_
         dat_lines[0].booking_line = IntroLine(self, dat_lines[0].code)
         intro_line = dat_lines[0].booking_line
         transfer_lines = []
         for dat_line in dat_lines[1:]:
             dat_line.booking_line = TransferLine(self, dat_line.code)
             transfer_lines += [dat_line.booking_line]
+        changes = Wealth()
         self.account_changes: dict[str, Wealth] = {}
         self.sink_account = None
-        changes = Wealth()
         for transfer_line in [tl for tl in transfer_lines if not tl.errors]:
             if transfer_line.account not in self.account_changes:
                 self.account_changes[transfer_line.account] = Wealth()
@@ -183,6 +182,8 @@ class Booking:
         for _ in [bl for bl in [intro_line] + transfer_lines if bl.errors]:
             self.questionable = True
             break
+        self.id_ = id_
+        self.dat_lines = dat_lines
 
 
 class Handler(PlomHttpHandler):