Moved check if netto minutes exceed max. parking time down into loop.
If this is the case, then stop updating the end-time-date.
This commit is contained in:
parent
38eca50d83
commit
9d713c894d
@ -707,10 +707,16 @@ Ticket Calculator::private_GetDurationFromCost(Configuration *cfg,
|
|||||||
if (!IsYearPeriodActive(cfg, current)) {
|
if (!IsYearPeriodActive(cfg, current)) {
|
||||||
return Ticket();
|
return Ticket();
|
||||||
}
|
}
|
||||||
if(durationMinutesNetto > maxParkingTimeMinutes) {
|
// if(durationMinutesNetto >= maxParkingTimeMinutes) {
|
||||||
durationMinutesNetto = maxParkingTimeMinutes;
|
// might be useful for overpayment
|
||||||
break;
|
// durationMinutesNetto = maxParkingTimeMinutes;
|
||||||
}
|
// int durationMinutesBrutto = start.secsTo(end) / 60;
|
||||||
|
//
|
||||||
|
// return
|
||||||
|
// Ticket(start, end, durationMinutesNetto,
|
||||||
|
// durationMinutesBrutto, cost, Ticket::s[INVALID_PRICE]);
|
||||||
|
//
|
||||||
|
// }
|
||||||
if(current.time() >= lastWorktimeTo) {
|
if(current.time() >= lastWorktimeTo) {
|
||||||
// Go to next day if minutes not spent
|
// Go to next day if minutes not spent
|
||||||
if (carryOverNotSet) {
|
if (carryOverNotSet) {
|
||||||
@ -726,7 +732,16 @@ Ticket Calculator::private_GetDurationFromCost(Configuration *cfg,
|
|||||||
moneyLeft -= price;
|
moneyLeft -= price;
|
||||||
moneyLeft = std::round(moneyLeft * 1000.0) / 1000.0;
|
moneyLeft = std::round(moneyLeft * 1000.0) / 1000.0;
|
||||||
current = current.addSecs(60);
|
current = current.addSecs(60);
|
||||||
|
|
||||||
|
//qCritical() << "moneyLeft" << moneyLeft
|
||||||
|
// << "durationMinutesNetto" << durationMinutesNetto
|
||||||
|
// << "current" << current.toString(Qt::ISODate);
|
||||||
|
|
||||||
|
if(durationMinutesNetto <= maxParkingTimeMinutes) {
|
||||||
|
// stop updating of end-date if parking time is
|
||||||
|
// overshot
|
||||||
end = current;
|
end = current;
|
||||||
|
}
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
} // while(durationMinutes > 0) {
|
} // while(durationMinutes > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user