From: Maxim Mamontov Date: Wed, 29 Feb 2012 12:59:03 +0000 (+0200) Subject: New fee charge algo added X-Git-Tag: 2.409~418 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/d7d8cffb85a42301bac662c4e2cd3f36ae50a66a New fee charge algo added --- diff --git a/projects/stargazer/settings_impl.cpp b/projects/stargazer/settings_impl.cpp index 2bf8d082..16a2ac47 100644 --- a/projects/stargazer/settings_impl.cpp +++ b/projects/stargazer/settings_impl.cpp @@ -375,7 +375,7 @@ while (node) if (strcasecmp(node->getName(), "FeeChargeType") == 0) { - if (ParseUnsignedInRange(node->getValue(0), 0, 2, &feeChargeType) != 0) + if (ParseUnsignedInRange(node->getValue(0), 0, 3, &feeChargeType) != 0) { strError = "Incorrect FeeChargeType value: \'" + string(node->getValue(0)) + "\'"; return -1; diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 733e6256..3639060a 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1250,6 +1250,10 @@ switch (settings->GetFeeChargeType()) 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; } ResetPassiveTime(); } @@ -1312,6 +1316,13 @@ switch (settings->GetFeeChargeType()) SetPrepaidTraff(); } break; + case 3: + if (c >= 0) + { + property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge"); + SetPrepaidTraff(); + } + break; } } //-----------------------------------------------------------------------------