From 00d74e646abdca52e7838d2737c4a00dbb5275c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20G=C3=BChne=20=28Marfir=29?= Date: Thu, 6 Apr 2023 20:53:11 +0200 Subject: [PATCH] #3237: change supported period to 1 year --- .../portfolio/ui/views/StatementOfAssetsViewer.java | 4 ++-- .../name/abuchen/portfolio/snapshot/ReportingPeriod.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/StatementOfAssetsViewer.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/StatementOfAssetsViewer.java index 458a3ccb44..d4ed206824 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/StatementOfAssetsViewer.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/StatementOfAssetsViewer.java @@ -69,7 +69,7 @@ import name.abuchen.portfolio.snapshot.ClientSnapshot; import name.abuchen.portfolio.snapshot.GroupByTaxonomy; import name.abuchen.portfolio.snapshot.ReportingPeriod; -import name.abuchen.portfolio.snapshot.ReportingPeriod.SinceX; +import name.abuchen.portfolio.snapshot.ReportingPeriod.LastXYears; import name.abuchen.portfolio.snapshot.SecurityPosition; import name.abuchen.portfolio.snapshot.filter.ClientFilter; import name.abuchen.portfolio.snapshot.filter.ReadOnlyAccount; @@ -751,7 +751,7 @@ private void addDividendColumns(List options) // dividend yield on costs column = new Column("yocdiv", Messages.ColumnDividendYieldOnCost, SWT.RIGHT, 80); //$NON-NLS-1$ column.setOptions(new ReportingPeriodColumnOptions(Messages.ColumnDividendYieldOnCost + " {0}", // $NON-NLS-1$ //$NON-NLS-1$ - List.of(new SinceX(LocalDate.now().minusDays(365))))); + List.of(new LastXYears(1)))); column.setGroupLabel(Messages.GroupLabelDividends); column.setDescription(Messages.ColumnDividendYieldOnCost_Description); column.setVisible(false); diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ReportingPeriod.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ReportingPeriod.java index 610a719f0a..b1f481d39f 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ReportingPeriod.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ReportingPeriod.java @@ -122,6 +122,15 @@ public String getCode() return buf.toString(); } + public static class LastXYears extends LastX + { + + public LastXYears(int years) + { + super(years, 0); + } + } + public static class LastX extends ReportingPeriod { private final int years;