Repository navigation
Closed
Labels
docsDocumentation-related.Documentation-related.journalThe journal file format, and its features.The journal file format, and its features.
Milestone
Description
Hi,
Case 1
If I'm using the following file:
2009/01/01
assets:a:sek SEK 100.00000 @ 1.35
assets:a:cash
2014/01/01
assets:b:stock:Foo Bar "Foo Bar" 27.0000000 @ 179.400000
assets:b:cash
P 2010/01/01 SEK 1.40
P 2015/01/01 "Foo Bar" 200.0000000
and run the following command, it looks like the behavior is different between the two transactions:
C:\tmp>hledger -f test.journal bal -B -V
54.0000000 assets
54.0000000 a
-135.0000000 cash
189.0000000 sek <---- changed with updated price
0 b
-4843.8000000 cash
4843.8000000 stock:Foo Bar <--- why is this not changed?
Case 2
If I then change the date of the second transaction to the same as the first one:
2009/01/01
assets:a:sek SEK 100.00000 @ 1.35
assets:a:cash
2009/01/01
assets:b:stock:Foo Bar "Foo Bar" 27.0000000 @ 179.400000
assets:b:cash
P 2010/01/01 SEK 1.40
P 2015/01/01 "Foo Bar" 200.0000000
I get another output:
C:\tmp>hledger -f test.journal bal -B -V
0 assets
0 a
-135.0000000 cash
135.0000000 sek <---- this is no longer updated
0 b
-4843.8000000 cash
4843.8000000 stock:Foo Bar
I feel I'm missing something very basic here, could you please explain the behavior?
- What is the difference between transaction 1 and 2 in Case 1?
- Why did the balance change for transaction 1 in Case 2 when I changed the date for transaction 2?
hledger 1.4 / Windows 10
Metadata
Metadata
Assignees
Labels
docsDocumentation-related.Documentation-related.journalThe journal file format, and its features.The journal file format, and its features.
Activity
simonmichael commentedon Dec 29, 2017
Can someone help investigate this one ?
simonmichael commentedon Dec 29, 2017
Related docs, and at least part of the answer:
http://hledger.org/manual.html#market-prices
http://hledger.org/manual.html#market-value: when there is a market price (P directive) for the amount's commodity, dated on or before the report end date (see hledger -> Report start & end date), the amount will be converted
http://hledger.org/hledger.html#report-start-end-date: the [default] effective report start and end dates will be the earliest and latest transaction or posting dates found in the journal
With no explicit report end date specified, it was converting using prices effective on the date of the latest transaction. In this situation I guess it should use today's date instead.
simonmichael commentedon Dec 29, 2017
Secondly, the different result you get from combining -B and -V here seems like a bug. http://hledger.org/manual.html#market-value says Using -B and -V together is allowed. but I don't know if that ever does anything meaningful. Perhaps we should make this an error.
uses today's prices, not those of last txn date, for -V (fix #683,#648)
doc: warn about combining -B and -V (#683)