show halfprice for member fees if entry_year == current_year && start_date >= 1.7. Fixes #616 #629

Merged
philipp merged 2 commits from halfprice-fee into main 2024-07-22 21:59:39 +02:00
Showing only changes of commit b1252e8d5c - Show all commits

View File

@ -362,12 +362,16 @@ ASKÖ Ruderverein Donau Linz", self.name),
} }
let halfprice = if let Some(member_since_date) = &self.member_since_date { let halfprice = if let Some(member_since_date) = &self.member_since_date {
let member_since_date = if let Ok(member_since_date) = NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d")
NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d").unwrap(); {
let halfprice_startdate = NaiveDate::from_ymd_opt(Local::now().year(), 7, 1).unwrap(); let halfprice_startdate =
NaiveDate::from_ymd_opt(Local::now().year(), 7, 1).unwrap();
member_since_date >= halfprice_startdate member_since_date >= halfprice_startdate
} else { } else {
false false
}
} else {
false
}; };
if self.has_role(db, "Unterstützend").await { if self.has_role(db, "Unterstützend").await {