Skip to content

Commit 575d4ea

Browse files
committed
Fix #135: net worth historical chart values appears too low.
Implement bar chart column mouse click to pivot networth report.
1 parent 41123ac commit 575d4ea

File tree

10 files changed

+25
-44
lines changed

10 files changed

+25
-44
lines changed

Source/WPF/MoneyPackage/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap">
3-
<Identity Name="43906ChrisLovett.MyMoney.Net" Publisher="CN=Chris Lovett, O=Chris Lovett, S=Washington, C=US" Version="2.1.0.41" />
3+
<Identity Name="43906ChrisLovett.MyMoney.Net" Publisher="CN=Chris Lovett, O=Chris Lovett, S=Washington, C=US" Version="2.1.0.42" />
44
<Properties>
55
<DisplayName>MyMoney.Net</DisplayName>
66
<PublisherDisplayName>Chris Lovett</PublisherDisplayName>

Source/WPF/MyMoney/Properties/PublishProfiles/ClickOnceProfile.pubxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
66
<PropertyGroup>
7-
<ApplicationRevision>41</ApplicationRevision>
8-
<ApplicationVersion>2.1.0.41</ApplicationVersion>
7+
<ApplicationRevision>42</ApplicationRevision>
8+
<ApplicationVersion>2.1.0.42</ApplicationVersion>
99
<BootstrapperEnabled>True</BootstrapperEnabled>
1010
<Configuration>Release</Configuration>
1111
<CreateWebPageOnPublish>True</CreateWebPageOnPublish>

Source/WPF/MyMoney/Reports/NetWorthReport.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ public override async Task Generate(IReportWriter writer)
294294
historicalChart.VerticalAlignment = VerticalAlignment.Top;
295295
historicalChart.HorizontalAlignment = HorizontalAlignment.Left;
296296
historicalChart.ContextMenu = new ContextMenu();
297+
historicalChart.ColumnClicked += this.OnBarChartColumnClicked;
297298
var menuItem = new MenuItem() { Header = "Export..." };
298299
menuItem.Click += this.ExportHistoryClick;
299300
historicalChart.ContextMenu.Items.Add(menuItem);
@@ -325,6 +326,12 @@ public override async Task Generate(IReportWriter writer)
325326
}
326327
}
327328

329+
private void OnBarChartColumnClicked(object sender, ChartDataValue e)
330+
{
331+
this.reportDate = (DateTime)e.UserData;
332+
this.Regenerate();
333+
}
334+
328335
private UIElement GenerateBarChartTips(ChartDataValue value)
329336
{
330337
var tip = new StackPanel() { Orientation = Orientation.Vertical };

Source/WPF/MyMoney/Setup/changes.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<changes>
3+
<change version="2.1.0.42" date="1/7/2025">
4+
- Fix #135: net worth historical chart values appears too low
5+
- Implement bar chart column mouse click to pivot networth report.
6+
</change>
37
<change version="2.1.0.41" date="1/3/2025">
48
- Don't store "N/A" in memo field from OFX downloads.
59
</change>

Source/WPF/MyMoney/StockQuotes/StockQuoteCache.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Threading.Tasks;
45
using System.Windows.Forms.Design.Behavior;
56
using Walkabout.Data;
@@ -172,21 +173,6 @@ internal async Task<StockQuoteIndex> LoadIndexFromHistory(Security s)
172173
return index;
173174
}
174175

175-
/// <summary>
176-
/// Use this method to provide stock quote info from Transactions in the case that
177-
/// you have a security that has no download stock price history, which can happen
178-
/// with custom securities that are not publicly traded.
179-
/// </summary>
180-
internal void SetQuote(DateTime date, Security security, decimal price)
181-
{
182-
if (!this.quoteIndex.TryGetValue(security, out StockQuoteIndex index))
183-
{
184-
// create an empty index that we can update below.
185-
this.quoteIndex[security] = new StockQuoteIndex();
186-
}
187-
this.quoteIndex[security].SetQuote(date, price);
188-
}
189-
190176
/// <summary>
191177
/// Provides optimized access to stock quotes
192178
/// </summary>

Source/WPF/MyMoney/Views/GraphGenerators.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,6 @@ public async Task Prepare(IStatusService status)
223223
case InvestmentType.Add:
224224
if (i.Units > 0)
225225
{
226-
if (i.UnitPrice != 0)
227-
{
228-
// In case we don't have any online stock quote histories this at least
229-
// tells our StockQuotesByDate what the unit price was on the date of this
230-
// transaction.
231-
this.RecordPrice(i.Date, s, i.UnitPrice);
232-
}
233226
holdings.Buy(i.Security, i.Date, i.Units, i.OriginalCostBasis);
234227
foreach (var sale in holdings.ProcessPendingSales(i.Security))
235228
{
@@ -241,10 +234,6 @@ public async Task Prepare(IStatusService status)
241234
case InvestmentType.Sell:
242235
if (i.Units > 0)
243236
{
244-
if (i.UnitPrice != 0)
245-
{
246-
this.RecordPrice(i.Date, s, i.UnitPrice);
247-
}
248237
if (i.Transaction.Transfer == null)
249238
{
250239
foreach (var sale in holdings.Sell(s, i.Date, i.Units, i.OriginalCostBasis))
@@ -324,14 +313,6 @@ private async Task<decimal> ComputeMarketValue(DateTime date, AccountHoldings ho
324313
return total;
325314
}
326315

327-
private void RecordPrice(DateTime date, Security security, decimal price)
328-
{
329-
if (security != null && this.cache != null)
330-
{
331-
this.cache.SetQuote(date, security, price);
332-
}
333-
}
334-
335316
private void ApplyPendingSplits(DateTime dateTime, AccountHoldings holding)
336317
{
337318
// When a stock split becomes due we remove it from the pendingSplits

Source/WPF/Version/Version.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
// And also sync this with the MSIX package manifest in
77
// ~\MyMoney.Net\Source\WPF\MoneyPackage\Package.appxmanifest
88

9-
[assembly: AssemblyVersion("2.1.0.41")]
10-
[assembly: AssemblyFileVersion("2.1.0.41")]
9+
[assembly: AssemblyVersion("2.1.0.42")]
10+
[assembly: AssemblyFileVersion("2.1.0.42")]

Source/WPF/Version/Version.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<ApplicationRevision>41</ApplicationRevision>
5-
<ApplicationVersion>2.1.0.41</ApplicationVersion>
4+
<ApplicationRevision>42</ApplicationRevision>
5+
<ApplicationVersion>2.1.0.42</ApplicationVersion>
66
</PropertyGroup>
77
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0.41
1+
2.1.0.42

docs/Reports/NetworthReport.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ This report summarizes the current value of all your holdings up to the
88
given date and subtracts credit card balances, and any loans to provide a net worth total.
99

1010
You can pick different dates to get a detailed report for any date that you have historical
11-
stock quote data for, see [StockQuoteService](../Accounts/StockQuoteServices.md).
11+
stock quote data for. Simply edit the date field.
12+
13+
Historical stock quotes come from your configured [StockQuoteService](../Accounts/StockQuoteServices.md).
1214

1315
You can also create [Asset](../Accounts/Assets.md) accounts to cover the value of personal property so those show up in the report also.  Just set the Account Type to "Asset" in the Account properties dialog.
1416

15-
The bar chart shows the networth back in time.
17+
The bar chart shows the networth back in time. You can click a bar chart column to regenerate the report
18+
for the date listed in the tooltip for that bar.

0 commit comments

Comments
 (0)