property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
break;
case 1:
- if (c > 0)
+ if (c + credit >= 0)
property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
break;
case 2:
- if (c > fee)
+ if (c + credit >= fee)
+ property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
+ break;
+ case 3:
+ if (c >= 0)
property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
break;
}
}
double c = cash;
-printfd(__FILE__, "login: %8s Fee=%f PassiveTimePart=%f fee=%f\n",
+printfd(__FILE__, "login: %8s Cash=%f Credit=%f Fee=%f PassiveTimePart=%f fee=%f\n",
login.c_str(),
+ cash.ConstData(),
+ credit.ConstData(),
tariff->GetFee(),
passiveTimePart,
fee);
SetPrepaidTraff();
break;
case 1:
- if (c > 0)
+ if (c + credit >= 0)
{
property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
SetPrepaidTraff();
}
break;
case 2:
- if (c > fee)
+ if (c + credit >= fee)
+ {
+ property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
+ SetPrepaidTraff();
+ }
+ break;
+ case 3:
+ if (c >= 0)
{
property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
SetPrepaidTraff();