101 lines
3.8 KiB
JavaScript
101 lines
3.8 KiB
JavaScript
/*******************************************************************
|
|
|
|
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();
|
|
}
|
|
|
|
};
|