Compare commits
2 Commits
23748966de
...
eefdde4693
Author | SHA1 | Date | |
---|---|---|---|
eefdde4693 | |||
6157861d62 |
@ -2,12 +2,12 @@
|
||||
|
||||
enum DayOfWeek
|
||||
{
|
||||
Saturday = 0x06,
|
||||
Sunday = 0x01,
|
||||
Monday = 0x02,
|
||||
Tuesday = 0x02,
|
||||
Wednesday = 0x03,
|
||||
Thursday = 0x04,
|
||||
Friday = 0x05,
|
||||
UndefinedDay = 0xFF
|
||||
};
|
||||
Monday = 0x01,
|
||||
Tuesday = 0x02,
|
||||
Wednesday = 0x03,
|
||||
Thursday = 0x04,
|
||||
Friday = 0x05,
|
||||
Saturday = 0x06,
|
||||
Sunday = 0x07,
|
||||
UndefinedDay = 0xFF
|
||||
};
|
||||
|
@ -201,16 +201,9 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
||||
|
||||
if (price_per_unit < 0) price_per_unit = 1.0f;
|
||||
|
||||
if((price/price_per_unit) < minMin) return "PARKING NOT ALLOWED";
|
||||
// if((price/price_per_unit) < minMin) return "PARKING NOT ALLOWED";
|
||||
LOG_DEBUG("Calculated price per minute: ", price_per_unit);
|
||||
|
||||
if (price_per_unit < 0)
|
||||
{
|
||||
inputDate = inputDate.addDays(1);
|
||||
inputDate.setTime(worktime_from);
|
||||
return GetDurationFromCost(cfg, payment_option, inputDate.toString(Qt::ISODate).toStdString().c_str(), money_left, true);
|
||||
}
|
||||
|
||||
// If overtime flag is set
|
||||
if (overtime || nextDay)
|
||||
{
|
||||
@ -314,12 +307,12 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
||||
// }
|
||||
|
||||
double ret_val = 0;
|
||||
double calc_price = (int)total_duration_min - (int)price / price_per_unit;
|
||||
// double calc_price = (int)total_duration_min - (int)price / price_per_unit;
|
||||
|
||||
if (calc_price > 0 && total_duration_min > 0)
|
||||
{
|
||||
inputDate = inputDate.addSecs(-(int)ceil(calc_price) * 60);
|
||||
}
|
||||
//if (calc_price > 0 && total_duration_min > 0)
|
||||
//{
|
||||
// inputDate = inputDate.addSecs(-(int)ceil(calc_price) * 60);
|
||||
//}
|
||||
|
||||
if(price >= min_price && total_duration_min >= minMin)
|
||||
qDebug() << "GetDurationFromCost(): Valid until: " << inputDate.toString(Qt::ISODate);
|
||||
|
Loading…
x
Reference in New Issue
Block a user