Compare commits

...

19 Commits

Author SHA1 Message Date
6ef57792ce Add PrepaidOptionType.
PrepaidType declared as deprecated.
2024-08-15 21:16:46 +02:00
ec9f7d9262 Introduce bew memebers to control the handling of duration objects
(especially for GetTimeSteps() computation).
2024-08-15 21:14:57 +02:00
a2c40fa32a re-introduce prepay-option for backward compatibility 2024-08-15 21:13:25 +02:00
25b3143d88 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-08-02 14:37:42 +02:00
0856f10ca9 GetDurationFromCost():
Fix computation of end-time when pop_accumulate_durations is set
	in tariff-file.
2024-08-02 14:34:44 +02:00
88c703ecc2 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-08-02 13:21:54 +02:00
465b2274a1 compute_duration_for_parking_ticket():
Adapt end-time in case it is midnight: 00:00 -> 23:59
2024-08-02 13:15:11 +02:00
f946cd13e4 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-08-02 11:55:12 +02:00
8d1cbe7337 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-08-02 11:29:10 +02:00
3a98a14eb0 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-31 10:50:03 +02:00
0d0d34cb87 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-31 08:06:45 +02:00
8fff7a76f6 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-30 10:02:57 +02:00
84d807930e Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-26 17:35:38 +02:00
18f4e74eea Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-26 17:05:45 +02:00
bfd9f3b80c Fix: add missing parameter PermitType 2024-07-26 14:11:37 +02:00
cb69d3ca2f Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-26 13:35:56 +02:00
63043931c2 Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-26 13:12:56 +02:00
1ea03f522c Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-26 13:01:17 +02:00
ac20a767df Merge branch 'kleipeda-experimental' of /home/siegert/atbfs01entwicklung/Elektronik/PTU/git_bare_repos/libmobilisis-calc into kleipeda-experimental 2024-07-26 11:08:02 +02:00
5 changed files with 53 additions and 25 deletions

View File

@@ -28,6 +28,7 @@
#include "tariff_interpolation.h"
#include "tariff_prepaid.h"
#include "tariff_carryover.h"
#include "tariff_prepay.h"
#include "tariff_permit_type.h"
#include <QVector>
@@ -47,6 +48,7 @@ public:
using ATBPaymentOptionType = std::multimap<int, ATBPaymentOption>;
using TariffInterpolationType = std::multimap<int, ATBInterpolation>;
using TariffPrepaidType = std::multimap<int, ATBPrepaid>;
using TariffPrepayOptionType = std::multimap<int, ATBPrepay>;
using TariffCarryOverType = std::multimap<int, ATBCarryOver>;
using TariffDurationType = std::multimap<int, ATBDuration>;
@@ -54,7 +56,7 @@ public:
ATBCurrency Currency;
ATBDuration duration;
TariffDurationType Duration;
TariffDurationType Duration;
multimap<int, ATBPaymentMethod> PaymentMethod;
multimap<int, ATBPaymentRate> PaymentRate;
SpecialDaysWorktimeType SpecialDaysWorktime;
@@ -71,6 +73,7 @@ public:
TariffProductType TariffProduct;
TariffInterpolationType TariffInterpolations;
TariffPrepaidType TariffPrepaidOptions;
TariffPrepayOptionType TariffPrepayOptions;
TariffCarryOverType TariffCarryOverOptions;
/// <summary>

View File

