summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/transaction.cpp
Unidiff
Diffstat (limited to 'noncore/apps/qashmoney/transaction.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/transaction.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/noncore/apps/qashmoney/transaction.cpp b/noncore/apps/qashmoney/transaction.cpp
index af7d18f..5ecc7ed 100755
--- a/noncore/apps/qashmoney/transaction.cpp
+++ b/noncore/apps/qashmoney/transaction.cpp
@@ -10,2 +10,3 @@
10#include <stdlib.h> 10#include <stdlib.h>
11#include <iostream.h>
11 12
@@ -156,5 +157,6 @@ int Transaction::getYear ( int id )
156 157
157void Transaction::displayTransactions ( QListView *listview, int id, bool children, const char *limit ) 158void Transaction::displayTransactions ( QListView *listview, int id, bool children, const char *limit, QDate displaydate )
158 { 159 {
159 int showcleared = preferences->getPreference ( 3 ); 160 int showcleared = preferences->getPreference ( 3 );
161 int year = ( displaydate.year() ) - 1;
160 162
@@ -168,5 +170,5 @@ void Transaction::displayTransactions ( QListView *listview, int id, bool childr
168 if ( account->getParentAccountID ( id ) == -1 && children == TRUE ) 170 if ( account->getParentAccountID ( id ) == -1 && children == TRUE )
169 sqlite_get_table_printf ( tdb, "select day, month, year, payee, amount, transid, accountid from transactions where cleared = 0 and parentid = %i and payee like '%q';", &results, &rows, &columns, NULL, id, limit ); 171 sqlite_get_table_printf ( tdb, "select day, month, year, payee, amount, transid, accountid from transactions where cleared = 0 and year >= %i parentid = %i and payee like '%q';", &results, &rows, &columns, NULL, year, id, limit );
170 else 172 else
171 sqlite_get_table_printf ( tdb, "select day, month, year, payee, amount, transid, accountid from transactions where cleared = 0 and accountid = %i and payee like '%q';", &results, &rows, &columns, NULL, id, limit ); 173 sqlite_get_table_printf ( tdb, "select day, month, year, payee, amount, transid, accountid from transactions where cleared = 0 year >= %i accountid = %i and payee like '%q';", &results, &rows, &columns, NULL, year, id, limit );
172 } 174 }
@@ -175,3 +177,3 @@ void Transaction::displayTransactions ( QListView *listview, int id, bool childr
175 if ( account->getParentAccountID ( id ) == -1 && children == TRUE ) 177 if ( account->getParentAccountID ( id ) == -1 && children == TRUE )
176 sqlite_get_table_printf ( tdb, "select day, month, year, payee, amount, transid, accountid from transactions where parentid = %i and payee like '%q';", &results, &rows, &columns, NULL, id, limit ); 178 sqlite_get_table_printf ( tdb, "select day, month, year, payee, amount, transid, accountid from transactions where year >= %i and parentid = %i and payee like '%q';", &results, &rows, &columns, NULL, year, id, limit );
177 else 179 else
@@ -184,9 +186,3 @@ void Transaction::displayTransactions ( QListView *listview, int id, bool childr
184 { 186 {
185 // construct the date 187 QDate displaydate ( atoi ( results [ counter + 2 ] ), atoi ( results [ counter + 1 ] ), atoi ( results [ counter ] ) );
186 //QString daystring = results [ counter ];
187 //int day = results [ counter ].toInt ();
188 //QString monthstring = results [ counter + 1 ];
189 //int month = results [ counter + 1 ].toInt ();
190 //QString yearstring = results [ counter + 2 ];
191 //int year = results [ counter + 2 ].toInt ();
192 QString date = preferences->getDate ( atoi ( results [ counter + 2 ] ), atoi ( results [ counter + 1 ] ), atoi ( results [ counter ] ) ); 188 QString date = preferences->getDate ( atoi ( results [ counter + 2 ] ), atoi ( results [ counter + 1 ] ), atoi ( results [ counter ] ) );