[insight] Goals and rewards: a goal this month (its tank, what is needed, the pace, the split between its ways, where money could come from), medals and challenges from complete periods, the cancel letter in Czech
This commit is contained in:
@@ -149,7 +149,7 @@ pub fn analyse(state: &State, today: Date) -> Insight {
|
||||
let full: Vec<&EffectivePayment> = charges.iter().copied().filter(|p| cost(p) > TRIAL_MAX).collect();
|
||||
|
||||
// Trials: the last card check with no full charge after it, or a payment marked by hand.
|
||||
let last_check = charges.iter().filter(|p| cost(p) <= TRIAL_MAX).next_back();
|
||||
let last_check = charges.iter().rfind(|p| cost(p) <= TRIAL_MAX);
|
||||
for p in charges.iter().filter(|p| p.trial_ends.is_some() || Some(*p) == last_check) {
|
||||
let converted = full.iter().any(|f| f.date > p.date && f.id != p.id);
|
||||
let (ends, estimated) = match p.trial_ends {
|
||||
|
||||
Reference in New Issue
Block a user