compute option index using permit type.
This commit is contained in:
parent
fbc255a6f2
commit
894e23332f
@ -566,6 +566,7 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
time_t end_parking_time, // netto time in minutes
|
time_t end_parking_time, // netto time in minutes
|
||||||
struct price_t *price,
|
struct price_t *price,
|
||||||
PermitType permitType) { // permitType maps to product
|
PermitType permitType) { // permitType maps to product
|
||||||
|
|
||||||
CalcState calcState;
|
CalcState calcState;
|
||||||
|
|
||||||
int const paymentOptionIndex = tariff->getPaymentOptionIndex(permitType.get());
|
int const paymentOptionIndex = tariff->getPaymentOptionIndex(permitType.get());
|
||||||
@ -633,7 +634,7 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
{
|
{
|
||||||
CalcState calcState;
|
CalcState calcState;
|
||||||
|
|
||||||
int paymentOptionIndex = tariff->getPaymentOptionIndex(start_parking_time);
|
int paymentOptionIndex = tariff->getPaymentOptionIndex(permitType);
|
||||||
|
|
||||||
double minMin = tariff->getPaymentOptions(paymentOptionIndex).pop_min_time;
|
double minMin = tariff->getPaymentOptions(paymentOptionIndex).pop_min_time;
|
||||||
double maxMin = tariff->getPaymentOptions(paymentOptionIndex).pop_max_time;
|
double maxMin = tariff->getPaymentOptions(paymentOptionIndex).pop_max_time;
|
||||||
@ -645,7 +646,8 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
<< " netto_parking_time: " << netto_parking_time << endl
|
<< " netto_parking_time: " << netto_parking_time << endl
|
||||||
<< " start + netto: " << start_parking_time.addSecs(netto_parking_time * 60) << endl
|
<< " start + netto: " << start_parking_time.addSecs(netto_parking_time * 60) << endl
|
||||||
<< " minMin: " << minMin << endl
|
<< " minMin: " << minMin << endl
|
||||||
<< " maxMin: " << maxMin;
|
<< " maxMin: " << maxMin
|
||||||
|
<< " permitType: " << permitType.toString();
|
||||||
|
|
||||||
|
|
||||||
if (netto_parking_time < 0) {
|
if (netto_parking_time < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user