Compare commits
No commits in common. "dffc6e2a03ec3a6a2bb84a15ef3ef31e1230a218" and "7a53a688506d4e17a0a9ed0fa3b1ed5e9dea6593" have entirely different histories.
dffc6e2a03
...
7a53a68850
@ -44,7 +44,6 @@ public:
|
||||
pop_plus_steps_saved = 1;
|
||||
pop_minus_steps = 1; // -: jump <x=1> steps backward
|
||||
pop_allow_overpay = false;
|
||||
pop_apply_carry_over_to_ticket_endtime = false;
|
||||
}
|
||||
|
||||
int pop_id;
|
||||
@ -78,7 +77,6 @@ public:
|
||||
int pop_plus_steps_saved;
|
||||
int pop_minus_steps;
|
||||
bool pop_allow_overpay;
|
||||
bool pop_apply_carry_over_to_ticket_endtime;
|
||||
|
||||
struct ATBMaxDateTime {
|
||||
int direction;
|
||||
|
@ -15,19 +15,6 @@ struct ATBCarryOver {
|
||||
|
||||
int id;
|
||||
|
||||
explicit ATBCarryOver()
|
||||
: id(-1) {
|
||||
|
||||
for (int i = 0 ; i < 8; ++i) {
|
||||
carryover[i].day = -1;
|
||||
carryover[i].seemless = false;
|
||||
carryover[i].never = false;
|
||||
carryover[i].static_start = QTime(23, 59, 59);
|
||||
carryover[i].static_end = QTime(0, 0, 0);
|
||||
carryover[i].duration = -1;
|
||||
}
|
||||
}
|
||||
|
||||
friend QDebug operator<<(QDebug debug, ATBCarryOver const &co) {
|
||||
QDebugStateSaver saver(debug);
|
||||
|
||||
@ -44,21 +31,21 @@ struct ATBCarryOver {
|
||||
<< " day: " << co.carryover[(int)Qt::Tuesday].day << "\n"
|
||||
<< " static_start: " << co.carryover[(int)Qt::Tuesday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << co.carryover[(int)Qt::Tuesday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Tuesday].duration << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n"
|
||||
<< " anytime: " << co.carryover[(int)Qt::Tuesday].seemless << "\n"
|
||||
<< " never: " << co.carryover[(int)Qt::Tuesday].never << "\n"
|
||||
<< " **** Wednesday **** \n"
|
||||
<< " day: " << co.carryover[(int)Qt::Wednesday].day << "\n"
|
||||
<< " static_start: " << co.carryover[(int)Qt::Wednesday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << co.carryover[(int)Qt::Wednesday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Wednesday].duration << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n"
|
||||
<< " anytime: " << co.carryover[(int)Qt::Wednesday].seemless << "\n"
|
||||
<< " never: " << co.carryover[(int)Qt::Wednesday].never << "\n"
|
||||
<< " **** Thursday **** \n"
|
||||
<< " day: " << co.carryover[(int)Qt::Thursday].day << "\n"
|
||||
<< " static_start: " << co.carryover[(int)Qt::Thursday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << co.carryover[(int)Qt::Thursday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Thursday].duration << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n"
|
||||
<< " anytime: " << co.carryover[(int)Qt::Thursday].seemless << "\n"
|
||||
<< " never: " << co.carryover[(int)Qt::Thursday].never << "\n"
|
||||
<< " **** Friday **** \n"
|
||||
@ -71,14 +58,14 @@ struct ATBCarryOver {
|
||||
<< " day: " << co.carryover[(int)Qt::Saturday].day << "\n"
|
||||
<< " static_start: " << co.carryover[(int)Qt::Saturday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << co.carryover[(int)Qt::Saturday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Saturday].duration << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n"
|
||||
<< " anytime: " << co.carryover[(int)Qt::Saturday].seemless << "\n"
|
||||
<< " never: " << co.carryover[(int)Qt::Saturday].never << "\n"
|
||||
<< " **** Sunday **** \n"
|
||||
<< " day: " << co.carryover[(int)Qt::Sunday].day << "\n"
|
||||
<< " static_start: " << co.carryover[(int)Qt::Sunday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << co.carryover[(int)Qt::Sunday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Sunday].duration << "\n"
|
||||
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n"
|
||||
<< " anytime: " << co.carryover[(int)Qt::Sunday].seemless << "\n"
|
||||
<< " never: " << co.carryover[(int)Qt::Sunday].never << "\n";
|
||||
|
||||
|
@ -50,9 +50,6 @@ struct ATBTariffCarryOverSettings {
|
||||
return m_parkingTimeLimitChecker(*this, startTime, endTime, paymentOptionIndex);
|
||||
}
|
||||
|
||||
QTime const &parkingTimeLimit() const { return m_parking_time_limit; }
|
||||
QTime &parkingTimeLimit() { return m_parking_time_limit; }
|
||||
|
||||
friend QDebug operator<<(QDebug debug, ATBTariffCarryOverSettings const &co) {
|
||||
QDebugStateSaver saver(debug);
|
||||
|
||||
|
@ -5,34 +5,13 @@
|
||||
#include <QString>
|
||||
|
||||
struct ATBPrepaid {
|
||||
explicit ATBPrepaid() = default;
|
||||
int id;
|
||||
bool anytime;
|
||||
bool never;
|
||||
QTime static_start;
|
||||
QTime static_end;
|
||||
|
||||
struct week {
|
||||
int day;
|
||||
QTime static_start;
|
||||
QTime static_end;
|
||||
int duration;
|
||||
} prepaid[8];
|
||||
|
||||
explicit ATBPrepaid()
|
||||
: id(-1)
|
||||
, anytime(false)
|
||||
, never(false)
|
||||
, static_start(QTime(23, 59, 59))
|
||||
, static_end(QTime(0, 0, 0)) {
|
||||
|
||||
for (int i = 0 ; i < 8; ++i) {
|
||||
prepaid[i].day = -1;
|
||||
prepaid[i].static_start = QTime(23, 59, 59);
|
||||
prepaid[i].static_end = QTime(0, 0, 0);
|
||||
prepaid[i].duration = -1;
|
||||
}
|
||||
}
|
||||
|
||||
friend QDebug operator<<(QDebug debug, ATBPrepaid const &pp) {
|
||||
QDebugStateSaver saver(debug);
|
||||
|
||||
@ -41,41 +20,7 @@ struct ATBPrepaid {
|
||||
<< " static_start: " << pp.static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " anytime: " << pp.anytime << "\n"
|
||||
<< " never: " << pp.never << "\n"
|
||||
<< " **** Monday **** \n"
|
||||
<< " day: " << pp.prepaid[(int)Qt::Monday].day << "\n"
|
||||
<< " static_start: " << pp.prepaid[(int)Qt::Monday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.prepaid[(int)Qt::Monday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << pp.prepaid[(int)Qt::Monday].duration << "\n"
|
||||
<< " **** Tuesday **** \n"
|
||||
<< " day: " << pp.prepaid[(int)Qt::Tuesday].day << "\n"
|
||||
<< " static_start: " << pp.prepaid[(int)Qt::Tuesday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.prepaid[(int)Qt::Tuesday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << pp.prepaid[(int)Qt::Tuesday].duration << "\n"
|
||||
<< " **** Wednesday **** \n"
|
||||
<< " day: " << pp.prepaid[(int)Qt::Wednesday].day << "\n"
|
||||
<< " static_start: " << pp.prepaid[(int)Qt::Wednesday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.prepaid[(int)Qt::Wednesday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << pp.prepaid[(int)Qt::Wednesday].duration << "\n"
|
||||
<< " **** Thursday **** \n"
|
||||
<< " day: " << pp.prepaid[(int)Qt::Thursday].day << "\n"
|
||||
<< " static_start: " << pp.prepaid[(int)Qt::Thursday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.prepaid[(int)Qt::Thursday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << pp.prepaid[(int)Qt::Thursday].duration << "\n"
|
||||
<< " **** Friday **** \n"
|
||||
<< " day: " << pp.prepaid[(int)Qt::Friday].day << "\n"
|
||||
<< " static_start: " << pp.prepaid[(int)Qt::Friday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.prepaid[(int)Qt::Friday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " **** Saturday **** \n"
|
||||
<< " day: " << pp.prepaid[(int)Qt::Saturday].day << "\n"
|
||||
<< " static_start: " << pp.prepaid[(int)Qt::Saturday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.prepaid[(int)Qt::Saturday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << pp.prepaid[(int)Qt::Saturday].duration << "\n"
|
||||
<< " **** Sunday **** \n"
|
||||
<< " day: " << pp.prepaid[(int)Qt::Sunday].day << "\n"
|
||||
<< " static_start: " << pp.prepaid[(int)Qt::Sunday].static_start.toString(Qt::ISODate) << "\n"
|
||||
<< " static_end: " << pp.prepaid[(int)Qt::Sunday].static_end.toString(Qt::ISODate) << "\n"
|
||||
<< " duration: " << pp.prepaid[(int)Qt::Sunday].duration << "\n";
|
||||
<< " never: " << pp.never << "\n";
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
@ -337,9 +337,7 @@ int CALCULATE_LIBRARY_API get_maximal_parkingprice(Configuration *cfg,
|
||||
switch(permitType) {
|
||||
case PERMIT_TYPE::SHORT_TERM_PARKING: { // e.g. szeged (customer_281)
|
||||
if (paymentMethodId == PaymentMethod::Progressive || paymentMethodId == PaymentMethod::Steps) {
|
||||
//maxPrice = Utilities::getMaximalParkingPrice(cfg, paymentMethodId);
|
||||
ATBPaymentOption const &po = cfg->getPaymentOptions(paymentOptionIndex);
|
||||
maxPrice = po.pop_max_price; // maxTime is given in minutes
|
||||
maxPrice = Utilities::getMaximalParkingPrice(cfg, paymentMethodId);
|
||||
} else { // PaymentMethod::Linear -> e.g. szeged
|
||||
int const key = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
|
||||
int const maxTime = cfg->getPaymentOptions(paymentOptionIndex).pop_max_time; // maxTime is given in minutes
|
||||
@ -805,22 +803,20 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
|
||||
int weekDay = start_parking_time.date().dayOfWeek();
|
||||
int pop_carry_over_option_id = tariff->getPaymentOptions(paymentOptionIndex).pop_carry_over_option_id;
|
||||
int pop_prepaid_option_id = tariff->getPaymentOptions(paymentOptionIndex).pop_prepaid_option_id;
|
||||
qCritical() << __func__ << __LINE__ << "configured carry-over-id" << pop_carry_over_option_id;
|
||||
|
||||
std::optional<ATBPeriodYear> yperiod = Utilities::GetYearPeriodActive(tariff, start_parking_time);
|
||||
if (yperiod.has_value()) {
|
||||
ATBPeriodYear const &period = yperiod.value();
|
||||
pop_carry_over_option_id = period.pye_id;
|
||||
pop_prepaid_option_id = period.pye_id;
|
||||
qCritical() << __func__ << ":" << __LINE__ << "re-computed carry-over-id" << pop_carry_over_option_id;
|
||||
qCritical() << __func__ << ":" << __LINE__ << " re-computed prepaid-id" << pop_prepaid_option_id;
|
||||
qCritical() << __func__ << __LINE__ << "re-computed carry-over-id" << pop_carry_over_option_id;
|
||||
}
|
||||
|
||||
QTime carryOverStart = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_start;
|
||||
int carryOverDuration = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].duration;
|
||||
QTime const carryOverStart = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_start;
|
||||
int const carryOverDuration = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].duration;
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << " carryOverStart" << carryOverStart.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << ":" << __LINE__ << "carryOverDuration" << carryOverDuration;
|
||||
qCritical() << __func__ << __LINE__ << "carryOverStart" << carryOverStart.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << __LINE__ << "carryOverDuration" << carryOverDuration;
|
||||
|
||||
// handle prepaid option
|
||||
QDateTime effectiveStartTime(start_parking_time);
|
||||
@ -829,23 +825,17 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
if (prepaidOption.has_value()) {
|
||||
ATBPrepaid const &p = prepaidOption.value();
|
||||
if (p.never) {
|
||||
qCritical() << __func__ << ":" << __LINE__ << "prepaid: no";
|
||||
qCritical() << __func__ << __LINE__ << "prepaid: no";
|
||||
} else {
|
||||
qCritical() << __func__ << ":" << __LINE__ << " prepaidStart" << p.prepaid[weekDay].static_start.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << ":" << __LINE__ << " prepaidEnd" << p.prepaid[weekDay].static_end.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << ":" << __LINE__ << "prepaid duration" << p.prepaid[weekDay].duration;
|
||||
|
||||
if (start_parking_time.time() < p.prepaid[weekDay].static_end) { // static_end: e.g. 08:00:00
|
||||
effectiveStartTime.setTime(p.prepaid[weekDay].static_end);
|
||||
if (start_parking_time.time() < p.static_end) { // static_end: e.g. 08:00:00
|
||||
effectiveStartTime.setTime(p.static_end);
|
||||
} else
|
||||
if (start_parking_time.time() > p.prepaid[weekDay].static_start) { // static_start: e.g. 22:00:00
|
||||
effectiveStartTime.setTime(p.prepaid[weekDay].static_start);
|
||||
if (start_parking_time.time() > p.static_start) { // static_start: e.g. 22:00:00
|
||||
effectiveStartTime.setTime(p.static_start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << "effectiveStartTime:" << effectiveStartTime.toString(Qt::ISODate);
|
||||
|
||||
// handle carry over
|
||||
int minutesUntilCarryOver = effectiveStartTime.time().secsTo(carryOverStart) / 60;
|
||||
if (netto_parking_time > minutesUntilCarryOver) {
|
||||
@ -858,32 +848,13 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
end_parking_time = effectiveStartTime.addSecs(netto_parking_time*60);
|
||||
}
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << "end-parking-time:" << end_parking_time.toString(Qt::ISODate);
|
||||
|
||||
weekDay = end_parking_time.date().dayOfWeek();
|
||||
|
||||
// musste man in einer schleife machen
|
||||
carryOverStart = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_start;
|
||||
carryOverDuration = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].duration;
|
||||
|
||||
if (end_parking_time.time() > carryOverStart) {
|
||||
end_parking_time = end_parking_time.addSecs(carryOverDuration * 60);
|
||||
} else
|
||||
if (end_parking_time.time() == carryOverStart) {
|
||||
qCritical() << __func__ << ":" << __LINE__ << "end-parking-time:" << end_parking_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) {
|
||||
end_parking_time = end_parking_time.addSecs(carryOverDuration * 60);
|
||||
qCritical() << __func__ << ":" << __LINE__ << "end-parking-time:" << end_parking_time.toString(Qt::ISODate);
|
||||
}
|
||||
}
|
||||
|
||||
end_parking_time.setTime(QTime(end_parking_time.time().hour(),
|
||||
end_parking_time.time().minute(), 0));
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << "end-parking-time:" << end_parking_time.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << ":" << __LINE__ << " week-day:" << weekDay;
|
||||
|
||||
weekDay = end_parking_time.date().dayOfWeek();
|
||||
|
||||
for (auto[itr, rangeEnd] = tariff->WeekDays.equal_range((Qt::DayOfWeek)weekDay); itr != rangeEnd; ++itr) {
|
||||
ATBWeekDay const &wd = itr->second;
|
||||
@ -891,14 +862,12 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
end_parking_time,
|
||||
paymentOptionIndex);
|
||||
if (parkTimeLimitViolated) {
|
||||
//QTime const &tlimit = wd.getTariffCarryOverSettings().parkingTimeLimit();
|
||||
//end_parking_time.setTime(tlimit);
|
||||
|
||||
calcState.setDesc(QString("line=%1 endTime=%2: park-time-limit violated").arg(__LINE__)
|
||||
.arg(end_parking_time.time().toString(Qt::ISODate)));
|
||||
.arg(end_parking_time.time().toString(Qt::ISODate)));
|
||||
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
cost = Calculator::GetInstance().GetCostFromDuration(
|
||||
tariff,
|
||||
@ -1183,9 +1152,6 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
ticketEndTime,
|
||||
paymentOptionIndex);
|
||||
if (parkTimeLimitViolated) {
|
||||
//QTime const &tlimit = wd.getTariffCarryOverSettings().parkingTimeLimit();
|
||||
//ticketEndTime.setTime(tlimit);
|
||||
|
||||
calcState.setDesc(QString("line=%1 endTime=%2: park-time-limit violated").arg(__LINE__)
|
||||
.arg(ticketEndTime.time().toString(Qt::ISODate)));
|
||||
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
|
||||
|
@ -591,49 +591,6 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
QTime const &t = QTime::fromString(k->value.GetString(), Qt::ISODate);
|
||||
TariffPrepaidOption.static_end = t;
|
||||
}
|
||||
} else
|
||||
if (QString(inner_obj_name) == QString("prepaid_week")) {
|
||||
if (k->value.IsArray()) {
|
||||
auto days = k->value.GetArray();
|
||||
for (rapidjson::SizeType j=0; j < days.Size(); ++j) {
|
||||
if (days[j].IsObject()) {
|
||||
auto weekday = days[j].GetObject();
|
||||
for (auto w = weekday.MemberBegin(); w != weekday.MemberEnd(); ++w) {
|
||||
int day = j+1; // 8 entries
|
||||
|
||||
TariffPrepaidOption.prepaid[day].day = 0;
|
||||
|
||||
QString member(QString::fromStdString(w->name.GetString()));
|
||||
if (member == "prepaid_day") {
|
||||
if (w->value.IsInt()) {
|
||||
rapidjson::SizeType const d = w->value.GetInt();
|
||||
if (d != (j+1)) {
|
||||
qCritical() << "ERROR: misconfigured jsonfile" << d << "!=" << (j+1);
|
||||
}
|
||||
TariffPrepaidOption.prepaid[day].day = day;
|
||||
}
|
||||
} else
|
||||
if (member == "prepaid_duration") {
|
||||
if (w->value.IsInt()) {
|
||||
TariffPrepaidOption.prepaid[day].duration = w->value.GetInt();
|
||||
}
|
||||
} else
|
||||
if (member == "prepaid_static_start") {
|
||||
if (w->value.IsString()) {
|
||||
QTime const &t = QTime::fromString(w->value.GetString(), Qt::ISODate);
|
||||
TariffPrepaidOption.prepaid[day].static_start = t;
|
||||
}
|
||||
} else
|
||||
if (member == "prepaid_static_end") {
|
||||
if (w->value.IsString()) {
|
||||
QTime const &t = QTime::fromString(w->value.GetString(), Qt::ISODate);
|
||||
TariffPrepaidOption.prepaid[day].static_end = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case MemberType::InterpolationType: {
|
||||
@ -984,10 +941,6 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
if (k->value.IsBool()) {
|
||||
this->currentPaymentOptions.last().pop_allow_overpay = k->value.GetBool();
|
||||
}
|
||||
} else if (strcmp(inner_obj_name, "pop_apply_carry_over_to_ticket_endtime") == 0) {
|
||||
if (k->value.IsBool()) {
|
||||
this->currentPaymentOptions.last().pop_apply_carry_over_to_ticket_endtime = k->value.GetBool();
|
||||
}
|
||||
} else if (strcmp(inner_obj_name, "pop_payment_method_id") == 0) {
|
||||
this->currentPaymentOptions.last().pop_payment_method_id = k->value.GetInt();
|
||||
} else if (strcmp(inner_obj_name, "pop_day_end_time") == 0) {
|
||||
@ -1477,6 +1430,7 @@ bool Configuration::isDayIncludedAsSpecialDay(uint64_t businessHours, QDateTime
|
||||
|
||||
if (isSpecialDay(dt)) {
|
||||
bool const &r = ((businessHours & BusinessHours::OFFICIAL_HOLIDAY) == BusinessHours::OFFICIAL_HOLIDAY);
|
||||
qCritical() << "XXXXXXXXXXXXXXXXXX r" << r << businessHours;
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -1583,8 +1537,6 @@ int getPaymentOptionIndex(Configuration const &cfg, QDateTime const &dt) {
|
||||
|
||||
int const numOptions = cfg.getAllPaymentOptions().size();
|
||||
|
||||
// qCritical() << __func__ << ":" << __LINE__ << "numOptions" << numOptions;
|
||||
|
||||
for (int opt=0; opt < numOptions; ++opt) {
|
||||
uint64_t const pop_business_hours = cfg.getPaymentOptions(opt).pop_business_hours;
|
||||
|
||||
@ -1595,8 +1547,6 @@ int getPaymentOptionIndex(Configuration const &cfg, QDateTime const &dt) {
|
||||
// QDateTime const dt = QDateTime::currentDateTime();
|
||||
int const dayOfWeek = dt.date().dayOfWeek();
|
||||
|
||||
// qCritical() << __func__ << ":" << __LINE__ << "dayOfWeek" << dayOfWeek;
|
||||
|
||||
if (isHoliday(cfg, dt)) {
|
||||
if (pop_business_hours & BusinessHours::OFFICIAL_HOLIDAY) {
|
||||
return opt;
|
||||
@ -1635,7 +1585,6 @@ int getPaymentOptionIndex(Configuration const &cfg, QDateTime const &dt) {
|
||||
} break;
|
||||
case (int)Qt::Sunday: {
|
||||
if (pop_business_hours & BusinessHours::SUN) {
|
||||
qCritical() << __func__ << ":" << __LINE__ << "opt" << opt;
|
||||
return opt;
|
||||
}
|
||||
} break;
|
||||
|
Loading…
Reference in New Issue
Block a user