From: Luke Kenneth Casson Leighton Date: Mon, 26 Apr 2021 13:34:37 +0000 (+0100) Subject: also total up paid / requested amounts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b2429b50fbd7de7e23903b2110aa69725834e6b;p=utils.git also total up paid / requested amounts --- 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()