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
00030
00031 #ifndef ADOCJOURNAL_H
00032 #define ADOCJOURNAL_H
00033
00034 #include <qdatetime.h>
00035 #include "acfg.h"
00036 #include "aobject.h"
00037 #include "adocument.h"
00038
00039 class aDatabase;
00040
00041
00042
00058 class ANANAS_EXPORT aDocJournal :public aObject
00059 {
00060 Q_OBJECT
00061 private:
00068 int journalType;
00069 public:
00070 aDocJournal(aCfgItem context, aDatabase * adb = 0);
00071 aDocJournal( const QString & name, aDatabase * adb = 0);
00072 aDocJournal( aDatabase * adb = 0);
00073 virtual ERR_Code initObject();
00074 ERR_Code selectDocument( Q_ULLONG idd );
00075 virtual Q_ULLONG docId();
00076 int docType();
00077
00084 int type() { return journalType; }
00085 QString nextNumber( const QString &prefix, int mdId );
00086 QVariant getDate();
00087 QString getNumber();
00088
00089 int getSerialNumber();
00090 ERR_Code setDate( QVariant date );
00091 ERR_Code setNumber( QVariant number );
00092
00093 virtual ERR_Code New ( Q_ULLONG idd, const QString & docPrefix, int type );
00094 virtual ERR_Code deleteDocument ( Q_ULLONG idd );
00095 Q_ULLONG findDocument( Q_ULLONG idd );
00096
00097 Q_ULLONG findDoc( const QString & num, int type );
00098 QString getPrefix();
00099 QString selectionFilter( QDateTime from, QDateTime to, const QString & mdName = "",
00100 bool full=false );
00101 QString selectionFilter( const QString & num, const QString & mdName = "", bool full=false );
00102
00103 public slots:
00104 aDocument* CurrentDocument();
00105 virtual ERR_Code Delete();
00106 virtual ERR_Code Select( QDateTime from, QDateTime to, const QString & mdName = "" );
00107 virtual ERR_Code Select( const QString & num, const QString & mdName = "" );
00108 };
00109
00110 #endif// ADOCJOURNAL_H