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