Update various controllers and scripts; modify last modified dates, enhance JSON responses, and adjust PPN handling for improved functionality
This commit is contained in:
@@ -130,26 +130,27 @@ class IndexController {
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$ajson['CabID'] = $this->id_cab ?? 0;
|
||||
$ajson['html'] = '
|
||||
<div class="card">
|
||||
<div class="card-body my-bashboard">
|
||||
<div class="row h-100">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="h-50">
|
||||
<canvas id="ChartA"></canvas>
|
||||
$this->app->json([
|
||||
'CabID' => $this->id_cab ?? 0,
|
||||
'html' => '
|
||||
<div class="card">
|
||||
<div class="card-body my-bashboard">
|
||||
<div class="row h-100">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="h-50">
|
||||
<canvas id="ChartA"></canvas>
|
||||
</div>
|
||||
<div class="h-50">
|
||||
<canvas id="ChartB"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-50">
|
||||
<canvas id="ChartB"></canvas>
|
||||
<div class="col-12 col-md-6 h-100 overflow-scroll">
|
||||
<div id="tabelStok"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 h-100 overflow-scroll">
|
||||
<div id="tabelStok"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
$this->app->json($ajson);
|
||||
</div>'
|
||||
]);
|
||||
}
|
||||
|
||||
public function get401() {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Description : Transaksi Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 22th, 2010.
|
||||
Last Modified : September 20th, 2026.
|
||||
Last Modified : November 4th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -553,7 +553,7 @@ class BeliController {
|
||||
}
|
||||
|
||||
private function Data_Beli(string $nomor="", bool $baru=false): array {
|
||||
$aparam = [ 'No_Beli'=>$nomor, 'PPN'=>0, 'Lunas'=>0 ];
|
||||
$aparam = [ 'No_Beli'=>$nomor, 'PPN'=>1, 'Lunas'=>0 ];
|
||||
if (empty($nomor)) {
|
||||
if ($baru) $aparam['No_Beli'] = "BELI".$this->web_app['SERVER_ID'].(string) $this->id_cab.$this->app->user()->id(3)."#00";
|
||||
$aparam['Tgl_Beli'] = tgl_ymd();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Description : Transaksi Penyesuaian Stok Per Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 22nd, 2014.
|
||||
Last Modified : October 11th, 2026.
|
||||
Last Modified : November 4th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -98,13 +98,13 @@ class OpnamebarangController {
|
||||
|
||||
public function scan_produk() {
|
||||
$tcari = Param::Get("Cari_Produk", "");
|
||||
$scandata = ['Nama_Supplier'=>"BELUM ADA"];
|
||||
$scandata = [ 'InvID'=>0, 'SatuanID'=>0, 'VarianID'=>0, 'Kode_Barang'=>"KODE_SKU / KODE_BARCODE", 'Nama_Barang'=>"NAMA_BARANG", 'Nama_Satuan'=>"SATUAN", 'PPN'=>0, 'Harga_Beli'=>0, 'Stok_Sistem'=>0 ];
|
||||
|
||||
// Cari by SKU + Barcode
|
||||
// Satuan : Varian : SKU + Barcode : Harga_Pokok : Satuan : PPN : Stok
|
||||
$_row = $this->db->fetchRow("SELECT P.InvID,P.SatuanID,P.VarianID,P.Nama_Lengkap Nama_Barang,CONCAT(P.Kode_SKU,' / ',P.Kode_Barcode) Kode_Barang,P.Harga_Pokok Harga_Beli,P.Satuan_Kemasan Nama_Satuan,P.PPN,FORMAT(IFNULL(X.Stok,0),2) Stok_Sistem FROM (SELECT * FROM inv_produk_join WHERE Aktif=1 AND (Kode_SKU=? OR Kode_Barcode=?) GROUP BY InvID,SatuanID,VarianID) P LEFT JOIN inv_stok X ON (X.CabID=? AND X.InvID=P.InvID)", [$tcari, $tcari, $this->id_cab]);
|
||||
if ($_row) $scandata = array_merge($scandata, $_row->getData());
|
||||
$this->app->json([ $scandata ]);
|
||||
$this->app->json( $scandata );
|
||||
}
|
||||
|
||||
public function proses_simpan() {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Description : Master Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 19th, 2010.
|
||||
Last Modified : September 10th, 2026.
|
||||
Last Modified : November 4th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -253,7 +253,7 @@ class ProdukController {
|
||||
}
|
||||
|
||||
public function detail_produk() {
|
||||
$atabel = ['InvID'=>0,'Nama_Produk'=>"",'Grup_InvID'=>0,'StokID'=>$this->def_satuan,'NormalID'=>$this->def_satuan,'Harga_Beli'=>0,'Harga_Tambah'=>0,'Harga_Pokok'=>0,'Stok_Min'=>0,'Stok_Max'=>0,'Aktif'=>1,'PPN'=>0];
|
||||
$atabel = ['InvID'=>0,'Nama_Produk'=>"",'Grup_InvID'=>0,'StokID'=>$this->def_satuan,'NormalID'=>$this->def_satuan,'Harga_Beli'=>0,'Harga_Tambah'=>0,'Harga_Pokok'=>0,'Stok_Min'=>0,'Stok_Max'=>0,'Aktif'=>1,'PPN'=>1];
|
||||
if ($this->id_inv > 0) {
|
||||
$atabel = $this->db->fetchRow("SELECT * FROM inv_produk WHERE InvID=?", [$this->id_inv]);
|
||||
$this->Produk_Backup();
|
||||
|
||||
Reference in New Issue
Block a user