Fix 'approuve' button, add warning when break is not between day start and day end

This commit is contained in:
Aurélie Delhaie
2022-04-09 13:59:48 +02:00
parent 9bb56fe174
commit deb49909d1
11 changed files with 425 additions and 9 deletions

View File

@@ -84,6 +84,20 @@ QJsonObject Day::to_json()
return obj;
}
bool Day::has_warning()
{
bool warning = false;
foreach (BreakPoint val, breaks) {
if (val.getStart() < start) {
warning = true;
}
if (val.getEnd() > end) {
warning = true;
}
}
return warning;
}
Day* Day::from_json(QJsonObject obj)
{
Day *result = new Day();

View File

@@ -39,6 +39,7 @@ public:
float get_time_break();
void update(Day *);
QJsonObject to_json();
bool has_warning();
float get_total();