Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

transaction.h

Go to the documentation of this file.
00001 #ifndef TRANSACTION_H
00002 #define TRANSACTION_H
00003 
00004 #include <qstring.h>
00005 #include <qlistview.h>
00006 #include <qdatetime.h>
00007 #include <sqlite3.h>
00008 
00009 #include "preferences.h"
00010 
00011 class Transaction
00012   {
00013     public:
00014 
00015       Transaction ();
00016       ~Transaction ();
00017 
00018       // This function adds a new transaction to the database.  It takes the  payee, accountid,
00019       // budgetid, number, day, month, year, amount, cleared
00020       void addTransaction ( QString description, QString payee, int accountid, int parentid, int number, int day, int month, int year, float amount, int cleared, int budgetid, int lineitemid );
00021 
00022       // This updates an already existing transaction
00023       void updateTransaction ( QString, QString, int, int, int, int, float, int, int, int, int );
00024 
00025       // Deletes a transaction.  Takes the transid as its parameter
00026       void deleteTransaction ( int );
00027 
00028       // Returns the number of transactions
00029       int getNumberOfTransactions ();
00030 
00031       // this is an overloaded function that returns the number of
00032       // transactions for an account
00033       int getNumberOfTransactions ( int );
00034 
00035       // deletes all transactions for the provided accountid
00036       void deleteAllTransactions ( int accountid );
00037 
00038       QString getBudgetTotal ( int budgetid, int lineitemid, int year, int month, int viewtype );
00039       QString getActualTotal ( int budgetid, int year, int month, int viewtype );
00040 
00041       // These two functions clear budget ids is either a line item or an entire budget is deleted
00042       void clearBudgetIDs ( int, int );
00043       void clearBudgetIDs ( int );
00044 
00045     public slots:
00046 
00047       void displayTransactions ( QListView *, int, bool, const char *, QDate );
00048       char ** selectAllTransactions ( QDate fromdate, bool children, const char *limit, int id );
00049       char ** selectNonClearedTransactions ( QDate fromdate, bool children, const char *limit, int id );
00050       QString getPayee ( int );
00051       QString getTransactionDescription ( int );
00052       QString getNumber ( int );
00053       QString getAmount ( int );
00054       QString getAbsoluteAmount ( int );
00055       int getCleared ( int );
00056       void setCleared ( int id, int cleared );
00057       int getBudgetID ( int id );
00058       int getLineItemID ( int id );
00059       int getDay ( int );
00060       int getMonth ( int );
00061       int getYear ( int );
00062       int getAccountID ( int id );
00063 
00064     private:
00065 
00066       sqlite3 *tdb;
00067       int rows, columns;
00068   };
00069 
00070 #endif
00071 
00072 
00073 

Generated on Sat Nov 5 16:16:48 2005 for OPIE by  doxygen 1.4.2