Added transactionIdentifier as technicalId may gets set by persistence layer and transaction id therefore gets lost

This commit is contained in:
dankito 2020-08-31 11:32:08 +02:00
parent 88df169f92
commit 842ff7f0b2
1 changed files with 5 additions and 2 deletions

View File

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