Add helper WorkDayId() for future use.

This commit is contained in:
Gerhard Hoffmann 2024-02-15 16:11:41 +01:00
parent 5ee978f14a
commit 92c3b7c97c
2 changed files with 6 additions and 2 deletions

View File

@ -79,6 +79,8 @@ namespace Utilities {
QTime SpecialDaysWorkTimeUntil(Configuration const *cfg, int specialDayId);
QTime WeekDaysWorkTimeFrom(std::multimap<int, ATBWeekDaysWorktime>::const_iterator itr);
QTime WeekDaysWorkTimeUntil(std::multimap<int, ATBWeekDaysWorktime>::const_iterator itr);
int WeekDayId(std::multimap<int, ATBWeekDaysWorktime>::const_iterator itr);
// PaymentRate GetPaymentRate(Configuration const *cfg, );
bool isCarryOverSet(Configuration const *cfg, PaymentMethod paymentMethodId);
bool isCarryOverNotSet(Configuration const *cfg, PaymentMethod paymentMethodId);
PaymentMethod getPaymentMethodId(Configuration const *cfg);

View File

@ -345,6 +345,10 @@ QTime Utilities::WeekDaysWorkTimeUntil(std::multimap<int, ATBWeekDaysWorktime>::
return QTime::fromString(itr->second.pwd_time_to.c_str(), Qt::ISODate);
}
int Utilities::WeekDayId(std::multimap<int, ATBWeekDaysWorktime>::const_iterator itr) {
return itr->second.pwd_period_day_in_week_id;
}
bool Utilities::isCarryOverSet(Configuration const *cfg, PaymentMethod paymentMethodId) {
return !isCarryOverNotSet(cfg, paymentMethodId);
}
@ -406,8 +410,6 @@ uint32_t Utilities::getFirstDurationStep(Configuration const *cfg, PaymentMethod
BusinessHours Utilities::getBusinessHours(Configuration const *cfg, PaymentMethod methodId) {
int businessHours = cfg->PaymentOption.find(methodId)->second.pop_business_hours;
qCritical() << __func__ << ":" << __LINE__ << businessHours;
switch (businessHours) {
case NoRestriction_24_7: return BusinessHours::NoRestriction_24_7;
case OnlyWorkingDays: return BusinessHours::OnlyWorkingDays;