Add some debug output into GetDurationForPrice().

This commit is contained in:
Gerhard Hoffmann 2024-07-26 13:34:18 +02:00
parent 8dad8f00e8
commit 4a2b15d086

View File

@ -2723,6 +2723,10 @@ uint32_t Calculator::GetDurationForPrice(Configuration *cfg, int price) const {
int const pop_id = cfg->getPaymentOptions().pop_id;
int const pop_accumulate_prices = cfg->getPaymentOptions().pop_accumulate_prices;
qCritical() << "(" << __func__ << ":" << __LINE__ << ") accumulate prices" << pop_accumulate_prices;
int new_price = 0;
uint32_t duration = 0;
uint32_t duration_previous = 0;
@ -2744,14 +2748,19 @@ uint32_t Calculator::GetDurationForPrice(Configuration *cfg, int price) const {
if (pop_accumulate_prices) {
new_price += pra_price;
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pra_price:" << pra_price;
qCritical() << "(" << __func__ << ":" << __LINE__ << ") new_price:" << new_price;
if (new_price <= price) {
duration_previous = durationUnit;
qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
} else {
qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
return duration_previous;
}
}
}
qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration" << duration;
return duration;
}