diff --git a/library/src/calculator_functions.cpp b/library/src/calculator_functions.cpp index 1725d9f..1de18f6 100644 --- a/library/src/calculator_functions.cpp +++ b/library/src/calculator_functions.cpp @@ -554,22 +554,22 @@ Calculator::ComputeDurationFromCost(Configuration *cfg, .arg(netto_parking_time_in_minutes) .arg(free_parking_time_in_minutes); - if (std::optional co = getCarryOver(cfg, inputDate.addSecs(brutto_parking_time_in_minutes * 60))) { + if (std::optional co = getCarryOver(cfg, dt)) { TimeRange const &carryOverTimeRange = co.value().m_range; free_parking_time_in_minutes += carryOverTimeRange.m_duration; + + brutto_parking_time_in_minutes = free_parking_time_in_minutes + netto_parking_time_in_minutes; + dt = inputDate.addSecs(brutto_parking_time_in_minutes * 60); + weekDay = dt.date().dayOfWeek(); + + qCritical() << __func__ << ":" << __LINE__ << QString("%1 (%2): brutto: %3 = netto: %4 + free: %5") + .arg(dt.toString(Qt::ISODate)) + .arg(weekDay) + .arg(brutto_parking_time_in_minutes) + .arg(netto_parking_time_in_minutes) + .arg(free_parking_time_in_minutes); } - brutto_parking_time_in_minutes = free_parking_time_in_minutes + netto_parking_time_in_minutes; - dt = inputDate.addSecs(brutto_parking_time_in_minutes * 60); - weekDay = dt.date().dayOfWeek(); - - qCritical() << __func__ << ":" << __LINE__ << QString("%1 (%2): brutto: %3 = netto: %4 + free: %5") - .arg(dt.toString(Qt::ISODate)) - .arg(weekDay) - .arg(brutto_parking_time_in_minutes) - .arg(netto_parking_time_in_minutes) - .arg(free_parking_time_in_minutes); - if (std::optional serv = getService(cfg, dt)) { TimeRange const &serviceTimeRange = serv.value().m_range;