Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/kmymoney.cpp
Context not available. | |||||
126 | #include "views/konlinejoboutbox.h" | 126 | #include "views/konlinejoboutbox.h" | ||
---|---|---|---|---|---|
127 | #include "models/onlinejobmessagesmodel.h" | 127 | #include "models/onlinejobmessagesmodel.h" | ||
128 | 128 | | |||
129 | #include "mymoney/mymoneyfile.h" | ||||
129 | #include "mymoney/mymoneyutils.h" | 130 | #include "mymoney/mymoneyutils.h" | ||
130 | #include "mymoney/mymoneystatement.h" | 131 | #include "mymoney/mymoneystatement.h" | ||
131 | #include "mymoney/storage/mymoneystoragedump.h" | 132 | #include "mymoney/storage/mymoneystoragedump.h" | ||
Context not available. | |||||
165 | 166 | | |||
166 | #include "ledgerdelegate.h" | 167 | #include "ledgerdelegate.h" | ||
167 | #include "storageenums.h" | 168 | #include "storageenums.h" | ||
169 | #include "mymoneyenums.h" | ||||
168 | 170 | | |||
169 | using namespace Icons; | 171 | using namespace Icons; | ||
170 | 172 | | |||
Context not available. | |||||
2670 | try { | 2672 | try { | ||
2671 | const MyMoneySecurity& sec = file->security(newAccount.currencyId()); | 2673 | const MyMoneySecurity& sec = file->security(newAccount.currencyId()); | ||
2672 | // Check the opening balance | 2674 | // Check the opening balance | ||
2673 | if (openingBal.isPositive() && newAccount.accountGroup() == MyMoneyAccount::Liability) { | 2675 | if (openingBal.isPositive() && newAccount.accountGroup() == eMyMoney::Account::Liability) { | ||
2674 | QString message = i18n("This account is a liability and if the " | 2676 | QString message = i18n("This account is a liability and if the " | ||
2675 | "opening balance represents money owed, then it should be negative. " | 2677 | "opening balance represents money owed, then it should be negative. " | ||
2676 | "Negate the amount?\n\n" | 2678 | "Negate the amount?\n\n" | ||
Context not available. | |||||
2951 | 2953 | | |||
2952 | // in case of a loan account, we keep a reference to this | 2954 | // in case of a loan account, we keep a reference to this | ||
2953 | // schedule in the account | 2955 | // schedule in the account | ||
2954 | if (newAccount.accountType() == MyMoneyAccount::Loan | 2956 | if (newAccount.accountType() == eMyMoney::Account::Loan | ||
2955 | || newAccount.accountType() == MyMoneyAccount::AssetLoan) { | 2957 | || newAccount.accountType() == eMyMoney::Account::AssetLoan) { | ||
2956 | newAccount.setValue("schedule", newSchedule.id()); | 2958 | newAccount.setValue("schedule", newSchedule.id()); | ||
2957 | file->modifyAccount(newAccount); | 2959 | file->modifyAccount(newAccount); | ||
2958 | } | 2960 | } | ||
Context not available. | |||||
2990 | 2992 | | |||
2991 | // make sure we only allow transactions in a 'category' (income/expense account) | 2993 | // make sure we only allow transactions in a 'category' (income/expense account) | ||
2992 | switch (d->m_selectedAccount.accountType()) { | 2994 | switch (d->m_selectedAccount.accountType()) { | ||
2993 | case MyMoneyAccount::Income: | 2995 | case eMyMoney::Account::Income: | ||
2994 | case MyMoneyAccount::Expense: | 2996 | case eMyMoney::Account::Expense: | ||
2995 | break; | 2997 | break; | ||
2996 | 2998 | | |||
2997 | default: | 2999 | default: | ||
Context not available. | |||||
3100 | // to be deleted anymore | 3102 | // to be deleted anymore | ||
3101 | switch (d->m_selectedAccount.accountGroup()) { | 3103 | switch (d->m_selectedAccount.accountGroup()) { | ||
3102 | // special handling for categories to allow deleting of empty subcategories | 3104 | // special handling for categories to allow deleting of empty subcategories | ||
3103 | case MyMoneyAccount::Income: | 3105 | case eMyMoney::Account::Income: | ||
3104 | case MyMoneyAccount::Expense: { // open a compound statement here to be able to declare variables | 3106 | case eMyMoney::Account::Expense: { // open a compound statement here to be able to declare variables | ||
3105 | // which would otherwise not work within a case label. | 3107 | // which would otherwise not work within a case label. | ||
3106 | 3108 | | |||
3107 | // case A - only a single, unused category without subcats selected | 3109 | // case A - only a single, unused category without subcats selected | ||
Context not available. | |||||
3209 | MyMoneyFile* file = MyMoneyFile::instance(); | 3211 | MyMoneyFile* file = MyMoneyFile::instance(); | ||
3210 | if (!d->m_selectedAccount.id().isEmpty()) { | 3212 | if (!d->m_selectedAccount.id().isEmpty()) { | ||
3211 | if (!file->isStandardAccount(d->m_selectedAccount.id())) { | 3213 | if (!file->isStandardAccount(d->m_selectedAccount.id())) { | ||
3212 | if (d->m_selectedAccount.accountType() != MyMoneyAccount::Loan | 3214 | if (d->m_selectedAccount.accountType() != eMyMoney::Account::Loan | ||
3213 | && d->m_selectedAccount.accountType() != MyMoneyAccount::AssetLoan) { | 3215 | && d->m_selectedAccount.accountType() != eMyMoney::Account::AssetLoan) { | ||
3214 | QString caption; | 3216 | QString caption; | ||
3215 | bool category = false; | 3217 | bool category = false; | ||
3216 | switch (d->m_selectedAccount.accountGroup()) { | 3218 | switch (d->m_selectedAccount.accountGroup()) { | ||
Context not available. | |||||
3218 | caption = i18n("Edit account '%1'", d->m_selectedAccount.name()); | 3220 | caption = i18n("Edit account '%1'", d->m_selectedAccount.name()); | ||
3219 | break; | 3221 | break; | ||
3220 | 3222 | | |||
3221 | case MyMoneyAccount::Expense: | 3223 | case eMyMoney::Account::Expense: | ||
3222 | case MyMoneyAccount::Income: | 3224 | case eMyMoney::Account::Income: | ||
3223 | caption = i18n("Edit category '%1'", d->m_selectedAccount.name()); | 3225 | caption = i18n("Edit category '%1'", d->m_selectedAccount.name()); | ||
3224 | category = true; | 3226 | category = true; | ||
3225 | break; | 3227 | break; | ||
Context not available. | |||||
3245 | s0 = t.splitByAccount(d->m_selectedAccount.id()); | 3247 | s0 = t.splitByAccount(d->m_selectedAccount.id()); | ||
3246 | s1 = t.splitByAccount(d->m_selectedAccount.id(), false); | 3248 | s1 = t.splitByAccount(d->m_selectedAccount.id(), false); | ||
3247 | dlg->setOpeningBalance(s0.shares()); | 3249 | dlg->setOpeningBalance(s0.shares()); | ||
3248 | if (d->m_selectedAccount.accountGroup() == MyMoneyAccount::Liability) { | 3250 | if (d->m_selectedAccount.accountGroup() == eMyMoney::Account::Liability) { | ||
3249 | dlg->setOpeningBalance(-s0.shares()); | 3251 | dlg->setOpeningBalance(-s0.shares()); | ||
3250 | } | 3252 | } | ||
3251 | } catch (const MyMoneyException &e) { | 3253 | } catch (const MyMoneyException &e) { | ||
Context not available. | |||||
3280 | account.setOnlineBankingSettings((*it_plugin)->onlineBankingSettings(account.onlineBankingSettings())); | 3282 | account.setOnlineBankingSettings((*it_plugin)->onlineBankingSettings(account.onlineBankingSettings())); | ||
3281 | } | 3283 | } | ||
3282 | MyMoneyMoney bal = dlg->openingBalance(); | 3284 | MyMoneyMoney bal = dlg->openingBalance(); | ||
3283 | if (d->m_selectedAccount.accountGroup() == MyMoneyAccount::Liability) { | 3285 | if (d->m_selectedAccount.accountGroup() == eMyMoney::Account::Liability) { | ||
3284 | bal = -bal; | 3286 | bal = -bal; | ||
3285 | } | 3287 | } | ||
3286 | 3288 | | |||
Context not available. | |||||
3486 | // it make's sense for asset and liability accounts | 3488 | // it make's sense for asset and liability accounts | ||
3487 | try { | 3489 | try { | ||
3488 | // check if we have overdue schedules for this account | 3490 | // check if we have overdue schedules for this account | ||
3489 | QList<MyMoneySchedule> schedules = file->scheduleList(d->m_selectedAccount.id(), MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, QDate(), QDate(), true); | 3491 | QList<MyMoneySchedule> schedules = file->scheduleList(d->m_selectedAccount.id(), eMyMoney::Schedule::Type::Any, eMyMoney::Schedule::Occurrence::Any, eMyMoney::Schedule::PaymentType::Any, QDate(), QDate(), true); | ||
3490 | if (schedules.count() > 0) { | 3492 | if (schedules.count() > 0) { | ||
3491 | if (KMessageBox::questionYesNo(this, i18n("KMyMoney has detected some overdue scheduled transactions for this account. Do you want to enter those scheduled transactions now?"), i18n("Scheduled transactions found")) == KMessageBox::Yes) { | 3493 | if (KMessageBox::questionYesNo(this, i18n("KMyMoney has detected some overdue scheduled transactions for this account. Do you want to enter those scheduled transactions now?"), i18n("Scheduled transactions found")) == KMessageBox::Yes) { | ||
3492 | 3494 | | |||
Context not available. | |||||
3509 | } | 3511 | } | ||
3510 | 3512 | | |||
3511 | // reload list (maybe this schedule needs to be added again) | 3513 | // reload list (maybe this schedule needs to be added again) | ||
3512 | schedules = file->scheduleList(d->m_selectedAccount.id(), MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, QDate(), QDate(), true); | 3514 | schedules = file->scheduleList(d->m_selectedAccount.id(), eMyMoney::Schedule::Type::Any, eMyMoney::Schedule::Occurrence::Any, eMyMoney::Schedule::PaymentType::Any, QDate(), QDate(), true); | ||
3513 | } while (processedOne); | 3515 | } while (processedOne); | ||
3514 | } | 3516 | } | ||
3515 | } | 3517 | } | ||
Context not available. | |||||
3530 | 3532 | | |||
3531 | QList<QPair<MyMoneyTransaction, MyMoneySplit> > transactionList; | 3533 | QList<QPair<MyMoneyTransaction, MyMoneySplit> > transactionList; | ||
3532 | MyMoneyTransactionFilter filter(account.id()); | 3534 | MyMoneyTransactionFilter filter(account.id()); | ||
3533 | filter.addState(MyMoneyTransactionFilter::cleared); | 3535 | filter.addState((int)eMyMoney::TransactionFilter::State::Cleared); | ||
3534 | filter.addState(MyMoneyTransactionFilter::notReconciled); | 3536 | filter.addState((int)eMyMoney::TransactionFilter::State::NotReconciled); | ||
3535 | filter.setDateFilter(QDate(), endDate); | 3537 | filter.setDateFilter(QDate(), endDate); | ||
3536 | filter.setConsiderCategory(false); | 3538 | filter.setConsiderCategory(false); | ||
3537 | filter.setReportAllSplits(true); | 3539 | filter.setReportAllSplits(true); | ||
Context not available. | |||||
3600 | // retrieve list of all transactions that are not reconciled or cleared | 3602 | // retrieve list of all transactions that are not reconciled or cleared | ||
3601 | QList<QPair<MyMoneyTransaction, MyMoneySplit> > transactionList; | 3603 | QList<QPair<MyMoneyTransaction, MyMoneySplit> > transactionList; | ||
3602 | MyMoneyTransactionFilter filter(d->m_reconciliationAccount.id()); | 3604 | MyMoneyTransactionFilter filter(d->m_reconciliationAccount.id()); | ||
3603 | filter.addState(MyMoneyTransactionFilter::cleared); | 3605 | filter.addState((int)eMyMoney::TransactionFilter::State::Cleared); | ||
3604 | filter.addState(MyMoneyTransactionFilter::notReconciled); | 3606 | filter.addState((int)eMyMoney::TransactionFilter::State::NotReconciled); | ||
3605 | filter.setDateFilter(QDate(), d->m_endingBalanceDlg->statementDate()); | 3607 | filter.setDateFilter(QDate(), d->m_endingBalanceDlg->statementDate()); | ||
3606 | filter.setConsiderCategory(false); | 3608 | filter.setConsiderCategory(false); | ||
3607 | filter.setReportAllSplits(true); | 3609 | filter.setReportAllSplits(true); | ||
Context not available. | |||||
3660 | // collect the list of cleared splits for this account | 3662 | // collect the list of cleared splits for this account | ||
3661 | filter.clear(); | 3663 | filter.clear(); | ||
3662 | filter.addAccount(d->m_reconciliationAccount.id()); | 3664 | filter.addAccount(d->m_reconciliationAccount.id()); | ||
3663 | filter.addState(MyMoneyTransactionFilter::cleared); | 3665 | filter.addState(eMyMoney::TransactionFilter::Cleared); | ||
3664 | filter.setConsiderCategory(false); | 3666 | filter.setConsiderCategory(false); | ||
3665 | filter.setReportAllSplits(true); | 3667 | filter.setReportAllSplits(true); | ||
3666 | file->transactionList(transactionList, filter); | 3668 | file->transactionList(transactionList, filter); | ||
Context not available. | |||||
3916 | slotScheduleNew(MyMoneyTransaction()); | 3918 | slotScheduleNew(MyMoneyTransaction()); | ||
3917 | } | 3919 | } | ||
3918 | 3920 | | |||
3919 | void KMyMoneyApp::slotScheduleNew(const MyMoneyTransaction& _t, MyMoneySchedule::occurrenceE occurrence) | 3921 | void KMyMoneyApp::slotScheduleNew(const MyMoneyTransaction& _t, eMyMoney::Schedule::Occurrence occurrence) | ||
3920 | { | 3922 | { | ||
3921 | MyMoneySchedule schedule; | 3923 | MyMoneySchedule schedule; | ||
3922 | schedule.setOccurrence(occurrence); | 3924 | schedule.setOccurrence(occurrence); | ||
Context not available. | |||||
3927 | if (_t != MyMoneyTransaction()) { | 3929 | if (_t != MyMoneyTransaction()) { | ||
3928 | MyMoneyTransaction t(_t); | 3930 | MyMoneyTransaction t(_t); | ||
3929 | schedule.setTransaction(t); | 3931 | schedule.setTransaction(t); | ||
3930 | if (occurrence != MyMoneySchedule::OCCUR_ONCE) | 3932 | if (occurrence != eMyMoney::Schedule::Occurrence::Once) | ||
3931 | schedule.setNextDueDate(schedule.nextPayment(t.postDate())); | 3933 | schedule.setNextDueDate(schedule.nextPayment(t.postDate())); | ||
3932 | } | 3934 | } | ||
3933 | 3935 | | |||
Context not available. | |||||
3961 | KEditLoanWizard* loan_wiz = 0; | 3963 | KEditLoanWizard* loan_wiz = 0; | ||
3962 | 3964 | | |||
3963 | switch (schedule.type()) { | 3965 | switch (schedule.type()) { | ||
3964 | case MyMoneySchedule::TYPE_BILL: | 3966 | case eMyMoney::Schedule::Type::Bill: | ||
3965 | case MyMoneySchedule::TYPE_DEPOSIT: | 3967 | case eMyMoney::Schedule::Type::Deposit: | ||
3966 | case MyMoneySchedule::TYPE_TRANSFER: | 3968 | case eMyMoney::Schedule::Type::Transfer: | ||
3967 | sched_dlg = new KEditScheduleDlg(schedule, this); | 3969 | sched_dlg = new KEditScheduleDlg(schedule, this); | ||
3968 | d->m_transactionEditor = sched_dlg->startEdit(); | 3970 | d->m_transactionEditor = sched_dlg->startEdit(); | ||
3969 | if (d->m_transactionEditor) { | 3971 | if (d->m_transactionEditor) { | ||
Context not available. | |||||
4001 | delete sched_dlg; | 4003 | delete sched_dlg; | ||
4002 | break; | 4004 | break; | ||
4003 | 4005 | | |||
4004 | case MyMoneySchedule::TYPE_LOANPAYMENT: | 4006 | case eMyMoney::Schedule::Type::LoanPayment: | ||
4005 | loan_wiz = new KEditLoanWizard(schedule.account(2)); | 4007 | loan_wiz = new KEditLoanWizard(schedule.account(2)); | ||
4006 | connect(loan_wiz, SIGNAL(newCategory(MyMoneyAccount&)), this, SLOT(slotCategoryNew(MyMoneyAccount&))); | 4008 | connect(loan_wiz, SIGNAL(newCategory(MyMoneyAccount&)), this, SLOT(slotCategoryNew(MyMoneyAccount&))); | ||
4007 | connect(loan_wiz, SIGNAL(createPayee(QString,QString&)), this, SLOT(slotPayeeNew(QString,QString&))); | 4009 | connect(loan_wiz, SIGNAL(createPayee(QString,QString&)), this, SLOT(slotPayeeNew(QString,QString&))); | ||
Context not available. | |||||
4018 | delete loan_wiz; | 4020 | delete loan_wiz; | ||
4019 | break; | 4021 | break; | ||
4020 | 4022 | | |||
4021 | case MyMoneySchedule::TYPE_ANY: | 4023 | case eMyMoney::Schedule::Type::Any: | ||
4022 | break; | 4024 | break; | ||
4023 | } | 4025 | } | ||
4024 | 4026 | | |||
Context not available. | |||||
4035 | try { | 4037 | try { | ||
4036 | MyMoneySchedule sched = MyMoneyFile::instance()->schedule(d->m_selectedSchedule.id()); | 4038 | MyMoneySchedule sched = MyMoneyFile::instance()->schedule(d->m_selectedSchedule.id()); | ||
4037 | QString msg = i18n("<p>Are you sure you want to delete the scheduled transaction <b>%1</b>?</p>", d->m_selectedSchedule.name()); | 4039 | QString msg = i18n("<p>Are you sure you want to delete the scheduled transaction <b>%1</b>?</p>", d->m_selectedSchedule.name()); | ||
4038 | if (sched.type() == MyMoneySchedule::TYPE_LOANPAYMENT) { | 4040 | if (sched.type() == eMyMoney::Schedule::Type::LoanPayment) { | ||
4039 | msg += QString(" "); | 4041 | msg += QString(" "); | ||
4040 | msg += i18n("In case of loan payments it is currently not possible to recreate the scheduled transaction."); | 4042 | msg += i18n("In case of loan payments it is currently not possible to recreate the scheduled transaction."); | ||
4041 | } | 4043 | } | ||
Context not available. | |||||
4097 | try { | 4099 | try { | ||
4098 | schedule = MyMoneyFile::instance()->schedule(schedule.id()); | 4100 | schedule = MyMoneyFile::instance()->schedule(schedule.id()); | ||
4099 | if (!schedule.isFinished()) { | 4101 | if (!schedule.isFinished()) { | ||
4100 | if (schedule.occurrence() != MyMoneySchedule::OCCUR_ONCE) { | 4102 | if (schedule.occurrence() != eMyMoney::Schedule::Occurrence::Once) { | ||
4101 | QDate next = schedule.nextDueDate(); | 4103 | QDate next = schedule.nextDueDate(); | ||
4102 | if (!schedule.isFinished() && (KMessageBox::questionYesNo(this, QString("<qt>") + i18n("Do you really want to skip the <b>%1</b> transaction scheduled for <b>%2</b>?", schedule.name(), QLocale().toString(next, QLocale::ShortFormat)) + QString("</qt>"))) == KMessageBox::Yes) { | 4104 | if (!schedule.isFinished() && (KMessageBox::questionYesNo(this, QString("<qt>") + i18n("Do you really want to skip the <b>%1</b> transaction scheduled for <b>%2</b>?", schedule.name(), QLocale().toString(next, QLocale::ShortFormat)) + QString("</qt>"))) == KMessageBox::Yes) { | ||
4103 | MyMoneyFileTransaction ft; | 4105 | MyMoneyFileTransaction ft; | ||
Context not available. | |||||
5185 | if (d->m_transactionEditor) { | 5187 | if (d->m_transactionEditor) { | ||
5186 | connect(d->m_transactionEditor, SIGNAL(statusProgress(int,int)), this, SLOT(slotStatusProgressBar(int,int))); | 5188 | connect(d->m_transactionEditor, SIGNAL(statusProgress(int,int)), this, SLOT(slotStatusProgressBar(int,int))); | ||
5187 | connect(d->m_transactionEditor, SIGNAL(statusMsg(QString)), this, SLOT(slotStatusMsg(QString))); | 5189 | connect(d->m_transactionEditor, SIGNAL(statusMsg(QString)), this, SLOT(slotStatusMsg(QString))); | ||
5188 | connect(d->m_transactionEditor, SIGNAL(scheduleTransaction(MyMoneyTransaction,MyMoneySchedule::occurrenceE)), this, SLOT(slotScheduleNew(MyMoneyTransaction,MyMoneySchedule::occurrenceE))); | 5190 | connect(d->m_transactionEditor, SIGNAL(scheduleTransaction(MyMoneyTransaction,eMyMoney::Schedule::Occurrence)), this, SLOT(slotScheduleNew(MyMoneyTransaction,eMyMoney::Schedule::Occurrence))); | ||
5189 | } | 5191 | } | ||
5190 | slotUpdateActions(); | 5192 | slotUpdateActions(); | ||
5191 | } | 5193 | } | ||
Context not available. | |||||
5632 | try { | 5634 | try { | ||
5633 | KMyMoneyRegister::SelectedTransactions::const_iterator it_t; | 5635 | KMyMoneyRegister::SelectedTransactions::const_iterator it_t; | ||
5634 | for (it_t = d->m_selectedTransactions.constBegin(); it_t != d->m_selectedTransactions.constEnd(); ++it_t) { | 5636 | for (it_t = d->m_selectedTransactions.constBegin(); it_t != d->m_selectedTransactions.constEnd(); ++it_t) { | ||
5635 | if (d->m_selectedAccount.accountType() == MyMoneyAccount::Investment) { | 5637 | if (d->m_selectedAccount.accountType() == eMyMoney::Account::Investment) { | ||
5636 | d->moveInvestmentTransaction(d->m_selectedAccount.id(), id, (*it_t).transaction()); | 5638 | d->moveInvestmentTransaction(d->m_selectedAccount.id(), id, (*it_t).transaction()); | ||
5637 | } else { | 5639 | } else { | ||
5638 | QList<MyMoneySplit>::const_iterator it_s; | 5640 | QList<MyMoneySplit>::const_iterator it_s; | ||
Context not available. | |||||
5724 | 5726 | | |||
5725 | if (!d->m_selectedAccount.id().isEmpty()) { | 5727 | if (!d->m_selectedAccount.id().isEmpty()) { | ||
5726 | AccountSet accountSet; | 5728 | AccountSet accountSet; | ||
5727 | if (d->m_selectedAccount.accountType() == MyMoneyAccount::Investment) { | 5729 | if (d->m_selectedAccount.accountType() == eMyMoney::Account::Investment) { | ||
5728 | accountSet.addAccountType(MyMoneyAccount::Investment); | 5730 | accountSet.addAccountType(eMyMoney::Account::Investment); | ||
5729 | } else if (d->m_selectedAccount.isAssetLiability()) { | 5731 | } else if (d->m_selectedAccount.isAssetLiability()) { | ||
5730 | 5732 | | |||
5731 | accountSet.addAccountType(MyMoneyAccount::Checkings); | 5733 | accountSet.addAccountType(eMyMoney::Account::Checkings); | ||
5732 | accountSet.addAccountType(MyMoneyAccount::Savings); | 5734 | accountSet.addAccountType(eMyMoney::Account::Savings); | ||
5733 | accountSet.addAccountType(MyMoneyAccount::Cash); | 5735 | accountSet.addAccountType(eMyMoney::Account::Cash); | ||
5734 | accountSet.addAccountType(MyMoneyAccount::AssetLoan); | 5736 | accountSet.addAccountType(eMyMoney::Account::AssetLoan); | ||
5735 | accountSet.addAccountType(MyMoneyAccount::CertificateDep); | 5737 | accountSet.addAccountType(eMyMoney::Account::CertificateDep); | ||
5736 | accountSet.addAccountType(MyMoneyAccount::MoneyMarket); | 5738 | accountSet.addAccountType(eMyMoney::Account::MoneyMarket); | ||
5737 | accountSet.addAccountType(MyMoneyAccount::Asset); | 5739 | accountSet.addAccountType(eMyMoney::Account::Asset); | ||
5738 | accountSet.addAccountType(MyMoneyAccount::Currency); | 5740 | accountSet.addAccountType(eMyMoney::Account::Currency); | ||
5739 | accountSet.addAccountType(MyMoneyAccount::CreditCard); | 5741 | accountSet.addAccountType(eMyMoney::Account::CreditCard); | ||
5740 | accountSet.addAccountType(MyMoneyAccount::Loan); | 5742 | accountSet.addAccountType(eMyMoney::Account::Loan); | ||
5741 | accountSet.addAccountType(MyMoneyAccount::Liability); | 5743 | accountSet.addAccountType(eMyMoney::Account::Liability); | ||
5742 | } else if (d->m_selectedAccount.isIncomeExpense()) { | 5744 | } else if (d->m_selectedAccount.isIncomeExpense()) { | ||
5743 | accountSet.addAccountType(MyMoneyAccount::Income); | 5745 | accountSet.addAccountType(eMyMoney::Account::Income); | ||
5744 | accountSet.addAccountType(MyMoneyAccount::Expense); | 5746 | accountSet.addAccountType(eMyMoney::Account::Expense); | ||
5745 | } | 5747 | } | ||
5746 | 5748 | | |||
5747 | accountSet.load(d->m_moveToAccountSelector); | 5749 | accountSet.load(d->m_moveToAccountSelector); | ||
Context not available. | |||||
6100 | if (d->m_selectedTransactions.count() == 1) { | 6102 | if (d->m_selectedTransactions.count() == 1) { | ||
6101 | aC->action(s_Actions[Action::TransactionEditSplits])->setEnabled(true); | 6103 | aC->action(s_Actions[Action::TransactionEditSplits])->setEnabled(true); | ||
6102 | } | 6104 | } | ||
6103 | if (d->m_selectedAccount.isAssetLiability() && d->m_selectedAccount.accountType() != MyMoneyAccount::Investment) { | 6105 | if (d->m_selectedAccount.isAssetLiability() && d->m_selectedAccount.accountType() != eMyMoney::Account::Investment) { | ||
6104 | aC->action(s_Actions[Action::TransactionCreateSchedule])->setEnabled(d->m_selectedTransactions.count() == 1); | 6106 | aC->action(s_Actions[Action::TransactionCreateSchedule])->setEnabled(d->m_selectedTransactions.count() == 1); | ||
6105 | } | 6107 | } | ||
6106 | } | 6108 | } | ||
Context not available. | |||||
6231 | if (!d->m_selectedAccount.id().isEmpty()) { | 6233 | if (!d->m_selectedAccount.id().isEmpty()) { | ||
6232 | if (!file->isStandardAccount(d->m_selectedAccount.id())) { | 6234 | if (!file->isStandardAccount(d->m_selectedAccount.id())) { | ||
6233 | switch (d->m_selectedAccount.accountGroup()) { | 6235 | switch (d->m_selectedAccount.accountGroup()) { | ||
6234 | case MyMoneyAccount::Asset: | 6236 | case eMyMoney::Account::Asset: | ||
6235 | case MyMoneyAccount::Liability: | 6237 | case eMyMoney::Account::Liability: | ||
6236 | case MyMoneyAccount::Equity: | 6238 | case eMyMoney::Account::Equity: | ||
6237 | aC->action(s_Actions[Action::AccountTransactionReport])->setEnabled(true); | 6239 | aC->action(s_Actions[Action::AccountTransactionReport])->setEnabled(true); | ||
6238 | aC->action(s_Actions[Action::AccountEdit])->setEnabled(true); | 6240 | aC->action(s_Actions[Action::AccountEdit])->setEnabled(true); | ||
6239 | aC->action(s_Actions[Action::AccountDelete])->setEnabled(!file->isReferenced(d->m_selectedAccount)); | 6241 | aC->action(s_Actions[Action::AccountDelete])->setEnabled(!file->isReferenced(d->m_selectedAccount)); | ||
6240 | aC->action(s_Actions[Action::AccountOpen])->setEnabled(true); | 6242 | aC->action(s_Actions[Action::AccountOpen])->setEnabled(true); | ||
6241 | if (d->m_selectedAccount.accountGroup() != MyMoneyAccount::Equity) { | 6243 | if (d->m_selectedAccount.accountGroup() != eMyMoney::Account::Equity) { | ||
6242 | if (d->m_reconciliationAccount.id().isEmpty()) { | 6244 | if (d->m_reconciliationAccount.id().isEmpty()) { | ||
6243 | aC->action(s_Actions[Action::AccountStartReconciliation])->setEnabled(true); | 6245 | aC->action(s_Actions[Action::AccountStartReconciliation])->setEnabled(true); | ||
6244 | aC->action(s_Actions[Action::AccountStartReconciliation])->setToolTip(i18n("Reconcile")); | 6246 | aC->action(s_Actions[Action::AccountStartReconciliation])->setToolTip(i18n("Reconcile")); | ||
Context not available. | |||||
6253 | } | 6255 | } | ||
6254 | } | 6256 | } | ||
6255 | 6257 | | |||
6256 | if (d->m_selectedAccount.accountType() == MyMoneyAccount::Investment) | 6258 | if (d->m_selectedAccount.accountType() == eMyMoney::Account::Investment) | ||
6257 | aC->action(s_Actions[Action::InvestmentNew])->setEnabled(true); | 6259 | aC->action(s_Actions[Action::InvestmentNew])->setEnabled(true); | ||
6258 | 6260 | | |||
6259 | if (d->m_selectedAccount.isClosed()) | 6261 | if (d->m_selectedAccount.isClosed()) | ||
Context not available. | |||||
6280 | aC->action(s_Actions[Action::AccountBalanceChart])->setEnabled(true); | 6282 | aC->action(s_Actions[Action::AccountBalanceChart])->setEnabled(true); | ||
6281 | break; | 6283 | break; | ||
6282 | 6284 | | |||
6283 | case MyMoneyAccount::Income : | 6285 | case eMyMoney::Account::Income : | ||
6284 | case MyMoneyAccount::Expense : | 6286 | case eMyMoney::Account::Expense : | ||
6285 | aC->action(s_Actions[Action::CategoryEdit])->setEnabled(true); | 6287 | aC->action(s_Actions[Action::CategoryEdit])->setEnabled(true); | ||
6286 | // enable delete action, if category/account itself is not referenced | 6288 | // enable delete action, if category/account itself is not referenced | ||
6287 | // by any object except accounts, because we want to allow | 6289 | // by any object except accounts, because we want to allow | ||
Context not available. | |||||
6331 | if (!d->m_selectedSchedule.isFinished()) { | 6333 | if (!d->m_selectedSchedule.isFinished()) { | ||
6332 | aC->action(s_Actions[Action::ScheduleEnter])->setEnabled(true); | 6334 | aC->action(s_Actions[Action::ScheduleEnter])->setEnabled(true); | ||
6333 | // a schedule with a single occurrence cannot be skipped | 6335 | // a schedule with a single occurrence cannot be skipped | ||
6334 | if (d->m_selectedSchedule.occurrence() != MyMoneySchedule::OCCUR_ONCE) { | 6336 | if (d->m_selectedSchedule.occurrence() != eMyMoney::Schedule::Occurrence::Once) { | ||
6335 | aC->action(s_Actions[Action::ScheduleSkip])->setEnabled(true); | 6337 | aC->action(s_Actions[Action::ScheduleSkip])->setEnabled(true); | ||
6336 | } | 6338 | } | ||
6337 | } | 6339 | } | ||
Context not available. |