ComputeDurationFromCost():

brutto-time must be updated in case of an carry-over-section.
This commit is contained in:
Gerhard Hoffmann 2024-10-02 15:21:21 +02:00
parent 5a77958e8d
commit 5a55ad6ef0

View File

@ -554,10 +554,9 @@ Calculator::ComputeDurationFromCost(Configuration *cfg,
.arg(netto_parking_time_in_minutes)
.arg(free_parking_time_in_minutes);
if (std::optional<ATBTariffCarryOver> co = getCarryOver(cfg, inputDate.addSecs(brutto_parking_time_in_minutes * 60))) {
if (std::optional<ATBTariffCarryOver> 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);
@ -569,6 +568,7 @@ Calculator::ComputeDurationFromCost(Configuration *cfg,
.arg(brutto_parking_time_in_minutes)
.arg(netto_parking_time_in_minutes)
.arg(free_parking_time_in_minutes);
}
if (std::optional<ATBTariffService> serv = getService(cfg, dt)) {
TimeRange const &serviceTimeRange = serv.value().m_range;