FreeDebks  1.0.3
 All Classes Files Functions Variables Friends Pages
FdItemJournal.hpp
Go to the documentation of this file.
1 // --------------------------------------------------------------------
2 // Copyright © 2011-2013 Mathieu Schopfer
3 //
4 // This file is part of FreeDebks.
5 //
6 // FreeDebks is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // FreeDebks is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with FreeDebks. If not, see <http://www.gnu.org/licenses/>.
18 // --------------------------------------------------------------------
19 
20 #ifndef FDITEMJOURNAL_HPP
21 #define FDITEMJOURNAL_HPP
22 
23 #include <QtXml>
24 
25 #include "dataDefinitions.hpp"
26 
28 
47 class FdItemJournal
48 {
49 private:
58  QDate mDate;
67  QString mObject;
76  QString mLabel;
85  FdItemCoa_p mDebit;
94  FdItemCoa_p mCredit;
103  double mAmount;
104 
105 public:
106  FdItemJournal(QDate date, QString object = "", QString label = "", FdItemCoa_p debit = FdItemCoa_p(0), FdItemCoa_p credit = FdItemCoa_p(0), double amount = 0);
107  static FdItemJournal_p pointer(FdSubWindow* subwindow, QDomElement& entry);
108  QDate date() const;
109  QString object() const;
110  QString label() const;
111  FdItemCoa_p debit() const;
112  FdItemCoa_p credit() const;
113  double amount() const;
114  void setDate(QDate date);
115  void setObject(QString object);
116  void setLabel(QString label);
117  void setDebit(FdItemCoa_p account);
118  void setCredit(FdItemCoa_p account);
119  void setAmount(double amount);
120 
121  bool isEmpty() const;
122  bool isValid() const;
123  bool breakDown() const;
124  QDomElement toXml(QDomDocument& document) const;
125 };
126 
127 #endif // FDITEMJOURNAL_HPP