X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/19b1d5971c25819b3ccfe48cac16ff4e2daa6ec4..f907011b4827e85763372cdea76944b3b1cc3fd2:/projects/stargazer/user_impl.cpp diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 733e6256..42650eff 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1231,6 +1231,9 @@ STG_LOCKER lock(&mutex, __FILE__, __LINE__); if (passive.ConstData() || tariff == NULL) return; +if (tariff->GetPeriod() != TARIFF::MONTH) + return; + double fee = tariff->GetFee() / DaysInCurrentMonth(); if (fee == 0.0) @@ -1261,6 +1264,9 @@ STG_LOCKER lock(&mutex, __FILE__, __LINE__); if (tariff == NULL) return; +if (tariff->GetPeriod() != TARIFF::MONTH) + return; + double passiveTimePart = 1.0; if (!settings->GetFullFee()) { @@ -1315,6 +1321,39 @@ switch (settings->GetFeeChargeType()) } } //----------------------------------------------------------------------------- +void USER_IMPL::ProcessDailyFee() +{ +STG_LOCKER lock(&mutex, __FILE__, __LINE__); + +if (passive.ConstData() || tariff == NULL) + return; + +if (tariff->GetPeriod() != TARIFF::DAY) + return; + +double fee = tariff->GetFee(); + +if (fee == 0.0) + return; + +double c = cash; +switch (settings->GetFeeChargeType()) + { + case 0: + property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge"); + break; + case 1: + if (c + credit >= 0) + property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge"); + break; + case 2: + if (c + credit >= fee) + property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge"); + break; + } +ResetPassiveTime(); +} +//----------------------------------------------------------------------------- void USER_IMPL::SetPrepaidTraff() { if (tariff != NULL)