From 894e23332fec2ed8ce02903688b4d79b1c90fee4 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 29 Jul 2024 17:32:15 +0200 Subject: [PATCH] compute option index using permit type. --- library/src/calculate_price.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/src/calculate_price.cpp b/library/src/calculate_price.cpp index ed5ebc9..cfd4c63 100644 --- a/library/src/calculate_price.cpp +++ b/library/src/calculate_price.cpp @@ -566,6 +566,7 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket( time_t end_parking_time, // netto time in minutes struct price_t *price, PermitType permitType) { // permitType maps to product + CalcState calcState; int const paymentOptionIndex = tariff->getPaymentOptionIndex(permitType.get()); @@ -633,7 +634,7 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket( { CalcState calcState; - int paymentOptionIndex = tariff->getPaymentOptionIndex(start_parking_time); + int paymentOptionIndex = tariff->getPaymentOptionIndex(permitType); double minMin = tariff->getPaymentOptions(paymentOptionIndex).pop_min_time; double maxMin = tariff->getPaymentOptions(paymentOptionIndex).pop_max_time; @@ -645,7 +646,8 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket( << " netto_parking_time: " << netto_parking_time << endl << " start + netto: " << start_parking_time.addSecs(netto_parking_time * 60) << endl << " minMin: " << minMin << endl - << " maxMin: " << maxMin; + << " maxMin: " << maxMin + << " permitType: " << permitType.toString(); if (netto_parking_time < 0) {