1 /*
2  * Copyright 2002-2017  Thomas Baumgart <tbaumgart@kde.org>
3  * Copyright 2004       Kevin Tambascio <ktambascio@users.sourceforge.net>
4  * Copyright 2005-2006  Ace Jones <acejones@users.sourceforge.net>
5  * Copyright 2017-2018  Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef MYMONEYSPLIT_P_H
22 #define MYMONEYSPLIT_P_H
23 
24 #include "mymoneysplit.h"
25 
26 // ----------------------------------------------------------------------------
27 // QT Includes
28 
29 #include <QString>
30 #include <QDate>
31 
32 // ----------------------------------------------------------------------------
33 // KDE Includes
34 
35 // ----------------------------------------------------------------------------
36 // Project Includes
37 
38 #include "mymoneyobject_p.h"
39 #include "mymoneymoney.h"
40 #include "mymoneytransaction.h"
41 #include "mymoneyenums.h"
42 
43 using namespace eMyMoney;
44 
45 class MyMoneySplitPrivate : public MyMoneyObjectPrivate
46 {
47 
48 public:
MyMoneySplitPrivate()49   MyMoneySplitPrivate() :
50     m_reconcileFlag(eMyMoney::Split::State::NotReconciled),
51     m_isMatched(false)
52   {
53   }
54 
55   /**
56     * This member contains the ID of the payee
57     */
58   QString        m_payee;
59 
60   /**
61     * This member contains a list of the IDs of the tags
62     */
63   QList<QString> m_tagList;
64 
65   /**
66     * This member contains the ID of the account
67     */
68   QString        m_account;
69 
70   /**
71    * This member contains the ID of the cost center
72    */
73   QString        m_costCenter;
74 
75   /**
76     */
77   MyMoneyMoney   m_shares;
78 
79   /**
80     */
81   MyMoneyMoney   m_value;
82 
83   /**
84     * If the quotient of m_shares divided by m_values is not the correct price
85     * because of truncation, the price can be stored in this member. For display
86     * purpose and transaction edit this value can be used by the application.
87     */
88   MyMoneyMoney   m_price;
89 
90   QString        m_memo;
91 
92   /**
93     * This member contains information about the reconciliation
94     * state of the split. Possible values are
95     *
96     * @li NotReconciled
97     * @li Cleared
98     * @li Reconciled
99     * @li Frozen
100     *
101     */
102   eMyMoney::Split::State m_reconcileFlag;
103 
104   /**
105     * In case the reconciliation flag is set to Reconciled or Frozen
106     * this member contains the date of the reconciliation.
107     */
108   QDate          m_reconcileDate;
109 
110   /**
111     * The m_action member is an arbitrary string, but is intended to
112     * be conveniently limited to a menu of selections such as
113     * "Buy", "Sell", "Interest", etc.
114     */
115   QString        m_action;
116 
117   /**
118     * The m_number member is used to store a reference number to
119     * the split supplied by the user (e.g. check number, etc.).
120     */
121   QString        m_number;
122 
123   /**
124     * This member keeps the bank's unique ID for the split, so we can
125     * avoid duplicates.  This is only used for electronic statement downloads.
126     *
127     * This should only be set on the split which refers to the account
128     * that was downloaded.
129     */
130   QString        m_bankID;
131 
132   /**
133     * This member keeps a backward id to the transaction that this
134     * split can be found in. It is the purpose of the MyMoneyTransaction
135     * object to maintain this member variable.
136     */
137   QString        m_transactionId;
138 
139   MyMoneyTransaction m_matchedTransaction;
140   bool m_isMatched;
141 
142 };
143 
144 #endif
145