Update last modified dates in PosController, NotaController, and AkhirController; enhance printing logic for thermal printers

This commit is contained in:
2026-11-02 16:09:57 +07:00
parent a5fd32ba79
commit d5b44789fe
3 changed files with 54 additions and 20 deletions
+8 -3
View File
@@ -6,7 +6,7 @@
Description : Laporan Penerimaan Dana POS / Kasir
Created By : Siau Pheng ([email protected]).
Created Date : September 8th, 2012.
Last Modified : October 9th, 2026.
Last Modified : November 2nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
@@ -16,6 +16,7 @@ declare(strict_types=1);
namespace App\Controller\Report\Dana;
use App\Utils\Invesa;
use flight\Engine;
use flight\database\SimplePdo;
use flight\Session;
@@ -91,8 +92,12 @@ class PosController {
$tot_dana = $tot_jual + $tot_pulsa - $tot_potong - $tot_diskon;
$pre = new PrintPOS($this->app);
$pre->set_fontsize(2);//thermal
$pre->set_header_logo("logo-nota.png");//thermal
if (Invesa::Printer_Thermal(Param::Get("Printer", ""))) {
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
} else {
$pre->add_header($this->reg_name);
}
if ($this->app_inv['PRINT_OPENCD'] === 1) $pre->set_opendrawer();
if ($this->app_inv['PRINT_AUTOCUT'] === 1) $pre->set_cutpaper();
$pre->add_empty();
+39 -14
View File
@@ -6,7 +6,7 @@
Description : Cetak Struk / Nota POS
Created By : Siau Pheng ([email protected]).
Created Date : April 12th, 2011.
Last Modified : October 3rd, 2026.
Last Modified : November 2nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
@@ -16,6 +16,7 @@ declare(strict_types=1);
namespace App\Controller\Report;
use App\Utils\Invesa;
use App\Utils\PPOBClient;
use flight\Engine;
use flight\database\SimplePdo;
@@ -29,6 +30,7 @@ class NotaController {
private array $app_inv;
private string $no_cetak;
private int $op_cash;
private bool $is_thermal;
protected Engine $app;
protected SimplePdo $db;
@@ -39,6 +41,7 @@ class NotaController {
$this->app_inv = (array) $session->get('APP_INV');
$this->no_cetak = Param::Get("Nomor_Cetak", "");
$this->op_cash = Param::Int("Open_Cash", 0);
$this->is_thermal = Invesa::Printer_Thermal(Param::Get("Printer", ""));
}
public function pos(): void {
@@ -60,13 +63,18 @@ class NotaController {
if (count($aitem) === 0) return;
$pre = new PrintPOS($this->app);
$pre->set_fontsize(2);//thermal
$pre->set_header_logo("logo-nota.png");//thermal
if ($this->is_thermal) {
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
} else {
$pre->add_header($this->web_app['REG_NAME'], $this->web_app['REG_CITY']);
}
if ($this->app_inv['PRINT_OPENCD'] === 1 && $this->op_cash === 1) $pre->set_opendrawer();
if ($this->app_inv['PRINT_AUTOCUT'] === 1) $pre->set_cutpaper();
if (!empty($this->app_inv['TITLE_BEGIN'])) {
$_ahead = explode("[br]", stripslashes($this->app_inv['TITLE_BEGIN']));
foreach($_ahead as $val) $pre->addc($val);
foreach ($_ahead as $val) $pre->addc($val);
}
if ($is_member) {
@@ -81,6 +89,7 @@ class NotaController {
$items = 0; $qty = 0;
foreach ($aitem as $item) {
if ($item['Qty'] === 0) continue;
if ($item['Promo'] > 1) {
$apromo[] = rupiah($item['Qty'])." ".$item['Nama_Satuan']." ".$item['Nama_Produk_Varian'];
continue;
@@ -338,8 +347,12 @@ class NotaController {
if (count($aitem) === 0) return;
$pre = new PrintPOS($this->app);
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
if ($this->is_thermal) {
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
} else {
$pre->add_header($this->web_app['REG_NAME'], $this->web_app['REG_CITY']);
}
if ($this->app_inv['PRINT_AUTOCUT'] === 1) $pre->set_cutpaper();
$pre->add([$ainfo['No_Mutasi'],20,"L"], [tgl_sql2str($ainfo['Tgl_Mutasi']),20,"R"]);
$pre->add(["Dari Cabang : ",14,"L"], [$ainfo['Cabang1'],36,"L"]);
@@ -362,12 +375,16 @@ class NotaController {
$ainfo = $this->db->fetchRow("SELECT T.*,DATE_FORMAT(T.Tgl_TX,'%d-%m-%Y') Tgl_TX2,DATE_FORMAT(T.DateStamp,'%H:%i:%s') Jam_TX,UCASE(O.Nama) Nama_User,M.Kode_Member,M.Nama_Member,M.IM,B.Nama_Barang,UPPER(P.Nama_Tipe) Nama_Tipe FROM (SELECT * FROM inv_point_tx WHERE No_TX=?) T LEFT JOIN app_operator O ON (T.UserID=O.UserID) LEFT JOIN para_member M ON (M.MemberID=T.MemberID) LEFT JOIN inv_point_barang B ON (T.InvPID=B.InvPID) LEFT JOIN inv_point_tipe P ON (P.Point_TipeID=T.Point_TipeID)", [$this->no_cetak]);
$pre = new PrintPOS($this->app);
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
if ($this->is_thermal) {
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
} else {
$pre->add_header($this->web_app['REG_NAME'], $this->web_app['REG_CITY']);
}
if ($this->app_inv['PRINT_AUTOCUT'] === 1) $pre->set_cutpaper();
if (!empty($this->app_inv['TITLE_BEGIN'])) {
$_ahead = explode("[br]", stripslashes($this->app_inv['TITLE_BEGIN']));
foreach($_ahead as $val) $pre->addc($val);
foreach ($_ahead as $val) $pre->addc($val);
}
$pre->add([$ainfo['No_TX'],20,"L"], [$ainfo['Tgl_TX2'],20,"R"]);
@@ -405,8 +422,12 @@ class NotaController {
$abulan = bulan_array();
$pre = new PrintPOS($this->app);
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
if ($this->is_thermal) {
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
} else {
$pre->add_header($this->web_app['REG_NAME'], $this->web_app['REG_CITY']);
}
if ($this->app_inv['PRINT_AUTOCUT'] === 1) $pre->set_cutpaper();
$_info = $this->db->fetchRow("SELECT DATE_FORMAT(Tgl_Gaji,'%d-%m-%Y') Tgl_Gaji,Tgl_Gaji Tgl_Gaji2,Minggu,Bulan,Tahun,Kode_Jurnal,Catatan Catatan1,UserID FROM gel_gaji WHERE No_Gaji=?", [$this->no_cetak]);
@@ -464,13 +485,17 @@ class NotaController {
if ((int) $ainfo['KateID'] === 5) $is_token = 1;
$pre = new PrintPOS($this->app);
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
if ($this->is_thermal) {
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
} else {
$pre->add_header($this->web_app['REG_NAME'], $this->web_app['REG_CITY']);
}
if ($this->app_inv['PRINT_OPENCD'] === 1 && $this->op_cash === 1) $pre->set_opendrawer();
if ($this->app_inv['PRINT_AUTOCUT'] === 1) $pre->set_cutpaper();
if (!empty($this->app_inv['TITLE_BEGIN'])) {
$_ahead = explode("[br]", stripslashes($this->app_inv['TITLE_BEGIN']));
foreach($_ahead as $val) $pre->addc($val);
foreach ($_ahead as $val) $pre->addc($val);
}
$pre->add([$ainfo['No_TX'],20], [$ainfo['Tgl_TX2'],20,"R"]);
@@ -6,7 +6,7 @@
Description : Laporan Stok Akhir Barang
Created By : Siau Pheng (siaupheng@3fonia.com).
Created Date : January 24th, 2011.
Last Modified : October 13th, 2026.
Last Modified : November 2nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
@@ -93,8 +93,12 @@ class AkhirController {
$apre = $this->prepare();
$pre = new PrintPOS($this->app);
$pre->set_fontsize(2);//thermal
$pre->set_header_logo("logo-nota.png");//thermal
if (Invesa::Printer_Thermal(Param::Get("Printer", ""))) {
$pre->set_fontsize(2);
$pre->set_header_logo("logo-nota.png");
} else {
$pre->add_header($this->reg_name);
}
if ($this->app_inv['PRINT_AUTOCUT'] === 1) $pre->set_cutpaper();
$pre->add_empty();