From: Elena Mamontova <helenh463@gmail.com>
Date: Mon, 28 Nov 2016 13:31:52 +0000 (+0200)
Subject: Ticket. The time_t currentTime parameter added in
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/dbd170cc6a6787325b3bd00391f2727041ea4ad9?ds=sidebyside;hp=-c

Ticket. The time_t currentTime parameter added in
TariffChangeIsAllow() function decfinition. The time_t timeout variable and
construction if ((currentTime > timeout) && (timeout != 0)) added in
TariffChangeIsAllowed().
---

dbd170cc6a6787325b3bd00391f2727041ea4ad9
diff --git a/projects/stargazer/tariff_impl.cpp b/projects/stargazer/tariff_impl.cpp
index a3084fbc..2daaeeb3 100644
--- a/projects/stargazer/tariff_impl.cpp
+++ b/projects/stargazer/tariff_impl.cpp
@@ -145,8 +145,11 @@ else
     return tariffData.dirPrice[dir].priceDayA;
 }
 //-----------------------------------------------------------------------------
-std::string TARIFF_IMPL::TariffChangeIsAllowed(const TARIFF & to) const
+std::string TARIFF_IMPL::TariffChangeIsAllowed(const TARIFF & to, time_t currentTime) const
 {
+time_t timeout = GetChangePolicyTimeout();
+if ((currentTime > timeout) && (timeout != 0))
+    return "";
 switch (GetChangePolicy())
     {
     case TARIFF::ALLOW: