write_display_status_chunk(display_status)
for payee_state in PayeeState:
+ # work out headers per status
if payee_state == PayeeState.NotYetSubmitted:
display_status_header = "\n## Payment not yet submitted\n"
- subtotals_header = ("\n#### MoU Milestone subtotals for not "
+ subtotals_header = ("\nMoU Milestone subtotals for not "
"yet submitted payments\n")
elif payee_state == PayeeState.Submitted:
display_status_header = ("\n## Submitted to NLNet but "
"not yet paid\n")
- subtotals_header = ("\n#### MoU Milestone subtotals for "
+ subtotals_header = ("\nMoU Milestone subtotals for "
"submitted but not yet paid payments\n")
else:
assert payee_state == PayeeState.Paid
display_status_header = "\n## Paid by NLNet\n"
- subtotals_header = ("\n#### MoU Milestone subtotals for paid "
+ subtotals_header = ("\nMoU Milestone subtotals for paid "
"payments\n")
+ # list all the payments grouped by Grant
for milestone, payments_list in payments_dict.items():
milestone_header = f"\n### {milestone.identifier}\n"
mou_subtotals: Dict[Optional[Node], Money] = defaultdict(Money)
headers = [status_tracking_header,
display_status_header,
milestone_header]
+ # write out the payments and also compute the subtotals per
+ # mou milestone
for payment in payments_list:
node = payment.node
if payment.state == payee_state and node_included(node):
writer.write_node(headers=headers,
node=payment.node, payment=payment)
headers.append(subtotals_header)
+ # now display the mou subtotals. really, this should be before
for node, subtotal in mou_subtotals.items():
writer.write_node_header(headers, node)
if node is None: