GnuCash
Contact   Instructions
Bug 796614 - Reconciliation report contains incorrect transactions
Summary: Reconciliation report contains incorrect transactions
Status: REOPENED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Reports (show other bugs)
Version: 3.1
Hardware: Other Windows
: Normal normal
Target Milestone: future
Assignee: reports
QA Contact: reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-17 20:37 EDT by troysmith31
Modified: 2020-09-27 20:38 EDT (History)
5 users (show)

See Also:


Attachments
Screenshot of reconciliation report with error. (52.87 KB, image/png)
2018-06-17 20:37 EDT, troysmith31
no flags Details
Normal trace (1.54 KB, text/plain)
2018-06-19 15:38 EDT, troysmith31
no flags Details
--debug trace (472.05 KB, text/plain)
2018-06-19 15:39 EDT, troysmith31
no flags Details
--debug --extra trace (438.84 KB, text/plain)
2018-06-19 15:39 EDT, troysmith31
no flags Details
Normal trace2 (1.54 KB, text/plain)
2018-06-19 20:49 EDT, troysmith31
no flags Details
transaction.scm special build (100.55 KB, text/plain)
2018-06-21 01:14 EDT, Christopher Lam
no flags Details
Normal trace3 (1.75 KB, text/plain)
2018-06-21 21:37 EDT, troysmith31
no flags Details
render-options-changed and addto! inlined too (102.75 KB, application/octet-stream)
2018-06-21 21:42 EDT, Christopher Lam
no flags Details
Reconciliation screenshot (135.71 KB, image/jpeg)
2018-06-22 16:11 EDT, troysmith31
no flags Details

Description troysmith31 2018-06-17 20:37:17 EDT
Created attachment 372707 [details]
Screenshot of reconciliation report with error.

The reconciliation report contains incorrect transactions.  Please see attached for a screenshot of a reconciliation report from 2018-04-01 to 2018-04-30.  One transaction highlighted belong to the next month reconciliation as can be seen from the 2018-05-31 reconciled date.

There is one other transaction that should be on the report and is not present.  The transaction date is 2018-03-22 but was reconciled on 2018-04-30.

Hope this helps.
Comment 1 Christopher Lam 2018-06-17 22:20:32 EDT
Hello

The first thought is that this is by design... the date filter is, by default, applied to the posted date only.

However I think that applying date filter to the reconciled date wouldn't be too difficult. The filter would need to include all splits whereby the reconciled date falls within specified date, and also include splits whereby reconciled date doesn't exist.
Comment 2 Christopher Lam 2018-06-18 01:59:18 EDT
try https://raw.githubusercontent.com/christopherlam/gnucash/maint-fix-796614/gnucash/report/standard-reports/transaction.scm overwriting the same filename somewhere in c:\program files\gnucash folders
Comment 3 troysmith31 2018-06-18 15:19:54 EDT
I downloaded the file transaction.scm file and copied it to C:\Program Files (x86)\gnucash\share\gnucash\scm\gnucash\report\standard-reports folder.  The following error message was displayed after running the reconciliation report.

Report error

An error occurred wile running the report.
Comment 4 Christopher Lam 2018-06-19 06:31:52 EDT
please try again; if still fails please include tracefile
https://wiki.gnucash.org/wiki/Tracefile
Comment 5 troysmith31 2018-06-19 15:38:24 EDT
Created attachment 372724 [details]
Normal trace
Comment 6 troysmith31 2018-06-19 15:39:23 EDT
Created attachment 372725 [details]
--debug trace
Comment 7 troysmith31 2018-06-19 15:39:55 EDT
Created attachment 372726 [details]
--debug --extra trace
Comment 8 troysmith31 2018-06-19 15:41:11 EDT
I downloaded the transaction.scm file again and no change.

I attached the following tracefiles:

Normal trace:
gnucash.trace.043NKZ.log

--debug:
gnucash.trace.15W1KZ.log

--debub --extra
gnucash.trace.4QN1KZ.log
Comment 9 Christopher Lam 2018-06-19 19:29:14 EDT
The missing function is now in https://raw.githubusercontent.com/Gnucash/gnucash/maint/gnucash/report/report-system/html-utilities.scm 

