Added new navigation menu items in `_Layout.cshtml` for "Rechnungen" (Invoices) and "PDF hochladen" (Upload PDF) with icons, paths, and selection logic. Created a new Razor Page `Index.cshtml` to display imported invoices using a `DataGrid` with features like filtering, paging, and column formatting. Added a conditional message for when no invoices are available. Implemented the `IndexModel` class in `Index.cshtml.cs` to handle backend logic, including fetching and sorting invoices from the database using `AppDbContext`.
56 lines
2.0 KiB
Plaintext
56 lines
2.0 KiB
Plaintext
@page
|
|
@model DXApp.TemplateKitProject.Pages.Invoices.IndexModel
|
|
@{
|
|
ViewData["Title"] = "Rechnungen";
|
|
}
|
|
|
|
<h2>Importierte Rechnungen</h2>
|
|
|
|
@if (!Model.Invoices.Any())
|
|
{
|
|
<div class="alert alert-info mt-3">Noch keine Rechnungen importiert.</div>
|
|
}
|
|
else
|
|
{
|
|
@(Html.DevExtreme().DataGrid<DXApp.TemplateKitProject.Models.ZugferdInvoice>()
|
|
.DataSource(Model.Invoices)
|
|
.KeyExpr("Id")
|
|
.ShowBorders(true)
|
|
.RowAlternationEnabled(true)
|
|
.FilterRow(f => f.Visible(true))
|
|
.HeaderFilter(h => h.Visible(true))
|
|
.Paging(p => p.PageSize(20))
|
|
.Pager(p => p
|
|
.ShowPageSizeSelector(true)
|
|
.AllowedPageSizes(new[] { 10, 20, 50 })
|
|
.ShowInfo(true)
|
|
)
|
|
.Columns(cols =>
|
|
{
|
|
cols.Add().DataField("Id").Caption("ID").Width(60).AllowEditing(false);
|
|
cols.Add().DataField("InvoiceNumber").Caption("Rechnungsnr.");
|
|
cols.Add().DataField("InvoiceDate").Caption("Datum")
|
|
.DataType(GridColumnDataType.Date)
|
|
.Format("dd.MM.yyyy")
|
|
.Width(110);
|
|
cols.Add().DataField("SellerName").Caption("Verkäufer");
|
|
cols.Add().DataField("BuyerName").Caption("Käufer");
|
|
cols.Add().DataField("TotalAmount").Caption("Gesamt")
|
|
.DataType(GridColumnDataType.Number)
|
|
.Format("#,##0.00")
|
|
.Width(110);
|
|
cols.Add().DataField("TaxAmount").Caption("MwSt.")
|
|
.DataType(GridColumnDataType.Number)
|
|
.Format("#,##0.00")
|
|
.Width(100);
|
|
cols.Add().DataField("CurrencyCode").Caption("Währung").Width(80);
|
|
cols.Add().DataField("Iban").Caption("IBAN");
|
|
cols.Add().DataField("SourceType").Caption("Quelle").Width(90);
|
|
cols.Add().DataField("ImportedAt").Caption("Importiert am")
|
|
.DataType(GridColumnDataType.DateTime)
|
|
.Format("dd.MM.yyyy HH:mm")
|
|
.Width(150);
|
|
})
|
|
)
|
|
}
|