From 842ff7f0b2a7d921326e52654e355595c0d4680f Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 31 Aug 2020 11:32:08 +0200 Subject: [PATCH] Added transactionIdentifier as technicalId may gets set by persistence layer and transaction id therefore gets lost --- .../net/dankito/banking/ui/model/AccountTransaction.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/AccountTransaction.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/AccountTransaction.kt index 5ff95a5b..130b15ff 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/AccountTransaction.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/AccountTransaction.kt @@ -69,9 +69,12 @@ open class AccountTransaction( 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "", "", null, null, "", null) - open var technicalId: String = createDefaultId() + open var technicalId: String = buildTransactionIdentifier() - protected fun createDefaultId() : String { + open val transactionIdentifier: String + get() = buildTransactionIdentifier() + + protected fun buildTransactionIdentifier() : String { if (bankAccount != null) { return "${bankAccount.technicalId} ${IdDateFormat.format(bookingDate)} ${IdDateFormat.format(valueDate)} $amount $currency $unparsedUsage $otherPartyName $otherPartyBankCode $otherPartyAccountId" }