return OVERPAID in case overpay is not allowed
This commit is contained in:
parent
7c173ae292
commit
08a249f393
@ -262,11 +262,15 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
|
int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
|
||||||
int const pop_max_price = cfg->getPaymentOptions(paymentOptionIndex).pop_max_price;
|
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_min_price = cfg->getPaymentOptions(paymentOptionIndex).pop_min_price;
|
||||||
|
int const pop_allow_overpay = cfg->getPaymentOptions(paymentOptionIndex).pop_allow_overpay;
|
||||||
|
|
||||||
if (cost > pop_max_price) {
|
if (cost > pop_max_price) {
|
||||||
cost = pop_max_price;
|
|
||||||
qCritical() << DBG_HEADER << "MAX-PARKING-PRICE" << pop_max_price << ", COST" << cost;
|
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) {
|
if (cost < pop_min_price) {
|
||||||
|
Loading…
Reference in New Issue
Block a user