This example from the documentation uses the same account name for both real and virtual postings: https://www.ledger-cli.org/3.0/doc/ledger3.html#Working-with-multiple-funds-and-accounts
On Tuesday, February 27, 2018 at 9:13:57 AM UTC-6, Dániel Fancsali wrote: > > Hey, > > Just a hunch, but I feel it's a bit odd that the virtual account names > match the real ones. I'd double check that, maybe using ledger register > to see what the rolling sum is. > > Regards, > Dan > > On Tue, 27 Feb 2018 at 15:03 Ryan Nowakowski <[email protected] > <javascript:>> wrote: > >> On Tue, Feb 27, 2018 at 04:41:08AM +0100, Jostein Berntsen wrote: >> > On 26.02.18,16:43, Ryan Nowakowski wrote: >> > > I'm not sure how virtual postings and balance assertions are supposed >> to >> > > work together. Here's my sample ledger file without virtual postings: >> > > >> > > 2018/2/25 Initial balance >> > > Assets $100 >> > > Equity >> > > >> > > 2018/2/26 Buy something >> > > Assets $-10 >> > > Expenses >> > > >> > > 2018/2/26 Balance assertion >> > > Assets $0 = $90 >> > > >> > > Running: ledger -f test.dat bal >> > > ...works as expected: >> > > >> > > $90 Assets >> > > $-100 Equity >> > > $10 Expenses >> > > -------------------- >> > > 0 >> > > >> > > Then the same ledger file with an additional virtual posting >> transaction: >> > > >> > > 2018/2/25 Initial balance >> > > Assets $100 >> > > Equity >> > > >> > > 2018/2/26 Buy something >> > > Assets $-10 >> > > Expenses >> > > >> > > 2018/2/26 virtual stuff >> > > [Assets] $-10 >> > > [Expenses] >> > > >> > > 2018/2/26 Balance assertion >> > > Assets $0 = $90 >> > > >> > > >> > > When I run: ledger -f test.dat bal >> > > >> > > While parsing file "/tmp/test.dat", line 14: >> > > While parsing posting: >> > > Assets $0 = $90 >> > > ^^^ >> > > Error: Balance assertion off by $10 (expected to see $80) >> > > >> > > ...which seems ok since the virtual posting should make the balance >> $80 >> > > instead of $90. However if I use --real I'd expect the balance >> > > assertion to succeed: ledger -f test.dat bal --real >> > > >> > > But it doesn't: >> > > >> > > >> > > While parsing file "/tmp/test.dat", line 14: >> > > While parsing posting: >> > > Assets $0 = $90 >> > > ^^^ >> > > Error: Balance assertion off by $10 (expected to see $80) >> > > >> > > Is my expectation incorrect here? Is there any documentation on how >> > > virtual postings and balance assertion are supposed to interact? >> > > >> > >> > This works in my ledger setup with version 3.1.1, both with an without >> > --real. Which version are you using? >> > >> >> I forgot to include that little unimportant bit of info :) >> >> Ledger 3.1.2-20160801, the command-line accounting tool >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "Ledger" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/f5039d73-4858-448a-bf79-f499d54c0f4b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
