From 932d4e8cb92105f96f61fcfdcde54668db937e59 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 16 Sep 2024 16:56:48 +0200 Subject: [PATCH] check it ticket-end-time hits carry-over-start. if configured, move to end of carry-over. --- library/src/calculate_price.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/src/calculate_price.cpp b/library/src/calculate_price.cpp index 756a7b5..5dda024 100644 --- a/library/src/calculate_price.cpp +++ b/library/src/calculate_price.cpp @@ -1221,6 +1221,15 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket( if (ticketEndTime.time() > carryOverStart) { // qCritical() << __func__ << __LINE__ << "ticketEndTime.time():" << ticketEndTime.time().toString(Qt::ISODate); ticketEndTime = ticketEndTime.addSecs(carryOverDuration * 60); + } else + if (ticketEndTime.time() == carryOverStart) { + qCritical() << __func__ << __LINE__ << "ticketEndTime.time():" << ticketEndTime.time().toString(Qt::ISODate); + qCritical() << __func__ << ":" << __LINE__ << " carryOverStart" << carryOverStart.toString(Qt::ISODate); + ATBPaymentOption const &po = tariff->getPaymentOptions(paymentOptionIndex); + if (po.pop_apply_carry_over_to_ticket_endtime) { + ticketEndTime = ticketEndTime.addSecs(carryOverDuration * 60); + qCritical() << __func__ << __LINE__ << "ticketEndTime.time():" << ticketEndTime.time().toString(Qt::ISODate); + } } else { // qCritical() << __func__ << __LINE__ << "ticketEndTime.time():" << ticketEndTime.time().toString(Qt::ISODate); if (ticketEndTime.time() < carryOverEnd) {