From 08a249f3930a30ca0dbebe598ddd5ffe2d8ff1d9 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 21 Aug 2024 15:39:05 +0200 Subject: [PATCH] return OVERPAID in case overpay is not allowed --- library/src/calculator_functions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/src/calculator_functions.cpp b/library/src/calculator_functions.cpp index afe43fa..80731de 100644 --- a/library/src/calculator_functions.cpp +++ b/library/src/calculator_functions.cpp @@ -262,11 +262,15 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg, int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id; int const pop_max_price = cfg->getPaymentOptions(paymentOptionIndex).pop_max_price; int const pop_min_price = cfg->getPaymentOptions(paymentOptionIndex).pop_min_price; + int const pop_allow_overpay = cfg->getPaymentOptions(paymentOptionIndex).pop_allow_overpay; if (cost > pop_max_price) { - cost = pop_max_price; qCritical() << DBG_HEADER << "MAX-PARKING-PRICE" << pop_max_price << ", COST" << cost; - //return CalcState::OVERPAID.toStdString(); + if (pop_allow_overpay == false) { + return CalcState::OVERPAID.toStdString(); + } + cost = pop_max_price; + // return CalcState::OVERPAID.toStdString(); } if (cost < pop_min_price) {