New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 797640 - The Reconciliation Window starting balance calculator needs to ignore splits after statement date #660
Conversation
340b74b
to
948854e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the inline comments, you need to somehow compute the closing reconciled balance for the statement you're examining and to provide for displaying the splits that were reconciled in the statement being checked so that the reconcile window makes sense. The reconcile window currently displays only the splits that are unreconciled.
1f0e7ca
to
f056398
Compare
59d21af
to
9299a0a
Compare
7ba223c
to
a6a17f0
Compare
…eds to ignore splits after statement date
a6a17f0
to
f182d9f
Compare
That's not the ending balance I was thinking of. It defaults to the last regular balance on the day given and that's probably as close to right as it can be because there's no way for GnuCash to know which transactions are reflected in the bank's statement. The user is expected to replace that default with the amount on the statement. The ending balance I meant is the ending reconciled balance used to match the statement balance, and it will be the reconciled balance as of the end of the statement date using the new calculation from this PR. That leaves the display of the already-reconciled transactions. ISTM the display for an old statement should show both the unreconciled transactions and the transactions previously reconciled on the statement date so that the user can review the whole statement. One might go further and show also the transactions posted before the statement date that were reconciled later with some indication of that. |
I am not shure if it is useful in this context, but actions->online actions->get balance and some file formats like MT942 contain a balance. |
I guess you could store the balances in the Account's KVP. No, I mean Reconciled Balance. Ending Balance is what the user entered in the Reconcile Info dialog. |
Here's some further changes which fixes the suggested modified gnucash/gnome/window-reconcile.c
@@ -388,8 +388,8 @@ gnc_start_recn_date_changed (GtkWidget *widget, startRecnWindowData *data)
return;
new_date = gnc_date_edit_get_date_end (gde);
/* get the balance for the account as of the new date */
- new_balance = gnc_ui_account_get_balance_as_of_date (data->account, new_date,
- data->include_children);
+ new_balance = gnc_ui_account_get_reconciled_balance_as_of_date
+ (data->account, new_date, data->include_children);
/* update the amount edit with the amount */
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value),
new_balance); |
No, that would be wrong: Consider the normal situation where you're reconciling a just-arrived statement. This would make the proposed ending balance equal to the starting balance. The best default GnuCash can use is the cleared balance on the statement date if it's different from the starting balance, otherwise it should use the plain balance. That's the current behavior. |
I tried as follows but doesn't seem to produce good ending_balances. May be best wait for #667 to be completed then. https://github.com/Gnucash/gnucash/compare/maint...christopherlam:maint-reconcile-ending-balance?expand=1 |
Not surprising since you didn't test for inequality to the reconciled balance and fall back to balance-as-of-date. Did you create a test account with cleared but not reconciled splits to test with? |
adds a couple helper functions in account.cpp and gnc-ui-balances.c