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.
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.
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<---
Go ahead and fix it. All reports should run from 00:00:01 on the first day to 23:59:59 the last day.
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.