From a78c365924dda3ed2df69f5f7d01dd3151dcf63d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 16 Jun 2022 17:49:28 +0100 Subject: [PATCH] add list of not-submitted bugs --- src/budget_sync/budget_graph.py | 5 +++++ src/budget_sync/main.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/budget_sync/budget_graph.py b/src/budget_sync/budget_graph.py index 483f36e..de1bed8 100644 --- a/src/budget_sync/budget_graph.py +++ b/src/budget_sync/budget_graph.py @@ -235,6 +235,7 @@ class PaymentSummary: self.total_submitted = Money(0) self.submitted_date = None self.paid_date = None + self.not_submitted = [] summary_state = None for payment in self.payments: if summary_state is None: @@ -255,11 +256,15 @@ class PaymentSummary: self.total_paid += payment.amount else: assert payment.state is PayeeState.NotYetSubmitted + self.not_submitted.append(payment.node.bug.id) if summary_state is None: self.state = PaymentSummaryState.NotYetSubmitted else: self.state = summary_state + def get_not_submitted(self): + return self.not_submitted + def __repr__(self) -> str: return (f"PaymentSummary(total={self.total}, " f"total_paid={self.total_paid}, " diff --git a/src/budget_sync/main.py b/src/budget_sync/main.py index 6d587a2..b4c35c9 100644 --- a/src/budget_sync/main.py +++ b/src/budget_sync/main.py @@ -71,6 +71,9 @@ def summarize_milestones(budget_graph: BudgetGraph): print(f"{milestone.identifier}") print(f"\t{summary.total} submitted: " f"{summary.total_submitted} paid: {summary.total_paid}") + not_submitted = summary.get_not_submitted() + if not_submitted: + print ("not submitted", not_submitted) # and one to display people for person in budget_graph.milestone_people[milestone]: -- 2.30.2