simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
3.05k stars 321 forks source link

Can't combine -B and -V since 1.15. Should we support that ? #1184

Open trebestie opened 4 years ago

trebestie commented 4 years ago

As discussed in this thread you can't get a monocurrency report when in journal you mix declared with P and deducted from transactions values.

Even if was not the most accurate report you could get, until version 1.14 combining -V e -B flags did the trick.

My kind regards

psb777 commented 4 years ago

-V does the conversions of a FX or commodity balance at the current (most recent) price or at the price immediately at or before the --end= report date, and so does what you want, as best as I can understand. Perhaps you could draft a short example?

simonmichael commented 4 years ago

Here was my thought about that:

PS but I accept that this isn't quite the same. Eg if you have another transaction purchasing LITRES with a different cost.

Eg, in the OP's example add a second "Buy petrol" with a different cost:

2020/01/28 Buy petrol
    Expenses:Petrol     10 LITRES @@ 80
    Assets:Cash

Now the old hledger-1.14 -BV report (which I never used or saw used before) and the new hledger-1.16 -V report give different results.

trebestie commented 4 years ago

Il giorno mar 4 feb 2020 alle ore 03:11 Simon Michael < notifications@github.com> ha scritto:

Here was my thought about that:

PS but I accept that this isn't quite the same. Eg if you have another transaction purchasing LITRES with a different cost.

Eg, in the OP's example add a second "Buy petrol" with a different cost:

2020/01/28 Buy petrol Expenses:Petrol 10 LITRES @@ 80 Assets:Cash

Now the old -BV report (which I never used or saw used before) and the new report using -V give different results.

Hi Simon, here the outputs

hledger-1.16 bal --flat -V 420,0 Assets:Cash 9,0 Assets:Dollars 37,5 Assets:Pounds 316,0 Expenses:Groceries 20 LITRES Expenses:Petrol -1000,0 Revenues:Salary

          -217,5
       20 LITRES

hledger-1.14 bal --flat -VB 420,0 Assets:Cash 9,0 Assets:Dollars 37,5 Assets:Pounds 316,0 Expenses:Groceries 180,0 Expenses:Petrol -1000,0 Revenues:Salary

           -37,5

Cheers -- Diego Depaoli