Compare commits
2 Commits
schoenau
...
moransBran
Author | SHA1 | Date | |
---|---|---|---|
6ea58be34d | |||
8a7828c1e6 |
@@ -6,8 +6,4 @@ main.depends = library
|
||||
|
||||
contains( CONFIG, PTU5_YOCTO ) {
|
||||
SUBDIRS = library
|
||||
}
|
||||
|
||||
OTHER_FILES += \
|
||||
tariffs/tariff01.json \
|
||||
tariffs/tariff02.json
|
||||
}
|
3
README
3
README
@@ -1,3 +0,0 @@
|
||||
This branch "schoenau" is obsolete!
|
||||
|
||||
00332/Schoenau is allready included in current master branch.
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#ifndef ATB_PROJECT_H_INCLUDED
|
||||
#define ATB_PROJECT_H_INCLUDED
|
||||
|
||||
#include <QString>
|
||||
|
||||
class ATBProject {
|
||||
public:
|
||||
QString project;
|
||||
QString version;
|
||||
QString info;
|
||||
};
|
||||
|
||||
#endif // ATB_PROJECT_H_INCLUDED
|
@@ -109,7 +109,7 @@ CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff,
|
||||
void CALCULATE_LIBRARY_API free_tariff(parking_tariff_t *tariff);
|
||||
int CALCULATE_LIBRARY_API get_zone_nr(int zone = -1);
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket( // deprecated
|
||||
CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
time_t start_parking_time,
|
||||
time_t end_parking_time,
|
||||
@@ -118,11 +118,10 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket( // depre
|
||||
CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
QDateTime const &start_parking_time,
|
||||
int netto_parking_time,
|
||||
QDateTime &end_parking_time, // return value
|
||||
struct price_t *price); // return value
|
||||
QDateTime const &end_parking_time,
|
||||
struct price_t *price);
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket( // deprecated
|
||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
time_t start_parking_time,
|
||||
double cost,
|
||||
@@ -132,12 +131,17 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
QDateTime const &start_parking_time,
|
||||
double cost,
|
||||
QDateTime &ticketEndTime); // return value
|
||||
QDateTime &ticketEndTime);
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_daily_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
QDateTime const &start_parking_time,
|
||||
QDateTime &ticketEndTime);
|
||||
QString const &start_parking_time,
|
||||
uint8_t paymentMethod);
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_24hour_daily_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
QString const &start_parking_time,
|
||||
uint8_t paymentMethod);
|
||||
//#ifdef __cplusplus
|
||||
//} // extern "C"
|
||||
//#endif
|
||||
|
@@ -1,8 +1,6 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include "configuration.h"
|
||||
#include "payment_method.h"
|
||||
|
||||
#include <QDateTime>
|
||||
using namespace std;
|
||||
|
||||
@@ -25,24 +23,13 @@ public:
|
||||
/// <param name="tariff_cfg">Pointer to configuration</param>
|
||||
/// <param name="vehicle_type">Type of vehicle</param>
|
||||
/// <param name="start_datetime">Date/time of payment to be conducted in ISO8601 format (e.g. 2022-12-25T08:00:00Z) </param>
|
||||
/// <param name="end_datetime">Date/time of park end to be conducted in ISO8601 format (e.g. 2022-12-25T08:00:00Z) </param>
|
||||
/// <param name="durationMin">Duration of parking in minutes</param>
|
||||
/// <returns>Returns cost (data type: double)</returns>
|
||||
double GetCostFromDuration(Configuration* cfg, uint8_t vehicle_type, const QDateTime start_datetime, QDateTime & end_datetime, double durationMin, bool nextDay = false, bool prepaid = false);
|
||||
|
||||
// Introduced for Schoenau, Koenigsee.
|
||||
// For tariff of following structure: only steps, no special days, nonstop.
|
||||
uint32_t GetCostFromDuration(Configuration const* cfg, QDateTime const &start, quint64 durationMinutes, uint8_t paymentMethod = PaymentMethod::Steps);
|
||||
uint32_t GetCostFromDuration(Configuration const* cfg, QDateTime const &start, QDateTime const &end, uint8_t paymentMethod = PaymentMethod::Steps);
|
||||
double GetCostFromDuration(Configuration* cfg, uint8_t vehicle_type, char const* start_datetime, double durationMin, bool nextDay = false, bool prepaid = false);
|
||||
|
||||
// Daily ticket
|
||||
QDateTime GetDailyTicketDuration(Configuration* cfg, const QDateTime start_datetime, uint8_t payment_option, bool carry_over);
|
||||
QString GetDailyTicketDuration(Configuration* cfg, QString start_datetime, uint8_t payment_option, bool carry_over);
|
||||
|
||||
|
||||
//
|
||||
// helper functions for Schoenau
|
||||
//
|
||||
QList<int> GetTimeSteps(Configuration const *cfg, int paymentMethod);
|
||||
//
|
||||
uint32_t GetPriceForTimeStep(Configuration const *cfg, uint8_t paymentMethod, int timeStep);
|
||||
// 24-hour daily ticket
|
||||
QString Get24HourTicketDuration(Configuration* cfg, QString start_datetime, uint8_t payment_option);
|
||||
};
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include "member_type.h"
|
||||
#include "period_year.h"
|
||||
#include "payment_rate.h"
|
||||
#include "atb_project.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace rapidjson;
|
||||
@@ -28,8 +27,8 @@ using namespace rapidjson;
|
||||
class Configuration
|
||||
{
|
||||
public:
|
||||
ATBProject project;
|
||||
ATBCurrency Currency;
|
||||
|
||||
ATBCurrency Currency;
|
||||
ATBDuration duration;
|
||||
|
||||
multimap<int, ATBDuration> Duration;
|
||||
|
@@ -2,12 +2,12 @@
|
||||
|
||||
enum DayOfWeek
|
||||
{
|
||||
Monday = 0x01,
|
||||
Tuesday = 0x02,
|
||||
Wednesday = 0x03,
|
||||
Thursday = 0x04,
|
||||
Friday = 0x05,
|
||||
Saturday = 0x06,
|
||||
Sunday = 0x07,
|
||||
UndefinedDay = 0xFF
|
||||
};
|
||||
Saturday = 0x06,
|
||||
Sunday = 0x01,
|
||||
Monday = 0x02,
|
||||
Tuesday = 0x02,
|
||||
Wednesday = 0x03,
|
||||
Thursday = 0x04,
|
||||
Friday = 0x05,
|
||||
UndefinedDay = 0xFF
|
||||
};
|
@@ -15,4 +15,5 @@ public:
|
||||
double pop_min_price;
|
||||
int pop_carry_over;
|
||||
int pop_daily_card_price;
|
||||
int pop_multi_hour_price;
|
||||
};
|
||||
|
@@ -65,8 +65,7 @@ HEADERS += \
|
||||
include/mobilisis/tariff_period_year.h \
|
||||
include/mobilisis/tariff_payment_rate.h \
|
||||
include/mobilisis/tariff_log.h \
|
||||
include/mobilisis/calculate_price.h \
|
||||
include/mobilisis/atb_project.h
|
||||
include/mobilisis/calculate_price.h
|
||||
|
||||
OTHER_FILES += src/main.cpp
|
||||
|
||||
|
@@ -92,12 +92,10 @@ void CALCULATE_LIBRARY_API free_tariff(parking_tariff_t *tariff) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// this is currently not used
|
||||
CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
time_t start_parking_time, // in minutes
|
||||
time_t end_parking_time, // netto time in minutes
|
||||
time_t end_parking_time, // in minutes
|
||||
struct price_t *price) {
|
||||
CalcState calcState;
|
||||
double minMin = tariff->PaymentOption.find(PaymentOption::Option1)->second.pop_min_time;
|
||||
@@ -131,12 +129,11 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
QTime const t(0, 0, 0);
|
||||
QDateTime start(d, t, Qt::UTC);
|
||||
start = start.toLocalTime().addSecs(start_parking_time * 60);
|
||||
QDateTime end(start);
|
||||
if (start.isValid()) {
|
||||
QString cs = start.toString(Qt::ISODate);
|
||||
double cost = calculator.GetCostFromDuration(
|
||||
tariff, PaymentOption::Option1,
|
||||
start,
|
||||
end,
|
||||
cs.toLocal8Bit().constData(),
|
||||
duration, false, true);
|
||||
double minCost = tariff->PaymentOption.find(PaymentOption::Option1)->second.pop_min_price;
|
||||
if (cost < minCost) {
|
||||
@@ -155,10 +152,8 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
QDateTime const &start_parking_time,
|
||||
int netto_parking_time,
|
||||
QDateTime &end_parking_time,
|
||||
struct price_t *price)
|
||||
{
|
||||
QDateTime const &end_parking_time,
|
||||
struct price_t *price) {
|
||||
CalcState calcState;
|
||||
double minMin = tariff->PaymentOption.find(PaymentOption::Option1)->second.pop_min_time;
|
||||
double maxMin = tariff->PaymentOption.find(PaymentOption::Option1)->second.pop_max_time;
|
||||
@@ -166,37 +161,39 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
// DEBUG
|
||||
qCritical() << "compute_price_for_parking_ticket() " << endl
|
||||
<< " start_parking_time: " << start_parking_time << endl
|
||||
<< " netto_parking_time: " << netto_parking_time << endl
|
||||
<< " end_parking_time: " << end_parking_time << endl
|
||||
<< " minMin: " << minMin << endl
|
||||
<< " maxMin: " << maxMin;
|
||||
|
||||
|
||||
if (netto_parking_time < 0) {
|
||||
int const duration = (end_parking_time.toSecsSinceEpoch() -
|
||||
start_parking_time.toSecsSinceEpoch()) / 60;
|
||||
|
||||
if (duration < 0) {
|
||||
calcState.setDesc(QString("end=%1, start=%2")
|
||||
.arg(end_parking_time.toString(Qt::ISODate),
|
||||
start_parking_time.toString(Qt::ISODate)));
|
||||
return calcState.set(CalcState::State::NEGATIVE_PARING_TIME);
|
||||
}
|
||||
if (netto_parking_time > maxMin) {
|
||||
calcState.setDesc(QString("duration=%1, maxMin=%2").arg(netto_parking_time).arg(maxMin));
|
||||
if (duration > maxMin) {
|
||||
calcState.setDesc(QString("duration=%1, maxMin=%2").arg(duration, maxMin));
|
||||
return calcState.set(CalcState::State::ABOVE_MAX_PARKING_TIME);
|
||||
}
|
||||
if (netto_parking_time < minMin) {
|
||||
calcState.setDesc(QString("duration=%1, minMin=%2").arg(netto_parking_time).arg(minMin));
|
||||
if (duration < minMin) {
|
||||
calcState.setDesc(QString("duration=%1, minMin=%2").arg(duration, minMin));
|
||||
return calcState.set(CalcState::State::BELOW_MIN_PARKING_TIME);
|
||||
}
|
||||
if (netto_parking_time == 0) {
|
||||
if (duration == 0) {
|
||||
memset(price, 0x00, sizeof(*price));
|
||||
return calcState.set(CalcState::State::SUCCESS);
|
||||
}
|
||||
|
||||
if (start_parking_time.isValid()) {
|
||||
QString cs = start_parking_time.toString(Qt::ISODate);
|
||||
double cost = calculator.GetCostFromDuration(
|
||||
tariff, PaymentOption::Option1,
|
||||
start_parking_time, // starting time
|
||||
end_parking_time, // return value: end time
|
||||
netto_parking_time, // minutes, netto
|
||||
false, true);
|
||||
tariff, PaymentOption::Option1,
|
||||
cs.toLocal8Bit().constData(),
|
||||
duration, false, true);
|
||||
double minCost = tariff->PaymentOption.find(PaymentOption::Option1)->second.pop_min_price;
|
||||
if (cost < minCost) {
|
||||
calcState.setDesc(QString("minCost=%1, cost=%2").arg(minCost, cost));
|
||||
@@ -236,7 +233,7 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
duration = calculator.GetDurationFromCost(tariff, PaymentOption::Option1,
|
||||
cs.toLocal8Bit().constData(),
|
||||
price, false, true).c_str();
|
||||
QDateTime d = QDateTime::fromString(duration, Qt::ISODate);
|
||||
QDateTime d = QDateTime::fromString(duration);
|
||||
if (!d.isValid()) {
|
||||
calcState.setDesc(QString("ticketEndTime=%1").arg(duration));
|
||||
return calcState.set(CalcState::State::WRONG_ISO_TIME_FORMAT);
|
||||
@@ -252,8 +249,7 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
parking_tariff_t *tariff,
|
||||
QDateTime const &start_parking_time,
|
||||
double price,
|
||||
QDateTime &ticketEndTime)
|
||||
{
|
||||
QDateTime &ticketEndTime) {
|
||||
CalcState calcState;
|
||||
if (start_parking_time.isValid()) {
|
||||
QString cs = start_parking_time.toString(Qt::ISODate);
|
||||
@@ -279,28 +275,20 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
return calcState.set(CalcState::State::SUCCESS);
|
||||
}
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_daily_ticket(parking_tariff_t *tariff, QDateTime const &start_parking_time, QDateTime &ticketEndTime)
|
||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_daily_ticket(parking_tariff_t *tariff, QString const &start_parking_time,uint8_t paymentMethod)
|
||||
{
|
||||
CalcState calcState;
|
||||
if (start_parking_time.isValid()) {
|
||||
|
||||
ticketEndTime = calculator.GetDailyTicketDuration(tariff,
|
||||
start_parking_time,
|
||||
PaymentOption::Option1,
|
||||
false); // carry over
|
||||
|
||||
// DEBUG
|
||||
qCritical() << "compute_duration_for_daily_ticket(): ";
|
||||
qCritical() << " ticketEndTime: " << ticketEndTime;
|
||||
|
||||
if (!ticketEndTime.isValid()) {
|
||||
calcState.setDesc(QString("ticketEndTime=%1").arg(ticketEndTime.toString(Qt::ISODate)));
|
||||
return calcState.set(CalcState::State::WRONG_ISO_TIME_FORMAT);
|
||||
}
|
||||
|
||||
} else {
|
||||
return calcState.set(CalcState::State::INVALID_START_DATE);
|
||||
}
|
||||
QString result = calculator.GetDailyTicketDuration(tariff, start_parking_time, PaymentOption::Option1,false);
|
||||
qDebug() << "DailyTicket() => " + result;
|
||||
|
||||
return calcState.set(CalcState::State::SUCCESS);
|
||||
}
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_24hour_daily_ticket(parking_tariff_t *tariff, QString const &start_parking_time,uint8_t paymentMethod)
|
||||
{
|
||||
CalcState calcState;
|
||||
QString result = calculator.Get24HourTicketDuration(tariff, start_parking_time, PaymentOption::Option1,false);
|
||||
qDebug() << "24HourDailyTicket() => " + result;
|
||||
|
||||
return calcState.set(CalcState::State::SUCCESS);
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@
|
||||
double total_duration_min = 0.0f;
|
||||
double total_cost = 0.0f;
|
||||
bool overtime = false;
|
||||
int protection_counter = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
inline struct tm* localtime_r(const time_t *clock, struct tm* result){
|
||||
@@ -19,25 +20,55 @@ inline struct tm* localtime_r(const time_t *clock, struct tm* result){
|
||||
}
|
||||
#endif
|
||||
|
||||
QDateTime Calculator::GetDailyTicketDuration(Configuration* cfg, const QDateTime start_datetime, uint8_t payment_option, bool carry_over)
|
||||
QString Calculator::Get24HourTicketDuration(Configuration *cfg, QString start_datetime, uint8_t payment_option)
|
||||
{
|
||||
if(!start_datetime.isValid()) {
|
||||
return QDateTime();
|
||||
}
|
||||
if(start_datetime.isNull() || start_datetime.isEmpty()) return "Invalid date-time";
|
||||
protection_counter = 0;
|
||||
|
||||
double day_price = 0.0f;
|
||||
int current_special_day_id = -1;
|
||||
|
||||
QDateTime inputDateTime = QDateTime::fromString(start_datetime, Qt::ISODate);
|
||||
QTime worktime_from;
|
||||
QTime worktime_to;
|
||||
|
||||
int daily_24hour_card_price = cfg->PaymentOption.find(payment_option)->second.pop_multi_hour_price;
|
||||
if(daily_24hour_card_price <= 0) return "24-hour daily ticket: price zero or less";
|
||||
|
||||
bool is_special_day = Utilities::CheckSpecialDay(cfg, start_datetime.toStdString().c_str(), ¤t_special_day_id, &day_price);
|
||||
|
||||
if(is_special_day)
|
||||
{
|
||||
worktime_from = QTime::fromString(cfg->SpecialDaysWorktime.find(current_special_day_id)->second.pedwt_time_from.c_str(), Qt::ISODate);
|
||||
worktime_to = QTime::fromString(cfg->SpecialDaysWorktime.find(current_special_day_id)->second.pedwt_time_to.c_str(),Qt::ISODate);
|
||||
return "24-hour ticket cannot be bought on special day";
|
||||
}
|
||||
|
||||
// Check next special day
|
||||
inputDateTime = inputDateTime.addSecs(86400);
|
||||
while(Utilities::CheckSpecialDay(cfg, inputDateTime.toString(Qt::ISODate).toLocal8Bit(), ¤t_special_day_id, &day_price))
|
||||
{
|
||||
protection_counter++;
|
||||
if(protection_counter >=7) return NULL;
|
||||
inputDateTime = inputDateTime.addSecs(86400);
|
||||
}
|
||||
return inputDateTime.toString(Qt::ISODate) + ", price = " + to_string(daily_24hour_card_price).c_str();
|
||||
}
|
||||
|
||||
QString Calculator::GetDailyTicketDuration(Configuration* cfg, QString start_datetime, uint8_t payment_option, bool carry_over)
|
||||
{
|
||||
if(start_datetime.isNull() || start_datetime.isEmpty()) return NULL;
|
||||
|
||||
double day_price = 0.0f;
|
||||
int current_special_day_id = -1;
|
||||
bool is_special_day = Utilities::CheckSpecialDay(cfg, start_datetime.toString(Qt::ISODate).toStdString().c_str(), ¤t_special_day_id, &day_price);
|
||||
bool is_special_day = Utilities::CheckSpecialDay(cfg, start_datetime.toStdString().c_str(), ¤t_special_day_id, &day_price);
|
||||
|
||||
QDateTime inputDateTime = start_datetime;
|
||||
QDateTime inputDateTime = QDateTime::fromString(start_datetime, Qt::ISODate);
|
||||
QTime worktime_from;
|
||||
QTime worktime_to;
|
||||
|
||||
int daily_card_price = cfg->PaymentOption.find(payment_option)->second.pop_daily_card_price;
|
||||
if(daily_card_price <= 0) {
|
||||
LOG_ERROR("Calculator::GetDailyTicketDuration(): Daily ticket price zero or less");
|
||||
return QDateTime();
|
||||
}
|
||||
if(daily_card_price <= 0) return "Daily ticket price zero or less";
|
||||
|
||||
if(is_special_day)
|
||||
{
|
||||
@@ -51,21 +82,21 @@ QDateTime Calculator::GetDailyTicketDuration(Configuration* cfg, const QDateTime
|
||||
{
|
||||
// Go to next day if outside worktime
|
||||
inputDateTime = inputDateTime.addSecs(86400);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime, payment_option,true);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime.toString(Qt::ISODate), payment_option,true);
|
||||
}
|
||||
|
||||
if(day_price <=0)
|
||||
{
|
||||
// Go to next day if special day price is 0
|
||||
inputDateTime = inputDateTime.addSecs(86400);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime, payment_option,true);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime.toString(Qt::ISODate), payment_option,true);
|
||||
}
|
||||
|
||||
int diff = abs(inputDateTime.time().secsTo(worktime_to));
|
||||
inputDateTime = inputDateTime.addSecs(diff);
|
||||
|
||||
//qDebug() << "Ticket is valid until: " << inputDateTime.toString(Qt::ISODate) << "price = " << daily_card_price << ", duration = " << diff / 60;
|
||||
return inputDateTime;
|
||||
return inputDateTime.toString(Qt::ISODate) + ", price = " + to_string(daily_card_price).c_str() + ", duration = " + to_string((diff/60)).c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -81,7 +112,7 @@ QDateTime Calculator::GetDailyTicketDuration(Configuration* cfg, const QDateTime
|
||||
if(found <=0)
|
||||
{
|
||||
inputDateTime = inputDateTime.addSecs(86400);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime, payment_option,true);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime.toString(Qt::ISODate), payment_option,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -97,18 +128,18 @@ QDateTime Calculator::GetDailyTicketDuration(Configuration* cfg, const QDateTime
|
||||
{
|
||||
// Go to next day if outside worktime
|
||||
inputDateTime = inputDateTime.addSecs(86400);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime, payment_option,true);
|
||||
return GetDailyTicketDuration(cfg,inputDateTime.toString(Qt::ISODate), payment_option,true);
|
||||
}
|
||||
|
||||
int diff = abs(inputDateTime.time().secsTo(worktime_to));
|
||||
inputDateTime = inputDateTime.addSecs(diff);
|
||||
|
||||
//qDebug() << "Ticket is valid until: " << inputDateTime.toString(Qt::ISODate) << "price = " << daily_card_price << ", duration = " << diff / 60;
|
||||
return inputDateTime;
|
||||
//qDebug() << "Ticket is valid until: " << inputDateTime.toString(Qt::ISODate) << "price = " << daily_card_price << ", duration = " << diff / 60;
|
||||
return inputDateTime.toString(Qt::ISODate) + ", price = " + to_string(daily_card_price).c_str() + ", duration = " + to_string((diff/60)).c_str();
|
||||
}
|
||||
}
|
||||
|
||||
return QDateTime();
|
||||
return NULL;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
||||
@@ -118,6 +149,7 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
||||
bool nextDay,
|
||||
bool prepaid)
|
||||
{
|
||||
|
||||
// Get input date
|
||||
QDateTime inputDate = QDateTime::fromString(start_datetime,Qt::ISODate);
|
||||
|
||||
@@ -206,9 +238,19 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
||||
|
||||
if (price_per_unit < 0) price_per_unit = 1.0f;
|
||||
|
||||
// if((price/price_per_unit) < minMin) return "PARKING NOT ALLOWED";
|
||||
// Commented on 07.06.2023
|
||||
//if((price/price_per_unit) < minMin)
|
||||
// return "PARKING NOT ALLOWED";
|
||||
|
||||
LOG_DEBUG("Calculated price per minute: ", price_per_unit);
|
||||
|
||||
if (price_per_unit < 0)
|
||||
{
|
||||
inputDate = inputDate.addDays(1);
|
||||
inputDate.setTime(worktime_from);
|
||||
return GetDurationFromCost(cfg, payment_option, inputDate.toString(Qt::ISODate).toStdString().c_str(), money_left, true);
|
||||
}
|
||||
|
||||
// If overtime flag is set
|
||||
if (overtime || nextDay)
|
||||
{
|
||||
@@ -312,15 +354,15 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
||||
// }
|
||||
|
||||
double ret_val = 0;
|
||||
// double calc_price = (int)total_duration_min - (int)price / price_per_unit;
|
||||
double calc_price = (int)total_duration_min - (int)price / price_per_unit;
|
||||
|
||||
//if (calc_price > 0 && total_duration_min > 0)
|
||||
//{
|
||||
// inputDate = inputDate.addSecs(-(int)ceil(calc_price) * 60);
|
||||
//}
|
||||
if (calc_price > 0 && total_duration_min > 0)
|
||||
{
|
||||
inputDate.addSecs(-(int)ceil(calc_price) * 60);
|
||||
}
|
||||
|
||||
if(price >= min_price && total_duration_min >= minMin)
|
||||
qDebug() << "GetDurationFromCost(): Valid until: " << inputDate.toString(Qt::ISODate);
|
||||
qDebug() << "Valid until: " << inputDate.toString(Qt::ISODate);
|
||||
else
|
||||
{
|
||||
qDebug() << "Parking not allowed";
|
||||
@@ -339,40 +381,10 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
||||
///////////////////////////////////////
|
||||
|
||||
/// <inheritdoc/>
|
||||
///
|
||||
|
||||
uint32_t Calculator::GetCostFromDuration(Configuration const* cfg,
|
||||
QDateTime const &start,
|
||||
quint64 timeStepInMinutes,
|
||||
uint8_t paymentMethod) {
|
||||
// for instance, a tariff as used in Schoenau, Koenigssee: only steps, no
|
||||
// special days, nonstop.
|
||||
if (paymentMethod == PaymentMethod::Steps
|
||||
&& cfg->SpecialDays.size() == 0
|
||||
&& cfg->SpecialDaysWorktime.size() == 0) {
|
||||
QDateTime const end = start.addSecs(timeStepInMinutes*60);
|
||||
return GetCostFromDuration(cfg, start, end, paymentMethod);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t Calculator::GetCostFromDuration(Configuration const* cfg,
|
||||
QDateTime const &start,
|
||||
QDateTime const &end,
|
||||
uint8_t paymentMethod) {
|
||||
if (paymentMethod == PaymentMethod::Steps
|
||||
&& cfg->SpecialDays.size() == 0
|
||||
&& cfg->SpecialDaysWorktime.size() == 0) {
|
||||
int const timeStepInMinutes = start.secsTo(end) / 60;
|
||||
return GetPriceForTimeStep(cfg, paymentMethod, timeStepInMinutes);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_option, const QDateTime start_datetime, QDateTime & end_datetime, double durationMin, bool nextDay, bool prepaid)
|
||||
double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_option, const char* start_datetime, double durationMin, bool nextDay, bool prepaid)
|
||||
{
|
||||
// Get input date
|
||||
QDateTime inputDate = start_datetime;
|
||||
QDateTime inputDate = QDateTime::fromString(start_datetime,Qt::ISODate);
|
||||
|
||||
// Get day of week
|
||||
int weekdayId = 0;
|
||||
@@ -459,7 +471,7 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio
|
||||
{
|
||||
LOG_DEBUG("- No workday found, trying to find next available day");
|
||||
inputDate = inputDate.addDays(1);
|
||||
return floor(GetCostFromDuration(cfg, payment_option, inputDate, end_datetime, durationMin, true, prepaid));
|
||||
return floor(GetCostFromDuration(cfg, payment_option, inputDate.toString(Qt::ISODate).toStdString().c_str(), durationMin, true, prepaid));
|
||||
}
|
||||
worktime_from = QTime::fromString(cfg->WeekDaysWorktime.find(weekdayId)->second.pwd_time_from.c_str());
|
||||
worktime_to = QTime::fromString(cfg->WeekDaysWorktime.find(weekdayId)->second.pwd_time_to.c_str());
|
||||
@@ -472,7 +484,7 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio
|
||||
{
|
||||
inputDate = inputDate.addDays(1);
|
||||
inputDate.setTime(worktime_from);
|
||||
return GetCostFromDuration(cfg, payment_option, inputDate, end_datetime, durationMin, true, prepaid);
|
||||
return GetCostFromDuration(cfg, payment_option, inputDate.toString(Qt::ISODate).toStdString().c_str(), durationMin, true, prepaid);
|
||||
}
|
||||
|
||||
// If overtime flag is set
|
||||
@@ -502,7 +514,7 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio
|
||||
{
|
||||
LOG_DEBUG(" *** PREPAID *** Current time is past the time range end, searching for next available day");
|
||||
inputDate = inputDate.addDays(1);
|
||||
return GetCostFromDuration(cfg, payment_option, inputDate, end_datetime, durationMin, true, prepaid);
|
||||
return GetCostFromDuration(cfg, payment_option, inputDate.toString(Qt::ISODate).toStdString().c_str(), durationMin, true, prepaid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -554,7 +566,7 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio
|
||||
LOG_DEBUG("Reached end of worktime, searching for the next working day");
|
||||
inputDate = inputDate.addDays(1);
|
||||
overtime = true;
|
||||
return GetCostFromDuration(cfg, payment_option, inputDate, end_datetime, total_duration_min);
|
||||
return GetCostFromDuration(cfg, payment_option, inputDate.toString(Qt::ISODate).toStdString().c_str(), total_duration_min);
|
||||
}
|
||||
|
||||
// Increment input date minutes for each monetary unit
|
||||
@@ -563,46 +575,8 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio
|
||||
total_cost += price_per_unit;
|
||||
|
||||
}
|
||||
qDebug() << "GetCostFromDuration(): Valid until:" << inputDate.toString(Qt::ISODate).toStdString().c_str();
|
||||
|
||||
end_datetime = inputDate;
|
||||
|
||||
qDebug() << "Valid until:" << inputDate.toString(Qt::ISODate).toStdString().c_str();
|
||||
double ret_val = total_cost;
|
||||
total_cost = 0.0f;
|
||||
return ceil(ret_val);
|
||||
}
|
||||
|
||||
QList<int> Calculator::GetTimeSteps(Configuration const *cfg, int paymentOption) {
|
||||
QList<int> timeSteps;
|
||||
|
||||
int const pop_id = cfg->PaymentOption.find(paymentOption)->second.pop_id;
|
||||
|
||||
for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr)
|
||||
{
|
||||
int const durationId = itr->second.pra_payment_unit_id;
|
||||
int const durationUnit = cfg->Duration.find(durationId)->second.pun_duration;
|
||||
timeSteps << durationUnit;
|
||||
}
|
||||
|
||||
return timeSteps;
|
||||
}
|
||||
|
||||
uint32_t Calculator::GetPriceForTimeStep(Configuration const *cfg, uint8_t paymentOption, int timeStep) {
|
||||
|
||||
int const pop_id = cfg->PaymentOption.find(paymentOption)->second.pop_id;
|
||||
|
||||
for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr)
|
||||
{
|
||||
int const payment_unit_id = itr->second.pra_payment_unit_id;
|
||||
int const pun_id = cfg->Duration.find(payment_unit_id)->second.pun_id;
|
||||
|
||||
Q_ASSERT(pun_id == payment_unit_id);
|
||||
|
||||
int const pun_duration = cfg->Duration.find(payment_unit_id)->second.pun_duration;
|
||||
if (timeStep == pun_duration) {
|
||||
return (uint32_t)(itr->second.pra_price);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#include "configuration.h"
|
||||
#include <QDebug>
|
||||
|
||||
/// <inheritdoc/>
|
||||
MemberType Configuration::IdentifyJsonMember(const char* member_name)
|
||||
@@ -34,8 +33,8 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
}
|
||||
|
||||
// Parse JSON to document
|
||||
Document document;
|
||||
document.Parse(json);
|
||||
Document document;
|
||||
document.Parse(json);
|
||||
|
||||
// Return if parse error has been found
|
||||
ParseErrorCode err = document.GetParseError();
|
||||
@@ -55,13 +54,13 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
|
||||
// Validate JSON, check configuration members
|
||||
if (!document.HasMember("Currency")
|
||||
|| !document.HasMember("PaymentMethod")
|
||||
|| !document.HasMember("PaymentOption")
|
||||
|| !document.HasMember("PaymentRate")
|
||||
|| !document.HasMember("Duration"))
|
||||
//|| !document.HasMember("WeekDays")
|
||||
//|| !document.HasMember("SpecialDaysWorktime")
|
||||
//|| !document.HasMember("SpecialDays"))
|
||||
|| !document.HasMember("PaymentMethod")
|
||||
|| !document.HasMember("PaymentOption")
|
||||
|| !document.HasMember("PaymentRate")
|
||||
|| !document.HasMember("Duration")
|
||||
//|| !document.HasMember("WeekDays")
|
||||
|| !document.HasMember("SpecialDaysWorktime")
|
||||
|| !document.HasMember("SpecialDays"))
|
||||
{
|
||||
printf("%s", "Error: not a valid configuration JSON\n");
|
||||
return false;
|
||||
@@ -88,24 +87,13 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
const char* mb_name = i->name.GetString();
|
||||
if (mb_name == NULL) continue;
|
||||
|
||||
if (document[mb_name].IsString()) {
|
||||
QString const _mb_name(mb_name);
|
||||
if (_mb_name.startsWith("Project", Qt::CaseInsensitive)) {
|
||||
cfg->project.project = document[mb_name].GetString();
|
||||
qDebug() << "PROJECT" << cfg->project.project;
|
||||
// if (!document[mb_name].IsArray()) {
|
||||
std::string const _mb_name(mb_name);
|
||||
if (_mb_name == "version" || _mb_name == "project" ||
|
||||
_mb_name == "zone" || _mb_name == "info") {
|
||||
continue;
|
||||
}
|
||||
if (_mb_name.startsWith("Version", Qt::CaseInsensitive)) {
|
||||
cfg->project.version = document[mb_name].GetString();
|
||||
qDebug() << "VERSION" << cfg->project.version;
|
||||
continue;
|
||||
}
|
||||
if (_mb_name.startsWith("Info", Qt::CaseInsensitive)) {
|
||||
cfg->project.info = document[mb_name].GetString();
|
||||
qDebug() << "INFO" << cfg->project.info;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
//printf(" -%s\n", mb_name);
|
||||
|
||||
@@ -167,6 +155,7 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
else if (strcmp(inner_obj_name, "pop_min_price") == 0) PaymentOption.pop_min_price = k->value.GetDouble();
|
||||
else if (strcmp(inner_obj_name, "pop_carry_over") == 0) PaymentOption.pop_carry_over = k->value.GetInt();
|
||||
else if (strcmp(inner_obj_name, "pop_daily_card_price") == 0) PaymentOption.pop_daily_card_price = k->value.GetInt();
|
||||
else if (strcmp(inner_obj_name, "pop_multi_hour_price") == 0) PaymentOption.pop_multi_hour_price = k->value.GetInt();
|
||||
break;
|
||||
case MemberType::DurationType:
|
||||
if (strcmp(inner_obj_name, "pun_id") == 0) Duration.pun_id = k->value.GetInt();
|
||||
|
308
main/main.cpp
308
main/main.cpp
File diff suppressed because one or more lines are too long
@@ -7,8 +7,6 @@ QMAKE_CFLAGS = -c -pipe -std=c11 -g -O0 -Wall -Wno-attributes -W -DDEBUG -D_REEN
|
||||
QMAKE_CXX_FLAGS += -std=c11
|
||||
|
||||
INCLUDEPATH += $$_PRO_FILE_PWD_/../../MOBILISIS-Calculator/library/include/mobilisis/
|
||||
INCLUDEPATH += $$_PRO_FILE_PWD_/../../MOBILISIS-Calculator/library/include/rapidjson/
|
||||
INCLUDEPATH += $$_PRO_FILE_PWD_/../../MOBILISIS-Calculator/library/include/
|
||||
INCLUDEPATH += .
|
||||
|
||||
unix {
|
||||
|
@@ -1,13 +1,10 @@
|
||||
{
|
||||
"Project" : "Schoenau",
|
||||
"Version" : "1.0.0",
|
||||
"Info" : "",
|
||||
"Currency": [
|
||||
{
|
||||
"pcu_id": 1,
|
||||
"pcu_sign": "€",
|
||||
"pcu_major": "Euro",
|
||||
"pcu_minor": "Cent",
|
||||
"pcu_id": 2,
|
||||
"pcu_sign": "Ft",
|
||||
"pcu_major": "HUF",
|
||||
"pcu_minor": "",
|
||||
"pcu_active": true
|
||||
}
|
||||
],
|
||||
@@ -31,65 +28,26 @@
|
||||
],
|
||||
"PaymentOption": [
|
||||
{
|
||||
"pop_id": 1099,
|
||||
"pop_label": "Zone 1",
|
||||
"pop_payment_method_id": 4,
|
||||
"pop_day_end_time": "15:20:00",
|
||||
"pop_day_night_end_time": "15:20:00",
|
||||
"pop_id": 1049,
|
||||
"pop_label": "Zone Lila",
|
||||
"pop_payment_method_id": 3,
|
||||
"pop_day_end_time": "16:25:00",
|
||||
"pop_day_night_end_time": "16:25:00",
|
||||
"pop_price_night": 0,
|
||||
"pop_min_time": 60,
|
||||
"pop_max_time": 10080,
|
||||
"pop_min_price": 3,
|
||||
"pop_min_time": 15,
|
||||
"pop_max_time": 300,
|
||||
"pop_min_price": 0,
|
||||
"pop_carry_over": 1,
|
||||
"pop_daily_card_price": 0,
|
||||
"pop_multi_hour_price": 8
|
||||
"pop_daily_card_price": 900,
|
||||
"pop_multi_hour_price":500
|
||||
|
||||
}
|
||||
],
|
||||
"PaymentRate": [
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_option_id": 1049,
|
||||
"pra_payment_unit_id": 1,
|
||||
"pra_price": 3
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 6,
|
||||
"pra_price": 7
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 5,
|
||||
"pra_price": 8
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 7,
|
||||
"pra_price": 16
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 8,
|
||||
"pra_price": 24
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 9,
|
||||
"pra_price": 32
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 10,
|
||||
"pra_price": 40
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 11,
|
||||
"pra_price": 48
|
||||
},
|
||||
{
|
||||
"pra_payment_option_id": 1099,
|
||||
"pra_payment_unit_id": 12,
|
||||
"pra_price": 56
|
||||
"pra_price": 150
|
||||
}
|
||||
],
|
||||
"Duration": [
|
||||
@@ -104,44 +62,746 @@
|
||||
"pun_duration": 15
|
||||
},
|
||||
{
|
||||
"pun_id": 5,
|
||||
"pun_label": "24h",
|
||||
"pun_duration": 1440
|
||||
"pun_id": 4,
|
||||
"pun_label": "1 min",
|
||||
"pun_duration": 1
|
||||
}
|
||||
],
|
||||
"WeekDaysWorktime": [
|
||||
{
|
||||
"pwd_id": 621,
|
||||
"pwd_period_week_day_id": 36,
|
||||
"pwd_period_day_in_week_id": 1,
|
||||
"pwd_time_from": "08:00:00",
|
||||
"pwd_time_to": "18:00:00"
|
||||
},
|
||||
{
|
||||
"pun_id": 6,
|
||||
"pun_label": "3h",
|
||||
"pun_duration": 180
|
||||
"pwd_id": 622,
|
||||
"pwd_period_week_day_id": 36,
|
||||
"pwd_period_day_in_week_id": 2,
|
||||
"pwd_time_from": "08:00:00",
|
||||
"pwd_time_to": "18:00:00"
|
||||
},
|
||||
{
|
||||
"pun_id": 7,
|
||||
"pun_label": "48h",
|
||||
"pun_duration": 2880
|
||||
"pwd_id": 623,
|
||||
"pwd_period_week_day_id": 36,
|
||||
"pwd_period_day_in_week_id": 3,
|
||||
"pwd_time_from": "08:00:00",
|
||||
"pwd_time_to": "18:00:00"
|
||||
},
|
||||
{
|
||||
"pun_id": 8,
|
||||
"pun_label": "72h",
|
||||
"pun_duration": 4320
|
||||
"pwd_id": 624,
|
||||
"pwd_period_week_day_id": 36,
|
||||
"pwd_period_day_in_week_id": 4,
|
||||
"pwd_time_from": "08:00:00",
|
||||
"pwd_time_to": "18:00:00"
|
||||
},
|
||||
{
|
||||
"pun_id": 9,
|
||||
"pun_label": "96h",
|
||||
"pun_duration": 5670
|
||||
"pwd_id": 625,
|
||||
"pwd_period_week_day_id": 36,
|
||||
"pwd_period_day_in_week_id": 5,
|
||||
"pwd_time_from": "08:00:00",
|
||||
"pwd_time_to": "18:00:00"
|
||||
}
|
||||
],
|
||||
"PeriodYear": [
|
||||
{
|
||||
"pye_id": 8,
|
||||
"pye_label": "Whole year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
},
|
||||
{
|
||||
"pun_id": 10,
|
||||
"pun_label": "120h",
|
||||
"pun_duration": 7200
|
||||
"pye_id": 9,
|
||||
"pye_label": "Whole year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
},
|
||||
{
|
||||
"pun_id": 11,
|
||||
"pun_label": "144h",
|
||||
"pun_duration": 8640
|
||||
"pye_id": 10,
|
||||
"pye_label": "Whole year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
},
|
||||
{
|
||||
"pun_id": 12,
|
||||
"pun_label": "168h",
|
||||
"pun_duration": 10080
|
||||
"pye_id": 11,
|
||||
"pye_label": "Whole Year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
},
|
||||
{
|
||||
"pye_id": 12,
|
||||
"pye_label": "Whole Year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
},
|
||||
{
|
||||
"pye_id": 13,
|
||||
"pye_label": "Whole Year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
},
|
||||
{
|
||||
"pye_id": 14,
|
||||
"pye_label": "Whole Year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
},
|
||||
{
|
||||
"pye_id": 15,
|
||||
"pye_label": "Whole year",
|
||||
"pye_start_month": 1,
|
||||
"pye_start_day": 1,
|
||||
"pye_end_month": 12,
|
||||
"pye_end_day": 31
|
||||
}
|
||||
],
|
||||
"SpecialDaysWorktime": [
|
||||
{
|
||||
"pedwt_id": 2156,
|
||||
"pedwt_period_exc_day_id": 2024,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2158,
|
||||
"pedwt_period_exc_day_id": 2025,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2160,
|
||||
"pedwt_period_exc_day_id": 2026,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2162,
|
||||
"pedwt_period_exc_day_id": 2027,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2164,
|
||||
"pedwt_period_exc_day_id": 2028,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2170,
|
||||
"pedwt_period_exc_day_id": 2030,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2172,
|
||||
"pedwt_period_exc_day_id": 2032,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2174,
|
||||
"pedwt_period_exc_day_id": 11,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2175,
|
||||
"pedwt_period_exc_day_id": 13,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2178,
|
||||
"pedwt_period_exc_day_id": 2022,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2179,
|
||||
"pedwt_period_exc_day_id": 14,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2184,
|
||||
"pedwt_period_exc_day_id": 2021,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2188,
|
||||
"pedwt_period_exc_day_id": 2031,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2189,
|
||||
"pedwt_period_exc_day_id": 2029,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2194,
|
||||
"pedwt_period_exc_day_id": 2034,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2200,
|
||||
"pedwt_period_exc_day_id": 2037,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2202,
|
||||
"pedwt_period_exc_day_id": 2038,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2226,
|
||||
"pedwt_period_exc_day_id": 2016,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2245,
|
||||
"pedwt_period_exc_day_id": 2035,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2246,
|
||||
"pedwt_period_exc_day_id": 2036,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2249,
|
||||
"pedwt_period_exc_day_id": 2050,
|
||||
"pedwt_time_from": "08:00:00",
|
||||
"pedwt_time_to": "16:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2250,
|
||||
"pedwt_period_exc_day_id": 2051,
|
||||
"pedwt_time_from": "08:00:00",
|
||||
"pedwt_time_to": "16:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2251,
|
||||
"pedwt_period_exc_day_id": 2052,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2252,
|
||||
"pedwt_period_exc_day_id": 2053,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2253,
|
||||
"pedwt_period_exc_day_id": 2054,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2254,
|
||||
"pedwt_period_exc_day_id": 2055,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2255,
|
||||
"pedwt_period_exc_day_id": 2056,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2256,
|
||||
"pedwt_period_exc_day_id": 2057,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2257,
|
||||
"pedwt_period_exc_day_id": 2058,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2258,
|
||||
"pedwt_period_exc_day_id": 2059,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2259,
|
||||
"pedwt_period_exc_day_id": 2060,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2260,
|
||||
"pedwt_period_exc_day_id": 2061,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2261,
|
||||
"pedwt_period_exc_day_id": 2062,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2262,
|
||||
"pedwt_period_exc_day_id": 2063,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2263,
|
||||
"pedwt_period_exc_day_id": 2064,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2264,
|
||||
"pedwt_period_exc_day_id": 2065,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2265,
|
||||
"pedwt_period_exc_day_id": 2066,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2266,
|
||||
"pedwt_period_exc_day_id": 2067,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2267,
|
||||
"pedwt_period_exc_day_id": 2068,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2268,
|
||||
"pedwt_period_exc_day_id": 2069,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2269,
|
||||
"pedwt_period_exc_day_id": 2070,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
},
|
||||
{
|
||||
"pedwt_id": 2270,
|
||||
"pedwt_period_exc_day_id": 2071,
|
||||
"pedwt_time_from": "00:00:00",
|
||||
"pedwt_time_to": "00:00:00",
|
||||
"pedwt_price": 0
|
||||
}
|
||||
],
|
||||
"SpecialDays": [
|
||||
{
|
||||
"ped_id": 11,
|
||||
"ped_label": "Christmas 1st day",
|
||||
"ped_date_start": "2022-12-25",
|
||||
"ped_date_end": "2022-12-25",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 13,
|
||||
"ped_label": "Christmas 2nd day",
|
||||
"ped_date_start": "2022-12-26",
|
||||
"ped_date_end": "2022-12-26",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 14,
|
||||
"ped_label": "Republic Day (Hungary)",
|
||||
"ped_date_start": "2022-10-23",
|
||||
"ped_date_end": "2022-10-23",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2016,
|
||||
"ped_label": "Christmas (Sunday)",
|
||||
"ped_date_start": "2022-12-24",
|
||||
"ped_date_end": "2022-12-24",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2021,
|
||||
"ped_label": "Holiday (Hungary)",
|
||||
"ped_date_start": "2022-12-31",
|
||||
"ped_date_end": "2022-12-31",
|
||||
"ped_period_special_day_id": 1,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2022,
|
||||
"ped_label": "NewYear",
|
||||
"ped_date_start": "2023-01-01",
|
||||
"ped_date_end": "2023-01-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2024,
|
||||
"ped_label": "Good Friday",
|
||||
"ped_date_start": "2023-04-07",
|
||||
"ped_date_end": "2023-04-07",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2025,
|
||||
"ped_label": "Easter Sunday",
|
||||
"ped_date_start": "2023-04-09",
|
||||
"ped_date_end": "2023-04-09",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2026,
|
||||
"ped_label": "Easter Monday",
|
||||
"ped_date_start": "2023-04-10",
|
||||
"ped_date_end": "2023-04-10",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2027,
|
||||
"ped_label": "Whit Sunday",
|
||||
"ped_date_start": "2023-05-28",
|
||||
"ped_date_end": "2023-05-28",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2028,
|
||||
"ped_label": "Whit Monday",
|
||||
"ped_date_start": "2023-05-29",
|
||||
"ped_date_end": "2023-05-29",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2029,
|
||||
"ped_label": "Revolution Day (Hungary)",
|
||||
"ped_date_start": "2023-03-15",
|
||||
"ped_date_end": "2023-03-15",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2030,
|
||||
"ped_label": "Labour Day",
|
||||
"ped_date_start": "2023-05-01",
|
||||
"ped_date_end": "2023-05-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2031,
|
||||
"ped_label": "Saint Stephens Day (Hungary)",
|
||||
"ped_date_start": "2023-08-20",
|
||||
"ped_date_end": "2023-08-20",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2032,
|
||||
"ped_label": "All Saints Day",
|
||||
"ped_date_start": "2023-11-01",
|
||||
"ped_date_end": "2023-11-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2034,
|
||||
"ped_label": "Good Friday",
|
||||
"ped_date_start": "2024-03-29",
|
||||
"ped_date_end": "2024-03-29",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2035,
|
||||
"ped_label": "Easter",
|
||||
"ped_date_start": "2024-03-31",
|
||||
"ped_date_end": "2024-03-31",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2036,
|
||||
"ped_label": "Easter Monday",
|
||||
"ped_date_start": "2024-04-01",
|
||||
"ped_date_end": "2024-04-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2037,
|
||||
"ped_label": "Whit Monday",
|
||||
"ped_date_start": "2024-05-20",
|
||||
"ped_date_end": "2024-05-20",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2038,
|
||||
"ped_label": "Whit Sunday",
|
||||
"ped_date_start": "2024-05-19",
|
||||
"ped_date_end": "2024-05-19",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2050,
|
||||
"ped_label": "Uskrs",
|
||||
"ped_date_start": "2023-04-16",
|
||||
"ped_date_end": "2023-04-16",
|
||||
"ped_period_special_day_id": 1,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2051,
|
||||
"ped_label": "Uskrs",
|
||||
"ped_date_start": "2023-04-16",
|
||||
"ped_date_end": "2023-04-16",
|
||||
"ped_period_special_day_id": 1,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2052,
|
||||
"ped_label": "Christmas 1st day",
|
||||
"ped_date_start": "2022-12-25",
|
||||
"ped_date_end": "2022-12-25",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2053,
|
||||
"ped_label": "Christmas 2nd day",
|
||||
"ped_date_start": "2022-12-26",
|
||||
"ped_date_end": "2022-12-26",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2054,
|
||||
"ped_label": "Republic Day (Hungary)",
|
||||
"ped_date_start": "2022-10-23",
|
||||
"ped_date_end": "2022-10-23",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2055,
|
||||
"ped_label": "Christmas (Sunday)",
|
||||
"ped_date_start": "2022-12-24",
|
||||
"ped_date_end": "2022-12-24",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2056,
|
||||
"ped_label": "Holiday (Hungary)",
|
||||
"ped_date_start": "2022-12-31",
|
||||
"ped_date_end": "2022-12-31",
|
||||
"ped_period_special_day_id": 1,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2057,
|
||||
"ped_label": "NewYear",
|
||||
"ped_date_start": "2023-01-01",
|
||||
"ped_date_end": "2023-01-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2058,
|
||||
"ped_label": "Good Friday",
|
||||
"ped_date_start": "2023-04-07",
|
||||
"ped_date_end": "2023-04-07",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2059,
|
||||
"ped_label": "Easter Sunday",
|
||||
"ped_date_start": "2023-04-09",
|
||||
"ped_date_end": "2023-04-09",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2060,
|
||||
"ped_label": "Easter Monday",
|
||||
"ped_date_start": "2023-04-10",
|
||||
"ped_date_end": "2023-04-10",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2061,
|
||||
"ped_label": "Whit Sunday",
|
||||
"ped_date_start": "2023-05-28",
|
||||
"ped_date_end": "2023-05-28",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2062,
|
||||
"ped_label": "Whit Monday",
|
||||
"ped_date_start": "2023-05-29",
|
||||
"ped_date_end": "2023-05-29",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2023
|
||||
},
|
||||
{
|
||||
"ped_id": 2063,
|
||||
"ped_label": "Revolution Day (Hungary)",
|
||||
"ped_date_start": "2023-03-15",
|
||||
"ped_date_end": "2023-03-15",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2064,
|
||||
"ped_label": "Labour Day",
|
||||
"ped_date_start": "2023-05-01",
|
||||
"ped_date_end": "2023-05-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2065,
|
||||
"ped_label": "Saint Stephens Day (Hungary)",
|
||||
"ped_date_start": "2023-08-20",
|
||||
"ped_date_end": "2023-08-20",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2066,
|
||||
"ped_label": "All Saints Day",
|
||||
"ped_date_start": "2023-11-01",
|
||||
"ped_date_end": "2023-11-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 0
|
||||
},
|
||||
{
|
||||
"ped_id": 2067,
|
||||
"ped_label": "Good Friday",
|
||||
"ped_date_start": "2024-03-29",
|
||||
"ped_date_end": "2024-03-29",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2068,
|
||||
"ped_label": "Easter",
|
||||
"ped_date_start": "2024-03-31",
|
||||
"ped_date_end": "2024-03-31",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2069,
|
||||
"ped_label": "Easter Monday",
|
||||
"ped_date_start": "2024-04-01",
|
||||
"ped_date_end": "2024-04-01",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2070,
|
||||
"ped_label": "Whit Monday",
|
||||
"ped_date_start": "2024-05-20",
|
||||
"ped_date_end": "2024-05-20",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
},
|
||||
{
|
||||
"ped_id": 2071,
|
||||
"ped_label": "Whit Sunday",
|
||||
"ped_date_start": "2024-05-19",
|
||||
"ped_date_end": "2024-05-19",
|
||||
"ped_period_special_day_id": 2,
|
||||
"ped_year": 2024
|
||||
}
|
||||
]
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
tariffs/tariff04.json
Normal file
1
tariffs/tariff04.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user