text:
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1874]
From: <vomikan@us...> - 2012-02-25 07:55:03
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1874&view=rev
Date:     2012-02-25 07:54:57 +0000 (Sat, 25 Feb 2012)
comma removed in filter field if  not needed
--- trunk/mmex/src/filtertransdialog.cpp	2012-02-25 07:53:33 UTC (rev 1873)
+++ trunk/mmex/src/filtertransdialog.cpp	2012-02-25 07:54:57 UTC (rev 1874)
@@ -642,15 +642,15 @@
wxString mmFilterTransactionsDialog::userTypeStr()
-    wxString transCode;
+    wxString transCode = wxEmptyString;
if (typeCheckBox->IsChecked())
if (cbTypeWithdrawal_->GetValue())
transCode = TRANS_TYPE_WITHDRAWAL_STR;
if (cbTypeDeposit_->GetValue())
-            transCode << wxT(", ") << TRANS_TYPE_DEPOSIT_STR;
+            transCode << (transCode.IsEmpty() ? wxT("") : wxT(", ")) << TRANS_TYPE_DEPOSIT_STR;
if (cbTypeTransfer_->GetValue())
-            transCode << wxT(", ") << TRANS_TYPE_TRANSFER_STR;
+            transCode << (transCode.IsEmpty() ? wxT("") : wxT(", ")) << TRANS_TYPE_TRANSFER_STR;
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1873]
From: <vomikan@us...> - 2012-02-25 07:53:39
Revision: 1873
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1873&view=rev
Date:     2012-02-25 07:53:33 +0000 (Sat, 25 Feb 2012)
--- trunk/mmex/src/mmcheckingpanel.cpp	2012-02-25 07:52:03 UTC (rev 1872)
+++ trunk/mmex/src/mmcheckingpanel.cpp	2012-02-25 07:53:33 UTC (rev 1873)
void mmCheckingPanel::showTips()
wxStaticText* st = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_DETAILS);
-    st->SetLabel(Tips(wxT("checkingpanel")));
+    st->SetLabel(Tips(TIPS_BANKS));
void mmCheckingPanel::setAccountSummary()
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1872]
From: <vomikan@us...> - 2012-02-25 07:52:09
Revision: 1872
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1872&view=rev
Date:     2012-02-25 07:52:03 +0000 (Sat, 25 Feb 2012)
--- trunk/mmex/src/assetspanel.cpp	2012-02-25 07:05:31 UTC (rev 1871)
+++ trunk/mmex/src/assetspanel.cpp	2012-02-25 07:52:03 UTC (rev 1872)
stm -> SetLabel(wxT(""));
-        st->SetLabel(Tips(wxT("assets")));
+        st->SetLabel(Tips(TIPS_ASSETS));
--- trunk/mmex/src/billsdepositspanel.cpp	2012-02-25 07:05:31 UTC (rev 1871)
+++ trunk/mmex/src/billsdepositspanel.cpp	2012-02-25 07:52:03 UTC (rev 1872)
-        st-> SetLabel(Tips(wxT("billsdeposits")));
+        st-> SetLabel(Tips(TIPS_BILLS));
stm-> SetLabel(wxT(""));
--- trunk/mmex/src/stockspanel.cpp	2012-02-25 07:05:31 UTC (rev 1871)
+++ trunk/mmex/src/stockspanel.cpp	2012-02-25 07:52:03 UTC (rev 1872)
wxStaticText* stm = (wxStaticText*)FindWindow(ID_PANEL_STOCKS_STATIC_DETAILS_MINI);
if (selectedIndex_ == -1)
-        st->SetLabel(_("Using MMEX it is possible to track stocks/mutual funds investments."));
+        st->SetLabel(Tips(TIPS_STOCK));
stm->SetLabel(wxT(""));
--- trunk/mmex/src/util.cpp	2012-02-25 07:05:31 UTC (rev 1871)
+++ trunk/mmex/src/util.cpp	2012-02-25 07:52:03 UTC (rev 1872)
@@ -945,8 +945,24 @@
wxString Tips(wxString type)
wxString tipsStr = wxEmptyString;
-    if (type == wxT("checkingpanel"))
+    if (type == TIPS_ASSETS)
+        tipsStr = _("MMEX allows you to track fixed assets like cars, houses, land and others. Each asset can have its value appreciate by a certain rate per year, depreciate by a certain rate per year, or not change in value. The total assets are added to your total financial worth.");
+    else if (type == TIPS_STOCK)
+        tipsStr = _("Using MMEX it is possible to track stocks/mutual funds investments.");
+    else if (type == TIPS_BILLS)
+        wxArrayString tips;
+        tips.Add(_("MMEX allows regular payments to be set up as transactions. These transactions can also be regular deposits, or transfers that will occur at some future time. These transactions act a reminder that an event is about to occur, and appears on the Home Page 14 days before the transaction is due. "));
+        tips.Add(_("Tip: These transactions can be set up to activate – allowing the user to adjust any values on the due date."));
+        tipsStr = tips[rand() % tips.GetCount()];
wxArrayString tips;
tips.Add(_("Recommendation: Always backup your .mmb database file regularly."));
tips.Add(_("Recommendation: If upgrading to a new version of MMEX, make sure you backup your .mmb database file before doing so."));
@@ -973,22 +989,6 @@
tips.Add(_("Before going to a shop and buy something: take the time making a list of what you really need. In the shop buy what is in your list."));
tipsStr = tips[rand() % tips.GetCount()];
-    else if (type == wxT("assets"))
-        tipsStr = _("MMEX allows you to track fixed assets like cars, houses, land and others. Each asset can have its value appreciate by a certain rate per year, depreciate by a certain rate per year, or not change in value. The total assets are added to your total financial worth.");
-    else if (type == wxT("stocks"))
-        tipsStr = _("Using MMEX it is possible to track stocks/mutual funds investments.");
-    else if (type == wxT("billsdeposits"))
-        wxArrayString tips;
-        tips.Add(_("MMEX allows regular payments to be set up as transactions. These transactions can also be regular deposits, or transfers that will occur at some future time. These transactions act a reminder that an event is about to occur, and appears on the Home Page 14 days before the transaction is due. "));
-        tips.Add(_("Tip: These transactions can be set up to activate – allowing the user to adjust any values on the due date."));
-        tipsStr = tips[rand() % tips.GetCount()];
return tipsStr;
--- trunk/mmex/src/util.h	2012-02-25 07:05:31 UTC (rev 1871)
+++ trunk/mmex/src/util.h	2012-02-25 07:52:03 UTC (rev 1872)
@@ -75,6 +75,11 @@
const wxString INIDB_BUDGET_SUMMARY_WITHOUT_CATEG = wxT("BUDGET_SUMMARY_WITHOUT_CATEGORIES");
const wxString INIDB_IGNORE_FUTURE_TRANSACTIONS   = wxT("IGNORE_FUTURE_TRANSACTIONS");
+const wxString TIPS_BANKS  = wxT("checkingpanel");
+const wxString TIPS_BILLS  = wxT("billsdeposits");
+const wxString TIPS_STOCK = wxT("investment");
+const wxString TIPS_ASSETS = wxT("assets");
void mmShowErrorMessageInvalid( wxWindow *parent, const wxString &message );
void mmShowErrorMessage( wxWindow *parent, const wxString &message, const wxString &messageheader );
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1871]
trunk/mmex/src/reportsummarystocks.cpp
From: <vomikan@us...> - 2012-02-25 07:05:38
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1871&view=rev
Date:     2012-02-25 07:05:31 +0000 (Sat, 25 Feb 2012)
Modified: trunk/mmex/src/reportsummarystocks.cpp
--- trunk/mmex/src/reportsummarystocks.cpp	2012-02-25 01:12:19 UTC (rev 1870)
+++ trunk/mmex/src/reportsummarystocks.cpp	2012-02-25 07:05:31 UTC (rev 1871)
"STOCKNAME, "
"total(NUMSHARES) as NUMSHARES, "
"SYMBOL, "
-           "avg(CURRENTPRICE) as CURRENTPRICE, "
+           "total(CURRENTPRICE*NUMSHARES)/total(NUMSHARES) as CURRENTPRICE, "
"total(PURCHASEPRICE*NUMSHARES)/total(NUMSHARES) as PURCHASEPRICE, "
"total(VALUE) as VALUE, "
"total(COMMISSION) as COMMISSION, "
hb.addTableHeaderCell(_("Name"));
hb.addTableHeaderCell(_("Symbol"));
hb.addTableHeaderCell(_("Purchase Date"));
-        hb.addTableHeaderCell(_("Quntity"));
-        hb.addTableHeaderCell(_("Purchase Price"));
-        hb.addTableHeaderCell(_("Current Price"));
-        hb.addTableHeaderCell(_("Commission"));
-        hb.addTableHeaderCell(_("Gain/Loss"));
+        hb.addTableHeaderCell(_("Quantity"), true);
+        hb.addTableHeaderCell(_("Purchase Price"), true);
+        hb.addTableHeaderCell(_("Current Price"), true);
+        hb.addTableHeaderCell(_("Commission"), true);
+        hb.addTableHeaderCell(_("Gain/Loss"), true);
hb.addTableHeaderCell(_("Value"), true);
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1870]
From: <stef145g@us...> - 2012-02-25 01:12:26
Revision: 1870
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1870&view=rev
Date:     2012-02-25 01:12:19 +0000 (Sat, 25 Feb 2012)
Deactivate web site menu item if not available in account.
--- trunk/mmex/src/mmex.cpp	2012-02-24 21:39:46 UTC (rev 1869)
+++ trunk/mmex/src/mmex.cpp	2012-02-25 01:12:19 UTC (rev 1870)
@@ -2489,6 +2489,10 @@
menu.Append(MENU_TREEPOPUP_LAUNCHWEBSITE, _("&Launch Account Website"));
+                    // Enable menu item only if a website exists for the account.
+                    bool webStatus = !pAccount->website_.IsEmpty();
+                    menu.Enable(MENU_TREEPOPUP_LAUNCHWEBSITE, webStatus);
PopupMenu(&menu, pt);
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1869]
From: <vomikan@us...> - 2012-02-24 21:39:52
Revision: 1869
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1869&view=rev
Date:     2012-02-24 21:39:46 +0000 (Fri, 24 Feb 2012)
report groupped by account and provide average totals
--- trunk/mmex/src/reportsummarystocks.cpp	2012-02-24 06:30:09 UTC (rev 1868)
+++ trunk/mmex/src/reportsummarystocks.cpp	2012-02-24 21:39:46 UTC (rev 1869)
@@ -27,60 +27,86 @@
wxString mmReportSummaryStocks::getHTMLText()
-        mmHTMLBuilder hb;
-        hb.init();
-        hb.addHeader(3, _("Summary of Stocks"));
-        wxDateTime now = wxDateTime::Now();
-        wxString dt = _("Today's Date: ") + mmGetNiceDateString(now);
-        hb.addHeader(7, dt);
-        hb.addLineBreak();
+    mmHTMLBuilder hb;
+    hb.init();
+    hb.addHeader(3, _("Summary of Stocks"));
+    wxDateTime now = wxDateTime::Now();
+    wxString dt = _("Today's Date: ") + mmGetNiceDateString(now);
+    hb.addHeader(6, dt);
+    hb.startCenter();
-        hb.startCenter();
+    double gain_loss_sum_total = 0.0;
-        hb.startTable();
-		hb.startTableRow();
-		hb.addTableHeaderCell(_("Company"));
-		hb.addTableHeaderCell(_("Name"));
-		hb.addTableHeaderCell(_("Symbol"));
-		hb.addTableHeaderCell(_("Purchase Date"));
-		hb.addTableHeaderCell(_("Quntity"));
-		hb.addTableHeaderCell(_("Purchase Price"));
-		hb.addTableHeaderCell(_("Current Price"));
-		hb.addTableHeaderCell(_("Commission"));
-		hb.addTableHeaderCell(_("Gain/Loss"));
-		hb.addTableHeaderCell(_("Value"), true);
-		hb.endTableRow();
+    static const char sql[] =
+    "select ACCOUNTID "
+    "from ACCOUNTLIST_V1 "
+    "where ACCOUNTTYPE = 'Investment' "
+    "and STATUS <> 'Closed' ";
-        double gain_loss_sum = 0;
-        mmDBWrapper::loadBaseCurrencySettings(db_);
-        wxSQLite3ResultSet q1 = db_->ExecuteQuery("select * from STOCK_V1");
+    static const char sql2[] =
+    "select "
+           "STOCKNAME, "
+           "total(NUMSHARES) as NUMSHARES, "
+           "SYMBOL, "
+           "avg(CURRENTPRICE) as CURRENTPRICE, "
+           "total(PURCHASEPRICE*NUMSHARES)/total(NUMSHARES) as PURCHASEPRICE, "
+           "total(VALUE) as VALUE, "
+           "total(COMMISSION) as COMMISSION, "
+           "min(PURCHASEDATE) as PURCHASEDATE "
+    "from STOCK_V1 "
+    "where HELDAT = ? "
+    "group by UPPER(SYMBOL) ";
-        while (q1.NextRow())
+    wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql);
+    hb.startTable(wxT("95%"));
+    while (q1.NextRow())
+        double gain_loss_sum = 0.0;
+        int accountID  = q1.GetInt(wxT("ACCOUNTID"));
+        wxString heldAt_ = core_->getAccountName(accountID);
+        hb.addTotalRow(wxT(""), 9, wxT(""));
+        hb.addTotalRow(heldAt_, 9, wxT(""));
+        hb.startTableRow();
+        hb.addTableHeaderCell(_("Name"));
+        hb.addTableHeaderCell(_("Symbol"));
+        hb.addTableHeaderCell(_("Purchase Date"));
+        hb.addTableHeaderCell(_("Quntity"));
+        hb.addTableHeaderCell(_("Purchase Price"));
+        hb.addTableHeaderCell(_("Current Price"));
+        hb.addTableHeaderCell(_("Commission"));
+        hb.addTableHeaderCell(_("Gain/Loss"));
+        hb.addTableHeaderCell(_("Value"), true);
+        hb.endTableRow();
+        wxSQLite3Statement st = db_->PrepareStatement(sql2);
+        st.Bind(1, accountID);
+        wxSQLite3ResultSet q2 = st.ExecuteQuery();
+        while (q2.NextRow())
mmStockTransactionHolder th;
-            th.id_              = q1.GetInt(wxT("STOCKID"));
-            int accountID       = q1.GetInt(wxT("HELDAT"));
-            th.heldAt_          = core_->getAccountName(accountID);
-            th.shareName_       = q1.GetString(wxT("STOCKNAME"));
-            th.numSharesStr_    = q1.GetString(wxT("NUMSHARES"));
-            th.numShares_       = q1.GetDouble(wxT("NUMSHARES"));
-            th.symbol_          = q1.GetString(wxT("SYMBOL"));
+            //th.id_              = q2.GetInt(wxT("STOCKID"));
+            th.shareName_       = q2.GetString(wxT("STOCKNAME"));
+            th.numShares_       = q2.GetDouble(wxT("NUMSHARES"));
+            th.numSharesStr_    = q2.GetString(wxT("NUMSHARES"));
+            th.symbol_          = q2.GetString(wxT("SYMBOL"));
-            th.currentPrice_    = q1.GetDouble(wxT("CURRENTPRICE"));
-            th.purchasePrice_   = q1.GetDouble(wxT("PURCHASEPRICE"));
-            th.value_           = q1.GetDouble(wxT("VALUE"));
-            double commission   = q1.GetDouble(wxT("COMMISSION"));
-            wxString dateString = q1.GetString(wxT("PURCHASEDATE"));
+            th.currentPrice_    = q2.GetDouble(wxT("CURRENTPRICE"));
+            th.purchasePrice_   = q2.GetDouble(wxT("PURCHASEPRICE"));
+            th.value_           = q2.GetDouble(wxT("VALUE"));
+            double commission   = q2.GetDouble(wxT("COMMISSION"));
+            wxString dateString = q2.GetString(wxT("PURCHASEDATE"));
wxDateTime dtdt     = mmGetStorageStringAsDate(dateString);
wxString dt         = mmGetDateForDisplay(db_, dtdt);
th.gainLoss_        = th.value_ - ((th.numShares_ * th.purchasePrice_) + commission);
double base_conv_rate = mmDBWrapper::getCurrencyBaseConvRate(db_, accountID);
-            gain_loss_sum += th.gainLoss_ * base_conv_rate;
+            gain_loss_sum += th.gainLoss_;
+            gain_loss_sum_total += th.gainLoss_ * base_conv_rate;
wxString commString;
mmex::formatDoubleToCurrencyEdit(commission, commString);
@@ -89,50 +115,61 @@
mmex::formatDoubleToCurrencyEdit(th.purchasePrice_, th.pPriceStr_);
-			hb.startTableRow();
-			hb.addTableCell(th.heldAt_, false, true);
-			hb.addTableCell(th.shareName_, false, true);
-			hb.addTableCell(th.symbol_);
+            hb.startTableRow();
+            hb.addTableCell(th.shareName_, false, true);
+            hb.addTableCell(th.symbol_);
hb.addTableCell(dt);
hb.addTableCell(th.numSharesStr_, true);
hb.addTableCell(th.pPriceStr_, true);
hb.addTableCell(th.cPriceStr_, true);
hb.addTableCell(commString, true);
-			if(th.gainLoss_ < 0)
-				hb.addTableCell(th.gainLossStr_, true, true, true, wxT("#ff0000"));
-			else if(th.gainLoss_ > 0)
-				hb.addTableCell(th.gainLossStr_, true, false, true);
-				hb.addTableCell(th.gainLossStr_, true, true);
+            if(th.gainLoss_ < 0.0)
+                hb.addTableCell(th.gainLossStr_, true, true, true, wxT("RED"));
+                hb.addTableCell(th.gainLossStr_, true, false, true);
hb.addTableCell(th.valueStr_, true);
-        q1.Finalize();
-        /* Stocks */
+        q2.Finalize();
double invested = 0;
-        double stockBalance = mmDBWrapper::getStockInvestmentBalance(db_, invested);
+        double stockBalance = mmDBWrapper::getStockInvestmentBalance(db_, accountID, false, invested);
wxString stockBalanceStr;
wxString gain_loss_sum_str;
+        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(accountID).lock();
+        wxASSERT(pCurrencyPtr);
+        mmex::CurrencyFormatter::instance().loadSettings(*pCurrencyPtr);
mmex::formatDoubleToCurrency(stockBalance, stockBalanceStr);
mmex::formatDoubleToCurrency(gain_loss_sum, gain_loss_sum_str);
+        hb.addRowSeparator(9);
+        hb.addTotalRow(_("Total Stock Investments: "), 8, gain_loss_sum_str);
+        hb.addTableCell(stockBalanceStr, true, true, true); //numeric, italic, bold
-	hb.addRowSeparator(10);
-	hb.addTotalRow(_("Total Stock Investments: "), 9, gain_loss_sum_str);
-	hb.addTableCell(stockBalanceStr, true, true, true); //numeric, italic, bold
+    q1.Finalize();
+    mmDBWrapper::loadBaseCurrencySettings(db_);
+    double invested = 0;
+    double stockBalance = mmDBWrapper::getStockInvestmentBalance(db_, invested);
+    wxString stockBalanceStr;
+    wxString gain_loss_sum_total_str;
+    mmex::formatDoubleToCurrency(gain_loss_sum_total, gain_loss_sum_total_str);
+    mmex::formatDoubleToCurrency(stockBalance, stockBalanceStr);
+    hb.addRowSeparator(9);
+    hb.addTotalRow(_("Total Stock Investments: "), 8, gain_loss_sum_total_str);
+    hb.addTableCell(stockBalanceStr, true, true, true); //numeric, italic, bold
+    hb.endTableRow();
-	hb.endCenter();
-        hb.end();
-        return hb.getHTMLText();
+    hb.endCenter();
+    hb.end();
+    return hb.getHTMLText();
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1868]
From: <guanlisheng@us...> - 2012-02-24 06:30:20
Revision: 1868
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1868&view=rev
Date:     2012-02-24 06:30:09 +0000 (Fri, 24 Feb 2012)
trunk/mmex/src/mmcoredb.h
trunk/mmex/src/reportcashflow.cpp
trunk/mmex/src/reportsummary.cpp
--- trunk/mmex/src/billsdepositsdialog.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/billsdepositsdialog.cpp	2012-02-24 06:30:09 UTC (rev 1868)
boost::shared_ptr<mmBankTransaction> pTemp(new mmBankTransaction(core_->db_));
pTransaction = pTemp;
-            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(fromAccountID).lock();
+            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(fromAccountID).lock();
pTransaction->accountID_ = fromAccountID;
--- trunk/mmex/src/filtertransdialog.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/filtertransdialog.cpp	2012-02-24 06:30:09 UTC (rev 1868)
pBankTransaction->reportCategAmount_ = fabs(pBankTransaction->getAmountForSplit(categID_, subcategID_));
-                    boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(pBankTransaction->accountID_).lock();
+                    boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(pBankTransaction->accountID_).lock();
mmex::formatDoubleToCurrencyEdit(pBankTransaction->reportCategAmount_, pBankTransaction->reportCategAmountStr_);
--- trunk/mmex/src/mmcheckingpanel.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/mmcheckingpanel.cpp	2012-02-24 06:30:09 UTC (rev 1868)
@@ -874,13 +874,13 @@
convertion = ( convrate < toconvrate ? amount/toamount : toamount/amount);
wxString convertionStr;
-        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(toaccountId).lock();
+        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(toaccountId).lock();
mmex::CurrencyFormatter::instance().loadSettings(*pCurrencyPtr);
mmex::formatDoubleToCurrency(toamount, toamountStr);
mmex::formatDoubleToCurrencyEdit(convertion, convertionStr);
-        pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(accountId).lock();
+        pCurrencyPtr = core_->getCurrencyWeakPtr(accountId).lock();
mmex::formatDoubleToCurrency(amount, amountStr);
mmDBWrapper::loadSettings(core_->db_.get(), pCurrency->currencyID_);
mmex::formatDoubleToCurrency(amount*convrate, basecuramountStr);
-            pCurrency = core_->accountList_.getCurrencyWeakPtr(accountId).lock();
+            pCurrency = core_->getCurrencyWeakPtr(accountId).lock();
wxASSERT(pCurrency);
mmex::CurrencyFormatter::instance().loadSettings(*pCurrency);
if (useOriginalDate == wxT("TRUE"))
useOriginal = true;
boost::shared_ptr<mmBankTransaction> pCopiedTrans = m_cp->core_->bTransactionList_.copyTransaction(m_selectedForCopy, useOriginal);
-        boost::shared_ptr<mmCurrency> pCurrencyPtr = m_cp->core_->accountList_.getCurrencyWeakPtr(pCopiedTrans->accountID_).lock();
+        boost::shared_ptr<mmCurrency> pCurrencyPtr = m_cp->core_->getCurrencyWeakPtr(pCopiedTrans->accountID_).lock();
pCopiedTrans->updateAllData(m_cp->core_, pCopiedTrans->accountID_, pCurrencyPtr, true);
m_cp->initVirtualListControl(NULL);
RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1);
Modified: trunk/mmex/src/mmcoredb.h
--- trunk/mmex/src/mmcoredb.h	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/mmcoredb.h	2012-02-24 06:30:09 UTC (rev 1868)
boost::shared_ptr<mmAccount> getAccountSharedPtr(int accountID) const { return accountList_.getAccountSharedPtr(accountID); }
int getNumAccounts() const { return accountList_.getNumAccounts(); }
int getNumBankAccounts() const { return accountList_.getNumBankAccounts(); }
+    boost::weak_ptr<mmCurrency> getCurrencyWeakPtr(int accountID) const { return accountList_.getCurrencyWeakPtr(accountID); }
int addAccount(boost::shared_ptr<mmAccount> pAccount) { return accountList_.add(pAccount); };
void updateAccount(boost::shared_ptr<mmAccount> pAccount) { return accountList_.update(pAccount); };
bool accountExists(const wxString& name) const { return accountList_.exists(name); };
--- trunk/mmex/src/mmex.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/mmex.cpp	2012-02-24 06:30:09 UTC (rev 1868)
boost::shared_ptr<mmBankTransaction> pTemp(new mmBankTransaction(m_core.get()->db_));
-                boost::shared_ptr<mmCurrency> pCurrencyPtr = m_core.get()->accountList_.getCurrencyWeakPtr(th.accountID_).lock();
+                boost::shared_ptr<mmCurrency> pCurrencyPtr = m_core.get()->getCurrencyWeakPtr(th.accountID_).lock();
pTransaction->accountID_ = th.accountID_;
--- trunk/mmex/src/mmhomepagepanel.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/mmhomepagepanel.cpp	2012-02-24 06:30:09 UTC (rev 1868)
if (pCA->acctType_ != ACCOUNT_TYPE_BANK || pCA->status_ == mmAccount::MMEX_Closed) continue;
-        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(pCA->id_).lock();
+        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(pCA->id_).lock();
const mmAccount* pTA= it->get();
if (pTA && pTA->status_== mmAccount::MMEX_Open && pTA->acctType_ == ACCOUNT_TYPE_TERM)
-            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(pTA->id_).lock();
+            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(pTA->id_).lock();
double baseconvrate = q1.GetDouble(wxT("BASECONVRATE"));
double stockGain = q1.GetDouble(wxT("GAIN"));
-        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(stockaccountId).lock();
+        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(stockaccountId).lock();
double convRate = q1.GetDouble(wxT("BASECONVRATE"));
wxString convRateStr;
-            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(accountId).lock();
+            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(accountId).lock();
wxString tBalanceStr;
colorStr = wxT("#FF6600");
-                boost::weak_ptr<mmCurrency> wpCurrency = core_->accountList_.getCurrencyWeakPtr(trans_[bdidx].accountID_);
+                boost::weak_ptr<mmCurrency> wpCurrency = core_->getCurrencyWeakPtr(trans_[bdidx].accountID_);
boost::shared_ptr<mmCurrency> pCurrency = wpCurrency.lock();
if (pCurrency)
--- trunk/mmex/src/mmtransaction.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/mmtransaction.cpp	2012-02-24 06:30:09 UTC (rev 1868)
toAmt_          = q1.GetDouble(wxT("TOTRANSAMOUNT"));
category_ = core->getCategorySharedPtr(q1.GetInt(wxT("CATEGID")), q1.GetInt(wxT("SUBCATEGID")));
-    boost::shared_ptr<mmCurrency> pCurrencyPtr = core->accountList_.getCurrencyWeakPtr(accountID_).lock();
+    boost::shared_ptr<mmCurrency> pCurrencyPtr = core->getCurrencyWeakPtr(accountID_).lock();
splitEntries_ = boost::shared_ptr<mmSplitTransactionEntries>(new mmSplitTransactionEntries());
--- trunk/mmex/src/qifimport.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/qifimport.cpp	2012-02-24 06:30:09 UTC (rev 1868)
fromAccountID = core->getAccountID(acctName);
-    boost::shared_ptr<mmCurrency> pCurrencyPtr = core->accountList_.getCurrencyWeakPtr(fromAccountID).lock();
+    boost::shared_ptr<mmCurrency> pCurrencyPtr = core->getCurrencyWeakPtr(fromAccountID).lock();
wxString chooseExt;
Modified: trunk/mmex/src/reportcashflow.cpp
--- trunk/mmex/src/reportcashflow.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/reportcashflow.cpp	2012-02-24 06:30:09 UTC (rev 1868)
core_->bTransactionList_.getDailyBalance(account->id_, daily_balance);
-        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(account->id_).lock();
+        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(account->id_).lock();
Modified: trunk/mmex/src/reportsummary.cpp
--- trunk/mmex/src/reportsummary.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/reportsummary.cpp	2012-02-24 06:30:09 UTC (rev 1868)
double bal = pCA->initialBalance_ + core_->bTransactionList_.getBalance(pCA->id_, mmIniOptions::instance().ignoreFutureTransactions_);
-            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(pCA->id_).lock();
+            boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(pCA->id_).lock();
double bal = pTA->initialBalance_ + core_->bTransactionList_.getBalance(pTA->id_, mmIniOptions::instance().ignoreFutureTransactions_);
--- trunk/mmex/src/transdialog.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/transdialog.cpp	2012-02-24 06:30:09 UTC (rev 1868)
pTransaction = core_->bTransactionList_.getBankTransactionPtr(accountID_, transID_);
-    boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(fromAccountID).lock();
+    boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(fromAccountID).lock();
--- trunk/mmex/src/univcsvdialog.cpp	2012-02-24 06:02:18 UTC (rev 1867)
+++ trunk/mmex/src/univcsvdialog.cpp	2012-02-24 06:30:09 UTC (rev 1868)
if (fromAccountID > 0)
-        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(fromAccountID).lock();
+        boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->getCurrencyWeakPtr(fromAccountID).lock();
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1867]
From: <guanlisheng@us...> - 2012-02-24 06:02:24
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1867&view=rev
Date:     2012-02-24 06:02:18 +0000 (Fri, 24 Feb 2012)
trunk/mmex/src/reporttransactions.cpp
--- trunk/mmex/src/mmcheckingpanel.cpp	2012-02-24 05:50:24 UTC (rev 1866)
+++ trunk/mmex/src/mmcheckingpanel.cpp	2012-02-24 06:02:18 UTC (rev 1867)
double checking_bal = core_->bTransactionList_.getBalance(m_AccountID);
double reconciledBal = core_->bTransactionList_.getReconciledBalance(m_AccountID);
-    double acctInitBalance = core_->accountList_.getAccountSharedPtr(m_AccountID)->initialBalance_;
+    double acctInitBalance = core_->getAccountSharedPtr(m_AccountID)->initialBalance_;
wxString balance, recbalance;
mmex::formatDoubleToCurrency(checking_bal + acctInitBalance, balance);
if (pgd)
pgd->Update(20);
-    boost::shared_ptr<mmAccount> pAccount = core_->accountList_.getAccountSharedPtr(m_AccountID);
+    boost::shared_ptr<mmAccount> pAccount = core_->getAccountSharedPtr(m_AccountID);
boost::shared_ptr<mmCurrency> pCurrency = pAccount->currency_.lock();
pCurrency->loadCurrencySettings();
--- trunk/mmex/src/mmex.cpp	2012-02-24 05:50:24 UTC (rev 1866)
+++ trunk/mmex/src/mmex.cpp	2012-02-24 06:02:18 UTC (rev 1867)
@@ -1671,7 +1671,7 @@
-           boost::shared_ptr<mmAccount> pAccount = m_core->accountList_.getAccountSharedPtr(data);
+           boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data);
if (pAccount)
wxString acctType = pAccount->acctType_;
@@ -2343,7 +2343,7 @@
if (selectedItemData_)
int data = selectedItemData_->getData();
-      boost::shared_ptr<mmAccount> pAccount = m_core->accountList_.getAccountSharedPtr(data);
+      boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data);
wxString website = pAccount->website_;
@@ -2367,7 +2367,7 @@
-        boost::shared_ptr<mmAccount> pAccount = m_core->accountList_.getAccountSharedPtr(data);
+        boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data);
@@ -2423,7 +2423,7 @@
wxMessageDialog msgDlg(this,
int data = iData->getData();
if (!iData->isBudgetingNode())
-            boost::shared_ptr<mmAccount> pAccount = m_core->accountList_.getAccountSharedPtr(data);
+            boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data);
--- trunk/mmex/src/newacctdialog.cpp	2012-02-24 05:50:24 UTC (rev 1866)
+++ trunk/mmex/src/newacctdialog.cpp	2012-02-24 06:02:18 UTC (rev 1867)
void mmNewAcctDialog::fillControlsWithData()
-    boost::shared_ptr<mmAccount> pAccount = core_->accountList_.getAccountSharedPtr(accountID_);
+    boost::shared_ptr<mmAccount> pAccount = core_->getAccountSharedPtr(accountID_);
wxASSERT(pAccount);
textAccountName_->SetValue(pAccount->name_);
-       pAccount = core_->accountList_.getAccountSharedPtr(accountID_);
+       pAccount = core_->getAccountSharedPtr(accountID_);
pAccount->acctType_ = ACCOUNT_TYPE_BANK;
Modified: trunk/mmex/src/reporttransactions.cpp
--- trunk/mmex/src/reporttransactions.cpp	2012-02-24 05:50:24 UTC (rev 1866)
+++ trunk/mmex/src/reporttransactions.cpp	2012-02-24 06:02:18 UTC (rev 1867)
if ( refAccountID_ > -1 && refTrans[index]->transType_ == TRANS_TYPE_TRANSFER_STR &&
(refAccountID_ == refTrans[index]->accountID_ || refAccountID_ == refTrans[index]->toAccountID_) )
-            boost::shared_ptr<mmAccount> pAccount = core_->accountList_.getAccountSharedPtr(refAccountID_);
+            boost::shared_ptr<mmAccount> pAccount = core_->getAccountSharedPtr(refAccountID_);
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1866]
From: <guanlisheng@us...> - 2012-02-24 05:50:31
Revision: 1866
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1866&view=rev
Date:     2012-02-24 05:50:24 +0000 (Fri, 24 Feb 2012)
Modified: trunk/mmex/doc/help/index.html
--- trunk/mmex/doc/help/index.html	2012-02-24 02:17:00 UTC (rev 1865)
+++ trunk/mmex/doc/help/index.html	2012-02-24 05:50:24 UTC (rev 1866)
-Manager Ex User Manual<BR><FONT SIZE=3>MMEX 0.9.9.0</FONT></FONT></H2>
+    <H2 CLASS="western" ALIGN=CENTER><A NAME="top"></A><FONT FACE="Verdana">
+            <BR>Money Manager Ex User Manual<BR>
+            <FONT SIZE=3>MMEX 0.9.9.0</FONT>
+    </FONT></H2>
<COL WIDTH=208*>
@@ -29,17 +31,13 @@
<TD WIDTH=81%>
-				<LI><P STYLE="margin-bottom: 0in"><A HREF="#introduction"><FONT FACE="Verdana"><SPAN STYLE="font-weight: normal">Introduction</SPAN></FONT></A></P>
-				<LI><P STYLE="margin-bottom: 0in"><A HREF="#financial_health"><FONT FACE="Verdana">Working
-				towards better Financial Health</FONT></A></P>
-				Manager Ex Concepts</FONT></A></P>
+                <LI><P STYLE="margin-bottom: 0in"><A HREF="#introduction"><FONT FACE="Verdana"><SPAN STYLE="font-weight: normal">Introduction</SPAN></FONT></A></P>
+				<LI><P STYLE="margin-bottom: 0in"><A HREF="#financial_health"><FONT FACE="Verdana">Working towards better Financial Health</FONT></A></P>
+				<LI><P STYLE="margin-bottom: 0in"><A HREF="#concepts"><FONT FACE="Verdana">Money Manager Ex Concepts</FONT></A></P>
<LI><P><A HREF="#recommendation"><FONT FACE="Verdana">Recommendations</FONT></A></P>
-			<P><A HREF="../help">English Version</A></P>
+		<TD WIDTH=19%><P><A HREF="../help">English Version</A></P></TD>
@@ -50,62 +48,66 @@
-				<LI><P><FONT FACE="Verdana"><B>Database Management</B></FONT><FONT FACE="Verdana"><SPAN STYLE="font-weight: normal"><BR>*
-				<A HREF="#create_database">Creating a New Database</A><BR>*
-				<A HREF="#encrypting_database">Encrypting a Database</A><BR>*
-				<A HREF="#switching_databases">Switching Databases</A></SPAN></FONT></P>
+                <LI><P><FONT FACE="Verdana"><B>Database Management</B></FONT><FONT FACE="Verdana"><SPAN STYLE="font-weight: normal">
+                        <BR>* <A HREF="#create_database">Creating a New Database</A>
+                        <BR>* <A HREF="#encrypting_database">Encrypting a Database</A>
+                        <BR>* <A HREF="#switching_databases">Switching Databases</A>
+                </SPAN></FONT></P>
-				<LI><P><FONT FACE="Verdana"><B>Working with</B></FONT><FONT FACE="Verdana">:<BR>*
-				<A HREF="#currencies">Currencies</A><BR>* <A HREF="#categories">Categories</A><BR>*
-				<A HREF="#payees">Payees</A></FONT></P>
+                <LI><P><FONT FACE="Verdana"><B>Working with</B></FONT><FONT FACE="Verdana">
+                    <BR>* <A HREF="#currencies">Currencies</A>
+                    <BR>* <A HREF="#categories">Categories</A>
+                    <BR>* <A HREF="#payees">Payees</A>
+                </FONT></P>
-				<LI><P><FONT FACE="Verdana"><B>Account Management</B></FONT><FONT FACE="Verdana"><BR>*
-				<A HREF="#create_account">Creating New Accounts</A><BR>* <A HREF="#editaccounts">Editing
-				Account Information</A><BR>* <A HREF="#creating_new_transaction">Creating
-				New Transactions</A><BR>* <A HREF="#edittrans">Editing and
-				Updating Transactions</A><BR>* <A HREF="#rectrans">Reconciling &amp;
-				Balancing Transactions</A><BR>* <A HREF="#followup">Flagging
-				Transactions for Followup</A></FONT></P>
-				<LI><P><A HREF="#account_setup"><FONT FACE="Verdana"><B>Account
-				Setup Example</B></FONT></A></P>
+                <LI><P><FONT FACE="Verdana"><B>Account Management</B>
+                    </FONT><FONT FACE="Verdana">
+                        <BR>* <A HREF="#create_account">Creating New Accounts</A>
+                        <BR>* <A HREF="#editaccounts">Editing Account Information</A>
+                        <BR>* <A HREF="#creating_new_transaction">Creating New Transactions</A>
+                        <BR>* <A HREF="#edittrans">Editing and Updating Transactions</A>
+                        <BR>* <A HREF="#rectrans">Reconciling &amp; Balancing Transactions</A>
+                        <BR>* <A HREF="#followup">Flagging Transactions for Followup</A>
+                    </FONT></P>
+                <LI><P><A HREF="#account_setup"><FONT FACE="Verdana"><B>Account Setup Example</B> </FONT></A></P>
-				<LI><P><FONT FACE="Verdana"><B>Import From</B></FONT> <FONT FACE="Verdana"><BR>*
-				<A HREF="#importQIF">QIF Files</A> <BR>* <A HREF="#importUnivCSV">Universal
-				CSV Importer</A> </FONT>
-				<LI><P><A HREF="#importcsvtips"><FONT FACE="Verdana"><B>Tips for
-				creating CSV Files</B></FONT></A></P>
-				<LI><P><FONT FACE="Verdana"><B>Export To</B></FONT> <FONT FACE="Verdana"><BR>*
-				<A HREF="#exportcsv">CSV Files</A> <BR>* <A HREF="#export_qif">QIF
-				Files</A></FONT></P>
+                <LI><P><FONT FACE="Verdana"><B>Import From</B></FONT> <FONT FACE="Verdana">
+                    <BR>* <A HREF="#importQIF">QIF Files</A>
+                    <BR>* <A HREF="#importUnivCSV">Universal CSV Importer</A>
+				<LI><P><A HREF="#importcsvtips"><FONT FACE="Verdana"><B>Tips for creating CSV Files</B></FONT></A></P>
+                <LI><P><FONT FACE="Verdana"><B>Export To</B></FONT> <FONT FACE="Verdana">
+                    <BR>* <A HREF="#exportcsv">CSV Files</A>
+                    <BR>* <A HREF="#export_qif">QIF Files</A>
-				<LI><P><A HREF="#reports"><FONT FACE="Verdana"><B>Reports</B></FONT></A><FONT FACE="Verdana"><BR>*
-				<A HREF="#financialYearReport">Financial Year Reports</A><BR>*
-				<A HREF="#transaction_report">Transaction Reports</A><BR>* <A HREF="#cashFlowReport">Cash
-				Flow Reports</A><BR>* <A HREF="custom_sql_reports.html">Custom
-				SQL Reports</A></FONT></P>
+                <LI><P><A HREF="#reports"><FONT FACE="Verdana"><B>Reports</B></FONT></A><FONT FACE="Verdana">
+                    <BR>* <A HREF="#financialYearReport">Financial Year Reports</A>
+                    <BR>* <A HREF="#transaction_report">Transaction Reports</A>
+                    <BR>* <A HREF="#cashFlowReport">Cash Flow Reports</A>
+                    <BR>* <A HREF="custom_sql_reports.html">Custom SQL Reports</A>
-				<LI><P><A HREF="investment.html"><FONT FACE="Verdana"><B>Stock
-				Investments</B></FONT></A></P>
+				<LI><P><A HREF="investment.html"><FONT FACE="Verdana"><B>Stock Investments</B></FONT></A></P>
<LI><P><A HREF="#assets"><FONT FACE="Verdana"><B>Assets</B></FONT></A></P>
@@ -113,10 +115,8 @@
-				<LI><P><A HREF="#repeating_transactions"><FONT FACE="Verdana"><B>Repeating
-				Transactions</B></FONT></A></P>
-				<LI><P><A HREF="#transfilter"><FONT FACE="Verdana"><B>Transaction
-				Filter</B></FONT></A></P>
+				<LI><P><A HREF="#repeating_transactions"><FONT FACE="Verdana"><B>Repeating Transactions</B></FONT></A></P>
+				<LI><P><A HREF="#transfilter"><FONT FACE="Verdana"><B>Transaction Filter</B></FONT></A></P>
-	<LI><P STYLE="margin-bottom: 0in"><A HREF="#faq"><FONT FACE="Verdana">Frequently
-	Asked Questions</FONT></A></P>
+	<LI><P STYLE="margin-bottom: 0in"><A HREF="#faq"><FONT FACE="Verdana">Frequently Asked Questions</FONT></A></P>
@@ -1876,4 +1875,4 @@
<H5 CLASS="western"><FONT FACE="Verdana">Copyright &ordf; 2005-2011&nbsp;
CodeLathe LLC. All rights reserved.</FONT></H5>
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1865]
From: <guanlisheng@us...> - 2012-02-24 02:17:07
Revision: 1865
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1865&view=rev
Date:     2012-02-24 02:17:00 +0000 (Fri, 24 Feb 2012)
trunk/mmex/src/reportsummaryassets.cpp
--- trunk/mmex/src/mmtransaction.h	2012-02-23 14:32:18 UTC (rev 1864)
+++ trunk/mmex/src/mmtransaction.h	2012-02-24 02:17:00 UTC (rev 1865)
class mmBankTransaction : public mmTransaction
-    mmBankTransaction(mmCoreDB* core,
-       wxSQLite3ResultSet& q1);
+    mmBankTransaction(mmCoreDB* core, wxSQLite3ResultSet& q1);
mmBankTransaction(boost::shared_ptr<wxSQLite3Database> db);
virtual ~mmBankTransaction() {}
Modified: trunk/mmex/src/reportsummaryassets.cpp
--- trunk/mmex/src/reportsummaryassets.cpp	2012-02-23 14:32:18 UTC (rev 1864)
+++ trunk/mmex/src/reportsummaryassets.cpp	2012-02-24 02:17:00 UTC (rev 1865)
@@ -27,68 +27,68 @@
wxString mmReportSummaryAssets::getHTMLText()
-        hb.addHeader(3, _("Summary of Assets"));
+    hb.addHeader(3, _("Summary of Assets"));
+    hb.addHeader(7, dt);
+    hb.addLineBreak();
-        hb.startTable(wxT("50%"));
-        hb.startTableRow();
-        hb.addTableHeaderCell(_("Name"));
-        hb.addTableHeaderCell(_("Type"));
-        hb.addTableHeaderCell(_("Value"));
-        hb.endTableRow();
+    hb.startTable(wxT("50%"));
+    hb.startTableRow();
+    hb.addTableHeaderCell(_("Name"));
+    hb.addTableHeaderCell(_("Type"));
+    hb.addTableHeaderCell(_("Value"));
-        "select ASSETID, "
-               "ASSETNAME, "
-               "ASSETTYPE "
-        "from ASSETS_V1";
+    "select ASSETID, "
+           "ASSETNAME, "
+           "ASSETTYPE "
+    "from ASSETS_V1";
-        wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql);
-            mmAssetHolder th;
+        mmAssetHolder th;
-            th.id_           = q1.GetInt(wxT("ASSETID"));
-            th.value_             = mmDBWrapper::getAssetValue(db_, th.id_);
-            th.assetName_         = q1.GetString(wxT("ASSETNAME"));
+        th.id_           = q1.GetInt(wxT("ASSETID"));
+        th.value_             = mmDBWrapper::getAssetValue(db_, th.id_);
+        th.assetName_         = q1.GetString(wxT("ASSETNAME"));
-            wxString assetTypeStr = q1.GetString(wxT("ASSETTYPE"));
-            th.assetType_ = wxGetTranslation(assetTypeStr);
+        wxString assetTypeStr = q1.GetString(wxT("ASSETTYPE"));
+        th.assetType_ = wxGetTranslation(assetTypeStr);
-            mmex::formatDoubleToCurrencyEdit(th.value_, th.valueStr_);
+        mmex::formatDoubleToCurrencyEdit(th.value_, th.valueStr_);
-			hb.addTableCell(th.assetName_, false, true);
-			hb.addTableCell(th.assetType_);
-			hb.addTableCell(th.valueStr_, true);
-			hb.endTableRow();
-        /* Assets */
-        double assetBalance = mmDBWrapper::getAssetBalance(db_);
-        wxString assetBalanceStr;
-        mmex::formatDoubleToCurrency(assetBalance, assetBalanceStr);
+        hb.addTableCell(th.assetName_, false, true);
+        hb.addTableCell(th.assetType_);
+        hb.addTableCell(th.valueStr_, true);
+    /* Assets */
+    double assetBalance = mmDBWrapper::getAssetBalance(db_);
+    wxString assetBalanceStr;
+    mmex::formatDoubleToCurrency(assetBalance, assetBalanceStr);
-	hb.addRowSeparator(3);
-	hb.addTotalRow(_("Total Assets: "), 3, assetBalanceStr);
-        hb.endTable();
+    hb.addRowSeparator(3);
+    hb.addTotalRow(_("Total Assets: "), 3, assetBalanceStr);
+    hb.endTable();
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1864]
From: <vomikan@us...> - 2012-02-23 14:32:29
Revision: 1864
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1864&view=rev
Date:     2012-02-23 14:32:18 +0000 (Thu, 23 Feb 2012)
added: held at column and gain/loss total
--- trunk/mmex/src/reportsummarystocks.cpp	2012-02-23 13:07:54 UTC (rev 1863)
+++ trunk/mmex/src/reportsummarystocks.cpp	2012-02-23 14:32:18 UTC (rev 1864)
@@ -39,63 +39,65 @@
hb.startTable();
hb.addTableHeaderCell(_("Company"));
+		hb.addTableHeaderCell(_("Name"));
-		hb.addTableHeaderCell(_("Number Shares"));
+		hb.addTableHeaderCell(_("Quntity"));
hb.addTableHeaderCell(_("Purchase Price"));
hb.addTableHeaderCell(_("Current Price"));
hb.addTableHeaderCell(_("Commission"));
-		hb.addTableHeaderCell(_("Value"));
-		hb.addTableHeaderCell(_("Gain Loss"));
+		hb.addTableHeaderCell(_("Gain/Loss"));
+		hb.addTableHeaderCell(_("Value"), true);
+        double gain_loss_sum = 0;
+        mmDBWrapper::loadBaseCurrencySettings(db_);
wxSQLite3ResultSet q1 = db_->ExecuteQuery("select * from STOCK_V1");
-            th.id_           = q1.GetInt(wxT("STOCKID"));
-            int accountID         = q1.GetInt(wxT("HELDAT"));
-            th.heldAt_            = core_->getAccountName(accountID);
-            th.shareName_         = q1.GetString(wxT("STOCKNAME"));
-            th.numSharesStr_      = q1.GetString(wxT("NUMSHARES"));
-            th.numShares_         = q1.GetDouble(wxT("NUMSHARES"));
-            th.symbol_            = q1.GetString(wxT("SYMBOL"));
+            th.id_              = q1.GetInt(wxT("STOCKID"));
+            int accountID       = q1.GetInt(wxT("HELDAT"));
+            th.heldAt_          = core_->getAccountName(accountID);
+            th.shareName_       = q1.GetString(wxT("STOCKNAME"));
+            th.numSharesStr_    = q1.GetString(wxT("NUMSHARES"));
+            th.numShares_       = q1.GetDouble(wxT("NUMSHARES"));
+            th.symbol_          = q1.GetString(wxT("SYMBOL"));
-            th.currentPrice_      = q1.GetDouble(wxT("CURRENTPRICE"));
-            th.purchasePrice_      = q1.GetDouble(wxT("PURCHASEPRICE"));
-            th.valueStr_          = q1.GetString(wxT("VALUE"));
-            th.value_             = q1.GetDouble(wxT("VALUE"));
-            double commission     = q1.GetDouble(wxT("COMMISSION"));
-            wxString dateString   = q1.GetString(wxT("PURCHASEDATE"));
-            wxDateTime dtdt = mmGetStorageStringAsDate(dateString);
-            wxString dt = mmGetDateForDisplay(db_, dtdt);
+            th.currentPrice_    = q1.GetDouble(wxT("CURRENTPRICE"));
+            th.purchasePrice_   = q1.GetDouble(wxT("PURCHASEPRICE"));
+            th.value_           = q1.GetDouble(wxT("VALUE"));
+            double commission   = q1.GetDouble(wxT("COMMISSION"));
+            wxString dateString = q1.GetString(wxT("PURCHASEDATE"));
+            wxDateTime dtdt     = mmGetStorageStringAsDate(dateString);
+            wxString dt         = mmGetDateForDisplay(db_, dtdt);
+            double base_conv_rate = mmDBWrapper::getCurrencyBaseConvRate(db_, accountID);
+            gain_loss_sum += th.gainLoss_ * base_conv_rate;
+            wxString commString;
+            mmex::formatDoubleToCurrencyEdit(commission, commString);
mmex::formatDoubleToCurrencyEdit(th.currentPrice_, th.cPriceStr_);
+            mmex::formatDoubleToCurrencyEdit(th.value_, th.valueStr_);
-            wxString commString;
-            mmex::formatDoubleToCurrencyEdit(commission, commString);
+			hb.addTableCell(th.heldAt_, false, true);
hb.addTableCell(th.shareName_, false, true);
hb.addTableCell(th.symbol_);
+            hb.addTableCell(dt);
-            hb.addTableCell(dt);
-            hb.addTableCell(th.valueStr_, true);
if(th.gainLoss_ < 0)
hb.addTableCell(th.gainLossStr_, true, true);
+            hb.addTableCell(th.valueStr_, true);
@@ -118,12 +121,15 @@
double stockBalance = mmDBWrapper::getStockInvestmentBalance(db_, invested);
+        wxString gain_loss_sum_str;
mmDBWrapper::loadBaseCurrencySettings(db_);
+        mmex::formatDoubleToCurrency(gain_loss_sum, gain_loss_sum_str);
-	hb.addRowSeparator(9);
-	hb.addTotalRow(_("Total Stock Investments: "), 9, stockBalanceStr);
+	hb.addRowSeparator(10);
+	hb.addTotalRow(_("Total Stock Investments: "), 9, gain_loss_sum_str);
+	hb.addTableCell(stockBalanceStr, true, true, true); //numeric, italic, bold
hb.endCenter();
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1863]
From: <guanlisheng@us...> - 2012-02-23 13:08:01
Revision: 1863
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1863&view=rev
Date:     2012-02-23 13:07:54 +0000 (Thu, 23 Feb 2012)
--- trunk/mmex/src/mmex.cpp	2012-02-23 12:52:44 UTC (rev 1862)
+++ trunk/mmex/src/mmex.cpp	2012-02-23 13:07:54 UTC (rev 1863)
@@ -1794,7 +1794,7 @@
wxDateTime dtEnd = prevMonthEnd;
wxDateTime dtBegin = prevMonthEnd.Subtract(wxDateSpan::Days(numDays));
wxString title = _("Categories - Last Calendar Month");
-            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(),false,dtBegin,dtEnd,title,0);
+            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), false, dtBegin, dtEnd, title, 0);
wxDateTime dtEnd = today;
wxDateTime dtBegin = today.Subtract(wxDateSpan::Month());
wxString title = _("Categories - Last 30 Days");
wxDateTime dtBegin = prevMonthEnd;
wxDateTime dtEnd = wxDateTime::Now();
wxString title = _("Categories - Current Month");
@@ -1831,7 +1831,7 @@
wxDateTime dtEnd = prevYearEnd;
wxDateTime dtBegin = prevYearEnd.Subtract(wxDateSpan::Year());
wxString title = _("Categories - Last Year");
@@ -1856,8 +1856,7 @@
wxDateTime dtEnd = refDate;
wxDateTime dtBegin = refDate.Subtract(wxDateSpan::Year());
wxString title = _("Categories - Last Financial Year");
-            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), false, dtBegin, dtEnd,
-                title, 0);
@@ -1866,8 +1865,7 @@
wxDateTime dtBegin = wxDateTime(getUserDefinedFinancialYear(true));
wxDateTime dtEnd   = wxDateTime::Now();
wxString title = _("Categories - Current Financial Year");
@@ -1876,8 +1874,7 @@
wxDateTime dtEnd =  wxDateTime::Now();
wxDateTime dtBegin =  wxDateTime::Now();
wxString title = _("Where the Money Comes From");
-            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), true, dtBegin, dtEnd,
-                title, 1);
+            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), true, dtBegin, dtEnd, title, 1);
@@ -1894,8 +1891,7 @@
wxString title = _("Where the Money Comes From - Last Calendar Month");
+            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), false, dtBegin, dtEnd, title, 1);
@@ -1906,8 +1902,7 @@
wxString title = _("Where the Money Comes From - Last 30 days");
@@ -1918,8 +1913,7 @@
wxString title = _("Where the Money Comes From - Current Month");
-               title, 1);
@@ -1934,7 +1928,7 @@
wxString title = _("Where the Money Comes From - Last year");
-            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(),false,dtBegin,dtEnd,title,1);
@@ -1949,7 +1943,7 @@
wxDateTime dtBegin = yearBegin;
wxString title = _("Where the Money Comes From - Current Year");
@@ -1959,7 +1953,7 @@
wxString title = _("Where the Money Comes From - Last Financial Year");
@@ -1969,7 +1963,7 @@
wxString title = _("Where the Money Comes From - Current Financial Year");
@@ -1978,7 +1972,7 @@
wxDateTime dtBegin = wxDateTime::Now();
wxString title = _("Where the Money Goes");
-            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(),true,dtBegin,dtEnd,title,2);
+            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), true, dtBegin, dtEnd, title, 2);
@@ -1995,7 +1989,7 @@
wxString title = _("Where the Money Goes - Last Calendar Month");
-            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(),false,dtBegin,dtEnd,title,2);
+            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), false, dtBegin, dtEnd, title, 2);
@@ -2006,7 +2000,7 @@
wxString title = _("Where the Money Goes - Last 30 Days");
-            mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(),false,dtBegin,dtEnd,title, 2);
@@ -2017,7 +2011,7 @@
wxString title = _("Where the Money Goes - Current Month");
@@ -2032,7 +2026,7 @@
wxString title = _("Where the Money Goes - Last Year");
@@ -2047,7 +2041,7 @@
wxString title = _("Where the Money Goes - Current Year");
@@ -2057,7 +2051,7 @@
wxString title = _("Where the Money Goes - Last Financial Year");
@@ -2066,7 +2060,7 @@
wxString title = _("Where the Money Goes - Current Financial Year");
@@ -2177,8 +2171,7 @@
else if (iData->getString() == wxT("Payee Report"))
wxString title = _("Payee Report");
-            mmPrintableBase* rs = new mmReportPayeeExpenses(m_core.get(), true, wxDateTime::Now(),
-                wxDateTime::Now(), title);
+            mmPrintableBase* rs = new mmReportPayeeExpenses(m_core.get(), true, wxDateTime::Now(), wxDateTime::Now(), title);
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1862]
From: <guanlisheng@us...> - 2012-02-23 12:52:55
Revision: 1862
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1862&view=rev
Date:     2012-02-23 12:52:44 +0000 (Thu, 23 Feb 2012)
pass core to stocks & assets report fix bug
trunk/mmex/src/reportbase.h
trunk/mmex/src/reportsummaryassets.h
trunk/mmex/src/reportsummarystocks.h
--- trunk/mmex/src/mmex.cpp	2012-02-22 09:24:08 UTC (rev 1861)
+++ trunk/mmex/src/mmex.cpp	2012-02-23 12:52:44 UTC (rev 1862)
@@ -1760,7 +1760,7 @@
else if (iData->getString() == wxT("Summary of Stocks"))
-            mmPrintableBase* rs = new mmReportSummaryStocks(m_db.get());
+            mmPrintableBase* rs = new mmReportSummaryStocks(m_core.get(), m_db.get());
else if (iData->getString() == wxT("Summary of Assets"))
-            mmPrintableBase* rs = new mmReportSummaryAssets(m_db.get());
+            mmPrintableBase* rs = new mmReportSummaryAssets(m_core.get(), m_db.get());
Modified: trunk/mmex/src/reportbase.h
--- trunk/mmex/src/reportbase.h	2012-02-22 09:24:08 UTC (rev 1861)
+++ trunk/mmex/src/reportbase.h	2012-02-23 12:52:44 UTC (rev 1862)
virtual wxString getHTMLText() = 0;
-    mmPrintableBase() {}
mmPrintableBase(mmCoreDB* core): core_(core) {}
Modified: trunk/mmex/src/reportsummaryassets.h
--- trunk/mmex/src/reportsummaryassets.h	2012-02-22 09:24:08 UTC (rev 1861)
+++ trunk/mmex/src/reportsummaryassets.h	2012-02-23 12:52:44 UTC (rev 1862)
class mmReportSummaryAssets : public mmPrintableBase
-    mmReportSummaryAssets(wxSQLite3Database* db) : db_(db) {}
+    mmReportSummaryAssets(mmCoreDB* core,  wxSQLite3Database* db) : mmPrintableBase(core), db_(db) {}
Modified: trunk/mmex/src/reportsummarystocks.h
--- trunk/mmex/src/reportsummarystocks.h	2012-02-22 09:24:08 UTC (rev 1861)
+++ trunk/mmex/src/reportsummarystocks.h	2012-02-23 12:52:44 UTC (rev 1862)
class mmReportSummaryStocks : public mmPrintableBase
-    mmReportSummaryStocks(wxSQLite3Database* db) : db_(db) {}
+    mmReportSummaryStocks(mmCoreDB* core, wxSQLite3Database* db) : mmPrintableBase(core), db_(db) {}
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1861]
From: <guanlisheng@us...> - 2012-02-22 09:24:18
Revision: 1861
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1861&view=rev
Date:     2012-02-22 09:24:08 +0000 (Wed, 22 Feb 2012)
trunk/mmex/src/univcsvdialog.h
--- trunk/mmex/src/defs.h	2012-02-22 00:31:40 UTC (rev 1860)
+++ trunk/mmex/src/defs.h	2012-02-22 09:24:08 UTC (rev 1861)
+#include <wx/choice.h>
--- trunk/mmex/src/univcsvdialog.cpp	2012-02-22 00:31:40 UTC (rev 1860)
+++ trunk/mmex/src/univcsvdialog.cpp	2012-02-22 09:24:08 UTC (rev 1861)
#include "univcsvdialog.h"
#include "fileviewerdialog.h"
-#include "defs.h"
#include "platfdep.h"
-#include <wx/statline.h>
IMPLEMENT_DYNAMIC_CLASS(mmUnivCSVDialog, wxDialog)
Modified: trunk/mmex/src/univcsvdialog.h
--- trunk/mmex/src/univcsvdialog.h	2012-02-22 00:31:40 UTC (rev 1860)
+++ trunk/mmex/src/univcsvdialog.h	2012-02-22 09:24:08 UTC (rev 1861)
-#include "dbwrapper.h"
#include "mmcoredb.h"
-#include <wx/choice.h>
#define ID_MYDIALOG8 10040
#define SYMBOL_UNIVCSVDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1860]
From: <stef145g@us...> - 2012-02-22 00:31:46
Revision: 1860
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1860&view=rev
Date:     2012-02-22 00:31:40 +0000 (Wed, 22 Feb 2012)
Fix: Repeating Transactions Future Date setting, from different time zones.
--- trunk/mmex/src/billsdepositsdialog.cpp	2012-02-22 00:11:23 UTC (rev 1859)
+++ trunk/mmex/src/billsdepositsdialog.cpp	2012-02-22 00:31:40 UTC (rev 1860)
@@ -122,8 +122,10 @@
"select BDID, ACCOUNTID, TOACCOUNTID, PAYEEID, TRANSCODE, TRANSAMOUNT, STATUS, TRANSACTIONNUMBER, NOTES, CATEGID, "
"SUBCATEGID, FOLLOWUPID, TOTRANSAMOUNT, REPEATS, NUMOCCURRENCES, "
-        "date(NEXTOCCURRENCEDATE, 'localtime') as NEXTOCCURRENCEDATE, date(TRANSDATE, 'localtime') as TRANSDATE "
+        "NEXTOCCURRENCEDATE, date(TRANSDATE, 'localtime') as TRANSDATE "
"from BILLSDEPOSITS_V1 where BDID = ? ";
+		// Removed "date(NEXTOCCURRENCEDATE, 'localtime') as NEXTOCCURRENCEDATE, "
+		// because causing problems with some systems and in different time zones
wxSQLite3Statement st = db_->PrepareStatement(billsdepositsSql);
st.Bind(1, bdID_);
--- trunk/mmex/src/dbwrapper.cpp	2012-02-22 00:11:23 UTC (rev 1859)
+++ trunk/mmex/src/dbwrapper.cpp	2012-02-22 00:31:40 UTC (rev 1860)
@@ -1870,11 +1870,13 @@
static const char sql[] =
"select NUMOCCURRENCES, "
-               "date(NEXTOCCURRENCEDATE, 'localtime') as NEXTOCCURRENCEDATE, "
+               "NEXTOCCURRENCEDATE, "
"REPEATS "
"from BILLSDEPOSITS_V1 "
"WHERE BDID = ?";
wxDateTime updateOccur = wxDateTime::Now();
int numRepeats  = -1;
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1859]
From: <stef145g@us...> - 2012-02-22 00:11:29
Revision: 1859
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1859&view=rev
Date:     2012-02-22 00:11:23 +0000 (Wed, 22 Feb 2012)
Fix: Home page selection after Transaction report and CashFlow Specific Account Report
--- trunk/mmex/src/mmex.cpp	2012-02-21 14:57:46 UTC (rev 1858)
+++ trunk/mmex/src/mmex.cpp	2012-02-22 00:11:23 UTC (rev 1859)
@@ -884,7 +884,6 @@
if (activeHomePage_)
-                        refreshRequested_ = true;
createHomePage(); // Update home page details only if it is being displayed
@@ -925,7 +924,6 @@
-                refreshRequested_ = true;
@@ -1711,11 +1709,7 @@
if (iData->getString() == wxT("Home Page"))
-            if (!refreshRequested_)
-                createHomePage();
+            createHomePage();
@@ -2321,23 +2315,16 @@
else if (iData->getString() == wxT("Cash Flow - Specific Accounts"))
+            navTreeCtrl_->UnselectAll();    // item in navTreeCtrl_ to enable re-selection.
+            processPendingEvents();         // Clear event buffer before activating report.
OnCashFlowSpecificAccounts();
-            refreshRequested_ = true;    // Prevent home page being recreated when deselecting
-            navTreeCtrl_->UnselectAll(); // item in navTreeCtrl_ to enable re-selection.
else if (iData->getString() == wxT("Transaction Report"))
wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TRANSACTIONREPORT);
-            AddPendingEvent(evt);
+            AddPendingEvent(evt);           // Events will be processed in due course.
-//      Moved to act when using right mouse button instead.
-//      else if (iData->getString() == wxT("Budgeting"))
-//          wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_BUDGETSETUPDIALOG);
-//          AddPendingEvent(evt);
else if (iData->getString() == wxT("Bills & Deposits"))
@@ -3387,8 +3374,7 @@
// Ensure database is in a steady state first
if (!activeHomePage_)
-        refreshRequested_ = true;
-        createHomePage();
+        createHomePage();   // Display Home page when not being displayed.
bool encrypt = dlg.GetFilterIndex() != 0; // emb -> Encrypted mMB
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1858]
From: <guanlisheng@us...> - 2012-02-21 14:57:58
Revision: 1858
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1858&view=rev
Date:     2012-02-21 14:57:46 +0000 (Tue, 21 Feb 2012)
csv importer & exporter refine
--- trunk/mmex/src/univcsvdialog.cpp	2012-02-21 13:32:04 UTC (rev 1857)
+++ trunk/mmex/src/univcsvdialog.cpp	2012-02-21 14:57:46 UTC (rev 1858)
EVT_BUTTON(wxID_DOWN, mmUnivCSVDialog::OnMoveDown)
EVT_BUTTON(wxID_STANDARD, mmUnivCSVDialog::OnStandard)
EVT_BUTTON(wxID_SEARCH, mmUnivCSVDialog::OnSearch)
+    EVT_CHOICE(wxID_ACCOUNT, mmUnivCSVDialog::OnAccountChange)
EVT_LISTBOX(ID_LISTBOX, mmUnivCSVDialog::OnListBox)
EVT_RADIOBOX(wxID_RADIO_BOX, mmUnivCSVDialog::OnCheckOrRadioBox)
@@ -134,86 +135,86 @@
this->SetSizer(itemBoxSizer2);
-    if (this->is_importer_)
-        wxStaticText* itemStaticText3 = new wxStaticText(this, wxID_STATIC,
-           _("Specify the order of fields in the CSV file"), wxDefaultPosition, wxDefaultSize, 0);
-        itemBoxSizer2->Add(itemStaticText3, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 5);
+    wxStaticText* itemStaticText3 = new wxStaticText(this, wxID_STATIC,
+       _("Specify the order of fields in the CSV file"), wxDefaultPosition, wxDefaultSize, 0);
+    itemBoxSizer2->Add(itemStaticText3, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 5);
-        wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
-        itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);
+    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
+    itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);
-        //CSV fields candicate
-        csvFieldCandicate_ = new wxListBox(this, ID_LISTBOX_CANDICATE,
-            wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE|wxLB_NEEDED_SB);
-        itemBoxSizer3->Add(csvFieldCandicate_, 1, wxGROW|wxALL, 1);
-        for(std::map<int, wxString>::const_iterator it = CSVFieldName_.begin(); it != CSVFieldName_.end(); it ++)
-            csvFieldCandicate_->Append(it->second, new mmListBoxItem(it->first, it->second));
+    //CSV fields candicate
+    csvFieldCandicate_ = new wxListBox(this, ID_LISTBOX_CANDICATE,
+        wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE|wxLB_NEEDED_SB);
+    itemBoxSizer3->Add(csvFieldCandicate_, 1, wxGROW|wxALL, 1);
+    for(std::map<int, wxString>::const_iterator it = CSVFieldName_.begin(); it != CSVFieldName_.end(); it ++)
+        csvFieldCandicate_->Append(it->second, new mmListBoxItem(it->first, it->second));
-         //Add Remove Area
-        wxPanel* itemPanel_AddRemove = new wxPanel(this, ID_PANEL10,
-            wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-        itemBoxSizer3->Add(itemPanel_AddRemove, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
+     //Add Remove Area
+    wxPanel* itemPanel_AddRemove = new wxPanel(this, ID_PANEL10,
+        wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    itemBoxSizer3->Add(itemPanel_AddRemove, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
-        wxBoxSizer* itemBoxSizer_AddRemove = new wxBoxSizer(wxVERTICAL);
-        itemPanel_AddRemove->SetSizer(itemBoxSizer_AddRemove);
+    wxBoxSizer* itemBoxSizer_AddRemove = new wxBoxSizer(wxVERTICAL);
+    itemPanel_AddRemove->SetSizer(itemBoxSizer_AddRemove);
-        //Add button
-        m_button_add_= new wxButton(itemPanel_AddRemove, wxID_ADD, _("Add"),
-            wxDefaultPosition, wxDefaultSize, 0);
-        itemBoxSizer_AddRemove->Add(m_button_add_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    //Add button
+    m_button_add_= new wxButton(itemPanel_AddRemove, wxID_ADD, _("Add"),
+        wxDefaultPosition, wxDefaultSize, 0);
+    itemBoxSizer_AddRemove->Add(m_button_add_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-        //Remove button
-        m_button_remove_ = new wxButton(itemPanel_AddRemove, wxID_REMOVE, _("Remove"),
-        itemBoxSizer_AddRemove->Add(m_button_remove_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-        //ListBox of attribute order
-        csvListBox_ = new wxListBox(this, ID_LISTBOX,
-        itemBoxSizer3->Add(csvListBox_, 1, wxGROW|wxALL, 1);
+    //Remove button
+    m_button_remove_ = new wxButton(itemPanel_AddRemove, wxID_REMOVE, _("Remove"),
+    itemBoxSizer_AddRemove->Add(m_button_remove_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    //ListBox of attribute order
+    csvListBox_ = new wxListBox(this, ID_LISTBOX,
+    itemBoxSizer3->Add(csvListBox_, 1, wxGROW|wxALL, 1);
-       //Arranger Area
-        wxPanel* itemPanel_Arranger = new wxPanel(this, ID_PANEL10,
-        itemBoxSizer3->Add(itemPanel_Arranger, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
+   //Arranger Area
+    wxPanel* itemPanel_Arranger = new wxPanel(this, ID_PANEL10,
+    itemBoxSizer3->Add(itemPanel_Arranger, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
-        wxBoxSizer* itemBoxSizer_Arranger = new wxBoxSizer(wxVERTICAL);
-        itemPanel_Arranger->SetSizer(itemBoxSizer_Arranger);
+    wxBoxSizer* itemBoxSizer_Arranger = new wxBoxSizer(wxVERTICAL);
+    itemPanel_Arranger->SetSizer(itemBoxSizer_Arranger);
-        //Move Up button
-        wxButton* itemButton_MoveUp = new wxButton(itemPanel_Arranger, wxID_UP, _("&Up"),
-        itemBoxSizer_Arranger->Add(itemButton_MoveUp, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-        itemButton_MoveUp -> SetToolTip (_("Move Up"));
+    //Move Up button
+    wxButton* itemButton_MoveUp = new wxButton(itemPanel_Arranger, wxID_UP, _("&Up"),
+    itemBoxSizer_Arranger->Add(itemButton_MoveUp, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    itemButton_MoveUp -> SetToolTip (_("Move Up"));
-        //Move down button
-        wxButton* itemButton_MoveDown = new wxButton(itemPanel_Arranger, wxID_DOWN, _("&Down"),
-        itemBoxSizer_Arranger->Add(itemButton_MoveDown, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-        itemButton_MoveDown -> SetToolTip (_("Move &Down"));
+    //Move down button
+    wxButton* itemButton_MoveDown = new wxButton(itemPanel_Arranger, wxID_DOWN, _("&Down"),
+    itemBoxSizer_Arranger->Add(itemButton_MoveDown, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    itemButton_MoveDown -> SetToolTip (_("Move &Down"));
-        //Standard MMEX CSV
-        wxButton* itemButton_standard = new wxButton(itemPanel_Arranger, wxID_STANDARD, _("&MMEX format"),
-        itemBoxSizer_Arranger->Add(itemButton_standard, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-        itemButton_standard->SetToolTip(_("MMEX standard format"));
-        //Load Template button
-        wxButton* itemButton_Load = new wxButton(itemPanel_Arranger, wxID_OPEN, _("&Open"),
-        itemBoxSizer_Arranger->Add(itemButton_Load, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-        itemButton_Load -> SetToolTip (_("Load Template"));
+    //Standard MMEX CSV
+    wxButton* itemButton_standard = new wxButton(itemPanel_Arranger, wxID_STANDARD, _("&MMEX format"),
+    itemBoxSizer_Arranger->Add(itemButton_standard, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    itemButton_standard->SetToolTip(_("MMEX standard format"));
+    //Load Template button
+    wxButton* itemButton_Load = new wxButton(itemPanel_Arranger, wxID_OPEN, _("&Open"),
+    itemBoxSizer_Arranger->Add(itemButton_Load, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    itemButton_Load -> SetToolTip (_("Load Template"));
-        //Save As Template button
-        wxButton* itemButton_Save = new wxButton(itemPanel_Arranger, wxID_SAVEAS, _("Save &As..."),
-        itemBoxSizer_Arranger->Add(itemButton_Save, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-        itemButton_Save -> SetToolTip (_("Save Template"));
+    //Save As Template button
+    wxButton* itemButton_Save = new wxButton(itemPanel_Arranger, wxID_SAVEAS, _("Save As..."),
+    itemBoxSizer_Arranger->Add(itemButton_Save, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    itemButton_Save -> SetToolTip (_("Save Template"));
-        wxStaticLine*  m_staticline1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
-        itemBoxSizer2->Add(m_staticline1, 0, wxEXPAND | wxALL, 5 );
+    wxStaticLine*  m_staticline1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
+    itemBoxSizer2->Add(m_staticline1, 0, wxEXPAND | wxALL, 5 );
+    if (this->is_importer_)
//file to import, file path and search button
wxPanel* itemPanel6 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
itemBoxSizer2->Add(itemPanel6, 0, wxEXPAND|wxALL, 1);
itemBoxSizer7->Add(button_search, 0, wxALIGN_RIGHT|wxALL, 5);
-    // account to import
+    // account to import or export
wxPanel* itemPanel7 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
itemBoxSizer2->Add(itemPanel7, 0, wxEXPAND|wxALL, 1);
itemBoxSizer8->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString as = core_->getAccountsName();
-    m_choice_account_ = new wxChoice(itemPanel7, wxID_ANY, wxDefaultPosition, wxSize(210, -1), as, 0);
+    m_choice_account_ = new wxChoice(itemPanel7, wxID_ACCOUNT, wxDefaultPosition, wxSize(210, -1), as, 0);
m_choice_account_->SetSelection(0);
itemBoxSizer8->Add(m_choice_account_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
@@ -256,15 +257,12 @@
itemBoxSizer2->Add(m_radio_box_, 0, wxALL|wxEXPAND, 5);
-        // Preview
-        wxStaticBoxSizer* m_staticbox = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _T("&Preview")), wxVERTICAL);
+    // Preview
+    wxStaticBoxSizer* m_staticbox = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _T("&Preview")), wxVERTICAL);
-        m_list_ctrl_ = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 100), wxLC_REPORT);
-        m_staticbox->Add(m_list_ctrl_, 1, wxGROW|wxALL, 5);
-        itemBoxSizer2->Add(m_staticbox, 0, wxALL|wxEXPAND, 5);
+    m_list_ctrl_ = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 100), wxLC_REPORT);
+    m_staticbox->Add(m_list_ctrl_, 1, wxGROW|wxALL, 5);
+    itemBoxSizer2->Add(m_staticbox, 0, wxALL|wxEXPAND, 5);
//Import File button
wxPanel* itemPanel5 = new wxPanel(this, ID_PANEL10,
@@ -646,7 +644,7 @@
if (countImported > 0)
msg << _ ("Imported transactions have been flagged so you can review them.");
if (!canceledbyuser)
@@ -704,18 +702,52 @@
it != core_->bTransactionList_.transactions_.end();
++ it)
-            boost::shared_ptr<const mmBankTransaction> pBankTransaction = *it;
+            const mmBankTransaction* pBankTransaction = it->get();
if (pBankTransaction && pBankTransaction->accountID_ == fromAccountID)
if (pBankTransaction->transType_ == TRANS_TYPE_TRANSFER_STR) continue; //TODO
+                double amount = pBankTransaction->transType_ == TRANS_TYPE_DEPOSIT_STR ? pBankTransaction->amt_ : - pBankTransaction->amt_;
+                for (std::vector<int>::const_iterator sit = csvFieldOrder_.begin(); sit != csvFieldOrder_.end(); ++ sit)
+                    switch (*sit)
+                        case UNIV_CSV_DATE:
+                            text << pBankTransaction->dateStr_;
+                        case UNIV_CSV_PAYEE:
+                            text << inQuotes(pBankTransaction->payeeStr_);
+                        case UNIV_CSV_AMOUNT:
+                            text << amount;
+                        case UNIV_CSV_CATEGORY:
+                            text << inQuotes(pBankTransaction->catStr_);
+                        case UNIV_CSV_SUBCATEGORY:
+                            text << inQuotes(pBankTransaction->subCatStr_);
+                        case UNIV_CSV_TRANSNUM:
+                            text << pBankTransaction->transNum_;
+                        case UNIV_CSV_NOTES:
+                            text << inQuotes(pBankTransaction->notes_);
+                        case UNIV_CSV_WITHDRAWAL:
+                            text << (amount > 0 ? 0.0 : amount);
+                        case UNIV_CSV_DEPOSIT:
+                            text << (amount > 0 ? amount : 0);
+                        case UNIV_CSV_DONTCARE:
+                    text << delimit;
-                text << pBankTransaction->dateStr_ << delimit
-                    << inQuotes(pBankTransaction->payeeStr_) << delimit
-                    << (pBankTransaction->transType_ == TRANS_TYPE_DEPOSIT_STR ? pBankTransaction->amt_ : - pBankTransaction->amt_) << delimit
-                    << inQuotes(pBankTransaction->catStr_) << delimit
-                    << inQuotes(pBankTransaction->subCatStr_) << delimit
-                    << pBankTransaction->transNum_ << delimit
-                    << inQuotes(pBankTransaction->notes_) << endl;
+                text << endl;
++ numRecords;
@@ -728,7 +760,6 @@
void mmUnivCSVDialog::update_preview()
-    if (! this->is_importer_) return;
this->m_list_ctrl_->ClearAll();
this->m_list_ctrl_->InsertColumn(index, _("#"));
@@ -738,43 +769,122 @@
this->m_list_ctrl_->InsertColumn(index, this->getCSVFieldName(*it));
-    wxString fileName = m_text_ctrl_->GetValue();
-    if (!fileName.IsEmpty())
+    //TODO re use code in OnImport & OnExport
-        wxTextFile tFile(fileName);
-        if (!tFile.Open())
+        wxString fileName = m_text_ctrl_->GetValue();
+        if (!fileName.IsEmpty())
-             wxMessageBox(_("Unable to open file."), _("Universal CSV Import"), wxICON_WARNING);
+            wxTextFile tFile(fileName);
+            if (!tFile.Open())
+                 wxMessageBox(_("Unable to open file."), _("Universal CSV Import"), wxICON_WARNING);
+            wxString delimit = this->delimit_;
+            wxString line;
+            size_t count = 0;
+            for (line = tFile.GetFirstLine(); !tFile.Eof(); line = tFile.GetNextLine())
+                wxStringTokenizer tkz(line, delimit, wxTOKEN_RET_EMPTY_ALL);
+                int col = 0;
+                wxString buf;
+                buf.Printf(_T("%d"), col);
+                long itemIndex = m_list_ctrl_->InsertItem(row, buf, 0);
+                buf.Printf(_T("%d"), row + 1);
+                m_list_ctrl_->SetItem(itemIndex, col, buf);
+                while (tkz.HasMoreTokens())
+                    ++ col;
+                    wxString token = tkz.GetNextToken();
+                    if (col >= m_list_ctrl_->GetColumnCount())
+                        m_list_ctrl_->SetItem(itemIndex, col, token);
+                if (++ count >= 10) break;
+                ++ row;
+    else // exporter preview
+        wxString acctName = m_choice_account_->GetStringSelection();
+        int fromAccountID = core_->getAccountID(acctName);
-        wxString delimit = this->delimit_;
-        wxString line;
-        size_t count = 0;
-        int row = 0;
-        for (line = tFile.GetFirstLine(); !tFile.Eof(); line = tFile.GetNextLine())
+        if (fromAccountID > 0)
-            wxStringTokenizer tkz(line, delimit, wxTOKEN_RET_EMPTY_ALL);
-            wxString buf;
-            buf.Printf(_T("%d"), col);
-            long itemIndex = m_list_ctrl_->InsertItem(row, buf, 0);
-            buf.Printf(_T("%d"), row + 1);
-            m_list_ctrl_->SetItem(itemIndex, col, buf);
-            while (tkz.HasMoreTokens())
+            for(std::vector< boost::shared_ptr<mmBankTransaction> >::const_iterator it = core_->bTransactionList_.transactions_.begin();
+                it != core_->bTransactionList_.transactions_.end();
+                ++ it)
-                ++ col;
-                wxString token = tkz.GetNextToken();
+                const mmBankTransaction* pBankTransaction = it->get();
+                if (pBankTransaction && pBankTransaction->accountID_ == fromAccountID)
+                    if (pBankTransaction->transType_ == TRANS_TYPE_TRANSFER_STR) continue; //TODO
+                    double amount = pBankTransaction->transType_ == TRANS_TYPE_DEPOSIT_STR ? pBankTransaction->amt_ : - pBankTransaction->amt_;
-                if (col >= m_list_ctrl_->GetColumnCount())
-                    m_list_ctrl_->SetItem(itemIndex, col, token);
+                    int col = 0;
+                    wxString buf;
+                    buf.Printf(_T("%d"), col);
+                    long itemIndex = m_list_ctrl_->InsertItem(row, buf, 0);
+                    buf.Printf(_T("%d"), row + 1);
+                    m_list_ctrl_->SetItem(itemIndex, col, buf);
+                    for (std::vector<int>::const_iterator sit = csvFieldOrder_.begin(); sit != csvFieldOrder_.end(); ++ sit)
+                        ++ col;
+                        wxString text;
+                        switch (*sit)
+                            case UNIV_CSV_DATE:
+                                text << pBankTransaction->dateStr_;
+                            case UNIV_CSV_PAYEE:
+                                text << inQuotes(pBankTransaction->payeeStr_);
+                            case UNIV_CSV_AMOUNT:
+                                text << amount;
+                            case UNIV_CSV_CATEGORY:
+                                text << inQuotes(pBankTransaction->catStr_);
+                            case UNIV_CSV_SUBCATEGORY:
+                                text << inQuotes(pBankTransaction->subCatStr_);
+                            case UNIV_CSV_TRANSNUM:
+                                text << pBankTransaction->transNum_;
+                            case UNIV_CSV_NOTES:
+                                text << inQuotes(pBankTransaction->notes_);
+                            case UNIV_CSV_WITHDRAWAL:
+                                text << (amount > 0 ? 0.0 : amount);
+                            case UNIV_CSV_DEPOSIT:
+                                text << (amount > 0 ? amount : 0);
+                            case UNIV_CSV_DONTCARE:
+                       if (col >= m_list_ctrl_->GetColumnCount())
+                            m_list_ctrl_->SetItem(itemIndex, col, text);
+                    if (++ count >= 10) break;
+                    ++ row;
-            if (++ count >= 10) break;
-            ++ row;
@@ -824,15 +934,15 @@
int standard[] = {UNIV_CSV_DATE, UNIV_CSV_PAYEE, UNIV_CSV_AMOUNT, UNIV_CSV_CATEGORY, UNIV_CSV_SUBCATEGORY, UNIV_CSV_TRANSNUM, UNIV_CSV_NOTES};
for (int i = 0; i < sizeof(standard)/sizeof(UNIV_CSV_DATE); ++ i)
-        csvListBox_->Append(CSVFieldName_[i], new mmListBoxItem(i, CSVFieldName_[i]));
-        csvFieldOrder_.push_back(i);
+        csvListBox_->Append(CSVFieldName_[standard[i]], new mmListBoxItem(standard[i], CSVFieldName_[standard[i]]));
+        csvFieldOrder_.push_back(standard[i]);
csvFieldCandicate_->Clear();
int rest[] = {UNIV_CSV_DONTCARE, UNIV_CSV_WITHDRAWAL, UNIV_CSV_DEPOSIT};
for (int i = 0; i < sizeof(rest)/sizeof(UNIV_CSV_DATE); ++ i)
-        csvFieldCandicate_->Append(CSVFieldName_[i], new mmListBoxItem(i, CSVFieldName_[i]));
+        csvFieldCandicate_->Append(CSVFieldName_[rest[i]], new mmListBoxItem(rest[i], CSVFieldName_[rest[i]]));
update_preview();
@@ -849,6 +959,15 @@
+void mmUnivCSVDialog::OnAccountChange(wxCommandEvent& event)
+    int sel = event.GetInt();
+    if (sel != wxNOT_FOUND)
+        update_preview();
void mmUnivCSVDialog::OnListBox(wxCommandEvent& event)
int sel = event.GetInt();
--- trunk/mmex/src/univcsvdialog.h	2012-02-21 13:32:04 UTC (rev 1857)
+++ trunk/mmex/src/univcsvdialog.h	2012-02-21 14:57:46 UTC (rev 1858)
#define wxID_SEARCH 10100
#define wxID_RADIO_BOX 10101
#define wxID_STANDARD 10102
+#define wxID_ACCOUNT 10103
void OnMoveDown(wxCommandEvent& event);
void OnStandard(wxCommandEvent& event);
void OnSearch(wxCommandEvent& event);
+    void OnAccountChange(wxCommandEvent& event);
void OnListBox(wxCommandEvent& event);
void OnCheckOrRadioBox(wxCommandEvent& event);
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1857]
From: <guanlisheng@us...> - 2012-02-21 13:32:10
Revision: 1857
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1857&view=rev
Date:     2012-02-21 13:32:04 +0000 (Tue, 21 Feb 2012)
--- trunk/mmex/src/univcsvdialog.cpp	2012-02-21 09:58:01 UTC (rev 1856)
+++ trunk/mmex/src/univcsvdialog.cpp	2012-02-21 13:32:04 UTC (rev 1857)
@@ -819,30 +819,23 @@
void mmUnivCSVDialog::OnStandard(wxCommandEvent& /*event*/)
-   csvListBox_->Clear();
-   csvListBox_->Append(CSVFieldName_[UNIV_CSV_DATE], new mmListBoxItem(UNIV_CSV_DATE, CSVFieldName_[UNIV_CSV_DATE]));
-   csvListBox_->Append(CSVFieldName_[UNIV_CSV_PAYEE], new mmListBoxItem(UNIV_CSV_PAYEE, CSVFieldName_[UNIV_CSV_PAYEE]));
-   csvListBox_->Append(CSVFieldName_[UNIV_CSV_AMOUNT], new mmListBoxItem(UNIV_CSV_AMOUNT, CSVFieldName_[UNIV_CSV_AMOUNT]));
-   csvListBox_->Append(CSVFieldName_[UNIV_CSV_CATEGORY], new mmListBoxItem(UNIV_CSV_CATEGORY, CSVFieldName_[UNIV_CSV_CATEGORY]));
-   csvListBox_->Append(CSVFieldName_[UNIV_CSV_SUBCATEGORY], new mmListBoxItem(UNIV_CSV_SUBCATEGORY, CSVFieldName_[UNIV_CSV_SUBCATEGORY]));
-   csvListBox_->Append(CSVFieldName_[UNIV_CSV_TRANSNUM], new mmListBoxItem(UNIV_CSV_TRANSNUM, CSVFieldName_[UNIV_CSV_TRANSNUM]));
-   csvListBox_->Append(CSVFieldName_[UNIV_CSV_NOTES], new mmListBoxItem(UNIV_CSV_NOTES, CSVFieldName_[UNIV_CSV_NOTES]));
+    csvListBox_->Clear();
+    csvFieldOrder_.clear();
+    int standard[] = {UNIV_CSV_DATE, UNIV_CSV_PAYEE, UNIV_CSV_AMOUNT, UNIV_CSV_CATEGORY, UNIV_CSV_SUBCATEGORY, UNIV_CSV_TRANSNUM, UNIV_CSV_NOTES};
+    for (int i = 0; i < sizeof(standard)/sizeof(UNIV_CSV_DATE); ++ i)
+        csvListBox_->Append(CSVFieldName_[i], new mmListBoxItem(i, CSVFieldName_[i]));
+        csvFieldOrder_.push_back(i);
-   csvFieldOrder_.clear();
-   csvFieldOrder_.push_back(UNIV_CSV_DATE);
-   csvFieldOrder_.push_back(UNIV_CSV_PAYEE);
-   csvFieldOrder_.push_back(UNIV_CSV_AMOUNT);
-   csvFieldOrder_.push_back(UNIV_CSV_CATEGORY);
-   csvFieldOrder_.push_back(UNIV_CSV_SUBCATEGORY);
-   csvFieldOrder_.push_back(UNIV_CSV_TRANSNUM);
-   csvFieldOrder_.push_back(UNIV_CSV_NOTES);
-   csvFieldCandicate_->Clear();
-   csvFieldCandicate_->Append(CSVFieldName_[UNIV_CSV_DONTCARE], new mmListBoxItem(UNIV_CSV_DONTCARE, CSVFieldName_[UNIV_CSV_DONTCARE]));
-   csvFieldCandicate_->Append(CSVFieldName_[UNIV_CSV_WITHDRAWAL], new mmListBoxItem(UNIV_CSV_WITHDRAWAL, CSVFieldName_[UNIV_CSV_DEPOSIT]));
-   csvFieldCandicate_->Append(CSVFieldName_[UNIV_CSV_DEPOSIT], new mmListBoxItem(UNIV_CSV_DEPOSIT, CSVFieldName_[UNIV_CSV_DEPOSIT]));
-   update_preview();
+    csvFieldCandicate_->Clear();
+    int rest[] = {UNIV_CSV_DONTCARE, UNIV_CSV_WITHDRAWAL, UNIV_CSV_DEPOSIT};
+    for (int i = 0; i < sizeof(rest)/sizeof(UNIV_CSV_DATE); ++ i)
+        csvFieldCandicate_->Append(CSVFieldName_[i], new mmListBoxItem(i, CSVFieldName_[i]));
+    update_preview();
void mmUnivCSVDialog::OnSearch(wxCommandEvent& /*event*/)
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1856]
From: <guanlisheng@us...> - 2012-02-21 09:58:07
Revision: 1856
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1856&view=rev
Date:     2012-02-21 09:58:01 +0000 (Tue, 21 Feb 2012)
typo fix and MMEX format selection
--- trunk/mmex/src/univcsvdialog.cpp	2012-02-20 09:05:59 UTC (rev 1855)
+++ trunk/mmex/src/univcsvdialog.cpp	2012-02-21 09:58:01 UTC (rev 1856)
EVT_BUTTON(wxID_SAVEAS, mmUnivCSVDialog::OnSave)
EVT_BUTTON(wxID_UP, mmUnivCSVDialog::OnMoveUp)
+    EVT_BUTTON(wxID_STANDARD, mmUnivCSVDialog::OnStandard)
@@ -143,11 +144,11 @@
itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);
-        csvFiledCandicate_ = new wxListBox(this, ID_LISTBOX_CANDICATE,
+        csvFieldCandicate_ = new wxListBox(this, ID_LISTBOX_CANDICATE,
wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE|wxLB_NEEDED_SB);
-        itemBoxSizer3->Add(csvFiledCandicate_, 1, wxGROW|wxALL, 1);
+        itemBoxSizer3->Add(csvFieldCandicate_, 1, wxGROW|wxALL, 1);
for(std::map<int, wxString>::const_iterator it = CSVFieldName_.begin(); it != CSVFieldName_.end(); it ++)
-            csvFiledCandicate_->Append(it->second, new mmListBoxItem(it->first, it->second));
+            csvFieldCandicate_->Append(it->second, new mmListBoxItem(it->first, it->second));
//Add Remove Area
wxPanel* itemPanel_AddRemove = new wxPanel(this, ID_PANEL10,
@@ -191,6 +192,12 @@
itemBoxSizer_Arranger->Add(itemButton_MoveDown, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemButton_MoveDown -> SetToolTip (_("Move &Down"));
+        //Standard MMEX CSV
+        wxButton* itemButton_standard = new wxButton(itemPanel_Arranger, wxID_STANDARD, _("&MMEX format"),
+            wxDefaultPosition, wxDefaultSize, 0);
+        itemBoxSizer_Arranger->Add(itemButton_standard, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+        itemButton_standard->SetToolTip(_("MMEX standard format"));
//Load Template button
wxButton* itemButton_Load = new wxButton(itemPanel_Arranger, wxID_OPEN, _("&Open"),
@@ -305,21 +312,21 @@
//Selection dialog for fields to be added to listbox
void mmUnivCSVDialog::OnAdd(wxCommandEvent& /*event*/)
-    int index = csvFiledCandicate_->GetSelection();
+    int index = csvFieldCandicate_->GetSelection();
if (index != wxNOT_FOUND)
-        mmListBoxItem* item = (mmListBoxItem*)csvFiledCandicate_->GetClientObject(index);
+        mmListBoxItem* item = (mmListBoxItem*)csvFieldCandicate_->GetClientObject(index);
csvListBox_->Append(item->getName(), new mmListBoxItem(item->getIndex(), item->getName()));
csvFieldOrder_.push_back(item->getIndex());
if (item->getIndex() != UNIV_CSV_DONTCARE)
-            csvFiledCandicate_->Delete(index);
-            if (index < (int)csvFiledCandicate_->GetCount())
-                csvFiledCandicate_->SetSelection(index, true);
+            csvFieldCandicate_->Delete(index);
+            if (index < (int)csvFieldCandicate_->GetCount())
+                csvFieldCandicate_->SetSelection(index, true);
-                csvFiledCandicate_->SetSelection(csvFiledCandicate_->GetCount() - 1, true);
+                csvFieldCandicate_->SetSelection(csvFieldCandicate_->GetCount() - 1, true);
this->update_preview();
@@ -339,13 +346,13 @@
if (item_index != UNIV_CSV_DONTCARE)
-            for (pos = 0; pos < (int)csvFiledCandicate_->GetCount() - 1; pos ++)
+            for (pos = 0; pos < (int)csvFieldCandicate_->GetCount() - 1; pos ++)
-                mmListBoxItem *item = (mmListBoxItem*)csvFiledCandicate_->GetClientObject(pos);
+                mmListBoxItem *item = (mmListBoxItem*)csvFieldCandicate_->GetClientObject(pos);
if (item_index < item->getIndex())
-            csvFiledCandicate_->Insert(item_name, pos, new mmListBoxItem(item_index, item_name));
+            csvFieldCandicate_->Insert(item_name, pos, new mmListBoxItem(item_index, item_name));
csvListBox_->Delete(index);
@@ -405,13 +412,13 @@
csvFieldOrder_.push_back(num);
-      // update csvFiledCandicate_
-      csvFiledCandicate_->Clear();
+      // update csvFieldCandicate_
+      csvFieldCandicate_->Clear();
for (std::map<int, wxString>::const_iterator it = CSVFieldName_.begin(); it != CSVFieldName_.end(); ++ it)
std::vector<int>::const_iterator loc = find(csvFieldOrder_.begin(), csvFieldOrder_.end(), it->first);
if (loc == csvFieldOrder_.end() || it->first == UNIV_CSV_DONTCARE)
-              csvFiledCandicate_->Append(it->second, new mmListBoxItem(it->first, it->second));
+              csvFieldCandicate_->Append(it->second, new mmListBoxItem(it->first, it->second));
tFile.Write();
@@ -810,6 +817,34 @@
+void mmUnivCSVDialog::OnStandard(wxCommandEvent& /*event*/)
+   csvListBox_->Clear();
+   csvListBox_->Append(CSVFieldName_[UNIV_CSV_DATE], new mmListBoxItem(UNIV_CSV_DATE, CSVFieldName_[UNIV_CSV_DATE]));
+   csvListBox_->Append(CSVFieldName_[UNIV_CSV_PAYEE], new mmListBoxItem(UNIV_CSV_PAYEE, CSVFieldName_[UNIV_CSV_PAYEE]));
+   csvListBox_->Append(CSVFieldName_[UNIV_CSV_AMOUNT], new mmListBoxItem(UNIV_CSV_AMOUNT, CSVFieldName_[UNIV_CSV_AMOUNT]));
+   csvListBox_->Append(CSVFieldName_[UNIV_CSV_CATEGORY], new mmListBoxItem(UNIV_CSV_CATEGORY, CSVFieldName_[UNIV_CSV_CATEGORY]));
+   csvListBox_->Append(CSVFieldName_[UNIV_CSV_SUBCATEGORY], new mmListBoxItem(UNIV_CSV_SUBCATEGORY, CSVFieldName_[UNIV_CSV_SUBCATEGORY]));
+   csvListBox_->Append(CSVFieldName_[UNIV_CSV_TRANSNUM], new mmListBoxItem(UNIV_CSV_TRANSNUM, CSVFieldName_[UNIV_CSV_TRANSNUM]));
+   csvListBox_->Append(CSVFieldName_[UNIV_CSV_NOTES], new mmListBoxItem(UNIV_CSV_NOTES, CSVFieldName_[UNIV_CSV_NOTES]));
+   csvFieldOrder_.clear();
+   csvFieldOrder_.push_back(UNIV_CSV_DATE);
+   csvFieldOrder_.push_back(UNIV_CSV_PAYEE);
+   csvFieldOrder_.push_back(UNIV_CSV_AMOUNT);
+   csvFieldOrder_.push_back(UNIV_CSV_CATEGORY);
+   csvFieldOrder_.push_back(UNIV_CSV_SUBCATEGORY);
+   csvFieldOrder_.push_back(UNIV_CSV_TRANSNUM);
+   csvFieldOrder_.push_back(UNIV_CSV_NOTES);
+   csvFieldCandicate_->Clear();
+   csvFieldCandicate_->Append(CSVFieldName_[UNIV_CSV_DONTCARE], new mmListBoxItem(UNIV_CSV_DONTCARE, CSVFieldName_[UNIV_CSV_DONTCARE]));
+   csvFieldCandicate_->Append(CSVFieldName_[UNIV_CSV_WITHDRAWAL], new mmListBoxItem(UNIV_CSV_WITHDRAWAL, CSVFieldName_[UNIV_CSV_DEPOSIT]));
+   csvFieldCandicate_->Append(CSVFieldName_[UNIV_CSV_DEPOSIT], new mmListBoxItem(UNIV_CSV_DEPOSIT, CSVFieldName_[UNIV_CSV_DEPOSIT]));
+   update_preview();
wxString fileName = wxFileSelector(_("Choose CSV data file to import"),
--- trunk/mmex/src/univcsvdialog.h	2012-02-20 09:05:59 UTC (rev 1855)
+++ trunk/mmex/src/univcsvdialog.h	2012-02-21 09:58:01 UTC (rev 1856)
#define ID_LISTBOX_CANDICATE 10099
+#define wxID_STANDARD 10102
void OnSave(wxCommandEvent& event);
void OnMoveUp(wxCommandEvent& event);
+    void OnStandard(wxCommandEvent& event);
bool is_importer_;
wxSQLite3Database* db_;
std::vector<int> csvFieldOrder_;
-    wxListBox* csvFiledCandicate_;
+    wxListBox* csvFieldCandicate_;
wxListBox* csvListBox_;
wxButton* m_button_add_;
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1855]
From: <guanlisheng@us...> - 2012-02-20 09:06:10
Revision: 1855
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1855&view=rev
Date:     2012-02-20 09:05:59 +0000 (Mon, 20 Feb 2012)
format and cleanup
--- trunk/mmex/src/util.cpp	2012-02-20 07:43:40 UTC (rev 1854)
+++ trunk/mmex/src/util.cpp	2012-02-20 09:05:59 UTC (rev 1855)
@@ -890,23 +890,22 @@
-int getTransformedTrxStatus(wxString in)
+int getTransformedTrxStatus(const wxString& in)
-    wxString statusStr = in;
-    if (statusStr == wxT("R"))
+    if (in == wxT("R"))
out = (DEF_STATUS_RECONCILED);
-    else if (statusStr == wxT("V"))
+    else if (in == wxT("V"))
out = (DEF_STATUS_VOID);
-    else if (statusStr == wxT("F"))
+    else if (in == wxT("F"))
out = (DEF_STATUS_FOLLOWUP);
-    else if (statusStr == wxT("D"))
+    else if (in == wxT("D"))
out = (DEF_STATUS_DUPLICATE);
--- trunk/mmex/src/util.h	2012-02-20 07:43:40 UTC (rev 1854)
+++ trunk/mmex/src/util.h	2012-02-20 09:05:59 UTC (rev 1855)
}; // namespace DateTimeProviders
-int getTransformedTrxStatus(wxString in);
+int getTransformedTrxStatus(const wxString& in);
wxString getTransformedTrxStatus(int in);
wxString Tips(wxString type);
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1854]
trunk/mmex/src/mmhelppanel.cpp
From: <guanlisheng@us...> - 2012-02-20 07:43:47
Revision: 1854
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1854&view=rev
Date:     2012-02-20 07:43:40 +0000 (Mon, 20 Feb 2012)
Modified: trunk/mmex/src/mmhelppanel.cpp
--- trunk/mmex/src/mmhelppanel.cpp	2012-02-20 07:00:17 UTC (rev 1853)
+++ trunk/mmex/src/mmhelppanel.cpp	2012-02-20 07:43:40 UTC (rev 1854)
#include "mmhelppanel.h"
#include "reportbase.h"
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1853]
trunk/mmex/src/mmreportspanel.cpp
From: <guanlisheng@us...> - 2012-02-20 07:00:28
Revision: 1853
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1853&view=rev
Date:     2012-02-20 07:00:17 +0000 (Mon, 20 Feb 2012)
Modified: trunk/mmex/src/mmreportspanel.cpp
--- trunk/mmex/src/mmreportspanel.cpp	2012-02-20 06:56:15 UTC (rev 1852)
+++ trunk/mmex/src/mmreportspanel.cpp	2012-02-20 07:00:17 UTC (rev 1853)
#include "mmreportspanel.h"
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1852]
From: <guanlisheng@us...> - 2012-02-20 06:56:26
Revision: 1852
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1852&view=rev
Date:     2012-02-20 06:56:15 +0000 (Mon, 20 Feb 2012)
trunk/mmex/src/reportcategexp.cpp
trunk/mmex/src/reportincexpenses.cpp
trunk/mmex/src/reportpayee.cpp
trunk/mmex/src/reporttransstats.cpp
--- trunk/mmex/src/reportcashflow.cpp	2012-02-20 05:56:12 UTC (rev 1851)
+++ trunk/mmex/src/reportcashflow.cpp	2012-02-20 06:56:15 UTC (rev 1852)
mmReportCashFlow::mmReportCashFlow(mmCoreDB* core, const wxArrayString* accountArray) :
mmPrintableBase(core),
Modified: trunk/mmex/src/reportcategexp.cpp
--- trunk/mmex/src/reportcategexp.cpp	2012-02-20 05:56:12 UTC (rev 1851)
+++ trunk/mmex/src/reportcategexp.cpp	2012-02-20 06:56:15 UTC (rev 1852)
#include "mmgraphpie.h"
#include "reportbudget.h"
Modified: trunk/mmex/src/reportincexpenses.cpp
--- trunk/mmex/src/reportincexpenses.cpp	2012-02-20 05:56:12 UTC (rev 1851)
+++ trunk/mmex/src/reportincexpenses.cpp	2012-02-20 06:56:15 UTC (rev 1852)
#include "mmgraphincexpensesmonth.h"
Modified: trunk/mmex/src/reportpayee.cpp
--- trunk/mmex/src/reportpayee.cpp	2012-02-20 05:56:12 UTC (rev 1851)
+++ trunk/mmex/src/reportpayee.cpp	2012-02-20 06:56:15 UTC (rev 1852)
--- trunk/mmex/src/reporttransactions.cpp	2012-02-20 05:56:12 UTC (rev 1851)
+++ trunk/mmex/src/reporttransactions.cpp	2012-02-20 06:56:15 UTC (rev 1852)
#include "mmcheckingpanel.h"
#include "mmtransaction.h"
Modified: trunk/mmex/src/reporttransstats.cpp
--- trunk/mmex/src/reporttransstats.cpp	2012-02-20 05:56:12 UTC (rev 1851)
+++ trunk/mmex/src/reporttransstats.cpp	2012-02-20 06:56:15 UTC (rev 1852)
#include "budgetingpanel.h"
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1851]
trunk/mmex/src/fileviewerdialog.cpp
From: <guanlisheng@us...> - 2012-02-20 05:56:18
Revision: 1851
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1851&view=rev
Date:     2012-02-20 05:56:12 +0000 (Mon, 20 Feb 2012)
Modified: trunk/mmex/src/fileviewerdialog.cpp
--- trunk/mmex/src/fileviewerdialog.cpp	2012-02-19 14:28:25 UTC (rev 1850)
+++ trunk/mmex/src/fileviewerdialog.cpp	2012-02-20 05:56:12 UTC (rev 1851)
fileviewer::fileviewer(const wxString& fileName, wxWindow* parent,
wxWindowID id,const wxString& caption,
const wxPoint& pos, const wxSize& size, long style )
+: fileName_(fileName)
-    fileName_ = fileName;
@@ -51,18 +51,15 @@
void fileviewer::CreateControls()
-    fileviewer* itemDialog1 = this;
-    itemDialog1->SetSizer(itemBoxSizer2);
+    this->SetSizer(itemBoxSizer2);
-    wxTextCtrl *itemTextCtrl3 = new wxTextCtrl( itemDialog1,
+    wxTextCtrl *itemTextCtrl3 = new wxTextCtrl( this,
ID_TEXTCTRL_FILEVIEWER, wxT(""),
SYMBOL_FILEVIEWER_POSITION, SYMBOL_FILEVIEWER_SIZE,
wxTE_MULTILINE|wxTE_READONLY );
-    itemBoxSizer2->Add(itemTextCtrl3, 1,
-        wxALIGN_CENTER_HORIZONTAL|wxALL|wxGROW, 10);
+    itemBoxSizer2->Add(itemTextCtrl3, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxGROW, 10);
/* Load the Text from the file */
if ( !fileName_.empty() )
//Scroll to the top of file
itemTextCtrl3->SetInsertionPoint(0);
-    wxButton* itemButtonOK = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
+    wxButton* itemButtonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemButtonOK, 0, wxALIGN_RIGHT|wxALL, 4);
itemButtonOK->SetFocus();
[Moneymanagerex-commits] SF.net SVN: moneymanagerex:[1850]
From: <guanlisheng@us...> - 2012-02-19 14:28:31
Revision: 1850
http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1850&view=rev
Date:     2012-02-19 14:28:25 +0000 (Sun, 19 Feb 2012)
--- trunk/mmex/src/dbwrapper.cpp	2012-02-19 14:14:13 UTC (rev 1849)
+++ trunk/mmex/src/dbwrapper.cpp	2012-02-19 14:28:25 UTC (rev 1850)
@@ -1532,35 +1532,7 @@
-double mmDBWrapper::getSplitTransactionValueForCategory(wxSQLite3Database* db, int transID,
-                                                      int categID, int subcategID)
-    "select SPLITTRANSAMOUNT "
-    "from SPLITTRANSACTIONS_V1 "
-    "where CATEGID = ? and "
-          "SUBCATEGID = ? and "
-          "TRANSID = ?";
-    double amt = 0.0;
-    wxSQLite3Statement st = db->PrepareStatement(sql);
-    st.Bind(1, categID);
-    st.Bind(2, subcategID);
-    st.Bind(3, transID);
-    wxSQLite3ResultSet q1 = st.ExecuteQuery();
-    if (q1.NextRow())
-        amt = q1.GetDouble(wxT("SPLITTRANSAMOUNT"));
-    st.Finalize();
-    return amt;
wxArrayString mmDBWrapper::filterPayees(wxSQLite3Database* db, const wxString& patt)
wxSQLite3Statement st = db->PrepareStatement("select PAYEENAME from PAYEE_V1 where PAYEENAME LIKE ? ORDER BY PAYEENAME");
Modified: trunk/mmex/src/dbwrapper.h
--- trunk/mmex/src/dbwrapper.h	2012-02-19 14:14:13 UTC (rev 1849)
+++ trunk/mmex/src/dbwrapper.h	2012-02-19 14:28:25 UTC (rev 1850)
double getAssetBalance(wxSQLite3Database* db);
double getAssetValue(wxSQLite3Database* db, int assetID);
-/* Split Transaction API */
-double getSplitTransactionValueForCategory(wxSQLite3Database* db, int transID, int categID, int subcategID);

value: This website is a web service that offers software consumers a centralized online location to control and manage open-source software projects and research business software. It provides source code repository hosting, bug tracking, mirroring of downloads for load balancing, a wiki for documentation, developer and user mailing lists, user-support forums, user-written reviews and ratings, a news bulletin, micro-blog for publishing project updates, and other features.