Files
ias/apps/js/repo/piutang.js
T
2026-01-22 15:30:17 +07:00

99 lines
3.7 KiB
JavaScript

/*******************************************************************
App. Name : Inventory Advanced Systems
Module : /apps/js/repo/piutang.js
Desc. : JS - Laporan Piutang Outlet
Created By : Siau Pheng ([email protected]).
Created Date : July 17th, 2011.
Last Modified : July 4th, 2023.
(c) 2011 - 2023, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoPiutangJS = {
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("Grup_OutletID");
cetak.add_param("SalesID");
cetak.add_param("Grup_InvID");
cetak.add_param("TipeDT");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt=='print') { cetak.doPrint(); } else cetak.doPreview();
},
proses_dload: function(){
var dload = new cEXPORT(this.PHP);
dload.add_param("data", "export");
dload.add_param("Tipe");
dload.add_param("OutletID");
dload.add_param("Grup_OutletID");
dload.add_param("SalesID");
dload.add_param("Grup_InvID");
dload.add_param("TipeDT");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
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">&nbsp;</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);
}
};