Extract ReportHeader, ReportDivider, ReportSectionHeader, and
ReportFooter under Components/Pages/Reports/ and adopt them across
BalanceReport, BalanceSheetReport, ProfitLossReport, and DetailReport.
Row shapes are unchanged; the primitives just fold the divider hr
rows (30+ occurrences), section headers (8), and header/footer (4
each). ProfitLossReport / DetailReport also drop leftover
`m.Class == 3/4` magic numbers for ClassIds. Print CSS gains
`table.report tr { page-break-inside: avoid; }` so section headers
don't land at the bottom of a page alone. Net -88 lines across the
four report razor files.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
61 lines
2 KiB
Text
61 lines
2 KiB
Text
@page "/BalanceSheetReport"
|
|
|
|
@if (balanceSheet is null)
|
|
{
|
|
<Loading/>
|
|
return;
|
|
}
|
|
|
|
<ReportHeader Title="@header"/>
|
|
|
|
<table class="report">
|
|
<tbody>
|
|
<ReportSectionHeader Title="Einnahmen" Colspan="3"/>
|
|
@foreach (var account in balanceSheet.ActivaAccountList.OrderBy(m => m.Number))
|
|
{
|
|
@if (account.StartBalanceCHF == 0) { continue; }
|
|
|
|
<tr>
|
|
<td>@account.Number</td>
|
|
<td>Vortrag von @(balanceSheet.Year - 1) / @account.Name</td>
|
|
<td class="right">@Math.Abs(account.StartBalanceCHF).ToFormattedString()</td>
|
|
</tr>
|
|
}
|
|
@foreach (var account in balanceSheet.IncomeAccountList.OrderBy(m => m.Number))
|
|
{
|
|
@if (account.BalanceCHF == 0) { continue; }
|
|
|
|
<tr>
|
|
<td>@account.Number</td>
|
|
<td>@account.Name</td>
|
|
<td class="right">@Math.Abs(account.BalanceCHF).ToFormattedString()</td>
|
|
</tr>
|
|
}
|
|
<ReportDivider Colspan="3"/>
|
|
<ReportSectionHeader Title="Ausgaben" Colspan="3"/>
|
|
@foreach (var account in balanceSheet.ExpensesAccountList.OrderBy(m => m.Number))
|
|
{
|
|
@if (account.BalanceCHF == 0) { continue; }
|
|
|
|
<tr>
|
|
<td>@account.Number</td>
|
|
<td>@account.Name</td>
|
|
<td class="right">@account.BalanceCHF.ToFormattedString()</td>
|
|
</tr>
|
|
}
|
|
<ReportDivider Colspan="3"/>
|
|
<tr>
|
|
<td colspan="2">Total Einnahmen</td>
|
|
<td class="right">@balanceSheet.ProfitCHF.ToFormattedString()</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">Total Ausgaben</td>
|
|
<td class="right sum">-@balanceSheet.LossCHF.ToFormattedString()</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" class="total">Übertrag @(balanceSheet.Year + 1)</td>
|
|
<td class="right total sum">CHF @win.ToFormattedString()</td>
|
|
</tr>
|
|
<ReportFooter Footer="@footer"/>
|
|
</tbody>
|
|
</table>
|