mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
When creating a SELL activity with a non-zero fee, the cash balance on the account was credited by (quantity * unitPrice) + fee instead of (quantity * unitPrice) - fee, inflating the cash balance by 2x the fee. The previous logic added the fee to the gross magnitude before negating the entire amount for BUY/FEE. SELL (and DIVIDEND/INTEREST/LIABILITY when carrying a fee) therefore received +gross + fee. Compute the signed gross amount first, then subtract the fee unconditionally — fees always reduce cash regardless of activity direction.pull/6862/head
2 changed files with 10 additions and 4 deletions
Loading…
Reference in new issue