diff --git a/app/Libraries/Barcode_lib.php b/app/Libraries/Barcode_lib.php index 2f5759cf1..5ee45ebd7 100644 --- a/app/Libraries/Barcode_lib.php +++ b/app/Libraries/Barcode_lib.php @@ -4,8 +4,8 @@ namespace App\Libraries; use Config\OSPOS; use Exception; -use Picqer\Barcode\BarcodeGeneratorDynamicHTML; use Picqer\Barcode\BarcodeGeneratorPNG; +use Picqer\Barcode\BarcodeGeneratorSVG; /** * Barcode library @@ -109,9 +109,10 @@ class Barcode_lib { try { - $generator = new BarcodeGeneratorDynamicHTML(); + $generator = new BarcodeGeneratorSVG(); $barcode_value = $this->get_barcode_value($item, $barcode_config); - return $generator->getBarcode($barcode_value, $barcode_config['barcode_type']); + + return $generator->getBarcode($barcode_value, $barcode_config['barcode_type'], 2, $barcode_config['barcode_height']); } catch(Exception $e) { @@ -130,8 +131,8 @@ class Barcode_lib { try { - $generator = new BarcodeGeneratorPNG(); - return base64_encode($generator->getBarcode($barcode_content, $generator::TYPE_CODE_128)); + $generator = new BarcodeGeneratorSVG(); + return $generator->getBarcode($barcode_content, $generator::TYPE_CODE_128); } catch(Exception $e) { @@ -154,7 +155,7 @@ class Barcode_lib $display_table = ''; $display_table .= ''; $barcode = $this->generate_barcode($item, $barcode_config); - $display_table .= '"; + $display_table .= '"; $display_table .= ''; $display_table .= ''; $display_table .= '
' . $this->manage_display_layout($barcode_config['barcode_first_row'], $item, $barcode_config) . '
$barcode
$barcode
' . $this->manage_display_layout($barcode_config['barcode_second_row'], $item, $barcode_config) . '
' . $this->manage_display_layout($barcode_config['barcode_third_row'], $item, $barcode_config) . '
'; diff --git a/app/Views/sales/receipt_default.php b/app/Views/sales/receipt_default.php index 80d8d171d..7b616906c 100644 --- a/app/Views/sales/receipt_default.php +++ b/app/Views/sales/receipt_default.php @@ -243,7 +243,7 @@
- <?= esc($barcode) ?>
+
diff --git a/app/Views/sales/receipt_email.php b/app/Views/sales/receipt_email.php index 0462d2e09..e1b080f66 100644 --- a/app/Views/sales/receipt_email.php +++ b/app/Views/sales/receipt_email.php @@ -223,7 +223,7 @@
- <?= esc($barcode) ?>
+
diff --git a/app/Views/sales/receipt_short.php b/app/Views/sales/receipt_short.php index 8e9508b91..cbbeb6c12 100644 --- a/app/Views/sales/receipt_short.php +++ b/app/Views/sales/receipt_short.php @@ -216,7 +216,7 @@
- <?= esc($barcode) ?>
+