Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org) using the following scheme: MAJOR.MINOR.PATCH

## [0.55.0] - 2026-07-01

### Added
- Dolibarr expense report line `dateIncurred` computed date property

### Changed
- Updated Dolibarr expense report line date decoding/encoding

## [0.54.0] - 2026-07-01

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,20 @@ public final class DolibarrExpenseReportLine: CommonBusinessObjectLine {
/// Expense report line comments
public var comments: String?

// Computed

/// Expense report line date
public var dateIncurred: Date {
Date(timeIntervalSince1970: TimeInterval(date))
}

// MARK: - Enums

enum CodingKeys: String, CodingKey {
case quantity = "qty"
case unitPriceInclTax = "value_unit"
case date = "dates"
case dateDecode = "dates"
case dateEncode = "date"
case feeTypeId = "fk_c_type_fees"
case feeTypeCode = "type_fees_code"
case feeTypeLabel = "type_fees_libelle"
Expand Down Expand Up @@ -146,7 +154,7 @@ public final class DolibarrExpenseReportLine: CommonBusinessObjectLine {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.quantity = try container.decode(String.self, forKey: .quantity)
self.unitPriceInclTax = try container.decode(String.self, forKey: .unitPriceInclTax)
self.date = try container.decode(Int.self, forKey: .date)
self.date = try container.decode(Int.self, forKey: .dateDecode)
self.feeTypeId = try container.decode(String.self, forKey: .feeTypeId)
self.feeTypeCode = try container.decode(String.self, forKey: .feeTypeCode)
self.feeTypeLabel = try container.decode(String.self, forKey: .feeTypeLabel)
Expand Down Expand Up @@ -225,7 +233,7 @@ public final class DolibarrExpenseReportLine: CommonBusinessObjectLine {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(quantity, forKey: .quantity)
try container.encode(unitPriceInclTax, forKey: .unitPriceInclTax)
try container.encode(date, forKey: .date)
try container.encode(date, forKey: .dateEncode)
try container.encode(feeTypeId, forKey: .feeTypeId)
try container.encode(feeTypeCode, forKey: .feeTypeCode)
try container.encode(feeTypeLabel, forKey: .feeTypeLabel)
Expand Down
Loading