Auto-balance manually/automatically?

33 views
Skip to first unread message

Oon-Ee Ng

unread,
Oct 1, 2019, 4:33:37 AM10/1/19
to bean...@googlegroups.com
I just had to spend half an hour trolling through a whole bunch of transactions to find the unbalanced one. The account itself has relatively frequent transactions of varying amounts, and had been last checked a month or so ago.

Unfortunately the nature of the account is that I don't have a running balance of funds (in the way most bank statements do) which I can use to quickly isolate the date of the offending transaction. Is there a way to script an auto-balance? Something as simple as "Find the balances of this list of accounts and insert a balance statement for all of them on date X"?

Martin Blais

unread,
Oct 1, 2019, 6:52:45 PM10/1/19
to Beancount
Not that I know of.
I've spent some time in the past going on hunting expeditions like
this (when the OCD kicks in), and every time I come out thinking I
should build a bunch of tools to help narrow down errors, and then I
just move on. I think more tools might be helpful in that department.

On Tue, Oct 1, 2019 at 4:33 AM Oon-Ee Ng <ngoone...@gmail.com> wrote:
>
> I just had to spend half an hour trolling through a whole bunch of transactions to find the unbalanced one. The account itself has relatively frequent transactions of varying amounts, and had been last checked a month or so ago.
>
> Unfortunately the nature of the account is that I don't have a running balance of funds (in the way most bank statements do) which I can use to quickly isolate the date of the offending transaction. Is there a way to script an auto-balance? Something as simple as "Find the balances of this list of accounts and insert a balance statement for all of them on date X"?
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAGQ70evoEdsWg45zLtagwRqCcj%2BCn4G3XJGJdOD9uLLsZCVQuw%40mail.gmail.com.

Justus Pendleton

unread,
Oct 2, 2019, 9:28:11 AM10/2/19
to Beancount
On Tuesday, October 1, 2019 at 3:33:37 PM UTC+7, Oon-Ee Ng wrote:
Is there a way to script an auto-balance? Something as simple as "Find the balances of this list of accounts and insert a balance statement for all of them on date X"?

Maybe I'm not understanding what you're asking for but isn't this just (in pseudo bash-code, since I don't actually remember how bash arrays work)

DATE=$1
ACCOUNTS=(Assets:US:Checking Assets:US:Savings)
for ACCOUNT in $ACCOUNTS
  BALANCE=$(bean-query my.beancount "balances at units from close on $DATE where account = '$ACCOUNT'" | tail -1)
  echo $DATE $BALANCE
end
Reply all
Reply to author
Forward
0 new messages