From 38abc654253923b7237eee5b1e6d864c31274871 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 16 Sep 2024 16:54:25 +0200 Subject: [PATCH] compute_price_for_parking_ticket(): Check if minutesUntilCarryOver is positive (usually must be). --- library/src/calculate_price.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/calculate_price.cpp b/library/src/calculate_price.cpp index d0ffdec..756a7b5 100644 --- a/library/src/calculate_price.cpp +++ b/library/src/calculate_price.cpp @@ -893,7 +893,7 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket( // handle carry over int minutesUntilCarryOver = effectiveStartTime.time().secsTo(carryOverStart) / 60; - if (netto_parking_time > minutesUntilCarryOver) { + if ((minutesUntilCarryOver > 0) && (netto_parking_time > minutesUntilCarryOver)) { int const rest = netto_parking_time - minutesUntilCarryOver; QDateTime s(effectiveStartTime); s = s.addSecs(minutesUntilCarryOver * 60);