]> git.stg.codes - stg.git/commitdiff
New fee charge algo added
authorMaxim Mamontov <faust.madf@gmail.com>
Wed, 29 Feb 2012 12:59:03 +0000 (14:59 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Wed, 29 Feb 2012 12:59:03 +0000 (14:59 +0200)
projects/stargazer/settings_impl.cpp
projects/stargazer/user_impl.cpp

index 2bf8d08271bf2b32bf718398d7c964d09744153e..16a2ac47130f1497fdb47ec1ee33e923989c5e42 100644 (file)
@@ -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;
index 733e625692bed34418c0a2dcdbccf0362fbc5571..3639060a85cc0c4ca25619af18e017e4fbf40840 100644 (file)
@@ -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;
     }
 }
 //-----------------------------------------------------------------------------