summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/traninfo.h
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/traninfo.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/traninfo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/apps/checkbook/traninfo.h b/noncore/apps/checkbook/traninfo.h
index 0abdc61..cbe0238 100644
--- a/noncore/apps/checkbook/traninfo.h
+++ b/noncore/apps/checkbook/traninfo.h
@@ -28,73 +28,76 @@
28 28
29#ifndef TRANINFO_H 29#ifndef TRANINFO_H
30#define TRANINFO_H 30#define TRANINFO_H
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qlist.h> 33#include <qlist.h>
34 34
35class Config; 35class Config;
36 36
37class TranInfo 37class TranInfo
38{ 38{
39 public: 39 public:
40 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(), 40 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(),
41 bool = TRUE, const QString & = 0x0, const QString & = 0x0, 41 bool = TRUE, const QString & = 0x0, const QString & = 0x0,
42 float = 0.0, float = 0.0, 42 float = 0.0, float = 0.0,
43 const QString & = 0x0, const QString & = 0x0, int =-1 ); 43 const QString & = 0x0, const QString & = 0x0, int =-1 );
44 TranInfo( Config, int ); 44 TranInfo( Config, int );
45 45
46 // getters 46 // getters
47 int id() const { return i; } 47 int id() const { return i; }
48 const QString &getIdStr(); 48 const QString &getIdStr();
49 49
50 const QString &desc() const { return d; } 50 const QString &desc() const { return d; }
51 const QDate &date() const { return td; } 51 const QDate &date() const { return td; }
52 const QString &datestr(); 52 const QString &datestr(bool = false);
53 bool withdrawal()const { return w; } 53 bool withdrawal()const { return w; }
54 const QString &type() const { return t; } 54 const QString &type() const { return t; }
55 const QString &category()const { return c; } 55 const QString &category()const { return c; }
56 float amount() const { return a; } 56 float amount() const { return a; }
57 float fee() const { return f; } 57 float fee() const { return f; }
58 const QString &number()const { return cn; } 58 const QString &number()const { return cn; }
59 const QString &notes() const { return n; } 59 const QString &notes() const { return n; }
60 int getNext() { return(_next); } 60 int getNext() { return(_next); }
61 61
62 // setters 62 // setters
63 void setDesc( const QString &desc ) { d = desc; } 63 void setDesc( const QString &desc ) { d = desc; }
64 void setDate( const QDate &date ) { td = date; } 64 void setDate( const QDate &date ) { td = date; }
65 void setWithdrawal( bool withdrawal ) { w = withdrawal; } 65 void setWithdrawal( bool withdrawal ) { w = withdrawal; }
66 void setType( const QString &type ) { t = type; } 66 void setType( const QString &type ) { t = type; }
67 void setCategory( const QString &cat ){ c = cat; } 67 void setCategory( const QString &cat ){ c = cat; }
68 void setAmount( float amount ) { a = amount; } 68 void setAmount( float amount ) { a = amount; }
69 void setFee( float fee ) { f = fee; } 69 void setFee( float fee ) { f = fee; }
70 void setNumber( const QString &num ) { cn = num; } 70 void setNumber( const QString &num ) { cn = num; }
71 void setNotes( const QString &notes ) { n = notes; } 71 void setNotes( const QString &notes ) { n = notes; }
72 void setNext(int next) { _next=next; } 72 void setNext(int next) { _next=next; }
73 73
74 // write 74 // write
75 void write( Config * ); 75 void write( Config * );
76 76
77 // toString 77 // toString
78 QString toString(); 78 QString toString();
79 79
80 private: 80 private:
81 int i; 81 int i;
82 QString d; 82 QString d;
83 QDate td; 83 QDate td;
84 bool w; 84 bool w;
85 QString t; 85 QString t;
86 QString c; 86 QString c;
87 float a; 87 float a;
88 float f; 88 float f;
89 QString cn; 89 QString cn;
90 QString n; 90 QString n;
91 int _next; 91 int _next;
92}; 92};
93 93
94class TranInfoList : public QList<TranInfo> 94class TranInfoList : public QList<TranInfo>
95{ 95{
96 public:
97 TranInfo *findMostRecentByDesc( const QString &desc );
98
96 protected: 99 protected:
97 int compareItems( QCollection::Item, QCollection::Item ); 100 int compareItems( QCollection::Item, QCollection::Item );
98}; 101};
99 102
100#endif 103#endif