func (m *MT940) AccountTransactions() []domain.AccountTransaction {
	accountConnection := domain.AccountConnection{BankID: m.Account.BankID, AccountID: m.Account.AccountID, CountryCode: 280}
	var transactions []domain.AccountTransaction
	for _, transactionSequence := range m.Transactions {
		tr := transactionSequence.Transaction
		descr := transactionSequence.Description
		var amount float64
		if tr.DebitCreditIndicator == "D" {
			amount = -tr.Amount
		} else {
			amount = tr.Amount
		}
		transaction := domain.AccountTransaction{
			Account:     accountConnection,
			Amount:      domain.Amount{Amount: amount, Currency: m.StartingBalance.Currency},
			ValutaDate:  tr.ValutaDate.Time,
			BookingDate: tr.BookingDate.Time,
			AccountBalanceBefore: domain.Balance{
				Amount: domain.Amount{
					Amount:   m.StartingBalance.Amount,
					Currency: m.StartingBalance.Currency,
				},
				TransmissionDate: m.StartingBalance.BookingDate.Time,
			},
			AccountBalanceAfter: domain.Balance{
				Amount: domain.Amount{
					Amount:   m.ClosingBalance.Amount,
					Currency: m.ClosingBalance.Currency,
				},
				TransmissionDate: m.ClosingBalance.BookingDate.Time,
			},
		}
		if descr != nil {
			transaction.BookingText = descr.BookingText
			transaction.BankID = descr.BankID
			transaction.AccountID = descr.AccountID
			transaction.Name = descr.Name
			transaction.Purpose = strings.Join(descr.Purpose, " ")
			transaction.Purpose2 = strings.Join(descr.Purpose2, " ")
			transaction.TransactionID = descr.TransactionID
		}
		transactions = append(transactions, transaction)
	}
	return transactions
}
// AccountTransactions returns a slice of account transactions created from m
AccountTransactions returns a slice of account transactions created from m
// AccountTransactions returns a slice of account transactions created from m
func (m *MT940) AccountTransactions() []domain.AccountTransaction {
	accountConnection := domain.AccountConnection{BankID: m.Account.BankID, AccountID: m.Account.AccountID, CountryCode: 280}
	var transactions []domain.AccountTransaction
	for _, transactionSequence := range m.Transactions {
		tr := transactionSequence.Transaction
		descr := transactionSequence.Description
		var amount float64
		if tr.DebitCreditIndicator == "D" {
			amount = -tr.Amount
		} else {
			amount = tr.Amount
		}
		transaction := domain.AccountTransaction{
			Account:     accountConnection,
			Amount:      domain.Amount{Amount: amount, Currency: m.StartingBalance.Currency},
			ValutaDate:  tr.ValutaDate.Time,
			BookingDate: tr.BookingDate.Time,
			AccountBalanceBefore: domain.Balance{
				Amount: domain.Amount{
					Amount:   m.StartingBalance.Amount,
					Currency: m.StartingBalance.Currency,
				},
				TransmissionDate: m.StartingBalance.BookingDate.Time,
			},
			AccountBalanceAfter: domain.Balance{
				Amount: domain.Amount{
					Amount:   m.ClosingBalance.Amount,
					Currency: m.ClosingBalance.Currency,
				},
				TransmissionDate: m.ClosingBalance.BookingDate.Time,
			},
		}
		if descr != nil {
			transaction.BookingText = descr.BookingText
			transaction.BankID = descr.BankID
			transaction.AccountID = descr.AccountID
			transaction.Name = descr.Name
			transaction.Purpose = strings.Join(descr.Purpose, " ")
			transaction.Purpose2 = strings.Join(descr.Purpose2, " ")
			transaction.TransactionID = descr.TransactionID
		}
		transactions = append(transactions, transaction)
	}
	return transactions
}
func ( m * MT940 ) AccountTransactions ( ) [ ] domain . AccountTransaction { accountConnection := domain . AccountConnection { BankID : m . Account . BankID , AccountID : m . Account . AccountID , CountryCode : 280 } var transactions [ ] domain . AccountTransaction for _ , transactionSequence := range m . Transactions { tr := transactionSequence . Transaction descr := transactionSequence . Description var amount float64 if tr . DebitCreditIndicator == " " { amount = - tr . Amount } else { amount = tr . Amount } transaction := domain . AccountTransaction { Account : accountConnection , Amount : domain . Amount { Amount : amount , Currency : m . StartingBalance . Currency } , ValutaDate : tr . ValutaDate . Time , BookingDate : tr . BookingDate . Time , AccountBalanceBefore : domain . Balance { Amount : domain . Amount { Amount : m . StartingBalance . Amount , Currency : m . StartingBalance . Currency , } , TransmissionDate : m . StartingBalance . BookingDate . Time , } , AccountBalanceAfter : domain . Balance { Amount : domain . Amount { Amount : m . ClosingBalance . Amount , Currency : m . ClosingBalance . Currency , } , TransmissionDate : m . ClosingBalance . BookingDate . Time , } , } if descr != nil { transaction . BookingText = descr . BookingText transaction . BankID = descr . BankID transaction . AccountID = descr . AccountID transaction . Name = descr . Name transaction . Purpose = strings . Join ( descr . Purpose , " " ) transaction . Purpose2 = strings . Join ( descr . Purpose2 , " " ) transaction . TransactionID = descr . TransactionID } transactions = append ( transactions , transaction ) } return transactions }
AccountTransactions returns a slice of account transactions created from m
AccountTransactions returns a slice of account transactions created from m