diff --git a/gnucash/report/commodity-utilities.scm b/gnucash/report/commodity-utilities.scm index 84e218bde8f..5e1990de2b5 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 'foreign' amount, the @@ -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 48e80cdfc2b..5a46604b287 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)