As before, replace html-utilities.scm in your c:\program files\gnucash folder...
Comment 10 troysmith31 2018-06-19 20:49:31 EDT
Created attachment 372730 [details]
Normal trace2
Comment 11 troysmith31 2018-06-19 20:50:04 EDT
I downloaded the html-utilities.scm and copied it to the C:\Program Files (x86)\gnucash\share\gnucash\scm folder.  I am getting the same error.

I uploaded the following trace file for review:

gnucash.trace.SBW3KZ.log
Comment 12 Christopher Lam 2018-06-21 01:14:05 EDT
Created attachment 372739 [details]
transaction.scm special build

this is a crafted transaction.scm - will not be applied to code.
this contains gnc:render-options-changed inlined.
Comment 13 troysmith31 2018-06-21 21:37:25 EDT
Created attachment 372749 [details]
Normal trace3

The same report error observed, tracefile attached.
Comment 14 Christopher Lam 2018-06-21 21:42:46 EDT
Created attachment 372750 [details]
render-options-changed and addto! inlined too
Comment 15 troysmith31 2018-06-21 22:12:41 EDT
This version worked!

I was able to run the report for a one month period and the reconciled transactions now match!  Great Job Chris!

The report looks good with "Reconciled" selected in Report Options->Filter->Reconcile Status

However, when "All" or "Unreconciled" is selected for report options, every transaction in the database is displayed under the Unreconciled section of the report and I think this is undesirable.

I think the Unreconciled section should only contain transaction that were not reconciled before the reporting end period as in the original report.
Comment 16 Christopher Lam 2018-06-22 00:48:44 EDT
I can't reproduce this one. Make sure you test your sorting/filtering options.

The changes to this bug involve changing the split-date filter from Posted-Date to Reconciled-Date.

I'd think this can now be reviewed.
Comment 17 Christopher Lam 2018-06-22 03:32:09 EDT
I'm actually thinking that changing the date filtering strategy from posted-date to reconcile-date isn't such a great idea... the reconcile report displays the running balance by default (to mimic bank statement balance); this balance shows the running balance sorted by posted-date and will be completely jumbled up when sorting by reconcile-date.

So, I think either remove running balance completely, or do not merge this change.
Comment 18 troysmith31 2018-06-22 16:11:11 EDT
Created attachment 372778 [details]
Reconciliation screenshot

Remove the running balance because it is not necessary and unwanted.  The reconciliation report should mimic the attached screenshot and ideally include the following:

Date
Num
Description
Amount
Reconciled

Total income
Total expenses

Statement Date
Starting Balance
Ending Balance
Reconciled Balance
Difference

A reconciliation report should also contain the number of cleared transactions to quickly compare to the bank statement (used to quickly find errors)

The attached is and example of information I have to submit to an auditor for verification of a good reconciliation.  It would be my preference to produce a report in lieu of screenshots.
Comment 19 Christopher Lam 2018-06-23 06:07:08 EDT
Most of the desired information can be gleaned from the Reconcilation Report. Running Balances can & will be disabled if sorting by reconciled date.

So I'd submit the PR as is. The other fields are rather too specialised to calculate for now, and would require too complex change of transaction.scm
Comment 20 Christopher Lam 2018-06-23 09:08:51 EDT
https://github.com/Gnucash/gnucash/pull/376

Addendum the one change I've added is the 'funds in' and 'funds out' can be offered, with their own subtotals. But the other fields are rather difficult.
Comment 21 Christopher Lam 2018-06-30 12:16:01 EDT
will be fixed in 3.3
Comment 22 CDB-Man 2020-05-26 00:20:40 EDT
Relevant: I have started a new ticket bug 797772 that impacts this ticket.
Comment 23 Christopher Lam 2020-09-27 02:23:47 EDT
Strongly considering reverting this change.

Reasoning: the reconciled_date is a very inconsistently used field -- it may refer to the statement_date of reconciliation, or $today when downloading from AqBanking. Many users have resorted to *not* rely on this date to consider reconciliation data; they merely use the reconciled_status field.

Would any major devs or OP object (strongly) to reverting this change?

The OP request may be resolved as described in bug 797772 - sort by reconciled_status then sort by reconciled_date.

If (any only if) a separate sorting via reconciled_date is required, it *could* be implemented via option:

[x] Date filters on reconciled date rather than posted date.
Comment 24 CDB-Man 2020-09-27 20:38:51 EDT
Chris I agree with your points there, and your enhancement option suggestion.

Note You need to log in before you can comment on or make changes to this bug.