GnuCash
Contact   Instructions
Bug 797241 - Some reports skip transactions of the last day of the selected period
Summary: Some reports skip transactions of the last day of the selected period
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Reports (show other bugs)
Version: 3.5
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: reports
QA Contact: reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-16 23:19 EDT by Steven Bruniges
Modified: 2019-05-24 09:05 EDT (History)
4 users (show)

See Also:


Attachments

Description Steven Bruniges 2019-05-16 23:19:29 EDT
Some reports filter transactions incorrectly, to the beginning of the selected date, instead of the end of the selected date.  The latter is expected, as the "Report Options" offers a drop down which states "End of the accounting period" etc.  If instead a date is selected, again records entered on that date are missed.  It is expected that all techniques to configure the report have the same erroneous behavior.

Demonstrable on the reports "Investment Portfolio" and  "Advanced Portfolio" (and possibly more reports).  A transaction in an account "on the chosen date" does not impact the report outcome.

An example of a report that works correctly is "Balance sheet".

The likely bug is the selected date as a text object is being translated to an object of type date, without adding an increment for the next 24 Hours, to correspond with the "end of the date" behavior expected.

The chosen report is used in some countries to report on Depreciation for Tax purposes, hence has an impact on valid tax returns.
Comment 1 Christopher Lam 2019-05-17 09:36:34 EDT
I've just tested, and I can confirm
- buy txn on 1.1.19
- sell txn on 1.3.19

balance-sheet dated 1.3.19 recognises the sale on 1.3.19
portfolio dated 1.3.19 does not recognise the sale

If this fix is desirable, it should be fairly easy.

My (infinitely) small issue is whether it is acceptable to fix this, given that users may have produced reports with previous behaviour, and if they compare reports in the future, it will not be the same.

My opinion that this is a genuine bug; for consistency a balance-sheet or asset-valuation type report dated X should both consider transactions on the last date the same way -- either we count these transactions, or we don't.
Comment 2 Christopher Lam 2019-05-17 09:42:56 EDT
to fix, modify portfolio.scm as follows

replace the lines

--->start<---
  (let ((to-date     (gnc:date-option-absolute-time
                      (get-option gnc:pagename-general "Date")))
--->end<---

with the lines -- beware extra ) in the third line

--->start<---
  (let ((to-date     (gnc:time64-end-day-time 
                      (gnc:date-option-absolute-time
                       (get-option gnc:pagename-general "Date"))))
--->end<---
Comment 3 John Ralls 2019-05-17 10:08:50 EDT
Go ahead and fix it. All reports should run from 00:00:01 on the first day to 23:59:59 the last day.
Comment 4 Christopher Lam 2019-05-17 11:11:03 EDT
ok fixed in win32 maint. should be available in 24h in https://code.gnucash.org/builds/win32/maint/ 

Thank you for report, please let us know whether any other report exhibits bad behaviour.

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