diff --git a/library/src/calculator_functions.cpp b/library/src/calculator_functions.cpp index 6444af0..59474fa 100644 --- a/library/src/calculator_functions.cpp +++ b/library/src/calculator_functions.cpp @@ -135,14 +135,20 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg, static const PaymentMethod paymentMethodId = Utilities::getPaymentMethodId(cfg); int const paymentOptionIndex = cfg->getPaymentOptionIndex(permitType.get()); - qCritical() << DBG_HEADER << " start:" << inputDate.toString(Qt::ISODate); - qCritical() << DBG_HEADER << " option index:" << paymentOptionIndex; - qCritical() << DBG_HEADER << "paymentMethodId:" << static_cast(paymentMethodId); - qCritical() << DBG_HEADER << " prepaid:" << prepaid; - qCritical() << DBG_HEADER << " cost (price):" << cost; + if (DBG_LEVEL >= DBG_DEBUG) { + qCritical() << DBG_HEADER << " start:" << inputDate.toString(Qt::ISODate); + qCritical() << DBG_HEADER << " option index:" << paymentOptionIndex; + qCritical() << DBG_HEADER << "paymentMethodId:" << static_cast(paymentMethodId); + qCritical() << DBG_HEADER << " prepaid:" << prepaid; + qCritical() << DBG_HEADER << " cost (price):" << cost; + } QList tsteps = Calculator::GetInstance().GetTimeSteps(cfg, paymentOptionIndex, inputDate); - qCritical() << DBG_HEADER << " time steps:" << tsteps; + if (DBG_LEVEL >= DBG_DEBUG) { + qCritical() << DBG_HEADER << " time steps:" << tsteps; + } else { + Q_UNUSED(tsteps); + } if (paymentMethodId == PaymentMethod::Degressive) { @@ -287,6 +293,9 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg, QTime pwd_time_from = QTime::fromString(QString::fromStdString(iter->second.pwd_time_from), Qt::ISODate); QTime pwd_time_to = QTime::fromString(QString::fromStdString(iter->second.pwd_time_to), Qt::ISODate); + //qCritical() << DBG_HEADER << "from" << pwd_time_from.toString(Qt::ISODate); + //qCritical() << DBG_HEADER << " to" << pwd_time_to.toString(Qt::ISODate); + if (inputDate.time() < pwd_time_from) { inputDate.setTime(pwd_time_from); useWeekDaysWorkTimeOfOtherDay = false; @@ -465,6 +474,7 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg, QTime pwd_time_from = QTime::fromString(QString::fromStdString(iter->second.pwd_time_from), Qt::ISODate); if (next_working_time_from < pwd_time_from) { next_working_time_from = pwd_time_from; + qCritical() << DBG_HEADER << "next working time from" << next_working_time_from.toString(Qt::ISODate); break; } }