Compare commits
5 Commits
master
...
kleipeda-e
Author | SHA1 | Date | |
---|---|---|---|
9b137c2873 | |||
dd249a87d5 | |||
575885c19e | |||
d82a732a8d | |||
99dbd7c194 |
@ -780,7 +780,7 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
double maxMin = tariff->getPaymentOptions(paymentOptionIndex).pop_max_time;
|
||||
|
||||
// DEBUG
|
||||
qCritical() << "compute_price_for_parking_ticket() " << endl
|
||||
qCritical() << __func__ << ":" << __LINE__ << endl
|
||||
<< " paymentOptionIndex: " << paymentOptionIndex << endl
|
||||
<< " start_parking_time: " << start_parking_time << endl
|
||||
<< " netto_parking_time: " << netto_parking_time << endl
|
||||
@ -912,10 +912,12 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
|
||||
if (carryOver == 1) {
|
||||
QTime carryOverStart = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_start;
|
||||
QTime carryOverEnd = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_end;
|
||||
int 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__ << " carryOverEnd:" << carryOverEnd.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << ":" << __LINE__ << "carryOverDuration:" << carryOverDuration;
|
||||
|
||||
// handle carry over
|
||||
int minutesUntilCarryOver = effectiveStartTime.time().secsTo(carryOverStart) / 60;
|
||||
@ -941,12 +943,21 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
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);
|
||||
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);
|
||||
qCritical() << __func__ << ":" << __LINE__ << "adapted end-parking-time:" << end_parking_time.toString(Qt::ISODate);
|
||||
}
|
||||
} else
|
||||
if (end_parking_time.time() == carryOverEnd) {
|
||||
qCritical() << __func__ << ":" << __LINE__ << " end-parking-time:" << end_parking_time.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << ":" << __LINE__ << " carryOverEnd:" << carryOverEnd.toString(Qt::ISODate);
|
||||
ATBPaymentOption const &po = tariff->getPaymentOptions(paymentOptionIndex);
|
||||
if (po.pop_apply_carry_over_to_ticket_endtime == false) {
|
||||
end_parking_time = end_parking_time.addSecs(-carryOverDuration * 60);
|
||||
qCritical() << __func__ << ":" << __LINE__ << "adapted end-parking-time:" << end_parking_time.toString(Qt::ISODate);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -458,7 +458,7 @@ Calculator::ComputeDurationFromCost(Configuration *cfg,
|
||||
arg(cost).arg(nettoParktimeForCost);
|
||||
|
||||
int cnt = 0;
|
||||
while (++cnt < 10 && netto_parking_time_in_minutes < nettoParktimeForCost) {
|
||||
while (++cnt < 20 && netto_parking_time_in_minutes < nettoParktimeForCost) {
|
||||
// qCritical() << __func__ << ":" << __LINE__ << "cnt [" << cnt;
|
||||
|
||||
brutto_parking_time_in_minutes = free_parking_time_in_minutes + netto_parking_time_in_minutes;
|
||||
@ -3584,7 +3584,9 @@ uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int p
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep;
|
||||
}
|
||||
|
||||
if (timeStep == pun_duration) {
|
||||
// allow some tolerance when searching for [timeStep == pun_duration]:
|
||||
// this might happen when crossing minute boundaries
|
||||
if (std::abs(timeStep - pun_duration) < 4) {
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") return price" << price;
|
||||
return price;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user