compute_price_for_parking_ticket():

Reset pop_max_price to original value using pop_max_price_saved.
This commit is contained in:
Gerhard Hoffmann 2024-09-17 17:01:32 +02:00
parent 2ce0aeef1d
commit d8d32820a3

View File

@ -77,6 +77,7 @@ int CALCULATE_LIBRARY_API get_maximal_parkingtime(Configuration const *cfg,
if (paymentOptionIndex == -1) { if (paymentOptionIndex == -1) {
paymentOptionIndex = cfg->getPaymentOptionIndex(permitType); paymentOptionIndex = cfg->getPaymentOptionIndex(permitType);
} }
int maxTime = 0; int maxTime = 0;
switch(permitType) { switch(permitType) {
@ -683,6 +684,9 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
paymentOptionIndex = tariff->getPaymentOptionIndex(permitType.get()); paymentOptionIndex = tariff->getPaymentOptionIndex(permitType.get());
} }
tariff->getPaymentOptions(paymentOptionIndex).pop_max_price
= tariff->getPaymentOptions(paymentOptionIndex).pop_max_price_save;
double minMin = tariff->PaymentOption.find(tariff->getPaymentOptions(paymentOptionIndex).pop_payment_method_id)->second.pop_min_time; double minMin = tariff->PaymentOption.find(tariff->getPaymentOptions(paymentOptionIndex).pop_payment_method_id)->second.pop_min_time;
double maxMin = tariff->PaymentOption.find(tariff->getPaymentOptions(paymentOptionIndex).pop_payment_method_id)->second.pop_max_time; double maxMin = tariff->PaymentOption.find(tariff->getPaymentOptions(paymentOptionIndex).pop_payment_method_id)->second.pop_max_time;
@ -753,6 +757,9 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
paymentOptionIndex = tariff->getPaymentOptionIndex(permitType); paymentOptionIndex = tariff->getPaymentOptionIndex(permitType);
} }
tariff->getPaymentOptions(paymentOptionIndex).pop_max_price
= tariff->getPaymentOptions(paymentOptionIndex).pop_max_price_save;
double minMin = tariff->getPaymentOptions(paymentOptionIndex).pop_min_time; double minMin = tariff->getPaymentOptions(paymentOptionIndex).pop_min_time;
double maxMin = tariff->getPaymentOptions(paymentOptionIndex).pop_max_time; double maxMin = tariff->getPaymentOptions(paymentOptionIndex).pop_max_time;