From b17f77b22a8a579f52b5b2c8bbbe75a75178af33 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 15 Aug 2024 21:28:49 +0200 Subject: [PATCH] Add setting of max-price in case of degressive-tariff. + maxPrice = cfg->getPaymentOptions(paymentOptionIndex).pop_max_price; --- library/src/calculate_price.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/src/calculate_price.cpp b/library/src/calculate_price.cpp index 935b872..d43794a 100644 --- a/library/src/calculate_price.cpp +++ b/library/src/calculate_price.cpp @@ -327,6 +327,8 @@ int CALCULATE_LIBRARY_API get_maximal_parkingprice(Configuration *cfg, case PERMIT_TYPE::SHORT_TERM_PARKING: { // e.g. szeged (customer_281) if (paymentMethodId == PaymentMethod::Progressive || paymentMethodId == PaymentMethod::Steps) { maxPrice = Utilities::getMaximalParkingPrice(cfg, paymentMethodId); + } else if (paymentMethodId == PaymentMethod::Degressive) { + maxPrice = cfg->getPaymentOptions(paymentOptionIndex).pop_max_price; } else { // PaymentMethod::Linear -> e.g. szeged int const key = cfg->getPaymentOptions(paymentOptionIndex).pop_id; int const maxTime = cfg->getPaymentOptions(paymentOptionIndex).pop_max_time; // maxTime is given in minutes