Capital gain on investment is not calculated

it seems a bug, Capital gain on investment is not calculated after sale the investment when a investment is belong to a investment CONTROL ACCOUNT. it will calculate the capital gain if you remove the investment item from control account.