also total up paid / requested amounts
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 26 Apr 2021 13:34:37 +0000 (14:34 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 26 Apr 2021 13:34:37 +0000 (14:34 +0100)
src/budget_sync/main.py

index e18e07208473f6200edbfaebec6cd03284e5544a..ca9ce5137af3ea27fef40e555d12cf55f2357fa9 100644 (file)
@@ -40,12 +40,25 @@ def main():
     # quick hack to display total payment amounts per-milestone
     for milestone, payments in budget_graph.milestone_payments.items():
         print (milestone)
-        print ()
         total = 0
+        total_requested = 0
+        total_req_or_paid = 0
+        total_paid = 0
         for payment in payments:
             print("\t", payment)
             total += payment.amount
-        print ("\t", total)
+            if payment.submitted is not None:
+                total_requested += payment.amount
+            if payment.paid is not None:
+                total_paid += payment.amount
+            if payment.submitted or payment.paid is not None:
+                total_req_or_paid += payment.amount
+
+        print ("\t %-9s" % total,
+                "submitted %-9s" % total_requested,
+                "paid %-9s" % total_paid,
+                "submitted or paid %-9s" % total_req_or_paid)
+        print ()
 
 if __name__ == "__main__":
     main()