summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/transfer.cpp
Unidiff
Diffstat (limited to 'noncore/apps/qashmoney/transfer.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/transfer.cpp61
1 files changed, 34 insertions, 27 deletions
diff --git a/noncore/apps/qashmoney/transfer.cpp b/noncore/apps/qashmoney/transfer.cpp
index 77cbb4e..568d584 100755
--- a/noncore/apps/qashmoney/transfer.cpp
+++ b/noncore/apps/qashmoney/transfer.cpp
@@ -66,5 +66,5 @@ int Transfer::getNumberOfTransfers ( int accountid )
66 } 66 }
67 67
68void Transfer::displayTransfers ( QListView *listview, int accountid, bool children ) 68void Transfer::displayTransfers ( QListView *listview, int accountid, bool children, QDate displaydate )
69 { 69 {
70 int showcleared = preferences->getPreference ( 3 ); 70 int showcleared = preferences->getPreference ( 3 );
@@ -101,4 +101,5 @@ void Transfer::displayTransfers ( QListView *listview, int accountid, bool child
101 int year = yearstring.toInt (); 101 int year = yearstring.toInt ();
102 QString date = preferences->getDate ( year, month, day ); 102 QString date = preferences->getDate ( year, month, day );
103 QDate testdate ( year, month, day );
103 104
104 //construct the amount and id strings 105 //construct the amount and id strings
@@ -113,20 +114,22 @@ void Transfer::displayTransfers ( QListView *listview, int accountid, bool child
113 QString toaccount = account->getAccountName ( atol ( results [ counter + 6 ] ) ); 114 QString toaccount = account->getAccountName ( atol ( results [ counter + 6 ] ) );
114 115
115 // display this transfer 116 if ( testdate >= displaydate || showcleared == 0 )
116 if ( account->getParentAccountID ( accountid ) == -1 )
117 { 117 {
118 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 ) 118 // display this transfer
119 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id, toaccount ); 119 if ( account->getParentAccountID ( accountid ) == -1 )
120 {
121 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 )
122 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id, toaccount );
123 else
124 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id, toaccount );
125 }
120 else 126 else
121 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id, toaccount ); 127 {
128 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 )
129 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id );
130 else
131 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id );
132 }
122 } 133 }
123 else
124 {
125 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 )
126 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id );
127 else
128 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id );
129 }
130
131 counter = counter + 7; 134 counter = counter + 7;
132 } 135 }
@@ -164,4 +167,5 @@ void Transfer::displayTransfers ( QListView *listview, int accountid, bool child
164 int year = yearstring.toInt (); 167 int year = yearstring.toInt ();
165 QString date = preferences->getDate ( year, month, day ); 168 QString date = preferences->getDate ( year, month, day );
169 QDate testdate ( year, month, day );
166 170
167 //construct the amount and id strings 171 //construct the amount and id strings
@@ -177,18 +181,21 @@ void Transfer::displayTransfers ( QListView *listview, int accountid, bool child
177 QString fromaccount = account->getAccountName ( atol ( toresults [ counter + 5 ] ) ); 181 QString fromaccount = account->getAccountName ( atol ( toresults [ counter + 5 ] ) );
178 182
179 // display this transfer 183 if ( testdate >= displaydate || showcleared == 0 )
180 if ( account->getParentAccountID ( accountid ) == -1 ) 184 {
181 { 185 // display this transfer
182 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 ) 186 if ( account->getParentAccountID ( accountid ) == -1 )
183 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id, fromaccount ); 187 {
184 else 188 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 )
185 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id, fromaccount ); 189 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id, fromaccount );
186 } 190 else
187 else 191 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id, fromaccount );
188 { 192 }
189 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 )
190 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id );
191 else 193 else
192 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id ); 194 {
195 if ( showcleared == 1 && getCleared ( id.toInt() ) == 1 )
196 ColorListItem *item = new ColorListItem ( listview, date, transactionname, amount, id );
197 else
198 QListViewItem *item = new QListViewItem ( listview, date, transactionname, amount, id );
199 }
193 } 200 }
194 201