Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Additional test cases to check balance with bank statements #39
Stems from discussion around #6 (comment), and actually we are already doing that manually when we validate the beancount files.
Basically, the goal is to keep balance consistent with every balance in every bank account.
For example, pick 1/31/2017, the sum of all the assets of PNC according to beancount should be equal to the balance on that day in the bank statement. The same should apply to every day, and other bank accounts as well.
To achieve that, we'll add sanitized bank statements in the repository, so that they can be compared with through the tests.
Does it sound reasonable? I've not looked into beancount whether it has special support for this kind of task, but I imagine writing query from scratch is still feasible. The test could be a little slow, if we want to run a query for each day with transaction, but that's low priority to optimize IMO.
IMO it could be handy for account that's not separated to escrow/operation. For example, by end of 2012-06, new-alliance has escrow $46.66, and operations $83.75, they do sum up to $130.41 as shown in bank statement, but I've not found a way to aggregate those two parts using Beancount balance assertions.
Hmmm, good point ...
I guess we would have to invert the taxonomy in order to take advantage of that feature. In other words, we'd have to do:
Then we could do:
Should we do that? I think it'd mean rewriting the escrow balance test scripts.
That's a good find. I don't see a better approach yet. Rewriting the escrow balance test scripts sounds feasible. I'll try this with the 2012-06 part.
It might, but putting all assertions doesn't add much workload. BTW if we use the built-in balance-assertion, it'll only check those days that appear in bank statements automatically (I think), which is ideal.
One possible overhead is some tricky scenarios where balancing in the middle of month is not so straightforward. Still IMO it's better to resolve those cases earlier than later, and, if indeed infeasible, we fallback to monthly/bi-weekly assertion (though I guess those cases will bite us later anyways).