check it ticket-end-time hits carry-over-start. if configured, move to end of carry-over.

This commit is contained in:
Gerhard Hoffmann 2024-09-16 16:56:48 +02:00
parent 38abc65425
commit 932d4e8cb9

View File

@ -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) {