@@ -12,7 +12,12 @@ public:
, pun_duration_saved(0)
, pun_duration_min(0)
, pun_duration_max(0)
, pun_interpolation_id(-1) {
, pun_interpolation_id(-1)
, pun_netto(false)
, pun_brutto(false)
, pun_fixed(false)
, pun_requires_change(false)
, pun_next_step_correction(0) {
}
friend QDebug operator<<(QDebug debug, ATBDuration const &td) {
@@ -25,6 +30,10 @@ public:
<< " pun_duration_saved: " << td.pun_duration_saved << "\n"
<< " pun_duration_min: " << td.pun_duration_min << "\n"
<< " pun_duration_max: " << td.pun_duration_max << "\n"
<< " pun_netto: " << td.pun_netto << "\n"
<< " pun_brutto: " << td.pun_brutto << "\n"
<< " pun_fixed: " << td.pun_fixed << "\n"
<< " pun_requires_change: " << td.pun_requires_change << "\n"
<< "pun_interpolation_id: " << td.pun_interpolation_id << "\n";
return debug;
@@ -33,8 +42,13 @@ public:
int pun_id;
std::string pun_label;
int pun_duration;
int pun_duration_saved;
int pun_duration_min;
int pun_duration_max;
int pun_interpolation_id;
int pun_duration_saved;
int pun_duration_min;
int pun_duration_max;
int pun_interpolation_id;
bool pun_netto; // the timestep expressed by this duration is a netto timestep
bool pun_brutto; // the timestep expressed by this duration is a brutto timestep
bool pun_fixed; // the value given in tariff-file is fixed (constant)
bool pun_requires_change; // the value has to be changes (controlled by other parameters)
int pun_next_step_correction;
};

View File

@@ -13,16 +13,17 @@ enum MemberType
WeekDaysWorkTimeType = 0x06,
SpecialDaysWorktimeType = 0x07,
SpecialDaysType = 0x08,
PeriodYearType = 0x09,
DailyTicketType = 0x0A,
CustomerType = 0x0B,
TimeBaseType = 0x0C,
TimeRangeType = 0x0D,
TimeStepConfigType = 0x0E,
ProductType = 0x0F,
InterpolationType = 0x10,
PrepaidType = 0x11,
CarryOverType = 0x12
PeriodYearType = 0x09,
DailyTicketType = 0x0A,
CustomerType = 0x0B,
TimeBaseType = 0x0C,
TimeRangeType = 0x0D,
TimeStepConfigType = 0x0E,
ProductType = 0x0F,
InterpolationType = 0x10,
PrepaidType = 0x11, // deprecated
CarryOverType = 0x12,
PrepaidOptionType = 0x13,
};
#endif // MEMBER_TYPE_H_INCLUDED

View File

@@ -996,15 +996,20 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
} else {
ticketEndTime = QDateTime::fromString(endTime,Qt::ISODate);
// DEBUG
//qCritical() << "compute_duration_for_parking_ticket(): ";
//qCritical() << " endTime: " << endTime;
//qCritical() << " ticketEndTime: " << ticketEndTime;
if (!ticketEndTime.isValid()) {
calcState.setDesc(QString("ticketEndTime=%1").arg(endTime));
return calcState.set(CalcState::State::WRONG_ISO_TIME_FORMAT);
}
if (ticketEndTime.time().hour() == 0 && ticketEndTime.time().minute() == 0) {
ticketEndTime = ticketEndTime.addDays(-1);
ticketEndTime.setTime(QTime(23, 59, 0));
}
// DEBUG
qCritical() << "compute_duration_for_parking_ticket(): ";
qCritical() << " endTime: " << endTime;
qCritical() << " ticketEndTime: " << ticketEndTime;
}
} else {
return calcState.set(CalcState::State::INVALID_START_DATE);

View File

@@ -181,8 +181,8 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
price = pra_price;
}
//qCritical() << DBG_HEADER << " PRICE" << price << "COST" << cost;
//qCritical() << DBG_HEADER << " duration id" << durationId;
// qCritical() << DBG_HEADER << " PRICE" << price << "COST" << cost;
// qCritical() << DBG_HEADER << " duration id" << durationId;
auto search = cfg->Duration.find(durationId);
if (search != cfg->Duration.end()) {
@@ -207,11 +207,16 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
//found = true;
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration in minutes" << durationInMinutes;
QDateTime d(inputDate.addSecs(duration_previous * 60));
QDateTime d;
if (pop_accumulate_durations) {
d = inputDate.addSecs(durationInMinutes * 60);
} else {
d = inputDate.addSecs(duration_previous * 60);
}
qCritical() << DBG_HEADER << " provided price (cost):" << cost;
qCritical() << DBG_HEADER << " computed time for price (minutes):" << duration_previous;
qCritical() << DBG_HEADER << "configured minimal parking time (minutes):" << cfg->getPaymentOptions(paymentOptionIndex).pop_min_time;
qCritical() << DBG_HEADER << " minimal parking time (minutes):" << cfg->getPaymentOptions(paymentOptionIndex).pop_min_time;
if (duration_previous < cfg->getPaymentOptions(paymentOptionIndex).pop_min_time) {
return CalcState::BELOW_MIN_PARKING_TIME.toStdString(); // minimal parking time is set by GetTimeSteps()