AccountingNext/Schaad.Accounting.UI/Components/Pages/Reports/BalanceReport.razor
Claudio Schaad 1c5227ab9a PR U-12: report primitives + print CSS
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>
2026-07-07 08:15:00 +02:00

79 lines
2.6 KiB
Text

@page "/BalanceReport"
@if (balance is null)
{
<Loading/>
return;
}
<ReportHeader Title="@header"/>
<table class="report">
<thead>
<tr>
<th>Konto</th>
<th>Bezeichnung</th>
<th class="right">Aktiven</th>
<th class="right">Passiven</th>
</tr>
<tr>
<th colspan="4"><hr/></th>
</tr>
</thead>
<tbody>
<ReportSectionHeader Title="Aktiven" Colspan="4"/>
@foreach (var account in balance.ActivaAccountList.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>
<td></td>
</tr>
}
<ReportDivider Colspan="4"/>
<tr>
<td colspan="2" class="total">Total Aktiven</td>
<td class="right total">CHF @balance.TotalActivaCHF.ToFormattedString()</td>
<td></td>
</tr>
<ReportDivider Colspan="4"/>
<ReportSectionHeader Title="Passiven" Colspan="4"/>
@foreach (var account in balance.PassivaAccountList.OrderBy(m => m.Number))
{
@if (account.BalanceCHF == 0) { continue; }
<tr>
<td>@account.Number</td>
<td>@account.Name</td>
<td></td>
<td class="right">@Math.Abs(account.BalanceCHF).ToFormattedString()</td>
</tr>
}
<ReportDivider Colspan="4"/>
<tr>
<td colspan="2" class="total">Total Passiven</td>
<td></td>
<td class="right total">@balance.TotalPassivaCHF.ToFormattedString()</td>
</tr>
<ReportDivider Colspan="4"/>
<tr>
<td colspan="2" class="total">Total</td>
<td class="right">@balance.TotalActivaCHF.ToFormattedString()</td>
<td class="right">@balance.TotalPassivaCHF.ToFormattedString()</td>
</tr>
<tr>
<td colspan="2" class="total">Eigenkapital</td>
<td class="right sum"></td>
<td class="right sum">@win.ToFormattedString()</td>
</tr>
<tr>
<td colspan="2" class="total">Bilanzsumme</td>
<td class="right total sum">CHF @balance.TotalActivaCHF.ToFormattedString()</td>
<td class="right total sum">CHF @((balance.TotalPassivaCHF + win).ToFormattedString())</td>
</tr>
<ReportFooter Footer="@footer" Colspan="4"/>
</tbody>
</table>