Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--historical uses period-end valuations of prices, while --cumulative doesn't #2205

Open
the-solipsist opened this issue Jun 17, 2024 · 1 comment
Labels
impact4 Affects more than a few users. severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate.

Comments

@the-solipsist
Copy link
Collaborator

--historical and --cumulative provided the same output until v1.20 if the periods were the same.

Since v1.21, they no longer do. They diverge if there are multiple commodities with prices that change over the periods.

I'm not sure if this should be counted as a regression or not.

Example

sol@spica /tmp> hledger --version
hledger 1.33.1, linux-x86_64

sol@spica /tmp> cat temp.j
2020-01-01 Transaction
  Assets:Cash:INR     INR 10000.00
  Assets:Cash:USD     USD 2000.00
  Equity:Opening

P 2020-12-31 USD INR 40.00
P 2021-12-31 USD INR 50.00
P 2022-12-31 USD INR 60.00

sol@spica /tmp> hledger -f temp.j bal --yearly -XINR --cumulative
Ending balances (cumulative) in 2020-01-01..2022-12-31, valued at period ends:

                 ||    2020-12-31     2021-12-31     2022-12-31 
=================++=============================================
 Assets:Cash:INR ||  INR 10000.00   INR 10000.00   INR 10000.00 
 Assets:Cash:USD ||  INR 80000.00   INR 80000.00   INR 80000.00 
 Equity:Opening  || INR -90000.00  INR -90000.00  INR -90000.00 
-----------------++---------------------------------------------
                 ||             0              0              0 

sol@spica /tmp> hledger -f temp.j bal --yearly -XINR --historical
Ending balances (historical) in 2020-01-01..2022-12-31, valued at period ends:

                 ||    2020-12-31      2021-12-31      2022-12-31 
=================++===============================================
 Assets:Cash:INR ||  INR 10000.00    INR 10000.00    INR 10000.00 
 Assets:Cash:USD ||  INR 80000.00   INR 100000.00   INR 120000.00 
 Equity:Opening  || INR -90000.00  INR -110000.00  INR -130000.00 
-----------------++-----------------------------------------------
                 ||             0               0               0 
@the-solipsist the-solipsist added severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate. impact4 Affects more than a few users. labels Jun 17, 2024
@the-solipsist the-solipsist changed the title --historical uses period-end valuation of prices, while --cumulative does not --historical uses period-end valuations of prices, while --cumulative doesn't Jun 17, 2024
@simonmichael
Copy link
Owner

I will definitely check it out, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact4 Affects more than a few users. severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate.
Projects
None yet
Development

No branches or pull requests

2 participants