fix math for reinvestments
This commit is contained in:
@@ -153,7 +153,7 @@ class Dividend extends Model
|
|||||||
'symbol' => $holding->symbol,
|
'symbol' => $holding->symbol,
|
||||||
'transaction_type' => "BUY",
|
'transaction_type' => "BUY",
|
||||||
'reinvested_dividend' => true,
|
'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,
|
'quantity' => ($dividend['dividend_amount'] * $holding->qtyOwned(Carbon::parse($dividend['date']))) / $market_data->market_value,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user