Update Invesa class metadata and refactor Printer_Thermal method for improved clarity

This commit is contained in:
2026-11-01 12:56:45 +07:00
parent dd6f0dea12
commit 52897c25c5
+5 -6
View File
@@ -6,7 +6,7 @@
Description : Class umum untuk Aplikasi Invesa Description : Class umum untuk Aplikasi Invesa
Created By : Siau Pheng ([email protected]). Created By : Siau Pheng ([email protected]).
Created Date : February 10th, 2012. Created Date : February 10th, 2012.
Last Modified : September 1st, 2026. Last Modified : October 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM. (c) 3FONIA Software; WWW.3FONIA.COM.
@@ -16,11 +16,10 @@ declare(strict_types=1);
namespace App\Utils; namespace App\Utils;
use flight\Session;
final class Invesa { final class Invesa {
public const ppn = [0=>"Tanpa PPN", 1=>"PPN", 3=>"Spesial 1", 4=>"Spesial 2", 5=>"Spesial 3"]; public const ppn = [ 0=>"Tanpa PPN", 1=>"PPN", 3=>"Spesial 1", 4=>"Spesial 2", 5=>"Spesial 3" ];
public const old_printer = [ "TM-U220" ];
public function __construct() { public function __construct() {
} }
@@ -158,9 +157,9 @@ final class Invesa {
/************************* PRINTER THERMAL *************************/ /************************* PRINTER THERMAL *************************/
public static function Printer_Thermal(Session $session, string $printer): bool { public static function Printer_Thermal(string $printer): bool {
$is_thermal = true; $is_thermal = true;
foreach($session->get('APP_INV',['OLD_PRINTER'=>[]])['OLD_PRINTER'] as $old) { foreach (self::old_printer as $old) {
if (str_contains($printer, $old)) { if (str_contains($printer, $old)) {
$is_thermal = false; $is_thermal = false;
break; break;