AccountingNext/Schaad.Accounting.UI/Components/Pages/Dialogs/ElectricityBillDialog.razor
Claudio Schaad b3bb041317 Strom: align labels and inputs in the bill dialog (#20)
Co-authored-by: Claudio Schaad <c.schaad@pog.ch>
Co-committed-by: Claudio Schaad <c.schaad@pog.ch>
2026-11-01 18:45:15 +00:00

58 lines
2.6 KiB
Text

@implements IDialogContentComponent<Schaad.Accounting.Models.ElectricityBill>
@rendermode InteractiveServer
<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" Label="Von" /></div>
<div class="dialog-field"><FluentDatePicker @bind-Value="@periodTo" Label="Bis" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.GridKwh" Label="Netzbezug (kWh)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.PvKwh" Label="PV-Produktion (kWh)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.GridChf" Label="Netzbezug (CHF)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.PvChf" Label="PV (CHF)" /></div>
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.SideCostsChf" Label="Nebenkosten (CHF)" /></div>
</div>
<div>
<FluentValidationSummary />
</div>
</EditForm>
<div style="margin-top: 12px; font-size: 13px; color: #52514e;">
Total <strong>@Chf(Content.TotalChf)</strong>
</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 {
// 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/electricity-bill-guide.svg"
alt="Beispiel-Abrechnung mit Markierungen, welcher Wert in welches Feld gehört"
style="width: 100%; height: auto; display: block;" />;
}