Skip to content

Commit

Permalink
FCASH is a cash account at fidelity
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Dec 19, 2023
1 parent 3114e09 commit 5189ad8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions Shared/Models/Importer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,13 @@ private static async Task<List<Account>> ImportFidelity(IAsyncEnumerator<string[
var accountName = chunks[1];
var symbol = chunks[2];

// many tickers have "**" at end, signifying money market fund.
if (symbol.Length >= 2 && symbol.Substring(symbol.Length-2) == "**") {
symbol = symbol.Substring(0, symbol.Length - 2);
}

string? investmentName;
double value;
double? price = null;
double? shares = null;
double? costBasis = null;
double? expenseRatio = null;

// many tickers have "**" at end, signifying money market fund.
if (symbol.Length >= 2 && symbol.Substring(symbol.Length-2) == "**") {
symbol = symbol.Substring(0, symbol.Length - 2);
}

if (symbol == "Pending Activity")
{
investmentName = symbol;
Expand All @@ -205,6 +195,13 @@ private static async Task<List<Account>> ImportFidelity(IAsyncEnumerator<string[
costBasis = FormatUtilities.ParseDouble(chunks[13], allowCurrency:true);
}

// many tickers have "**" at end, signifying money market fund.
if (symbol.Length >= 2 && symbol.Substring(symbol.Length-2) == "**") {
symbol = symbol.Substring(0, symbol.Length - 2);
shares = value;
price = 1.0;
}

if (lastAccountNumber != accountNumber)
{
newAccount = new(PIN) {
Expand All @@ -222,7 +219,7 @@ private static async Task<List<Account>> ImportFidelity(IAsyncEnumerator<string[
newInvestment.ExpenseRatio = expenseRatio;
}

if (newInvestment.Ticker == "PENDING") {
if (newInvestment.Ticker == "PENDING" || newInvestment.Ticker == "FCASH") {
newInvestment.AssetType = global::AssetType.Cash;
}

Expand Down
2 changes: 1 addition & 1 deletion wwwroot/cache.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CACHE MANIFEST

# Version 1.0099
# Version 1.0100

NETWORK:
*

0 comments on commit 5189ad8

Please sign in to comment.