00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef TRANINFO_H
00030 #define TRANINFO_H
00031
00032 #include <qdatetime.h>
00033 #include <qlist.h>
00034
00035 class Config;
00036
00037 class TranInfo
00038 {
00039 public:
00040 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(),
00041 bool = TRUE, const QString & = 0x0, const QString & = 0x0,
00042 float = 0.0, float = 0.0,
00043 const QString & = 0x0, const QString & = 0x0, int =-1 );
00044 TranInfo( Config *, int );
00045
00046
00047 int id() const { return i; }
00048 const QString &getIdStr();
00049
00050 const QString &desc() const { return d; }
00051 const QDate &date() const { return td; }
00052 const QString &datestr(bool = false);
00053 bool withdrawal() const { return w; }
00054 const QString &type() const { return t; }
00055 const QString &category() const { return c; }
00056 float amount() const { return a; }
00057 float fee() const { return f; }
00058 const QString &number() const { return cn; }
00059 const QString ¬es() const { return n; }
00060 int getNext() { return(_next); }
00061
00062
00063 void setDesc( const QString &desc ) { d = desc; }
00064 void setDate( const QDate &date ) { td = date; }
00065 void setWithdrawal( bool withdrawal ) { w = withdrawal; }
00066 void setType( const QString &type ) { t = type; }
00067 void setCategory( const QString &cat ) { c = cat; }
00068 void setAmount( float amount ) { a = amount; }
00069 void setFee( float fee ) { f = fee; }
00070 void setNumber( const QString &num ) { cn = num; }
00071 void setNotes( const QString ¬es ) { n = notes; }
00072 void setNext(int next) { _next=next; }
00073
00074
00075 void write( Config * );
00076
00077
00078 QString toString();
00079
00080 private:
00081 int i;
00082 QString d;
00083 QDate td;
00084 bool w;
00085 QString t;
00086 QString c;
00087 float a;
00088 float f;
00089 QString cn;
00090 QString n;
00091 int _next;
00092 };
00093
00094 class TranInfoList : public QList<TranInfo>
00095 {
00096 public:
00097 TranInfo *findMostRecentByDesc( const QString &desc );
00098
00099 protected:
00100 int compareItems( QCollection::Item, QCollection::Item );
00101 };
00102
00103 #endif