return OVERPAID in case overpay is not allowed

This commit is contained in:
Gerhard Hoffmann 2024-08-21 15:39:05 +02:00
parent 7c173ae292
commit 08a249f393

View File

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