From b0b0fa614061f9c0c098466f89dd8ab5a4c5ef61 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 2 Sep 2024 19:39:45 +0200 Subject: [PATCH] Fixed mapping unparsedReference / sepaReference to reference --- .../net/codinux/banking/client/model/AccountTransaction.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt index 521da432..95e9f6af 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt @@ -7,7 +7,7 @@ import net.codinux.banking.client.model.config.NoArgConstructor open class AccountTransaction( val amount: Amount = Amount.Zero, val currency: String, - val reference: String, // Alternative: purpose (or Remittance information) + val unparsedReference: String, // Alternative: purpose (or Remittance information) /** * Transaction date (Buchungstag) - der Tag, an dem ein Zahlungsvorgang in das System einer Bank eingegangen ist. @@ -62,5 +62,9 @@ open class AccountTransaction( var category: String? = null, var notes: String? = null, ) { + + val reference: String + get() = sepaReference ?: unparsedReference + override fun toString() = "${valueDate.dayOfMonth}.${valueDate.monthNumber}.${valueDate.year} ${amount.toString().padStart(4, ' ')} ${if (currency == "EUR") "€" else currency} ${otherPartyName ?: ""} - $reference" } \ No newline at end of file