From: <vo...@us...> - 2013-10-17 13:05:16
|
Revision: 4894 http://sourceforge.net/p/moneymanagerex/code/4894 Author: vomikan Date: 2013-10-17 13:05:08 +0000 (Thu, 17 Oct 2013) Log Message: ----------- fix for mini info panel Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-17 09:25:19 UTC (rev 4893) +++ trunk/src/mmcheckingpanel.cpp 2013-10-17 13:05:08 UTC (rev 4894) @@ -677,7 +677,7 @@ //if (split_) { mmSplitTransactionEntries* splits = m_trans[selIndex]->splitEntries_; - m_trans[selIndex]->getSplitTransactions(splits); + if (splits) m_trans[selIndex]->getSplitTransactions(splits); for (const auto &i : splits->entries_) { @@ -694,16 +694,11 @@ if (currencyid != basecurrencyid) //Show nothing if account currency is base { - //load settings for base currency - Model_Currency::Data* currency = Model_Currency::instance().get(basecurrencyid); - CurrencyFormatter::instance().loadSettings(currency); - wxString basecuramountStr; - basecuramountStr = CurrencyFormatter::float2Money(amount*convrate); - - amountStr = CurrencyFormatter::float2Money(amount); - - //output - infoStr << amountStr << " = " << basecuramountStr; + Model_Currency::Data *currency = Model_Currency::instance().get(currencyid); + amountStr = wxString::Format( "%f4", amount); + if (currency) amountStr = Model_Currency::toString(amount, currency); + infoStr << amountStr + << " = " << Model_Currency::toString(amount*convrate); } } return infoStr; @@ -1737,14 +1732,14 @@ if (m_selectedIndex >= 0 && m_cp->m_trans.size() > 0) { - SetItemState(m_selectedIndex, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); - SetItemState(m_selectedIndex, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); + //SetItemState(m_selectedIndex, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + //SetItemState(m_selectedIndex, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); if (topItemIndex_ < 0 || (topItemIndex_ - m_selectedIndex) > GetCountPerPage()) topItemIndex_ = m_selectedIndex; EnsureVisible(topItemIndex_); } //debuger - //wxLogDebug(wxString::Format("+trx id:%ld | top:%ld | selected:%ld", trans_id, topItemIndex_, m_selectedIndex)); + wxLogDebug(wxString::Format("+trx id:%ld | top:%ld | selected:%ld", trans_id, topItemIndex_, m_selectedIndex)); m_cp->updateExtraTransactionData(m_selectedIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-17 14:42:41
|
Revision: 4898 http://sourceforge.net/p/moneymanagerex/code/4898 Author: vomikan Date: 2013-10-17 14:42:36 +0000 (Thu, 17 Oct 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-17 14:36:17 UTC (rev 4897) +++ trunk/src/mmcheckingpanel.cpp 2013-10-17 14:42:36 UTC (rev 4898) @@ -612,63 +612,65 @@ int accountId = m_trans[selIndex]->accountID_; int toaccountId = m_trans[selIndex]->toAccountID_; Model_Account::Data* account = Model_Account::instance().get(accountId); - wxString fromaccStr = account->ACCOUNTNAME; + Model_Currency::Data* currency = Model_Account::currency(account); int basecurrencyid = Model_Infotable::instance().GetBaseCurrencyId(); - wxString transcodeStr = m_trans[selIndex]->transType_; + int currencyid = basecurrencyid; + int tocurrencyid = basecurrencyid; double amount = m_trans[selIndex]->amt_; - wxString amountStr; + double convrate = 1.0, toconvrate = 1.0; + wxString amountStr, infoStr = "", intoaccStr = ""; + wxString fromaccStr = "", one = "1.0"; + if (account) fromaccStr = account->ACCOUNTNAME; - Model_Currency::Data* currency = Model_Account::currency(account); - int currencyid = currency->CURRENCYID; - //TODO: FIXME: If base currency does not set bug may happens - if (basecurrencyid == -1) basecurrencyid = currencyid; - wxString curpfxStr = currency->PFX_SYMBOL; - wxString cursfxStr = currency->SFX_SYMBOL; - double convrate = currency->BASECONVRATE; + if (currency) + { + currencyid = currency->CURRENCYID; + convrate = currency->BASECONVRATE; + one = Model_Currency::toString(1, currency); + } - wxString infoStr = ""; - if (transcodeStr == TRANS_TYPE_TRANSFER_STR) + if (m_trans[selIndex]->transType_ == TRANS_TYPE_TRANSFER_STR) { Model_Account::Data* to_account = Model_Account::instance().get(toaccountId); + if (to_account) intoaccStr = to_account->ACCOUNTNAME; Model_Currency::Data* to_currency = Model_Account::currency(to_account); - wxString intoaccStr = to_account->ACCOUNTNAME; - double toconvrate = to_currency->BASECONVRATE; - wxString tocurpfxStr = to_currency->PFX_SYMBOL; - wxString tocursfxStr = to_currency->SFX_SYMBOL; + if (!to_currency) + { + wxASSERT(false); + to_currency = Model_Currency::GetBaseCurrency(); + } - int tocurrencyid = to_currency->CURRENCYID; + toconvrate = to_currency->BASECONVRATE; + tocurrencyid = to_currency->CURRENCYID; + double toamount = m_trans[selIndex]->toAmt_; double convertion = 0.0; if (toamount != 0.0 && amount != 0.0) convertion = ( convrate < toconvrate ? amount/toamount : toamount/amount); wxString toamountStr, convertionStr; -// CurrencyFormatter::instance().loadSettings(*pCurrencyPtr); - toamountStr = CurrencyFormatter::float2Money(toamount); - convertionStr = CurrencyFormatter::float2String(convertion); + amountStr = Model_Currency::toString(amount, currency); + toamountStr = Model_Currency::toString(toamount, to_currency); + convertionStr = Model_Currency::toString(convertion, to_currency); -// CurrencyFormatter::instance().loadSettings(*pCurrencyPtr); - amountStr = CurrencyFormatter::float2Money(amount); - //if (currencyid == basecurrencyid) - convertionStr = CurrencyFormatter::float2String(convertion); - infoStr << amountStr << " "; - if (amount!=toamount || tocurrencyid != currencyid) + if (amount != toamount || tocurrencyid != currencyid) infoStr << "-> " << toamountStr << " "; infoStr << wxString::Format(_("From %s to %s"), fromaccStr, intoaccStr); if (tocurrencyid != currencyid) { + one = Model_Currency::toString(1, currency); infoStr << " ( "; if (accountId == m_AccountID && convrate < toconvrate) - infoStr << tocurpfxStr << "1" << tocursfxStr << " = " << curpfxStr << convertionStr << cursfxStr << " "; + infoStr << one << " = " << convertionStr << " "; else if (accountId == m_AccountID && convrate > toconvrate) - infoStr << curpfxStr << "1" << cursfxStr << " = " << tocurpfxStr << convertionStr << tocursfxStr << " "; + infoStr << one << " = " << convertionStr << " "; else if (accountId != m_AccountID && convrate < toconvrate) - infoStr << tocurpfxStr << "1" << tocursfxStr << " = " << curpfxStr << convertionStr << cursfxStr << " "; + infoStr << one << " = " << convertionStr << " "; else - infoStr << curpfxStr << "1" << cursfxStr << " = " << tocurpfxStr << convertionStr << tocursfxStr << " "; + infoStr << one << " = " << convertionStr << " "; infoStr << " )"; } } @@ -694,7 +696,6 @@ if (currencyid != basecurrencyid) //Show nothing if account currency is base { - Model_Currency::Data *currency = Model_Currency::instance().get(currencyid); amountStr = wxString::Format( "%f4", amount); if (currency) amountStr = Model_Currency::toString(amount, currency); infoStr << amountStr This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-17 14:58:40
|
Revision: 4899 http://sourceforge.net/p/moneymanagerex/code/4899 Author: vomikan Date: 2013-10-17 14:58:37 +0000 (Thu, 17 Oct 2013) Log Message: ----------- typo fix Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-17 14:42:36 UTC (rev 4898) +++ trunk/src/mmcheckingpanel.cpp 2013-10-17 14:58:37 UTC (rev 4899) @@ -1733,8 +1733,8 @@ if (m_selectedIndex >= 0 && m_cp->m_trans.size() > 0) { - //SetItemState(m_selectedIndex, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); - //SetItemState(m_selectedIndex, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); + SetItemState(m_selectedIndex, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + SetItemState(m_selectedIndex, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); if (topItemIndex_ < 0 || (topItemIndex_ - m_selectedIndex) > GetCountPerPage()) topItemIndex_ = m_selectedIndex; EnsureVisible(topItemIndex_); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-18 07:11:33
|
Revision: 4907 http://sourceforge.net/p/moneymanagerex/code/4907 Author: guanlisheng Date: 2013-10-18 07:11:27 +0000 (Fri, 18 Oct 2013) Log Message: ----------- start checking panel refactor Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-18 06:57:41 UTC (rev 4906) +++ trunk/src/mmcheckingpanel.cpp 2013-10-18 07:11:27 UTC (rev 4907) @@ -140,6 +140,8 @@ void mmCheckingPanel::sortTable() { + // TODO m_trans_2 + std::sort(this->m_trans.begin(), this->m_trans.end()); // default sorter if (m_listCtrlAccount->g_sortcol == m_listCtrlAccount->COL_DATE_OR_TRANSACTION_ID) { @@ -346,6 +348,7 @@ filteredBalance_ = 0.0; // clear everything m_trans = core_->bTransactionList_.accountTransactions_; + this->m_trans_2 = Model_Checking::instance().find(Model_Checking::ACCOUNTID(m_AccountID)); m_listCtrlAccount->DeleteAllItems(); // decide whether top or down icon needs to be shown This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-22 07:25:22
|
Revision: 4949 http://sourceforge.net/p/moneymanagerex/code/4949 Author: vomikan Date: 2013-10-22 07:25:20 +0000 (Tue, 22 Oct 2013) Log Message: ----------- save transaction and split items Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-22 06:53:44 UTC (rev 4948) +++ trunk/src/mmcheckingpanel.cpp 2013-10-22 07:25:20 UTC (rev 4949) @@ -1601,10 +1601,16 @@ if ( dlg.ShowModal() == wxID_OK ) { - int transID = dlg.getTransID(); - refreshVisualList(transID); + Model_Checking::instance().save(transaction); + if (split.size() > 0) + { + for (auto &item : split) + item.TRANSID = transaction->TRANSID; + Model_Splittransaction::instance().save(split); + } + + refreshVisualList(transaction->TRANSID); } - } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-22 10:09:07
|
Revision: 4951 http://sourceforge.net/p/moneymanagerex/code/4951 Author: guanlisheng Date: 2013-10-22 10:09:03 +0000 (Tue, 22 Oct 2013) Log Message: ----------- checking panel Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-22 09:24:54 UTC (rev 4950) +++ trunk/src/mmcheckingpanel.cpp 2013-10-22 10:09:03 UTC (rev 4951) @@ -348,7 +348,7 @@ filteredBalance_ = 0.0; // clear everything m_trans = core_->bTransactionList_.accountTransactions_; - this->m_trans_2 = Model_Checking::instance().find(Model_Checking::ACCOUNTID(m_AccountID)); + this->m_trans_2 = Model_Checking::instance().find_or(Model_Checking::ACCOUNTID(m_AccountID), Model_Checking::TOACCOUNTID(m_AccountID)); m_listCtrlAccount->DeleteAllItems(); // decide whether top or down icon needs to be shown @@ -911,6 +911,26 @@ } return cell_value; + + const Model_Checking::Data& tran = this->m_trans_2.at(item); + switch (column) + { + case TransactionListCtrl::COL_DATE_OR_TRANSACTION_ID: + return mmGetDateForDisplay(Model_Checking::TRANSDATE(tran)); + case TransactionListCtrl::COL_TRANSACTION_NUMBER: + return tran.TRANSACTIONNUMBER; + case TransactionListCtrl::COL_PAYEE_STR: + case TransactionListCtrl::COL_STATUS: + return tran.STATUS; + case TransactionListCtrl::COL_CATEGORY: + case TransactionListCtrl::COL_WITHDRAWAL: + case TransactionListCtrl::COL_DEPOSIT: + case TransactionListCtrl::COL_BALANCE: + case TransactionListCtrl::COL_NOTES: + return tran.NOTES; + default: + return ""; + } } void mmCheckingPanel::OnSearchTxtEntered(wxCommandEvent& /*event*/) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-26 12:06:50
|
Revision: 4987 http://sourceforge.net/p/moneymanagerex/code/4987 Author: guanlisheng Date: 2013-10-26 12:06:46 +0000 (Sat, 26 Oct 2013) Log Message: ----------- just show $ in checking panel Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-26 12:04:18 UTC (rev 4986) +++ trunk/src/mmcheckingpanel.cpp 2013-10-26 12:06:46 UTC (rev 4987) @@ -205,6 +205,7 @@ Model_Checking::Full_Data full_tran(tran); full_tran.CATEGNAME = category ? category->CATEGNAME: ""; full_tran.SUBCATEGNAME = sub_category ? sub_category->SUBCATEGNAME: ""; + full_tran.PAYEENAME = payee->PAYEENAME; this->m_trans.push_back(full_tran); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-26 12:39:19
|
Revision: 4988 http://sourceforge.net/p/moneymanagerex/code/4988 Author: guanlisheng Date: 2013-10-26 12:39:16 +0000 (Sat, 26 Oct 2013) Log Message: ----------- show balance $ in checking panel Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-26 12:06:46 UTC (rev 4987) +++ trunk/src/mmcheckingpanel.cpp 2013-10-26 12:39:16 UTC (rev 4988) @@ -815,7 +815,7 @@ else return ""; case TransactionListCtrl::COL_BALANCE: - // TODO + return Model_Currency::toCurrency(Model_Checking::balance(&tran, this->m_AccountID), this->m_currency); case TransactionListCtrl::COL_NOTES: return tran.NOTES; default: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-26 13:00:22
|
Revision: 4989 http://sourceforge.net/p/moneymanagerex/code/4989 Author: vomikan Date: 2013-10-26 13:00:18 +0000 (Sat, 26 Oct 2013) Log Message: ----------- fix for filterTable Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-26 12:39:16 UTC (rev 4988) +++ trunk/src/mmcheckingpanel.cpp 2013-10-26 13:00:18 UTC (rev 4989) @@ -181,14 +181,18 @@ void mmCheckingPanel::filterTable() { this->m_trans.clear(); - for (const auto& tran: Model_Checking::instance().find_or(Model_Checking::ACCOUNTID(m_AccountID), Model_Checking::TOACCOUNTID(m_AccountID))) + for (const auto& tran : Model_Checking::instance().find_or(Model_Checking::ACCOUNTID(m_AccountID), Model_Checking::TOACCOUNTID(m_AccountID))) { - if (transFilterDlg_->getAccountCheckBox() && transFilterDlg_->getAccountID() != tran.TOACCOUNTID) continue; - if (transFilterDlg_->getDateRangeCheckBox() && ! Model_Checking::TRANSDATE(tran).IsBetween(transFilterDlg_->getFromDateCtrl().GetDateOnly(), transFilterDlg_->getToDateControl().GetDateOnly())) continue; + if (transFilterDlg_->getAccountCheckBox() + && (transFilterDlg_->getAccountID() != tran.ACCOUNTID && transFilterDlg_->getAccountID() != tran.TOACCOUNTID)) continue; - const Model_Payee::Data* payee = Model_Payee::instance().get(tran.PAYEEID); - if (!payee) continue; - if (transFilterDlg_->getPayeeCheckBox() && transFilterDlg_->userPayeeStr() != payee->PAYEENAME) continue; + //wxLogDebug("Check date? %i trx date:%s %s %s", transFilterDlg_->getDateRangeCheckBox(), tran.TRANSDATE, transFilterDlg_->getFromDateCtrl().GetDateOnly().FormatISODate(), transFilterDlg_->getToDateControl().GetDateOnly().FormatISODate()); + //if (transFilterDlg_->getDateRangeCheckBox() + // && !Model_Checking::TRANSDATE(tran).IsBetween(transFilterDlg_->getFromDateCtrl().GetDateOnly() + // , transFilterDlg_->getToDateControl().GetDateOnly() + // ) + // ) continue; + if (transFilterDlg_->getCategoryCheckBox() && !(transFilterDlg_->getCategoryID() == tran.CATEGID && transFilterDlg_->getSubCategoryID() == tran.SUBCATEGID)) continue; if (transFilterDlg_->getStatusCheckBox() && transFilterDlg_->getStatus() != tran.STATUS) continue; if (transFilterDlg_->getTypeCheckBox() && transFilterDlg_->getType() != tran.TRANSCODE) continue; @@ -197,15 +201,21 @@ if (transFilterDlg_->getNumberCheckBox() && transFilterDlg_->getNumber() != tran.TRANSACTIONNUMBER) continue; if (transFilterDlg_->getNotesCheckBox() && !tran.NOTES.Matches(transFilterDlg_->getNotes())) continue; - filteredBalance_ += tran.TRANSAMOUNT; - + Model_Checking::Full_Data full_tran(tran); + if (Model_Checking::TRANSFER != Model_Checking::type(tran)) + { + const Model_Payee::Data* payee = Model_Payee::instance().get(tran.PAYEEID); + if (transFilterDlg_->getPayeeCheckBox()) + { + if (transFilterDlg_->userPayeeStr().CmpNoCase(payee->PAYEENAME)) continue; + } + full_tran.PAYEENAME = payee->PAYEENAME; + } Model_Category::Data* category = Model_Category::instance().get(tran.CATEGID); - Model_Subcategory::Data* sub_category = Model_Subcategory::instance().get(tran.SUBCATEGID); - Model_Checking::Full_Data full_tran(tran); - full_tran.CATEGNAME = category ? category->CATEGNAME: ""; - full_tran.SUBCATEGNAME = sub_category ? sub_category->SUBCATEGNAME: ""; - full_tran.PAYEENAME = payee->PAYEENAME; + full_tran.CATEGNAME = category ? Model_Category::instance().full_name(tran.CATEGID, tran.SUBCATEGID) : ""; + //Model_Subcategory::Data* sub_category = Model_Subcategory::instance().get(tran.SUBCATEGID); + //full_tran.SUBCATEGNAME = sub_category ? sub_category->SUBCATEGNAME: ""; this->m_trans.push_back(full_tran); } @@ -278,7 +288,8 @@ m_listCtrlAccount->DeleteAllItems(); // decide whether top or down icon needs to be shown - m_listCtrlAccount->setColumnImage(m_listCtrlAccount->g_sortcol, m_listCtrlAccount->g_asc ? m_listCtrlAccount->ICON_ASC : m_listCtrlAccount->ICON_DESC); + m_listCtrlAccount->setColumnImage(m_listCtrlAccount->g_sortcol + , m_listCtrlAccount->g_asc ? m_listCtrlAccount->ICON_ASC : m_listCtrlAccount->ICON_DESC); filterTable(); sortTable(); m_listCtrlAccount->SetItemCount(m_trans.size()); @@ -369,9 +380,9 @@ /* ---------------------- */ - wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow( this, - ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(200, 200), - wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER ); + wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow( this + , ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(200, 200) + , wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER ); wxSize imageSize(16, 16); m_imageList.reset(new wxImageList(imageSize.GetWidth(), imageSize.GetHeight())); @@ -789,7 +800,7 @@ wxString mmCheckingPanel::getItem(long item, long column) const { - if (item < 0 || item >= m_trans.size()) return ""; + if (item < 0 || item >= (int)m_trans.size()) return ""; const Model_Checking::Full_Data& tran = this->m_trans.at(item); switch (column) @@ -1282,7 +1293,7 @@ */ wxListItemAttr* TransactionListCtrl::OnGetItemAttr(long item) const { - if (item < 0 || item >= m_cp->m_trans.size()) return 0; + if (item < 0 || item >= (int)m_cp->m_trans.size()) return 0; const Model_Checking::Full_Data& tran = m_cp->m_trans[item]; bool in_the_future = Model_Checking::TRANSDATE(&tran) > wxDateTime::Now().GetDateOnly(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-26 15:19:28
|
Revision: 4993 http://sourceforge.net/p/moneymanagerex/code/4993 Author: vomikan Date: 2013-10-26 15:19:25 +0000 (Sat, 26 Oct 2013) Log Message: ----------- fix for change transaction status Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-26 15:11:04 UTC (rev 4992) +++ trunk/src/mmcheckingpanel.cpp 2013-10-26 15:19:25 UTC (rev 4993) @@ -1168,11 +1168,13 @@ else if (evt == MENU_TREEPOPUP_MARKDELETE) status = "X"; else wxASSERT(false); - int transID = OnMarkTransactionDB(status); + m_cp->m_trans[m_selectedIndex].STATUS = status; + Model_Checking::Data *trx = Model_Checking::instance().get(m_cp->m_trans[m_selectedIndex].TRANSID); + if (trx) Model_Checking::instance().save(trx); if ((m_cp->transFilterActive_ && m_cp->transFilterDlg_->getStatusCheckBox()) || (status == "X" && !showDeletedTransactions_)) - refreshVisualList(transID); + refreshVisualList(m_cp->m_trans[m_selectedIndex].TRANSID); else RefreshItems(m_selectedIndex, m_selectedIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-27 12:35:49
|
Revision: 5013 http://sourceforge.net/p/moneymanagerex/code/5013 Author: vomikan Date: 2013-10-27 12:35:46 +0000 (Sun, 27 Oct 2013) Log Message: ----------- fix for selected account Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-27 12:16:07 UTC (rev 5012) +++ trunk/src/mmcheckingpanel.cpp 2013-10-27 12:35:46 UTC (rev 5013) @@ -32,14 +32,11 @@ #include "model/Model_Category.h" //---------------------------------------------------------------------------- + #include <wx/srchctrl.h> #include <algorithm> //---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- - BEGIN_EVENT_TABLE(mmCheckingPanel, wxPanel) EVT_BUTTON(wxID_NEW, mmCheckingPanel::OnNewTransaction) EVT_BUTTON(wxID_EDIT, mmCheckingPanel::OnEditTransaction) @@ -130,6 +127,8 @@ transFilterActive_ = false; transFilterDlg_ = new mmFilterTransactionsDialog(this); SetTransactionFilterState(true); + m_account = Model_Account::instance().get(m_AccountID); + if (!m_account) return false; initViewTransactionsHeader(); initFilterSettings(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-27 20:26:34
|
Revision: 5021 http://sourceforge.net/p/moneymanagerex/code/5021 Author: vomikan Date: 2013-10-27 20:26:31 +0000 (Sun, 27 Oct 2013) Log Message: ----------- fix for withdrawa / deposit amounts Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-27 16:56:29 UTC (rev 5020) +++ trunk/src/mmcheckingpanel.cpp 2013-10-27 20:26:31 UTC (rev 5021) @@ -191,7 +191,7 @@ for (const auto& tran : Model_Checking::instance().find_or(Model_Checking::ACCOUNTID(m_AccountID), Model_Checking::TOACCOUNTID(m_AccountID))) { - double transaction_amount = (Model_Checking::status(tran) != Model_Checking::VOID_) ? Model_Checking::balance(tran) : 0; + double transaction_amount = (Model_Checking::status(tran) != Model_Checking::VOID_) ? Model_Checking::balance(tran, m_AccountID) : 0; account_balance_ += transaction_amount; reconciled_balance_ += (Model_Checking::status(tran) == Model_Checking::RECONCILED) ? transaction_amount : 0; if (transFilterActive_) @@ -826,15 +826,11 @@ case TransactionListCtrl::COL_CATEGORY: return tran.CATEGNAME; case TransactionListCtrl::COL_WITHDRAWAL: - if (Model_Checking::type(&tran) == Model_Checking::WITHDRAWAL) - return Model_Currency::toString(tran.TRANSAMOUNT, this->m_currency); - else - return ""; + return Model_Checking::balance(tran, m_AccountID) <= 0 + ? Model_Currency::toString(tran.TRANSAMOUNT, this->m_currency) : ""; case TransactionListCtrl::COL_DEPOSIT: - if (Model_Checking::type(&tran) == Model_Checking::DEPOSIT) - return Model_Currency::toString(tran.TRANSAMOUNT, this->m_currency); - else - return ""; + return Model_Checking::balance(tran, m_AccountID) > 0 + ? Model_Currency::toString(tran.TRANSAMOUNT, this->m_currency) : ""; case TransactionListCtrl::COL_BALANCE: return Model_Currency::toString(tran.BALANCE, this->m_currency); case TransactionListCtrl::COL_NOTES: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-27 21:14:34
|
Revision: 5023 http://sourceforge.net/p/moneymanagerex/code/5023 Author: vomikan Date: 2013-10-27 21:14:31 +0000 (Sun, 27 Oct 2013) Log Message: ----------- fix for category column Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-27 21:02:09 UTC (rev 5022) +++ trunk/src/mmcheckingpanel.cpp 2013-10-27 21:14:31 UTC (rev 5023) @@ -227,8 +227,8 @@ { const Model_Payee::Data* payee = Model_Payee::instance().get(tran.PAYEEID); if (payee) full_tran.PAYEENAME = payee->PAYEENAME; - full_tran.CATEGNAME = Model_Category::instance().full_name(tran.CATEGID, tran.SUBCATEGID); } + full_tran.CATEGNAME = Model_Category::instance().full_name(tran.CATEGID, tran.SUBCATEGID); filteredBalance_ += transaction_amount; this->m_trans.push_back(full_tran); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-27 23:59:20
|
Revision: 5026 http://sourceforge.net/p/moneymanagerex/code/5026 Author: guanlisheng Date: 2013-10-27 23:59:17 +0000 (Sun, 27 Oct 2013) Log Message: ----------- sorted transactions Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-27 23:52:36 UTC (rev 5025) +++ trunk/src/mmcheckingpanel.cpp 2013-10-27 23:59:17 UTC (rev 5026) @@ -189,7 +189,7 @@ reconciled_balance_ = account_balance_; } - for (const auto& tran : Model_Checking::instance().find_or(Model_Checking::ACCOUNTID(m_AccountID), Model_Checking::TOACCOUNTID(m_AccountID))) + for (const auto& tran : Model_Account::transaction(this->m_account)) { double transaction_amount = (Model_Checking::status(tran) != Model_Checking::VOID_) ? Model_Checking::balance(tran, m_AccountID) : 0; account_balance_ += transaction_amount; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-11-09 15:26:03
|
Revision: 5144 http://sourceforge.net/p/moneymanagerex/code/5144 Author: siena123 Date: 2013-11-09 15:25:59 +0000 (Sat, 09 Nov 2013) Log Message: ----------- fix memory leak Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-09 14:05:53 UTC (rev 5143) +++ trunk/src/mmcheckingpanel.cpp 2013-11-09 15:25:59 UTC (rev 5144) @@ -687,23 +687,50 @@ mmDateRange* date_range = new mmAllTime; if (currentView_ == MENU_VIEW_ALLTRANSACTIONS) + { + delete date_range; date_range = new mmAllTime; + } else if (currentView_ == MENU_VIEW_TODAY) + { + delete date_range; date_range = new mmToday; + } else if (currentView_ == MENU_VIEW_CURRENTMONTH) + { + delete date_range; date_range = new mmCurrentMonth; + } else if (currentView_ == MENU_VIEW_LAST30) + { + delete date_range; date_range = new mmLast30Days; + } else if (currentView_ == MENU_VIEW_LAST90) + { + delete date_range; date_range = new mmLast90Days; + } else if (currentView_ == MENU_VIEW_LASTMONTH) + { + delete date_range; date_range = new mmLastMonth; + } else if (currentView_ == MENU_VIEW_LAST3MONTHS) + { + delete date_range; date_range = new mmLast3Months; + } else if (currentView_ == MENU_VIEW_LAST12MONTHS) + { + delete date_range; date_range = new mmCurrentYear; + } else if (currentView_ == MENU_VIEW_CURRENTYEAR) + { + delete date_range; date_range = new mmLast12Months; + } else wxASSERT(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-11-10 13:42:00
|
Revision: 5158 http://sourceforge.net/p/moneymanagerex/code/5158 Author: siena123 Date: 2013-11-10 13:41:57 +0000 (Sun, 10 Nov 2013) Log Message: ----------- Fix for pop up menu Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-10 13:23:19 UTC (rev 5157) +++ trunk/src/mmcheckingpanel.cpp 2013-11-10 13:41:57 UTC (rev 5158) @@ -1097,7 +1097,16 @@ } bool hide_menu_item = (selectedIndex < 0); - const Model_Checking::Full_Data& tran = m_cp->m_trans.at(m_selectedIndex); + bool type_transfer = false; + bool have_category = false; + if (m_selectedIndex > -1) + { + const Model_Checking::Full_Data& tran = m_cp->m_trans.at(m_selectedIndex); + if (Model_Checking::type(tran) == Model_Checking::TRANSFER) + type_transfer = true; + if (tran.CATEGID > -1) + have_category = true; + } wxMenu menu; menu.Append(MENU_TREEPOPUP_NEW, _("&New Transaction")); menu.AppendSeparator(); @@ -1108,8 +1117,7 @@ menu.Append(MENU_ON_DUPLICATE_TRANSACTION, _("D&uplicate Transaction")); if (hide_menu_item) menu.Enable(MENU_ON_DUPLICATE_TRANSACTION, false); menu.Append(MENU_TREEPOPUP_MOVE, _("&Move Transaction")); - if (hide_menu_item || Model_Checking::type(tran) == Model_Checking::TRANSFER || (Model_Account::checking_account_num() < 2) - || Model_Checking::type(&tran) == Model_Checking::TRANSFER) + if (hide_menu_item || type_transfer || (Model_Account::checking_account_num() < 2)) menu.Enable(MENU_TREEPOPUP_MOVE, false); menu.Append(MENU_ON_PASTE_TRANSACTION, _("&Paste Transaction")); if (m_selectedForCopy < 0) menu.Enable(MENU_ON_PASTE_TRANSACTION, false); @@ -1117,7 +1125,7 @@ menu.AppendSeparator(); menu.Append(MENU_TREEPOPUP_VIEW_SPLIT_CATEGORIES, _("&View Split Categories")); - if (hide_menu_item || (tran.CATEGID > -1)) + if (hide_menu_item || have_category) menu.Enable(MENU_TREEPOPUP_VIEW_SPLIT_CATEGORIES, false); menu.AppendSeparator(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-11-10 20:10:59
|
Revision: 5172 http://sourceforge.net/p/moneymanagerex/code/5172 Author: siena123 Date: 2013-11-10 20:10:57 +0000 (Sun, 10 Nov 2013) Log Message: ----------- cleanup - TODO already done Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-10 20:04:39 UTC (rev 5171) +++ trunk/src/mmcheckingpanel.cpp 2013-11-10 20:10:57 UTC (rev 5172) @@ -1133,7 +1133,6 @@ menu.Append(MENU_TREEPOPUP_MARKDELETE, _("Move to Trash")); if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_MARKDELETE, false); - //TODO: how to set value??? wxString menu_item_label = showDeletedTransactions_ ? _("Hide Deleted") : _("Show Deleted"); menu.AppendCheckItem(MENU_TREEPOPUP_SHOWTRASH, menu_item_label); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-11-10 20:16:14
|
Revision: 5173 http://sourceforge.net/p/moneymanagerex/code/5173 Author: siena123 Date: 2013-11-10 20:16:10 +0000 (Sun, 10 Nov 2013) Log Message: ----------- cleanup - TODO already done Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-10 20:10:57 UTC (rev 5172) +++ trunk/src/mmcheckingpanel.cpp 2013-11-10 20:16:10 UTC (rev 5173) @@ -779,9 +779,8 @@ { for (const auto& tran: this->m_trans) { + // remove also removes any split transactions Model_Checking::instance().remove(tran.TRANSID); - // TODO remove split - // CHECK if (m_listCtrlAccount->m_selectedForCopy == tran.TRANSID) m_listCtrlAccount->m_selectedForCopy = -1; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-11-10 20:20:13
|
Revision: 5174 http://sourceforge.net/p/moneymanagerex/code/5174 Author: siena123 Date: 2013-11-10 20:20:11 +0000 (Sun, 10 Nov 2013) Log Message: ----------- cleanup - TODO already done Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-10 20:16:10 UTC (rev 5173) +++ trunk/src/mmcheckingpanel.cpp 2013-11-10 20:20:11 UTC (rev 5174) @@ -791,9 +791,8 @@ { if (tran.STATUS == status) { + // remove also removes any split transactions Model_Checking::instance().remove(tran.TRANSID); - // TODO remove split - // CHECK if (m_listCtrlAccount->m_selectedForCopy == tran.TRANSID) m_listCtrlAccount->m_selectedForCopy = -1; } } @@ -1493,8 +1492,8 @@ long transID = i.TRANSID; if (m_cp->m_listCtrlAccount->GetItemState(x, wxLIST_STATE_SELECTED) == wxLIST_STATE_SELECTED) { + // remove also removes any split transactions Model_Checking::instance().remove(transID); - // TODO remove split if (x <= topItemIndex_) topItemIndex_--; m_selectedIndex--; if (m_selectedForCopy == transID) m_selectedForCopy = -1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-11-10 22:20:41
|
Revision: 5178 http://sourceforge.net/p/moneymanagerex/code/5178 Author: siena123 Date: 2013-11-10 22:20:38 +0000 (Sun, 10 Nov 2013) Log Message: ----------- cleanup - TODO Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-10 21:22:53 UTC (rev 5177) +++ trunk/src/mmcheckingpanel.cpp 2013-11-10 22:20:38 UTC (rev 5178) @@ -155,10 +155,32 @@ std::stable_sort(this->m_trans.begin(), this->m_trans.end(), SorterByCATEGNAME()); break; case TransactionListCtrl::COL_WITHDRAWAL: - // TODO + std::stable_sort(this->m_trans.begin(), this->m_trans.end() + , [&](const Model_Checking::Data& x, const Model_Checking::Data& y) + { + double trans_x = x.TRANSAMOUNT; + if ((Model_Checking::type(x) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(x) == Model_Checking::TRANSFER && x.ACCOUNTID == this->m_AccountID)) + trans_x = -trans_x; + double trans_y = y.TRANSAMOUNT; + if ((Model_Checking::type(y) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(y) == Model_Checking::TRANSFER && y.ACCOUNTID == this->m_AccountID)) + trans_y = -trans_y; + + return trans_x > trans_y; + }); break; case TransactionListCtrl::COL_DEPOSIT: - // TODO + std::stable_sort(this->m_trans.begin(), this->m_trans.end() + , [&](const Model_Checking::Data& x, const Model_Checking::Data& y) + { + double trans_x = x.TRANSAMOUNT; + if ((Model_Checking::type(x) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(x) == Model_Checking::TRANSFER && x.ACCOUNTID == this->m_AccountID)) + trans_x = -trans_x; + double trans_y = y.TRANSAMOUNT; + if ((Model_Checking::type(y) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(y) == Model_Checking::TRANSFER && y.ACCOUNTID == this->m_AccountID)) + trans_y = -trans_y; + + return trans_x < trans_y; + }); break; case TransactionListCtrl::COL_BALANCE: std::stable_sort(this->m_trans.begin(), this->m_trans.end(), Model_Checking::SorterByBALANCE()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-11-11 03:36:23
|
Revision: 5194 http://sourceforge.net/p/moneymanagerex/code/5194 Author: guanlisheng Date: 2013-11-11 03:36:20 +0000 (Mon, 11 Nov 2013) Log Message: ----------- fix sorter by withdrawal & deposit Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-11 03:30:54 UTC (rev 5193) +++ trunk/src/mmcheckingpanel.cpp 2013-11-11 03:36:20 UTC (rev 5194) @@ -158,28 +158,14 @@ std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [&](const Model_Checking::Data& x, const Model_Checking::Data& y) { - double trans_x = x.TRANSAMOUNT; - if ((Model_Checking::type(x) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(x) == Model_Checking::TRANSFER && x.ACCOUNTID == this->m_AccountID)) - trans_x = -trans_x; - double trans_y = y.TRANSAMOUNT; - if ((Model_Checking::type(y) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(y) == Model_Checking::TRANSFER && y.ACCOUNTID == this->m_AccountID)) - trans_y = -trans_y; - - return trans_x > trans_y; + return Model_Checking::withdrawal(x, this->m_AccountID) < Model_Checking::withdrawal(y, this->m_AccountID); }); break; case TransactionListCtrl::COL_DEPOSIT: std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [&](const Model_Checking::Data& x, const Model_Checking::Data& y) { - double trans_x = x.TRANSAMOUNT; - if ((Model_Checking::type(x) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(x) == Model_Checking::TRANSFER && x.ACCOUNTID == this->m_AccountID)) - trans_x = -trans_x; - double trans_y = y.TRANSAMOUNT; - if ((Model_Checking::type(y) == Model_Checking::WITHDRAWAL) || (Model_Checking::type(y) == Model_Checking::TRANSFER && y.ACCOUNTID == this->m_AccountID)) - trans_y = -trans_y; - - return trans_x < trans_y; + return Model_Checking::deposit(x, this->m_AccountID) < Model_Checking::deposit(y, this->m_AccountID); }); break; case TransactionListCtrl::COL_BALANCE: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-11-11 16:36:35
|
Revision: 5213 http://sourceforge.net/p/moneymanagerex/code/5213 Author: vomikan Date: 2013-11-11 16:36:29 +0000 (Mon, 11 Nov 2013) Log Message: ----------- fixes Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-11 14:30:14 UTC (rev 5212) +++ trunk/src/mmcheckingpanel.cpp 2013-11-11 16:36:29 UTC (rev 5213) @@ -246,6 +246,8 @@ if (transFilterDlg_->getNotesCheckBox() && !tran.NOTES.Matches(transFilterDlg_->getNotes())) continue; } + if (!m_listCtrlAccount->showDeletedTransactions_ && Model_Checking::status(tran) == Model_Checking::VOID_) continue; + Model_Checking::Full_Data full_tran(tran); full_tran.BALANCE = account_balance_; if (Model_Checking::TRANSFER == Model_Checking::type(tran)) @@ -1161,9 +1163,6 @@ menu.AppendSeparator(); - menu.Append(MENU_TREEPOPUP_MARKDELETE, _("Move to Trash")); - if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_MARKDELETE, false); - wxString menu_item_label = showDeletedTransactions_ ? _("Hide Deleted") : _("Show Deleted"); menu.AppendCheckItem(MENU_TREEPOPUP_SHOWTRASH, menu_item_label); @@ -1231,15 +1230,18 @@ else if (evt == MENU_TREEPOPUP_MARKVOID) status = "V"; else if (evt == MENU_TREEPOPUP_MARK_ADD_FLAG_FOLLOWUP) status = "F"; else if (evt == MENU_TREEPOPUP_MARKDUPLICATE) status = "D"; - else if (evt == MENU_TREEPOPUP_MARKDELETE) status = "X"; else wxASSERT(false); - m_cp->m_trans[m_selectedIndex].STATUS = status; Model_Checking::Data *trx = Model_Checking::instance().get(m_cp->m_trans[m_selectedIndex].TRANSID); - if (trx) Model_Checking::instance().save(trx); + if (trx) + { + m_cp->m_trans[m_selectedIndex].STATUS = status; + trx->STATUS = status; + Model_Checking::instance().save(trx); + } if ((m_cp->transFilterActive_ && m_cp->transFilterDlg_->getStatusCheckBox()) - || (status == "X" && !showDeletedTransactions_)) + || (status == "V" && !showDeletedTransactions_)) refreshVisualList(m_cp->m_trans[m_selectedIndex].TRANSID); else RefreshItems(m_selectedIndex, m_selectedIndex); @@ -1348,8 +1350,6 @@ res = ICON_RECONCILED; else if (status == "V") res = ICON_VOID; - else if (status == "X") - res = ICON_TRASH; else if (status == "D") res = ICON_DUPLICATE; } @@ -1488,7 +1488,7 @@ wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TREEPOPUP_MARKVOID); OnMarkTransaction(evt); } - else if ((wxGetKeyState(WXK_DELETE)|| wxGetKeyState(WXK_NUMPAD_DELETE)) && status != "X") + else if ((wxGetKeyState(WXK_DELETE)|| wxGetKeyState(WXK_NUMPAD_DELETE)) && status != "V") { wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TREEPOPUP_MARKDELETE); OnMarkTransaction(evt); @@ -1678,7 +1678,6 @@ m_cp->initVirtualListControl(); m_cp->markSelectedTransaction(trans_id); - if (topItemIndex_ >= (long)m_cp->m_trans.size()) topItemIndex_ = g_asc ? (long)m_cp->m_trans.size() - 1 : 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-11-12 12:18:14
|
Revision: 5220 http://sourceforge.net/p/moneymanagerex/code/5220 Author: vomikan Date: 2013-11-12 12:18:11 +0000 (Tue, 12 Nov 2013) Log Message: ----------- fixes Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-12 11:19:04 UTC (rev 5219) +++ trunk/src/mmcheckingpanel.cpp 2013-11-12 12:18:11 UTC (rev 5220) @@ -1490,7 +1490,7 @@ } else if ((wxGetKeyState(WXK_DELETE)|| wxGetKeyState(WXK_NUMPAD_DELETE)) && status != "V") { - wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TREEPOPUP_MARKDELETE); + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TREEPOPUP_MARKVOID); OnMarkTransaction(evt); } else if (wxGetKeyState(WXK_DELETE)|| wxGetKeyState(WXK_NUMPAD_DELETE)) @@ -1529,7 +1529,7 @@ // remove also removes any split transactions Model_Checking::instance().remove(transID); if (x <= topItemIndex_) topItemIndex_--; - m_selectedIndex--; + if (!m_cp->m_trans.empty() && m_selectedIndex > 0) m_selectedIndex--; if (m_selectedForCopy == transID) m_selectedForCopy = -1; } x++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-11-12 12:43:11
|
Revision: 5221 http://sourceforge.net/p/moneymanagerex/code/5221 Author: vomikan Date: 2013-11-12 12:43:06 +0000 (Tue, 12 Nov 2013) Log Message: ----------- copy split transactions Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-12 12:18:11 UTC (rev 5220) +++ trunk/src/mmcheckingpanel.cpp 2013-11-12 12:43:06 UTC (rev 5221) @@ -1443,13 +1443,20 @@ bool useOriginalDate = Model_Setting::instance().GetBoolSetting(INIDB_USE_ORG_DATE_COPYPASTE, false); Model_Checking::Data* tran = Model_Checking::instance().get(m_selectedForCopy); - Model_Checking::Data* copy = Model_Checking::instance().clone(tran); + Model_Checking::Data* copy = Model_Checking::instance().clone(tran); //TODO: this function can't clone split transactions if (!useOriginalDate) copy->TRANSDATE = wxDateTime::Now().FormatISODate(); if (Model_Checking::type(copy) != Model_Checking::TRANSFER) copy->ACCOUNTID = m_cp->m_AccountID; - Model_Checking::instance().save(copy); + int transactionID = Model_Checking::instance().save(copy); - topItemIndex_ = m_selectedIndex; - refreshVisualList(); + Model_Splittransaction::Data_Set copy_split = Model_Checking::splittransaction(tran); + for (auto& splt : Model_Checking::splittransaction(tran)) + { + splt.TRANSID = transactionID; + copy_split.push_back(splt); + } + Model_Splittransaction::instance().save(copy_split); + + refreshVisualList(transactionID); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-11-13 08:26:29
|
Revision: 5225 http://sourceforge.net/p/moneymanagerex/code/5225 Author: vomikan Date: 2013-11-13 08:26:27 +0000 (Wed, 13 Nov 2013) Log Message: ----------- format Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-11-13 03:20:25 UTC (rev 5224) +++ trunk/src/mmcheckingpanel.cpp 2013-11-13 08:26:27 UTC (rev 5225) @@ -332,14 +332,14 @@ this->SetSizer(itemBoxSizer9); /* ---------------------- */ - wxPanel* headerPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, - wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL ); + wxPanel* headerPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, + wxDefaultSize, wxNO_BORDER | wxTAB_TRAVERSAL); itemBoxSizer9->Add(headerPanel, flags); wxBoxSizer* itemBoxSizerVHeader = new wxBoxSizer(wxVERTICAL); headerPanel->SetSizer(itemBoxSizerVHeader); - wxGridSizer* itemBoxSizerVHeader2 = new wxGridSizer(0,1,5,20); + wxGridSizer* itemBoxSizerVHeader2 = new wxGridSizer(0, 1, 5, 20); itemBoxSizerVHeader->Add(itemBoxSizerVHeader2); header_text_ = new wxStaticText( headerPanel, wxID_STATIC, ""); @@ -348,13 +348,13 @@ itemBoxSizerVHeader2->Add(header_text_, flags); wxBoxSizer* itemBoxSizerHHeader2 = new wxBoxSizer(wxHORIZONTAL); - wxFlexGridSizer* itemFlexGridSizerHHeader2 = new wxFlexGridSizer(5,1,1); + wxFlexGridSizer* itemFlexGridSizerHHeader2 = new wxFlexGridSizer(5, 1, 1); itemBoxSizerVHeader2->Add(itemBoxSizerHHeader2); itemBoxSizerHHeader2->Add(itemFlexGridSizerHHeader2); wxBitmap itemStaticBitmap(rightarrow_xpm); - bitmapMainFilter_ = new wxStaticBitmap( headerPanel, wxID_ANY, - itemStaticBitmap); + bitmapMainFilter_ = new wxStaticBitmap(headerPanel, wxID_ANY + , itemStaticBitmap); itemFlexGridSizerHHeader2->Add(bitmapMainFilter_, flags); bitmapMainFilter_->Connect(wxID_ANY, wxEVT_RIGHT_DOWN , wxMouseEventHandler(mmCheckingPanel::OnFilterResetToViewAll), NULL, this); @@ -366,8 +366,8 @@ itemFlexGridSizerHHeader2->AddSpacer(20); - bitmapTransFilter_ = new wxStaticBitmap( headerPanel, ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, - itemStaticBitmap); + bitmapTransFilter_ = new wxStaticBitmap( headerPanel, ID_PANEL_CHECKING_STATIC_BITMAP_FILTER + , itemStaticBitmap); itemFlexGridSizerHHeader2->Add(bitmapTransFilter_, flags); bitmapTransFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN , wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); @@ -378,16 +378,16 @@ _("Transaction Filter")); itemFlexGridSizerHHeader2->Add(statTextTransFilter_, flags); - wxStaticText* itemStaticText12 = new wxStaticText( headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER1, "$", wxDefaultPosition, wxSize(120,-1)); - wxStaticText* itemStaticText14 = new wxStaticText( headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER2, "$", wxDefaultPosition, wxSize(120,-1)); - wxStaticText* itemStaticText16 = new wxStaticText( headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER3, "$", wxDefaultPosition, wxSize(120,-1)); - wxStaticText* itemStaticText17 = new wxStaticText( headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER4, _("Displayed Bal: ")); - wxStaticText* itemStaticText18 = new wxStaticText( headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER5, "$", wxDefaultPosition, wxSize(120,-1)); + wxStaticText* itemStaticText12 = new wxStaticText(headerPanel + , ID_PANEL_CHECKING_STATIC_BALHEADER1, "$", wxDefaultPosition, wxSize(120, -1)); + wxStaticText* itemStaticText14 = new wxStaticText(headerPanel + , ID_PANEL_CHECKING_STATIC_BALHEADER2, "$", wxDefaultPosition, wxSize(120, -1)); + wxStaticText* itemStaticText16 = new wxStaticText(headerPanel + , ID_PANEL_CHECKING_STATIC_BALHEADER3, "$", wxDefaultPosition, wxSize(120, -1)); + wxStaticText* itemStaticText17 = new wxStaticText(headerPanel + , ID_PANEL_CHECKING_STATIC_BALHEADER4, _("Displayed Bal: ")); + wxStaticText* itemStaticText18 = new wxStaticText(headerPanel + , ID_PANEL_CHECKING_STATIC_BALHEADER5, "$", wxDefaultPosition, wxSize(120, -1)); wxFlexGridSizer* balances_header = new wxFlexGridSizer(0,8,5,10); itemBoxSizerVHeader->Add(balances_header); @@ -402,9 +402,9 @@ /* ---------------------- */ - wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow( this + wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow(this , ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(200, 200) - , wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER ); + , wxSP_3DBORDER | wxSP_3DSASH | wxNO_BORDER); wxSize imageSize(16, 16); m_imageList.reset(new wxImageList(imageSize.GetWidth(), imageSize.GetHeight())); @@ -417,9 +417,9 @@ m_imageList->Add(wxImage(duplicate_xpm).Scale(16, 16)); m_imageList->Add(wxImage(trash_xpm).Scale(16, 16)); - m_listCtrlAccount = new TransactionListCtrl( this, itemSplitterWindow10, - ID_PANEL_CHECKING_LISTCTRL_ACCT, wxDefaultPosition, wxDefaultSize, - wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxLC_VIRTUAL | wxLC_SINGLE_SEL); + m_listCtrlAccount = new TransactionListCtrl( this, itemSplitterWindow10 + , ID_PANEL_CHECKING_LISTCTRL_ACCT, wxDefaultPosition, wxDefaultSize + , wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxLC_VIRTUAL | wxLC_SINGLE_SEL); m_listCtrlAccount->SetImageList(m_imageList.get(), wxIMAGE_LIST_SMALL); m_listCtrlAccount->setSortOrder(m_listCtrlAccount->g_asc); @@ -486,11 +486,11 @@ //Infobar-mini info_panel_mini_ = new wxStaticText( itemPanel12, wxID_STATIC, ""); - itemButtonsSizer->Add(info_panel_mini_, 1, wxGROW|wxTOP|wxLEFT, 5); + itemButtonsSizer->Add(info_panel_mini_, 1, wxGROW | wxTOP | wxLEFT, 5); //Infobar - info_panel_ = new wxStaticText( itemPanel12, - wxID_STATIC, "", wxDefaultPosition, wxSize(200,-1), wxTE_MULTILINE|wxTE_WORDWRAP); + info_panel_ = new wxStaticText(itemPanel12 + , wxID_STATIC, "", wxDefaultPosition, wxSize(200, -1), wxTE_MULTILINE | wxTE_WORDWRAP); itemBoxSizer4->Add(info_panel_, flagsExpand); //Show tips when no any transaction selected showTips(); @@ -570,87 +570,6 @@ } } //---------------------------------------------------------------------------- -wxString mmCheckingPanel::getMiniInfoStr(int selIndex) const -{ - const Model_Checking::Full_Data& tran = this->m_trans.at(selIndex); - int accountId = tran.ACCOUNTID; - int toaccountId = tran.TOACCOUNTID; - Model_Account::Data* account = Model_Account::instance().get(accountId); - Model_Currency::Data* currency = Model_Account::currency(account); - - int currencyid = m_basecurrecyID; - int tocurrencyid = m_basecurrecyID; - - double amount = tran.TRANSAMOUNT; - double convrate = 1.0, toconvrate = 1.0; - wxString amountStr, infoStr = "", intoaccStr = ""; - wxString fromaccStr = "", one = "1.0"; - if (account) fromaccStr = account->ACCOUNTNAME; - - if (currency) - { - currencyid = currency->CURRENCYID; - convrate = currency->BASECONVRATE; - one = Model_Currency::toString(1, currency); - } - - if (Model_Checking::type(&tran) == Model_Checking::TRANSFER) - { - Model_Account::Data* to_account = Model_Account::instance().get(toaccountId); - if (to_account) intoaccStr = to_account->ACCOUNTNAME; - Model_Currency::Data* to_currency = Model_Account::currency(to_account); - if (!to_currency) - { - wxASSERT(false); - to_currency = Model_Currency::GetBaseCurrency(); - } - - toconvrate = to_currency->BASECONVRATE; - tocurrencyid = to_currency->CURRENCYID; - - double toamount = tran.TOTRANSAMOUNT; - double convertion = 0.0; - if (toamount != 0.0 && amount != 0.0) - convertion = ( convrate < toconvrate ? amount/toamount : toamount/amount); - wxString toamountStr, convertionStr; - - amountStr = Model_Currency::toString(amount, currency); - toamountStr = Model_Currency::toString(toamount, to_currency); - convertionStr = Model_Currency::toString(convertion, to_currency); - - infoStr << amountStr << " "; - if (amount != toamount || tocurrencyid != currencyid) - infoStr << "-> " << toamountStr << " "; - infoStr << wxString::Format(_("From %s to %s"), fromaccStr, intoaccStr); - - if (tocurrencyid != currencyid) - { - one = Model_Currency::toString(1, currency); - infoStr << " ( "; - if (accountId == m_AccountID && convrate < toconvrate) - infoStr << one << " = " << convertionStr << " "; - else if (accountId == m_AccountID && convrate > toconvrate) - infoStr << one << " = " << convertionStr << " "; - else if (accountId != m_AccountID && convrate < toconvrate) - infoStr << one << " = " << convertionStr << " "; - else - infoStr << one << " = " << convertionStr << " "; - infoStr << " )"; - } - } - else //For deposits and withdrawals calculates amount in base currency - { - if (currencyid != m_basecurrecyID) //Show nothing if account currency is base - { - amountStr = wxString::Format( "%f4", amount); - if (currency) amountStr = Model_Currency::toString(amount, currency); - infoStr << amountStr - << " = " << Model_Currency::toString(amount*convrate); - } - } - return infoStr; -} -//--------------------------- void mmCheckingPanel::showTips() { info_panel_->SetLabel(Tips(TIPS_BANKS)); @@ -1749,3 +1668,83 @@ } //---------------------------------------------------------------------------- +wxString mmCheckingPanel::getMiniInfoStr(int selIndex) const +{ + const Model_Checking::Full_Data& tran = this->m_trans.at(selIndex); + int accountId = tran.ACCOUNTID; + int toaccountId = tran.TOACCOUNTID; + Model_Account::Data* account = Model_Account::instance().get(accountId); + Model_Currency::Data* currency = Model_Account::currency(account); + + int currencyid = m_basecurrecyID; + int tocurrencyid = m_basecurrecyID; + + double amount = tran.TRANSAMOUNT; + double convrate = 1.0, toconvrate = 1.0; + wxString amountStr, infoStr = "", intoaccStr = ""; + wxString fromaccStr = "", one = "1.0"; + if (account) fromaccStr = account->ACCOUNTNAME; + + if (currency) + { + currencyid = currency->CURRENCYID; + convrate = currency->BASECONVRATE; + one = Model_Currency::toString(1, currency); + } + + if (Model_Checking::type(&tran) == Model_Checking::TRANSFER) + { + Model_Account::Data* to_account = Model_Account::instance().get(toaccountId); + if (to_account) intoaccStr = to_account->ACCOUNTNAME; + Model_Currency::Data* to_currency = Model_Account::currency(to_account); + if (!to_currency) + { + wxASSERT(false); + to_currency = Model_Currency::GetBaseCurrency(); + } + + toconvrate = to_currency->BASECONVRATE; + tocurrencyid = to_currency->CURRENCYID; + + double toamount = tran.TOTRANSAMOUNT; + double convertion = 0.0; + if (toamount != 0.0 && amount != 0.0) + convertion = (convrate < toconvrate ? amount / toamount : toamount / amount); + wxString toamountStr, convertionStr; + + amountStr = Model_Currency::toString(amount, currency); + toamountStr = Model_Currency::toString(toamount, to_currency); + convertionStr = Model_Currency::toString(convertion, to_currency); + + infoStr << amountStr << " "; + if (amount != toamount || tocurrencyid != currencyid) + infoStr << "-> " << toamountStr << " "; + infoStr << wxString::Format(_("From %s to %s"), fromaccStr, intoaccStr); + + if (tocurrencyid != currencyid) + { + one = Model_Currency::toString(1, currency); + infoStr << " ( "; + if (accountId == m_AccountID && convrate < toconvrate) + infoStr << one << " = " << convertionStr << " "; + else if (accountId == m_AccountID && convrate > toconvrate) + infoStr << one << " = " << convertionStr << " "; + else if (accountId != m_AccountID && convrate < toconvrate) + infoStr << one << " = " << convertionStr << " "; + else + infoStr << one << " = " << convertionStr << " "; + infoStr << " )"; + } + } + else //For deposits and withdrawals calculates amount in base currency + { + if (currencyid != m_basecurrecyID) //Show nothing if account currency is base + { + amountStr = wxString::Format("%f4", amount); + if (currency) amountStr = Model_Currency::toString(amount, currency); + infoStr << amountStr + << " = " << Model_Currency::toString(amount*convrate); + } + } + return infoStr; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |