mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Implemented BarcodeType and BarcodeText settings, fixed barcode alignment issue
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
|
@using Berufsschule_HAM.Services
|
||||||
@using Microsoft.AspNetCore.Mvc.Localization
|
@using Microsoft.AspNetCore.Mvc.Localization
|
||||||
@inject IViewLocalizer T
|
@inject IViewLocalizer T
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
@inject LdapService ldap
|
||||||
@{
|
@{
|
||||||
string barcodeType = Configuration["BarcodeType"] ?? "EAN13";
|
AdminSettingsModel adminSettingsModel = await ldap.GetAdminSettingsModelAsync();
|
||||||
|
string barcodeType = adminSettingsModel.BarcodeType;
|
||||||
|
string barcodeText = adminSettingsModel.BarcodeText;
|
||||||
}
|
}
|
||||||
|
|
||||||
<!-- Print Modal -->
|
<!-- Print Modal -->
|
||||||
@@ -520,7 +524,7 @@
|
|||||||
|
|
||||||
const label = printWindow.document.createElement("div");
|
const label = printWindow.document.createElement("div");
|
||||||
label.className = "barcode-label";
|
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");
|
const svg = printWindow.document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||||
svg.id = `barcode_${i}`;
|
svg.id = `barcode_${i}`;
|
||||||
@@ -538,7 +542,6 @@
|
|||||||
displayValue: true,
|
displayValue: true,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
});
|
});
|
||||||
svg.viewBox.baseVal.x += 10;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const errDiv = printWindow.document.createElement("div");
|
const errDiv = printWindow.document.createElement("div");
|
||||||
|
|||||||
Reference in New Issue
Block a user