Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

Additional test cases to check balance with bank statements #39

Open
nobodxbodon opened this issue Mar 2, 2017 · 5 comments
Open

Additional test cases to check balance with bank statements #39

nobodxbodon opened this issue Mar 2, 2017 · 5 comments

Comments

@nobodxbodon
Copy link
Contributor

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.

@chadwhitacre
Copy link
Contributor

Is this a good use case for Beancount balance assertions?

@nobodxbodon
Copy link
Contributor Author

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.

@chadwhitacre
Copy link
Contributor

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:

Assets:New-Alliance:Escrow
Assets:New-Alliance:Operations

Instead of:

Assets:Escrow:New-Alliance
Assets:Operations:New-Alliance

Then we could do:

2012-07-01 balance Assets:New-Alliance  130.41 USD

Right?

Should we do that? I think it'd mean rewriting the escrow balance test scripts.

@chadwhitacre
Copy link
Contributor

The same should apply to every day

Do you think we need this for every day? Would monthly assertions be sufficient?

@nobodxbodon
Copy link
Contributor Author

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.

Would monthly assertions be sufficient?

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants