From 73d7bd43c0250c2092066a5e4d919eede0bed567 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sun, 2 Nov 2025 22:49:01 +0100 Subject: [PATCH] Implemented BarcodeType and BarcodeText settings, fixed barcode alignment issue --- src/Views/Shared/_Batch.cshtml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Views/Shared/_Batch.cshtml b/src/Views/Shared/_Batch.cshtml index 3e46da9..3a920cd 100644 --- a/src/Views/Shared/_Batch.cshtml +++ b/src/Views/Shared/_Batch.cshtml @@ -1,8 +1,12 @@ +@using Berufsschule_HAM.Services @using Microsoft.AspNetCore.Mvc.Localization @inject IViewLocalizer T @inject IConfiguration Configuration +@inject LdapService ldap @{ - string barcodeType = Configuration["BarcodeType"] ?? "EAN13"; + AdminSettingsModel adminSettingsModel = await ldap.GetAdminSettingsModelAsync(); + string barcodeType = adminSettingsModel.BarcodeType; + string barcodeText = adminSettingsModel.BarcodeText; } @@ -520,7 +524,7 @@ const label = printWindow.document.createElement("div"); label.className = "barcode-label"; - label.textContent = "HAM"; //asset?.Name || assetId; + label.textContent = "@Html.Raw(barcodeText)"; const svg = printWindow.document.createElementNS("http://www.w3.org/2000/svg", "svg"); svg.id = `barcode_${i}`; @@ -538,7 +542,6 @@ displayValue: true, fontSize: 12, }); - svg.viewBox.baseVal.x += 10; } catch (err) { console.error(err); const errDiv = printWindow.document.createElement("div");