summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qashmoney/transaction.h
Unidiff
Diffstat (limited to 'noncore/unsupported/qashmoney/transaction.h') (more/less context) (show whitespace changes)
-rwxr-xr-xnoncore/unsupported/qashmoney/transaction.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/noncore/unsupported/qashmoney/transaction.h b/noncore/unsupported/qashmoney/transaction.h
new file mode 100755
index 0000000..3df43a8
--- a/dev/null
+++ b/noncore/unsupported/qashmoney/transaction.h
@@ -0,0 +1,73 @@
1#ifndef TRANSACTION_H
2#define TRANSACTION_H
3
4#include <qstring.h>
5#include <qlistview.h>
6#include <qdatetime.h>
7#include <sqlite3.h>
8
9#include "preferences.h"
10
11class Transaction
12 {
13 public:
14
15 Transaction ();
16 ~Transaction ();
17
18 // This function adds a new transaction to the database. It takes the payee, accountid,
19 // budgetid, number, day, month, year, amount, cleared
20 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 );
21
22 // This updates an already existing transaction
23 void updateTransaction ( QString, QString, int, int, int, int, float, int, int, int, int );
24
25 // Deletes a transaction. Takes the transid as its parameter
26 void deleteTransaction ( int );
27
28 // Returns the number of transactions
29 int getNumberOfTransactions ();
30
31 // this is an overloaded function that returns the number of
32 // transactions for an account
33 int getNumberOfTransactions ( int );
34
35 // deletes all transactions for the provided accountid
36 void deleteAllTransactions ( int accountid );
37
38 QString getBudgetTotal ( int budgetid, int lineitemid, int year, int month, int viewtype );
39 QString getActualTotal ( int budgetid, int year, int month, int viewtype );
40
41 // These two functions clear budget ids is either a line item or an entire budget is deleted
42 void clearBudgetIDs ( int, int );
43 void clearBudgetIDs ( int );
44
45 public slots:
46
47 void displayTransactions ( QListView *, int, bool, const char *, QDate );
48 char ** selectAllTransactions ( QDate fromdate, bool children, const char *limit, int id );
49 char ** selectNonClearedTransactions ( QDate fromdate, bool children, const char *limit, int id );
50 QString getPayee ( int );
51 QString getTransactionDescription ( int );
52 QString getNumber ( int );
53 QString getAmount ( int );
54 QString getAbsoluteAmount ( int );
55 int getCleared ( int );
56 void setCleared ( int id, int cleared );
57 int getBudgetID ( int id );
58 int getLineItemID ( int id );
59 int getDay ( int );
60 int getMonth ( int );
61 int getYear ( int );
62 int getAccountID ( int id );
63
64 private:
65
66 sqlite3 *tdb;
67 int rows, columns;
68 };
69
70#endif
71
72
73