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) {