I am aware that pad just adds the according transaction with the specified account such that the required balance is matched.
now I see 2010-01-01 * "initialize" Assets:Parent:Child 20 CHF Assets:Parent 1 CHF Equity:Opening-Balance -21 CHF // makes total sense 2010-01-02 pad Assets:Parent:Child Expenses:Expenses 2010-01-02 P "(Padding inserted for Balance of 0 CHF for difference -20 CHF)" Assets:Parent:Child -20 CHF Expenses:Expenses 20 CHF 2010-01-03 balance Assets:Parent:Child 0 CHF // makes total sense 2010-01-04 pad Assets:Parent Expenses:Expenses 2010-01-04 P "(Padding inserted for Balance of 0 CHF for difference -21 CHF)" Assets:Parent -21 CHF // makes zero sense, should be -1 (one for the parent plus zero for the child), not -21. This account has a balance of 1, not 21 Expenses:Expenses 21 CHF 2010-01-05 balance Assets:Parent 0 CHF ; Diff: -20 CHF // continues to make zero sense So i understand that the behavior of pad makes limited sense in nested accounts, hence I try to avoid it. What would be the clean way of balancing both accounts other than hardcoding a transaction and changing it everytime some historic transactions pops up? Thanks! On Thursday, November 28, 2019 at 10:26:51 PM UTC+1, Martin Blais wrote: > > Use > bean-query <filename> print > to view what the padding directive actually does > > On Thu, Nov 28, 2019 at 4:55 AM nug get <[email protected] > <javascript:>> wrote: > > > > with the following minimal example i get an error on balancing the > parent account: > > > > 2000-01-01 open Assets:Parent CHF > > 2000-01-01 open Assets:Parent:Child CHF > > 2000-01-01 open Equity:Opening-Balance CHF > > 2000-01-01 open Expenses:Expenses CHF > > > > ;get random amounts on the accounts > > 2010-01-01 * "initialize" > > Assets:Parent:Child 20 CHF > > Assets:Parent 1 CHF > > Equity:Opening-Balance > > > > ; pad child and parent > > 2010-01-02 pad Assets:Parent:Child Expenses:Expenses > > 2010-01-03 balance Assets:Parent:Child 0 CHF > > > > 2010-01-04 pad Assets:Parent Expenses:Expenses > > 2010-01-05 balance Assets:Parent 0 CHF > > > > > > $ bean-check testpad.bean > > >testpad.bean:17: Balance failed for 'Assets:Parent': expected 0 > CHF != accumulated -20 CHF (20 too little) > > > > > > 2010-01-05 balance Assets:Parent 0 > CHF > > > > I would have expected the parent account to be padded to zero with no > error. > > removing the pad / balance of the child makes the parent balance > correctly. > > I do not understand, why does the balancing of the parent account fail? > > How would I pad both accounts correctly? > > Thanks! > > > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "Beancount" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/1312bcca-1a78-470f-be0a-4d4a59bebdae%40googlegroups.com. > > > -- You received this message because you are subscribed to the Google Groups "Beancount" 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/beancount/3c197bd8-19df-4c6f-8787-0c15cce3c304%40googlegroups.com.
