]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp
Implemented daily fee charge with backward compatibility.
[stg.git] / projects / stargazer / plugins / configuration / sgconfig / parser_tariff.cpp
index 389e85750e28a50d725e9853f5fd60846319c3fc..bb855fafc07ba679c057b7bfbda772ae8424f0c6 100644 (file)
@@ -1,8 +1,8 @@
 #include <cstdio> // snprintf
 #include <cstring>
 
 #include <cstdio> // snprintf
 #include <cstring>
 
+#include "stg/tariffs.h"
 #include "parser.h"
 #include "parser.h"
-#include "tariffs.h"
 
 const int pt_mega = 1024 * 1024;
 //-----------------------------------------------------------------------------
 
 const int pt_mega = 1024 * 1024;
 //-----------------------------------------------------------------------------
@@ -145,6 +145,8 @@ for (; it != dataList.end(); ++it)
             break;
         }
 
             break;
         }
 
+    answerList->push_back("<Period value=\"" + TARIFF::PeriodToString(it->tariffConf.period) + "\"/>");
+
     answerList->push_back("</tariff>");
     }
 answerList->push_back("</Tariffs>");
     answerList->push_back("</tariff>");
     }
 answerList->push_back("</Tariffs>");
@@ -451,6 +453,12 @@ else
             }
         return 0;
         }
             }
         return 0;
         }
+
+    if (strcasecmp(el, "Period") == 0)
+        {
+        td.tariffConf.period = TARIFF::StringToPeriod(attr[1]);
+        return 0;
+        }
     }
 return -1;
 }
     }
 return -1;
 }