/******************************************************************* App. Name : Inventory Advanced Systems Module : /apps/js/repo/jual_retur.js Desc. : JS - Laporan Retur Penjualan Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : April 12th, 2011. Last Modified : July 4th, 2023. (c) 2011 - 2023, 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var RepoJualReturJS = { PHP: '', KODE: '', loading: function(){ $('#butCetak').click(function(){this.proses_print('print');}.bind(this)); $('#butPreview').click(function(){this.proses_print('preview');}.bind(this)); //$('#butExcel').click(function(){this.proses_dload();}.bind(this)); FoniaJS.AutoComplete('#Nama_Outlet', this.PHP, ['data=auto-outlet'], this.Outlet_Comp); $('#Nama_Outlet').on('click', function(){ $('#Nama_Outlet').select(); }); }, proses_print: function(prt){ var cetak = new cPRINTER(this.PHP); cetak.set_zoom(90); cetak.add_param("data", "print"); cetak.add_param("Tipe"); cetak.add_param("OutletID"); cetak.add_param("Tgl_From"); cetak.add_param("Tgl_To"); if (prt=='print') { cetak.doPrint(); } else cetak.doPreview(); }, outlet_brow: function(){ var _isi = new String('
 
'); this.winBOutlet = FoniaJS.showWindow('BOutlet', 'Daftar Outlet', _isi, 900, '', function(){ $('#winBOutlet').find('#Cari_Outlet').keydown(function(e){ var key = e.keyCode || e.which || 0; if (key==13 && e.target.value!='') this.data_query('brow-outlet'); }.bind(this)); $('#winBOutlet').find('#butSearch').click(function(e){ this.data_query('brow-outlet'); }.bind(this)); $('#winBOutlet').find('#butAll').click(function(){ $('#winBOutlet').find('#Cari_Outlet').val(''); this.data_query('brow-outlet'); }.bind(this)); this.data_query('brow-outlet'); FoniaJS.setFocus('#Cari_Outlet'); }.bind(this)); }, outlet_select: function(acell){ FoniaJS.closeWindow(this.winBOutlet); $('#OutletID').val(acell[0]); $('#Nama_Outlet').val(acell[2]); }, data_query: function(tipe){ if (tipe=="brow-outlet"){ new Request.JSONF({ url: this.PHP, sendParam: ['data=brow-outlet','Cari_Outlet'], onSuccess: function(){ FoniaJS.setFocus('#Cari_Outlet'); } }).send(); } }, Outlet_Comp: function(item){ $('#OutletID').val(item.value); } };