first commit
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/gel/keluar.js
|
||||
Desc. : JS - Transaksi Pengeluaran Kas
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 23rd, 2013.
|
||||
Last Modified : September 29th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var KasKeluarJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
//$('#butCari').click(function(){this.tx_brow();}.bind(this));
|
||||
this.data_query('tabel-detail', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_detail: function(mode, No_Kas){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-tx','mode_detail='+mode,'No_Kas='+No_Kas],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Pengeluaran Kas', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.tx_simpan();}.bind(this)).end()
|
||||
.find('#Jumlah').keyup(function(e){
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.tx_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert') {
|
||||
$('#TXID').focus();
|
||||
} else {
|
||||
FoniaJS.setFocus('#Ket');
|
||||
}
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.tx_detail('insert', "");
|
||||
},
|
||||
|
||||
tx_ubah: function(acell){
|
||||
this.tx_detail('update', acell[0]);
|
||||
},
|
||||
|
||||
tx_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[0]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Kas='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Kas','Tgl_Kas','CabID','TXID','Ket','Jumlah'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode='+mode,'No_Kas'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')]
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/gel/terima.js
|
||||
Desc. : JS - Transaksi Penerimaan Kas
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 23rd, 2013.
|
||||
Last Modified : September 29th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var KasTerimaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
//$('#butCari').click(function(){this.tx_brow();}.bind(this));
|
||||
this.data_query('tabel-detail', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_detail: function(mode, No_Kas){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-tx','mode_detail='+mode,'No_Kas='+No_Kas],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Penerimaan Kas', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.tx_simpan();}.bind(this)).end()
|
||||
.find('#Jumlah').keyup(function(e){
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.tx_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert') {
|
||||
$('#TXID').focus();
|
||||
} else {
|
||||
FoniaJS.setFocus('#Ket');
|
||||
}
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.tx_detail('insert', "");
|
||||
},
|
||||
|
||||
tx_ubah: function(acell){
|
||||
this.tx_detail('update', acell[0]);
|
||||
},
|
||||
|
||||
tx_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[0]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Kas='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Kas','Tgl_Kas','CabID','TXID','Ket','Jumlah'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode='+mode,'No_Kas'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')]
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,112 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/index.js
|
||||
Desc. : JS - Halaman Utama Desktop
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 24th, 2010.
|
||||
Last Modified : December 14th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
$(document).ready(function(){
|
||||
jQuery("#preloader").remove();
|
||||
loadSidebar();
|
||||
IndexJS.loading();
|
||||
setInterval(function(){
|
||||
if ($('#ChartB').length) return false;
|
||||
IndexJS.load_chart();
|
||||
}, 600000);
|
||||
if ('undefined' !== typeof qz) startConnection();
|
||||
});
|
||||
|
||||
var IndexJS = {
|
||||
|
||||
loading: function(){
|
||||
new Request.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=default'],
|
||||
onSuccess: function(ares){
|
||||
$('#pageContent').html(ares.content);
|
||||
$('#pageToolbarTop').html('');
|
||||
$('#pageToolbarBot').html('');
|
||||
this.load_chart();
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
load_chart: function(){
|
||||
this.data_query('chart-sale');
|
||||
this.data_query('chart-omzet');
|
||||
this.data_query('tabel-stok');
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="chart-sale"){
|
||||
new Request.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=chart-sale'],
|
||||
onSuccess: function(ares){
|
||||
if (ares.tipe=='chart') {
|
||||
var ctx = Chart.getChart('ChartA');
|
||||
if (typeof ctx !== 'undefined') ctx.destroy();
|
||||
var myChart = new Chart($('#ChartA'), {
|
||||
type: ares.chart.type,
|
||||
data: ares.chart.data,
|
||||
options: ares.chart.options
|
||||
});
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="chart-omzet"){
|
||||
new Request.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=chart-omzet'],
|
||||
onSuccess: function(ares){
|
||||
if (ares.tipe=='chart') {
|
||||
var ctx = Chart.getChart('ChartB');
|
||||
if (typeof ctx !== 'undefined') ctx.destroy();
|
||||
var myChart = new Chart($('#ChartB'), {
|
||||
type: ares.chart.type,
|
||||
data: ares.chart.data,
|
||||
options: ares.chart.options
|
||||
});
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-stok"){
|
||||
new Request.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=tabel-stok'],
|
||||
onSuccess: function(ares){
|
||||
if (ares.tipe=='tabel') {
|
||||
$('#tabelStok').html(ares.html);
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function loadSidebar(){
|
||||
const mySidebar = document.getElementById('sidebarMain');
|
||||
mySidebar.addEventListener('shown.bs.modal', () => {
|
||||
document.querySelectorAll('.sidebar .nav-link').forEach((element) => {
|
||||
element.addEventListener('click', (e) => {
|
||||
let nextEl = element.nextElementSibling, parentEl = element.parentElement;
|
||||
if (nextEl){
|
||||
e.preventDefault();
|
||||
let mycollapse = new bootstrap.Collapse(nextEl);
|
||||
if (nextEl.classList.contains('show')){
|
||||
mycollapse.hide();
|
||||
} else {
|
||||
mycollapse.show();
|
||||
var opened_submenu = parentEl.parentElement.querySelector('.submenu.show');
|
||||
if (opened_submenu){ new bootstrap.Collapse(opened_submenu); }
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/cekharga.js
|
||||
Desc. : JS - Informasi Barang & Harga Jual
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 22nd, 2014.
|
||||
Last Modified : January 4th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var CekHargaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
html5QrcodeScanner: null,
|
||||
|
||||
loading: function(){
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
if (FoniaJS.WEB_MOBILE){
|
||||
html5QrcodeScanner = new Html5Qrcode('qr-reader');
|
||||
html5QrcodeScanner.start({ facingMode: 'environment' }, { fps: 10, qrbox: 250 }, CekHargaJS.ScanSukses);
|
||||
} else {
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk'], {'selectFunc': CekHargaJS.Produk_Comp});
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
}
|
||||
},
|
||||
|
||||
ScanSukses: function(decodedText, decodedResult){
|
||||
new Request.JSON({
|
||||
url: CekHargaJS.PHP,
|
||||
sendParam: ['data=scan-produk','Cari_Produk='+decodedText],
|
||||
onSuccess: function(ajson){
|
||||
$('#InvID').val(ajson.InvID);
|
||||
$('#Kode_Barang').val(ajson.Kode_Barang);
|
||||
$('#Nama_Barang').val(ajson.Nama_Barang);
|
||||
$('#Nama_Satuan').val(ajson.Nama_Satuan);
|
||||
$('#Harga_Jual').val(ajson.Harga_Jual);
|
||||
$('#Nama_Supplier').val(ajson.Nama_Supplier);
|
||||
}
|
||||
}).send();
|
||||
//this.html5QrcodeScanner.pause();
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#Kode_Barang').val(acell[1]+' / '+acell[2]);
|
||||
$('#Nama_Barang').val(acell[5]);
|
||||
$('#Nama_Satuan').val(acell[6]);
|
||||
$('#Harga_Jual').val(acell[4]);
|
||||
this.update_Sup();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#Kode_Barang').val(adata[0]);
|
||||
$('#Nama_Barang').val(adata[1]);
|
||||
$('#Nama_Satuan').val(adata[2]);
|
||||
$('#Harga_Jual').val(adata[3]);
|
||||
$('#Nama_Produk').val('');
|
||||
$('#Nama_Produk').focus();
|
||||
CekHargaJS.update_Sup();
|
||||
},
|
||||
|
||||
update_Sup: function(){
|
||||
if ($('#InvID').val()==0) return false;
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=cek_supplier','InvID']
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,286 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/opname.js
|
||||
Desc. : JS - Transaksi Opname Stok Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 24th, 2010.
|
||||
Last Modified : September 29th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var OpnameJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
$('#butUbah').click(function(){this.tx_ubah();}.bind(this));
|
||||
$('#butHapus').click(function(){this.tx_hapus();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.tx_simpan();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
$('#butPrint').click(function(){this.tx_print();}.bind(this));
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 900, '', function(){
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
tx_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBTX);
|
||||
$('#No_Opname').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
tx_ubah: function(){
|
||||
if (!$('#No_Opname').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showAuth(function(){this.data_query('master', 'edit')}.bind(this), this, 'EDIT '+$('#No_Opname').val());
|
||||
},
|
||||
|
||||
tx_hapus: function(){
|
||||
if (!$('#No_Opname').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_Opname').val()+'</strong> ?', function(){
|
||||
FoniaJS.showAuth(function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=delete','No_Opname'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
$('#No_Opname').val('');
|
||||
this.data_query('master', 'view');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), this, 'DELETE '+$('#No_Opname').val());
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
if ($('#CabID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Nama Cabang !");
|
||||
return;
|
||||
}
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', function(){
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_Opname').val('');
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(prt){
|
||||
if ($('#No_Opname').val()) {
|
||||
var cetak = new cPRINTER(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "nota-opname");
|
||||
cetak.add_param("Nomor_Cetak", $('#No_Opname').val());
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
return;
|
||||
}
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
if ($('#CabID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Nama Cabang !");
|
||||
return;
|
||||
}
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
|
||||
},
|
||||
|
||||
detail_produk: function(mode, ID, InvID, SatuanID, HPP){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-produk','mode','mode_detail='+mode,'No_Opname','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'HPP='+HPP],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Opname','Tgl_Opname','CabID'], {'selectFunc': OpnameJS.Produk_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Qty').keyup(function(e){
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert' && InvID == 0) {
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
} else {
|
||||
FoniaJS.setFocus('#Qty');
|
||||
}
|
||||
this.update_stok();
|
||||
}.bind(this), null, false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
if ($('#CabID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Nama Cabang !");
|
||||
return;
|
||||
}
|
||||
this.detail_produk('insert', 0, 0, 0, 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[2]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Opname','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
if (parseInt($('#InvID').val())==0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Barang !');
|
||||
return;
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Opname','CabID','ID','InvID','SatuanID','Qty','Harga_Beli'],
|
||||
onSuccess: function(){
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['data=master','mode='+mode,'No_Opname'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['data=master','mode=save','No_Opname','Tgl_Opname','CabID','Catatan'];
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: function(ajson){
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#No_Opname').keyup(function(e){
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#No_Opname")) && ($("#No_Opname").val() !== '')) this.data_query('master');
|
||||
}
|
||||
}.bind(this));
|
||||
this.data_query('tabel-detail');
|
||||
if ($.inArray($("#mode").val(),['add','edit']) !== -1) {
|
||||
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
|
||||
$('#butTambah').addClass('d-none');
|
||||
$('#butUbah').addClass('d-none');
|
||||
$('#butHapus').addClass('d-none');
|
||||
$('#butPrint').addClass('d-none');
|
||||
$('#butSimpan').removeClass('d-none');
|
||||
$('#butBatal').removeClass('d-none');
|
||||
} else {
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#butTambah').removeClass('d-none');
|
||||
$('#butUbah').removeClass('d-none');
|
||||
$('#butHapus').removeClass('d-none');
|
||||
$('#butPrint').removeClass('d-none');
|
||||
$('#butSimpan').addClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
}
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
FoniaJS.setFocus('#No_Opname');
|
||||
}
|
||||
if ($('#mode').val()=='print') this.tx_print(true);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','No_Opname']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-tx','Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','CabID','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#SatuanID').val(adata[3]);
|
||||
$('#Kode_Barang').val(adata[0]);
|
||||
$('#Nama_Satuan').val(adata[2]);
|
||||
$('#Harga_Beli').val(adata[4]);
|
||||
OpnameJS.update_stok();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
update_stok: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=cek_stok','Tgl_Opname','CabID','InvID']
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/opname_barang.js
|
||||
Desc. : JS - Transaksi Penyesuaian Stok Per Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 22nd, 2014.
|
||||
Last Modified : September 21st, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var OpnameBarangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
html5QrcodeScanner: null,
|
||||
|
||||
loading: function(){
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
if (FoniaJS.WEB_MOBILE){
|
||||
html5QrcodeScanner = new Html5Qrcode('qr-reader');
|
||||
html5QrcodeScanner.start({ facingMode: 'environment' }, { fps: 10, qrbox: 250 }, OpnameBarangJS.ScanSukses);
|
||||
} else {
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk'], {'selectFunc': OpnameBarangJS.Produk_Comp});
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
}
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
if ($('#InvID').val()==0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Produk!');
|
||||
return;
|
||||
}
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=simpan-opname','InvID','Stok_Fisik'],
|
||||
onSuccess: function(ares){
|
||||
if (ares.Status){
|
||||
FoniaJS.showInfo('Sukses simpan penyesuaian Stok !');
|
||||
$('#InvID').val(0);
|
||||
$('.form-control').val('')
|
||||
if (FoniaJS.WEB_MOBILE){
|
||||
this.html5QrcodeScanner.resume();
|
||||
} else FoniaJS.setFocus('Nama_Produk');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
ScanSukses: function(decodedText, decodedResult){
|
||||
new Request.JSON({
|
||||
url: OpnameBarangJS.PHP,
|
||||
sendParam: ['data=scan-produk','Cari_Produk='+decodedText],
|
||||
onSuccess: function(ajson){
|
||||
$('#InvID').val(ajson.InvID);
|
||||
$('#Kode_Barang').val(ajson.Kode_Barang);
|
||||
$('#Nama_Barang').val(ajson.Nama_Barang);
|
||||
$('#Nama_Satuan').val(ajson.Nama_Satuan);
|
||||
$('#Stok_Sistem').val(ajson.Stok_Sistem);
|
||||
FoniaJS.setFocus('#Stok_Fisik');
|
||||
}
|
||||
}).send();
|
||||
this.html5QrcodeScanner.pause();
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#Kode_Barang').val(acell[1]+' / '+acell[2]);
|
||||
$('#Nama_Barang').val(acell[5]);
|
||||
$('#Nama_Satuan').val(acell[6]);
|
||||
OpnameBarangJS.update_Stok();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#Kode_Barang').val(adata[0]);
|
||||
$('#Nama_Barang').val(adata[1]);
|
||||
$('#Nama_Satuan').val(adata[2]);
|
||||
OpnameBarangJS.update_Stok();
|
||||
},
|
||||
|
||||
update_Stok: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=cek_stok','InvID'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Stok_Fisik');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,525 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/pos.js
|
||||
Desc. : JS - Transaksi Penjualan / Kasir POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 5th, 2012.
|
||||
Last Modified : January 21st, 2026.
|
||||
|
||||
(c) 2012 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var POSJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
POLE_DISP: null,
|
||||
POLE_CONF: {},
|
||||
|
||||
loading: function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Jual'], {'selectFunc': POSJS.Produk_Comp, 'keyFunc': POSJS.Produk_Key, 'breakValue': ['*9']});
|
||||
$('#Nama_Produk').click(() => $('#Nama_Produk').select());
|
||||
$('#POS_Qty').on({
|
||||
keyup: (e) => {
|
||||
(13 == e.which) && $('#Nama_Produk').focus();
|
||||
},
|
||||
click: () => $('#POS_Qty').select()
|
||||
});
|
||||
this.data_query('master');
|
||||
//POLE DISPLAY
|
||||
this.data_query('pole-config');
|
||||
},
|
||||
|
||||
proses_oc: function(){
|
||||
var cetak = new cPRINTERPOS(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "opencash");
|
||||
cetak.exec();
|
||||
$('#Nama_Produk').focus();
|
||||
},
|
||||
|
||||
proses_print: function(oc){
|
||||
var _no_jual = $('#No_Cetak').val();
|
||||
var cetak = new cPRINTERPOS(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "nota-pos");
|
||||
cetak.add_param("Nomor_Cetak", _no_jual);
|
||||
cetak.add_param("Open_Cash", oc);
|
||||
cetak.exec();
|
||||
},
|
||||
|
||||
proses_cancel: function(){
|
||||
if ($('#Total_Item').val()==0) {
|
||||
FoniaJS.showInfo('Tidak ada item barang !');
|
||||
return;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Apakah Anda yakin ingin membatalkan ?<br>Semua item transaksi nota ini akan dihapus !', () => this.data_query('master','cancel'), 'danger');
|
||||
},
|
||||
|
||||
nota_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Nota" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowNota"> </div>');
|
||||
this.winBNota = FoniaJS.showWindow('BNota', 'Daftar Transaksi', _isi, 900, '', () => {
|
||||
$('#winBNota')
|
||||
.find('#Cari_Nota').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-nota');
|
||||
}).end()
|
||||
.find('#butSearch').click((e) => {
|
||||
this.data_query('brow-nota');
|
||||
}).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBNota').find('#Cari_Nota').val('');
|
||||
this.data_query('brow-nota');
|
||||
});
|
||||
this.data_query('brow-nota');
|
||||
});
|
||||
},
|
||||
|
||||
nota_print: function(acell){
|
||||
FoniaJS.closeWindow(this.winBNota);
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin ingin cetak ulang Nota "'+acell[0]+'" ?', () => {
|
||||
$('#No_Cetak').val(acell[0]);
|
||||
this.proses_print(0);
|
||||
}, 'info');
|
||||
},
|
||||
|
||||
nota_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBNota);
|
||||
FoniaJS.showAuth(() => {
|
||||
$('#No_Jual').val(acell[0]);
|
||||
this.data_query('master', 'edit');
|
||||
}, this, 'EDIT POS : '+acell[0]);
|
||||
},
|
||||
|
||||
nota_delete: function(acell){
|
||||
FoniaJS.closeWindow(this.winBNota);
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Nota "'+acell[0]+'" ?', () => {
|
||||
FoniaJS.showAuth(() => {
|
||||
$('#No_Jual').val(acell[0]);
|
||||
this.data_query('master', 'delete');
|
||||
}, this, 'DELETE '+acell[0]);
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
pending_brow: function(){
|
||||
this.winBPend = FoniaJS.showWindow('BPend', 'Daftar Transaksi Pending', '<div id="divBrowPending"> </div>', 900, '', () => this.data_query('brow-pending'));
|
||||
},
|
||||
|
||||
pending_select: function(acell){
|
||||
$('#No_Jual').val(acell[0]);
|
||||
FoniaJS.closeWindow(this.winBPend);
|
||||
this.data_query('master', 'pending-edit');
|
||||
},
|
||||
|
||||
pending_delete: function(acell){
|
||||
FoniaJS.closeWindow(this.winBPend);
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Transaksi Pending "'+acell[0]+'" ?', () => {
|
||||
$('#No_Jual').val(acell[0]);
|
||||
this.data_query('master', 'pending-delete');
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
produk_add: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=info_produk'],
|
||||
onSuccess: (txt) => {
|
||||
this.winBarang = FoniaJS.showWindow('Barang', 'Penambahan Item Barang', txt, 600, [{},{i:'butBatal'},{i:'butSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winBarang')
|
||||
.find('#butSimpan').click(() => this.produk_simpan()).end()
|
||||
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
|
||||
.find('#Kode_Barcode').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Nama_Barang');
|
||||
}).end()
|
||||
.find('#Nama_Barang').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Grup_InvID');
|
||||
}).end()
|
||||
.find('#Grup_InvID').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#StokID');
|
||||
}).end()
|
||||
.find('#StokID').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Harga_Jual');
|
||||
});
|
||||
FoniaJS.setFocus('#Kode_Barcode');
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
produk_simpan: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=simpan_produk','Kode_Barcode','Nama_Barang','Grup_InvID','StokID','Harga_Jual'],
|
||||
onSuccess: (ajson) => {
|
||||
if (ajson.msg) FoniaJS.showInfo(ajson.msg);
|
||||
FoniaJS.closeWindow(this.winBarang);
|
||||
$('#Nama_Produk').val('').focus();
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', () => {
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}).end()
|
||||
.find('#butSearch').click((e) => {
|
||||
this.data_query('brow-produk');
|
||||
}).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
});
|
||||
this.data_query('brow-produk');
|
||||
});
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
this.detail_produk('insert', 0, acell[0], acell[1]);
|
||||
},
|
||||
|
||||
detail_produk: function(mode, ID, InvID, SatuanID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_produk','mode_detail='+mode,'No_Jual','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID],
|
||||
onSuccess: (txt) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', txt, 600, [{},{i:'butBatal'},{i:'butSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winDetail')
|
||||
.find('#butSimpan').click(() => this.detail_simpan()).end()
|
||||
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
|
||||
.find('#Qty').keyup((e) => {
|
||||
this.Hitung_Detail(1);
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Harga_Diskon');
|
||||
}).end()
|
||||
.find('#Harga_Diskon').keyup((e) => {
|
||||
this.Hitung_Detail(1);
|
||||
if (13==e.which) {
|
||||
if (FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
|
||||
}
|
||||
}).end()
|
||||
.find('#Persen_Diskon').keyup((e) => {
|
||||
this.Hitung_Detail(2);
|
||||
if (13==e.which) {
|
||||
if (FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
|
||||
}
|
||||
});
|
||||
this.Hitung_Detail(1);
|
||||
FoniaJS.setFocus('#Qty');
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
if (parseInt(acell[3])==1){
|
||||
this.detail_lain('update', acell[0]);
|
||||
} else
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','No_Jual','ID='+acell[0]],
|
||||
onSuccess: () => {
|
||||
$('#Nama_Produk').focus();
|
||||
//POLE DISPLAY
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP.Send([{'t':'..','a':'L'},{'t':'Total '+$('#Total_Disp').html(),'a':'R'}]);
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
if (FoniaJS.StrToFloat($('#Persen_Diskon').val())>=100) {
|
||||
FoniaJS.showInfo('Nilai Diskon diluar batas !');
|
||||
return false;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','No_Jual','InvID','SatuanID','Qty','Harga_Beli','Harga_Jual','Harga_Diskon','ID','Ket'],
|
||||
onSuccess: () => {
|
||||
//POLE DISPLAY
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP.Send([{'t':$('#Nama_Lengkap').val(),'a':'L'},{'t':'Total '+$('#Total_Disp').html(),'a':'R'}]);
|
||||
}
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
$('#Nama_Produk').val('');
|
||||
$('#Nama_Produk').focus();
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_lain: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_lain','mode_detail='+mode,'No_Jual','ID='+ID],
|
||||
onSuccess: (txt) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', txt, 600, [{},{i:'butBatal'},{i:'butSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winDetail')
|
||||
.find('#butSimpan').click(() => this.detail_simpan()).end()
|
||||
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
|
||||
.find('#Ket').keyup((e) => {
|
||||
if ('' === e.target.value) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Qty');
|
||||
}).end()
|
||||
.find('#Qty').keyup((e) => {
|
||||
this.Hitung_Detail(0);
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Harga_Jual');
|
||||
}).end()
|
||||
.find('#Harga_Jual').keyup((e) => {
|
||||
this.Hitung_Detail(0);
|
||||
if (13==e.which) {
|
||||
if (FoniaJS.StrToFloat($('#Qty').val())>0 && FoniaJS.StrToFloat($('#Harga_Jual').val())>0) this.detail_simpan();
|
||||
}
|
||||
});
|
||||
this.Hitung_Detail(0);
|
||||
FoniaJS.setFocus('#Ket');
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
kasir_show: function(){
|
||||
//POLE DISPLAY
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP.Send([{'t':'Total '+$('#Total_Disp').html(),'a':'C'},{'t':'Tunai / Non Tunai ?','a':'C'}]);
|
||||
}
|
||||
if ($('#Total_Item').val()==0) {
|
||||
FoniaJS.showInfo('Belum ada transaksi !');
|
||||
return;
|
||||
}
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=info_kasir','No_Jual','Total_Nota'],
|
||||
onSuccess: (adata) => {
|
||||
this.winKasir = FoniaJS.showWindow('Kasir', 'Informasi Pembayaran', adata.html, 500, '', () => {
|
||||
$('#butKPend').click(() => this.kasir_pending());
|
||||
$('#butKBayar').click(() => this.kasir_simpan());
|
||||
$('#butKBatal').click(() => $('#Nama_Produk').focus());
|
||||
$('#popTotal_Tunai').keyup((e) => {
|
||||
if (13 == e.which && parseFloat(e.target.value) == 0){
|
||||
e.target.value = FoniaJS.FloatToStr($('#Total_Nota').val());
|
||||
}
|
||||
if (27 == e.which) {
|
||||
FoniaJS.closeWindow(this.winKasir);
|
||||
$('#Nama_Produk').focus();
|
||||
}
|
||||
this.kasir_hitung();
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (13 == e.which) $('#butKBayar').focus();
|
||||
});
|
||||
$('#popTotal_Kartu').keyup((e) => {
|
||||
if (13 == e.which && $('#popKartuID').val() > 0 && parseFloat(e.target.value) == 0){
|
||||
e.target.value = FoniaJS.FloatToStr($('#Total_Nota').val()-FoniaJS.StrToFloat($('#popTotal_Tunai').val()));
|
||||
}
|
||||
if (27 == e.which) {
|
||||
FoniaJS.closeWindow(this.winKasir);
|
||||
$('#Nama_Produk').focus();
|
||||
}
|
||||
this.kasir_hitung();
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (13 == e.which) $('#butKBayar').focus();
|
||||
});
|
||||
$('#popKartuID').change(() => {
|
||||
if ($('#popKartuID').val() > 0){
|
||||
if (parseFloat($('#popTotal_Kartu').val()) == 0) $('#popTotal_Kartu').val(FoniaJS.FloatToStr($('#Total_Nota').val()-FoniaJS.StrToFloat($('#popTotal_Tunai').val())));
|
||||
$('.ckartu').removeClass('d-none');
|
||||
} else {
|
||||
$('#popTotal_Kartu').val('0.00');
|
||||
$('.ckartu').addClass('d-none');
|
||||
}
|
||||
this.kasir_hitung();
|
||||
FoniaJS.setFocus('#popTotal_Kartu');
|
||||
});
|
||||
$('#popTotal_Tunai').val(FoniaJS.FloatToStr($('#Total_Tunai').val()));
|
||||
$('#popTotal_Kartu').val(FoniaJS.FloatToStr($('#Total_Kartu').val()));
|
||||
$('#popTotal_Bayar').val($('#Total_Bayar').val());
|
||||
$('#popKartuID').val($('#KartuID').val()).trigger('change');
|
||||
$('#popNo_Kartu').val($('#No_Kartu').val());
|
||||
$('#popNama_Kartu').val($('#Nama_Kartu').val());
|
||||
$('#Total_Disp').html(adata.Total_Disp);
|
||||
FoniaJS.setFocus('#popTotal_Tunai');
|
||||
});
|
||||
this.Simpan = false;
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
kasir_hitung: function(){
|
||||
const totBayar = FoniaJS.StrToFloat($('#popTotal_Tunai').val()) + FoniaJS.StrToFloat($('#popTotal_Kartu').val());
|
||||
const totSisa = totBayar - FoniaJS.StrToFloat($('#popTotal_Jual').val());
|
||||
$('#popTotal_Bayar').val(totBayar);
|
||||
$('#popTotal_Sisa').val(FoniaJS.FloatToStr(totSisa, 2)).removeClass('border-danger border-success').addClass((totSisa < 0) ? 'border-danger' : 'border-success');
|
||||
},
|
||||
|
||||
kasir_simpan: function(){
|
||||
const totTunai = FoniaJS.StrToFloat($('#popTotal_Tunai').val());
|
||||
const totKartu = FoniaJS.StrToFloat($('#popTotal_Kartu').val());
|
||||
const jenKartu = $('#popKartuID').val();
|
||||
if (jenKartu == 0 && totKartu > 0) {
|
||||
FoniaJS.showInfo('Silakan pilih Jenis Pembayaran Non Tunai!');
|
||||
FoniaJS.setFocus('#popKartuID');
|
||||
return false;
|
||||
} else if (jenKartu > 0 && totKartu == 0) {
|
||||
FoniaJS.showInfo('Silakan masukkan Jumlah Pembayaran Non Tunai!');
|
||||
FoniaJS.setFocus('#popKartuID');
|
||||
return false;
|
||||
}
|
||||
if (FoniaJS.StrToFloat($('#popTotal_Sisa').val())<0) {
|
||||
FoniaJS.showInfo('Pembayaran Transaksi tidak mencukupi!');
|
||||
FoniaJS.setFocus('#popTotal_Bayar');
|
||||
return false;
|
||||
}
|
||||
if (this.Simpan==true) {
|
||||
FoniaJS.showError('Proses pembayaran sedang dilakukan!');
|
||||
return;
|
||||
}
|
||||
this.Simpan = true;
|
||||
$('#Total_Tunai').val(totTunai);
|
||||
$('#Total_Kartu').val(totKartu);
|
||||
$('#Total_Bayar').val($('#popTotal_Bayar').val());
|
||||
$('#KartuID').val($('#popKartuID').val());
|
||||
$('#No_Kartu').val($('#popNo_Kartu').val());
|
||||
$('#Nama_Kartu').val($('#popNama_Kartu').val());
|
||||
FoniaJS.closeWindow(this.winKasir);
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
kasir_pending: function(){
|
||||
FoniaJS.closeWindow(this.winKasir);
|
||||
this.data_query('master', 'pending-save');
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=='master'){
|
||||
mode = (mode) ? mode : '';
|
||||
var sparam = ['data=master','mode='+mode,'No_Jual','No_Cetak'];
|
||||
if (-1 !== mode.search(/save/i)) sparam = ['data=master','mode='+mode,'No_Jual','Tgl_Jual','Total_Tunai','Total_Kartu','Total_Bayar','KartuID','No_Kartu','Nama_Kartu'];
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: (txt) => {
|
||||
$('#divPOS2').html(txt);
|
||||
$('#posPEND').click(() =>this.pending_brow());
|
||||
$('#posTAMBAH').click(() => this.produk_add());
|
||||
$('#posBARANG').click(() => this.produk_brow());
|
||||
$('#posNOTA').click(() => this.nota_brow());
|
||||
$('#posSIMPAN').click(() => this.kasir_show());
|
||||
$('#posBATAL').click(() => this.proses_cancel());
|
||||
FoniaJS.User.Level>1 && $('#posBATAL').hide();
|
||||
this.data_query('detail');
|
||||
$('#Nama_Produk').focus();
|
||||
if (-1!==$.inArray($('#mode').val(), ['print','opencd','saveonly'])){
|
||||
if ($('#mode').val()=='print') this.proses_print(1);
|
||||
if ($('#mode').val()=='opencd') this.proses_oc();
|
||||
//POLE DISPLAY
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP.Send([{'t':this.POLE_CONF.END1,'a':'C'},{'t':this.POLE_CONF.END2,'a':'C'}]);
|
||||
}
|
||||
} else {
|
||||
//POLE DISPLAY
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP.Send([{'t':this.POLE_CONF.START1,'a':'C'},{'t':this.POLE_CONF.START2,'a':'C'}]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=='detail'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','No_Jual']
|
||||
}).send();
|
||||
} else if (tipe=='brow-produk'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: () => {
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=='brow-nota'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-nota','Cari_Nota'],
|
||||
onSuccess: () => {
|
||||
FoniaJS.setFocus('#Cari_Nota');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=='brow-pending'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-pending']
|
||||
}).send();
|
||||
} else if (tipe=='pole-config'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=pole-config'],
|
||||
onSuccess: (acfg) => {
|
||||
if (typeof acfg.pole == 'object'){
|
||||
this.POLE_CONF = acfg.pole;
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP = new cPOLEDISPLAY(this.POLE_CONF.PORT);
|
||||
this.POLE_DISP.Open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var _qty = $('#POS_Qty').val();
|
||||
var adata = item.data.split(':');
|
||||
//jika stok kosong tidak simpan hanya utk glamore
|
||||
if (parseInt(adata[3])>0 || _qty<0){
|
||||
new Request.JSONF({
|
||||
url: POSJS.PHP,
|
||||
sendParam: ['data=detail','mode_detail=insert','No_Jual','InvID='+item.value,'SatuanID='+adata[0],'Qty='+_qty,'Harga_Beli='+adata[1],'Harga_Jual='+adata[2]],
|
||||
onSuccess: () => {
|
||||
$('#POS_Qty').val('1.00');
|
||||
//POLE DISPLAY
|
||||
if (POSJS.POLE_CONF.ENABLE){
|
||||
POSJS.POLE_DISP.Send([{'t':item.text,'a':'L'},{'t':'Total '+$('#Total_Disp').html(),'a':'R'}]);
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
} else {
|
||||
this.winPesan = FoniaJS.showWindow('Pesan', 'Informasi Barang', '<div class="fs-3 text-center text-danger">Barang tidak tersedia atau habis !</div>', 300, [{},{i:'butTutup'}], () => {
|
||||
$('#winPesan').find('#butTutup').click(() => $('#Nama_Produk').focus()).focus();
|
||||
});
|
||||
}
|
||||
$('#Nama_Produk').val('').focus();
|
||||
},
|
||||
|
||||
Produk_Key: function(key, val){
|
||||
if (val == '*9') {
|
||||
if (key == 13) POSJS.detail_lain('insert', 0);
|
||||
} else {
|
||||
if (key == 13) {
|
||||
POSJS.kasir_show();
|
||||
} else if (key == 117) {//f6
|
||||
POSJS.proses_oc();
|
||||
} else if (key == 119) {//f8
|
||||
POSJS.produk_add();
|
||||
} else if (key == 120) {//f9
|
||||
POSJS.produk_brow();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onblur_Qty: function(){
|
||||
if ($('#POS_Qty').val()==0) $('#POS_Qty').val('1.00');
|
||||
},
|
||||
|
||||
Hitung_Detail: function(tipe){
|
||||
if (tipe==1) $('#Persen_Diskon').val(FoniaJS.FloatToStr((FoniaJS.StrToFloat($('#Harga_Diskon').val())*100) / FoniaJS.StrToFloat($('#Harga_Jual').val()), 2));
|
||||
if (tipe==2) $('#Harga_Diskon').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Jual').val()) * FoniaJS.StrToFloat($('#Persen_Diskon').val()) * 0.01, 2));
|
||||
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * (FoniaJS.StrToFloat($('#Harga_Jual').val()) - FoniaJS.StrToFloat($('#Harga_Diskon').val())), 2));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,84 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/login.js
|
||||
Desc. : JS - Halaman Proses Login
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 15th, 2008.
|
||||
Last Modified : June 28th, 2020.
|
||||
|
||||
(c) 2008 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#butLogin').click(LoginJS.Proses_Login);
|
||||
$('#Username').keydown(function(e){
|
||||
if (e.which==13) $('#Password').focus();
|
||||
});
|
||||
$('#Password').keydown(function(e){
|
||||
if (e.which==13) $('#butLogin').trigger('click');
|
||||
});
|
||||
LoginJS.Tampil_Login();
|
||||
document.oncontextmenu = new Function ('return false');
|
||||
|
||||
$.backstretch([
|
||||
[
|
||||
{ width: 1280, url: FoniaJS.WEB_PATH+"assets/images/bs/toko_1280.jpg" },
|
||||
{ width: 960, url: FoniaJS.WEB_PATH+"assets/images/bs/toko_960.jpg" }
|
||||
],
|
||||
[
|
||||
{ width: 1280, url: FoniaJS.WEB_PATH+"assets/images/bs/rak_1280.jpg" },
|
||||
{ width: 960, url: FoniaJS.WEB_PATH+"assets/images/bs/rak_960.jpg" }
|
||||
],
|
||||
[
|
||||
{ width: 1280, url: FoniaJS.WEB_PATH+"assets/images/bs/shop_1280.jpg" },
|
||||
{ width: 960, url: FoniaJS.WEB_PATH+"assets/images/bs/shop_960.jpg" }
|
||||
]
|
||||
], {
|
||||
duration: 6000,
|
||||
transition: 'push_left|push_right|cover_up|cover_down|fade',
|
||||
transitionDuration: 600
|
||||
});
|
||||
});
|
||||
|
||||
var LoginJS = {
|
||||
|
||||
Tampil_Login: function(){
|
||||
var Username = FoniaJS.getCookie('Username');
|
||||
if (Username != '') {
|
||||
$('#Username').val(Username);
|
||||
FoniaJS.setFocus('#Password');
|
||||
} else {
|
||||
FoniaJS.setFocus('#Username');
|
||||
}
|
||||
},
|
||||
|
||||
Proses_Login: function(){
|
||||
if (!$('#Username').val()){
|
||||
$('#Username').focus();
|
||||
FoniaJS.showError('Silahkan masukkan Username !');
|
||||
return false;
|
||||
}
|
||||
if (!$('#Password').val()){
|
||||
$('#Password').focus();
|
||||
FoniaJS.showError('Silahkan masukkan Password !');
|
||||
return false;
|
||||
}
|
||||
new Request.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/login.php',
|
||||
sendParam: ['mode=login','Username','Password'],
|
||||
onSuccess: function(respon){
|
||||
if (respon.hasil == 'SUKSES'){
|
||||
FoniaJS.setCookie('Username', $('#Username').val(), 365);
|
||||
$('#divLoginMsg').html(respon.pesan).removeClass('d-none');
|
||||
$('.input-group').addClass('d-none');
|
||||
setTimeout(function(){self.location = FoniaJS.WEB_PATH+'?auth='+(respon.token??'');}, 1600);
|
||||
}else{
|
||||
FoniaJS.showInfo(respon.pesan, 3000);
|
||||
if (respon.redir) setTimeout(function(){self.location = respon.redir;}, 600);
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,118 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/barcode.js
|
||||
Desc. : JS - Cetak Barcode Label
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 28th, 2013.
|
||||
Last Modified : October 2nd, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoBarcodeJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print();}.bind(this));
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk'], {'selectFunc': RepoBarcodeJS.Produk_Comp});
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
$('#butPL').click(function(){this.load_printer();}.bind(this));
|
||||
$('#Nama_Produk').focus();
|
||||
},
|
||||
|
||||
proses_print: function(){
|
||||
if ($('#InvID').val() == 0){
|
||||
FoniaJS.showError('Silakan masukkan Nama Barang !');
|
||||
FoniaJS.setFocus('Nama_Produk');
|
||||
return;
|
||||
}
|
||||
if ($('#Printer').val() == ''){
|
||||
FoniaJS.showError('Silakan pilih Nama Printer Barcode !');
|
||||
return;
|
||||
}
|
||||
var cetak = new cPRINTERPOS(this.PHP);
|
||||
cetak.setPrinter($('#Printer').val());
|
||||
cetak.add_param("data", "print-barcode");
|
||||
cetak.add_param("InvID");
|
||||
cetak.add_param("SatuanID");
|
||||
cetak.add_param("Qty");
|
||||
cetak.add_param("Kode_Sup");
|
||||
cetak.add_param("Printer");
|
||||
cetak.exec();
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#SatuanID').val(acell[1]);
|
||||
$('#Kode_SKU').val(acell[2]);
|
||||
$('#Nama_Produk').val(acell[4]);
|
||||
this.update_Sup();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#SatuanID').val(adata[1]);
|
||||
$('#Kode_SKU').val(adata[0]);
|
||||
RepoBarcodeJS.update_Sup();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
update_Sup: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=opt-sup','InvID']
|
||||
}).send();
|
||||
},
|
||||
|
||||
load_printer: function(){
|
||||
var parent = this;
|
||||
qz.printers.find().then(function(data){
|
||||
var _dafprt = '';
|
||||
for(var i = 0; i < data.length; i++) {
|
||||
_dafprt += data[i] + '|';
|
||||
};
|
||||
new Request.JSONF({
|
||||
url: parent.PHP,
|
||||
sendParam: ['data=load-printer','Printer='+_dafprt,'DefPrint='+$('#configPrinter').html()]
|
||||
}).send();
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/dana_pos.js
|
||||
Desc. : JS - Laporan Penerimaan Kasir / POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 8th, 2012.
|
||||
Last Modified : September 30th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoDanaPOSJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butPOS').click(function(){this.proses_pos();}.bind(this));
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_pos: function(){
|
||||
if ($('#KasirID').val()==0){
|
||||
FoniaJS.showError("Untuk Cetak POS silakan pilih salah satu Nama Pengguna!");
|
||||
$('#KasirID').focus();
|
||||
return;
|
||||
}
|
||||
var cetak = new cPRINTERPOS(this.PHP);
|
||||
cetak.add_param("data", "print-pos");
|
||||
cetak.add_param("Tipe", "R");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("KasirID");
|
||||
cetak.add_param("Tgl_From");
|
||||
cetak.add_param("Tgl_To");
|
||||
cetak.exec();
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("Tipe");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("KasirID");
|
||||
cetak.add_param("Tgl_From");
|
||||
cetak.add_param("Tgl_To");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("KasirID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/jual.js
|
||||
Desc. : JS - Laporan Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 12th, 2011.
|
||||
Last Modified : September 30th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoJualJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("Tipe");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("Tgl_From");
|
||||
cetak.add_param("Tgl_To");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/jual_analisa.js
|
||||
Desc. : JS - Laporan Analisa Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 9th, 2013.
|
||||
Last Modified : October 4th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoJualAnaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("Tipe");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("Grup_InvID");
|
||||
cetak.add_param("SupID");
|
||||
cetak.add_param("Urut");
|
||||
cetak.add_param("Tgl_From");
|
||||
cetak.add_param("Tgl_To");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Grup_InvID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Urut");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/jual_rekap.js
|
||||
Desc. : JS - Laporan Rekap Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 9th, 2013.
|
||||
Last Modified : October 4th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoJualRekapJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("Grup_InvID");
|
||||
cetak.add_param("SupID");
|
||||
cetak.add_param("Tgl_From");
|
||||
cetak.add_param("Tgl_To");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Grup_InvID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,160 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/label.js
|
||||
Desc. : JS - Cetak Label Harga Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 13th, 2014.
|
||||
Last Modified : October 5th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoLabelJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){//oke
|
||||
$('#butHapus').click(function(){this.proses_empty();}.bind(this));
|
||||
$('#butPrint').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
this.data_query('tabel-detail', 'empty', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
proses_empty: function(){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=empty']
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_print: function(prt){//oke
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
produk_brow: function(){//oke
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winBProduk')
|
||||
.find('#butWSimpan').click(function(){this.produk_simpan();}.bind(this)).end()
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_simpan: function(){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=simpan-produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
grup_brow: function(){//oke
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Grup" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowGrup"> </div>');
|
||||
this.winBGrup = FoniaJS.showWindow('BGrup', 'Daftar Grup Barang', _isi, 900, null, function(){
|
||||
$('#winBGrup')
|
||||
.find('#Cari_Grup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-grup');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-grup');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBGrup').find('#Cari_Grup').val('');
|
||||
this.data_query('brow-grup');
|
||||
}.bind(this));
|
||||
this.data_query('brow-grup');
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
grup_select: function(acell){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=simpan-grup','Grup_InvID='+acell[0]],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winBGrup);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){//oke
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-tx','mode_detail=update','ID='+acell[0]],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Nama_Produk').keyup(function(e){
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){//oke
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=delete','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail','ID','Nama_Produk='+encodeURIComponent($('#Nama_Produk').val())],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){//oke
|
||||
if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail='+mode,'No_Label'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')]
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-grup"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-grup','Cari_Grup'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/opname.js
|
||||
Desc. : JS - Laporan Opname Stok Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 8th, 2012.
|
||||
Last Modified : October 4th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoOpnameJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("KasirID");
|
||||
cetak.add_param("Tgl_From");
|
||||
cetak.add_param("Tgl_To");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("KasirID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/stok_akhir.js
|
||||
Desc. : JS - Laporan Stok Akhir Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 24th, 2011.
|
||||
Last Modified : October 1st, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoStokAkhirJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("SupID");
|
||||
cetak.add_param("Grup_InvID");
|
||||
cetak.add_param("Tanggal");
|
||||
cetak.add_param("Urut");
|
||||
cetak.add_param("Harga");
|
||||
cetak.add_param("Min_Stok");
|
||||
cetak.add_param("Min_Qty");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Grup_InvID");
|
||||
dload.add_param("Tanggal");
|
||||
dload.add_param("Urut");
|
||||
dload.add_param("Harga");
|
||||
dload.add_param("Min_Stok");
|
||||
dload.add_param("Min_Qty");
|
||||
dload.download();
|
||||
},
|
||||
|
||||
oc_MinStok: function(){
|
||||
if ($('#Min_Stok').val()=='Y') {
|
||||
$('#Min_Qty').prop({disabled:false, readonly:false});
|
||||
FoniaJS.setFocus('#Min_Qty')
|
||||
} else {
|
||||
$('#Min_Qty').prop({disabled:true, readonly:true}).val(0);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,100 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/stok_mutasi.js
|
||||
Desc. : JS - Laporan Mutasi Stok Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 16th, 2011.
|
||||
Last Modified : October 2nd, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoStokMutasiJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk'], {'selectFunc': RepoStokMutasiJS.Produk_Comp});
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
$('#Nama_Produk').focus();
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
if ($('#InvID').val()==0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Barang !');
|
||||
$('#Nama_Produk').focus();
|
||||
return;
|
||||
}
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("InvID");
|
||||
cetak.add_param("Tgl_From");
|
||||
cetak.add_param("Tgl_To");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
if ($('#InvID').val()==0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Barang !');
|
||||
$('#Nama_Produk').focus();
|
||||
return;
|
||||
}
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("InvID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#Nama_Produk').val(acell[3]);
|
||||
$('#Tgl_From').focus();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
$('#InvID').val(item.value);
|
||||
$('#Tgl_From').focus();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,80 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/about.js
|
||||
Desc. : JS - Informasi Aplikasi
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : November 23th, 2011.
|
||||
Last Modified : May 1st, 2022.
|
||||
|
||||
(c) 2011 - 2022, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var AboutJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#win'+this.KODE).find('#divBuildInfo').html('<p>Aplikasi dibuat dengan komponen :<br>- jQuery Version '+$().jquery+' <br>- Bootstrap Version '+$.fn.tooltip.Constructor.VERSION+' <br>- FoniaJS Version '+FoniaJS.version+' <br>- FoniaPHP Version '+FoniaJS.phpversion+'</p>');
|
||||
},
|
||||
|
||||
proses_checkdb: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=check_db'],
|
||||
onSuccess: function(txt){
|
||||
this.winCheck = FoniaJS.showWindow('CekDB', 'Cek, Perbaiki dan Optimalisasi Database', txt, 500, [{},{i:'butTutup'},{i:'butWProses',v:'Proses DB !',c:'success'}], function(){
|
||||
$('#winCekDB').find('#butWProses').click(function(){this.checkdb_run();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_update: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=check_update'],
|
||||
onSuccess: function(txt){
|
||||
this.winUpdate = FoniaJS.showWindow('CekApp', 'Cek dan Update Aplikasi', txt, 500, [{},{i:'butTutup'},{i:'butWUpdate',v:'Proses Update !',c:'success'}], function(){
|
||||
$('#winCekApp').find('#butWUpdate').click(function(){this.update_run();}.bind(this));
|
||||
var tomb = $('#winCekApp').find('#butWUpdate');
|
||||
if ($('#file_online').val()==1){
|
||||
tomb.prop('disabled', false);
|
||||
} else {
|
||||
tomb.html('Telah Update!').prop('disabled', true);
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
checkdb_run: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=proses_db','DB_Cek','DB_Repair','DB_Opti'],
|
||||
onSuccess: function(txt){
|
||||
if ($('#DB_Hasil')) $('#DB_Hasil').removeClass('d-none').html(txt);
|
||||
FoniaJS.showInfo('Proses Database selesai', 2000);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
update_run: function(){
|
||||
if ($('#file_online')){
|
||||
if ($('#file_online').val()==1){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=proses_update','file_web','file_sql','file_build'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.sukses==true) {
|
||||
FoniaJS.showInfo('Aplikasi telah di Update.<br>Silakan Log Out dari Aplikasi<br>Lalu refresh browser Anda!');
|
||||
} else {
|
||||
FoniaJS.showInfo('Aplikasi gagal di Update.');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/chpasswd.js
|
||||
Desc. : JS - Perubahan Password Operator
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 7th, 2008.
|
||||
Last Modified : April 25th, 2020.
|
||||
|
||||
(c) 2008 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var SYSChpasswdJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butSave').click(function(){this.proses_save();}.bind(this));
|
||||
FoniaJS.setFocus('#LPass');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
if ($("#LPass").val()=="") {
|
||||
FoniaJS.showInfo("Silakan masukkan password lama Anda!");
|
||||
FoniaJS.setFocus("#LPass");
|
||||
return false;
|
||||
} else if ($("#BPass1").val()=="") {
|
||||
FoniaJS.showInfo("Silakan masukkan password baru 1 Anda!");
|
||||
FoniaJS.setFocus("#BPass1");
|
||||
return false;
|
||||
} else if ($("#BPass2").val()=="") {
|
||||
FoniaJS.showInfo("Silakan masukkan password baru 2 Anda!");
|
||||
FoniaJS.setFocus("#BPass2");
|
||||
return false;
|
||||
} else if ($("#BPass1").val()!=$("#BPass2").val()) {
|
||||
FoniaJS.showInfo("Password baru 1 dan 2 Anda tidak sama!");
|
||||
FoniaJS.setFocus("#BPass1");
|
||||
return false;
|
||||
}
|
||||
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=chpasswd','LPass','BPass1','BPass2'],
|
||||
onSuccess: function(ajson){
|
||||
if (ajson.status == true) {
|
||||
FoniaJS.showInfo(ajson.msg);
|
||||
FoniaJS.closeWindow('#win'+this.KODE);
|
||||
} else {
|
||||
FoniaJS.showError(ajson.msg);
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/config.js
|
||||
Desc. : JS - Konfigurasi Aplikasi
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 25th, 2010.
|
||||
Last Modified : September 30th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var ConfigJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
this.data_query('view');
|
||||
},
|
||||
|
||||
proses_edit: function(){
|
||||
this.data_query('edit');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','mode=save','REG_ID','REG_ADDRESS','REG_CITY','REG_POSTCODE','REG_PHONE','REG_FAX','REG_WEBSITE','REG_EMAIL','REG_OWNER','REG_NPWP'],
|
||||
onSuccess: function(txt){
|
||||
$('#divMaster').html(txt);
|
||||
this.update_event();
|
||||
}.bind(this)
|
||||
}).send()
|
||||
},
|
||||
|
||||
data_query: function(mode){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','mode='+mode,'REG_ID'],
|
||||
onSuccess: function(txt){
|
||||
$('#divMaster').html(txt);
|
||||
this.update_event();
|
||||
}.bind(this)
|
||||
}).send()
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$("#butUbah").prop('disabled', true);
|
||||
$("#butSimpan").prop('disabled', false);
|
||||
} else {
|
||||
$("#butUbah").prop('disabled', false);
|
||||
$("#butSimpan").prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/printer.js
|
||||
Desc. : JS - Konfigurasi Printer POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 4th, 2013.
|
||||
Last Modified : November 7th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var PrinterJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
this.data_query('form-printer');
|
||||
},
|
||||
|
||||
proses_edit: function(){
|
||||
this.data_query('form-printer', 'edit');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
this.data_query('form-printer', 'save');
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=='form-printer'){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=form-printer','mode='+mode,'REG_ID','PRINT_AUTO','PRINT_OPENCD','PRINT_AUTOCUT','PRINT_ROW','TITLE_END'],
|
||||
onSuccess: function(a){
|
||||
$('#divPrinter').html(a.html);
|
||||
this.update_event();
|
||||
if (a.sukses) FoniaJS.showInfo('Konfigurasi printer sukses disimpan!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$('#butUbah').prop('disabled', true);
|
||||
$('#butSimpan').prop('disabled', false);
|
||||
} else {
|
||||
$('#butUbah').prop('disabled', false);
|
||||
$('#butSimpan').prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user