Files
DXApp/DXApp.TemplateKitProject/Pages/Invoices/Details.cshtml
OlgunR 346750e933 Enhance PDF viewer with annotations and WebAssembly
Added support for advanced annotation tools, including signature and stamp management, along with accessibility improvements. Introduced WebAssembly binaries (`qcms_bg.wasm`, `quickjs-eval.wasm`, `openjpeg.wasm`, `jbig2.wasm`) for enhanced performance in color management, JavaScript execution, and image decoding.

Implemented a JavaScript fallback (`openjpeg_nowasm_fallback.js`) for environments without WebAssembly support. Updated `Details.cshtml` to include a PDF viewer popup and added a new Razor Page (`ViewPdf.cshtml`) for secure PDF file access. Registered `.mjs` MIME type in `Program.cs` for PDF.js compatibility.

Enhanced localization with translations for multiple languages in `viewer.ftl` and added new icons, dialogs, and accessibility features. Updated `DXApp.sln` to include a new project for template management. These changes improve functionality, modularity, and user experience.
2026-06-01 14:08:17 +02:00

85 lines
3.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@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 (!string.IsNullOrEmpty(Model.Invoice?.ResultFilePath))
{
<button class="btn btn-primary mb-3 ms-2"
onclick="openPdfViewer(@Model.Invoice.Id)">
📄 PDF anzeigen
</button>
}
@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>
@(Html.DevExtreme().Popup()
.ID("pdf-viewer-popup")
.Title("PDF Viewer")
.Width("90%")
.Height("90%")
.ShowCloseButton(true)
.OnHiding("onPdfPopupHiding")
.ContentTemplate(new JS(@"function() {
return '<iframe id=""pdf-iframe"" style=""width:100%;height:100%;border:none;""></iframe>';
}"))
)
}
<script>
function openPdfViewer(invoiceId) {
var pdfUrl = window.location.origin + '/Invoices/ViewPdf?id=' + invoiceId;
var viewerUrl = '/js/pdfjs/web/viewer.html?file=' + encodeURIComponent(pdfUrl);
var popup = $('#pdf-viewer-popup').dxPopup('instance');
// onShown sicherstellen dass iframe im DOM ist
popup.option('onShown', function () {
$('#pdf-iframe').attr('src', viewerUrl);
});
popup.show();
}
function onPdfPopupHiding() {
// iframe src leeren beim Schließen → verhindert dass PDF im Hintergrund weiter läuft
$('#pdf-iframe').attr('src', '');
}
</script>