Fix multi-currency imports (#94)

This commit is contained in:
hackerESQ
2025-05-02 18:14:06 -05:00
committed by GitHub
parent 17e5d8b665
commit de54b6843d
10 changed files with 80 additions and 62 deletions
+4 -3
View File
@@ -47,12 +47,13 @@ class ConfigSheet implements FromCollection, WithHeadings, WithTitle
]);
// reinvested holdings
Holding::myHoldings()->where('reinvest_dividends', true)->get()->each(function ($holding) use (&$configs) {
$reinvested_holdings = Holding::myHoldings()->where('reinvest_dividends', true)->get(['portfolio_id', 'symbol']);
if ($reinvested_holdings->isNotEmpty()) {
$configs->push([
'key' => 'reinvested_dividends',
'value' => $holding->id,
'value' => $reinvested_holdings->toJson(),
]);
});
}
return $configs;
}