From cb34c866653ec520de8adbe96341b85eff789db6 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 5 Sep 2024 23:31:02 +0200 Subject: [PATCH] Changed order of opening and closing balance --- .../net/codinux/banking/fints/mapper/FinTsModelMapper.kt | 5 ++++- .../codinux/banking/fints/model/AccountTransaction.kt | 9 +++++---- .../fints/transactions/Mt940AccountTransactionsParser.kt | 5 +++-- .../dankito/banking/client/model/AccountTransaction.kt | 7 ++++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt index 7850ae9b..153ad98e 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/mapper/FinTsModelMapper.kt @@ -116,9 +116,12 @@ open class FinTsModelMapper { transaction.bookingDate, transaction.valueDate, transaction.otherPartyName, transaction.otherPartyBankCode, transaction.otherPartyAccountId, - transaction.postingText, transaction.statementNumber, transaction.sheetNumber, + transaction.postingText, + transaction.openingBalance, transaction.closingBalance, + transaction.statementNumber, transaction.sheetNumber, + transaction.customerReference, transaction.bankReference, transaction.furtherInformation, transaction.endToEndReference, transaction.mandateReference, transaction.creditorIdentifier, transaction.originatorsIdentificationCode, diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/AccountTransaction.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/AccountTransaction.kt index 2c4bfc8d..edf2daab 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/AccountTransaction.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/AccountTransaction.kt @@ -29,6 +29,10 @@ open class AccountTransaction( * Buchungstext, z. B. DAUERAUFTRAG, BARGELDAUSZAHLUNG, ONLINE-UEBERWEISUNG, FOLGELASTSCHRIFT, ... */ val postingText: String?, + + val openingBalance: Money?, + val closingBalance: Money?, + /** * Auszugsnummer */ @@ -38,9 +42,6 @@ open class AccountTransaction( */ val sheetNumber: Int?, - val openingBalance: Money?, - val closingBalance: Money?, - /** * Kundenreferenz. */ @@ -115,7 +116,7 @@ open class AccountTransaction( constructor(account: AccountData, amount: Money, unparsedReference: String, bookingDate: LocalDate, valueDate: LocalDate, otherPartyName: String?, otherPartyBankCode: String?, otherPartyAccountId: String?, postingText: String? = null) : this(account, amount, unparsedReference, bookingDate, valueDate, otherPartyName, otherPartyBankCode, otherPartyAccountId, postingText, - 0, null, null, null, + null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, "", null, null, "", null, false) diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/transactions/Mt940AccountTransactionsParser.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/transactions/Mt940AccountTransactionsParser.kt index bd9a2ce1..e6cb8486 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/transactions/Mt940AccountTransactionsParser.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/transactions/Mt940AccountTransactionsParser.kt @@ -60,12 +60,13 @@ open class Mt940AccountTransactionsParser( transaction.information?.otherPartyAccountId, transaction.information?.postingText, - statement.statementNumber, - statement.sheetNumber, Money(mapAmount(statement.openingBalance), currency), Money(mapAmount(statement.closingBalance), currency), + statement.statementNumber, + statement.sheetNumber, + // :60: customer reference: Wenn „KREF+“ eingestellt ist, dann erfolgt die Angabe der Referenznummer in Tag :86: . transaction.information?.customerReference ?: transaction.statementLine.customerReference, transaction.statementLine.bankReference, diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/client/model/AccountTransaction.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/client/model/AccountTransaction.kt index dc055eda..19e3812f 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/client/model/AccountTransaction.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/client/model/AccountTransaction.kt @@ -20,12 +20,13 @@ open class AccountTransaction( val otherPartyAccountId: String?, val postingText: String?, - val statementNumber: Int, - val sheetNumber: Int?, val openingBalance: Money?, val closingBalance: Money?, + val statementNumber: Int, + val sheetNumber: Int?, + val customerReference: String?, val bankReference: String?, val furtherInformation: String?, @@ -51,7 +52,7 @@ open class AccountTransaction( constructor(amount: Money, unparsedReference: String, bookingDate: LocalDate, valueDate: LocalDate, otherPartyName: String?, otherPartyBankCode: String?, otherPartyAccountId: String?, postingText: String?) : this(amount, unparsedReference, bookingDate, valueDate, otherPartyName, otherPartyBankCode, otherPartyAccountId, postingText, - 0, null, null, null, + null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null)