Compare commits
2 Commits
245f7a8268
...
9adc9ac4ed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9adc9ac4ed | ||
|
|
8e329c2b50 |
44
DXApp.TemplateKitProject/Pages/Invoices/Details.cshtml
Normal file
44
DXApp.TemplateKitProject/Pages/Invoices/Details.cshtml
Normal file
@@ -0,0 +1,44 @@
|
||||
@page
|
||||
@model DXApp.TemplateKitProject.Pages.Invoices.DetailsModel
|
||||
@{
|
||||
ViewData["Title"] = "Rechnungsdetails";
|
||||
}
|
||||
|
||||
<h2>📄 Rechnungsdetails</h2>
|
||||
<a href="/Invoices" class="btn btn-secondary mb-3">← Zurück zur Liste</a>
|
||||
|
||||
@if (Model.Invoice is null)
|
||||
{
|
||||
<div class="alert alert-danger">Rechnung nicht gefunden.</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-bordered w-auto">
|
||||
<tr><th>ID</th><td>@Model.Invoice.Id</td></tr>
|
||||
<tr><th>Rechnungsnummer</th><td>@Model.Invoice.InvoiceNumber</td></tr>
|
||||
<tr><th>Rechnungsdatum</th><td>@Model.Invoice.InvoiceDate.ToString("dd.MM.yyyy")</td></tr>
|
||||
<tr><th>Verkäufer</th><td>@Model.Invoice.SellerName</td></tr>
|
||||
<tr><th>USt-ID Verkäufer</th><td>@Model.Invoice.SellerTaxId</td></tr>
|
||||
<tr><th>Käufer</th><td>@Model.Invoice.BuyerName</td></tr>
|
||||
<tr><th>Währung</th><td>@Model.Invoice.CurrencyCode</td></tr>
|
||||
<tr><th>Steuerbetrag</th><td>@Model.Invoice.TaxAmount.ToString("N2")</td></tr>
|
||||
<tr><th>Gesamtbetrag</th><td><strong>@Model.Invoice.TotalAmount.ToString("N2")</strong></td></tr>
|
||||
<tr><th>IBAN</th><td>@Model.Invoice.Iban</td></tr>
|
||||
<tr><th>Quelle</th><td>@Model.Invoice.SourceType</td></tr>
|
||||
<tr><th>Guideline-ID</th><td><code>@Model.Invoice.GuidelineId</code></td></tr>
|
||||
<tr><th>Importiert am</th><td>@Model.Invoice.ImportedAt.ToString("dd.MM.yyyy HH:mm")</td></tr>
|
||||
<tr>
|
||||
<th>Result-PDF</th>
|
||||
<td>
|
||||
@if (!string.IsNullOrEmpty(Model.Invoice.ResultFilePath))
|
||||
{
|
||||
<small class="text-muted">@Model.Invoice.ResultFilePath</small>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">– nicht vorhanden –</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
22
DXApp.TemplateKitProject/Pages/Invoices/Details.cshtml.cs
Normal file
22
DXApp.TemplateKitProject/Pages/Invoices/Details.cshtml.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using DXApp.TemplateKitProject.Data;
|
||||
using DXApp.TemplateKitProject.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DXApp.TemplateKitProject.Pages.Invoices;
|
||||
|
||||
public class DetailsModel(AppDbContext db) : PageModel
|
||||
{
|
||||
public ZugferdInvoice? Invoice { get; private set; }
|
||||
|
||||
public async Task<IActionResult> OnGetAsync(int id)
|
||||
{
|
||||
Invoice = await db.ZugferdInvoices.FirstOrDefaultAsync(i => i.Id == id);
|
||||
|
||||
if (Invoice is null)
|
||||
return NotFound();
|
||||
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,16 @@ else
|
||||
)
|
||||
.Columns(cols =>
|
||||
{
|
||||
cols.Add()
|
||||
.Caption("Details")
|
||||
.Width(80)
|
||||
.CellTemplate(new JS(@"function(container, options) {
|
||||
$('<a>')
|
||||
.attr('href', '/Invoices/Details?id=' + options.data.Id)
|
||||
.attr('class', 'btn btn-sm btn-outline-primary')
|
||||
.text('Details')
|
||||
.appendTo(container);
|
||||
}"));
|
||||
cols.Add().DataField("Id").Caption("ID").Width(60).AllowEditing(false);
|
||||
cols.Add().DataField("InvoiceNumber").Caption("Rechnungsnr.");
|
||||
cols.Add().DataField("InvoiceDate").Caption("Datum")
|
||||
|
||||
@@ -40,13 +40,6 @@
|
||||
{
|
||||
<strong>⚠ Kein ZUGFeRD-XML gefunden.</strong>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(Model.ResultFilePath))
|
||||
{
|
||||
<div class="alert alert-success mt-2">
|
||||
📦 <strong>Result-PDF erstellt:</strong>
|
||||
<small class="text-muted">@Model.ResultFilePath</small>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@* PDF/A-Konformitätsstufe anzeigen *@
|
||||
@@ -104,6 +97,13 @@
|
||||
<tr><th>Importiert am</th><td>@Model.ImportedInvoice.ImportedAt.ToString("dd.MM.yyyy HH:mm")</td></tr>
|
||||
</table>
|
||||
<div class="alert alert-success mt-2">✔ Rechnung wurde in der Datenbank gespeichert (ID: @Model.ImportedInvoice.Id)</div>
|
||||
@if (!string.IsNullOrEmpty(Model.ResultFilePath))
|
||||
{
|
||||
<div class="alert alert-success mt-2">
|
||||
📦 <strong>Result-PDF erstellt:</strong>
|
||||
<small class="text-muted">@Model.ResultFilePath</small>
|
||||
</div>
|
||||
}
|
||||
@if (Model.IsDuplicate)
|
||||
{
|
||||
<div class="alert alert-warning mt-2">
|
||||
|
||||
Reference in New Issue
Block a user