Add some debug output into GetDurationForPrice().
This commit is contained in:
parent
8dad8f00e8
commit
4a2b15d086
@ -2723,6 +2723,10 @@ uint32_t Calculator::GetDurationForPrice(Configuration *cfg, int price) const {
|
|||||||
int const pop_id = cfg->getPaymentOptions().pop_id;
|
int const pop_id = cfg->getPaymentOptions().pop_id;
|
||||||
int const pop_accumulate_prices = cfg->getPaymentOptions().pop_accumulate_prices;
|
int const pop_accumulate_prices = cfg->getPaymentOptions().pop_accumulate_prices;
|
||||||
|
|
||||||
|
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") accumulate prices" << pop_accumulate_prices;
|
||||||
|
|
||||||
|
|
||||||
int new_price = 0;
|
int new_price = 0;
|
||||||
uint32_t duration = 0;
|
uint32_t duration = 0;
|
||||||
uint32_t duration_previous = 0;
|
uint32_t duration_previous = 0;
|
||||||
@ -2744,14 +2748,19 @@ uint32_t Calculator::GetDurationForPrice(Configuration *cfg, int price) const {
|
|||||||
|
|
||||||
if (pop_accumulate_prices) {
|
if (pop_accumulate_prices) {
|
||||||
new_price += pra_price;
|
new_price += pra_price;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pra_price:" << pra_price;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") new_price:" << new_price;
|
||||||
if (new_price <= price) {
|
if (new_price <= price) {
|
||||||
duration_previous = durationUnit;
|
duration_previous = durationUnit;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
|
||||||
} else {
|
} else {
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
|
||||||
return duration_previous;
|
return duration_previous;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration" << duration;
|
||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user