Added:
int computeBruttoDurationInSecs() and
    computeBruttoDateTime() based on it.
    Given a netto duration (in seconds), compute a corresponding
    brutto duration.
			
			
This commit is contained in:
		@@ -27,6 +27,13 @@ class Calculator {
 | 
			
		||||
                                            int netto_parking_time,
 | 
			
		||||
                                            int paymentOptionIndex);
 | 
			
		||||
 | 
			
		||||
    int computeBruttoDurationInSecs(Configuration const *cfg,
 | 
			
		||||
                                    QDateTime const &from,
 | 
			
		||||
                                    int durationInSecs, bool maxBrutto = false);
 | 
			
		||||
 | 
			
		||||
    QDateTime computeBruttoDateTime(Configuration const *cfg,
 | 
			
		||||
                                    QDateTime const &from,
 | 
			
		||||
                                    int durationInSecs, bool maxBrutto = false);
 | 
			
		||||
protected:
 | 
			
		||||
    explicit Calculator() = default;
 | 
			
		||||
 | 
			
		||||
@@ -70,8 +77,7 @@ public:
 | 
			
		||||
	/// <param name="start_datetime">Date/time of payment to be conducted in ISO8601 format (e.g. 2022-12-25T08:00:00Z)</param>
 | 
			
		||||
	/// <param name="price"></param>
 | 
			
		||||
	/// <returns>Returns duration in seconds (data type: double)</returns>
 | 
			
		||||
    std::string GetDurationFromCost(Configuration* cfg, uint8_t vehicle_type, char const* start_datetime, double price,
 | 
			
		||||
                                    PermitType permitType, bool nextDay = false, bool prepaid = false);
 | 
			
		||||
    std::string GetDurationFromCost(Configuration* cfg, uint8_t vehicle_type, char const* start_datetime, double price, PermitType permitType, bool nextDay = false, bool prepaid = false);
 | 
			
		||||
 | 
			
		||||
	/// <summary>
 | 
			
		||||
	///  Gets cost from duration in seconds
 | 
			
		||||
@@ -79,11 +85,10 @@ 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="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, QDateTime &start_datetime, QDateTime & end_datetime, int durationMin,
 | 
			
		||||
                               PermitType permitType, bool nextDay = false, bool prepaid = false);
 | 
			
		||||
    double GetCostFromDuration(Configuration* cfg, uint8_t vehicle_type, QDateTime &start_datetime, QDateTime & end_datetime, int durationMin, PermitType permitType, bool nextDay = false, bool prepaid = false);
 | 
			
		||||
 | 
			
		||||
    // Daily ticket
 | 
			
		||||
    QDateTime GetDailyTicketDuration(Configuration* cfg, const QDateTime start_datetime, uint8_t payment_option, bool carry_over);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user