Additional test cases to check balance with bank statements #39

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

Comments

Projects
None yet
2 participants
@nobodxbodon
Contributor

nobodxbodon commented Mar 2, 2017

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

This comment has been minimized.

Show comment
Hide comment
@chadwhitacre

chadwhitacre Mar 2, 2017

Contributor

Is this a good use case for Beancount balance assertions?

Contributor

chadwhitacre commented Mar 2, 2017

Is this a good use case for Beancount balance assertions?

@nobodxbodon

This comment has been minimized.

Show comment
Hide comment
@nobodxbodon

nobodxbodon Mar 3, 2017

Contributor

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.

Contributor

nobodxbodon commented Mar 3, 2017

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

This comment has been minimized.

Show comment
Hide comment
@chadwhitacre

chadwhitacre Mar 3, 2017

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.

Contributor

chadwhitacre commented Mar 3, 2017

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

This comment has been minimized.

Show comment
Hide comment
@chadwhitacre

chadwhitacre Mar 3, 2017

Contributor

The same should apply to every day

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

Contributor

chadwhitacre commented Mar 3, 2017

The same should apply to every day

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

@nobodxbodon

This comment has been minimized.

Show comment
Hide comment
@nobodxbodon

nobodxbodon Mar 6, 2017

Contributor

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

Contributor

nobodxbodon commented Mar 6, 2017

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 join this conversation on GitHub. Already have an account? Sign in to comment