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 98e79663..4c2bbe55 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 @@ -5,9 +5,9 @@ import net.codinux.banking.client.model.config.NoArgConstructor @NoArgConstructor open class AccountTransaction( - val amount: Amount = Amount.Zero, + val amount: Amount = Amount.Zero, // TODO: a string is really bad in UI, find a better solution val currency: String, - val unparsedReference: String, // Alternative: purpose (or Remittance information) + val reference: String, // Alternative: Remittance information, Transaction description, (payment) purpose, payment reference /** * Transaction date (Buchungstag) - der Tag, an dem ein Zahlungsvorgang in das System einer Bank eingegangen ist. @@ -22,52 +22,56 @@ open class AccountTransaction( */ val valueDate: LocalDate, + // deutsche Begriffe: "Transaktionspartei" oder "Beteiligte Partei" + // Englische: Transaction party (ist die beste Wahl für eine neutrale und übergreifende Beschreibung), + // Counterparty (ist nützlich in formellen oder finanziellen Kontexten), Participant (ist breiter gefasst, aber weniger präzise) val otherPartyName: String? = null, // Alternatives: Parties involved, Transaction parties.single names: Beneficiary, Payee respectively Payer, Debtor val otherPartyBankCode: String? = null, val otherPartyAccountId: String? = null, - val bookingText: String? = null, - val information: String? = null, - - val statementNumber: Int? = null, - val sequenceNumber: Int? = null, + val postingText: String? = null, val openingBalance: Amount? = null, val closingBalance: Amount? = null, - val endToEndReference: String? = null, + val statementNumber: Int? = null, + val sheetNumber: Int? = null, + val customerReference: String? = null, + val bankReference: String? = null, + val furtherInformation: String? = null, + + val endToEndReference: String? = null, val mandateReference: String? = null, val creditorIdentifier: String? = null, val originatorsIdentificationCode: String? = null, val compensationAmount: String? = null, val originalAmount: String? = null, - val sepaReference: String? = null, val deviantOriginator: String? = null, val deviantRecipient: String? = null, val referenceWithNoSpecialType: String? = null, - val primaNotaNumber: String? = null, - val textKeySupplement: String? = null, - val currencyType: String? = null, - val bookingKey: String? = null, - val referenceForTheAccountOwner: String? = null, - val referenceOfTheAccountServicingInstitution: String? = null, - val supplementaryDetails: String? = null, + val journalNumber: String? = null, + val textKeyAddition: String? = null, - val transactionReferenceNumber: String? = null, - val relatedReferenceNumber: String? = null, + val orderReferenceNumber: String? = null, + val referenceNumber: String? = null, + + /** + * Storno, ob die Buchung storniert wurde(?). + * Aus: + * „RC“ = Storno Haben + * „RD“ = Storno Soll + */ + val isReversal: Boolean = false, var userSetDisplayName: String? = null, var category: String? = null, var notes: String? = null, ) { - val reference: String - get() = sepaReference ?: unparsedReference - open val identifier by lazy { - "$amount $currency $bookingDate $valueDate $unparsedReference $sepaReference $otherPartyName $otherPartyBankCode $otherPartyAccountId" + "$amount $currency $bookingDate $valueDate $reference $otherPartyName $otherPartyBankCode $otherPartyAccountId" } override fun toString() = "${valueDate.dayOfMonth}.${valueDate.monthNumber}.${valueDate.year} ${amount.toString().padStart(4, ' ')} ${if (currency == "EUR") "€" else currency} ${otherPartyName ?: ""} - $reference" diff --git a/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt b/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt index 5f08ffa5..d9959d9b 100644 --- a/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt +++ b/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt @@ -169,22 +169,23 @@ open class FinTs4kMapper { mapAmount(transaction.amount), transaction.amount.currency.code, transaction.unparsedReference, transaction.bookingDate, transaction.valueDate, transaction.otherPartyName, transaction.otherPartyBankCode, transaction.otherPartyAccountId, - transaction.bookingText, null, - transaction.statementNumber, transaction.sequenceNumber, + + transaction.bookingText, mapNullableAmount(transaction.openingBalance), mapNullableAmount(transaction.closingBalance), - transaction.endToEndReference, transaction.customerReference, transaction.mandateReference, - transaction.creditorIdentifier, transaction.originatorsIdentificationCode, - transaction.compensationAmount, transaction.originalAmount, - transaction.sepaReference, - transaction.deviantOriginator, transaction.deviantRecipient, - transaction.referenceWithNoSpecialType, transaction.primaNotaNumber, transaction.textKeySupplement, + transaction.statementNumber, transaction.sequenceNumber, - transaction.currencyType, transaction.bookingKey, transaction.referenceForTheAccountOwner, transaction.referenceOfTheAccountServicingInstitution, transaction.supplementaryDetails, - transaction.transactionReferenceNumber, transaction.relatedReferenceNumber + transaction.endToEndReference, transaction.mandateReference, + transaction.creditorIdentifier, transaction.originatorsIdentificationCode, + transaction.compensationAmount, transaction.originalAmount, + transaction.deviantOriginator, transaction.deviantRecipient, + transaction.referenceWithNoSpecialType, transaction.primaNotaNumber, transaction.textKeySupplement, + + transaction.transactionReferenceNumber, transaction.relatedReferenceNumber, + false ) protected open fun mapNullableAmount(amount: Money?) = amount?.let { mapAmount(it) }