/******************************************************************* PHP Class : /Controller/Report/Gel/HarianbesarController Description : Laporan Buku Besar Harian Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : May 1st, 2009. Last Modified : October 22nd, 2026. (c) 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var RepoGelHBesarJS = { PHP: '', KODE: '', index() { $('#butCetak').click(() => this.proses_print(true)); $('#butPreview').click(() => this.proses_print()); $('#butExcel').click(() => this.proses_dload()); $('#butBrowRek').click(() => this.rek_brow()); FoniaJS.AutoComplete('#Nama_Rek', this.PHP + '/auto_rek', [], {'selectFunc':this.Rek_Comp}); FoniaJS.setFocus('#Nama_Rek'); }, proses_print(prt) { if (parseInt($('#Kode_Rek').val())==0) { FoniaJS.showError('Silakan masukkan Nama Rekening !'); return; } var cetak = new Printer(this.PHP + '/print'); cetak.add_param("Kode_Rek"); cetak.add_param("Jenis"); cetak.add_param("Tgl_From"); cetak.add_param("Tgl_To"); if (prt) cetak.doPrint(); else cetak.doPreview(); }, proses_dload() { if (parseInt($('#Kode_Rek').val())==0) { FoniaJS.showError('Silakan masukkan Nama Rekening !'); return; } var dload = new Download(this.PHP + '/excel'); dload.add_param("Kode_Rek"); dload.add_param("Jenis"); dload.add_param("Tgl_From"); dload.add_param("Tgl_To"); dload.download(); }, rek_brow() { var _isi = new String('
 
'); this.winBRek = FoniaJS.showWindow('BRek', 'Daftar Rekening', _isi, 'lg', '', () => { $('#winBRek') .find('#Cari_Rek').keydown((e) => { var key = e.keyCode || e.which || 0; if (key==13 && e.target.value!='') this.data_query('brow-rek'); }).end() .find('#butSearch').click(() => this.data_query('brow-rek')).end() .find('#butAll').click(() => { $('#winBRek').find('#Cari_Rek').val(''); this.data_query('brow-rek'); }); this.data_query('brow-rek'); }); }, rek_select(acell) { FoniaJS.closeWindow(this.winBRek); $('#Kode_Rek').val(acell[0]); $('#Nama_Rek').val(acell[1]); $('#Tgl_From').focus(); }, data_query(tipe, mode) { if (tipe=="brow-rek"){ new Request_JSF({ url: this.PHP + '/brow_rek', sendParam: ['Cari_Rek'], onSuccess: () => FoniaJS.setFocus('#Cari_Rek') }).send(); } }, Rek_Comp(item) { $('#Kode_Rek').val(item.value); $('#Tgl_From').focus(); } };