Class SwiftStatement
Repesents and manages SWIFT MT-940 Customer Statement messages.
Implements
Inherited Members
Namespace: Subsembly.Swift
Assembly: Subsembly.Sepa.dll
Syntax
public sealed class SwiftStatement : Swift9xxBase, IEnumerable, IComparable
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.
Declaration
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.
Declaration
public SwiftStatement(string sAccountIdentification, SwiftBalance aOpeningBalance)
Parameters
Type | Name | Description |
---|---|---|
System.String | sAccountIdentification | The account identification for which to create the new statement. |
SwiftBalance | aOpeningBalance | The 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
Type | Condition |
---|---|
System.ArgumentNullException | Either argument was |
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).
Declaration
public SwiftBalance ClosingAvailableBalance { get; set; }
Property Value
Type | Description |
---|---|
SwiftBalance |
ClosingBalance
The closing balance of this statement.
Declaration
public SwiftBalance ClosingBalance { get; set; }
Property Value
Type | Description |
---|---|
SwiftBalance | The ClosingBalance is never The SwiftBalance instance provided by this property must only be read and must not be modified. |
CreationDate
Declaration
protected override DateTime CreationDate { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Overrides
ForwardAvailableBalances
Funds which are available to the account owner (if a credit or debit balance) for the specified forward value date.
Declaration
public IList ForwardAvailableBalances { get; }
Property Value
Type | Description |
---|---|
System.Collections.IList |
InfoToAccountOwner
Additional information on the message as a whole to be passed on to the account owner.
Declaration
public string InfoToAccountOwner { get; set; }
Property Value
Type | Description |
---|---|
System.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.
Declaration
public SwiftBalance OpeningBalance { get; set; }
Property Value
Type | Description |
---|---|
SwiftBalance | The OpeningBalance is never 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.
Declaration
public override void AddStatementLine(SwiftStatementLine aStatementLine)
Parameters
Type | Name | Description |
---|---|---|
SwiftStatementLine | aStatementLine | Statement line to be inserted. This must have an EntryDate set. |
Overrides
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)
Declaration
protected override void ParseField(SwiftStatementReaderState nState, SwiftField aField)
Parameters
Type | Name | Description |
---|---|---|
SwiftStatementReaderState | nState | |
SwiftField | aField |
Overrides
WriteMT940(SwiftWriter)
Writes this complete SwiftStatement instance as a SWIFT MT-940 message.
Declaration
public void WriteMT940(SwiftWriter aSwiftWriter)
Parameters
Type | Name | Description |
---|---|---|
SwiftWriter | aSwiftWriter | Destination to write the SWIFT MT-940 message to. |
WriteMT940(Stream)
Writes this complete SwiftStatement instance as a SWIFT MT-940 message.
Declaration
public void WriteMT940(Stream aStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | aStream | Output stream to write the SWIFT MT-940 message to. This stream will not be closed by this method. |