diff --git a/CHANGELOG.md b/CHANGELOG.md index c24baa5..42f96fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### 1.1.1 (2020-09-07) + +* [Fixed] Wrong creation of data for new Rules if the initial selection was used #13 +* [Fixed] Missing months for Monthly Bucket Expenses Reports in case of no data #14 +* [Fixed] Crashes on Report Page due to display split of Monthly Bucket Expenses Reports #15 + ### 1.1 (2020-09-05) * [Add] Added Rule set for automatic Bucket assignments #5 diff --git a/OpenBudgeteer.Blazor/Pages/Report.razor b/OpenBudgeteer.Blazor/Pages/Report.razor index 06925f3..bdfc702 100644 --- a/OpenBudgeteer.Blazor/Pages/Report.razor +++ b/OpenBudgeteer.Blazor/Pages/Report.razor @@ -88,6 +88,6 @@ int halfIndex = _dataContext.MonthBucketExpensesConfigs.Count / 2; _monthBucketExpensesConfigsLeft.AddRange(_dataContext.MonthBucketExpensesConfigs.ToList().GetRange(0,halfIndex)); - _monthBucketExpensesConfigsRight.AddRange(_dataContext.MonthBucketExpensesConfigs.ToList().GetRange(halfIndex,halfIndex+1)); + _monthBucketExpensesConfigsRight.AddRange(_dataContext.MonthBucketExpensesConfigs.ToList().GetRange(halfIndex,_dataContext.MonthBucketExpensesConfigs.Count - halfIndex)); } } diff --git a/OpenBudgeteer.Blazor/Shared/NavMenu.razor b/OpenBudgeteer.Blazor/Shared/NavMenu.razor index c398356..4651a58 100644 --- a/OpenBudgeteer.Blazor/Shared/NavMenu.razor +++ b/OpenBudgeteer.Blazor/Shared/NavMenu.razor @@ -52,7 +52,7 @@ diff --git a/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs b/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs index 0baaf89..b691cca 100644 --- a/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs +++ b/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs @@ -221,12 +221,23 @@ public async Task> LoadMonthExpen .ToList(); // Collect results + if (queryResults.Count == 0) continue; // No data available. Nothing to add newReportRecord.BucketName = bucket.Name; + var reportInsertMonth = queryResults.First().YearMonth; foreach (var queryResult in queryResults) { + // Create empty MonthlyResults in case no data for specific months are available + while (queryResult.YearMonth != reportInsertMonth) + { + newReportRecord.MonthlyResults.Add(new Tuple( + reportInsertMonth, + 0)); + reportInsertMonth = reportInsertMonth.AddMonths(1); + } newReportRecord.MonthlyResults.Add(new Tuple( - queryResult.YearMonth, - queryResult.Balance)); + queryResult.YearMonth, + queryResult.Balance)); + reportInsertMonth = reportInsertMonth.AddMonths(1); } } result.Add(newReportRecord); diff --git a/OpenBudgeteer.Core/ViewModels/RulesViewModel.cs b/OpenBudgeteer.Core/ViewModels/RulesViewModel.cs index 0bd16d8..34992da 100644 --- a/OpenBudgeteer.Core/ViewModels/RulesViewModel.cs +++ b/OpenBudgeteer.Core/ViewModels/RulesViewModel.cs @@ -84,7 +84,13 @@ public Tuple CreateNewRuleSet() public void ResetNewRuleSet() { NewRuleSet = new RuleSetViewModelItem(_dbOptions); - NewRuleSet.MappingRules.Add(new MappingRuleViewModelItem(_dbOptions, new MappingRule())); + // Defaults required because if initial selection in UI will not be updated by User + // then binding will not update these properties + NewRuleSet.MappingRules.Add(new MappingRuleViewModelItem(_dbOptions, new MappingRule() + { + ComparisionField = 1, + ComparisionType = 1 + })); } public Tuple SaveRuleSetItem(RuleSetViewModelItem ruleSet)