From 3cb0ad5c86e7f624b016800a1a6aa3f2cfbc737f Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Fri, 18 Oct 2024 22:08:52 -0500 Subject: [PATCH] fix math for reinvestments --- app/Models/Dividend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Dividend.php b/app/Models/Dividend.php index 1a0b477..b6fe241 100644 --- a/app/Models/Dividend.php +++ b/app/Models/Dividend.php @@ -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, ]); }