Add utilities

isDayIncluded(), SpecialDaysWorkTimeFrom() and specialDaysWorkTimeUntil().
This commit is contained in:
Gerhard Hoffmann 2024-04-19 13:19:26 +02:00
parent 1991853b66
commit 0cd4424434

View File

@ -15,6 +15,9 @@
using namespace std;
namespace Utilities {
bool isDayIncluded(uint64_t businessHours, QDateTime const &dt);
/// <summary>
/// Get day of week from current date (Zeller's Algorithm), starting day is Sunday
/// </summary>
@ -76,7 +79,9 @@ namespace Utilities {
double CalculatePricePerUnit(double pra_price, double durationUnit = -1);
QTime SpecialDaysWorkTimeFrom(Configuration const *cfg, int specialDayId);
QTime SpecialDaysWorkTimeFrom(Configuration::SpecialDaysWorktimeType::const_iterator it);
QTime SpecialDaysWorkTimeUntil(Configuration const *cfg, int specialDayId);
QTime SpecialDaysWorkTimeUntil(Configuration::SpecialDaysWorktimeType::const_iterator it);
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);
@ -94,4 +99,5 @@ namespace Utilities {
BusinessHours getBusinessHours(Configuration const *cfg, PaymentMethod methodId);
uint32_t computeWeekDaysPrice(Configuration const *cfg, PaymentMethod id);
double computeWeekDaysDurationUnit(Configuration const *cfg, PaymentMethod id);
QStringList dumpBusinessHours(uint64_t businessHours);
}