compute_price_for_parking_ticket():

Include opverpaid option in price-computation.
This commit is contained in:
Gerhard Hoffmann 2024-09-30 16:57:18 +02:00
parent ab3cdb32ae
commit 212c792b77

View File

@ -700,6 +700,8 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
paymentOptionIndex = tariff->getPaymentOptionIndex(permitType.get()); paymentOptionIndex = tariff->getPaymentOptionIndex(permitType.get());
} }
qCritical() << __func__ << ":" << __LINE__ << "pop_max_price" << tariff->getPaymentOptions(paymentOptionIndex).pop_max_price;
tariff->getPaymentOptions(paymentOptionIndex).pop_max_price tariff->getPaymentOptions(paymentOptionIndex).pop_max_price
= tariff->getPaymentOptions(paymentOptionIndex).pop_max_price_save; = tariff->getPaymentOptions(paymentOptionIndex).pop_max_price_save;
@ -982,7 +984,9 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
Calculator::GetInstance().ComputeCostFromDuration(tariff, start_parking_time, end_parking_time, netto_parking_time); Calculator::GetInstance().ComputeCostFromDuration(tariff, start_parking_time, end_parking_time, netto_parking_time);
CalcState const cs = p.first; CalcState const cs = p.first;
if ((cs.getStatus() == CalcState::State::SUCCESS || cs.getStatus() == CalcState::State::SUCCESS_MAXPRICE)) { if ((cs.getStatus() == CalcState::State::SUCCESS ||
cs.getStatus() == CalcState::State::SUCCESS_MAXPRICE ||
cs.getStatus() == CalcState::State::OVERPAID)) {
if (p.second.has_value()) { if (p.second.has_value()) {
cost = p.second.value(); cost = p.second.value();
} }