Fixed mapping unparsedReference / sepaReference to reference

This commit is contained in:
dankito 2024-09-02 19:39:45 +02:00
parent f1dad3bc26
commit b0b0fa6140
1 changed files with 5 additions and 1 deletions

View File

@ -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"
}