GnuCash
Contact   Instructions
Bug 797089 - In the main Account Register window, the value shown under 'Total (Period)' excludes any transaction with date equal to the end date of the reporting period.
Summary: In the main Account Register window, the value shown under 'Total (Period)' e...
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Register (show other bugs)
Version: 2.6.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: ui
QA Contact: ui
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-05 03:14 EST by Nick
Modified: 2019-11-05 11:31 EST (History)
6 users (show)

See Also:


Attachments

Description Nick 2019-02-05 03:14:33 EST
GnuCash 2.6.21

In the main Account Register window, the value shown under 'Total (Period)' excludes any transaction with date equal to the end date of the reporting period.

Test case:

1. Specify accounting period:
Edit/Preferences/Accounting Period
- Start Date/Absolute = 2017-03-01
- End Date/Absolute = 2018-02-28

2. Create test transactions with dates equal to (1) start of specified accounting period and (2) end of specified accounting period:
Income account DUMMY
Txn TEST-START with date = 2017-03-01 and amount = 123
Txn TEST-END with date = 2018-02-28 and amount = 456

3. Run Income Statement report:
Options/General/Start Date = Start of accounting period
Options/General/End Date = End of accounting period  
Result: Balance of account DUMMY is 579, which is correct - it includes both of the test transaction amounts.

4. Display column Total (Period) in the main Account Register window,
Result: Balance of account DUMMY is shown as 123, which is incorrect - it should be 579, which is the amount shown (correctly) in the Income Statement report for the same period. The discrepancy is due to the fact that the amount shown does not  include the amount associated with txn TEST-END (456) with date equal to the end of the period. However, it does include the amount associated with txn TEST-START (123)  with date equal to the start of the period.    

5. Hypothesis:
The logic used in the calculation of Total (Period) is currently: 
Include transaction amount if transaction date is greater or equal to start date of accounting period and LESS THAN than end date of accounting period 
(start date <= txn date < end date); 
it should be
Include transaction amount if transaction date is greater or equal to start date of accounting period and LESS THAN OR EQUAL TO end date of accounting period 
(start date <= txn date <= end date).
Comment 1 Nick 2019-02-05 03:21:07 EST
I appreciate that 2.x release has been superseded by 3.x, and that therefore 2.x is presumably considered'stable' with no further modifications allowed. I do not know if this same bug exists in 3.x, but I am unable to use that latest version  because the text appears too big on my screen (I use 125% fonts in Window 7 Home). If anyone can suggest some way for me to 'patch' my own copy of GC 2.6.21 to fix the bug reported above, I will be very grateful.
Comment 2 Geert Janssens 2019-02-05 03:37:38 EST
I don't know off-hand whether the accounting period calculation has been fixed in 3.x nor whether it would be an easy fix to backport (probably not as date handling has been completely rewritten for 3.x).

But perhaps it may be easier for you to tweak the font size for gnucash instead and make the jump to 3.x ? Or at least give it another spin to test whether the issue still exits there.

https://wiki.gnucash.org/wiki/GTK3#Font_Size_in_Documents explains how you can do that.
Comment 3 Bob 2019-05-17 06:21:06 EDT
I have pushed a fix for this, the absolute end date was being set to the start of the day instead of the end of the day.

This will be in version 3.6, it is possible to change your version but building on Windows is problematic so I would suggest upgrading to 3.6 and use the web page Geert mentions to change the font and size accordingly.

It will be in the next nightly so if you want to try that, look here for the last 3.5 build https://code.gnucash.org/builds/win32/maint/
Comment 4 Christopher Lam 2019-10-03 22:38:34 EDT
Is this bug still present in recent versions?
Comment 5 Nick 2019-10-04 09:32:55 EDT
(In reply to Christopher Lam from comment #4)
> Is this bug still present in recent versions?

Afraid I do not know. Installed 3.6 as suggested by Bob. I use keyboard (arrow keys, tab key, delete key) a lot instead of mouse, and found that data entry and navigation between fields in account register using those keys is different in some cases from 2.x so I uninstalled 3.6 and reverted to 2.6.21

Hard to give detailed bug (?) report as that will involve keeping detailed info about exact keystrokes and results in 2.x vs 3.x.  I only have one computer. 

Also prefer UI in 2.6; was not able to tweak icon sizes etc. to suit even when following Geert's suggestions.

Sorry - I'm clearly not tech-savvy :(
Comment 6 John Ralls 2019-11-05 11:31:42 EST
This is easily tested, and it is fixed.

As a separate issue both the balance(period) and total(period) produce results that are a bit counter-intuitive for Asset and Liability accounts: Since they sum up transactions only for the period they reflect the *change* in the balance for the period. That's likely what one would want to see for Equity--especially income and expense--accounts, so I suggest that we should change the name of the column rather than the algorithm.

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