Update various controllers and scripts; modify last modified dates, enhance JSON responses, and adjust PPN handling for improved functionality

This commit is contained in:
2026-11-04 11:14:12 +07:00
parent 4344b53de8
commit eab5acde17
11 changed files with 84 additions and 41 deletions
@@ -6,7 +6,7 @@
Description : Laporan Margin Penjualan / Member
Created By : Siau Pheng ([email protected]).
Created Date : October 12nd, 2012.
Last Modified : October 7th, 2026.
Last Modified : November 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
@@ -226,7 +226,7 @@ class MarginController {
$ttipe = $form->radio("_", "Tipe", "R", true, false, ["R"=>"Rekap","D"=>"Detail"]);
$tcab = $form->option_db("_", "CabID", $this->id_cab, true, false, "para_cabang", ["CabID","Nama_Cab"], "Aktif=1 ORDER BY CabID", [0,"SEMUA CABANG"]);
$tmem = $form->textauto("_", "Nama_Member", ['value'=>0,'text'=>"SEMUA MEMBER"], true, true, "nama member");
$turut = $form->radio("_", "Urut", "B", true, false, ['H'=>"Harga Jual",'M'=>"Margin"]);
$turut = $form->radio("_", "Urut", "M", true, false, ['H'=>"Harga Jual",'M'=>"Margin"]);
$tfrom = $form->datebox("_", "Tgl_From", tgl_ymd(), true, false);
$tto = $form->datebox("_", "Tgl_To", tgl_ymd(), true, false);
$ajson['html'] = '
@@ -6,7 +6,7 @@
Description : Laporan Stok Akhir Barang
Created By : Siau Pheng ([email protected]).
Created Date : January 24th, 2011.
Last Modified : November 2nd, 2026.
Last Modified : November 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
@@ -46,7 +46,7 @@ class AkhirController {
$apre = [
'id_sup' => Param::Int("SupID", 0),
'id_grup_inv' => Param::Int("Grup_InvID", 0),
'ppn' => Param::Int("PPN", 9),
'ppn' => Param::Int("PPN", 0),
'tgl' => Param::Get("Tanggal"),
'urut' => Param::Get("Urut", "B"),
'min' => Param::Get("Min_Stok", "N"),
@@ -75,7 +75,7 @@ class AkhirController {
$tsql2 .= " AND P.Grup_InvID=?";
array_push($asql2, $apre['id_grup_inv']);
}
if ($apre['ppn'] !== 9) {
if ($apre['ppn'] > 0) {
$tsql2 .= " AND P.PPN=?";
array_push($asql2, $apre['ppn']);
}
@@ -191,7 +191,7 @@ class AkhirController {
$tcab = $form->option_db("_", "CabID", $this->id_cab, true, false, "para_cabang", ["CabID","Nama_Cab"], "Aktif=1 ORDER BY CabID", [0,"SEMUA CABANG"]);
$tsup = $form->option_db("_", "SupID", 0, true, false, "para_supplier", ["SupID","Nama_Sup"], "Aktif=1 ORDER BY Nama_Sup", [0,"SEMUA SUPPLIER"]);
$tgrup_inv = $form->option_db("_", "Grup_InvID", 0, true, false, "inv_produk_grup", ["Grup_InvID","Nama_Grup"], "Aktif=1 ORDER BY Nama_Grup", [0,"SEMUA GRUP"]);
$tppn = $form->option("_", "PPN", 9, true, false, [9 => "SEMUA STATUS"] + Invesa::PPN_Array());
$tppn = $form->option("_", "PPN", 9, true, false, [0 => "SEMUA STATUS"] + Invesa::PPN_Array());
$ttgl = $form->datebox("_", "Tanggal", tgl_ymd(), false, false);
$turut = $form->radio("_", "Urut", "B", true, false, ['B'=>"Nama Barang",'J'=>"Jumlah / Nilai"]);
$tstok = $form->radio("_", "Min_Stok", "N", true, false, ["Y"=>"Ya","N"=>"Tidak"], null, "RepoStokAkhirJS.oc_MinStok");
@@ -6,7 +6,7 @@
Description : Laporan Mutasi Stok Barang
Created By : Siau Pheng ([email protected]).
Created Date : July 16th, 2011.
Last Modified : October 12th, 2026.
Last Modified : November 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
@@ -83,6 +83,18 @@ class MutasiController {
$this->app->json($ajson);
}
public function scan_produk() {
$tcari = Param::Get("Cari_Produk", "");
$scandata = [ 'InvID'=>0, 'Nama_Produk'=>"" ];
// Cari by SKU + Barcode
// InvID : Nama_Produk
$_row = $this->db->fetchRow("SELECT P.InvID,P.Nama_Lengkap Nama_Produk FROM (SELECT * FROM vi_inv_produk WHERE Aktif=1 AND Barcode_Nama LIKE ?) P", ['%'.$tcari.'%']);
if ($_row) $scandata = array_merge($scandata, $_row->getData());
$this->app->json( $scandata );
}
private function prepare() {
$apre = [
'id_inv' => Param::Int("InvID", 0),
@@ -198,7 +210,11 @@ class MutasiController {
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="CabID">Nama Cabang</label>
<div class="col">'.$tcab.'</div>
</div>
</div>';
if (isMobile()) {
$ajson['html'] .= '<div class="row mb-1"><div class="col"><div id="qr-reader"></div></div></div>';
}
$ajson['html'] .= '
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Nama_Produk">Nama Barang</label>
<div class="col"><div class="input-group">'.$tproduk.'<button id="butBrowProduk" class="btn btn-info" type="button"><i class="bi-bag"></i></button></div></div>