ComputeCostFromDuration():

Add price when overpaid occurred.
This commit is contained in:
Gerhard Hoffmann 2024-09-30 16:53:25 +02:00
parent acbc27cfb2
commit 4f23ab3d68

View File

@ -402,6 +402,9 @@ Calculator::ComputeDurationFromCost(Configuration *cfg,
return std::make_pair(CalcState(CalcState::State::SUCCESS), dt); return std::make_pair(CalcState(CalcState::State::SUCCESS), dt);
} }
} }
qCritical() << __func__ << ":" << __LINE__ << "outside allowed parking time" << dt.toString(Qt::ISODate);
return std::make_pair(CalcState(CalcState::State::OUTSIDE_ALLOWED_PARKING_TIME, return std::make_pair(CalcState(CalcState::State::OUTSIDE_ALLOWED_PARKING_TIME,
CalcState::OUTSIDE_ALLOWED_PARKING_TIME), dt); CalcState::OUTSIDE_ALLOWED_PARKING_TIME), dt);
} else { } else {
@ -570,16 +573,17 @@ Calculator::ComputeCostFromDuration(Configuration *cfg, QDateTime const &startDa
qCritical() << __func__ << ":" << __LINE__ << "result" qCritical() << __func__ << ":" << __LINE__ << "result"
<< r.first.toString() << r.second.toString(Qt::ISODate); << r.first.toString() << r.second.toString(Qt::ISODate);
returnState = r.first; returnState = r.first;
endDatetime = r.second;
if (returnState.getStatus() == CalcState::State::SUCCESS || if (returnState.getStatus() == CalcState::State::SUCCESS ||
returnState.getStatus() == CalcState::State::SUCCESS_MAXPRICE) { returnState.getStatus() == CalcState::State::SUCCESS_MAXPRICE ||
returnState.getStatus() == CalcState::State::OVERPAID) {
endDatetime = r.second;
qCritical() << __func__ << ":" << __LINE__ << "--- endDateTime" << endDatetime.toString(Qt::ISODate); qCritical() << __func__ << ":" << __LINE__ << "--- endDateTime" << endDatetime.toString(Qt::ISODate);
qCritical() << __func__ << ":" << __LINE__ << "------ r.second" << r.second.toString(Qt::ISODate); qCritical() << __func__ << ":" << __LINE__ << "------ r.second" << r.second.toString(Qt::ISODate);
qCritical() << __func__ << ":" << __LINE__ << "status" << returnState.toString() << (int)returnState.getStatus();
if (!endDatetime.isNull() && endDatetime.isValid()) { if (!endDatetime.isNull() && endDatetime.isValid()) {
cost = c; cost = c;