diff --git a/README.md b/README.md index 53ca6f5..ee9d72e 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ $ investir capital-gains data/freetrade.csv -------------------------------------------------------------------------------------------------------------------- Number of disposals: 7 Gains in the year, before losses: £1715.67 Disposal proceeds: £8166.14 Losses in the year: £13.95 -Allowable costs (including purchase price): £6464.42 +Allowable costs (including purchase price): £6464.42 Net gain or loss: £1701.72 Tax year 2022-2023 -------------------------------------------------------------------------------------------------------------------- @@ -87,7 +87,7 @@ Allowable costs (including purchase price): £6464.42 -------------------------------------------------------------------------------------------------------------------- Number of disposals: 4 Gains in the year, before losses: £1484.16 Disposal proceeds: £6553.93 Losses in the year: £119.50 -Allowable costs (including purchase price): £5189.27 +Allowable costs (including purchase price): £5189.27 Net gain or loss: £1364.66 ``` View cost, allocation weight, and unrealised gain/loss for open diff --git a/src/investir/taxcalculator.py b/src/investir/taxcalculator.py index 9f4beb7..9b21614 100644 --- a/src/investir/taxcalculator.py +++ b/src/investir/taxcalculator.py @@ -182,7 +182,9 @@ def gbp(amount): ) print( f"{'Allowable costs (including purchase price):':44}" - f"{gbp(total_cost):>10}\n" + f"{gbp(total_cost):>10} " + f"{'Net gain or loss:':44}" + f"{gbp(total_gains - total_losses):>10}\n" ) def _calculate_unrealised_gain_loss( diff --git a/tests/test_cli/capital_gains b/tests/test_cli/capital_gains index 17e296f..e96e6fb 100644 --- a/tests/test_cli/capital_gains +++ b/tests/test_cli/capital_gains @@ -12,7 +12,7 @@ -------------------------------------------------------------------------------------------------------------------- Number of disposals: 7 Gains in the year, before losses: £1715.67 Disposal proceeds: £8166.14 Losses in the year: £13.95 -Allowable costs (including purchase price): £6464.42 +Allowable costs (including purchase price): £6464.42 Net gain or loss: £1701.72 Tax year 2022-2023 -------------------------------------------------------------------------------------------------------------------- @@ -25,5 +25,5 @@ Allowable costs (including purchase price): £6464.42 -------------------------------------------------------------------------------------------------------------------- Number of disposals: 4 Gains in the year, before losses: £1484.16 Disposal proceeds: £6553.93 Losses in the year: £119.50 -Allowable costs (including purchase price): £5189.27 +Allowable costs (including purchase price): £5189.27 Net gain or loss: £1364.66 diff --git a/tests/test_cli/capital_gains_amzn b/tests/test_cli/capital_gains_amzn index e702b67..31123cc 100644 --- a/tests/test_cli/capital_gains_amzn +++ b/tests/test_cli/capital_gains_amzn @@ -6,5 +6,5 @@ ------------------------------------------------------------------------------------------------------------------- Number of disposals: 1 Gains in the year, before losses: £1448.41 Disposal proceeds: £4941.53 Losses in the year: £0.00 -Allowable costs (including purchase price): £3493.12 +Allowable costs (including purchase price): £3493.12 Net gain or loss: £1448.41 diff --git a/tests/test_cli/capital_gains_gains b/tests/test_cli/capital_gains_gains index d1fcc39..66ae409 100644 --- a/tests/test_cli/capital_gains_gains +++ b/tests/test_cli/capital_gains_gains @@ -11,7 +11,7 @@ -------------------------------------------------------------------------------------------------------------------- Number of disposals: 6 Gains in the year, before losses: £1715.67 Disposal proceeds: £8012.93 Losses in the year: £0.00 -Allowable costs (including purchase price): £6297.26 +Allowable costs (including purchase price): £6297.26 Net gain or loss: £1715.67 Tax year 2022-2023 ------------------------------------------------------------------------------------------------------------------- @@ -22,5 +22,5 @@ Allowable costs (including purchase price): £6297.26 ------------------------------------------------------------------------------------------------------------------- Number of disposals: 2 Gains in the year, before losses: £1484.16 Disposal proceeds: £5254.48 Losses in the year: £0.00 -Allowable costs (including purchase price): £3770.32 +Allowable costs (including purchase price): £3770.32 Net gain or loss: £1484.16 diff --git a/tests/test_cli/capital_gains_losses b/tests/test_cli/capital_gains_losses index 0f4df55..f69e046 100644 --- a/tests/test_cli/capital_gains_losses +++ b/tests/test_cli/capital_gains_losses @@ -6,7 +6,7 @@ ------------------------------------------------------------------------------------------------------------------ Number of disposals: 1 Gains in the year, before losses: £0.00 Disposal proceeds: £153.21 Losses in the year: £13.95 -Allowable costs (including purchase price): £167.16 +Allowable costs (including purchase price): £167.16 Net gain or loss: £-13.95 Tax year 2022-2023 ------------------------------------------------------------------------------------------------------------------- @@ -17,5 +17,5 @@ Allowable costs (including purchase price): £167.16 ------------------------------------------------------------------------------------------------------------------- Number of disposals: 2 Gains in the year, before losses: £0.00 Disposal proceeds: £1299.45 Losses in the year: £119.50 -Allowable costs (including purchase price): £1418.95 +Allowable costs (including purchase price): £1418.95 Net gain or loss: £-119.50 diff --git a/tests/test_cli/capital_gains_swks b/tests/test_cli/capital_gains_swks index c58a8f5..e737f68 100644 --- a/tests/test_cli/capital_gains_swks +++ b/tests/test_cli/capital_gains_swks @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------------------------------------------ Number of disposals: 2 Gains in the year, before losses: £10.92 Disposal proceeds: £331.34 Losses in the year: £13.95 -Allowable costs (including purchase price): £334.37 +Allowable costs (including purchase price): £334.37 Net gain or loss: £-3.03 Tax year 2022-2023 ------------------------------------------------------------------------------------------------------------------ @@ -18,5 +18,5 @@ Allowable costs (including purchase price): £334.37 ------------------------------------------------------------------------------------------------------------------ Number of disposals: 2 Gains in the year, before losses: £35.75 Disposal proceeds: £1292.64 Losses in the year: £114.47 -Allowable costs (including purchase price): £1371.36 +Allowable costs (including purchase price): £1371.36 Net gain or loss: £-78.72 diff --git a/tests/test_cli/capital_gains_swks_gains b/tests/test_cli/capital_gains_swks_gains index 6db2825..63a1251 100644 --- a/tests/test_cli/capital_gains_swks_gains +++ b/tests/test_cli/capital_gains_swks_gains @@ -6,7 +6,7 @@ ------------------------------------------------------------------------------------------------------------------ Number of disposals: 1 Gains in the year, before losses: £10.92 Disposal proceeds: £178.13 Losses in the year: £0.00 -Allowable costs (including purchase price): £167.21 +Allowable costs (including purchase price): £167.21 Net gain or loss: £10.92 Tax year 2022-2023 ------------------------------------------------------------------------------------------------------------------ @@ -16,5 +16,5 @@ Allowable costs (including purchase price): £167.21 ------------------------------------------------------------------------------------------------------------------ Number of disposals: 1 Gains in the year, before losses: £35.75 Disposal proceeds: £312.95 Losses in the year: £0.00 -Allowable costs (including purchase price): £277.20 +Allowable costs (including purchase price): £277.20 Net gain or loss: £35.75 diff --git a/tests/test_cli/capital_gains_swks_losses b/tests/test_cli/capital_gains_swks_losses index d0cc7d2..79093b9 100644 --- a/tests/test_cli/capital_gains_swks_losses +++ b/tests/test_cli/capital_gains_swks_losses @@ -6,7 +6,7 @@ ------------------------------------------------------------------------------------------------------------------ Number of disposals: 1 Gains in the year, before losses: £0.00 Disposal proceeds: £153.21 Losses in the year: £13.95 -Allowable costs (including purchase price): £167.16 +Allowable costs (including purchase price): £167.16 Net gain or loss: £-13.95 Tax year 2022-2023 ------------------------------------------------------------------------------------------------------------------ @@ -16,5 +16,5 @@ Allowable costs (including purchase price): £167.16 ------------------------------------------------------------------------------------------------------------------ Number of disposals: 1 Gains in the year, before losses: £0.00 Disposal proceeds: £979.69 Losses in the year: £114.47 -Allowable costs (including purchase price): £1094.16 +Allowable costs (including purchase price): £1094.16 Net gain or loss: £-114.47 diff --git a/tests/test_cli/capital_gains_ty2022 b/tests/test_cli/capital_gains_ty2022 index e23f845..10e7259 100644 --- a/tests/test_cli/capital_gains_ty2022 +++ b/tests/test_cli/capital_gains_ty2022 @@ -9,5 +9,5 @@ -------------------------------------------------------------------------------------------------------------------- Number of disposals: 4 Gains in the year, before losses: £1484.16 Disposal proceeds: £6553.93 Losses in the year: £119.50 -Allowable costs (including purchase price): £5189.27 +Allowable costs (including purchase price): £5189.27 Net gain or loss: £1364.66 diff --git a/tests/test_cli/capital_gains_ty2022_gains b/tests/test_cli/capital_gains_ty2022_gains index 5852f5b..cfee436 100644 --- a/tests/test_cli/capital_gains_ty2022_gains +++ b/tests/test_cli/capital_gains_ty2022_gains @@ -7,5 +7,5 @@ ------------------------------------------------------------------------------------------------------------------- Number of disposals: 2 Gains in the year, before losses: £1484.16 Disposal proceeds: £5254.48 Losses in the year: £0.00 -Allowable costs (including purchase price): £3770.32 +Allowable costs (including purchase price): £3770.32 Net gain or loss: £1484.16 diff --git a/tests/test_cli/capital_gains_ty2022_losses b/tests/test_cli/capital_gains_ty2022_losses index aecc68d..e641eed 100644 --- a/tests/test_cli/capital_gains_ty2022_losses +++ b/tests/test_cli/capital_gains_ty2022_losses @@ -7,5 +7,5 @@ ------------------------------------------------------------------------------------------------------------------- Number of disposals: 2 Gains in the year, before losses: £0.00 Disposal proceeds: £1299.45 Losses in the year: £119.50 -Allowable costs (including purchase price): £1418.95 +Allowable costs (including purchase price): £1418.95 Net gain or loss: £-119.50 diff --git a/tests/test_cli/capital_gains_ty2022_swks_gains b/tests/test_cli/capital_gains_ty2022_swks_gains index 77d03f1..1735f24 100644 --- a/tests/test_cli/capital_gains_ty2022_swks_gains +++ b/tests/test_cli/capital_gains_ty2022_swks_gains @@ -6,5 +6,5 @@ ------------------------------------------------------------------------------------------------------------------ Number of disposals: 1 Gains in the year, before losses: £35.75 Disposal proceeds: £312.95 Losses in the year: £0.00 -Allowable costs (including purchase price): £277.20 +Allowable costs (including purchase price): £277.20 Net gain or loss: £35.75 diff --git a/tests/test_cli/capital_gains_ty2022_swks_losses b/tests/test_cli/capital_gains_ty2022_swks_losses index 470758b..ca91ab8 100644 --- a/tests/test_cli/capital_gains_ty2022_swks_losses +++ b/tests/test_cli/capital_gains_ty2022_swks_losses @@ -6,5 +6,5 @@ ------------------------------------------------------------------------------------------------------------------ Number of disposals: 1 Gains in the year, before losses: £0.00 Disposal proceeds: £979.69 Losses in the year: £114.47 -Allowable costs (including purchase price): £1094.16 +Allowable costs (including purchase price): £1094.16 Net gain or loss: £-114.47