using Microsoft.AspNetCore.Components; using Schaad.Accounting.Datasets; using Schaad.Accounting.Interfaces; namespace Schaad.Accounting.UI.Components.Pages.Reports; public partial class DetailReport : ComponentBase { [Inject] private IViewService viewService { get; set; } = null!; [Inject] private ISettingsService settingsService { get; set; } = null!; private IReadOnlyList? accounts; private IReadOnlyList? transactions; private decimal profit; private decimal loss; private string header = ""; private string footer = ""; protected override async Task OnInitializedAsync() { accounts = await viewService.GetAccountViewListAsync(); transactions = await viewService.GetTransactionViewListAsync(); profit = Math.Abs(accounts.Where(m => m.Class == ClassIds.Income).Sum(m => m.Balance)); loss = Math.Abs(accounts.Where(m => m.Class == ClassIds.Expenses).Sum(m => m.Balance)); (header, footer) = Report.GetViewDataTitleAndFooter("Detailaufstellung", settingsService); await base.OnInitializedAsync(); } }