AccountingNext/Schaad.Accounting.UI/Components/Pages/Dialogs/WaterHeatingBillDialog.razor
Claudio Schaad 5457bd74b8 Strom: align labels and inputs in the bill dialog
The dialog field grid of Wasser & Heizung moves to app.css (.dialog-fields/.dialog-field) and is used by the Strom dialog too, which is now as wide (760px).

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

111 lines
5.6 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@implements IDialogContentComponent<Schaad.Accounting.Models.WaterHeatingBill>
@rendermode InteractiveServer
@using Schaad.Accounting.Models
<FluentDialogHeader ShowDismiss="true">
<FluentStack VerticalAlignment="VerticalAlignment.Center">
<FluentIcon Value="@(new Icons.Regular.Size24.WindowApps())" />
<FluentLabel Typo="Typography.PaneHeader">
@Dialog.Instance.Parameters.Title
</FluentLabel>
</FluentStack>
</FluentDialogHeader>
<FluentDialogBody>
<EditForm EditContext="@editContext">
<DataAnnotationsValidator />
<div class="dialog-fields">
<div class="dialog-field"><FluentDatePicker @bind-Value="@periodFrom" @bind-Value:after="SyncPeriod" Label="Von" /></div>
<div class="dialog-field"><FluentDatePicker @bind-Value="@periodTo" @bind-Value:after="SyncPeriod" Label="Bis" /></div>
</div>
<div style="@SectionStyle">NeoVac – Ablesequittung</div>
<div class="dialog-fields">
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WarmWaterM3" @bind-Value:after="Content.CalculateCosts" Label="Warmwasser (m³)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.ColdWaterM3" @bind-Value:after="Content.CalculateCosts" Label="Kaltwasser (m³)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.HeatingMwh" Label="Wärme (MWh)" /></div>
</div>
<div style="@SectionStyle">NeoVac – Anteil (‰)</div>
<div class="dialog-fields">
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WaterBasePermille" @bind-Value:after="Content.CalculateCosts" Label="Wasser Grund (‰)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WaterConsumptionPermille" @bind-Value:after="Content.CalculateCosts" Label="Wasser Verbrauch (‰)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.HeatingPermille" @bind-Value:after="Content.CalculateCosts" Label="Heizung total (‰)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WarmWaterHeatingPermille" @bind-Value:after="Content.CalculateCosts" Label="Heizung WW (‰)" /></div>
</div>
<div style="@SectionStyle">Verwaltung – Ihr Anteil</div>
<div class="dialog-fields">
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WaterCostsChf" @bind-Value:after="Content.CalculateCosts" Label="Wasserkosten (CHF)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.HeatingCostsChf" @bind-Value:after="Content.CalculateCosts" Label="Heizkosten (CHF)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.ManagerWaterPermille" Label="Wasser (‰, optional)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.ManagerHeatingPermille" Label="Heizung (‰, optional)" /></div>
</div>
<div>
<FluentValidationSummary />
</div>
</EditForm>
<div style="margin-top: 12px; font-size: 13px; color: #52514e;">
Wasser: Grundkosten <strong>@Chf(Content.BaseCostsChf)</strong>
· Warmwasser <strong>@Chf(Content.WarmWaterChf)</strong>
· Kaltwasser <strong>@Chf(Content.ColdWaterChf)</strong>
</div>
<div style="margin-top: 4px; font-size: 13px; color: #52514e;">
Heizung: Warmwasser <strong>@Chf(Content.WarmWaterHeatingChf)</strong>
· Räume <strong>@Chf(Content.RoomHeatingChf)</strong>
</div>
<div style="margin-top: 4px; font-size: 13px; color: #52514e;">
Total <strong>@M3(Content.TotalM3)</strong> · <strong>@Mwh(Content.HeatingMwh)</strong> · <strong>@Chf(Content.TotalChf)</strong>
</div>
@if (Checks is { Count: > 0 } checks)
{
<div style="@SectionStyle">Kontrolle</div>
@foreach (var check in checks)
{
<div style="font-size: 13px; color: @CheckColor(check.Result);">@CheckSymbol(check.Result) @check.Text</div>
}
}
<FluentButton Appearance="Appearance.Lightweight" Style="margin-top: 12px; padding: 0; font-size: 13px;" OnClick="ShowGuideAsync">
Woher kommen die Werte? (NeoVac-Abrechnung)
</FluentButton>
</FluentDialogBody>
<FluentDialogFooter>
<FluentButton Appearance="Appearance.Neutral"
OnClick="@CancelAsync">
Abbrechen
</FluentButton>
<FluentButton Appearance="Appearance.Accent"
Disabled="@(periodFrom is null || periodTo is null)"
OnClick="@SaveAsync">
Speichern
</FluentButton>
</FluentDialogFooter>
@code {
private const string SectionStyle = "margin-top: 14px; margin-bottom: 4px; font-size: 11px; font-weight: bold; color: #898781; text-transform: uppercase;";
// Shown in its own dialog (see ShowGuideAsync) instead of expanding inline: this dialog has a
// fixed Height, and FluentDialogBody doesn't resize to fit growing content.
private RenderFragment GuideImage =>
@<img src="/images/water-heating-bill-guide.svg"
alt="Beispiel-Abrechnung mit Markierungen, welcher Wert in welches Feld gehört"
style="width: 100%; height: auto; display: block;" />;
private static string CheckSymbol(BillCheckResult result) => result switch
{
BillCheckResult.Ok => "✓",
BillCheckResult.Warning => "⚠",
_ => "·"
};
private static string CheckColor(BillCheckResult result) => result switch
{
BillCheckResult.Ok => "#1a7f37",
BillCheckResult.Warning => "#c4314b",
_ => "#52514e"
};
}