Add a section comparing earnings

This commit is contained in:
traxys 2023-12-09 18:09:55 +01:00
parent 09f35f84ea
commit afccfcfb56

View file

@ -43,6 +43,7 @@ pub(crate) enum Section {
Variable,
Accounts,
Remaining,
Earnings,
}
impl Section {
@ -52,6 +53,7 @@ impl Section {
Section::Variable => "Variable",
Section::Accounts => "Accounts",
Section::Remaining => "Remaining",
Section::Earnings => "Earnings",
}
}
}
@ -399,6 +401,14 @@ where
std::iter::once(("Main", main_account)).chain(s.savings())
}),
mk_section!(Section::Earnings, |s| {
let earnings = s.earnings();
[
(self.person_1, earnings.person_1),
(self.person_2, earnings.person_2),
]
}),
mk_section!(Section::Remaining, move |s| {
let contrib = s.contributions(self.archive);