Add case for BusinessHours::NoRestriction_24_7: used for Neuhauder-Christoph-Reisen

This commit is contained in:
Gerhard Hoffmann 2024-04-16 12:05:55 +02:00
parent 475487c2ce
commit cd159f2bbd

View File

@ -619,6 +619,10 @@ CalcState Calculator::isParkingAllowed(Configuration const *cfg, QDateTime const
if (paymentMethodId == PaymentMethod::Steps) { if (paymentMethodId == PaymentMethod::Steps) {
int const weekdayId = start.date().dayOfWeek(); int const weekdayId = start.date().dayOfWeek();
BusinessHours businessHours = Utilities::getBusinessHours(cfg, paymentMethodId); BusinessHours businessHours = Utilities::getBusinessHours(cfg, paymentMethodId);
if (businessHours == BusinessHours::NoRestriction_24_7) {
return CalcState(CalcState::State::SUCCESS, "PARKING_ALLOWED",
QTime(0, 0, 0), QTime(23, 59, 59));
} else
if (businessHours == BusinessHours::OnlyWeekDays) { if (businessHours == BusinessHours::OnlyWeekDays) {
if (weekdayId != (int)Qt::Saturday && weekdayId != (int)Qt::Sunday) { // e.g. Neuhauser, Linsinger Maschinenbau (741) if (weekdayId != (int)Qt::Saturday && weekdayId != (int)Qt::Sunday) { // e.g. Neuhauser, Linsinger Maschinenbau (741)
if (cfg->WeekDaysWorktime.count(weekdayId) > 0) { if (cfg->WeekDaysWorktime.count(weekdayId) > 0) {