Account
public class Account : AccountItem
extension Account: CustomStringConvertible
extension Account: Equatable
Class with represents an Account with a name, CommoditySymbol, opening and closing date
It does hot hold any Transactions
-
Name of the account
Declaration
Swift
public let name: AccountName -
BookingMethodof the accountDeclaration
Swift
public let bookingMethod: BookingMethod -
Commodityof this accountDeclaration
Swift
public let commoditySymbol: CommoditySymbol? -
MetaData of the Account
Declaration
Swift
public let metaData: [String : String] -
Optional date of opening. If it exists
isPostingValid(:)checks that the transaction is on or after this dateDeclaration
Swift
public let opening: Date? -
Optional closing date. If it exists
isPostingValid(:)checks that the transaction is before or on this dateDeclaration
Swift
public let closing: Date? -
Balance asserts for this account
Declaration
Swift
public internal(set) var balances: [Balance] { get } -
Declaration
Swift
public var nameItem: String { get } -
Creates an Account
Declaration
Swift
public init( name: AccountName, bookingMethod: BookingMethod = .strict, commoditySymbol: CommoditySymbol? = nil, opening: Date? = nil, closing: Date? = nil, metaData: [String: String] = [:] )Parameters
namea vaild name for the account
bookingMethodbookingMethods, defaults to .strict
-
Returns the Acount opening and closing string for the ledger.
If no open date is set it returns an empty string, if only the opening is set the closing line is ommitted
Declaration
Swift
public var description: String { get } -
Compare the name, commodity and meta data as well as the opening and closing of two Accounts.
This does not compare
Transactions as they are not part of AccountsDeclaration
Swift
public static func == (lhs: Account, rhs: Account) -> BoolReturn Value
if the accounts are equal
View on GitHub
Install in Dash
Account Class Reference