gnucash maint: Bug 798625 - "Last up through report date" changed in 4.12
John Ralls
jralls at code.gnucash.org
Fri Jan 6 19:52:35 EST 2023
Updated via https://github.com/Gnucash/gnucash/commit/f7324d16 (commit)
from https://github.com/Gnucash/gnucash/commit/2733d23b (commit)
commit f7324d16b47ec180a0a79ebb5a50c169236f6074
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Jan 7 03:49:48 2023 +0300
Bug 798625 - "Last up through report date" changed in 4.12
Don't adjust report dates with time64CanonicalDayTime. They're set
to 23:59:59 local which is always >= neutral time at which prices
and transactions are timestamped. Local noon is before neutral time for
all time zones east of UTC+2.
diff --git a/gnucash/report/commodity-utilities.scm b/gnucash/report/commodity-utilities.scm
index 84e218bde..5e1990de2 100644
--- a/gnucash/report/commodity-utilities.scm
+++ b/gnucash/report/commodity-utilities.scm
@@ -739,7 +739,7 @@
(gnc-pricedb-get-db (gnc-get-current-book))
(gnc:gnc-monetary-amount foreign)
(gnc:gnc-monetary-commodity foreign)
- domestic (time64CanonicalDayTime date))))))
+ domestic date)))))
(define (gnc:exchange-by-pricedb-nearest-before foreign domestic date)
(and (gnc:gnc-monetary? foreign) date
@@ -751,7 +751,7 @@
(gnc-pricedb-get-db (gnc-get-current-book))
(gnc:gnc-monetary-amount foreign)
(gnc:gnc-monetary-commodity foreign)
- domestic (time64CanonicalDayTime date))))))
+ domestic date)))))
;; Exchange by the nearest price from pricelist. This function takes
;; the <gnc-monetary> 'foreign' amount, the <gnc:commodity*>
@@ -817,9 +817,9 @@
(define pdb (gnc-pricedb-get-db (gnc-get-current-book)))
(case source
((pricedb-nearest) (cut gnc-pricedb-get-nearest-price pdb <> target-curr
- (time64CanonicalDayTime date)))
+ date))
((pricedb-before) (cut gnc-pricedb-get-nearest-before-price pdb <> target-curr
- (time64CanonicalDayTime date)))
+ date))
((pricedb-latest) (cut gnc-pricedb-get-latest-price pdb <> target-curr))
(else
(lambda (commodity)
diff --git a/gnucash/report/trep-engine.scm b/gnucash/report/trep-engine.scm
index 48e80cdfc..5a46604b2 100644
--- a/gnucash/report/trep-engine.scm
+++ b/gnucash/report/trep-engine.scm
@@ -1316,17 +1316,13 @@ be excluded from periodic reporting.")
(opt-val pagename-currency
optname-currency)))
""))))
- ;; For conversion to row-currency. Use midday as the
- ;; transaction time so it matches a price on the same day.
- ;; Otherwise it uses midnight which will likely match a
- ;; price on the previous day
+ ;; For conversion to row-currency.
(converted-amount (lambda (s)
(exchange-fn
(gnc:make-gnc-monetary (split-currency s)
(split-amount s))
(row-currency s)
- (time64CanonicalDayTime
- (xaccTransGetDate (xaccSplitGetParent s))))))
+ (xaccTransGetDate (xaccSplitGetParent s)))))
(converted-debit-amount (lambda (s) (and (positive? (split-amount s))
(converted-amount s))))
(converted-credit-amount (lambda (s)
Summary of changes:
gnucash/report/commodity-utilities.scm | 8 ++++----
gnucash/report/trep-engine.scm | 8 ++------
2 files changed, 6 insertions(+), 10 deletions(-)
More information about the gnucash-changes
mailing list