Implemented computeWeekDaysPrice() and computeWeekDaysDurationUnit()

This commit is contained in:
Gerhard Hoffmann 2023-11-28 15:20:31 +01:00
parent 57ec82a2fc
commit 9abc165a7c

View File

@ -473,6 +473,17 @@ int Calculator::findNextWorkTimeRange(QDateTime const &dt,
return nextWorkTimeRange; return nextWorkTimeRange;
} }
uint32_t Calculator::computeWeekDaysPrice(Configuration const *cfg, PaymentMethod id) const {
int pop_id = cfg->PaymentOption.find(id)->second.pop_id;
return cfg->PaymentRate.find(pop_id)->second.pra_price;
}
double Calculator::computeWeekDaysDurationUnit(Configuration const *cfg, PaymentMethod id) const {
int pop_id = cfg->PaymentOption.find(id)->second.pop_id;
int durationId = cfg->PaymentRate.find(pop_id)->second.pra_payment_unit_id;
return (double)(cfg->Duration.find(durationId)->second.pun_duration);
}
using namespace Utilities; using namespace Utilities;
Ticket Calculator::private_GetCostFromDuration(Configuration const* cfg, Ticket Calculator::private_GetCostFromDuration(Configuration const* cfg,