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