bal, reg, print: -V prefers non-future valuation dates again (#999)
This commit is contained in:
parent
ef9c4a29c4
commit
9d3eb8c069
@ -173,10 +173,10 @@ brNegate (is, tot) = (map brItemNegate is, -tot)
|
||||
-- default valuation commodities. This means using the Journal's most
|
||||
-- recent applicable market prices before the valuation date.
|
||||
-- The valuation date is the specified report end date if any,
|
||||
-- otherwise the journal's end date.
|
||||
-- otherwise the current date, otherwise the journal's end date.
|
||||
brValue :: ReportOpts -> Journal -> BalanceReport -> BalanceReport
|
||||
brValue ropts j r =
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> journalEndDate False j
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> today_ ropts <|> journalEndDate False j
|
||||
in case mvaluationdate of
|
||||
Nothing -> r
|
||||
Just d -> r'
|
||||
|
||||
@ -43,10 +43,10 @@ entriesReport opts q j =
|
||||
-- default valuation commodities. This means using the Journal's most
|
||||
-- recent applicable market prices before the valuation date.
|
||||
-- The valuation date is the specified report end date if any,
|
||||
-- otherwise the journal's end date.
|
||||
-- otherwise the current date, otherwise the journal's end date.
|
||||
erValue :: ReportOpts -> Journal -> EntriesReport -> EntriesReport
|
||||
erValue ropts j ts =
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> journalEndDate False j
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> today_ ropts <|> journalEndDate False j
|
||||
in case mvaluationdate of
|
||||
Nothing -> ts
|
||||
Just d -> map valuetxn ts
|
||||
|
||||
@ -277,10 +277,10 @@ multiBalanceReportSpan (MultiBalanceReport (colspans, _, _)) = DateSpan (spanSta
|
||||
-- default valuation commodities. This means using the Journal's most
|
||||
-- recent applicable market prices before the valuation date.
|
||||
-- The valuation date is the specified report end date if any,
|
||||
-- otherwise the journal's end date.
|
||||
-- otherwise the current date, otherwise the journal's end date.
|
||||
mbrValue :: ReportOpts -> Journal -> MultiBalanceReport -> MultiBalanceReport
|
||||
mbrValue ropts j r =
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> journalEndDate False j
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> today_ ropts <|> journalEndDate False j
|
||||
in case mvaluationdate of
|
||||
Nothing -> r
|
||||
Just d -> r'
|
||||
|
||||
@ -229,10 +229,10 @@ negatePostingAmount p = p { pamount = negate $ pamount p }
|
||||
-- default valuation commodities. This means using the Journal's most
|
||||
-- recent applicable market prices before the valuation date.
|
||||
-- The valuation date is the specified report end date if any,
|
||||
-- otherwise the journal's end date.
|
||||
-- otherwise the current date, otherwise the journal's end date.
|
||||
prValue :: ReportOpts -> Journal -> PostingsReport -> PostingsReport
|
||||
prValue ropts j r =
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> journalEndDate False j
|
||||
let mvaluationdate = periodEnd (period_ ropts) <|> today_ ropts <|> journalEndDate False j
|
||||
in case mvaluationdate of
|
||||
Nothing -> r
|
||||
Just d -> r'
|
||||
|
||||
@ -38,7 +38,7 @@ P 3000/1/1 $ €1.30
|
||||
3000/01/01
|
||||
(a) $100
|
||||
>>>
|
||||
€130.00 a
|
||||
€120.00 a
|
||||
>>>=0
|
||||
|
||||
# 4. The market prices in effect at the report end date are used.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user