reg & bal incorrect output #87

Closed
simonmichael opened this Issue Apr 8, 2013 · 2 comments

Projects

None yet

1 participant

@simonmichael
Owner

Original author: thierry....@gmail.com (November 09, 2012 23:33:42)

What steps will reproduce the problem?

$ cat hledger_test_14
D 1000,00 €

2000/12/08 * SG PEE STK
Actif:Invest:SgPeeStk -1910,117 "Eq_454" @@ 10742,52 €
Actif:Invest:SgPeeStk 215,796 "Eq_455" @@ 10742,52 €
[Revenu:Invest:Capital] -553,653 "Eq_454" @@ 2609,92 €
[Revenu:Invest:Capital] -5,684 "Eq_454" @@ 26,10 €
[Revenu:Invest:Capital] -50,833 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -49,714 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -49,957 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -49,778 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -142,316 "Eq_454" @@ 674,01 €
[Revenu:Invest:Capital] -49,029 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -51,233 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -49,204 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -49,474 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -47,773 "Eq_454" @@ 234,90 €
[Revenu:Invest:Capital] -109,439 "Eq_454" @@ 576,96 €
[Revenu:Invest:Capital] -31,133 "Eq_454" @@ 171,51 €
[Revenu:Invest:Capital] -438,249 "Eq_454" @@ 2537,90 €
[Revenu:Invest:Capital] -11,927 "Eq_454" @@ 72,03 €
[Revenu:Invest:Capital] -170,721 "Eq_454" @@ 990,18 €
[Revenu:Invest:Capital] 1910,117 "Eq_454" @@ 10742,52 €
[Revenu:Invest:Capital]

$ cat hledger_test_14 | hledger -f - bal Revenu:Invest:Capital

-2849,01 € Revenu:Invest:Capital

      -2849,01 €

What is the expected output?

$ cat hledger_test_14 | ledger --args-only --decimal-comma -f - bal Revenu:Invest:Capital
-969,81 € Revenu:Invest:Capital

What do you see instead?

$ cat hledger_test_14 | hledger -f - bal Revenu:Invest:Capital

-2849,01 € Revenu:Invest:Capital

      -2849,01 €

What version of the product are you using?

$ hledger --version
hledger 0.19

On what operating system?

$ uname -a
Linux rialto 3.2.0-3-amd64 #1 SMP Thu Jun 28 09:07:26 UTC 2012 x86_64 GNU/Linux

Please provide any additional information below.

removing virtual transaction does not help

$ sed 's/[Revenu:Invest:Capital]/Revenu:Invest:Capital/' hledger_test_14 | ledger --args-only --decimal-comma -f - bal Revenu:Invest:Capital
-969,81 € Revenu:Invest:Capital

$ sed 's/[Revenu:Invest:Capital]/Revenu:Invest:Capital/' hledger_test_14 | hledger -f - bal Revenu:Invest:Capital

-2849,01 € Revenu:Invest:Capital

      -2849,01 €

Original issue: http://code.google.com/p/hledger/issues/detail?id=87

@simonmichael
Owner

From simon@joyful.com on November 12, 2012 16:39:35
Total-priced (@@) amounts were not being summed correctly.
I have committed a fix (http://hub.darcs.net/simon/hledger/patch/20121112163143-3c3f9).
Thanks for finding this!

@simonmichael
Owner

From thierry....@gmail.com on November 12, 2012 20:23:04
I confirm that "it works!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment