In article <[email protected]>,
 henry atting <[email protected]> wrote:

> This test.dat:
> 
> 2014/01/01 Opening Balances  
>     Assets:Bank:Checking         €1000.00 
>     Equity:Opening Balances 
> 
> 2014/01/02 unspecified 
>    [Assets:Bank:Vir]                 €400.00 
>    [Assets:Bank:Checking] 
> 
> does exactly what I want.
> 
> ledger -f test.dat bal bank:checking 
>    €600.00 Assets:Bank:Checking 
> ledger -f test.dat bal bank:checking -R  
>    €1000.00 Assets:Bank:Checking 
> 
> Only the command with the `R' switch reveals the correct amount in 
> Bank:Checking
> 
> This works fine til the end of the year when I want to archive the last 
> year. 
> 
> Writing equitiy to a file then fails:
> 
> ledger -f test.dat equity > e.dat
> 
> While handling posting from "test.dat", line 9: > [Assets:Bank:Checking] 
> Error: 'equity' cannot accept virtual and non-virtual postings to the same 
> account 

I have had the same problem when I first tried to archive previous years. You 
may use:

  ledger -f test.dat --real equity > e.dat

But, the rule of thumb I have adopted is: never have both virtual and 
non-virtual postings in the same account. In your case, you might use 
unbalanced 
virtual postings:

2014/01/02 unspecified 
   (Assets:Bank:Vir)                 €400.00 

or rename the accounts:

2014/01/02 unspecified 
   [Assets:Bank:Vir]                 €400.00 
   [Assets:Bank:Checking:Vir] 


Regards,
Life

-- 

--- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to