Skip to content

Commit

Permalink
'+ IBOND' button for treasury direct accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Jan 13, 2024
1 parent 3604601 commit c38e039
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Pages/AccountView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@
<tr style=background:black;color:white>
<td colspan=4>
<button @onclick='@(e=>addInvestment2(e,accBuffer))' style=margin-left:8px>holding</button>
@if (account.Custodian?.ToLowerInvariant() == "treasury direct" || account.Custodian?.ToLowerInvariant() == "treasurydirect")
{
<button @onclick='@(e=>addIBOND(e,accBuffer))' style=margin-left:8px>IBOND</button>
}
</td>

</tr>
<tr>
<td colspan=4 style=text-align:right;font-size:9pt;font-style:italic>
Expand Down Expand Up @@ -1011,6 +1016,22 @@
appData.ImportResult = null;
}

private void addIBOND(MouseEventArgs e, int accountIndex)
{
if (appData.FamilyData is not null) {
var account = appData.FamilyData.Accounts[accountIndex];
if (account.SelectedInvestment != null)
{
account.SelectedInvestment.Selected = false;
}

account.SelectedInvestment = new Investment(appData.FamilyData.PIN) { funds = Funds, Selected = true, Ticker = "IBOND" };
account.Investments.Add(account.SelectedInvestment);

account.SelectedInvestment.SelectedTransaction = new Transaction() { Type = "Edit" };
}
}

private void addInvestment2(MouseEventArgs e, int accountIndex) {
if (appData.FamilyData is not null) {
var account = appData.FamilyData.Accounts[accountIndex];
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.0115
# Version 1.0116

NETWORK:
*

0 comments on commit c38e039

Please sign in to comment.