From 2b2429b50fbd7de7e23903b2110aa69725834e6b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 26 Apr 2021 14:34:37 +0100 Subject: [PATCH] also total up paid / requested amounts --- src/budget_sync/main.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/budget_sync/main.py b/src/budget_sync/main.py index e18e072..ca9ce51 100644 --- a/src/budget_sync/main.py +++ b/src/budget_sync/main.py @@ -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() -- 2.30.2