From d7d8cffb85a42301bac662c4e2cd3f36ae50a66a Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Wed, 29 Feb 2012 14:59:03 +0200 Subject: [PATCH] New fee charge algo added --- projects/stargazer/settings_impl.cpp | 2 +- projects/stargazer/user_impl.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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; } } //----------------------------------------------------------------------------- -- 2.44.2