From 6904ad02a2c16a159c94ea3e2b7a73ae8916c9bc Mon Sep 17 00:00:00 2001 From: chruoss Date: Wed, 29 Oct 2025 15:13:12 +0100 Subject: [PATCH] Renamed L6009.php -> L4736.php Renamed L6009_A.php -> L4736_A.php Added correct L6009.php Added correct L6009_A.php --- app/Models/Labels/Sheets/Avery/L4736.php | 110 +++++++++++ app/Models/Labels/Sheets/Avery/L4736_A.php | 121 ++++++++++++ app/Models/Labels/Sheets/Avery/L6009.php | 176 +++++++----------- app/Models/Labels/Sheets/Avery/L6009_A.php | 204 +++++++++------------ 4 files changed, 380 insertions(+), 231 deletions(-) create mode 100644 app/Models/Labels/Sheets/Avery/L4736.php create mode 100644 app/Models/Labels/Sheets/Avery/L4736_A.php diff --git a/app/Models/Labels/Sheets/Avery/L4736.php b/app/Models/Labels/Sheets/Avery/L4736.php new file mode 100644 index 0000000000..f8789bdb73 --- /dev/null +++ b/app/Models/Labels/Sheets/Avery/L4736.php @@ -0,0 +1,110 @@ +getUnit(), 0); + $this->pageWidth = $paperSize->width; + $this->pageHeight = $paperSize->height; + + $this->pageMarginLeft = Helper::convertUnit(self::COLUMN1_X, 'pt', $this->getUnit()); + $this->pageMarginTop = Helper::convertUnit(self::ROW1_Y, 'pt', $this->getUnit()); + + $columnSpacingPt = self::COLUMN2_X - self::COLUMN1_X - self::LABEL_W; + $this->columnSpacing = Helper::convertUnit($columnSpacingPt, 'pt', $this->getUnit()); + $rowSpacingPt = self::ROW2_Y - self::ROW1_Y - self::LABEL_H; + $this->rowSpacing = Helper::convertUnit($rowSpacingPt, 'pt', $this->getUnit()); + + $this->labelWidth = Helper::convertUnit(self::LABEL_W, 'pt', $this->getUnit()); + $this->labelHeight = Helper::convertUnit(self::LABEL_H, 'pt', $this->getUnit()); + } + + public function getPageWidth() + { + return $this->pageWidth; + } + public function getPageHeight() + { + return $this->pageHeight; + } + + public function getPageMarginTop() + { + return $this->pageMarginTop; + } + public function getPageMarginBottom() + { + return $this->pageMarginTop; + } + public function getPageMarginLeft() + { + return $this->pageMarginLeft; + } + public function getPageMarginRight() + { + return $this->pageMarginLeft; + } + + public function getColumns() + { + return 4; + } + public function getRows() + { + return 12; + } + + public function getLabelColumnSpacing() + { + return $this->columnSpacing; + } + public function getLabelRowSpacing() + { + return $this->rowSpacing; + } + + public function getLabelWidth() + { + return $this->labelWidth; + } + public function getLabelHeight() + { + return $this->labelHeight; + } + + public function getLabelBorder() + { + return 0; + } +} + +?> diff --git a/app/Models/Labels/Sheets/Avery/L4736_A.php b/app/Models/Labels/Sheets/Avery/L4736_A.php new file mode 100644 index 0000000000..c2af2717b5 --- /dev/null +++ b/app/Models/Labels/Sheets/Avery/L4736_A.php @@ -0,0 +1,121 @@ +getLabelPrintableArea(); + + $currentX = $pa->x1; + $currentY = $pa->y1; + $usableWidth = $pa->w; + $usableHeight = $pa->h; + + if ($record->has('title')) { + static::writeText( + $pdf, $record->get('title'), + $pa->x1, $pa->y1, + 'freesans', '', self::TITLE_SIZE, 'C', + $pa->w, self::TITLE_SIZE, true, 0 + ); + + } + $currentY += self::TITLE_SIZE + self::TITLE_MARGIN; + $usableHeight -= self::TITLE_SIZE + self::TITLE_MARGIN; + $barcodeSize = $usableHeight; + if ($record->has('barcode2d')) { + static::write2DBarcode( + $pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type, + $currentX, $currentY, + $barcodeSize, $barcodeSize + ); + $currentX += $barcodeSize + self::BARCODE_MARGIN; + $usableWidth -= $barcodeSize + self::BARCODE_MARGIN; + } + + foreach ($record->get('fields') as $field) { + static::writeText( + $pdf, $field['label'], + $currentX, $currentY, + 'freesans', '', self::LABEL_SIZE, 'L', + $usableWidth, self::LABEL_SIZE, true, 0 + ); + $currentY += self::LABEL_SIZE + self::LABEL_MARGIN; + + static::writeText( + $pdf, $field['value'], + $currentX, $currentY, + 'freemono', 'B', self::FIELD_SIZE, 'L', + $usableWidth, self::FIELD_SIZE, true, 0, 0.01 + ); + $currentY += self::FIELD_SIZE + self::FIELD_MARGIN; + } + + } +} + + +?> diff --git a/app/Models/Labels/Sheets/Avery/L6009.php b/app/Models/Labels/Sheets/Avery/L6009.php index 11d6cfffca..7739e0d4f5 100644 --- a/app/Models/Labels/Sheets/Avery/L6009.php +++ b/app/Models/Labels/Sheets/Avery/L6009.php @@ -1,110 +1,66 @@ -getUnit(), 0); - $this->pageWidth = $paperSize->width; - $this->pageHeight = $paperSize->height; - - $this->pageMarginLeft = Helper::convertUnit(self::COLUMN1_X, 'pt', $this->getUnit()); - $this->pageMarginTop = Helper::convertUnit(self::ROW1_Y, 'pt', $this->getUnit()); - - $columnSpacingPt = self::COLUMN2_X - self::COLUMN1_X - self::LABEL_W; - $this->columnSpacing = Helper::convertUnit($columnSpacingPt, 'pt', $this->getUnit()); - $rowSpacingPt = self::ROW2_Y - self::ROW1_Y - self::LABEL_H; - $this->rowSpacing = Helper::convertUnit($rowSpacingPt, 'pt', $this->getUnit()); - - $this->labelWidth = Helper::convertUnit(self::LABEL_W, 'pt', $this->getUnit()); - $this->labelHeight = Helper::convertUnit(self::LABEL_H, 'pt', $this->getUnit()); - } - - public function getPageWidth() - { - return $this->pageWidth; - } - public function getPageHeight() - { - return $this->pageHeight; - } - - public function getPageMarginTop() - { - return $this->pageMarginTop; - } - public function getPageMarginBottom() - { - return $this->pageMarginTop; - } - public function getPageMarginLeft() - { - return $this->pageMarginLeft; - } - public function getPageMarginRight() - { - return $this->pageMarginLeft; - } - - public function getColumns() - { - return 4; - } - public function getRows() - { - return 12; - } - - public function getLabelColumnSpacing() - { - return $this->columnSpacing; - } - public function getLabelRowSpacing() - { - return $this->rowSpacing; - } - - public function getLabelWidth() - { - return $this->labelWidth; - } - public function getLabelHeight() - { - return $this->labelHeight; - } - - public function getLabelBorder() - { - return 0; - } -} - -?> +getUnit(), 0); + $this->pageWidth = $paperSize->width; + $this->pageHeight = $paperSize->height; + + $this->pageMarginLeft = Helper::convertUnit(self::COLUMN1_X, 'pt', $this->getUnit()); + $this->pageMarginTop = Helper::convertUnit(self::ROW1_Y, 'pt', $this->getUnit()); + + $this->columnSpacing = Helper::convertUnit(self::COLUMN_SPACING, 'pt', $this->getUnit()); + $this->rowSpacing = Helper::convertUnit(self::ROW_SPACING, 'pt', $this->getUnit()); + + $this->labelWidth = Helper::convertUnit(self::LABEL_W, 'pt', $this->getUnit()); + $this->labelHeight = Helper::convertUnit(self::LABEL_H, 'pt', $this->getUnit()); + } + + public function getPageWidth() { return $this->pageWidth; } + public function getPageHeight() { return $this->pageHeight; } + + public function getPageMarginTop() { return $this->pageMarginTop; } + public function getPageMarginBottom() { return $this->pageMarginTop; } + public function getPageMarginLeft() { return $this->pageMarginLeft; } + public function getPageMarginRight() { return $this->pageMarginLeft; } + + public function getColumns() { return 4; } + public function getRows() { return 12; } + + public function getLabelColumnSpacing(){ return $this->columnSpacing; } + public function getLabelRowSpacing() { return $this->rowSpacing; } + + public function getLabelWidth() { return $this->labelWidth; } + public function getLabelHeight() { return $this->labelHeight; } + + public function getLabelBorder() { return 0; } +} + +?> \ No newline at end of file diff --git a/app/Models/Labels/Sheets/Avery/L6009_A.php b/app/Models/Labels/Sheets/Avery/L6009_A.php index 09f3aa8358..4fbd0d3e55 100644 --- a/app/Models/Labels/Sheets/Avery/L6009_A.php +++ b/app/Models/Labels/Sheets/Avery/L6009_A.php @@ -1,121 +1,83 @@ -getLabelPrintableArea(); - - $currentX = $pa->x1; - $currentY = $pa->y1; - $usableWidth = $pa->w; - $usableHeight = $pa->h; - - if ($record->has('title')) { - static::writeText( - $pdf, $record->get('title'), - $pa->x1, $pa->y1, - 'freesans', '', self::TITLE_SIZE, 'C', - $pa->w, self::TITLE_SIZE, true, 0 - ); - - } - $currentY += self::TITLE_SIZE + self::TITLE_MARGIN; - $usableHeight -= self::TITLE_SIZE + self::TITLE_MARGIN; - $barcodeSize = $usableHeight; - if ($record->has('barcode2d')) { - static::write2DBarcode( - $pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type, - $currentX, $currentY, - $barcodeSize, $barcodeSize - ); - $currentX += $barcodeSize + self::BARCODE_MARGIN; - $usableWidth -= $barcodeSize + self::BARCODE_MARGIN; - } - - foreach ($record->get('fields') as $field) { - static::writeText( - $pdf, $field['label'], - $currentX, $currentY, - 'freesans', '', self::LABEL_SIZE, 'L', - $usableWidth, self::LABEL_SIZE, true, 0 - ); - $currentY += self::LABEL_SIZE + self::LABEL_MARGIN; - - static::writeText( - $pdf, $field['value'], - $currentX, $currentY, - 'freemono', 'B', self::FIELD_SIZE, 'L', - $usableWidth, self::FIELD_SIZE, true, 0, 0.01 - ); - $currentY += self::FIELD_SIZE + self::FIELD_MARGIN; - } - - } -} - - -?> +getLabelPrintableArea(); + $currentX = $pa->x1; + $currentY = $pa->y1; + $usableWidth = $pa->w; + $usableHeight = $pa->h; + + if ($record->has('title')) { + static::writeText( + $pdf, $record->get('title'), + $pa->x1, $pa->y1, + 'freesans', '', self::TITLE_SIZE, 'C', + $pa->w, self::TITLE_SIZE, true, 0 + ); + } + + $currentY += self::TITLE_SIZE + self::TITLE_MARGIN; + $usableHeight -= self::TITLE_SIZE + self::TITLE_MARGIN; + + $barcodeSize = $usableHeight; + if ($record->has('barcode2d')) { + static::write2DBarcode( + $pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type, + $currentX, $currentY, + $barcodeSize, $barcodeSize + ); + $currentX += $barcodeSize + self::BARCODE_MARGIN; + $usableWidth -= $barcodeSize + self::BARCODE_MARGIN; + } + + foreach ($record->get('fields') as $field) { + static::writeText( + $pdf, $field['label'], + $currentX, $currentY, + 'freesans', '', self::LABEL_SIZE, 'L', + $usableWidth, self::LABEL_SIZE, true, 0 + ); + $currentY += self::LABEL_SIZE + self::LABEL_MARGIN; + + static::writeText( + $pdf, $field['value'], + $currentX, $currentY, + 'freemono', 'B', self::FIELD_SIZE, 'L', + $usableWidth, self::FIELD_SIZE, true, 0, 0.01 + ); + $currentY += self::FIELD_SIZE + self::FIELD_MARGIN; + } + } +} + +?> \ No newline at end of file