I am using Manager for stocks accounting (investing in shares of public companies). The inventory items represent shares of specific companies. When inventory items are sold, the proceeds minus the average cost of the inventory items sold equals capital gain/loss.
I encountered a situation where the average cost of the items sold is not calculated correctly when the following events happen in this exact order:
Event #1 - Apr 9, 2020 - bought 11,000 shares of Company X at $45.85 per share
Event #2 - Apr 9, 2020 - bought 7,000 shares of Company X at $46.55 per share
Event #3 - Apr 14, 2020 - bought 2,000 shares of Company X at $49.65 per share
Event #4 - Apr 15, 2020 - sold 20,000 shares of Company X at $46.75 per share
Event #5 - Apr 15, 2020 - bought 20,000 shares of Company X at $46.75 per share
If I look at the “Inventory Items” tab after these events, I see 20,000 items of Company X with average cost of $46.61. Clearly that’s an error, because at event #5 I paid $46.75 per share and not $46.61 and prior to event #5 I had no shares of this company as they were all sold in event #4. The computation of income and Profit Margin report also appear to be incorrect as a result.
If I change the date of event #5 to Apr 16, 2020, then everything gets calculated correctly. It appears to me that since the last 2 events are on the same day, they are processed by Manager in the wrong order, where share balance first goes to 40,000 and is averaged with events #1, #2 and #3 and then goes back down to 20,000 after even #4. That however is not the correct sequence of events and therefore the result is also incorrect.
I believe this is a small bug that needs to be fixed. Your thoughts/suggestions? I would prefer to keep the date for event #5 as Apr 15, 2020 and changing it I view as a hack.