101 lines
3.6 KiB
Plaintext
101 lines
3.6 KiB
Plaintext
@using GoodWood.Application.DTOs
|
|
@using GoodWood.Application.Interfaces
|
|
|
|
@inject ISepaExportService SepaExportService
|
|
|
|
<MudDialog>
|
|
<TitleContent>
|
|
<MudText Typo="Typo.h6">SEPA Export Details</MudText>
|
|
</TitleContent>
|
|
<DialogContent>
|
|
@if (_loading)
|
|
{
|
|
<MudProgressCircular Indeterminate="true" />
|
|
}
|
|
else if (_exportDetails is not null)
|
|
{
|
|
<MudStack Spacing="3">
|
|
<MudPaper Class="pa-3" Elevation="0">
|
|
<MudGrid>
|
|
<MudItem xs="6">
|
|
<MudText Typo="Typo.caption" Color="Color.Secondary">Beschreibung</MudText>
|
|
<MudText Typo="Typo.body1">@_exportDetails.Description</MudText>
|
|
</MudItem>
|
|
<MudItem xs="6">
|
|
<MudText Typo="Typo.caption" Color="Color.Secondary">Einzugsdatum</MudText>
|
|
<MudText Typo="Typo.body1">@_exportDetails.RequestedCollectionDate.ToString("dd.MM.yyyy")</MudText>
|
|
</MudItem>
|
|
<MudItem xs="6">
|
|
<MudText Typo="Typo.caption" Color="Color.Secondary">Erstellt</MudText>
|
|
<MudText Typo="Typo.body1">@_exportDetails.CreatedAt.ToString("dd.MM.yyyy HH:mm")</MudText>
|
|
</MudItem>
|
|
<MudItem xs="6">
|
|
<MudText Typo="Typo.caption" Color="Color.Secondary">Gesamtbetrag</MudText>
|
|
<MudText Typo="Typo.h6" Color="Color.Success">@_exportDetails.TotalAmount.ToString("C")</MudText>
|
|
</MudItem>
|
|
</MudGrid>
|
|
</MudPaper>
|
|
|
|
<MudText Typo="Typo.subtitle1" Class="mt-2">Enthaltene Buchungen (@_exportDetails.EntryCount)</MudText>
|
|
|
|
<MudTable Items="_exportDetails.Entries" Dense="true" Hover="true">
|
|
<HeaderContent>
|
|
<MudTh>Datum</MudTh>
|
|
<MudTh>Person</MudTh>
|
|
<MudTh>Beschreibung</MudTh>
|
|
<MudTh Style="text-align:right">Betrag</MudTh>
|
|
</HeaderContent>
|
|
<RowTemplate>
|
|
<MudTd>@context.BookingDate.ToString("dd.MM.yyyy")</MudTd>
|
|
<MudTd>@context.PersonName</MudTd>
|
|
<MudTd>@context.Comment</MudTd>
|
|
<MudTd Style="text-align:right">@context.Amount.ToString("C")</MudTd>
|
|
</RowTemplate>
|
|
</MudTable>
|
|
</MudStack>
|
|
}
|
|
else if (_error is not null)
|
|
{
|
|
<MudAlert Severity="Severity.Error">@_error</MudAlert>
|
|
}
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="Close">Schließen</MudButton>
|
|
</DialogActions>
|
|
</MudDialog>
|
|
|
|
@code {
|
|
[CascadingParameter]
|
|
private IMudDialogInstance? MudDialog { get; set; }
|
|
|
|
[Parameter]
|
|
public SepaExportDto Export { get; set; } = null!;
|
|
|
|
private SepaExportDto? _exportDetails;
|
|
private bool _loading = true;
|
|
private string? _error;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
try
|
|
{
|
|
_exportDetails = await SepaExportService.GetByIdAsync(Export.Id);
|
|
|
|
if (_exportDetails is null)
|
|
{
|
|
_error = "Export nicht gefunden";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
_error = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
_loading = false;
|
|
}
|
|
}
|
|
|
|
private void Close() => MudDialog?.Close();
|
|
}
|