GetTimeSteps():
Fix: check not only if "current" is above carryOverStart, but also if "current" is below carryOverEnd.
This commit is contained in:
parent
84e2530767
commit
648799629a
@ -2893,12 +2893,13 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
||||
|
||||
int const durationInSecs = it->second.pun_duration_saved * 60;
|
||||
it->second.pun_duration = it->second.pun_duration_saved;
|
||||
if (current >= carryOverStart) {
|
||||
|
||||
if (current >= carryOverStart && current < carryOverEnd) {
|
||||
it->second.pun_duration += current.secsTo(carryOverEnd) / 60;
|
||||
} else {
|
||||
// start < carryOverStart
|
||||
QDateTime const &newCurrent = current.addSecs(durationInSecs);
|
||||
if (newCurrent > carryOverStart) {
|
||||
if (newCurrent > carryOverStart && newCurrent <= carryOverEnd) {
|
||||
// cross carry over section
|
||||
it->second.pun_next_step_correction = carryOverStart.secsTo(carryOverEnd) / 60;
|
||||
it->second.pun_duration += it->second.pun_next_step_correction;
|
||||
|
Loading…
Reference in New Issue
Block a user