Skip to content

Commit

Permalink
Merge pull request #53 from alexpung/bugfix-GainShouldBeZeroInAcquisi…
Browse files Browse the repository at this point in the history
…tionTrade

Supress gain calculation in an acquisition trade
  • Loading branch information
alexpung authored Jan 22, 2024
2 parents 3419155 + 66d3629 commit 25b6a81
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TradeTaxCalculation : ITradeTaxCalculation
public List<TradeMatch> MatchHistory { get; init; } = [];
public WrappedMoney TotalAllowableCost => MatchHistory.Sum(tradeMatch => tradeMatch.BaseCurrencyMatchAllowableCost);
public WrappedMoney TotalProceeds => MatchHistory.Sum(tradeMatch => tradeMatch.BaseCurrencyMatchDisposalProceed);
public WrappedMoney Gain => TotalProceeds - TotalAllowableCost;
public WrappedMoney Gain => AcquisitionDisposal == TradeType.DISPOSAL ? TotalProceeds - TotalAllowableCost : WrappedMoney.GetBaseCurrencyZero();
/// <summary>
/// For acquistion: Cost of buying + commission
/// For disposal: Proceed you get - commission
Expand Down

0 comments on commit 25b6a81

Please sign in to comment.