fix math for reinvestments

This commit is contained in:
hackerESQ
2024-10-18 22:08:52 -05:00
parent da9e7dd5c7
commit 3cb0ad5c86
+1 -1
View File
@@ -153,7 +153,7 @@ class Dividend extends Model
'symbol' => $holding->symbol,
'transaction_type' => "BUY",
'reinvested_dividend' => true,
'cost_basis' => $market_data->market_value,
'cost_basis' => 0,
'quantity' => ($dividend['dividend_amount'] * $holding->qtyOwned(Carbon::parse($dividend['date']))) / $market_data->market_value,
]);
}