-
-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de73f55
commit b6b0c85
Showing
3 changed files
with
96 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,43 @@ | ||
# test some specific transaction balanced checking issues | ||
# Test cases for balanced-transaction checking, cf #1479 | ||
|
||
# Old journal entries dependent on commodity directives for balancing (#1479) | ||
< | ||
commodity $0.00 | ||
|
||
2021-01-01 move a lot elsewhere, adjusting cost basis due to fees | ||
assets:investments1 AAAA -11.0 @ $0.093735 | ||
expenses:fees AAAA 0.6 | ||
equity:basis adjustment AAAA -0.6 | ||
assets:investments2 AAAA 10.4 @ $0.099143 | ||
assets:investments1 A -11.0 @ B 0.093735 | ||
expenses:fees A 0.6 | ||
equity:basis adjustment A -0.6 | ||
assets:investments2 A 10.4 @ B 0.099143 | ||
|
||
# 1. fail with default "exact" balanced checking | ||
# 1, 2. succeeds with old "styled" and new "exact" balanced checking | ||
$ hledger -f- check --balancing=styled | ||
$ hledger -f- check | ||
>2 /real postings' sum should be 0 but is: \$0.0000022/ | ||
>=1 | ||
|
||
# 2. succeed with "styled" balanced checking | ||
< | ||
commodity $0.00 | ||
|
||
2021-01-01 | ||
a A -11.0 @ B 0.093735 | ||
b A 10.4 @ B 0.099143 | ||
|
||
# 3, 4. succeeds with old and new balanced checking | ||
$ hledger -f- check --balancing=styled | ||
$ hledger -f- check | ||
|
||
< | ||
commodity B0.00 | ||
|
||
2021-01-01 | ||
a A -9514.405544 @ B 0.104314 | ||
b A 9513.805544 @ B 0.1043206 | ||
|
||
# 5, 6. succeeds and fails with old and new balanced checking | ||
$ hledger -f- check --balancing=styled | ||
$ hledger -f- check | ||
>2 // | ||
>= 1 | ||
|
||
# < | ||
# 2021-01-01 | ||
# a 1C @ $1.0049 | ||
# b $-1.000 |