Minor: more detailed debug output

This commit is contained in:
Gerhard Hoffmann 2024-02-01 13:18:27 +01:00
parent f7af631de6
commit 38eca50d83

View File

@ -674,13 +674,24 @@ Ticket Calculator::private_GetDurationFromCost(Configuration *cfg,
// Check prepaid
if (!prepaid) {
if ((current.time() < worktime_from) || (current.time() > worktime_to)) {
qDebug() << "[STOP] * Ticket is not valid * ";
if (current.time() < worktime_from) {
qDebug() << "[STOP] TICKET IS NOT VALID: "
<< QString("%1 (current) < %2 (start)")
.arg(current.toString(Qt::ISODate)
.arg(worktime_from.toString(Qt::ISODate)));
return Ticket();
} else
if (current.time() > worktime_to) {
qDebug() << "[STOP] TICKET IS NOT VALID: "
<< QString("%1 (current) > %2 (end)")
.arg(current.toString(Qt::ISODate)
.arg(worktime_to.toString(Qt::ISODate)));
return Ticket();
}
} else {
qDebug() << "* PREPAID MODE ACTIVE *";
if (current.time() < worktime_from) {
qDebug() << "*** PREPAID *** Current time is before time range start, fast-forward to start"
<< worktime_from.toString(Qt::ISODate);
current.setTime(worktime_from);
end = current;
} else if(current.time() > lastWorktimeTo) {