how are balance and pad directives ordered?

480 views
Skip to first unread message

24x7...@gmail.com

unread,
Sep 12, 2015, 10:18:07 AM9/12/15
to Beancount
Hi Martin,

I am trying to use the balance directive to automatically assert whether the statement balances are correct, without having to inspect each transaction. The way it shows up in the bean-web is awesome. It's very easy to quickly validate that the transactions for a particular billing period balance.

However, I am not sure I know how to correctly use the balance directives. For a couple of my accounts, there are transactions for the week in which the statement closes. As a result, they almost always don't balance. For other accounts, that don't have transactions on both sides of the statement closing date, I move the balance assertion date a day forward or backward and it works. 

Are the balance assertions made at the beginning of the day or the end of the day? Is there a way to anchor them either at the beginning or at the end?

Thanks, cb

Martin Blais

unread,
Sep 12, 2015, 5:03:45 PM9/12/15
to Beancount
On Sat, Sep 12, 2015 at 10:18 AM, <24x7...@gmail.com> wrote:
Hi Martin,

I am trying to use the balance directive to automatically assert whether the statement balances are correct, without having to inspect each transaction. The way it shows up in the bean-web is awesome. It's very easy to quickly validate that the transactions for a particular billing period balance.

Glad you find it easy to read! :-)


However, I am not sure I know how to correctly use the balance directives. For a couple of my accounts, there are transactions for the week in which the statement closes. As a result, they almost always don't balance.

I'm reading this: you mean that there are pending transactions for a date _before_ the balance date which will get included later only. The fix for this is to change the balance date to the date of the last included transaction.


For other accounts, that don't have transactions on both sides of the statement closing date, I move the balance assertion date a day forward or backward and it works. 

That's the method I use too.

There's a related problem: Because Beancount does not yet deal with the problem of differing settlement dates (see http://furius.ca/beancount/doc/proposal-dates for details), sometimes if you have to adjust one date it can be a bit finnicky to fudge the balance date. It's not a huge problem - I manage to do it almost every time in practice - but eventually when this proposal will be implemented and it will be possible to associate the precise settlement date for each side of a transaction, there will be even less of these instances of fudging left (if any). 

(I do plan to implement this settlement dates improvement, but only after the more substantial booking work is complete.)


Are the balance assertions made at the beginning of the day or the end of the day? Is there a way to anchor them either at the beginning or at the end?

Balance assertions always apply at the beginning of the day:

If you need to assert an end-of-day balance, fudge your date to the next day.
I've gone back and forth about whether I should add a "balance_end" directive or perhaps a modifier to the balance directive to automatically do this as a convenience in the input, e.g. 

  YYYY-MM-DD balance* ACCOUNT AMOUNT

Still unconvinced at this point. I just fudge my balance dates manually so far, when I need to, which is fairly rarely. 




Thanks, cb

--
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 beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/7955da0c-3da2-4eee-8040-d9670a28a465%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages