Skip to content

A free open source IT asset/license management system

add TZe_241_B

Godfrey Mb9df072cbbb3
diff --git a/app/Models/Labels/Tapes/Brother/TZe_241.php b/app/Models/Labels/Tapes/Brother/TZe_241_A.php
similarity index 98%
rename from app/Models/Labels/Tapes/Brother/TZe_241.php
rename to app/Models/Labels/Tapes/Brother/TZe_241_A.php
index 1abbf3e099..1f9a90719d 100644
--- a/app/Models/Labels/Tapes/Brother/TZe_241.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_241_A.php
@@ -4,7 +4,7 @@ namespace App\Models\Labels\Tapes\Brother;
use App\Helpers\Helper;
-class TZe_241 extends TZe_18mm
+class TZe_241_A extends TZe_18mm
{
private const LABEL_SIZE = 5.0;
diff --git a/app/Models/Labels/Tapes/Brother/TZe_241_B.php b/app/Models/Labels/Tapes/Brother/TZe_241_B.php
new file mode 100644
index 0000000000..ace016f30f
--- /dev/null
+++ b/app/Models/Labels/Tapes/Brother/TZe_241_B.php
@@ -0,0 +1,98 @@
+<?php
+
+namespace App\Models\Labels\Tapes\Brother;
+
+use App\Helpers\Helper;
+
+class TZe_241_B extends TZe_18mm
+{
+ private const LABEL_SIZE = 5.0;
+
+ private const FIELD_SIZE = 5.0;
+
+ private const FIELD_MARGIN = 0.8;
+
+ public function getUnit()
+ {
+ return 'mm';
+ }
+
+ public function getWidth()
+ {
+ return 30.0;
+ }
+
+ public function getSupportAssetTag()
+ {
+ return false;
+ }
+
+ public function getSupport1DBarcode()
+ {
+ return false;
+ }
+
+ public function getSupport2DBarcode()
+ {
+ return false;
+ }
+
+ public function getSupportFields()
+ {
+ return 2;
+ }
+
+ public function getSupportLogo()
+ {
+ return false;
+ }
+
+ public function getSupportTitle()
+ {
+ return false;
+ }
+
+ public function write($pdf, $record)
+ {
+ $pa = $this->getPrintableArea();
+
+ $currentX = $pa->x1;
+ $currentY = $pa->y1;
+ $usableWidth = $pa->w;
+ $usableHeight = $pa->h;
+
+ $fields = $record->get('fields') ?? [];
+
+ $field_layout = Helper::labelFieldLayoutScaling(
+ pdf: $pdf,
+ fields: $fields,
+ currentX: $currentX,
+ usableWidth: $usableWidth,
+ usableHeight: $usableHeight,
+ baseLabelSize: self::LABEL_SIZE,
+ baseFieldSize: self::FIELD_SIZE,
+ baseFieldMargin: self::FIELD_MARGIN,
+ baseLabelPadding: 1.5,
+ baseGap: 1.5,
+ maxScale: 1.8,
+ labelFont: 'freesans',
+ );
+
+ foreach ($fields as $field) {
+ static::writeText(
+ $pdf, $field['label'],
+ $currentX, $currentY,
+ 'freesans', '', $field_layout['labelSize'], 'L',
+ $field_layout['labelWidth'], $field_layout['rowAdvance'], true, 0
+ );
+
+ static::writeText(
+ $pdf, $field['value'],
+ $field_layout['valueX'], $currentY,
+ 'freemono', 'B', $field_layout['fieldSize'], 'L',
+ $field_layout['valueWidth'], $field_layout['rowAdvance'], true, 0, 0.01
+ );
+ $currentY += $field_layout['rowAdvance'];
+ }
+ }
+}