diff --git a/library/src/calculator_functions.cpp b/library/src/calculator_functions.cpp index aa1e58e..5333919 100644 --- a/library/src/calculator_functions.cpp +++ b/library/src/calculator_functions.cpp @@ -533,6 +533,16 @@ Calculator::GetDurationFromCost(Configuration* cfg, //qCritical() << DBG_HEADER << "NEW INPUT" << inputDate.toString(Qt::ISODate); + int const pop_carry_over = cfg->getPaymentOptions(paymentOptionIndex).pop_carry_over; + if (pop_carry_over) { + int weekDay = inputDate.date().dayOfWeek(); + int const pop_carry_over_option_id = cfg->getPaymentOptions(paymentOptionIndex).pop_carry_over_option_id; + if (pop_carry_over_option_id != -1) { + int const carryOverDuration = cfg->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].duration; + inputDate = inputDate.addSecs(carryOverDuration * 60); + } + } + inputDate = inputDate.addSecs(durationInSecs); #if DEBUG_GET_DURATION_FROM_COST==1 qCritical() << DBG_HEADER << "TICKET-END" << inputDate.toString(Qt::ISODate);