From 4271c0fb318de9e3cc057429096582fc53efa0a8 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 2 Aug 2024 10:50:25 +0200 Subject: [PATCH] Fixed compute_next_timestep() for degressive tariff: compute_next_timestep() was actually never called for such a tariff. --- library/src/calculate_price.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/src/calculate_price.cpp b/library/src/calculate_price.cpp index 6aca26e..2165055 100644 --- a/library/src/calculate_price.cpp +++ b/library/src/calculate_price.cpp @@ -508,10 +508,12 @@ int CALCULATE_LIBRARY_API compute_next_timestep(parking_tariff_t *tariff, int cu // without given YearPeriod, SpecialDays and SpecialDaysWorktime if ((paymentMethodId == PaymentMethod::Steps) || // progressive tariff: e.g. Neuhauser, Kirchdorf (743) - (paymentMethodId == PaymentMethod::Progressive)) - // (paymentMethodId == PaymentMethod::Degressive)) degressive tariff: e.g. Fuchs Technik (500) + (paymentMethodId == PaymentMethod::Progressive) || + // degressive tariff: e.g. Fuchs Technik (500) + (paymentMethodId == PaymentMethod::Degressive)) { QList &stepList = Calculator::GetInstance().GetTimeSteps(tariff, paymentOptionIndex); + int const size = stepList.size(); if (size == 0) { qCritical() << "compute_next_timestep() *ERROR empty step-list*";