]> git.stg.codes - stg.git/commitdiff
Ticket 37. Int2TS() method changed to formatTime() function in the SaveTariff() function.
authorElena Mamontova <helenh463@gmail.com>
Tue, 27 Sep 2016 12:52:32 +0000 (15:52 +0300)
committerElena Mamontova <helenh463@gmail.com>
Tue, 27 Sep 2016 12:52:32 +0000 (15:52 +0300)
TS2Int() method changed to readTime() function in the RestoreTariff() function.
'#include "stg/common.h"' added.

projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp

index 1623988d549e92252e56449bc92d21e89103eb7c..fd0b38bca4f9a6056a52d9d3d9ca178290435c86 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <libpq-fe.h>
 
+#include "stg/common.h"
 #include "postgresql_store.h"
 #include "stg/locker.h"
 
@@ -319,7 +320,7 @@ int32_t id;
 
     if (version > 7)
         query << ", change_policy = '" << TARIFF::ChangePolicyToString(td.tariffConf.changePolicy) << "', \
-                  change_policy_timeout = CAST('" << Int2TS(td.tariffConf.changePolicyTimeout) << "' AS TIMESTAMP)";
+                  change_policy_timeout = CAST('" << formatTime(td.tariffConf.changePolicyTimeout) << "' AS TIMESTAMP)";
 
     query << " WHERE pk_tariff = " << id;
 
@@ -516,7 +517,7 @@ if (version > 6)
 if (version > 7)
     {
     td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(PQgetvalue(result, 0, 6));
-    td->tariffConf.changePolicyTimeout = TS2Int(PQgetvalue(result, 0, 7));
+    td->tariffConf.changePolicyTimeout = readTime(PQgetvalue(result, 0, 7));
     }
 
 PQclear(result);