ComputeCostFromDuration():
Add price when overpaid occurred.
This commit is contained in:
parent
acbc27cfb2
commit
4f23ab3d68
@ -402,6 +402,9 @@ Calculator::ComputeDurationFromCost(Configuration *cfg,
|
||||
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,
|
||||
CalcState::OUTSIDE_ALLOWED_PARKING_TIME), dt);
|
||||
} else {
|
||||
@ -570,16 +573,17 @@ Calculator::ComputeCostFromDuration(Configuration *cfg, QDateTime const &startDa
|
||||
qCritical() << __func__ << ":" << __LINE__ << "result"
|
||||
<< r.first.toString() << r.second.toString(Qt::ISODate);
|
||||
|
||||
|
||||
returnState = r.first;
|
||||
endDatetime = r.second;
|
||||
|
||||
|
||||
if (returnState.getStatus() == CalcState::State::SUCCESS ||
|
||||
returnState.getStatus() == CalcState::State::SUCCESS_MAXPRICE) {
|
||||
|
||||
endDatetime = r.second;
|
||||
returnState.getStatus() == CalcState::State::SUCCESS_MAXPRICE ||
|
||||
returnState.getStatus() == CalcState::State::OVERPAID) {
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << "--- endDateTime" << endDatetime.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()) {
|
||||
cost = c;
|
||||
|
Loading…
Reference in New Issue
Block a user