diff options
Diffstat (limited to 'tests')
| -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) |
