AccountingNext/Schaad.Accounting.UI/Components/Pages/WaterHeating.razor
Claudio Schaad 53e4854bc2 Add "Wasser & Heizung" page for the NeoVac water and heating bills
NeoVac only reports per-mille shares of the property; the own costs in CHF
come from the property manager's statement. The new page stores both in
water-heating.json (per mandator) and calculates the CHF parts: water base
and consumption costs by their per-mille share, consumption split by m³
into warm and cold water, and the warm water part of the heating costs
(the rest is room heating). Charts for water (m³), heat (MWh) and the
stacked costs; the dialog has a guide image showing where each value is
on the bills. The Wasser page stays for bills with the CHF values entered
directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 19:18:03 +01:00

61 lines
3.8 KiB
Text

@page "/water-heating"
@rendermode InteractiveServer
@using Schaad.Accounting.UI.Components.Pages.Analytics
<PageTitle>Wasser &amp; Heizung</PageTitle>
<div class="water-heating">
<FluentStack Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentButton IconStart="@(new Icons.Regular.Size16.Add())" Appearance="Appearance.Neutral" OnClick="AddAsync">Neue Abrechnung hinzufügen</FluentButton>
</FluentStack>
@if (source.Count == 0)
{
<FluentMessageBar Intent="MessageIntent.Info" AllowDismiss="false">Noch keine Abrechnungen erfasst.</FluentMessageBar>
}
else
{
<BillChartToolbar Filter="@filter" FilterChanged="@OnFilterChanged" Years="@years" IsSplit="@isSplit" />
<div class="pair">
<FluentCard class="chart-card">
<div class="card-title">Wasserverbrauch @PerPeriod</div>
<ChartJsChart Kind="stackedBar" Data="@waterData" Height="360px"
AriaLabel="@($"Warm- und Kaltwasserverbrauch {PerPeriod}, gestapelte Balken in m³")" />
</FluentCard>
<FluentCard class="chart-card">
<div class="card-title">Wärmeverbrauch @PerPeriod</div>
<ChartJsChart Kind="stackedBar" Data="@heatData" Height="360px"
AriaLabel="@($"Wärmeverbrauch {PerPeriod}, Balken in MWh")" />
</FluentCard>
</div>
<FluentCard class="chart-card">
<div class="card-title">Kosten @PerPeriod</div>
<ChartJsChart Kind="stackedBar" Data="@costData" Height="320px"
AriaLabel="@($"Kosten {PerPeriod}, gestapelte Balken in CHF: Grundkosten Wasser, Kalt- und Warmwasser, Heizung Warmwasser und Räume")" />
</FluentCard>
}
<div class="table-scroll">
<FluentDataGrid Items="@source.AsQueryable()" RowSize="DataGridRowSize.Medium">
<PropertyColumn Title="Von" Property="@(p => p.PeriodFrom)" Format="dd.MM.yyyy" Sortable="true" IsDefaultSortColumn="true" InitialSortDirection="SortDirection.Descending" />
<PropertyColumn Title="Bis" Property="@(p => p.PeriodTo)" Format="dd.MM.yyyy" Sortable="true" />
<PropertyColumn Title="Warmwasser m³" Property="@(p => p.WarmWaterM3)" Format="#,0.00" Align="Align.End" />
<PropertyColumn Title="Kaltwasser m³" Property="@(p => p.ColdWaterM3)" Format="#,0.00" Align="Align.End" />
<PropertyColumn Title="Wärme MWh" Property="@(p => p.HeatingMwh)" Format="#,0.000" Align="Align.End" />
<PropertyColumn Title="Grundkosten" Property="@(p => p.BaseCostsChf)" Format="C2" Align="Align.End" />
<PropertyColumn Title="Warmwasser CHF" Property="@(p => p.WarmWaterChf)" Format="C2" Align="Align.End" />
<PropertyColumn Title="Kaltwasser CHF" Property="@(p => p.ColdWaterChf)" Format="C2" Align="Align.End" />
<PropertyColumn Title="Heizung Warmwasser" Property="@(p => p.WarmWaterHeatingChf)" Format="C2" Align="Align.End" />
<PropertyColumn Title="Heizung Räume" Property="@(p => p.RoomHeatingChf)" Format="C2" Align="Align.End" />
<PropertyColumn Title="Total CHF" Property="@(p => p.TotalChf)" Format="C2" Align="Align.End" />
<TemplateColumn Align="Align.Center" Width="50px">
<FluentButton IconEnd="@(new Icons.Regular.Size16.Delete())" Appearance="Appearance.Neutral" title="Löschen" aria-label="Löschen" OnClick="@(() => DeleteAsync(context.Id))" />
</TemplateColumn>
<TemplateColumn Align="Align.Center" Width="50px">
<FluentButton IconEnd="@(new Icons.Regular.Size16.Edit())" Appearance="Appearance.Neutral" title="Bearbeiten" aria-label="Bearbeiten" OnClick="@(() => EditAsync(context.Id))" />
</TemplateColumn>
</FluentDataGrid>
</div>
</div>