#include <mymoneyaccount.h>


Public Types | |
| enum | _accountTypeE { UnknownAccountType = 0, Checkings, Savings, Cash, CreditCard, Loan, CertificateDep, Investment, MoneyMarket, Asset, Liability, Currency, Income, Expense, AssetLoan, Stock, Equity, MaxAccountTypes } |
| typedef enum MyMoneyAccount::_accountTypeE | accountTypeE |
Public Member Functions | |
| MyMoneyAccount () | |
| MyMoneyAccount (const QString &id, const MyMoneyAccount &right) | |
| MyMoneyAccount (const QDomElement &el) | |
| ~MyMoneyAccount () | |
| bool | operator== (const MyMoneyAccount &) const |
| MyMoneyAccount::accountTypeE | accountGroup (void) const |
| const QString & | institutionId (void) const |
| const QString & | name (void) const |
| const QString & | number (void) const |
| const QString & | description (void) const |
| const QDate & | openingDate (void) const |
| const QDate & | lastReconciliationDate (void) const |
| const QDate & | lastModified (void) const |
| const QString & | parentAccountId (void) const |
| const QStringList & | accountList (void) const |
| int | accountCount (void) const |
| void | addAccountId (const QString &account) |
| void | removeAccountId (const QString &account) |
| void | removeAccountIds (void) |
| void | setLastModified (const QDate &date) |
| void | setName (const QString &name) |
| void | setNumber (const QString &number) |
| void | setDescription (const QString &desc) |
| void | setInstitutionId (const QString &id) |
| void | setOpeningDate (const QDate &date) |
| void | setLastReconciliationDate (const QDate &date) |
| void | setAccountType (const accountTypeE type) |
| void | setParentAccountId (const QString &parent) |
| void | touch (void) |
| accountTypeE | accountType (void) const |
| const QString & | currencyId (void) const |
| void | setCurrencyId (const QString &id) |
| void | writeXML (QDomDocument &document, QDomElement &parent) const |
| virtual bool | hasReferenceTo (const QString &id) const |
| const MyMoneyMoney & | balance (void) const |
| void | adjustBalance (const MyMoneySplit &s, bool reverse=false) |
| void | setBalance (const MyMoneyMoney &val) |
| void | setOnlineBankingSettings (const MyMoneyKeyValueContainer &values) |
| const MyMoneyKeyValueContainer & | onlineBankingSettings (void) const |
| void | setClosed (bool isClosed) |
| bool | isClosed (void) const |
| int | fraction (const MyMoneySecurity &sec) |
| int | fraction (const MyMoneySecurity &sec) const |
| int | fraction (void) const |
| bool | isCategory (void) const __attribute__((deprecated)) |
| bool | isIncomeExpense (void) const |
| bool | isAssetLiability (void) const |
| bool | isLoan (void) const |
| bool | isInvest (void) const |
| QString | brokerageName (void) const |
| QPixmap | accountPixmap (bool reconcileFlag=false, int size=0) const |
| KMYMONEY_EXPORT QDataStream & | operator<< (const MyMoneyAccount &) |
| KMYMONEY_EXPORT QDataStream & | operator>> (MyMoneyAccount &) |
Static Public Member Functions | |
| static MyMoneyAccount::accountTypeE | accountGroup (MyMoneyAccount::accountTypeE type) |
| static QString | accountTypeToString (const MyMoneyAccount::accountTypeE accountType) |
Private Attributes | |
| accountTypeE | m_accountType |
| QString | m_institution |
| QString | m_name |
| QString | m_number |
| QString | m_description |
| QDate | m_lastModified |
| QDate | m_openingDate |
| QDate | m_lastReconciliationDate |
| QStringList | m_accountList |
| QString | m_parentAccount |
| QString | m_currencyId |
| MyMoneyMoney | m_balance |
| MyMoneyKeyValueContainer | m_onlineBankingSettings |
| int | m_fraction |
Friends | |
| class | MyMoneyObjectContainer |
Currently, the following account types are known:
Account types currently supported.
Account types currently supported.
| MyMoneyAccount::MyMoneyAccount | ( | ) |
This is the constructor for a new empty account
| MyMoneyAccount::MyMoneyAccount | ( | const QString & | id, | |
| const MyMoneyAccount & | right | |||
| ) |
This is the constructor for a new account known to the current file This is the only constructor that will set the attribute m_openingDate to a correct value.
| id | id assigned to the account | |
| right | account definition |
| MyMoneyAccount::MyMoneyAccount | ( | const QDomElement & | el | ) |
This is the constructor for an account that is described by a QDomElement (e.g. from a file).
| el | const reference to the QDomElement from which to create the object |
| MyMoneyAccount::~MyMoneyAccount | ( | ) |
This is the destructor for any MyMoneyAccount object
| bool MyMoneyAccount::operator== | ( | const MyMoneyAccount & | ) | const |
This operator tests for equality of two MyMoneyAccount objects
| static MyMoneyAccount::accountTypeE MyMoneyAccount::accountGroup | ( | MyMoneyAccount::accountTypeE | type | ) | [static] |
This converts the account type into one of the four major account types liability, asset, expense or income.
The current assignment is as follows:
| type | actual account type |
| MyMoneyAccount::accountTypeE MyMoneyAccount::accountGroup | ( | void | ) | const |
| const QString& MyMoneyAccount::institutionId | ( | void | ) | const [inline] |
This method returns the id of the MyMoneyInstitution object this account belongs to.
| const QString& MyMoneyAccount::name | ( | void | ) | const [inline] |
This method returns the name of the account
Reimplemented in reports::ReportAccount.
| const QString& MyMoneyAccount::number | ( | void | ) | const [inline] |
This method returns the number of the account at the institution
| const QString& MyMoneyAccount::description | ( | void | ) | const [inline] |
This method returns the descriptive text of the account.
| const QDate& MyMoneyAccount::openingDate | ( | void | ) | const [inline] |
This method returns the opening date of this account
| const QDate& MyMoneyAccount::lastReconciliationDate | ( | void | ) | const [inline] |
This method returns the date of the last reconciliation of this account
| const QDate& MyMoneyAccount::lastModified | ( | void | ) | const [inline] |
This method returns the date the account was last modified
| const QString& MyMoneyAccount::parentAccountId | ( | void | ) | const [inline] |
This method is used to return the ID of the parent account
| const QStringList& MyMoneyAccount::accountList | ( | void | ) | const [inline] |
This method returns the list of the account id's of subordinate accounts
| int MyMoneyAccount::accountCount | ( | void | ) | const [inline] |
This method returns the number of entries in the m_accountList
| void MyMoneyAccount::addAccountId | ( | const QString & | account | ) |
This method is used to add an account id as sub-ordinate account
| account | const QString reference to account ID |
| void MyMoneyAccount::removeAccountId | ( | const QString & | account | ) |
This method is used to remove an account from the list of sub-ordinate accounts.
| account | const QString reference to account ID to be removed |
| void MyMoneyAccount::removeAccountIds | ( | void | ) |
This method is used to remove all accounts from the list of sub-ordinate accounts.
| void MyMoneyAccount::setLastModified | ( | const QDate & | date | ) |
This method is used to modify the date of the last modification access.
| date | date of last modification |
| void MyMoneyAccount::setName | ( | const QString & | name | ) |
This method is used to set the name of the account
| name | name of the account |
| void MyMoneyAccount::setNumber | ( | const QString & | number | ) |
This method is used to set the number of the account at the institution
| number | number of the account |
| void MyMoneyAccount::setDescription | ( | const QString & | desc | ) |
This method is used to set the descriptive text of the account
| desc | text that serves as description |
| void MyMoneyAccount::setInstitutionId | ( | const QString & | id | ) |
This method is used to set the id of the institution this account belongs to.
| id | id of the institution this account belongs to |
| void MyMoneyAccount::setOpeningDate | ( | const QDate & | date | ) |
This method is used to set the opening date information of an account.
| date | QDate of opening date |
| void MyMoneyAccount::setLastReconciliationDate | ( | const QDate & | date | ) |
This method is used to set the date of the last reconciliation of an account.
| date | QDate of last reconciliation |
| void MyMoneyAccount::setAccountType | ( | const accountTypeE | type | ) |
This method is used to change the account type
| type | account type |
| void MyMoneyAccount::setParentAccountId | ( | const QString & | parent | ) |
This method is used to set a new parent account id
| parent | QString reference to new parent account |
| void MyMoneyAccount::touch | ( | void | ) | [inline] |
This method is used to update m_lastModified to the current date
| accountTypeE MyMoneyAccount::accountType | ( | void | ) | const [inline] |
This method returns the type of the account.
| const QString& MyMoneyAccount::currencyId | ( | void | ) | const [inline] |
This method retrieves the id of the currency used with this account. If the return value is empty, the base currency should be used.
| void MyMoneyAccount::setCurrencyId | ( | const QString & | id | ) |
This method sets the id of the currency used with this account.
| id | ID of currency to be associated with this account. |
| void MyMoneyAccount::writeXML | ( | QDomDocument & | document, | |
| QDomElement & | parent | |||
| ) | const |
This method creates a QDomElement for the document under the parent node parent.
| document | reference to QDomDocument | |
| parent | reference to QDomElement parent node |
Reimplemented from MyMoneyKeyValueContainer.
| virtual bool MyMoneyAccount::hasReferenceTo | ( | const QString & | id | ) | const [virtual] |
This method checks if a reference to the given object exists. It returns, a true if the object is referencing the one requested by the parameter id. If it does not, this method returns false.
| id | id of the object to be checked for references |
| true | This object references object with id id. | |
| false | This object does not reference the object with id id. |
Implements MyMoneyObject.
Reimplemented in MyMoneyAccountLoan.
| const MyMoneyMoney& MyMoneyAccount::balance | ( | void | ) | const [inline] |
This member returns the balance of this account based on all transactions stored in the journal.
| void MyMoneyAccount::adjustBalance | ( | const MyMoneySplit & | s, | |
| bool | reverse = false | |||
| ) |
This method adjusts the balance of this account according to the difference contained in the split s. If the s.action() is MyMoneySplit::ActionSplitShares then the balance will be adjusted accordingly.
| s | const reference to MyMoneySplit object containing the value to be added/subtracted to/from the balance | |
| reverse | add (false) or subtract (true) the shares contained in the split. It also affects the balance for share splits in the opposite direction. |
| void MyMoneyAccount::setBalance | ( | const MyMoneyMoney & | val | ) | [inline] |
This method sets the balance of this account according to the value provided by val.
| val | const reference to MyMoneyMoney object containing the value to be assigned to the balance |
| void MyMoneyAccount::setOnlineBankingSettings | ( | const MyMoneyKeyValueContainer & | values | ) |
This method sets the kvp's for online banking with this account
| values | The container of kvp's needed when connecting to this account |
| const MyMoneyKeyValueContainer& MyMoneyAccount::onlineBankingSettings | ( | void | ) | const |
This method retrieves the kvp's for online banking with this account
| void MyMoneyAccount::setClosed | ( | bool | isClosed | ) |
This method sets the closed flag for the account. This is just an informational flag for the application. It has no other influence on the behaviour of the account object. The default for new objects open.
| isClosed | mark the account closed (true) or open (false). |
| bool MyMoneyAccount::isClosed | ( | void | ) | const |
Return the closed flag for the account.
| false | account is marked open (the default for new accounts) | |
| true | account is marked closed |
| int MyMoneyAccount::fraction | ( | const MyMoneySecurity & | sec | ) |
returns the applicable smallest fraction for this account for the given security based on the account type. At the same time, m_fraction is updated to the value returned.
| sec | const reference to currency (security) |
| sec.smallestCashFraction() | for account type Cash | |
| sec.smallestAccountFraction() | for all other account types |
| int MyMoneyAccount::fraction | ( | const MyMoneySecurity & | sec | ) | const |
Same as the above method, but does not modify m_fraction.
| int MyMoneyAccount::fraction | ( | void | ) | const |
This method returns the stored value for the fraction of this account or -1 if not initialized. It can be initialized by calling fraction(const MyMoneySecurity& sec) once.
| bool MyMoneyAccount::isCategory | ( | void | ) | const |
This method returns true if the account type is either Income or Expense
| true | account is of type income or expense | |
| false | for all other account types |
| bool MyMoneyAccount::isIncomeExpense | ( | void | ) | const |
This method returns true if the account type is either Income or Expense
| true | account is of type income or expense | |
| false | for all other account types |
| bool MyMoneyAccount::isAssetLiability | ( | void | ) | const |
This method returns true if the account type is either Asset or Liability
| true | account is of type asset or liability | |
| false | for all other account types |
| bool MyMoneyAccount::isLoan | ( | void | ) | const |
This method returns true if the account type is either AssetLoan or Loan
| true | account is of type Loan or AssetLoan | |
| false | for all other account types |
| bool MyMoneyAccount::isInvest | ( | void | ) | const |
This method returns true if the account type is Stock
| true | account is of type Stock | |
| false | for all other account types |
| QString MyMoneyAccount::brokerageName | ( | void | ) | const |
This method returns a name that has a brokerage suffix of the current name. It only works on investment accounts and returns the name for all other cases.
| QPixmap MyMoneyAccount::accountPixmap | ( | bool | reconcileFlag = false, |
|
| int | size = 0 | |||
| ) | const |
| size | is a hint for the size of the icon |
| static QString MyMoneyAccount::accountTypeToString | ( | const MyMoneyAccount::accountTypeE | accountType | ) | [static] |
This method is used to convert the internal representation of an account type into a human readable format
| accountType | numerical representation of the account type. For possible values, see MyMoneyAccount::accountTypeE |
| KMYMONEY_EXPORT QDataStream& MyMoneyAccount::operator<< | ( | const MyMoneyAccount & | ) |
| KMYMONEY_EXPORT QDataStream& MyMoneyAccount::operator>> | ( | MyMoneyAccount & | ) |
friend class MyMoneyObjectContainer [friend] |
accountTypeE MyMoneyAccount::m_accountType [private] |
This member variable identifies the type of account
QString MyMoneyAccount::m_institution [private] |
This member variable keeps the ID of the MyMoneyInstitution object that this object belongs to.
QString MyMoneyAccount::m_name [private] |
This member variable keeps the name of the account It is solely for documentation purposes and it's contents is not used otherwise by the mymoney-engine.
QString MyMoneyAccount::m_number [private] |
This member variable keeps the account number at the institution It is solely for documentation purposes and it's contents is not used otherwise by the mymoney-engine.
QString MyMoneyAccount::m_description [private] |
This member variable is a description of the account. It is solely for documentation purposes and it's contents is not used otherwise by the mymoney-engine.
QDate MyMoneyAccount::m_lastModified [private] |
This member variable keeps the date when the account was last modified.
QDate MyMoneyAccount::m_openingDate [private] |
This member variable keeps the date when the account was created as an object in a MyMoneyFile
QDate MyMoneyAccount::m_lastReconciliationDate [private] |
This member variable keeps the date of the last reconciliation of this account
QStringList MyMoneyAccount::m_accountList [private] |
This member holds the ID's of all sub-ordinate accounts
QString MyMoneyAccount::m_parentAccount [private] |
This member contains the ID of the parent account
QString MyMoneyAccount::m_currencyId [private] |
This member contains the ID of the currency associated with this account
MyMoneyMoney MyMoneyAccount::m_balance [private] |
This member holds the balance of all transactions stored in the journal for this account.
This member variable keeps the set of kvp's needed to establish online banking sessions to this account.
int MyMoneyAccount::m_fraction [private] |
This member keeps the fraction for the account. It is filled by MyMoneyFile when set to -1. See also
1.5.6