83 lines
3.2 KiB
JavaScript
83 lines
3.2 KiB
JavaScript
/*******************************************************************
|
|
|
|
App. Name : Inventory Advanced Systems
|
|
Module : /apps/js/repo/rekap_sales.php
|
|
Desc. : JS - Laporan R. Penjualan Produk/Sales
|
|
Created By : Siau Pheng ([email protected]).
|
|
Created Date : April 15th, 2011.
|
|
Last Modified : July 4th, 2023.
|
|
|
|
(c) 2011 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
|
|
|
*******************************************************************/
|
|
|
|
var RepoRekapSalesJS = {
|
|
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('Rekap');
|
|
cetak.add_param('SalesID');
|
|
cetak.add_param('OutletID');
|
|
cetak.add_param('Grup_InvID');
|
|
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('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Outlet" 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="divBrowOutlet"> </div>');
|
|
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);
|
|
}
|
|
|
|
};
|