/******************************************************************* PHP Class : /Controller/Report/Stok/MutasiController Description : Laporan Mutasi Stok Barang Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : July 16th, 2011. Last Modified : October 12th, 2026. (c) 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var RepoStokMutasiJS = { PHP: '', KODE: '', index() { $('#butCetak').click(() => this.proses_print(true)); $('#butPreview').click(() => this.proses_print()); $('#butExcel').click(() => this.proses_dload()); $('#butBrowProduk').click(() => this.produk_brow()); FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', [], {'selectFunc':this.Produk_Comp}); FoniaJS.setFocus('#Nama_Produk'); }, proses_print(prt) { if ($('#InvID').val()==0) { FoniaJS.showError('Silakan masukkan Nama Barang !'); $('#Nama_Produk').focus(); return; } var cetak = new Printer(this.PHP + '/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() { if ($('#InvID').val()==0) { FoniaJS.showError('Silakan masukkan Nama Barang !'); $('#Nama_Produk').focus(); return; } var dload = new Download(this.PHP + '/excel'); dload.add_param("CabID"); dload.add_param("InvID"); dload.add_param("Tgl_From"); dload.add_param("Tgl_To"); dload.download(); }, produk_brow() { var _isi = new String('
 
'); this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => { $('#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(() => 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(acell) { FoniaJS.closeWindow(this.winBProduk); $('#InvID').val(acell[0]); $('#Nama_Produk').val(acell[5]); }, data_query(tipe) { if (tipe=="brow-produk"){ new Request_JSF({ url: this.PHP + '/brow_produk', sendParam: ['Cari_Produk'], onSuccess: () => FoniaJS.setFocus('#Cari_Produk') }).send(); } }, Produk_Comp(item) { $('#InvID').val(item.value); $('#Tgl_From').focus(); } };