Commit 2c6a6b0a authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Show reconciliation history in ledger view

Reconciliation history is displayed when the "Show Reconciled Balances"
option is enabled in the "View" menu.

A new configuration variable called "ShowReconciledBalances" has been
introduced for the permanent setting, which is enabled by default.

BUG: 433662
FIXED-IN:5.1.2
parent e2314a55
......@@ -258,6 +258,20 @@
</listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo>&Ctrl;<keycap>B</keycap></keycombo>
</shortcut>
<guimenu>View</guimenu>
<guimenuitem>Show reconciled balances</guimenuitem>
</menuchoice></term>
<listitem>
<para><action>Show reconciled balances and the last reconciliation
milestone on the register.</action></para>
</listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
......
......@@ -153,6 +153,9 @@ const QHash<Icon, QHash<IconSet, QString> > iconMappings{
{ Icon::HideReconciled,
{{IconSet::Common, QStringLiteral("hide-reconciled")}}
},
{ Icon::ShowReconciledBalances,
{{IconSet::Breeze, QStringLiteral("gnumeric-autosum")}}
},
{Icon::KMyMoney, {{IconSet::Common, QStringLiteral("kmymoney")}}},
{ Icon::KeyEnter,
{ {IconSet::Common, QStringLiteral("input-keyboard")},
......
......@@ -31,6 +31,7 @@ enum class Icon { OpenDatabase, Merge, Reconcile, Split, Tip, PerformanceTest,
Pause, SeekForward,
SkipForward,
HideReconciled, HideCategories,
ShowReconciledBalances,
Home, Institution, Institutions,
Accounts,
Schedule, Tags,
......
......@@ -1386,6 +1386,7 @@ QHash<Action, QAction *> KMyMoneyApp::initActions()
// *************
{Action::ViewTransactionDetail, QStringLiteral("view_show_transaction_detail"), i18n("Show Transaction Detail"), Icon::TransactionDetails},
{Action::ViewHideReconciled, QStringLiteral("view_hide_reconciled_transactions"), i18n("Hide reconciled transactions"), Icon::HideReconciled},
{Action::ViewShowReconciledBalances, QStringLiteral("view_show_reconciled_balances"), i18n("Show reconciled balances"), Icon::ShowReconciledBalances},
{Action::ViewHideCategories, QStringLiteral("view_hide_unused_categories"), i18n("Hide unused categories"), Icon::HideCategories},
{Action::ViewShowAll, QStringLiteral("view_show_all_accounts"), i18n("Show all accounts"), Icon::Empty},
// *********************
......@@ -1530,6 +1531,7 @@ QHash<Action, QAction *> KMyMoneyApp::initActions()
// *************
{Action::ViewTransactionDetail, &KMyMoneyApp::slotShowTransactionDetail},
{Action::ViewHideReconciled, &KMyMoneyApp::slotHideReconciledTransactions},
{Action::ViewShowReconciledBalances, &KMyMoneyApp::slotShowReconciledBalances},
{Action::ViewHideCategories, &KMyMoneyApp::slotHideUnusedCategories},
{Action::ViewShowAll, &KMyMoneyApp::slotShowAllAccounts},
// **************
......@@ -1573,6 +1575,7 @@ QHash<Action, QAction *> KMyMoneyApp::initActions()
// so set them here
const QVector<Action> checkableActions {
Action::ViewTransactionDetail, Action::ViewHideReconciled, Action::ViewHideCategories,
Action::ViewShowReconciledBalances, Action::ViewHideCategories,
#ifdef KMM_DEBUG
Action::DebugTraces,
Action::DebugTimers,
......@@ -1635,6 +1638,7 @@ QHash<Action, QAction *> KMyMoneyApp::initActions()
// Setup transaction detail switch
lutActions[Action::ViewTransactionDetail]->setChecked(KMyMoneySettings::showRegisterDetailed());
lutActions[Action::ViewHideReconciled]->setChecked(KMyMoneySettings::hideReconciledTransactions());
lutActions[Action::ViewShowReconciledBalances]->setChecked(KMyMoneySettings::showReconciledBalances());
lutActions[Action::ViewHideCategories]->setChecked(KMyMoneySettings::hideUnusedCategory());
lutActions[Action::ViewShowAll]->setChecked(KMyMoneySettings::showAllAccounts());
......@@ -1777,6 +1781,7 @@ void KMyMoneyApp::readOptions()
pActions[Action::ViewHideReconciled]->setChecked(KMyMoneySettings::hideReconciledTransactions());
pActions[Action::ViewShowReconciledBalances]->setChecked(KMyMoneySettings::showReconciledBalances());
pActions[Action::ViewHideCategories]->setChecked(KMyMoneySettings::hideUnusedCategory());
d->m_recentFiles->loadEntries(d->m_config->group("Recent Files"));
......@@ -2016,6 +2021,12 @@ void KMyMoneyApp::slotHideReconciledTransactions()
d->m_myMoneyView->slotRefreshViews();
}
void KMyMoneyApp::slotShowReconciledBalances()
{
KMyMoneySettings::setShowReconciledBalances(pActions[Action::ViewShowReconciledBalances]->isChecked());
d->m_myMoneyView->slotRefreshViews();
}
void KMyMoneyApp::slotHideUnusedCategories()
{
KMyMoneySettings::setHideUnusedCategory(pActions[Action::ViewHideCategories]->isChecked());
......
......@@ -435,6 +435,11 @@ public Q_SLOTS:
*/
void slotHideReconciledTransactions();
/**
* Toggles the show reconciled balances setting
*/
void slotShowReconciledBalances();
/**
* Toggles the hide unused categories setting
*/
......
<!DOCTYPE kpartgui>
<kpartgui version="46" name="kmymoney" >
<kpartgui version="47" name="kmymoney" >
<MenuBar>
<Menu name="file" >
<DefineGroup name="open_db_group" append="open_merge"/>
......@@ -30,6 +30,7 @@
<Menu name="view" >
<Action name="view_show_transaction_detail" />
<Action name="view_hide_reconciled_transactions" />
<Action name="view_show_reconciled_balances" />
<Action name="view_hide_unused_categories" />
<Action name="view_show_all_accounts" />
</Menu>
......
......@@ -34,7 +34,7 @@ enum class Action {
// *************
// The view menu
// *************
ViewTransactionDetail, ViewHideReconciled,
ViewTransactionDetail, ViewHideReconciled, ViewShowReconciledBalances,
ViewHideCategories, ViewShowAll,
// *************
// The institution menu
......
......@@ -252,6 +252,10 @@
<label>Hide reconciled transactions</label>
<default>false</default>
</entry>
<entry name="ShowReconciledBalances" type="Bool">
<label>Show reconciled balances</label>
<default>true</default>
</entry>
<entry name="ShowRegisterDetailed" type="Bool">
<label>Show all register entries in full detail</label>
<default>false</default>
......
......@@ -1705,6 +1705,14 @@ void Register::addGroupMarkers()
if (d->m_account.lastReconciliationDate().isValid())
new KMyMoneyRegister::StatementGroupMarker(this, eRegister::CashFlowDirection::Deposit, d->m_account.lastReconciliationDate(), i18n("Last reconciliation"));
if (KMyMoneySettings::showReconciledBalances()) {
foreach(const QDate &date, d->m_account.reconciliationHistory().keys()) {
QString txt = i18n("Reconciled Balance: %1", d->m_account.reconciliationHistory()[date].formatMoney(d->m_account.fraction()));
new KMyMoneyRegister::StatementGroupMarker(this, eRegister::CashFlowDirection::Deposit, date, txt);
}
}
if (KMyMoneySettings::showFancyMarker()) {
if (!d->m_account.value("lastImportedTransactionDate").isEmpty()
&& !d->m_account.value("lastStatementBalance").isEmpty()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment