AccountingNext/Schaad.Accounting.UI/Components/Pages/Reports/ProfitLossReport.razor.cs
Claudio Schaad 1a3d93e0e3 Remove dead and unused code
- CSS: drop the Bootstrap template leftovers (NavMenu.razor.css, most of
  MainLayout.razor.css, button/form rules in app.css) and the copied
  Fluent demo rules in BankTransactions.razor.css.
- Bootstrap: keep only bootstrap.min.css (+ map); 42 unused files removed.
- Credit-card statement import, never wired into the Blazor UI: service
  methods, GetCreditCardStatementPath, DI registrations for
  ICreditCardStatementService/IPdfParsingService, FreeSpire.PDF.
- CSV export (GetTransactionListCsvAsync), only called from tests.
- Split predefinitions: model, repository and the JSON editor entry.
- Unused members: TrySetYear, GetUploadPath (+ DataFolders.Uploads),
  GetClasses; unused usings, fields and parameters.
- Home.razor.css -> PendingBookings.razor.css: the pending-bookings table
  moved there in "PR U-10" and had lost its styling since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:46:08 +01:00

33 lines
No EOL
1.1 KiB
C#

using Microsoft.AspNetCore.Components;
using Schaad.Accounting.Datasets;
using Schaad.Accounting.Interfaces;
namespace Schaad.Accounting.UI.Components.Pages.Reports;
public partial class ProfitLossReport : ComponentBase
{
[Inject]
private IViewService viewService { get; set; } = null!;
[Inject]
private ISettingsService settingsService { get; set; } = null!;
private IReadOnlyList<AccountDataset>? accounts;
private decimal profit;
private decimal loss;
private decimal win;
private string header = "";
private string footer = "";
protected override async Task OnInitializedAsync()
{
accounts = await viewService.GetAccountViewListAsync();
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));
win = profit - loss;
(header, footer) = Report.GetViewDataTitleAndFooter("Erfolgsrechnung", settingsService);
await base.OnInitializedAsync();
}
}