Skip to content

Commit 963a701

Browse files
committed
allow filtering for accounts in summary of accounts report
1 parent 5fc76ca commit 963a701

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/report/BalanceReport.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ wxString BalanceReport::getHTMLText()
129129
mmDate start_date = mmDate::today();
130130
// Calculate the report date
131131
for (const auto& account_d : AccountModel::instance().find_all()) {
132+
if (m_account_a && wxNOT_FOUND == m_account_a->Index(account_d.m_name))
133+
continue;
134+
132135
if (account_d.m_open_date < start_date)
133136
start_date = account_d.m_open_date;
134137
m_account_balance_mDate_mId[account_d.m_id] = loadAccountBalance_mDate(account_d);
@@ -182,6 +185,9 @@ wxString BalanceReport::getHTMLText()
182185
std::fill(balance_a.begin(), balance_a.end(), 0.0);
183186
int idx;
184187
for (const auto& account_d : AccountModel::instance().find_all()) {
188+
if (m_account_a && wxNOT_FOUND == m_account_a->Index(account_d.m_name))
189+
continue;
190+
185191
idx = mmNavigatorList::instance().getAccountTypeIdx(account_d.m_type_);
186192
if (idx == -1) {
187193
idx = mmNavigatorList::instance().getAccountTypeIdx(mmNavigatorItem::TYPE_ID_CHECKING);
@@ -300,6 +306,7 @@ wxString BalanceReport::getHTMLText()
300306
hb.endTable();
301307
}
302308
hb.endDiv();
309+
hb.displayFooter(getAccountNames());
303310

304311
hb.end();
305312

src/report/_ReportBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ void ReportBase::setReportParameters(ReportBase::REPORT_ID report_id)
5353

5454
switch (report_id) {
5555
case MyUsage: m_parameters = M_DATE_RANGE | M_CHART; break;
56-
case MonthlySummaryofAccounts: m_parameters = M_CHART; break;
57-
case YearlySummaryofAccounts: m_parameters = M_CHART; break;
56+
case MonthlySummaryofAccounts: m_parameters = M_ACCOUNT | M_CHART; break;
57+
case YearlySummaryofAccounts: m_parameters = M_ACCOUNT | M_CHART; break;
5858
case WheretheMoneyGoes: m_parameters = M_DATE_RANGE | M_ACCOUNT | M_CHART; break;
5959
case WheretheMoneyComesFrom: m_parameters = M_DATE_RANGE | M_ACCOUNT | M_CHART; break;
6060
case CategoriesSummary: m_parameters = M_DATE_RANGE | M_ACCOUNT | M_CHART; break;

0 commit comments

Comments
 (0)