gnucash maint: [balsheet-pnl] pnl columns should retrieve appropriate price.

Christopher Lam clam at
Mon Feb 15 07:59:45 EST 2021

Updated	 via (commit)
	from (commit)

commit b4e99a30484e105724b7979ec5de3e802d47d81d
Author: Christopher Lam <christopher.lck at>
Date:   Mon Feb 15 19:10:17 2021 +0800

    [balsheet-pnl] pnl columns should retrieve appropriate price.
    Preamble: the profit&loss list of dates starts from starting_date,
    adds Delta time until end_date. i.e. monthly pnl from 1-jan to 31-dec
    generates list 1-jan 1-feb 1-mar etc.
    The pnl columns refer to period ColumnDate to next ColumnDate, less 1
    day. i.e. 1-jan to 31-jan, 1-feb to 28-feb, 1-mar to 31-mar etc.
    The pnl columns must convert to report-currency using price retrieved
    on the period end_date rather than the next start_date. i.e. Old code
    would retrieve 1-feb price for 1-jan to 31-jan column. This is
    incorrect. This commit ensures that the 1-jan to 31-jan retrieves
    price on 31-jan.

Summary of changes:
 gnucash/report/reports/standard/balsheet-pnl.scm   | 25 +++++++++++++++-------
 .../reports/standard/test/test-balsheet-pnl.scm    | 16 +++++++-------
 2 files changed, 25 insertions(+), 16 deletions(-)

More information about the gnucash-patches mailing list