From 03dd6c44da1dd0c7465448146ec56324a1f1b6de Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 30 Sep 2024 16:58:23 +0200 Subject: [PATCH] Always reset pop_max_price to configured value. --- library/src/calculate_price.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/library/src/calculate_price.cpp b/library/src/calculate_price.cpp index 0201600..7f30d97 100644 --- a/library/src/calculate_price.cpp +++ b/library/src/calculate_price.cpp @@ -1036,6 +1036,10 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket( double price, QString &duration, PermitType permitType) { + + tariff->getPaymentOptions(0).pop_max_price + = tariff->getPaymentOptions(0).pop_max_price_save; + CalcState calcState; QDate const d(1970, 1, 1); QTime const t(0, 0, 0); @@ -1091,6 +1095,9 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket( QDateTime &ticketEndTime, PermitType permitType) { + tariff->getPaymentOptions(0).pop_max_price + = tariff->getPaymentOptions(0).pop_max_price_save; + CalcState calcState; bool prepaid = true; @@ -1418,6 +1425,9 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_daily_ticket(parking_tariff QDateTime &ticketEndTime, PermitType /* PermitType */) { + tariff->getPaymentOptions(0).pop_max_price + = tariff->getPaymentOptions(0).pop_max_price_save; + CalcState calcState; if (start_parking_time.isValid()) { @@ -1449,8 +1459,11 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_daily_ticket( QDateTime &endDatetime, PERMIT_TYPE permitType, struct price_t *price) {// return value - CalcState calcState; + tariff->getPaymentOptions(0).pop_max_price + = tariff->getPaymentOptions(0).pop_max_price_save; + + CalcState calcState; if (startDatetime.isValid()) { if (std::optional p =