The code block displaying the "Result-PDF" success message was removed from its original location and reintroduced in a different section of the `Upload.cshtml` file. The new placement is after the success message confirming that the invoice was saved in the database. The functionality and alert structure remain unchanged, displaying the file path of the generated PDF if `Model.ResultFilePath` is not empty.
115 lines
4.6 KiB
Plaintext
115 lines
4.6 KiB
Plaintext
@page
|
||
@model DXApp.TemplateKitProject.Pages.Invoices.UploadModel
|
||
@{
|
||
ViewData["Title"] = "PDF/A Upload";
|
||
}
|
||
|
||
<h2>PDF/A Rechnung hochladen</h2>
|
||
|
||
<form method="post" enctype="multipart/form-data">
|
||
<div class="mb-3">
|
||
<label asp-for="PdfFile" class="form-label">PDF/A-Datei auswählen</label>
|
||
<input asp-for="PdfFile" type="file" class="form-control" accept=".pdf" />
|
||
<span asp-validation-for="PdfFile" class="text-danger"></span>
|
||
</div>
|
||
<button type="submit" class="btn btn-primary">Hochladen & Analysieren</button>
|
||
</form>
|
||
|
||
@if (Model.ExtractionDone)
|
||
{
|
||
<hr />
|
||
<h4>Ergebnis</h4>
|
||
|
||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||
{
|
||
<div class="alert alert-danger">@Model.ErrorMessage</div>
|
||
}
|
||
else if (Model.Result == null || !Model.Result.HasAttachments)
|
||
{
|
||
<div class="alert alert-warning">Keine Anhänge in der PDF gefunden.</div>
|
||
}
|
||
else
|
||
{
|
||
<div class="alert @(Model.Result.HasZugferdXml ? "alert-success" : "alert-warning")">
|
||
@if (Model.Result.HasZugferdXml)
|
||
{
|
||
<strong>✔ ZUGFeRD/Factur-X XML gefunden:</strong>
|
||
<span>@Model.Result.ZugferdXmlAttachment!.OriginalFileName</span>
|
||
}
|
||
else
|
||
{
|
||
<strong>⚠ Kein ZUGFeRD-XML gefunden.</strong>
|
||
}
|
||
</div>
|
||
|
||
@* PDF/A-Konformitätsstufe anzeigen *@
|
||
<div class="alert @(Model.Result.PdfAWarning ? "alert-warning" : "alert-info") mt-2">
|
||
<strong>PDF/A-Konformität:</strong> @Model.Result.PdfALevel
|
||
@if (!string.IsNullOrEmpty(Model.Result.ZugferdGuidelineId))
|
||
{
|
||
<br />
|
||
|
||
<strong>Guideline-ID:</strong>
|
||
<code>@Model.Result.ZugferdGuidelineId</code>
|
||
}
|
||
@if (Model.Result.PdfAWarning)
|
||
{
|
||
<span> – ⚠️ ZUGFeRD-Rechnungen müssen PDF/A-3b sein.</span>
|
||
}
|
||
</div>
|
||
|
||
<table class="table table-sm table-bordered">
|
||
<thead class="table-light">
|
||
<tr>
|
||
<th>Dateiname</th>
|
||
<th>Größe</th>
|
||
<th>ZUGFeRD?</th>
|
||
<th>Gespeichert unter</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach (var a in Model.Result.Attachments)
|
||
{
|
||
<tr class="@(a.IsZugferdXml ? "table-success" : "")">
|
||
<td>@a.OriginalFileName</td>
|
||
<td>@($"{a.FileSizeBytes:N0}") Bytes</td>
|
||
<td>@(a.IsZugferdXml ? "✔ Ja" : "Nein")</td>
|
||
<td><small class="text-muted">@a.SavedFilePath</small></td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
}
|
||
@if (Model.ImportedInvoice is not null)
|
||
{
|
||
<hr />
|
||
<h4>📄 Geparste Rechnungsdaten</h4>
|
||
<table class="table table-sm table-bordered w-auto">
|
||
<tr><th>Rechnungsnummer</th><td>@Model.ImportedInvoice.InvoiceNumber</td></tr>
|
||
<tr><th>Rechnungsdatum</th><td>@Model.ImportedInvoice.InvoiceDate.ToString("dd.MM.yyyy")</td></tr>
|
||
<tr><th>Verkäufer</th><td>@Model.ImportedInvoice.SellerName</td></tr>
|
||
<tr><th>USt-ID Verkäufer</th><td>@Model.ImportedInvoice.SellerTaxId</td></tr>
|
||
<tr><th>Käufer</th><td>@Model.ImportedInvoice.BuyerName</td></tr>
|
||
<tr><th>Währung</th><td>@Model.ImportedInvoice.CurrencyCode</td></tr>
|
||
<tr><th>Steuerbetrag</th><td>@Model.ImportedInvoice.TaxAmount.ToString("N2")</td></tr>
|
||
<tr><th>Gesamtbetrag</th><td><strong>@Model.ImportedInvoice.TotalAmount.ToString("N2")</strong></td></tr>
|
||
<tr><th>IBAN</th><td>@Model.ImportedInvoice.Iban</td></tr>
|
||
<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">
|
||
⚠️ <strong>Duplikat:</strong> Diese Rechnung wurde bereits importiert (ID: @Model.ImportedInvoice!.Id).
|
||
Es wurde kein neuer Eintrag angelegt.
|
||
</div>
|
||
}
|
||
}
|
||
} |