Compare commits
No commits in common. "abf4ef0b0096ed664efbf221dd4a1719a90a462c" and "40440e28d3dbc6b152f5009a855f8477c03d6a7f" have entirely different histories.
abf4ef0b00
...
40440e28d3
@ -213,26 +213,6 @@ int CALCULATE_LIBRARY_API compute_product_price(Configuration const *cfg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case PERMIT_TYPE::SHORT_TERM_PARKING_PKW: {
|
|
||||||
qCritical() << "TODO: SHORT_TERM_PARKING_PKW";
|
|
||||||
} break;
|
|
||||||
case PERMIT_TYPE::SHORT_TERM_PARKING_BUS: {
|
|
||||||
qCritical() << "TODO: SHORT_TERM_PARKING_BUS";
|
|
||||||
} break;
|
|
||||||
case PERMIT_TYPE::SHORT_TERM_PARKING_CAMPER: {
|
|
||||||
qCritical() << "TODO: SHORT_TERM_PARKING_CAMPER";
|
|
||||||
} break;
|
|
||||||
case PERMIT_TYPE::DAY_TICKET_PKW: {
|
|
||||||
int const pop_daily_card_price = cfg->getPaymentOptions().pop_daily_card_price;
|
|
||||||
qCritical() << "DAY_TICKET_PKW: daily ticket price" << pop_daily_card_price;
|
|
||||||
return pop_daily_card_price;
|
|
||||||
} break;
|
|
||||||
case PERMIT_TYPE::DAY_TICKET_BUS: {
|
|
||||||
qCritical() << "TODO: DAY_TICKET_BUS";
|
|
||||||
} break;
|
|
||||||
case PERMIT_TYPE::DAY_TICKET_CAMPER: {
|
|
||||||
qCritical() << "TODO: DAY_TICKET_CAMPER";
|
|
||||||
} break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -606,7 +586,7 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
}
|
}
|
||||||
double minCost = tariff->getPaymentOptions(paymentOptionIndex).pop_min_price;
|
double minCost = tariff->getPaymentOptions(paymentOptionIndex).pop_min_price;
|
||||||
if (cost < minCost) {
|
if (cost < minCost) {
|
||||||
calcState.setDesc(QString("minCost=%1, cost=%2").arg(minCost).arg(cost));
|
calcState.setDesc(QString("minCost=%1, cost=%2").arg(minCost, cost));
|
||||||
return calcState.set(CalcState::State::BELOW_MIN_PARKING_PRICE);
|
return calcState.set(CalcState::State::BELOW_MIN_PARKING_PRICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2448,9 +2448,6 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int paymentOptionIndex) const {
|
uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int paymentOptionIndex) const {
|
||||||
|
|
||||||
int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
|
int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
|
||||||
int const pop_accumulate_prices = cfg->getPaymentOptions(paymentOptionIndex).pop_accumulate_prices;
|
|
||||||
|
|
||||||
uint32_t price = 0;
|
|
||||||
|
|
||||||
for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr)
|
for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr)
|
||||||
{
|
{
|
||||||
@ -2460,14 +2457,8 @@ uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int p
|
|||||||
Q_ASSERT(pun_id == payment_unit_id);
|
Q_ASSERT(pun_id == payment_unit_id);
|
||||||
|
|
||||||
int const pun_duration = cfg->Duration.find(payment_unit_id)->second.pun_duration;
|
int const pun_duration = cfg->Duration.find(payment_unit_id)->second.pun_duration;
|
||||||
if (pop_accumulate_prices) {
|
|
||||||
price += itr->second.pra_price;
|
|
||||||
} else {
|
|
||||||
price = (uint32_t)(itr->second.pra_price);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (timeStep == pun_duration) {
|
if (timeStep == pun_duration) {
|
||||||
return price;
|
return (uint32_t)(itr->second.pra_price);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user