mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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.
This commit is contained in:
parent
2733d23b68
commit
f7324d16b4
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user