compute_price_for_parking_ticket():

In case parking-time-limit is violated, return with an error.

	Commented out: use another possiblity: cut max-parking-time
	so that parking-time-limit is not violated.
This commit is contained in:
Gerhard Hoffmann 2024-09-11 11:49:31 +02:00
parent 05f03a623b
commit fa10ea4b89

View File

@ -891,12 +891,14 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
end_parking_time,
paymentOptionIndex);
if (parkTimeLimitViolated) {
//QTime const &tlimit = wd.getTariffCarryOverSettings().parkingTimeLimit();
//end_parking_time.setTime(tlimit);
calcState.setDesc(QString("line=%1 endTime=%2: park-time-limit violated").arg(__LINE__)
.arg(end_parking_time.time().toString(Qt::ISODate)));
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
}
}
} else {
cost = Calculator::GetInstance().GetCostFromDuration(
tariff,
@ -1181,6 +1183,9 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
ticketEndTime,
paymentOptionIndex);
if (parkTimeLimitViolated) {
//QTime const &tlimit = wd.getTariffCarryOverSettings().parkingTimeLimit();
//ticketEndTime.setTime(tlimit);
calcState.setDesc(QString("line=%1 endTime=%2: park-time-limit violated").arg(__LINE__)
.arg(ticketEndTime.time().toString(Qt::ISODate)));
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);