return OVERPAID in case overpay is not allowed
This commit is contained in:
		@@ -262,10 +262,14 @@ 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;
 | 
			
		||||
                    if (pop_allow_overpay == false) {
 | 
			
		||||
                        return CalcState::OVERPAID.toStdString();
 | 
			
		||||
                    }
 | 
			
		||||
                    cost = pop_max_price;
 | 
			
		||||
                    // return CalcState::OVERPAID.toStdString();
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user