compute_duration_for_parking_ticket():
Switch to different tariff based on product-type/product-id.
This commit is contained in:
parent
e172e814e7
commit
d95741baae
@ -1135,6 +1135,10 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
QDateTime &ticketEndTime,
|
||||
PermitType permitType)
|
||||
{
|
||||
if (tariffs.count(permitType) > 0) {
|
||||
tariff = tariffs[permitType].get();
|
||||
}
|
||||
|
||||
tariff->getPaymentOptions(0).pop_max_price
|
||||
= tariff->getPaymentOptions(0).pop_max_price_save;
|
||||
|
||||
@ -1142,8 +1146,15 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
|
||||
bool prepaid = true;
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << " permit type (int): " << static_cast<int>(permitType);
|
||||
qCritical() << __func__ << ":" << __LINE__ << "permit type (string): " << permitType.toString();
|
||||
qCritical() << __func__ << ":" << __LINE__ << " tariff-includes: " << tariff->getTariffIncludes();
|
||||
|
||||
int paymentOptionIndex = getPaymentOptionIndex(*tariff, start_parking_time);
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << "payment option index: " << paymentOptionIndex;
|
||||
|
||||
|
||||
if (paymentOptionIndex == -1) {
|
||||
paymentOptionIndex = tariff->getPaymentOptionIndex(permitType);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user