Always reset pop_max_price to configured value.

This commit is contained in:
Gerhard Hoffmann 2024-09-30 16:58:23 +02:00
parent 212c792b77
commit 03dd6c44da

View File

@ -1036,6 +1036,10 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
double price, double price,
QString &duration, QString &duration,
PermitType permitType) { PermitType permitType) {
tariff->getPaymentOptions(0).pop_max_price
= tariff->getPaymentOptions(0).pop_max_price_save;
CalcState calcState; CalcState calcState;
QDate const d(1970, 1, 1); QDate const d(1970, 1, 1);
QTime const t(0, 0, 0); QTime const t(0, 0, 0);
@ -1091,6 +1095,9 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
QDateTime &ticketEndTime, QDateTime &ticketEndTime,
PermitType permitType) PermitType permitType)
{ {
tariff->getPaymentOptions(0).pop_max_price
= tariff->getPaymentOptions(0).pop_max_price_save;
CalcState calcState; CalcState calcState;
bool prepaid = true; bool prepaid = true;
@ -1418,6 +1425,9 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_daily_ticket(parking_tariff
QDateTime &ticketEndTime, QDateTime &ticketEndTime,
PermitType /* PermitType */) PermitType /* PermitType */)
{ {
tariff->getPaymentOptions(0).pop_max_price
= tariff->getPaymentOptions(0).pop_max_price_save;
CalcState calcState; CalcState calcState;
if (start_parking_time.isValid()) { if (start_parking_time.isValid()) {
@ -1449,8 +1459,11 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_daily_ticket(
QDateTime &endDatetime, QDateTime &endDatetime,
PERMIT_TYPE permitType, PERMIT_TYPE permitType,
struct price_t *price) {// return value 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 (startDatetime.isValid()) {
if (std::optional<struct price_t> p = if (std::optional<struct price_t> p =