From bbdbb32c28a7b37da8caee60cd3756720fe88f4f Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Tue, 22 Sep 2026 21:53:13 +0200 Subject: reports: ignore IB rows on P&L accounts; bokfctl --dry-run Co-Authored-By: Claude Opus 5.5 --- tests/test_core.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/test_core.c') 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) -- cgit v1.3