Fix: Handle case if "pop_carry_over_start_time_range" and "pop_carry_over_end_time_range"

is not given in tariff file.
This commit is contained in:
Gerhard Hoffmann 2024-06-04 11:19:39 +02:00
parent 8737508839
commit 64b2b4bd85

View File

@ -689,6 +689,18 @@ CalcState Calculator::isParkingAllowedForWeekDay(Configuration const *cfg,
int const pop_carry_over_start_time_range = cfg->getPaymentOptions(paymentOptionIndex).pop_carry_over_start_time_range;
int const pop_carry_over_end_time_range = cfg->getPaymentOptions(paymentOptionIndex).pop_carry_over_end_time_range;
// qCritical() << DBG_HEADER
// << "pop_carry_over_start_time_range" << pop_carry_over_start_time_range
// << "pop_carry_over_end_time_range" << pop_carry_over_end_time_range;
if ((int)cfg->TimeRange.count(pop_carry_over_start_time_range) <= 0 &&
(int)cfg->TimeRange.count(pop_carry_over_end_time_range) <= 0) {
qCritical() << DBG_HEADER << "PARKING_ALLOWED. startTime" << startTime.toString(Qt::ISODate);
return CalcState(CalcState::State::SUCCESS, "PARKING_ALLOWED", startTime);
} else
// search entry in time-range-field of tariff-file
if (cfg->TimeRange.count(pop_carry_over_start_time_range) == 1 &&
cfg->TimeRange.count(pop_carry_over_end_time_range) == 1) {