diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-22 21:53:13 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-22 21:53:13 +0200 |
| commit | bbdbb32c28a7b37da8caee60cd3756720fe88f4f (patch) | |
| tree | 296073e6ab0bacef67a6cab1660f6b64b74f3085 /tests/test_core.c | |
| parent | 8e3ff5a7ae7cb5e43b6eed3be8d77f2997888669 (diff) | |
| download | bokf-0.1.66.tar.gz bokf-0.1.66.zip | |
reports: ignore IB rows on P&L accounts; bokfctl --dry-runv0.1.66
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_core.c')
| -rw-r--r-- | tests/test_core.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_core.c b/tests/test_core.c index 54e73f5..c9c969e 100644 --- a/tests/test_core.c +++ b/tests/test_core.c @@ -2295,6 +2295,27 @@ static void test_ib_carry(struct tctx *t) CHECK(strstr(sbuf, "#UB 0 3001") == NULL); CHECK(strstr(sbuf, "#RES 0 1930") == NULL); } + + /* an IB adjustment balanced against a P&L account moves only the balance + side; the P&L account still opens at zero */ + d = call(reqf("{\"v\":1,\"id\":\"ibc7a\",\"cmd\":\"voucher.post\"," + "\"session\":\"%s\",\"org\":%d,\"args\":{\"date\":" + "\"%d-01-01\",\"description\":\"IB-justering\"," + "\"series\":\"IB\",\"rows\":[" + "{\"account\":\"1930\",\"debit_ore\":700}," + "{\"account\":\"3001\",\"credit_ore\":700}]}}", + g_session, org, y)); + CHECK_OK(d); + yyjson_doc_free(d); + d = call(reqf("{\"v\":1,\"id\":\"ibc7b\",\"cmd\":\"report.trial_balance\"," + "\"session\":\"%s\",\"org\":%d,\"args\":{\"fiscal_year\":" + "%lld}}", + g_session, org, (long long)fy2)); + CHECK_OK(d); + CHECK(find_amount(d, "result.accounts", "account", "1930", "ib_ore") == + 100700); + CHECK(find_amount(d, "result.accounts", "account", "3001", "ib_ore") == 0); + yyjson_doc_free(d); } static void test_period_lock(struct tctx *t) |
