]> git.stg.codes - stg.git/commitdiff
Ticket 37. In 'case' where TARIFF::TO_EXPENSIVE, operation '>' changed to '>=' in
authorElena Mamontova <helenh463@gmail.com>
Wed, 14 Sep 2016 14:44:19 +0000 (17:44 +0300)
committerElena Mamontova <helenh463@gmail.com>
Wed, 14 Sep 2016 14:44:19 +0000 (17:44 +0300)
if() construction in TariffChangeIsAllowed() function.

projects/stargazer/tariff_impl.cpp

index 34590975882045b607466e3c15bb048559b41868..a3084fbcd810c781fdd895be95c6148b797400f1 100644 (file)
@@ -157,7 +157,7 @@ switch (GetChangePolicy())
         else
             return "New tariff '" + to.GetName() + "' is more expensive than current tariff '" + GetName() + "'. The policy is '" + TARIFF::ChangePolicyToString(GetChangePolicy()) + "'.";
     case TARIFF::TO_EXPENSIVE:
         else
             return "New tariff '" + to.GetName() + "' is more expensive than current tariff '" + GetName() + "'. The policy is '" + TARIFF::ChangePolicyToString(GetChangePolicy()) + "'.";
     case TARIFF::TO_EXPENSIVE:
-        if (to.GetFee() > GetFee())
+        if (to.GetFee() >= GetFee())
             return "";
         else
             return "New tariff '" + to.GetName() + "' is more cheap than current tariff '" + GetName() + "'. The policy is '" + TARIFF::ChangePolicyToString(GetChangePolicy()) + "'.";
             return "";
         else
             return "New tariff '" + to.GetName() + "' is more cheap than current tariff '" + GetName() + "'. The policy is '" + TARIFF::ChangePolicyToString(GetChangePolicy()) + "'.";