File indexing completed on 2024-05-12 05:06:35
0001 /* 0002 SPDX-FileCopyrightText: 2000-2002 Michael Edwardes <mte@users.sourceforge.net> 0003 SPDX-FileCopyrightText: 2001 Felix Rodriguez <frodriguez@users.sourceforge.net> 0004 SPDX-FileCopyrightText: 2002-2003 Kevin Tambascio <ktambascio@users.sourceforge.net> 0005 SPDX-FileCopyrightText: 2006-2017 Thomas Baumgart <tbaumgart@kde.org> 0006 SPDX-FileCopyrightText: 2006 Ace Jones <acejones@users.sourceforge.net> 0007 SPDX-FileCopyrightText: 2017-2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> 0008 SPDX-License-Identifier: GPL-2.0-or-later 0009 */ 0010 0011 #ifndef MYMONEYACCOUNT_P_H 0012 #define MYMONEYACCOUNT_P_H 0013 0014 // ---------------------------------------------------------------------------- 0015 // QT Includes 0016 0017 #include <QString> 0018 #include <QDate> 0019 #include <QMap> 0020 0021 // ---------------------------------------------------------------------------- 0022 // KDE Includes 0023 0024 0025 // ---------------------------------------------------------------------------- 0026 // Project Includes 0027 0028 #include "mymoneyobject_p.h" 0029 #include "mymoneykeyvaluecontainer.h" 0030 #include "mymoneymoney.h" 0031 #include "mymoneyenums.h" 0032 0033 using namespace eMyMoney; 0034 0035 class MyMoneyAccountPrivate : public MyMoneyObjectPrivate 0036 { 0037 public: 0038 MyMoneyAccountPrivate() 0039 : MyMoneyObjectPrivate() 0040 , m_accountType(Account::Type::Unknown) 0041 , m_fraction(-1) 0042 { 0043 } 0044 0045 MyMoneyAccountPrivate(const MyMoneyAccountPrivate& right) 0046 : MyMoneyObjectPrivate(right) 0047 { 0048 *this = right; 0049 } 0050 0051 MyMoneyAccountPrivate& operator=(const MyMoneyAccountPrivate& right) 0052 { 0053 MyMoneyObjectPrivate::operator=(right); 0054 m_accountType = right.m_accountType; 0055 m_institution = right.m_institution; 0056 m_name = right.m_name; 0057 m_number = right.m_number; 0058 m_description = right.m_description; 0059 m_lastModified = right.m_lastModified; 0060 m_openingDate = right.m_openingDate; 0061 m_lastReconciliationDate = right.m_lastReconciliationDate; 0062 m_accountList = right.m_accountList; 0063 m_parentAccount = right.m_parentAccount; 0064 m_currencyId = right.m_currencyId; 0065 m_balance = right.m_balance; 0066 m_totalPostedValue = right.m_totalPostedValue; 0067 m_postedValue = right.m_postedValue; 0068 m_onlineBankingSettings = right.m_onlineBankingSettings; 0069 m_fraction = right.m_fraction; 0070 m_reconciliationHistory = right.m_reconciliationHistory; 0071 return *this; 0072 } 0073 0074 void collectReferencedObjects() override 0075 { 0076 m_referencedObjects = {m_institution, m_parentAccount, m_currencyId}; 0077 } 0078 0079 /** 0080 * This member variable identifies the type of account 0081 */ 0082 eMyMoney::Account::Type m_accountType; 0083 0084 /** 0085 * This member variable keeps the ID of the MyMoneyInstitution object 0086 * that this object belongs to. 0087 */ 0088 QString m_institution; 0089 0090 /** 0091 * This member variable keeps the name of the account 0092 * It is solely for documentation purposes and it's contents is not 0093 * used otherwise by the mymoney-engine. 0094 */ 0095 QString m_name; 0096 0097 /** 0098 * This member variable keeps the account number at the institution 0099 * It is solely for documentation purposes and it's contents is not 0100 * used otherwise by the mymoney-engine. 0101 */ 0102 QString m_number; 0103 0104 /** 0105 * This member variable is a description of the account. 0106 * It is solely for documentation purposes and it's contents is not 0107 * used otherwise by the mymoney-engine. 0108 */ 0109 QString m_description; 0110 0111 /** 0112 * This member variable keeps the date when the account 0113 * was last modified. 0114 */ 0115 QDate m_lastModified; 0116 0117 /** 0118 * This member variable keeps the date when the 0119 * account was created as an object in a MyMoneyFile 0120 */ 0121 QDate m_openingDate; 0122 0123 /** 0124 * This member variable keeps the date of the last 0125 * reconciliation of this account 0126 */ 0127 QDate m_lastReconciliationDate; 0128 0129 /** 0130 * This member holds the ID's of all sub-ordinate accounts 0131 */ 0132 QStringList m_accountList; 0133 0134 /** 0135 * This member contains the ID of the parent account 0136 */ 0137 QString m_parentAccount; 0138 0139 /** 0140 * This member contains the ID of the currency associated with this account 0141 */ 0142 QString m_currencyId; 0143 0144 /** 0145 * This member holds the balance of all transactions stored in the journal 0146 * for this account. 0147 */ 0148 MyMoneyMoney m_balance; 0149 0150 /** 0151 * This member keeps the value of the account and all subaccounts 0152 */ 0153 MyMoneyMoney m_totalPostedValue; 0154 0155 /** 0156 * This member keeps the value of the account without the subaccounts 0157 */ 0158 MyMoneyMoney m_postedValue; 0159 0160 /** 0161 * This member variable keeps the set of kvp's needed to establish 0162 * online banking sessions to this account. 0163 */ 0164 MyMoneyKeyValueContainer m_onlineBankingSettings; 0165 0166 /** 0167 * This member keeps the fraction for the account. It is filled by MyMoneyFile 0168 * when set to -1. See also @sa fraction(const MyMoneySecurity&). 0169 */ 0170 int m_fraction; 0171 0172 /** 0173 * This member keeps the reconciliation history 0174 */ 0175 QMap<QDate, MyMoneyMoney> m_reconciliationHistory; 0176 0177 }; 0178 0179 #endif