-rwxr-xr-x | noncore/apps/qashmoney/accountdisplay.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp index 64f4ea8..d0ba82a 100755 --- a/noncore/apps/qashmoney/accountdisplay.cpp +++ b/noncore/apps/qashmoney/accountdisplay.cpp | |||
@@ -1,20 +1,19 @@ | |||
1 | #include <qdatetime.h> | 1 | #include <qdatetime.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <iostream.h> | ||
5 | 4 | ||
6 | #include "accountdisplay.h" | 5 | #include "accountdisplay.h" |
7 | #include "newaccount.h" | 6 | #include "newaccount.h" |
8 | #include "transaction.h" | 7 | #include "transaction.h" |
9 | #include "transferdialog.h" | 8 | #include "transferdialog.h" |
10 | #include "preferences.h" | 9 | #include "preferences.h" |
11 | #include "transfer.h" | 10 | #include "transfer.h" |
12 | 11 | ||
13 | extern Account *account; | 12 | extern Account *account; |
14 | extern Transaction *transaction; | 13 | extern Transaction *transaction; |
15 | extern Transfer *transfer; | 14 | extern Transfer *transfer; |
16 | extern Preferences *preferences; | 15 | extern Preferences *preferences; |
17 | 16 | ||
18 | AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) | 17 | AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) |
19 | { | 18 | { |
20 | cleared = 0; | 19 | cleared = 0; |
@@ -257,33 +256,33 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item ) | |||
257 | { | 256 | { |
258 | // construct the transferdialog window | 257 | // construct the transferdialog window |
259 | TransferDialog *td = new TransferDialog ( this, firstaccountid, secondaccountid ); | 258 | TransferDialog *td = new TransferDialog ( this, firstaccountid, secondaccountid ); |
260 | 259 | ||
261 | // enter today's date in the date box as default | 260 | // enter today's date in the date box as default |
262 | QDate today = QDate::currentDate (); | 261 | QDate today = QDate::currentDate (); |
263 | int defaultday = today.day(); | 262 | int defaultday = today.day(); |
264 | int defaultmonth = today.month(); | 263 | int defaultmonth = today.month(); |
265 | int defaultyear = today.year(); | 264 | int defaultyear = today.year(); |
266 | td->date->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) ); | 265 | td->date->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) ); |
267 | 266 | ||
268 | if ( td->exec() == QDialog::Accepted ) | 267 | if ( td->exec() == QDialog::Accepted ) |
269 | { | 268 | { |
270 | // set the cleared integer if the checkbox is checked | 269 | // set the cleared integer if the checkbox is checked |
271 | if ( td->clearedcheckbox->isChecked() == TRUE ) | 270 | if ( td->clearedcheckbox->isChecked() == TRUE ) |
272 | cleared = 1; | 271 | cleared = 1; |
273 | cout << "Year from transferdialog = " << td->getYear() << endl; | 272 | qDebug("Year from transferdialog = %i",td->getYear()); |
274 | // add the transfer with a new date if its been edited or use the default date | 273 | // add the transfer with a new date if its been edited or use the default date |
275 | if ( td->getDateEdited () == TRUE ) | 274 | if ( td->getDateEdited () == TRUE ) |
276 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); | 275 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); |
277 | else | 276 | else |
278 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); | 277 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); |
279 | 278 | ||
280 | // update account balances of both accounts and parents if necessary | 279 | // update account balances of both accounts and parents if necessary |
281 | account->updateAccountBalance ( firstaccountid ); | 280 | account->updateAccountBalance ( firstaccountid ); |
282 | if ( account->getParentAccountID ( firstaccountid ) != -1 ) | 281 | if ( account->getParentAccountID ( firstaccountid ) != -1 ) |
283 | account->changeParentAccountBalance ( account->getParentAccountID ( firstaccountid ) ); | 282 | account->changeParentAccountBalance ( account->getParentAccountID ( firstaccountid ) ); |
284 | account->updateAccountBalance ( secondaccountid ); | 283 | account->updateAccountBalance ( secondaccountid ); |
285 | if ( account->getParentAccountID ( secondaccountid ) != -1 ) | 284 | if ( account->getParentAccountID ( secondaccountid ) != -1 ) |
286 | account->changeParentAccountBalance ( account->getParentAccountID ( secondaccountid ) ); | 285 | account->changeParentAccountBalance ( account->getParentAccountID ( secondaccountid ) ); |
287 | 286 | ||
288 | // redisplay accounts | 287 | // redisplay accounts |
289 | account->displayAccounts ( listview ); | 288 | account->displayAccounts ( listview ); |