Class SwiftStatement
Repesents and manages SWIFT MT-940 Customer Statement messages.
public sealed class SwiftStatement : Swift9xxBase, IEnumerable, IComparable
- Inheritance
-
SwiftStatement
- Implements
- Inherited Members
Remarks
The SWIFT fields are read into the properties of the new SwiftStatement instance as follows:
| 20 | Field content will be placed into TransactionReference property. |
| 21 | Field content will be placed into
RelatedReference
property. If no field 21 appears, then the
RelatedReference property
will be null. |
| 25 | Field content will be placed into AccountIdentification property. |
| 28C | Subfields will be placed into StatementNumber and SequenceNumber properties. If no sequence number subfield exists, then the SequenceNumber will be zero. |
| 60a | Regardless of the actual field type, this will be stored in the OpeningBalance property. |
| 61 and 86 | All these fields are collected as new SwiftStatementLine instances, added to the StatementLines collection. |
| 62a | Regardless of the actual field type, this will be stored in the ClosingBalance property. |
| 64 | If present it will be placed into the
ClosingAvailableBalance property. If not, then that property will be
null. |
| 65 | All occurences of this field will be added to the ForwardAvailableBalances collection. |
| 86 | If present it will be placed into the
InfoToAccountOwner property. If not, then that property
will be null. |
Constructors
SwiftStatement()
Default constructor.
public SwiftStatement()
Remarks
This should only be used when subsequently reading the statement data from a stream or file.
SwiftStatement(string, SwiftBalance)
Constructs a new SwiftStatement from scratch.
public SwiftStatement(string sAccountIdentification, SwiftBalance aOpeningBalance)
Parameters
sAccountIdentificationstringThe account identification for which to create the new statement.
aOpeningBalanceSwiftBalanceThe opening balance of the the new statement. This implicitly defines the starting date of the statement period and the currency of the account.
Remarks
The newly created SwiftStatement is completely initialised from the given parameters and thus can immediately be written as a MT-940, albeit without any statement lines in it.
The TransactionReference is preset with the string "STARTUMS". However it can be changed at any time.
Exceptions
- ArgumentNullException
Either argument was
null.
Properties
ClosingAvailableBalance
Funds which are available to the account owner (if credit balance) or the balance which is subject to interest charges (if debit balance).
public SwiftBalance ClosingAvailableBalance { get; set; }
Property Value
ClosingBalance
The closing balance of this statement.
public SwiftBalance ClosingBalance { get; set; }
Property Value
- SwiftBalance
The ClosingBalance is never
null. Its Time component is not set and will always be completely ignored.The SwiftBalance instance provided by this property must only be read and must not be modified.
CreationDate
protected override DateTime CreationDate { get; }
Property Value
ForwardAvailableBalances
Funds which are available to the account owner (if a credit or debit balance) for the specified forward value date.
public IList ForwardAvailableBalances { get; }
Property Value
InfoToAccountOwner
Additional information on the message as a whole to be passed on to the account owner.
public string InfoToAccountOwner { get; set; }
Property Value
- string
The InfoToAccountOwner property corresponds with the final field 86 of a SWIFT MT-940 message which does not correspond to a particular statement line, but to the message as a whole. This field may contain up to six lines of text with up to 65 characters each.
OpeningBalance
The opening balance of this statement.
public SwiftBalance OpeningBalance { get; set; }
Property Value
- SwiftBalance
The OpeningBalance is never
null. Its Time component is not set and will always be completely ignored.The SwiftBalance instance provided by this property must only be read and must not be modified.
Remarks
In addition to just the balance value, the OpeningBalance property provides much more information about this statement. Most of all it provides the date where this statement begins. In addition it defines the initial account currency.
Methods
AddStatementLine(SwiftStatementLine)
Inserts a statement line into this statement.
public override void AddStatementLine(SwiftStatementLine aStatementLine)
Parameters
aStatementLineSwiftStatementLineStatement line to be inserted. This must have an EntryDate set.
Remarks
If the inserted statement contains an entry date that is before the date of the opening balance, then the opening balance is recomputed by subtracting the amount of the statement line. The date of the opening balance is changed to the entry date of the statement line.
Otherwise the closing balance is recomputed by adding the amount of the statement line. If the entry date of the inserted statement line is after the closing balance date, then the closing balance date is updated.
If the opening balance (or closing balance) is null, no computations are
done.
ParseField(SwiftStatementReaderState, SwiftField)
protected override void ParseField(SwiftStatementReaderState nState, SwiftField aField)
Parameters
nStateSwiftStatementReaderStateaFieldSwiftField
WriteMT940(SwiftWriter)
Writes this complete SwiftStatement instance as a SWIFT MT-940 message.
public void WriteMT940(SwiftWriter aSwiftWriter)
Parameters
aSwiftWriterSwiftWriterDestination to write the SWIFT MT-940 message to.
WriteMT940(Stream)
Writes this complete SwiftStatement instance as a SWIFT MT-940 message.
public void WriteMT940(Stream aStream)
Parameters
aStreamStreamOutput stream to write the SWIFT MT-940 message to. This stream will not be closed by this method.