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:
parent
05f03a623b
commit
fa10ea4b89
@ -891,12 +891,14 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
end_parking_time,
|
end_parking_time,
|
||||||
paymentOptionIndex);
|
paymentOptionIndex);
|
||||||
if (parkTimeLimitViolated) {
|
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__)
|
calcState.setDesc(QString("line=%1 endTime=%2: park-time-limit violated").arg(__LINE__)
|
||||||
.arg(end_parking_time.time().toString(Qt::ISODate)));
|
.arg(end_parking_time.time().toString(Qt::ISODate)));
|
||||||
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
|
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cost = Calculator::GetInstance().GetCostFromDuration(
|
cost = Calculator::GetInstance().GetCostFromDuration(
|
||||||
tariff,
|
tariff,
|
||||||
@ -1181,6 +1183,9 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
|||||||
ticketEndTime,
|
ticketEndTime,
|
||||||
paymentOptionIndex);
|
paymentOptionIndex);
|
||||||
if (parkTimeLimitViolated) {
|
if (parkTimeLimitViolated) {
|
||||||
|
//QTime const &tlimit = wd.getTariffCarryOverSettings().parkingTimeLimit();
|
||||||
|
//ticketEndTime.setTime(tlimit);
|
||||||
|
|
||||||
calcState.setDesc(QString("line=%1 endTime=%2: park-time-limit violated").arg(__LINE__)
|
calcState.setDesc(QString("line=%1 endTime=%2: park-time-limit violated").arg(__LINE__)
|
||||||
.arg(ticketEndTime.time().toString(Qt::ISODate)));
|
.arg(ticketEndTime.time().toString(Qt::ISODate)));
|
||||||
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
|
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
|
||||||
|
Loading…
Reference in New Issue
Block a user